Misc fixes for User page and my device info page

- Rename UserAndAccountDashboard* to AccountDashboard*
- Move emergency info from account to device info page

- Move auto sync data toggles (4 of them) from Account page to user page
   - Move the controllers too. UserSettings is a not a DashboardFragment
     so I had to manually call each controller method.
     TODO: refactor UserSettings to a DashboardFragment

- Move legal information/regulatory info above advance button within device info page.

Fixes: 72523158
Bug: 71871075
Test: robotests
Change-Id: I1b8af8af61e49d17926f984978a09a974b6c62e1
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 4a4275f..1963830 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1006,7 +1006,7 @@
         </activity>
 
 
-        <activity android:name="Settings$MeCardActivity"
+        <activity android:name=".Settings$MyDeviceInfoActivity"
                   android:label="@string/device_info_settings"
                   android:icon="@drawable/ic_settings_about"
                   android:taskAffinity="com.android.settings"
@@ -1020,7 +1020,7 @@
                 <category android:name="android.intent.category.DEFAULT" />
                 <category android:name="android.intent.category.VOICE_LAUNCH" />
             </intent-filter>
-            <intent-filter android:priority="10">
+            <intent-filter android:priority="270">
                 <action android:name="com.android.settings.action.SETTINGS" />
             </intent-filter>
             <meta-data android:name="com.android.settings.category"
@@ -2329,7 +2329,7 @@
             android:configChanges="orientation|keyboardHidden|screenSize"
             android:label="@string/header_add_an_account"
             android:taskAffinity="com.android.settings"
-            android:parentActivityName="Settings$UserAndAccountDashboardActivity">
+            android:parentActivityName=".Settings$AccountDashboardActivity">
             <intent-filter android:priority="1">
                 <action android:name="android.settings.ADD_ACCOUNT_SETTINGS" />
                 <category android:name="android.intent.category.DEFAULT" />
@@ -3092,7 +3092,7 @@
                        android:resource="@string/app_and_notification_dashboard_summary"/>
         </activity>
 
-        <activity android:name=".Settings$UserAndAccountDashboardActivity"
+        <activity android:name=".Settings$AccountDashboardActivity"
                   android:label="@string/account_dashboard_title"
                   android:icon="@drawable/ic_homepage_accounts">
             <intent-filter android:priority="3">
@@ -3103,11 +3103,9 @@
                 <category android:name="android.intent.category.DEFAULT" />
             </intent-filter>
             <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
-                       android:value="com.android.settings.accounts.UserAndAccountDashboardFragment"/>
+                       android:value="com.android.settings.accounts.AccountDashboardFragment"/>
             <meta-data android:name="com.android.settings.category"
                        android:value="com.android.settings.category.ia.homepage"/>
-            <meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
-              android:value="true" />
         </activity>
 
         <activity android:name=".Settings$SystemDashboardActivity"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 65d7b0f..fe05e6f 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -6663,8 +6663,8 @@
     <string name="app_and_notification_dashboard_title">Apps &amp; notifications</string>
     <!-- Summary for Apps & Notification settings, explaining a few important settings under it [CHAR LIMIT=NONE]-->
     <string name="app_and_notification_dashboard_summary">Permissions, default apps</string>
-    <!-- Title for setting tile leading to User and accounts settings [CHAR LIMIT=40]-->
-    <string name="account_dashboard_title">Users &amp; accounts</string>
+    <!-- Title for setting tile leading to account settings [CHAR LIMIT=40]-->
+    <string name="account_dashboard_title">Accounts</string>
     <!-- Title for setting tile leading to setting UI which allows user set default app to
     handle actions such as open web page, making phone calls, default SMS apps [CHAR  LIMIT=40]-->
     <string name="app_default_dashboard_title">Default apps</string>
diff --git a/res/xml/accounts_dashboard_settings.xml b/res/xml/accounts_dashboard_settings.xml
new file mode 100644
index 0000000..1e29d0a
--- /dev/null
+++ b/res/xml/accounts_dashboard_settings.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 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.
+-->
+
+<PreferenceScreen
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:settings="http://schemas.android.com/apk/res-auto"
+    android:key="user_and_account_settings_screen"
+    android:title="@string/account_dashboard_title"
+    settings:keywords="@string/keywords_accounts">
+
+    <PreferenceCategory
+        android:key="dashboard_tile_placeholder"
+        android:order="200"/>
+
+</PreferenceScreen>
diff --git a/res/xml/my_device_info.xml b/res/xml/my_device_info.xml
index 4988b16..dabed8a 100644
--- a/res/xml/my_device_info.xml
+++ b/res/xml/my_device_info.xml
@@ -20,7 +20,7 @@
     xmlns:settings="http://schemas.android.com/apk/res-auto"
     android:key="my_device_info_pref_screen"
     android:title="@string/my_device_info_title"
-    settings:initialExpandedChildrenCount="4">
+    settings:initialExpandedChildrenCount="7">
 
     <com.android.settings.applications.LayoutPreference
         android:key="my_device_info_header"
@@ -49,10 +49,31 @@
         android:title="@string/my_device_info_device_name_preference_title"
         android:summary="@string/summary_placeholder"/>
 
+    <Preference
+        android:key="emergency_info"
+        android:order="4"
+        android:title="@string/emergency_info_title"
+        android:summary="@string/summary_placeholder"/>
+
+    <!-- Legal information -->
+    <Preference
+        android:key="legal_container"
+        android:order="5"
+        android:title="@string/legal_information"
+        android:fragment="com.android.settings.LegalSettings" />
+
+    <!-- Regulatory labels -->
+    <Preference
+        android:key="regulatory_info"
+        android:order="6"
+        android:title="@string/regulatory_labels">
+        <intent android:action="android.settings.SHOW_REGULATORY_INFO"/>
+    </Preference>
+
     <!-- SIM status -->
     <Preference
         android:key="sim_status"
