Merge "Updated screen lock type picker footer strings"
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 90aa55f..70dce8f 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -41,7 +41,7 @@
     <uses-permission android:name="android.permission.CLEAR_APP_USER_DATA" />
     <uses-permission android:name="android.permission.READ_PHONE_STATE" />
     <uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />
-    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
+    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
     <uses-permission android:name="android.permission.WRITE_APN_SETTINGS"/>
     <uses-permission android:name="android.permission.ACCESS_CHECKIN_PROPERTIES"/>
     <uses-permission android:name="android.permission.READ_USER_DICTIONARY"/>
@@ -443,7 +443,7 @@
             android:exported="true"
             android:permission="android.permission.TETHER_PRIVILEGED" />
 
-        <activity android:name="TetherProvisioningActivity"
+        <activity android:name=".network.TetherProvisioningActivity"
             android:exported="true"
             android:permission="android.permission.TETHER_PRIVILEGED"
             android:excludeFromRecents="true"
@@ -2987,11 +2987,23 @@
                        android:value="true" />
         </activity>
 
+        <activity android:name="Settings$BluetoothDeviceDetailActivity"
+                  android:label="@string/device_details_title"
+                  android:permission="android.permission.BLUETOOTH_PRIVILEGED"
+                  android:parentActivityName="Settings$ConnectedDeviceDashboardActivity">
+            <intent-filter android:priority="1">
+                <action android:name="com.android.settings.BLUETOOTH_DEVICE_DETAIL_SETTINGS" />
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
+                       android:value="com.android.settings.bluetooth.BluetoothDeviceDetailsFragment" />
+        </activity>
+
         <activity android:name=".panel.SettingsPanelActivity"
             android:label="@string/settings_panel_title"
             android:theme="@style/Theme.BottomDialog"
             android:excludeFromRecents="true"
-            android:launchMode="singleTask"
+            android:launchMode="singleTop"
             android:exported="true">
                  <intent-filter>
                      <action android:name="android.settings.panel.action.INTERNET_CONNECTIVITY" />
@@ -3021,16 +3033,7 @@
         <provider android:name=".slices.SettingsSliceProvider"
                   android:authorities="com.android.settings.slices;android.settings.slices"
                   android:exported="true"
-                  android:grantUriPermissions="true">
-            <intent-filter>
-                <action android:name="android.intent.action.VIEW" />
-                <category android:name="android.intent.category.DEFAULT" />
-                <category android:name="android.intent.category.BROWSABLE" />
-                <category android:name="android.app.slice.category.SLICE" />
-                <data android:scheme="settings"
-                      android:host="com.android.settings.slices" />
-            </intent-filter>
-        </provider>
+                  android:grantUriPermissions="true" />
 
         <receiver
             android:name=".slices.SliceBroadcastReceiver"
diff --git a/res/drawable/ic_airplanemode_active.xml b/res/drawable/ic_airplanemode_active.xml
index 10dd7ed..7ade8b2 100644
--- a/res/drawable/ic_airplanemode_active.xml
+++ b/res/drawable/ic_airplanemode_active.xml
@@ -20,9 +20,6 @@
         android:viewportHeight="24.0"
         android:tint="?android:attr/colorControlNormal">
     <path
-        android:pathData="M20.8,13.56L13.5,9V3.5C13.5,2.67,12.83,2,12,2s-1.5,0.67-1.5,1.5V9l-7.3,4.56c-0.43,0.27-0.7,0.75-0.7,1.27v0.49
-c0,0.34,0.33,0.58,0.65,0.48l7.35-2.3V19l-1.6,1.2c-0.25,0.19-0.4,0.49-0.4,0.8v0.67c0,0.17,0.14,0.28,0.31,0.24
-c1.94-0.55,1.3-0.37,3.19-0.91c1.21,0.35,1.99,0.57,3.19,0.91c0.17,0.04,0.31-0.07,0.31-0.24V21c0-0.31-0.15-0.61-0.4-0.8L13.5,19
-v-5.5l7.35,2.3c0.32,0.1,0.65-0.14,0.65-0.48v-0.49C21.5,14.31,21.23,13.83,20.8,13.56z"
+        android:pathData="M21,16v-2l-8,-5V3.5C13,2.67 12.33,2 11.5,2S10,2.67 10,3.5V9l-8,5v2l8,-2.5V19l-2,1.5V22l3.5,-1l3.5,1v-1.5L13,19v-5.5L21,16z"
         android:fillColor="#FFFFFFFF"/>
 </vector>
diff --git a/res/drawable/ic_battery_saver_accent_24dp.xml b/res/drawable/ic_battery_saver_accent_24dp.xml
index c8def54..764402d 100644
--- a/res/drawable/ic_battery_saver_accent_24dp.xml
+++ b/res/drawable/ic_battery_saver_accent_24dp.xml
@@ -22,8 +22,8 @@
         android:tint="?android:attr/colorAccent">
     <path
         android:fillColor="#FF000000"
-        android:pathData="M15,14l-2,0l0,2l-2,0l0,-2l-2,0l0,-2l2,0l0,-2l2,0l0,2l2,0z"/>
+        android:pathData="M16.67,4H14.5V2h-5v2H7.33C6.6,4 6,4.6 6,5.33V15v5.67C6,21.4 6.6,22 7.33,22h9.33C17.4,22 18,21.4 18,20.67V15V5.33C18,4.6 17.4,4 16.67,4zM16,15v5H8v-5V6h8V15z"/>
     <path
         android:fillColor="#FF000000"
-        android:pathData="M16.2,22.5H7.8c-1.3,0 -2.3,-1 -2.3,-2.3V5.8c0,-1.3 1,-2.3 2.3,-2.3h0.7v-2h7v2h0.7c1.3,0 2.3,1.1 2.3,2.3v14.3C18.5,21.5 17.5,22.5 16.2,22.5zM7.8,5.5c-0.2,0 -0.3,0.2 -0.3,0.3v14.3c0,0.2 0.2,0.3 0.3,0.3h8.3c0.2,0 0.3,-0.1 0.3,-0.3V5.8c0,-0.2 -0.1,-0.3 -0.3,-0.3h-2.7v-2h-3v2H7.8z"/>
+        android:pathData="M15,12l-2,0l0,-2l-2,0l0,2l-2,0l0,2l2,0l0,2l2,0l0,-2l2,0z"/>
 </vector>
diff --git a/res/drawable/ic_friction_lock_closed.xml b/res/drawable/ic_friction_lock_closed.xml
index 56256a9..2f035e7 100644
--- a/res/drawable/ic_friction_lock_closed.xml
+++ b/res/drawable/ic_friction_lock_closed.xml
@@ -15,11 +15,11 @@
     limitations under the License.
 -->
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:viewportWidth="48"
-        android:viewportHeight="48"
-        android:width="18dp"
-        android:height="18dp">
+        android:width="24dp"
+        android:height="24dp"
+        android:viewportWidth="24"
+        android:viewportHeight="24">
     <path
-        android:pathData="M36 16l-2 0 0 -4C34 6.48 29.52 2 24 2 18.48 2 14 6.48 14 12l0 4 -2 0c-2.21 0 -4 1.79 -4 4l0 20c0 2.21 1.79 4 4 4l24 0c2.21 0 4 -1.79 4 -4l0 -20c0 -2.21 -1.79 -4 -4 -4zM24 34c-2.21 0 -4 -1.79 -4 -4 0 -2.21 1.79 -4 4 -4 2.21 0 4 1.79 4 4 0 2.21 -1.79 4 -4 4zm6.2 -18l-12.4 0 0 -4c0 -3.42 2.78 -6.2 6.2 -6.2 3.42 0 6.2 2.78 6.2 6.2l0 4z"
-        android:fillColor="?android:attr/colorControlNormal" />
+        android:fillColor="?android:attr/colorControlNormal"
+        android:pathData="M18,8h-1V6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2H6c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V10C20,8.9 19.1,8 18,8zM9,6c0,-1.66 1.34,-3 3,-3s3,1.34 3,3v2H9V6zM18,20H6V10h12V20zM12,17c1.1,0 2,-0.9 2,-2c0,-1.1 -0.9,-2 -2,-2c-1.1,0 -2,0.9 -2,2C10,16.1 10.9,17 12,17z"/>
 </vector>
diff --git a/res/drawable/ic_settings.xml b/res/drawable/ic_settings.xml
deleted file mode 100644
index 3d8563d..0000000
--- a/res/drawable/ic_settings.xml
+++ /dev/null
@@ -1,34 +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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-    android:width="24dp"
-    android:height="24dp"
-    android:viewportWidth="24.0"
-    android:viewportHeight="24.0"
-    android:tint="?android:attr/colorAccent">
-    <path
-        android:fillColor="#FF000000"
-        android:pathData="M21.4 14.2l-1.94-1.45c.03-.25 .04 -.5 .04 -.76s-.01-.51-.04-.76L21.4 9.8c.42-.31
-.52 -.94 .24 -1.41l-1.6-2.76c-.28-.48-.88-.7-1.36-.5l-2.14 .91
-c-.48-.37-1.01-.68-1.57-.92l-.27-2.2c-.06-.52-.56-.92-1.11-.92h-3.18c-.55 0-1.05
-.4 -1.11 .92 l-.26 2.19c-.57 .24 -1.1 .55 -1.58 .92 l-2.14-.91c-.48-.2-1.08 .02
--1.36 .5 l-1.6 2.76c-.28 .48 -.18 1.1 .24 1.42l1.94 1.45c-.03 .24 -.04 .49 -.04
-.75 s.01 .51 .04 .76 L2.6 14.2c-.42 .31 -.52 .94 -.24 1.41l1.6 2.76c.28 .48 .88
-.7 1.36 .5 l2.14-.91c.48 .37 1.01 .68 1.57 .92 l.27 2.19c.06 .53 .56 .93 1.11
-.93 h3.18c.55 0 1.04-.4 1.11-.92l.27-2.19c.56-.24 1.09-.55 1.57-.92l2.14 .91
-c.48 .2 1.08-.02 1.36-.5l1.6-2.76c.28-.48 .18 -1.1-.24-1.42zM12 15.5c-1.93
-0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"/>
-</vector>
diff --git a/res/drawable/ic_settings_accent.xml b/res/drawable/ic_settings_accent.xml
new file mode 100644
index 0000000..7d871bc
--- /dev/null
+++ b/res/drawable/ic_settings_accent.xml
@@ -0,0 +1,29 @@
+<!--
+     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.
+-->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="24dp"
+        android:height="24dp"
+        android:viewportWidth="24.0"
+        android:viewportHeight="24.0"
+        android:tint="?android:attr/colorAccent">
+    <path
+        android:fillColor="#FFFFFFFF"
+        android:pathData="M13.85,22.25h-3.7c-0.74,0 -1.36,-0.54 -1.45,-1.27l-0.27,-1.89c-0.27,-0.14 -0.53,-0.29 -0.79,-0.46l-1.8,0.72c-0.7,0.26 -1.47,-0.03 -1.81,-0.65L2.2,15.53c-0.35,-0.66 -0.2,-1.44 0.36,-1.88l1.53,-1.19c-0.01,-0.15 -0.02,-0.3 -0.02,-0.46c0,-0.15 0.01,-0.31 0.02,-0.46l-1.52,-1.19C1.98,9.9 1.83,9.09 2.2,8.47l1.85,-3.19c0.34,-0.62 1.11,-0.9 1.79,-0.63l1.81,0.73c0.26,-0.17 0.52,-0.32 0.78,-0.46l0.27,-1.91c0.09,-0.7 0.71,-1.25 1.44,-1.25h3.7c0.74,0 1.36,0.54 1.45,1.27l0.27,1.89c0.27,0.14 0.53,0.29 0.79,0.46l1.8,-0.72c0.71,-0.26 1.48,0.03 1.82,0.65l1.84,3.18c0.36,0.66 0.2,1.44 -0.36,1.88l-1.52,1.19c0.01,0.15 0.02,0.3 0.02,0.46s-0.01,0.31 -0.02,0.46l1.52,1.19c0.56,0.45 0.72,1.23 0.37,1.86l-1.86,3.22c-0.34,0.62 -1.11,0.9 -1.8,0.63l-1.8,-0.72c-0.26,0.17 -0.52,0.32 -0.78,0.46l-0.27,1.91C15.21,21.71 14.59,22.25 13.85,22.25zM13.32,20.72c0,0.01 0,0.01 0,0.02L13.32,20.72zM10.68,20.7l0,0.02C10.69,20.72 10.69,20.71 10.68,20.7zM10.62,20.25h2.76l0.37,-2.55l0.53,-0.22c0.44,-0.18 0.88,-0.44 1.34,-0.78l0.45,-0.34l2.38,0.96l1.38,-2.4l-2.03,-1.58l0.07,-0.56c0.03,-0.26 0.06,-0.51 0.06,-0.78c0,-0.27 -0.03,-0.53 -0.06,-0.78l-0.07,-0.56l2.03,-1.58l-1.39,-2.4l-2.39,0.96l-0.45,-0.35c-0.42,-0.32 -0.87,-0.58 -1.33,-0.77L13.75,6.3l-0.37,-2.55h-2.76L10.25,6.3L9.72,6.51C9.28,6.7 8.84,6.95 8.38,7.3L7.93,7.63L5.55,6.68L4.16,9.07l2.03,1.58l-0.07,0.56C6.09,11.47 6.06,11.74 6.06,12c0,0.26 0.02,0.53 0.06,0.78l0.07,0.56l-2.03,1.58l1.38,2.4l2.39,-0.96l0.45,0.35c0.43,0.33 0.86,0.58 1.33,0.77l0.53,0.22L10.62,20.25zM18.22,17.72c0,0.01 -0.01,0.02 -0.01,0.03L18.22,17.72zM5.77,17.71l0.01,0.02C5.78,17.72 5.77,17.71 5.77,17.71zM3.93,9.47L3.93,9.47C3.93,9.47 3.93,9.47 3.93,9.47zM18.22,6.27c0,0.01 0.01,0.02 0.01,0.02L18.22,6.27zM5.79,6.25L5.78,6.27C5.78,6.27 5.79,6.26 5.79,6.25zM13.31,3.28c0,0.01 0,0.01 0,0.02L13.31,3.28zM10.69,3.26l0,0.02C10.69,3.27 10.69,3.27 10.69,3.26z"/>
+    <path
+        android:fillColor="#FFFFFFFF"
+        android:pathData="M12,12m-3.5,0a3.5,3.5 0,1 1,7 0a3.5,3.5 0,1 1,-7 0"/>
+</vector>
diff --git a/res/drawable/ic_settings_night_display.xml b/res/drawable/ic_settings_night_display.xml
index 3292ed4..4cd1347 100644
--- a/res/drawable/ic_settings_night_display.xml
+++ b/res/drawable/ic_settings_night_display.xml
@@ -21,5 +21,5 @@
         android:viewportWidth="24">
     <path
         android:fillColor="#FF000000"
-        android:pathData="M15.5,22c1.05,0 2.05,-0.16 3,-0.46c-4.06,-1.27 -7,-5.06 -7,-9.54s2.94,-8.27 7,-9.54C17.55,2.16 16.55,2 15.5,2c-5.52,0 -10,4.48 -10,10S9.98,22 15.5,22L15.5,22z"/>
+        android:pathData="M6.28,4.81c0,0.16 0.01,0.32 0.02,0.48c0.38,6.58 5.83,12.03 12.41,12.41c0.16,0.01 0.32,0.02 0.47,0.02c-1.58,1.2 -3.53,1.88 -5.56,1.88c-0.46,0 -0.93,-0.03 -1.4,-0.1c-3.96,-0.58 -7.13,-3.75 -7.71,-7.71C4.13,9.24 4.8,6.75 6.28,4.81M8.27,0.6c-0.08,0 -0.17,0.02 -0.25,0.07c-3.8,2.2 -6.2,6.56 -5.49,11.4c0.7,4.82 4.59,8.7 9.4,9.4c0.57,0.08 1.13,0.12 1.69,0.12c4.15,0 7.78,-2.26 9.72,-5.62c0.2,-0.35 -0.07,-0.76 -0.44,-0.76c-0.05,0 -0.1,0.01 -0.15,0.02c-1.03,0.31 -2.12,0.48 -3.25,0.48c-0.22,0 -0.44,-0.01 -0.67,-0.02C13.23,15.38 8.62,10.77 8.29,5.17C8.21,3.81 8.38,2.49 8.75,1.26C8.86,0.91 8.59,0.6 8.27,0.6L8.27,0.6z"/>
 </vector>
diff --git a/res/drawable/ic_system_update.xml b/res/drawable/ic_system_update.xml
deleted file mode 100644
index 3325fdd..0000000
--- a/res/drawable/ic_system_update.xml
+++ /dev/null
@@ -1,25 +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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:width="24dp"
-        android:height="24dp"
-        android:viewportWidth="24.0"
-        android:viewportHeight="24.0"
-        android:tint="?android:attr/colorControlNormal">
-    <path
-        android:fillColor="#FFFFFFFF"
-        android:pathData="M17,1.01L7,1C5.9,1 5,1.9 5,3v18c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V3C19,1.9 18.1,1.01 17,1.01zM17,21H7l0,-1h10V21zM17,18H7V6h10V18zM7,4V3h10v1H7zM16,12.5l-4,4l-4,-4l1.41,-1.41L11,12.67V8.5V8h2v0.5v4.17l1.59,-1.59L16,12.5z"/>
-</vector>
diff --git a/res/drawable/ic_system_update_vd_theme_24.xml b/res/drawable/ic_system_update_vd_theme_24.xml
deleted file mode 100644
index d1fc061..0000000
--- a/res/drawable/ic_system_update_vd_theme_24.xml
+++ /dev/null
@@ -1,25 +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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:width="24dp"
-        android:height="24dp"
-        android:viewportWidth="24.0"
-        android:viewportHeight="24.0"
-        android:tint="?android:attr/colorControlNormal">
-    <path
-        android:fillColor="@android:color/white"
-        android:pathData="M17,1.01L7,1C5.9,1 5,1.9 5,3v18c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V3C19,1.9 18.1,1.01 17,1.01zM17,21H7l0,-1h10V21zM17,18H7V6h10V18zM7,4V3h10v1H7zM16,12.5l-4,4l-4,-4l1.41,-1.41L11,12.67V8.5V8h2v0.5v4.17l1.59,-1.59L16,12.5z"/>
-</vector>
diff --git a/res/drawable/progress_indeterminate_horizontal_material_trimmed.xml b/res/drawable/progress_indeterminate_horizontal_material_trimmed.xml
deleted file mode 100644
index 070b9a1..0000000
--- a/res/drawable/progress_indeterminate_horizontal_material_trimmed.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2015 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.
--->
-
-<!-- Variant of progress_indeterminate_horizontal_material in frameworks/base/core/res, which
-     draws the whole height of the progress bar instead having blank space above and below the
-     bar. -->
-<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
-    android:drawable="@drawable/vector_drawable_progress_indeterminate_horizontal_trimmed" >
-    <target
-        android:name="rect2_grp"
-        android:animation="@*android:anim/progress_indeterminate_horizontal_rect2" />
-    <target
-        android:name="rect1_grp"
-        android:animation="@*android:anim/progress_indeterminate_horizontal_rect1" />
-</animated-vector>
diff --git a/res/drawable/vector_drawable_progress_indeterminate_horizontal_trimmed.xml b/res/drawable/vector_drawable_progress_indeterminate_horizontal_trimmed.xml
deleted file mode 100644
index 39e3a37..0000000
--- a/res/drawable/vector_drawable_progress_indeterminate_horizontal_trimmed.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2015 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.
--->
-
-<!-- Variant of vector_drawable_progress_indeterminate_horizontal in frameworks/base/core/res, which
-     draws the whole height of the progress bar instead having blank space above and below the
-     bar. -->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-    android:height="10dp"
-    android:width="360dp"
-    android:viewportHeight="10"
-    android:viewportWidth="360" >
-    <group
-        android:name="progress_group"
-        android:translateX="180"
-        android:translateY="5" >
-        <path
-            android:name="background_track"
-            android:pathData="M -180.0,-5.0 l 360.0,0 l 0,10.0 l -360.0,0 Z"
-            android:fillColor="?android:attr/colorControlActivated"
-            android:fillAlpha="?android:attr/disabledAlpha"/>
-        <group
-            android:name="rect2_grp"
-            android:translateX="-197.60001"
-            android:scaleX="0.1" >
-            <path
-                android:name="rect2"
-                android:pathData="M -144.0,-5.0 l 288.0,0 l 0,10.0 l -288.0,0 Z"
-                android:fillColor="?android:attr/colorControlActivated" />
-        </group>
-        <group
-            android:name="rect1_grp"
-            android:translateX="-522.59998"
-            android:scaleX="0.1" >
-            <path
-                android:name="rect1"
-                android:pathData="M -144.0,-5.0 l 288.0,0 l 0,10.0 l -288.0,0 Z"
-                android:fillColor="?android:attr/colorControlActivated" />
-        </group>
-    </group>
-</vector>
diff --git a/res/layout-land/storage_summary_donut.xml b/res/layout-land/storage_summary_donut.xml
index f43737a..db91547 100644
--- a/res/layout-land/storage_summary_donut.xml
+++ b/res/layout-land/storage_summary_donut.xml
@@ -18,7 +18,6 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:background="?android:attr/colorPrimary"
     android:gravity="center_vertical"
     android:orientation="horizontal" >
 
diff --git a/res/layout-sw360dp/homepage_condition_full_tile.xml b/res/layout-sw360dp/homepage_condition_full_tile.xml
deleted file mode 100644
index e1c7b01..0000000
--- a/res/layout-sw360dp/homepage_condition_full_tile.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-     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.
--->
-
-<com.google.android.material.card.MaterialCardView
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    style="@style/ContextualCardStyle">
-
-    <LinearLayout
-        android:id="@+id/content"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:paddingStart="@dimen/homepage_card_padding_start"
-        android:paddingEnd="@dimen/homepage_full_card_padding_end"
-        android:paddingTop="@dimen/homepage_condition_full_card_padding_top"
-        android:paddingBottom="@dimen/homepage_condition_full_card_padding_bottom"
-        android:orientation="horizontal"
-        android:gravity="center_vertical">
-
-        <ImageView
-            android:id="@android:id/icon"
-            android:layout_width="@dimen/homepage_card_icon_size"
-            android:layout_height="@dimen/homepage_card_icon_size"
-            android:tint="?android:attr/colorAccent"/>
-
-        <LinearLayout
-            android:layout_width="0dp"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:paddingStart="@dimen/homepage_condition_full_card_padding_start"
-            android:paddingEnd="@dimen/homepage_condition_full_card_padding_end"
-            android:orientation="vertical">
-
-            <TextView
-                android:id="@android:id/title"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginBottom="@dimen/homepage_condition_card_title_margin_bottom"
-                android:textAppearance="@style/TextAppearance.ConditionCardTitle"/>
-
-            <TextView
-                android:id="@android:id/summary"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:textAppearance="@style/TextAppearance.ConditionCardSummary"/>
-
-        </LinearLayout>
-
-        <include layout="@layout/vertical_divider"/>
-
-        <Button
-            android:id="@+id/first_action"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            style="@style/ConditionFullCardBorderlessButton"/>
-
-    </LinearLayout>
-
-</com.google.android.material.card.MaterialCardView>
diff --git a/res/layout-sw360dp/storage_summary_donut.xml b/res/layout-sw360dp/storage_summary_donut.xml
index f43737a..db91547 100644
--- a/res/layout-sw360dp/storage_summary_donut.xml
+++ b/res/layout-sw360dp/storage_summary_donut.xml
@@ -18,7 +18,6 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:background="?android:attr/colorPrimary"
     android:gravity="center_vertical"
     android:orientation="horizontal" >
 
diff --git a/res/layout/card_preference_layout.xml b/res/layout/card_preference_layout.xml
index d4a06d6..bcaeb86 100644
--- a/res/layout/card_preference_layout.xml
+++ b/res/layout/card_preference_layout.xml
@@ -25,6 +25,10 @@
         android:layout_height="wrap_content"
         android:layout_margin="8dp"
         style="@style/ContextualCardStyle">
-        <include layout="@layout/preference_material" />
+        <include
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="-8dp"
+            layout="@layout/preference_material" />
     </com.google.android.material.card.MaterialCardView>
 </FrameLayout>
diff --git a/res/layout/homepage_condition_full_tile.xml b/res/layout/homepage_condition_full_tile.xml
index 2de1464..3d261ca 100644
--- a/res/layout/homepage_condition_full_tile.xml
+++ b/res/layout/homepage_condition_full_tile.xml
@@ -22,18 +22,20 @@
     style="@style/ContextualCardStyle">
 
     <LinearLayout
-        android:id="@+id/content"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:paddingTop="@dimen/homepage_condition_half_card_padding_top"
         android:orientation="vertical">
 
         <LinearLayout
+            android:id="@+id/content"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:paddingStart="@dimen/homepage_card_padding_start"
-            android:paddingEnd="@dimen/homepage_card_padding_end"
-            android:orientation="vertical">
+            android:paddingEnd="@dimen/homepage_full_card_padding_end"
+            android:paddingTop="@dimen/homepage_condition_full_card_padding_top"
+            android:paddingBottom="@dimen/homepage_condition_full_card_padding_bottom"
+            android:orientation="horizontal"
+            android:gravity="center_vertical">
 
             <ImageView
                 android:id="@android:id/icon"
@@ -41,35 +43,45 @@
                 android:layout_height="@dimen/homepage_card_icon_size"
                 android:tint="?android:attr/colorAccent"/>
 
-            <TextView
-                android:id="@android:id/title"
-                android:layout_width="match_parent"
+            <LinearLayout
+                android:layout_width="0dp"
                 android:layout_height="wrap_content"
-                android:maxLines="1"
-                android:ellipsize="end"
-                android:layout_marginTop="@dimen/homepage_condition_half_card_title_margin_top"
-                android:layout_marginBottom="@dimen/homepage_condition_card_title_margin_bottom"
-                android:textAppearance="@style/TextAppearance.ConditionCardTitle"/>
+                android:layout_weight="1"
+                android:paddingStart="@dimen/homepage_condition_full_card_padding_start"
+                android:paddingEnd="@dimen/homepage_condition_full_card_padding_end"
+                android:orientation="vertical">
 
-            <TextView
-                android:id="@android:id/summary"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:maxLines="1"
-                android:ellipsize="end"
-                android:layout_marginBottom="@dimen/homepage_condition_half_card_summary_margin_bottom"
-                android:textAppearance="@style/TextAppearance.ConditionCardSummary"/>
+                <TextView
+                    android:id="@android:id/title"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginBottom="@dimen/homepage_condition_card_title_margin_bottom"
+                    android:textAppearance="@style/TextAppearance.ConditionCardTitle"/>
 
-            <include layout="@layout/horizontal_divider"/>
+                <TextView
+                    android:id="@android:id/summary"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:textAppearance="@style/TextAppearance.ConditionCardSummary"/>
+
+            </LinearLayout>
 
         </LinearLayout>
+
+        <FrameLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="12dp"
+            android:layout_marginEnd="12dp">
+            <include
+                layout="@layout/horizontal_divider"/>
+        </FrameLayout>
+
         <Button
             android:id="@+id/first_action"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:scrollbars="none"
-            style="@style/ConditionHalfCardBorderlessButton"/>
-
+            style="@style/ConditionFullCardBorderlessButton"/>
     </LinearLayout>
 
 </com.google.android.material.card.MaterialCardView>
diff --git a/res/layout/homepage_condition_half_tile.xml b/res/layout/homepage_condition_half_tile.xml
index 8f5af02..308b3a6 100644
--- a/res/layout/homepage_condition_half_tile.xml
+++ b/res/layout/homepage_condition_half_tile.xml
@@ -55,14 +55,22 @@
                 android:id="@android:id/summary"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:maxLines="1"
+                android:lines="2"
                 android:ellipsize="end"
                 android:layout_marginBottom="@dimen/homepage_condition_half_card_summary_margin_bottom"
                 android:textAppearance="@style/TextAppearance.ConditionCardSummary"/>
 
-            <include layout="@layout/horizontal_divider"/>
-
         </LinearLayout>
+
+        <FrameLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="12dp"
+            android:layout_marginEnd="12dp">
+            <include
+                layout="@layout/horizontal_divider"/>
+        </FrameLayout>
+
         <Button
             android:id="@+id/first_action"
             android:layout_width="match_parent"
diff --git a/res/layout/preference_app_restrictions.xml b/res/layout/preference_app_restrictions.xml
index 65fd06c..698f1ed 100644
--- a/res/layout/preference_app_restrictions.xml
+++ b/res/layout/preference_app_restrictions.xml
@@ -83,7 +83,7 @@
         android:layout_height="fill_parent"
         android:paddingStart="12dip"
         android:paddingEnd="12dp"
-        android:src="@drawable/ic_settings"
+        android:src="@drawable/ic_settings_accent"
         android:contentDescription="@string/apps_with_restrictions_settings_button"
         android:layout_gravity="center"
         android:clickable="true"
diff --git a/res/layout/preference_widget_gear.xml b/res/layout/preference_widget_gear.xml
index f533dcf..11870ac 100644
--- a/res/layout/preference_widget_gear.xml
+++ b/res/layout/preference_widget_gear.xml
@@ -25,6 +25,6 @@
     android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
     android:background="?android:attr/selectableItemBackground"
     android:scaleType="center"
-    android:src="@drawable/ic_settings"
+    android:src="@drawable/ic_settings_accent"
     android:contentDescription="@string/settings_button" />
 
diff --git a/res/layout/preference_widget_gear_no_bg.xml b/res/layout/preference_widget_gear_no_bg.xml
index 89d34d4..6a26fc8 100644
--- a/res/layout/preference_widget_gear_no_bg.xml
+++ b/res/layout/preference_widget_gear_no_bg.xml
@@ -22,6 +22,6 @@
     android:layout_height="match_parent"
     android:layout_gravity="center"
     android:scaleType="center"
-    android:src="@drawable/ic_settings"
+    android:src="@drawable/ic_settings_accent"
     android:contentDescription="@string/settings_button" />
 
diff --git a/res/layout/preference_widget_gear_optional_background.xml b/res/layout/preference_widget_gear_optional_background.xml
index d02f638..0c826df 100644
--- a/res/layout/preference_widget_gear_optional_background.xml
+++ b/res/layout/preference_widget_gear_optional_background.xml
@@ -25,7 +25,7 @@
         android:layout_height="match_parent"
         android:layout_gravity="center"
         android:scaleType="center"
-        android:src="@drawable/ic_settings"
+        android:src="@drawable/ic_settings_accent"
         android:contentDescription="@string/settings_button" />
     <!-- Additional overdraw background to stop parent's material ripple -->
     <FrameLayout
@@ -42,7 +42,7 @@
             android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
             android:background="?android:attr/selectableItemBackground"
             android:scaleType="center"
-            android:src="@drawable/ic_settings"
+            android:src="@drawable/ic_settings_accent"
             android:contentDescription="@string/settings_button" />
     </FrameLayout>
 </FrameLayout>
diff --git a/res/layout/restricted_preference_user_delete_widget.xml b/res/layout/restricted_preference_user_delete_widget.xml
index 7bafacc..71f1dd7 100644
--- a/res/layout/restricted_preference_user_delete_widget.xml
+++ b/res/layout/restricted_preference_user_delete_widget.xml
@@ -35,7 +35,7 @@
             android:layout_height="fill_parent"
             android:paddingStart="16dip"
             android:paddingEnd="16dip"
-            android:src="@drawable/ic_settings"
+            android:src="@drawable/ic_settings_accent"
             android:contentDescription="@string/settings_label"
             android:layout_gravity="center"
             android:background="?android:attr/selectableItemBackground" />
diff --git a/res/layout/storage_summary_donut.xml b/res/layout/storage_summary_donut.xml
index 1637189..88f5b36 100644
--- a/res/layout/storage_summary_donut.xml
+++ b/res/layout/storage_summary_donut.xml
@@ -17,7 +17,6 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:background="?android:attr/colorPrimary"
     android:gravity="center"
     android:orientation="vertical"
     android:paddingTop="32dp"
diff --git a/res/layout/wifi_display_preference.xml b/res/layout/wifi_display_preference.xml
index 99cb89c..4532441 100644
--- a/res/layout/wifi_display_preference.xml
+++ b/res/layout/wifi_display_preference.xml
@@ -37,7 +37,7 @@
         android:layout_gravity="center_vertical"
         android:padding="8dip"
         android:background="?android:attr/selectableItemBackground"
-        android:src="@drawable/ic_settings"
+        android:src="@drawable/ic_settings_accent"
         android:contentDescription="@string/wifi_display_details" />
 
 </LinearLayout>
diff --git a/res/layout/wifi_progress_header.xml b/res/layout/wifi_progress_header.xml
deleted file mode 100644
index 3f5d428..0000000
--- a/res/layout/wifi_progress_header.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-    Copyright (C) 2015 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.
--->
-
-<FrameLayout
-    android:layout_width="match_parent"
-    android:layout_height="3dp"
-    xmlns:android="http://schemas.android.com/apk/res/android">
-    <View
-        android:id="@+id/progress_bar_background"
-        style="@style/TrimmedHorizontalProgressBar"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:background="?android:attr/colorSecondary" />
-    <ProgressBar
-        android:id="@+id/progress_bar_animation"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        style="@style/TrimmedHorizontalProgressBar"
-        android:indeterminate="true" />
-</FrameLayout>
diff --git a/res/values-night/colors.xml b/res/values-night/colors.xml
index cdbeada..617feb3 100644
--- a/res/values-night/colors.xml
+++ b/res/values-night/colors.xml
@@ -23,6 +23,7 @@
   <color name="homepage_support_background">#3F5FBD</color>
   <!-- 80% black for status bar of homepage -->
   <color name="homepage_status_bar_color">#cc000000</color>
-  <color name="homepage_card_dismissal_background">@*android:color/material_grey_800</color>
+  <color name="homepage_card_dismissal_background">@*android:color/material_grey_900</color>
+  <color name="contextual_card_background">@*android:color/material_grey_900</color>
 </resources>
 
diff --git a/res/values/colors.xml b/res/values/colors.xml
index f6723a8..a10d1d7 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -100,8 +100,10 @@
     <color name="homepage_location_background">#2EC7DC</color>
     <color name="homepage_about_background">#9FA8DA</color>
     <color name="homepage_privacy_background">#5E97F6</color>
+
     <color name="homepage_card_stroke_color">#1f000000</color>
     <color name="homepage_card_dismissal_background">@*android:color/material_grey_50</color>
+    <color name="contextual_card_background">@*android:color/background_device_default_light</color>
     <!-- End of dashboard/homepage icon background colors -->
 
     <color name="switchbar_text_color">@android:color/white</color>
diff --git a/res/values/config.xml b/res/values/config.xml
index 3023067..c2899ef 100755
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -353,4 +353,7 @@
 
     <!-- Whether or not extra preview panels should be used for screen zoom setting. -->
     <bool name="config_enable_extra_screen_zoom_preview">true</bool>
+
+    <!-- Slice Uri to query nearby devices. -->
+    <string name="config_nearby_devices_slice_uri" translatable="false">content://com.google.android.gms.nearby.fastpair/device_status_list_item</string>
 </resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index d42f073..963d19f 100755
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -368,8 +368,8 @@
     <dimen name="homepage_condition_half_card_padding_top">12dp</dimen>
     <dimen name="homepage_condition_half_card_title_margin_top">12dp</dimen>
     <dimen name="homepage_condition_half_card_summary_margin_bottom">12dp</dimen>
