Skip to content

Commit

Permalink
Remove Download Service Connections
Browse files Browse the repository at this point in the history
Signed-off-by: alperozturk <[email protected]>
  • Loading branch information
alperozturk96 committed Dec 26, 2023
1 parent ba35038 commit eae1f08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ public abstract class FileActivity extends DrawerActivity

protected FilesDownloadWorker.FileDownloaderBinder mDownloaderBinder;
protected FileUploaderBinder mUploaderBinder;
private ServiceConnection mDownloadServiceConnection;
private ServiceConnection mUploadServiceConnection;

@Inject
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> originalUsers;
private String originalCurrentUser;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -374,10 +368,6 @@ public void run(AccountManagerFuture<Boolean> future) {

@Override
protected void onDestroy() {
if (downloadServiceConnection != null) {
unbindService(downloadServiceConnection);
downloadServiceConnection = null;
}
if (uploadServiceConnection != null) {
unbindService(uploadServiceConnection);
uploadServiceConnection = null;
Expand Down

0 comments on commit eae1f08

Please sign in to comment.