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:
tobiaskaminsky 2018-01-09 08:31:37 +01:00
parent 2655d6f87b
commit 2b0dd3209c
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

View file

@ -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;
}
}