-    <dimen name="homepage_condition_full_card_padding_start">24dp</dimen>
-    <dimen name="homepage_condition_full_card_padding_end">24dp</dimen>
+    <dimen name="homepage_condition_full_card_padding_start">12dp</dimen>
+    <dimen name="homepage_condition_full_card_padding_end">16dp</dimen>
     <dimen name="homepage_condition_full_card_padding_top">12dp</dimen>
     <dimen name="homepage_condition_full_card_padding_bottom">12dp</dimen>
     <dimen name="homepage_condition_header_padding_top">10dp</dimen>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 1949ac6..281389d 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -6857,10 +6857,10 @@
     <!-- Wizard finish button label [CHAR LIMIT=25] -->
     <string name="wizard_finish">Finish</string>
 
-    <!-- An option in a photo selection dialog, if there is no photo yet [CHAR LIMIT=50] -->
-    <string name="user_image_take_photo" msgid="7496128293167402354">Take photo</string>
-    <!-- An option in a photo selection dialog, if there is no photo yet [CHAR LIMIT=50] -->
-    <string name="user_image_choose_photo" msgid="3746334626214970837">Choose photo from Gallery</string>
+    <!-- An option in a photo selection dialog to take a new photo [CHAR LIMIT=50] -->
+    <string name="user_image_take_photo" msgid="7496128293167402354">Take a photo</string>
+    <!-- An option in a photo selection dialog to choose a pre-existing image [CHAR LIMIT=50] -->
+    <string name="user_image_choose_photo" msgid="3746334626214970837">Choose an image</string>
     <!-- Accessibility message for the photo selector which is a button/popup with the current photo [CHAR LIMIT=50] -->
     <string name="user_image_photo_selector">Select photo</string>
 
@@ -7078,7 +7078,7 @@
     <string name="keywords_display_auto_brightness">dim screen, touchscreen, battery, smart brightness, dynamic brightness</string>
 
     <!-- Search keywords for adaptive sleep setting [CHAR LIMIT=NONE]-->
-    <string name="keywords_display_adaptive_sleep">dim screen, sleep, battery, timeout, attention</string>
+    <string name="keywords_display_adaptive_sleep">dim screen, sleep, battery, timeout, attention, display, screen, inactivity</string>
 
     <!-- List of synonyms for the auto rotate (rotate the virtual display when the device rotates) setting, used to match in settings search [CHAR LIMIT=NONE] -->
     <string name="keywords_auto_rotate">rotate, flip, rotation, portrait, landscape, orientation, vertical, horizontal</string>
@@ -10503,6 +10503,9 @@
     <string name="preferred_network_mode_dialogtitle">Preferred network type</string>
     <!-- Mobile network settings screen, name of the option to manage carrier profiles on devices which support embedded carrier profiles [CHAR LIMIT=NONE] -->
     <string name="carrier_settings_euicc">Carrier</string>
+    <!-- Mobile network settings screen, a string showing the version of carrier settings for this
+         subscription [CHAR LIMIT=NONE] -->
+    <string name="carrier_settings_version">Settings version</string>
 
     <!-- Mobile network settings screen, name for call settings category [CHAR LIMIT=NONE] -->
     <string name="call_category">Calling</string>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 84c8831..323d39b 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -82,15 +82,6 @@
         <item name="android:scrollbarStyle">outsideOverlay</item>
     </style>
 
-    <style name="TrimmedHorizontalProgressBar"
-           parent="android:Widget.Material.ProgressBar.Horizontal">
-        <item name="android:indeterminateDrawable">
-            @drawable/progress_indeterminate_horizontal_material_trimmed
-        </item>
-        <item name="android:minHeight">3dip</item>
-        <item name="android:maxHeight">3dip</item>
-    </style>
-
     <style name="bt_item">
         <item name="android:layout_width">match_parent</item>
         <item name="android:layout_height">wrap_content</item>
@@ -286,6 +277,7 @@
 
     <style name="TextAppearance.ConditionCardTitle"
            parent="@*android:style/TextAppearance.DeviceDefault.Subhead">
+        <item name="android:fontFamily">@*android:string/config_headlineFontFamilyMedium</item>
         <item name="android:textSize">16sp</item>
     </style>
 
@@ -419,6 +411,7 @@
         <item name="android:layout_marginBottom">@dimen/homepage_card_vertical_margin</item>
         <item name="android:layout_marginStart">@dimen/homepage_card_side_margin</item>
         <item name="android:layout_marginEnd">@dimen/homepage_card_side_margin</item>
+        <item name="cardBackgroundColor">@color/contextual_card_background</item>
         <item name="cardCornerRadius">@*android:dimen/config_dialogCornerRadius</item>
         <item name="cardElevation">0dp</item>
         <item name="strokeColor">@color/homepage_card_stroke_color</item>
@@ -448,8 +441,9 @@
 
     <style name="ConditionFullCardBorderlessButton"
            parent="@style/ConditionCardBorderlessButton">
-        <item name="android:minWidth">24dp</item>
-        <item name="android:layout_marginStart">20dp</item>
+        <item name="android:textAlignment">viewStart</item>
+        <item name="android:paddingStart">50dp</item>
+        <item name="android:paddingEnd">50dp</item>
     </style>
 
     <style name="ContextualCardDismissalButton"
diff --git a/res/xml/connected_devices.xml b/res/xml/connected_devices.xml
index 29c9e01..ae88d36 100644
--- a/res/xml/connected_devices.xml
+++ b/res/xml/connected_devices.xml
@@ -20,6 +20,12 @@
     android:key="connected_devices_screen"
     android:title="@string/connected_devices_dashboard_title">
 
+    <com.android.settings.slices.SlicePreference
+        android:key="bt_nearby_slice"
+        android:title="@string/summary_placeholder"
+        settings:controller="com.android.settings.slices.SlicePreferenceController"
+        settings:allowDividerBelow="true"/>
+
     <PreferenceCategory
         android:key="available_device_list"
         android:title="@string/connected_device_available_media_title"
diff --git a/res/xml/mobile_network_settings.xml b/res/xml/mobile_network_settings.xml
index c6eb3e7..16484f3 100644
--- a/res/xml/mobile_network_settings.xml
+++ b/res/xml/mobile_network_settings.xml
@@ -77,7 +77,8 @@
 
     <PreferenceCategory
         android:key="calling_category"
-        android:title="@string/call_category">
+        android:title="@string/call_category"
+        settings:searchable="false">
 
         <PreferenceScreen
             android:key="wifi_calling_key"
diff --git a/res/xml/mobile_network_settings_v2.xml b/res/xml/mobile_network_settings_v2.xml
index f269fad..c3bb656 100644
--- a/res/xml/mobile_network_settings_v2.xml
+++ b/res/xml/mobile_network_settings_v2.xml
@@ -98,6 +98,12 @@
         android:title="@string/carrier_settings_euicc"
         settings:controller="com.android.settings.network.telephony.EuiccPreferenceController" />
 
+    <Preference
+        android:key="carrier_settings_version_key"
+        android:title="@string/carrier_settings_version"
+        settings:controller="com.android.settings.network.telephony.CarrierSettingsVersionPreferenceController"
+        settings:enableCopying="true" />
+
     <PreferenceCategory
         android:key="calling_category"
         android:title="@string/call_category">
diff --git a/res/xml/security_lockscreen_settings.xml b/res/xml/security_lockscreen_settings.xml
index c5765d3..6833922 100644
--- a/res/xml/security_lockscreen_settings.xml
+++ b/res/xml/security_lockscreen_settings.xml
@@ -60,6 +60,12 @@
             settings:controller="com.android.settings.display.AmbientDisplayAlwaysOnPreferenceController" />
 
         <Preference
+            android:key="ambient_display_wake_screen"
+            android:title="@string/ambient_display_wake_screen_title"
+            android:fragment="com.android.settings.gestures.WakeScreenGestureSettings"
+            settings:controller="com.android.settings.gestures.WakeScreenGesturePreferenceController" />
+
+        <Preference
             android:key="ambient_display_tap"
             android:title="@string/ambient_display_tap_screen_title"
             android:fragment="com.android.settings.gestures.TapScreenGestureSettings"
@@ -77,12 +83,6 @@
             android:fragment="com.android.settings.gestures.PickupGestureSettings"
             settings:controller="com.android.settings.gestures.PickupGesturePreferenceController" />
 
-        <Preference
-            android:key="ambient_display_wake_screen"
-            android:title="@string/ambient_display_wake_screen_title"
-            android:fragment="com.android.settings.gestures.WakeScreenGestureSettings"
-            settings:controller="com.android.settings.gestures.WakeScreenGesturePreferenceController" />
-
         <SwitchPreference
             android:key="ambient_display_notification"
             android:title="@string/doze_title"
diff --git a/res/xml/storage_dashboard_fragment.xml b/res/xml/storage_dashboard_fragment.xml
index 3f2e55f..c4bd11d 100644
--- a/res/xml/storage_dashboard_fragment.xml
+++ b/res/xml/storage_dashboard_fragment.xml
@@ -66,7 +66,7 @@
     <com.android.settings.deviceinfo.StorageItemPreference
         android:key="pref_system"
         android:title="@string/storage_detail_system"
-        android:icon="@drawable/ic_system_update_vd_theme_24"
+        android:icon="@drawable/ic_system_update"
         android:order="100" />
     <PreferenceCategory
         android:key="pref_secondary_users"
diff --git a/src/com/android/settings/MasterClear.java b/src/com/android/settings/MasterClear.java
index 8dad57f..58bc58c 100644
--- a/src/com/android/settings/MasterClear.java
+++ b/src/com/android/settings/MasterClear.java
@@ -65,10 +65,10 @@
 import com.android.settings.password.ConfirmLockPattern;
 import com.android.settingslib.RestrictedLockUtilsInternal;
 
-import com.google.android.setupcompat.TemplateLayout;
 import com.google.android.setupcompat.template.FooterBarMixin;
 import com.google.android.setupcompat.template.FooterButton;
 import com.google.android.setupcompat.template.FooterButton.ButtonType;
+import com.google.android.setupdesign.GlifLayout;
 
 import java.util.List;
 
@@ -416,7 +416,7 @@
             return;
         }
 
-        final TemplateLayout layout = mContentView.findViewById(R.id.setup_wizard_layout);
+        final GlifLayout layout = mContentView.findViewById(R.id.setup_wizard_layout);
         final FooterBarMixin mixin = layout.getMixin(FooterBarMixin.class);
         mixin.setPrimaryButton(
                 new FooterButton.Builder(getActivity())
diff --git a/src/com/android/settings/MasterClearConfirm.java b/src/com/android/settings/MasterClearConfirm.java
index c25f2af..618dd2c 100644
--- a/src/com/android/settings/MasterClearConfirm.java
+++ b/src/com/android/settings/MasterClearConfirm.java
@@ -44,10 +44,10 @@
 import com.android.settings.enterprise.ActionDisabledByAdminDialogHelper;
 import com.android.settingslib.RestrictedLockUtilsInternal;
 
-import com.google.android.setupcompat.TemplateLayout;
 import com.google.android.setupcompat.template.FooterBarMixin;
 import com.google.android.setupcompat.template.FooterButton;
 import com.google.android.setupcompat.template.FooterButton.ButtonType;
+import com.google.android.setupdesign.GlifLayout;
 
 /**
  * Confirm and execute a reset of the device to a clean "just out of the box"
@@ -152,7 +152,7 @@
      * Configure the UI for the final confirmation interaction
      */
     private void establishFinalConfirmationState() {
-        final TemplateLayout layout = mContentView.findViewById(R.id.setup_wizard_layout);
+        final GlifLayout layout = mContentView.findViewById(R.id.setup_wizard_layout);
 
         final FooterBarMixin mixin = layout.getMixin(FooterBarMixin.class);
         mixin.setPrimaryButton(
diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index e7f543a..ae4ae2a 100644
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -156,6 +156,7 @@
     }
     public static class WebViewAppPickerActivity extends SettingsActivity { /* empty */ }
     public static class AdvancedConnectedDeviceActivity extends SettingsActivity { /* empty */ }
+    public static class BluetoothDeviceDetailActivity extends SettingsActivity { /* empty */ }
 
     // Top level categories for new IA
     public static class NetworkDashboardActivity extends SettingsActivity {}
diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java
index 93a785f..65cfdf6 100644
--- a/src/com/android/settings/Utils.java
+++ b/src/com/android/settings/Utils.java
@@ -71,6 +71,7 @@
 import android.provider.ContactsContract.Profile;
 import android.provider.ContactsContract.RawContacts;
 import android.provider.Settings;
+import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
 import android.text.Spannable;
 import android.text.SpannableString;
@@ -958,6 +959,22 @@
     }
 
     /**
+     * Converts the {@link Drawable} to a {@link Bitmap}.
+     */
+    public static Bitmap drawableToBitmap(Drawable drawable) {
+        if (drawable instanceof BitmapDrawable) {
+            return ((BitmapDrawable)drawable).getBitmap();
+        }
+
+        final Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(),
+                drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
+        final Canvas canvas = new Canvas(bitmap);
+        drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
+        drawable.draw(canvas);
+        return bitmap;
+    }
+
+    /**
      * Get the {@link Drawable} that represents the app icon
      */
     public static Drawable getBadgedIcon(IconDrawableFactory iconDrawableFactory,
@@ -980,4 +997,13 @@
         }
         return false;
     }
+
+    /** Get {@link Resources} by subscription id if subscription id is valid. */
+    public static Resources getResourcesForSubId(Context context, int subId) {
+        if (subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
+            return SubscriptionManager.getResourcesForSubId(context, subId);
+        } else {
+            return context.getResources();
+        }
+    }
 }
diff --git a/src/com/android/settings/accessibility/AccessibilityHearingAidPreferenceController.java b/src/com/android/settings/accessibility/AccessibilityHearingAidPreferenceController.java
index 617a9bb..1881ca7 100644
--- a/src/com/android/settings/accessibility/AccessibilityHearingAidPreferenceController.java
+++ b/src/com/android/settings/accessibility/AccessibilityHearingAidPreferenceController.java
@@ -148,7 +148,8 @@
         mFragmentManager = fragmentManager;
     }
 
-    private CachedBluetoothDevice getConnectedHearingAidDevice() {
+    @VisibleForTesting
+    CachedBluetoothDevice getConnectedHearingAidDevice() {
         if (!mHearingAidProfileSupported) {
             return null;
         }
@@ -158,9 +159,11 @@
         final List<BluetoothDevice> deviceList = mLocalBluetoothManager.getProfileManager()
                 .getHearingAidProfile().getConnectedDevices();
         final Iterator it = deviceList.iterator();
-        if (it.hasNext()) {
+        while (it.hasNext()) {
             BluetoothDevice obj = (BluetoothDevice)it.next();
-            return mLocalBluetoothManager.getCachedDeviceManager().findDevice(obj);
+            if (!mLocalBluetoothManager.getCachedDeviceManager().isSubDevice(obj)) {
+                return mLocalBluetoothManager.getCachedDeviceManager().findDevice(obj);
+            }
         }
         return null;
     }
diff --git a/src/com/android/settings/biometrics/face/FaceSettings.java b/src/com/android/settings/biometrics/face/FaceSettings.java
index 4e2c711..490580d 100644
--- a/src/com/android/settings/biometrics/face/FaceSettings.java
+++ b/src/com/android/settings/biometrics/face/FaceSettings.java
@@ -58,7 +58,9 @@
     private FaceSettingsAttentionPreferenceController mAttentionController;
 
     private final FaceSettingsRemoveButtonPreferenceController.Listener mRemovalListener = () -> {
-        getActivity().finish();
+        if (getActivity() != null) {
+            getActivity().finish();
+        }
     };
 
     public static boolean isAvailable(Context context) {
diff --git a/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java b/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java
index 5c609e6..749a38f 100644
--- a/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java
+++ b/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java
@@ -45,7 +45,8 @@
  * supports, such as "Phone audio", "Media audio", "Contact sharing", etc.
  */
 public class BluetoothDetailsProfilesController extends BluetoothDetailsController
-        implements Preference.OnPreferenceClickListener {
+        implements Preference.OnPreferenceClickListener,
+        LocalBluetoothProfileManager.ServiceListener {
     private static final String KEY_PROFILES_GROUP = "bluetooth_profiles";
 
     @VisibleForTesting
@@ -87,6 +88,7 @@
         pref.setKey(profile.toString());
         pref.setTitle(profile.getNameResource(mCachedDevice.getDevice()));
         pref.setOnPreferenceClickListener(this);
+        pref.setOrder(profile.getOrdinal());
         return pref;
     }
 
@@ -221,7 +223,7 @@
         }
         BluetoothDevice device = mCachedDevice.getDevice();
         A2dpProfile a2dp = (A2dpProfile) profile;
-        if (a2dp.supportsHighQualityAudio(device)) {
+        if (a2dp.isProfileReady() && a2dp.supportsHighQualityAudio(device)) {
             SwitchPreference highQualityAudioPref = new SwitchPreference(
                     mProfilesContainer.getContext());
             highQualityAudioPref.setKey(HIGH_QUALITY_AUDIO_PREF_TAG);
@@ -235,6 +237,28 @@
         }
     }
 
+    @Override
+    public void onPause() {
+        super.onPause();
+        mProfileManager.removeServiceListener(this);
+    }
+
+    @Override
+    public void onResume() {
+        super.onResume();
+        mProfileManager.addServiceListener(this);
+    }
+
+    @Override
+    public void onServiceConnected() {
+        refresh();
+    }
+
+    @Override
+    public void onServiceDisconnected() {
+        refresh();
+    }
+
     /**
      * Refreshes the state of the switches for all profiles, possibly adding or removing switches as
      * needed.
@@ -242,7 +266,10 @@
     @Override
     protected void refresh() {
         for (LocalBluetoothProfile profile : getProfiles()) {
-            SwitchPreference pref = (SwitchPreference) mProfilesContainer.findPreference(
+            if (!profile.isProfileReady()) {
+                continue;
+            }
+            SwitchPreference pref = mProfilesContainer.findPreference(
                     profile.toString());
             if (pref == null) {
                 pref = createProfilePreference(mProfilesContainer.getContext(), profile);
@@ -252,7 +279,7 @@
             refreshProfilePreference(pref, profile);
         }
         for (LocalBluetoothProfile removedProfile : mCachedDevice.getRemovedProfiles()) {
-            SwitchPreference pref = (SwitchPreference) mProfilesContainer.findPreference(
+            final SwitchPreference pref = mProfilesContainer.findPreference(
                     removedProfile.toString());
             if (pref != null) {
                 mProfilesContainer.removePreference(pref);
diff --git a/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragment.java b/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragment.java
index 98455f2..2fbd061 100644
--- a/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragment.java
+++ b/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragment.java
@@ -107,6 +107,11 @@
         mDeviceAddress = getArguments().getString(KEY_DEVICE_ADDRESS);
         mManager = getLocalBluetoothManager(context);
         mCachedDevice = getCachedDevice(mDeviceAddress);
+        if (mCachedDevice == null) {
+            // Close this page if device is null with invalid device mac address
+            finish();
+            return;
+        }
         super.onAttach(context);
         use(AdvancedBluetoothDetailsHeaderController.class).init(mCachedDevice);
 
diff --git a/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment.java b/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment.java
index b84cc26..d5cfdcc 100644
--- a/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment.java
+++ b/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment.java
@@ -17,6 +17,7 @@
 
 import android.app.settings.SettingsEnums;
 import android.content.Context;
+import android.net.Uri;
 import android.provider.SearchIndexableResource;
 
 import androidx.annotation.VisibleForTesting;
@@ -24,6 +25,7 @@
 import com.android.settings.R;
 import com.android.settings.dashboard.DashboardFragment;
 import com.android.settings.search.BaseSearchIndexProvider;
+import com.android.settings.slices.SlicePreferenceController;
 import com.android.settingslib.core.AbstractPreferenceController;
 import com.android.settingslib.core.lifecycle.Lifecycle;
 import com.android.settingslib.search.SearchIndexable;
@@ -88,6 +90,8 @@
         use(ConnectedDeviceGroupController.class).init(this);
         use(PreviouslyConnectedDevicePreferenceController.class).init(this);
         use(DiscoverableFooterPreferenceController.class).init(this);
+        use(SlicePreferenceController.class).setSliceUri(
+                Uri.parse(getString(R.string.config_nearby_devices_slice_uri)));
     }
 
     /**
diff --git a/src/com/android/settings/datausage/AppDataUsage.java b/src/com/android/settings/datausage/AppDataUsage.java
index 998234b..8bab256 100644
--- a/src/com/android/settings/datausage/AppDataUsage.java
+++ b/src/com/android/settings/datausage/AppDataUsage.java
@@ -52,6 +52,7 @@
 import com.android.settingslib.net.UidDetail;
 import com.android.settingslib.net.UidDetailProvider;
 
+import java.util.ArrayList;
 import java.util.List;
 
 public class AppDataUsage extends DataUsageBaseFragment implements OnPreferenceChangeListener,
@@ -59,8 +60,10 @@
 
     private static final String TAG = "AppDataUsage";
 
-    public static final String ARG_APP_ITEM = "app_item";
-    public static final String ARG_NETWORK_TEMPLATE = "network_template";
+    static final String ARG_APP_ITEM = "app_item";
+    static final String ARG_NETWORK_TEMPLATE = "network_template";
+    static final String ARG_NETWORK_CYCLES = "network_cycles";
+    static final String ARG_SELECTED_CYCLE = "selected_cycle";
 
     private static final String KEY_TOTAL_USAGE = "total_usage";
     private static final String KEY_FOREGROUND_USAGE = "foreground_usage";
@@ -84,8 +87,10 @@
     private PreferenceCategory mAppList;
 
     private Drawable mIcon;
-    private CharSequence mLabel;
-    private String mPackageName;
+    @VisibleForTesting
+    CharSequence mLabel;
+    @VisibleForTesting
+    String mPackageName;
     private CycleAdapter mCycleAdapter;
 
     private List<NetworkCycleDataForUid> mUsageData;
@@ -97,6 +102,8 @@
     private RestrictedSwitchPreference mUnrestrictedData;
     private DataSaverBackend mDataSaverBackend;
     private Context mContext;
+    private ArrayList<Long> mCycles;
+    private long mSelectedCycle;
 
     @Override
     public void onCreate(Bundle icicle) {
@@ -108,6 +115,10 @@
         mAppItem = (args != null) ? (AppItem) args.getParcelable(ARG_APP_ITEM) : null;
         mTemplate = (args != null) ? (NetworkTemplate) args.getParcelable(ARG_NETWORK_TEMPLATE)
                 : null;
+        mCycles = (args != null) ? (ArrayList) args.getSerializable(ARG_NETWORK_CYCLES)
+            : null;
+        mSelectedCycle = (args != null) ? args.getLong(ARG_SELECTED_CYCLE) : 0L;
+
         if (mTemplate == null) {
             mTemplate = DataUsageUtils.getDefaultTemplate(mContext,
                     SubscriptionManager.getDefaultDataSubscriptionId());
@@ -133,29 +144,32 @@
         mForegroundUsage = findPreference(KEY_FOREGROUND_USAGE);
         mBackgroundUsage = findPreference(KEY_BACKGROUND_USAGE);
 
-        mCycle = (SpinnerPreference) findPreference(KEY_CYCLE);
+        mCycle = findPreference(KEY_CYCLE);
         mCycleAdapter = new CycleAdapter(mContext, mCycle, mCycleListener);
 
+        final UidDetailProvider uidDetailProvider = getUidDetailProvider();
+
         if (mAppItem.key > 0) {
-            if (mPackages.size() != 0) {
-                try {
-                    ApplicationInfo info = mPackageManager.getApplicationInfoAsUser(
-                            mPackages.valueAt(0), 0, UserHandle.getUserId(mAppItem.key));
-                    mIcon = IconDrawableFactory.newInstance(getActivity()).getBadgedIcon(info);
-                    mLabel = info.loadLabel(mPackageManager);
-                    mPackageName = info.packageName;
-                } catch (PackageManager.NameNotFoundException e) {
-                }
-            }
             if (!UserHandle.isApp(mAppItem.key)) {
+                final UidDetail uidDetail = uidDetailProvider.getUidDetail(mAppItem.key, true);
+                mIcon = uidDetail.icon;
+                mLabel = uidDetail.label;
                 removePreference(KEY_UNRESTRICTED_DATA);
                 removePreference(KEY_RESTRICT_BACKGROUND);
             } else {
-                mRestrictBackground = (RestrictedSwitchPreference) findPreference(
-                        KEY_RESTRICT_BACKGROUND);
+                if (mPackages.size() != 0) {
+                    try {
+                        final ApplicationInfo info = mPackageManager.getApplicationInfoAsUser(
+                            mPackages.valueAt(0), 0, UserHandle.getUserId(mAppItem.key));
+                        mIcon = IconDrawableFactory.newInstance(getActivity()).getBadgedIcon(info);
+                        mLabel = info.loadLabel(mPackageManager);
+                        mPackageName = info.packageName;
+                    } catch (PackageManager.NameNotFoundException e) {
+                    }
+                }
+                mRestrictBackground = findPreference(KEY_RESTRICT_BACKGROUND);
                 mRestrictBackground.setOnPreferenceChangeListener(this);
-                mUnrestrictedData = (RestrictedSwitchPreference) findPreference(
-                        KEY_UNRESTRICTED_DATA);
+                mUnrestrictedData = findPreference(KEY_UNRESTRICTED_DATA);
                 mUnrestrictedData.setOnPreferenceChangeListener(this);
             }
             mDataSaverBackend = new DataSaverBackend(mContext);
@@ -164,7 +178,7 @@
             mAppSettingsIntent = new Intent(Intent.ACTION_MANAGE_NETWORK_USAGE);
             mAppSettingsIntent.addCategory(Intent.CATEGORY_DEFAULT);
 
-            PackageManager pm = getPackageManager();
+            final PackageManager pm = getPackageManager();
             boolean matchFound = false;
             for (String packageName : mPackages) {
                 mAppSettingsIntent.setPackage(packageName);
@@ -179,7 +193,7 @@
             }
 
             if (mPackages.size() > 1) {
-                mAppList = (PreferenceCategory) findPreference(KEY_APP_LIST);
+                mAppList = findPreference(KEY_APP_LIST);
                 LoaderManager.getInstance(this).restartLoader(LOADER_APP_PREF, Bundle.EMPTY,
                         mAppPrefCallbacks);
             } else {
@@ -187,7 +201,7 @@
             }
         } else {
             final Context context = getActivity();
-            UidDetail uidDetail = new UidDetailProvider(context).getUidDetail(mAppItem.key, true);
+            final UidDetail uidDetail = uidDetailProvider.getUidDetail(mAppItem.key, true);
             mIcon = uidDetail.icon;
             mLabel = uidDetail.label;
             mPackageName = context.getPackageName();
@@ -257,6 +271,11 @@
         updatePrefs(getAppRestrictBackground(), getUnrestrictData());
     }
 
+    @VisibleForTesting
+    UidDetailProvider getUidDetailProvider() {
+        return new UidDetailProvider(mContext);
+    }
+
     private void updatePrefs(boolean restrictBackground, boolean unrestrictData) {
         final EnforcedAdmin admin = RestrictedLockUtilsInternal.checkIfMeteredDataRestricted(
                 mContext, mPackageName, UserHandle.getUserId(mAppItem.key));
@@ -276,7 +295,7 @@
     }
 
     private void addUid(int uid) {
-        String[] packages = getPackageManager().getPackagesForUid(uid);
+        String[] packages = mPackageManager.getPackagesForUid(uid);
         if (packages != null) {
             for (int i = 0; i < packages.length; i++) {
                 mPackages.add(packages[i]);
@@ -383,6 +402,9 @@
                 } else {
                     builder.addUid(mAppItem.key);
                 }
+                if (mCycles != null) {
+                    builder.setCycles(mCycles);
+                }
                 return builder.build();
             }
 
@@ -391,7 +413,23 @@
                     List<NetworkCycleDataForUid> data) {
                 mUsageData = data;
                 mCycleAdapter.updateCycleList(data);
-                bindData(0 /* position */);
+                if (mSelectedCycle > 0L) {
+                    final int numCycles = data.size();
+                    int position = 0;
+                    for (int i = 0; i < numCycles; i++) {
+                        final NetworkCycleDataForUid cycleData = data.get(i);
+                        if (cycleData.getEndTime() == mSelectedCycle) {
+                            position = i;
+                            break;
+                        }
+                    }
+                    if (position > 0) {
+                        mCycle.setSelection(position);
+                    }
+                    bindData(position);
+                } else {
+                    bindData(0 /* position */);
+                }
             }
 
             @Override
diff --git a/src/com/android/settings/datausage/DataUsageList.java b/src/com/android/settings/datausage/DataUsageList.java
index 735532a..e5158ff 100644
--- a/src/com/android/settings/datausage/DataUsageList.java
+++ b/src/com/android/settings/datausage/DataUsageList.java
@@ -33,6 +33,7 @@
 import android.net.NetworkPolicy;
 import android.net.NetworkTemplate;
 import android.os.Bundle;
+import android.os.Process;
 import android.os.UserHandle;
 import android.os.UserManager;
 import android.provider.Settings;
@@ -108,6 +109,7 @@
     @VisibleForTesting
     int mNetworkType;
     private List<NetworkCycleChartData> mCycleData;
+    private ArrayList<Long> mCycles;
 
     private LoadingViewController mLoadingViewController;
     private UidDetailProvider mUidDetailProvider;
@@ -362,7 +364,8 @@
                         category = AppItem.CATEGORY_USER;
                     }
                 }
-            } else if (uid == UID_REMOVED || uid == UID_TETHERING) {
+            } else if (uid == UID_REMOVED || uid == UID_TETHERING
+                    || uid == Process.OTA_UPDATE_UID) {
                 collapseKey = uid;
                 category = AppItem.CATEGORY_APP;
             } else {
@@ -409,10 +412,23 @@
         }
     }
 
-    private void startAppDataUsage(AppItem item) {
+    @VisibleForTesting
+    void startAppDataUsage(AppItem item) {
         final Bundle args = new Bundle();
         args.putParcelable(AppDataUsage.ARG_APP_ITEM, item);
         args.putParcelable(AppDataUsage.ARG_NETWORK_TEMPLATE, mTemplate);
+        if (mCycles == null) {
+            mCycles = new ArrayList<>();
+            for (NetworkCycleChartData data : mCycleData) {
+                if (mCycles.isEmpty()) {
+                    mCycles.add(data.getEndTime());
+                }
+                mCycles.add(data.getStartTime());
+            }
+        }
+        args.putSerializable(AppDataUsage.ARG_NETWORK_CYCLES, mCycles);
+        args.putLong(AppDataUsage.ARG_SELECTED_CYCLE,
+            mCycleData.get(mCycleSpinner.getSelectedItemPosition()).getEndTime());
 
         new SubSettingLauncher(getContext())
                 .setDestination(AppDataUsage.class.getName())
diff --git a/src/com/android/settings/development/BluetoothSnoopLogPreferenceController.java b/src/com/android/settings/development/BluetoothSnoopLogPreferenceController.java
index d26f0dd..d698436 100644
--- a/src/com/android/settings/development/BluetoothSnoopLogPreferenceController.java
+++ b/src/com/android/settings/development/BluetoothSnoopLogPreferenceController.java
@@ -55,8 +55,7 @@
         mListEntries = context.getResources().getStringArray(R.array.bt_hci_snoop_log_entries);
     }
 
-    // Default mode is FILTERED on userdebug/eng build, DISABLED on user build,
-    // or can be changed by modifying the global setting.
+    // Default mode is DISABLED. It can also be changed by modifying the global setting.
     public int getDefaultModeIndex() {
         if (!Build.IS_DEBUGGABLE) {
             return BTSNOOP_LOG_MODE_DISABLED_INDEX;
@@ -71,7 +70,7 @@
             }
         }
 
-        return BTSNOOP_LOG_MODE_FILTERED_INDEX;
+        return BTSNOOP_LOG_MODE_DISABLED_INDEX;
     }
 
     @Override
diff --git a/src/com/android/settings/gestures/WakeScreenGesturePreferenceController.java b/src/com/android/settings/gestures/WakeScreenGesturePreferenceController.java
index a43fad1..96a3580 100644
--- a/src/com/android/settings/gestures/WakeScreenGesturePreferenceController.java
+++ b/src/com/android/settings/gestures/WakeScreenGesturePreferenceController.java
@@ -53,7 +53,18 @@
                 || !mFeatureProvider.isSupported(mContext)) {
             return UNSUPPORTED_ON_DEVICE;
         }
-        return mFeatureProvider.isEnabled(mContext) ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
+
+        if (!mFeatureProvider.isEnabled(mContext)) {
+            return CONDITIONALLY_UNAVAILABLE;
+        }
+
+        return getAmbientConfig().alwaysOnEnabled(mUserId)
+                ? AVAILABLE : DISABLED_DEPENDENT_SETTING;
+    }
+
+    @Override
+    protected boolean canHandleClicks() {
+        return getAmbientConfig().alwaysOnEnabled(mUserId);
     }
 
     @Override
diff --git a/src/com/android/settings/homepage/contextualcards/ContextualCardLoader.java b/src/com/android/settings/homepage/contextualcards/ContextualCardLoader.java
index 88c489b..7a0eb0f 100644
--- a/src/com/android/settings/homepage/contextualcards/ContextualCardLoader.java
+++ b/src/com/android/settings/homepage/contextualcards/ContextualCardLoader.java
@@ -39,6 +39,7 @@
 import androidx.annotation.VisibleForTesting;
 import androidx.slice.Slice;
 
+import com.android.settings.R;
 import com.android.settings.overlay.FeatureFactory;
 import com.android.settingslib.utils.AsyncLoaderCompat;
 
@@ -51,7 +52,7 @@
     @VisibleForTesting
     static final int DEFAULT_CARD_COUNT = 4;
     static final int CARD_CONTENT_LOADER_ID = 1;
-    static final long CARD_CONTENT_LOADER_TIMEOUT_MS = DateUtils.SECOND_IN_MILLIS;
+    static final long CARD_CONTENT_LOADER_TIMEOUT_MS = DateUtils.SECOND_IN_MILLIS * 3;
 
     private static final String TAG = "ContextualCardLoader";
 
