From f1731f889d2eac881abc3f94a9945a1dd10021a7 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Mon, 8 Jan 2018 14:34:41 +0100 Subject: [PATCH 1/3] on account removal also disable contacts backup job remove unneeded function Signed-off-by: tobiasKaminsky --- .../com/owncloud/android/jobs/AccountRemovalJob.java | 9 +++++++++ .../ui/activity/ContactsPreferenceActivity.java | 11 ----------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/owncloud/android/jobs/AccountRemovalJob.java b/src/main/java/com/owncloud/android/jobs/AccountRemovalJob.java index b6ce79255a..68db8b0d4b 100644 --- a/src/main/java/com/owncloud/android/jobs/AccountRemovalJob.java +++ b/src/main/java/com/owncloud/android/jobs/AccountRemovalJob.java @@ -38,6 +38,7 @@ import com.owncloud.android.datamodel.FilesystemDataProvider; import com.owncloud.android.datamodel.SyncedFolder; import com.owncloud.android.datamodel.SyncedFolderProvider; import com.owncloud.android.datamodel.UploadsStorageManager; +import com.owncloud.android.ui.activity.ContactsPreferenceActivity; import com.owncloud.android.ui.events.AccountRemovedEvent; import com.owncloud.android.utils.FileStorageUtils; import com.owncloud.android.utils.FilesSyncHelper; @@ -67,7 +68,15 @@ public class AccountRemovalJob extends Job implements AccountManagerCallback jobs = jobManager.getAllJobRequestsForTag(ContactsBackupJob.TAG); - - for (JobRequest jobRequest : jobs) { - jobManager.cancel(jobRequest.getJobId()); - } - } - public static void cancelPreviousContactBackupJobForAccount(Context context, Account account) { Log_OC.d(TAG, "disabling existing contacts backup job for account: " + account.name); From 2655d6f87b3138029cecda3f12236396564ed5b5 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Mon, 8 Jan 2018 14:41:32 +0100 Subject: [PATCH 2/3] code enhancement Signed-off-by: tobiasKaminsky --- .../owncloud/android/jobs/AccountRemovalJob.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/owncloud/android/jobs/AccountRemovalJob.java b/src/main/java/com/owncloud/android/jobs/AccountRemovalJob.java index 68db8b0d4b..ce5892c9a9 100644 --- a/src/main/java/com/owncloud/android/jobs/AccountRemovalJob.java +++ b/src/main/java/com/owncloud/android/jobs/AccountRemovalJob.java @@ -66,17 +66,14 @@ public class AccountRemovalJob extends Job implements AccountManagerCallback Date: Tue, 9 Jan 2018 08:31:37 +0100 Subject: [PATCH 3/3] use cancelContactBackupJobForAccount to disable all backup jobs switched if branches, according to findBugs Signed-off-by: tobiaskaminsky --- .../java/com/owncloud/android/jobs/AccountRemovalJob.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/owncloud/android/jobs/AccountRemovalJob.java b/src/main/java/com/owncloud/android/jobs/AccountRemovalJob.java index ce5892c9a9..4edaf54f8d 100644 --- a/src/main/java/com/owncloud/android/jobs/AccountRemovalJob.java +++ b/src/main/java/com/owncloud/android/jobs/AccountRemovalJob.java @@ -68,11 +68,9 @@ public class AccountRemovalJob extends Job implements AccountManagerCallback