diff --git a/CHANGELOG.md b/CHANGELOG.md index 04bc26dd349..67e3bdd9838 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ ownCloud admins and users. ## Summary * Change - Upgrade minimum SDK version to Android 7.0 (v24): [#4230](https://github.com/owncloud/android/issues/4230) +* Change - Automatic discovery of the account in login: [#4301](https://github.com/owncloud/android/issues/4301) * Enhancement - New setting for automatic removal of local files: [#4175](https://github.com/owncloud/android/issues/4175) * Enhancement - Unit tests for repository classes - Part 1: [#4232](https://github.com/owncloud/android/issues/4232) @@ -43,6 +44,14 @@ ownCloud admins and users. https://github.com/owncloud/android/issues/4230 https://github.com/owncloud/android/pull/4299 +* Change - Automatic discovery of the account in login: [#4301](https://github.com/owncloud/android/issues/4301) + + Automatic account discovery is done at login. Removed the refresh account button + in the Manage Accounts view. + + https://github.com/owncloud/android/issues/4301 + https://github.com/owncloud/android/pull/4325 + * Enhancement - New setting for automatic removal of local files: [#4175](https://github.com/owncloud/android/issues/4175) A new setting has been created to delete automatically downloaded files, when diff --git a/changelog/unreleased/4325 b/changelog/unreleased/4325 new file mode 100644 index 00000000000..6ecd1a53065 --- /dev/null +++ b/changelog/unreleased/4325 @@ -0,0 +1,6 @@ +Change: Automatic discovery of the account in login + +Automatic account discovery is done at login. Removed the refresh account button in the Manage Accounts view. + +https://github.com/owncloud/android/issues/4301 +https://github.com/owncloud/android/pull/4325 diff --git a/owncloudApp/src/main/java/com/owncloud/android/presentation/accounts/AccountsManagementActivity.kt b/owncloudApp/src/main/java/com/owncloud/android/presentation/accounts/AccountsManagementActivity.kt index dffb9937bb9..3399a252113 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/presentation/accounts/AccountsManagementActivity.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/presentation/accounts/AccountsManagementActivity.kt @@ -25,15 +25,12 @@ import android.accounts.AccountManager import android.accounts.AccountManagerCallback import android.accounts.AccountManagerFuture import android.accounts.OperationCanceledException -import android.content.ContentResolver import android.content.Intent -import android.content.SyncRequest import android.os.Bundle import android.view.MenuItem import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import com.owncloud.android.MainApp.Companion.accountType -import com.owncloud.android.MainApp.Companion.authority import com.owncloud.android.MainApp.Companion.initDependencyInjection import com.owncloud.android.R import com.owncloud.android.presentation.accounts.RemoveAccountDialogFragment.Companion.newInstance @@ -187,25 +184,6 @@ class AccountsManagementActivity : FileActivity(), AccountsManagementAdapter.Acc startActivity(updateAccountCredentials) } - override fun refreshAccount(account: Account) { - Timber.d("Got to start sync") - Timber.d("Requesting sync for " + account.name + " at " + authority + " with new API") - val builder = SyncRequest.Builder() - builder.setSyncAdapter(account, authority) - builder.setExpedited(true) - builder.setManual(true) - builder.syncOnce() - - // Fix bug in Android Lollipop when you click on refresh the whole account - val extras = Bundle() - builder.setExtras(extras) - - val request = builder.build() - ContentResolver.requestSync(request) - - showSnackMessage(getString(R.string.synchronizing_account)) - } - override fun createAccount() { val am = AccountManager.get(applicationContext) am.addAccount( diff --git a/owncloudApp/src/main/java/com/owncloud/android/presentation/accounts/AccountsManagementAdapter.kt b/owncloudApp/src/main/java/com/owncloud/android/presentation/accounts/AccountsManagementAdapter.kt index 25091e51730..6e81d385b7c 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/presentation/accounts/AccountsManagementAdapter.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/presentation/accounts/AccountsManagementAdapter.kt @@ -2,8 +2,9 @@ * ownCloud Android client application * * @author Javier Rodríguez Pérez + * @author Aitor Ballesteros Pavón * - * Copyright (C) 2022 ownCloud GmbH. + * Copyright (C) 2024 ownCloud GmbH. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -99,12 +100,6 @@ class AccountsManagementAdapter(private val accountListener: AccountAdapterListe holder.binding.ticker.visibility = View.INVISIBLE } - /// bind listener to refresh account - holder.binding.refreshAccountButton.apply { - setImageResource(R.drawable.ic_action_refresh) - setOnClickListener { accountListener.refreshAccount(account) } - } - /// bind listener to change password holder.binding.passwordButton.apply { setImageResource(R.drawable.ic_key) @@ -169,7 +164,6 @@ class AccountsManagementAdapter(private val accountListener: AccountAdapterListe interface AccountAdapterListener { fun removeAccount(account: Account) fun changePasswordOfAccount(account: Account) - fun refreshAccount(account: Account) fun createAccount() fun switchAccount(position: Int) } diff --git a/owncloudApp/src/main/java/com/owncloud/android/presentation/releasenotes/ReleaseNotesViewModel.kt b/owncloudApp/src/main/java/com/owncloud/android/presentation/releasenotes/ReleaseNotesViewModel.kt index f23d1aa15f2..50ad138bc28 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/presentation/releasenotes/ReleaseNotesViewModel.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/presentation/releasenotes/ReleaseNotesViewModel.kt @@ -50,6 +50,11 @@ class ReleaseNotesViewModel( subtitle = R.string.release_notes_4_3_0_subtitle_1, type = ReleaseNoteType.ENHANCEMENT, ), + ReleaseNote( + title = R.string.release_notes_4_3_0_title_2, + subtitle = R.string.release_notes_4_3_0_subtitle_2, + type = ReleaseNoteType.ENHANCEMENT, + ), ) } } diff --git a/owncloudApp/src/main/java/com/owncloud/android/workers/AccountDiscoveryWorker.kt b/owncloudApp/src/main/java/com/owncloud/android/workers/AccountDiscoveryWorker.kt index 4f04b576e61..3c16686113a 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/workers/AccountDiscoveryWorker.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/workers/AccountDiscoveryWorker.kt @@ -3,8 +3,9 @@ * * @author Abel García de Prada * @author Juan Carlos Garrote Gascón + * @author Aitor Ballesteros Pavón * - * Copyright (C) 2023 ownCloud GmbH. + * Copyright (C) 2024 ownCloud GmbH. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -112,7 +113,7 @@ class AccountDiscoveryWorker( accountName = folder.owner, remotePath = folder.remotePath, spaceId = folder.spaceId, - syncMode = SynchronizeFolderUseCase.SyncFolderMode.REFRESH_FOLDER + syncMode = SynchronizeFolderUseCase.SyncFolderMode.REFRESH_FOLDER_RECURSIVELY ) ) } diff --git a/owncloudApp/src/main/res/layout/account_item.xml b/owncloudApp/src/main/res/layout/account_item.xml index ced54273d1d..e068406b281 100644 --- a/owncloudApp/src/main/res/layout/account_item.xml +++ b/owncloudApp/src/main/res/layout/account_item.xml @@ -78,25 +78,6 @@ app:layout_constraintStart_toEndOf="@id/ticker" app:layout_constraintTop_toBottomOf="@id/name" /> - - New setting to remove automatically downloaded files that were not used for a certain time A new setting has been added in "Advanced" section to delete automatically downloaded files, when the time since their last usage exceeds the selected time in the setting + Automatic discovery of the account in login + Removed the account refresh button in the Manage Accounts view, as automatic account discovery is done at login Open in web