Bug 1398283 - Clean up Sync Preferences screen r=nalexander draft
authorGrigory Kruglov <gkruglov@mozilla.com>
Tue, 19 Sep 2017 14:11:53 -0400
changeset 667129 8cb32592ee62d0b797f1288e66897d034f87ecc9
parent 666525 cc0d4711a0f4d38980a67ed64054cf96b5683a1b
child 732297 8c79e053ba55df624c7d4fa808c08c03382b5c42
push id80614
push userbmo:gkruglov@mozilla.com
push dateTue, 19 Sep 2017 18:12:34 +0000
reviewersnalexander
bugs1398283
milestone57.0a1
Bug 1398283 - Clean up Sync Preferences screen r=nalexander MozReview-Commit-ID: GfdBBT2cSh7
mobile/android/base/locales/en-US/sync_strings.dtd
mobile/android/services/src/main/java/org/mozilla/gecko/fxa/activities/FxAccountStatusFragment.java
mobile/android/services/src/main/res/layout/fxaccount_status_error_preference.xml
mobile/android/services/src/main/res/xml/fxaccount_status_prefscreen.xml
mobile/android/services/strings.xml.in
--- a/mobile/android/base/locales/en-US/sync_strings.dtd
+++ b/mobile/android/base/locales/en-US/sync_strings.dtd
@@ -46,43 +46,40 @@
      Firefox. -->
 <!ENTITY fxaccount_back_to_browsing 'Back to browsing'>
 
 <!ENTITY fxaccount_getting_started_welcome_to_sync 'Welcome to &syncBrand.shortName.label;'>
 <!ENTITY fxaccount_getting_started_description2 'Sign in to sync your tabs, bookmarks, logins &amp; more.'>
 <!ENTITY fxaccount_getting_started_get_started 'Get started'>
 <!ENTITY fxaccount_getting_started_old_firefox 'Using an older version of &syncBrand.shortName.label;?'>
 
-<!ENTITY fxaccount_status_signed_in_as 'Signed in as'>
-<!ENTITY fxaccount_status_manage_account 'Manage account'>
 <!ENTITY fxaccount_status_auth_server 'Account server'>
 <!ENTITY fxaccount_status_sync_now 'Sync now'>
 <!ENTITY fxaccount_status_syncing2 'Syncing…'>
 <!ENTITY fxaccount_status_device_name 'Device name'>
 <!ENTITY fxaccount_status_sync_server 'Sync server'>
-<!ENTITY fxaccount_status_sync '&syncBrand.shortName.label;'>
-<!ENTITY fxaccount_status_sync_enabled '&syncBrand.shortName.label;: enabled'>
 <!ENTITY fxaccount_status_needs_verification2 'Your account needs to be verified. Tap to resend verification email.'>
 <!ENTITY fxaccount_status_needs_credentials 'Cannot connect. Tap to sign in.'>
 <!ENTITY fxaccount_status_needs_upgrade 'You need to upgrade &brandShortName; to sign in.'>
 <!ENTITY fxaccount_status_needs_master_sync_automatically_enabled '&syncBrand.shortName.label; is set up, but not syncing automatically. Toggle “Auto-sync data” in Android Settings &gt; Data Usage.'>
 <!ENTITY fxaccount_status_needs_master_sync_automatically_enabled_v21 '&syncBrand.shortName.label; is set up, but not syncing automatically. Toggle “Auto-sync data” in the menu of Android Settings &gt; Accounts.'>
 <!ENTITY fxaccount_status_needs_finish_migrating 'Tap to sign in to your new Firefox Account.'>
+<!ENTITY fxaccount_status_choose_what 'Choose what to sync'>
 <!ENTITY fxaccount_status_bookmarks 'Bookmarks'>
 <!ENTITY fxaccount_status_history 'History'>
 <!ENTITY fxaccount_status_passwords2 'Logins'>
 <!ENTITY fxaccount_status_tabs 'Open tabs'>
+<!ENTITY fxaccount_status_additional_settings 'Additional Settings'>
 <!ENTITY fxaccount_status_legal 'Legal' >
 <!-- Localization note: when tapped, the following two strings link to
      external web pages.  Compare fxaccount_policy_{linktos,linkprivacy}:
      these strings are separated to accommodate languages that decline
      the two uses differently. -->
 <!ENTITY fxaccount_status_linktos2 'Terms of service'>
 <!ENTITY fxaccount_status_linkprivacy2 'Privacy notice'>