-        android:order="4"
+        android:order="7"
         android:title="@string/sim_status_title"
         settings:keywords="@string/keywords_sim_status"
         android:summary="@string/summary_placeholder"/>
@@ -110,23 +131,6 @@
         android:title="@string/status_bt_address"
         android:summary="@string/summary_placeholder"/>
 
-
-    <!-- Legal information -->
-    <Preference
-        android:key="legal_container"
-        android:order="37"
-        android:title="@string/legal_information"
-        android:fragment="com.android.settings.LegalSettings"
-        settings:allowDividerAbove="true"/>
-
-    <!-- Regulatory labels -->
-    <Preference
-        android:key="regulatory_info"
-        android:order="38"
-        android:title="@string/regulatory_labels">
-        <intent android:action="android.settings.SHOW_REGULATORY_INFO"/>
-    </Preference>
-
     <!-- Safety & regulatory manual -->
     <Preference
         android:key="safety_info"
diff --git a/res/xml/user_and_accounts_settings.xml b/res/xml/user_and_accounts_settings.xml
deleted file mode 100644
index 7f82f43..0000000
--- a/res/xml/user_and_accounts_settings.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2016 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.
--->
-
-<PreferenceScreen
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:settings="http://schemas.android.com/apk/res-auto"
-    android:key="user_and_account_settings_screen"
-    android:title="@string/account_dashboard_title"
-    settings:keywords="@string/keywords_accounts">
-
-    <Preference
-        android:key="emergency_info"
-        android:title="@string/emergency_info_title"
-        android:order="100"
-        settings:allowDividerAbove="true"/>
-
-    <SwitchPreference
-        android:key="auto_sync_account_data"
-        android:title="@string/auto_sync_account_title"
-        android:summary="@string/auto_sync_account_summary"
-        android:order="102"
-        settings:allowDividerAbove="true"/>
-
-    <SwitchPreference
-        android:key="auto_sync_work_account_data"
-        android:title="@string/account_settings_menu_auto_sync_work"
-        android:summary="@string/auto_sync_account_summary"
-        android:order="103"/>
-
-    <SwitchPreference
-        android:key="auto_sync_personal_account_data"
-        android:title="@string/account_settings_menu_auto_sync_personal"
-        android:summary="@string/auto_sync_account_summary"
-        android:order="104"/>
-
-    <com.android.settingslib.RestrictedSwitchPreference
-        android:key="user_settings_add_users_when_locked"
-        android:title="@string/user_add_on_lockscreen_menu"
-        android:singleLineTitle="false"
-        android:order="105"/>
-
-    <PreferenceCategory
-        android:key="dashboard_tile_placeholder"
-        android:order="200"/>
-
-</PreferenceScreen>
diff --git a/res/xml/user_settings.xml b/res/xml/user_settings.xml
index cf68344..32b46d9 100644
--- a/res/xml/user_settings.xml
+++ b/res/xml/user_settings.xml
@@ -14,18 +14,47 @@
      limitations under the License.
 -->
 
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
-        xmlns:settings="http://schemas.android.com/apk/res-auto"
-        android:title="@string/user_settings_title">
+<PreferenceScreen
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:settings="http://schemas.android.com/apk/res-auto"
+    android:key="user_settings_screen"
+    android:title="@string/user_settings_title">
 
     <PreferenceCategory
-            android:key="user_list"
-            android:title="@string/user_list_title">
+        android:key="user_list"
+        android:title="@string/user_list_title"
+        android:order="10">
     </PreferenceCategory>
 
     <com.android.settingslib.RestrictedPreference
-            android:key="user_add"
-            android:title="@string/user_add_user_or_profile_menu"
-            android:icon="@drawable/ic_menu_add" />
+        android:key="user_add"
+        android:title="@string/user_add_user_or_profile_menu"
+        android:icon="@drawable/ic_menu_add"
+        android:order="20"/>
+
+    <SwitchPreference
+        android:key="auto_sync_account_data"
+        android:title="@string/auto_sync_account_title"
+        android:summary="@string/auto_sync_account_summary"
+        android:order="102"
+        settings:allowDividerAbove="true"/>
+
+    <SwitchPreference
+        android:key="auto_sync_work_account_data"
+        android:title="@string/account_settings_menu_auto_sync_work"
+        android:summary="@string/auto_sync_account_summary"
+        android:order="103"/>
+
+    <SwitchPreference
+        android:key="auto_sync_personal_account_data"
+        android:title="@string/account_settings_menu_auto_sync_personal"
+        android:summary="@string/auto_sync_account_summary"
+        android:order="104"/>
+
+    <com.android.settingslib.RestrictedSwitchPreference
+        android:key="user_settings_add_users_when_locked"
+        android:title="@string/user_add_on_lockscreen_menu"
+        android:singleLineTitle="false"
+        android:order="105"/>
 
 </PreferenceScreen>
diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index dcf7ed5..0b6fe89 100644
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -54,7 +54,7 @@
     public static class NightDisplaySettingsActivity extends SettingsActivity { /* empty */ }
     public static class NightDisplaySuggestionActivity extends NightDisplaySettingsActivity { /* empty */ }
     public static class DeviceInfoSettingsActivity extends SettingsActivity { /* empty */ }
-    public static class MeCardActivity extends SettingsActivity { /* empty */ }
+    public static class MyDeviceInfoActivity extends SettingsActivity { /* empty */ }
     public static class ApplicationSettingsActivity extends SettingsActivity { /* empty */ }
     public static class ManageApplicationsActivity extends SettingsActivity { /* empty */ }
     public static class ManageAssistActivity extends SettingsActivity { /* empty */ }
@@ -168,7 +168,7 @@
     public static class PowerUsageSummaryLegacyActivity extends SettingsActivity { /* empty */ }
     public static class AppAndNotificationDashboardActivity extends SettingsActivity {}
     public static class StorageDashboardActivity extends SettingsActivity {}
