diff --git a/src/com/android/settings/accounts/AccountSyncSettings.java b/src/com/android/settings/accounts/AccountSyncSettings.java
index cbd8fee..b782ed8 100644
--- a/src/com/android/settings/accounts/AccountSyncSettings.java
+++ b/src/com/android/settings/accounts/AccountSyncSettings.java
@@ -50,8 +50,6 @@
 import android.view.MenuItem;
 import android.view.View;
 import android.view.ViewGroup;
-import android.view.View.OnClickListener;
-import android.widget.Button;
 import android.widget.ImageView;
 import android.widget.TextView;
 
@@ -74,17 +72,17 @@
     private TextView mProviderId;
     private ImageView mProviderIcon;
     private TextView mErrorInfoView;
-    protected View mRemoveAccountArea;
     private java.text.DateFormat mDateFormat;
     private java.text.DateFormat mTimeFormat;
     private Account mAccount;
     // List of all accounts, updated when accounts are added/removed
     // We need to re-scan the accounts on sync events, in case sync state changes.
     private Account[] mAccounts;
-    private Button mRemoveAccountButton;
     private ArrayList<SyncStateCheckBoxPreference> mCheckBoxes =
                 new ArrayList<SyncStateCheckBoxPreference>();
     private ArrayList<String> mInvisibleAdapters = Lists.newArrayList();
+    // Tell if we will use the current SyncManager data or just the User input
+    protected boolean mUseSyncManagerFeedsState = true;
 
     @Override
     public Dialog onCreateDialog(final int id) {
@@ -266,7 +264,7 @@
 
     @Override
     public boolean onPreferenceTreeClick(PreferenceScreen preferences, Preference preference) {
-        if (preference instanceof SyncStateCheckBoxPreference) {
+        if (preference instanceof SyncStateCheckBoxPreference && mUseSyncManagerFeedsState) {
             SyncStateCheckBoxPreference syncPref = (SyncStateCheckBoxPreference) preference;
             String authority = syncPref.getAuthority();
             Account account = syncPref.getAccount();
@@ -347,6 +345,10 @@
     @Override
     protected void onSyncStateUpdated() {
         if (!isResumed()) return;
+        setFeedsState(mUseSyncManagerFeedsState);
+    }
+
+    private void setFeedsState(boolean useSyncManager) {
         // iterate over all the preferences, setting the state properly for each
         Date date = new Date();
         List<SyncInfo> currentSyncs = ContentResolver.getCurrentSyncs();
@@ -365,49 +367,53 @@
             String authority = syncPref.getAuthority();
             Account account = syncPref.getAccount();
 
-            SyncStatusInfo status = ContentResolver.getSyncStatus(account, authority);
-            boolean syncEnabled = ContentResolver.getSyncAutomatically(account, authority);
-            boolean authorityIsPending = status == null ? false : status.pending;
-            boolean initialSync = status == null ? false : status.initialize;
+            if (useSyncManager) {
+                SyncStatusInfo status = ContentResolver.getSyncStatus(account, authority);
+                boolean syncEnabled = ContentResolver.getSyncAutomatically(account, authority);
+                boolean authorityIsPending = status == null ? false : status.pending;
+                boolean initialSync = status == null ? false : status.initialize;
 
-            boolean activelySyncing = isSyncing(currentSyncs, account, authority);
-            boolean lastSyncFailed = status != null
-                    && status.lastFailureTime != 0
-                    && status.getLastFailureMesgAsInt(0)
-                       != ContentResolver.SYNC_ERROR_SYNC_ALREADY_IN_PROGRESS;
-            if (!syncEnabled) lastSyncFailed = false;
-            if (lastSyncFailed && !activelySyncing && !authorityIsPending) {
-                syncIsFailing = true;
-            }
-            if (Log.isLoggable(TAG, Log.VERBOSE)) {
-                Log.d(TAG, "Update sync status: " + account + " " + authority +
-                        " active = " + activelySyncing + " pend =" +  authorityIsPending);
-            }
+                boolean activelySyncing = isSyncing(currentSyncs, account, authority);
+                boolean lastSyncFailed = status != null
+                        && status.lastFailureTime != 0
+                        && status.getLastFailureMesgAsInt(0)
+                           != ContentResolver.SYNC_ERROR_SYNC_ALREADY_IN_PROGRESS;
+                if (!syncEnabled) lastSyncFailed = false;
+                if (lastSyncFailed && !activelySyncing && !authorityIsPending) {
+                    syncIsFailing = true;
+                }
+                if (Log.isLoggable(TAG, Log.VERBOSE)) {
+                    Log.d(TAG, "Update sync status: " + account + " " + authority +
+                            " active = " + activelySyncing + " pend =" +  authorityIsPending);
+                }
 
-            final long successEndTime = (status == null) ? 0 : status.lastSuccessTime;
-            if (successEndTime != 0) {
-                date.setTime(successEndTime);
-                final String timeString = mDateFormat.format(date) + " "
-                        + mTimeFormat.format(date);
-                syncPref.setSummary(timeString);
+                final long successEndTime = (status == null) ? 0 : status.lastSuccessTime;
+                if (successEndTime != 0) {
+                    date.setTime(successEndTime);
+                    final String timeString = mDateFormat.format(date) + " "
+                            + mTimeFormat.format(date);
+                    syncPref.setSummary(timeString);
+                } else {
+                    syncPref.setSummary("");
+                }
+                int syncState = ContentResolver.getIsSyncable(account, authority);
+
+                syncPref.setActive(activelySyncing && (syncState >= 0) &&
+                        !initialSync);
+                syncPref.setPending(authorityIsPending && (syncState >= 0) &&
+                        !initialSync);
+
+                syncPref.setFailed(lastSyncFailed);
+                ConnectivityManager connManager =
+                    (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
+                final boolean masterSyncAutomatically = ContentResolver.getMasterSyncAutomatically();
+                final boolean backgroundDataEnabled = connManager.getBackgroundDataSetting();
+                final boolean oneTimeSyncMode = !masterSyncAutomatically || !backgroundDataEnabled;
+                syncPref.setOneTimeSyncMode(oneTimeSyncMode);
+                syncPref.setChecked(oneTimeSyncMode || syncEnabled);
             } else {
-                syncPref.setSummary("");
+                syncPref.setChecked(true);
             }
-            int syncState = ContentResolver.getIsSyncable(account, authority);
-
-            syncPref.setActive(activelySyncing && (syncState >= 0) &&
-                    !initialSync);
-            syncPref.setPending(authorityIsPending && (syncState >= 0) &&
-                    !initialSync);
-
-            syncPref.setFailed(lastSyncFailed);
-            ConnectivityManager connManager =
-                (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
-            final boolean masterSyncAutomatically = ContentResolver.getMasterSyncAutomatically();
-            final boolean backgroundDataEnabled = connManager.getBackgroundDataSetting();
-            final boolean oneTimeSyncMode = !masterSyncAutomatically || !backgroundDataEnabled;
-            syncPref.setOneTimeSyncMode(oneTimeSyncMode);
-            syncPref.setChecked(oneTimeSyncMode || syncEnabled);
         }
         mErrorInfoView.setVisibility(syncIsFailing ? View.VISIBLE : View.GONE);
         getActivity().invalidateOptionsMenu();
diff --git a/src/com/android/settings/accounts/AccountSyncSettingsInAddAccount.java b/src/com/android/settings/accounts/AccountSyncSettingsInAddAccount.java
index 8fa576a..5b3af83 100644
--- a/src/com/android/settings/accounts/AccountSyncSettingsInAddAccount.java
+++ b/src/com/android/settings/accounts/AccountSyncSettingsInAddAccount.java
@@ -1,11 +1,11 @@
 
 package com.android.settings.accounts;
 
+import android.accounts.Account;
+import android.content.ContentResolver;
+import android.preference.Preference;
 import com.android.settings.R;
 
-import android.app.Activity;
-import android.content.ContentResolver;
-import android.os.Bundle;
 import android.view.Menu;
 import android.view.View;
 import android.view.View.OnClickListener;
@@ -27,6 +27,8 @@
         mFinishArea.setVisibility(View.VISIBLE);
         mFinishButton = (View) rootView.findViewById(R.id.finish_button);
         mFinishButton.setOnClickListener(this);
+
+        mUseSyncManagerFeedsState = false;
     }
 
     @Override
@@ -37,6 +39,22 @@
     }
 
     public void onClick(View v) {
+        applySyncSettingsToSyncManager();
         finish();
     }
+
+    private void applySyncSettingsToSyncManager() {
+        for (int i = 0, count = getPreferenceScreen().getPreferenceCount(); i < count; i++) {
+            Preference pref = getPreferenceScreen().getPreference(i);
+            if (! (pref instanceof SyncStateCheckBoxPreference)) {
+                continue;
+            }
+            SyncStateCheckBoxPreference syncPref = (SyncStateCheckBoxPreference) pref;
+
+            String authority = syncPref.getAuthority();
+            Account account = syncPref.getAccount();
+
+            ContentResolver.setSyncAutomatically(account, authority, syncPref.isChecked());
+        }
+    }
 }