-<!ENTITY fxaccount_status_more 'More&ellipsis;'>
 <!ENTITY fxaccount_remove_account 'Disconnect&ellipsis;'>
 
 <!ENTITY fxaccount_remove_account_dialog_title2 'Disconnect from Sync?'>
 <!ENTITY fxaccount_remove_account_dialog_message2 'Your browsing data will remain on this device, but it will no longer sync with your account.'>
 <!-- Localization note: format string below will be replaced
      with the Firefox Account's email address. -->
 <!ENTITY fxaccount_remove_account_toast2 'Firefox Account &formatS; disconnected.'>
 <!-- Localization note (fxaccount_remove_account_dialog_action_confirm): This is the label for the
--- a/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/activities/FxAccountStatusFragment.java
+++ b/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/activities/FxAccountStatusFragment.java
@@ -8,23 +8,23 @@ import android.accounts.Account;
 import android.content.BroadcastReceiver;
 import android.content.ContentResolver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
 import android.content.SharedPreferences;
 import android.os.Bundle;
 import android.os.Handler;
-import android.preference.CheckBoxPreference;
 import android.preference.EditTextPreference;
 import android.preference.Preference;
 import android.preference.Preference.OnPreferenceChangeListener;
 import android.preference.Preference.OnPreferenceClickListener;
 import android.preference.PreferenceCategory;
 import android.preference.PreferenceScreen;
+import android.preference.SwitchPreference;
 import android.support.v4.content.LocalBroadcastManager;
 import android.text.TextUtils;
 import android.text.format.DateUtils;
 
 import com.squareup.picasso.Picasso;
 import com.squareup.picasso.Target;
 
 import org.mozilla.gecko.AppConstants;
@@ -81,47 +81,36 @@ public class FxAccountStatusFragment
   // schedule the sync as usual. See also comment below about garbage
   // collection.
   private static final long DELAY_IN_MILLISECONDS_BEFORE_REQUESTING_SYNC = 5 * 1000;
   private static final long LAST_SYNCED_TIME_UPDATE_INTERVAL_IN_MILLISECONDS = 60 * 1000;
   private static final long PROFILE_FETCH_RETRY_INTERVAL_IN_MILLISECONDS = 60 * 1000;
 
   private static final String[] STAGES_TO_SYNC_ON_DEVICE_NAME_CHANGE = new String[] { "clients" };
 
-  // By default, the auth/account server preference is only shown when the
-  // account is configured to use a custom server. In debug mode, this is set.
-  private static boolean ALWAYS_SHOW_AUTH_SERVER = false;
+  protected PreferenceCategory additionalSettingsCategory;
+  protected PreferenceCategory errorStatesCategory;
 
-  // By default, the Sync server preference is only shown when the account is
-  // configured to use a custom Sync server. In debug mode, this is set.
-  private static boolean ALWAYS_SHOW_SYNC_SERVER = false;
-
-  protected PreferenceCategory accountCategory;
   protected Preference profilePreference;
-  protected Preference manageAccountPreference;
   protected Preference authServerPreference;
   protected Preference removeAccountPreference;
 
   protected Preference needsPasswordPreference;
   protected Preference needsUpgradePreference;
   protected Preference needsVerificationPreference;
   protected Preference needsMasterSyncAutomaticallyEnabledPreference;
   protected Preference needsFinishMigratingPreference;
 
-  protected PreferenceCategory syncCategory;
-
-  protected CheckBoxPreference bookmarksPreference;
-  protected CheckBoxPreference historyPreference;
-  protected CheckBoxPreference tabsPreference;
-  protected CheckBoxPreference passwordsPreference;
-  protected CheckBoxPreference readingListPreference;
+  protected SwitchPreference bookmarksPreference;
+  protected SwitchPreference historyPreference;
+  protected SwitchPreference tabsPreference;
+  protected SwitchPreference passwordsPreference;
 
   protected EditTextPreference deviceNamePreference;
   protected Preference syncServerPreference;