-    public static class UserAndAccountDashboardActivity extends SettingsActivity {}
+    public static class AccountDashboardActivity extends SettingsActivity {}
     public static class SystemDashboardActivity extends SettingsActivity {}
     public static class AdvancedConnectedDeviceActivity extends SettingsActivity {
         public static final boolean isEnabled() {
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index cc90619..d4584b7 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -878,7 +878,7 @@
                 .getAccountFeatureProvider()
                 .isMeCardEnabled(this);
         somethingChanged = setTileEnabled(new ComponentName(packageName,
-                        Settings.MeCardActivity.class.getName()),
+                        Settings.MyDeviceInfoActivity.class.getName()),
                 isMeCardEnabled, isAdmin)
                 || somethingChanged;
         somethingChanged = setTileEnabled(new ComponentName(packageName,
diff --git a/src/com/android/settings/accounts/UserAndAccountDashboardFragment.java b/src/com/android/settings/accounts/AccountDashboardFragment.java
similarity index 77%
rename from src/com/android/settings/accounts/UserAndAccountDashboardFragment.java
rename to src/com/android/settings/accounts/AccountDashboardFragment.java
index 37584fc..fe967b8 100644
--- a/src/com/android/settings/accounts/UserAndAccountDashboardFragment.java
+++ b/src/com/android/settings/accounts/AccountDashboardFragment.java
@@ -35,10 +35,10 @@
 import java.util.Arrays;
 import java.util.List;
 
-public class UserAndAccountDashboardFragment extends DashboardFragment {
+public class AccountDashboardFragment extends DashboardFragment {
 
-    private static final String TAG = "UserAndAccountDashboard";
-    private static final String KEY_ADD_USER_WHEN_LOCKED = "user_settings_add_users_when_locked";
+    private static final String TAG = "AccountDashboardFrag";
+
 
     @Override
     public int getMetricsCategory() {
@@ -52,7 +52,7 @@
 
     @Override
     protected int getPreferenceScreenResId() {
-        return R.xml.user_and_accounts_settings;
+        return R.xml.accounts_dashboard_settings;
     }
 
     @Override
@@ -63,16 +63,7 @@
     @Override
     protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
         final List<AbstractPreferenceController> controllers = new ArrayList<>();
-        controllers.add(new EmergencyInfoPreferenceController(context));
-        AddUserWhenLockedPreferenceController addUserWhenLockedPrefController =
-                new AddUserWhenLockedPreferenceController(
-                        context, KEY_ADD_USER_WHEN_LOCKED);
-        controllers.add(addUserWhenLockedPrefController);
-        getLifecycle().addObserver(addUserWhenLockedPrefController);
-        controllers.add(new AutoSyncDataPreferenceController(context, this));
-        controllers.add(new AutoSyncPersonalDataPreferenceController(context, this));
-        controllers.add(new AutoSyncWorkDataPreferenceController(context, this));
-        String[] authorities = getIntent().getStringArrayExtra(EXTRA_AUTHORITIES);
+        final String[] authorities = getIntent().getStringArrayExtra(EXTRA_AUTHORITIES);
         final AccountPreferenceController accountPrefController =
                 new AccountPreferenceController(context, this, authorities);
         getLifecycle().addObserver(accountPrefController);
@@ -116,7 +107,7 @@
                 public List<SearchIndexableResource> getXmlResourcesToIndex(
                         Context context, boolean enabled) {
                     final SearchIndexableResource sir = new SearchIndexableResource(context);
-                    sir.xmlResId = R.xml.user_and_accounts_settings;
+                    sir.xmlResId = R.xml.accounts_dashboard_settings;
                     return Arrays.asList(sir);
                 }
             };
diff --git a/src/com/android/settings/core/gateway/SettingsGateway.java b/src/com/android/settings/core/gateway/SettingsGateway.java
index 2cb1cbf..ecf0584 100644
--- a/src/com/android/settings/core/gateway/SettingsGateway.java
+++ b/src/com/android/settings/core/gateway/SettingsGateway.java
@@ -36,7 +36,7 @@
 import com.android.settings.accounts.AccountSyncSettings;
 import com.android.settings.accounts.ChooseAccountActivity;
 import com.android.settings.accounts.ManagedProfileSettings;
-import com.android.settings.accounts.UserAndAccountDashboardFragment;
+import com.android.settings.accounts.AccountDashboardFragment;
 import com.android.settings.applications.AppAndNotificationDashboardFragment;
 import com.android.settings.applications.DefaultAppSettings;
 import com.android.settings.applications.InstalledAppDetails;
@@ -249,7 +249,7 @@
             ConnectedDeviceDashboardFragment.class.getName(),
             ConnectedDeviceDashboardFragmentOld.class.getName(),
             AppAndNotificationDashboardFragment.class.getName(),
-            UserAndAccountDashboardFragment.class.getName(),
+            AccountDashboardFragment.class.getName(),
             EnterprisePrivacySettings.class.getName(),
             WebViewAppPicker.class.getName(),
             LockscreenDashboardFragment.class.getName(),
@@ -270,7 +270,7 @@
             Settings.StorageDashboardActivity.class.getName(),
             Settings.PowerUsageSummaryActivity.class.getName(),
             Settings.PowerUsageSummaryLegacyActivity.class.getName(),
-            Settings.UserAndAccountDashboardActivity.class.getName(),
+            Settings.AccountDashboardActivity.class.getName(),
             Settings.SecuritySettingsActivity.class.getName(),
             Settings.SecuritySettingsActivityV2.class.getName(),
             Settings.AccessibilitySettingsActivity.class.getName(),
@@ -298,6 +298,6 @@
             Settings.DateTimeSettingsActivity.class.getName(),
             Settings.DeviceInfoSettingsActivity.class.getName(),
             Settings.EnterprisePrivacySettingsActivity.class.getName(),
-            Settings.MeCardActivity.class.getName(),
+            Settings.MyDeviceInfoActivity.class.getName(),
     };
 }
diff --git a/src/com/android/settings/dashboard/DashboardFragmentRegistry.java b/src/com/android/settings/dashboard/DashboardFragmentRegistry.java
index 0536403..bb575ea 100644
--- a/src/com/android/settings/dashboard/DashboardFragmentRegistry.java
+++ b/src/com/android/settings/dashboard/DashboardFragmentRegistry.java
@@ -20,7 +20,7 @@
 
 import com.android.settings.DisplaySettings;
 import com.android.settings.accounts.AccountDetailDashboardFragment;
-import com.android.settings.accounts.UserAndAccountDashboardFragment;
+import com.android.settings.accounts.AccountDashboardFragment;
 import com.android.settings.applications.AppAndNotificationDashboardFragment;
 import com.android.settings.applications.DefaultAppSettings;
 import com.android.settings.connecteddevice.AdvancedConnectedDeviceDashboardFragment;
@@ -81,7 +81,7 @@
                 CategoryKey.CATEGORY_SECURITY);
         PARENT_TO_CATEGORY_KEY_MAP.put(AccountDetailDashboardFragment.class.getName(),
                 CategoryKey.CATEGORY_ACCOUNT_DETAIL);
-        PARENT_TO_CATEGORY_KEY_MAP.put(UserAndAccountDashboardFragment.class.getName(),
+        PARENT_TO_CATEGORY_KEY_MAP.put(AccountDashboardFragment.class.getName(),
                 CategoryKey.CATEGORY_ACCOUNT);
         PARENT_TO_CATEGORY_KEY_MAP.put(
                 SystemDashboardFragment.class.getName(), CategoryKey.CATEGORY_SYSTEM);
diff --git a/src/com/android/settings/dashboard/conditional/WorkModeCondition.java b/src/com/android/settings/dashboard/conditional/WorkModeCondition.java
index 5add32f..5c47be6 100644
--- a/src/com/android/settings/dashboard/conditional/WorkModeCondition.java
+++ b/src/com/android/settings/dashboard/conditional/WorkModeCondition.java
@@ -85,7 +85,7 @@
     @Override
     public void onPrimaryClick() {
         mManager.getContext().startActivity(new Intent(mManager.getContext(),
-                Settings.UserAndAccountDashboardActivity.class)
+                Settings.UserSettingsActivity.class)
                 .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
     }
 
diff --git a/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java b/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java
index 04e7fde..bb95228 100644
--- a/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java
+++ b/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java
@@ -25,20 +25,20 @@
 import android.os.Bundle;
 import android.os.UserManager;
 import android.provider.SearchIndexableResource;
-import android.telephony.TelephonyManager;
 import android.view.View;
 
-import com.android.internal.annotations.VisibleForTesting;
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
 import com.android.settings.R;
-import com.android.settings.SettingsActivity;
 import com.android.settings.Utils;
+import com.android.settings.accounts.EmergencyInfoPreferenceController;
 import com.android.settings.applications.LayoutPreference;
 import com.android.settings.dashboard.DashboardFragment;
+import com.android.settings.dashboard.SummaryLoader;
 import com.android.settings.deviceinfo.BluetoothAddressPreferenceController;
 import com.android.settings.deviceinfo.BrandedAccountPreferenceController;
 import com.android.settings.deviceinfo.BuildNumberPreferenceController;
 import com.android.settings.deviceinfo.DeviceModelPreferenceController;
+import com.android.settings.deviceinfo.DeviceNamePreferenceController;
 import com.android.settings.deviceinfo.FccEquipmentIdPreferenceController;
 import com.android.settings.deviceinfo.FeedbackPreferenceController;
 import com.android.settings.deviceinfo.ImsStatusPreferenceController;
@@ -52,11 +52,9 @@
 import com.android.settings.deviceinfo.imei.ImeiInfoPreferenceController;
 import com.android.settings.deviceinfo.simstatus.SimStatusPreferenceController;
 import com.android.settings.search.BaseSearchIndexProvider;
-import com.android.settings.search.Indexable;
 import com.android.settings.widget.EntityHeaderController;
 import com.android.settingslib.core.AbstractPreferenceController;
 import com.android.settingslib.core.lifecycle.Lifecycle;
-import com.android.settings.deviceinfo.DeviceNamePreferenceController;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -103,6 +101,7 @@
     private static List<AbstractPreferenceController> buildPreferenceControllers(Context context,
             Activity activity, Fragment fragment, Lifecycle lifecycle) {
         final List<AbstractPreferenceController> controllers = new ArrayList<>();
+        controllers.add(new EmergencyInfoPreferenceController(context));
         controllers.add(new PhoneNumberPreferenceController(context));
         controllers.add(new BrandedAccountPreferenceController(context));
         DeviceNamePreferenceController deviceNamePreferenceController =
@@ -154,6 +153,25 @@
         controller.done(context, true /* rebindActions */);
     }
 
+    private static class SummaryProvider implements SummaryLoader.SummaryProvider {
+
+        private final SummaryLoader mSummaryLoader;
+
+        public SummaryProvider(SummaryLoader summaryLoader) {
+            mSummaryLoader = summaryLoader;
+        }
+
+        @Override
+        public void setListening(boolean listening) {
+            if (listening) {
+                mSummaryLoader.setSummary(this, DeviceModelPreferenceController.getDeviceModel());
+            }
+        }
+    }
+
+    public static final SummaryLoader.SummaryProviderFactory SUMMARY_PROVIDER_FACTORY
+            = (activity, summaryLoader) -> new SummaryProvider(summaryLoader);
+
     /**
      * For Search.
      */
diff --git a/src/com/android/settings/search/SearchIndexableResourcesImpl.java b/src/com/android/settings/search/SearchIndexableResourcesImpl.java
index 034cbd0..9d0dce1 100644
--- a/src/com/android/settings/search/SearchIndexableResourcesImpl.java
+++ b/src/com/android/settings/search/SearchIndexableResourcesImpl.java
@@ -25,7 +25,7 @@
 import com.android.settings.accessibility.AccessibilitySettings;
 import com.android.settings.accessibility.AccessibilityShortcutPreferenceFragment;
 import com.android.settings.accessibility.MagnificationPreferenceFragment;
-import com.android.settings.accounts.UserAndAccountDashboardFragment;
+import com.android.settings.accounts.AccountDashboardFragment;
 import com.android.settings.applications.AppAndNotificationDashboardFragment;
 import com.android.settings.applications.DefaultAppSettings;
 import com.android.settings.applications.SpecialAccessSettings;
@@ -138,7 +138,7 @@
         addIndex(ScreenLockSettings.class);
         addIndex(EncryptionAndCredential.class);
         addIndex(ScreenPinningSettings.class);
-        addIndex(UserAndAccountDashboardFragment.class);
+        addIndex(AccountDashboardFragment.class);
         addIndex(VirtualKeyboardFragment.class);
         addIndex(AvailableVirtualKeyboardFragment.class);
         addIndex(PhysicalKeyboardFragment.class);
diff --git a/src/com/android/settings/security/LockscreenDashboardFragment.java b/src/com/android/settings/security/LockscreenDashboardFragment.java
index 7054181..c400645 100644
--- a/src/com/android/settings/security/LockscreenDashboardFragment.java
+++ b/src/com/android/settings/security/LockscreenDashboardFragment.java
@@ -22,7 +22,7 @@
 
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
 import com.android.settings.R;
-import com.android.settings.accounts.AddUserWhenLockedPreferenceController;
+import com.android.settings.users.AddUserWhenLockedPreferenceController;
 import com.android.settings.dashboard.DashboardFragment;
 import com.android.settings.notification.LockScreenNotificationPreferenceController;
 import com.android.settings.search.BaseSearchIndexProvider;
@@ -86,10 +86,8 @@
                         KEY_LOCK_SCREEN_NOTIFICATON_WORK_PROFILE);
         lifecycle.addObserver(notificationController);
         controllers.add(notificationController);
-        final AddUserWhenLockedPreferenceController addUserWhenLockedController =
-                new AddUserWhenLockedPreferenceController(context, KEY_ADD_USER_FROM_LOCK_SCREEN);
-        lifecycle.addObserver(addUserWhenLockedController);
-        controllers.add(addUserWhenLockedController);
+        controllers.add(new AddUserWhenLockedPreferenceController(
+                context, KEY_ADD_USER_FROM_LOCK_SCREEN, lifecycle));
         mOwnerInfoPreferenceController =
                 new OwnerInfoPreferenceController(context, this, lifecycle);
         controllers.add(mOwnerInfoPreferenceController);
@@ -121,7 +119,7 @@
                     final List<AbstractPreferenceController> controllers = new ArrayList<>();
                     controllers.add(new LockScreenNotificationPreferenceController(context));
                     controllers.add(new AddUserWhenLockedPreferenceController(context,
-                            KEY_ADD_USER_FROM_LOCK_SCREEN));
+                            KEY_ADD_USER_FROM_LOCK_SCREEN, null /* lifecycle */));
                     controllers.add(new OwnerInfoPreferenceController(
                             context, null /* fragment */, null /* lifecycle */));
                     controllers.add(new LockdownButtonPreferenceController(context));