@@ -94,6 +95,10 @@
     @Override
     public List<ContextualCard> loadInBackground() {
         final List<ContextualCard> result = new ArrayList<>();
+        if (mContext.getResources().getBoolean(R.bool.config_use_legacy_suggestion)) {
+            Log.d(TAG, "Skipping - in legacy suggestion mode");
+            return result;
+        }
         try (Cursor cursor = getContextualCardsFromProvider()) {
             if (cursor.getCount() > 0) {
                 for (cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) {
@@ -170,6 +175,7 @@
 
     @VisibleForTesting
     boolean isCardEligibleToDisplay(ContextualCard card) {
+        final long startTime = System.currentTimeMillis();
         if (card.isCustomCard()) {
             return true;
         }
@@ -190,6 +196,10 @@
         provider.release();
 
         final Slice slice = Slice.bindSlice(mContext, uri, SUPPORTED_SPECS);
+        //TODO(b/123668403): remove the log here once we do the change with FutureTask
+        final long bindTime = System.currentTimeMillis() - startTime;
+        Log.d(TAG, "Binding time for " + uri + " = " + bindTime);
+
         if (slice == null || slice.hasHint(HINT_ERROR)) {
             Log.w(TAG, "Failed to bind slice, not eligible for display " + uri);
             return false;
diff --git a/src/com/android/settings/homepage/contextualcards/ContextualCardManager.java b/src/com/android/settings/homepage/contextualcards/ContextualCardManager.java
index b35a38a..344c248 100644
--- a/src/com/android/settings/homepage/contextualcards/ContextualCardManager.java
+++ b/src/com/android/settings/homepage/contextualcards/ContextualCardManager.java
@@ -188,6 +188,8 @@
     @Override
     public void onFinishCardLoading(List<ContextualCard> cards) {
         final long loadTime = System.currentTimeMillis() - mStartTime;
+        //TODO(b/123668403): remove the log here once we do the change with FutureTask
+        Log.d(TAG, "Total loading time = " + loadTime);
         final List<ContextualCard> cardsToKeep = getCardsToKeep(cards);
 
         //navigate back to the homepage or after card dismissal
diff --git a/src/com/android/settings/homepage/contextualcards/slices/BluetoothDevicesSlice.java b/src/com/android/settings/homepage/contextualcards/slices/BluetoothDevicesSlice.java
index ea2a308..5673948 100644
--- a/src/com/android/settings/homepage/contextualcards/slices/BluetoothDevicesSlice.java
+++ b/src/com/android/settings/homepage/contextualcards/slices/BluetoothDevicesSlice.java
@@ -21,9 +21,6 @@
 import android.bluetooth.BluetoothAdapter;
 import android.content.Context;
 import android.content.Intent;
-import android.graphics.Bitmap;
-import android.graphics.Bitmap.Config;
-import android.graphics.Canvas;
 import android.graphics.drawable.Drawable;
 import android.net.Uri;
 import android.os.Bundle;
@@ -84,17 +81,6 @@
         mContext = context;
     }
 
-    private static Bitmap getBitmapFromVectorDrawable(Drawable VectorDrawable) {
-        final Bitmap bitmap = Bitmap.createBitmap(VectorDrawable.getIntrinsicWidth(),
-                VectorDrawable.getIntrinsicHeight(), Config.ARGB_8888);
-        final Canvas canvas = new Canvas(bitmap);
-
-        VectorDrawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
-        VectorDrawable.draw(canvas);
-
-        return bitmap;
-    }
-
     @Override
     public Uri getUri() {
         return CustomSliceRegistry.BLUETOOTH_DEVICES_SLICE_URI;
@@ -234,7 +220,7 @@
                 .getBtClassDrawableWithDescription(mContext, device);
 
         if (pair.first != null) {
-            return IconCompat.createWithBitmap(getBitmapFromVectorDrawable(pair.first));
+            return IconCompat.createWithBitmap(Utils.drawableToBitmap(pair.first));
         } else {
             return IconCompat.createWithResource(mContext,
                 com.android.internal.R.drawable.ic_settings_bluetooth);
diff --git a/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSlice.java b/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSlice.java
index 016aa32..692dc0a 100644
--- a/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSlice.java
+++ b/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSlice.java
@@ -142,20 +142,6 @@
         mNotificationBackend = new NotificationBackend();
     }
 
-    private static Bitmap drawableToBitmap(Drawable drawable) {
-        if (drawable instanceof BitmapDrawable) {
-            return ((BitmapDrawable) drawable).getBitmap();
-        }
-
-        final Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(),
-                drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
-        final Canvas canvas = new Canvas(bitmap);
-        drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
-        drawable.draw(canvas);
-
-        return bitmap;
-    }
-
     @Override
     public Slice getSlice() {
         final ListBuilder listBuilder =
@@ -257,7 +243,7 @@
             return null;
         }
 
-        return IconCompat.createWithBitmap(drawableToBitmap(drawable));
+        return IconCompat.createWithBitmap(Utils.drawableToBitmap(drawable));
     }
 
     @VisibleForTesting
diff --git a/src/com/android/settings/network/MobileNetworkSummaryController.java b/src/com/android/settings/network/MobileNetworkSummaryController.java
index fff1fea..dd282c6 100644
--- a/src/com/android/settings/network/MobileNetworkSummaryController.java
+++ b/src/com/android/settings/network/MobileNetworkSummaryController.java
@@ -31,6 +31,7 @@
 import com.android.settings.R;
 import com.android.settings.network.telephony.MobileNetworkActivity;
 import com.android.settings.widget.AddPreference;
+import com.android.settingslib.Utils;
 import com.android.settingslib.core.AbstractPreferenceController;
 
 import java.util.List;
@@ -50,6 +51,7 @@
     private SubscriptionManager mSubscriptionManager;
     private SubscriptionsChangeListener mChangeListener;
     private TelephonyManager mTelephonyMgr;
+    private EuiccManager mEuiccManager;
     private AddPreference mPreference;
 
     /**
@@ -71,6 +73,7 @@
         super(context);
         mSubscriptionManager = context.getSystemService(SubscriptionManager.class);
         mTelephonyMgr = mContext.getSystemService(TelephonyManager.class);
+        mEuiccManager = mContext.getSystemService(EuiccManager.class);
         mChangeListener = new SubscriptionsChangeListener(context, this);
         lifecycle.addObserver(this);
     }
@@ -97,7 +100,11 @@
         final List<SubscriptionInfo> subs = SubscriptionUtil.getAvailableSubscriptions(
                 mSubscriptionManager);
         if (subs.isEmpty()) {
-            return mContext.getResources().getString(R.string.mobile_network_summary_add_a_network);
+            if (mEuiccManager.isEnabled()) {
+                return mContext.getResources().getString(
+                        R.string.mobile_network_summary_add_a_network);
+            }
+            return null;
         } else if (subs.size() == 1) {
             return subs.get(0).getDisplayName();
         } else {
@@ -112,20 +119,22 @@
         mContext.startActivity(intent);
     }
 
-    private boolean shouldEnableAddButton() {
-        // The add button should only show up if the device is in multi-sim mode.
-        return mTelephonyMgr.getMultiSimConfiguration() != UNKNOWN;
+    private boolean shouldShowAddButton() {
+        // The add button should only show up if the device is in multi-sim mode and the eSIM
+        // manager is enabled.
+        return mTelephonyMgr.getMultiSimConfiguration() != UNKNOWN && mEuiccManager.isEnabled();
     }
 
     private void update() {
         if (mPreference == null) {
             return;
         }
-        final boolean enableAddButton = shouldEnableAddButton();
+        final boolean showAddButton = shouldShowAddButton();
         refreshSummary(mPreference);
-        if (!enableAddButton) {
+        if (!showAddButton) {
             mPreference.setOnAddClickListener(null);
         } else {
+            mPreference.setAddWidgetEnabled(!mChangeListener.isAirplaneModeOn());
             mPreference.setOnAddClickListener(p -> {
                 startAddSimFlow();
             });
@@ -134,11 +143,11 @@
                 mSubscriptionManager);
         mPreference.setOnPreferenceClickListener(null);
         mPreference.setFragment(null);
-        mPreference.setEnabled(true);
+        mPreference.setEnabled(!mChangeListener.isAirplaneModeOn());
         if (subs.isEmpty()) {
-            if (enableAddButton) {
+            if (showAddButton) {
                 mPreference.setEnabled(false);
-            } else {
+            } else if (mEuiccManager.isEnabled()) {
                 mPreference.setOnPreferenceClickListener((Preference pref) -> {
                     startAddSimFlow();
                     return true;
@@ -157,7 +166,7 @@
 
     @Override
     public boolean isAvailable() {
-        return true;
+        return !Utils.isWifiOnly(mContext);
     }
 
     @Override
@@ -167,6 +176,7 @@
 
     @Override
     public void onAirplaneModeChanged(boolean airplaneModeEnabled) {
+        update();
     }
 
     @Override
diff --git a/src/com/android/settings/network/SubscriptionUtil.java b/src/com/android/settings/network/SubscriptionUtil.java
index 237e08a..224fc41 100644
--- a/src/com/android/settings/network/SubscriptionUtil.java
+++ b/src/com/android/settings/network/SubscriptionUtil.java
@@ -38,7 +38,7 @@
         if (sResultsForTesting != null) {
             return sResultsForTesting;
         }
-        List<SubscriptionInfo> subscriptions = manager.getAvailableSubscriptionInfoList();
+        List<SubscriptionInfo> subscriptions = manager.getSelectableSubscriptionInfoList();
         if (subscriptions == null) {
             subscriptions = new ArrayList<>();
         }
diff --git a/src/com/android/settings/TetherProvisioningActivity.java b/src/com/android/settings/network/TetherProvisioningActivity.java
similarity index 89%
rename from src/com/android/settings/TetherProvisioningActivity.java
rename to src/com/android/settings/network/TetherProvisioningActivity.java
index e842db1..b30950e 100644
--- a/src/com/android/settings/TetherProvisioningActivity.java
+++ b/src/com/android/settings/network/TetherProvisioningActivity.java
@@ -14,17 +14,21 @@
  * limitations under the License.
  */
 
-package com.android.settings;
+package com.android.settings.network;
 
 import android.app.Activity;
 import android.content.Intent;
 import android.content.pm.PackageManager;
+import android.content.res.Resources;
 import android.net.ConnectivityManager;
 import android.os.Bundle;
 import android.os.ResultReceiver;
 import android.os.UserHandle;
+import android.telephony.SubscriptionManager;
 import android.util.Log;
 
+import com.android.settings.Utils;
+
 /**
  * Activity which acts as a proxy to the tether provisioning app for sanity checks and permission
  * restrictions. Specifically, the provisioning apps require
@@ -47,7 +51,9 @@
 
         int tetherType = getIntent().getIntExtra(ConnectivityManager.EXTRA_ADD_TETHER_TYPE,
                 ConnectivityManager.TETHERING_INVALID);
-        String[] provisionApp = getResources().getStringArray(
+        final int subId = SubscriptionManager.getDefaultDataSubscriptionId();
+        final Resources res = Utils.getResourcesForSubId(this, subId);
+        final String[] provisionApp = res.getStringArray(
                 com.android.internal.R.array.config_mobile_hotspot_provision_app);
 
         Intent intent = new Intent(Intent.ACTION_MAIN);
diff --git a/src/com/android/settings/network/telephony/ApnPreferenceController.java b/src/com/android/settings/network/telephony/ApnPreferenceController.java
index f5cd140..9fdb6ea 100644
--- a/src/com/android/settings/network/telephony/ApnPreferenceController.java
+++ b/src/com/android/settings/network/telephony/ApnPreferenceController.java
@@ -32,7 +32,6 @@
 import androidx.preference.PreferenceScreen;
 
 import com.android.settings.SettingsActivity;
-import com.android.settings.core.BasePreferenceController;
 import com.android.settings.network.ApnSettings;
 import com.android.settingslib.RestrictedLockUtilsInternal;
 import com.android.settingslib.RestrictedPreference;
@@ -43,12 +42,11 @@
 /**
  * Preference controller for "Apn settings"
  */
-public class ApnPreferenceController extends BasePreferenceController implements
+public class ApnPreferenceController extends TelephonyBasePreferenceController implements
         LifecycleObserver, OnStart, OnStop {
 
     @VisibleForTesting
     CarrierConfigManager mCarrierConfigManager;
-    private int mSubId;
     private Preference mPreference;
     private DpcApnEnforcedObserver mDpcApnEnforcedObserver;
 
@@ -59,12 +57,12 @@
     }
 
     @Override
-    public int getAvailabilityStatus() {
-        final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(mSubId);
-        final boolean isCdmaApn = MobileNetworkUtils.isCdmaOptions(mContext, mSubId)
+    public int getAvailabilityStatus(int subId) {
+        final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(subId);
+        final boolean isCdmaApn = MobileNetworkUtils.isCdmaOptions(mContext, subId)
                 && carrierConfig != null
                 && carrierConfig.getBoolean(CarrierConfigManager.KEY_SHOW_APN_SETTING_CDMA_BOOL);
-        final boolean isGsmApn = MobileNetworkUtils.isGsmOptions(mContext, mSubId)
+        final boolean isGsmApn = MobileNetworkUtils.isGsmOptions(mContext, subId)
                 && carrierConfig != null
                 && carrierConfig.getBoolean(CarrierConfigManager.KEY_APN_EXPAND_BOOL);
 
diff --git a/src/com/android/settings/network/telephony/CarrierPreferenceController.java b/src/com/android/settings/network/telephony/CarrierPreferenceController.java
index fbbfb9e..c381dc4 100644
--- a/src/com/android/settings/network/telephony/CarrierPreferenceController.java
+++ b/src/com/android/settings/network/telephony/CarrierPreferenceController.java
@@ -28,21 +28,17 @@
 import androidx.annotation.VisibleForTesting;
 import androidx.preference.Preference;
 
-import com.android.settings.core.BasePreferenceController;
-
 /**
  * Preference controller for "Carrier Settings"
  */
-public class CarrierPreferenceController extends BasePreferenceController {
+public class CarrierPreferenceController extends TelephonyBasePreferenceController {
 
     @VisibleForTesting
     CarrierConfigManager mCarrierConfigManager;
-    private int mSubId;
 
     public CarrierPreferenceController(Context context, String key) {
         super(context, key);
         mCarrierConfigManager = new CarrierConfigManager(context);
-        mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
     }
 
     public void init(int subId) {
@@ -50,14 +46,14 @@
     }
 
     @Override
-    public int getAvailabilityStatus() {
-        final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(mSubId);
+    public int getAvailabilityStatus(int subId) {
+        final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(subId);
 
         // Return available if it is in CDMA or GSM mode, and the flag is on
         return carrierConfig != null
                 && carrierConfig.getBoolean(CarrierConfigManager.KEY_CARRIER_SETTINGS_ENABLE_BOOL)
-                && (MobileNetworkUtils.isCdmaOptions(mContext, mSubId)
-                || MobileNetworkUtils.isGsmOptions(mContext, mSubId))
+                && (MobileNetworkUtils.isCdmaOptions(mContext, subId)
+                || MobileNetworkUtils.isGsmOptions(mContext, subId))
                 ? AVAILABLE
                 : CONDITIONALLY_UNAVAILABLE;
     }
diff --git a/src/com/android/settings/network/telephony/CarrierSettingsVersionPreferenceController.java b/src/com/android/settings/network/telephony/CarrierSettingsVersionPreferenceController.java
new file mode 100644
index 0000000..a6db773
--- /dev/null
+++ b/src/com/android/settings/network/telephony/CarrierSettingsVersionPreferenceController.java
@@ -0,0 +1,54 @@
+/*
+ * 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.network.telephony;
+
+import android.content.Context;
+import android.os.PersistableBundle;
+import android.telephony.CarrierConfigManager;
+import android.telephony.SubscriptionManager;
+
+import com.android.settings.core.BasePreferenceController;
+
+public class CarrierSettingsVersionPreferenceController extends BasePreferenceController {
+
+    private int mSubscriptionId;
+    private CarrierConfigManager mManager;
+
+    public CarrierSettingsVersionPreferenceController(Context context, String preferenceKey) {
+        super(context, preferenceKey);
+        mManager = context.getSystemService(CarrierConfigManager.class);
+        mSubscriptionId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
+    }
+
+    public void init(int subscriptionId) {
+        mSubscriptionId = subscriptionId;
+    }
+
+    @Override
+    public CharSequence getSummary() {
+        final PersistableBundle config = mManager.getConfigForSubId(mSubscriptionId);
+        if (config == null) {
+            return null;
+        }
+        return config.getString(CarrierConfigManager.KEY_CARRIER_CONFIG_VERSION_STRING);
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        return AVAILABLE;
+    }
+}
diff --git a/src/com/android/settings/network/telephony/DataServiceSetupPreferenceController.java b/src/com/android/settings/network/telephony/DataServiceSetupPreferenceController.java
index 75579dd..d1fbd73 100644
--- a/src/com/android/settings/network/telephony/DataServiceSetupPreferenceController.java
+++ b/src/com/android/settings/network/telephony/DataServiceSetupPreferenceController.java
@@ -29,18 +29,15 @@
 import androidx.preference.Preference;
 
 import com.android.internal.telephony.PhoneConstants;
-import com.android.settings.core.BasePreferenceController;
 
 /**
  * Preference controller for "Data service setup"
  */
-public class DataServiceSetupPreferenceController extends BasePreferenceController {
+public class DataServiceSetupPreferenceController extends TelephonyBasePreferenceController {
 
     private CarrierConfigManager mCarrierConfigManager;
     private TelephonyManager mTelephonyManager;
-    private PersistableBundle mCarrierConfig;
     private String mSetupUrl;
-    private int mSubId;
 
     public DataServiceSetupPreferenceController(Context context, String key) {
         super(context, key);
@@ -48,16 +45,16 @@
         mTelephonyManager = context.getSystemService(TelephonyManager.class);
         mSetupUrl = Settings.Global.getString(mContext.getContentResolver(),
                 Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
-        mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
     }
 
     @Override
-    public int getAvailabilityStatus() {
+    public int getAvailabilityStatus(int subId) {
         final boolean isLteOnCdma = mTelephonyManager.getLteOnCdmaMode()
                 == PhoneConstants.LTE_ON_CDMA_TRUE;
-        return mSubId != SubscriptionManager.INVALID_SUBSCRIPTION_ID
-                && mCarrierConfig != null
-                && !mCarrierConfig.getBoolean(
+        final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(subId);
+        return subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID
+                && carrierConfig != null
+                && !carrierConfig.getBoolean(
                 CarrierConfigManager.KEY_HIDE_CARRIER_NETWORK_SETTINGS_BOOL)
                 && isLteOnCdma && !TextUtils.isEmpty(mSetupUrl)
                 ? AVAILABLE
@@ -67,7 +64,6 @@
     public void init(int subId) {
         mSubId = subId;
         mTelephonyManager = TelephonyManager.from(mContext).createForSubscriptionId(mSubId);
-        mCarrierConfig = mCarrierConfigManager.getConfigForSubId(mSubId);
     }
 
     @Override
diff --git a/src/com/android/settings/network/telephony/DataUsagePreferenceController.java b/src/com/android/settings/network/telephony/DataUsagePreferenceController.java
index b94f7e5..7028a3e 100644
--- a/src/com/android/settings/network/telephony/DataUsagePreferenceController.java
+++ b/src/com/android/settings/network/telephony/DataUsagePreferenceController.java
@@ -28,27 +28,24 @@
 import androidx.preference.Preference;
 
 import com.android.settings.R;
-import com.android.settings.core.BasePreferenceController;
 import com.android.settingslib.net.DataUsageController;
 
 /**
  * Preference controller for "Data usage"
  */
-public class DataUsagePreferenceController extends BasePreferenceController {
+public class DataUsagePreferenceController extends TelephonyBasePreferenceController {
 
     private NetworkTemplate mTemplate;
     private DataUsageController.DataUsageInfo mDataUsageInfo;
     private Intent mIntent;
-    private int mSubId;
 
     public DataUsagePreferenceController(Context context, String key) {
         super(context, key);
-        mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
     }
 
     @Override
-    public int getAvailabilityStatus() {
-        return mSubId != SubscriptionManager.INVALID_SUBSCRIPTION_ID
+    public int getAvailabilityStatus(int subId) {
+        return subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID
                 ? AVAILABLE
                 : AVAILABLE_UNSEARCHABLE;
     }
diff --git a/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceController.java b/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceController.java
index fcd2fa0..a9606ab 100644
--- a/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceController.java
+++ b/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceController.java
@@ -31,18 +31,16 @@
 import com.android.internal.telephony.Phone;
 import com.android.internal.telephony.PhoneConstants;
 import com.android.settings.R;
-import com.android.settings.core.BasePreferenceController;
 
 /**
  * Preference controller for "Enabled network mode"
  */
-public class EnabledNetworkModePreferenceController extends BasePreferenceController implements
+public class EnabledNetworkModePreferenceController extends
+        TelephonyBasePreferenceController implements
         ListPreference.OnPreferenceChangeListener {
 
     private CarrierConfigManager mCarrierConfigManager;
     private TelephonyManager mTelephonyManager;
-    private PersistableBundle mPersistableBundle;
-    private int mSubId;
     private boolean mIsGlobalCdma;
     @VisibleForTesting
     boolean mShow4GForLTE;
@@ -50,26 +48,28 @@
     public EnabledNetworkModePreferenceController(Context context, String key) {
         super(context, key);
         mCarrierConfigManager = context.getSystemService(CarrierConfigManager.class);
-        mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
     }
 
     @Override
-    public int getAvailabilityStatus() {
+    public int getAvailabilityStatus(int subId) {
         boolean visible;
-        if (mSubId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
+        final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(subId);
+        final TelephonyManager telephonyManager = TelephonyManager
+                .from(mContext).createForSubscriptionId(subId);
+        if (subId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
             visible = false;
-        } else if (mPersistableBundle == null) {
+        } else if (carrierConfig == null) {
             visible = false;
-        } else if (mPersistableBundle.getBoolean(
+        } else if (carrierConfig.getBoolean(
                 CarrierConfigManager.KEY_HIDE_CARRIER_NETWORK_SETTINGS_BOOL)) {
             visible = false;
-        } else if (mPersistableBundle.getBoolean(
+        } else if (carrierConfig.getBoolean(
                 CarrierConfigManager.KEY_HIDE_PREFERRED_NETWORK_TYPE_BOOL)
-                && !mTelephonyManager.getServiceState().getRoaming()
-                && mTelephonyManager.getServiceState().getDataRegState()
+                && !telephonyManager.getServiceState().getRoaming()
+                && telephonyManager.getServiceState().getDataRegState()
                 == ServiceState.STATE_IN_SERVICE) {
             visible = false;
-        } else if (mPersistableBundle.getBoolean(CarrierConfigManager.KEY_WORLD_PHONE_BOOL)) {
+        } else if (carrierConfig.getBoolean(CarrierConfigManager.KEY_WORLD_PHONE_BOOL)) {
             visible = false;
         } else {
             visible = true;
@@ -104,15 +104,15 @@
 
     public void init(int subId) {
         mSubId = subId;
-        mPersistableBundle = mCarrierConfigManager.getConfigForSubId(mSubId);
+        final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(mSubId);
         mTelephonyManager = TelephonyManager.from(mContext).createForSubscriptionId(mSubId);
 
         final boolean isLteOnCdma =
                 mTelephonyManager.getLteOnCdmaMode() == PhoneConstants.LTE_ON_CDMA_TRUE;
         mIsGlobalCdma = isLteOnCdma
-                && mPersistableBundle.getBoolean(CarrierConfigManager.KEY_SHOW_CDMA_CHOICES_BOOL);
-        mShow4GForLTE = mPersistableBundle != null
-                ? mPersistableBundle.getBoolean(
+                && carrierConfig.getBoolean(CarrierConfigManager.KEY_SHOW_CDMA_CHOICES_BOOL);
+        mShow4GForLTE = carrierConfig != null
+                ? carrierConfig.getBoolean(
                 CarrierConfigManager.KEY_SHOW_4G_FOR_LTE_DATA_ICON_BOOL)
                 : false;
     }
diff --git a/src/com/android/settings/network/telephony/Enhanced4gLtePreferenceController.java b/src/com/android/settings/network/telephony/Enhanced4gLtePreferenceController.java
index cc8e78d..c510294 100644
--- a/src/com/android/settings/network/telephony/Enhanced4gLtePreferenceController.java
+++ b/src/com/android/settings/network/telephony/Enhanced4gLtePreferenceController.java
@@ -31,7 +31,6 @@
 
 import com.android.ims.ImsManager;
 import com.android.settings.R;
-import com.android.settings.core.TogglePreferenceController;
 import com.android.settingslib.core.lifecycle.LifecycleObserver;
 import com.android.settingslib.core.lifecycle.events.OnStart;
 import com.android.settingslib.core.lifecycle.events.OnStop;
@@ -42,8 +41,8 @@
 /**
  * Preference controller for "Enhanced 4G LTE"
  */
-public class Enhanced4gLtePreferenceController extends TogglePreferenceController implements
-        LifecycleObserver, OnStart, OnStop {
+public class Enhanced4gLtePreferenceController extends TelephonyTogglePreferenceController
+        implements LifecycleObserver, OnStart, OnStop {
 
     private Preference mPreference;
     private TelephonyManager mTelephonyManager;
@@ -53,24 +52,23 @@
     ImsManager mImsManager;
     private PhoneCallStateListener mPhoneStateListener;
     private final List<On4gLteUpdateListener> m4gLteListeners;
-    private int mSubId;
 
     public Enhanced4gLtePreferenceController(Context context, String key) {
         super(context, key);
         mCarrierConfigManager = context.getSystemService(CarrierConfigManager.class);
         m4gLteListeners = new ArrayList<>();
         mPhoneStateListener = new PhoneCallStateListener(Looper.getMainLooper());
-        mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
     }
 
     @Override
-    public int getAvailabilityStatus() {
-        final boolean isVisible = mSubId != SubscriptionManager.INVALID_SUBSCRIPTION_ID
-                && mImsManager != null && mCarrierConfig != null
+    public int getAvailabilityStatus(int subId) {
+        final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(subId);
+        final boolean isVisible = subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID
+                && mImsManager != null && carrierConfig != null
                 && mImsManager.isVolteEnabledByPlatform()
                 && mImsManager.isVolteProvisionedOnDevice()
                 && MobileNetworkUtils.isImsServiceStateReady(mImsManager)
-                && !mCarrierConfig.getBoolean(CarrierConfigManager.KEY_HIDE_ENHANCED_4G_LTE_BOOL);
+                && !carrierConfig.getBoolean(CarrierConfigManager.KEY_HIDE_ENHANCED_4G_LTE_BOOL);
         return isVisible
                 ? (is4gLtePrefEnabled() ? AVAILABLE : AVAILABLE_UNSEARCHABLE)
                 : CONDITIONALLY_UNAVAILABLE;
diff --git a/src/com/android/settings/network/telephony/EuiccPreferenceController.java b/src/com/android/settings/network/telephony/EuiccPreferenceController.java
index ae207a2..ecd20ed 100644
--- a/src/com/android/settings/network/telephony/EuiccPreferenceController.java
+++ b/src/com/android/settings/network/telephony/EuiccPreferenceController.java
@@ -18,31 +18,26 @@
 
 import android.content.Context;
 import android.content.Intent;
-import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
 import android.telephony.euicc.EuiccManager;
 import android.text.TextUtils;
 
 import androidx.preference.Preference;
 
-import com.android.settings.core.BasePreferenceController;
-
 /**
  * Preference controller for "Euicc preference"
  */
-public class EuiccPreferenceController extends BasePreferenceController {
+public class EuiccPreferenceController extends TelephonyBasePreferenceController {
 
     private TelephonyManager mTelephonyManager;
-    private int mSubId;
 
     public EuiccPreferenceController(Context context, String key) {
         super(context, key);
         mTelephonyManager = context.getSystemService(TelephonyManager.class);
-        mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
     }
 
     @Override
-    public int getAvailabilityStatus() {
+    public int getAvailabilityStatus(int subId) {
         return MobileNetworkUtils.showEuiccSettings(mContext)
                 ? AVAILABLE
                 : CONDITIONALLY_UNAVAILABLE;
diff --git a/src/com/android/settings/network/telephony/MobileDataPreferenceController.java b/src/com/android/settings/network/telephony/MobileDataPreferenceController.java
index 47822b6..f678e08 100644
--- a/src/com/android/settings/network/telephony/MobileDataPreferenceController.java
+++ b/src/com/android/settings/network/telephony/MobileDataPreferenceController.java
@@ -40,7 +40,7 @@
 /**
  * Preference controller for "Mobile data"
  */
-public class MobileDataPreferenceController extends TogglePreferenceController
+public class MobileDataPreferenceController extends TelephonyTogglePreferenceController
         implements LifecycleObserver, OnStart, OnStop {
 
     private static final String DIALOG_TAG = "MobileDataDialog";
@@ -50,7 +50,6 @@
     private SubscriptionManager mSubscriptionManager;
     private DataContentObserver mDataContentObserver;
     private FragmentManager mFragmentManager;
-    private int mSubId;
     @VisibleForTesting
     int mDialogType;
     @VisibleForTesting
@@ -58,15 +57,13 @@
 
     public MobileDataPreferenceController(Context context, String key) {
         super(context, key);
-        mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
         mSubscriptionManager = context.getSystemService(SubscriptionManager.class);
         mDataContentObserver = new DataContentObserver(new Handler(Looper.getMainLooper()));
-        mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
     }
 
     @Override
-    public int getAvailabilityStatus() {
-        return mSubId != SubscriptionManager.INVALID_SUBSCRIPTION_ID
+    public int getAvailabilityStatus(int subId) {
+        return subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID
                 ? AVAILABLE
                 : CONDITIONALLY_UNAVAILABLE;
     }
@@ -74,7 +71,7 @@
     @Override
     public void displayPreference(PreferenceScreen screen) {
         super.displayPreference(screen);
-        mPreference = (SwitchPreference) screen.findPreference(getPreferenceKey());
+        mPreference = screen.findPreference(getPreferenceKey());
     }
 
     @Override
@@ -122,6 +119,14 @@
                 && mSubId == SubscriptionManager.getDefaultDataSubscriptionId();
     }
 
+    public static Uri getObservableUri(int subId) {
+        Uri uri = Settings.Global.getUriFor(Settings.Global.MOBILE_DATA);
+        if (TelephonyManager.getDefault().getSimCount() != 1) {
+            uri = Settings.Global.getUriFor(Settings.Global.MOBILE_DATA + subId);
+        }
+        return uri;
+    }
+
     public void init(FragmentManager fragmentManager, int subId) {
         mFragmentManager = fragmentManager;
         mSubId = subId;
@@ -172,10 +177,7 @@
         }
 
         public void register(Context context, int subId) {
-            Uri uri = Settings.Global.getUriFor(Settings.Global.MOBILE_DATA);
-            if (TelephonyManager.getDefault().getSimCount() != 1) {
-                uri = Settings.Global.getUriFor(Settings.Global.MOBILE_DATA + subId);
-            }
+            final Uri uri = getObservableUri(subId);
             context.getContentResolver().registerContentObserver(uri, false, this);
 
         }
diff --git a/src/com/android/settings/network/telephony/MobileDataSlice.java b/src/com/android/settings/network/telephony/MobileDataSlice.java
new file mode 100644
index 0000000..6efd8c3
--- /dev/null
+++ b/src/com/android/settings/network/telephony/MobileDataSlice.java
@@ -0,0 +1,249 @@
+/*
+ * 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.network.telephony;
+
+import static android.app.slice.Slice.EXTRA_TOGGLE_STATE;
+
+import android.annotation.ColorInt;
+import android.app.PendingIntent;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.database.ContentObserver;
+import android.net.Uri;
+import android.os.Handler;
+import android.os.Looper;
+import android.telephony.SubscriptionInfo;
+import android.telephony.SubscriptionManager;
+import android.telephony.TelephonyManager;
+
+import androidx.core.graphics.drawable.IconCompat;
+import androidx.slice.Slice;
+import androidx.slice.builders.ListBuilder;
+import androidx.slice.builders.SliceAction;
+
+import com.android.settings.R;
+import com.android.settings.Utils;
+import com.android.settings.network.AirplaneModePreferenceController;
+import com.android.settings.slices.CustomSliceRegistry;
+import com.android.settings.slices.CustomSliceable;
+import com.android.settings.slices.SliceBackgroundWorker;
+
+import com.google.common.annotations.VisibleForTesting;
+
+import java.io.IOException;
+
+/**
+ * Custom {@link Slice} for Mobile Data.
+ * <p>
+ *     We make a custom slice instead of using {@link MobileDataPreferenceController} because the
+ *     pref controller is generalized across any carrier, and thus does not control a specific
+ *     subscription. We attempt to reuse any telephony-specific code from the preference controller.
+ *
+ * </p>
+ *
+ */
+public class MobileDataSlice implements CustomSliceable {
+
+    private final Context mContext;
+    private final SubscriptionManager mSubscriptionManager;
+    private final TelephonyManager mTelephonyManager;
+
+    public MobileDataSlice(Context context) {
+        mContext = context;
+        mSubscriptionManager = mContext.getSystemService(SubscriptionManager.class);
+        mTelephonyManager = mContext.getSystemService(TelephonyManager.class);
+    }
+
+    @Override
+    public Slice getSlice() {
+        final IconCompat icon = IconCompat.createWithResource(mContext,
+                R.drawable.ic_network_cell);
+        final String title = mContext.getText(R.string.mobile_data_settings_title).toString();
+        final CharSequence summary = getSummary();
+        @ColorInt final int color = Utils.getColorAccentDefaultColor(mContext);
+        final PendingIntent toggleAction = getBroadcastIntent(mContext);
+        final PendingIntent primaryAction = getPrimaryAction();
+        final SliceAction primarySliceAction = SliceAction.createDeeplink(primaryAction, icon,
+                ListBuilder.ICON_IMAGE, title);
+        final SliceAction toggleSliceAction = SliceAction.createToggle(toggleAction,
+                null /* actionTitle */, isMobileDataEnabled());
+
+        final ListBuilder listBuilder = new ListBuilder(mContext, getUri(),
+                ListBuilder.INFINITY)
+                .setAccentColor(color)
+                .addRow(new ListBuilder.RowBuilder()
+                        .setTitle(title)
+                        .setSubtitle(summary)
+                        .addEndItem(toggleSliceAction)
+                        .setPrimaryAction(primarySliceAction));
+        return listBuilder.build();
+    }
+
+    @Override
+    public Uri getUri() {
+        return CustomSliceRegistry.MOBILE_DATA_SLICE_URI;
+    }
+
+    @Override
+    public void onNotifyChange(Intent intent) {
+        // Don't make a change if we are in Airplane Mode.
+        if (isAirplaneModeEnabled()) {
+            return;
+        }
+
+        final boolean newState = intent.getBooleanExtra(EXTRA_TOGGLE_STATE,
+                    isMobileDataEnabled());
+
+        final int defaultSubId = getDefaultSubscriptionId(mSubscriptionManager);
+        if (defaultSubId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
+            return; // No subscription - do nothing.
+        }
+
+        MobileNetworkUtils.setMobileDataEnabled(mContext, defaultSubId, newState,
+                false /* disableOtherSubscriptions */);
+        // Do not notifyChange on Uri. The service takes longer to update the current value than it
+        // does for the Slice to check the current value again. Let {@link WifiScanWorker}
+        // handle it.
+    }
+
+    @Override
+    public IntentFilter getIntentFilter() {
+        final IntentFilter filter = new IntentFilter();
+        filter.addAction(Intent.ACTION_AIRPLANE_MODE_CHANGED);
+        return filter;
+    }
+
+    @Override
+    public Intent getIntent() {
+        return new Intent(mContext, MobileNetworkActivity.class);
+    }
+
+    @Override
+    public Class<? extends SliceBackgroundWorker> getBackgroundWorkerClass() {
+        return MobileDataWorker.class;
+    }
+
+    protected static int getDefaultSubscriptionId(SubscriptionManager subscriptionManager) {
+        final SubscriptionInfo defaultSubscription =
+                subscriptionManager.getDefaultDataSubscriptionInfo();
+        if (defaultSubscription == null) {
+            return SubscriptionManager.INVALID_SUBSCRIPTION_ID; // No default subscription
+        }
+
+        return defaultSubscription.getSubscriptionId();
+    }
+
+    private CharSequence getSummary() {
+        final SubscriptionInfo defaultSubscription =
+                mSubscriptionManager.getDefaultDataSubscriptionInfo();
+        if (defaultSubscription == null) {
+            return null; // no summary text
+        }
+
+        return defaultSubscription.getDisplayName();
+    }
+
+    private PendingIntent getPrimaryAction() {
+        final Intent intent = getIntent();
+        return PendingIntent.getActivity(mContext, 0 /* requestCode */,
+                intent, 0 /* flags */);
+    }
+
+    @VisibleForTesting
+    boolean isAirplaneModeEnabled() {
+        // Generic key since we only want the method check - no UI.
+        AirplaneModePreferenceController controller = new AirplaneModePreferenceController(mContext,
+                "key" /* Key */);
+        return controller.isChecked();
+    }
+
+    @VisibleForTesting
+    boolean isMobileDataEnabled() {
+        if (mTelephonyManager == null) {
+            return false;
+        }
+
+        return mTelephonyManager.isDataEnabled();
+    }
+
+    /**
+     * Listener for mobile data state changes.
+     *
+     * <p>
+     *     Listen to individual subscription changes since there is no framework broadcast.
+     *
+     *     This worker registers a ContentObserver in the background and updates the MobileData
+     *     Slice when the value changes.
+     */
+    public static class MobileDataWorker extends SliceBackgroundWorker<Void> {
+
+        DataContentObserver mMobileDataObserver;
+
+        public MobileDataWorker(Context context, Uri uri) {
+            super(context, uri);
+            final Handler handler = new Handler(Looper.getMainLooper());
+            mMobileDataObserver = new DataContentObserver(handler, this);
+        }
+
+        @Override
+        protected void onSlicePinned() {
+            final SubscriptionManager subscriptionManager =
+                    getContext().getSystemService(SubscriptionManager.class);
+            mMobileDataObserver.register(getContext(),
+                    getDefaultSubscriptionId(subscriptionManager));
+        }
+
+        @Override
+        protected void onSliceUnpinned() {
+            mMobileDataObserver.unRegister(getContext());
+        }
+
+        @Override
+        public void close() throws IOException {
+            mMobileDataObserver = null;
+        }
+
+        public void updateSlice() {
+            notifySliceChange();
+        }
+
+        public class DataContentObserver extends ContentObserver {
+
+            private final MobileDataWorker mSliceBackgroundWorker;
+
+            public DataContentObserver(Handler handler, MobileDataWorker backgroundWorker) {
+                super(handler);
+                mSliceBackgroundWorker = backgroundWorker;
+            }
+
+            @Override
+            public void onChange(boolean selfChange) {
+                mSliceBackgroundWorker.updateSlice();
+            }
+
+            public void register(Context context, int subId) {
+                final Uri uri = MobileDataPreferenceController.getObservableUri(subId);
+                context.getContentResolver().registerContentObserver(uri, false, this);
+            }
+
+            public void unRegister(Context context) {
+                context.getContentResolver().unregisterContentObserver(this);
+            }
+        }
+    }
+}
diff --git a/src/com/android/settings/network/telephony/MobileNetworkActivity.java b/src/com/android/settings/network/telephony/MobileNetworkActivity.java
index 821b1e1e..3c0940d 100644
--- a/src/com/android/settings/network/telephony/MobileNetworkActivity.java
+++ b/src/com/android/settings/network/telephony/MobileNetworkActivity.java
@@ -160,7 +160,7 @@
             final int subId = intent.getIntExtra(Settings.EXTRA_SUB_ID, SUB_ID_NULL);
             if (subId != SUB_ID_NULL) {
                 for (SubscriptionInfo subscription :
-                        mSubscriptionManager.getAvailableSubscriptionInfoList()) {
+                        mSubscriptionManager.getSelectableSubscriptionInfoList()) {
                     if (subscription.getSubscriptionId() == subId) {
                         return subscription;
                     }
diff --git a/src/com/android/settings/network/telephony/MobileNetworkSettings.java b/src/com/android/settings/network/telephony/MobileNetworkSettings.java
index e05f185..4f9f020 100644
--- a/src/com/android/settings/network/telephony/MobileNetworkSettings.java
+++ b/src/com/android/settings/network/telephony/MobileNetworkSettings.java
@@ -114,7 +114,7 @@
     @Override
     protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
         mSubId = getArguments().getInt(Settings.EXTRA_SUB_ID,
-                SubscriptionManager.INVALID_SUBSCRIPTION_ID);
+                MobileNetworkUtils.getSearchableSubscriptionId(context));
 
         if (FeatureFlagPersistent.isEnabled(getContext(), FeatureFlags.NETWORK_INTERNET_V2) &&
             mSubId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
@@ -133,6 +133,7 @@
           use(CallsDefaultSubscriptionController.class).init(getLifecycle());
           use(SmsDefaultSubscriptionController.class).init(getLifecycle());
           use(MobileNetworkSwitchController.class).init(getLifecycle(), mSubId);
+          use(CarrierSettingsVersionPreferenceController.class).init(mSubId);
         }
         use(MobileDataPreferenceController.class).init(getFragmentManager(), mSubId);
         use(RoamingPreferenceController.class).init(getFragmentManager(), mSubId);
@@ -251,11 +252,6 @@
     public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
             new BaseSearchIndexProvider() {
                 @Override
-                protected boolean isPageSearchEnabled(Context context) {
-                    return false;
-                }
-
-                @Override
                 public List<SearchIndexableResource> getXmlResourcesToIndex(Context context,
                         boolean enabled) {
                     final ArrayList<SearchIndexableResource> result = new ArrayList<>();
diff --git a/src/com/android/settings/network/telephony/MobileNetworkUtils.java b/src/com/android/settings/network/telephony/MobileNetworkUtils.java
index c5cdd3a..8e44dd4 100644
--- a/src/com/android/settings/network/telephony/MobileNetworkUtils.java
+++ b/src/com/android/settings/network/telephony/MobileNetworkUtils.java
@@ -44,6 +44,8 @@
 import com.android.ims.ImsManager;
 import com.android.internal.telephony.Phone;
 import com.android.internal.telephony.PhoneConstants;
+import com.android.internal.util.ArrayUtils;
+import com.android.settings.core.BasePreferenceController;
 
 import java.util.Arrays;
 import java.util.List;
@@ -403,4 +405,52 @@
         }
         return false;
     }
+
+
+    /**
+     * Return subId that supported by search. If there are more than one, return first one,
+     * otherwise return {@link SubscriptionManager#INVALID_SUBSCRIPTION_ID}
+     */
+    public static int getSearchableSubscriptionId(Context context) {
+        final SubscriptionManager subscriptionManager = context.getSystemService(
+                SubscriptionManager.class);
+        final int subIds[] = subscriptionManager.getActiveSubscriptionIdList();
+
+        return subIds.length >= 1 ? subIds[0] : SubscriptionManager.INVALID_SUBSCRIPTION_ID;
+    }
+
+    /**
+     * Return availability for a default subscription id. If subId already been set, use it to
+     * check, otherwise traverse all active subIds on device to check.
+     * @param context context
+     * @param defSubId Default subId get from telephony preference controller
+     * @param callback Callback to check availability for a specific subId
+     * @return Availability
+     *
+     * @see BasePreferenceController#getAvailabilityStatus()
+     */
+    public static int getAvailability(Context context, int defSubId,
+            TelephonyAvailabilityCallback callback) {
+        final SubscriptionManager subscriptionManager = context.getSystemService(
+                SubscriptionManager.class);
+        if (defSubId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
+            // If subId has been set, return the corresponding status
+            return callback.getAvailabilityStatus(defSubId);
+        } else {
+            // Otherwise, search whether there is one subId in device that support this preference
+            final int[] subIds = subscriptionManager.getActiveSubscriptionIdList();
+            if (ArrayUtils.isEmpty(subIds)) {
+                return callback.getAvailabilityStatus(
+                        SubscriptionManager.INVALID_SUBSCRIPTION_ID);
+            } else {
+                for (final int subId : subIds) {
+                    final int status = callback.getAvailabilityStatus(subId);
+                    if (status == BasePreferenceController.AVAILABLE) {
+                        return status;
+                    }
+                }
+                return callback.getAvailabilityStatus(subIds[0]);
+            }
+        }
+    }
 }
diff --git a/src/com/android/settings/network/telephony/NetworkSelectSettings.java b/src/com/android/settings/network/telephony/NetworkSelectSettings.java
index ff04583..2495ca5 100644
--- a/src/com/android/settings/network/telephony/NetworkSelectSettings.java
+++ b/src/com/android/settings/network/telephony/NetworkSelectSettings.java
@@ -122,7 +122,7 @@
 
         final Activity activity = getActivity();
         if (activity != null) {
-            mProgressHeader = setPinnedHeaderView(R.layout.wifi_progress_header)
+            mProgressHeader = setPinnedHeaderView(R.layout.progress_header)
                     .findViewById(R.id.progress_bar_animation);
             setProgressBarVisible(false);
         }
diff --git a/src/com/android/settings/network/telephony/PreferredNetworkModePreferenceController.java b/src/com/android/settings/network/telephony/PreferredNetworkModePreferenceController.java
index 0326f42..294f05f 100644
--- a/src/com/android/settings/network/telephony/PreferredNetworkModePreferenceController.java
+++ b/src/com/android/settings/network/telephony/PreferredNetworkModePreferenceController.java
@@ -30,43 +30,43 @@
 import com.android.internal.telephony.Phone;
 import com.android.internal.telephony.PhoneConstants;
 import com.android.settings.R;
-import com.android.settings.core.BasePreferenceController;
 
 /**
  * Preference controller for "Preferred network mode"
  */
-public class PreferredNetworkModePreferenceController extends BasePreferenceController implements
-        ListPreference.OnPreferenceChangeListener {
+public class PreferredNetworkModePreferenceController extends TelephonyBasePreferenceController
+        implements ListPreference.OnPreferenceChangeListener {
 
     private CarrierConfigManager mCarrierConfigManager;
     private TelephonyManager mTelephonyManager;
     private PersistableBundle mPersistableBundle;
-    private int mSubId;
     private boolean mIsGlobalCdma;
 
     public PreferredNetworkModePreferenceController(Context context, String key) {
         super(context, key);
         mCarrierConfigManager = context.getSystemService(CarrierConfigManager.class);
-        mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
     }
 
     @Override
-    public int getAvailabilityStatus() {
+    public int getAvailabilityStatus(int subId) {
+        final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(subId);
+        final TelephonyManager telephonyManager = TelephonyManager
+                .from(mContext).createForSubscriptionId(subId);
         boolean visible;
-        if (mSubId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
+        if (subId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
             visible = false;
-        } else if (mPersistableBundle == null) {
+        } else if (carrierConfig == null) {
             visible = false;
-        } else if (mPersistableBundle.getBoolean(
+        } else if (carrierConfig.getBoolean(
                 CarrierConfigManager.KEY_HIDE_CARRIER_NETWORK_SETTINGS_BOOL)) {
             visible = false;
-        } else if (mPersistableBundle.getBoolean(
+        } else if (carrierConfig.getBoolean(
                 CarrierConfigManager.KEY_HIDE_PREFERRED_NETWORK_TYPE_BOOL)
-                && !mTelephonyManager.getServiceState().getRoaming()
-                && mTelephonyManager.getServiceState().getDataRegState()
+                && !telephonyManager.getServiceState().getRoaming()
+                && telephonyManager.getServiceState().getDataRegState()
                 == ServiceState.STATE_IN_SERVICE) {
             visible = false;
-        } else if (mPersistableBundle.getBoolean(CarrierConfigManager.KEY_WORLD_PHONE_BOOL)) {
+        } else if (carrierConfig.getBoolean(CarrierConfigManager.KEY_WORLD_PHONE_BOOL)) {
             visible = true;
         } else {
             visible = false;
@@ -100,13 +100,13 @@
 
     public void init(int subId) {
         mSubId = subId;
-        mPersistableBundle = mCarrierConfigManager.getConfigForSubId(mSubId);
+        final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(mSubId);
         mTelephonyManager = TelephonyManager.from(mContext).createForSubscriptionId(mSubId);
 
         final boolean isLteOnCdma =
                 mTelephonyManager.getLteOnCdmaMode() == PhoneConstants.LTE_ON_CDMA_TRUE;
         mIsGlobalCdma = isLteOnCdma
-                && mPersistableBundle.getBoolean(CarrierConfigManager.KEY_SHOW_CDMA_CHOICES_BOOL);
+                && carrierConfig.getBoolean(CarrierConfigManager.KEY_SHOW_CDMA_CHOICES_BOOL);
     }
 
     private int getPreferredNetworkMode() {
diff --git a/src/com/android/settings/network/telephony/RoamingPreferenceController.java b/src/com/android/settings/network/telephony/RoamingPreferenceController.java
index 688268c..4140d5d 100644
--- a/src/com/android/settings/network/telephony/RoamingPreferenceController.java
+++ b/src/com/android/settings/network/telephony/RoamingPreferenceController.java
@@ -42,7 +42,7 @@
 /**
  * Preference controller for "Roaming"
  */
-public class RoamingPreferenceController extends TogglePreferenceController implements
+public class RoamingPreferenceController extends TelephonyTogglePreferenceController implements
         LifecycleObserver, OnStart, OnStop {
 
     private static final String DIALOG_TAG = "MobileDataDialog";
@@ -50,7 +50,6 @@
     private RestrictedSwitchPreference mSwitchPreference;
     private TelephonyManager mTelephonyManager;
     private CarrierConfigManager mCarrierConfigManager;
-    private int mSubId;
     private DataContentObserver mDataContentObserver;
     @VisibleForTesting
     boolean mNeedDialog;
@@ -59,10 +58,8 @@
 
     public RoamingPreferenceController(Context context, String key) {
         super(context, key);
-        mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
         mCarrierConfigManager = context.getSystemService(CarrierConfigManager.class);
         mDataContentObserver = new DataContentObserver(new Handler(Looper.getMainLooper()));
-        mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
     }
 
     @Override
@@ -78,12 +75,12 @@
     @Override
     public void displayPreference(PreferenceScreen screen) {
         super.displayPreference(screen);
-        mSwitchPreference = (RestrictedSwitchPreference) screen.findPreference(getPreferenceKey());
+        mSwitchPreference = screen.findPreference(getPreferenceKey());
     }
 
     @Override
-    public int getAvailabilityStatus() {
-        return mSubId != SubscriptionManager.INVALID_SUBSCRIPTION_ID
+    public int getAvailabilityStatus(int subId) {
+        return subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID
                 ? AVAILABLE
                 : AVAILABLE_UNSEARCHABLE;
     }
diff --git a/src/com/android/settings/network/telephony/TelephonyAvailabilityCallback.java b/src/com/android/settings/network/telephony/TelephonyAvailabilityCallback.java
new file mode 100644
index 0000000..d60bccd
--- /dev/null
+++ b/src/com/android/settings/network/telephony/TelephonyAvailabilityCallback.java
@@ -0,0 +1,30 @@
+/*
+ * 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.network.telephony;
+
+/**
+ * Callback to decide whether preference is available based on subscription id
+ */
+public interface TelephonyAvailabilityCallback {
+    /**
+     * Return availability status for a specific subId
+     *
+     * @see TelephonyBasePreferenceController
+     * @see TelephonyTogglePreferenceController
+     */
+    int getAvailabilityStatus(int subId);
+}
diff --git a/src/com/android/settings/network/telephony/TelephonyBasePreferenceController.java b/src/com/android/settings/network/telephony/TelephonyBasePreferenceController.java
new file mode 100644
index 0000000..e4ff5c4
--- /dev/null
+++ b/src/com/android/settings/network/telephony/TelephonyBasePreferenceController.java
@@ -0,0 +1,40 @@
+/*
+ * 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.network.telephony;
+
+import android.content.Context;
+import android.telephony.SubscriptionManager;
+
+import com.android.settings.core.BasePreferenceController;
+
+/**
+ * {@link BasePreferenceController} that used by all preferences that requires subscription id.
+ */
+public abstract class TelephonyBasePreferenceController extends BasePreferenceController
+        implements TelephonyAvailabilityCallback {
+    protected int mSubId;
+
+    public TelephonyBasePreferenceController(Context context, String preferenceKey) {
+        super(context, preferenceKey);
+        mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        return MobileNetworkUtils.getAvailability(mContext, mSubId, this::getAvailabilityStatus);
+    }
+}
diff --git a/src/com/android/settings/network/telephony/TelephonyTogglePreferenceController.java b/src/com/android/settings/network/telephony/TelephonyTogglePreferenceController.java
new file mode 100644
index 0000000..71efc57
--- /dev/null
+++ b/src/com/android/settings/network/telephony/TelephonyTogglePreferenceController.java
@@ -0,0 +1,40 @@
+/*
+ * 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.network.telephony;
+
+import android.content.Context;
+import android.telephony.SubscriptionManager;
+
+import com.android.settings.core.TogglePreferenceController;
+
+/**
+ * {@link TogglePreferenceController} that used by all preferences that requires subscription id.
+ */
+public abstract class TelephonyTogglePreferenceController extends TogglePreferenceController
+        implements TelephonyAvailabilityCallback {
+    protected int mSubId;
+
+    public TelephonyTogglePreferenceController(Context context, String preferenceKey) {
+        super(context, preferenceKey);
+        mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        return MobileNetworkUtils.getAvailability(mContext, mSubId, this::getAvailabilityStatus);
+    }
+}
diff --git a/src/com/android/settings/network/telephony/VideoCallingPreferenceController.java b/src/com/android/settings/network/telephony/VideoCallingPreferenceController.java
index 1007ef8..8c32df0 100644
--- a/src/com/android/settings/network/telephony/VideoCallingPreferenceController.java
+++ b/src/com/android/settings/network/telephony/VideoCallingPreferenceController.java
@@ -34,7 +34,6 @@
 import androidx.preference.SwitchPreference;
 
 import com.android.ims.ImsManager;
-import com.android.settings.core.TogglePreferenceController;
 import com.android.settingslib.core.lifecycle.LifecycleObserver;
 import com.android.settingslib.core.lifecycle.events.OnStart;
 import com.android.settingslib.core.lifecycle.events.OnStop;
@@ -42,34 +41,31 @@
 /**
  * Preference controller for "Video Calling"
  */
-public class VideoCallingPreferenceController extends TogglePreferenceController implements
+public class VideoCallingPreferenceController extends TelephonyTogglePreferenceController implements
         LifecycleObserver, OnStart, OnStop,
         Enhanced4gLtePreferenceController.On4gLteUpdateListener {
 
     private Preference mPreference;
     private TelephonyManager mTelephonyManager;
     private CarrierConfigManager mCarrierConfigManager;
-    private PersistableBundle mCarrierConfig;
     @VisibleForTesting
     ImsManager mImsManager;
     private PhoneCallStateListener mPhoneStateListener;
     private DataContentObserver mDataContentObserver;
-    private int mSubId;
 
     public VideoCallingPreferenceController(Context context, String key) {
         super(context, key);
         mCarrierConfigManager = context.getSystemService(CarrierConfigManager.class);
         mDataContentObserver = new DataContentObserver(new Handler(Looper.getMainLooper()));
         mPhoneStateListener = new PhoneCallStateListener(Looper.getMainLooper());
-        mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
     }
 
     @Override
-    public int getAvailabilityStatus() {
-        return mSubId != SubscriptionManager.INVALID_SUBSCRIPTION_ID
+    public int getAvailabilityStatus(int subId) {
+        return subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID
                 && MobileNetworkUtils.isWifiCallingEnabled(mContext,
-                SubscriptionManager.getPhoneId(mSubId))
-                && isVideoCallEnabled()
+                SubscriptionManager.getPhoneId(subId))
+                && isVideoCallEnabled(subId)
                 ? AVAILABLE
                 : CONDITIONALLY_UNAVAILABLE;
     }
@@ -96,7 +92,7 @@
     public void updateState(Preference preference) {
         super.updateState(preference);
         final SwitchPreference switchPreference = (SwitchPreference) preference;
-        final boolean videoCallEnabled = isVideoCallEnabled();
+        final boolean videoCallEnabled = isVideoCallEnabled(mSubId, mImsManager);
         switchPreference.setVisible(videoCallEnabled);
         if (videoCallEnabled) {
             final boolean is4gLteEnabled = mImsManager.isEnhanced4gLteModeSettingEnabledByUser()
@@ -121,7 +117,6 @@
     public VideoCallingPreferenceController init(int subId) {
         mSubId = subId;
         mTelephonyManager = TelephonyManager.from(mContext).createForSubscriptionId(mSubId);
-        mCarrierConfig = mCarrierConfigManager.getConfigForSubId(mSubId);
         if (mSubId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
             mImsManager = ImsManager.getInstance(mContext, SubscriptionManager.getPhoneId(mSubId));
         }
@@ -129,15 +124,25 @@
         return this;
     }
 
+    private boolean isVideoCallEnabled(int subId) {
+        final ImsManager imsManager = subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID
+                ? ImsManager.getInstance(mContext, SubscriptionManager.getPhoneId(subId))
+                : null;
+        return isVideoCallEnabled(subId, imsManager);
+    }
+
     @VisibleForTesting
-    boolean isVideoCallEnabled() {
-        return mCarrierConfig != null && mImsManager != null
-                && mImsManager.isVtEnabledByPlatform()
-                && mImsManager.isVtProvisionedOnDevice()
-                && MobileNetworkUtils.isImsServiceStateReady(mImsManager)
-                && (mCarrierConfig.getBoolean(
+    boolean isVideoCallEnabled(int subId, ImsManager imsManager) {
+        final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(subId);
+        final TelephonyManager telephonyManager = TelephonyManager
+                .from(mContext).createForSubscriptionId(subId);
+        return carrierConfig != null && imsManager != null
+                && imsManager.isVtEnabledByPlatform()
+                && imsManager.isVtProvisionedOnDevice()
+                && MobileNetworkUtils.isImsServiceStateReady(imsManager)
+                && (carrierConfig.getBoolean(
                 CarrierConfigManager.KEY_IGNORE_DATA_ENABLED_CHANGED_FOR_VIDEO_CALLS)
-                || mTelephonyManager.isDataEnabled());
+                || telephonyManager.isDataEnabled());
     }
 
     @Override
diff --git a/src/com/android/settings/network/telephony/WifiCallingPreferenceController.java b/src/com/android/settings/network/telephony/WifiCallingPreferenceController.java
index ec9a841..dfa1271 100644
--- a/src/com/android/settings/network/telephony/WifiCallingPreferenceController.java
+++ b/src/com/android/settings/network/telephony/WifiCallingPreferenceController.java
@@ -33,7 +33,6 @@
 
 import com.android.ims.ImsConfig;
 import com.android.ims.ImsManager;
-import com.android.settings.core.BasePreferenceController;
 import com.android.settingslib.core.lifecycle.LifecycleObserver;
 import com.android.settingslib.core.lifecycle.events.OnStart;
 import com.android.settingslib.core.lifecycle.events.OnStop;
@@ -43,7 +42,7 @@
 /**
  * Preference controller for "Wifi Calling"
  */
-public class WifiCallingPreferenceController extends BasePreferenceController implements
+public class WifiCallingPreferenceController extends TelephonyBasePreferenceController implements
         LifecycleObserver, OnStart, OnStop {
 
     @VisibleForTesting
@@ -56,21 +55,19 @@
     PhoneAccountHandle mSimCallManager;
     private PhoneCallStateListener mPhoneStateListener;
     private Preference mPreference;
-    private int mSubId;
 
     public WifiCallingPreferenceController(Context context, String key) {
         super(context, key);
         mTelephonyManager = context.getSystemService(TelephonyManager.class);
         mSimCallManager = context.getSystemService(TelecomManager.class).getSimCallManager();
         mPhoneStateListener = new PhoneCallStateListener(Looper.getMainLooper());
-        mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
     }
 
     @Override
-    public int getAvailabilityStatus() {
-        return mSubId != SubscriptionManager.INVALID_SUBSCRIPTION_ID
+    public int getAvailabilityStatus(int subId) {
+        return subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID
                 && MobileNetworkUtils.isWifiCallingEnabled(mContext,
-                SubscriptionManager.getPhoneId(mSubId))
+                SubscriptionManager.getPhoneId(subId))
                 ? AVAILABLE
                 : UNSUPPORTED_ON_DEVICE;
     }
diff --git a/src/com/android/settings/network/telephony/cdma/CdmaBasePreferenceController.java b/src/com/android/settings/network/telephony/cdma/CdmaBasePreferenceController.java
index a5498bc..ea7d82f 100644
--- a/src/com/android/settings/network/telephony/cdma/CdmaBasePreferenceController.java
+++ b/src/com/android/settings/network/telephony/cdma/CdmaBasePreferenceController.java
@@ -29,8 +29,8 @@
 import androidx.preference.PreferenceManager;
 import androidx.preference.PreferenceScreen;
 
-import com.android.settings.core.BasePreferenceController;
 import com.android.settings.network.telephony.MobileNetworkUtils;
+import com.android.settings.network.telephony.TelephonyBasePreferenceController;
 import com.android.settingslib.core.lifecycle.LifecycleObserver;
 import com.android.settingslib.core.lifecycle.events.OnStart;
 import com.android.settingslib.core.lifecycle.events.OnStop;
@@ -38,7 +38,7 @@
 /**
  * Preference controller related to CDMA category
  */
-public abstract class CdmaBasePreferenceController extends BasePreferenceController
+public abstract class CdmaBasePreferenceController extends TelephonyBasePreferenceController
         implements LifecycleObserver, OnStart, OnStop {
 
     protected Preference mPreference;
@@ -64,8 +64,8 @@
     }
 
     @Override
-    public int getAvailabilityStatus() {
-        return MobileNetworkUtils.isCdmaOptions(mContext, mSubId)
+    public int getAvailabilityStatus(int subId) {
+        return MobileNetworkUtils.isCdmaOptions(mContext, subId)
                 ? AVAILABLE
                 : CONDITIONALLY_UNAVAILABLE;
     }
diff --git a/src/com/android/settings/network/telephony/cdma/CdmaSubscriptionPreferenceController.java b/src/com/android/settings/network/telephony/cdma/CdmaSubscriptionPreferenceController.java
index c653890..e6c1c22 100644
--- a/src/com/android/settings/network/telephony/cdma/CdmaSubscriptionPreferenceController.java
+++ b/src/com/android/settings/network/telephony/cdma/CdmaSubscriptionPreferenceController.java
@@ -44,8 +44,8 @@
     }
 
     @Override
-    public int getAvailabilityStatus() {
-        return MobileNetworkUtils.isCdmaOptions(mContext, mSubId) && deviceSupportsNvAndRuim()
+    public int getAvailabilityStatus(int subId) {
+        return MobileNetworkUtils.isCdmaOptions(mContext, subId) && deviceSupportsNvAndRuim()
                 ? AVAILABLE
                 : CONDITIONALLY_UNAVAILABLE;
     }
diff --git a/src/com/android/settings/network/telephony/gsm/AutoSelectPreferenceController.java b/src/com/android/settings/network/telephony/gsm/AutoSelectPreferenceController.java
index fdc9f7f..a5d445f 100644
--- a/src/com/android/settings/network/telephony/gsm/AutoSelectPreferenceController.java
+++ b/src/com/android/settings/network/telephony/gsm/AutoSelectPreferenceController.java
@@ -29,9 +29,9 @@
 
 import com.android.settings.R;
 import com.android.settings.core.SubSettingLauncher;
-import com.android.settings.core.TogglePreferenceController;
 import com.android.settings.network.telephony.MobileNetworkUtils;
 import com.android.settings.network.telephony.NetworkSelectSettings;
+import com.android.settings.network.telephony.TelephonyTogglePreferenceController;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -39,7 +39,7 @@
 /**
  * Preference controller for "Auto Select Network"
  */
-public class AutoSelectPreferenceController extends TogglePreferenceController {
+public class AutoSelectPreferenceController extends TelephonyTogglePreferenceController {
 
     private int mSubId;
     private TelephonyManager mTelephonyManager;
@@ -54,8 +54,8 @@
     }
 
     @Override
-    public int getAvailabilityStatus() {
-        return MobileNetworkUtils.shouldDisplayNetworkSelectOptions(mContext,mSubId)
+    public int getAvailabilityStatus(int subId) {
+        return MobileNetworkUtils.shouldDisplayNetworkSelectOptions(mContext, subId)
                 ? AVAILABLE
                 : CONDITIONALLY_UNAVAILABLE;
     }
diff --git a/src/com/android/settings/network/telephony/gsm/OpenNetworkSelectPagePreferenceController.java b/src/com/android/settings/network/telephony/gsm/OpenNetworkSelectPagePreferenceController.java
index e8a392a..9ac0d12 100644
--- a/src/com/android/settings/network/telephony/gsm/OpenNetworkSelectPagePreferenceController.java
+++ b/src/com/android/settings/network/telephony/gsm/OpenNetworkSelectPagePreferenceController.java
@@ -33,11 +33,13 @@
 import com.android.settings.core.SubSettingLauncher;
 import com.android.settings.network.telephony.MobileNetworkUtils;
 import com.android.settings.network.telephony.NetworkSelectSettings;
+import com.android.settings.network.telephony.TelephonyBasePreferenceController;
 
 /**
  * Preference controller for "Open network select"
  */
-public class OpenNetworkSelectPagePreferenceController extends BasePreferenceController implements
+public class OpenNetworkSelectPagePreferenceController extends
+        TelephonyBasePreferenceController implements
         AutoSelectPreferenceController.OnNetworkSelectModeListener {
 
     private int mSubId;
@@ -51,8 +53,8 @@
     }
 
     @Override
-    public int getAvailabilityStatus() {
-        return MobileNetworkUtils.shouldDisplayNetworkSelectOptions(mContext, mSubId)
+    public int getAvailabilityStatus(int subId) {
+        return MobileNetworkUtils.shouldDisplayNetworkSelectOptions(mContext, subId)
                 ? AVAILABLE
                 : CONDITIONALLY_UNAVAILABLE;
     }
diff --git a/src/com/android/settings/panel/InternetConnectivityPanel.java b/src/com/android/settings/panel/InternetConnectivityPanel.java
index aae42f8..4e4fc0c 100644
--- a/src/com/android/settings/panel/InternetConnectivityPanel.java
+++ b/src/com/android/settings/panel/InternetConnectivityPanel.java
@@ -16,6 +16,7 @@
 
 package com.android.settings.panel;
 
+import android.app.settings.SettingsEnums;
 import android.content.Context;
 import android.content.Intent;
 import android.net.Uri;
@@ -55,6 +56,7 @@
     public List<Uri> getSlices() {
         final List<Uri> uris = new ArrayList<>();
         uris.add(CustomSliceRegistry.WIFI_SLICE_URI);
+        uris.add(CustomSliceRegistry.MOBILE_DATA_SLICE_URI);
         uris.add(CustomSliceRegistry.AIRPLANE_URI);
         return uris;
     }
@@ -63,4 +65,9 @@
     public Intent getSeeMoreIntent() {
         return new Intent(Settings.ACTION_WIRELESS_SETTINGS);
     }
+
+    @Override
+    public int getMetricsCategory() {
+        return SettingsEnums.PANEL_INTERNET_CONNECTIVITY;
+    }
 }
diff --git a/src/com/android/settings/panel/MediaOutputPanel.java b/src/com/android/settings/panel/MediaOutputPanel.java
index f7639d9..c42906d 100644
--- a/src/com/android/settings/panel/MediaOutputPanel.java
+++ b/src/com/android/settings/panel/MediaOutputPanel.java
@@ -19,6 +19,7 @@
 import static com.android.settings.media.MediaOutputSlice.MEDIA_PACKAGE_NAME;
 import static com.android.settings.slices.CustomSliceRegistry.MEDIA_OUTPUT_SLICE_URI;
 
+import android.app.settings.SettingsEnums;
 import android.content.Context;
 import android.content.Intent;
 import android.net.Uri;
@@ -71,4 +72,9 @@
     public Intent getSeeMoreIntent() {
         return null;
     }
+
+    @Override
+    public int getMetricsCategory() {
+        return SettingsEnums.PANEL_MEDIA_OUTPUT;
+    }
 }
diff --git a/src/com/android/settings/panel/NfcPanel.java b/src/com/android/settings/panel/NfcPanel.java
index 70452a3..8fa41d9 100644
--- a/src/com/android/settings/panel/NfcPanel.java
+++ b/src/com/android/settings/panel/NfcPanel.java
@@ -50,4 +50,9 @@
         intent.setClassName(mContext.getPackageName(), SubSettings.class.getName());
         return intent;
     }
+
+    @Override
+    public int getMetricsCategory() {
+        return SettingsEnums.PANEL_NFC;
+    }
 }
diff --git a/src/com/android/settings/panel/PanelContent.java b/src/com/android/settings/panel/PanelContent.java
index bd84c2f..496bac3 100644
--- a/src/com/android/settings/panel/PanelContent.java
+++ b/src/com/android/settings/panel/PanelContent.java
@@ -19,12 +19,14 @@
 import android.content.Intent;
 import android.net.Uri;
 
+import com.android.settingslib.core.instrumentation.Instrumentable;
+
 import java.util.List;
 
 /**
  * Represents the data class needed to create a Settings Panel. See {@link PanelFragment}.
  */
-public interface PanelContent {
+public interface PanelContent extends Instrumentable {
 
     /**
      * @return a string for the title of the Panel.
diff --git a/src/com/android/settings/panel/PanelFeatureProvider.java b/src/com/android/settings/panel/PanelFeatureProvider.java
index 5af5ac8..85e098d 100644
--- a/src/com/android/settings/panel/PanelFeatureProvider.java
+++ b/src/com/android/settings/panel/PanelFeatureProvider.java
@@ -21,7 +21,8 @@
 public interface PanelFeatureProvider {
 
     /**
-     * Returns {@link PanelContent} as specified by the {@code panelType} and {@code packageName}.
+     * Returns {@link PanelContent} as specified by the {@param panelType}, and
+     * {@param mediaPackageName}.
      */
-    PanelContent getPanel(Context context, String panelType, String packageName);
+    PanelContent getPanel(Context context, String panelType, String mediaPackageName);
 }
diff --git a/src/com/android/settings/panel/PanelFeatureProviderImpl.java b/src/com/android/settings/panel/PanelFeatureProviderImpl.java
index c3d611d..6b096a1 100644
--- a/src/com/android/settings/panel/PanelFeatureProviderImpl.java
+++ b/src/com/android/settings/panel/PanelFeatureProviderImpl.java
@@ -24,7 +24,7 @@
 public class PanelFeatureProviderImpl implements PanelFeatureProvider {
 
     @Override
-    public PanelContent getPanel(Context context, String panelType, String packageName) {
+    public PanelContent getPanel(Context context, String panelType, String mediaPackageName) {
         switch (panelType) {
             case Settings.Panel.ACTION_INTERNET_CONNECTIVITY:
                 return InternetConnectivityPanel.create(context);
@@ -33,7 +33,7 @@
             case Settings.Panel.ACTION_NFC:
                 return NfcPanel.create(context);
             case ACTION_MEDIA_OUTPUT:
-                return MediaOutputPanel.create(context, packageName);
+                return MediaOutputPanel.create(context, mediaPackageName);
         }
 
         throw new IllegalStateException("No matching panel for: "  + panelType);
diff --git a/src/com/android/settings/panel/PanelFragment.java b/src/com/android/settings/panel/PanelFragment.java
index db0bf0e..a222d36 100644
--- a/src/com/android/settings/panel/PanelFragment.java
+++ b/src/com/android/settings/panel/PanelFragment.java
@@ -16,9 +16,9 @@
 
 package com.android.settings.panel;
 
-import android.content.Intent;
+import android.app.settings.SettingsEnums;
+import android.content.Context;
 import android.os.Bundle;
-import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -35,6 +35,8 @@
 import com.android.internal.annotations.VisibleForTesting;
 import com.android.settings.R;
 import com.android.settings.overlay.FeatureFactory;
+import com.android.settings.panel.PanelLoggingContract.PanelClosedKeys;
+import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
 
 public class PanelFragment extends Fragment {
 
@@ -45,15 +47,15 @@
     private Button mDoneButton;
     private RecyclerView mPanelSlices;
 
+    private PanelContent mPanel;
+    private final MetricsFeatureProvider mMetricsProvider;
+
     @VisibleForTesting
     PanelSlicesAdapter mAdapter;
 
-    private View.OnClickListener mDoneButtonListener = (v) -> {
-        Log.d(TAG, "Closing dialog");
-        getActivity().finish();
-    };
-
     public PanelFragment() {
+        final Context context = getActivity();
+        mMetricsProvider = FeatureFactory.getFactory(context).getMetricsFeatureProvider();
     }
 
     @Nullable
@@ -69,38 +71,70 @@
         mTitleView = view.findViewById(R.id.panel_title);
 
         final Bundle arguments = getArguments();
-        final String panelType = arguments.getString(SettingsPanelActivity.KEY_PANEL_TYPE_ARGUMENT);
-        final String packageName =
-                arguments.getString(SettingsPanelActivity.KEY_PANEL_PACKAGE_NAME);
+        final String panelType =
+                arguments.getString(SettingsPanelActivity.KEY_PANEL_TYPE_ARGUMENT);
+        final String callingPackageName =
+                arguments.getString(SettingsPanelActivity.KEY_CALLING_PACKAGE_NAME);
+        final String mediaPackageName =
+                arguments.getString(SettingsPanelActivity.KEY_MEDIA_PACKAGE_NAME);
 
-        final PanelContent panel = FeatureFactory.getFactory(activity)
+        // TODO (b/124399577) transform interface to take a context and bundle.
+        mPanel = FeatureFactory.getFactory(activity)
                 .getPanelFeatureProvider()
-                .getPanel(activity, panelType, packageName);
+                .getPanel(activity, panelType, mediaPackageName);
 
-        mAdapter = new PanelSlicesAdapter(this, panel.getSlices());
+        // Log panel opened.
+        mMetricsProvider.action(
+                0 /* attribution */,
+                SettingsEnums.PAGE_VISIBLE /* opened panel - Action */,
+                mPanel.getMetricsCategory(),
+                callingPackageName,
+                0 /* value */);
+
+        mAdapter = new PanelSlicesAdapter(this, mPanel);
 
         mPanelSlices.setHasFixedSize(true);
         mPanelSlices.setLayoutManager(new LinearLayoutManager((activity)));
         mPanelSlices.setAdapter(mAdapter);
 
-        mTitleView.setText(panel.getTitle());
+        mTitleView.setText(mPanel.getTitle());
 
-        mSeeMoreButton.setOnClickListener(getSeeMoreListener(panel.getSeeMoreIntent()));
-        mDoneButton.setOnClickListener(mDoneButtonListener);
+        mSeeMoreButton.setOnClickListener(getSeeMoreListener());
+        mDoneButton.setOnClickListener(getCloseListener());
 
         //If getSeeMoreIntent() is null, hide the mSeeMoreButton.
-        if (panel.getSeeMoreIntent() == null) {
+        if (mPanel.getSeeMoreIntent() == null) {
             mSeeMoreButton.setVisibility(View.GONE);
         }
 
         return view;
     }
 
-    private View.OnClickListener getSeeMoreListener(final Intent intent) {
+    @VisibleForTesting
+    View.OnClickListener getSeeMoreListener() {
         return (v) -> {
+            mMetricsProvider.action(
+                    0 /* attribution */,
+                    SettingsEnums.PAGE_HIDE ,
+                    mPanel.getMetricsCategory(),
+                    PanelClosedKeys.KEY_SEE_MORE,
+                    0 /* value */);
             final FragmentActivity activity = getActivity();
-            activity.startActivity(intent);
+            activity.startActivityForResult(mPanel.getSeeMoreIntent(), 0);
             activity.finish();
         };
     }
+
+    @VisibleForTesting
+    View.OnClickListener getCloseListener() {
+        return (v) -> {
+            mMetricsProvider.action(
+                    0 /* attribution */,
+                    SettingsEnums.PAGE_HIDE,
+                    mPanel.getMetricsCategory(),
+                    PanelClosedKeys.KEY_DONE,
+                    0 /* value */);
+            getActivity().finish();
+        };
+    }
 }
diff --git a/src/com/android/settings/panel/PanelLoggingContract.java b/src/com/android/settings/panel/PanelLoggingContract.java
new file mode 100644
index 0000000..e149186
--- /dev/null
+++ b/src/com/android/settings/panel/PanelLoggingContract.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.panel;
+
+/**
+ * Simple contract class to track keys in Panel logging.
+ *
+ * <p>
+ *    Constants should only be removed if underlying panel, or use case is removed.
+ * </p>
+ */
+public class PanelLoggingContract {
+
+    /**
+     * Keys tracking different ways users exit Panels.
+     */
+    interface PanelClosedKeys {
+        /**
+         * The user clicked the See More button linking deeper into Settings.
+         */
+        String KEY_SEE_MORE = "see_more";
+
+        /**
+         * The user clicked the Done button, closing the Panel.
+         */
+        String KEY_DONE = "done";
+
+        /**
+         * The user clicked outside the dialog, closing the Panel.
+         */
+        String KEY_CLICKED_OUT = "clicked_out";
+    }
+}
diff --git a/src/com/android/settings/panel/PanelSlicesAdapter.java b/src/com/android/settings/panel/PanelSlicesAdapter.java
index f688512..c1cb049 100644
--- a/src/com/android/settings/panel/PanelSlicesAdapter.java
+++ b/src/com/android/settings/panel/PanelSlicesAdapter.java
@@ -16,6 +16,7 @@
 
 package com.android.settings.panel;
 
+import android.app.settings.SettingsEnums;
 import android.content.Context;
 import android.net.Uri;
 import android.view.LayoutInflater;
@@ -31,8 +32,8 @@
 import androidx.slice.widget.SliceView;
 
 import com.android.settings.R;
+import com.android.settings.overlay.FeatureFactory;
 
-import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -43,10 +44,12 @@
 
     private final List<Uri> mSliceUris;
     private final PanelFragment mPanelFragment;
+    private final PanelContent mPanelContent;
 
-    public PanelSlicesAdapter(PanelFragment fragment, List<Uri> sliceUris) {
+    public PanelSlicesAdapter(PanelFragment fragment, PanelContent panel) {
         mPanelFragment = fragment;
-        mSliceUris = new ArrayList<>(sliceUris);
+        mSliceUris = panel.getSlices();
+        mPanelContent = panel;
     }
 
     @NonNull
@@ -56,7 +59,7 @@
         final LayoutInflater inflater = LayoutInflater.from(context);
         final View view = inflater.inflate(R.layout.panel_slice_row, viewGroup, false);
 
-        return new SliceRowViewHolder(view);
+        return new SliceRowViewHolder(view, mPanelContent);
     }
 
     @Override
@@ -79,22 +82,38 @@
      */
     public static class SliceRowViewHolder extends RecyclerView.ViewHolder {
 
+        private final PanelContent mPanelContent;
+
         @VisibleForTesting
         LiveData<Slice> sliceLiveData;
 
         @VisibleForTesting
         final SliceView sliceView;
 
-        public SliceRowViewHolder(View view) {
+        public SliceRowViewHolder(View view, PanelContent panelContent) {
             super(view);
             sliceView = view.findViewById(R.id.slice_view);
             sliceView.setMode(SliceView.MODE_LARGE);
+            mPanelContent = panelContent;
         }
 
         public void onBind(PanelFragment fragment, Uri sliceUri) {
             final Context context = sliceView.getContext();
             sliceLiveData = SliceLiveData.fromUri(context, sliceUri);
             sliceLiveData.observe(fragment.getViewLifecycleOwner(), sliceView);
+
+            // Log Panel interaction
+            sliceView.setOnSliceActionListener(
+                    ((eventInfo, sliceItem) -> {
+                        FeatureFactory.getFactory(context)
+                                .getMetricsFeatureProvider()
+                                .action(0 /* attribution */,
+                                        SettingsEnums.ACTION_PANEL_INTERACTION,
+                                        mPanelContent.getMetricsCategory(),
+                                        sliceUri.toString() /* log key */,
+                                        eventInfo.actionType /* value */);
+                    })
+            );
         }
     }
 }
diff --git a/src/com/android/settings/panel/SettingsPanelActivity.java b/src/com/android/settings/panel/SettingsPanelActivity.java
index 4cf535e..3819c80 100644
--- a/src/com/android/settings/panel/SettingsPanelActivity.java
+++ b/src/com/android/settings/panel/SettingsPanelActivity.java
@@ -19,11 +19,13 @@
 import static com.android.settingslib.media.MediaOutputSliceConstants.ACTION_MEDIA_OUTPUT;
 import static com.android.settingslib.media.MediaOutputSliceConstants.EXTRA_PACKAGE_NAME;
 
+import android.app.settings.SettingsEnums;
 import android.content.Intent;
 import android.os.Bundle;
 import android.text.TextUtils;
 import android.util.Log;
 import android.view.Gravity;
+import android.view.MotionEvent;
 import android.view.Window;
 import android.view.WindowManager;
 
@@ -34,6 +36,8 @@
 
 import com.android.internal.annotations.VisibleForTesting;
 import com.android.settings.R;
+import com.android.settings.overlay.FeatureFactory;
+import com.android.settings.panel.PanelLoggingContract.PanelClosedKeys;
 
 /**
  * Dialog Activity to host Settings Slices.
@@ -49,7 +53,16 @@
      * Key specifying which Panel the app is requesting.
      */
     public static final String KEY_PANEL_TYPE_ARGUMENT = "PANEL_TYPE_ARGUMENT";
-    public static final String KEY_PANEL_PACKAGE_NAME = "PANEL_PACKAGE_NAME";
+
+    /**
+     * Key specifying the package which requested the Panel.
+     */
+    public static final String KEY_CALLING_PACKAGE_NAME = "PANEL_CALLING_PACKAGE_NAME";
+
+    /**
+     * Key specifying the package name for which the
+     */
+    public static final String KEY_MEDIA_PACKAGE_NAME = "PANEL_MEDIA_PACKAGE_NAME";
 
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -62,12 +75,12 @@
             return;
         }
 
-        final String packageName =
+        final String mediaPackageName =
                 callingIntent.getStringExtra(EXTRA_PACKAGE_NAME);
 
         if (TextUtils.equals(ACTION_MEDIA_OUTPUT, callingIntent.getAction())
-                && TextUtils.isEmpty(packageName)) {
-            Log.e(TAG, "Null package name, closing Panel Activity");
+                && TextUtils.isEmpty(mediaPackageName)) {
+            Log.e(TAG, "Missing EXTRA_PACKAGE_NAME, closing Panel Activity");
             finish();
             return;
         }
@@ -81,7 +94,8 @@
                 WindowManager.LayoutParams.WRAP_CONTENT);
 
         mBundle.putString(KEY_PANEL_TYPE_ARGUMENT, callingIntent.getAction());
-        mBundle.putString(KEY_PANEL_PACKAGE_NAME, packageName);
+        mBundle.putString(KEY_CALLING_PACKAGE_NAME, getCallingPackage());
+        mBundle.putString(KEY_MEDIA_PACKAGE_NAME, mediaPackageName);
 
         final PanelFragment panelFragment = new PanelFragment();
         panelFragment.setArguments(mBundle);
@@ -92,4 +106,21 @@
             fragmentManager.beginTransaction().add(R.id.main_content, panelFragment).commit();
         }
     }
+
+    @Override
+    public boolean onTouchEvent(MotionEvent event) {
+        if (event.getAction() == MotionEvent.ACTION_OUTSIDE) {
+            final PanelContent panelContent = FeatureFactory.getFactory(this)
+                    .getPanelFeatureProvider()
+                    .getPanel(this, getIntent().getAction(), null /* Media Package Name */);
+            FeatureFactory.getFactory(this)
+                    .getMetricsFeatureProvider()
+                    .action(0 /* attribution */,
+                            SettingsEnums.PAGE_HIDE,
+                            panelContent.getMetricsCategory(),
+                            PanelClosedKeys.KEY_CLICKED_OUT,
+                            0 /* value */);
+        }
+        return super.onTouchEvent(event);
+    }
 }
diff --git a/src/com/android/settings/panel/VolumePanel.java b/src/com/android/settings/panel/VolumePanel.java
index 352fed5..20c2272 100644
--- a/src/com/android/settings/panel/VolumePanel.java
+++ b/src/com/android/settings/panel/VolumePanel.java
@@ -21,6 +21,7 @@
 import static com.android.settings.slices.CustomSliceRegistry.VOLUME_MEDIA_URI;
 import static com.android.settings.slices.CustomSliceRegistry.VOLUME_RINGER_URI;
 
+import android.app.settings.SettingsEnums;
 import android.content.Context;
 import android.content.Intent;
 import android.net.Uri;
@@ -62,4 +63,9 @@
     public Intent getSeeMoreIntent() {
         return new Intent(Settings.ACTION_SOUND_SETTINGS);
     }
+
+    @Override
+    public int getMetricsCategory() {
+        return SettingsEnums.PANEL_VOLUME;
+    }
 }
\ No newline at end of file
diff --git a/src/com/android/settings/password/SetNewPasswordActivity.java b/src/com/android/settings/password/SetNewPasswordActivity.java
index 8e8e7bc..d7445e6 100644
--- a/src/com/android/settings/password/SetNewPasswordActivity.java
+++ b/src/com/android/settings/password/SetNewPasswordActivity.java
@@ -16,7 +16,7 @@
 
 package com.android.settings.password;
 
-import static android.Manifest.permission.GET_AND_REQUEST_SCREEN_LOCK_COMPLEXITY;
+import static android.Manifest.permission.REQUEST_SCREEN_LOCK_COMPLEXITY;
 import static android.app.admin.DevicePolicyManager.ACTION_SET_NEW_PARENT_PROFILE_PASSWORD;
 import static android.app.admin.DevicePolicyManager.ACTION_SET_NEW_PASSWORD;
 import static android.app.admin.DevicePolicyManager.EXTRA_PASSWORD_COMPLEXITY;
@@ -83,7 +83,7 @@
         if (ACTION_SET_NEW_PASSWORD.equals(mNewPasswordAction)
                 && getIntent().hasExtra(EXTRA_PASSWORD_COMPLEXITY)) {
             final boolean hasPermission = PasswordUtils.isCallingAppPermitted(
-                    this, activityToken, GET_AND_REQUEST_SCREEN_LOCK_COMPLEXITY);
+                    this, activityToken, REQUEST_SCREEN_LOCK_COMPLEXITY);
             if (hasPermission) {
                 mRequestedMinComplexity =
                         PasswordMetrics.sanitizeComplexityLevel(getIntent()
@@ -91,7 +91,7 @@
             } else {
                 PasswordUtils.crashCallingApplication(activityToken,
                         "Must have permission "
-                                + GET_AND_REQUEST_SCREEN_LOCK_COMPLEXITY + " to use extra "
+                                + REQUEST_SCREEN_LOCK_COMPLEXITY + " to use extra "
                                 + EXTRA_PASSWORD_COMPLEXITY);
                 finish();
                 return;
diff --git a/src/com/android/settings/password/SetupChooseLockGeneric.java b/src/com/android/settings/password/SetupChooseLockGeneric.java
index 33c3edb..7fbb211 100644
--- a/src/com/android/settings/password/SetupChooseLockGeneric.java
+++ b/src/com/android/settings/password/SetupChooseLockGeneric.java
@@ -16,7 +16,7 @@
 
 package com.android.settings.password;
 
-import static android.Manifest.permission.GET_AND_REQUEST_SCREEN_LOCK_COMPLEXITY;
+import static android.Manifest.permission.REQUEST_SCREEN_LOCK_COMPLEXITY;
 import static android.app.admin.DevicePolicyManager.EXTRA_PASSWORD_COMPLEXITY;
 
 import static com.android.settings.password.ChooseLockSettingsHelper.EXTRA_KEY_REQUESTED_MIN_COMPLEXITY;
@@ -82,10 +82,10 @@
         if(getIntent().hasExtra(EXTRA_KEY_REQUESTED_MIN_COMPLEXITY)) {
             IBinder activityToken = getActivityToken();
             boolean hasPermission = PasswordUtils.isCallingAppPermitted(
-                    this, activityToken, GET_AND_REQUEST_SCREEN_LOCK_COMPLEXITY);
+                    this, activityToken, REQUEST_SCREEN_LOCK_COMPLEXITY);
             if (!hasPermission) {
                 PasswordUtils.crashCallingApplication(activityToken,
-                        "Must have permission " + GET_AND_REQUEST_SCREEN_LOCK_COMPLEXITY
+                        "Must have permission " + REQUEST_SCREEN_LOCK_COMPLEXITY
                                 + " to use extra " + EXTRA_PASSWORD_COMPLEXITY);
                 finish();
                 return;
diff --git a/src/com/android/settings/privacy/PrivacyDashboardFragment.java b/src/com/android/settings/privacy/PrivacyDashboardFragment.java
index 8f1d4c7..5823407 100644
--- a/src/com/android/settings/privacy/PrivacyDashboardFragment.java
+++ b/src/com/android/settings/privacy/PrivacyDashboardFragment.java
@@ -16,9 +16,16 @@
 
 package com.android.settings.privacy;
 
+import android.app.ActionBar;
+import android.app.Activity;
 import android.app.settings.SettingsEnums;
 import android.content.Context;
+import android.os.Bundle;
 import android.provider.SearchIndexableResource;
+import android.util.Log;
+import android.view.View;
+
+import androidx.annotation.VisibleForTesting;
 
 import com.android.settings.R;
 import com.android.settings.dashboard.DashboardFragment;
@@ -27,13 +34,14 @@
 import com.android.settingslib.core.AbstractPreferenceController;
 import com.android.settingslib.core.lifecycle.Lifecycle;
 import com.android.settingslib.search.SearchIndexable;
+import com.android.settingslib.widget.ActionBarShadowController;
 
 import java.util.ArrayList;
 import java.util.List;
 
 @SearchIndexable
 public class PrivacyDashboardFragment extends DashboardFragment {
-    private static final String TAG = "PrivacyDashboardFragment";
+    private static final String TAG = "PrivacyDashboardFrag";
     private static final String KEY_LOCK_SCREEN_NOTIFICATIONS = "privacy_lock_screen_notifications";
     private static final String KEY_WORK_PROFILE_CATEGORY =
             "privacy_work_profile_notifications_category";
@@ -65,6 +73,30 @@
         return buildPreferenceControllers(context, getSettingsLifecycle());
     }
 
+    @Override
+    public void onViewCreated(View view, Bundle savedInstanceState) {
+        super.onViewCreated(view, savedInstanceState);
+        styleActionBar();
+    }
+
+    @VisibleForTesting
+    void styleActionBar() {
+        final Activity activity = getActivity();
+        final ActionBar actionBar = activity.getActionBar();
+        final Lifecycle lifecycle = getSettingsLifecycle();
+        final View scrollView = getListView();
+
+        if (actionBar == null) {
+            Log.w(TAG, "No actionbar, cannot style actionbar.");
+            return;
+        }
+
+        actionBar.setElevation(0);
+        if (lifecycle != null && scrollView != null) {
+            ActionBarShadowController.attachToView(activity, lifecycle, scrollView);
+        }
+    }
+
     private static List<AbstractPreferenceController> buildPreferenceControllers(
             Context context, Lifecycle lifecycle) {
         final List<AbstractPreferenceController> controllers = new ArrayList<>();
diff --git a/src/com/android/settings/slices/CustomSliceManager.java b/src/com/android/settings/slices/CustomSliceManager.java
index 3786c5c..c9e473a 100644
--- a/src/com/android/settings/slices/CustomSliceManager.java
+++ b/src/com/android/settings/slices/CustomSliceManager.java
@@ -18,7 +18,6 @@
 
 import android.content.Context;
 import android.net.Uri;
-import android.text.TextUtils;
 import android.util.ArrayMap;
 
 import androidx.annotation.VisibleForTesting;
@@ -35,6 +34,7 @@
 import com.android.settings.homepage.contextualcards.slices.NotificationChannelSlice;
 import com.android.settings.location.LocationSlice;
 import com.android.settings.media.MediaOutputSlice;
+import com.android.settings.network.telephony.MobileDataSlice;
 import com.android.settings.wifi.slice.ContextualWifiSlice;
 import com.android.settings.wifi.slice.WifiSlice;
 
@@ -123,6 +123,7 @@
         mUriMap.put(CustomSliceRegistry.FLASHLIGHT_SLICE_URI, FlashlightSlice.class);
         mUriMap.put(CustomSliceRegistry.LOCATION_SLICE_URI, LocationSlice.class);
         mUriMap.put(CustomSliceRegistry.LOW_STORAGE_SLICE_URI, LowStorageSlice.class);
+        mUriMap.put(CustomSliceRegistry.MOBILE_DATA_SLICE_URI, MobileDataSlice.class);
         mUriMap.put(CustomSliceRegistry.NOTIFICATION_CHANNEL_SLICE_URI,
                 NotificationChannelSlice.class);
         mUriMap.put(CustomSliceRegistry.STORAGE_SLICE_URI, StorageSlice.class);
diff --git a/src/com/android/settings/slices/CustomSliceRegistry.java b/src/com/android/settings/slices/CustomSliceRegistry.java
index 66e85c0..ab1b248 100644
--- a/src/com/android/settings/slices/CustomSliceRegistry.java
+++ b/src/com/android/settings/slices/CustomSliceRegistry.java
@@ -164,6 +164,16 @@
             .appendPath(SettingsSlicesContract.PATH_SETTING_ACTION)
             .appendPath("toggle_nfc")
             .build();
+
+    /**
+     * Backing Uri for Mobile Data Slice.
+     */
+    public static final Uri MOBILE_DATA_SLICE_URI = new Uri.Builder()
+            .scheme(ContentResolver.SCHEME_CONTENT)
+            .authority(SettingsSliceProvider.SLICE_AUTHORITY)
+            .appendEncodedPath(SettingsSlicesContract.PATH_SETTING_ACTION)
+            .appendPath("mobile_data")
+            .build();
     /**
      * Backing Uri for Notification channel Slice.
      */
diff --git a/src/com/android/settings/slices/CustomSliceable.java b/src/com/android/settings/slices/CustomSliceable.java
index b538b89..220cdc8 100644
--- a/src/com/android/settings/slices/CustomSliceable.java
+++ b/src/com/android/settings/slices/CustomSliceable.java
@@ -71,7 +71,7 @@
      *
      * @param intent which has the action taken on a {@link Slice}.
      */
-    void onNotifyChange(Intent intent);
+    default void onNotifyChange(Intent intent) {}
 
     /**
      * @return an {@link Intent} to the source of the Slice data.
@@ -90,11 +90,12 @@
     }
 
     /**
-     * Settings Slices which can represent component lists that are updatable by the
-     * {@link SliceBackgroundWorker} class returned here.
+     * 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 SliceBackgroundWorker} class for fetching the list of results in the
-     * background.
+     * @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/slices/SettingsSliceProvider.java b/src/com/android/settings/slices/SettingsSliceProvider.java
index 80b7133..d1648e0 100644
--- a/src/com/android/settings/slices/SettingsSliceProvider.java
+++ b/src/com/android/settings/slices/SettingsSliceProvider.java
@@ -21,7 +21,6 @@
 import android.app.slice.SliceManager;
 import android.content.ContentResolver;
 import android.content.Context;
-import android.content.Intent;
 import android.content.IntentFilter;
 import android.net.Uri;
 import android.os.StrictMode;
@@ -46,7 +45,6 @@
 import com.android.settingslib.SliceBroadcastRelay;
 import com.android.settingslib.utils.ThreadUtils;
 
-import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -150,18 +148,6 @@
     }
 
     @Override
-    public Uri onMapIntentToUri(Intent intent) {
-        try {
-            return getContext().getSystemService(SliceManager.class).mapIntentToUri(
-                    SliceDeepLinkSpringBoard.parse(
-                            intent.getData(), getContext().getPackageName()));
-        } catch (URISyntaxException e) {
-            Log.e(TAG, "Uri syntax error, can't map intent to uri.", e);
-            return null;
-        }
-    }
-
-    @Override
     public void onSlicePinned(Uri sliceUri) {
         if (mCustomSliceManager.isValidUri(sliceUri)) {
             final CustomSliceable sliceable = mCustomSliceManager.getSliceableFromUri(sliceUri);
@@ -464,8 +450,9 @@
 
     private List<Uri> getSpecialCaseOemUris() {
         return Arrays.asList(
-                CustomSliceRegistry.ZEN_MODE_SLICE_URI,
-                CustomSliceRegistry.FLASHLIGHT_SLICE_URI
+                CustomSliceRegistry.FLASHLIGHT_SLICE_URI,
+                CustomSliceRegistry.MOBILE_DATA_SLICE_URI,
+                CustomSliceRegistry.ZEN_MODE_SLICE_URI
         );
     }
 
diff --git a/src/com/android/settings/slices/SliceBackgroundWorker.java b/src/com/android/settings/slices/SliceBackgroundWorker.java
index 6df45ba..995394e 100644
--- a/src/com/android/settings/slices/SliceBackgroundWorker.java
+++ b/src/com/android/settings/slices/SliceBackgroundWorker.java
@@ -59,6 +59,14 @@
         mUri = uri;
     }
 
+    protected Uri getUri() {
+        return mUri;
+    }
+
+    protected Context getContext() {
+        return mContext;
+    }
+
     /**
      * Returns the singleton instance of the {@link SliceBackgroundWorker} for specified {@link Uri}
      * if exists
@@ -151,7 +159,7 @@
     /**
      * Notify that data was updated and attempt to sync changes to the Slice.
      */
-    protected void notifySliceChange() {
+    protected final void notifySliceChange() {
         mContext.getContentResolver().notifyChange(mUri, null);
     }
 }
\ No newline at end of file
diff --git a/src/com/android/settings/slices/SliceBuilderUtils.java b/src/com/android/settings/slices/SliceBuilderUtils.java
index 8b4bb74..8f85431 100644
--- a/src/com/android/settings/slices/SliceBuilderUtils.java
+++ b/src/com/android/settings/slices/SliceBuilderUtils.java
@@ -449,14 +449,14 @@
         int iconResource = data.getIconResource();
 
         if (iconResource == 0) {
-            iconResource = R.drawable.ic_settings;
+            iconResource = R.drawable.ic_settings_accent;
         }
         try {
             return IconCompat.createWithResource(context, iconResource);
         } catch (Exception e) {
             Log.w(TAG, "Falling back to settings icon because there is an error getting slice icon "
                     + data.getUri(), e);
-            return IconCompat.createWithResource(context, R.drawable.ic_settings);
+            return IconCompat.createWithResource(context, R.drawable.ic_settings_accent);
         }
     }
 }
diff --git a/src/com/android/settings/slices/SliceDeepLinkSpringBoard.java b/src/com/android/settings/slices/SliceDeepLinkSpringBoard.java
index d633b7a..f4afa16 100644
--- a/src/com/android/settings/slices/SliceDeepLinkSpringBoard.java
+++ b/src/com/android/settings/slices/SliceDeepLinkSpringBoard.java
@@ -21,94 +21,58 @@
 import android.provider.Settings;
 import android.util.Log;
 
-import androidx.annotation.Keep;
-
 import com.android.settings.bluetooth.BluetoothSliceBuilder;
 import com.android.settings.notification.ZenModeSliceBuilder;
 import com.android.settings.overlay.FeatureFactory;
 
-import java.net.URISyntaxException;
-
 public class SliceDeepLinkSpringBoard extends Activity {
 
     private static final String TAG = "DeeplinkSpringboard";
-    public static final String INTENT = "intent";
-    public static final String SETTINGS = "settings";
-    public static final String ACTION_VIEW_SLICE = "com.android.settings.action.VIEW_SLICE";
     public static final String EXTRA_SLICE = "slice";
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        Uri uri = getIntent().getData();
-        if (uri == null) {
+        final Uri sliceUri = parse(getIntent().getData());
+        if (sliceUri == null) {
             Log.e(TAG, "No data found");
             finish();
             return;
         }
         try {
-            Intent intent = parse(uri, getPackageName());
-            if (ACTION_VIEW_SLICE.equals(intent.getAction())) {
-                // This shouldn't matter since the slice is shown instead of the device
-                // index caring about the launch uri.
-                final Uri sliceUri = Uri.parse(intent.getStringExtra(EXTRA_SLICE));
-                Intent launchIntent;
+            // This shouldn't matter since the slice is shown instead of the device
+            // index caring about the launch uri.
+            Intent launchIntent;
 
-                // TODO (b/80263568) Avoid duplicating this list of Slice Uris.
-                final CustomSliceManager customSliceManager = FeatureFactory.getFactory(this)
-                        .getSlicesFeatureProvider().getCustomSliceManager(this);
-                if (customSliceManager.isValidUri(sliceUri)) {
-                    final CustomSliceable sliceable =
-                            customSliceManager.getSliceableFromUri(sliceUri);
-                    launchIntent = sliceable.getIntent();
-                } else if (CustomSliceRegistry.ZEN_MODE_SLICE_URI.equals(sliceUri)) {
-                    launchIntent = ZenModeSliceBuilder.getIntent(this /* context */);
-                } else if (CustomSliceRegistry.BLUETOOTH_URI.equals(sliceUri)) {
-                    launchIntent = BluetoothSliceBuilder.getIntent(this /* context */);
-                } else {
-                    final SlicesDatabaseAccessor slicesDatabaseAccessor =
-                            new SlicesDatabaseAccessor(this /* context */);
-                    // Sadly have to block here because we don't know where to go.
-                    final SliceData sliceData =
-                            slicesDatabaseAccessor.getSliceDataFromUri(sliceUri);
-                    launchIntent = SliceBuilderUtils.getContentIntent(this, sliceData);
-                }
-
-                startActivity(launchIntent);
+            // TODO (b/80263568) Avoid duplicating this list of Slice Uris.
+            final CustomSliceManager customSliceManager = FeatureFactory.getFactory(this)
+                    .getSlicesFeatureProvider().getCustomSliceManager(this);
+            if (customSliceManager.isValidUri(sliceUri)) {
+                final CustomSliceable sliceable =
+                        customSliceManager.getSliceableFromUri(sliceUri);
+                launchIntent = sliceable.getIntent();
+            } else if (CustomSliceRegistry.ZEN_MODE_SLICE_URI.equals(sliceUri)) {
+                launchIntent = ZenModeSliceBuilder.getIntent(this /* context */);
+            } else if (CustomSliceRegistry.BLUETOOTH_URI.equals(sliceUri)) {
+                launchIntent = BluetoothSliceBuilder.getIntent(this /* context */);
             } else {
-                startActivity(intent);
+                final SlicesDatabaseAccessor slicesDatabaseAccessor =
+                        new SlicesDatabaseAccessor(this /* context */);
+                // Sadly have to block here because we don't know where to go.
+                final SliceData sliceData =
+                        slicesDatabaseAccessor.getSliceDataFromUri(sliceUri);
+                launchIntent = SliceBuilderUtils.getContentIntent(this, sliceData);
             }
+            startActivity(launchIntent);
             finish();
-        } catch (URISyntaxException e) {
-            Log.e(TAG, "Error decoding uri", e);
-            finish();
-        } catch (IllegalStateException e) {
+        } catch (Exception e) {
             Log.w(TAG, "Couldn't launch Slice intent", e);
             startActivity(new Intent(Settings.ACTION_SETTINGS));
             finish();
         }
     }
 
-    @Keep
-    public static Uri createDeepLink(String s) {
-        return new Uri.Builder().scheme(SETTINGS)
-                .authority(SettingsSliceProvider.SLICE_AUTHORITY)
-                .appendQueryParameter(INTENT, s)
-                .build();
-    }
-
-    public static Intent parse(Uri uri, String pkg) throws URISyntaxException {
-        Intent intent = Intent.parseUri(uri.getQueryParameter(INTENT),
-                Intent.URI_ANDROID_APP_SCHEME);
-        // Start with some really strict constraints and loosen them if we need to.
-        // Don't allow components.
-        intent.setComponent(null);
-        // Clear out the extras.
-        if (intent.getExtras() != null) {
-            intent.getExtras().clear();
-        }
-        // Make sure this points at Settings.
-        intent.setPackage(pkg);
-        return intent;
+    private static Uri parse(Uri uri) {
+        return Uri.parse(uri.getQueryParameter(EXTRA_SLICE));
     }
 }
diff --git a/src/com/android/settings/widget/AdaptiveHomepageIcon.java b/src/com/android/settings/widget/AdaptiveHomepageIcon.java
index bec5d8d..bc7aaa7 100644
--- a/src/com/android/settings/widget/AdaptiveHomepageIcon.java
+++ b/src/com/android/settings/widget/AdaptiveHomepageIcon.java
@@ -72,11 +72,13 @@
                 // If found anything, use it.
                 if (bgColor != 0) {
                     setBackgroundColor(bgColor);
+                    return;
                 }
             }
         } catch (PackageManager.NameNotFoundException e) {
             Log.e(TAG, "Failed to set background color for " + tile.getPackageName());
         }
+        setBackgroundColor(context.getColor(R.color.homepage_generic_icon_background));
     }
 
     public void setBackgroundColor(int color) {
diff --git a/src/com/android/settings/widget/AddPreference.java b/src/com/android/settings/widget/AddPreference.java
index ce36ab3..2183fd4 100644
--- a/src/com/android/settings/widget/AddPreference.java
+++ b/src/com/android/settings/widget/AddPreference.java
@@ -34,6 +34,7 @@
 
     private OnAddClickListener mListener;
     private View mWidgetFrame;
+    private View mAddWidget;
 
     public AddPreference(Context context, AttributeSet attrs) {
         super(context, attrs);
@@ -53,6 +54,12 @@
        }
     }
 
+    public void setAddWidgetEnabled(boolean enabled) {
+        if (mAddWidget != null) {
+            mAddWidget.setEnabled(enabled);
+        }
+    }
+
     @Override
     protected int getSecondTargetResId() {
         return R.layout.preference_widget_add;
@@ -67,9 +74,9 @@
     public void onBindViewHolder(PreferenceViewHolder holder) {
         super.onBindViewHolder(holder);
         mWidgetFrame = holder.findViewById(android.R.id.widget_frame);
-        final View addWidget = holder.findViewById(getAddWidgetResId());
-        addWidget.setEnabled(true);
-        addWidget.setOnClickListener(this);
+        mAddWidget = holder.findViewById(getAddWidgetResId());
+        mAddWidget.setEnabled(true);
+        mAddWidget.setOnClickListener(this);
     }
 
     @Override
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index 881e3d2..2e12bce 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -203,7 +203,7 @@
         super.onViewCreated(view, savedInstanceState);
         final Activity activity = getActivity();
         if (activity != null) {
-            mProgressHeader = setPinnedHeaderView(R.layout.wifi_progress_header)
+            mProgressHeader = setPinnedHeaderView(R.layout.progress_header)
                     .findViewById(R.id.progress_bar_animation);
             setProgressBarVisible(false);
         }
diff --git a/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java b/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java
index 4aac538..65be11c 100644
--- a/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java
+++ b/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java
@@ -19,6 +19,9 @@
 import android.app.ActionBar;
 import android.app.settings.SettingsEnums;
 import android.content.Intent;
+import android.net.wifi.WifiConfiguration;
+import android.net.wifi.WifiInfo;
+import android.net.wifi.WifiManager;
 import android.os.Bundle;
 import android.provider.Settings;
 import android.util.Log;
@@ -31,6 +34,8 @@
 import com.android.settings.R;
 import com.android.settings.core.InstrumentedActivity;
 
+import java.util.List;
+
 /**
  * To provision "other" device with specified Wi-Fi network.
  *
@@ -78,6 +83,7 @@
 
     /** The Wi-Fi DPP QR code from intent ACTION_PROCESS_WIFI_EASY_CONNECT_QR_CODE */
     private WifiQrCode mWifiDppQrCode;
+
     /** Secret extra that allows fake networks to show in UI for testing purposes */
     private boolean mIsTest;
 
@@ -90,6 +96,9 @@
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
+        setContentView(R.layout.wifi_dpp_activity);
+        mFragmentManager = getSupportFragmentManager();
+
         if (savedInstanceState != null) {
             String qrCode = savedInstanceState.getString(KEY_QR_CODE);
 
@@ -103,13 +112,10 @@
 
             mWifiNetworkConfig = WifiNetworkConfig.getValidConfigOrNull(security, ssid,
                     preSharedKey, hiddenSsid, networkId);
+        } else {
+            handleIntent(getIntent());
         }
 
-        setContentView(R.layout.wifi_dpp_activity);
-        mFragmentManager = getSupportFragmentManager();
-
-        handleIntent(getIntent());
-
         ActionBar actionBar = getActionBar();
         if (actionBar != null) {
             actionBar.setElevation(0);
@@ -150,7 +156,13 @@
                 if (mWifiDppQrCode == null || !isDppSupported) {
                     cancelActivity = true;
                 } else {
-                    showChooseSavedWifiNetworkFragment(/* addToBackStack */ false);
+                    final WifiNetworkConfig connectedConfig = getConnectedWifiNetworkConfigOrNull();
+                    if (connectedConfig == null) {
+                        showChooseSavedWifiNetworkFragment(/* addToBackStack */ false);
+                    } else {
+                        mWifiNetworkConfig = connectedConfig;
+                        showAddDeviceFragment(/* addToBackStack */ false);
+                    }
                 }
                 break;
             default:
@@ -167,13 +179,18 @@
         WifiDppQrCodeScannerFragment fragment =
                 (WifiDppQrCodeScannerFragment) mFragmentManager.findFragmentByTag(
                         WifiDppUtils.TAG_FRAGMENT_QR_CODE_SCANNER);
-        // Avoid to replace the same fragment during configuration change
-        if (fragment != null && fragment.isVisible()) {
-            return;
-        }
 
         if (fragment == null) {
             fragment = new WifiDppQrCodeScannerFragment();
+        } else {
+            if (fragment.isVisible()) {
+                return;
+            }
+
+            // When the fragment in back stack but not on top of the stack, we can simply pop
+            // stack because current fragment transactions are arranged in an order
+            mFragmentManager.popBackStackImmediate();
+            return;
         }
         final FragmentTransaction fragmentTransaction = mFragmentManager.beginTransaction();
 
@@ -189,12 +206,19 @@
         WifiDppQrCodeGeneratorFragment fragment =
                 (WifiDppQrCodeGeneratorFragment) mFragmentManager.findFragmentByTag(
                         WifiDppUtils.TAG_FRAGMENT_QR_CODE_GENERATOR);
-        // Avoid to replace the same fragment during configuration change
-        if (fragment != null && fragment.isVisible()) {
+
+        if (fragment == null) {
+            fragment = new WifiDppQrCodeGeneratorFragment();
+        } else {
+            if (fragment.isVisible()) {
+                return;
+            }
+
+            // When the fragment in back stack but not on top of the stack, we can simply pop
+            // stack because current fragment transactions are arranged in an order
+            mFragmentManager.popBackStackImmediate();
             return;
         }
-
-        fragment = new WifiDppQrCodeGeneratorFragment();
         final FragmentTransaction fragmentTransaction = mFragmentManager.beginTransaction();
 
         fragmentTransaction.replace(R.id.fragment_container, fragment,
@@ -206,10 +230,6 @@
         WifiDppChooseSavedWifiNetworkFragment fragment =
                 (WifiDppChooseSavedWifiNetworkFragment) mFragmentManager.findFragmentByTag(
                         WifiDppUtils.TAG_FRAGMENT_CHOOSE_SAVED_WIFI_NETWORK);
-        // Avoid to replace the same fragment during configuration change
-        if (fragment != null && fragment.isVisible()) {
-            return;
-        }
 
         if (fragment == null) {
             fragment = new WifiDppChooseSavedWifiNetworkFragment();
@@ -218,6 +238,15 @@
                 bundle.putBoolean(WifiDppUtils.EXTRA_TEST, true);
                 fragment.setArguments(bundle);
             }
+        } else {
+            if (fragment.isVisible()) {
+                return;
+            }
+
+            // When the fragment in back stack but not on top of the stack, we can simply pop
+            // stack because current fragment transactions are arranged in an order
+            mFragmentManager.popBackStackImmediate();
+            return;
         }
         final FragmentTransaction fragmentTransaction = mFragmentManager.beginTransaction();
 
@@ -234,14 +263,17 @@
                 (WifiDppAddDeviceFragment) mFragmentManager.findFragmentByTag(
                         WifiDppUtils.TAG_FRAGMENT_ADD_DEVICE);
 
-        // Avoid to replace the same fragment during configuration change
-        if (mFragmentManager.findFragmentByTag(
-                WifiDppUtils.TAG_FRAGMENT_ADD_DEVICE) != null) {
-            return;
-        }
-
         if (fragment == null) {
             fragment = new WifiDppAddDeviceFragment();
+        } else {
+            if (fragment.isVisible()) {
+                return;
+            }
+
+            // When the fragment in back stack but not on top of the stack, we can simply pop
+            // stack because current fragment transactions are arranged in an order
+            mFragmentManager.popBackStackImmediate();
+            return;
         }
         final FragmentTransaction fragmentTransaction = mFragmentManager.beginTransaction();
 
@@ -359,4 +391,31 @@
 
         showAddDeviceFragment(/* addToBackStack */ true);
     }
+
+    private WifiNetworkConfig getConnectedWifiNetworkConfigOrNull() {
+        final WifiManager wifiManager = getSystemService(WifiManager.class);
+        if (!wifiManager.isWifiEnabled()) {
+            return null;
+        }
+
+        final WifiInfo connectionInfo = wifiManager.getConnectionInfo();
+        if (connectionInfo == null) {
+            return null;
+        }
+
+        final int connectionNetworkId = connectionInfo.getNetworkId();
+        final List<WifiConfiguration> configs = wifiManager.getConfiguredNetworks();
+        for (WifiConfiguration wifiConfiguration : configs) {
+            if (wifiConfiguration.networkId == connectionNetworkId) {
+                return WifiNetworkConfig.getValidConfigOrNull(
+                    WifiDppUtils.getSecurityString(wifiConfiguration),
+                    wifiConfiguration.getPrintableSsid(),
+                    wifiConfiguration.preSharedKey,
+                    /* hiddenSsid */ false,
+                    wifiConfiguration.networkId);
+            }
+        }
+
+        return null;
+    }
 }
diff --git a/src/com/android/settings/wifi/dpp/WifiDppEnrolleeActivity.java b/src/com/android/settings/wifi/dpp/WifiDppEnrolleeActivity.java
index df36ae5..143f87f 100644
--- a/src/com/android/settings/wifi/dpp/WifiDppEnrolleeActivity.java
+++ b/src/com/android/settings/wifi/dpp/WifiDppEnrolleeActivity.java
@@ -100,7 +100,9 @@
         setContentView(R.layout.wifi_dpp_activity);
         mFragmentManager = getSupportFragmentManager();
 
-        handleIntent(getIntent());
+        if (savedInstanceState == null) {
+            handleIntent(getIntent());
+        }
 
         ActionBar actionBar = getActionBar();
         if (actionBar != null) {
@@ -122,13 +124,23 @@
     }
 
     private void showQrCodeScannerFragment(boolean addToBackStack, String ssid) {
-        // Avoid to replace the same fragment during configuration change
-        if (mFragmentManager.findFragmentByTag(WifiDppUtils.TAG_FRAGMENT_QR_CODE_SCANNER) != null) {
+        WifiDppQrCodeScannerFragment fragment =
+                (WifiDppQrCodeScannerFragment) mFragmentManager.findFragmentByTag(
+                        WifiDppUtils.TAG_FRAGMENT_QR_CODE_SCANNER);
+
+        if (fragment == null) {
+            fragment = new WifiDppQrCodeScannerFragment(ssid);
+        } else {
+            if (fragment.isVisible()) {
+                return;
+            }
+
+            // When the fragment in back stack but not on top of the stack, we can simply pop
+            // stack because current fragment transactions are arranged in an order
+            mFragmentManager.popBackStackImmediate();
             return;
         }
-
-        WifiDppQrCodeScannerFragment fragment = new WifiDppQrCodeScannerFragment(ssid);
-        FragmentTransaction fragmentTransaction = mFragmentManager.beginTransaction();
+        final FragmentTransaction fragmentTransaction = mFragmentManager.beginTransaction();
 
         fragmentTransaction.replace(R.id.fragment_container, fragment,
                 WifiDppUtils.TAG_FRAGMENT_QR_CODE_SCANNER);
diff --git a/src/com/android/settings/wifi/dpp/WifiDppUtils.java b/src/com/android/settings/wifi/dpp/WifiDppUtils.java
index 9c69032..7bc80e0 100644
--- a/src/com/android/settings/wifi/dpp/WifiDppUtils.java
+++ b/src/com/android/settings/wifi/dpp/WifiDppUtils.java
@@ -18,6 +18,7 @@
 
 import android.content.Context;
 import android.content.Intent;
+import android.net.wifi.WifiConfiguration.KeyMgmt;
 import android.net.wifi.WifiConfiguration;
 import android.net.wifi.WifiManager;
 import android.text.TextUtils;
@@ -147,6 +148,17 @@
         }
     }
 
+    static String getSecurityString(WifiConfiguration config) {
+        if (config.allowedKeyManagement.get(KeyMgmt.SAE)) {
+            return WifiQrCode.SECURITY_SAE;
+        }
+        if (config.allowedKeyManagement.get(KeyMgmt.WPA_PSK)) {
+            return WifiQrCode.SECURITY_WPA_PSK;
+        }
+        return (config.wepKeys[0] == null) ?
+                WifiQrCode.SECURITY_NO_PASSWORD : WifiQrCode.SECURITY_WEP;
+    }
+
     /**
      * Returns an intent to launch QR code generator or scanner according to the Wi-Fi network
      * security. It may return null if the security is not supported by QR code generator nor
diff --git a/src/com/android/settings/wifi/dpp/WifiNetworkListFragment.java b/src/com/android/settings/wifi/dpp/WifiNetworkListFragment.java
index 89efc31..ce92f90 100644
--- a/src/com/android/settings/wifi/dpp/WifiNetworkListFragment.java
+++ b/src/com/android/settings/wifi/dpp/WifiNetworkListFragment.java
@@ -20,7 +20,6 @@
 import android.app.settings.SettingsEnums;
 import android.content.Context;
 import android.content.Intent;
-import android.net.NetworkInfo.DetailedState;
 import android.net.wifi.WifiConfiguration;
 import android.net.wifi.WifiManager;
 import android.os.Bundle;
@@ -28,7 +27,6 @@
 import android.view.View;
 import android.widget.Toast;
 
-import androidx.annotation.VisibleForTesting;
 import androidx.preference.Preference;
 import androidx.preference.PreferenceCategory;
 
@@ -64,9 +62,6 @@
     private WifiManager.ActionListener mSaveListener;
     private boolean mIsTest;
 
-    @VisibleForTesting
-    boolean mUseConnectedAccessPointDirectly;
-
     // Container Activity must implement this interface
     public interface OnChooseNetworkListener {
         public void onChooseNetwork(WifiNetworkConfig wifiNetworkConfig);
@@ -123,8 +118,6 @@
                 }
             }
         };
-
-        mUseConnectedAccessPointDirectly = true;
     }
 
     @Override
@@ -310,16 +303,6 @@
             if (isValidForDppConfiguration(accessPoint)) {
                 final String key = accessPoint.getKey();
 
-                // Check if this access point is already connected.
-                if (mUseConnectedAccessPointDirectly
-                        && accessPoint.getDetailedState() == DetailedState.CONNECTED) {
-                    // Uses connected access point to start DPP in Configurator-Initiator role
-                    // directly.
-                    onPreferenceTreeClick(createAccessPointPreference(accessPoint));
-                    removeCachedPrefs(mAccessPointsPreferenceCategory);
-                    return;
-                }
-
                 final AccessPointPreference pref = (AccessPointPreference) getCachedPreference(key);
                 if (pref != null) {
                     pref.setOrder(index);
diff --git a/src/com/android/settings/wifi/slice/ContextualWifiSlice.java b/src/com/android/settings/wifi/slice/ContextualWifiSlice.java
index fa8c267..7a6d1fa 100644
--- a/src/com/android/settings/wifi/slice/ContextualWifiSlice.java
+++ b/src/com/android/settings/wifi/slice/ContextualWifiSlice.java
@@ -16,17 +16,26 @@
 
 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.
@@ -56,6 +65,36 @@
         // 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 IconCompat.createWithBitmap(Utils.drawableToBitmap(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 1a0ed0c..b6fc17c 100644
--- a/src/com/android/settings/wifi/slice/WifiSlice.java
+++ b/src/com/android/settings/wifi/slice/WifiSlice.java
@@ -64,8 +64,8 @@
     @VisibleForTesting
     static final int DEFAULT_EXPANDED_ROW_COUNT = 3;
 
+    protected final Context mContext;
     protected final WifiManager mWifiManager;
-    private final Context mContext;
 
     public WifiSlice(Context context) {
         mContext = context;
@@ -85,7 +85,7 @@
                 R.drawable.ic_settings_wireless);
         final String title = mContext.getString(R.string.wifi_settings);
         final CharSequence summary = getSummary();
-        @ColorInt final int color = Utils.getColorAccentDefaultColor(mContext);
+        @ColorInt final int color = getSliceAccentColor();
         final PendingIntent toggleAction = getBroadcastIntent(mContext);
         final PendingIntent primaryAction = getPrimaryAction();
         final SliceAction primarySliceAction = SliceAction.createDeeplink(primaryAction, icon,
@@ -120,29 +120,22 @@
                 listBuilder.addRow(getAccessPointRow(results.get(i)));
             } else if (needLoadingRow) {
                 listBuilder.addRow(new ListBuilder.RowBuilder()
-                        .setTitle(mContext.getText(R.string.wifi_empty_list_wifi_on))
-                        .setSubtitle(placeholder));
+                        .setTitle(mContext.getText(R.string.wifi_empty_list_wifi_on)));
                 needLoadingRow = false;
             } else {
                 listBuilder.addRow(new ListBuilder.RowBuilder()
-                        .setTitle(placeholder)
-                        .setSubtitle(placeholder));
+                        .setTitle(placeholder));
             }
         }
         return listBuilder.build();
     }
 
     private ListBuilder.RowBuilder getAccessPointRow(AccessPoint accessPoint) {
-        final String title = accessPoint.getConfigName();
-        final IconCompat levelIcon = IconCompat.createWithResource(mContext,
-                com.android.settingslib.Utils.getWifiIconResource(accessPoint.getLevel()));
-        final CharSequence apSummary = accessPoint.getSettingsSummary();
+        final CharSequence title = accessPoint.getConfigName();
+        final IconCompat levelIcon = getAccessPointLevelIcon(accessPoint);
         final ListBuilder.RowBuilder rowBuilder = new ListBuilder.RowBuilder()
                 .setTitleItem(levelIcon, ListBuilder.ICON_IMAGE)
                 .setTitle(title)
-                .setSubtitle(!TextUtils.isEmpty(apSummary)
-                        ? apSummary
-                        : mContext.getText(R.string.summary_placeholder))
                 .setPrimaryAction(SliceAction.create(
                         getAccessPointAction(accessPoint), levelIcon, ListBuilder.ICON_IMAGE,
                         title));
@@ -154,9 +147,19 @@
         return rowBuilder;
     }
 
+    protected IconCompat getAccessPointLevelIcon(AccessPoint accessPoint) {
+        return IconCompat.createWithResource(mContext,
+                com.android.settingslib.Utils.getWifiIconResource(accessPoint.getLevel()));
+    }
+
+    @ColorInt
+    protected int getSliceAccentColor() {
+        return Utils.getColorAccentDefaultColor(mContext);
+    }
+
     private IconCompat getEndIcon(AccessPoint accessPoint) {
         if (accessPoint.isActive()) {
-            return IconCompat.createWithResource(mContext, R.drawable.ic_settings);
+            return IconCompat.createWithResource(mContext, R.drawable.ic_settings_accent);
         } else if (accessPoint.getSecurity() != AccessPoint.SECURITY_NONE) {
             return IconCompat.createWithResource(mContext, R.drawable.ic_friction_lock_closed);
         } else if (accessPoint.isMetered()) {
@@ -247,7 +250,7 @@
                 return mContext.getText(R.string.switch_off_text);
             case WifiManager.WIFI_STATE_UNKNOWN:
             default:
-                return "";
+                return null;
         }
     }
 
diff --git a/src/com/android/settings/wifi/tether/TetherService.java b/src/com/android/settings/wifi/tether/TetherService.java
index 4b39f67..09781a8 100644
--- a/src/com/android/settings/wifi/tether/TetherService.java
+++ b/src/com/android/settings/wifi/tether/TetherService.java
@@ -32,16 +32,20 @@
 import android.content.SharedPreferences;
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
+import android.content.res.Resources;
 import android.net.ConnectivityManager;
 import android.os.IBinder;
 import android.os.ResultReceiver;
 import android.os.SystemClock;
+import android.telephony.SubscriptionManager;
 import android.text.TextUtils;
 import android.util.ArrayMap;
 import android.util.Log;
 
 import androidx.annotation.VisibleForTesting;
 
+import com.android.settings.Utils;
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -65,7 +69,7 @@
 
     private int mCurrentTypeIndex;
     private boolean mInProvisionCheck;
-    private UsageStatsManagerWrapper mUsageManagerWrapper;
+    private TetherServiceWrapper mWrapper;
     private ArrayList<Integer> mCurrentTethers;
     private ArrayMap<Integer, List<ResultReceiver>> mPendingCallbacks;
     private HotspotOffReceiver mHotspotReceiver;
@@ -79,7 +83,7 @@
     public void onCreate() {
         super.onCreate();
         if (DEBUG) Log.d(TAG, "Creating TetherService");
-        String provisionResponse = getResources().getString(
+        String provisionResponse = getResourceForDefaultDataSubId().getString(
                 com.android.internal.R.string.config_mobile_hotspot_provision_response);
         registerReceiver(mReceiver, new IntentFilter(provisionResponse),
                 android.Manifest.permission.CONNECTIVITY_INTERNAL, null);
@@ -91,9 +95,6 @@
         mPendingCallbacks.put(ConnectivityManager.TETHERING_USB, new ArrayList<ResultReceiver>());
         mPendingCallbacks.put(
                 ConnectivityManager.TETHERING_BLUETOOTH, new ArrayList<ResultReceiver>());
-        if (mUsageManagerWrapper == null) {
-            mUsageManagerWrapper = new UsageStatsManagerWrapper(this);
-        }
         mHotspotReceiver = new HotspotOffReceiver(this);
     }
 
@@ -258,7 +259,7 @@
     }
 
     private Intent getProvisionBroadcastIntent(int index) {
-        String provisionAction = getResources().getString(
+        String provisionAction = getResourceForDefaultDataSubId().getString(
                 com.android.internal.R.string.config_mobile_hotspot_provision_app_no_ui);
         Intent intent = new Intent(provisionAction);
         int type = mCurrentTethers.get(index);
@@ -282,7 +283,7 @@
         for (ResolveInfo resolver : resolvers) {
             if (resolver.activityInfo.applicationInfo.isSystemApp()) {
                 String packageName = resolver.activityInfo.packageName;
-                mUsageManagerWrapper.setAppInactive(packageName, false);
+                getTetherServiceWrapper().setAppInactive(packageName, false);
             }
         }
     }
@@ -294,7 +295,7 @@
 
         PendingIntent pendingIntent = PendingIntent.getService(this, 0, intent, 0);
         AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
-        int period = getResources().getInteger(
+        int period = getResourceForDefaultDataSubId().getInteger(
                 com.android.internal.R.integer.config_mobile_hotspot_provision_check_period);
         long periodMs = period * MS_PER_HOUR;
         long firstTime = SystemClock.elapsedRealtime() + periodMs;
@@ -347,7 +348,7 @@
         @Override
         public void onReceive(Context context, Intent intent) {
             if (DEBUG) Log.d(TAG, "Got provision result " + intent);
-            String provisionResponse = getResources().getString(
+            String provisionResponse = getResourceForDefaultDataSubId().getString(
                     com.android.internal.R.string.config_mobile_hotspot_provision_response);
 
             if (provisionResponse.equals(intent.getAction())) {
@@ -385,19 +386,27 @@
     };
 
     @VisibleForTesting
-    void setUsageStatsManagerWrapper(UsageStatsManagerWrapper wrapper) {
-        mUsageManagerWrapper = wrapper;
+    void setTetherServiceWrapper(TetherServiceWrapper wrapper) {
+        mWrapper = wrapper;
+    }
+
+    private TetherServiceWrapper getTetherServiceWrapper() {
+        if (mWrapper == null) {
+            mWrapper = new TetherServiceWrapper(this);
+        }
+        return mWrapper;
     }
 
     /**
-     * A static helper class used for tests. UsageStatsManager cannot be mocked out becasue
-     * it's marked final. This class can be mocked out instead.
+     * A static helper class used for tests. UsageStatsManager cannot be mocked out because
+     * it's marked final. Static method SubscriptionManager#getResourcesForSubId also cannot
+     * be mocked. This class can be mocked out instead.
      */
     @VisibleForTesting
-    public static class UsageStatsManagerWrapper {
+    public static class TetherServiceWrapper {
         private final UsageStatsManager mUsageStatsManager;
 
-        UsageStatsManagerWrapper(Context context) {
+        TetherServiceWrapper(Context context) {
             mUsageStatsManager = (UsageStatsManager)
                     context.getSystemService(Context.USAGE_STATS_SERVICE);
         }
@@ -405,5 +414,15 @@
         void setAppInactive(String packageName, boolean isInactive) {
             mUsageStatsManager.setAppInactive(packageName, isInactive);
         }
+
+        int getDefaultDataSubscriptionId() {
+            return SubscriptionManager.getDefaultDataSubscriptionId();
+        }
+    }
+
+    @VisibleForTesting
+    Resources getResourceForDefaultDataSubId() {
+        final int subId = getTetherServiceWrapper().getDefaultDataSubscriptionId();
+        return Utils.getResourcesForSubId(this, subId);
     }
 }
diff --git a/tests/robotests/src/com/android/settings/accessibility/AccessibilityHearingAidPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/accessibility/AccessibilityHearingAidPreferenceControllerTest.java
index 951f203..3f4e82d 100644
--- a/tests/robotests/src/com/android/settings/accessibility/AccessibilityHearingAidPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/accessibility/AccessibilityHearingAidPreferenceControllerTest.java
@@ -181,6 +181,15 @@
         verify(mContext, never()).unregisterReceiver(any());
     }
 
+    @Test
+    public void getConnectedHearingAidDevice_doNotReturnSubDevice() {
+        when(mHearingAidProfile.getConnectedDevices()).thenReturn(generateHearingAidDeviceList());
+        when(mLocalBluetoothManager.getCachedDeviceManager().isSubDevice(mBluetoothDevice))
+                .thenReturn(true);
+
+        assertThat(mPreferenceController.getConnectedHearingAidDevice()).isNull();
+    }
+
     private void setupBluetoothEnvironment() {
         ShadowBluetoothUtils.sLocalBluetoothManager = mLocalBluetoothManager;
         mLocalBluetoothManager = Utils.getLocalBtManager(mContext);
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsProfilesControllerTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsProfilesControllerTest.java
index 9577fa7..57fd86b 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsProfilesControllerTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsProfilesControllerTest.java
@@ -294,6 +294,7 @@
         PbapServerProfile psp = mock(PbapServerProfile.class);
         when(psp.getNameResource(mDevice)).thenReturn(R.string.bluetooth_profile_pbap);
         when(psp.toString()).thenReturn(PbapServerProfile.NAME);
+        when(psp.isProfileReady()).thenReturn(true);
         when(mProfileManager.getPbapProfile()).thenReturn(psp);
 
         showScreen(mController);
@@ -316,6 +317,7 @@
         PbapServerProfile psp = mock(PbapServerProfile.class);
         when(psp.getNameResource(mDevice)).thenReturn(R.string.bluetooth_profile_pbap);
         when(psp.toString()).thenReturn(PbapServerProfile.NAME);
+        when(psp.isProfileReady()).thenReturn(true);
         when(mProfileManager.getPbapProfile()).thenReturn(psp);
 
         showScreen(mController);
@@ -336,6 +338,7 @@
         setupDevice(makeDefaultDeviceConfig());
         MapProfile mapProfile = mock(MapProfile.class);
         when(mapProfile.getNameResource(mDevice)).thenReturn(R.string.bluetooth_profile_map);
+        when(mapProfile.isProfileReady()).thenReturn(true);
         when(mProfileManager.getMapProfile()).thenReturn(mapProfile);
         when(mProfileManager.getProfileByName(eq(mapProfile.toString()))).thenReturn(mapProfile);
         mDevice.setMessageAccessPermission(BluetoothDevice.ACCESS_REJECTED);
@@ -361,6 +364,7 @@
         when(profile.supportsHighQualityAudio(mDevice)).thenReturn(supportsHighQualityAudio);
         when(profile.isHighQualityAudioEnabled(mDevice)).thenReturn(highQualityAudioEnabled);
         when(profile.isPreferred(mDevice)).thenReturn(preferred);
+        when(profile.isProfileReady()).thenReturn(true);
         mConnectableProfiles.add(profile);
         return profile;
     }
@@ -442,12 +446,25 @@
         setupDevice(makeDefaultDeviceConfig());
         A2dpProfile audioProfile = addMockA2dpProfile(false, true, true);
         showScreen(mController);
-        SwitchPreference audioPref =
-            (SwitchPreference) mScreen.findPreference(audioProfile.toString());
+        SwitchPreference audioPref = mScreen.findPreference(audioProfile.toString());
         SwitchPreference highQualityAudioPref = getHighQualityAudioPref();
         assertThat(audioPref).isNotNull();
         assertThat(audioPref.isChecked()).isFalse();
         assertThat(highQualityAudioPref).isNotNull();
         assertThat(highQualityAudioPref.isVisible()).isFalse();
     }
+
+    @Test
+    public void onResume_addServiceListener() {
+        mController.onResume();
+
+        verify(mProfileManager).addServiceListener(mController);
+    }
+
+    @Test
+    public void onPause_removeServiceListener() {
+        mController.onPause();
+
+        verify(mProfileManager).removeServiceListener(mController);
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragmentTest.java b/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragmentTest.java
index df87761..2328375 100644
--- a/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragmentTest.java
@@ -15,10 +15,8 @@
  */
 package com.android.settings.connecteddevice;
 
-import static com.android.settings.connecteddevice.ConnectedDeviceDashboardFragment
-        .KEY_AVAILABLE_DEVICES;
-import static com.android.settings.connecteddevice.ConnectedDeviceDashboardFragment
-        .KEY_CONNECTED_DEVICES;
+import static com.android.settings.connecteddevice.ConnectedDeviceDashboardFragment.KEY_AVAILABLE_DEVICES;
+import static com.android.settings.connecteddevice.ConnectedDeviceDashboardFragment.KEY_CONNECTED_DEVICES;
 
 import static com.google.common.truth.Truth.assertThat;
 
@@ -30,6 +28,9 @@
 import android.provider.SearchIndexableResource;
 
 import com.android.settings.R;
+import com.android.settings.core.BasePreferenceController;
+import com.android.settings.core.PreferenceControllerListHelper;
+import com.android.settings.slices.SlicePreferenceController;
 import com.android.settings.testutils.shadow.ShadowBluetoothAdapter;
 import com.android.settings.testutils.shadow.ShadowConnectivityManager;
 import com.android.settings.testutils.shadow.ShadowUserManager;
@@ -49,6 +50,7 @@
 @Config(shadows = {ShadowUserManager.class,
         ShadowConnectivityManager.class, ShadowBluetoothAdapter.class})
 public class ConnectedDeviceDashboardFragmentTest {
+    private static final String KEY_NEARBY_DEVICES = "bt_nearby_slice";
 
     @Mock
     private PackageManager mPackageManager;
@@ -64,7 +66,7 @@
     }
 
     @Test
-    public void testSearchIndexProvider_shouldIndexResource() {
+    public void searchIndexProvider_shouldIndexResource() {
         final List<SearchIndexableResource> indexRes =
                 ConnectedDeviceDashboardFragment.SEARCH_INDEX_DATA_PROVIDER
                         .getXmlResourcesToIndex(mContext, true /* enabled */);
@@ -74,10 +76,24 @@
     }
 
     @Test
-    public void testNonIndexableKeys_existInXmlLayout() {
+    public void nonIndexableKeys_existInXmlLayout() {
         final List<String> niks = ConnectedDeviceDashboardFragment.SEARCH_INDEX_DATA_PROVIDER
                 .getNonIndexableKeys(mContext);
 
-        assertThat(niks).containsExactly(KEY_CONNECTED_DEVICES, KEY_AVAILABLE_DEVICES);
+        assertThat(niks).containsExactly(KEY_CONNECTED_DEVICES, KEY_AVAILABLE_DEVICES,
+                KEY_NEARBY_DEVICES);
+    }
+
+    @Test
+    public void getPreferenceControllers_containSlicePrefController() {
+        final List<BasePreferenceController> controllers =
+                PreferenceControllerListHelper.getPreferenceControllersFromXml(mContext,
+                        R.xml.connected_devices);
+
+        assertThat(controllers
+                .stream()
+                .filter(controller -> controller instanceof SlicePreferenceController)
+                .count())
+                .isEqualTo(1);
     }
 }
diff --git a/tests/robotests/src/com/android/settings/datausage/AppDataUsageTest.java b/tests/robotests/src/com/android/settings/datausage/AppDataUsageTest.java
index 2855554..6cecd98 100644
--- a/tests/robotests/src/com/android/settings/datausage/AppDataUsageTest.java
+++ b/tests/robotests/src/com/android/settings/datausage/AppDataUsageTest.java
@@ -22,6 +22,7 @@
 import static org.mockito.ArgumentMatchers.anyBoolean;
 import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
@@ -31,10 +32,13 @@
 import static org.mockito.Mockito.when;
 
 import android.content.Context;
+import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageManager;
+import android.content.pm.PackageManager.NameNotFoundException;
 import android.net.NetworkPolicyManager;
 import android.net.NetworkTemplate;
 import android.os.Bundle;
+import android.os.Process;
 import android.telephony.SubscriptionManager;
 import android.text.format.DateUtils;
 import android.util.ArraySet;
@@ -56,6 +60,8 @@
 import com.android.settingslib.RestrictedSwitchPreference;
 import com.android.settingslib.net.NetworkCycleDataForUid;
 import com.android.settingslib.net.NetworkCycleDataForUidLoader;
+import com.android.settingslib.net.UidDetail;
+import com.android.settingslib.net.UidDetailProvider;
 
 import org.junit.After;
 import org.junit.Before;
@@ -96,6 +102,62 @@
     }
 
     @Test
+    public void onCreate_appUid_shouldGetAppLabelFromAppInfo() throws NameNotFoundException {
+        mFragment = spy(new AppDataUsage());
+        final FragmentActivity activity = spy(Robolectric.setupActivity(FragmentActivity.class));
+        doReturn(mPackageManager).when(activity).getPackageManager();
+        doReturn(activity).when(mFragment).getActivity();
+        doReturn(RuntimeEnvironment.application).when(mFragment).getContext();
+        ReflectionHelpers.setField(mFragment, "mDashboardFeatureProvider",
+            FakeFeatureFactory.setupForTest().dashboardFeatureProvider);
+        final String packageName = "testPackage";
+        final int uid = (Process.FIRST_APPLICATION_UID + Process.LAST_APPLICATION_UID) / 2;
+        doReturn(new String[] {packageName}).when(mPackageManager).getPackagesForUid(uid);
+        final String label = "testLabel";
+        final AppItem appItem = new AppItem(uid);
+        appItem.uids.put(uid, true);
+        final ApplicationInfo info = spy(new ApplicationInfo());
+        doReturn(label).when(info).loadLabel(mPackageManager);
+        when(mPackageManager.getApplicationInfoAsUser(
+            eq(packageName), anyInt() /* flags */, anyInt() /* userId */)).thenReturn(info);
+        final Bundle args = new Bundle();
+        args.putParcelable(AppDataUsage.ARG_APP_ITEM, appItem);
+        args.putInt(AppInfoBase.ARG_PACKAGE_UID, uid);
+        mFragment.setArguments(args);
+
+        mFragment.onCreate(Bundle.EMPTY);
+
+        assertThat(mFragment.mLabel).isEqualTo(label);
+    }
+
+    @Test
+    public void onCreate_notAppUid_shouldGetAppLabelFromUidDetailProvider() {
+        mFragment = spy(new AppDataUsage());
+        ReflectionHelpers.setField(mFragment, "mDashboardFeatureProvider",
+            FakeFeatureFactory.setupForTest().dashboardFeatureProvider);
+        doReturn(Robolectric.setupActivity(FragmentActivity.class)).when(mFragment).getActivity();
+        doReturn(RuntimeEnvironment.application).when(mFragment).getContext();
+        final UidDetailProvider uidDetailProvider = mock(UidDetailProvider.class);
+        doReturn(uidDetailProvider).when(mFragment).getUidDetailProvider();
+        final String label = "testLabel";
+        final int uid = Process.SYSTEM_UID;
+        final UidDetail uidDetail = new UidDetail();
+        uidDetail.label = label;
+        when(uidDetailProvider.getUidDetail(eq(uid), anyBoolean() /* blocking */)).
+            thenReturn(uidDetail);
+        final AppItem appItem = new AppItem(uid);
+        appItem.uids.put(uid, true);
+        final Bundle args = new Bundle();
+        args.putParcelable(AppDataUsage.ARG_APP_ITEM, appItem);
+        args.putInt(AppInfoBase.ARG_PACKAGE_UID, uid);
+        mFragment.setArguments(args);
+
+        mFragment.onCreate(Bundle.EMPTY);
+
+        assertThat(mFragment.mLabel).isEqualTo(label);
+    }
+
+    @Test
     public void bindAppHeader_allWorkApps_shouldNotShowAppInfoLink() {
         ShadowEntityHeaderController.setUseMock(mHeaderController);
         when(mHeaderController.setRecyclerView(any(), any())).thenReturn(mHeaderController);
@@ -283,6 +345,70 @@
         assertThat(uids.get(2)).isEqualTo(789);
     }
 
+    @Test
+    public void onCreateLoader_hasCyclesSpecified_shouldQueryDataUsageForSpecifiedCycles() {
+        final long startTime = 1521583200000L;
+        final long endTime = 1521676800000L;
+        ArrayList<Long> testCycles = new ArrayList<>();
+        testCycles.add(endTime);
+        testCycles.add(startTime);
+        final int uid = 123;
+        final AppItem appItem = new AppItem(uid);
+        appItem.category = AppItem.CATEGORY_APP;
+        appItem.addUid(uid);
+
+        mFragment = new AppDataUsage();
+        ReflectionHelpers.setField(mFragment, "mContext", RuntimeEnvironment.application);
+        ReflectionHelpers.setField(mFragment, "mCycles", testCycles);
+        ReflectionHelpers.setField(mFragment, "mAppItem", appItem);
+        ReflectionHelpers.setField(mFragment, "mTemplate",
+            NetworkTemplate.buildTemplateWifiWildcard());
+
+        final NetworkCycleDataForUidLoader loader = (NetworkCycleDataForUidLoader)
+            mFragment.mUidDataCallbacks.onCreateLoader(0 /* id */, Bundle.EMPTY /* args */);
+
+        final ArrayList<Long> cycles = loader.getCycles();
+        assertThat(cycles).hasSize(2);
+        assertThat(cycles.get(0)).isEqualTo(endTime);
+        assertThat(cycles.get(1)).isEqualTo(startTime);
+    }
+
+    @Test
+    public void onLoadFinished_hasSelectedCycleSpecified_shouldSelectSpecifiedCycle() {
+        final long now = System.currentTimeMillis();
+        final long tenDaysAgo = now - (DateUtils.DAY_IN_MILLIS * 10);
+        final long twentyDaysAgo = now - (DateUtils.DAY_IN_MILLIS * 20);
+        final long thirtyDaysAgo = now - (DateUtils.DAY_IN_MILLIS * 30);
+        final List<NetworkCycleDataForUid> data = new ArrayList<>();
+        NetworkCycleDataForUid.Builder builder = new NetworkCycleDataForUid.Builder();
+        builder.setStartTime(thirtyDaysAgo).setEndTime(twentyDaysAgo).setTotalUsage(9876L);
+        data.add(builder.build());
+        builder = new NetworkCycleDataForUid.Builder();
+        builder.setStartTime(twentyDaysAgo).setEndTime(tenDaysAgo).setTotalUsage(5678L);
+        data.add(builder.build());
+        builder = new NetworkCycleDataForUid.Builder();
+        builder.setStartTime(tenDaysAgo).setEndTime(now).setTotalUsage(1234L);
+        data.add(builder.build());
+
+        mFragment = new AppDataUsage();
+        ReflectionHelpers.setField(mFragment, "mContext", RuntimeEnvironment.application);
+        ReflectionHelpers.setField(mFragment, "mCycleAdapter", mock(CycleAdapter.class));
+        ReflectionHelpers.setField(mFragment, "mSelectedCycle", tenDaysAgo);
+        final Preference backgroundPref = mock(Preference.class);
+        ReflectionHelpers.setField(mFragment, "mBackgroundUsage", backgroundPref);
+        final Preference foregroundPref = mock(Preference.class);
+        ReflectionHelpers.setField(mFragment, "mForegroundUsage", foregroundPref);
+        final Preference totalPref = mock(Preference.class);
+        ReflectionHelpers.setField(mFragment, "mTotalUsage", totalPref);
+        final SpinnerPreference cycle = mock(SpinnerPreference.class);
+        ReflectionHelpers.setField(mFragment, "mCycle", cycle);
+
+        mFragment.mUidDataCallbacks.onLoadFinished(null /* loader */, data);
+
+        verify(cycle).setSelection(1);
+    }
+
+    @Test
     @Config(shadows = {ShadowDataUsageUtils.class, ShadowSubscriptionManager.class})
     public void onCreate_noNetworkTemplateAndInvalidDataSubscription_shouldUseWifiTemplate() {
         ShadowDataUsageUtils.IS_MOBILE_DATA_SUPPORTED = true;
@@ -293,6 +419,10 @@
         mFragment = spy(new AppDataUsage());
         doReturn(Robolectric.setupActivity(FragmentActivity.class)).when(mFragment).getActivity();
         doReturn(RuntimeEnvironment.application).when(mFragment).getContext();
+        final UidDetailProvider uidDetailProvider = mock(UidDetailProvider.class);
+        doReturn(uidDetailProvider).when(mFragment).getUidDetailProvider();
+        doReturn(new UidDetail()).when(uidDetailProvider).getUidDetail(anyInt(), anyBoolean());
+
         ReflectionHelpers.setField(mFragment, "mDashboardFeatureProvider",
             FakeFeatureFactory.setupForTest().dashboardFeatureProvider);
         final Bundle args = new Bundle();
diff --git a/tests/robotests/src/com/android/settings/datausage/DataUsageListTest.java b/tests/robotests/src/com/android/settings/datausage/DataUsageListTest.java
index 427550c..7d042ce 100644
--- a/tests/robotests/src/com/android/settings/datausage/DataUsageListTest.java
+++ b/tests/robotests/src/com/android/settings/datausage/DataUsageListTest.java
@@ -30,19 +30,27 @@
 import android.net.NetworkTemplate;
 import android.os.Bundle;
 import android.provider.Settings;
+import android.widget.Spinner;
 
+import com.android.settings.SettingsActivity;
 import com.android.settings.testutils.FakeFeatureFactory;
+import com.android.settingslib.AppItem;
 import com.android.settingslib.NetworkPolicyEditor;
 import com.android.settingslib.core.instrumentation.VisibilityLoggerMixin;
+import com.android.settingslib.net.NetworkCycleChartData;
 
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.RobolectricTestRunner;
 import org.robolectric.util.ReflectionHelpers;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import androidx.fragment.app.FragmentActivity;
 import androidx.preference.PreferenceManager;
 
@@ -124,4 +132,32 @@
         assertThat(mDataUsageList.mTemplate).isNotNull();
         assertThat(mDataUsageList.mSubId).isEqualTo(3);
     }
+
+    @Test
+    public void startAppDataUsage_shouldAddCyclesInfoToLaunchArguments() {
+        final long startTime = 1521583200000L;
+        final long endTime = 1521676800000L;
+        final List<NetworkCycleChartData> data = new ArrayList<>();
+        final NetworkCycleChartData.Builder builder = new NetworkCycleChartData.Builder();
+        builder.setStartTime(startTime)
+            .setEndTime(endTime);
+        data.add(builder.build());
+        ReflectionHelpers.setField(mDataUsageList, "mCycleData", data);
+        final Spinner spinner = mock(Spinner.class);
+        when(spinner.getSelectedItemPosition()).thenReturn(0);
+        ReflectionHelpers.setField(mDataUsageList, "mCycleSpinner", spinner);
+        final ArgumentCaptor<Intent> intent = ArgumentCaptor.forClass(Intent.class);
+
+        mDataUsageList.startAppDataUsage(new AppItem());
+
+        verify(mContext).startActivity(intent.capture());
+        final Bundle arguments =
+            intent.getValue().getBundleExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT_ARGUMENTS);
+        assertThat(arguments.getLong(AppDataUsage.ARG_SELECTED_CYCLE)).isEqualTo(endTime);
+        final ArrayList<Long> cycles =
+            (ArrayList) arguments.getSerializable(AppDataUsage.ARG_NETWORK_CYCLES);
+        assertThat(cycles).hasSize(2);
+        assertThat(cycles.get(0)).isEqualTo(endTime);
+        assertThat(cycles.get(1)).isEqualTo(startTime);
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceControllerTest.java
index feb3533..73fea77 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceControllerTest.java
@@ -341,7 +341,7 @@
         final StorageItemPreference apps = spy(new StorageItemPreference(mContext));
         apps.setIcon(R.drawable.ic_storage_apps);
         final StorageItemPreference system = spy(new StorageItemPreference(mContext));
-        system.setIcon(R.drawable.ic_system_update_vd_theme_24);
+        system.setIcon(R.drawable.ic_system_update);
         final StorageItemPreference files = spy(new StorageItemPreference(mContext));
         files.setIcon(R.drawable.ic_folder_vd_theme_24);
         final PreferenceScreen screen = mock(PreferenceScreen.class);
diff --git a/tests/robotests/src/com/android/settings/gestures/WakeScreenGesturePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/gestures/WakeScreenGesturePreferenceControllerTest.java
index 6149539..ecda5fd 100644
--- a/tests/robotests/src/com/android/settings/gestures/WakeScreenGesturePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/WakeScreenGesturePreferenceControllerTest.java
@@ -17,12 +17,14 @@
 package com.android.settings.gestures;
 
 import static com.android.settings.core.BasePreferenceController.AVAILABLE;
+import static com.android.settings.core.BasePreferenceController.DISABLED_DEPENDENT_SETTING;
 import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE;
 
 import static com.google.common.truth.Truth.assertThat;
 
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.Mockito.reset;
 import static org.mockito.Mockito.when;
 
 import android.content.Context;
@@ -77,6 +79,7 @@
 
     @Test
     public void getAvailabilityStatus_gestureNotSupported_UNSUPPORTED_ON_DEVICE() {
+        when(mAmbientDisplayConfiguration.alwaysOnEnabled(anyInt())).thenReturn(true);
         when(mAmbientDisplayConfiguration.wakeScreenGestureAvailable()).thenReturn(false);
         final int availabilityStatus = mController.getAvailabilityStatus();
 
@@ -85,6 +88,7 @@
 
     @Test
     public void getAvailabilityStatus_gestureSupported_AVAILABLE() {
+        when(mAmbientDisplayConfiguration.alwaysOnEnabled(anyInt())).thenReturn(true);
         when(mAmbientDisplayConfiguration.wakeScreenGestureAvailable()).thenReturn(true);
         final int availabilityStatus = mController.getAvailabilityStatus();
 
@@ -92,6 +96,25 @@
     }
 
     @Test
+    public void getAvailabilityStatus_gestureSupported_DISABLED_DEPENDENT_SETTING() {
+        when(mAmbientDisplayConfiguration.alwaysOnEnabled(anyInt())).thenReturn(false);
+        when(mAmbientDisplayConfiguration.wakeScreenGestureAvailable()).thenReturn(true);
+        final int availabilityStatus = mController.getAvailabilityStatus();
+
+        assertThat(availabilityStatus).isEqualTo(DISABLED_DEPENDENT_SETTING);
+    }
+
+    @Test
+    public void canHandleClicks_onlyWhenAlwaysOn() {
+        when(mAmbientDisplayConfiguration.alwaysOnEnabled(anyInt())).thenReturn(false);
+        assertThat(mController.canHandleClicks()).isEqualTo(false);
+
+        reset(mAmbientDisplayConfiguration);
+        when(mAmbientDisplayConfiguration.alwaysOnEnabled(anyInt())).thenReturn(true);
+        assertThat(mController.canHandleClicks()).isEqualTo(true);
+    }
+
+    @Test
     public void isSliceableCorrectKey_returnsTrue() {
         final WakeScreenGesturePreferenceController controller =
                 new WakeScreenGesturePreferenceController(mContext, "gesture_wake_screen");
diff --git a/tests/robotests/src/com/android/settings/homepage/contextualcards/ContextualCardLoaderTest.java b/tests/robotests/src/com/android/settings/homepage/contextualcards/ContextualCardLoaderTest.java
index c47fa38..f04008b 100644
--- a/tests/robotests/src/com/android/settings/homepage/contextualcards/ContextualCardLoaderTest.java
+++ b/tests/robotests/src/com/android/settings/homepage/contextualcards/ContextualCardLoaderTest.java
@@ -27,6 +27,7 @@
 import android.content.Context;
 import android.net.Uri;
 
+import com.android.settings.R;
 import com.android.settings.slices.CustomSliceRegistry;
 
 import org.junit.Before;
@@ -132,6 +133,14 @@
         assertThat(result).hasSize(2);
     }
 
+    @Test
+    public void loadInBackground_legacyMode_shouldReturnNothing() {
+        assertThat(mContext.getResources().getBoolean(R.bool.config_use_legacy_suggestion))
+                .isTrue();
+
+        assertThat(mContextualCardLoader.loadInBackground()).isEmpty();
+    }
+
     private ContextualCard getContextualCard(String sliceUri) {
         return new ContextualCard.Builder()
                 .setName("test_card")
diff --git a/tests/robotests/src/com/android/settings/network/MobileNetworkSummaryControllerTest.java b/tests/robotests/src/com/android/settings/network/MobileNetworkSummaryControllerTest.java
index 6a1abd1..ba152b9 100644
--- a/tests/robotests/src/com/android/settings/network/MobileNetworkSummaryControllerTest.java
+++ b/tests/robotests/src/com/android/settings/network/MobileNetworkSummaryControllerTest.java
@@ -24,6 +24,7 @@
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.ArgumentMatchers.isNull;
 import static org.mockito.ArgumentMatchers.notNull;
+import static org.mockito.Mockito.atLeastOnce;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.spy;
@@ -33,9 +34,12 @@
 import android.app.Activity;
 import android.content.Context;
 import android.content.Intent;
+import android.net.ConnectivityManager;
+import android.provider.Settings;
 import android.telephony.SubscriptionInfo;
 import android.telephony.TelephonyManager;
 import android.telephony.euicc.EuiccManager;
+import android.text.TextUtils;
 
 import com.android.settings.network.telephony.MobileNetworkActivity;
 import com.android.settings.widget.AddPreference;
@@ -61,7 +65,8 @@
     private Lifecycle mLifecycle;
     @Mock
     private TelephonyManager mTelephonyManager;
-
+    @Mock
+    private EuiccManager mEuiccManager;
     @Mock
     private PreferenceScreen mPreferenceScreen;
 
@@ -74,7 +79,9 @@
         MockitoAnnotations.initMocks(this);
         mContext = spy(Robolectric.setupActivity(Activity.class));
         when(mContext.getSystemService(eq(TelephonyManager.class))).thenReturn(mTelephonyManager);
+        when(mContext.getSystemService(EuiccManager.class)).thenReturn(mEuiccManager);
         when(mTelephonyManager.getMultiSimConfiguration()).thenReturn(UNKNOWN);
+        when(mEuiccManager.isEnabled()).thenReturn(true);
 
         mController = new MobileNetworkSummaryController(mContext, mLifecycle);
         mPreference = spy(new AddPreference(mContext, null));
@@ -89,6 +96,14 @@
     }
 
     @Test
+    public void isAvailable_wifiOnlyMode_notAvailable() {
+        ConnectivityManager cm = mock(ConnectivityManager.class);
+        when(cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)).thenReturn(false);
+        when(mContext.getSystemService(ConnectivityManager.class)).thenReturn(cm);
+        assertThat(mController.isAvailable()).isFalse();
+    }
+
+    @Test
     public void getSummary_noSubscriptions_correctSummaryAndClickHandler() {
         mController.displayPreference(mPreferenceScreen);
         mController.onResume();
@@ -102,6 +117,14 @@
     }
 
     @Test
+    public void getSummary_noSubscriptionsNoEuiccMgr_correctSummaryAndClickHandler() {
+        when(mEuiccManager.isEnabled()).thenReturn(false);
+        assertThat(TextUtils.isEmpty(mController.getSummary())).isTrue();
+        assertThat(mPreference.getOnPreferenceClickListener()).isNull();
+        assertThat(mPreference.getFragment()).isNull();
+    }
+
+    @Test
     public void getSummary_oneSubscription_correctSummaryAndClickHandler() {
         final SubscriptionInfo sub1 = mock(SubscriptionInfo.class);
         when(sub1.getSubscriptionId()).thenReturn(1);
@@ -205,6 +228,15 @@
     }
 
     @Test
+    public void addButton_noSubscriptionsMultiSimModeNoEuiccMgr_noAddClickListener() {
+        when(mTelephonyManager.getMultiSimConfiguration()).thenReturn(DSDS);
+        when(mEuiccManager.isEnabled()).thenReturn(false);
+        mController.displayPreference(mPreferenceScreen);
+        mController.onResume();
+        verify(mPreference, never()).setOnAddClickListener(notNull());
+    }
+
+    @Test
     public void addButton_noSubscriptionsMultiSimMode_hasAddClickListenerAndPrefDisabled() {
         when(mTelephonyManager.getMultiSimConfiguration()).thenReturn(DSDS);
         mController.displayPreference(mPreferenceScreen);
@@ -236,4 +268,73 @@
         verify(mPreference, never()).setOnAddClickListener(isNull());
         verify(mPreference).setOnAddClickListener(notNull());
     }
+
+    @Test
+    public void addButton_oneSubscriptionAirplaneModeTurnedOn_addButtonGetsDisabled() {
+        when(mTelephonyManager.getMultiSimConfiguration()).thenReturn(DSDS);
+        final SubscriptionInfo sub1 = mock(SubscriptionInfo.class);
+        SubscriptionUtil.setAvailableSubscriptionsForTesting(Arrays.asList(sub1));
+        mController.displayPreference(mPreferenceScreen);
+        mController.onResume();
+
+        Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, 1);
+        mController.onAirplaneModeChanged(true);
+
+        ArgumentCaptor<Boolean> captor = ArgumentCaptor.forClass(Boolean.class);
+        verify(mPreference, atLeastOnce()).setAddWidgetEnabled(captor.capture());
+        assertThat(captor.getValue()).isFalse();
+    }
+
+    @Test
+    public void onResume_oneSubscriptionAirplaneMode_isDisabled() {
+        when(mTelephonyManager.getMultiSimConfiguration()).thenReturn(DSDS);
+        Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, 1);
+        final SubscriptionInfo sub1 = mock(SubscriptionInfo.class);
+        SubscriptionUtil.setAvailableSubscriptionsForTesting(Arrays.asList(sub1));
+        mController.displayPreference(mPreferenceScreen);
+        mController.onResume();
+
+        assertThat(mPreference.isEnabled()).isFalse();
+
+        ArgumentCaptor<Boolean> captor = ArgumentCaptor.forClass(Boolean.class);
+        verify(mPreference, atLeastOnce()).setAddWidgetEnabled(captor.capture());
+        assertThat(captor.getValue()).isFalse();
+    }
+
+    @Test
+    public void onAirplaneModeChanged_oneSubscriptionAirplaneModeGetsTurnedOn_isDisabled() {
+        final SubscriptionInfo sub1 = mock(SubscriptionInfo.class);
+        SubscriptionUtil.setAvailableSubscriptionsForTesting(Arrays.asList(sub1));
+        mController.displayPreference(mPreferenceScreen);
+        mController.onResume();
+
+        assertThat(mPreference.isEnabled()).isTrue();
+
+        Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, 1);
+        mController.onAirplaneModeChanged(true);
+
+        assertThat(mPreference.isEnabled()).isFalse();
+    }
+
+    @Test
+    public void onAirplaneModeChanged_oneSubscriptionAirplaneModeGetsTurnedOff_isEnabled() {
+        when(mTelephonyManager.getMultiSimConfiguration()).thenReturn(DSDS);
+        Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, 1);
+        final SubscriptionInfo sub1 = mock(SubscriptionInfo.class);
+        SubscriptionUtil.setAvailableSubscriptionsForTesting(Arrays.asList(sub1));
+        mController.displayPreference(mPreferenceScreen);
+        mController.onResume();
+
+        assertThat(mPreference.isEnabled()).isFalse();
+
+        Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, 0);
+        mController.onAirplaneModeChanged(false);
+
+        assertThat(mPreference.isEnabled()).isTrue();
+
+        ArgumentCaptor<Boolean> captor = ArgumentCaptor.forClass(Boolean.class);
+        verify(mPreference, atLeastOnce()).setAddWidgetEnabled(eq(false));
+        verify(mPreference, atLeastOnce()).setAddWidgetEnabled(captor.capture());
+        assertThat(captor.getValue()).isTrue();
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/network/SubscriptionUtilTest.java b/tests/robotests/src/com/android/settings/network/SubscriptionUtilTest.java
index e0334b1..dbc122a 100644
--- a/tests/robotests/src/com/android/settings/network/SubscriptionUtilTest.java
+++ b/tests/robotests/src/com/android/settings/network/SubscriptionUtilTest.java
@@ -47,7 +47,7 @@
 
     @Test
     public void getAvailableSubscriptions_nullInfoFromSubscriptionManager_nonNullResult() {
-        when(mManager.getAvailableSubscriptionInfoList()).thenReturn(null);
+        when(mManager.getSelectableSubscriptionInfoList()).thenReturn(null);
         final List<SubscriptionInfo> subs = SubscriptionUtil.getAvailableSubscriptions(mManager);
         assertThat(subs).isNotNull();
         assertThat(subs).isEmpty();
@@ -57,7 +57,7 @@
     public void getAvailableSubscriptions_oneSubscription_oneResult() {
         final SubscriptionInfo info = mock(SubscriptionInfo.class);
         when(info.getMncString()).thenReturn("fake1234");
-        when(mManager.getAvailableSubscriptionInfoList()).thenReturn(Arrays.asList(info));
+        when(mManager.getSelectableSubscriptionInfoList()).thenReturn(Arrays.asList(info));
         final List<SubscriptionInfo> subs = SubscriptionUtil.getAvailableSubscriptions(mManager);
         assertThat(subs).isNotNull();
         assertThat(subs).hasSize(1);
@@ -69,7 +69,7 @@
         final SubscriptionInfo info2 = mock(SubscriptionInfo.class);
         when(info1.getMncString()).thenReturn("fake1234");
         when(info2.getMncString()).thenReturn("fake5678");
-        when(mManager.getAvailableSubscriptionInfoList()).thenReturn(Arrays.asList(info1, info2));
+        when(mManager.getSelectableSubscriptionInfoList()).thenReturn(Arrays.asList(info1, info2));
         final List<SubscriptionInfo> subs = SubscriptionUtil.getAvailableSubscriptions(mManager);
         assertThat(subs).isNotNull();
         assertThat(subs).hasSize(2);
@@ -82,7 +82,7 @@
         final SubscriptionInfo info3 = mock(SubscriptionInfo.class);
         when(info1.getSubscriptionId()).thenReturn(1);
         when(info1.getMncString()).thenReturn("fake1234");
-        when(mManager.getAvailableSubscriptionInfoList()).thenReturn(
+        when(mManager.getSelectableSubscriptionInfoList()).thenReturn(
                 new ArrayList<>(Arrays.asList(info1, info2, info3)));
         final List<SubscriptionInfo> subs = SubscriptionUtil.getAvailableSubscriptions(mManager);
         assertThat(subs).isNotNull();
@@ -100,7 +100,7 @@
         when(info1.getMncString()).thenReturn("fake1234");
         when(info4.getSubscriptionId()).thenReturn(4);
         when(info4.getMncString()).thenReturn("fake5678");
-        when(mManager.getAvailableSubscriptionInfoList()).thenReturn(new ArrayList<>(
+        when(mManager.getSelectableSubscriptionInfoList()).thenReturn(new ArrayList<>(
                 Arrays.asList(info1, info2, info3, info4)));
         final List<SubscriptionInfo> subs = SubscriptionUtil.getAvailableSubscriptions(mManager);
         assertThat(subs).isNotNull();
diff --git a/tests/robotests/src/com/android/settings/network/telephony/CarrierSettingsVersionPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/network/telephony/CarrierSettingsVersionPreferenceControllerTest.java
new file mode 100644
index 0000000..268c581
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/network/telephony/CarrierSettingsVersionPreferenceControllerTest.java
@@ -0,0 +1,73 @@
+/*
+ * 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.network.telephony;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.content.Context;
+import android.os.PersistableBundle;
+import android.telephony.CarrierConfigManager;
+
+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.Shadows;
+import org.robolectric.annotation.Config;
+import org.robolectric.shadows.ShadowCarrierConfigManager;
+
+@RunWith(RobolectricTestRunner.class)
+@Config(shadows = ShadowCarrierConfigManager.class)
+public class CarrierSettingsVersionPreferenceControllerTest {
+
+    private ShadowCarrierConfigManager mCarrierConfigManager;
+    private CarrierSettingsVersionPreferenceController mController;
+    private int mSubscriptionId = 1234;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        final Context context = RuntimeEnvironment.application;
+        mController = new CarrierSettingsVersionPreferenceController(context, "dummy_key");
+        mController.init(mSubscriptionId);
+        mCarrierConfigManager = Shadows.shadowOf(
+                context.getSystemService(CarrierConfigManager.class));
+    }
+
+    @Test
+    public void getSummary_nullConfig_noCrash() {
+        mCarrierConfigManager.setConfigForSubId(mSubscriptionId, null);
+        assertThat(mController.getSummary()).isNull();
+    }
+
+    @Test
+    public void getSummary_nullVersionString_noCrash() {
+        mCarrierConfigManager.setConfigForSubId(mSubscriptionId, new PersistableBundle());
+        assertThat(mController.getSummary()).isNull();
+    }
+
+    @Test
+    public void getSummary_hasVersionString_correctSummary() {
+        final PersistableBundle bundle = new PersistableBundle();
+        bundle.putString(CarrierConfigManager.KEY_CARRIER_CONFIG_VERSION_STRING,
+                "test_version_123");
+        mCarrierConfigManager.setConfigForSubId(mSubscriptionId, bundle);
+        assertThat(mController.getSummary()).isEqualTo("test_version_123");
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/network/telephony/MobileDataSliceTest.java b/tests/robotests/src/com/android/settings/network/telephony/MobileDataSliceTest.java
new file mode 100644
index 0000000..c497cf8
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/network/telephony/MobileDataSliceTest.java
@@ -0,0 +1,165 @@
+/*
+ * 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.network.telephony;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
+import android.content.Context;
+import android.content.Intent;
+import android.provider.Settings;
+import android.telephony.SubscriptionInfo;
+import android.telephony.SubscriptionManager;
+import android.telephony.TelephonyManager;
+
+import androidx.core.graphics.drawable.IconCompat;
+import androidx.slice.Slice;
+import androidx.slice.SliceMetadata;
+import androidx.slice.SliceProvider;
+import androidx.slice.core.SliceAction;
+import androidx.slice.widget.SliceLiveData;
+
+import com.android.settings.R;
+
+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 java.util.List;
+
+@RunWith(RobolectricTestRunner.class)
+public class MobileDataSliceTest {
+
+    private static final int SUB_ID = 2;
+
+    @Mock
+    private TelephonyManager mTelephonyManager;
+    @Mock
+    private SubscriptionManager mSubscriptionManager;
+    @Mock
+    private SubscriptionInfo mSubscriptionInfo;
+
+    private Context mContext;
+    private MobileDataSlice mMobileDataSlice;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        mContext = spy(RuntimeEnvironment.application);
+
+        doReturn(mTelephonyManager).when(mContext).getSystemService(Context.TELEPHONY_SERVICE);
+        doReturn(mSubscriptionManager).when(mContext).getSystemService(SubscriptionManager.class);
+        doReturn(mTelephonyManager).when(mTelephonyManager).createForSubscriptionId(SUB_ID);
+        doReturn(mSubscriptionInfo).when(mSubscriptionManager).getDefaultDataSubscriptionInfo();
+        doReturn(SUB_ID).when(mSubscriptionInfo).getSubscriptionId();
+
+        // Set-up specs for SliceMetadata.
+        SliceProvider.setSpecs(SliceLiveData.SUPPORTED_SPECS);
+
+        mMobileDataSlice = spy(new MobileDataSlice(mContext));
+    }
+
+    @Test
+    public void getSlice_shouldHaveTitleAndToggle() {
+        final Slice mobileData = mMobileDataSlice.getSlice();
+
+        final SliceMetadata metadata = SliceMetadata.from(mContext, mobileData);
+        assertThat(metadata.getTitle())
+                .isEqualTo(mContext.getString(R.string.mobile_data_settings_title));
+
+        final List<SliceAction> toggles = metadata.getToggles();
+        assertThat(toggles).hasSize(1);
+
+        final SliceAction primaryAction = metadata.getPrimaryAction();
+        final IconCompat expectedToggleIcon = IconCompat.createWithResource(mContext,
+                R.drawable.ic_network_cell);
+        assertThat(primaryAction.getIcon().toString()).isEqualTo(expectedToggleIcon.toString());
+    }
+
+    @Test
+    public void handleUriChange_turnedOn_updatesMobileData() {
+        doReturn(false).when(mMobileDataSlice).isAirplaneModeEnabled();
+        doReturn(mSubscriptionInfo).when(mSubscriptionManager).getActiveSubscriptionInfo(SUB_ID);
+        final Intent intent = mMobileDataSlice.getIntent();
+        intent.putExtra(android.app.slice.Slice.EXTRA_TOGGLE_STATE, true);
+
+        mMobileDataSlice.onNotifyChange(intent);
+
+        verify(mTelephonyManager).setDataEnabled(true);
+    }
+
+    @Test
+    public void handleUriChange_turnedOff_updatesMobileData() {
+        doReturn(false).when(mMobileDataSlice).isAirplaneModeEnabled();
+        doReturn(mSubscriptionInfo).when(mSubscriptionManager).getActiveSubscriptionInfo(SUB_ID);
+        final Intent intent = mMobileDataSlice.getIntent();
+        intent.putExtra(android.app.slice.Slice.EXTRA_TOGGLE_STATE, false);
+
+        mMobileDataSlice.onNotifyChange(intent);
+
+        verify(mTelephonyManager).setDataEnabled(false);
+    }
+
+    @Test
+    public void handleUriChange_turnedOff_airplaneModeOn_mobileDataDoesNotUpdate() {
+        doReturn(true).when(mMobileDataSlice).isAirplaneModeEnabled();
+        doReturn(mSubscriptionInfo).when(mSubscriptionManager).getActiveSubscriptionInfo(SUB_ID);
+        final Intent intent = mMobileDataSlice.getIntent();
+        intent.putExtra(android.app.slice.Slice.EXTRA_TOGGLE_STATE, false);
+
+        mMobileDataSlice.onNotifyChange(intent);
+
+        verify(mTelephonyManager, times(0)).setDataEnabled(true);
+    }
+
+    @Test
+    public void isAirplaneModeEnabled_correctlyReturnsTrue() {
+        Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, 1);
+
+        final boolean isAirplaneModeEnabled = mMobileDataSlice.isAirplaneModeEnabled();
+
+        assertThat(isAirplaneModeEnabled).isTrue();
+    }
+
+    @Test
+    public void isAirplaneModeEnabled_correctlyReturnsFalse() {
+        Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, 0);
+
+        final boolean isAirplaneModeEnabled = mMobileDataSlice.isAirplaneModeEnabled();
+
+        assertThat(isAirplaneModeEnabled).isFalse();
+    }
+
+    @Test
+    public void isMobileDataEnabled_mobileDataEnabled() {
+        final boolean seed = true;
+        doReturn(seed).when(mTelephonyManager).isDataEnabled();
+
+        final boolean isMobileDataEnabled = mMobileDataSlice.isMobileDataEnabled();
+
+        assertThat(isMobileDataEnabled).isEqualTo(seed);
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkActivityTest.java b/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkActivityTest.java
index 447931e..3b5cdf9 100644
--- a/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkActivityTest.java
+++ b/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkActivityTest.java
@@ -148,7 +148,7 @@
         doReturn(intent).when(mMobileNetworkActivity).getIntent();
         mSubscriptionInfos.add(mSubscriptionInfo);
         mSubscriptionInfos.add(mSubscriptionInfo2);
-        doReturn(mSubscriptionInfos).when(mSubscriptionManager).getAvailableSubscriptionInfoList();
+        doReturn(mSubscriptionInfos).when(mSubscriptionManager).getSelectableSubscriptionInfoList();
         doReturn(true).when(mSubscriptionManager).isActiveSubscriptionId(CURRENT_SUB_ID);
 
         assertThat(mMobileNetworkActivity.getSubscriptionId()).isEqualTo(CURRENT_SUB_ID);
diff --git a/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkUtilsTest.java b/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkUtilsTest.java
index 34e680e..7dfe520 100644
--- a/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkUtilsTest.java
+++ b/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkUtilsTest.java
@@ -41,7 +41,6 @@
 import android.telephony.TelephonyManager;
 
 import com.android.internal.telephony.PhoneConstants;
-import com.android.settings.R;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -184,4 +183,19 @@
 
         assertThat(MobileNetworkUtils.isCdmaOptions(mContext, SUB_ID_1)).isTrue();
     }
+
+    @Test
+    public void getSearchableSubscriptionId_oneActive_returnValid() {
+        when(mSubscriptionManager.getActiveSubscriptionIdList()).thenReturn(new int[]{SUB_ID_1});
+
+        assertThat(MobileNetworkUtils.getSearchableSubscriptionId(mContext)).isEqualTo(SUB_ID_1);
+    }
+
+    @Test
+    public void getSearchableSubscriptionId_nonActive_returnInvalid() {
+        when(mSubscriptionManager.getActiveSubscriptionIdList()).thenReturn(new int[0]);
+
+        assertThat(MobileNetworkUtils.getSearchableSubscriptionId(mContext))
+                .isEqualTo(SubscriptionManager.INVALID_SUBSCRIPTION_ID);
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/network/telephony/TelephonyBasePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/network/telephony/TelephonyBasePreferenceControllerTest.java
new file mode 100644
index 0000000..886ea17
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/network/telephony/TelephonyBasePreferenceControllerTest.java
@@ -0,0 +1,93 @@
+/*
+ * 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.network.telephony;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.telephony.SubscriptionManager;
+
+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 TelephonyBasePreferenceControllerTest {
+    private static final int VALID_SUB_ID = 1;
+
+    @Mock
+    private SubscriptionManager mSubscriptionManager;
+
+    private TestPreferenceController mPreferenceController;
+    private Context mContext;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+
+        mContext = spy(RuntimeEnvironment.application);
+        when(mContext.getSystemService(SubscriptionManager.class))
+                .thenReturn(mSubscriptionManager);
+        when(mSubscriptionManager.getActiveSubscriptionIdList()).thenReturn(new int[]{});
+        mPreferenceController = new TestPreferenceController(mContext, "prefKey");
+    }
+
+    @Test
+    public void isAvailable_validSubIdSet_returnTrue() {
+        mPreferenceController.init(VALID_SUB_ID);
+
+        assertThat(mPreferenceController.isAvailable()).isTrue();
+    }
+
+    @Test
+    public void isAvailable_noIdSetHoweverHasDefaultOne_returnTrue() {
+        when(mSubscriptionManager.getActiveSubscriptionIdList())
+                .thenReturn(new int[]{VALID_SUB_ID});
+
+        assertThat(mPreferenceController.isAvailable()).isTrue();
+    }
+
+    @Test
+    public void isAvailable_noDefaultAndNoSet_returnFalse() {
+        assertThat(mPreferenceController.isAvailable()).isFalse();
+    }
+
+    /**
+     * Test preference controller for {@link TelephonyBasePreferenceController}
+     */
+    public class TestPreferenceController extends TelephonyBasePreferenceController {
+        public TestPreferenceController(Context context, String prefKey) {
+            super(context, prefKey);
+        }
+
+        public void init(int subId) {
+            mSubId = subId;
+        }
+
+        @Override
+        public int getAvailabilityStatus(int subId) {
+            return subId == VALID_SUB_ID ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
+        }
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/network/telephony/VideoCallingPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/network/telephony/VideoCallingPreferenceControllerTest.java
index a057022..d904ab3 100644
--- a/tests/robotests/src/com/android/settings/network/telephony/VideoCallingPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/network/telephony/VideoCallingPreferenceControllerTest.java
@@ -84,14 +84,14 @@
 
     @Test
     public void isVideoCallEnabled_allFlagsOn_returnTrue() {
-        assertThat(mController.isVideoCallEnabled()).isTrue();
+        assertThat(mController.isVideoCallEnabled(SUB_ID, mImsManager)).isTrue();
     }
 
     @Test
     public void isVideoCallEnabled_disabledByPlatform_returnFalse() {
         doReturn(false).when(mImsManager).isVtEnabledByPlatform();
 
-        assertThat(mController.isVideoCallEnabled()).isFalse();
+        assertThat(mController.isVideoCallEnabled(SUB_ID, mImsManager)).isFalse();
     }
 
     @Test
@@ -100,7 +100,7 @@
                 CarrierConfigManager.KEY_IGNORE_DATA_ENABLED_CHANGED_FOR_VIDEO_CALLS, false);
         doReturn(false).when(mTelephonyManager).isDataEnabled();
 
-        assertThat(mController.isVideoCallEnabled()).isFalse();
+        assertThat(mController.isVideoCallEnabled(SUB_ID, mImsManager)).isFalse();
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/panel/FakePanelContent.java b/tests/robotests/src/com/android/settings/panel/FakePanelContent.java
index 1d79952..8f54115 100644
--- a/tests/robotests/src/com/android/settings/panel/FakePanelContent.java
+++ b/tests/robotests/src/com/android/settings/panel/FakePanelContent.java
@@ -18,6 +18,7 @@
 
 import static com.android.settings.slices.CustomSliceRegistry.WIFI_SLICE_URI;
 
+import android.app.settings.SettingsEnums;
 import android.content.Intent;
 import android.net.Uri;
 
@@ -53,4 +54,9 @@
     public Intent getSeeMoreIntent() {
         return INTENT;
     }
+
+    @Override
+    public int getMetricsCategory() {
+        return SettingsEnums.TESTING;
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/panel/InternetConnectivityPanelTest.java b/tests/robotests/src/com/android/settings/panel/InternetConnectivityPanelTest.java
index 3a4cf7b..42867fb 100644
--- a/tests/robotests/src/com/android/settings/panel/InternetConnectivityPanelTest.java
+++ b/tests/robotests/src/com/android/settings/panel/InternetConnectivityPanelTest.java
@@ -46,8 +46,10 @@
     public void getSlices_containsNecessarySlices() {
         final List<Uri> uris = mPanel.getSlices();
 
-        assertThat(uris).containsExactly(CustomSliceRegistry.WIFI_SLICE_URI,
-                CustomSliceRegistry.AIRPLANE_URI);
+        assertThat(uris).containsExactly(
+                CustomSliceRegistry.AIRPLANE_URI,
+                CustomSliceRegistry.MOBILE_DATA_SLICE_URI,
+                CustomSliceRegistry.WIFI_SLICE_URI);
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/panel/PanelFragmentTest.java b/tests/robotests/src/com/android/settings/panel/PanelFragmentTest.java
index 389c31e..be8d8bc 100644
--- a/tests/robotests/src/com/android/settings/panel/PanelFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/panel/PanelFragmentTest.java
@@ -22,10 +22,13 @@
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
 
+import android.app.settings.SettingsEnums;
 import android.content.Context;
 import android.os.Bundle;
 import android.view.LayoutInflater;
+import android.view.View;
 import android.widget.LinearLayout;
 
 import com.android.settings.R;
@@ -71,13 +74,14 @@
                                 .get()
                                 .getSupportFragmentManager()
                                 .findFragmentById(R.id.main_content));
+
+        final Bundle bundle = new Bundle();
+        bundle.putString(SettingsPanelActivity.KEY_PANEL_TYPE_ARGUMENT, FAKE_EXTRA);
+        doReturn(bundle).when(mPanelFragment).getArguments();
     }
 
     @Test
     public void onCreateView_adapterGetsDataset() {
-        final Bundle bundle = new Bundle();
-        bundle.putString(SettingsPanelActivity.KEY_PANEL_TYPE_ARGUMENT, FAKE_EXTRA);
-        doReturn(bundle).when(mPanelFragment).getArguments();
         mPanelFragment.onCreateView(LayoutInflater.from(mContext),
                 new LinearLayout(mContext), null);
         PanelSlicesAdapter adapter = mPanelFragment.mAdapter;
@@ -85,4 +89,43 @@
         assertThat(adapter.getData()).containsAllIn(mFakePanelContent.getSlices());
     }
 
+    @Test
+    public void onCreate_logsOpenEvent() {
+        verify(mFakeFeatureFactory.metricsFeatureProvider).action(
+                0,
+                SettingsEnums.PAGE_VISIBLE,
+                mFakePanelContent.getMetricsCategory(),
+                null,
+                0);
+    }
+
+    @Test
+    public void panelSeeMoreClick_logsCloseEvent() {
+        final View.OnClickListener listener = mPanelFragment.getSeeMoreListener();
+
+        listener.onClick(null);
+
+        verify(mFakeFeatureFactory.metricsFeatureProvider).action(
+                0,
+                SettingsEnums.PAGE_HIDE,
+                mFakePanelContent.getMetricsCategory(),
+                PanelLoggingContract.PanelClosedKeys.KEY_SEE_MORE,
+                0
+        );
+    }
+
+    @Test
+    public void panelDoneClick_logsCloseEvent() {
+        final View.OnClickListener listener = mPanelFragment.getCloseListener();
+
+        listener.onClick(null);
+
+        verify(mFakeFeatureFactory.metricsFeatureProvider).action(
+                0,
+                SettingsEnums.PAGE_HIDE,
+                mFakePanelContent.getMetricsCategory(),
+                PanelLoggingContract.PanelClosedKeys.KEY_DONE,
+                0
+        );
+    }
 }
\ No newline at end of file
diff --git a/tests/robotests/src/com/android/settings/panel/PanelSlicesAdapterTest.java b/tests/robotests/src/com/android/settings/panel/PanelSlicesAdapterTest.java
index abefa67..4dce15e 100644
--- a/tests/robotests/src/com/android/settings/panel/PanelSlicesAdapterTest.java
+++ b/tests/robotests/src/com/android/settings/panel/PanelSlicesAdapterTest.java
@@ -71,7 +71,7 @@
                                 .getSupportFragmentManager()
                                 .findFragmentById(R.id.main_content));
 
-        mAdapter = new PanelSlicesAdapter(mPanelFragment, mFakePanelContent.getSlices());
+        mAdapter = new PanelSlicesAdapter(mPanelFragment, mFakePanelContent);
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/panel/SettingsPanelActivityTest.java b/tests/robotests/src/com/android/settings/panel/SettingsPanelActivityTest.java
index 359cf5d..a51b7b0 100644
--- a/tests/robotests/src/com/android/settings/panel/SettingsPanelActivityTest.java
+++ b/tests/robotests/src/com/android/settings/panel/SettingsPanelActivityTest.java
@@ -16,13 +16,25 @@
 
 package com.android.settings.panel;
 
-import static com.android.settings.panel.SettingsPanelActivity.KEY_PANEL_PACKAGE_NAME;
+import static com.android.settings.panel.SettingsPanelActivity.KEY_MEDIA_PACKAGE_NAME;
 import static com.android.settings.panel.SettingsPanelActivity.KEY_PANEL_TYPE_ARGUMENT;
 
 import static com.google.common.truth.Truth.assertThat;
 
-import android.content.Intent;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
 
+import android.app.settings.SettingsEnums;
+import android.content.Intent;
+import android.view.MotionEvent;
+
+import com.android.settings.testutils.FakeFeatureFactory;
+
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.robolectric.Robolectric;
@@ -31,6 +43,22 @@
 @RunWith(RobolectricTestRunner.class)
 public class SettingsPanelActivityTest {
 
+    private FakeFeatureFactory mFakeFeatureFactory;
+    private FakeSettingsPanelActivity mSettingsPanelActivity;
+    private PanelFeatureProvider mPanelFeatureProvider;
+    private FakePanelContent mFakePanelContent;
+
+    @Before
+    public void setUp() {
+        mFakeFeatureFactory = FakeFeatureFactory.setupForTest();
+        mSettingsPanelActivity = Robolectric.buildActivity(FakeSettingsPanelActivity.class)
+                .create().get();
+        mPanelFeatureProvider = spy(new PanelFeatureProviderImpl());
+        mFakeFeatureFactory.panelFeatureProvider = mPanelFeatureProvider;
+        mFakePanelContent = new FakePanelContent();
+        doReturn(mFakePanelContent).when(mPanelFeatureProvider).getPanel(any(), any(), any());
+    }
+
     @Test
     public void startMediaOutputSlice_withPackageName_bundleShouldHaveValue() {
         final Intent intent = new Intent()
@@ -41,7 +69,7 @@
         final SettingsPanelActivity activity =
                 Robolectric.buildActivity(SettingsPanelActivity.class, intent).create().get();
 
-        assertThat(activity.mBundle.getString(KEY_PANEL_PACKAGE_NAME))
+        assertThat(activity.mBundle.getString(KEY_MEDIA_PACKAGE_NAME))
                 .isEqualTo("com.google.android.music");
         assertThat(activity.mBundle.getString(KEY_PANEL_TYPE_ARGUMENT))
                 .isEqualTo("com.android.settings.panel.action.MEDIA_OUTPUT");
@@ -55,7 +83,23 @@
         final SettingsPanelActivity activity =
                 Robolectric.buildActivity(SettingsPanelActivity.class, intent).create().get();
 
-        assertThat(activity.mBundle.containsKey(KEY_PANEL_PACKAGE_NAME)).isFalse();
+        assertThat(activity.mBundle.containsKey(KEY_MEDIA_PACKAGE_NAME)).isFalse();
         assertThat(activity.mBundle.containsKey(KEY_PANEL_TYPE_ARGUMENT)).isFalse();
     }
+
+    @Test
+    public void onTouchEvent_outsideAction_logsPanelClosed() {
+        final MotionEvent event = mock(MotionEvent.class);
+        when(event.getAction()).thenReturn(MotionEvent.ACTION_OUTSIDE);
+
+        mSettingsPanelActivity.onTouchEvent(event);
+
+        verify(mFakeFeatureFactory.metricsFeatureProvider).action(
+                0,
+                SettingsEnums.PAGE_HIDE,
+                SettingsEnums.TESTING,
+                PanelLoggingContract.PanelClosedKeys.KEY_CLICKED_OUT,
+                0
+        );
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/password/SetNewPasswordActivityTest.java b/tests/robotests/src/com/android/settings/password/SetNewPasswordActivityTest.java
index 4232016..48f9fb4 100644
--- a/tests/robotests/src/com/android/settings/password/SetNewPasswordActivityTest.java
+++ b/tests/robotests/src/com/android/settings/password/SetNewPasswordActivityTest.java
@@ -16,7 +16,7 @@
 
 package com.android.settings.password;
 
-import static android.Manifest.permission.GET_AND_REQUEST_SCREEN_LOCK_COMPLEXITY;
+import static android.Manifest.permission.REQUEST_SCREEN_LOCK_COMPLEXITY;
 import static android.app.admin.DevicePolicyManager.ACTION_SET_NEW_PARENT_PROFILE_PASSWORD;
 import static android.app.admin.DevicePolicyManager.ACTION_SET_NEW_PASSWORD;
 import static android.app.admin.DevicePolicyManager.EXTRA_PASSWORD_COMPLEXITY;
@@ -139,7 +139,7 @@
     public void testLaunchChooseLock_setNewPasswordExtraWithPermission() {
         ShadowPasswordUtils.setCallingAppLabel(APP_LABEL);
         ShadowPasswordUtils.setCallingAppPackageName(PKG_NAME);
-        ShadowPasswordUtils.addGrantedPermission(GET_AND_REQUEST_SCREEN_LOCK_COMPLEXITY);
+        ShadowPasswordUtils.addGrantedPermission(REQUEST_SCREEN_LOCK_COMPLEXITY);
         Settings.Global.putInt(RuntimeEnvironment.application.getContentResolver(),
                 Settings.Global.DEVICE_PROVISIONED, 1);
 
@@ -169,7 +169,7 @@
     public void testLaunchChooseLock_setNewPasswordExtraInvalidValue() {
         ShadowPasswordUtils.setCallingAppLabel(APP_LABEL);
         ShadowPasswordUtils.setCallingAppPackageName(PKG_NAME);
-        ShadowPasswordUtils.addGrantedPermission(GET_AND_REQUEST_SCREEN_LOCK_COMPLEXITY);
+        ShadowPasswordUtils.addGrantedPermission(REQUEST_SCREEN_LOCK_COMPLEXITY);
         Settings.Global.putInt(RuntimeEnvironment.application.getContentResolver(),
                 Settings.Global.DEVICE_PROVISIONED, 1);
 
@@ -197,7 +197,7 @@
     public void testLaunchChooseLock_setNewPasswordExtraNoneComplexity() {
         ShadowPasswordUtils.setCallingAppLabel(APP_LABEL);
         ShadowPasswordUtils.setCallingAppPackageName(PKG_NAME);
-        ShadowPasswordUtils.addGrantedPermission(GET_AND_REQUEST_SCREEN_LOCK_COMPLEXITY);
+        ShadowPasswordUtils.addGrantedPermission(REQUEST_SCREEN_LOCK_COMPLEXITY);
         Settings.Global.putInt(RuntimeEnvironment.application.getContentResolver(),
                 Settings.Global.DEVICE_PROVISIONED, 1);
 
@@ -225,7 +225,7 @@
     public void testLaunchChooseLock_setNewPasswordWithoutExtra() {
         ShadowPasswordUtils.setCallingAppLabel(APP_LABEL);
         ShadowPasswordUtils.setCallingAppPackageName(PKG_NAME);
-        ShadowPasswordUtils.addGrantedPermission(GET_AND_REQUEST_SCREEN_LOCK_COMPLEXITY);
+        ShadowPasswordUtils.addGrantedPermission(REQUEST_SCREEN_LOCK_COMPLEXITY);
         Settings.Global.putInt(RuntimeEnvironment.application.getContentResolver(),
                 Settings.Global.DEVICE_PROVISIONED, 1);
 
@@ -252,7 +252,7 @@
     public void testLaunchChooseLock_setNewParentProfilePasswordExtraWithPermission() {
         ShadowPasswordUtils.setCallingAppLabel(APP_LABEL);
         ShadowPasswordUtils.setCallingAppPackageName(PKG_NAME);
-        ShadowPasswordUtils.addGrantedPermission(GET_AND_REQUEST_SCREEN_LOCK_COMPLEXITY);
+        ShadowPasswordUtils.addGrantedPermission(REQUEST_SCREEN_LOCK_COMPLEXITY);
         Settings.Global.putInt(RuntimeEnvironment.application.getContentResolver(),
                 Settings.Global.DEVICE_PROVISIONED, 1);
 
@@ -280,7 +280,7 @@
     public void testLaunchChooseLock_setNewParentProfilePasswordWithoutExtra() {
         ShadowPasswordUtils.setCallingAppLabel(APP_LABEL);
         ShadowPasswordUtils.setCallingAppPackageName(PKG_NAME);
-        ShadowPasswordUtils.addGrantedPermission(GET_AND_REQUEST_SCREEN_LOCK_COMPLEXITY);
+        ShadowPasswordUtils.addGrantedPermission(REQUEST_SCREEN_LOCK_COMPLEXITY);
         Settings.Global.putInt(RuntimeEnvironment.application.getContentResolver(),
                 Settings.Global.DEVICE_PROVISIONED, 1);
 
diff --git a/tests/robotests/src/com/android/settings/password/SetupChooseLockGenericTest.java b/tests/robotests/src/com/android/settings/password/SetupChooseLockGenericTest.java
index 63bdc38..d35b38a 100644
--- a/tests/robotests/src/com/android/settings/password/SetupChooseLockGenericTest.java
+++ b/tests/robotests/src/com/android/settings/password/SetupChooseLockGenericTest.java
@@ -16,7 +16,7 @@
 
 package com.android.settings.password;
 
-import static android.Manifest.permission.GET_AND_REQUEST_SCREEN_LOCK_COMPLEXITY;
+import static android.Manifest.permission.REQUEST_SCREEN_LOCK_COMPLEXITY;
 import static android.app.admin.DevicePolicyManager.PASSWORD_COMPLEXITY_HIGH;
 
 import static com.android.settings.password.ChooseLockSettingsHelper.EXTRA_KEY_REQUESTED_MIN_COMPLEXITY;
@@ -68,7 +68,7 @@
     @Test
     @Config(shadows = {ShadowPasswordUtils.class})
     public void setupChooseLockGenericPasswordComplexityExtraWithPermission() {
-        ShadowPasswordUtils.addGrantedPermission(GET_AND_REQUEST_SCREEN_LOCK_COMPLEXITY);
+        ShadowPasswordUtils.addGrantedPermission(REQUEST_SCREEN_LOCK_COMPLEXITY);
 
         Intent intent = new Intent("com.android.settings.SETUP_LOCK_SCREEN");
         intent.putExtra(EXTRA_KEY_REQUESTED_MIN_COMPLEXITY, PASSWORD_COMPLEXITY_HIGH);
diff --git a/tests/robotests/src/com/android/settings/privacy/PrivacyDashboardFragmentTest.java b/tests/robotests/src/com/android/settings/privacy/PrivacyDashboardFragmentTest.java
new file mode 100644
index 0000000..d073e9b
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/privacy/PrivacyDashboardFragmentTest.java
@@ -0,0 +1,68 @@
+/*
+ * 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.privacy;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.app.ActionBar;
+import android.content.Context;
+import android.os.Bundle;
+import android.view.View;
+
+import androidx.fragment.app.FragmentActivity;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.android.settingslib.core.lifecycle.Lifecycle;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.robolectric.Robolectric;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+
+@RunWith(RobolectricTestRunner.class)
+public class PrivacyDashboardFragmentTest {
+
+    private Context mContext;
+    private PrivacyDashboardFragment mFragment;
+
+    @Before
+    public void setUp() {
+        mContext = RuntimeEnvironment.application;
+        mFragment = spy(new PrivacyDashboardFragment());
+    }
+
+    @Test
+    public void onViewCreated_shouldCallStyleActionBar() {
+        final FragmentActivity activity = spy(
+                Robolectric.buildActivity(FragmentActivity.class).get());
+        final ActionBar actionBar = mock(ActionBar.class);
+
+        when(mFragment.getActivity()).thenReturn(activity);
+        when(mFragment.getSettingsLifecycle()).thenReturn(mock(Lifecycle.class));
+        when(mFragment.getListView()).thenReturn(mock(RecyclerView.class));
+        when(activity.getActionBar()).thenReturn(actionBar);
+
+        mFragment.onViewCreated(new View(mContext), new Bundle());
+
+        verify(mFragment).styleActionBar();
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/slices/SettingsSliceProviderTest.java b/tests/robotests/src/com/android/settings/slices/SettingsSliceProviderTest.java
index 7eae3e4..726e4bd 100644
--- a/tests/robotests/src/com/android/settings/slices/SettingsSliceProviderTest.java
+++ b/tests/robotests/src/com/android/settings/slices/SettingsSliceProviderTest.java
@@ -99,7 +99,7 @@
     private static final String SUMMARY = "summary";
     private static final String SCREEN_TITLE = "screen title";
     private static final String FRAGMENT_NAME = "fragment name";
-    private static final int ICON = R.drawable.ic_settings;
+    private static final int ICON = R.drawable.ic_settings_accent;
     private static final Uri URI = Uri.parse("content://com.android.settings.slices/test");
     private static final String PREF_CONTROLLER = FakeToggleController.class.getName();
 
@@ -116,7 +116,8 @@
 
     private static final List<Uri> SPECIAL_CASE_OEM_URIS = Arrays.asList(
             CustomSliceRegistry.ZEN_MODE_SLICE_URI,
-            CustomSliceRegistry.FLASHLIGHT_SLICE_URI
+            CustomSliceRegistry.FLASHLIGHT_SLICE_URI,
+            CustomSliceRegistry.MOBILE_DATA_SLICE_URI
     );
 
     @Before
@@ -577,7 +578,7 @@
         values.put(SlicesDatabaseHelper.IndexColumns.TITLE, TITLE);
         values.put(SlicesDatabaseHelper.IndexColumns.SUMMARY, "s");
         values.put(SlicesDatabaseHelper.IndexColumns.SCREENTITLE, "s");
-        values.put(SlicesDatabaseHelper.IndexColumns.ICON_RESOURCE, R.drawable.ic_settings);
+        values.put(SlicesDatabaseHelper.IndexColumns.ICON_RESOURCE, R.drawable.ic_settings_accent);
         values.put(SlicesDatabaseHelper.IndexColumns.FRAGMENT, "test");
         values.put(SlicesDatabaseHelper.IndexColumns.CONTROLLER, PREF_CONTROLLER);
         values.put(SlicesDatabaseHelper.IndexColumns.PLATFORM_SLICE, isPlatformSlice);
diff --git a/tests/robotests/src/com/android/settings/slices/SliceBuilderUtilsTest.java b/tests/robotests/src/com/android/settings/slices/SliceBuilderUtilsTest.java
index c2d1e93..0a42f42 100644
--- a/tests/robotests/src/com/android/settings/slices/SliceBuilderUtilsTest.java
+++ b/tests/robotests/src/com/android/settings/slices/SliceBuilderUtilsTest.java
@@ -63,7 +63,7 @@
     private final String SCREEN_TITLE = "screen title";
     private final String KEYWORDS = "a, b, c";
     private final String FRAGMENT_NAME = "fragment name";
-    private final int ICON = R.drawable.ic_settings;
+    private final int ICON = R.drawable.ic_settings_accent;
     private final Uri URI = Uri.parse("content://com.android.settings.slices/test");
     private final Class TOGGLE_CONTROLLER = FakeToggleController.class;
     private final Class SLIDER_CONTROLLER = FakeSliderController.class;
@@ -431,7 +431,7 @@
     @Test
     public void buildIntentSlice_noIconPassed_returnsSliceWithIcon() {
         final int expectedIconResource = IconCompat.createWithResource(mContext,
-                R.drawable.ic_settings).toIcon().getResId();
+                R.drawable.ic_settings_accent).toIcon().getResId();
         final SliceData sliceData = getDummyData(CONTEXT_CONTROLLER, SliceData.SliceType.INTENT,
                 0x0);
 
@@ -446,7 +446,7 @@
     @Test
     public void buildDisabledDependentSlice_noIconPassed_returnsSliceWithIcon() {
         final int expectedIconResource = IconCompat.createWithResource(mContext,
-                R.drawable.ic_settings).toIcon().getResId();
+                R.drawable.ic_settings_accent).toIcon().getResId();
         final SliceData data = getDummyData(FakeUnavailablePreferenceController.class,
                 SUMMARY, SliceData.SliceType.SWITCH, SCREEN_TITLE, 0 /* icon */,
                 IS_DYNAMIC_SUMMARY_ALLOWED, null /* unavailableSliceSubtitle */);
@@ -465,7 +465,7 @@
     @Test
     public void buildToggleSlice_noIconPassed_returnsSliceWithIcon() {
         final int expectedIconResource = IconCompat.createWithResource(mContext,
-                R.drawable.ic_settings).toIcon().getResId();
+                R.drawable.ic_settings_accent).toIcon().getResId();
         final SliceData dummyData = getDummyData(TOGGLE_CONTROLLER, SliceData.SliceType.SWITCH,
                 0x0);
 
@@ -480,7 +480,7 @@
     @Test
     public void buildSliderSlice_noIconPassed_returnsSliceWithIcon() {
         final int expectedIconResource = IconCompat.createWithResource(mContext,
-                R.drawable.ic_settings).toIcon().getResId();
+                R.drawable.ic_settings_accent).toIcon().getResId();
         final SliceData data = getDummyData(SLIDER_CONTROLLER, SliceData.SliceType.SLIDER, 0x0);
 
         final Slice slice = SliceBuilderUtils.buildSlice(mContext, data);
@@ -493,7 +493,7 @@
 
     @Test
     public void getSafeIcon_replacesEmptyIconWithSettingsIcon() {
-        final int settingsIcon = R.drawable.ic_settings;
+        final int settingsIcon = R.drawable.ic_settings_accent;
         final int zeroIcon = 0x0;
         final SliceData data = getDummyData(TOGGLE_CONTROLLER, SliceData.SliceType.SWITCH,
                 zeroIcon);
@@ -507,7 +507,7 @@
 
     @Test
     public void getSafeIcon_invalidResource_shouldFallbackToSettingsIcon() {
-        final int settingsIcon = R.drawable.ic_settings;
+        final int settingsIcon = R.drawable.ic_settings_accent;
         final int badIcon = 0x12345678;
         final SliceData data = getDummyData(TOGGLE_CONTROLLER, SliceData.SliceType.SWITCH,
                 badIcon);
diff --git a/tests/robotests/src/com/android/settings/testutils/shadow/ShadowTileUtils.java b/tests/robotests/src/com/android/settings/testutils/shadow/ShadowTileUtils.java
index 722df77..8736fe8 100644
--- a/tests/robotests/src/com/android/settings/testutils/shadow/ShadowTileUtils.java
+++ b/tests/robotests/src/com/android/settings/testutils/shadow/ShadowTileUtils.java
@@ -43,6 +43,6 @@
     @Implementation
     protected static Pair<String, Integer> getIconFromUri(Context context, String packageName,
             String uriString, Map<String, IContentProvider> providerMap) {
-        return Pair.create(RuntimeEnvironment.application.getPackageName(), R.drawable.ic_settings);
+        return Pair.create(RuntimeEnvironment.application.getPackageName(), R.drawable.ic_settings_accent);
     }
 }
diff --git a/tests/robotests/src/com/android/settings/widget/AdaptiveHomepageIconTest.java b/tests/robotests/src/com/android/settings/widget/AdaptiveHomepageIconTest.java
index 32690a3..05a9cfb 100644
--- a/tests/robotests/src/com/android/settings/widget/AdaptiveHomepageIconTest.java
+++ b/tests/robotests/src/com/android/settings/widget/AdaptiveHomepageIconTest.java
@@ -87,7 +87,7 @@
     public void setBackgroundColor_externalTileWithBackgroundColorRawValue_shouldUpdateIcon() {
         final Tile tile = spy(new Tile(mActivityInfo, CategoryKey.CATEGORY_HOMEPAGE));
         mActivityInfo.metaData.putInt(META_DATA_PREFERENCE_ICON_BACKGROUND_ARGB, 0xff0000);
-        doReturn(Icon.createWithResource(mContext, R.drawable.ic_settings))
+        doReturn(Icon.createWithResource(mContext, R.drawable.ic_settings_accent))
                 .when(tile).getIcon(mContext);
         final AdaptiveHomepageIcon icon =
                 new AdaptiveHomepageIcon(mContext, new ColorDrawable(Color.BLACK));
@@ -97,11 +97,25 @@
     }
 
     @Test
+    public void setBackgroundColor_tileWithoutBackgroundColor_shouldSetDefaultBackgroundColor() {
+        final Tile tile = spy(new Tile(mActivityInfo, CategoryKey.CATEGORY_HOMEPAGE));
+        doReturn(Icon.createWithResource(mContext, R.drawable.ic_settings_accent))
+            .when(tile).getIcon(mContext);
+        final AdaptiveHomepageIcon icon =
+            new AdaptiveHomepageIcon(mContext, new ColorDrawable(Color.BLACK));
+
+        icon.setBackgroundColor(mContext, tile);
+
+        assertThat(icon.mBackgroundColor).isEqualTo(
+            mContext.getColor(R.color.homepage_generic_icon_background));
+    }
+
+    @Test
     public void onBindTile_externalTileWithBackgroundColorHint_shouldUpdateIcon() {
         final Tile tile = spy(new Tile(mActivityInfo, CategoryKey.CATEGORY_HOMEPAGE));
         mActivityInfo.metaData.putInt(META_DATA_PREFERENCE_ICON_BACKGROUND_HINT,
                 R.color.material_blue_500);
-        doReturn(Icon.createWithResource(mContext, R.drawable.ic_settings))
+        doReturn(Icon.createWithResource(mContext, R.drawable.ic_settings_accent))
                 .when(tile).getIcon(mContext);
 
         final AdaptiveHomepageIcon icon =
diff --git a/tests/unit/src/com/android/settings/bluetooth/BluetoothDeviceDetailsRotationTest.java b/tests/unit/src/com/android/settings/bluetooth/BluetoothDeviceDetailsRotationTest.java
index 4ed04f0..aec6dd2 100644
--- a/tests/unit/src/com/android/settings/bluetooth/BluetoothDeviceDetailsRotationTest.java
+++ b/tests/unit/src/com/android/settings/bluetooth/BluetoothDeviceDetailsRotationTest.java
@@ -70,16 +70,16 @@
 
         BluetoothDeviceDetailsFragment.sTestDataFactory =
                 new BluetoothDeviceDetailsFragment.TestDataFactory() {
-            @Override
-            public CachedBluetoothDevice getDevice(String deviceAddress) {
-                return mCachedDevice;
-            }
+                    @Override
+                    public CachedBluetoothDevice getDevice(String deviceAddress) {
+                        return mCachedDevice;
+                    }
 
-            @Override
-            public LocalBluetoothManager getManager(Context context) {
-                return mBluetoothManager;
-            }
-        };
+                    @Override
+                    public LocalBluetoothManager getManager(Context context) {
+                        return mBluetoothManager;
+                    }
+                };
     }
 
     @Test
@@ -103,4 +103,4 @@
             throw new RuntimeException(e);
         }
     }
-}
+}
\ No newline at end of file
diff --git a/tests/unit/src/com/android/settings/slices/SliceDeepLinkSpringBoardTest.java b/tests/unit/src/com/android/settings/slices/SliceDeepLinkSpringBoardTest.java
deleted file mode 100644
index 0c5f501..0000000
--- a/tests/unit/src/com/android/settings/slices/SliceDeepLinkSpringBoardTest.java
+++ /dev/null
@@ -1,99 +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 com.android.settings.slices.SliceDeepLinkSpringBoard.createDeepLink;
-
-import android.content.Context;
-import android.content.Intent;
-import android.net.Uri;
-import android.platform.test.annotations.Presubmit;
-
-import androidx.test.InstrumentationRegistry;
-import androidx.test.filters.MediumTest;
-import androidx.test.runner.AndroidJUnit4;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(AndroidJUnit4.class)
-@MediumTest
-public class SliceDeepLinkSpringBoardTest {
-    private Context mContext;
-
-    @Before
-    public void setUp() {
-        mContext = InstrumentationRegistry.getTargetContext();
-    }
-
-    @Test
-    @Presubmit
-    public void launchesDeepLinkIntent_shouldNotCrash() {
-        final Intent deepLinkIntent = getSpringboardIntent(
-                "content://com.android.settings.slices/action/test_slice");
-
-        mContext.startActivity(deepLinkIntent);
-    }
-
-    @Test
-    @Presubmit
-    public void launchesDeepLinkIntent_wifiSlice_shouldNotCrash() {
-        final Intent deepLinkIntent = getSpringboardIntent(
-                CustomSliceRegistry.WIFI_SLICE_URI.toString());
-
-        mContext.startActivity(deepLinkIntent);
-    }
-
-    @Test
-    @Presubmit
-    public void launchesDeepLinkIntent_bluetoothSlice_shouldNotCrash() {
-        final Intent deepLinkIntent = getSpringboardIntent(
-                CustomSliceRegistry.BLUETOOTH_URI.toString());
-
-        mContext.startActivity(deepLinkIntent);
-    }
-
-    @Test
-    @Presubmit
-    public void launchesDeepLinkIntent_dndSlice_shouldNotCrash() {
-        final Intent deepLinkIntent = getSpringboardIntent(
-                CustomSliceRegistry.ZEN_MODE_SLICE_URI.toString());
-
-        mContext.startActivity(deepLinkIntent);
-    }
-
-    @Test
-    @Presubmit
-    public void launchesDeepLinkIntent_locationSlice_shouldNotCrash() {
-        final Intent deepLinkIntent = getSpringboardIntent(
-                CustomSliceRegistry.LOCATION_SLICE_URI.toString());
-
-        mContext.startActivity(deepLinkIntent);
-    }
-
-    private Intent getSpringboardIntent(String uriString) {
-        final Uri uri = createDeepLink(new Intent(SliceDeepLinkSpringBoard.ACTION_VIEW_SLICE)
-                .setPackage(mContext.getPackageName())
-                .putExtra(SliceDeepLinkSpringBoard.EXTRA_SLICE, uriString)
-                .toUri(Intent.URI_ANDROID_APP_SCHEME));
-
-        return new Intent(Intent.ACTION_VIEW)
-                .setData(uri)
-                .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-    }
-}
diff --git a/tests/unit/src/com/android/settings/wifi/dpp/WifiNetworkListFragmentTest.java b/tests/unit/src/com/android/settings/wifi/dpp/WifiNetworkListFragmentTest.java
index 18d62c2..c1c1d54 100644
--- a/tests/unit/src/com/android/settings/wifi/dpp/WifiNetworkListFragmentTest.java
+++ b/tests/unit/src/com/android/settings/wifi/dpp/WifiNetworkListFragmentTest.java
@@ -98,7 +98,6 @@
     private void callOnWifiStateChanged(int state) {
         mActivityRule.getActivity().getMainThreadHandler()
                 .post(() -> mWifiNetworkListFragment.onWifiStateChanged(state));
-        mWifiNetworkListFragment.mUseConnectedAccessPointDirectly = false;
     }
 
     /** Launch the activity via an Intent with a String extra. */
@@ -173,4 +172,4 @@
         onView(withText(resourceString(WIFI_DISPLAY_STATUS_CONNECTED))).check(
                 matches(isDisplayed()));
     }
-}
\ No newline at end of file
+}
diff --git a/tests/unit/src/com/android/settings/wifi/tether/TetherServiceTest.java b/tests/unit/src/com/android/settings/wifi/tether/TetherServiceTest.java
index 09b317c..0332092 100644
--- a/tests/unit/src/com/android/settings/wifi/tether/TetherServiceTest.java
+++ b/tests/unit/src/com/android/settings/wifi/tether/TetherServiceTest.java
@@ -27,6 +27,8 @@
 import static android.net.ConnectivityManager.TETHERING_WIFI;
 import static android.net.ConnectivityManager.TETHER_ERROR_NO_ERROR;
 import static android.net.ConnectivityManager.TETHER_ERROR_PROVISION_FAILED;
+import static android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID;
+
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyLong;
 import static org.mockito.Matchers.eq;
@@ -83,7 +85,7 @@
 
     private TetherService mService;
     private MockResources mResources;
-    private FakeUsageStatsManagerWrapper mUsageStatsManagerWrapper;
+    private MockTetherServiceWrapper mWrapper;
     int mLastReceiverResultCode = BOGUS_RECEIVER_RESULT;
     private int mLastTetherRequestType = TETHERING_INVALID;
     private int mProvisionResponse = BOGUS_RECEIVER_RESULT;
@@ -125,7 +127,7 @@
         when(mPrefs.edit()).thenReturn(mPrefEditor);
         when(mPrefEditor.putString(eq(CURRENT_TYPES), mStoredTypes.capture())).thenReturn(
                 mPrefEditor);
-        mUsageStatsManagerWrapper = new FakeUsageStatsManagerWrapper(mContext);
+        mWrapper = new MockTetherServiceWrapper(mContext);
 
         ResolveInfo systemAppResolveInfo = new ResolveInfo();
         ActivityInfo systemActivityInfo = new ActivityInfo();
@@ -146,6 +148,8 @@
         resolvers.add(systemAppResolveInfo);
         when(mPackageManager.queryBroadcastReceivers(
                 any(Intent.class), eq(PackageManager.MATCH_ALL))).thenReturn(resolvers);
+        setupService();
+        getService().setTetherServiceWrapper(mWrapper);
     }
 
     @Override
@@ -171,16 +175,13 @@
     }
 
     public void testStartKeepsProvisionAppActive() {
-        setupService();
-        getService().setUsageStatsManagerWrapper(mUsageStatsManagerWrapper);
-
         runProvisioningForType(TETHERING_WIFI);
 
         assertTrue(waitForProvisionRequest(TETHERING_WIFI));
         assertTrue(waitForProvisionResponse(TETHER_ERROR_NO_ERROR));
-        assertFalse(mUsageStatsManagerWrapper.isAppInactive(ENTITLEMENT_PACKAGE_NAME));
+        assertFalse(mWrapper.isAppInactive(ENTITLEMENT_PACKAGE_NAME));
         // Non-system handler of the intent action should stay idle.
-        assertTrue(mUsageStatsManagerWrapper.isAppInactive(FAKE_PACKAGE_NAME));
+        assertTrue(mWrapper.isAppInactive(FAKE_PACKAGE_NAME));
     }
 
     public void testScheduleRechecks() {
@@ -419,11 +420,11 @@
         }
     }
 
-    private static class FakeUsageStatsManagerWrapper
-            extends TetherService.UsageStatsManagerWrapper {
+    private static class MockTetherServiceWrapper
+            extends TetherService.TetherServiceWrapper {
         private final Set<String> mActivePackages;
 
-        FakeUsageStatsManagerWrapper(Context context) {
+        MockTetherServiceWrapper(Context context) {
             super(context);
             mActivePackages = new HashSet<>();
         }
@@ -440,5 +441,10 @@
         boolean isAppInactive(String packageName) {
             return !mActivePackages.contains(packageName);
         }
+
+        @Override
+        int getDefaultDataSubscriptionId() {
+            return INVALID_SUBSCRIPTION_ID;
+        }
     }
 }