-  protected Preference morePreference;
   protected Preference syncNowPreference;
 
   protected volatile AndroidFxAccount fxAccount;
   // The contract is: when fxAccount is non-null, then clientsDataDelegate is
   // non-null.  If violated then an IllegalStateException is thrown.
   protected volatile SharedPreferencesClientsDataDelegate clientsDataDelegate;
 
   // Used to post delayed sync requests.
@@ -160,88 +149,79 @@ public class FxAccountStatusFragment
     HardwareUtils.init(getActivity());
 
     addPreferences();
   }
 
   protected void addPreferences() {
     addPreferencesFromResource(R.xml.fxaccount_status_prefscreen);
 
-    accountCategory = (PreferenceCategory) ensureFindPreference("signed_in_as_category");
+    errorStatesCategory = (PreferenceCategory) ensureFindPreference("error_state");
+    additionalSettingsCategory = (PreferenceCategory) ensureFindPreference("additional_settings");
+
     profilePreference = ensureFindPreference("profile");
-    manageAccountPreference = ensureFindPreference("manage_account");
     authServerPreference = ensureFindPreference("auth_server");
     removeAccountPreference = ensureFindPreference("remove_account");
 
     needsPasswordPreference = ensureFindPreference("needs_credentials");
     needsUpgradePreference = ensureFindPreference("needs_upgrade");
     needsVerificationPreference = ensureFindPreference("needs_verification");
     needsMasterSyncAutomaticallyEnabledPreference = ensureFindPreference("needs_master_sync_automatically_enabled");
     needsFinishMigratingPreference = ensureFindPreference("needs_finish_migrating");
 
-    syncCategory = (PreferenceCategory) ensureFindPreference("sync_category");
-
-    bookmarksPreference = (CheckBoxPreference) ensureFindPreference("bookmarks");
-    historyPreference = (CheckBoxPreference) ensureFindPreference("history");
-    tabsPreference = (CheckBoxPreference) ensureFindPreference("tabs");
-    passwordsPreference = (CheckBoxPreference) ensureFindPreference("passwords");
-
-    if (!FxAccountUtils.LOG_PERSONAL_INFORMATION) {
-      removeDebugButtons();
-    } else {
-      connectDebugButtons();
-      ALWAYS_SHOW_AUTH_SERVER = true;
-      ALWAYS_SHOW_SYNC_SERVER = true;
-    }
+    bookmarksPreference = (SwitchPreference) ensureFindPreference("bookmarks");
+    historyPreference = (SwitchPreference) ensureFindPreference("history");
+    tabsPreference = (SwitchPreference) ensureFindPreference("tabs");
+    passwordsPreference = (SwitchPreference) ensureFindPreference("passwords");
 
     profilePreference.setOnPreferenceClickListener(this);
-    manageAccountPreference.setOnPreferenceClickListener(this);
     removeAccountPreference.setOnPreferenceClickListener(this);
 
     needsPasswordPreference.setOnPreferenceClickListener(this);
     needsVerificationPreference.setOnPreferenceClickListener(this);
     needsFinishMigratingPreference.setOnPreferenceClickListener(this);
 
     bookmarksPreference.setOnPreferenceClickListener(this);
     historyPreference.setOnPreferenceClickListener(this);
     tabsPreference.setOnPreferenceClickListener(this);
     passwordsPreference.setOnPreferenceClickListener(this);
 
     deviceNamePreference = (EditTextPreference) ensureFindPreference("device_name");
     deviceNamePreference.setOnPreferenceChangeListener(this);
 
     syncServerPreference = ensureFindPreference("sync_server");
-    morePreference = ensureFindPreference("more");
-    morePreference.setOnPreferenceClickListener(this);
 
     syncNowPreference = ensureFindPreference("sync_now");
     syncNowPreference.setEnabled(true);
     syncNowPreference.setOnPreferenceClickListener(this);
 
+    if (!FxAccountUtils.LOG_PERSONAL_INFORMATION) {
+      removeDebugButtons();
+    } else {
+      connectDebugButtons();
+    }
+
+    updateAdditionalPreferences();
+
     ensureFindPreference("linktos").setOnPreferenceClickListener(this);
     ensureFindPreference("linkprivacy").setOnPreferenceClickListener(this);
   }
 
   /**
    * We intentionally don't refresh here. Our owning activity is responsible for
    * providing an AndroidFxAccount to our refresh method in its onResume method.
    */
   @Override
   public void onResume() {
     super.onResume();
   }
 
   @Override
   public boolean onPreferenceClick(Preference preference) {
     if (preference == profilePreference) {
-      ActivityUtils.openURLInFennec(getActivity().getApplicationContext(), "about:accounts?action=avatar");
-      return true;
-    }
-
-    if (preference == manageAccountPreference) {
       ActivityUtils.openURLInFennec(getActivity().getApplicationContext(), "about:accounts?action=manage");
       return true;
     }
 
     if (preference == removeAccountPreference) {
       FxAccountStatusActivity.maybeDeleteAndroidAccount(getActivity(), fxAccount.getAndroidAccount(), null);
       return true;
     }
@@ -282,21 +262,16 @@ public class FxAccountStatusFragment
     if (preference == bookmarksPreference ||
         preference == historyPreference ||
         preference == passwordsPreference ||
         preference == tabsPreference) {
       saveEngineSelections();
       return true;
     }
 
-    if (preference == morePreference) {
-      getActivity().openOptionsMenu();
-      return true;
-    }
-
     if (preference == syncNowPreference) {
       if (fxAccount != null) {
         fxAccount.requestImmediateSync(null, null);
       }
       return true;
     }
 
     if (TextUtils.equals("linktos", preference.getKey())) {
@@ -324,78 +299,88 @@ public class FxAccountStatusFragment
 
   /**
    * Show at most one error preference, hiding all others.
    *
    * @param errorPreferenceToShow
    *          single error preference to show; if null, hide all error preferences
    */
   protected void showOnlyOneErrorPreference(Preference errorPreferenceToShow) {
+    final PreferenceScreen statusScreen = (PreferenceScreen) ensureFindPreference("status_screen");
+    final boolean showShowErrorState = errorPreferenceToShow != null;
+    final boolean currentlyShowingErrorState = null != findPreference(errorStatesCategory.getKey());
+
+    if (currentlyShowingErrorState != showShowErrorState) {
+      if (showShowErrorState) {
+        statusScreen.addPreference(errorStatesCategory);
+      } else {
+        statusScreen.removePreference(errorStatesCategory);
+      }
+    }
+
+    if (!showShowErrorState) {
+      return;
+    }
+
     final Preference[] errorPreferences = new Preference[] {
         this.needsPasswordPreference,
         this.needsUpgradePreference,
         this.needsVerificationPreference,
         this.needsMasterSyncAutomaticallyEnabledPreference,
         this.needsFinishMigratingPreference,
     };
     for (Preference errorPreference : errorPreferences) {
-      final boolean currentlyShown = null != findPreference(errorPreference.getKey());
+      final boolean currentlyShown = null != errorStatesCategory.findPreference(errorPreference.getKey());
       final boolean shouldBeShown = errorPreference == errorPreferenceToShow;
       if (currentlyShown == shouldBeShown) {
         continue;
       }
       if (shouldBeShown) {
-        syncCategory.addPreference(errorPreference);
+        errorStatesCategory.addPreference(errorPreference);
       } else {
-        syncCategory.removePreference(errorPreference);
+        errorStatesCategory.removePreference(errorPreference);
       }
     }
   }
 
   protected void showNeedsPassword() {
-    syncCategory.setTitle(R.string.fxaccount_status_sync);
     showOnlyOneErrorPreference(needsPasswordPreference);
     setCheckboxesEnabled(false);
   }
 
   protected void showNeedsUpgrade() {
-    syncCategory.setTitle(R.string.fxaccount_status_sync);
     showOnlyOneErrorPreference(needsUpgradePreference);
     setCheckboxesEnabled(false);
   }
 
   protected void showNeedsVerification() {
-    syncCategory.setTitle(R.string.fxaccount_status_sync);
     showOnlyOneErrorPreference(needsVerificationPreference);
     setCheckboxesEnabled(false);
   }
 
   protected void showNeedsMasterSyncAutomaticallyEnabled() {
-    syncCategory.setTitle(R.string.fxaccount_status_sync);
     needsMasterSyncAutomaticallyEnabledPreference.setTitle(AppConstants.Versions.preLollipop ?
                                                    R.string.fxaccount_status_needs_master_sync_automatically_enabled :
                                                    R.string.fxaccount_status_needs_master_sync_automatically_enabled_v21);
     showOnlyOneErrorPreference(needsMasterSyncAutomaticallyEnabledPreference);
     setCheckboxesEnabled(false);
   }
 
   protected void showNeedsFinishMigrating() {
-    syncCategory.setTitle(R.string.fxaccount_status_sync);
     showOnlyOneErrorPreference(needsFinishMigratingPreference);
     setCheckboxesEnabled(false);
   }
 
   protected void showConnected() {
-    syncCategory.setTitle(R.string.fxaccount_status_sync_enabled);
     showOnlyOneErrorPreference(null);
     setCheckboxesEnabled(true);
   }
 
-  protected class InnerSyncStatusDelegate implements SyncStatusListener {
-    protected final Runnable refreshRunnable = new Runnable() {
+  private class InnerSyncStatusDelegate implements SyncStatusListener {
+    /* package-private */ final Runnable refreshRunnable = new Runnable() {
       @Override
       public void run() {
         refresh();
       }
     };
 
     @Override
     public Context getContext() {
@@ -514,18 +499,17 @@ public class FxAccountStatusFragment
       throw new IllegalArgumentException("fxAccount must not be null");
     }
 
     // profilePreference is set during onCreate, so it's definitely not null here.
     final float cornerRadius = getResources().getDimension(R.dimen.fxaccount_profile_image_width) / 2;
     profileAvatarTarget = new PicassoPreferenceIconTarget(getResources(), profilePreference, cornerRadius);
 
     updateProfileInformation();
-    updateAuthServerPreference();
-    updateSyncServerPreference();
+    updateAdditionalPreferences();
 
     try {
       // There are error states determined by Android, not the login state
       // machine, and we have a chance to present these states here. We handle
       // them specially, since we can't surface these states as part of syncing,
       // because they generally stop syncs from happening regularly. Right now
       // there are no such states.
 
@@ -643,41 +627,62 @@ public class FxAccountStatusFragment
   }
 
   private void scheduleAndUpdateLastSyncedTime() {
     final String lastSynced = getLastSyncedString(fxAccount.getLastSyncedTimestamp());
     syncNowPreference.setSummary(lastSynced);
     handler.postDelayed(lastSyncedTimeUpdateRunnable, LAST_SYNCED_TIME_UPDATE_INTERVAL_IN_MILLISECONDS);
   }
 
-  protected void updateAuthServerPreference() {
+  private void updateAdditionalPreferences() {
+    // Ensure we have fxAccount; it's set in refresh().
+    if (fxAccount == null) {
+      return;
+    }
+
+    // In debug mode, everything is shown. Otherwise, we show those that have been customized.
     final String authServer = fxAccount.getAccountServerURI();
-    final boolean shouldBeShown = ALWAYS_SHOW_AUTH_SERVER || !FxAccountConstants.DEFAULT_AUTH_SERVER_ENDPOINT.equals(authServer);
-    final boolean currentlyShown = null != findPreference(authServerPreference.getKey());
-    if (currentlyShown != shouldBeShown) {
+    final String syncServer = fxAccount.getTokenServerURI();
+    final boolean inDebugMode = FxAccountUtils.LOG_PERSONAL_INFORMATION;
+    final boolean authServerCustomized = !FxAccountConstants.DEFAULT_AUTH_SERVER_ENDPOINT.equals(authServer);
+    final boolean syncServerCustomized = !FxAccountConstants.DEFAULT_TOKEN_SERVER_ENDPOINT.equals(syncServer);
+
+    final boolean shouldBeShown = inDebugMode || authServerCustomized || syncServerCustomized;
+
+    final boolean additionalSettingsCategoryCurrentlyShown = null != findPreference(additionalSettingsCategory.getKey());
+    if (shouldBeShown != additionalSettingsCategoryCurrentlyShown) {
+      final PreferenceScreen statusScreen = (PreferenceScreen) ensureFindPreference("status_screen");
       if (shouldBeShown) {
-        accountCategory.addPreference(authServerPreference);
+        statusScreen.addPreference(additionalSettingsCategory);
       } else {
-        accountCategory.removePreference(authServerPreference);
+        statusScreen.removePreference(additionalSettingsCategory);
+        return;
+      }
+    }
+
+    final boolean showAuthServerPref = authServerCustomized || inDebugMode;
+    final boolean authServerPrefCurrentlyShown = null != findPreference(authServerPreference.getKey());
+    if (authServerPrefCurrentlyShown != showAuthServerPref) {
+      if (showAuthServerPref) {
+        additionalSettingsCategory.addPreference(authServerPreference);
+      } else {
+        additionalSettingsCategory.removePreference(authServerPreference);
       }
     }
     // Always set the summary, because on first run, the preference is visible,
     // and the above block will be skipped if there is a custom value.
     authServerPreference.setSummary(authServer);
-  }
 
-  protected void updateSyncServerPreference() {
-    final String syncServer = fxAccount.getTokenServerURI();
-    final boolean shouldBeShown = ALWAYS_SHOW_SYNC_SERVER || !FxAccountConstants.DEFAULT_TOKEN_SERVER_ENDPOINT.equals(syncServer);
-    final boolean currentlyShown = null != findPreference(syncServerPreference.getKey());
-    if (currentlyShown != shouldBeShown) {
-      if (shouldBeShown) {
-        syncCategory.addPreference(syncServerPreference);
+    final boolean showSyncServerPref = syncServerCustomized || inDebugMode;
+    final boolean syncServerPrefCurrentlyShown = null != findPreference(syncServerPreference.getKey());
+    if (syncServerPrefCurrentlyShown != showSyncServerPref) {
+      if (showSyncServerPref) {
+        additionalSettingsCategory.addPreference(syncServerPreference);
       } else {
-        syncCategory.removePreference(syncServerPreference);
+        additionalSettingsCategory.removePreference(syncServerPreference);
       }
     }
     // Always set the summary, because on first run, the preference is visible,
     // and the above block will be skipped if there is a custom value.
     syncServerPreference.setSummary(syncServer);
   }
 
   /**
--- a/mobile/android/services/src/main/res/layout/fxaccount_status_error_preference.xml
+++ b/mobile/android/services/src/main/res/layout/fxaccount_status_error_preference.xml
@@ -1,16 +1,16 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:background="@color/fxaccount_error_preference_backgroundcolor"
     android:gravity="center_vertical"
     android:minHeight="?android:attr/listPreferredItemHeight"
-    android:paddingRight="?android:attr/scrollbarSize" >
+    android:paddingRight="?android:attr/scrollbarSize">
 
     <LinearLayout
         android:layout_width="wrap_content"
         android:layout_height="match_parent"
         android:gravity="center"
         android:minWidth="0dp"
         android:orientation="horizontal" >
 
@@ -23,18 +23,20 @@
             android:padding="10dip" />
     </LinearLayout>
 
     <RelativeLayout
         android:layout_width="0dp"
         android:layout_height="wrap_content"
         android:layout_marginBottom="6dip"
         android:layout_marginLeft="15dip"
-        android:layout_marginRight="6dip"
-        android:layout_marginTop="6dip"
+        android:layout_marginStart="15dip"
+        android:layout_marginRight="15dip"
+        android:layout_marginEnd="6dip"
+        android:layout_marginTop="0dp"
         android:layout_weight="1" >
 
         <TextView
             android:id="@+android:id/title"
             style="@style/FxAccountTextItem"
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
             android:layout_gravity="center_horizontal"
--- a/mobile/android/services/src/main/res/xml/fxaccount_status_prefscreen.xml
+++ b/mobile/android/services/src/main/res/xml/fxaccount_status_prefscreen.xml
@@ -1,36 +1,16 @@
 <?xml version="1.0" encoding="utf-8"?>
 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
                   xmlns:gecko="http://schemas.android.com/apk/res-auto"
                   android:key="status_screen">
 
     <PreferenceCategory
-        android:key="signed_in_as_category"
-        android:title="@string/fxaccount_status_signed_in_as" >
-        <Preference
-            android:editable="false"
-            android:key="profile"
-            android:icon="@drawable/sync_avatar_default"
-            android:persistent="false"
-            android:title="" />
-        <Preference
-            android:editable="false"
-            android:key="manage_account"
-            android:persistent="false"
-            android:title="@string/fxaccount_status_manage_account" />
-        <Preference
-            android:editable="false"
-            android:key="auth_server"
-            android:persistent="false"
-            android:title="@string/fxaccount_status_auth_server" />
-    </PreferenceCategory>
-    <PreferenceCategory
-        android:key="sync_category"
-        android:title="@string/fxaccount_status_sync" >
+        android:key="error_state">
+
         <Preference
             android:editable="false"
             android:icon="@drawable/fxaccount_sync_error"
             android:key="needs_credentials"
             android:layout="@layout/fxaccount_status_error_preference"
             android:persistent="false"
             android:title="@string/fxaccount_status_needs_credentials" />
         <Preference
@@ -56,80 +36,98 @@
             android:title="@string/fxaccount_status_needs_master_sync_automatically_enabled" />
         <Preference
             android:editable="false"
             android:icon="@drawable/fxaccount_sync_error"
             android:key="needs_finish_migrating"
             android:layout="@layout/fxaccount_status_error_preference"
             android:persistent="false"
             android:title="@string/fxaccount_status_needs_finish_migrating" />
+    </PreferenceCategory>
 
-        <Preference
-            android:editable="false"
-            android:key="sync_now"
-            android:defaultValue=""
-            android:persistent="false"
-            android:title="@string/fxaccount_status_sync_now"
-            android:summary="" />
+    <Preference
+        android:editable="false"
+        android:key="profile"
+        android:icon="@drawable/sync_avatar_default"
+        android:persistent="false"
+        android:title="" />
 
-        <CheckBoxPreference
+    <Preference
+        android:editable="false"
+        android:key="sync_now"
+        android:defaultValue=""
+        android:persistent="false"
+        android:title="@string/fxaccount_status_sync_now"
+        android:summary="" />
+
+    <PreferenceCategory
+        android:title="@string/fxaccount_status_choose_what">
+
+        <SwitchPreference
             android:key="bookmarks"
             android:persistent="false"
             android:title="@string/fxaccount_status_bookmarks" />
-        <CheckBoxPreference
+        <SwitchPreference
             android:key="history"
             android:persistent="false"
             android:title="@string/fxaccount_status_history" />
-        <CheckBoxPreference
+        <SwitchPreference
             android:key="tabs"
             android:persistent="false"
             android:title="@string/fxaccount_status_tabs" />
-        <CheckBoxPreference
+        <SwitchPreference
             android:key="passwords"
             android:persistent="false"
             android:title="@string/fxaccount_status_passwords" />
+    </PreferenceCategory>
 
-        <EditTextPreference
-            android:singleLine="true"
-            android:key="device_name"
+    <EditTextPreference
+        android:singleLine="true"
+        android:key="device_name"
+        android:persistent="false"
+        android:title="@string/fxaccount_status_device_name" />
+
+    <org.mozilla.gecko.fxa.activities.CustomColorPreference
+        android:editable="false"
+        android:key="remove_account"
+        android:persistent="false"
+        gecko:titleColor="@color/rejection_red"
+        android:title="@string/fxaccount_remove_account" />
+
+    <PreferenceCategory
+        android:key="additional_settings"
+        android:title="@string/fxaccount_status_additional_settings">
+
+        <Preference
+            android:editable="false"
+            android:key="auth_server"
             android:persistent="false"
-            android:title="@string/fxaccount_status_device_name" />
-
+            android:title="@string/fxaccount_status_auth_server" />
         <Preference
             android:editable="false"
             android:key="sync_server"
             android:persistent="false"
             android:title="@string/fxaccount_status_sync_server" />
-        <org.mozilla.gecko.fxa.activities.CustomColorPreference
-            android:editable="false"
-            android:key="remove_account"
-            android:persistent="false"
-            gecko:titleColor="@color/rejection_red"
-            android:title="@string/fxaccount_remove_account" />
-        <Preference
-            android:editable="false"
-            android:key="more"
-            android:persistent="false"
-            android:title="@string/fxaccount_status_more" />
+    </PreferenceCategory>
 
-    </PreferenceCategory>
     <PreferenceCategory
         android:key="legal_category"
         android:title="@string/fxaccount_status_legal" >
         <Preference
             android:editable="false"
             android:key="linktos"
             android:persistent="false"
             android:title="@string/fxaccount_status_linktos" />
         <Preference
             android:editable="false"
             android:key="linkprivacy"
             android:persistent="false"
             android:title="@string/fxaccount_status_linkprivacy" />
     </PreferenceCategory>
+
     <PreferenceCategory
         android:key="debug_category" >
         <Preference android:key="debug_refresh" />
         <Preference android:key="debug_dump" />
         <Preference android:key="debug_force_sync" />
         <Preference android:key="debug_invalidate_certificate" />
         <Preference android:key="debug_forget_certificate" />
         <Preference android:key="debug_require_password" />
--- a/mobile/android/services/strings.xml.in
+++ b/mobile/android/services/strings.xml.in
@@ -24,41 +24,38 @@
 <string name="fxaccount_link_tos">https://accounts.firefox.com/legal/terms</string>
 <string name="fxaccount_link_pn">https://accounts.firefox.com/legal/privacy</string>
 
 <string name="fxaccount_getting_started_welcome_to_sync">&fxaccount_getting_started_welcome_to_sync;</string>
 <string name="fxaccount_getting_started_description">&fxaccount_getting_started_description2;</string>
 <string name="fxaccount_getting_started_get_started">&fxaccount_getting_started_get_started;</string>
 
 <string name="fxaccount_status_activity_label">&syncBrand.shortName.label;</string>
-<string name="fxaccount_status_signed_in_as">&fxaccount_status_signed_in_as;</string>
-<string name="fxaccount_status_manage_account">&fxaccount_status_manage_account;</string>
 <string name="fxaccount_status_auth_server">&fxaccount_status_auth_server;</string>
 <string name="fxaccount_status_sync_now">&fxaccount_status_sync_now;</string>
 <string name="fxaccount_status_syncing">&fxaccount_status_syncing2;</string>
 <string name="fxaccount_status_last_synced">&remote_tabs_last_synced;</string>
 <string name="fxaccount_status_never_synced">&remote_tabs_never_synced;</string>
 <string name="fxaccount_status_device_name">&fxaccount_status_device_name;</string>
 <string name="fxaccount_status_sync_server">&fxaccount_status_sync_server;</string>
-<string name="fxaccount_status_sync">&fxaccount_status_sync;</string>
-<string name="fxaccount_status_sync_enabled">&fxaccount_status_sync_enabled;</string>
 <string name="fxaccount_status_needs_verification">&fxaccount_status_needs_verification2;</string>
 <string name="fxaccount_status_needs_credentials">&fxaccount_status_needs_credentials;</string>
 <string name="fxaccount_status_needs_upgrade">&fxaccount_status_needs_upgrade;</string>
 <string name="fxaccount_status_needs_master_sync_automatically_enabled">&fxaccount_status_needs_master_sync_automatically_enabled;</string>
 <string name="fxaccount_status_needs_master_sync_automatically_enabled_v21">&fxaccount_status_needs_master_sync_automatically_enabled_v21;</string>
 <string name="fxaccount_status_needs_finish_migrating">&fxaccount_status_needs_finish_migrating;</string>
+<string name="fxaccount_status_choose_what">&fxaccount_status_choose_what;</string>
 <string name="fxaccount_status_bookmarks">&fxaccount_status_bookmarks;</string>
 <string name="fxaccount_status_history">&fxaccount_status_history;</string>
 <string name="fxaccount_status_passwords">&fxaccount_status_passwords2;</string>
 <string name="fxaccount_status_tabs">&fxaccount_status_tabs;</string>
+<string name="fxaccount_status_additional_settings">&fxaccount_status_additional_settings;</string>
 <string name="fxaccount_status_legal">&fxaccount_status_legal;</string>
 <string name="fxaccount_status_linktos">&fxaccount_status_linktos2;</string>
 <string name="fxaccount_status_linkprivacy">&fxaccount_status_linkprivacy2;</string>
-<string name="fxaccount_status_more">&fxaccount_status_more;</string>
 <string name="fxaccount_remove_account">&fxaccount_remove_account;</string>
 
 <string name="fxaccount_label">&fxaccount_account_type_label;</string>
 
 <string name="fxaccount_options_title">&fxaccount_options_title;</string>
 <string name="fxaccount_options_configure_title">&fxaccount_options_configure_title;</string>
 
 <string name="fxaccount_sync_sign_in_error_notification_title">&fxaccount_sync_sign_in_error_notification_title2;</string>