diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 6724ff5..a5586f7 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -3009,6 +3009,7 @@
             android:theme="@style/Theme.BottomDialog"
             android:excludeFromRecents="true"
             android:launchMode="singleTop"
+            android:taskAffinity=".panel.SettingsPanelActivity"
             android:exported="true">
                  <intent-filter>
                      <action android:name="android.settings.panel.action.INTERNET_CONNECTIVITY" />
diff --git a/res/layout-land/panel_layout.xml b/res/layout-land/panel_layout.xml
index 3975bfe..049fd0b 100644
--- a/res/layout-land/panel_layout.xml
+++ b/res/layout-land/panel_layout.xml
@@ -20,7 +20,7 @@
               android:orientation="vertical">
 
     <TextView
-        android:id="@+id/title"
+        android:id="@+id/panel_title"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:gravity="center"
diff --git a/res/layout/dialog_firmware_version.xml b/res/layout/dialog_firmware_version.xml
deleted file mode 100644
index 1d5f531..0000000
--- a/res/layout/dialog_firmware_version.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (C) 2017 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.
-  -->
-
-<ScrollView
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content">
-    <LinearLayout
-        android:orientation="vertical"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:padding="@dimen/sim_content_padding">
-
-        <TextView
-            style="@style/device_info_dialog_label"
-            android:id="@+id/firmware_version_label"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:text="@string/firmware_version"/>
-        <TextView
-            style="@style/device_info_dialog_value"
-            android:id="@+id/firmware_version_value"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"/>
-
-        <TextView
-            style="@style/device_info_dialog_label"
-            android:id="@+id/security_patch_level_label"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:text="@string/security_patch"/>
-        <TextView
-            style="@style/device_info_dialog_value"
-            android:id="@+id/security_patch_level_value"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:background="?android:attr/selectableItemBackground"
-            android:textColor="?android:attr/colorAccent"/>
-
-        <TextView
-            style="@style/device_info_dialog_label"
-            android:id="@+id/module_version_label"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:text="@string/module_version"/>
-        <TextView
-            style="@style/device_info_dialog_value"
-            android:id="@+id/module_version_value"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"/>
-
-        <TextView
-            style="@style/device_info_dialog_label"
-            android:id="@+id/baseband_version_label"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:text="@string/baseband_version"/>
-        <TextView
-            style="@style/device_info_dialog_value"
-            android:id="@+id/baseband_version_value"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"/>
-
-        <TextView
-            style="@style/device_info_dialog_label"
-            android:id="@+id/kernel_version_label"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:text="@string/kernel_version"/>
-        <TextView
-            style="@style/device_info_dialog_value"
-            android:id="@+id/kernel_version_value"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"/>
-
-        <TextView
-            style="@style/device_info_dialog_label"
-            android:id="@+id/build_number_label"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:text="@string/build_number"/>
-        <TextView
-            style="@style/device_info_dialog_value"
-            android:id="@+id/build_number_value"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"/>
-
-    </LinearLayout>
-</ScrollView>
diff --git a/res/layout/dialog_hardware_info.xml b/res/layout/dialog_hardware_info.xml
deleted file mode 100644
index 7ea4783..0000000
--- a/res/layout/dialog_hardware_info.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (C) 2017 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.
-  -->
-
-<ScrollView
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content">
-    <LinearLayout
-        android:orientation="vertical"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:padding="24dp">
-
-        <TextView
-            style="@style/device_info_dialog_label"
-            android:id="@+id/model_label"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:text="@string/model_info" />
-        <TextView
-            style="@style/device_info_dialog_value"
-            android:id="@+id/model_value"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content" />
-
-        <TextView
-            style="@style/device_info_dialog_label"
-            android:id="@+id/serial_number_label"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:text="@string/status_serial_number" />
-        <TextView
-            style="@style/device_info_dialog_value"
-            android:id="@+id/serial_number_value"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content" />
-
-        <TextView
-            style="@style/device_info_dialog_label"
-            android:id="@+id/hardware_rev_label"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:text="@string/hardware_revision" />
-        <TextView
-            style="@style/device_info_dialog_value"
-            android:id="@+id/hardware_rev_value"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content" />
-
-    </LinearLayout>
-</ScrollView>
\ No newline at end of file
diff --git a/res/layout/settings_panel.xml b/res/layout/settings_panel.xml
index aec898c..3405ef0 100644
--- a/res/layout/settings_panel.xml
+++ b/res/layout/settings_panel.xml
@@ -16,4 +16,5 @@
 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/main_content"
     android:layout_height="match_parent"
-    android:layout_width="match_parent"/>
\ No newline at end of file
+    android:layout_width="match_parent"
+    android:animateLayoutChanges="true"/>
\ No newline at end of file
diff --git a/res/layout/wifi_button_preference_widget.xml b/res/layout/wifi_button_preference_widget.xml
index 55078c2..1ecb98c 100644
--- a/res/layout/wifi_button_preference_widget.xml
+++ b/res/layout/wifi_button_preference_widget.xml
@@ -19,6 +19,8 @@
            android:id="@+id/button_icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
+           android:minWidth="@dimen/min_tap_target_size"
+           android:minHeight="@dimen/min_tap_target_size"
            android:layout_gravity="center"
            android:background="@null"
            android:visibility="gone"
diff --git a/res/layout/wifi_dialog.xml b/res/layout/wifi_dialog.xml
index 8ee2fba..1ae3bf5 100644
--- a/res/layout/wifi_dialog.xml
+++ b/res/layout/wifi_dialog.xml
@@ -65,9 +65,10 @@
                         android:id="@+id/ssid_scanner_button"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
+                        android:minWidth="@dimen/min_tap_target_size"
+                        android:minHeight="@dimen/min_tap_target_size"
                         android:layout_alignParentEnd="true"
                         android:layout_centerVertical="true"
-                        android:layout_margin="5dp"
                         android:background="@null"
                         android:src="@drawable/ic_scan_24dp"
                         android:contentDescription="@string/wifi_add_network" />
@@ -300,9 +301,10 @@
                         android:id="@+id/password_scanner_button"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
+                        android:minWidth="@dimen/min_tap_target_size"
+                        android:minHeight="@dimen/min_tap_target_size"
                         android:layout_alignParentEnd="true"
                         android:layout_centerVertical="true"
-                        android:layout_margin="5dp"
                         android:background="@null"
                         android:src="@drawable/ic_scan_24dp"
                         android:contentDescription="@string/wifi_add_network" />
diff --git a/res/layout/wifi_network_details_two_buttons_panel.xml b/res/layout/wifi_network_details_two_buttons_panel.xml
index 57f76b5..6c51d11 100644
--- a/res/layout/wifi_network_details_two_buttons_panel.xml
+++ b/res/layout/wifi_network_details_two_buttons_panel.xml
@@ -27,7 +27,6 @@
         android:paddingStart="8dp"
         android:paddingEnd="8dp">
         <Button
-            style="@android:style/@Widget.Material.Button.Colored"
             android:id="@+id/forget_button"
             android:text="@string/forget"
             android:layout_width="0dp"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index f581121..90b72e1 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -2153,6 +2153,10 @@
     <string name="wifi_dpp_could_not_add_device">Couldn\u2019t add device</string>
     <!-- Title for the fragment to show that device found but naming known [CHAR LIMIT=50]  -->
     <string name="wifi_dpp_device_found">Device found</string>
+    <!-- Hint for Wi-Fi DPP handshake running [CHAR LIMIT=NONE]  -->
+    <string name="wifi_dpp_sharing_wifi_with_this_device">Sharing Wi\u2011Fi with this device\u2026</string>
+    <!-- Hint for Wi-Fi DPP handshake running [CHAR LIMIT=NONE]  -->
+    <string name="wifi_dpp_connecting">Connecting\u2026</string>
      <!-- Label for the try again button [CHAR LIMIT=20]-->
     <string name="retry">Retry</string>
     <!-- Label for the check box to share a network with other users on the same device -->
@@ -2927,8 +2931,6 @@
 
     <!-- About phone screen, status item label  [CHAR LIMIT=40] -->
     <string name="firmware_version">Android version</string>
-    <!-- About phone screen, dialog title for showing device software information such as android version, security patch level, etc  [CHAR LIMIT=60] -->
-    <string name="firmware_title">Android</string>
     <!-- About phone screen, status item label  [CHAR LIMIT=60] -->
     <string name="security_patch">Android security patch level</string>
     <!-- About phone screen, status item label  [CHAR LIMIT=40] -->
@@ -3625,7 +3627,7 @@
     <string name="master_clear_final_button_text">Erase everything</string>
     <!-- Master clear failed message -->
     <string name="master_clear_failed">No reset was performed because the System Clear service isn\u2019t available.</string>
-    <!-- Master clear confirmation screen title [CHAR LIMIT=30] -->
+    <!-- Master clear confirmation screen title [CHAR LIMIT=33] -->
     <string name="master_clear_confirm_title">Erase all data?</string>
     <!-- Error message for users that aren't allowed to factory reset [CHAR LIMIT=none] -->
     <string name="master_clear_not_available">Factory reset is not available for this user</string>
diff --git a/res/xml/firmware_version.xml b/res/xml/firmware_version.xml
new file mode 100644
index 0000000..2914ef1
--- /dev/null
+++ b/res/xml/firmware_version.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Copyright (C) 2019 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="firmware_version_screen"
+    android:title="@string/firmware_version"
+    settings:keywords="@string/keywords_android_version">
+
+    <!-- Android version -->
+    <Preference
+        android:key="os_firmware_version"
+        android:title="@string/firmware_version"
+        android:summary="@string/summary_placeholder"
+        settings:enableCopying="true"
+        settings:allowDynamicSummaryInSlice="true"
+        settings:controller="com.android.settings.deviceinfo.firmwareversion.FirmwareVersionDetailPreferenceController"/>
+
+    <!-- Security patch -->
+    <Preference
+        android:key="security_key"
+        android:title="@string/security_patch"
+        settings:enableCopying="true"
+        settings:controller="com.android.settings.deviceinfo.firmwareversion.SecurityPatchLevelPreferenceController"/>
+
+    <!-- Mainline module version -->
+    <Preference
+        android:key="module_version"
+        android:title="@string/module_version"
+        android:summary="@string/summary_placeholder"
+        settings:enableCopying="true"
+        settings:controller="com.android.settings.deviceinfo.firmwareversion.MainlineModuleVersionPreferenceController"/>
+
+    <!-- Baseband -->
+    <Preference
+        android:key="base_band"
+        android:title="@string/baseband_version"
+        android:summary="@string/summary_placeholder"
+        settings:enableCopying="true"
+        settings:controller="com.android.settings.deviceinfo.firmwareversion.BasebandVersionPreferenceController"/>
+
+    <!-- Kernel -->
+    <Preference
+        android:key="kernel_version"
+        android:title="@string/kernel_version"
+        android:summary="@string/summary_placeholder"
+        settings:enableCopying="true"
+        settings:controller="com.android.settings.deviceinfo.firmwareversion.KernelVersionPreferenceController"/>
+
+    <!-- Build -->
+    <Preference
+        android:key="os_build_number"
+        android:title="@string/build_number"
+        android:summary="@string/summary_placeholder"
+        settings:enableCopying="true"
+        settings:controller="com.android.settings.deviceinfo.firmwareversion.SimpleBuildNumberPreferenceController"/>
+
+</PreferenceScreen>
\ No newline at end of file
diff --git a/res/xml/hardware_info.xml b/res/xml/hardware_info.xml
new file mode 100644
index 0000000..2e35101
--- /dev/null
+++ b/res/xml/hardware_info.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Copyright (C) 2019 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="hardware_info_screen"
+    android:title="@string/hardware_info"
+    settings:keywords="@string/keywords_model_and_hardware">
+
+    <!-- Model -->
+    <Preference
+        android:key="hardware_info_device_model"
+        android:title="@string/model_info"
+        android:summary="@string/summary_placeholder"
+        settings:allowDynamicSummaryInSlice="true"
+        settings:controller="com.android.settings.deviceinfo.hardwareinfo.DeviceModelPreferenceController"
+        settings:enableCopying="true"/>
+
+    <!-- SerialNumber -->
+    <Preference
+        android:key="hardware_info_device_serial"
+        android:title="@string/status_serial_number"
+        android:summary="@string/summary_placeholder"
+        settings:allowDynamicSummaryInSlice="true"
+        settings:controller="com.android.settings.deviceinfo.hardwareinfo.SerialNumberPreferenceController"
+        settings:enableCopying="true"/>
+
+    <!-- Hardware revision -->
+    <Preference
+        android:key="hardware_info_device_revision"
+        android:title="@string/hardware_revision"
+        android:summary="@string/summary_placeholder"
+        settings:allowDynamicSummaryInSlice="true"
+        settings:controller="com.android.settings.deviceinfo.hardwareinfo.HardwareRevisionPreferenceController"
+        settings:enableCopying="true"/>
+
+</PreferenceScreen>
\ No newline at end of file
diff --git a/res/xml/my_device_info.xml b/res/xml/my_device_info.xml
index 6323a14..83bf5c4 100644
--- a/res/xml/my_device_info.xml
+++ b/res/xml/my_device_info.xml
@@ -105,7 +105,8 @@
         settings:keywords="@string/keywords_model_and_hardware"
         android:summary="@string/summary_placeholder"
         settings:allowDynamicSummaryInSlice="true"
-        settings:controller="com.android.settings.deviceinfo.DeviceModelPreferenceController"/>
+        android:fragment="com.android.settings.deviceinfo.hardwareinfo.HardwareInfoFragment"
+        settings:controller="com.android.settings.deviceinfo.HardwareInfoPreferenceController"/>
 
     <!-- IMEI -->
     <Preference
@@ -121,11 +122,10 @@
         android:key="firmware_version"
         android:order="32"
         android:title="@string/firmware_version"
-        settings:keywords="@string/keywords_android_version"
         android:summary="@string/summary_placeholder"
         settings:allowDynamicSummaryInSlice="true"
-        settings:controller=
-            "com.android.settings.deviceinfo.firmwareversion.FirmwareVersionPreferenceController"/>
+        android:fragment="com.android.settings.deviceinfo.firmwareversion.FirmwareVersionSettings"
+        settings:controller="com.android.settings.deviceinfo.firmwareversion.FirmwareVersionPreferenceController"/>
 
     <!--IP address -->
     <Preference
diff --git a/src/com/android/settings/applications/RecentAppsPreferenceController.java b/src/com/android/settings/applications/RecentAppsPreferenceController.java
index fe52a8b..838d758 100644
--- a/src/com/android/settings/applications/RecentAppsPreferenceController.java
+++ b/src/com/android/settings/applications/RecentAppsPreferenceController.java
@@ -82,6 +82,8 @@
     Preference mAllAppPref;
     @VisibleForTesting
     Preference mDivider;
+    @VisibleForTesting
+    boolean mIsFirstLaunch;
 
     private final PackageManager mPm;
     private final UsageStatsManager mUsageStatsManager;
@@ -93,6 +95,7 @@
     private Fragment mHost;
     private Calendar mCal;
     private List<UsageStats> mStats;
+    private List<UsageStats> mRecentApps;
     private boolean mHasRecentApps;
 
     static {
@@ -115,6 +118,9 @@
         mIconDrawableFactory = IconDrawableFactory.newInstance(mContext);
         mPowerManager = mContext.getSystemService(PowerManager.class);
         mUsageStatsManager = mContext.getSystemService(UsageStatsManager.class);
+        mRecentApps = new ArrayList<>();
+        mIsFirstLaunch = true;
+        reloadData();
     }
 
     public void setFragment(Fragment fragment) {
@@ -123,8 +129,7 @@
 
     @Override
     public int getAvailabilityStatus() {
-        reloadData();
-        return getDisplayableRecentAppList().isEmpty() ? AVAILABLE_UNSEARCHABLE : AVAILABLE;
+        return mRecentApps.isEmpty() ? AVAILABLE_UNSEARCHABLE : AVAILABLE;
     }
 
     @Override
@@ -152,7 +157,11 @@
     @Override
     public void updateState(Preference preference) {
         super.updateState(preference);
-        refreshUi();
+        // In order to improve launch time, we don't load data again at first launch.
+        if (!mIsFirstLaunch) {
+            reloadData();
+            refreshUi();
+        }
         // Show total number of installed apps as See all's summary.
         new InstalledAppCounter(mContext, InstalledAppCounter.IGNORE_INSTALL_REASON,
                 mContext.getPackageManager()) {
@@ -167,6 +176,7 @@
                 }
             }
         }.execute();
+        mIsFirstLaunch = false;
     }
 
     @Override
@@ -177,11 +187,9 @@
 
     @VisibleForTesting
     void refreshUi() {
-        reloadData();
-        final List<UsageStats> recentApps = getDisplayableRecentAppList();
-        if (recentApps != null && !recentApps.isEmpty()) {
+        if (mRecentApps != null && !mRecentApps.isEmpty()) {
             mHasRecentApps = true;
-            displayRecentApps(recentApps);
+            displayRecentApps();
         } else {
             mHasRecentApps = false;
             displayOnlyAppInfo();
@@ -197,6 +205,8 @@
                 : mUsageStatsManager.queryUsageStats(
                         UsageStatsManager.INTERVAL_BEST, mCal.getTimeInMillis(),
                         System.currentTimeMillis());
+
+        updateDisplayableRecentAppList();
     }
 
     private void displayOnlyAppInfo() {
@@ -206,10 +216,10 @@
         mRecentAppsPreference.setVisible(false);
     }
 
-    private void displayRecentApps(List<UsageStats> recentApps) {
+    private void displayRecentApps() {
         int showAppsCount = 0;
 
-        for (UsageStats stat : recentApps) {
+        for (UsageStats stat : mRecentApps) {
             final AppEntityInfo appEntityInfoInfo = createAppEntity(stat);
             if (appEntityInfoInfo != null) {
                 mAppEntitiesController.setAppEntity(showAppsCount++, appEntityInfoInfo);
@@ -246,8 +256,8 @@
                 .build();
     }
 
-    private List<UsageStats> getDisplayableRecentAppList() {
-        final List<UsageStats> recentApps = new ArrayList<>();
+    private void updateDisplayableRecentAppList() {
+        mRecentApps.clear();
         final Map<String, UsageStats> map = new ArrayMap<>();
         final int statCount = mStats.size();
         for (int i = 0; i < statCount; i++) {
@@ -273,13 +283,12 @@
             if (appEntry == null) {
                 continue;
             }
-            recentApps.add(stat);
+            mRecentApps.add(stat);
             count++;
             if (count >= AppEntitiesHeaderController.MAXIMUM_APPS) {
                 break;
             }
         }
-        return recentApps;
     }
 
 
diff --git a/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminListItem.java b/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminListItem.java
index 305281c..370a4df 100644
--- a/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminListItem.java
+++ b/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminListItem.java
@@ -30,6 +30,7 @@
 
     private static final String TAG = "DeviceAdminListItem";
 
+    private final UserHandle mUserHandle;
     private final String mKey;
     private final DeviceAdminInfo mInfo;
     private final CharSequence mName;
@@ -39,7 +40,8 @@
 
     public DeviceAdminListItem(Context context, DeviceAdminInfo info) {
         mInfo = info;
-        mKey = mInfo.getComponent().flattenToString();
+        mUserHandle = new UserHandle(getUserIdFromDeviceAdminInfo(mInfo));
+        mKey = mUserHandle.getIdentifier() + "@" + mInfo.getComponent().flattenToString();
         mDPM = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE);
         final PackageManager pm = context.getPackageManager();
         mName = mInfo.loadLabel(pm);
@@ -48,8 +50,7 @@
         } catch (Resources.NotFoundException exception) {
             Log.w(TAG, "Setting description to null because can't find resource: " + mKey);
         }
-        mIcon = pm.getUserBadgedIcon(mInfo.loadIcon(pm),
-                new UserHandle(DeviceAdminUtils.getUserIdFromDeviceAdminInfo(mInfo)));
+        mIcon = pm.getUserBadgedIcon(mInfo.loadIcon(pm), mUserHandle);
     }
 
     @Override
@@ -70,8 +71,7 @@
     }
 
     public boolean isActive() {
-        return mDPM.isAdminActiveAsUser(mInfo.getComponent(),
-                DeviceAdminUtils.getUserIdFromDeviceAdminInfo(mInfo));
+        return mDPM.isAdminActiveAsUser(mInfo.getComponent(), getUserIdFromDeviceAdminInfo(mInfo));
     }
 
     public Drawable getIcon() {
@@ -79,16 +79,25 @@
     }
 
     public boolean isEnabled() {
-        return !mDPM.isRemovingAdmin(mInfo.getComponent(),
-                DeviceAdminUtils.getUserIdFromDeviceAdminInfo(mInfo));
+        return !mDPM.isRemovingAdmin(mInfo.getComponent(), getUserIdFromDeviceAdminInfo(mInfo));
     }
 
     public UserHandle getUser() {
-        return new UserHandle(DeviceAdminUtils.getUserIdFromDeviceAdminInfo(mInfo));
+        return new UserHandle(getUserIdFromDeviceAdminInfo(mInfo));
     }
 
     public Intent getLaunchIntent(Context context) {
         return new Intent(context, DeviceAdminAdd.class)
                 .putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, mInfo.getComponent());
     }
+
+    /**
+     * Extracts the user id from a device admin info object.
+     *
+     * @param adminInfo the device administrator info.
+     * @return identifier of the user associated with the device admin.
+     */
+    private static int getUserIdFromDeviceAdminInfo(DeviceAdminInfo adminInfo) {
+        return UserHandle.getUserId(adminInfo.getActivityInfo().applicationInfo.uid);
+    }
 }
diff --git a/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminListPreferenceController.java b/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminListPreferenceController.java
index 319d62f..7b139d9 100644
--- a/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminListPreferenceController.java
+++ b/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminListPreferenceController.java
@@ -53,6 +53,9 @@
 import com.android.settingslib.widget.FooterPreference;
 import com.android.settingslib.widget.FooterPreferenceMixinCompat;
 
+import org.xmlpull.v1.XmlPullParserException;
+
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -249,8 +252,7 @@
                 Log.w(TAG, "Unable to load component: " + activeAdmin);
                 continue;
             }
-            final DeviceAdminInfo deviceAdminInfo = DeviceAdminUtils.createDeviceAdminInfo(
-                    mContext, ai);
+            final DeviceAdminInfo deviceAdminInfo = createDeviceAdminInfo(mContext, ai);
             if (deviceAdminInfo == null) {
                 continue;
             }
@@ -286,7 +288,7 @@
                     && alreadyAddedComponents.contains(riComponentName)) {
                 continue;
             }
-            DeviceAdminInfo deviceAdminInfo = DeviceAdminUtils.createDeviceAdminInfo(
+            DeviceAdminInfo deviceAdminInfo = createDeviceAdminInfo(
                     mContext, resolveInfo.activityInfo);
             // add only visible ones (note: active admins are added regardless of visibility)
             if (deviceAdminInfo != null && deviceAdminInfo.isVisible()) {
@@ -297,4 +299,20 @@
             }
         }
     }
+
+    /**
+     * Creates a device admin info object for the resolved intent that points to the component of
+     * the device admin.
+     *
+     * @param ai ActivityInfo for the admin component.
+     * @return new {@link DeviceAdminInfo} object or null if there was an error.
+     */
+    private static DeviceAdminInfo createDeviceAdminInfo(Context context, ActivityInfo ai) {
+        try {
+            return new DeviceAdminInfo(context, ai);
+        } catch (XmlPullParserException | IOException e) {
+            Log.w(TAG, "Skipping " + ai, e);
+        }
+        return null;
+    }
 }
diff --git a/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminUtils.java b/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminUtils.java
deleted file mode 100644
index 13d9d20..0000000
--- a/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminUtils.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 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.applications.specialaccess.deviceadmin;
-
-import android.app.admin.DeviceAdminInfo;
-import android.content.Context;
-import android.content.pm.ActivityInfo;
-import android.os.UserHandle;
-import android.util.Log;
-
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.io.IOException;
-
-public class DeviceAdminUtils {
-
-    private static final String TAG = "DeviceAdminUtils";
-
-    /**
-     * Creates a device admin info object for the resolved intent that points to the component of
-     * the device admin.
-     *
-     * @param ai ActivityInfo for the admin component.
-     * @return new {@link DeviceAdminInfo} object or null if there was an error.
-     */
-    public static DeviceAdminInfo createDeviceAdminInfo(Context context, ActivityInfo ai) {
-        try {
-            return new DeviceAdminInfo(context, ai);
-        } catch (XmlPullParserException | IOException e) {
-            Log.w(TAG, "Skipping " + ai, e);
-        }
-        return null;
-    }
-
-    /**
-     * Extracts the user id from a device admin info object.
-     *
-     * @param adminInfo the device administrator info.
-     * @return identifier of the user associated with the device admin.
-     */
-    public static int getUserIdFromDeviceAdminInfo(DeviceAdminInfo adminInfo) {
-        return UserHandle.getUserId(adminInfo.getActivityInfo().applicationInfo.uid);
-    }
-}
diff --git a/src/com/android/settings/bluetooth/AdvancedBluetoothDetailsHeaderController.java b/src/com/android/settings/bluetooth/AdvancedBluetoothDetailsHeaderController.java
index 34a758b..64c9866 100644
--- a/src/com/android/settings/bluetooth/AdvancedBluetoothDetailsHeaderController.java
+++ b/src/com/android/settings/bluetooth/AdvancedBluetoothDetailsHeaderController.java
@@ -16,6 +16,7 @@
 
 package com.android.settings.bluetooth;
 
+import android.bluetooth.BluetoothAdapter;
 import android.bluetooth.BluetoothDevice;
 import android.content.Context;
 import android.graphics.Bitmap;
@@ -23,6 +24,8 @@
 import android.graphics.PorterDuffColorFilter;
 import android.graphics.drawable.Drawable;
 import android.net.Uri;
+import android.os.Handler;
+import android.os.Looper;
 import android.provider.MediaStore;
 import android.util.Log;
 import android.view.View;
@@ -59,9 +62,25 @@
     @VisibleForTesting
     final Map<String, Bitmap> mIconCache;
     private CachedBluetoothDevice mCachedDevice;
+    @VisibleForTesting
+    BluetoothAdapter mBluetoothAdapter;
+    @VisibleForTesting
+    Handler mHandler = new Handler(Looper.getMainLooper());
+    @VisibleForTesting
+    final BluetoothAdapter.MetadataListener mMetadataListener =
+            new BluetoothAdapter.MetadataListener() {
+                @Override
+                public void onMetadataChanged(BluetoothDevice device, int key, String value) {
+                    super.onMetadataChanged(device, key, value);
+                    Log.i(TAG, String.format("Metadata updated in Device %s: %d = %s.", device, key,
+                            value));
+                    refresh();
+                }
+            };
 
     public AdvancedBluetoothDetailsHeaderController(Context context, String prefKey) {
         super(context, prefKey);
+        mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
         mIconCache = new HashMap<>();
     }
 
