|
@@ -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<Boo
|
|
|
Account account = AccountUtils.getOwnCloudAccountByName(context, bundle.getString(ACCOUNT, ""));
|
|
|
|
|
|
if (account != null ) {
|
|
|
+ // disable contact backup job
|
|
|
+ ContactsPreferenceActivity.cancelPreviousContactBackupJobForAccount(context, account);
|
|
|
+
|
|
|
AccountManager am = (AccountManager) context.getSystemService(ACCOUNT_SERVICE);
|
|
|
+
|
|
|
+ if (am == null) {
|
|
|
+ return Result.FAILURE;
|
|
|
+ }
|
|
|
+
|
|
|
am.removeAccount(account, this, null);
|
|
|
|
|
|
FileDataStorageManager storageManager = new FileDataStorageManager(account, context.getContentResolver());
|