Code cleanup for enable and disable google sync

This commit is contained in:
Jimmy Shih
2014-01-08 14:05:31 -08:00
parent 071e33719e
commit 7f124aa76b
6 changed files with 49 additions and 55 deletions
@@ -50,7 +50,6 @@ import android.accounts.AccountManagerFuture;
import android.accounts.AuthenticatorException;
import android.accounts.OperationCanceledException;
import android.app.Activity;
import android.content.ContentResolver;
import android.content.Intent;
import android.os.Bundle;
import android.os.Parcelable;
@@ -343,16 +342,7 @@ public abstract class AbstractSendToGoogleActivity extends AbstractMyTracksActiv
Class<?> next;
if (sendRequest.isSendDrive()) {
if (sendRequest.isDriveSync()) {
PreferencesUtils.setBoolean(this, R.string.drive_sync_key, true);
// Turn off everything
SyncUtils.disableSync(this);
// Turn on sync
ContentResolver.setMasterSyncAutomatically(true);
// Enable sync for account
SyncUtils.enableSync(sendRequest.getAccount());
SyncUtils.enableSync(this);
return;
} else {
next = SendDriveActivity.class;