@@ -84,11 +103,14 @@
     @Override
     public void onStart() {
         mCachedDevice.registerCallback(this::onDeviceAttributesChanged);
+        mBluetoothAdapter.registerMetadataListener(mCachedDevice.getDevice(), mMetadataListener,
+                mHandler);
     }
 
     @Override
     public void onStop() {
         mCachedDevice.unregisterCallback(this::onDeviceAttributesChanged);
+        mBluetoothAdapter.unregisterMetadataListener(mCachedDevice.getDevice());
 
         // Destroy icon bitmap associated with this header
         for (Bitmap bitmap : mIconCache.values()) {
diff --git a/src/com/android/settings/core/gateway/SettingsGateway.java b/src/com/android/settings/core/gateway/SettingsGateway.java
index 60655fe..5e32e71 100644
--- a/src/com/android/settings/core/gateway/SettingsGateway.java
+++ b/src/com/android/settings/core/gateway/SettingsGateway.java
@@ -49,9 +49,9 @@
 import com.android.settings.applications.specialaccess.pictureinpicture.PictureInPictureDetails;
 import com.android.settings.applications.specialaccess.pictureinpicture.PictureInPictureSettings;
 import com.android.settings.applications.specialaccess.vrlistener.VrListenerSettings;
-import com.android.settings.backup.UserBackupSettingsActivity;
 import com.android.settings.backup.PrivacySettings;
 import com.android.settings.backup.ToggleBackupSettingFragment;
+import com.android.settings.backup.UserBackupSettingsActivity;
 import com.android.settings.biometrics.face.FaceSettings;
 import com.android.settings.bluetooth.BluetoothDeviceDetailsFragment;
 import com.android.settings.connecteddevice.AdvancedConnectedDeviceDashboardFragment;
@@ -68,6 +68,7 @@
 import com.android.settings.deviceinfo.StorageDashboardFragment;
 import com.android.settings.deviceinfo.StorageSettings;
 import com.android.settings.deviceinfo.aboutphone.MyDeviceInfoFragment;
+import com.android.settings.deviceinfo.firmwareversion.FirmwareVersionSettings;
 import com.android.settings.display.NightDisplaySettings;
 import com.android.settings.dream.DreamSettings;
 import com.android.settings.enterprise.EnterprisePrivacySettings;
@@ -166,6 +167,7 @@
             DisplaySettings.class.getName(),
             MyDeviceInfoFragment.class.getName(),
             ManageApplications.class.getName(),
+            FirmwareVersionSettings.class.getName(),
             ManageAssist.class.getName(),
             ProcessStatsUi.class.getName(),
             NotificationStation.class.getName(),
diff --git a/src/com/android/settings/development/FileEncryptionPreferenceController.java b/src/com/android/settings/development/FileEncryptionPreferenceController.java
index 8aadfb9..82a58ba 100644
--- a/src/com/android/settings/development/FileEncryptionPreferenceController.java
+++ b/src/com/android/settings/development/FileEncryptionPreferenceController.java
@@ -63,7 +63,8 @@
 
     @Override
     public void updateState(Preference preference) {
-        if (!TextUtils.equals("file", CryptoProperties.type().orElse("none"))) {
+        if (CryptoProperties.type().orElse(CryptoProperties.type_values.NONE) !=
+            CryptoProperties.type_values.FILE) {
             return;
         }
 
diff --git a/src/com/android/settings/deviceinfo/BuildNumberPreferenceController.java b/src/com/android/settings/deviceinfo/BuildNumberPreferenceController.java
index ec0ab36..f13af94 100644
--- a/src/com/android/settings/deviceinfo/BuildNumberPreferenceController.java
+++ b/src/com/android/settings/deviceinfo/BuildNumberPreferenceController.java
@@ -42,7 +42,6 @@
 import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settings.overlay.FeatureFactory;
 import com.android.settings.password.ChooseLockSettingsHelper;
-import com.android.settings.slices.Copyable;
 import com.android.settingslib.RestrictedLockUtils;
 import com.android.settingslib.RestrictedLockUtilsInternal;
 import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
@@ -50,7 +49,7 @@
 import com.android.settingslib.core.lifecycle.events.OnStart;
 import com.android.settingslib.development.DevelopmentSettingsEnabler;
 
-public class BuildNumberPreferenceController extends BasePreferenceController implements Copyable,
+public class BuildNumberPreferenceController extends BasePreferenceController implements
         LifecycleObserver, OnStart {
 
     static final int TAPS_TO_BE_A_DEVELOPER = 7;
@@ -109,6 +108,11 @@
     }
 
     @Override
+    public boolean isCopyableSlice() {
+        return true;
+    }
+
+    @Override
     public void copy() {
         final ClipboardManager clipboard = (ClipboardManager) mContext.getSystemService(
                 CLIPBOARD_SERVICE);
diff --git a/src/com/android/settings/deviceinfo/HardwareInfoDialogFragment.java b/src/com/android/settings/deviceinfo/HardwareInfoDialogFragment.java
deleted file mode 100644
index 34a7143..0000000
--- a/src/com/android/settings/deviceinfo/HardwareInfoDialogFragment.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2017 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.deviceinfo;
-
-import android.app.Dialog;
-import android.app.settings.SettingsEnums;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.SystemProperties;
-import android.text.TextUtils;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.widget.TextView;
-
-import androidx.annotation.VisibleForTesting;
-import androidx.appcompat.app.AlertDialog;
-
-import com.android.settings.R;
-import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
-
-public class HardwareInfoDialogFragment extends InstrumentedDialogFragment {
-
-    public static final String TAG = "HardwareInfo";
-
-    @Override
-    public int getMetricsCategory() {
-        return SettingsEnums.DIALOG_SETTINGS_HARDWARE_INFO;
-    }
-
-    public static HardwareInfoDialogFragment newInstance() {
-        final HardwareInfoDialogFragment fragment = new HardwareInfoDialogFragment();
-        return fragment;
-    }
-
-    @Override
-    public Dialog onCreateDialog(Bundle savedInstanceState) {
-        final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())
-                .setTitle(R.string.hardware_info)
-                .setPositiveButton(android.R.string.ok, null);
-        final View content = LayoutInflater.from(builder.getContext())
-                .inflate(R.layout.dialog_hardware_info, null /* parent */);
-        // Model
-        setText(content, R.id.model_label, R.id.model_value,
-                DeviceModelPreferenceController.getDeviceModel());
-
-        // Serial number
-        setText(content, R.id.serial_number_label, R.id.serial_number_value, getSerialNumber());
-
-        // Hardware rev
-        setText(content, R.id.hardware_rev_label, R.id.hardware_rev_value,
-                SystemProperties.get("ro.boot.hardware.revision"));
-
-        return builder.setView(content).create();
-    }
-
-    @VisibleForTesting
-    void setText(View content, int labelViewId, int valueViewId, String value) {
-        if (content == null) {
-            return;
-        }
-        final View labelView = content.findViewById(labelViewId);
-        final TextView valueView = content.findViewById(valueViewId);
-        if (!TextUtils.isEmpty(value)) {
-            labelView.setVisibility(View.VISIBLE);
-            valueView.setVisibility(View.VISIBLE);
-            valueView.setText(value);
-        } else {
-            labelView.setVisibility(View.GONE);
-            valueView.setVisibility(View.GONE);
-        }
-    }
-
-    @VisibleForTesting
-    String getSerialNumber() {
-        return Build.getSerial();
-    }
-}
diff --git a/src/com/android/settings/deviceinfo/DeviceModelPreferenceController.java b/src/com/android/settings/deviceinfo/HardwareInfoPreferenceController.java
similarity index 71%
rename from src/com/android/settings/deviceinfo/DeviceModelPreferenceController.java
rename to src/com/android/settings/deviceinfo/HardwareInfoPreferenceController.java
index 2797153..29f1391 100644
--- a/src/com/android/settings/deviceinfo/DeviceModelPreferenceController.java
+++ b/src/com/android/settings/deviceinfo/HardwareInfoPreferenceController.java
@@ -17,11 +17,8 @@
 
 import android.content.Context;
 import android.os.Build;
-import android.text.TextUtils;
 import android.util.Log;
 
-import androidx.fragment.app.Fragment;
-import androidx.preference.Preference;
 import androidx.preference.PreferenceScreen;
 
 import com.android.settings.R;
@@ -31,21 +28,14 @@
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.FutureTask;
 
-public class DeviceModelPreferenceController extends BasePreferenceController {
-
+public class HardwareInfoPreferenceController extends BasePreferenceController {
 
     private static final String TAG = "DeviceModelPrefCtrl";
 
-    private Fragment mHost;
-
-    public DeviceModelPreferenceController(Context context, String key) {
+    public HardwareInfoPreferenceController(Context context, String key) {
         super(context, key);
     }
 
-    public void setHost(Fragment fragment) {
-        mHost = fragment;
-    }
-
     @Override
     public void displayPreference(PreferenceScreen screen) {
         super.displayPreference(screen);
@@ -54,7 +44,7 @@
     @Override
     public int getAvailabilityStatus() {
         return mContext.getResources().getBoolean(R.bool.config_show_device_model)
-                ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
+                ? AVAILABLE_UNSEARCHABLE : UNSUPPORTED_ON_DEVICE;
     }
 
     @Override
@@ -62,21 +52,6 @@
         return mContext.getResources().getString(R.string.model_summary, getDeviceModel());
     }
 
-    @Override
-    public boolean handlePreferenceTreeClick(Preference preference) {
-        if (!TextUtils.equals(preference.getKey(), getPreferenceKey())) {
-            return false;
-        }
-        final HardwareInfoDialogFragment fragment = HardwareInfoDialogFragment.newInstance();
-        fragment.show(mHost.getFragmentManager(), HardwareInfoDialogFragment.TAG);
-        return true;
-    }
-
-    @Override
-    public boolean isSliceable() {
-        return true;
-    }
-
     public static String getDeviceModel() {
         FutureTask<String> msvSuffixTask = new FutureTask<>(() -> DeviceInfoUtils.getMsvSuffix());
 
diff --git a/src/com/android/settings/deviceinfo/PhoneNumberPreferenceController.java b/src/com/android/settings/deviceinfo/PhoneNumberPreferenceController.java
index 598dfb1..3767860 100644
--- a/src/com/android/settings/deviceinfo/PhoneNumberPreferenceController.java
+++ b/src/com/android/settings/deviceinfo/PhoneNumberPreferenceController.java
@@ -35,14 +35,12 @@
 
 import com.android.settings.R;
 import com.android.settings.core.BasePreferenceController;
-import com.android.settings.slices.Copyable;
 import com.android.settingslib.DeviceInfoUtils;
 
 import java.util.ArrayList;
 import java.util.List;
 
-public class PhoneNumberPreferenceController extends BasePreferenceController implements
-        Copyable {
+public class PhoneNumberPreferenceController extends BasePreferenceController {
 
     private final static String KEY_PHONE_NUMBER = "phone_number";
 
@@ -99,6 +97,11 @@
     }
 
     @Override
+    public boolean isCopyableSlice() {
+        return true;
+    }
+
+    @Override
     public void copy() {
         final ClipboardManager clipboard = (ClipboardManager) mContext.getSystemService(
                 CLIPBOARD_SERVICE);
diff --git a/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java b/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java
index 0116c42..e6afb7b 100644
--- a/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java
+++ b/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java
@@ -31,7 +31,6 @@
 import com.android.settings.dashboard.DashboardFragment;
 import com.android.settings.deviceinfo.BluetoothAddressPreferenceController;
 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;
@@ -41,7 +40,6 @@
 import com.android.settings.deviceinfo.SafetyInfoPreferenceController;
 import com.android.settings.deviceinfo.UptimePreferenceController;
 import com.android.settings.deviceinfo.WifiMacAddressPreferenceController;
-import com.android.settings.deviceinfo.firmwareversion.FirmwareVersionPreferenceController;
 import com.android.settings.deviceinfo.imei.ImeiInfoPreferenceController;
 import com.android.settings.deviceinfo.simstatus.SimStatusPreferenceController;
 import com.android.settings.search.BaseSearchIndexProvider;
@@ -77,8 +75,6 @@
     @Override
     public void onAttach(Context context) {
         super.onAttach(context);
-        use(FirmwareVersionPreferenceController.class).setHost(this /* parent */);
-        use(DeviceModelPreferenceController.class).setHost(this /* parent */);
         use(ImeiInfoPreferenceController.class).setHost(this /* parent */);
         use(DeviceNamePreferenceController.class).setHost(this /* parent */);
         mBuildNumberPreferenceController = use(BuildNumberPreferenceController.class);
diff --git a/src/com/android/settings/deviceinfo/firmwareversion/BasebandVersionDialogController.java b/src/com/android/settings/deviceinfo/firmwareversion/BasebandVersionDialogController.java
deleted file mode 100644
index 0e36d85..0000000
--- a/src/com/android/settings/deviceinfo/firmwareversion/BasebandVersionDialogController.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2017 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.deviceinfo.firmwareversion;
-
-import android.content.Context;
-import android.os.SystemProperties;
-
-import androidx.annotation.VisibleForTesting;
-
-import com.android.settings.R;
-import com.android.settings.Utils;
-
-public class BasebandVersionDialogController {
-
-    @VisibleForTesting
-    static final int BASEBAND_VERSION_LABEL_ID = R.id.baseband_version_label;
-    @VisibleForTesting
-    static final int BASEBAND_VERSION_VALUE_ID = R.id.baseband_version_value;
-    @VisibleForTesting
-    static final String BASEBAND_PROPERTY = "gsm.version.baseband";
-
-    private final FirmwareVersionDialogFragment mDialog;
-
-    public BasebandVersionDialogController(FirmwareVersionDialogFragment dialog) {
-        mDialog = dialog;
-    }
-
-    /**
-     * Updates the baseband version field of the dialog.
-     */
-    public void initialize() {
-        final Context context = mDialog.getContext();
-        if (Utils.isWifiOnly(context)) {
-            mDialog.removeSettingFromScreen(BASEBAND_VERSION_LABEL_ID);
-            mDialog.removeSettingFromScreen(BASEBAND_VERSION_VALUE_ID);
-            return;
-        }
-
-        mDialog.setText(BASEBAND_VERSION_VALUE_ID, SystemProperties.get(BASEBAND_PROPERTY,
-                context.getString(R.string.device_info_default)));
-    }
-}
diff --git a/src/com/android/settings/deviceinfo/firmwareversion/BasebandVersionPreferenceController.java b/src/com/android/settings/deviceinfo/firmwareversion/BasebandVersionPreferenceController.java
new file mode 100644
index 0000000..dd3d560
--- /dev/null
+++ b/src/com/android/settings/deviceinfo/firmwareversion/BasebandVersionPreferenceController.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2019 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.deviceinfo.firmwareversion;
+
+import android.content.Context;
+import android.os.SystemProperties;
+
+import androidx.annotation.VisibleForTesting;
+
+import com.android.settings.R;
+import com.android.settings.Utils;
+import com.android.settings.core.BasePreferenceController;
+
+public class BasebandVersionPreferenceController extends BasePreferenceController {
+
+    @VisibleForTesting
+    static final String BASEBAND_PROPERTY = "gsm.version.baseband";
+
+    public BasebandVersionPreferenceController(Context context, String preferenceKey) {
+        super(context, preferenceKey);
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        return !Utils.isWifiOnly(mContext) ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
+    }
+
+    @Override
+    public CharSequence getSummary() {
+        return SystemProperties.get(BASEBAND_PROPERTY,
+                mContext.getString(R.string.device_info_default));
+    }
+}
diff --git a/src/com/android/settings/deviceinfo/firmwareversion/BuildNumberDialogController.java b/src/com/android/settings/deviceinfo/firmwareversion/BuildNumberDialogController.java
deleted file mode 100644
index ba4eb7a..0000000
--- a/src/com/android/settings/deviceinfo/firmwareversion/BuildNumberDialogController.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2017 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.deviceinfo.firmwareversion;
-
-import android.os.Build;
-import android.text.BidiFormatter;
-
-import androidx.annotation.VisibleForTesting;
-
-import com.android.settings.R;
-
-public class BuildNumberDialogController {
-
-    @VisibleForTesting
-    static final int BUILD_NUMBER_VALUE_ID = R.id.build_number_value;
-
-    private final FirmwareVersionDialogFragment mDialog;
-
-    public BuildNumberDialogController(FirmwareVersionDialogFragment dialog) {
-        mDialog = dialog;
-    }
-
-    /**
-     * Updates the build number to the dialog.
-     */
-    public void initialize() {
-        mDialog.setText(BUILD_NUMBER_VALUE_ID,
-                BidiFormatter.getInstance().unicodeWrap(Build.DISPLAY));
-    }
-}
diff --git a/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionDialogController.java b/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionDetailPreferenceController.java
similarity index 72%
rename from src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionDialogController.java
rename to src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionDetailPreferenceController.java
index 8c29f7b..9f3d6e5 100644
--- a/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionDialogController.java
+++ b/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionDetailPreferenceController.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 The Android Open Source Project
+ * Copyright (C) 2019 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.
@@ -22,42 +22,60 @@
 import android.os.SystemClock;
 import android.os.UserHandle;
 import android.os.UserManager;
+import android.text.TextUtils;
 import android.util.Log;
-import android.view.View;
 
 import androidx.annotation.VisibleForTesting;
+import androidx.preference.Preference;
 
 import com.android.settings.R;
+import com.android.settings.Utils;
+import com.android.settings.core.BasePreferenceController;
+import com.android.settings.slices.Sliceable;
 import com.android.settingslib.RestrictedLockUtils;
 import com.android.settingslib.RestrictedLockUtilsInternal;
 
-public class FirmwareVersionDialogController implements View.OnClickListener {
+public class FirmwareVersionDetailPreferenceController extends BasePreferenceController {
 
     private static final String TAG = "firmwareDialogCtrl";
     private static final int DELAY_TIMER_MILLIS = 500;
     private static final int ACTIVITY_TRIGGER_COUNT = 3;
 
-    @VisibleForTesting
-    static final int FIRMWARE_VERSION_VALUE_ID = R.id.firmware_version_value;
-    @VisibleForTesting
-    static final int FIRMWARE_VERSION_LABEL_ID = R.id.firmware_version_label;
-
-    private final FirmwareVersionDialogFragment mDialog;
-    private final Context mContext;
     private final UserManager mUserManager;
     private final long[] mHits = new long[ACTIVITY_TRIGGER_COUNT];
 
     private RestrictedLockUtils.EnforcedAdmin mFunDisallowedAdmin;
     private boolean mFunDisallowedBySystem;
 
-    public FirmwareVersionDialogController(FirmwareVersionDialogFragment dialog) {
-        mDialog = dialog;
-        mContext = dialog.getContext();
+    public FirmwareVersionDetailPreferenceController(Context context, String key) {
+        super(context, key);
         mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
+        initializeAdminPermissions();
     }
 
     @Override
-    public void onClick(View v) {
+    public int getAvailabilityStatus() {
+        return AVAILABLE;
+    }
+
+    @Override
+    public boolean isSliceable() {
+        return true;
+    }
+
+    @Override
+    public CharSequence getSummary() {
+        return Build.VERSION.RELEASE;
+    }
+
+    @Override
+    public boolean handlePreferenceTreeClick(Preference preference) {
+        if (!TextUtils.equals(preference.getKey(), getPreferenceKey())) {
+            return false;
+        }
+        if (Utils.isMonkeyRunning()) {
+            return false;
+        }
         arrayCopy();
         mHits[mHits.length - 1] = SystemClock.uptimeMillis();
         if (mHits[0] >= (SystemClock.uptimeMillis() - DELAY_TIMER_MILLIS)) {
@@ -67,7 +85,7 @@
                             mFunDisallowedAdmin);
                 }
                 Log.d(TAG, "Sorry, no fun for you!");
-                return;
+                return true;
             }
 
             final Intent intent = new Intent(Intent.ACTION_MAIN)
@@ -79,21 +97,7 @@
                 Log.e(TAG, "Unable to start activity " + intent.toString());
             }
         }
-    }
-
-    /**
-     * Populates the Android version field in the dialog and registers click listeners.
-     */
-    public void initialize() {
-        initializeAdminPermissions();
-        registerClickListeners();
-
-        mDialog.setText(FIRMWARE_VERSION_VALUE_ID, Build.VERSION.RELEASE);
-    }
-
-    private void registerClickListeners() {
-        mDialog.registerClickListener(FIRMWARE_VERSION_LABEL_ID, this /* listener */);
-        mDialog.registerClickListener(FIRMWARE_VERSION_VALUE_ID, this /* listener */);
+        return true;
     }
 
     /**
@@ -111,4 +115,10 @@
         mFunDisallowedBySystem = RestrictedLockUtilsInternal.hasBaseUserRestriction(
                 mContext, UserManager.DISALLOW_FUN, UserHandle.myUserId());
     }
+
+    @Override
+    public void copy() {
+        Sliceable.setCopyContent(mContext, getSummary(),
+                mContext.getText(R.string.firmware_version));
+    }
 }
diff --git a/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionDialogFragment.java b/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionDialogFragment.java
deleted file mode 100644
index 2093c3e..0000000
--- a/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionDialogFragment.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2017 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.deviceinfo.firmwareversion;
-
-import android.app.Dialog;
-import android.app.settings.SettingsEnums;
-import android.os.Bundle;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.widget.TextView;
-
-import androidx.appcompat.app.AlertDialog;
-import androidx.fragment.app.Fragment;
-import androidx.fragment.app.FragmentManager;
-
-import com.android.settings.R;
-import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
-
-public class FirmwareVersionDialogFragment extends InstrumentedDialogFragment {
-
-    private static final String TAG = "firmwareVersionDialog";
-
-    private View mRootView;
-
-    public static void show(Fragment host) {
-        final FragmentManager manager = host.getChildFragmentManager();
-        if (manager.findFragmentByTag(TAG) == null) {
-            final FirmwareVersionDialogFragment dialog = new FirmwareVersionDialogFragment();
-            dialog.show(manager, TAG);
-        }
-    }
-
-    @Override
-    public int getMetricsCategory() {
-        return SettingsEnums.DIALOG_FIRMWARE_VERSION;
-    }
-
-    @Override
-    public Dialog onCreateDialog(Bundle savedInstanceState) {
-        final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())
-                .setTitle(R.string.firmware_title)
-                .setPositiveButton(android.R.string.ok, null /* listener */);
-
-        mRootView = LayoutInflater.from(getActivity()).inflate(
-                R.layout.dialog_firmware_version, null /* parent */);
-
-        initializeControllers();
-
-        return builder.setView(mRootView).create();
-    }
-
-    public void setText(int viewId, CharSequence text) {
-        final TextView view = mRootView.findViewById(viewId);
-        if (view != null) {
-            view.setText(text);
-        }
-    }
-
-    public void removeSettingFromScreen(int viewId) {
-        final View view = mRootView.findViewById(viewId);
-        if (view != null) {
-            view.setVisibility(View.GONE);
-        }
-    }
-
-    public void registerClickListener(int viewId, View.OnClickListener listener) {
-        final View view = mRootView.findViewById(viewId);
-        if (view != null) {
-            view.setOnClickListener(listener);
-        }
-    }
-
-    private void initializeControllers() {
-        new FirmwareVersionDialogController(this).initialize();
-        new SecurityPatchLevelDialogController(this).initialize();
-        new BasebandVersionDialogController(this).initialize();
-        new KernelVersionDialogController(this).initialize();
-        new BuildNumberDialogController(this).initialize();
-        new ModuleVersionDialogController(this).initialize();
-    }
-}
diff --git a/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionPreferenceController.java b/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionPreferenceController.java
index b7b67b7..41d9566 100644
--- a/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionPreferenceController.java
+++ b/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionPreferenceController.java
@@ -18,56 +18,22 @@
 
 import android.content.Context;
 import android.os.Build;
-import android.text.TextUtils;
 
-import androidx.fragment.app.Fragment;
-import androidx.preference.Preference;
-
-import com.android.settings.R;
 import com.android.settings.core.BasePreferenceController;
-import com.android.settings.slices.Copyable;
 
-public class FirmwareVersionPreferenceController extends BasePreferenceController implements
-        Copyable {
-
-    private Fragment mFragment;
+public class FirmwareVersionPreferenceController extends BasePreferenceController {
 
     public FirmwareVersionPreferenceController(Context context, String key) {
         super(context, key);
     }
 
-    public void setHost(Fragment fragment) {
-        mFragment = fragment;
-    }
-
     @Override
     public int getAvailabilityStatus() {
-        return AVAILABLE;
+        return AVAILABLE_UNSEARCHABLE;
     }
 
     @Override
     public CharSequence getSummary() {
         return Build.VERSION.RELEASE;
     }
-
-    @Override
-    public boolean handlePreferenceTreeClick(Preference preference) {
-        if (!TextUtils.equals(preference.getKey(), mPreferenceKey)) {
-            return false;
-        }
-
-        FirmwareVersionDialogFragment.show(mFragment);
-        return true;
-    }
-
-    @Override
-    public boolean isSliceable() {
-        return true;
-    }
-
-    @Override
-    public void copy() {
-        Copyable.setCopyContent(mContext, getSummary(),
-                mContext.getText(R.string.firmware_version));
-    }
 }
diff --git a/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionSettings.java b/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionSettings.java
new file mode 100644
index 0000000..90c3b56
--- /dev/null
+++ b/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionSettings.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2019 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.deviceinfo.firmwareversion;
+
+import android.app.settings.SettingsEnums;
+import android.content.Context;
+import android.provider.SearchIndexableResource;
+
+import com.android.settings.R;
+import com.android.settings.dashboard.DashboardFragment;
+import com.android.settings.search.BaseSearchIndexProvider;
+import com.android.settings.search.Indexable;
+import com.android.settingslib.search.SearchIndexable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@SearchIndexable
+public class FirmwareVersionSettings extends DashboardFragment {
+
+    @Override
+    protected int getPreferenceScreenResId() {
+        return R.xml.firmware_version;
+    }
+
+    @Override
+    protected String getLogTag() {
+        return "FirmwareVersionSettings";
+    }
+
+    @Override
+    public int getMetricsCategory() {
+        return SettingsEnums.DIALOG_FIRMWARE_VERSION;
+    }
+
+    public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
+            new BaseSearchIndexProvider() {
+                @Override
+                public List<SearchIndexableResource> getXmlResourcesToIndex(Context context,
+                        boolean enabled) {
+                    final ArrayList<SearchIndexableResource> result = new ArrayList<>();
+
+                    final SearchIndexableResource sir = new SearchIndexableResource(context);
+                    sir.xmlResId = R.xml.firmware_version;
+                    result.add(sir);
+                    return result;
+                }
+
+            };
+}
diff --git a/src/com/android/settings/deviceinfo/firmwareversion/KernelVersionDialogController.java b/src/com/android/settings/deviceinfo/firmwareversion/KernelVersionDialogController.java
deleted file mode 100644
index 0d816d5..0000000
--- a/src/com/android/settings/deviceinfo/firmwareversion/KernelVersionDialogController.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2017 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.deviceinfo.firmwareversion;
-
-import androidx.annotation.VisibleForTesting;
-
-import com.android.settings.R;
-import com.android.settingslib.DeviceInfoUtils;
-
-public class KernelVersionDialogController {
-
-    @VisibleForTesting
-    static int KERNEL_VERSION_VALUE_ID = R.id.kernel_version_value;
-
-    private final FirmwareVersionDialogFragment mDialog;
-
-    public KernelVersionDialogController(FirmwareVersionDialogFragment dialog) {
-        mDialog = dialog;
-    }
-
-    /**
-     * Updates kernel version to the dialog.
-     */
-    public void initialize() {
-        mDialog.setText(KERNEL_VERSION_VALUE_ID,
-                DeviceInfoUtils.getFormattedKernelVersion(mDialog.getContext()));
-    }
-}
diff --git a/src/com/android/settings/deviceinfo/firmwareversion/KernelVersionPreferenceController.java b/src/com/android/settings/deviceinfo/firmwareversion/KernelVersionPreferenceController.java
new file mode 100644
index 0000000..0500c893
--- /dev/null
+++ b/src/com/android/settings/deviceinfo/firmwareversion/KernelVersionPreferenceController.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2019 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.deviceinfo.firmwareversion;
+
+import android.content.Context;
+
+import com.android.settings.core.BasePreferenceController;
+import com.android.settingslib.DeviceInfoUtils;
+
+public class KernelVersionPreferenceController extends BasePreferenceController {
+
+    public KernelVersionPreferenceController(Context context, String preferenceKey) {
+        super(context, preferenceKey);
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        return AVAILABLE;
+    }
+
+    @Override
+    public CharSequence getSummary() {
+        return DeviceInfoUtils.getFormattedKernelVersion(mContext);
+    }
+}
diff --git a/src/com/android/settings/deviceinfo/firmwareversion/MainlineModuleVersionPreferenceController.java b/src/com/android/settings/deviceinfo/firmwareversion/MainlineModuleVersionPreferenceController.java
new file mode 100644
index 0000000..e2f4fae
--- /dev/null
+++ b/src/com/android/settings/deviceinfo/firmwareversion/MainlineModuleVersionPreferenceController.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2019 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.deviceinfo.firmwareversion;
+
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.text.TextUtils;
+import android.util.FeatureFlagUtils;
+import android.util.Log;
+
+import com.android.settings.core.BasePreferenceController;
+import com.android.settings.core.FeatureFlags;
+
+public class MainlineModuleVersionPreferenceController extends BasePreferenceController {
+
+    private static final String TAG = "MainlineModuleControl";
+
+    private final PackageManager mPackageManager;
+
+    private String mModuleVersion;
+
+    public MainlineModuleVersionPreferenceController(Context context, String key) {
+        super(context, key);
+        mPackageManager = mContext.getPackageManager();
+        initModules();
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        if (!FeatureFlagUtils.isEnabled(mContext, FeatureFlags.MAINLINE_MODULE)) {
+            return UNSUPPORTED_ON_DEVICE;
+        }
+        return !TextUtils.isEmpty(mModuleVersion) ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
+    }
+
+    private void initModules() {
+        if (!FeatureFlagUtils.isEnabled(mContext, FeatureFlags.MAINLINE_MODULE)) {
+            return;
+        }
+        final String moduleProvider = mContext.getString(
+                com.android.internal.R.string.config_defaultModuleMetadataProvider);
+        if (!TextUtils.isEmpty(moduleProvider)) {
+            try {
+                mModuleVersion =
+                        mPackageManager.getPackageInfo(moduleProvider, 0 /* flags */).versionName;
+                return;
+            } catch (PackageManager.NameNotFoundException e) {
+                Log.e(TAG, "Failed to get mainline version.", e);
+                mModuleVersion = null;
+            }
+        }
+    }
+
+    @Override
+    public CharSequence getSummary() {
+        return mModuleVersion;
+    }
+}
diff --git a/src/com/android/settings/deviceinfo/firmwareversion/ModuleVersionDialogController.java b/src/com/android/settings/deviceinfo/firmwareversion/ModuleVersionDialogController.java
deleted file mode 100644
index 0dc953d..0000000
--- a/src/com/android/settings/deviceinfo/firmwareversion/ModuleVersionDialogController.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2019 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.deviceinfo.firmwareversion;
-
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.text.TextUtils;
-import android.util.FeatureFlagUtils;
-import android.util.Log;
-
-import com.android.settings.R;
-import com.android.settings.core.FeatureFlags;
-
-import androidx.annotation.VisibleForTesting;
-
-public class ModuleVersionDialogController {
-
-    private static final String TAG = "MainlineModuleControl";
-
-    @VisibleForTesting
-    static final int MODULE_VERSION_LABEL_ID = R.id.module_version_label;
-    @VisibleForTesting
-    static final int MODULE_VERSION_VALUE_ID = R.id.module_version_value;
-
-    private final FirmwareVersionDialogFragment mDialog;
-    private final Context mContext;
-    private final PackageManager mPackageManager;
-
-    public ModuleVersionDialogController(FirmwareVersionDialogFragment dialog) {
-        mDialog = dialog;
-        mContext = mDialog.getContext();
-        mPackageManager = mContext.getPackageManager();
-    }
-
-    /**
-     * Updates the mainline module version field of the dialog.
-     */
-    public void initialize() {
-        if (!FeatureFlagUtils.isEnabled(mContext, FeatureFlags.MAINLINE_MODULE)) {
-            mDialog.removeSettingFromScreen(MODULE_VERSION_LABEL_ID);
-            mDialog.removeSettingFromScreen(MODULE_VERSION_VALUE_ID);
-            return;
-        }
-        final String moduleProvider = mContext.getString(
-            com.android.internal.R.string.config_defaultModuleMetadataProvider);
-        if (!TextUtils.isEmpty(moduleProvider)) {
-            try {
-                mDialog.setText(MODULE_VERSION_VALUE_ID,
-                    mPackageManager.getPackageInfo(moduleProvider, 0 /* flags */).versionName);
-                return;
-            } catch (PackageManager.NameNotFoundException e) {
-                Log.e(TAG, "Failed to get mainline version.", e);
-            }
-        }
-        mDialog.removeSettingFromScreen(MODULE_VERSION_LABEL_ID);
-        mDialog.removeSettingFromScreen(MODULE_VERSION_VALUE_ID);
-    }
-}
diff --git a/src/com/android/settings/deviceinfo/firmwareversion/SecurityPatchLevelDialogController.java b/src/com/android/settings/deviceinfo/firmwareversion/SecurityPatchLevelDialogController.java
deleted file mode 100644
index 9037fe7..0000000
--- a/src/com/android/settings/deviceinfo/firmwareversion/SecurityPatchLevelDialogController.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2017 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.deviceinfo.firmwareversion;
-
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.net.Uri;
-import android.text.TextUtils;
-import android.util.Log;
-import android.view.View;
-
-import androidx.annotation.VisibleForTesting;
-
-import com.android.settings.R;
-import com.android.settingslib.DeviceInfoUtils;
-
-public class SecurityPatchLevelDialogController implements View.OnClickListener {
-
-    private static final String TAG = "SecurityPatchCtrl";
-    private static final Uri INTENT_URI_DATA = Uri.parse(
-            "https://source.android.com/security/bulletin/");
-
-    @VisibleForTesting
-    static final int SECURITY_PATCH_VALUE_ID = R.id.security_patch_level_value;
-    @VisibleForTesting
-    static final int SECURITY_PATCH_LABEL_ID = R.id.security_patch_level_label;
-
-    private final FirmwareVersionDialogFragment mDialog;
-    private final Context mContext;
-    private final PackageManager mPackageManager;
-    private final String mCurrentPatch;
-
-    public SecurityPatchLevelDialogController(FirmwareVersionDialogFragment dialog) {
-        mDialog = dialog;
-        mContext = dialog.getContext();
-        mPackageManager = mContext.getPackageManager();
-        mCurrentPatch = DeviceInfoUtils.getSecurityPatch();
-    }
-
-    @Override
-    public void onClick(View v) {
-        final Intent intent = new Intent();
-        intent.setAction(Intent.ACTION_VIEW);
-        intent.setData(INTENT_URI_DATA);
-        if (mPackageManager.queryIntentActivities(intent, 0).isEmpty()) {
-            // Don't send out the intent to stop crash
-            Log.w(TAG, "Stop click action on " + SECURITY_PATCH_VALUE_ID + ": "
-                    + "queryIntentActivities() returns empty");
-            return;
-        }
-
-        mContext.startActivity(intent);
-    }
-
-    /**
-     * Populates the security patch level field in the dialog and registers click listeners.
-     */
-    public void initialize() {
-        if (TextUtils.isEmpty(mCurrentPatch)) {
-            mDialog.removeSettingFromScreen(SECURITY_PATCH_LABEL_ID);
-            mDialog.removeSettingFromScreen(SECURITY_PATCH_VALUE_ID);
-            return;
-        }
-        registerListeners();
-        mDialog.setText(SECURITY_PATCH_VALUE_ID, mCurrentPatch);
-    }
-
-    private void registerListeners() {
-        mDialog.registerClickListener(SECURITY_PATCH_LABEL_ID, this /* listener */);
-        mDialog.registerClickListener(SECURITY_PATCH_VALUE_ID, this /* listener */);
-    }
-}
diff --git a/src/com/android/settings/deviceinfo/firmwareversion/SecurityPatchLevelPreferenceController.java b/src/com/android/settings/deviceinfo/firmwareversion/SecurityPatchLevelPreferenceController.java
new file mode 100644
index 0000000..1df78a8
--- /dev/null
+++ b/src/com/android/settings/deviceinfo/firmwareversion/SecurityPatchLevelPreferenceController.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2019 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.deviceinfo.firmwareversion;
+
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.net.Uri;
+import android.text.TextUtils;
+import android.util.Log;
+
+import androidx.preference.Preference;
+
+import com.android.settings.core.BasePreferenceController;
+import com.android.settingslib.DeviceInfoUtils;
+
+public class SecurityPatchLevelPreferenceController extends BasePreferenceController {
+
+    private static final String TAG = "SecurityPatchCtrl";
+    private static final Uri INTENT_URI_DATA = Uri.parse(
+            "https://source.android.com/security/bulletin/");
+
+    private final PackageManager mPackageManager;
+    private final String mCurrentPatch;
+
+    public SecurityPatchLevelPreferenceController(Context context, String key) {
+        super(context, key);
+        mPackageManager = mContext.getPackageManager();
+        mCurrentPatch = DeviceInfoUtils.getSecurityPatch();
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        return !TextUtils.isEmpty(mCurrentPatch)
+                ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
+    }
+
+    @Override
+    public CharSequence getSummary() {
+        return mCurrentPatch;
+    }
+
+    @Override
+    public boolean handlePreferenceTreeClick(Preference preference) {
+        if (!TextUtils.equals(preference.getKey(), getPreferenceKey())) {
+            return false;
+        }
+
+        final Intent intent = new Intent();
+        intent.setAction(Intent.ACTION_VIEW);
+        intent.setData(INTENT_URI_DATA);
+        if (mPackageManager.queryIntentActivities(intent, 0).isEmpty()) {
+            // Don't send out the intent to stop crash
+            Log.w(TAG, "queryIntentActivities() returns empty");
+            return true;
+        }
+
+        mContext.startActivity(intent);
+        return true;
+    }
+}
diff --git a/src/com/android/settings/deviceinfo/firmwareversion/SimpleBuildNumberPreferenceController.java b/src/com/android/settings/deviceinfo/firmwareversion/SimpleBuildNumberPreferenceController.java
new file mode 100644
index 0000000..c7d4459
--- /dev/null
+++ b/src/com/android/settings/deviceinfo/firmwareversion/SimpleBuildNumberPreferenceController.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2019 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.deviceinfo.firmwareversion;
+
+import android.content.Context;
+import android.os.Build;
+import android.text.BidiFormatter;
+
+import com.android.settings.core.BasePreferenceController;
+
+public class SimpleBuildNumberPreferenceController extends BasePreferenceController {
+
+    public SimpleBuildNumberPreferenceController(Context context,
+            String preferenceKey) {
+        super(context, preferenceKey);
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        return AVAILABLE;
+    }
+
+    @Override
+    public CharSequence getSummary() {
+        return BidiFormatter.getInstance().unicodeWrap(Build.DISPLAY);
+    }
+}
diff --git a/src/com/android/settings/deviceinfo/hardwareinfo/DeviceModelPreferenceController.java b/src/com/android/settings/deviceinfo/hardwareinfo/DeviceModelPreferenceController.java
new file mode 100644
index 0000000..42c7b01
--- /dev/null
+++ b/src/com/android/settings/deviceinfo/hardwareinfo/DeviceModelPreferenceController.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2019 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.deviceinfo.hardwareinfo;
+
+import android.content.Context;
+
+import com.android.settings.deviceinfo.HardwareInfoPreferenceController;
+
+public class DeviceModelPreferenceController extends HardwareInfoPreferenceController {
+
+    public DeviceModelPreferenceController(Context context, String key) {
+        super(context, key);
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        final int availability = super.getAvailabilityStatus();
+        if (availability == AVAILABLE_UNSEARCHABLE) {
+            return AVAILABLE;
+        }
+        return availability;
+    }
+
+    @Override
+    public boolean isSliceable() {
+        return true;
+    }
+}
diff --git a/src/com/android/settings/deviceinfo/hardwareinfo/HardwareInfoFragment.java b/src/com/android/settings/deviceinfo/hardwareinfo/HardwareInfoFragment.java
new file mode 100644
index 0000000..40e73ef
--- /dev/null
+++ b/src/com/android/settings/deviceinfo/hardwareinfo/HardwareInfoFragment.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2019 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.deviceinfo.hardwareinfo;
+
+import android.app.settings.SettingsEnums;
+import android.content.Context;
+import android.provider.SearchIndexableResource;
+
+import com.android.settings.R;
+import com.android.settings.dashboard.DashboardFragment;
+import com.android.settings.search.BaseSearchIndexProvider;
+import com.android.settings.search.Indexable;
+import com.android.settingslib.search.SearchIndexable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+@SearchIndexable
+public class HardwareInfoFragment extends DashboardFragment {
+
+    public static final String TAG = "HardwareInfo";
+
+    @Override
+    public int getMetricsCategory() {
+        return SettingsEnums.DIALOG_SETTINGS_HARDWARE_INFO;
+    }
+
+    @Override
+    protected int getPreferenceScreenResId() {
+        return R.xml.hardware_info;
+    }
+
+    @Override
+    protected String getLogTag() {
+        return TAG;
+    }
+
+    public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
+            new BaseSearchIndexProvider() {
+                @Override
+                public List<SearchIndexableResource> getXmlResourcesToIndex(Context context,
+                        boolean enabled) {
+                    final ArrayList<SearchIndexableResource> result = new ArrayList<>();
+
+                    final SearchIndexableResource sir = new SearchIndexableResource(context);
+                    sir.xmlResId = R.xml.hardware_info;
+                    result.add(sir);
+                    return result;
+                }
+
+                @Override
+                protected boolean isPageSearchEnabled(Context context) {
+                    return context.getResources().getBoolean(R.bool.config_show_device_model);
+                }
+            };
+}
diff --git a/src/com/android/settings/deviceinfo/hardwareinfo/HardwareRevisionPreferenceController.java b/src/com/android/settings/deviceinfo/hardwareinfo/HardwareRevisionPreferenceController.java
new file mode 100644
index 0000000..ec0cdb2
--- /dev/null
+++ b/src/com/android/settings/deviceinfo/hardwareinfo/HardwareRevisionPreferenceController.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2019 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.deviceinfo.hardwareinfo;
+
+import android.content.Context;
+import android.os.SystemProperties;
+
+import com.android.settings.R;
+import com.android.settings.core.BasePreferenceController;
+
+public class HardwareRevisionPreferenceController extends BasePreferenceController {
+
+    public HardwareRevisionPreferenceController(Context context, String preferenceKey) {
+        super(context, preferenceKey);
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        return mContext.getResources().getBoolean(R.bool.config_show_device_model)
+                ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
+    }
+
+    @Override
+    public boolean isSliceable() {
+        return true;
+    }
+
+    @Override
+    public CharSequence getSummary() {
+        return SystemProperties.get("ro.boot.hardware.revision");
+    }
+}
diff --git a/src/com/android/settings/deviceinfo/hardwareinfo/SerialNumberPreferenceController.java b/src/com/android/settings/deviceinfo/hardwareinfo/SerialNumberPreferenceController.java
new file mode 100644
index 0000000..01cd5f3
--- /dev/null
+++ b/src/com/android/settings/deviceinfo/hardwareinfo/SerialNumberPreferenceController.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2019 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.deviceinfo.hardwareinfo;
+
+import android.content.Context;
+import android.os.Build;
+
+import com.android.settings.R;
+import com.android.settings.core.BasePreferenceController;
+import com.android.settings.slices.Sliceable;
+
+public class SerialNumberPreferenceController extends BasePreferenceController {
+
+    public SerialNumberPreferenceController(Context context, String preferenceKey) {
+        super(context, preferenceKey);
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        return mContext.getResources().getBoolean(R.bool.config_show_device_model)
+                ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
+    }
+
+    @Override
+    public boolean isSliceable() {
+        return true;
+    }
+
+    @Override
+    public boolean isCopyableSlice() {
+        return true;
+    }
+
+    @Override
+    public void copy() {
+        Sliceable.setCopyContent(mContext, getSummary(),
+                mContext.getText(R.string.status_serial_number));
+    }
+
+    @Override
+    public CharSequence getSummary() {
+        return Build.getSerial();
+    }
+}
diff --git a/src/com/android/settings/deviceinfo/imei/ImeiInfoPreferenceController.java b/src/com/android/settings/deviceinfo/imei/ImeiInfoPreferenceController.java
index 96ff83c..77d975e 100644
--- a/src/com/android/settings/deviceinfo/imei/ImeiInfoPreferenceController.java
+++ b/src/com/android/settings/deviceinfo/imei/ImeiInfoPreferenceController.java
@@ -29,7 +29,7 @@
 
 import com.android.settings.R;
 import com.android.settings.core.BasePreferenceController;
-import com.android.settings.slices.Copyable;
+import com.android.settings.slices.Sliceable;
 import com.android.settingslib.Utils;
 
 import java.util.ArrayList;
@@ -38,7 +38,7 @@
 /**
  * Controller that manages preference for single and multi sim devices.
  */
-public class ImeiInfoPreferenceController extends BasePreferenceController implements Copyable {
+public class ImeiInfoPreferenceController extends BasePreferenceController {
 
     private final boolean mIsMultiSim;
     private final TelephonyManager mTelephonyManager;
@@ -106,8 +106,13 @@
     }
 
     @Override
+    public boolean isCopyableSlice() {
+        return true;
+    }
+
+    @Override
     public void copy() {
-        Copyable.setCopyContent(mContext, getSummary(), mContext.getText(R.string.status_imei));
+        Sliceable.setCopyContent(mContext, getSummary(), mContext.getText(R.string.status_imei));
     }
 
     private void updatePreference(Preference preference, int simSlot) {
diff --git a/src/com/android/settings/fuelgauge/batterytip/StatsManagerConfig.java b/src/com/android/settings/fuelgauge/batterytip/StatsManagerConfig.java
index a0449f2..153aa40 100644
--- a/src/com/android/settings/fuelgauge/batterytip/StatsManagerConfig.java
+++ b/src/com/android/settings/fuelgauge/batterytip/StatsManagerConfig.java
@@ -65,6 +65,11 @@
             AnomalyType.EXCESSIVE_CRASH_RATE,
             AnomalyType.EXCESSIVE_CRASH_LOOPING,
             AnomalyType.NUMBER_OF_OPEN_FILES,
+            AnomalyType.EXCESSIVE_CAMERA_USAGE_IN_BACKGROUND,
+            AnomalyType.EXCESSIVE_CONTACT_ACCESS,
+            AnomalyType.EXCESSIVE_AUDIO_IN_BACKGROUND,
+            AnomalyType.EXCESSIVE_CRASH_ANR_IN_BACKGROUND,
+            AnomalyType.BATTERY_DRAIN_FROM_UNUSED_APP,
     })
     public @interface AnomalyType {
         /**
@@ -218,6 +223,42 @@
          * The application crashed because no more file descriptors were available.
          */
         int NUMBER_OF_OPEN_FILES = 26;
+
+        /**
+         * The application used an excessive amount of CPU while in a
+         * background process state.
+         */
+        int EXCESSIVE_CPU_USAGE_IN_BACKGROUND = 27;
+
+        /**
+         * The application kept the camera open for an excessive amount
+         * of time while in a bckground process state.
+         */
+        int EXCESSIVE_CAMERA_USAGE_IN_BACKGROUND = 28;
+
+        /**
+         * The application has accessed the contacts content provider an
+         * excessive amount.
+         */
+        int EXCESSIVE_CONTACT_ACCESS = 29;
+
+        /**
+         * The application has played too much audio while in a background
+         * process state.
+         */
+        int EXCESSIVE_AUDIO_IN_BACKGROUND = 30;
+
+        /**
+         * The application has crashed or ANRed too many times while in a
+         * background process state.
+         */
+        int EXCESSIVE_CRASH_ANR_IN_BACKGROUND = 31;
+
+        /**
+         * An application which has not been used by the user recently
+         * was detected to cause an excessive amount of battery drain.
+         */
+        int BATTERY_DRAIN_FROM_UNUSED_APP = 32;
     }
 
 }
diff --git a/src/com/android/settings/gestures/PreventRingingSwitchPreferenceController.java b/src/com/android/settings/gestures/PreventRingingSwitchPreferenceController.java
index 35ff2ec..e21bb75 100644
--- a/src/com/android/settings/gestures/PreventRingingSwitchPreferenceController.java
+++ b/src/com/android/settings/gestures/PreventRingingSwitchPreferenceController.java
@@ -61,6 +61,17 @@
             LayoutPreference pref = screen.findPreference(getPreferenceKey());
             if (pref != null) {
                 mSettingObserver = new SettingObserver(pref);
+                pref.setOnPreferenceClickListener(preference -> {
+                    int preventRinging = Settings.Secure.getInt(mContext.getContentResolver(),
+                            Settings.Secure.VOLUME_HUSH_GESTURE,
+                            Settings.Secure.VOLUME_HUSH_VIBRATE);
+                    boolean isChecked = preventRinging != Settings.Secure.VOLUME_HUSH_OFF;
+                    Settings.Secure.putInt(mContext.getContentResolver(),
+                            Settings.Secure.VOLUME_HUSH_GESTURE, isChecked
+                                    ? Settings.Secure.VOLUME_HUSH_OFF
+                                    : Settings.Secure.VOLUME_HUSH_VIBRATE);
+                    return true;
+                });
                 mSwitch = pref.findViewById(R.id.switch_bar);
                 if (mSwitch != null) {
                     mSwitch.addOnSwitchChangeListener(this);
diff --git a/src/com/android/settings/homepage/contextualcards/ContextualCardLoader.java b/src/com/android/settings/homepage/contextualcards/ContextualCardLoader.java
index 42e18ed..d6ea6ca 100644
--- a/src/com/android/settings/homepage/contextualcards/ContextualCardLoader.java
+++ b/src/com/android/settings/homepage/contextualcards/ContextualCardLoader.java
@@ -23,6 +23,7 @@
 import android.content.Context;
 import android.database.ContentObserver;
 import android.database.Cursor;
+import android.net.Uri;
 import android.os.Handler;
 import android.os.Looper;
 import android.text.format.DateUtils;
diff --git a/src/com/android/settings/homepage/contextualcards/deviceinfo/DeviceInfoSlice.java b/src/com/android/settings/homepage/contextualcards/deviceinfo/DeviceInfoSlice.java
index e278baa..48a9aa5 100644
--- a/src/com/android/settings/homepage/contextualcards/deviceinfo/DeviceInfoSlice.java
+++ b/src/com/android/settings/homepage/contextualcards/deviceinfo/DeviceInfoSlice.java
@@ -36,7 +36,7 @@
 import com.android.settings.R;
 import com.android.settings.SubSettings;
 import com.android.settings.Utils;
-import com.android.settings.deviceinfo.DeviceModelPreferenceController;
+import com.android.settings.deviceinfo.HardwareInfoPreferenceController;
 import com.android.settings.deviceinfo.aboutphone.MyDeviceInfoFragment;
 import com.android.settings.slices.CustomSliceRegistry;
 import com.android.settings.slices.CustomSliceable;
@@ -107,7 +107,7 @@
     }
 
     private CharSequence getDeviceModel() {
-        return DeviceModelPreferenceController.getDeviceModel();
+        return HardwareInfoPreferenceController.getDeviceModel();
     }
 
     @VisibleForTesting
diff --git a/src/com/android/settings/homepage/contextualcards/slices/BatteryFixSlice.java b/src/com/android/settings/homepage/contextualcards/slices/BatteryFixSlice.java
index 5b5d474..9b912a8 100644
--- a/src/com/android/settings/homepage/contextualcards/slices/BatteryFixSlice.java
+++ b/src/com/android/settings/homepage/contextualcards/slices/BatteryFixSlice.java
@@ -80,7 +80,7 @@
     public Slice getSlice() {
         final ListBuilder sliceBuilder =
                 new ListBuilder(mContext, BATTERY_FIX_SLICE_URI, ListBuilder.INFINITY)
-                        .setAccentColor(-1);
+                        .setAccentColor(COLOR_NOT_TINTED);
 
         // TipType.SUMMARY is battery good
         if (UNIMPORTANT_BATTERY_TIPS.contains(readBatteryTipAvailabilityCache(mContext))) {
diff --git a/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSlice.java b/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSlice.java
index 0152614..ae8b80a 100644
--- a/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSlice.java
+++ b/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSlice.java
@@ -142,7 +142,8 @@
     @Override
     public Slice getSlice() {
         final ListBuilder listBuilder =
-                new ListBuilder(mContext, getUri(), ListBuilder.INFINITY).setAccentColor(-1);
+                new ListBuilder(mContext, getUri(), ListBuilder.INFINITY)
+                        .setAccentColor(COLOR_NOT_TINTED);
         /**
          * Get package which is satisfied with:
          * 1. Recently installed.
diff --git a/src/com/android/settings/nfc/NfcPreferenceController.java b/src/com/android/settings/nfc/NfcPreferenceController.java
index 04f288d..2ca3b23 100644
--- a/src/com/android/settings/nfc/NfcPreferenceController.java
+++ b/src/com/android/settings/nfc/NfcPreferenceController.java
@@ -15,20 +15,26 @@
  */
 package com.android.settings.nfc;
 
+import android.content.BroadcastReceiver;
 import android.content.Context;
+import android.content.Intent;
 import android.content.IntentFilter;
+import android.net.Uri;
 import android.nfc.NfcAdapter;
 import android.provider.Settings;
-
+import android.util.Log;
 import androidx.annotation.VisibleForTesting;
 import androidx.preference.PreferenceScreen;
 import androidx.preference.SwitchPreference;
 
 import com.android.settings.core.TogglePreferenceController;
+import com.android.settings.slices.SliceBackgroundWorker;
 import com.android.settingslib.core.lifecycle.LifecycleObserver;
 import com.android.settingslib.core.lifecycle.events.OnPause;
 import com.android.settingslib.core.lifecycle.events.OnResume;
 
+import java.io.IOException;
+
 public class NfcPreferenceController extends TogglePreferenceController
         implements LifecycleObserver, OnResume, OnPause {
 
@@ -51,8 +57,7 @@
             return;
         }
 
-        final SwitchPreference switchPreference =
-                (SwitchPreference) screen.findPreference(getPreferenceKey());
+        final SwitchPreference switchPreference = screen.findPreference(getPreferenceKey());
 
         mNfcEnabler = new NfcEnabler(mContext, switchPreference);
 
@@ -87,14 +92,6 @@
     }
 
     @Override
-    public IntentFilter getIntentFilter() {
-        final IntentFilter filter = new IntentFilter();
-        filter.addAction(NfcAdapter.ACTION_ADAPTER_STATE_CHANGED);
-        filter.addAction(NfcAdapter.EXTRA_ADAPTER_STATE);
-        return filter;
-    }
-
-    @Override
     public boolean hasAsyncUpdate() {
         return true;
     }
@@ -105,6 +102,11 @@
     }
 
     @Override
+    public Class<? extends SliceBackgroundWorker> getBackgroundWorkerClass() {
+        return NfcSliceWorker.class;
+    }
+
+    @Override
     public void onResume() {
         if (mAirplaneModeObserver != null) {
             mAirplaneModeObserver.register();
@@ -135,4 +137,77 @@
                 Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
         return toggleable != null && toggleable.contains(Settings.Global.RADIO_NFC);
     }
+
+    /**
+     * Listener for background changes to NFC.
+     *
+     * <p>
+     *     Listen to broadcasts from {@link NfcAdapter}. The worker will call notify changed on the
+     *     NFC Slice only when the following extras are present in the broadcast:
+     *     <ul>
+     *      <li>{@link NfcAdapter#STATE_ON}</li>
+     *      <li>{@link NfcAdapter#STATE_OFF}</li>
+     *     </ul>
+     */
+    public static class NfcSliceWorker extends SliceBackgroundWorker<Void> {
+
+        private static final String TAG = "NfcSliceWorker";
+
+        private static final IntentFilter NFC_FILTER =
+                new IntentFilter(NfcAdapter.ACTION_ADAPTER_STATE_CHANGED);
+
+        private NfcUpdateReceiver mUpdateObserver;
+
+        public NfcSliceWorker(Context context, Uri uri) {
+            super(context, uri);
+            mUpdateObserver = new NfcUpdateReceiver(this);
+        }
+
+        @Override
+        protected void onSlicePinned() {
+            getContext().registerReceiver(mUpdateObserver, NFC_FILTER);
+        }
+
+        @Override
+        protected void onSliceUnpinned() {
+            getContext().unregisterReceiver(mUpdateObserver);
+        }
+
+        @Override
+        public void close() throws IOException {
+            mUpdateObserver = null;
+        }
+
+        public void updateSlice() {
+            notifySliceChange();
+        }
+
+        public class NfcUpdateReceiver extends BroadcastReceiver {
+
+            private final int NO_EXTRA = -1;
+
+            private final NfcSliceWorker mSliceBackgroundWorker;
+
+            public NfcUpdateReceiver(NfcSliceWorker sliceWorker) {
+                mSliceBackgroundWorker = sliceWorker;
+            }
+
+            @Override
+            public void onReceive(Context context, Intent intent) {
+                final int nfcStateExtra = intent.getIntExtra(NfcAdapter.EXTRA_ADAPTER_STATE,
+                        NO_EXTRA);
+
+                // Do nothing if state change is empty, or an intermediate step.
+                if ( (nfcStateExtra == NO_EXTRA)
+                        || (nfcStateExtra == NfcAdapter.STATE_TURNING_ON)
+                        || (nfcStateExtra == NfcAdapter.STATE_TURNING_OFF)) {
+                    Log.d(TAG, "Transitional update, dropping broadcast");
+                    return;
+                }
+
+                Log.d(TAG, "Nfc broadcast received, updating Slice.");
+                mSliceBackgroundWorker.updateSlice();
+            }
+        }
+    }
 }
diff --git a/src/com/android/settings/notification/NotificationAssistantPreferenceController.java b/src/com/android/settings/notification/NotificationAssistantPreferenceController.java
index 5c591b8..66f27fe 100644
--- a/src/com/android/settings/notification/NotificationAssistantPreferenceController.java
+++ b/src/com/android/settings/notification/NotificationAssistantPreferenceController.java
@@ -16,18 +16,46 @@
 
 package com.android.settings.notification;
 
+import android.content.ComponentName;
 import android.content.Context;
+import android.content.pm.PackageManager;
+import android.os.UserHandle;
 
 import com.android.settings.core.BasePreferenceController;
+import com.android.settingslib.applications.DefaultAppInfo;
+import com.android.settingslib.widget.CandidateInfo;
+
+import com.google.common.annotations.VisibleForTesting;
 
 public class NotificationAssistantPreferenceController extends BasePreferenceController {
 
+    @VisibleForTesting
+    protected NotificationBackend mNotificationBackend;
+    private PackageManager mPackageManager;
+
     public NotificationAssistantPreferenceController(Context context, String preferenceKey) {
         super(context, preferenceKey);
+        mNotificationBackend = new NotificationBackend();
+        mPackageManager = mContext.getPackageManager();
     }
 
     @Override
     public int getAvailabilityStatus() {
         return BasePreferenceController.AVAILABLE;
     }
+
+    @Override
+    public CharSequence getSummary() {
+        CandidateInfo appSelected = new NotificationAssistantPicker.CandidateNone(mContext);
+        ComponentName assistant = mNotificationBackend.getAllowedNotificationAssistant();
+        if (assistant != null) {
+            appSelected = createCandidateInfo(assistant);
+        }
+        return appSelected.loadLabel();
+    }
+
+    @VisibleForTesting
+    protected CandidateInfo createCandidateInfo(ComponentName cn) {
+        return new DefaultAppInfo(mContext, mPackageManager, UserHandle.myUserId(), cn);
+    }
 }
diff --git a/src/com/android/settings/password/ChooseLockGeneric.java b/src/com/android/settings/password/ChooseLockGeneric.java
index cae7d33..cf62112 100644
--- a/src/com/android/settings/password/ChooseLockGeneric.java
+++ b/src/com/android/settings/password/ChooseLockGeneric.java
@@ -238,8 +238,8 @@
                     UserManager.get(getActivity()),
                     getArguments(),
                     getActivity().getIntent().getExtras()).getIdentifier();
-            mController =
-                    new ChooseLockGenericController(getContext(), mUserId, mRequestedMinComplexity);
+            mController = new ChooseLockGenericController(
+                    getContext(), mUserId, mRequestedMinComplexity, mLockPatternUtils);
             if (ACTION_SET_NEW_PASSWORD.equals(chooseLockAction)
                     && UserManager.get(getActivity()).isManagedProfile(mUserId)
                     && mLockPatternUtils.isSeparateProfileChallengeEnabled(mUserId)) {
diff --git a/src/com/android/settings/password/ChooseLockGenericController.java b/src/com/android/settings/password/ChooseLockGenericController.java
index 91ca957..62a0063 100644
--- a/src/com/android/settings/password/ChooseLockGenericController.java
+++ b/src/com/android/settings/password/ChooseLockGenericController.java
@@ -27,6 +27,7 @@
 import androidx.annotation.NonNull;
 import androidx.annotation.VisibleForTesting;
 
+import com.android.internal.widget.LockPatternUtils;
 import com.android.settings.R;
 
 import java.util.ArrayList;
@@ -43,12 +44,14 @@
     @PasswordComplexity private final int mRequestedMinComplexity;
     private ManagedLockPasswordProvider mManagedPasswordProvider;
     private DevicePolicyManager mDpm;
+    private final LockPatternUtils mLockPatternUtils;
 
     public ChooseLockGenericController(Context context, int userId) {
         this(
                 context,
                 userId,
-                PASSWORD_COMPLEXITY_NONE);
+                PASSWORD_COMPLEXITY_NONE,
+                new LockPatternUtils(context));
     }
 
     /**
@@ -56,13 +59,14 @@
      *                               when determining the available screen lock types
      */
     public ChooseLockGenericController(Context context, int userId,
-            @PasswordComplexity int requestedMinComplexity) {
+            @PasswordComplexity int requestedMinComplexity, LockPatternUtils lockPatternUtils) {
         this(
                 context,
                 userId,
                 requestedMinComplexity,
                 context.getSystemService(DevicePolicyManager.class),
-                ManagedLockPasswordProvider.get(context, userId));
+                ManagedLockPasswordProvider.get(context, userId),
+                lockPatternUtils);
     }
 
     @VisibleForTesting
@@ -71,12 +75,14 @@
             int userId,
             @PasswordComplexity int requestedMinComplexity,
             DevicePolicyManager dpm,
-            ManagedLockPasswordProvider managedLockPasswordProvider) {
+            ManagedLockPasswordProvider managedLockPasswordProvider,
+            LockPatternUtils lockPatternUtils) {
         mContext = context;
         mUserId = userId;
         mRequestedMinComplexity = requestedMinComplexity;
         mManagedPasswordProvider = managedLockPasswordProvider;
         mDpm = dpm;
+        mLockPatternUtils = lockPatternUtils;
     }
 
     /**
@@ -105,6 +111,12 @@
                     && !managedProfile; // Swipe doesn't make sense for profiles.
             case MANAGED:
                 return mManagedPasswordProvider.isManagedPasswordChoosable();
+            case PIN:
+            case PATTERN:
+            case PASSWORD:
+                // Hide the secure lock screen options if the device doesn't support the secure lock
+                // screen feature.
+                return mLockPatternUtils.hasSecureLockScreen();
         }
         return true;
     }
diff --git a/src/com/android/settings/slices/Copyable.java b/src/com/android/settings/slices/Copyable.java
deleted file mode 100644
index a480063..0000000
--- a/src/com/android/settings/slices/Copyable.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2018 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.slices;
-
-import static android.content.Context.CLIPBOARD_SERVICE;
-
-import android.content.ClipData;
-import android.content.ClipboardManager;
-import android.content.Context;
-import android.widget.Toast;
-
-import com.android.settings.R;
-
-/**
- * Provide the copy ability for preference controller to copy the data to the clipboard.
- */
-public interface Copyable {
-    /**
-     * Copy the key slice information to the clipboard.
-     * It is highly recommended to show the toast to notify users when implemented this function.
-     */
-    void copy();
-
-    /**
-     * Set the copy content to the clipboard and show the toast.
-     */
-    static void setCopyContent(Context context, CharSequence copyContent,
-            CharSequence messageTitle) {
-        final ClipboardManager clipboard = (ClipboardManager) context.getSystemService(
-                CLIPBOARD_SERVICE);
-        final ClipData clip = ClipData.newPlainText("text", copyContent);
-        clipboard.setPrimaryClip(clip);
-
-        final String toast = context.getString(R.string.copyable_slice_toast, messageTitle);
-        Toast.makeText(context, toast, Toast.LENGTH_SHORT).show();
-    }
-}
diff --git a/src/com/android/settings/slices/CustomSliceable.java b/src/com/android/settings/slices/CustomSliceable.java
index d32e266..0b97bed 100644
--- a/src/com/android/settings/slices/CustomSliceable.java
+++ b/src/com/android/settings/slices/CustomSliceable.java
@@ -55,6 +55,11 @@
 public interface CustomSliceable extends Sliceable {
 
     /**
+     * The color representing not to be tinted for the slice.
+     */
+    int COLOR_NOT_TINTED = -1;
+
+    /**
      * @return an complete instance of the {@link Slice}.
      */
     Slice getSlice();
@@ -79,18 +84,6 @@
     Intent getIntent();
 
     /**
-     * Settings Slices which require background work, such as updating lists should implement a
-     * {@link SliceBackgroundWorker} and return it here. An example of background work is updating
-     * a list of Wifi networks available in the area.
-     *
-     * @return a {@link Class<? extends SliceBackgroundWorker>} to perform background work for the
-     * slice.
-     */
-    default Class<? extends SliceBackgroundWorker> getBackgroundWorkerClass() {
-        return null;
-    }
-
-    /**
      * Standardize the intents returned to indicate actions by the Slice.
      * <p>
      *     The {@link PendingIntent} is linked to {@link SliceBroadcastReceiver} where the Intent
diff --git a/src/com/android/settings/slices/SettingsSliceProvider.java b/src/com/android/settings/slices/SettingsSliceProvider.java
index 5c662e5..397b2fc 100644
--- a/src/com/android/settings/slices/SettingsSliceProvider.java
+++ b/src/com/android/settings/slices/SettingsSliceProvider.java
@@ -153,7 +153,7 @@
             if (filter != null) {
                 registerIntentToUri(filter, sliceUri);
             }
-            ThreadUtils.postOnMainThread(() -> startBackgroundWorker(sliceable));
+            ThreadUtils.postOnMainThread(() -> startBackgroundWorker(sliceable, sliceUri));
             return;
         }
 
@@ -326,20 +326,19 @@
         }
     }
 
-    private void startBackgroundWorker(CustomSliceable sliceable) {
+    private void startBackgroundWorker(Sliceable sliceable, Uri uri) {
         final Class workerClass = sliceable.getBackgroundWorkerClass();
         if (workerClass == null) {
             return;
         }
 
-        final Uri uri = sliceable.getUri();
         if (mPinnedWorkers.containsKey(uri)) {
             return;
         }
 
         Log.d(TAG, "Starting background worker for: " + uri);
         final SliceBackgroundWorker worker = SliceBackgroundWorker.getInstance(
-                getContext(), sliceable);
+                getContext(), sliceable, uri);
         mPinnedWorkers.put(uri, worker);
         worker.onSlicePinned();
     }
@@ -397,6 +396,8 @@
             registerIntentToUri(filter, uri);
         }
 
+        ThreadUtils.postOnMainThread(() -> startBackgroundWorker(controller, uri));
+
         final List<Uri> pinnedSlices = getContext().getSystemService(
                 SliceManager.class).getPinnedSlices();
         if (pinnedSlices.contains(uri)) {
diff --git a/src/com/android/settings/slices/SliceBackgroundWorker.java b/src/com/android/settings/slices/SliceBackgroundWorker.java
index 995394e..559aa71 100644
--- a/src/com/android/settings/slices/SliceBackgroundWorker.java
+++ b/src/com/android/settings/slices/SliceBackgroundWorker.java
@@ -80,13 +80,12 @@
      * Returns the singleton instance of the {@link SliceBackgroundWorker} for specified {@link
      * CustomSliceable}
      */
-    static SliceBackgroundWorker getInstance(Context context, CustomSliceable sliceable) {
-        final Uri uri = sliceable.getUri();
+    static SliceBackgroundWorker getInstance(Context context, Sliceable sliceable, Uri uri) {
         SliceBackgroundWorker worker = getInstance(uri);
         if (worker == null) {
             final Class<? extends SliceBackgroundWorker> workerClass =
                     sliceable.getBackgroundWorkerClass();
-            worker = createInstance(context, uri, workerClass);
+            worker = createInstance(context.getApplicationContext(), uri, workerClass);
             LIVE_WORKERS.put(uri, worker);
         }
         return worker;
diff --git a/src/com/android/settings/slices/SliceBroadcastReceiver.java b/src/com/android/settings/slices/SliceBroadcastReceiver.java
index 061cf18..b2ea583 100644
--- a/src/com/android/settings/slices/SliceBroadcastReceiver.java
+++ b/src/com/android/settings/slices/SliceBroadcastReceiver.java
@@ -184,7 +184,7 @@
 
         final BasePreferenceController controller = getPreferenceController(context, key);
 
-        if (!(controller instanceof Copyable)) {
+        if (!(controller instanceof Sliceable)) {
             throw new IllegalArgumentException(
                     "Copyable action passed for a non-copyable key:" + key);
         }
@@ -197,7 +197,7 @@
             return;
         }
 
-        ((Copyable) controller).copy();
+        controller.copy();
     }
 
     /**
diff --git a/src/com/android/settings/slices/SliceBuilderUtils.java b/src/com/android/settings/slices/SliceBuilderUtils.java
index 8f85431..c3869a6 100644
--- a/src/com/android/settings/slices/SliceBuilderUtils.java
+++ b/src/com/android/settings/slices/SliceBuilderUtils.java
@@ -93,7 +93,7 @@
             return buildUnavailableSlice(context, sliceData);
         }
 
-        if (controller instanceof Copyable) {
+        if (controller.isCopyableSlice()) {
             return buildCopyableSlice(context, sliceData, controller);
         }
 
diff --git a/src/com/android/settings/slices/Sliceable.java b/src/com/android/settings/slices/Sliceable.java
index ddec2e1..c1661f8 100644
--- a/src/com/android/settings/slices/Sliceable.java
+++ b/src/com/android/settings/slices/Sliceable.java
@@ -16,7 +16,15 @@
 
 package com.android.settings.slices;
 
+import static android.content.Context.CLIPBOARD_SERVICE;
+
+import android.content.ClipData;
+import android.content.ClipboardManager;
+import android.content.Context;
 import android.content.IntentFilter;
+import android.widget.Toast;
+
+import com.android.settings.R;
 
 /**
  * A collection of API making a PreferenceController "sliceable"
@@ -55,4 +63,44 @@
     default boolean hasAsyncUpdate() {
         return false;
     }
+
+    /**
+     * Copy the key slice information to the clipboard.
+     * It is highly recommended to show the toast to notify users when implemented this function.
+     */
+    default void copy() {
+    }
+
+    /**
+     * Whether or not it's a copyable slice.
+     */
+    default boolean isCopyableSlice() {
+        return false;
+    }
+
+    /**
+     * Set the copy content to the clipboard and show the toast.
+     */
+    static void setCopyContent(Context context, CharSequence copyContent,
+            CharSequence messageTitle) {
+        final ClipboardManager clipboard = (ClipboardManager) context.getSystemService(
+                CLIPBOARD_SERVICE);
+        final ClipData clip = ClipData.newPlainText("text", copyContent);
+        clipboard.setPrimaryClip(clip);
+
+        final String toast = context.getString(R.string.copyable_slice_toast, messageTitle);
+        Toast.makeText(context, toast, Toast.LENGTH_SHORT).show();
+    }
+
+    /**
+     * Settings Slices which require background work, such as updating lists should implement a
+     * {@link SliceBackgroundWorker} and return it here. An example of background work is updating
+     * a list of Wifi networks available in the area.
+     *
+     * @return a {@link Class<? extends SliceBackgroundWorker>} to perform background work for the
+     * slice.
+     */
+    default Class<? extends SliceBackgroundWorker> getBackgroundWorkerClass() {
+        return null;
+    }
 }
diff --git a/src/com/android/settings/wifi/AddNetworkFragment.java b/src/com/android/settings/wifi/AddNetworkFragment.java
index 651b25f..81b6c85 100644
--- a/src/com/android/settings/wifi/AddNetworkFragment.java
+++ b/src/com/android/settings/wifi/AddNetworkFragment.java
@@ -19,12 +19,14 @@
 import android.app.Activity;
 import android.app.settings.SettingsEnums;
 import android.content.Intent;
+import android.net.wifi.WifiConfiguration;
 import android.os.Bundle;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.Button;
 import android.widget.ImageButton;
+import android.widget.TextView;
 
 import androidx.annotation.VisibleForTesting;
 
@@ -40,7 +42,10 @@
     final static int SUBMIT_BUTTON_ID = android.R.id.button1;
     @VisibleForTesting
     final static int CANCEL_BUTTON_ID = android.R.id.button2;
-    final static int SCANNER_BUTTON_ID = R.id.ssid_scanner_button;
+    final static int SSID_SCANNER_BUTTON_ID = R.id.ssid_scanner_button;
+    final static int PASSWORD_SCANNER_BUTTON_ID = R.id.password_scanner_button;
+
+    private static final int REQUEST_CODE_WIFI_DPP_ENROLLEE_QR_CODE_SCANNER = 0;
 
     private WifiConfigController mUIController;
     private Button mSubmitBtn;
@@ -68,10 +73,12 @@
 
         mSubmitBtn = rootView.findViewById(SUBMIT_BUTTON_ID);
         mCancelBtn = rootView.findViewById(CANCEL_BUTTON_ID);
-        final ImageButton scannerButton = rootView.findViewById(SCANNER_BUTTON_ID);
+        final ImageButton ssidScannerButton = rootView.findViewById(SSID_SCANNER_BUTTON_ID);
+        final ImageButton passwordScannerButton = rootView.findViewById(PASSWORD_SCANNER_BUTTON_ID);
         mSubmitBtn.setOnClickListener(this);
         mCancelBtn.setOnClickListener(this);
-        scannerButton.setOnClickListener(this);
+        ssidScannerButton.setOnClickListener(this);
+        passwordScannerButton.setOnClickListener(this);
         mUIController = new WifiConfigController(this, rootView, null, getMode());
 
         return rootView;
@@ -85,6 +92,8 @@
 
     @Override
     public void onClick(View view) {
+        String ssid = null;
+
         switch (view.getId()) {
             case SUBMIT_BUTTON_ID:
                 handleSubmitAction();
@@ -92,15 +101,34 @@
             case CANCEL_BUTTON_ID:
                 handleCancelAction();
                 break;
-            case SCANNER_BUTTON_ID:
+            case SSID_SCANNER_BUTTON_ID:
+                final TextView ssidEditText = getView().findViewById(R.id.ssid);
+                ssid = ssidEditText.getText().toString();
+                // No break and flows to case PASSWORD_SCANNER_BUTTON_ID
+            case PASSWORD_SCANNER_BUTTON_ID:
                 // Launch QR code scanner to join a network.
-                getContext().startActivity(
-                        WifiDppUtils.getEnrolleeQrCodeScannerIntent(/* ssid */ null));
+                startActivityForResult(WifiDppUtils.getEnrolleeQrCodeScannerIntent(ssid),
+                        REQUEST_CODE_WIFI_DPP_ENROLLEE_QR_CODE_SCANNER);
                 break;
         }
     }
 
     @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+
+        if (requestCode == REQUEST_CODE_WIFI_DPP_ENROLLEE_QR_CODE_SCANNER) {
+            if (resultCode != Activity.RESULT_OK) {
+                return;
+            }
+
+            final WifiConfiguration config = data.getParcelableExtra(
+                    WifiDialogActivity.KEY_WIFI_CONFIGURATION);
+            successfullyFinish(config);
+        }
+    }
+
+    @Override
     public int getMode() {
         return WifiConfigUiBase.MODE_CONNECT;
     }
@@ -158,9 +186,13 @@
 
     @VisibleForTesting
     void handleSubmitAction() {
+        successfullyFinish(mUIController.getConfig());
+    }
+
+    private void successfullyFinish(WifiConfiguration config) {
         final Intent intent = new Intent();
         final Activity activity = getActivity();
-        intent.putExtra(WIFI_CONFIG_KEY, mUIController.getConfig());
+        intent.putExtra(WIFI_CONFIG_KEY, config);
         activity.setResult(Activity.RESULT_OK, intent);
         activity.finish();
     }
diff --git a/src/com/android/settings/wifi/WifiDialog.java b/src/com/android/settings/wifi/WifiDialog.java
index 7d5f3b3..fbea824 100644
--- a/src/com/android/settings/wifi/WifiDialog.java
+++ b/src/com/android/settings/wifi/WifiDialog.java
@@ -18,15 +18,16 @@
 
 import android.content.Context;
 import android.content.DialogInterface;
+import android.content.Intent;
 import android.os.Bundle;
 import android.view.View;
 import android.widget.Button;
 import android.widget.ImageButton;
+import android.widget.TextView;
 
 import androidx.appcompat.app.AlertDialog;
 
 import com.android.settings.R;
-import com.android.settings.wifi.dpp.WifiDppUtils;
 import com.android.settingslib.RestrictedLockUtils;
 import com.android.settingslib.RestrictedLockUtilsInternal;
 import com.android.settingslib.wifi.AccessPoint;
@@ -40,6 +41,9 @@
 
         default void onSubmit(WifiDialog dialog) {
         }
+
+        default void onScan(WifiDialog dialog, String ssid) {
+        }
     }
 
     private static final int BUTTON_SUBMIT = DialogInterface.BUTTON_POSITIVE;
@@ -80,18 +84,6 @@
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         mView = getLayoutInflater().inflate(R.layout.wifi_dialog, /* root */ null);
-        final ImageButton scannerButton = mView.findViewById(R.id.password_scanner_button);
-        if (scannerButton != null) {
-            scannerButton.setOnClickListener((View v) -> {
-                String ssid = null;
-                if (mAccessPoint != null) {
-                    ssid = mAccessPoint.getSsidStr();
-                }
-                // Launch QR code scanner to join a network.
-                getContext().startActivity(
-                        WifiDppUtils.getEnrolleeQrCodeScannerIntent(ssid));
-            });
-        }
         setView(mView);
         mController = new WifiConfigController(this, mView, mAccessPoint, mMode);
         super.onCreate(savedInstanceState);
@@ -109,6 +101,35 @@
         }
     }
 
+    @Override
+    protected void onStart() {
+        View.OnClickListener onClickScannerButtonListener = v -> {
+            if (mListener == null) {
+                return;
+            }
+
+            String ssid = null;
+            if (mAccessPoint == null) {
+                final TextView ssidEditText = findViewById(R.id.ssid);
+                ssid = ssidEditText.getText().toString();
+            } else {
+                ssid = mAccessPoint.getSsidStr();
+            }
+            mListener.onScan(/* WifiDialog */ this, ssid);
+        };
+
+        final ImageButton ssidScannerButton = findViewById(R.id.ssid_scanner_button);
+        ssidScannerButton.setOnClickListener(onClickScannerButtonListener);
+
+        final ImageButton passwordScannerButton = findViewById(R.id.password_scanner_button);
+        passwordScannerButton.setOnClickListener(onClickScannerButtonListener);
+
+        if (mHideSubmitButton) {
+            ssidScannerButton.setVisibility(View.GONE);
+            passwordScannerButton.setVisibility(View.GONE);
+        }
+    }
+
     public void onRestoreInstanceState(Bundle savedInstanceState) {
         super.onRestoreInstanceState(savedInstanceState);
         mController.updatePassword();
diff --git a/src/com/android/settings/wifi/WifiDialogActivity.java b/src/com/android/settings/wifi/WifiDialogActivity.java
index c32bcf3..35de66e 100644
--- a/src/com/android/settings/wifi/WifiDialogActivity.java
+++ b/src/com/android/settings/wifi/WifiDialogActivity.java
@@ -29,6 +29,7 @@
 import androidx.annotation.VisibleForTesting;
 
 import com.android.settings.SetupWizardUtils;
+import com.android.settings.wifi.dpp.WifiDppUtils;
 import com.android.settingslib.wifi.AccessPoint;
 
 import com.google.android.setupcompat.util.WizardManagerHelper;
@@ -49,10 +50,13 @@
     @VisibleForTesting
     static final String KEY_CONNECT_FOR_CALLER = "connect_for_caller";
 
-    private static final String KEY_WIFI_CONFIGURATION = "wifi_configuration";
+    public static final String KEY_WIFI_CONFIGURATION = "wifi_configuration";
+
     private static final int RESULT_CONNECTED = RESULT_FIRST_USER;
     private static final int RESULT_FORGET = RESULT_FIRST_USER + 1;
 
+    private static final int REQUEST_CODE_WIFI_DPP_ENROLLEE_QR_CODE_SCANNER = 0;
+
     private WifiDialog mDialog;
 
     @Override
@@ -162,4 +166,25 @@
         mDialog = null;
         finish();
     }
+
+    @Override
+    public void onScan(WifiDialog dialog, String ssid) {
+        // Launch QR code scanner to join a network.
+        startActivityForResult(WifiDppUtils.getEnrolleeQrCodeScannerIntent(ssid),
+                REQUEST_CODE_WIFI_DPP_ENROLLEE_QR_CODE_SCANNER);
+    }
+
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+
+        if (requestCode == REQUEST_CODE_WIFI_DPP_ENROLLEE_QR_CODE_SCANNER) {
+            if (resultCode != RESULT_OK) {
+                return;
+            }
+
+            setResult(RESULT_CONNECTED, data);
+            finish();
+        }
+    }
 }
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index 4ca9f86..27c495e 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -117,6 +117,8 @@
     private static final String PREF_KEY_SAVED_NETWORKS = "saved_networks";
     private static final String PREF_KEY_STATUS_MESSAGE = "wifi_status_message";
 
+    private static final int REQUEST_CODE_WIFI_DPP_ENROLLEE_QR_CODE_SCANNER = 0;
+
     private static boolean isVerboseLoggingEnabled() {
         return WifiTracker.sVerboseLogging || Log.isLoggable(TAG, Log.VERBOSE);
     }
@@ -427,10 +429,17 @@
     public void onActivityResult(int requestCode, int resultCode, Intent data) {
         super.onActivityResult(requestCode, resultCode, data);
 
-        // Only handle request comes from AddNetworkFragment
         if (requestCode == ADD_NETWORK_REQUEST) {
             handleAddNetworkRequest(resultCode, data);
             return;
+        } else if (requestCode == REQUEST_CODE_WIFI_DPP_ENROLLEE_QR_CODE_SCANNER) {
+            if (resultCode == Activity.RESULT_OK) {
+                if (mDialog != null) {
+                    mDialog.dismiss();
+                }
+                mWifiTracker.resumeScanning();
+            }
+            return;
         }
 
         final boolean formerlyRestricted = mIsRestricted;
@@ -1065,6 +1074,13 @@
         }
     }
 
+    @Override
+    public void onScan(WifiDialog dialog, String ssid) {
+        // Launch QR code scanner to join a network.
+        startActivityForResult(WifiDppUtils.getEnrolleeQrCodeScannerIntent(ssid),
+                REQUEST_CODE_WIFI_DPP_ENROLLEE_QR_CODE_SCANNER);
+    }
+
     /* package */ void submit(WifiConfigController configController) {
 
         final WifiConfiguration config = configController.getConfig();
diff --git a/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java b/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java
index 671624e..53b1530 100644
--- a/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java
+++ b/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java
@@ -371,9 +371,6 @@
 
         // Update whether the forget button should be displayed.
         mButtonsPref.setButton1Visible(canForgetNetwork());
-
-        // TODO(b/124700405): Check if showing share button is fine to added for saved network
-        mButtonsPref.setButton3Visible(false);
     }
 
     private void updateLiveNetworkInfo() {
diff --git a/src/com/android/settings/wifi/dpp/WifiDppAddDeviceFragment.java b/src/com/android/settings/wifi/dpp/WifiDppAddDeviceFragment.java
index 97b2ebe..9e731ba 100644
--- a/src/com/android/settings/wifi/dpp/WifiDppAddDeviceFragment.java
+++ b/src/com/android/settings/wifi/dpp/WifiDppAddDeviceFragment.java
@@ -172,6 +172,9 @@
             mLatestStatusCode = code;
         }
 
+        if (isGoingInitiator()) {
+            mSummary.setText(R.string.wifi_dpp_sharing_wifi_with_this_device);
+        }
         mProgressBar.setVisibility(isGoingInitiator() ? View.VISIBLE : View.INVISIBLE);
         mButtonRight.setVisibility(isGoingInitiator() ? View.INVISIBLE : View.VISIBLE);
     }
@@ -255,7 +258,7 @@
             mTitle.setText(information);
         }
 
-        mSummary.setText(getString(R.string.wifi_dpp_add_device_to_wifi, getSsid()));
+        updateSummary();
         mWifiApPictureView = view.findViewById(R.id.wifi_ap_picture_view);
 
         mChooseDifferentNetwork = view.findViewById(R.id.choose_different_network);
@@ -273,6 +276,7 @@
             mProgressBar.setVisibility(View.VISIBLE);
             mButtonRight.setVisibility(View.INVISIBLE);
             startWifiDppConfiguratorInitiator();
+            updateSummary();
         });
 
         if (savedInstanceState != null) {
@@ -342,4 +346,12 @@
 
         return model.isGoingInitiator();
     }
+
+    private void updateSummary() {
+        if (isGoingInitiator()) {
+            mSummary.setText(R.string.wifi_dpp_sharing_wifi_with_this_device);
+        } else {
+            mSummary.setText(getString(R.string.wifi_dpp_add_device_to_wifi, getSsid()));
+        }
+    }
 }
diff --git a/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java b/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java
index e664a05..a19069b 100644
--- a/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java
+++ b/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java
@@ -31,7 +31,6 @@
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
-import android.provider.Settings;
 import android.text.TextUtils;
 import android.util.Log;
 import android.util.Size;
@@ -48,6 +47,7 @@
 import androidx.lifecycle.ViewModelProviders;
 
 import com.android.settings.R;
+import com.android.settings.wifi.WifiDialogActivity;
 import com.android.settings.wifi.qrcode.QrCamera;
 import com.android.settings.wifi.qrcode.QrDecorateView;
 
@@ -77,6 +77,7 @@
     // Key for Bundle usage
     private static final String KEY_IS_CONFIGURATOR_MODE = "key_is_configurator_mode";
     private static final String KEY_LATEST_ERROR_CODE = "key_latest_error_code";
+    private static final String KEY_WIFI_CONFIGURATION = "key_wifi_configuration";
 
     private ProgressBar mProgressBar;
     private QrCamera mCamera;
@@ -93,6 +94,9 @@
     /** QR code data scanned by camera */
     private WifiQrCode mWifiQrCode;
 
+    /** The WifiConfiguration connecting for enrollee usage */
+    private WifiConfiguration mWifiConfiguration;
+
     private int mLatestStatusCode = WifiDppUtils.EASY_CONNECT_EVENT_FAILURE_NONE;
 
     @Override
@@ -102,6 +106,7 @@
         if (savedInstanceState != null) {
             mIsConfiguratorMode = savedInstanceState.getBoolean(KEY_IS_CONFIGURATOR_MODE);
             mLatestStatusCode = savedInstanceState.getInt(KEY_LATEST_ERROR_CODE);
+            mWifiConfiguration = savedInstanceState.getParcelable(KEY_WIFI_CONFIGURATION);
         }
 
         final WifiDppInitiatorViewModel model =
@@ -224,13 +229,7 @@
         } else {
             mTitle.setText(R.string.wifi_dpp_scan_qr_code);
 
-            String description;
-            if (TextUtils.isEmpty(mSsid)) {
-                description = getString(R.string.wifi_dpp_scan_qr_code_join_unknown_network, mSsid);
-            } else {
-                description = getString(R.string.wifi_dpp_scan_qr_code_join_network, mSsid);
-            }
-            mSummary.setText(description);
+            updateEnrolleeSummary();
         }
 
         mErrorMessage = view.findViewById(R.id.error_message);
@@ -410,6 +409,7 @@
                     if (!mIsConfiguratorMode) {
                         mProgressBar.setVisibility(View.VISIBLE);
                         startWifiDppEnrolleeInitiator((WifiQrCode)msg.obj);
+                        updateEnrolleeSummary();
                     }
                     break;
 
@@ -417,6 +417,7 @@
                     mErrorMessage.setVisibility(View.INVISIBLE);
 
                     final WifiNetworkConfig wifiNetworkConfig = (WifiNetworkConfig)msg.obj;
+                    mWifiConfiguration = wifiNetworkConfig.getWifiConfigurationOrNull();
                     wifiNetworkConfig.connect(getContext(),
                             /* listener */ WifiDppQrCodeScannerFragment.this);
                     break;
@@ -431,6 +432,7 @@
     public void onSaveInstanceState(Bundle outState) {
         outState.putBoolean(KEY_IS_CONFIGURATOR_MODE, mIsConfiguratorMode);
         outState.putInt(KEY_LATEST_ERROR_CODE, mLatestStatusCode);
+        outState.putParcelable(KEY_WIFI_CONFIGURATION, mWifiConfiguration);
 
         super.onSaveInstanceState(outState);
     }
@@ -446,6 +448,7 @@
             for (WifiConfiguration wifiConfig : wifiConfigs) {
                 if (wifiConfig.networkId == newNetworkId) {
                     mLatestStatusCode = WifiDppUtils.EASY_CONNECT_EVENT_SUCCESS;
+                    mWifiConfiguration = wifiConfig;
                     wifiManager.connect(wifiConfig, WifiDppQrCodeScannerFragment.this);
                     return;
                 }
@@ -453,6 +456,7 @@
 
             Log.e(TAG, "Invalid networkId " + newNetworkId);
             mLatestStatusCode = EasyConnectStatusCallback.EASY_CONNECT_EVENT_FAILURE_GENERIC;
+            updateEnrolleeSummary();
             mProgressBar.setVisibility(View.INVISIBLE);
             showErrorMessage(getString(R.string.wifi_dpp_check_connection_try_again));
             restartCamera();
@@ -520,6 +524,7 @@
             }
 
             mLatestStatusCode = code;
+            updateEnrolleeSummary();
             mProgressBar.setVisibility(View.INVISIBLE);
             restartCamera();
         }
@@ -539,9 +544,11 @@
 
     @Override
     public void onSuccess() {
-        startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
+        final Intent resultIntent = new Intent();
+        resultIntent.putExtra(WifiDialogActivity.KEY_WIFI_CONFIGURATION, mWifiConfiguration);
+
         final Activity hostActivity = getActivity();
-        hostActivity.setResult(Activity.RESULT_OK);
+        hostActivity.setResult(Activity.RESULT_OK, resultIntent);
         hostActivity.finish();
     }
 
@@ -578,4 +585,18 @@
 
         mCamera.start(surfaceTexture);
     }
+
+    private void updateEnrolleeSummary() {
+        if (isGoingInitiator()) {
+            mSummary.setText(R.string.wifi_dpp_connecting);
+        } else {
+            String description;
+            if (TextUtils.isEmpty(mSsid)) {
+                description = getString(R.string.wifi_dpp_scan_qr_code_join_unknown_network, mSsid);
+            } else {
+                description = getString(R.string.wifi_dpp_scan_qr_code_join_network, mSsid);
+            }
+            mSummary.setText(description);
+        }
+    }
 }
diff --git a/src/com/android/settings/wifi/dpp/WifiDppUtils.java b/src/com/android/settings/wifi/dpp/WifiDppUtils.java
index 24cd1d7..6c991cf 100644
--- a/src/com/android/settings/wifi/dpp/WifiDppUtils.java
+++ b/src/com/android/settings/wifi/dpp/WifiDppUtils.java
@@ -95,6 +95,11 @@
     /**
      * Returns an intent to launch QR code scanner for Wi-Fi DPP enrollee.
      *
+     * After enrollee success, the callee activity will return connecting WifiConfiguration by
+     * putExtra {@code WifiDialogActivity.KEY_WIFI_CONFIGURATION} for
+     * {@code Activity#setResult(int resultCode, Intent data)}. The calling object should check
+     * if it's available before using it.
+     *
      * @param ssid The data corresponding to {@code WifiConfiguration} SSID
      * @return Intent for launching QR code scanner
      */
diff --git a/src/com/android/settings/wifi/dpp/WifiNetworkConfig.java b/src/com/android/settings/wifi/dpp/WifiNetworkConfig.java
index 979e602..6135cba 100644
--- a/src/com/android/settings/wifi/dpp/WifiNetworkConfig.java
+++ b/src/com/android/settings/wifi/dpp/WifiNetworkConfig.java
@@ -228,7 +228,7 @@
     /**
      * This is a simplified method from {@code WifiConfigController.getConfig()}
      */
-    private WifiConfiguration getWifiConfigurationOrNull() {
+    WifiConfiguration getWifiConfigurationOrNull() {
         if (!isValidConfig(this)) {
             return null;
         }
diff --git a/src/com/android/settings/wifi/slice/ContextualWifiSlice.java b/src/com/android/settings/wifi/slice/ContextualWifiSlice.java
index 5761ae5..fa8c267 100644
--- a/src/com/android/settings/wifi/slice/ContextualWifiSlice.java
+++ b/src/com/android/settings/wifi/slice/ContextualWifiSlice.java
@@ -16,26 +16,17 @@
 
 package com.android.settings.wifi.slice;
 
-import android.annotation.ColorInt;
 import android.content.Context;
-import android.graphics.PorterDuff;
-import android.graphics.PorterDuffColorFilter;
-import android.graphics.drawable.Drawable;
-import android.net.NetworkInfo.State;
 import android.net.Uri;
 import android.net.wifi.WifiSsid;
 import android.text.TextUtils;
 import android.util.Log;
 
 import androidx.annotation.VisibleForTesting;
-import androidx.core.graphics.drawable.IconCompat;
 import androidx.slice.Slice;
 
-import com.android.settings.R;
-import com.android.settings.Utils;
 import com.android.settings.slices.CustomSliceRegistry;
 import com.android.settings.slices.CustomSliceable;
-import com.android.settingslib.wifi.AccessPoint;
 
 /**
  * {@link CustomSliceable} for Wi-Fi, used by contextual homepage.
@@ -65,36 +56,6 @@
         // keep showing this card to keep UI stable, even if wifi connects to a network later.
         mPreviouslyDisplayed = true;
 
-        // Reload theme for switching dark mode on/off
-        mContext.getTheme().applyStyle(R.style.Theme_Settings_Home, true /* force */);
-
         return super.getSlice();
     }
-
-    @Override
-    protected IconCompat getAccessPointLevelIcon(AccessPoint accessPoint) {
-        final Drawable d = mContext.getDrawable(
-                com.android.settingslib.Utils.getWifiIconResource(accessPoint.getLevel()));
-
-        @ColorInt int color;
-        if (accessPoint.isActive()) {
-            final State state = accessPoint.getNetworkInfo().getState();
-            if (state == State.CONNECTED) {
-                color = Utils.getColorAccentDefaultColor(mContext);
-            } else { // connecting
-                color = Utils.getDisabled(mContext, Utils.getColorAttrDefaultColor(mContext,
-                        android.R.attr.colorControlNormal));
-            }
-        } else {
-            color = Utils.getColorAttrDefaultColor(mContext, android.R.attr.colorControlNormal);
-        }
-
-        d.setColorFilter(new PorterDuffColorFilter(color, PorterDuff.Mode.SRC_IN));
-        return Utils.createIconWithDrawable(d);
-    }
-
-    @Override
-    protected int getSliceAccentColor() {
-        return -1;
-    }
 }
diff --git a/src/com/android/settings/wifi/slice/WifiSlice.java b/src/com/android/settings/wifi/slice/WifiSlice.java
index b4b94e1..679ab8b 100644
--- a/src/com/android/settings/wifi/slice/WifiSlice.java
+++ b/src/com/android/settings/wifi/slice/WifiSlice.java
@@ -26,12 +26,21 @@
 import android.app.settings.SettingsEnums;
 import android.content.Context;
 import android.content.Intent;
+import android.graphics.Color;
+import android.graphics.PorterDuff;
+import android.graphics.PorterDuffColorFilter;
+import android.graphics.drawable.ColorDrawable;
+import android.graphics.drawable.Drawable;
+import android.net.NetworkInfo;
 import android.net.Uri;
 import android.net.wifi.WifiInfo;
 import android.net.wifi.WifiManager;
 import android.net.wifi.WifiSsid;
 import android.os.Bundle;
+import android.text.Spannable;
+import android.text.SpannableString;
 import android.text.TextUtils;
+import android.text.style.ForegroundColorSpan;
 
 import androidx.annotation.VisibleForTesting;
 import androidx.core.graphics.drawable.IconCompat;
