mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 09:39:25 +03:00
use cancelContactBackupJobForAccount to disable all backup jobs
switched if branches, according to findBugs Signed-off-by: tobiaskaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
2655d6f87b
commit
2b0dd3209c
1 changed files with 4 additions and 4 deletions
|
@ -68,11 +68,9 @@ public class AccountRemovalJob extends Job implements AccountManagerCallback<Boo
|
|||
Account account = AccountUtils.getOwnCloudAccountByName(context, bundle.getString(ACCOUNT, ""));
|
||||
AccountManager am = (AccountManager) context.getSystemService(ACCOUNT_SERVICE);
|
||||
|
||||
if (account == null || am == null) {
|
||||
return Result.FAILURE;
|
||||
} else {
|
||||
if (account != null && am != null) {
|
||||
// disable contact backup job
|
||||
ContactsPreferenceActivity.cancelPreviousContactBackupJobForAccount(context, account);
|
||||
ContactsPreferenceActivity.cancelContactBackupJobForAccount(context, account);
|
||||
|
||||
am.removeAccount(account, this, null);
|
||||
|
||||
|
@ -118,6 +116,8 @@ public class AccountRemovalJob extends Job implements AccountManagerCallback<Boo
|
|||
}
|
||||
|
||||
return Result.SUCCESS;
|
||||
} else {
|
||||
return Result.FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue