diff --git a/src/com/android/settings/DataUsageSummary.java b/src/com/android/settings/DataUsageSummary.java
index dbef6cb..bdae072 100644
--- a/src/com/android/settings/DataUsageSummary.java
+++ b/src/com/android/settings/DataUsageSummary.java
@@ -489,6 +489,7 @@
                 hasReadyMobileRadio(context) && isOwner && !appDetailMode);
         mMenuRestrictBackground.setChecked(mPolicyManager.getRestrictBackground());
 
+        // TODO: Define behavior of this sync button. See: http://b/16076571
         mMenuAutoSync = menu.findItem(R.id.data_usage_menu_auto_sync);
         mMenuAutoSync.setChecked(ContentResolver.getMasterSyncAutomatically());
         mMenuAutoSync.setVisible(!appDetailMode);
diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index 895e9ea..01149f3 100644
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -69,6 +69,7 @@
     public static class PowerUsageSummaryActivity extends SettingsActivity { /* empty */ }
     public static class BatterySaverSettingsActivity extends SettingsActivity { /* empty */ }
     public static class AccountSyncSettingsActivity extends SettingsActivity { /* empty */ }
+    public static class AccountSettingsActivity extends SettingsActivity { /* empty */ }
     public static class AccountSyncSettingsInAddAccountActivity extends SettingsActivity { /* empty */ }
     public static class CryptKeeperSettingsActivity extends SettingsActivity { /* empty */ }
     public static class DeviceAdminSettingsActivity extends SettingsActivity { /* empty */ }
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index 751d478..90abf0a 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -66,6 +66,7 @@
 import com.android.internal.util.XmlUtils;
 import com.android.settings.accessibility.AccessibilitySettings;
 import com.android.settings.accessibility.CaptionPropertiesFragment;
+import com.android.settings.accounts.AccountSettings;
 import com.android.settings.accounts.AccountSyncSettings;
 import com.android.settings.applications.InstalledAppDetails;
 import com.android.settings.applications.ManageApplications;
@@ -262,6 +263,7 @@
             WifiDisplaySettings.class.getName(),
             PowerUsageSummary.class.getName(),
             AccountSyncSettings.class.getName(),
+            AccountSettings.class.getName(),
             CryptKeeperSettings.class.getName(),
             DataUsageSummary.class.getName(),
             DreamSettings.class.getName(),
diff --git a/src/com/android/settings/accounts/AccountSettings.java b/src/com/android/settings/accounts/AccountSettings.java
index 13878d7..88f47bc 100644
--- a/src/com/android/settings/accounts/AccountSettings.java
+++ b/src/com/android/settings/accounts/AccountSettings.java
@@ -19,7 +19,9 @@
 
 import android.accounts.Account;
 import android.accounts.AccountManager;
+import android.app.ActivityManager;
 import android.content.BroadcastReceiver;
+import android.content.ContentResolver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
@@ -29,7 +31,11 @@
 import android.os.UserManager;
 import android.util.Log;
 import android.util.SparseArray;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
 import android.preference.Preference;
+import android.preference.Preference.OnPreferenceChangeListener;
 import android.preference.Preference.OnPreferenceClickListener;
 import android.preference.PreferenceGroup;
 
@@ -54,7 +60,6 @@
         implements AuthenticatorHelper.OnAccountsUpdateListener,
         OnPreferenceClickListener {
     public static final String TAG = "AccountSettings";
-
     private static final String KEY_ACCOUNT = "account";
     private static final String KEY_ADD_ACCOUNT = "add_account";
 
@@ -68,6 +73,7 @@
     private UserManager mUm;
     private SparseArray<ProfileData> mProfiles;
     private ManagedProfileBroadcastReceiver mManagedProfileBroadcastReceiver;
+    private boolean mIsSingleProfileUi = true;
 
     /**
      * Holds data related to the accounts belonging to one profile.
@@ -97,6 +103,50 @@
         mUm = (UserManager) getSystemService(Context.USER_SERVICE);
         mProfiles = new SparseArray<ProfileData>(2);
         updateUi();
+        setHasOptionsMenu(true);
+    }
+
+    @Override
+    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+        inflater.inflate(R.menu.account_settings, menu);
+        final UserHandle currentProfile = UserHandle.getCallingUserHandle();
+        if (mIsSingleProfileUi) {
+            menu.findItem(R.id.account_settings_menu_auto_sync)
+                    .setVisible(true)
+                    .setOnMenuItemClickListener(new MasterSyncStateClickListener(currentProfile));
+            menu.removeItem(R.id.account_settings_menu_auto_sync_personal);
+            menu.removeItem(R.id.account_settings_menu_auto_sync_work);
+        } else {
+            final UserHandle managedProfile = Utils.getManagedProfile(mUm);
+
+            menu.findItem(R.id.account_settings_menu_auto_sync_personal)
+                    .setVisible(true)
+                    .setOnMenuItemClickListener(new MasterSyncStateClickListener(currentProfile));
+            menu.findItem(R.id.account_settings_menu_auto_sync_work)
+                    .setVisible(true)
+                    .setOnMenuItemClickListener(new MasterSyncStateClickListener(managedProfile));
+            menu.removeItem(R.id.account_settings_menu_auto_sync);
+        }
+        super.onCreateOptionsMenu(menu, inflater);
+    }
+
+    @Override
+    public void onPrepareOptionsMenu(Menu menu) {
+        final UserHandle currentProfile = UserHandle.getCallingUserHandle();
+        if (mIsSingleProfileUi) {
+            menu.findItem(R.id.account_settings_menu_auto_sync)
+                    .setChecked(ContentResolver.getMasterSyncAutomaticallyAsUser(
+                            currentProfile.getIdentifier()));
+        } else {
+            final UserHandle managedProfile = Utils.getManagedProfile(mUm);
+
+            menu.findItem(R.id.account_settings_menu_auto_sync_personal)
+                    .setChecked(ContentResolver.getMasterSyncAutomaticallyAsUser(
+                            currentProfile.getIdentifier()));
+            menu.findItem(R.id.account_settings_menu_auto_sync_work)
+                    .setChecked(ContentResolver.getMasterSyncAutomaticallyAsUser(
+                            managedProfile.getIdentifier()));
+            }
     }
 
     void updateUi() {
@@ -117,12 +167,13 @@
             if (managedProfile == null) {
                 updateSingleProfileUi();
             } else {
-                updateProfileUi(currentProfile,
-                        KEY_CATEGORY_PERSONAL, KEY_ADD_ACCOUNT_PERSONAL, new ArrayList<String>());
-                final ArrayList<String> unusedPreferences = new ArrayList<String>(1);
+                mIsSingleProfileUi = false;
+                updateProfileUi(currentProfile, KEY_CATEGORY_PERSONAL, KEY_ADD_ACCOUNT_PERSONAL,
+                        new ArrayList<String>());
+                final ArrayList<String> unusedPreferences = new ArrayList<String>(2);
                 unusedPreferences.add(KEY_ADD_ACCOUNT);
-                updateProfileUi(managedProfile,
-                        KEY_CATEGORY_WORK, KEY_ADD_ACCOUNT_WORK, unusedPreferences);
+                updateProfileUi(managedProfile, KEY_CATEGORY_WORK, KEY_ADD_ACCOUNT_WORK,
+                        unusedPreferences);
                 mManagedProfileBroadcastReceiver = new ManagedProfileBroadcastReceiver();
                 mManagedProfileBroadcastReceiver.register(getActivity());
             }
@@ -141,8 +192,8 @@
                 unusedPreferences);
     }
 
-    private void updateProfileUi(UserHandle userHandle, String categoryKey, String addAccountKey,
-            ArrayList<String> unusedPreferences) {
+    private void updateProfileUi(final UserHandle userHandle, String categoryKey,
+            String addAccountKey, ArrayList<String> unusedPreferences) {
         final int count = unusedPreferences.size();
         for (int i = 0; i < count; i++) {
             removePreference(unusedPreferences.get(i));
@@ -345,6 +396,28 @@
             }
         }
     }
+
+    private class MasterSyncStateClickListener implements MenuItem.OnMenuItemClickListener {
+        private final UserHandle mUserHandle;
+
+        public MasterSyncStateClickListener(UserHandle userHandle) {
+            mUserHandle = userHandle;
+        }
+
+        @Override
+        public boolean onMenuItemClick(MenuItem item) {
+            // TODO: Add confirmation dialogs. See: http://b/16076571
+            if (ActivityManager.isUserAMonkey()) {
+                Log.d(TAG, "ignoring monkey's attempt to flip sync state");
+            } else {
+                boolean newSyncState = !item.isChecked();
+                item.setChecked(newSyncState);
+                ContentResolver.setMasterSyncAutomaticallyAsUser(newSyncState,
+                        mUserHandle.getIdentifier());
+            }
+            return true;
+        }
+    }
     // TODO Implement a {@link SearchIndexProvider} to allow Indexing and Search of account types
     // See http://b/15403806
 }
diff --git a/src/com/android/settings/accounts/SyncSettings.java b/src/com/android/settings/accounts/SyncSettings.java
deleted file mode 100644
index 3248113..0000000
--- a/src/com/android/settings/accounts/SyncSettings.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.settings.accounts;
-
-import android.accounts.Account;
-import android.accounts.AccountManager;
-import android.accounts.OnAccountsUpdateListener;
-import android.app.Activity;
-import android.app.ActivityManager;
-import android.content.ContentResolver;
-import android.content.Intent;
-import android.graphics.drawable.Drawable;
-import android.os.Bundle;
-import android.preference.CheckBoxPreference;
-import android.preference.Preference;
-import android.preference.Preference.OnPreferenceChangeListener;
-import android.preference.PreferenceScreen;
-import android.util.Log;
-
-import com.android.settings.AccountPreference;
-import com.android.settings.DialogCreatable;
-import com.android.settings.R;
-
-import java.util.ArrayList;
-
-public class SyncSettings extends AccountPreferenceBase
-        implements OnAccountsUpdateListener, DialogCreatable {
-
-    private static final String KEY_SYNC_SWITCH = "sync_switch";
-
-    private String[] mAuthorities;
-
-    private SettingsDialogFragment mDialogFragment;
-    private CheckBoxPreference mAutoSyncPreference;
-
-    @Override
-    public void onCreate(Bundle icicle) {
-        super.onCreate(icicle);
-
-        addPreferencesFromResource(R.xml.sync_settings);
-        mAutoSyncPreference =
-                (CheckBoxPreference) getPreferenceScreen().findPreference(KEY_SYNC_SWITCH);
-        mAutoSyncPreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
-            @Override
-            public boolean onPreferenceChange(Preference preference, Object newValue) {
-                if (ActivityManager.isUserAMonkey()) {
-                    Log.d("SyncSettings", "ignoring monkey's attempt to flip sync state");
-                } else {
-                    ContentResolver.setMasterSyncAutomatically((Boolean) newValue);
-                }
-                return true;
-            }
-        });
-
-        setHasOptionsMenu(true);
-    }
-
-    @Override
-    public void onStart() {
-        super.onStart();
-        Activity activity = getActivity();
-        AccountManager.get(activity).addOnAccountsUpdatedListener(this, null, true);
-    }
-
-    @Override
-    public void onActivityCreated(Bundle savedInstanceState) {
-        super.onActivityCreated(savedInstanceState);
-
-        final Activity activity = getActivity();
-        mAutoSyncPreference.setChecked(ContentResolver.getMasterSyncAutomatically());
-        mAuthorities = activity.getIntent().getStringArrayExtra(AUTHORITIES_FILTER_KEY);
-
-        updateAuthDescriptions();
-    }
-
-    @Override
-    public void onStop() {
-        super.onStop();
-        final Activity activity = getActivity();
-        AccountManager.get(activity).removeOnAccountsUpdatedListener(this);
-    }
-
-    @Override
-    public boolean onPreferenceTreeClick(PreferenceScreen preferences, Preference preference) {
-        if (preference instanceof AccountPreference) {
-            startAccountSettings((AccountPreference) preference);
-        } else {
-            return false;
-        }
-        return true;
-    }
-
-    private void startAccountSettings(AccountPreference acctPref) {
-        Intent intent = new Intent("android.settings.ACCOUNT_SYNC_SETTINGS");
-        intent.putExtra(AccountSyncSettings.ACCOUNT_KEY, acctPref.getAccount());
-        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-        startActivity(intent);
-        finish();
-    }
-
-    @Override
-    public void showDialog(int dialogId) {
-        if (mDialogFragment != null) {
-            Log.e(TAG, "Old dialog fragment not null!");
-        }
-        mDialogFragment = new SettingsDialogFragment(this, dialogId);
-        mDialogFragment.show(getActivity().getFragmentManager(), Integer.toString(dialogId));
-    }
-
-    private void removeAccountPreferences() {
-        PreferenceScreen parent = getPreferenceScreen();
-        for (int i = 0; i < parent.getPreferenceCount(); ) {
-            if (parent.getPreference(i) instanceof AccountPreference) {
-                parent.removePreference(parent.getPreference(i));
-            } else {
-                i++;
-            }
-        }
-    }
-
-    @Override
-    public void onAccountsUpdated(Account[] accounts) {
-        if (getActivity() == null) return;
-
-        removeAccountPreferences();
-        for (int i = 0, n = accounts.length; i < n; i++) {
-            final Account account = accounts[i];
-            final ArrayList<String> auths = getAuthoritiesForAccountType(account.type);
-
-            boolean showAccount = true;
-            if (mAuthorities != null && auths != null) {
-                showAccount = false;
-                for (String requestedAuthority : mAuthorities) {
-                    if (auths.contains(requestedAuthority)) {
-                        showAccount = true;
-                        break;
-                    }
-                }
-            }
-
-            if (showAccount) {
-                final Drawable icon = getDrawableForType(account.type);
-                final AccountPreference preference =
-                        new AccountPreference(getActivity(), account, icon, auths, true);
-                getPreferenceScreen().addPreference(preference);
-                preference.setSummary(getLabelForType(account.type));
-            }
-        }
-        onSyncStateUpdated();
-    }
-
-    @Override
-    protected void onAuthDescriptionsUpdated() {
-        // Update account icons for all account preference items
-        for (int i = 0; i < getPreferenceScreen().getPreferenceCount(); i++) {
-            Preference pref = getPreferenceScreen().getPreference(i);
-            if (pref instanceof AccountPreference) {
-                AccountPreference accPref = (AccountPreference)
-                        getPreferenceScreen().getPreference(i);
-                accPref.setIcon(getDrawableForType(accPref.getAccount().type));
-                accPref.setSummary(getLabelForType(accPref.getAccount().type));
-            }
-        }
-    }
-}
diff --git a/src/com/android/settings/accounts/SyncSettingsActivity.java b/src/com/android/settings/accounts/SyncSettingsActivity.java
deleted file mode 100644
index 014c24d..0000000
--- a/src/com/android/settings/accounts/SyncSettingsActivity.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.settings.accounts;
-
-import android.content.Intent;
-
-import com.android.settings.SettingsActivity;
-
-/**
- * Launcher activity for the SyncSettings fragment.
- *
- */
-public class SyncSettingsActivity extends SettingsActivity {
-    @Override
-    public Intent getIntent() {
-        Intent modIntent = new Intent(super.getIntent());
-        modIntent.putExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT, SyncSettings.class.getName());
-        return modIntent;
-    }
-
-    @Override
-    protected boolean isValidFragment(String fragmentName) {
-        if (SyncSettings.class.getName().equals(fragmentName)) return true;
-        return false;
-    }
-}
\ No newline at end of file
