From 584ed8b82c313ca5194353cceded2149e1b7e2c3 Mon Sep 17 00:00:00 2001 From: alperozturk Date: Thu, 21 Dec 2023 15:53:07 +0100 Subject: [PATCH] Remove Download Service Connections Signed-off-by: alperozturk --- .../com/owncloud/android/ui/activity/FileActivity.java | 9 ++------- .../android/ui/activity/ManageAccountsActivity.java | 10 ---------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/ui/activity/FileActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/FileActivity.java index 2a89b567e764..e36c0e9ed2ca 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/FileActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/FileActivity.java @@ -168,7 +168,6 @@ public abstract class FileActivity extends DrawerActivity protected FilesDownloadWorker.FileDownloaderBinder mDownloaderBinder; protected FileUploaderBinder mUploaderBinder; - private ServiceConnection mDownloadServiceConnection; private ServiceConnection mUploadServiceConnection; @Inject @@ -234,10 +233,10 @@ protected void onCreate(Bundle savedInstanceState) { bindService(new Intent(this, OperationsService.class), mOperationsServiceConnection, Context.BIND_AUTO_CREATE); - mDownloadServiceConnection = newTransferenceServiceConnection(); - if (mDownloadServiceConnection != null && user != null) { + if (user != null) { new FilesDownloadHelper().downloadFile(user, mFile); } + mUploadServiceConnection = newTransferenceServiceConnection(); if (mUploadServiceConnection != null) { bindService(new Intent(this, FileUploader.class), mUploadServiceConnection, @@ -281,10 +280,6 @@ protected void onDestroy() { unbindService(mOperationsServiceConnection); mOperationsServiceBinder = null; } - if (mDownloadServiceConnection != null) { - unbindService(mDownloadServiceConnection); - mDownloadServiceConnection = null; - } if (mUploadServiceConnection != null) { unbindService(mUploadServiceConnection); mUploadServiceConnection = null; diff --git a/app/src/main/java/com/owncloud/android/ui/activity/ManageAccountsActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/ManageAccountsActivity.java index 1cd495dfee49..24622e11414a 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/ManageAccountsActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/ManageAccountsActivity.java @@ -105,7 +105,6 @@ public class ManageAccountsActivity extends FileActivity implements UserListAdap private final Handler handler = new Handler(); private String accountName; private UserListAdapter userListAdapter; - private ServiceConnection downloadServiceConnection; private ServiceConnection uploadServiceConnection; private Set originalUsers; private String originalCurrentUser; @@ -241,11 +240,6 @@ private boolean hasCurrentAccountChanged() { * Initialize ComponentsGetters. */ private void initializeComponentGetters() { - downloadServiceConnection = newTransferenceServiceConnection(); - if (downloadServiceConnection != null) { - // FIXME check this usage - // bindService(new Intent(this, FileDownloader.class), downloadServiceConnection, Context.BIND_AUTO_CREATE); - } uploadServiceConnection = newTransferenceServiceConnection(); if (uploadServiceConnection != null) { bindService(new Intent(this, FileUploader.class), uploadServiceConnection, @@ -374,10 +368,6 @@ public void run(AccountManagerFuture future) { @Override protected void onDestroy() { - if (downloadServiceConnection != null) { - unbindService(downloadServiceConnection); - downloadServiceConnection = null; - } if (uploadServiceConnection != null) { unbindService(uploadServiceConnection); uploadServiceConnection = null;