diff --git a/src/com/android/settings/accounts/AddUserWhenLockedPreferenceController.java b/src/com/android/settings/users/AddUserWhenLockedPreferenceController.java
similarity index 92%
rename from src/com/android/settings/accounts/AddUserWhenLockedPreferenceController.java
rename to src/com/android/settings/users/AddUserWhenLockedPreferenceController.java
index c93ef73..06601fa 100644
--- a/src/com/android/settings/accounts/AddUserWhenLockedPreferenceController.java
+++ b/src/com/android/settings/users/AddUserWhenLockedPreferenceController.java
@@ -13,16 +13,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.settings.accounts;
+package com.android.settings.users;
 
 import android.content.Context;
 import android.provider.Settings.Global;
 import android.support.v7.preference.Preference;
 
 import com.android.settings.core.PreferenceControllerMixin;
-import com.android.settings.users.UserCapabilities;
 import com.android.settingslib.RestrictedSwitchPreference;
 import com.android.settingslib.core.AbstractPreferenceController;
+import com.android.settingslib.core.lifecycle.Lifecycle;
 import com.android.settingslib.core.lifecycle.LifecycleObserver;
 import com.android.settingslib.core.lifecycle.events.OnPause;
 import com.android.settingslib.core.lifecycle.events.OnResume;