@@ -79,13 +88,15 @@
 
     @Override
     public Slice getSlice() {
+        // Reload theme for switching dark mode on/off
+        mContext.getTheme().applyStyle(R.style.Theme_Settings_Home, true /* force */);
+
         final boolean isWifiEnabled = isWifiEnabled();
 
         final IconCompat icon = IconCompat.createWithResource(mContext,
                 R.drawable.ic_settings_wireless);
         final String title = mContext.getString(R.string.wifi_settings);
         final CharSequence summary = getSummary();
-        @ColorInt final int color = getSliceAccentColor();
         final PendingIntent toggleAction = getBroadcastIntent(mContext);
         final PendingIntent primaryAction = getPrimaryAction();
         final SliceAction primarySliceAction = SliceAction.createDeeplink(primaryAction, icon,
@@ -94,7 +105,7 @@
                 null /* actionTitle */, isWifiEnabled);
 
         final ListBuilder listBuilder = new ListBuilder(mContext, getUri(), ListBuilder.INFINITY)
-                .setAccentColor(color)
+                .setAccentColor(COLOR_NOT_TINTED)
                 .addRow(new ListBuilder.RowBuilder()
                         .setTitle(title)
                         .setSubtitle(summary)
@@ -118,8 +129,7 @@
             if (i < apCount) {
                 listBuilder.addRow(getAccessPointRow(results.get(i)));
             } else if (needLoadingRow) {
-                listBuilder.addRow(new ListBuilder.RowBuilder()
-                        .setTitle(mContext.getText(R.string.wifi_empty_list_wifi_on)));
+                listBuilder.addRow(getLoadingRow());
                 needLoadingRow = false;
             } else {
                 listBuilder.addRow(new ListBuilder.RowBuilder()
@@ -130,11 +140,11 @@
     }
 
     private ListBuilder.RowBuilder getAccessPointRow(AccessPoint accessPoint) {
-        final CharSequence title = accessPoint.getConfigName();
+        final CharSequence title = getAccessPointName(accessPoint);
         final IconCompat levelIcon = getAccessPointLevelIcon(accessPoint);
         final ListBuilder.RowBuilder rowBuilder = new ListBuilder.RowBuilder()
                 .setTitleItem(levelIcon, ListBuilder.ICON_IMAGE)
-                .setTitle(title)
+                .setSubtitle(title)
                 .setPrimaryAction(SliceAction.create(
                         getAccessPointAction(accessPoint), levelIcon, ListBuilder.ICON_IMAGE,
                         title));
@@ -146,14 +156,35 @@
         return rowBuilder;
     }
 
-    protected IconCompat getAccessPointLevelIcon(AccessPoint accessPoint) {
-        return IconCompat.createWithResource(mContext,
-                com.android.settingslib.Utils.getWifiIconResource(accessPoint.getLevel()));
+    private CharSequence getAccessPointName(AccessPoint accessPoint) {
+        final CharSequence name = accessPoint.getConfigName();
+        final Spannable span = new SpannableString(name);
+        @ColorInt final int color = Utils.getColorAttrDefaultColor(mContext,
+                android.R.attr.textColorPrimary);
+        span.setSpan(new ForegroundColorSpan(color), 0, name.length(),
+                Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+        return span;
     }
 
-    @ColorInt
-    protected int getSliceAccentColor() {
-        return Utils.getColorAccentDefaultColor(mContext);
+    private IconCompat getAccessPointLevelIcon(AccessPoint accessPoint) {
+        final Drawable d = mContext.getDrawable(
+                com.android.settingslib.Utils.getWifiIconResource(accessPoint.getLevel()));
+
+        @ColorInt int color;
+        if (accessPoint.isActive()) {
+            final NetworkInfo.State state = accessPoint.getNetworkInfo().getState();
+            if (state == NetworkInfo.State.CONNECTED) {
+                color = Utils.getColorAccentDefaultColor(mContext);
+            } else { // connecting
+                color = Utils.getDisabled(mContext, Utils.getColorAttrDefaultColor(mContext,
+                        android.R.attr.colorControlNormal));
+            }
+        } else {
+            color = Utils.getColorAttrDefaultColor(mContext, android.R.attr.colorControlNormal);
+        }
+
+        d.setColorFilter(new PorterDuffColorFilter(color, PorterDuff.Mode.SRC_IN));
+        return Utils.createIconWithDrawable(d);
     }
 
     private IconCompat getEndIcon(AccessPoint accessPoint) {
@@ -190,6 +221,18 @@
                 intent, 0 /* flags */);
     }
 
+    private ListBuilder.RowBuilder getLoadingRow() {
+        final CharSequence title = mContext.getText(R.string.wifi_empty_list_wifi_on);
+
+        // for aligning to the Wi-Fi AP's name
+        final IconCompat emptyIcon = Utils.createIconWithDrawable(
+                new ColorDrawable(Color.TRANSPARENT));
+
+        return new ListBuilder.RowBuilder()
+                .setTitleItem(emptyIcon, ListBuilder.ICON_IMAGE)
+                .setSubtitle(title);
+    }
+
     /**
      * Update the current wifi status to the boolean value keyed by
      * {@link android.app.slice.Slice#EXTRA_TOGGLE_STATE} on {@param intent}.
diff --git a/tests/robotests/src/com/android/settings/applications/RecentAppsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/RecentAppsPreferenceControllerTest.java
index 1411bc0..e2a1657 100644
--- a/tests/robotests/src/com/android/settings/applications/RecentAppsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/RecentAppsPreferenceControllerTest.java
@@ -25,9 +25,9 @@
 import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.ArgumentMatchers.anyLong;
 import static org.mockito.ArgumentMatchers.argThat;
-import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
@@ -146,6 +146,7 @@
         when(mUsageStatsManager.queryUsageStats(anyInt(), anyLong(), anyLong()))
                 .thenReturn(stats);
         mAppEntry.info = mApplicationInfo;
+        mController.reloadData();
 
         assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
     }
@@ -157,13 +158,17 @@
     }
 
     @Test
-    public void displayPreferenceAndUpdateState_shouldRefreshUi() {
-        doNothing().when(mController).refreshUi();
-
+    public void displayPreference_shouldNotReloadData() {
         mController.displayPreference(mScreen);
-        mController.updateState(mScreen);
 
-        verify(mController, times(2)).refreshUi();
+        verify(mController, never()).reloadData();
+    }
+
+    @Test
+    public void displayPreference_shouldRefreshUi() {
+        mController.displayPreference(mScreen);
+
+        verify(mController).refreshUi();
     }
 
     @Test
@@ -174,6 +179,25 @@
     }
 
     @Test
+    public void updateState_firstLaunch_shouldNotReloadData() {
+        mController.mIsFirstLaunch = true;
+
+        mController.updateState(mRecentAppsPreference);
+
+        verify(mController, never()).reloadData();
+    }
+
+    @Test
+    public void updateState_afterFirstLaunch_shouldReloadDataAndRefreshUi() {
+        mController.mIsFirstLaunch = false;
+
+        mController.updateState(mRecentAppsPreference);
+
+        verify(mController).reloadData();
+        verify(mController).refreshUi();
+    }
+
+    @Test
     public void updateState_threeValidRecentOpenAppsSet_setAppEntityThreeTime() {
         final List<UsageStats> stats = new ArrayList<>();
         final UsageStats stat1 = new UsageStats();
@@ -203,6 +227,7 @@
         when(mUsageStatsManager.queryUsageStats(anyInt(), anyLong(), anyLong()))
                 .thenReturn(stats);
         mAppEntry.info = mApplicationInfo;
+        mController.mIsFirstLaunch = false;
 
         mController.updateState(mRecentAppsPreference);
 
@@ -243,6 +268,7 @@
         when(mUsageStatsManager.queryUsageStats(anyInt(), anyLong(), anyLong()))
                 .thenReturn(stats);
         mAppEntry.info = mApplicationInfo;
+        mController.mIsFirstLaunch = false;
 
         mController.updateState(mRecentAppsPreference);
 
@@ -274,6 +300,7 @@
         when(mUsageStatsManager.queryUsageStats(anyInt(), anyLong(), anyLong()))
                 .thenReturn(stats);
         mAppEntry.info = mApplicationInfo;
+        mController.mIsFirstLaunch = false;
 
         mController.updateState(mRecentAppsPreference);
 
@@ -314,6 +341,7 @@
         // Make sure stat2 is considered an instant app.
         ReflectionHelpers.setStaticField(AppUtils.class, "sInstantAppDataProvider",
                 (InstantAppDataProvider) (ApplicationInfo info) -> info == stat2Entry.info);
+        mController.mIsFirstLaunch = false;
 
         mController.updateState(mRecentAppsPreference);
 
@@ -389,6 +417,7 @@
                 .thenReturn(new ResolveInfo());
         when(mUsageStatsManager.queryUsageStats(anyInt(), anyLong(), anyLong()))
                 .thenReturn(stats);
+        mController.mIsFirstLaunch = false;
 
         mController.updateState(mRecentAppsPreference);
 
diff --git a/tests/robotests/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminListItemTest.java b/tests/robotests/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminListItemTest.java
index 17703e3..7392fb1 100644
--- a/tests/robotests/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminListItemTest.java
+++ b/tests/robotests/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminListItemTest.java
@@ -67,7 +67,7 @@
 
         DeviceAdminListItem item = new DeviceAdminListItem(mContext, mDeviceAdminInfo);
 
-        assertThat(item.getKey()).isEqualTo(cn.flattenToShortString());
+        assertThat(item.getKey()).isEqualTo("0@" + cn.flattenToShortString());
         assertThat(item.getName()).isEqualTo(label);
         assertThat(item.getDescription()).isEqualTo(description);
     }
diff --git a/tests/robotests/src/com/android/settings/bluetooth/AdvancedBluetoothDetailsHeaderControllerTest.java b/tests/robotests/src/com/android/settings/bluetooth/AdvancedBluetoothDetailsHeaderControllerTest.java
index 53fac3c..139ef41 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/AdvancedBluetoothDetailsHeaderControllerTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/AdvancedBluetoothDetailsHeaderControllerTest.java
@@ -21,6 +21,7 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import android.bluetooth.BluetoothAdapter;
 import android.bluetooth.BluetoothDevice;
 import android.content.Context;
 import android.graphics.Bitmap;
@@ -65,6 +66,8 @@
     private ImageView mImageView;
     @Mock
     private CachedBluetoothDevice mCachedDevice;
+    @Mock
+    private BluetoothAdapter mBluetoothAdapter;
     private AdvancedBluetoothDetailsHeaderController mController;
     private LayoutPreference mLayoutPreference;
 
@@ -78,6 +81,7 @@
         mLayoutPreference = new LayoutPreference(mContext,
                 LayoutInflater.from(mContext).inflate(R.layout.advanced_bt_entity_header, null));
         mController.mLayoutPreference = mLayoutPreference;
+        mController.mBluetoothAdapter = mBluetoothAdapter;
         when(mCachedDevice.getDevice()).thenReturn(mBluetoothDevice);
     }
 
@@ -159,6 +163,21 @@
         verify(mImageView).setImageBitmap(mBitmap);
     }
 
+    @Test
+    public void onStart_registerCallback() {
+        mController.onStart();
+
+        verify(mBluetoothAdapter).registerMetadataListener(mBluetoothDevice,
+                mController.mMetadataListener, mController.mHandler);
+    }
+
+    @Test
+    public void onStop_unregisterCallback() {
+        mController.onStop();
+
+        verify(mBluetoothAdapter).unregisterMetadataListener(mBluetoothDevice);
+    }
+
     private void assertBatteryLevel(LinearLayout linearLayout, int batteryLevel) {
         final TextView textView = linearLayout.findViewById(R.id.bt_battery_summary);
         assertThat(textView.getText().toString()).isEqualTo(
diff --git a/tests/robotests/src/com/android/settings/development/FileEncryptionPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/FileEncryptionPreferenceControllerTest.java
index 61e650f..0784a61 100644
--- a/tests/robotests/src/com/android/settings/development/FileEncryptionPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/FileEncryptionPreferenceControllerTest.java
@@ -92,7 +92,7 @@
         ReflectionHelpers.setField(mController, "mStorageManager", mStorageManager);
         when(mStorageManager.isConvertibleToFBE()).thenReturn(true);
         mController.displayPreference(mPreferenceScreen);
-        CryptoProperties.type("foobar");
+        CryptoProperties.type(CryptoProperties.type_values.NONE);
 
         mController.updateState(mPreference);
 
@@ -106,7 +106,7 @@
         ReflectionHelpers.setField(mController, "mStorageManager", mStorageManager);
         when(mStorageManager.isConvertibleToFBE()).thenReturn(true);
         mController.displayPreference(mPreferenceScreen);
-        CryptoProperties.type("file");
+        CryptoProperties.type(CryptoProperties.type_values.FILE);
 
         mController.updateState(mPreference);
 
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/HardwareInfoDialogFragmentTest.java b/tests/robotests/src/com/android/settings/deviceinfo/HardwareInfoDialogFragmentTest.java
deleted file mode 100644
index 29d9a7c..0000000
--- a/tests/robotests/src/com/android/settings/deviceinfo/HardwareInfoDialogFragmentTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2017 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.deviceinfo;
-
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verify;
-
-import android.os.SystemProperties;
-import android.view.View;
-
-import androidx.fragment.app.FragmentActivity;
-
-import com.android.settings.R;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.robolectric.Robolectric;
-import org.robolectric.RobolectricTestRunner;
-
-@RunWith(RobolectricTestRunner.class)
-public class HardwareInfoDialogFragmentTest {
-
-    private FragmentActivity mActivity;
-
-    @Before
-    public void setUp() {
-        mActivity = Robolectric.setupActivity(FragmentActivity.class);
-    }
-
-    @Test
-    public void display_shouldShowHardwareRevision() {
-        final String TEST_HARDWARE_REV = "123";
-        SystemProperties.set("ro.boot.hardware.revision", TEST_HARDWARE_REV);
-
-        final HardwareInfoDialogFragment fragment = spy(HardwareInfoDialogFragment.newInstance());
-        doReturn("").when(fragment).getSerialNumber();
-        fragment.show(mActivity.getSupportFragmentManager(), HardwareInfoDialogFragment.TAG);
-
-        verify(fragment).setText(
-                any(View.class), eq(R.id.model_label), eq(R.id.model_value),
-                anyString());
-
-        verify(fragment).setText(
-                any(View.class), eq(R.id.hardware_rev_label), eq(R.id.hardware_rev_value),
-                anyString());
-    }
-}
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/BasebandVersionDialogControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/BasebandVersionPreferenceControllerTest.java
similarity index 60%
rename from tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/BasebandVersionDialogControllerTest.java
rename to tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/BasebandVersionPreferenceControllerTest.java
index 0f56164..5f4848f 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/BasebandVersionDialogControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/BasebandVersionPreferenceControllerTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 The Android Open Source Project
+ * Copyright (C) 2019 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.
@@ -16,15 +16,12 @@
 
 package com.android.settings.deviceinfo.firmwareversion;
 
-import static com.android.settings.deviceinfo.firmwareversion.BasebandVersionDialogController
-        .BASEBAND_PROPERTY;
-import static com.android.settings.deviceinfo.firmwareversion.BasebandVersionDialogController
-        .BASEBAND_VERSION_LABEL_ID;
-import static com.android.settings.deviceinfo.firmwareversion.BasebandVersionDialogController
-        .BASEBAND_VERSION_VALUE_ID;
+import static com.android.settings.core.BasePreferenceController.AVAILABLE;
+import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE;
+import static com.android.settings.deviceinfo.firmwareversion.BasebandVersionPreferenceController.BASEBAND_PROPERTY;
 
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
+import static com.google.common.truth.Truth.assertThat;
+
 import static org.robolectric.shadow.api.Shadow.extract;
 
 import android.content.Context;
@@ -36,7 +33,6 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.RobolectricTestRunner;
 import org.robolectric.RuntimeEnvironment;
@@ -44,44 +40,35 @@
 
 @RunWith(RobolectricTestRunner.class)
 @Config(shadows = ShadowConnectivityManager.class)
-public class BasebandVersionDialogControllerTest {
-
-    @Mock
-    private FirmwareVersionDialogFragment mDialog;
+public class BasebandVersionPreferenceControllerTest {
 
     private Context mContext;
-    private BasebandVersionDialogController mController;
+    private BasebandVersionPreferenceController mController;
 
     @Before
     public void setup() {
         MockitoAnnotations.initMocks(this);
         mContext = RuntimeEnvironment.application;
-        when(mDialog.getContext()).thenReturn(mContext);
-        mController = new BasebandVersionDialogController(mDialog);
+        mController = new BasebandVersionPreferenceController(mContext, "key");
     }
 
     @Test
-    public void initialize_wifiOnly_shouldRemoveSettingFromDialog() {
-        ShadowConnectivityManager connectivityManager =
+    public void getAvailability_wifiOnly_unavailable() {
+        final ShadowConnectivityManager connectivityManager =
                 extract(mContext.getSystemService(ConnectivityManager.class));
         connectivityManager.setNetworkSupported(ConnectivityManager.TYPE_MOBILE, false);
 
-        mController.initialize();
-
-        verify(mDialog).removeSettingFromScreen(BASEBAND_VERSION_LABEL_ID);
-        verify(mDialog).removeSettingFromScreen(BASEBAND_VERSION_VALUE_ID);
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE);
     }
 
     @Test
-    public void initialize_hasMobile_shouldSetDialogTextToBasebandVersion() {
+    public void getAvailability_hasMobile_available() {
         final String text = "test";
         SystemProperties.set(BASEBAND_PROPERTY, text);
         ShadowConnectivityManager connectivityManager =
                 extract(mContext.getSystemService(ConnectivityManager.class));
         connectivityManager.setNetworkSupported(ConnectivityManager.TYPE_MOBILE, true);
 
-        mController.initialize();
-
-        verify(mDialog).setText(BASEBAND_VERSION_VALUE_ID, text);
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
     }
 }
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/BuildNumberDialogControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/BuildNumberDialogControllerTest.java
deleted file mode 100644
index a1e8813..0000000
--- a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/BuildNumberDialogControllerTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2017 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.deviceinfo.firmwareversion;
-
-import static com.android.settings.deviceinfo.firmwareversion.BuildNumberDialogController
-        .BUILD_NUMBER_VALUE_ID;
-
-import static org.mockito.Mockito.verify;
-
-import android.os.Build;
-import android.text.BidiFormatter;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.robolectric.RobolectricTestRunner;
-
-@RunWith(RobolectricTestRunner.class)
-public class BuildNumberDialogControllerTest {
-
-    @Mock
-    private FirmwareVersionDialogFragment mDialog;
-
-    private BuildNumberDialogController mController;
-
-    @Before
-    public void setup() {
-        MockitoAnnotations.initMocks(this);
-        mController = new BuildNumberDialogController(mDialog);
-    }
-
-    @Test
-    public void initialize_shouldUpdateBuildNumberToDialog() {
-        mController.initialize();
-
-        verify(mDialog)
-            .setText(BUILD_NUMBER_VALUE_ID, BidiFormatter.getInstance().unicodeWrap(Build.DISPLAY));
-    }
-}
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionDialogControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionDetailPreferenceControllerTest.java
similarity index 64%
rename from tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionDialogControllerTest.java
rename to tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionDetailPreferenceControllerTest.java
index 0c57941..adfff25 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionDialogControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionDetailPreferenceControllerTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 The Android Open Source Project
+ * Copyright (C) 2019 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.
@@ -16,13 +16,9 @@
 
 package com.android.settings.deviceinfo.firmwareversion;
 
-import static com.android.settings.deviceinfo.firmwareversion.FirmwareVersionDialogController
-        .FIRMWARE_VERSION_LABEL_ID;
-import static com.android.settings.deviceinfo.firmwareversion.FirmwareVersionDialogController
-        .FIRMWARE_VERSION_VALUE_ID;
+import static com.google.common.truth.Truth.assertThat;
 
 import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.spy;
@@ -32,7 +28,8 @@
 import android.content.Context;
 import android.os.Build;
 import android.os.UserManager;
-import android.view.View;
+
+import androidx.preference.Preference;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -44,36 +41,30 @@
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(RobolectricTestRunner.class)
-public class FirmwareVersionDialogControllerTest {
+public class FirmwareVersionDetailPreferenceControllerTest {
 
     @Mock
     private UserManager mUserManager;
-    @Mock
-    private FirmwareVersionDialogFragment mDialog;
-    @Mock
-    private View mView;
 
+    private Preference mPreference;
     private Context mContext;
-    private FirmwareVersionDialogController mController;
+    private FirmwareVersionDetailPreferenceController mController;
 
     @Before
     public void setup() {
         MockitoAnnotations.initMocks(this);
         mContext = spy(RuntimeEnvironment.application);
-        when(mDialog.getContext()).thenReturn(mContext);
-        mController = spy(new FirmwareVersionDialogController(mDialog));
+        mController = spy(new TestController(mContext, "key"));
+
         ReflectionHelpers.setField(mController, "mUserManager", mUserManager);
-        doNothing().when(mController).arrayCopy();
-        doNothing().when(mController).initializeAdminPermissions();
+
+        mPreference = new Preference(mContext);
+        mPreference.setKey(mController.getPreferenceKey());
     }
 
     @Test
-    public void initialize_shouldRegisterListenersAndSetBuildVersion() {
-        mController.initialize();
-
-        verify(mDialog).registerClickListener(eq(FIRMWARE_VERSION_VALUE_ID), any());
-        verify(mDialog).registerClickListener(eq(FIRMWARE_VERSION_LABEL_ID), any());
-        verify(mDialog).setText(FIRMWARE_VERSION_VALUE_ID, Build.VERSION.RELEASE);
+    public void getSummary_shouldGetBuildVersion() {
+        assertThat(mController.getSummary()).isEqualTo(Build.VERSION.RELEASE);
     }
 
     @Test
@@ -82,7 +73,7 @@
         hits[0] = Long.MAX_VALUE;
         when(mUserManager.hasUserRestriction(UserManager.DISALLOW_FUN)).thenReturn(true);
 
-        mController.onClick(mView);
+        mController.handlePreferenceTreeClick(mPreference);
 
         verify(mContext, never()).startActivity(any());
     }
@@ -93,8 +84,19 @@
         hits[0] = Long.MAX_VALUE;
         when(mUserManager.hasUserRestriction(UserManager.DISALLOW_FUN)).thenReturn(false);
 
-        mController.onClick(mView);
+        mController.handlePreferenceTreeClick(mPreference);
 
         verify(mContext).startActivity(any());
     }
+
+    private static class TestController extends FirmwareVersionDetailPreferenceController {
+
+        public TestController(Context context, String key) {
+            super(context, key);
+        }
+
+        @Override
+        void initializeAdminPermissions() {
+        }
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionPreferenceControllerTest.java
index 0c74525..77ae4e2 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionPreferenceControllerTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 The Android Open Source Project
+ * Copyright (C) 2019 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.
@@ -16,42 +16,29 @@
 
 package com.android.settings.deviceinfo.firmwareversion;
 
-import static android.content.Context.CLIPBOARD_SERVICE;
-
 import static com.google.common.truth.Truth.assertThat;
 
-import android.content.ClipboardManager;
 import android.content.Context;
 import android.os.Build;
 
-import androidx.fragment.app.Fragment;
 import androidx.preference.Preference;
 import androidx.preference.PreferenceManager;
 import androidx.preference.PreferenceScreen;
 
 import com.android.settings.core.BasePreferenceController;
 
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.RobolectricTestRunner;
 import org.robolectric.RuntimeEnvironment;
-import org.robolectric.annotation.Config;
-import org.robolectric.annotation.Implementation;
-import org.robolectric.annotation.Implements;
-import org.robolectric.annotation.Resetter;
 
 @RunWith(RobolectricTestRunner.class)
 public class FirmwareVersionPreferenceControllerTest {
 
     private static final String KEY = "firmware_version";
 
-    @Mock
-    private Fragment mFragment;
-
     private Preference mPreference;
     private PreferenceScreen mScreen;
     private FirmwareVersionPreferenceController mController;
@@ -62,22 +49,16 @@
         final Context context = RuntimeEnvironment.application;
         final PreferenceManager preferenceManager = new PreferenceManager(context);
         mController = new FirmwareVersionPreferenceController(context, KEY);
-        mController.setHost(mFragment);
         mPreference = new Preference(context);
         mPreference.setKey(KEY);
         mScreen = preferenceManager.createPreferenceScreen(context);
         mScreen.addPreference(mPreference);
     }
 
-    @After
-    public void tearDown() {
-        ShadowFirmwareVersionDialogFragment.reset();
-    }
-
     @Test
     public void firmwareVersion_shouldAlwaysBeShown() {
-        assertThat(mController.getAvailabilityStatus()).isEqualTo(
-                BasePreferenceController.AVAILABLE);
+        assertThat(mController.getAvailabilityStatus())
+                .isEqualTo(BasePreferenceController.AVAILABLE_UNSEARCHABLE);
     }
 
     @Test
@@ -86,55 +67,4 @@
 
         assertThat(mPreference.getSummary()).isEqualTo(Build.VERSION.RELEASE);
     }
-
-    @Test
-    @Config(shadows = ShadowFirmwareVersionDialogFragment.class)
-    public void handlePreferenceTreeClick_samePreferenceKey_shouldStartDialogFragment() {
-        final boolean result = mController.handlePreferenceTreeClick(mPreference);
-
-        assertThat(ShadowFirmwareVersionDialogFragment.isShowing).isTrue();
-        assertThat(result).isTrue();
-    }
-
-    @Test
-    public void handlePreferenceTreeClick_unknownPreferenceKey_shouldDoNothingAndReturnFalse() {
-        mPreference.setKey("foobar");
-
-        final boolean result = mController.handlePreferenceTreeClick(mPreference);
-
-        assertThat(ShadowFirmwareVersionDialogFragment.isShowing).isFalse();
-        assertThat(result).isFalse();
-    }
-
-    @Test
-    public void isSliceable_shouldBeTrue() {
-        assertThat(mController.isSliceable()).isTrue();
-    }
-
-    @Test
-    public void copy_shouldCopyVersionNumberToClipboard() {
-        mController.copy();
-
-        final Context context = RuntimeEnvironment.application;
-        final ClipboardManager clipboard = (ClipboardManager) context.getSystemService(
-                CLIPBOARD_SERVICE);
-        final CharSequence data = clipboard.getPrimaryClip().getItemAt(0).getText();
-        assertThat(data.toString()).isEqualTo(Build.VERSION.RELEASE);
-    }
-
-    @Implements(FirmwareVersionDialogFragment.class)
-    public static class ShadowFirmwareVersionDialogFragment {
-
-        private static boolean isShowing = false;
-
-        @Implementation
-        public static void show(Fragment fragemnt) {
-            isShowing = true;
-        }
-
-        @Resetter
-        public static void reset() {
-            isShowing = false;
-        }
-    }
 }
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/KernelVersionDialogControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/KernelVersionDialogControllerTest.java
deleted file mode 100644
index 52af280..0000000
--- a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/KernelVersionDialogControllerTest.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2017 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.deviceinfo.firmwareversion;
-
-import static com.android.settings.deviceinfo.firmwareversion.KernelVersionDialogController
-        .KERNEL_VERSION_VALUE_ID;
-
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import android.content.Context;
-
-import com.android.settingslib.DeviceInfoUtils;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
-
-@RunWith(RobolectricTestRunner.class)
-public class KernelVersionDialogControllerTest {
-
-    @Mock
-    private FirmwareVersionDialogFragment mDialog;
-
-    private Context mContext;
-    private KernelVersionDialogController mController;
-
-    @Before
-    public void setup() {
-        MockitoAnnotations.initMocks(this);
-        mContext = RuntimeEnvironment.application;
-        when(mDialog.getContext()).thenReturn(mContext);
-        mController = new KernelVersionDialogController(mDialog);
-    }
-
-    @Test
-    public void initialize_shouldUpdateKernelVersionToDialog() {
-        mController.initialize();
-
-        verify(mDialog)
-            .setText(KERNEL_VERSION_VALUE_ID, DeviceInfoUtils.getFormattedKernelVersion(mContext));
-    }
-}
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/KernelVersionPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/KernelVersionPreferenceControllerTest.java
new file mode 100644
index 0000000..9ee0bb3
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/KernelVersionPreferenceControllerTest.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2019 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.deviceinfo.firmwareversion;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.content.Context;
+
+import com.android.settingslib.DeviceInfoUtils;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+
+@RunWith(RobolectricTestRunner.class)
+public class KernelVersionPreferenceControllerTest {
+
+
+    private Context mContext;
+    private KernelVersionPreferenceController mController;
+
+    @Before
+    public void setup() {
+        MockitoAnnotations.initMocks(this);
+        mContext = RuntimeEnvironment.application;
+        mController = new KernelVersionPreferenceController(mContext, "key");
+    }
+
+    @Test
+    public void getSummary_shouldGetKernalVersion() {
+        assertThat(mController.getSummary()).isEqualTo(
+                DeviceInfoUtils.getFormattedKernelVersion(mContext));
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/MainlineModuleVersionPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/MainlineModuleVersionPreferenceControllerTest.java
new file mode 100644
index 0000000..2761b2f
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/MainlineModuleVersionPreferenceControllerTest.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2019 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.deviceinfo.firmwareversion;
+
+import static com.android.settings.core.BasePreferenceController.AVAILABLE;
+import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Matchers.anyInt;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
+import android.util.FeatureFlagUtils;
+
+import com.android.settings.core.FeatureFlags;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+
+@RunWith(RobolectricTestRunner.class)
+public class MainlineModuleVersionPreferenceControllerTest {
+
+    @Mock
+    private PackageManager mPackageManager;
+
+    private Context mContext;
+
+    @Before
+    public void setup() {
+        MockitoAnnotations.initMocks(this);
+        mContext = spy(RuntimeEnvironment.application);
+        when(mContext.getPackageManager()).thenReturn(mPackageManager);
+
+        FeatureFlagUtils.setEnabled(mContext, FeatureFlags.MAINLINE_MODULE, true);
+    }
+
+    @Test
+    public void getAvailabilityStatus_featureDisabled_unavailable() {
+        FeatureFlagUtils.setEnabled(mContext, FeatureFlags.MAINLINE_MODULE, false);
+
+        final MainlineModuleVersionPreferenceController controller =
+                new MainlineModuleVersionPreferenceController(mContext, "key");
+
+        assertThat(controller.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE);
+    }
+
+    @Test
+    public void getAvailabilityStatus_noMainlineModuleProvider_unavailable() {
+        when(mContext.getString(
+                com.android.internal.R.string.config_defaultModuleMetadataProvider)).thenReturn(
+                null);
+
+        final MainlineModuleVersionPreferenceController controller =
+                new MainlineModuleVersionPreferenceController(mContext, "key");
+
+        assertThat(controller.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE);
+    }
+
+    @Test
+    public void getAvailabilityStatus_noMainlineModulePackageInfo_unavailable() throws Exception {
+
+        final String provider = "test.provider";
+        when(mContext.getString(
+                com.android.internal.R.string.config_defaultModuleMetadataProvider))
+                .thenReturn(provider);
+        when(mPackageManager.getPackageInfo(eq(provider), anyInt()))
+                .thenThrow(new PackageManager.NameNotFoundException());
+
+        final MainlineModuleVersionPreferenceController controller =
+                new MainlineModuleVersionPreferenceController(mContext, "key");
+
+        assertThat(controller.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE);
+    }
+
+    @Test
+    public void getAvailabilityStatus_hasMainlineModulePackageInfo_available() throws Exception {
+        final String provider = "test.provider";
+        final String version = "test version 123";
+        final PackageInfo info = new PackageInfo();
+        info.versionName = version;
+        when(mContext.getString(
+                com.android.internal.R.string.config_defaultModuleMetadataProvider))
+                .thenReturn(provider);
+        when(mPackageManager.getPackageInfo(eq(provider), anyInt())).thenReturn(info);
+
+        final MainlineModuleVersionPreferenceController controller =
+                new MainlineModuleVersionPreferenceController(mContext, "key");
+
+        assertThat(controller.getAvailabilityStatus()).isEqualTo(AVAILABLE);
+    }
+
+}
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/ModuleVersionDialogControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/ModuleVersionDialogControllerTest.java
deleted file mode 100644
index b84ea99..0000000
--- a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/ModuleVersionDialogControllerTest.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (C) 2019 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.deviceinfo.firmwareversion;
-
-import static org.mockito.Matchers.anyInt;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import android.content.Context;
-import android.content.pm.PackageInfo;
-import android.content.pm.PackageManager;
-import android.util.FeatureFlagUtils;
-
-import com.android.settings.core.FeatureFlags;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
-
-@RunWith(RobolectricTestRunner.class)
-public class ModuleVersionDialogControllerTest {
-
-    @Mock
-    private FirmwareVersionDialogFragment mDialog;
-    @Mock
-    private PackageManager mPackageManager;
-
-    private Context mContext;
-    private ModuleVersionDialogController mController;
-
-    @Before
-    public void setup() {
-        MockitoAnnotations.initMocks(this);
-        mContext = spy(RuntimeEnvironment.application);
-        when(mDialog.getContext()).thenReturn(mContext);
-        when(mContext.getPackageManager()).thenReturn(mPackageManager);
-        mController = new ModuleVersionDialogController(mDialog);
-        FeatureFlagUtils.setEnabled(mContext, FeatureFlags.MAINLINE_MODULE, true);
-    }
-
-    @Test
-    public void initialize_featureDisabled_shouldRemoveSettingFromDialog() {
-        FeatureFlagUtils.setEnabled(mContext, FeatureFlags.MAINLINE_MODULE, false);
-
-        mController.initialize();
-
-        verify(mDialog).removeSettingFromScreen(mController.MODULE_VERSION_LABEL_ID);
-        verify(mDialog).removeSettingFromScreen(mController.MODULE_VERSION_VALUE_ID);
-    }
-
-    @Test
-    public void initialize_noMainlineModuleProvider_shouldRemoveSettingFromDialog() {
-        when(mContext.getString(
-            com.android.internal.R.string.config_defaultModuleMetadataProvider)).thenReturn(null);
-
-        mController.initialize();
-
-        verify(mDialog).removeSettingFromScreen(mController.MODULE_VERSION_LABEL_ID);
-        verify(mDialog).removeSettingFromScreen(mController.MODULE_VERSION_VALUE_ID);
-    }
-
-    @Test
-    public void initialize_noMainlineModulePackageInfo_shouldRemoveSettingFromDialog()
-            throws PackageManager.NameNotFoundException {
-        final String provider = "test.provider";
-        when(mContext.getString(
-            com.android.internal.R.string.config_defaultModuleMetadataProvider))
-            .thenReturn(provider);
-        when(mPackageManager.getPackageInfo(eq(provider), anyInt()))
-            .thenThrow(new PackageManager.NameNotFoundException());
-
-        mController.initialize();
-
-        verify(mDialog).removeSettingFromScreen(mController.MODULE_VERSION_LABEL_ID);
-        verify(mDialog).removeSettingFromScreen(mController.MODULE_VERSION_VALUE_ID);
-    }
-
-    @Test
-    public void initialize_hasMainlineModulePackageInfo_shouldshouldSetDialogTextToMainlineVersion()
-            throws PackageManager.NameNotFoundException {
-        final String provider = "test.provider";
-        final String version = "test version 123";
-        final PackageInfo info = new PackageInfo();
-        info.versionName = version;
-        when(mContext.getString(
-            com.android.internal.R.string.config_defaultModuleMetadataProvider))
-            .thenReturn(provider);
-        when(mPackageManager.getPackageInfo(eq(provider), anyInt())).thenReturn(info);
-
-        mController.initialize();
-
-        verify(mDialog).setText(mController.MODULE_VERSION_VALUE_ID, version);
-    }
-
-}
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/SecurityPatchLevelDialogControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/SecurityPatchLevelPreferenceControllerTest.java
similarity index 62%
rename from tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/SecurityPatchLevelDialogControllerTest.java
rename to tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/SecurityPatchLevelPreferenceControllerTest.java
index 8c334cc..ccc91e6 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/SecurityPatchLevelDialogControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/SecurityPatchLevelPreferenceControllerTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 The Android Open Source Project
+ * Copyright (C) 2019 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.
@@ -16,14 +16,13 @@
 
 package com.android.settings.deviceinfo.firmwareversion;
 
-import static com.android.settings.deviceinfo.firmwareversion.SecurityPatchLevelDialogController
-        .SECURITY_PATCH_LABEL_ID;
-import static com.android.settings.deviceinfo.firmwareversion.SecurityPatchLevelDialogController
-        .SECURITY_PATCH_VALUE_ID;
+import static com.android.settings.core.BasePreferenceController.AVAILABLE;
+import static com.android.settings.core.BasePreferenceController.CONDITIONALLY_UNAVAILABLE;
+
+import static com.google.common.truth.Truth.assertThat;
 
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verify;
@@ -33,7 +32,8 @@
 import android.content.Context;
 import android.content.pm.PackageManager;
 import android.os.Build;
-import android.view.View;
+
+import androidx.preference.Preference;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -47,55 +47,47 @@
 import java.util.Collections;
 
 @RunWith(RobolectricTestRunner.class)
-public class SecurityPatchLevelDialogControllerTest {
+public class SecurityPatchLevelPreferenceControllerTest {
 
     @Mock
     private PackageManager mPackageManager;
-    @Mock
-    private FirmwareVersionDialogFragment mDialog;
-    @Mock
-    private View mView;
 
     private Context mContext;
-    private SecurityPatchLevelDialogController mController;
+    private SecurityPatchLevelPreferenceController mController;
 
     @Before
     public void setup() {
         MockitoAnnotations.initMocks(this);
         mContext = spy(Robolectric.setupActivity(Activity.class));
-        when(mDialog.getContext()).thenReturn(mContext);
     }
 
     @Test
-    public void initialize_noPatchInfo_shouldRemoveSettingFromDialog() {
+    public void getAvailabilityStatus_noPatchInfo_unavailable() {
         ReflectionHelpers.setStaticField(Build.VERSION.class, "SECURITY_PATCH", "");
-        mController = new SecurityPatchLevelDialogController(mDialog);
+        mController = new SecurityPatchLevelPreferenceController(mContext, "key");
 
-        mController.initialize();
-
-        verify(mDialog).removeSettingFromScreen(SECURITY_PATCH_VALUE_ID);
-        verify(mDialog).removeSettingFromScreen(SECURITY_PATCH_LABEL_ID);
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(CONDITIONALLY_UNAVAILABLE);
     }
 
     @Test
-    public void initialize_patchInfoAvailable_shouldRegisterListeners() {
+    public void getAvailabilityStatus_hasPatchInfo_available() {
         ReflectionHelpers.setStaticField(Build.VERSION.class, "SECURITY_PATCH", "foobar");
-        mController = new SecurityPatchLevelDialogController(mDialog);
+        mController = new SecurityPatchLevelPreferenceController(mContext, "key");
 
-        mController.initialize();
-
-        verify(mDialog).registerClickListener(eq(SECURITY_PATCH_LABEL_ID), any());
-        verify(mDialog).registerClickListener(eq(SECURITY_PATCH_VALUE_ID), any());
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
     }
 
     @Test
     public void onClick_noActivityIntent_shouldDoNothing() {
         when(mPackageManager.queryIntentActivities(any(), anyInt()))
                 .thenReturn(Collections.emptyList());
-        mController = new SecurityPatchLevelDialogController(mDialog);
+        mController = new SecurityPatchLevelPreferenceController(mContext, "key");
         ReflectionHelpers.setField(mController, "mPackageManager", mPackageManager);
 
-        mController.onClick(mView);
+        final Preference pref = new Preference(mContext);
+        pref.setKey(mController.getPreferenceKey());
+
+        mController.handlePreferenceTreeClick(pref);
 
         verify(mContext, never()).startActivity(any());
     }
@@ -104,10 +96,14 @@
     public void onClick_activityIntentFound_shouldStartActivity() {
         when(mPackageManager.queryIntentActivities(any(), anyInt()))
                 .thenReturn(Collections.singletonList(null));
-        mController = new SecurityPatchLevelDialogController(mDialog);
+
+        mController = new SecurityPatchLevelPreferenceController(mContext, "key");
         ReflectionHelpers.setField(mController, "mPackageManager", mPackageManager);
 
-        mController.onClick(mView);
+        final Preference pref = new Preference(mContext);
+        pref.setKey(mController.getPreferenceKey());
+
+        mController.handlePreferenceTreeClick(pref);
 
         verify(mContext).startActivity(any());
     }
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/hardwareinfo/DeviceModelPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/hardwareinfo/DeviceModelPreferenceControllerTest.java
new file mode 100644
index 0000000..1204c44
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/deviceinfo/hardwareinfo/DeviceModelPreferenceControllerTest.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2019 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.deviceinfo.hardwareinfo;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.content.Context;
+
+import com.android.settings.core.BasePreferenceController;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+import org.robolectric.annotation.Config;
+
+@RunWith(RobolectricTestRunner.class)
+public class DeviceModelPreferenceControllerTest {
+
+    private Context mContext;
+    private DeviceModelPreferenceController mController;
+
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        mContext = RuntimeEnvironment.application;
+        mController = new DeviceModelPreferenceController(mContext, "test_key");
+    }
+
+    @Test
+    public void getAvailabilityStatus_configAllowed_available() {
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(
+                BasePreferenceController.AVAILABLE);
+    }
+
+    @Test
+    @Config(qualifiers = "mcc999")
+    public void getAvailabilityStatus_configDisallowed_unavailable() {
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(
+                BasePreferenceController.UNSUPPORTED_ON_DEVICE);
+    }
+
+    @Test
+    public void isAlwaysSliceable() {
+        assertThat(mController.isSliceable()).isTrue();
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/DeviceModelPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/hardwareinfo/HardwareInfoPreferenceControllerTest.java
similarity index 64%
rename from tests/robotests/src/com/android/settings/deviceinfo/DeviceModelPreferenceControllerTest.java
rename to tests/robotests/src/com/android/settings/deviceinfo/hardwareinfo/HardwareInfoPreferenceControllerTest.java
index 6418cf8..413c492 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/DeviceModelPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/hardwareinfo/HardwareInfoPreferenceControllerTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 The Android Open Source Project
+ * Copyright (C) 2019 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.
@@ -13,56 +13,44 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.settings.deviceinfo;
+package com.android.settings.deviceinfo.hardwareinfo;
 
 import static com.google.common.truth.Truth.assertThat;
 
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
 import android.content.Context;
 import android.os.Build;
 
-import androidx.fragment.app.Fragment;
-import androidx.fragment.app.FragmentManager;
-import androidx.fragment.app.FragmentTransaction;
 import androidx.preference.Preference;
 import androidx.preference.PreferenceManager;
 import androidx.preference.PreferenceScreen;
 
 import com.android.settings.R;
 import com.android.settings.core.BasePreferenceController;
+import com.android.settings.deviceinfo.HardwareInfoPreferenceController;
 
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.RobolectricTestRunner;
 import org.robolectric.RuntimeEnvironment;
 import org.robolectric.annotation.Config;
 
 @RunWith(RobolectricTestRunner.class)
-public class DeviceModelPreferenceControllerTest {
+public class HardwareInfoPreferenceControllerTest {
 
     private final String KEY = "device_model";
 
-    @Mock
-    private Fragment mFragment;
     private Preference mPreference;
     private PreferenceScreen mPreferenceScreen;
     private Context mContext;
-    private DeviceModelPreferenceController mController;
+    private HardwareInfoPreferenceController mController;
 
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
         mContext = RuntimeEnvironment.application;
-        mController = new DeviceModelPreferenceController(mContext, KEY);
-        mController.setHost(mFragment);
+        mController = new HardwareInfoPreferenceController(mContext, KEY);
         mPreference = new Preference(mContext);
         mPreference.setKey(KEY);
         final PreferenceManager preferenceManager = new PreferenceManager(mContext);
@@ -73,7 +61,7 @@
     @Test
     public void isAvailable_returnTrueIfVisible() {
         assertThat(mController.getAvailabilityStatus()).isEqualTo(
-                BasePreferenceController.AVAILABLE);
+                BasePreferenceController.AVAILABLE_UNSEARCHABLE);
     }
 
     @Test
@@ -90,22 +78,6 @@
         assertThat(containBuildModel(mPreference.getSummary())).isTrue();
     }
 
-    @Test
-    public void clickPreference_shouldLaunchHardwareInfoDialog() {
-        FragmentManager fragmentManager = mock(FragmentManager.class);
-        when(mFragment.getFragmentManager()).thenReturn(fragmentManager);
-        when(fragmentManager.beginTransaction()).thenReturn(mock(FragmentTransaction.class));
-
-        assertThat(mController.handlePreferenceTreeClick(mPreference)).isTrue();
-        verify(fragmentManager.beginTransaction())
-                .add(any(HardwareInfoDialogFragment.class), eq(HardwareInfoDialogFragment.TAG));
-    }
-
-    @Test
-    public void isSliceable_shouldBeTrue() {
-        assertThat(mController.isSliceable()).isTrue();
-    }
-
     private boolean containBuildModel(CharSequence result) {
         final String oracle = mContext.getResources().getString(R.string.model_summary,
                 Build.MODEL);
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/hardwareinfo/SerialNumberPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/hardwareinfo/SerialNumberPreferenceControllerTest.java
new file mode 100644
index 0000000..c2ae4af
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/deviceinfo/hardwareinfo/SerialNumberPreferenceControllerTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2019 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.deviceinfo.hardwareinfo;
+
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.content.ClipData;
+import android.content.ClipboardManager;
+import android.content.Context;
+import android.os.Build;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+
+@RunWith(RobolectricTestRunner.class)
+public class SerialNumberPreferenceControllerTest {
+
+    private Context mContext;
+    private SerialNumberPreferenceController mController;
+
+    @Before
+    public void setUp() {
+        mContext = RuntimeEnvironment.application;
+        mController = new SerialNumberPreferenceController(mContext, "test");
+    }
+
+    @Test
+    public void isCopyableSlice() {
+        assertThat(mController.isSliceable()).isTrue();
+        assertThat(mController.isCopyableSlice()).isTrue();
+    }
+
+    @Test
+    public void copy_shouldPutSerialNumberToClipBoard() {
+        mController.copy();
+
+        final ClipboardManager clipboardManager = mContext.getSystemService(ClipboardManager.class);
+        final ClipData data = clipboardManager.getPrimaryClip();
+
+        assertThat(data.getItemAt(0).getText().toString()).contains(Build.getSerial());
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/gestures/PreventRingingSwitchPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/gestures/PreventRingingSwitchPreferenceControllerTest.java
index 5f221f5..85eeacc 100644
--- a/tests/robotests/src/com/android/settings/gestures/PreventRingingSwitchPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/PreventRingingSwitchPreferenceControllerTest.java
@@ -18,6 +18,7 @@
 
 import static com.google.common.truth.Truth.assertThat;
 
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.times;
@@ -29,8 +30,10 @@
 import android.provider.Settings;
 
 import androidx.preference.Preference;
+import androidx.preference.PreferenceScreen;
 
 import com.android.settings.widget.SwitchBar;
+import com.android.settingslib.widget.LayoutPreference;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -95,4 +98,16 @@
         mController.updateState(mPreference);
         verify(mController.mSwitch, times(1)).setChecked(true);
     }
+
+    @Test
+    public void testPreferenceClickListenerAttached() {
+        PreferenceScreen preferenceScreen = mock(PreferenceScreen.class);
+        LayoutPreference mLayoutPreference = mock(LayoutPreference.class);
+        when(preferenceScreen.findPreference(mController.getPreferenceKey())).thenReturn(
+                mLayoutPreference);
+        mController.displayPreference(preferenceScreen);
+
+        verify(mLayoutPreference, times(1))
+                .setOnPreferenceClickListener(any());
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/nfc/NfcPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/nfc/NfcPreferenceControllerTest.java
index 8883ddf..e3672c9 100644
--- a/tests/robotests/src/com/android/settings/nfc/NfcPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/nfc/NfcPreferenceControllerTest.java
@@ -19,10 +19,13 @@
 import static com.google.common.truth.Truth.assertThat;
 
 import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
 import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
 import android.nfc.NfcAdapter;
 import android.nfc.NfcManager;
 import android.os.UserManager;
@@ -31,6 +34,10 @@
 import androidx.preference.PreferenceScreen;
 import androidx.preference.SwitchPreference;
 
+import com.android.settings.nfc.NfcPreferenceController.NfcSliceWorker;
+import com.android.settings.nfc.NfcPreferenceController.NfcSliceWorker.NfcUpdateReceiver;
+import com.android.settings.slices.SliceBuilderUtils;
+
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -246,4 +253,67 @@
 
         assertThat(mNfcController.mAirplaneModeObserver).isNull();
     }
+
+    @Test
+    public void ncfSliceWorker_nfcBroadcast_noExtra_sliceDoesntUpdate() {
+        final NfcSliceWorker worker = spy(new NfcSliceWorker(mContext, getDummyUri()));
+        final NfcUpdateReceiver receiver = worker.new NfcUpdateReceiver(worker);
+        final Intent triggerIntent = new Intent(NfcAdapter.ACTION_ADAPTER_STATE_CHANGED);
+
+        receiver.onReceive(mContext, triggerIntent);
+
+        verify(worker, times(0)).updateSlice();
+    }
+
+    @Test
+    public void ncfSliceWorker_nfcBroadcast_turningOn_sliceDoesntUpdate() {
+        final NfcSliceWorker worker = spy(new NfcSliceWorker(mContext, getDummyUri()));
+        final NfcUpdateReceiver receiver = worker.new NfcUpdateReceiver(worker);
+        final Intent triggerIntent = new Intent(NfcAdapter.ACTION_ADAPTER_STATE_CHANGED);
+        triggerIntent.putExtra(NfcAdapter.EXTRA_ADAPTER_STATE, NfcAdapter.STATE_TURNING_ON);
+
+        receiver.onReceive(mContext, triggerIntent);
+
+        verify(worker, times(0)).updateSlice();
+    }
+
+    @Test
+    public void ncfSliceWorker_nfcBroadcast_turningOff_sliceDoesntUpdate() {
+        final NfcSliceWorker worker = spy(new NfcSliceWorker(mContext, getDummyUri()));
+        final NfcUpdateReceiver receiver = worker.new NfcUpdateReceiver(worker);
+        final Intent triggerIntent = new Intent(NfcAdapter.ACTION_ADAPTER_STATE_CHANGED);
+        triggerIntent.putExtra(NfcAdapter.EXTRA_ADAPTER_STATE, NfcAdapter.STATE_TURNING_OFF);
+
+        receiver.onReceive(mContext, triggerIntent);
+
+        verify(worker, times(0)).updateSlice();
+    }
+
+    @Test
+    public void ncfSliceWorker_nfcBroadcast_nfcOn_sliceUpdates() {
+        final NfcSliceWorker worker = spy(new NfcSliceWorker(mContext, getDummyUri()));
+        final NfcUpdateReceiver receiver = worker.new NfcUpdateReceiver(worker);
+        final Intent triggerIntent = new Intent(NfcAdapter.ACTION_ADAPTER_STATE_CHANGED);
+        triggerIntent.putExtra(NfcAdapter.EXTRA_ADAPTER_STATE, NfcAdapter.STATE_ON);
+
+        receiver.onReceive(mContext, triggerIntent);
+
+        verify(worker).updateSlice();
+    }
+
+    @Test
+    public void ncfSliceWorker_nfcBroadcast_nfcOff_sliceUpdates() {
+        final NfcSliceWorker worker = spy(new NfcSliceWorker(mContext, getDummyUri()));
+        final NfcUpdateReceiver receiver = worker.new NfcUpdateReceiver(worker);
+        final Intent triggerIntent = new Intent(NfcAdapter.ACTION_ADAPTER_STATE_CHANGED);
+        triggerIntent.putExtra(NfcAdapter.EXTRA_ADAPTER_STATE, NfcAdapter.STATE_OFF);
+
+        receiver.onReceive(mContext, triggerIntent);
+
+        verify(worker).updateSlice();
+    }
+
+    private Uri getDummyUri() {
+        return SliceBuilderUtils.getUri("action/nfc", false);
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/notification/NotificationAssistantPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/NotificationAssistantPreferenceControllerTest.java
new file mode 100644
index 0000000..b2f65e0
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/notification/NotificationAssistantPreferenceControllerTest.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2019 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.notification;
+
+import static junit.framework.TestCase.assertEquals;
+
+import static org.mockito.Mockito.when;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.graphics.drawable.Drawable;
+import android.os.Debug;
+
+import com.android.settingslib.widget.CandidateInfo;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Answers;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+
+@RunWith(RobolectricTestRunner.class)
+public class NotificationAssistantPreferenceControllerTest {
+
+    private static final String KEY = "TEST_KEY";
+    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
+    private Context mContext;
+    @Mock
+    private NotificationBackend mBackend;
+    private NotificationAssistantPreferenceController mPreferenceController;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        mContext = RuntimeEnvironment.application;
+        mPreferenceController = new TestPreferenceController(mContext, mBackend);
+    }
+
+    @Test
+    public void testGetSummary_noAssistant() {
+        when(mBackend.getAllowedNotificationAssistant()).thenReturn(null);
+        CharSequence noneLabel = new NotificationAssistantPicker.CandidateNone(mContext)
+                .loadLabel();
+        assertEquals(noneLabel, mPreferenceController.getSummary());
+    }
+
+    @Test
+    public void testGetSummary_TestAssistant() {
+        String testName = "test_pkg/test_cls";
+        when(mBackend.getAllowedNotificationAssistant()).thenReturn(
+                ComponentName.unflattenFromString(testName));
+        assertEquals(testName, mPreferenceController.getSummary());
+    }
+
+    private final class TestPreferenceController extends NotificationAssistantPreferenceController {
+
+        private TestPreferenceController(Context context, NotificationBackend backend) {
+            super(context, KEY);
+            mNotificationBackend = backend;
+        }
+
+        @Override
+        public String getPreferenceKey() {
+            return KEY;
+        }
+
+        @Override
+        protected CandidateInfo createCandidateInfo(ComponentName cn) {
+            return new CandidateInfo(true) {
+                @Override
+                public CharSequence loadLabel() { return cn.flattenToString(); }
+
+                @Override
+                public Drawable loadIcon() { return null; }
+
+                @Override
+                public String getKey() { return null; }
+            };
+        }
+    }
+
+}
diff --git a/tests/robotests/src/com/android/settings/password/ChooseLockGenericControllerTest.java b/tests/robotests/src/com/android/settings/password/ChooseLockGenericControllerTest.java
index 2b7bdeb..4adc01b 100644
--- a/tests/robotests/src/com/android/settings/password/ChooseLockGenericControllerTest.java
+++ b/tests/robotests/src/com/android/settings/password/ChooseLockGenericControllerTest.java
@@ -34,6 +34,7 @@
 import android.app.admin.DevicePolicyManager.PasswordComplexity;
 import android.content.ComponentName;
 
+import com.android.internal.widget.LockPatternUtils;
 import com.android.settings.R;
 import com.android.settings.testutils.shadow.SettingsShadowResources;
 
@@ -61,10 +62,14 @@
     @Mock
     private DevicePolicyManager mDevicePolicyManager;
 
+    @Mock
+    private LockPatternUtils mLockPatternUtils;
+
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
 
+        when(mLockPatternUtils.hasSecureLockScreen()).thenReturn(true);
         mController = createController(PASSWORD_COMPLEXITY_NONE);
         SettingsShadowResources.overrideResource(R.bool.config_hide_none_security_option, false);
         SettingsShadowResources.overrideResource(R.bool.config_hide_swipe_security_option, false);
@@ -266,6 +271,7 @@
                 0 /* userId */,
                 minPasswordComplexity,
                 mDevicePolicyManager,
-                mManagedLockPasswordProvider);
+                mManagedLockPasswordProvider,
+                mLockPatternUtils);
     }
 }
diff --git a/tests/robotests/src/com/android/settings/password/ChooseLockTypeDialogFragmentTest.java b/tests/robotests/src/com/android/settings/password/ChooseLockTypeDialogFragmentTest.java
index 195c82d..9e8644f 100644
--- a/tests/robotests/src/com/android/settings/password/ChooseLockTypeDialogFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/password/ChooseLockTypeDialogFragmentTest.java
@@ -33,6 +33,7 @@
 import com.android.settings.R;
 import com.android.settings.password.ChooseLockTypeDialogFragment.OnLockTypeSelectedListener;
 import com.android.settings.testutils.shadow.ShadowAlertDialogCompat;
+import com.android.settings.testutils.shadow.ShadowLockPatternUtils;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -43,7 +44,7 @@
 import org.robolectric.shadows.androidx.fragment.FragmentController;
 
 @RunWith(RobolectricTestRunner.class)
-@Config(shadows = ShadowAlertDialogCompat.class)
+@Config(shadows = {ShadowAlertDialogCompat.class, ShadowLockPatternUtils.class})
 public class ChooseLockTypeDialogFragmentTest {
 
     private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/password/SetupChooseLockPasswordTest.java b/tests/robotests/src/com/android/settings/password/SetupChooseLockPasswordTest.java
index e0c6ded..aeb16e6 100644
--- a/tests/robotests/src/com/android/settings/password/SetupChooseLockPasswordTest.java
+++ b/tests/robotests/src/com/android/settings/password/SetupChooseLockPasswordTest.java
@@ -34,6 +34,7 @@
 import com.android.settings.password.SetupChooseLockPassword.SetupChooseLockPasswordFragment;
 import com.android.settings.testutils.shadow.SettingsShadowResources;
 import com.android.settings.testutils.shadow.ShadowAlertDialogCompat;
+import com.android.settings.testutils.shadow.ShadowLockPatternUtils;
 import com.android.settings.testutils.shadow.ShadowUtils;
 import com.android.settings.widget.ScrollToParentEditText;
 
@@ -57,7 +58,13 @@
 import java.util.List;
 
 @RunWith(RobolectricTestRunner.class)
-@Config(shadows = {SettingsShadowResources.class, ShadowUtils.class, ShadowAlertDialogCompat.class})
+@Config(
+        shadows = {
+                SettingsShadowResources.class,
+                ShadowLockPatternUtils.class,
+                ShadowUtils.class,
+                ShadowAlertDialogCompat.class
+        })
 public class SetupChooseLockPasswordTest {
 
     @Before
diff --git a/tests/robotests/src/com/android/settings/password/SetupChooseLockPatternTest.java b/tests/robotests/src/com/android/settings/password/SetupChooseLockPatternTest.java
index 430c535..4852546 100644
--- a/tests/robotests/src/com/android/settings/password/SetupChooseLockPatternTest.java
+++ b/tests/robotests/src/com/android/settings/password/SetupChooseLockPatternTest.java
@@ -38,6 +38,7 @@
 import com.android.settings.password.ChooseLockPattern.ChooseLockPatternFragment;
 import com.android.settings.password.ChooseLockPattern.IntentBuilder;
 import com.android.settings.testutils.shadow.ShadowAlertDialogCompat;
+import com.android.settings.testutils.shadow.ShadowLockPatternUtils;
 import com.android.settings.testutils.shadow.ShadowUtils;
 
 import com.google.android.setupcompat.PartnerCustomizationLayout;
@@ -57,7 +58,7 @@
 import java.util.Arrays;
 
 @RunWith(RobolectricTestRunner.class)
-@Config(shadows = {ShadowUtils.class, ShadowAlertDialogCompat.class})
+@Config(shadows = {ShadowUtils.class, ShadowAlertDialogCompat.class, ShadowLockPatternUtils.class})
 public class SetupChooseLockPatternTest {
 
     private SetupChooseLockPattern mActivity;
diff --git a/tests/robotests/src/com/android/settings/slices/SettingsSliceProviderTest.java b/tests/robotests/src/com/android/settings/slices/SettingsSliceProviderTest.java
index 726e4bd..a693f34 100644
--- a/tests/robotests/src/com/android/settings/slices/SettingsSliceProviderTest.java
+++ b/tests/robotests/src/com/android/settings/slices/SettingsSliceProviderTest.java
@@ -64,6 +64,7 @@
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
+import org.robolectric.Robolectric;
 import org.robolectric.RobolectricTestRunner;
 import org.robolectric.RuntimeEnvironment;
 import org.robolectric.annotation.Config;
@@ -184,6 +185,20 @@
     }
 
     @Test
+    public void loadSlice_registersBackgroundListener() {
+        insertSpecialCase(KEY);
+        final Uri uri = SliceBuilderUtils.getUri(INTENT_PATH, false);
+
+        mProvider.loadSlice(uri);
+
+        Robolectric.flushForegroundThreadScheduler();
+        Robolectric.flushBackgroundThreadScheduler();
+
+        assertThat(mProvider.mPinnedWorkers.get(uri).getClass())
+                .isEqualTo(FakeToggleController.TestWorker.class);
+    }
+
+    @Test
     public void testLoadSlice_doesNotCacheWithoutPin() {
         insertSpecialCase(KEY);
         final Uri uri = SliceBuilderUtils.getUri(INTENT_PATH, false);
diff --git a/tests/robotests/src/com/android/settings/testutils/FakeCopyableController.java b/tests/robotests/src/com/android/settings/testutils/FakeCopyableController.java
index 31e955c..e51a249 100644
--- a/tests/robotests/src/com/android/settings/testutils/FakeCopyableController.java
+++ b/tests/robotests/src/com/android/settings/testutils/FakeCopyableController.java
@@ -19,9 +19,8 @@
 import android.content.Context;
 
 import com.android.settings.core.BasePreferenceController;
-import com.android.settings.slices.Copyable;
 
-public class FakeCopyableController extends BasePreferenceController implements Copyable {
+public class FakeCopyableController extends BasePreferenceController {
 
     public FakeCopyableController(Context context, String preferenceKey) {
         super(context, preferenceKey);
@@ -38,6 +37,7 @@
     }
 
     @Override
-    public void copy() {
+    public boolean isCopyableSlice() {
+        return true;
     }
 }
diff --git a/tests/robotests/src/com/android/settings/testutils/FakeToggleController.java b/tests/robotests/src/com/android/settings/testutils/FakeToggleController.java
index d1677cd..e785487 100644
--- a/tests/robotests/src/com/android/settings/testutils/FakeToggleController.java
+++ b/tests/robotests/src/com/android/settings/testutils/FakeToggleController.java
@@ -19,10 +19,14 @@
 
 import android.content.Context;
 import android.content.IntentFilter;
+import android.net.Uri;
 import android.net.wifi.WifiManager;
 import android.provider.Settings;
 
 import com.android.settings.core.TogglePreferenceController;
+import com.android.settings.slices.SliceBackgroundWorker;
+
+import java.io.IOException;
 
 public class FakeToggleController extends TogglePreferenceController {
 
@@ -71,6 +75,11 @@
     }
 
     @Override
+    public Class<? extends SliceBackgroundWorker> getBackgroundWorkerClass() {
+        return TestWorker.class;
+    }
+
+    @Override
     public boolean hasAsyncUpdate() {
         return mIsAsyncUpdate;
     }
@@ -78,4 +87,23 @@
     public void setAsyncUpdate(boolean isAsyncUpdate) {
         mIsAsyncUpdate = isAsyncUpdate;
     }
+
+    public static class TestWorker extends SliceBackgroundWorker<Void> {
+
+        public TestWorker(Context context, Uri uri) {
+            super(context, uri);
+        }
+
+        @Override
+        protected void onSlicePinned() {
+        }
+
+        @Override
+        protected void onSliceUnpinned() {
+        }
+
+        @Override
+        public void close() throws IOException {
+        }
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/testutils/SliceTester.java b/tests/robotests/src/com/android/settings/testutils/SliceTester.java
index 17edb6e..d84d42c 100644
--- a/tests/robotests/src/com/android/settings/testutils/SliceTester.java
+++ b/tests/robotests/src/com/android/settings/testutils/SliceTester.java
@@ -238,22 +238,38 @@
      * @param title Title for asserting.
      */
     public static void assertAnySliceItemContainsTitle(List<SliceItem> sliceItems, String title) {
-        boolean hasTitle = false;
+        assertThat(hasText(sliceItems, title, HINT_TITLE)).isTrue();
+    }
+
+    /**
+     * Assert any slice item contains subtitle.
+     *
+     * @param sliceItems All slice items of a Slice.
+     * @param subtitle Subtitle for asserting.
+     */
+    public static void assertAnySliceItemContainsSubtitle(List<SliceItem> sliceItems,
+            String subtitle) {
+        // Subtitle has no hints
+        assertThat(hasText(sliceItems, subtitle, null /* hints */)).isTrue();
+    }
+
+    private static boolean hasText(List<SliceItem> sliceItems, String text, String hints) {
+        boolean hasText = false;
         for (SliceItem item : sliceItems) {
-            List<SliceItem> titleItems = SliceQuery.findAll(item, FORMAT_TEXT, HINT_TITLE,
+            List<SliceItem> textItems = SliceQuery.findAll(item, FORMAT_TEXT, hints,
                     null /* non-hints */);
-            if (titleItems == null) {
+            if (textItems == null) {
                 continue;
             }
 
-            for (SliceItem subTitleItem : titleItems) {
-                if (TextUtils.equals(subTitleItem.getText(), title)) {
-                    hasTitle = true;
+            for (SliceItem textItem : textItems) {
+                if (TextUtils.equals(textItem.getText(), text)) {
+                    hasText = true;
                     break;
                 }
             }
         }
-        assertThat(hasTitle).isTrue();
+        return hasText;
     }
 
     private static void assertKeywords(SliceMetadata metadata, SliceData data) {
diff --git a/tests/robotests/src/com/android/settings/testutils/shadow/ShadowLockPatternUtils.java b/tests/robotests/src/com/android/settings/testutils/shadow/ShadowLockPatternUtils.java
index 7ce098d..f287085 100644
--- a/tests/robotests/src/com/android/settings/testutils/shadow/ShadowLockPatternUtils.java
+++ b/tests/robotests/src/com/android/settings/testutils/shadow/ShadowLockPatternUtils.java
@@ -32,6 +32,11 @@
     private static boolean sDeviceEncryptionEnabled;
 
     @Implementation
+    protected boolean hasSecureLockScreen() {
+        return true;
+    }
+
+    @Implementation
     protected boolean isSecure(int id) {
         return true;
     }
diff --git a/tests/robotests/src/com/android/settings/wifi/slice/WifiSliceTest.java b/tests/robotests/src/com/android/settings/wifi/slice/WifiSliceTest.java
index dd99e55..6af8f80 100644
--- a/tests/robotests/src/com/android/settings/wifi/slice/WifiSliceTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/slice/WifiSliceTest.java
@@ -118,7 +118,7 @@
         // All AP rows + title row
         assertThat(rows).isEqualTo(DEFAULT_EXPANDED_ROW_COUNT + 1);
         // Has scanning text
-        SliceTester.assertAnySliceItemContainsTitle(sliceItems,
+        SliceTester.assertAnySliceItemContainsSubtitle(sliceItems,
                 mContext.getString(R.string.wifi_empty_list_wifi_on));
     }
 
diff --git a/tests/unit/src/com/android/settings/DisplaySettingsTest.java b/tests/unit/src/com/android/settings/DisplaySettingsTest.java
deleted file mode 100644
index cc9cd81..0000000
--- a/tests/unit/src/com/android/settings/DisplaySettingsTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2017 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;
-
-import static androidx.test.espresso.Espresso.onView;
-import static androidx.test.espresso.action.ViewActions.click;
-import static androidx.test.espresso.matcher.ViewMatchers.withText;
-
-import android.app.Instrumentation;
-import android.content.Context;
-import android.content.Intent;
-import android.support.test.uiautomator.UiDevice;
-
-import androidx.test.InstrumentationRegistry;
-import androidx.test.filters.SmallTest;
-import androidx.test.runner.AndroidJUnit4;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(AndroidJUnit4.class)
-@SmallTest
-public class DisplaySettingsTest {
-
-    private Instrumentation mInstrumentation;
-    private Context mContext;
-    private UiDevice mDevice;
-
-    @Before
-    public void setUp() {
-        mInstrumentation = InstrumentationRegistry.getInstrumentation();
-        mContext = mInstrumentation.getTargetContext();
-        mDevice = UiDevice.getInstance(mInstrumentation);
-    }
-
-    @Test
-    public void launchBrightnessLevel_shouldNotCrash() {
-        mInstrumentation.startActivitySync(
-                new Intent(mContext, DisplaySettings.class));
-        onView(withText(mContext.getString(R.string.brightness))).perform(click());
-        // should not crash
-        mDevice.pressBack(); // dismiss the brightness dialog
-    }
-}
diff --git a/tests/unit/src/com/android/settings/EncryptionInterstitialTest.java b/tests/unit/src/com/android/settings/EncryptionInterstitialTest.java
deleted file mode 100644
index 503a78c..0000000
--- a/tests/unit/src/com/android/settings/EncryptionInterstitialTest.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (C) 2017 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;
-
-import static androidx.test.espresso.Espresso.onView;
-import static androidx.test.espresso.action.ViewActions.click;
-import static androidx.test.espresso.matcher.ViewMatchers.withId;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import android.app.Activity;
-import android.app.Instrumentation;
-import android.app.Instrumentation.ActivityMonitor;
-import android.app.Instrumentation.ActivityResult;
-import android.content.Context;
-import android.content.Intent;
-
-import androidx.test.InstrumentationRegistry;
-import androidx.test.filters.MediumTest;
-import androidx.test.runner.AndroidJUnit4;
-
-import com.google.android.setupcompat.PartnerCustomizationLayout;
-import com.google.android.setupcompat.template.FooterBarMixin;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(AndroidJUnit4.class)
-@MediumTest
-public class EncryptionInterstitialTest {
-
-    private Instrumentation mInstrumentation;
-    private Context mContext;
-    private TestActivityMonitor mActivityMonitor;
-
-    @Before
-    public void setUp() {
-        mInstrumentation = InstrumentationRegistry.getInstrumentation();
-        mContext = mInstrumentation.getTargetContext();
-        mActivityMonitor = new TestActivityMonitor();
-        mInstrumentation.addMonitor(mActivityMonitor);
-    }
-
-    @After
-    public void tearDown() {
-        mInstrumentation.removeMonitor(mActivityMonitor);
-    }
-
-    @Test
-    public void clickYes_shouldRequirePassword() {
-        final Activity activity = mInstrumentation.startActivitySync(
-                new Intent(mContext, EncryptionInterstitial.class)
-                        .putExtra("extra_unlock_method_intent", new Intent("test.unlock.intent")));
-        final PartnerCustomizationLayout layout = activity.findViewById(R.id.setup_wizard_layout);
-        layout.getMixin(FooterBarMixin.class).getPrimaryButtonView().performClick();
-
-        mActivityMonitor.waitForActivityWithTimeout(1000);
-        assertEquals(1, mActivityMonitor.getHits());
-
-        assertTrue(mActivityMonitor.mMatchedIntent.getBooleanExtra(
-                EncryptionInterstitial.EXTRA_REQUIRE_PASSWORD, false));
-    }
-
-    @Test
-    public void clickNo_shouldNotRequirePassword() {
-        final Activity activity = mInstrumentation.startActivitySync(
-                new Intent(mContext, EncryptionInterstitial.class)
-                        .putExtra("extra_unlock_method_intent", new Intent("test.unlock.intent")));
-        final PartnerCustomizationLayout layout = activity.findViewById(R.id.setup_wizard_layout);
-        layout.getMixin(FooterBarMixin.class).getSecondaryButtonView().performClick();
-
-        mActivityMonitor.waitForActivityWithTimeout(1000);
-        assertEquals(1, mActivityMonitor.getHits());
-
-        assertFalse(mActivityMonitor.mMatchedIntent.getBooleanExtra(
-                EncryptionInterstitial.EXTRA_REQUIRE_PASSWORD, true));
-    }
-
-    private static class TestActivityMonitor extends ActivityMonitor {
-
-        Intent mMatchedIntent = null;
-
-        @Override
-        public ActivityResult onStartActivity(Intent intent) {
-            if ("test.unlock.intent".equals(intent.getAction())) {
-                mMatchedIntent = intent;
-                return new ActivityResult(Activity.RESULT_OK, null);
-            }
-            return null;
-        }
-    }
-}
diff --git a/tests/unit/src/com/android/settings/ManagedAccessSettingsLowRamTest.java b/tests/unit/src/com/android/settings/ManagedAccessSettingsLowRamTest.java
deleted file mode 100644
index 426b8a4..0000000
--- a/tests/unit/src/com/android/settings/ManagedAccessSettingsLowRamTest.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (C) 2017 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;
-
-import static androidx.test.espresso.Espresso.onView;
-import static androidx.test.espresso.action.ViewActions.click;
-import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist;
-import static androidx.test.espresso.assertion.ViewAssertions.matches;
-import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
-import static androidx.test.espresso.matcher.ViewMatchers.withText;
-
-import android.app.ActivityManager;
-import android.app.Instrumentation;
-import android.content.Context;
-import android.content.Intent;
-import android.provider.Settings;
-
-import androidx.test.InstrumentationRegistry;
-import androidx.test.filters.SmallTest;
-import androidx.test.runner.AndroidJUnit4;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(AndroidJUnit4.class)
-@SmallTest
-public class ManagedAccessSettingsLowRamTest {
-
-    private Instrumentation mInstrumentation;
-    private Context mTargetContext;
-
-    @Before
-    public void setUp() {
-        mInstrumentation = InstrumentationRegistry.getInstrumentation();
-        mTargetContext = mInstrumentation.getTargetContext();
-    }
-
-    @Test
-    public void testManagedAccessOptionsVisibility() throws Exception {
-        mInstrumentation.startActivitySync(new Intent(mTargetContext,
-                com.android.settings.Settings.AppAndNotificationDashboardActivity.class));
-        onView(withText(mTargetContext.getString(R.string.expand_button_title))).perform(click());
-        onView(withText(mTargetContext.getString(R.string.special_access))).perform(click());
-
-        String[] managedServiceLabels = new String[] {"Do Not Disturb access",
-                "VR helper services", "Notification access", "Picture-in-picture"};
-        for (String label : managedServiceLabels) {
-            if (ActivityManager.isLowRamDeviceStatic()) {
-                onView(withText(label)).check(doesNotExist());
-            } else {
-                onView(withText(label)).check(matches(isDisplayed()));
-            }
-        }
-    }
-
-    @Test
-    public void launchNotificationSetting_onlyWorksIfNotLowRam() {
-        final Intent intent = new Intent(Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS);
-
-        mInstrumentation.startActivitySync(intent);
-
-        final String label = "This feature is not available on this device";
-        if (ActivityManager.isLowRamDeviceStatic()) {
-            onView(withText(label)).check(matches(isDisplayed()));
-        } else {
-            onView(withText(label)).check(doesNotExist());
-        }
-    }
-
-    @Test
-    public void launchDndSetting_onlyWorksIfNotLowRam() {
-        final Intent intent = new Intent(Settings.ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS);
-
-        mInstrumentation.startActivitySync(intent);
-
-        final String label = "This feature is not available on this device";
-        if (ActivityManager.isLowRamDeviceStatic()) {
-            onView(withText(label)).check(matches(isDisplayed()));
-        } else {
-            onView(withText(label)).check(doesNotExist());
-        }
-    }
-
-    @Test
-    public void launchVrSetting_onlyWorksIfNotLowRam() {
-        final Intent intent = new Intent(Settings.ACTION_VR_LISTENER_SETTINGS);
-
-        mInstrumentation.startActivitySync(intent);
-
-        final String label = "This feature is not available on this device";
-        if (ActivityManager.isLowRamDeviceStatic()) {
-            onView(withText(label)).check(matches(isDisplayed()));
-        } else {
-            onView(withText(label)).check(doesNotExist());
-        }
-    }
-
-    @Test
-    public void launchPictureInPictureSetting_onlyWorksIfNotLowRam() {
-        final Intent intent = new Intent(Settings.ACTION_PICTURE_IN_PICTURE_SETTINGS);
-
-        mInstrumentation.startActivitySync(intent);
-
-        final String label = "This feature is not available on this device";
-        if (ActivityManager.isLowRamDeviceStatic()) {
-            onView(withText(label)).check(matches(isDisplayed()));
-        } else {
-            onView(withText(label)).check(doesNotExist());
-        }
-    }
-}
diff --git a/tests/unit/src/com/android/settings/RegulatoryInfoDisplayActivityTest.java b/tests/unit/src/com/android/settings/RegulatoryInfoDisplayActivityTest.java
index 48f9f5d..1701ddf 100644
--- a/tests/unit/src/com/android/settings/RegulatoryInfoDisplayActivityTest.java
+++ b/tests/unit/src/com/android/settings/RegulatoryInfoDisplayActivityTest.java
@@ -16,12 +16,6 @@
 
 package com.android.settings;
 
-import static androidx.test.espresso.Espresso.onView;
-import static androidx.test.espresso.assertion.ViewAssertions.matches;
-import static androidx.test.espresso.matcher.RootMatchers.isDialog;
-import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
-import static androidx.test.espresso.matcher.ViewMatchers.withId;
-
 import static junit.framework.Assert.fail;
 
 import android.app.Instrumentation;
@@ -29,8 +23,6 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.pm.ResolveInfo;
-import android.graphics.Bitmap;
-import android.util.Log;
 
 import androidx.test.InstrumentationRegistry;
 import androidx.test.filters.SmallTest;
@@ -40,10 +32,6 @@
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
 @RunWith(AndroidJUnit4.class)
 @SmallTest
 public class RegulatoryInfoDisplayActivityTest {
@@ -82,73 +70,4 @@
             return;
         }
     }
-
-    @Test
-    public void launchRegulatoryInfo_shouldNotCrash() {
-        final Context context = mInstrumentation.getTargetContext();
-        final boolean hasRegulatoryInfo = context.getResources()
-                .getBoolean(R.bool.config_show_regulatory_info);
-
-        if (!hasRegulatoryInfo) {
-            return;
-        }
-        // Launch intent
-        mInstrumentation.startActivitySync(mRegulatoryInfoIntent);
-
-        onView(withId(R.id.regulatoryInfo))
-                .inRoot(isDialog())
-                .check(matches(isDisplayed()));
-    }
-
-    @Test
-    public void launchRegulatoryInfo_withInfoImage_shouldDisplay() throws IOException {
-        // TODO: Remove "setenforce 0" when selinux rules is updated to give read permission for
-        // regulatory info.
-        mUiAutomation.executeShellCommand("setenforce 0");
-
-        final boolean tempFileCreated = ensureRegulatoryInfoImageExists();
-        try {
-            final Context context = mInstrumentation.getTargetContext();
-            final boolean hasRegulatoryInfo = context.getResources()
-                    .getBoolean(R.bool.config_show_regulatory_info);
-
-            if (!hasRegulatoryInfo) {
-                return;
-            }
-            // Launch intent
-            mInstrumentation.startActivitySync(mRegulatoryInfoIntent);
-
-            onView(withId(R.id.regulatoryInfo))
-                    .inRoot(isDialog())
-                    .check(matches(isDisplayed()));
-        } finally {
-            if (tempFileCreated) {
-                final String filename =
-                        RegulatoryInfoDisplayActivity.getRegulatoryInfoImageFileName();
-                new File(filename).delete();
-                Log.d(TAG, "Deleting temp file " + filename);
-            }
-        }
-    }
-
-    /**
-     * Ensures regulatory label image exists on disk.
-     *
-     * @return true if a test image is created.
-     */
-    private boolean ensureRegulatoryInfoImageExists() throws IOException {
-        final String filename = RegulatoryInfoDisplayActivity.getRegulatoryInfoImageFileName();
-        if (new File(filename).exists()) {
-            return false;
-        }
-        Log.d(TAG, "Creating temp file " + filename);
-        final Bitmap bitmap = Bitmap.createBitmap(400 /* width */, 400 /* height */,
-                Bitmap.Config.ARGB_8888);
-        final FileOutputStream out = new FileOutputStream(filename);
-        bitmap.compress(Bitmap.CompressFormat.PNG, 100 /* quality */, out);
-        out.close();
-        return true;
-    }
-
-
 }
diff --git a/tests/unit/src/com/android/settings/SettingsHookTests.java b/tests/unit/src/com/android/settings/SettingsHookTests.java
deleted file mode 100644
index ee0bbb6..0000000
--- a/tests/unit/src/com/android/settings/SettingsHookTests.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (C) 2010 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;
-
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.test.ActivityInstrumentationTestCase2;
-
-import java.util.List;
-
-/**
- * Tests for the Settings operator/manufacturer hook.
- *
- * Running all tests:
- *
- *   make SettingsTests
- *   adb push SettingsTests.apk /system/app/SettingsTests.apk
- *   adb shell am instrument \
- *    -w com.android.settings.tests/android.test.InstrumentationTestRunner
- */
-public class SettingsHookTests extends ActivityInstrumentationTestCase2<Settings> {
-
-    private static final String PACKAGE_NAME = "com.android.settings.tests.unit";
-
-    private static final String KEY_SETTINGS_ROOT = "parent";
-    private static final String KEY_SETTINGS_OPERATOR = "operator_settings";
-    private static final String KEY_SETTINGS_MANUFACTURER = "manufacturer_settings";
-
-    private static final String INTENT_OPERATOR_HOOK = "com.android.settings.OPERATOR_APPLICATION_SETTING";
-    private static final String INTENT_MANUFACTURER_HOOK = "com.android.settings.MANUFACTURER_APPLICATION_SETTING";
-
-    private Settings mSettings;
-
-    public SettingsHookTests() {
-        super("com.android.settings", Settings.class);
-    }
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        mSettings = getActivity();
-    }
-
-    /**
-     * Test that the operator/manufacturer settings hook test application is
-     * available and that it's installed in the device's system image.
-     */
-    public void testSettingsHookTestAppAvailable() throws Exception {
-        Context context = mSettings.getApplicationContext();
-        PackageManager pm = context.getPackageManager();
-        ApplicationInfo applicationInfo = pm.getApplicationInfo(PACKAGE_NAME, 0);
-        assertTrue((applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0);
-    }
-
-    /**
-     * Test that the operator test activity has registered an intent-filter for
-     * an action named 'android.settings.OPERATOR_APPLICATION_SETTING'.
-     */
-    public void testOperatorIntentFilter() {
-        boolean result = false;
-        Context context = mSettings.getApplicationContext();
-        PackageManager pm = context.getPackageManager();
-        Intent intent = new Intent(INTENT_OPERATOR_HOOK);
-        List<ResolveInfo> list = pm.queryIntentActivities(intent, 0);
-        for (ResolveInfo resolveInfo : list) {
-            if (resolveInfo.activityInfo.packageName.equals(PACKAGE_NAME)) {
-                result = true;
-            }
-        }
-        assertTrue("Intent-filter not found", result);
-    }
-
-    /**
-     * Test that the manufacturer test activity has registered an intent-filter
-     * for an action named 'android.settings.MANUFACTURER_APPLICATION_SETTING'.
-     */
-    public void testManufacturerIntentFilter() {
-        boolean result = false;
-        Context context = mSettings.getApplicationContext();
-        PackageManager pm = context.getPackageManager();
-        Intent intent = new Intent(INTENT_MANUFACTURER_HOOK);
-        List<ResolveInfo> list = pm.queryIntentActivities(intent, 0);
-        for (ResolveInfo resolveInfo : list) {
-            if (resolveInfo.activityInfo.packageName.equals(PACKAGE_NAME)) {
-                result = true;
-            }
-        }
-        assertTrue("Intent-filter not found", result);
-    }
-
-    /**
-     * Test that the operator preference is available in the Settings
-     * application.
-     */
-    public void testOperatorPreferenceAvailable() {
-// TODO: fix this test case to work with fragments
-//        PreferenceGroup root = (PreferenceGroup)mSettings.findPreference(KEY_SETTINGS_ROOT);
-//        Preference operatorPreference = root.findPreference(KEY_SETTINGS_OPERATOR);
-//        assertNotNull(operatorPreference);
-    }
-
-    /**
-     * Test that the manufacturer preference is available in the Settings
-     * application.
-     */
-    public void testManufacturerPreferenceAvailable() {
-// TODO: fix this test case to work with fragments
-//        PreferenceGroup root = (PreferenceGroup)mSettings.findPreference(KEY_SETTINGS_ROOT);
-//        Preference manufacturerHook = root.findPreference(KEY_SETTINGS_MANUFACTURER);
-//        assertNotNull(manufacturerHook);
-    }
-
-}
diff --git a/tests/unit/src/com/android/settings/accessibility/AccessibilityShortcutPreferenceFragmentTest.java b/tests/unit/src/com/android/settings/accessibility/AccessibilityShortcutPreferenceFragmentTest.java
index f8d06a8..0c27379 100644
--- a/tests/unit/src/com/android/settings/accessibility/AccessibilityShortcutPreferenceFragmentTest.java
+++ b/tests/unit/src/com/android/settings/accessibility/AccessibilityShortcutPreferenceFragmentTest.java
@@ -30,6 +30,7 @@
 
 import android.app.Instrumentation;
 import android.os.Bundle;
+
 import android.provider.Settings;
 import android.widget.CompoundButton;
 
@@ -64,14 +65,6 @@
     }
 
     @Test
-    public void lockScreenPreference_defaultBeforeDialogShown_isOff() {
-        setDialogShown(false);
-        setOnLockscreen(null);
-        startFragment();
-        assertLockscreenSwitchIsCheckedIs(false);
-    }
-
-    @Test
     public void lockScreenPreference_setOnBeforeDialogShown_isOn() {
         setDialogShown(false);
         setOnLockscreen(true);
@@ -87,14 +80,6 @@
         assertLockscreenSwitchIsCheckedIs(true);
     }
 
-    @Test
-    public void lockScreenPreference_setOffAfterDialogShown_isOn() {
-        setDialogShown(true);
-        setOnLockscreen(false);
-        startFragment();
-        assertLockscreenSwitchIsCheckedIs(false);
-    }
-
     private void startFragment() {
         mInstrumentation.runOnMainSync(() -> {
             new SubSettingLauncher(mActivity)
diff --git a/tests/unit/src/com/android/settings/applications/DefaultAppSettingsTest.java b/tests/unit/src/com/android/settings/applications/DefaultAppSettingsTest.java
deleted file mode 100644
index 1dd899e..0000000
--- a/tests/unit/src/com/android/settings/applications/DefaultAppSettingsTest.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2017 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.applications;
-
-import android.content.Context;
-import android.content.Intent;
-import android.support.test.uiautomator.UiDevice;
-import android.support.test.uiautomator.UiObject;
-import android.support.test.uiautomator.UiSelector;
-import android.test.InstrumentationTestCase;
-import android.widget.TextView;
-
-import androidx.test.filters.SmallTest;
-
-import com.android.settings.R;
-
-import org.junit.Test;
-
-/**
- * Test for Advanced App preferences.
- */
-@SmallTest
-public class DefaultAppSettingsTest extends InstrumentationTestCase {
-
-    private UiDevice mDevice;
-    private Context mTargetContext;
-    private String mTargetPackage;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        mDevice = UiDevice.getInstance(getInstrumentation());
-        mTargetContext = getInstrumentation().getTargetContext();
-        mTargetPackage = mTargetContext.getPackageName();
-    }
-
-    @Test
-    public void testSelectDefaultHome_shouldLaunchHomePicker() throws Exception {
-        launchDefaultApps();
-        final String titleHomeApp = mTargetContext.getResources().getString(R.string.home_app);
-        mDevice.findObject(new UiSelector().text(titleHomeApp)).click();
-        final UiObject actionBar = mDevice.findObject(new UiSelector().resourceId(
-            "com.android.settings:id/action_bar"));
-        final UiObject title = actionBar.getChild(
-            new UiSelector().className(TextView.class.getName()));
-        assertEquals(titleHomeApp, title.getText());
-    }
-
-    private void launchDefaultApps() throws Exception  {
-        final Intent settingsIntent = new Intent(Intent.ACTION_MAIN)
-            .addCategory(Intent.CATEGORY_LAUNCHER)
-            .setPackage(mTargetPackage)
-            .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-        getInstrumentation().getContext().startActivity(settingsIntent);
-        final String titleApps = mTargetContext.getResources().getString(
-            R.string.app_and_notification_dashboard_title);
-        mDevice.findObject(new UiSelector().text(titleApps)).click();
-        final String titleAdvance = mTargetContext.getResources().getString(
-                R.string.advanced_section_header);
-        mDevice.findObject(new UiSelector().text(titleAdvance)).click();
-        final String titleDefaultApps = mTargetContext.getResources().getString(
-            R.string.app_default_dashboard_title);
-        mDevice.findObject(new UiSelector().text(titleDefaultApps)).click();
-    }
-
-}
diff --git a/tests/unit/src/com/android/settings/applications/ManageApplicationsLaunchTest.java b/tests/unit/src/com/android/settings/applications/ManageApplicationsLaunchTest.java
deleted file mode 100644
index c98a43d..0000000
--- a/tests/unit/src/com/android/settings/applications/ManageApplicationsLaunchTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2017 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.applications;
-
-import static androidx.test.espresso.Espresso.onView;
-import static androidx.test.espresso.assertion.ViewAssertions.matches;
-import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
-import static androidx.test.espresso.matcher.ViewMatchers.withText;
-
-import static org.hamcrest.Matchers.allOf;
-
-import android.app.Instrumentation;
-import android.content.Intent;
-import android.provider.Settings;
-
-import androidx.test.InstrumentationRegistry;
-import androidx.test.filters.SmallTest;
-import androidx.test.runner.AndroidJUnit4;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@SmallTest
-@RunWith(AndroidJUnit4.class)
-public class ManageApplicationsLaunchTest {
-
-    private Instrumentation mInstrumentation;
-
-    @Before
-    public void setUp() {
-        mInstrumentation = InstrumentationRegistry.getInstrumentation();
-    }
-
-    @Test
-    public void launchAppsSettings_shouldShowAppList() throws Exception {
-        final Intent appsSettingsIntent = new
-                Intent(Settings.ACTION_MANAGE_APPLICATIONS_SETTINGS);
-
-        mInstrumentation.startActivitySync(appsSettingsIntent);
-
-        onView(allOf(withText("Calculator"))).check(matches(isDisplayed()));
-    }
-}
diff --git a/tests/unit/src/com/android/settings/applications/SpecialAppAccessSettingsTest.java b/tests/unit/src/com/android/settings/applications/SpecialAppAccessSettingsTest.java
deleted file mode 100644
index 4738d59..0000000
--- a/tests/unit/src/com/android/settings/applications/SpecialAppAccessSettingsTest.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2017 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.applications;
-
-import android.content.Context;
-import android.content.Intent;
-import android.support.test.uiautomator.UiDevice;
-import android.support.test.uiautomator.UiObject;
-import android.support.test.uiautomator.UiObjectNotFoundException;
-import android.support.test.uiautomator.UiScrollable;
-import android.support.test.uiautomator.UiSelector;
-import android.test.InstrumentationTestCase;
-import android.widget.TextView;
-
-import androidx.test.filters.SmallTest;
-
-import com.android.settings.R;
-
-import org.junit.Test;
-
-/**
- * Test for Special App Access preferences.
- */
-@SmallTest
-public class SpecialAppAccessSettingsTest extends InstrumentationTestCase {
-
-    private UiDevice mDevice;
-    private Context mTargetContext;
-    private String mTargetPackage;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        mDevice = UiDevice.getInstance(getInstrumentation());
-        mTargetContext = getInstrumentation().getTargetContext();
-        mTargetPackage = mTargetContext.getPackageName();
-    }
-
-    @Test
-    public void testSelectPictureInPicture_shouldNotCrash() throws Exception {
-        launchSpecialApps();
-        final String titlePictureInPictureApp =
-                mTargetContext.getResources().getString(R.string.picture_in_picture_title);
-
-        // select Picture-in-Picture
-        mDevice.findObject(new UiSelector().text(titlePictureInPictureApp)).click();
-
-        // Picture-in-picture settings page should launch and no crash
-        final UiObject actionBar = mDevice.findObject(new UiSelector().resourceId(
-            "com.android.settings:id/action_bar"));
-        final UiObject title = actionBar.getChild(
-            new UiSelector().className(TextView.class.getName()));
-        assertEquals(titlePictureInPictureApp, title.getText());
-    }
-
-    private void launchSpecialApps() throws Exception  {
-        final Intent settingsIntent = new Intent(Intent.ACTION_MAIN)
-            .addCategory(Intent.CATEGORY_LAUNCHER)
-            .setPackage(mTargetPackage)
-            .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-        getInstrumentation().getContext().startActivity(settingsIntent);
-        final String titleApps = mTargetContext.getResources().getString(
-            R.string.app_and_notification_dashboard_title);
-        mDevice.findObject(new UiSelector().text(titleApps)).click();
-        final String titleAdvance = mTargetContext.getResources().getString(
-                R.string.advanced_section_header);
-        mDevice.findObject(new UiSelector().text(titleAdvance)).click();
-        final String titleSpecialApps = mTargetContext.getResources().getString(
-            R.string.special_access);
-
-        try {
-            // scollbar may or may not be present, depending on how many recents app are there. If
-            // the page is scrollable, scroll to the bottom to show the special app access settings.
-            final UiScrollable settings = new UiScrollable(
-                    new UiSelector().packageName(mTargetContext.getPackageName()).scrollable(true));
-            settings.scrollTextIntoView(titleSpecialApps);
-        } catch (UiObjectNotFoundException e) {
-            // ignore
-        }
-
-        mDevice.findObject(new UiSelector().text(titleSpecialApps)).click();
-    }
-
-}
diff --git a/tests/unit/src/com/android/settings/backup/BackupIntentTest.java b/tests/unit/src/com/android/settings/backup/BackupIntentTest.java
index 0115c56..54e7451 100644
--- a/tests/unit/src/com/android/settings/backup/BackupIntentTest.java
+++ b/tests/unit/src/com/android/settings/backup/BackupIntentTest.java
@@ -39,7 +39,7 @@
 public class BackupIntentTest {
     private static final String INTENT_PRIVACY_SETTINGS = "android.settings.PRIVACY_SETTINGS";
     private static final String BACKUP_SETTINGS_ACTIVITY =
-            "com.android.settings.backup.UserBackupSettingsActivity";
+            "com.android.settings.Settings$PrivacyDashboardActivity";
 
     private Context mContext;
 
diff --git a/tests/unit/src/com/android/settings/bluetooth/BluetoothDeviceDetailsRotationTest.java b/tests/unit/src/com/android/settings/bluetooth/BluetoothDeviceDetailsRotationTest.java
deleted file mode 100644
index aec6dd2..0000000
--- a/tests/unit/src/com/android/settings/bluetooth/BluetoothDeviceDetailsRotationTest.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) 2017 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.bluetooth;
-
-import static org.mockito.Mockito.when;
-
-import android.app.Instrumentation;
-import android.content.Context;
-import android.content.Intent;
-import android.os.Bundle;
-import android.os.RemoteException;
-import android.support.test.uiautomator.UiDevice;
-
-import androidx.test.InstrumentationRegistry;
-import androidx.test.filters.SmallTest;
-import androidx.test.runner.AndroidJUnit4;
-
-import com.android.settings.SettingsActivity;
-import com.android.settings.core.SubSettingLauncher;
-import com.android.settingslib.bluetooth.CachedBluetoothDevice;
-import com.android.settingslib.bluetooth.LocalBluetoothManager;
-import com.android.settingslib.core.instrumentation.Instrumentable;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Answers;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
-@RunWith(AndroidJUnit4.class)
-@SmallTest
-public class BluetoothDeviceDetailsRotationTest {
-    private Context mContext;
-    private UiDevice mUiDevice;
-    private Instrumentation mInstrumentation;
-
-    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
-    private CachedBluetoothDevice mCachedDevice;
-
-    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
-    private LocalBluetoothManager mBluetoothManager;
-
-    private String mDeviceAddress;
-
-    @Before
-    public void setUp() throws Exception {
-        MockitoAnnotations.initMocks(this);
-        mContext = InstrumentationRegistry.getTargetContext();
-        mUiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
-        mInstrumentation = InstrumentationRegistry.getInstrumentation();
-
-        mDeviceAddress = "AA:BB:CC:DD:EE:FF";
-        when(mCachedDevice.getAddress()).thenReturn(mDeviceAddress);
-        when(mCachedDevice.getName()).thenReturn("Mock Device");
-
-        BluetoothDeviceDetailsFragment.sTestDataFactory =
-                new BluetoothDeviceDetailsFragment.TestDataFactory() {
-                    @Override
-                    public CachedBluetoothDevice getDevice(String deviceAddress) {
-                        return mCachedDevice;
-                    }
-
-                    @Override
-                    public LocalBluetoothManager getManager(Context context) {
-                        return mBluetoothManager;
-                    }
-                };
-    }
-
-    @Test
-    public void rotation() {
-        Intent intent = new Intent("android.settings.BLUETOOTH_SETTINGS");
-        SettingsActivity activity = (SettingsActivity) mInstrumentation.startActivitySync(intent);
-        Bundle args = new Bundle(1);
-        args.putString(BluetoothDeviceDetailsFragment.KEY_DEVICE_ADDRESS, mDeviceAddress);
-        new SubSettingLauncher(activity)
-                .setDestination(BluetoothDeviceDetailsFragment.class.getName())
-                .setTitleText("test")
-                .setArguments(args)
-                .setSourceMetricsCategory(Instrumentable.METRICS_CATEGORY_UNKNOWN)
-                .launch();
-        try {
-            mUiDevice.setOrientationLeft();
-            mUiDevice.setOrientationNatural();
-            mUiDevice.setOrientationRight();
-            mUiDevice.setOrientationNatural();
-        } catch (RemoteException e) {
-            throw new RuntimeException(e);
-        }
-    }
-}
\ No newline at end of file
diff --git a/tests/unit/src/com/android/settings/bluetooth/DevicePickerActivityTest.java b/tests/unit/src/com/android/settings/bluetooth/DevicePickerActivityTest.java
deleted file mode 100644
index e531e0a..0000000
--- a/tests/unit/src/com/android/settings/bluetooth/DevicePickerActivityTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2017 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.bluetooth;
-
-import android.app.Instrumentation;
-import android.content.Intent;
-
-import androidx.test.InstrumentationRegistry;
-import androidx.test.filters.SmallTest;
-import androidx.test.runner.AndroidJUnit4;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(AndroidJUnit4.class)
-@SmallTest
-public class DevicePickerActivityTest {
-
-    private Instrumentation mInstrumentation;
-
-    @Before
-    public void setUp() throws Exception {
-        mInstrumentation = InstrumentationRegistry.getInstrumentation();
-    }
-
-    @Test
-    public void startActivityNoCrash() {
-        mInstrumentation.startActivitySync(
-                new Intent("android.bluetooth.devicepicker.action.LAUNCH"));
-        // No crash
-    }
-}
diff --git a/tests/unit/src/com/android/settings/connecteddevice/ConnectedDeviceActivityTest.java b/tests/unit/src/com/android/settings/connecteddevice/ConnectedDeviceActivityTest.java
deleted file mode 100644
index 2957c4c..0000000
--- a/tests/unit/src/com/android/settings/connecteddevice/ConnectedDeviceActivityTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2017 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.connecteddevice;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import android.app.Instrumentation;
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.text.TextUtils;
-
-import androidx.test.InstrumentationRegistry;
-import androidx.test.filters.SmallTest;
-import androidx.test.runner.AndroidJUnit4;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.util.List;
-
-@RunWith(AndroidJUnit4.class)
-@SmallTest
-public class ConnectedDeviceActivityTest {
-    private static final String INTENT_ACTION = "android.intent.action.MAIN";
-    private static final String CONNECTED_DEVICE_TITLE = "Connected devices";
-
-    private Instrumentation mInstrumentation;
-
-    @Before
-    public void setUp() throws Exception {
-        mInstrumentation = InstrumentationRegistry.getInstrumentation();
-    }
-
-    @Test
-    public void queryConnectedDeviceActivity_onlyOneResponse() {
-        final PackageManager packageManager = mInstrumentation.getContext().getPackageManager();
-        final Intent intent = new Intent(INTENT_ACTION);
-
-        int count = 0;
-        final List<ResolveInfo> resolveInfoList = packageManager.queryIntentActivities(intent,
-                PackageManager.GET_META_DATA);
-        for (ResolveInfo info : resolveInfoList) {
-            if (TextUtils.equals(info.activityInfo.loadLabel(packageManager).toString(),
-                    CONNECTED_DEVICE_TITLE)) {
-                count++;
-            }
-        }
-
-        assertThat(count).isEqualTo(1);
-    }
-
-}
diff --git a/tests/unit/src/com/android/settings/dashboard/PreferenceThemeTest.java b/tests/unit/src/com/android/settings/dashboard/PreferenceThemeTest.java
index 18a5e70..0ae5597 100644
--- a/tests/unit/src/com/android/settings/dashboard/PreferenceThemeTest.java
+++ b/tests/unit/src/com/android/settings/dashboard/PreferenceThemeTest.java
@@ -18,13 +18,9 @@
 
 import static androidx.test.espresso.Espresso.onView;
 import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist;
-import static androidx.test.espresso.assertion.ViewAssertions.matches;
-import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
 import static androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility;
 import static androidx.test.espresso.matcher.ViewMatchers.withId;
 
-import static com.android.settings.dashboard.FirstIdViewMatcher.withFirstId;
-
 import static org.hamcrest.Matchers.allOf;
 
 import android.app.Instrumentation;
@@ -58,12 +54,6 @@
     }
 
     @Test
-    public void startPhoneStatus_preferenceIconSpaceReserved() throws InterruptedException {
-        launchPhoneStatus();
-        onView(withFirstId(R.id.icon_frame)).check(matches(isDisplayed()));
-    }
-
-    @Test
     public void startSetupWizardLockScreen_preferenceIconSpaceNotReserved() {
         launchSetupWizardLockScreen();
         // Icons should not be shown, and the frame should not occupy extra space.
@@ -72,14 +62,6 @@
         onView(withId(R.id.icon_container)).check(doesNotExist());
     }
 
-    private void launchPhoneStatus() {
-        final Intent settingsIntent = new Intent("android.settings.DEVICE_INFO_SETTINGS")
-                .addCategory(Intent.CATEGORY_DEFAULT)
-                .setPackage(mTargetPackage)
-                .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-        InstrumentationRegistry.getInstrumentation().startActivitySync(settingsIntent);
-    }
-
     private void launchSetupWizardLockScreen() {
         final Intent settingsIntent = new Intent("com.android.settings.SETUP_LOCK_SCREEN")
                 .addCategory(Intent.CATEGORY_DEFAULT)
diff --git a/tests/unit/src/com/android/settings/datausage/MobileDataUsageActivityTest.java b/tests/unit/src/com/android/settings/datausage/MobileDataUsageActivityTest.java
deleted file mode 100644
index 066d199..0000000
--- a/tests/unit/src/com/android/settings/datausage/MobileDataUsageActivityTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2017 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;
-
-import static junit.framework.Assert.assertEquals;
-
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.net.NetworkTemplate;
-import android.telephony.SubscriptionManager;
-import android.telephony.TelephonyManager;
-
-import androidx.test.InstrumentationRegistry;
-import androidx.test.filters.SmallTest;
-import androidx.test.runner.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(AndroidJUnit4.class)
-@SmallTest
-public class MobileDataUsageActivityTest {
-    private static final String TAG = "MobileDataUsageTest";
-    @Test
-    public void test_mobileDataUsageIntent() {
-        final Context context = InstrumentationRegistry.getTargetContext();
-        final PackageManager packageManager = context.getPackageManager();
-        final int subId = SubscriptionManager.getDefaultSubscriptionId();
-        final NetworkTemplate template = getNetworkTemplate(context, subId);
-
-        Intent intent = new Intent(android.provider.Settings.ACTION_MOBILE_DATA_USAGE);
-        intent.putExtra(android.provider.Settings.EXTRA_NETWORK_TEMPLATE, template);
-        intent.putExtra(android.provider.Settings.EXTRA_SUB_ID, subId);
-
-        assertEquals(packageManager.queryIntentActivities(intent, 0).size(), 1);
-
-        context.startActivity(intent);
-        // Should exit gracefully without crashing.
-    }
-
-    private NetworkTemplate getNetworkTemplate(Context context, int subId) {
-        TelephonyManager tm = (TelephonyManager) context
-                .getSystemService(Context.TELEPHONY_SERVICE);
-        NetworkTemplate mobileAll = NetworkTemplate.buildTemplateMobileAll(
-                tm.getSubscriberId(subId));
-        return NetworkTemplate.normalize(mobileAll,
-                tm.getMergedSubscriberIds());
-    }
-}
diff --git a/tests/unit/src/com/android/settings/datetime/timezone/model/TimeZoneDataTest.java b/tests/unit/src/com/android/settings/datetime/timezone/model/TimeZoneDataTest.java
index 2659529..a04c08d 100644
--- a/tests/unit/src/com/android/settings/datetime/timezone/model/TimeZoneDataTest.java
+++ b/tests/unit/src/com/android/settings/datetime/timezone/model/TimeZoneDataTest.java
@@ -56,9 +56,6 @@
         */
         assertThat(mTimeZoneData.lookupCountryCodesForZoneId("Europe/Simferopol").isEmpty())
                 .isTrue();
-        // Metlakatla has the same time as Anchorage after 2015
-        assertThat(mTimeZoneData.lookupCountryCodesForZoneId("America/Metlakatla").isEmpty())
-                .isTrue();
         assertThat(mTimeZoneData.lookupCountryCodesForZoneId("Europe/London").isEmpty())
                 .isFalse();
         assertThat(mTimeZoneData.lookupCountryCodesForZoneId("America/Los_Angeles").isEmpty())
diff --git a/tests/unit/src/com/android/settings/deviceinfo/StorageDashboardFragmentTest.java b/tests/unit/src/com/android/settings/deviceinfo/StorageDashboardFragmentTest.java
deleted file mode 100644
index a0053be..0000000
--- a/tests/unit/src/com/android/settings/deviceinfo/StorageDashboardFragmentTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.android.settings.deviceinfo;
-
-import static androidx.test.espresso.Espresso.onView;
-import static androidx.test.espresso.action.ViewActions.click;
-import static androidx.test.espresso.intent.Intents.intended;
-import static androidx.test.espresso.intent.matcher.IntentMatchers.hasExtra;
-import static androidx.test.espresso.matcher.ViewMatchers.withText;
-
-import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.equalTo;
-
-import androidx.test.espresso.intent.rule.IntentsTestRule;
-import androidx.test.filters.SmallTest;
-
-import com.android.settings.R;
-import com.android.settings.Settings.StorageDashboardActivity;
-import com.android.settings.deletionhelper.AutomaticStorageManagerSettings;
-
-import org.junit.Rule;
-import org.junit.Test;
-
-@SmallTest
-public class StorageDashboardFragmentTest {
-
-    public static final String EXTRA_KEY = ":settings:show_fragment";
-
-    @Rule
-    public IntentsTestRule<StorageDashboardActivity> mActivityRule =
-            new IntentsTestRule<>(StorageDashboardActivity.class, true, true);
-
-    @Test
-    public void testStorageManagePreference_canClickTextView() throws InterruptedException {
-        // Click on the actual textbox instead of just somewhere in the preference
-        onView(withText(R.string.automatic_storage_manager_preference_title)).perform(click());
-
-        // Check that it worked by seeing if we switched screens
-        intended(hasExtra(equalTo(EXTRA_KEY),
-                containsString(AutomaticStorageManagerSettings.class.getName())));
-
-    }
-}
diff --git a/tests/unit/src/com/android/settings/dream/DreamSettingsLaunchTest.java b/tests/unit/src/com/android/settings/dream/DreamSettingsLaunchTest.java
deleted file mode 100644
index 6a2abd5..0000000
--- a/tests/unit/src/com/android/settings/dream/DreamSettingsLaunchTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2017 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.dream;
-
-import android.content.Context;
-import android.content.Intent;
-import android.provider.Settings;
-
-import androidx.test.InstrumentationRegistry;
-import androidx.test.filters.SmallTest;
-import androidx.test.runner.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(AndroidJUnit4.class)
-@SmallTest
-public class DreamSettingsLaunchTest {
-
-    @Test
-    public void launchFromIntent_doesNotCrash() {
-        final Context context = InstrumentationRegistry.getTargetContext();
-        Intent intent = new Intent(Settings.ACTION_DREAM_SETTINGS);
-
-        context.startActivity(intent);
-    }
-}
diff --git a/tests/unit/src/com/android/settings/notification/AppNotificationSettingsTest.java b/tests/unit/src/com/android/settings/notification/AppNotificationSettingsTest.java
index ede4631..19b1360 100644
--- a/tests/unit/src/com/android/settings/notification/AppNotificationSettingsTest.java
+++ b/tests/unit/src/com/android/settings/notification/AppNotificationSettingsTest.java
@@ -41,6 +41,7 @@
 import android.content.Context;
 import android.content.Intent;
 import android.provider.Settings;
+import android.support.test.uiautomator.UiDevice;
 
 import androidx.test.InstrumentationRegistry;
 import androidx.test.espresso.intent.Intents;
@@ -55,7 +56,9 @@
 @RunWith(AndroidJUnit4.class)
 @SmallTest
 public class AppNotificationSettingsTest {
+    private static final String WM_DISMISS_KEYGUARD_COMMAND = "wm dismiss-keyguard";
 
+    private UiDevice mUiDevice;
     private Context mTargetContext;
     private Instrumentation mInstrumentation;
 
@@ -68,9 +71,14 @@
     private NotificationChannel mUngroupedChannel;
 
     @Before
-    public void setUp() {
+    public void setUp() throws Exception {
         mInstrumentation = InstrumentationRegistry.getInstrumentation();
         mTargetContext = mInstrumentation.getTargetContext();
+
+        mUiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
+        mUiDevice.wakeUp();
+        mUiDevice.executeShellCommand(WM_DISMISS_KEYGUARD_COMMAND);
+
         mNm  = (NotificationManager) mTargetContext.getSystemService(Context.NOTIFICATION_SERVICE);
 
         mGroup1 = new NotificationChannelGroup(this.getClass().getName() + "1", "group1");
@@ -87,7 +95,8 @@
     @Test
     public void launchNotificationSetting_shouldNotHaveAppInfoLink() {
         final Intent intent = new Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS)
-                .putExtra(Settings.EXTRA_APP_PACKAGE, mTargetContext.getPackageName());
+                .putExtra(Settings.EXTRA_APP_PACKAGE, mTargetContext.getPackageName())
+                .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
 
         mInstrumentation.startActivitySync(intent);
 
@@ -99,60 +108,38 @@
     @Test
     public void launchNotificationSetting_showGroupsWithMultipleChannels() {
         final Intent intent = new Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS)
-                .putExtra(Settings.EXTRA_APP_PACKAGE, mTargetContext.getPackageName());
+                .putExtra(Settings.EXTRA_APP_PACKAGE, mTargetContext.getPackageName())
+                .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         mInstrumentation.startActivitySync(intent);
         onView(allOf(withText(mGroup1.getName().toString()))).check(
                 matches(isDisplayed()));
-        try {
-            onView(allOf(withText(mGroup1Channel1.getName().toString())))
-                    .check(matches(isDisplayed()));
-            fail("Channel erroneously appearing");
-        } catch (Exception e) {
-            // expected
-        }
-        // links to group page
-        Intents.init();
-        onView(allOf(withText(mGroup1.getName().toString()))).perform(click());
-        intended(allOf(hasExtra(EXTRA_SHOW_FRAGMENT,
-                ChannelGroupNotificationSettings.class.getName())));
-        Intents.release();
+        onView(allOf(withText(mGroup1Channel1.getName().toString()))).check(
+                matches(isDisplayed()));
+        onView(allOf(withText(mGroup1Channel2.getName().toString()))).check(
+                matches(isDisplayed()));
     }
 
     @Test
     public void launchNotificationSetting_showUngroupedChannels() {
         final Intent intent = new Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS)
-                .putExtra(Settings.EXTRA_APP_PACKAGE, mTargetContext.getPackageName());
+                .putExtra(Settings.EXTRA_APP_PACKAGE, mTargetContext.getPackageName())
+                .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         mInstrumentation.startActivitySync(intent);
         onView(allOf(withText(mUngroupedChannel.getName().toString())))
                 .check(matches(isDisplayed()));
-        // links directly to channel page
-        Intents.init();
-        onView(allOf(withText(mUngroupedChannel.getName().toString()))).perform(click());
-        intended(allOf(hasExtra(EXTRA_SHOW_FRAGMENT, ChannelNotificationSettings.class.getName())));
-        Intents.release();
     }
 
     @Test
     public void launchNotificationSetting_showGroupsWithOneChannel() {
         final Intent intent = new Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS)
-                .putExtra(Settings.EXTRA_APP_PACKAGE, mTargetContext.getPackageName());
+                .putExtra(Settings.EXTRA_APP_PACKAGE, mTargetContext.getPackageName())
+                .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         mInstrumentation.startActivitySync(intent);
 
+        onView(allOf(withText(mGroup2.getName().toString())))
+                .check(matches(isDisplayed()));
         onView(allOf(withText(mGroup2Channel1.getName().toString())))
                 .check(matches(isDisplayed()));
-        try {
-            onView(allOf(withText(mGroup2.getName().toString()))).check(
-                    matches(isDisplayed()));
-            fail("Group erroneously appearing");
-        } catch (Exception e) {
-            // expected
-        }
-
-        // links directly to channel page
-        Intents.init();
-        onView(allOf(withText(mGroup2Channel1.getName().toString()))).perform(click());
-        intended(allOf(hasExtra(EXTRA_SHOW_FRAGMENT, ChannelNotificationSettings.class.getName())));
-        Intents.release();
     }
 
     private NotificationChannel createChannel(NotificationChannelGroup group,
diff --git a/tests/unit/src/com/android/settings/notification/ChannelNotificationSettingsTest.java b/tests/unit/src/com/android/settings/notification/ChannelNotificationSettingsTest.java
index f7a5a82..9a3a994 100644
--- a/tests/unit/src/com/android/settings/notification/ChannelNotificationSettingsTest.java
+++ b/tests/unit/src/com/android/settings/notification/ChannelNotificationSettingsTest.java
@@ -36,6 +36,7 @@
 import android.os.Process;
 import android.os.ServiceManager;
 import android.provider.Settings;
+import android.support.test.uiautomator.UiDevice;
 
 import androidx.test.InstrumentationRegistry;
 import androidx.test.filters.SmallTest;
@@ -48,17 +49,23 @@
 @RunWith(AndroidJUnit4.class)
 @SmallTest
 public class ChannelNotificationSettingsTest {
+    private static final String WM_DISMISS_KEYGUARD_COMMAND = "wm dismiss-keyguard";
 
+    private UiDevice mUiDevice;
     private Context mTargetContext;
     private Instrumentation mInstrumentation;
     private NotificationChannel mNotificationChannel;
     private NotificationManager mNm;
 
     @Before
-    public void setUp() {
+    public void setUp() throws Exception {
         mInstrumentation = InstrumentationRegistry.getInstrumentation();
         mTargetContext = mInstrumentation.getTargetContext();
 
+        mUiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
+        mUiDevice.wakeUp();
+        mUiDevice.executeShellCommand(WM_DISMISS_KEYGUARD_COMMAND);
+
         mNm  = (NotificationManager) mTargetContext.getSystemService(Context.NOTIFICATION_SERVICE);
         mNotificationChannel = new NotificationChannel(this.getClass().getName(),
                 this.getClass().getName(), IMPORTANCE_MIN);
@@ -69,7 +76,8 @@
     public void launchNotificationSetting_shouldNotCrash() {
         final Intent intent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS)
                 .putExtra(Settings.EXTRA_APP_PACKAGE, mTargetContext.getPackageName())
-                .putExtra(Settings.EXTRA_CHANNEL_ID, mNotificationChannel.getId());
+                .putExtra(Settings.EXTRA_CHANNEL_ID, mNotificationChannel.getId())
+                .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         mInstrumentation.startActivitySync(intent);
 
         onView(allOf(withText(mNotificationChannel.getName().toString()))).check(
@@ -90,12 +98,12 @@
 
         final Intent intent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS)
                 .putExtra(Settings.EXTRA_APP_PACKAGE, mTargetContext.getPackageName())
-                .putExtra(Settings.EXTRA_CHANNEL_ID, blocked.getId());
+                .putExtra(Settings.EXTRA_CHANNEL_ID, blocked.getId())
+                .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         mInstrumentation.startActivitySync(intent);
 
-        onView(allOf(withText("Off"), isDisplayed())).check(matches(isDisplayed()));
-        onView(allOf(withText("Android is blocking this category of notifications from"
-                + " appearing on this device"))).check(matches(isDisplayed()));
+        onView(allOf(withText("At your request, Android is blocking this category of notifications"
+                + " from appearing on this device"))).check(matches(isDisplayed()));
 
         try {
             onView(allOf(withText("On the lock screen"))).check(matches(isDisplayed()));
diff --git a/tests/unit/src/com/android/settings/notification/ZenModeSettingsIntegrationTest.java b/tests/unit/src/com/android/settings/notification/ZenModeSettingsIntegrationTest.java
index 2fe4074..4120a07 100644
--- a/tests/unit/src/com/android/settings/notification/ZenModeSettingsIntegrationTest.java
+++ b/tests/unit/src/com/android/settings/notification/ZenModeSettingsIntegrationTest.java
@@ -37,27 +37,29 @@
     @Test
     public void testZenModeSettingsPreferences() {
         launchZenSettings();
-        onView(withText("Behavior")).check(matches(isDisplayed()));
-        onView(withText("Turn on automatically")).check(matches(isDisplayed()));
+        onView(withText("Calls")).check(matches(isDisplayed()));
+        onView(withText("SMS, MMS, and messaging apps")).check(matches(isDisplayed()));
+        onView(withText("Restrict notifications")).check(matches(isDisplayed()));
+        onView(withText("Duration")).check(matches(isDisplayed()));
+        onView(withText("Schedules")).check(matches(isDisplayed()));
     }
 
     @Test
     public void testZenModeBehaviorPreferences() {
         launchZenBehaviorSettings();
-        onView(withText("Alarms")).check(matches(isDisplayed()));
-        onView(withText("Media and system feedback")).check(matches(isDisplayed()));
-        onView(withText("Reminders")).check(matches(isDisplayed()));
-        onView(withText("Events")).check(matches(isDisplayed()));
-        onView(withText("Messages")).check(matches(isDisplayed()));
         onView(withText("Calls")).check(matches(isDisplayed()));
-        onView(withText("Repeat callers")).check(matches(isDisplayed()));
+        onView(withText("SMS, MMS, and messaging apps")).check(matches(isDisplayed()));
+        onView(withText("Restrict notifications")).check(matches(isDisplayed()));
+        onView(withText("Duration")).check(matches(isDisplayed()));
+        onView(withText("Schedules")).check(matches(isDisplayed()));
     }
 
     @Test
     public void testZenModeAutomationPreferences() {
         launchZenAutomationSettings();
-        onView(withText("Weekend")).check(matches(isDisplayed()));
-        onView(withText("Add rule")).check(matches(isDisplayed()));
+        onView(withText("Sleeping")).check(matches(isDisplayed()));
+        onView(withText("Event")).check(matches(isDisplayed()));
+        onView(withText("Add more")).check(matches(isDisplayed()));
     }
 
     private void launchZenSettings() {
diff --git a/tests/unit/src/com/android/settings/tests/DrawOverlayDetailsTest.java b/tests/unit/src/com/android/settings/tests/DrawOverlayDetailsTest.java
deleted file mode 100644
index d450bf0..0000000
--- a/tests/unit/src/com/android/settings/tests/DrawOverlayDetailsTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * 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.
- */
-
-package com.android.settings.tests;
-
-import static androidx.test.espresso.Espresso.onView;
-import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu;
-import static androidx.test.espresso.action.ViewActions.click;
-import static androidx.test.espresso.assertion.ViewAssertions.matches;
-import static androidx.test.espresso.matcher.ViewMatchers.isEnabled;
-import static androidx.test.espresso.matcher.ViewMatchers.withText;
-
-import static org.hamcrest.core.IsNot.not;
-
-import android.app.Instrumentation;
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.support.test.uiautomator.UiDevice;
-import android.support.test.uiautomator.UiScrollable;
-import android.support.test.uiautomator.UiSelector;
-
-import androidx.test.InstrumentationRegistry;
-import androidx.test.filters.SmallTest;
-import androidx.test.runner.AndroidJUnit4;
-
-import com.android.settings.R;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(AndroidJUnit4.class)
-@SmallTest
-public class DrawOverlayDetailsTest {
-    private final static String PACKAGE_SYSTEM_UI = "com.android.systemui";
-
-    @Test
-    public void testSystemUiDrawOverlayDetails_Disabled() throws Exception{
-        Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
-        instrumentation.startActivitySync(new Intent(android.provider.Settings
-                .ACTION_MANAGE_OVERLAY_PERMISSION));
-
-        final Context targetContext = instrumentation.getTargetContext();
-
-        final PackageManager packageManager = targetContext.getPackageManager();
-        final String appName = (String) packageManager.getApplicationLabel(packageManager
-                .getApplicationInfo(PACKAGE_SYSTEM_UI, PackageManager.GET_META_DATA));
-
-        final UiDevice device = UiDevice.getInstance(instrumentation);
-        device.waitForIdle();
-
-        openActionBarOverflowOrOptionsMenu(targetContext);
-        onView(withText(targetContext.getString(R.string.menu_show_system))).perform(click());
-        device.waitForIdle();
-
-        final UiScrollable settings = new UiScrollable(
-                new UiSelector().packageName(targetContext.getPackageName()).scrollable(true));
-        settings.scrollTextIntoView(appName);
-        onView(withText(appName)).perform(click());
-        onView(withText(targetContext.getString(R.string.permit_draw_overlay))).check(matches
-                (not(isEnabled())));
-    }
-
-}
diff --git a/tests/unit/src/com/android/settings/tests/KeepOnScreenTest.java b/tests/unit/src/com/android/settings/tests/KeepOnScreenTest.java
deleted file mode 100644
index b930ffb..0000000
--- a/tests/unit/src/com/android/settings/tests/KeepOnScreenTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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.
- */
-
-package com.android.settings.tests;
-
-import static androidx.test.espresso.Espresso.onView;
-import static androidx.test.espresso.action.ViewActions.click;
-import static androidx.test.espresso.matcher.ViewMatchers.withText;
-
-import static junit.framework.Assert.assertEquals;
-
-import android.app.Instrumentation;
-import android.content.Context;
-import android.content.Intent;
-import android.os.BatteryManager;
-import android.provider.Settings;
-
-import androidx.test.InstrumentationRegistry;
-import androidx.test.filters.SmallTest;
-import androidx.test.runner.AndroidJUnit4;
-
-import com.android.settings.R;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(AndroidJUnit4.class)
-@SmallTest
-public class KeepOnScreenTest {
-    private static int EXPECTED_FLAG = BatteryManager.BATTERY_PLUGGED_AC
-            | BatteryManager.BATTERY_PLUGGED_USB | BatteryManager.BATTERY_PLUGGED_WIRELESS;
-
-    @Test
-    public void testStayAwake_turnOn_StayAwakeWhileWirelessCharging() throws Exception{
-        Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
-        instrumentation.startActivitySync(new Intent(android.provider.Settings
-                .ACTION_APPLICATION_DEVELOPMENT_SETTINGS));
-
-        final Context targetContext = instrumentation.getTargetContext();
-        final int prevFlag = Settings.Global.getInt(targetContext.getContentResolver(), Settings
-                .Global.STAY_ON_WHILE_PLUGGED_IN);
-
-        // Turn on "Stay Awake" if needed
-        if (prevFlag == 0) {
-            onView(withText(R.string.keep_screen_on)).perform(click());
-        }
-
-        final int currentFlag = Settings.Global.getInt(targetContext.getContentResolver(), Settings
-                .Global.STAY_ON_WHILE_PLUGGED_IN);
-
-        assertEquals(EXPECTED_FLAG, currentFlag);
-
-        // Since this app doesn't have permission(and shouldn't have) to change global setting, we
-        // can only tearDown in this way
-        if (prevFlag != currentFlag) {
-            onView(withText(R.string.keep_screen_on)).perform(click());
-        }
-    }
-}
diff --git a/tests/unit/src/com/android/settings/tests/PrivateVolumeSettingsTest.java b/tests/unit/src/com/android/settings/tests/PrivateVolumeSettingsTest.java
deleted file mode 100644
index 2760a07..0000000
--- a/tests/unit/src/com/android/settings/tests/PrivateVolumeSettingsTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.
- */
-package com.android.settings.tests;
-
-import static androidx.test.espresso.Espresso.onView;
-import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist;
-import static androidx.test.espresso.matcher.ViewMatchers.withText;
-
-import android.app.Instrumentation;
-import android.content.Intent;
-
-import androidx.test.InstrumentationRegistry;
-import androidx.test.filters.SmallTest;
-import androidx.test.runner.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(AndroidJUnit4.class)
-@SmallTest
-public class PrivateVolumeSettingsTest {
-    @Test
-    public void test_ManageStorageNotShown() {
-        Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
-        instrumentation.startActivitySync(
-                new Intent(android.provider.Settings.ACTION_INTERNAL_STORAGE_SETTINGS));
-        onView(withText(com.android.settings.R.string.storage_menu_manage)).check(doesNotExist());
-    }
-}
\ No newline at end of file
diff --git a/tests/unit/src/com/android/settings/tests/SettingsRestoreAfterCloseTest.java b/tests/unit/src/com/android/settings/tests/SettingsRestoreAfterCloseTest.java
deleted file mode 100644
index 3c6caf7..0000000
--- a/tests/unit/src/com/android/settings/tests/SettingsRestoreAfterCloseTest.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * 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.
- */
-package com.android.settings.tests;
-
-import android.app.ActivityManager;
-import android.content.Context;
-import android.content.Intent;
-import android.provider.Settings;
-import android.support.test.uiautomator.By;
-import android.support.test.uiautomator.UiDevice;
-import android.support.test.uiautomator.Until;
-
-import androidx.test.InstrumentationRegistry;
-import androidx.test.filters.SmallTest;
-import androidx.test.runner.AndroidJUnit4;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(AndroidJUnit4.class)
-@SmallTest
-public class SettingsRestoreAfterCloseTest {
-    private static final String PACKAGE_SETTINGS = "com.android.settings";
-    private static final int TIME_OUT = 2000;
-
-    private boolean mAlwaysFinish;
-
-    @Before
-    public void setUp() throws Exception {
-        // To make sure when we press home button, the activity will be destroyed by OS
-        Context context = InstrumentationRegistry.getContext();
-        mAlwaysFinish = Settings.Global.getInt(
-                context.getContentResolver(), Settings.Global
-                .ALWAYS_FINISH_ACTIVITIES, 0)
-                != 0;
-
-        ActivityManager.getService().setAlwaysFinish(true);
-    }
-
-    @After
-    public void tearDown() throws Exception {
-        ActivityManager.getService().setAlwaysFinish(mAlwaysFinish);
-    }
-
-    @Test
-    public void testRtlStability_AppCloseAndReOpen_shouldNotCrash() throws Exception {
-
-        final UiDevice uiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation
-                ());
-        uiDevice.pressHome();
-
-        // Open the settings app
-        startSettingsMainActivity(uiDevice);
-
-        // Press home button
-        uiDevice.pressHome();
-        final String launcherPackage = uiDevice.getLauncherPackageName();
-        uiDevice.wait(Until.hasObject(By.pkg(launcherPackage).depth(0)), TIME_OUT);
-
-        // Open the settings again
-        startSettingsMainActivity(uiDevice);
-    }
-
-    private void startSettingsMainActivity(UiDevice uiDevice) {
-        Context context = InstrumentationRegistry.getContext();
-        context.startActivity(new Intent(android.provider.Settings.ACTION_SETTINGS));
-        uiDevice.wait(Until.hasObject(By.pkg(PACKAGE_SETTINGS).depth(0)), TIME_OUT);
-    }
-}
diff --git a/tests/unit/src/com/android/settings/users/UserSettingsTest.java b/tests/unit/src/com/android/settings/users/UserSettingsTest.java
deleted file mode 100644
index 93f62f3..0000000
--- a/tests/unit/src/com/android/settings/users/UserSettingsTest.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * 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.
- */
-package com.android.settings.users;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import android.content.Context;
-import android.content.Intent;
-import android.support.test.uiautomator.UiDevice;
-import android.support.test.uiautomator.UiObject;
-import android.support.test.uiautomator.UiObjectNotFoundException;
-import android.support.test.uiautomator.UiScrollable;
-import android.support.test.uiautomator.UiSelector;
-
-import androidx.test.InstrumentationRegistry;
-import androidx.test.filters.SmallTest;
-import androidx.test.runner.AndroidJUnit4;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(AndroidJUnit4.class)
-@SmallTest
-public class UserSettingsTest {
-
-    private static final String SYSTEM = "System";
-    private static final String ADVANCED = "Advanced";
-    private static final String USERS = "Multiple users";
-    private static final String EMERGNENCY_INFO = "Emergency information";
-    private static final String ADD_USERS_WHEN_LOCKED = "Add users";
-    private static final String SWITCH_USER_BUTTON = "com.android.systemui:id/multi_user_switch";
-    private static final String SETTINGS_BUTTON = "com.android.systemui:id/settings_button";
-    private static final String PRIMARY_USER = "Owner";
-    private static final String GUEST_USER = "Guest";
-    private static final String ADD_GUEST = "Add guest";
-    private static final String CONTINUE = "Yes, continue";
-
-    private UiDevice mDevice;
-    private Context mContext;
-    private String mTargetPackage;
-
-    @Before
-    public void setUp() {
-        mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
-        mContext = InstrumentationRegistry.getTargetContext();
-        mTargetPackage = mContext.getPackageName();
-    }
-
-    @Test
-    public void testEmergencyInfoNotExists() throws Exception {
-        launchUserSettings();
-        UiObject emergencyInfoPreference =
-            mDevice.findObject(new UiSelector().text(EMERGNENCY_INFO));
-
-        assertThat(emergencyInfoPreference.exists()).isFalse();
-    }
-
-    @Test
-    public void testAddUsersWhenLockedNotExists() throws Exception {
-        launchUserSettings();
-        UiObject addUsersPreference =
-            mDevice.findObject(new UiSelector().text(ADD_USERS_WHEN_LOCKED));
-        assertThat(addUsersPreference.exists()).isFalse();
-    }
-
-    @Test
-    public void testUsersExistsOnSecondaryUser() throws Exception {
-        // switch to guest user
-        switchToOrCreateGuest();
-        // launch settings (launch from intent doesn't work, hence launch from quick settings)
-        mDevice.openQuickSettings();
-        mDevice.findObject(new UiSelector().resourceId(SETTINGS_BUTTON)).click();
-        // launch system settings and expand whole screen
-        final UiScrollable settings = new UiScrollable(
-            new UiSelector().packageName(mTargetPackage).scrollable(true));
-        final String titleSystem = SYSTEM;
-        settings.scrollTextIntoView(titleSystem);
-        mDevice.findObject(new UiSelector().text(titleSystem)).click();
-        mDevice.findObject(new UiSelector().text(ADVANCED)).click();
-
-        final boolean hasUsersSettings = mDevice.findObject(new UiSelector().text(USERS)).exists();
-
-        // switch back to primary user
-        mDevice.openQuickSettings();
-        mDevice.findObject(new UiSelector().resourceId(SWITCH_USER_BUTTON)).click();
-        mDevice.findObject(new UiSelector().text(PRIMARY_USER)).click();
-
-        assertThat(hasUsersSettings).isTrue();
-    }
-
-    private void launchSettings() {
-        Intent settingsIntent = new Intent(Intent.ACTION_MAIN)
-                .addCategory(Intent.CATEGORY_LAUNCHER)
-                .setPackage(mTargetPackage)
-                .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-        mContext.startActivity(settingsIntent);
-    }
-
-    private void launchUserSettings() throws Exception  {
-        launchSettings();
-        final UiScrollable settings = new UiScrollable(
-                new UiSelector().packageName(mTargetPackage).scrollable(true));
-        final String titleSystem = SYSTEM;
-        settings.scrollTextIntoView(titleSystem);
-        mDevice.findObject(new UiSelector().text(titleSystem)).click();
-        mDevice.findObject(new UiSelector().text(ADVANCED)).click();
-        mDevice.findObject(new UiSelector().text(USERS)).click();
-    }
-
-    private void switchToOrCreateGuest() throws UiObjectNotFoundException {
-        mDevice.openQuickSettings();
-        mDevice.findObject(new UiSelector().resourceId(SWITCH_USER_BUTTON)).click();
-        // if no existing guest user, select "Add guest", otherwise select "Guest"
-        final UiObject addGuest = mDevice.findObject(new UiSelector().text(ADD_GUEST));
-        if (addGuest.exists()) {
-            addGuest.click();
-            mDevice.waitForIdle();
-            mDevice.pressBack();
-        } else {
-            mDevice.findObject(new UiSelector().text(GUEST_USER)).click();
-            mDevice.waitForIdle();
-            mDevice.findObject(new UiSelector().text(CONTINUE)).click();
-            mDevice.waitForIdle();
-        }
-    }
-}
diff --git a/tests/unit/src/com/android/settings/wifi/tether/WifiTetherSettingsTest.java b/tests/unit/src/com/android/settings/wifi/tether/WifiTetherSettingsTest.java
index cb586e4..2de6611 100644
--- a/tests/unit/src/com/android/settings/wifi/tether/WifiTetherSettingsTest.java
+++ b/tests/unit/src/com/android/settings/wifi/tether/WifiTetherSettingsTest.java
@@ -56,7 +56,8 @@
         mTetherActivityIntent = new Intent()
                 .setClassName(mInstrumentation.getTargetContext().getPackageName(),
                         Settings.TetherSettingsActivity.class.getName())
-                .setPackage(mInstrumentation.getTargetContext().getPackageName());
+                .setPackage(mInstrumentation.getTargetContext().getPackageName())
+                .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
     }
 
     @After
@@ -69,7 +70,6 @@
         launchWifiTetherActivity();
         onView(withText("Hotspot name")).check(matches(isDisplayed()));
         onView(withText("Hotspot password")).check(matches(isDisplayed()));
-        onView(withText("AP Band")).check(matches(isDisplayed()));
     }
 
     private void launchWifiTetherActivity() {