@@ -35,10 +35,13 @@
     private final UserCapabilities mUserCaps;
     private boolean mShouldUpdateUserList;
 
-    public AddUserWhenLockedPreferenceController(Context context, String key) {
+    public AddUserWhenLockedPreferenceController(Context context, String key, Lifecycle lifecycle) {
         super(context);
         mPrefKey = key;
         mUserCaps = UserCapabilities.create(context);
+        if (lifecycle != null) {
+            lifecycle.addObserver(this);
+        }
     }
 
     @Override
diff --git a/src/com/android/settings/accounts/AutoSyncDataPreferenceController.java b/src/com/android/settings/users/AutoSyncDataPreferenceController.java
similarity index 99%
rename from src/com/android/settings/accounts/AutoSyncDataPreferenceController.java
rename to src/com/android/settings/users/AutoSyncDataPreferenceController.java
index 128e88d..5d9ec43 100644
--- a/src/com/android/settings/accounts/AutoSyncDataPreferenceController.java
+++ b/src/com/android/settings/users/AutoSyncDataPreferenceController.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.settings.accounts;
+package com.android.settings.users;
 
 import android.app.ActivityManager;
 import android.app.AlertDialog;
diff --git a/src/com/android/settings/accounts/AutoSyncPersonalDataPreferenceController.java b/src/com/android/settings/users/AutoSyncPersonalDataPreferenceController.java
similarity index 97%
rename from src/com/android/settings/accounts/AutoSyncPersonalDataPreferenceController.java
rename to src/com/android/settings/users/AutoSyncPersonalDataPreferenceController.java
index 673b453..79099ad 100644
--- a/src/com/android/settings/accounts/AutoSyncPersonalDataPreferenceController.java
+++ b/src/com/android/settings/users/AutoSyncPersonalDataPreferenceController.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.settings.accounts;
+package com.android.settings.users;
 
 import android.app.Fragment;
 import android.content.Context;
diff --git a/src/com/android/settings/accounts/AutoSyncWorkDataPreferenceController.java b/src/com/android/settings/users/AutoSyncWorkDataPreferenceController.java
similarity index 96%
rename from src/com/android/settings/accounts/AutoSyncWorkDataPreferenceController.java
rename to src/com/android/settings/users/AutoSyncWorkDataPreferenceController.java
index acf43aa..1970195 100644
--- a/src/com/android/settings/accounts/AutoSyncWorkDataPreferenceController.java
+++ b/src/com/android/settings/users/AutoSyncWorkDataPreferenceController.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.settings.accounts;
+package com.android.settings.users;
 
 import android.app.Fragment;
 import android.content.Context;
diff --git a/src/com/android/settings/users/UserCapabilities.java b/src/com/android/settings/users/UserCapabilities.java
index a92e3e2..084a5db 100644
--- a/src/com/android/settings/users/UserCapabilities.java
+++ b/src/com/android/settings/users/UserCapabilities.java
@@ -41,6 +41,7 @@
     public static UserCapabilities create(Context context) {
         UserManager userManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
         UserCapabilities caps = new UserCapabilities();
+
         if (!UserManager.supportsMultipleUsers() || Utils.isMonkeyRunning()) {
             caps.mEnabled = false;
             return caps;
diff --git a/src/com/android/settings/users/UserSettings.java b/src/com/android/settings/users/UserSettings.java
index 834166b..a8fab13 100644
--- a/src/com/android/settings/users/UserSettings.java
+++ b/src/com/android/settings/users/UserSettings.java
@@ -103,6 +103,7 @@
     private static final String KEY_USER_LIST = "user_list";
     private static final String KEY_USER_ME = "user_me";
     private static final String KEY_ADD_USER = "user_add";
+    private static final String KEY_ADD_USER_WHEN_LOCKED = "user_settings_add_users_when_locked";
 
     private static final int MENU_REMOVE_USER = Menu.FIRST;
 
@@ -145,8 +146,11 @@
     private SparseArray<Bitmap> mUserIcons = new SparseArray<>();
     private static SparseArray<Bitmap> sDarkDefaultUserBitmapCache = new SparseArray<>();
 
-    private EditUserInfoController mEditUserInfoController =
-            new EditUserInfoController();
+    private EditUserInfoController mEditUserInfoController = new EditUserInfoController();
+    private AddUserWhenLockedPreferenceController mAddUserWhenLockedPreferenceController;
+    private AutoSyncDataPreferenceController mAutoSyncDataPreferenceController;
+    private AutoSyncPersonalDataPreferenceController mAutoSyncPersonalDataPreferenceController;
+    private AutoSyncWorkDataPreferenceController mAutoSyncWorkDataPreferenceController;
 
     // A place to cache the generated default avatar
     private Drawable mDefaultIconDrawable;
@@ -191,6 +195,28 @@
     @Override
     public void onCreate(Bundle icicle) {
         super.onCreate(icicle);
+        addPreferencesFromResource(R.xml.user_settings);
+        if (Global.getInt(getContext().getContentResolver(), Global.DEVICE_PROVISIONED, 0) == 0) {
+            getActivity().finish();
+            return;
+        }
+        final Context context = getActivity();
+        mAddUserWhenLockedPreferenceController = new AddUserWhenLockedPreferenceController(
+                context, KEY_ADD_USER_WHEN_LOCKED, getLifecycle());
+
+        mAutoSyncDataPreferenceController = new AutoSyncDataPreferenceController(context, this);
+        mAutoSyncPersonalDataPreferenceController =
+                new AutoSyncPersonalDataPreferenceController(context, this);
+        mAutoSyncWorkDataPreferenceController =
+                new AutoSyncWorkDataPreferenceController(context, this);
+
+        final PreferenceScreen screen = getPreferenceScreen();
+        mAddUserWhenLockedPreferenceController.displayPreference(screen);
+        mAutoSyncDataPreferenceController.displayPreference(screen);
+        mAutoSyncPersonalDataPreferenceController.displayPreference(screen);
+        mAutoSyncWorkDataPreferenceController.displayPreference(screen);
+        screen.findPreference(mAddUserWhenLockedPreferenceController.getPreferenceKey())
+                .setOnPreferenceChangeListener(mAddUserWhenLockedPreferenceController);
 
         if (icicle != null) {
             if (icicle.containsKey(SAVE_ADDING_USER)) {
@@ -201,7 +227,7 @@
             }
             mEditUserInfoController.onRestoreInstanceState(icicle);
         }
-        final Context context = getActivity();
+
         mUserCaps = UserCapabilities.create(context);
         mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
         if (!mUserCaps.mEnabled) {
@@ -210,7 +236,6 @@
 
         final int myUserId = UserHandle.myUserId();
 
-        addPreferencesFromResource(R.xml.user_settings);
         mUserListCategory = (PreferenceGroup) findPreference(KEY_USER_LIST);
         mMePreference = new UserPreference(getPrefContext(), null /* attrs */, myUserId,
                 null /* settings icon handler */,
@@ -230,25 +255,40 @@
                 mAddUser.setTitle(R.string.user_add_user_menu);
             }
         }
-        setHasOptionsMenu(true);
-        IntentFilter filter = new IntentFilter(Intent.ACTION_USER_REMOVED);
+        final IntentFilter filter = new IntentFilter(Intent.ACTION_USER_REMOVED);
         filter.addAction(Intent.ACTION_USER_INFO_CHANGED);
         context.registerReceiverAsUser(mUserChangeReceiver, UserHandle.ALL, filter, null, mHandler);
         loadProfile();
         updateUserList();
         mShouldUpdateUserList = false;
-
-        if (Global.getInt(getContext().getContentResolver(), Global.DEVICE_PROVISIONED, 0) == 0) {
-            getActivity().finish();
-            return;
-        }
     }
 
     @Override
     public void onResume() {
         super.onResume();
 
-        if (!mUserCaps.mEnabled) return;
+        if (!mUserCaps.mEnabled) {
+            return;
+        }
+        final PreferenceScreen screen = getPreferenceScreen();
+
+        if (mAutoSyncDataPreferenceController.isAvailable()) {
+            mAutoSyncDataPreferenceController.updateState(screen.findPreference(
+                    mAutoSyncDataPreferenceController.getPreferenceKey()));
+        }
+        if (mAddUserWhenLockedPreferenceController.isAvailable()) {
+            mAddUserWhenLockedPreferenceController.updateState(screen.findPreference(
+                    mAddUserWhenLockedPreferenceController.getPreferenceKey()));
+        }
+        if (mAutoSyncPersonalDataPreferenceController.isAvailable()) {
+            mAutoSyncPersonalDataPreferenceController.updateState(screen.findPreference(
+                    mAutoSyncPersonalDataPreferenceController.getPreferenceKey()));
+        }
+        if (mAutoSyncWorkDataPreferenceController.isAvailable()) {
+            mAutoSyncWorkDataPreferenceController.updateState(screen.findPreference(
+                    mAutoSyncWorkDataPreferenceController.getPreferenceKey()));
+        }
+
         if (mShouldUpdateUserList) {
             mUserCaps.updateAddUserCapabilities(getActivity());
             loadProfile();
@@ -266,7 +306,9 @@
     public void onDestroy() {
         super.onDestroy();
 
-        if (!mUserCaps.mEnabled) return;
+        if (!mUserCaps.mEnabled) {
+            return;
+        }
 
         getActivity().unregisterReceiver(mUserChangeReceiver);
     }
@@ -286,6 +328,20 @@
     }
 
     @Override
+    public boolean onPreferenceTreeClick(Preference preference) {
+        if (mAutoSyncDataPreferenceController.handlePreferenceTreeClick(preference)) {
+            return true;
+        }
+        if (mAutoSyncPersonalDataPreferenceController.handlePreferenceTreeClick(preference)) {
+            return true;
+        }
+        if (mAutoSyncWorkDataPreferenceController.handlePreferenceTreeClick(preference)) {
+            return true;
+        }
+        return super.onPreferenceTreeClick(preference);
+    }
+
+    @Override
     public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
         int pos = 0;
         UserManager um = getContext().getSystemService(UserManager.class);
@@ -857,32 +913,24 @@
             loadIconsAsync(missingIcons);
         }
 
-        PreferenceScreen preferenceScreen = getPreferenceScreen();
-        preferenceScreen.removeAll();
-
-        // If profiles are supported, userPreferences will be added to the category labeled
-        // "User & Profiles", otherwise the category is skipped and elements are added directly
-        // to preferenceScreen
-        PreferenceGroup groupToAddUsers;
+        // Remove everything from mUserListCategory and add new users.
+        mUserListCategory.removeAll();
+        // If profiles are supported, mUserListCategory will have a special title
         if (mUserCaps.mCanAddRestrictedProfile) {
-            mUserListCategory.removeAll();
-            mUserListCategory.setOrder(Preference.DEFAULT_ORDER);
-            preferenceScreen.addPreference(mUserListCategory);
-            groupToAddUsers = mUserListCategory;
+            mUserListCategory.setTitle(R.string.user_list_title);
         } else {
-            groupToAddUsers = preferenceScreen;
+            mUserListCategory.setTitle(null);
         }
+
         for (UserPreference userPreference : userPreferences) {
             userPreference.setOrder(Preference.DEFAULT_ORDER);
-            groupToAddUsers.addPreference(userPreference);
+            mUserListCategory.addPreference(userPreference);
         }
 
         // Append Add user to the end of the list
         if ((mUserCaps.mCanAddUser || mUserCaps.mDisallowAddUserSetByAdmin) &&
                 Utils.isDeviceProvisioned(getActivity())) {
             boolean moreUsers = mUserManager.canAddMoreUsers();
-            mAddUser.setOrder(Preference.DEFAULT_ORDER);
-            preferenceScreen.addPreference(mAddUser);
             mAddUser.setEnabled(moreUsers && !mAddingUser);
             if (!moreUsers) {
                 mAddUser.setSummary(getString(R.string.user_add_max_count, getMaxRealUsers()));
diff --git a/tests/robotests/src/com/android/settings/accounts/UserAndAccountDashboardFragmentTest.java b/tests/robotests/src/com/android/settings/accounts/AccountDashboardFragmentTest.java
similarity index 92%
rename from tests/robotests/src/com/android/settings/accounts/UserAndAccountDashboardFragmentTest.java
rename to tests/robotests/src/com/android/settings/accounts/AccountDashboardFragmentTest.java
index 8dba2f2..dff82aa 100644
--- a/tests/robotests/src/com/android/settings/accounts/UserAndAccountDashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/accounts/AccountDashboardFragmentTest.java
@@ -44,19 +44,19 @@
 
 @RunWith(RobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
-public class UserAndAccountDashboardFragmentTest {
+public class AccountDashboardFragmentTest {
 
     private static final String METADATA_CATEGORY = "com.android.settings.category";
     private static final String METADATA_ACCOUNT_TYPE = "com.android.settings.ia.account";
 
     @Mock
     private UserManager mUserManager;
-    private UserAndAccountDashboardFragment mFragment;
+    private AccountDashboardFragment mFragment;
 
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
-        mFragment = new UserAndAccountDashboardFragment();
+        mFragment = new AccountDashboardFragment();
     }
 
     @Test
@@ -85,7 +85,7 @@
     @Test
     public void testSearchIndexProvider_shouldIndexResource() {
         final List<SearchIndexableResource> indexRes =
-                UserAndAccountDashboardFragment.SEARCH_INDEX_DATA_PROVIDER.getXmlResourcesToIndex(
+                AccountDashboardFragment.SEARCH_INDEX_DATA_PROVIDER.getXmlResourcesToIndex(
                         ShadowApplication.getInstance().getApplicationContext(),
                         true /* enabled */);
 
diff --git a/tests/robotests/src/com/android/settings/accounts/AddUserWhenLockedPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/users/AddUserWhenLockedPreferenceControllerTest.java
similarity index 92%
rename from tests/robotests/src/com/android/settings/accounts/AddUserWhenLockedPreferenceControllerTest.java
rename to tests/robotests/src/com/android/settings/users/AddUserWhenLockedPreferenceControllerTest.java
index faaf7db..3882d92 100644
--- a/tests/robotests/src/com/android/settings/accounts/AddUserWhenLockedPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/users/AddUserWhenLockedPreferenceControllerTest.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.settings.accounts;
+package com.android.settings.users;
 
 import static com.google.common.truth.Truth.assertThat;
 import static org.mockito.Answers.RETURNS_DEEP_STUBS;
@@ -22,6 +22,7 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import android.arch.lifecycle.LifecycleOwner;
 import android.content.Context;
 import android.content.pm.UserInfo;
 import android.os.UserManager;
@@ -31,6 +32,7 @@
 import com.android.settings.TestConfig;
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
 import com.android.settingslib.RestrictedSwitchPreference;
+import com.android.settingslib.core.lifecycle.Lifecycle;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -51,6 +53,8 @@
     @Mock(answer = RETURNS_DEEP_STUBS)
     private UserManager mUserManager;
 
+    private LifecycleOwner mLifecycleOwner;
+    private Lifecycle mLifecycle;
     private Context mContext;
     private AddUserWhenLockedPreferenceController mController;
 
@@ -60,7 +64,9 @@
         ShadowApplication shadowContext = ShadowApplication.getInstance();
         shadowContext.setSystemService(Context.USER_SERVICE, mUserManager);
         mContext = shadowContext.getApplicationContext();
-        mController = new AddUserWhenLockedPreferenceController(mContext, "fake_key");
+        mLifecycleOwner = () -> mLifecycle;
+        mLifecycle = new Lifecycle(mLifecycleOwner);
+        mController = new AddUserWhenLockedPreferenceController(mContext, "fake_key", mLifecycle);
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/accounts/AutoSyncDataPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/users/AutoSyncDataPreferenceControllerTest.java
similarity index 98%
rename from tests/robotests/src/com/android/settings/accounts/AutoSyncDataPreferenceControllerTest.java
rename to tests/robotests/src/com/android/settings/users/AutoSyncDataPreferenceControllerTest.java
index 7aa339f..680f080 100644
--- a/tests/robotests/src/com/android/settings/accounts/AutoSyncDataPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/users/AutoSyncDataPreferenceControllerTest.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.settings.accounts;
+package com.android.settings.users;
 
 import static com.google.common.truth.Truth.assertThat;
 import static org.mockito.Answers.RETURNS_DEEP_STUBS;
diff --git a/tests/robotests/src/com/android/settings/accounts/AutoSyncPersonalDataPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/users/AutoSyncPersonalDataPreferenceControllerTest.java
similarity index 98%
rename from tests/robotests/src/com/android/settings/accounts/AutoSyncPersonalDataPreferenceControllerTest.java
rename to tests/robotests/src/com/android/settings/users/AutoSyncPersonalDataPreferenceControllerTest.java
index 597fbd4..50b4ec3 100644
--- a/tests/robotests/src/com/android/settings/accounts/AutoSyncPersonalDataPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/users/AutoSyncPersonalDataPreferenceControllerTest.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.settings.accounts;
+package com.android.settings.users;
 
 import static com.google.common.truth.Truth.assertThat;
 import static org.mockito.Answers.RETURNS_DEEP_STUBS;
diff --git a/tests/robotests/src/com/android/settings/accounts/AutoSyncWorkDataPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/users/AutoSyncWorkDataPreferenceControllerTest.java
similarity index 97%
rename from tests/robotests/src/com/android/settings/accounts/AutoSyncWorkDataPreferenceControllerTest.java
rename to tests/robotests/src/com/android/settings/users/AutoSyncWorkDataPreferenceControllerTest.java
index a25aa28..19f3732 100644
--- a/tests/robotests/src/com/android/settings/accounts/AutoSyncWorkDataPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/users/AutoSyncWorkDataPreferenceControllerTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 The Android Open Source Project
+ * Copyright (C) 2016 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.
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.settings.accounts;
+package com.android.settings.users;
 
 
 import static com.google.common.truth.Truth.assertThat;
@@ -28,8 +28,8 @@
 import android.os.UserHandle;
 import android.os.UserManager;
 
-import com.android.settings.testutils.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
+import com.android.settings.testutils.SettingsRobolectricTestRunner;
 
 import org.junit.Before;
 import org.junit.Test;