[automerger skipped] Merge "Merge Coral/Flame into AOSP master" am: e2c2504c94 -s ours am: b8858e1d3f -s ours
am: 980b9a285d -s ours
am skip reason: change_id I46ad5cff3809191483b48fe292dba220a0d699c6 with SHA1 5eda5a3e7f is in history

Change-Id: Ibc1e435c217a9425de09d873070e55bf95f2a2b5
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index ff3f650..9bbcf23 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -2594,13 +2594,6 @@
                 android:value="com.android.settings.notification.AppNotificationSettings" />
         </activity>
 
-        <!-- Show channel group-level notification settings (group passed in as extras) -->
-        <activity android:name="Settings$ChannelGroupNotificationSettingsActivity"
-                  android:exported="true">
-            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
-                       android:value="com.android.settings.notification.ChannelGroupNotificationSettings" />
-        </activity>
-
         <!-- Show channel-level notification settings (channel passed in as extras) -->
         <activity android:name="Settings$ChannelNotificationSettingsActivity"
                   android:label="@string/notification_channel_title"
@@ -2714,7 +2707,7 @@
 
         <activity
             android:name=".wifi.NetworkRequestDialogActivity"
-            android:theme="@style/Transparent"
+            android:theme="@style/Theme.AlertDialog"
             android:excludeFromRecents="true"
             android:launchMode="singleTop"
             android:taskAffinity=".wifi.NetworkRequestDialogActivity"
@@ -3241,6 +3234,9 @@
         <activity android:name=".homepage.contextualcards.ContextualCardFeedbackDialog"
                   android:theme="@android:style/Theme.DeviceDefault.Light.Dialog.Alert" />
 
+        <activity android:name=".homepage.contextualcards.FaceReEnrollDialog"
+                  android:theme="@android:style/Theme.DeviceDefault.Light.Dialog.Alert" />
+
         <activity
             android:name="Settings$WifiCallingDisclaimerActivity"
             android:label="@string/wifi_calling_settings_title"
diff --git a/res/layout/empty_view.xml b/res/layout/empty_view.xml
new file mode 100644
index 0000000..33218f7
--- /dev/null
+++ b/res/layout/empty_view.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Copyright (C) 2019 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+              android:layout_width="match_parent"
+              android:layout_height="wrap_content"
+              android:visibility="gone"/>
diff --git a/res/layout/wifi_dialog.xml b/res/layout/wifi_dialog.xml
index d5dbb17..0a25934 100644
--- a/res/layout/wifi_dialog.xml
+++ b/res/layout/wifi_dialog.xml
@@ -138,8 +138,7 @@
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
                             style="@style/wifi_item_spinner"
-                            android:prompt="@string/wifi_eap_method"
-                            android:entries="@array/wifi_eap_method" />
+                            android:prompt="@string/wifi_eap_method" />
                 </LinearLayout>
 
                 <LinearLayout android:id="@+id/l_phase2"
diff --git a/res/values-en-rCA/strings.xml b/res/values-en-rCA/strings.xml
index a5cdab0..69b1b71 100644
--- a/res/values-en-rCA/strings.xml
+++ b/res/values-en-rCA/strings.xml
@@ -423,13 +423,13 @@
     <string name="security_settings_face_settings_require_attention" msgid="1638445716306615123">"Eyes open to unlock"</string>
     <string name="security_settings_face_settings_require_attention_details" msgid="5749808567341263288">"When using face authentication, your eyes must be open"</string>
     <string name="security_settings_face_settings_require_confirmation" msgid="2559602923985027572">"Always require confirmation"</string>
-    <string name="security_settings_face_settings_require_confirmation_details" msgid="2002651109571928756">"When authenticating in apps, always require confirmation"</string>
-    <string name="security_settings_face_settings_remove_face_data" msgid="3477772641643318370">"Remove face data"</string>
-    <string name="security_settings_face_settings_footer" msgid="8056977398747222768">"Your face can be used to unlock your device and access apps. "<annotation id="url">"Learn more"</annotation></string>
-    <!-- no translation found for security_settings_face_settings_remove_dialog_title (4829278778459836075) -->
-    <skip />
-    <!-- no translation found for security_settings_face_settings_remove_dialog_details (2609671025686003946) -->
-    <skip />
+    <string name="security_settings_face_settings_require_confirmation_details" msgid="6466094680756211420">"When using Face Unlock in apps, always require confirmation step"</string>
+    <string name="security_settings_face_settings_remove_face_data" msgid="304401377141467791">"Delete face data"</string>
+    <string name="security_settings_face_settings_enroll" msgid="495403103503629382">"Set up Face Unlock"</string>
+    <string name="security_settings_face_settings_footer" msgid="6072833685685070967">"Use Face Unlock to unlock your device, sign in to apps and confirm payments.\n\nKeep in mind:\nLooking at the phone can unlock it when you don’t intend to.\n\nYour phone can be unlocked by someone else if it’s held up to your face while your eyes are open.\n\nYour phone can be unlocked by someone who looks a lot like you, such as an identical sibling."</string>
+    <string name="security_settings_face_settings_remove_dialog_title" msgid="4829278778459836075">"Delete face data?"</string>
+    <string name="security_settings_face_settings_remove_dialog_details" msgid="1959642447512807205">"The images and biometric data used by Face Unlock will be permanently and securely deleted. After removal, you will need your PIN, pattern or password to unlock your phone, sign in to apps and confirm payments."</string>
+    <string name="security_settings_face_settings_context_subtitle" msgid="4381276009777294566">"Use face unlock to unlock your phone"</string>
     <string name="security_settings_fingerprint_preference_title" msgid="2488725232406204350">"Fingerprint"</string>
     <string name="fingerprint_manage_category_title" msgid="8293801041700001681">"Manage fingerprints"</string>
     <string name="fingerprint_usage_category_title" msgid="8438526918999536619">"Use fingerprint for"</string>
@@ -4352,9 +4352,13 @@
     <string name="game_driver_app_preference_default" msgid="7686384740483216333">"Default"</string>
     <string name="game_driver_app_preference_game_driver" msgid="6426312331295324606">"Game Driver"</string>
     <string name="game_driver_app_preference_system" msgid="8272672982113332753">"System Graphics Driver"</string>
+    <!-- no translation found for game_driver_all_apps_preference_values:0 (7193648562434970105) -->
+    <!-- no translation found for game_driver_all_apps_preference_values:1 (7189663725490629463) -->
+    <!-- no translation found for game_driver_all_apps_preference_values:2 (7166160247759864796) -->
     <!-- no translation found for game_driver_app_preference_values:0 (4271044622117073985) -->
     <!-- no translation found for game_driver_app_preference_values:1 (6628516810440406199) -->
     <!-- no translation found for game_driver_app_preference_values:2 (1760397725970916076) -->
+    <!-- no translation found for game_driver_app_preference_values:3 (6260984152570269090) -->
     <string name="unsupported_setting_summary" product="default" msgid="11246953620654225">"Setting isn’t supported on this phone"</string>
     <string name="unsupported_setting_summary" product="tablet" msgid="6328431665635673717">"Setting isn’t supported on this tablet"</string>
     <string name="unsupported_setting_summary" product="device" msgid="2348970994972110886">"Setting isn’t supported on this device"</string>
diff --git a/res/values-en-rXC/strings.xml b/res/values-en-rXC/strings.xml
index d046143..44a3c94 100644
--- a/res/values-en-rXC/strings.xml
+++ b/res/values-en-rXC/strings.xml
@@ -422,13 +422,13 @@
     <string name="security_settings_face_settings_require_attention" msgid="1638445716306615123">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‎‏‏‎‏‏‎‏‎‏‏‏‏‎‎‏‏‏‎‏‏‎‏‏‎‏‏‎‎‏‎‏‎‏‏‏‎‎‎‎‎‏‏‎‏‏‏‎‏‎‏‏‎‏‏‎‏‎‏‎‎‏‏‎Eyes open to unlock‎‏‎‎‏‎"</string>
     <string name="security_settings_face_settings_require_attention_details" msgid="5749808567341263288">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‎‎‏‏‏‏‏‏‎‎‏‎‏‏‎‏‏‎‏‏‎‎‎‏‏‎‏‏‎‏‏‎‎‏‏‏‏‎‏‏‎‏‏‏‏‏‏‎‏‎‏‎‎‏‏‎‏‏‏‎‎‎‎When using face authentication, your eyes must be open‎‏‎‎‏‎"</string>
     <string name="security_settings_face_settings_require_confirmation" msgid="2559602923985027572">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‎‏‎‎‎‏‏‏‎‎‎‎‏‎‏‏‎‎‎‏‎‎‏‎‏‎‎‏‏‎‎‎‏‎‎‏‎‏‎‎‎‏‎‏‏‎‏‏‏‎‎‎‎‎‏‏‏‏‏‎‏‎‎‎Always require confirmation‎‏‎‎‏‎"</string>
-    <string name="security_settings_face_settings_require_confirmation_details" msgid="2002651109571928756">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‎‏‏‏‎‏‏‏‏‎‎‏‎‏‎‏‏‎‏‏‎‎‎‏‎‎‏‎‎‏‎‏‏‎‏‏‎‏‏‎‎‎‏‎‎‏‏‏‎‏‎‎‎‏‎‏‎‏‏‎‏‎‎‎When authenticating in apps, always require confirmation‎‏‎‎‏‎"</string>
-    <string name="security_settings_face_settings_remove_face_data" msgid="3477772641643318370">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‎‏‏‎‎‎‎‎‏‎‎‎‎‏‏‏‎‎‎‎‏‏‏‏‏‎‎‏‎‏‎‏‎‏‎‎‎‏‎‏‎‏‏‏‎‎‎‏‏‎‎‏‏‎‎‎‏‏‎‎‎‏‎‎Remove face data‎‏‎‎‏‎"</string>
-    <string name="security_settings_face_settings_footer" msgid="8056977398747222768">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‏‎‏‏‏‏‏‏‎‏‎‎‎‎‎‎‏‎‎‎‏‎‎‏‎‎‎‎‎‏‏‎‏‎‎‏‏‏‏‎‏‎‏‏‎‏‏‏‎‏‎‎‏‎‏‏‏‏‎‎‎‎‎Your face can be used to unlock your device and access apps. ‎‏‎‎‏‏‎"<annotation id="url">"‎‏‎‎‏‏‏‎Learn more‎‏‎‎‏‏‎"</annotation>"‎‏‎‎‏‏‏‎‎‏‎‎‏‎"</string>
-    <!-- no translation found for security_settings_face_settings_remove_dialog_title (4829278778459836075) -->
-    <skip />
-    <!-- no translation found for security_settings_face_settings_remove_dialog_details (2609671025686003946) -->
-    <skip />
+    <string name="security_settings_face_settings_require_confirmation_details" msgid="6466094680756211420">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‎‏‏‎‎‏‏‎‏‏‏‏‎‎‎‎‏‎‏‏‏‎‏‏‎‏‏‎‏‎‎‏‏‏‎‎‏‎‏‎‎‎‎‏‎‎‎‏‎‎‏‏‏‎‏‏‎‏‏‏‎‎‎When using face unlock in apps, always require confirmation step‎‏‎‎‏‎"</string>
+    <string name="security_settings_face_settings_remove_face_data" msgid="304401377141467791">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‎‏‏‏‎‎‎‎‏‏‏‎‎‏‎‏‏‏‎‎‏‏‎‏‏‏‎‎‎‎‏‎‎‏‎‎‎‏‏‎‏‎‏‎‎‎‎‎‏‎‏‎‏‎‏‎‎‎‏‏‏‏‎Delete face data‎‏‎‎‏‎"</string>
+    <string name="security_settings_face_settings_enroll" msgid="495403103503629382">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‎‏‏‏‏‎‏‏‏‎‎‎‎‎‎‎‎‎‎‏‏‎‎‏‏‏‏‏‏‏‎‏‏‏‎‏‎‎‏‏‏‏‎‏‎‏‏‎‏‏‏‏‎‎‎‏‎‎‎‏‏‎‎Set up face unlock‎‏‎‎‏‎"</string>
+    <string name="security_settings_face_settings_footer" msgid="6072833685685070967">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‎‏‎‏‎‎‎‏‎‎‎‏‏‏‎‎‎‎‏‎‏‎‎‎‎‎‏‏‏‏‏‏‎‏‎‏‏‏‎‏‎‎‏‎‎‎‏‏‏‎‏‏‎‎‎‏‏‏‎‏‏‏‎Use face unlock to unlock your device, sign in to apps, and confirm payments.‎‏‎‎‏‏‎\n‎‏‎‎‏‏‏‎‎‏‎‎‏‏‎\n‎‏‎‎‏‏‏‎Keep in mind:‎‏‎‎‏‏‎\n‎‏‎‎‏‏‏‎Looking at the phone can unlock it when you don’t intend to.‎‏‎‎‏‏‎\n‎‏‎‎‏‏‏‎‎‏‎‎‏‏‎\n‎‏‎‎‏‏‏‎Your phone can be unlocked by someone else if it’s held up to your face while your eyes are open.‎‏‎‎‏‏‎\n‎‏‎‎‏‏‏‎‎‏‎‎‏‏‎\n‎‏‎‎‏‏‏‎Your phone can be unlocked by someone who looks a lot like you, say, an identical sibling.‎‏‎‎‏‎"</string>
+    <string name="security_settings_face_settings_remove_dialog_title" msgid="4829278778459836075">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‎‎‎‎‏‏‎‎‎‎‎‏‎‏‎‎‎‎‏‎‏‏‎‏‏‏‎‏‏‎‎‏‎‏‏‏‏‏‎‏‏‎‏‏‏‎‎‏‎‎‏‏‏‎‏‎‏‎‏‎‏‏‎Delete face data?‎‏‎‎‏‎"</string>
+    <string name="security_settings_face_settings_remove_dialog_details" msgid="1959642447512807205">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‎‏‏‏‎‏‏‎‎‏‏‎‎‏‎‎‎‎‎‏‏‎‎‎‏‏‎‏‏‎‎‎‏‏‎‎‎‏‎‏‏‎‎‎‏‏‏‎‎‏‎‎‏‏‏‎‎‏‎‎‏‎‏‎The images and biometric data used by face unlock will be permanently and securely deleted. After removal, you will need your PIN, pattern, or password to unlock your phone, sign in to apps, and confirm payments.‎‏‎‎‏‎"</string>
+    <string name="security_settings_face_settings_context_subtitle" msgid="4381276009777294566">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‎‏‏‏‏‎‎‏‏‎‎‏‏‎‏‎‏‏‎‏‎‏‏‎‏‎‏‎‎‎‏‎‏‏‎‎‎‎‏‏‎‏‏‎‏‏‏‎‏‏‎‏‏‎‎‏‏‏‎‎‏‏‎‎Use face unlock to unlock your phone‎‏‎‎‏‎"</string>
     <string name="security_settings_fingerprint_preference_title" msgid="2488725232406204350">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‎‏‎‎‎‏‎‏‎‎‎‏‎‎‏‏‎‏‏‏‎‏‎‎‏‏‎‏‎‎‏‏‎‏‏‏‏‎‏‎‎‎‏‏‏‏‏‏‎‎‎‏‏‏‏‏‎‏‏‏‏‏‎‎Fingerprint‎‏‎‎‏‎"</string>
     <string name="fingerprint_manage_category_title" msgid="8293801041700001681">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‏‏‎‎‏‏‎‎‎‏‏‎‎‏‏‎‎‎‎‎‎‎‎‎‎‏‏‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‏‏‎‎‎‏‎‏‏‏‏‎‎‏‎‎‎‏‎Manage fingerprints‎‏‎‎‏‎"</string>
     <string name="fingerprint_usage_category_title" msgid="8438526918999536619">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‏‏‎‏‎‏‎‎‎‏‏‎‏‏‏‎‏‎‏‎‏‏‏‎‎‎‎‏‏‎‎‎‎‎‏‎‏‎‏‎‎‎‏‎‎‏‏‏‏‏‎‎‏‏‏‏‏‎‏‎‏‏‎Use fingerprint for‎‏‎‎‏‎"</string>
@@ -4351,9 +4351,13 @@
     <string name="game_driver_app_preference_default" msgid="7686384740483216333">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‏‎‏‎‏‎‏‎‏‎‏‎‏‏‏‎‎‎‎‏‏‎‎‎‏‏‎‎‏‎‎‏‏‏‏‏‏‏‎‏‏‏‏‏‎‎‎‎‏‏‎‎‏‏‏‏‎‎‏‏‎‏‎Default‎‏‎‎‏‎"</string>
     <string name="game_driver_app_preference_game_driver" msgid="6426312331295324606">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‎‏‏‎‎‏‎‎‏‎‏‏‏‎‏‏‎‏‏‎‎‏‎‎‎‎‎‏‎‎‎‏‏‎‏‎‏‎‏‎‎‏‎‎‎‏‏‏‏‏‏‎‎‏‏‎‏‏‏‏‏‎‎Game Driver‎‏‎‎‏‎"</string>
     <string name="game_driver_app_preference_system" msgid="8272672982113332753">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‏‏‎‎‏‎‏‏‎‎‏‏‏‎‎‏‏‏‎‎‎‎‎‎‏‏‏‏‏‏‎‎‏‎‏‎‎‏‏‏‎‏‎‏‏‎‎‎‏‎‏‏‏‎‎‎‎‏‎‎‎‏‎System Graphics Driver‎‏‎‎‏‎"</string>
+    <!-- no translation found for game_driver_all_apps_preference_values:0 (7193648562434970105) -->
+    <!-- no translation found for game_driver_all_apps_preference_values:1 (7189663725490629463) -->
+    <!-- no translation found for game_driver_all_apps_preference_values:2 (7166160247759864796) -->
     <!-- no translation found for game_driver_app_preference_values:0 (4271044622117073985) -->
     <!-- no translation found for game_driver_app_preference_values:1 (6628516810440406199) -->
     <!-- no translation found for game_driver_app_preference_values:2 (1760397725970916076) -->
+    <!-- no translation found for game_driver_app_preference_values:3 (6260984152570269090) -->
     <string name="unsupported_setting_summary" product="default" msgid="11246953620654225">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‎‏‏‎‏‎‎‏‏‏‏‏‏‏‎‏‎‏‎‎‎‎‏‎‏‏‎‏‏‏‎‎‏‏‎‏‎‏‏‏‎‏‎‏‎‎‏‎‎‎‏‎‎‏‎‎‎‏‎Setting isn’t supported on this phone‎‏‎‎‏‎"</string>
     <string name="unsupported_setting_summary" product="tablet" msgid="6328431665635673717">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‎‏‎‏‏‏‏‏‎‏‎‎‏‏‎‎‎‏‏‎‏‏‎‎‎‏‎‎‏‎‎‎‎‎‎‏‏‏‏‎‎‎‏‏‎‎‎‏‎‎‎‏‏‎‎‏‏‏‎‏‎‏‎Setting isn’t supported on this tablet‎‏‎‎‏‎"</string>
     <string name="unsupported_setting_summary" product="device" msgid="2348970994972110886">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‎‏‎‎‎‎‎‏‎‎‏‏‎‎‏‎‎‏‏‏‎‎‎‏‎‏‎‏‏‎‎‏‎‏‎‏‏‏‏‎‎‎‎‎‎‏‎‎‎‏‏‎‎‎‎‎‎‏‎‎‏‏‎‎Setting isn’t supported on this device‎‏‎‎‏‎"</string>
diff --git a/res/values-ta/strings.xml b/res/values-ta/strings.xml
index 7291595..bdf3626 100644
--- a/res/values-ta/strings.xml
+++ b/res/values-ta/strings.xml
@@ -4456,7 +4456,7 @@
     <string name="default_for_calls_and_sms" msgid="3862322027700754792">"அழைப்புகளுக்கும் மெசேஜூக்கும்"</string>
     <string name="default_for_mobile_data" msgid="955987144209828344">"மொபைல் டேட்டாவுக்கு இயல்பான தேர்வு"</string>
     <string name="mobile_data_active" msgid="5108294051762397700">"மொபைல் டேட்டா ஆனில் உள்ளது"</string>
-    <string name="mobile_data_off" msgid="5831854766113105657">"மொபைல் டேட்டா ஆஃபில் உள்ளது"</string>
+    <string name="mobile_data_off" msgid="5831854766113105657">"மொபைல் டேட்டா ஆஃப் செய்யப்பட்டுள்ளது"</string>
     <string name="subscription_available" msgid="6502502298446954785">"பயன்படுத்துவதற்குத் தயாராக உள்ளது"</string>
     <string name="mobile_network_list_add_more" msgid="4000806369124701679">"மேலும் சேர்"</string>
     <!-- no translation found for mobile_network_active_sim (2375956837678169169) -->
diff --git a/res/values-te/strings.xml b/res/values-te/strings.xml
index 722b9d0..56183e17 100644
--- a/res/values-te/strings.xml
+++ b/res/values-te/strings.xml
@@ -1816,7 +1816,7 @@
     <string name="advanced_settings_summary" msgid="4016682978071086747">"మరిన్ని సెట్టింగ్‌ల ఎంపికలను ప్రారంభించు"</string>
     <string name="application_info_label" msgid="5736524913065714880">"యాప్ సమాచారం"</string>
     <string name="storage_label" msgid="8700867073480107253">"నిల్వ"</string>
-    <string name="auto_launch_label" msgid="2669236885531442195">"డిఫాల్ట్‌గా తెరువు"</string>
+    <string name="auto_launch_label" msgid="2669236885531442195">"డిఫాల్ట్‌గా తెరవడం"</string>
     <string name="auto_launch_label_generic" msgid="3230569852551968694">"డిఫాల్ట్‌లు"</string>
     <string name="screen_compatibility_label" msgid="663250687205465394">"స్క్రీన్ అనుకూలత"</string>
     <string name="permissions_label" msgid="2605296874922726203">"అనుమతులు"</string>
@@ -3647,7 +3647,7 @@
     <string name="slot_number" msgid="3762676044904653577">"(స్లాట్<xliff:g id="SLOT_NUM">%1$d</xliff:g>)"</string>
     <string name="launch_by_default" msgid="1840761193189009248">"డిఫాల్ట్‌గా తెరువు"</string>
     <string name="app_launch_domain_links_title" msgid="1160925981363706090">"లింక్‌లను తెరవడం"</string>
-    <string name="app_launch_open_domain_urls_title" msgid="8914721351596745701">"మద్దతిచ్చే లింక్‌లను తెరవండి"</string>
+    <string name="app_launch_open_domain_urls_title" msgid="8914721351596745701">"మద్దతిచ్చే లింక్‌లను తెరవడం"</string>
     <string name="app_launch_open_domain_urls_summary" msgid="5367573364240712217">"అడగకుండానే తెరవాలి"</string>
     <string name="app_launch_supported_domain_urls_title" msgid="8250695258211477480">"మద్దతిచ్చే లింక్‌లు"</string>
     <string name="app_launch_other_defaults_title" msgid="2516812499807835178">"ఇతర డిఫాల్ట్‌లు"</string>
@@ -3700,7 +3700,7 @@
     <string name="filter_notif_blocked_channels" msgid="5880190882221644289">"వర్గాలు: ఆఫ్ చేయబడినవి"</string>
     <string name="filter_notif_dnd_channels" msgid="1817930848881696728">"వర్గాలు: అంతరాయం కలిగించవద్దు నియమం పాటించనివి"</string>
     <string name="advanced_apps" msgid="4812975097124803873">"అధునాతనం"</string>
-    <string name="configure_apps" msgid="6685680790825882528">"అనువర్తనాలను కాన్ఫిగర్ చేయండి"</string>
+    <string name="configure_apps" msgid="6685680790825882528">"యాప్‌లను కాన్ఫిగర్ చేయండి"</string>
     <string name="unknown_app" msgid="5275921288718717656">"తెలియని యాప్"</string>
     <string name="app_permissions" msgid="5584182129908141622">"అనుమతి మేనేజర్"</string>
     <string name="app_permissions_summary" msgid="5163974162150406324">"యాప్‌లు <xliff:g id="APPS">%1$s</xliff:g>ని ఉపయోగిస్తున్నాయి"</string>
@@ -3715,9 +3715,9 @@
       <item quantity="other">మద్దతు ఉన్న లింక్‌లను తెరవగల సామర్థ్యం <xliff:g id="COUNT">%d</xliff:g> అనువర్తనాలకు ఉంది</item>
       <item quantity="one">మద్దతు ఉన్న లింక్‌లను తెరవగల సామర్థ్యం ఒక అనువర్తనానికి ఉంది</item>
     </plurals>
-    <string name="app_link_open_always" msgid="2474058700623948148">"ఈ అనువర్తనంలో తెరుస్తుంది"</string>
-    <string name="app_link_open_ask" msgid="7800878430190575991">"ప్రతిసారి అడుగుతుంది"</string>
-    <string name="app_link_open_never" msgid="3407647600352398543">"ఈ అనువర్తనంలో తెరవదు"</string>
+    <string name="app_link_open_always" msgid="2474058700623948148">"ఈ యాప్‌లో తెరవాలి"</string>
+    <string name="app_link_open_ask" msgid="7800878430190575991">"ప్రతిసారి అడగాలి"</string>
+    <string name="app_link_open_never" msgid="3407647600352398543">"ఈ యాప్‌లో తెరవకూడదు"</string>
     <string name="default_apps_title" msgid="1660450272764331490">"డిఫాల్ట్"</string>
     <string name="default_for_work" msgid="9152194239366247932">"కార్యాలయం కోసం డిఫాల్ట్"</string>
     <string name="assist_and_voice_input_title" msgid="1733165754793221197">"సహాయకం &amp; వాయిస్ ఇన్‌పుట్"</string>
@@ -3864,7 +3864,7 @@
     <string name="allow_overlay_description" msgid="8961670023925421358">"మీరు ఉపయోగించే ఇతర అనువర్తనాలలో ఎగువ భాగంలో కనిపించడం కోసం ఈ అనువర్తనాన్ని అనుమతించండి. మీరు ఆ అనువర్తనాలను ఉపయోగించే సమయంలో ఇది అంతరాయం కలిగించవచ్చు లేదా అవి కనిపించే లేదా ప్రవర్తించే తీరును మార్చవచ్చు."</string>
     <string name="keywords_vr_listener" msgid="7441221822576384680">"vr వర్చువల్ రియాలిటీ పరిశీలన స్టీరియో సహాయకం సేవ"</string>
     <string name="keywords_system_alert_window" msgid="5049498015597864850">"సిస్టమ్ హెచ్చరిక విండో డైలాగ్‌ని ఇతర అనువర్తనాల ఎగువన చూపు"</string>
-    <string name="overlay_settings" msgid="6930854109449524280">"ఇతర యాప్‌ల ఎగువన ప్రదర్శన"</string>
+    <string name="overlay_settings" msgid="6930854109449524280">"ఇతర యాప్‌ల పైన ప్రదర్శన"</string>
     <string name="system_alert_window_summary" msgid="602892301318324492">"<xliff:g id="COUNT_1">%2$d</xliff:g>లో <xliff:g id="COUNT_0">%1$d</xliff:g> యాప్‌లు ఇతర యాప్‌ల ఎగువన కనిపించడానికి అనుమతించబడ్డాయి"</string>
     <string name="filter_overlay_apps" msgid="6965969283342557573">"అనుమతి ఉన్న అనువర్తనాలు"</string>
     <string name="app_permission_summary_allowed" msgid="1505409933012886711">"అనుమతించబడింది"</string>
@@ -4210,7 +4210,7 @@
     <string name="oem_lock_info_message" msgid="9218313722236417510">"దయచేసి పరికర రక్షణ ఫీచర్‌ని ప్రారంభించడానికి పరికరాన్ని మళ్లీ ప్రారంభించండి."</string>
     <string name="automatic_storage_manager_freed_bytes" msgid="7517560170441007788">"మొత్తం <xliff:g id="SIZE">%1$s</xliff:g> అందుబాటులో ఉంచబడింది\n\nచివరిగా <xliff:g id="DATE">%2$s</xliff:g>న అమలు చేయబడింది"</string>
     <string name="web_action_enable_title" msgid="4051513950976670853">"తక్షణ యాప్‌లు"</string>
-    <string name="web_action_enable_summary" msgid="3108127559723396382">"లింక్‌లను యాప్‌లలో తెరవండి, వాటిని ఇన్‌స్టాల్ చేయకపోయినా ఫర్వాలేదు"</string>
+    <string name="web_action_enable_summary" msgid="3108127559723396382">"ఏవైనా యాప్‌లను ఇన్‌స్టాల్ చేయకపోయినా, వాటిలోనే లింక్‌లను తెరుస్తుంది"</string>
     <string name="web_action_section_title" msgid="7364647086538399136">"తక్షణ యాప్‌లు"</string>
     <string name="instant_apps_settings" msgid="8827777916518348213">"తక్షణ యాప్‌ల ప్రాధాన్యతలు"</string>
     <string name="domain_url_section_title" msgid="7046835219056428883">"ఇన్‌స్టాల్ చేయబడిన యాప్‌లు"</string>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index ab052e5..6f2961b 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -914,6 +914,8 @@
     <string name="security_settings_face_enroll_introduction_no_thanks">No thanks</string>
     <!-- Button text to start enrollment [CHAR LIMIT=30] -->
     <string name="security_settings_face_enroll_introduction_agree">Agree</string>
+    <!-- Button text to scroll to the end of a scrollview. [CHAR LIMIT=30] -->
+    <string name="security_settings_face_enroll_introduction_more">More</string>
     <!-- Introduction title shown in face enrollment to introduce the face unlock feature [CHAR LIMIT=40] -->
     <string name="security_settings_face_enroll_introduction_title">Unlock with your face</string>
     <!-- Introduction title shown in face enrollment to introduce the face unlock feature, when face unlock is disabled by device admin [CHAR LIMIT=60] -->
@@ -954,6 +956,18 @@
     <string name="security_settings_face_enroll_finish_title">All set. Looking good.</string>
     <!-- Button text to exit face wizard after everything is done [CHAR LIMIT=15] -->
     <string name="security_settings_face_enroll_done">Done</string>
+    <!-- Settings suggestion title text for re-enrolling a face. [CHAR LIMIT=50] -->
+    <string name="security_settings_face_enroll_should_re_enroll_title">Improve face unlock performance</string>
+    <!-- Settings suggestion subtitle text for re-enrolling a face. [CHAR LIMIT=40] -->
+    <string name="security_settings_face_enroll_should_re_enroll_subtitle">Set up face unlock again</string>
+    <!-- Settings suggestion title text for mandatory re-enrolling of a face. [CHAR LIMIT=50] -->
+    <string name="security_settings_face_enroll_must_re_enroll_title">Set up face unlock again</string>
+    <!-- Settings suggestion subtitle text for mandatory re-enrolling of a face. [CHAR LIMIT=40] -->
+    <string name="security_settings_face_enroll_must_re_enroll_subtitle">Improve security and performance</string>
+    <!-- Settings suggestion alert body title for re-enrolling a face. [CHAR LIMIT=60] -->
+    <string name="security_settings_face_enroll_improve_face_alert_title">Set up face unlock</string>
+    <!-- Settings suggestion alert body text for re-enrolling a face. [CHAR LIMIT=300] -->
+    <string name="security_settings_face_enroll_improve_face_alert_body">Delete your current face data to set up face unlock again.\n\nThe face data used by face unlock will be permanently and securely deleted. After removal, you will need your PIN, pattern, or password to unlock your phone, sign in to apps, and confirm payments.</string>
     <!-- Title for a category shown for the face settings page. [CHAR LIMIT=20] -->
     <string name="security_settings_face_settings_use_face_category">Use face unlock for</string>
     <!-- Text shown on a toggle which allows or disallows the device to use face for unlocking the device. [CHAR LIMIT=20] -->
@@ -979,7 +993,7 @@
     <!-- Dialog title shown when the user removes an enrollment [CHAR LIMIT=35] -->
     <string name="security_settings_face_settings_remove_dialog_title">Delete face data?</string>
     <!-- Dialog contents shown when the user removes an enrollment [CHAR LIMIT=NONE] -->
-    <string name="security_settings_face_settings_remove_dialog_details">The images and face model used by face unlock will be permanently and securely deleted. After removal, you will need your PIN, pattern, or password to unlock your phone, sign in to apps, and confirm payments.</string>
+    <string name="security_settings_face_settings_remove_dialog_details">The face data used by face unlock will be permanently and securely deleted. After removal, you will need your PIN, pattern, or password to unlock your phone, sign in to apps, and confirm payments.</string>
     <!-- Subtitle shown for contextual setting face enrollment [CHAR LIMIT=NONE] -->
     <string name="security_settings_face_settings_context_subtitle">Use face unlock to unlock your phone</string>
 
diff --git a/res/xml/app_notification_settings.xml b/res/xml/app_notification_settings.xml
index fedd3cc..7330f8d 100644
--- a/res/xml/app_notification_settings.xml
+++ b/res/xml/app_notification_settings.xml
@@ -30,6 +30,11 @@
         android:key="block_desc" />
 
     <!-- Channels/Channel groups added here -->
+    <PreferenceCategory
+        android:key="channels"
+        android:layout="@layout/empty_view"
+        settings:allowDividerAbove="false"
+        settings:allowDividerBelow="false" />
 
     <!-- Importance toggle -->
     <com.android.settingslib.RestrictedSwitchPreference
diff --git a/src/com/android/settings/applications/appinfo/AppButtonsPreferenceController.java b/src/com/android/settings/applications/appinfo/AppButtonsPreferenceController.java
index e15b0e3..e526417 100644
--- a/src/com/android/settings/applications/appinfo/AppButtonsPreferenceController.java
+++ b/src/com/android/settings/applications/appinfo/AppButtonsPreferenceController.java
@@ -160,7 +160,7 @@
     @Override
     public int getAvailabilityStatus() {
         // TODO(b/37313605): Re-enable once this controller supports instant apps
-        return isInstantApp() || isSystemModule() ? DISABLED_FOR_USER : AVAILABLE;
+        return mFinishing || isInstantApp() || isSystemModule() ? DISABLED_FOR_USER : AVAILABLE;
     }
 
     @Override
@@ -189,7 +189,7 @@
 
     @Override
     public void onResume() {
-        if (isAvailable() && !mFinishing) {
+        if (isAvailable()) {
             mAppsControlDisallowedBySystem = RestrictedLockUtilsInternal.hasBaseUserRestriction(
                     mActivity, UserManager.DISALLOW_APPS_CONTROL, mUserId);
             mAppsControlDisallowedAdmin = RestrictedLockUtilsInternal.checkIfRestrictionEnforced(
diff --git a/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java b/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java
index 965b8ed..5f164d6 100644
--- a/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java
+++ b/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java
@@ -33,6 +33,7 @@
 import com.google.android.setupcompat.template.FooterButton;
 import com.google.android.setupcompat.util.WizardManagerHelper;
 import com.google.android.setupdesign.span.LinkSpan;
+import com.google.android.setupdesign.template.RequireScrollMixin;
 
 public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
 
@@ -67,14 +68,25 @@
             );
         }
 
-        mFooterBarMixin.setPrimaryButton(
-                new FooterButton.Builder(this)
-                        .setText(R.string.security_settings_face_enroll_introduction_agree)
-                        .setListener(this::onNextButtonClick)
-                        .setButtonType(FooterButton.ButtonType.NEXT)
-                        .setTheme(R.style.SudGlifButton_Primary)
-                        .build()
-        );
+        FooterButton.Builder nextButtonBuilder = new FooterButton.Builder(this)
+                .setText(R.string.security_settings_face_enroll_introduction_agree)
+                .setButtonType(FooterButton.ButtonType.NEXT)
+                .setTheme(R.style.SudGlifButton_Primary);
+        if (maxFacesEnrolled()) {
+            nextButtonBuilder.setListener(this::onNextButtonClick);
+            mFooterBarMixin.setPrimaryButton(nextButtonBuilder.build());
+        } else {
+            final FooterButton agreeButton = nextButtonBuilder.build();
+            mFooterBarMixin.setPrimaryButton(agreeButton);
+            final RequireScrollMixin requireScrollMixin = getLayout().getMixin(
+                    RequireScrollMixin.class);
+            requireScrollMixin.requireScrollWithButton(this, agreeButton,
+                    R.string.security_settings_face_enroll_introduction_more,
+                    button -> {
+                        onNextButtonClick(button);
+                    });
+        }
+
     }
 
     @Override
@@ -134,13 +146,22 @@
         return findViewById(R.id.error_text);
     }
 
-    @Override
-    protected int checkMaxEnrolled() {
+    private boolean maxFacesEnrolled() {
         if (mFaceManager != null) {
             final int max = getResources().getInteger(
                     com.android.internal.R.integer.config_faceMaxTemplatesPerUser);
             final int numEnrolledFaces = mFaceManager.getEnrolledFaces(mUserId).size();
-            if (numEnrolledFaces >= max) {
+            return numEnrolledFaces >= max;
+        } else {
+            return false;
+        }
+    }
+
+    //TODO: Refactor this to something that conveys it is used for getting a string ID.
+    @Override
+    protected int checkMaxEnrolled() {
+        if (mFaceManager != null) {
+            if (maxFacesEnrolled()) {
                 return R.string.face_intro_error_max;
             }
         } else {
diff --git a/src/com/android/settings/biometrics/face/FaceSettingsLockscreenBypassPreferenceController.java b/src/com/android/settings/biometrics/face/FaceSettingsLockscreenBypassPreferenceController.java
index 15fab26..e717cb2 100644
--- a/src/com/android/settings/biometrics/face/FaceSettingsLockscreenBypassPreferenceController.java
+++ b/src/com/android/settings/biometrics/face/FaceSettingsLockscreenBypassPreferenceController.java
@@ -47,10 +47,10 @@
 
     @Override
     public boolean isChecked() {
-        boolean defaultValue = mContext.getResources().getBoolean(
-                com.android.internal.R.bool.config_faceAuthDismissesKeyguard);
-        return Settings.Secure.getInt(mContext.getContentResolver(),
-                Settings.Secure.FACE_UNLOCK_DISMISSES_KEYGUARD, defaultValue ? 1 : 0) != 0;
+        int defaultValue = mContext.getResources().getBoolean(
+                com.android.internal.R.bool.config_faceAuthDismissesKeyguard) ? 1 : 0;
+        return Settings.Secure.getIntForUser(mContext.getContentResolver(),
+                Settings.Secure.FACE_UNLOCK_DISMISSES_KEYGUARD, defaultValue, getUserId()) != 0;
     }
 
     @Override
@@ -81,7 +81,8 @@
         }
 
         if (mFaceManager != null && mFaceManager.isHardwareDetected()) {
-            return mFaceManager.hasEnrolledTemplates() ? AVAILABLE : DISABLED_DEPENDENT_SETTING;
+            return mFaceManager.hasEnrolledTemplates(getUserId())
+                    ? AVAILABLE : DISABLED_DEPENDENT_SETTING;
         } else {
             return UNSUPPORTED_ON_DEVICE;
         }
diff --git a/src/com/android/settings/bluetooth/BluetoothSliceBuilder.java b/src/com/android/settings/bluetooth/BluetoothSliceBuilder.java
index 18df872..5a4ee1f 100644
--- a/src/com/android/settings/bluetooth/BluetoothSliceBuilder.java
+++ b/src/com/android/settings/bluetooth/BluetoothSliceBuilder.java
@@ -136,6 +136,6 @@
         final Intent intent = new Intent(ACTION_BLUETOOTH_SLICE_CHANGED)
                 .setClass(context, SliceBroadcastReceiver.class);
         return PendingIntent.getBroadcast(context, 0 /* requestCode */, intent,
-                PendingIntent.FLAG_CANCEL_CURRENT);
+                PendingIntent.FLAG_UPDATE_CURRENT);
     }
 }
diff --git a/src/com/android/settings/core/gateway/SettingsGateway.java b/src/com/android/settings/core/gateway/SettingsGateway.java
index 5a81e71..384f262 100644
--- a/src/com/android/settings/core/gateway/SettingsGateway.java
+++ b/src/com/android/settings/core/gateway/SettingsGateway.java
@@ -106,7 +106,6 @@
 import com.android.settings.nfc.PaymentSettings;
 import com.android.settings.notification.AppBubbleNotificationSettings;
 import com.android.settings.notification.AppNotificationSettings;
-import com.android.settings.notification.ChannelGroupNotificationSettings;
 import com.android.settings.notification.ChannelNotificationSettings;
 import com.android.settings.notification.ConfigureNotificationSettings;
 import com.android.settings.notification.NotificationAccessSettings;
@@ -238,7 +237,6 @@
             AppNotificationSettings.class.getName(),
             NotificationAssistantPicker.class.getName(),
             ChannelNotificationSettings.class.getName(),
-            ChannelGroupNotificationSettings.class.getName(),
             ApnSettings.class.getName(),
             ApnEditor.class.getName(),
             WifiCallingSettings.class.getName(),
diff --git a/src/com/android/settings/development/BubbleGlobalPreferenceController.java b/src/com/android/settings/development/BubbleGlobalPreferenceController.java
index 86d7be1..2f22d09 100644
--- a/src/com/android/settings/development/BubbleGlobalPreferenceController.java
+++ b/src/com/android/settings/development/BubbleGlobalPreferenceController.java
@@ -16,8 +16,6 @@
 
 package com.android.settings.development;
 
-import static android.provider.Settings.Secure.NOTIFICATION_BUBBLES;
-
 import android.content.Context;
 import android.provider.Settings;
 
@@ -42,7 +40,7 @@
 
     @Override
     public String getPreferenceKey() {
-        return NOTIFICATION_BUBBLES;
+        return Settings.Global.NOTIFICATION_BUBBLES;
     }
 
     @Override
@@ -64,12 +62,12 @@
     }
 
     private boolean isEnabled() {
-        return Settings.Secure.getInt(mContext.getContentResolver(),
-                NOTIFICATION_BUBBLES, OFF) == ON;
+        return Settings.Global.getInt(mContext.getContentResolver(),
+                Settings.Global.NOTIFICATION_BUBBLES, OFF) == ON;
     }
 
     private void writeSetting(boolean isEnabled) {
-        Settings.Secure.putInt(mContext.getContentResolver(),
-                NOTIFICATION_BUBBLES, isEnabled ? ON : OFF);
+        Settings.Global.putInt(mContext.getContentResolver(),
+                Settings.Global.NOTIFICATION_BUBBLES, isEnabled ? ON : OFF);
     }
 }
diff --git a/src/com/android/settings/display/AmbientDisplayAlwaysOnPreferenceController.java b/src/com/android/settings/display/AmbientDisplayAlwaysOnPreferenceController.java
index 6a9e9fc..a0b1f44 100644
--- a/src/com/android/settings/display/AmbientDisplayAlwaysOnPreferenceController.java
+++ b/src/com/android/settings/display/AmbientDisplayAlwaysOnPreferenceController.java
@@ -17,6 +17,7 @@
 
 import android.content.Context;
 import android.hardware.display.AmbientDisplayConfiguration;
+import android.os.SystemProperties;
 import android.os.UserHandle;
 import android.provider.Settings;
 import android.text.TextUtils;
@@ -29,6 +30,7 @@
     private final int OFF = 0;
 
     private static final int MY_USER = UserHandle.myUserId();
+    private static final String PROP_AWARE_AVAILABLE = "ro.vendor.aware_available";
 
     private AmbientDisplayConfiguration mConfig;
     private OnPreferenceChangedCallback mCallback;
@@ -43,7 +45,9 @@
 
     @Override
     public int getAvailabilityStatus() {
-        return isAvailable(getConfig()) ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
+        return isAvailable(getConfig())
+                && !SystemProperties.getBoolean(PROP_AWARE_AVAILABLE, false) ?
+                AVAILABLE : UNSUPPORTED_ON_DEVICE;
     }
 
     @Override
diff --git a/src/com/android/settings/gestures/SystemNavigationGestureSettings.java b/src/com/android/settings/gestures/SystemNavigationGestureSettings.java
index 3def780..9e35529 100644
--- a/src/com/android/settings/gestures/SystemNavigationGestureSettings.java
+++ b/src/com/android/settings/gestures/SystemNavigationGestureSettings.java
@@ -31,7 +31,6 @@
 import android.content.SharedPreferences;
 import android.content.om.IOverlayManager;
 import android.content.om.OverlayInfo;
-import android.graphics.drawable.Drawable;
 import android.os.RemoteException;
 import android.os.ServiceManager;
 import android.provider.SearchIndexableResource;
@@ -48,6 +47,7 @@
 import com.android.settings.overlay.FeatureFactory;
 import com.android.settings.search.BaseSearchIndexProvider;
 import com.android.settings.search.Indexable;
+import com.android.settings.utils.CandidateInfoExtra;
 import com.android.settings.widget.RadioButtonPickerFragment;
 import com.android.settings.widget.RadioButtonPreference;
 import com.android.settings.widget.RadioButtonPreferenceWithExtraWidget;
@@ -150,12 +150,12 @@
     @Override
     public void bindPreferenceExtra(RadioButtonPreference pref,
             String key, CandidateInfo info, String defaultKey, String systemDefaultKey) {
-        if (!(info instanceof NavModeCandidateInfo)
+        if (!(info instanceof CandidateInfoExtra)
                 || !(pref instanceof RadioButtonPreferenceWithExtraWidget)) {
             return;
         }
 
-        pref.setSummary(((NavModeCandidateInfo) info).loadSummary());
+        pref.setSummary(((CandidateInfoExtra) info).loadSummary());
 
         RadioButtonPreferenceWithExtraWidget p = (RadioButtonPreferenceWithExtraWidget) pref;
         if (info.getKey() == KEY_SYSTEM_NAV_GESTURAL) {
@@ -175,25 +175,25 @@
     @Override
     protected List<? extends CandidateInfo> getCandidates() {
         final Context c = getContext();
-        List<NavModeCandidateInfo> candidates = new ArrayList<>();
+        List<CandidateInfoExtra> candidates = new ArrayList<>();
 
         if (SystemNavigationPreferenceController.isOverlayPackageAvailable(c,
                 NAV_BAR_MODE_GESTURAL_OVERLAY)) {
-            candidates.add(new NavModeCandidateInfo(
+            candidates.add(new CandidateInfoExtra(
                     c.getText(R.string.edge_to_edge_navigation_title),
                     c.getText(R.string.edge_to_edge_navigation_summary),
                     KEY_SYSTEM_NAV_GESTURAL, true /* enabled */));
         }
         if (SystemNavigationPreferenceController.isOverlayPackageAvailable(c,
                 NAV_BAR_MODE_2BUTTON_OVERLAY)) {
-            candidates.add(new NavModeCandidateInfo(
+            candidates.add(new CandidateInfoExtra(
                     c.getText(R.string.swipe_up_to_switch_apps_title),
                     c.getText(R.string.swipe_up_to_switch_apps_summary),
                     KEY_SYSTEM_NAV_2BUTTONS, true /* enabled */));
         }
         if (SystemNavigationPreferenceController.isOverlayPackageAvailable(c,
                 NAV_BAR_MODE_3BUTTON_OVERLAY)) {
-            candidates.add(new NavModeCandidateInfo(
+            candidates.add(new CandidateInfoExtra(
                     c.getText(R.string.legacy_navigation_title),
                     c.getText(R.string.legacy_navigation_summary),
                     KEY_SYSTEM_NAV_3BUTTONS, true /* enabled */));
@@ -325,39 +325,6 @@
                 Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED, 0) == 1;
     }
 
-    static class NavModeCandidateInfo extends CandidateInfo {
-        private final CharSequence mLabel;
-        private final CharSequence mSummary;
-        private final String mKey;
-
-        NavModeCandidateInfo(CharSequence label, CharSequence summary, String key,
-                boolean enabled) {
-            super(enabled);
-            mLabel = label;
-            mSummary = summary;
-            mKey = key;
-        }
-
-        @Override
-        public CharSequence loadLabel() {
-            return mLabel;
-        }
-
-        public CharSequence loadSummary() {
-            return mSummary;
-        }
-
-        @Override
-        public Drawable loadIcon() {
-            return null;
-        }
-
-        @Override
-        public String getKey() {
-            return mKey;
-        }
-    }
-
     public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
             new BaseSearchIndexProvider() {
                 @Override
diff --git a/src/com/android/settings/homepage/contextualcards/FaceReEnrollDialog.java b/src/com/android/settings/homepage/contextualcards/FaceReEnrollDialog.java
new file mode 100644
index 0000000..46ba26d
--- /dev/null
+++ b/src/com/android/settings/homepage/contextualcards/FaceReEnrollDialog.java
@@ -0,0 +1,122 @@
+/*
+ * 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.homepage.contextualcards;
+
+
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.hardware.face.Face;
+import android.hardware.face.FaceManager;
+import android.os.Bundle;
+import android.provider.Settings;
+import android.util.Log;
+
+import com.android.internal.app.AlertActivity;
+import com.android.internal.app.AlertController;
+import com.android.settings.R;
+import com.android.settings.Utils;
+import com.android.settings.homepage.contextualcards.slices.FaceSetupSlice;
+
+/**
+ * This class is used to show a popup dialog for {@link FaceSetupSlice}.
+ */
+public class FaceReEnrollDialog extends AlertActivity implements
+        DialogInterface.OnClickListener {
+
+    private static final String TAG = "FaceReEnrollDialog";
+
+    private static final String BIOMETRIC_ENROLL_ACTION = "android.settings.BIOMETRIC_ENROLL";
+
+    private FaceManager mFaceManager;
+    /**
+     * The type of re-enrollment that has been requested,
+     * see {@link Settings.Secure#FACE_UNLOCK_RE_ENROLL} for more details.
+     */
+    private int mReEnrollType;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        final AlertController.AlertParams alertParams = mAlertParams;
+        alertParams.mTitle = getText(
+                R.string.security_settings_face_enroll_improve_face_alert_title);
+        alertParams.mMessage = getText(
+                R.string.security_settings_face_enroll_improve_face_alert_body);
+        alertParams.mPositiveButtonText = getText(R.string.storage_menu_set_up);
+        alertParams.mNegativeButtonText = getText(R.string.cancel);
+        alertParams.mPositiveButtonListener = this;
+
+        mFaceManager = Utils.getFaceManagerOrNull(getApplicationContext());
+
+        final Context context = getApplicationContext();
+        mReEnrollType = FaceSetupSlice.getReEnrollSetting(context, getUserId());
+
+        Log.d(TAG, "ReEnroll Type : " + mReEnrollType);
+        if (mReEnrollType == FaceSetupSlice.FACE_RE_ENROLL_SUGGESTED) {
+            // setupAlert will actually display the popup dialog.
+            setupAlert();
+        } else if (mReEnrollType == FaceSetupSlice.FACE_RE_ENROLL_REQUIRED) {
+            // in this case we are skipping the popup dialog and directly going to the
+            // re enrollment flow. A grey overlay will appear to indicate that we are
+            // transitioning.
+            removeFaceAndReEnroll();
+        } else {
+            Log.d(TAG, "Error unsupported flow for : " + mReEnrollType);
+            dismiss();
+        }
+    }
+
+    @Override
+    public void onClick(DialogInterface dialog, int which) {
+        removeFaceAndReEnroll();
+    }
+
+    public void removeFaceAndReEnroll() {
+        final int userId = getUserId();
+        if (mFaceManager == null || !mFaceManager.hasEnrolledTemplates(userId)) {
+            finish();
+        }
+        mFaceManager.remove(new Face("", 0, 0), userId, new FaceManager.RemovalCallback() {
+            @Override
+            public void onRemovalError(Face face, int errMsgId, CharSequence errString) {
+                super.onRemovalError(face, errMsgId, errString);
+                finish();
+            }
+
+            @Override
+            public void onRemovalSucceeded(Face face, int remaining) {
+                super.onRemovalSucceeded(face, remaining);
+                if (remaining != 0) {
+                    return;
+                }
+                // Send user to the enroll flow.
+                final Intent reEnroll = new Intent(BIOMETRIC_ENROLL_ACTION);
+                final Context context = getApplicationContext();
+
+                try {
+                    startActivity(reEnroll);
+                } catch (Exception e) {
+                    Log.e(TAG, "Failed to startActivity");
+                }
+
+                finish();
+            }
+        });
+    }
+}
diff --git a/src/com/android/settings/homepage/contextualcards/slices/ContextualAdaptiveSleepSlice.java b/src/com/android/settings/homepage/contextualcards/slices/ContextualAdaptiveSleepSlice.java
index 3da5763..c477abc 100644
--- a/src/com/android/settings/homepage/contextualcards/slices/ContextualAdaptiveSleepSlice.java
+++ b/src/com/android/settings/homepage/contextualcards/slices/ContextualAdaptiveSleepSlice.java
@@ -26,6 +26,7 @@
 import android.content.Context;
 import android.content.Intent;
 import android.net.Uri;
+import android.provider.Settings;
 
 import androidx.core.graphics.drawable.IconCompat;
 import androidx.slice.Slice;
@@ -72,11 +73,12 @@
             return null;
         }
 
-        // Display the contextual card only if all the following 3 conditions hold:
-        // 1. The Screen Attention is enabled in Settings.
+        // Display the contextual card only if all the following 4 conditions hold:
+        // 1. The Screen Attention is available in Settings.
         // 2. The device is not recently set up.
         // 3. Current user hasn't opened Screen Attention's settings page before.
-        if (isSettingsAvailable() && !isUserInteracted() && !isRecentlySetup()) {
+        // 4. Screen Attention is off.
+        if (isSettingsAvailable() && !isUserInteracted() && !isRecentlySetup() && !isTurnedOn()) {
             final IconCompat icon = IconCompat.createWithResource(mContext,
                     R.drawable.ic_settings_adaptive_sleep);
             final CharSequence title = mContext.getText(R.string.adaptive_sleep_title);
@@ -123,6 +125,14 @@
     }
 
     /**
+     * @return {@code true} if the feature is turned on for the device, otherwise {@code false}
+     */
+    private boolean isTurnedOn() {
+        return Settings.System.getInt(
+                mContext.getContentResolver(), Settings.System.ADAPTIVE_SLEEP, 0) != 0;
+    }
+
+    /**
      * @return {@code true} if the current user has opened the Screen Attention settings page
      * before, otherwise {@code false}.
      */
diff --git a/src/com/android/settings/homepage/contextualcards/slices/FaceSetupSlice.java b/src/com/android/settings/homepage/contextualcards/slices/FaceSetupSlice.java
index 112f655..2e34824 100644
--- a/src/com/android/settings/homepage/contextualcards/slices/FaceSetupSlice.java
+++ b/src/com/android/settings/homepage/contextualcards/slices/FaceSetupSlice.java
@@ -17,17 +17,14 @@
 package com.android.settings.homepage.contextualcards.slices;
 
 
-import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_SUCCESS;
-
 import android.app.PendingIntent;
 import android.app.settings.SettingsEnums;
 import android.content.Context;
 import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.hardware.biometrics.BiometricManager;
 import android.hardware.face.FaceManager;
 import android.net.Uri;
 import android.os.UserHandle;
+import android.provider.Settings;
 
 import androidx.core.graphics.drawable.IconCompat;
 import androidx.slice.Slice;
@@ -39,14 +36,40 @@
 import com.android.settings.SubSettings;
 import com.android.settings.Utils;
 import com.android.settings.biometrics.face.FaceStatusPreferenceController;
+import com.android.settings.homepage.contextualcards.FaceReEnrollDialog;
 import com.android.settings.security.SecuritySettings;
 import com.android.settings.slices.CustomSliceRegistry;
 import com.android.settings.slices.CustomSliceable;
 import com.android.settings.slices.SliceBuilderUtils;
 
+/**
+ * This class is used for showing re-enroll suggestions in the Settings page. By either having an
+ * un-enrolled user or setting {@link Settings.Secure#FACE_UNLOCK_RE_ENROLL} to one of the
+ * states listed in {@link Settings.Secure} the slice will change its text and potentially show
+ * a {@link FaceReEnrollDialog}.
+ */
 public class FaceSetupSlice implements CustomSliceable {
 
     private final Context mContext;
+    /**
+     * If a user currently is not enrolled then this class will show a recommendation to
+     * enroll their face.
+     */
+    private FaceManager mFaceManager;
+
+    /**
+     * Various states the {@link FaceSetupSlice} can be in,
+     * See {@link Settings.Secure#FACE_UNLOCK_RE_ENROLL} for more details.
+     */
+
+    // No re-enrollment.
+    public static final int FACE_NO_RE_ENROLL_REQUIRED = 0;
+    // Re enrollment is suggested.
+    public static final int FACE_RE_ENROLL_SUGGESTED = 1;
+    // Re enrollment is required after a set time period.
+    public static final int FACE_RE_ENROLL_AFTER_TIMEOUT = 2;
+    // Re enrollment is required immediately.
+    public static final int FACE_RE_ENROLL_REQUIRED = 3;
 
     public FaceSetupSlice(Context context) {
         mContext = context;
@@ -54,21 +77,45 @@
 
     @Override
     public Slice getSlice() {
-        final FaceManager faceManager = Utils.getFaceManagerOrNull(mContext);
-        if (faceManager == null || faceManager.hasEnrolledTemplates(UserHandle.myUserId())) {
-            return null;
+        mFaceManager = Utils.getFaceManagerOrNull(mContext);
+        if (mFaceManager == null) {
+            return new ListBuilder(mContext, CustomSliceRegistry.FACE_ENROLL_SLICE_URI,
+                    ListBuilder.INFINITY).setIsError(true).build();
         }
 
-        final CharSequence title = mContext.getText(
-                R.string.security_settings_face_settings_enroll);
+        final int userId = UserHandle.myUserId();
+        final boolean hasEnrolledTemplates = mFaceManager.hasEnrolledTemplates(userId);
+        final int shouldReEnroll = FaceSetupSlice.getReEnrollSetting(mContext, userId);
+
+        CharSequence title = "";
+        CharSequence subtitle = "";
+
+        // Set the title and subtitle according to the different states, the icon and layout will
+        // stay the same.
+        if (!hasEnrolledTemplates) {
+            title = mContext.getText(R.string.security_settings_face_settings_enroll);
+            subtitle = mContext.getText(
+                    R.string.security_settings_face_settings_context_subtitle);
+        } else if (shouldReEnroll == FACE_RE_ENROLL_SUGGESTED) {
+            title = mContext.getText(
+                    R.string.security_settings_face_enroll_should_re_enroll_title);
+            subtitle = mContext.getText(
+                    R.string.security_settings_face_enroll_should_re_enroll_subtitle);
+        } else if (shouldReEnroll == FACE_RE_ENROLL_REQUIRED) {
+            title = mContext.getText(
+                    R.string.security_settings_face_enroll_must_re_enroll_title);
+            subtitle = mContext.getText(
+                    R.string.security_settings_face_enroll_must_re_enroll_subtitle);
+        } else {
+            return new ListBuilder(mContext, CustomSliceRegistry.FACE_ENROLL_SLICE_URI,
+                    ListBuilder.INFINITY).setIsError(true).build();
+        }
+
         final ListBuilder listBuilder = new ListBuilder(mContext,
                 CustomSliceRegistry.FACE_ENROLL_SLICE_URI, ListBuilder.INFINITY)
                 .setAccentColor(Utils.getColorAccentDefaultColor(mContext));
         final IconCompat icon = IconCompat.createWithResource(mContext, R.drawable.ic_face_24dp);
-        return listBuilder
-                .addRow(buildRowBuilder(title,
-                        mContext.getText(R.string.security_settings_face_settings_context_subtitle),
-                        icon, mContext, getIntent()))
+        return listBuilder.addRow(buildRowBuilder(title, subtitle, icon, mContext, getIntent()))
                 .build();
     }
 
@@ -79,12 +126,18 @@
 
     @Override
     public Intent getIntent() {
-        return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
-                SecuritySettings.class.getName(),
-                FaceStatusPreferenceController.KEY_FACE_SETTINGS,
-                mContext.getText(R.string.security_settings_face_settings_enroll).toString(),
-                SettingsEnums.SLICE)
-                .setClassName(mContext.getPackageName(), SubSettings.class.getName());
+        final boolean hasEnrolledTemplates = mFaceManager.hasEnrolledTemplates(
+                UserHandle.myUserId());
+        if (!hasEnrolledTemplates) {
+            return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
+                    SecuritySettings.class.getName(),
+                    FaceStatusPreferenceController.KEY_FACE_SETTINGS,
+                    mContext.getText(R.string.security_settings_face_settings_enroll).toString(),
+                    SettingsEnums.SLICE)
+                    .setClassName(mContext.getPackageName(), SubSettings.class.getName());
+        } else {
+            return new Intent(mContext, FaceReEnrollDialog.class);
+        }
     }
 
     private static RowBuilder buildRowBuilder(CharSequence title, CharSequence subTitle,
@@ -98,4 +151,10 @@
                 .setSubtitle(subTitle)
                 .setPrimaryAction(primarySliceAction);
     }
+
+    public static int getReEnrollSetting(Context context, int userId) {
+        return Settings.Secure.getIntForUser(context.getContentResolver(),
+                Settings.Secure.FACE_UNLOCK_RE_ENROLL, FACE_NO_RE_ENROLL_REQUIRED, userId);
+    }
+
 }
\ No newline at end of file
diff --git a/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSlice.java b/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSlice.java
index ccccd39..ff76779 100644
--- a/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSlice.java
+++ b/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSlice.java
@@ -20,7 +20,7 @@
 import static android.app.NotificationManager.IMPORTANCE_NONE;
 import static android.app.slice.Slice.EXTRA_TOGGLE_STATE;
 
-import static com.android.settings.notification.NotificationSettingsBase.ARG_FROM_SETTINGS;
+import static com.android.settings.notification.ChannelListPreferenceController.ARG_FROM_SETTINGS;
 
 import android.app.Application;
 import android.app.NotificationChannel;
@@ -110,7 +110,7 @@
      *
      * Note:
      * When the sent count of notification channels is the same, follow the sorting mechanism from
-     * {@link com.android.settings.notification.NotificationSettingsBase#mChannelComparator}.
+     * {@link com.android.settings.notification.ChannelListPreferenceController}.
      * Since slice view only shows displayable notification channels, so those deleted ones are
      * excluded from the comparison here.
      */
@@ -257,7 +257,6 @@
         channelArgs.putInt(AppInfoBase.ARG_PACKAGE_UID, mUid);
         channelArgs.putString(AppInfoBase.ARG_PACKAGE_NAME, mPackageName);
         channelArgs.putString(Settings.EXTRA_CHANNEL_ID, channel.getId());
-        channelArgs.putBoolean(ARG_FROM_SETTINGS, true);
 
         final Intent channelIntent = new SubSettingLauncher(mContext)
                 .setDestination(ChannelNotificationSettings.class.getName())
diff --git a/src/com/android/settings/network/ApnEditor.java b/src/com/android/settings/network/ApnEditor.java
index 542a869..1451a40 100644
--- a/src/com/android/settings/network/ApnEditor.java
+++ b/src/com/android/settings/network/ApnEditor.java
@@ -135,7 +135,10 @@
     private int mBearerInitialVal = 0;
     private String mMvnoTypeStr;
     private String mMvnoMatchDataStr;
-    private String[] mReadOnlyApnTypes;
+    @VisibleForTesting
+    String[] mReadOnlyApnTypes;
+    @VisibleForTesting
+    String[] mDefaultApnTypes;
     private String[] mReadOnlyApnFields;
     private boolean mReadOnlyApn;
     private Uri mCarrierUri;
@@ -189,7 +192,8 @@
     private static final int MMSPROXY_INDEX = 12;
     private static final int MMSPORT_INDEX = 13;
     private static final int AUTH_TYPE_INDEX = 14;
-    private static final int TYPE_INDEX = 15;
+    @VisibleForTesting
+    static final int TYPE_INDEX = 15;
     private static final int PROTOCOL_INDEX = 16;
     @VisibleForTesting
     static final int CARRIER_ENABLED_INDEX = 17;
@@ -250,12 +254,17 @@
                 mReadOnlyApnTypes = b.getStringArray(
                         CarrierConfigManager.KEY_READ_ONLY_APN_TYPES_STRING_ARRAY);
                 if (!ArrayUtils.isEmpty(mReadOnlyApnTypes)) {
-                    for (String apnType : mReadOnlyApnTypes) {
-                        Log.d(TAG, "onCreate: read only APN type: " + apnType);
-                    }
+                    Log.d(TAG,
+                            "onCreate: read only APN type: " + Arrays.toString(mReadOnlyApnTypes));
                 }
                 mReadOnlyApnFields = b.getStringArray(
                         CarrierConfigManager.KEY_READ_ONLY_APN_FIELDS_STRING_ARRAY);
+
+                mDefaultApnTypes = b.getStringArray(
+                        CarrierConfigManager.KEY_APN_SETTINGS_DEFAULT_APN_TYPES_STRING_ARRAY);
+                if (!ArrayUtils.isEmpty(mDefaultApnTypes)) {
+                    Log.d(TAG, "onCreate: default apn types: " + Arrays.toString(mDefaultApnTypes));
+                }
             }
         }
 
@@ -1150,17 +1159,24 @@
         return sNotSet.equals(value) ? null : value;
     }
 
-    private String getUserEnteredApnType() {
+    @VisibleForTesting
+    String getUserEnteredApnType() {
         // if user has not specified a type, map it to "ALL APN TYPES THAT ARE NOT READ-ONLY"
+        // but if user enter empty type, map it just for default
         String userEnteredApnType = mApnType.getText();
         if (userEnteredApnType != null) userEnteredApnType = userEnteredApnType.trim();
         if ((TextUtils.isEmpty(userEnteredApnType)
                 || PhoneConstants.APN_TYPE_ALL.equals(userEnteredApnType))
                 && !ArrayUtils.isEmpty(mReadOnlyApnTypes)) {
+            String[] apnTypeList = PhoneConstants.APN_TYPES;
+            if (TextUtils.isEmpty(userEnteredApnType) && !ArrayUtils.isEmpty(mDefaultApnTypes)) {
+                apnTypeList = mDefaultApnTypes;
+            }
+
             StringBuilder editableApnTypes = new StringBuilder();
             List<String> readOnlyApnTypes = Arrays.asList(mReadOnlyApnTypes);
             boolean first = true;
-            for (String apnType : PhoneConstants.APN_TYPES) {
+            for (String apnType : apnTypeList) {
                 // add APN type if it is not read-only and is not wild-cardable
                 if (!readOnlyApnTypes.contains(apnType)
                         && !apnType.equals(PhoneConstants.APN_TYPE_IA)
diff --git a/src/com/android/settings/network/MobileNetworkPreferenceController.java b/src/com/android/settings/network/MobileNetworkPreferenceController.java
index 3813435..646f10c 100644
--- a/src/com/android/settings/network/MobileNetworkPreferenceController.java
+++ b/src/com/android/settings/network/MobileNetworkPreferenceController.java
@@ -37,6 +37,7 @@
 import com.android.settings.core.FeatureFlags;
 import com.android.settings.core.PreferenceControllerMixin;
 import com.android.settings.network.telephony.MobileNetworkActivity;
+import com.android.settings.network.telephony.MobileNetworkUtils;
 import com.android.settingslib.RestrictedLockUtilsInternal;
 import com.android.settingslib.RestrictedPreference;
 import com.android.settingslib.Utils;
@@ -162,6 +163,6 @@
 
     @Override
     public CharSequence getSummary() {
-        return mTelephonyManager.getNetworkOperatorName();
+        return MobileNetworkUtils.getCurrentCarrierNameForDisplay(mContext);
     }
 }
diff --git a/src/com/android/settings/network/telephony/MobileNetworkUtils.java b/src/com/android/settings/network/telephony/MobileNetworkUtils.java
index 70b92c9..d180b70 100644
--- a/src/com/android/settings/network/telephony/MobileNetworkUtils.java
+++ b/src/com/android/settings/network/telephony/MobileNetworkUtils.java
@@ -536,4 +536,60 @@
         icons.setTintList(Utils.getColorAttr(context, android.R.attr.colorControlNormal));
         return icons;
     }
+
+    /**
+     * This method is migrated from
+     * {@link android.telephony.TelephonyManager.getNetworkOperatorName}. Which provides
+     *
+     * 1. Better support under multi-SIM environment.
+     * 2. Similar design which aligned with operator name displayed in status bar
+     */
+    public static CharSequence getCurrentCarrierNameForDisplay(Context context, int subId) {
+        SubscriptionManager sm = context.getSystemService(SubscriptionManager.class);
+        if (sm != null) {
+            SubscriptionInfo subInfo = getSubscriptionInfo(sm, subId);
+            if (subInfo != null) {
+                return subInfo.getCarrierName();
+            }
+        }
+        return getOperatorNameFromTelephonyManager(context);
+    }
+
+    public static CharSequence getCurrentCarrierNameForDisplay(Context context) {
+        SubscriptionManager sm = context.getSystemService(SubscriptionManager.class);
+        if (sm != null) {
+            int subId = sm.getDefaultSubscriptionId();
+            SubscriptionInfo subInfo = getSubscriptionInfo(sm, subId);
+            if (subInfo != null) {
+                return subInfo.getCarrierName();
+            }
+        }
+        return getOperatorNameFromTelephonyManager(context);
+    }
+
+    private static SubscriptionInfo getSubscriptionInfo(SubscriptionManager subManager,
+            int subId) {
+        List<SubscriptionInfo> subInfos = subManager.getAccessibleSubscriptionInfoList();
+        if (subInfos == null) {
+            subInfos = subManager.getActiveSubscriptionInfoList();
+        }
+        if (subInfos == null) {
+            return null;
+        }
+        for (SubscriptionInfo subInfo : subInfos) {
+            if (subInfo.getSubscriptionId() == subId) {
+                return subInfo;
+            }
+        }
+        return null;
+    }
+
+    private static String getOperatorNameFromTelephonyManager(Context context) {
+        TelephonyManager tm =
+                (TelephonyManager) context.getSystemService(TelephonyManager.class);
+        if (tm == null) {
+            return null;
+        }
+        return tm.getNetworkOperatorName();
+    }
 }
diff --git a/src/com/android/settings/network/telephony/NetworkSelectSettings.java b/src/com/android/settings/network/telephony/NetworkSelectSettings.java
index 62947d1..e288763 100644
--- a/src/com/android/settings/network/telephony/NetworkSelectSettings.java
+++ b/src/com/android/settings/network/telephony/NetworkSelectSettings.java
@@ -310,9 +310,8 @@
      * 1. use {@code ServiceState#getNetworkRegistrationInfoList()} to get the currently
      * registered cellIdentity, wrap it into a CellInfo;
      * 2. set the signal strength level as strong;
-     * 3. use {@link TelephonyManager#getNetworkOperatorName()} to get the title of the
-     * previously connected network operator, since the CellIdentity got from step 1 only has
-     * PLMN.
+     * 3. get the title of the previously connected network operator, since the CellIdentity
+     * got from step 1 only has PLMN.
      * - If the device has no data, we will remove the connected network operators list from the
      * screen.
      */
@@ -333,7 +332,8 @@
             if (cellInfo != null) {
                 NetworkOperatorPreference pref = new NetworkOperatorPreference(
                         cellInfo, getPrefContext(), mForbiddenPlmns, mShow4GForLTE);
-                pref.setTitle(mTelephonyManager.getNetworkOperatorName());
+                pref.setTitle(MobileNetworkUtils.getCurrentCarrierNameForDisplay(
+                        getPrefContext(), mSubId));
                 pref.setSummary(R.string.network_connected);
                 // Update the signal strength icon, since the default signalStrength value would be
                 // zero (it would be quite confusing why the connected network has no signal)
diff --git a/src/com/android/settings/network/telephony/gsm/OpenNetworkSelectPagePreferenceController.java b/src/com/android/settings/network/telephony/gsm/OpenNetworkSelectPagePreferenceController.java
index 46171bc..d679373 100644
--- a/src/com/android/settings/network/telephony/gsm/OpenNetworkSelectPagePreferenceController.java
+++ b/src/com/android/settings/network/telephony/gsm/OpenNetworkSelectPagePreferenceController.java
@@ -75,7 +75,7 @@
     public CharSequence getSummary() {
         final ServiceState ss = mTelephonyManager.getServiceState();
         if (ss != null && ss.getState() == ServiceState.STATE_IN_SERVICE) {
-            return mTelephonyManager.getNetworkOperatorName();
+            return MobileNetworkUtils.getCurrentCarrierNameForDisplay(mContext, mSubId);
         } else {
             return mContext.getString(R.string.network_disconnected);
         }
@@ -108,4 +108,4 @@
     public void onNetworkSelectModeChanged() {
         updateState(mPreference);
     }
-}
\ No newline at end of file
+}
diff --git a/src/com/android/settings/notification/AppNotificationSettings.java b/src/com/android/settings/notification/AppNotificationSettings.java
index 531d8fa..dc06f47 100644
--- a/src/com/android/settings/notification/AppNotificationSettings.java
+++ b/src/com/android/settings/notification/AppNotificationSettings.java
@@ -16,46 +16,34 @@
 
 package com.android.settings.notification;
 
-import android.app.NotificationChannel;
-import android.app.NotificationChannelGroup;
 import android.app.settings.SettingsEnums;
 import android.content.Context;
-import android.os.AsyncTask;
 import android.os.Bundle;
 import android.text.TextUtils;
 import android.util.Log;
 
-import androidx.preference.Preference;
-import androidx.preference.PreferenceCategory;
-import androidx.preference.PreferenceGroup;
-import androidx.preference.PreferenceScreen;
-import androidx.preference.SwitchPreference;
-
 import com.android.internal.widget.LockPatternUtils;
 import com.android.settings.R;
-import com.android.settings.widget.MasterSwitchPreference;
-import com.android.settingslib.RestrictedSwitchPreference;
 import com.android.settingslib.core.AbstractPreferenceController;
 
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
 import java.util.List;
 
+import androidx.preference.Preference;
+import androidx.preference.PreferenceGroup;
+import androidx.preference.PreferenceScreen;
+
 /** These settings are per app, so should not be returned in global search results. */
 public class AppNotificationSettings extends NotificationSettingsBase {
     private static final String TAG = "AppNotificationSettings";
     private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
 
-    private static String KEY_GENERAL_CATEGORY = "categories";
     private static String KEY_ADVANCED_CATEGORY = "app_advanced";
     private static String KEY_BADGE = "badge";
     private static String KEY_APP_LINK = "app_link";
     private static String KEY_BUBBLE = "bubble_link_pref";
     private static String[] LEGACY_NON_ADVANCED_KEYS = {KEY_BADGE, KEY_APP_LINK, KEY_BUBBLE};
 
-    private List<NotificationChannelGroup> mChannelGroupList;
-
     @Override
     public int getMetricsCategory() {
         return SettingsEnums.NOTIFICATION_APP_NOTIFICATION;
@@ -91,26 +79,6 @@
             return;
         }
 
-        if (!mShowLegacyChannelConfig) {
-            // Load channel settings
-            new AsyncTask<Void, Void, Void>() {
-                @Override
-                protected Void doInBackground(Void... unused) {
-                    mChannelGroupList = mBackend.getGroups(mPkg, mUid).getList();
-                    Collections.sort(mChannelGroupList, mChannelGroupComparator);
-                    return null;
-                }
-
-                @Override
-                protected void onPostExecute(Void unused) {
-                    if (getHost() == null) {
-                        return;
-                    }
-                    populateList();
-                }
-            }.execute();
-        }
-
         for (NotificationPreferenceController controller : mControllers) {
             controller.onResume(mAppRow, mChannel, mChannelGroup, mSuspendedAppsAdmin);
             controller.displayPreference(getPreferenceScreen());
@@ -154,125 +122,7 @@
         mControllers.add(new NotificationsOffPreferenceController(context));
         mControllers.add(new DeletedChannelsPreferenceController(context, mBackend));
         mControllers.add(new BubbleSummaryPreferenceController(context, mBackend));
+        mControllers.add(new ChannelListPreferenceController(context, mBackend));
         return new ArrayList<>(mControllers);
     }
-
-    private void populateList() {
-        if (!mDynamicPreferences.isEmpty()) {
-            for (Preference p : mDynamicPreferences) {
-                getPreferenceScreen().removePreference(p);
-            }
-            mDynamicPreferences.clear();
-        }
-        if (mChannelGroupList.isEmpty()) {
-            PreferenceCategory groupCategory = new PreferenceCategory(getPrefContext());
-            groupCategory.setTitle(R.string.notification_channels);
-            groupCategory.setKey(KEY_GENERAL_CATEGORY);
-            getPreferenceScreen().addPreference(groupCategory);
-            mDynamicPreferences.add(groupCategory);
-
-            Preference empty = new Preference(getPrefContext());
-            empty.setTitle(R.string.no_channels);
-            empty.setEnabled(false);
-            groupCategory.addPreference(empty);
-        } else {
-            populateGroupList();
-            mImportanceListener.onImportanceChanged();
-        }
-    }
-
-    private void populateGroupList() {
-        for (NotificationChannelGroup group : mChannelGroupList) {
-            PreferenceCategory groupCategory = new PreferenceCategory(getPrefContext());
-            groupCategory.setOrderingAsAdded(true);
-            getPreferenceScreen().addPreference(groupCategory);
-            mDynamicPreferences.add(groupCategory);
-            if (group.getId() == null) {
-                if (mChannelGroupList.size() > 1) {
-                    groupCategory.setTitle(R.string.notification_channels_other);
-                }
-                groupCategory.setKey(KEY_GENERAL_CATEGORY);
-            } else {
-                groupCategory.setTitle(group.getName());
-                groupCategory.setKey(group.getId());
-                populateGroupToggle(groupCategory, group);
-            }
-            if (!group.isBlocked()) {
-                final List<NotificationChannel> channels = group.getChannels();
-                Collections.sort(channels, mChannelComparator);
-                int N = channels.size();
-                for (int i = 0; i < N; i++) {
-                    final NotificationChannel channel = channels.get(i);
-                    populateSingleChannelPrefs(groupCategory, channel, group.isBlocked());
-                }
-            }
-        }
-    }
-
-    protected void populateGroupToggle(final PreferenceGroup parent,
-            NotificationChannelGroup group) {
-        RestrictedSwitchPreference preference = new RestrictedSwitchPreference(getPrefContext());
-        preference.setTitle(R.string.notification_switch_label);
-        preference.setEnabled(mSuspendedAppsAdmin == null
-                && isChannelGroupBlockable(group));
-        preference.setChecked(!group.isBlocked());
-        preference.setOnPreferenceClickListener(preference1 -> {
-            final boolean allowGroup = ((SwitchPreference) preference1).isChecked();
-            group.setBlocked(!allowGroup);
-            mBackend.updateChannelGroup(mAppRow.pkg, mAppRow.uid, group);
-
-            onGroupBlockStateChanged(group);
-            return true;
-        });
-
-        parent.addPreference(preference);
-    }
-
-    private Comparator<NotificationChannelGroup> mChannelGroupComparator =
-            new Comparator<NotificationChannelGroup>() {
-
-                @Override
-                public int compare(NotificationChannelGroup left, NotificationChannelGroup right) {
-                    // Non-grouped channels (in placeholder group with a null id) come last
-                    if (left.getId() == null && right.getId() != null) {
-                        return 1;
-                    } else if (right.getId() == null && left.getId() != null) {
-                        return -1;
-                    }
-                    return left.getId().compareTo(right.getId());
-                }
-            };
-
-    protected void onGroupBlockStateChanged(NotificationChannelGroup group) {
-        if (group == null) {
-            return;
-        }
-        PreferenceGroup groupGroup = (
-                PreferenceGroup) getPreferenceScreen().findPreference(group.getId());
-
-        if (groupGroup != null) {
-            if (group.isBlocked()) {
-                List<Preference> toRemove = new ArrayList<>();
-                int childCount = groupGroup.getPreferenceCount();
-                for (int i = 0; i < childCount; i++) {
-                    Preference pref = groupGroup.getPreference(i);
-                    if (pref instanceof MasterSwitchPreference) {
-                        toRemove.add(pref);
-                    }
-                }
-                for (Preference pref : toRemove) {
-                    groupGroup.removePreference(pref);
-                }
-            } else {
-                final List<NotificationChannel> channels = group.getChannels();
-                Collections.sort(channels, mChannelComparator);
-                int N = channels.size();
-                for (int i = 0; i < N; i++) {
-                    final NotificationChannel channel = channels.get(i);
-                    populateSingleChannelPrefs(groupGroup, channel, group.isBlocked());
-                }
-            }
-        }
-    }
-
 }
diff --git a/src/com/android/settings/notification/BubblePreferenceController.java b/src/com/android/settings/notification/BubblePreferenceController.java
index b68f11d..b57a911 100644
--- a/src/com/android/settings/notification/BubblePreferenceController.java
+++ b/src/com/android/settings/notification/BubblePreferenceController.java
@@ -16,7 +16,7 @@
 
 package com.android.settings.notification;
 
-import static android.provider.Settings.Secure.NOTIFICATION_BUBBLES;
+import static android.provider.Settings.Global.NOTIFICATION_BUBBLES;
 
 import android.annotation.Nullable;
 import android.content.Context;
@@ -113,7 +113,7 @@
     }
 
     private boolean isGloballyEnabled() {
-        return Settings.Secure.getInt(mContext.getContentResolver(),
+        return Settings.Global.getInt(mContext.getContentResolver(),
                 NOTIFICATION_BUBBLES, SYSTEM_WIDE_OFF) == SYSTEM_WIDE_ON;
     }
 
@@ -124,7 +124,7 @@
         backend.setAllowBubbles(pkg, uid, false);
         // changing the global settings will cause the observer on the host page to reload
         // correct preference state
-        Settings.Secure.putInt(mContext.getContentResolver(),
+        Settings.Global.putInt(mContext.getContentResolver(),
                 NOTIFICATION_BUBBLES, SYSTEM_WIDE_OFF);
     }
 
@@ -134,7 +134,7 @@
         backend.setAllowBubbles(pkg, uid, true);
         // changing the global settings will cause the observer on the host page to reload
         // correct preference state
-        Settings.Secure.putInt(mContext.getContentResolver(),
+        Settings.Global.putInt(mContext.getContentResolver(),
                 NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
     }
 }
diff --git a/src/com/android/settings/notification/BubbleSummaryPreferenceController.java b/src/com/android/settings/notification/BubbleSummaryPreferenceController.java
index b1632c4..cc687cf 100644
--- a/src/com/android/settings/notification/BubbleSummaryPreferenceController.java
+++ b/src/com/android/settings/notification/BubbleSummaryPreferenceController.java
@@ -16,7 +16,7 @@
 
 package com.android.settings.notification;
 
-import static android.provider.Settings.Secure.NOTIFICATION_BUBBLES;
+import static android.provider.Settings.Global.NOTIFICATION_BUBBLES;
 
 import android.app.settings.SettingsEnums;
 import android.content.Context;
@@ -100,7 +100,7 @@
     }
 
     private boolean isGloballyEnabled() {
-        return Settings.Secure.getInt(mContext.getContentResolver(),
+        return Settings.Global.getInt(mContext.getContentResolver(),
                 NOTIFICATION_BUBBLES, SYSTEM_WIDE_OFF) == SYSTEM_WIDE_ON;
     }
 }
diff --git a/src/com/android/settings/notification/ChannelGroupNotificationSettings.java b/src/com/android/settings/notification/ChannelGroupNotificationSettings.java
deleted file mode 100644
index 1f8b1c3..0000000
--- a/src/com/android/settings/notification/ChannelGroupNotificationSettings.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.settings.notification;
-
-import android.app.NotificationChannel;
-import android.app.settings.SettingsEnums;
-import android.content.Context;
-import android.util.Log;
-
-import androidx.preference.Preference;
-
-import com.android.settings.R;
-import com.android.settingslib.core.AbstractPreferenceController;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-public class ChannelGroupNotificationSettings extends NotificationSettingsBase {
-    private static final String TAG = "ChannelGroupSettings";
-
-    @Override
-    public int getMetricsCategory() {
-        return SettingsEnums.NOTIFICATION_CHANNEL_GROUP;
-    }
-
-    @Override
-    public void onResume() {
-        super.onResume();
-        if (mAppRow == null || mChannelGroup == null) {
-            Log.w(TAG, "Missing package or uid or packageinfo or group");
-            finish();
-            return;
-        }
-
-        populateChannelList();
-        for (NotificationPreferenceController controller : mControllers) {
-            controller.onResume(mAppRow, mChannel, mChannelGroup, mSuspendedAppsAdmin);
-            controller.displayPreference(getPreferenceScreen());
-        }
-        updatePreferenceStates();
-    }
-
-    @Override
-    protected String getLogTag() {
-        return TAG;
-    }
-
-    @Override
-    protected int getPreferenceScreenResId() {
-        return R.xml.notification_group_settings;
-    }
-
-    @Override
-    protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
-        mControllers = new ArrayList<>();
-        mControllers.add(new HeaderPreferenceController(context, this));
-        mControllers.add(new BlockPreferenceController(context, mImportanceListener, mBackend));
-        mControllers.add(new AppLinkPreferenceController(context));
-        mControllers.add(new NotificationsOffPreferenceController(context));
-        mControllers.add(new DescriptionPreferenceController(context));
-        return new ArrayList<>(mControllers);
-    }
-
-    private void populateChannelList() {
-        if (!mDynamicPreferences.isEmpty()) {
-            // If there's anything in mDynamicPreferences, we've called populateChannelList twice.
-            // Clear out existing channels and log.
-            Log.w(TAG, "Notification channel group posted twice to settings - old size " +
-                    mDynamicPreferences.size() + ", new size " + mDynamicPreferences.size());
-            for (Preference p : mDynamicPreferences) {
-                getPreferenceScreen().removePreference(p);
-            }
-        }
-        if (mChannelGroup.getChannels().isEmpty()) {
-            Preference empty = new Preference(getPrefContext());
-            empty.setTitle(R.string.no_channels);
-            empty.setEnabled(false);
-            getPreferenceScreen().addPreference(empty);
-            mDynamicPreferences.add(empty);
-
-        } else {
-            final List<NotificationChannel> channels = mChannelGroup.getChannels();
-            Collections.sort(channels, mChannelComparator);
-            for (NotificationChannel channel : channels) {
-                mDynamicPreferences.add(populateSingleChannelPrefs(
-                        getPreferenceScreen(), channel, mChannelGroup.isBlocked()));
-            }
-
-        }
-    }
-}
diff --git a/src/com/android/settings/notification/ChannelListPreferenceController.java b/src/com/android/settings/notification/ChannelListPreferenceController.java
new file mode 100644
index 0000000..7ff407c
--- /dev/null
+++ b/src/com/android/settings/notification/ChannelListPreferenceController.java
@@ -0,0 +1,311 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.notification;
+
+import static android.app.NotificationManager.IMPORTANCE_LOW;
+import static android.app.NotificationManager.IMPORTANCE_NONE;
+
+import android.app.NotificationChannel;
+import android.app.NotificationChannelGroup;
+import android.app.settings.SettingsEnums;
+import android.content.Context;
+import android.graphics.BlendMode;
+import android.graphics.BlendModeColorFilter;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.GradientDrawable;
+import android.graphics.drawable.LayerDrawable;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.provider.Settings;
+
+import com.android.settings.R;
+import com.android.settings.Utils;
+import com.android.settings.applications.AppInfoBase;
+import com.android.settings.core.SubSettingLauncher;
+import com.android.settings.widget.MasterSwitchPreference;
+import com.android.settingslib.RestrictedSwitchPreference;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import androidx.preference.Preference;
+import androidx.preference.PreferenceCategory;
+import androidx.preference.PreferenceGroup;
+import androidx.preference.SwitchPreference;
+
+public class ChannelListPreferenceController extends NotificationPreferenceController {
+
+    private static final String KEY = "channels";
+    private static String KEY_GENERAL_CATEGORY = "categories";
+    public static final String ARG_FROM_SETTINGS = "fromSettings";
+
+    private List<NotificationChannelGroup> mChannelGroupList;
+    private PreferenceCategory mPreference;
+
+    public ChannelListPreferenceController(Context context, NotificationBackend backend) {
+        super(context, backend);
+    }
+
+    @Override
+    public String getPreferenceKey() {
+        return KEY;
+    }
+
+    @Override
+    public boolean isAvailable() {
+        if (mAppRow == null) {
+            return false;
+        }
+        if (mAppRow.banned) {
+            return false;
+        }
+        if (mChannel != null) {
+            if (mBackend.onlyHasDefaultChannel(mAppRow.pkg, mAppRow.uid)
+                    || NotificationChannel.DEFAULT_CHANNEL_ID.equals(mChannel.getId())) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public void updateState(Preference preference) {
+        mPreference = (PreferenceCategory) preference;
+        // Load channel settings
+        new AsyncTask<Void, Void, Void>() {
+            @Override
+            protected Void doInBackground(Void... unused) {
+                mChannelGroupList = mBackend.getGroups(mAppRow.pkg, mAppRow.uid).getList();
+                Collections.sort(mChannelGroupList, mChannelGroupComparator);
+                return null;
+            }
+
+            @Override
+            protected void onPostExecute(Void unused) {
+                if (mContext == null) {
+                    return;
+                }
+                populateList();
+            }
+        }.execute();
+    }
+
+    private void populateList() {
+        // TODO: if preference has children, compare with newly loaded list
+        mPreference.removeAll();
+
+        if (mChannelGroupList.isEmpty()) {
+            PreferenceCategory groupCategory = new PreferenceCategory(mContext);
+            groupCategory.setTitle(R.string.notification_channels);
+            groupCategory.setKey(KEY_GENERAL_CATEGORY);
+            mPreference.addPreference(groupCategory);
+
+            Preference empty = new Preference(mContext);
+            empty.setTitle(R.string.no_channels);
+            empty.setEnabled(false);
+            groupCategory.addPreference(empty);
+        } else {
+            populateGroupList();
+        }
+    }
+
+    private void populateGroupList() {
+        for (NotificationChannelGroup group : mChannelGroupList) {
+            PreferenceCategory groupCategory = new PreferenceCategory(mContext);
+            groupCategory.setOrderingAsAdded(true);
+            mPreference.addPreference(groupCategory);
+            if (group.getId() == null) {
+                if (mChannelGroupList.size() > 1) {
+                    groupCategory.setTitle(R.string.notification_channels_other);
+                }
+                groupCategory.setKey(KEY_GENERAL_CATEGORY);
+            } else {
+                groupCategory.setTitle(group.getName());
+                groupCategory.setKey(group.getId());
+                populateGroupToggle(groupCategory, group);
+            }
+            if (!group.isBlocked()) {
+                final List<NotificationChannel> channels = group.getChannels();
+                Collections.sort(channels, mChannelComparator);
+                int N = channels.size();
+                for (int i = 0; i < N; i++) {
+                    final NotificationChannel channel = channels.get(i);
+                    populateSingleChannelPrefs(groupCategory, channel, group.isBlocked());
+                }
+            }
+        }
+    }
+
+    protected void populateGroupToggle(final PreferenceGroup parent,
+            NotificationChannelGroup group) {
+        RestrictedSwitchPreference preference =
+                new RestrictedSwitchPreference(mContext);
+        preference.setTitle(R.string.notification_switch_label);
+        preference.setEnabled(mAdmin == null
+                && isChannelGroupBlockable(group));
+        preference.setChecked(!group.isBlocked());
+        preference.setOnPreferenceClickListener(preference1 -> {
+            final boolean allowGroup = ((SwitchPreference) preference1).isChecked();
+            group.setBlocked(!allowGroup);
+            mBackend.updateChannelGroup(mAppRow.pkg, mAppRow.uid, group);
+
+            onGroupBlockStateChanged(group);
+            return true;
+        });
+
+        parent.addPreference(preference);
+    }
+
+    protected Preference populateSingleChannelPrefs(PreferenceGroup parent,
+            final NotificationChannel channel, final boolean groupBlocked) {
+        MasterSwitchPreference channelPref = new MasterSwitchPreference(mContext);
+        channelPref.setSwitchEnabled(mAdmin == null
+                && isChannelBlockable(channel)
+                && isChannelConfigurable(channel)
+                && !groupBlocked);
+        channelPref.setIcon(null);
+        if (channel.getImportance() > IMPORTANCE_LOW) {
+            channelPref.setIcon(getAlertingIcon());
+        }
+        channelPref.setIconSize(MasterSwitchPreference.ICON_SIZE_SMALL);
+        channelPref.setKey(channel.getId());
+        channelPref.setTitle(channel.getName());
+        channelPref.setSummary(NotificationBackend.getSentSummary(
+                mContext, mAppRow.sentByChannel.get(channel.getId()), false));
+        channelPref.setChecked(channel.getImportance() != IMPORTANCE_NONE);
+        Bundle channelArgs = new Bundle();
+        channelArgs.putInt(AppInfoBase.ARG_PACKAGE_UID, mAppRow.uid);
+        channelArgs.putString(AppInfoBase.ARG_PACKAGE_NAME, mAppRow.pkg);
+        channelArgs.putString(Settings.EXTRA_CHANNEL_ID, channel.getId());
+        channelArgs.putBoolean(ARG_FROM_SETTINGS, true);
+        channelPref.setIntent(new SubSettingLauncher(mContext)
+                .setDestination(ChannelNotificationSettings.class.getName())
+                .setArguments(channelArgs)
+                .setTitleRes(R.string.notification_channel_title)
+                .setSourceMetricsCategory(SettingsEnums.NOTIFICATION_APP_NOTIFICATION)
+                .toIntent());
+
+        channelPref.setOnPreferenceChangeListener(
+                (preference, o) -> {
+                    boolean value = (Boolean) o;
+                    int importance = value ? IMPORTANCE_LOW : IMPORTANCE_NONE;
+                    channel.setImportance(importance);
+                    channel.lockFields(
+                            NotificationChannel.USER_LOCKED_IMPORTANCE);
+                    MasterSwitchPreference channelPref1 = (MasterSwitchPreference) preference;
+                    channelPref1.setIcon(null);
+                    if (channel.getImportance() > IMPORTANCE_LOW) {
+                        channelPref1.setIcon(getAlertingIcon());
+                    }
+                    toggleBehaviorIconState(channelPref1.getIcon(),
+                            importance != IMPORTANCE_NONE);
+                    mBackend.updateChannel(mAppRow.pkg, mAppRow.uid, channel);
+
+                    return true;
+                });
+        if (parent.findPreference(channelPref.getKey()) == null) {
+            parent.addPreference(channelPref);
+        }
+        return channelPref;
+    }
+
+    private Drawable getAlertingIcon() {
+        Drawable icon = mContext.getDrawable(R.drawable.ic_notifications_alert);
+        icon.setTintList(Utils.getColorAccent(mContext));
+        return icon;
+    }
+
+    private void toggleBehaviorIconState(Drawable icon, boolean enabled) {
+        if (icon == null) return;
+
+        LayerDrawable layerDrawable = (LayerDrawable) icon;
+        GradientDrawable background =
+                (GradientDrawable) layerDrawable.findDrawableByLayerId(R.id.back);
+
+        if (background == null) return;
+
+        if (enabled) {
+            background.clearColorFilter();
+        } else {
+            background.setColorFilter(new BlendModeColorFilter(
+                    mContext.getColor(R.color.material_grey_300),
+                    BlendMode.SRC_IN));
+        }
+    }
+
+    protected void onGroupBlockStateChanged(NotificationChannelGroup group) {
+        if (group == null) {
+            return;
+        }
+        PreferenceGroup groupGroup = mPreference.findPreference(group.getId());
+
+        if (groupGroup != null) {
+            if (group.isBlocked()) {
+                List<Preference> toRemove = new ArrayList<>();
+                int childCount = groupGroup.getPreferenceCount();
+                for (int i = 0; i < childCount; i++) {
+                    Preference pref = groupGroup.getPreference(i);
+                    if (pref instanceof MasterSwitchPreference) {
+                        toRemove.add(pref);
+                    }
+                }
+                for (Preference pref : toRemove) {
+                    groupGroup.removePreference(pref);
+                }
+            } else {
+                final List<NotificationChannel> channels = group.getChannels();
+                Collections.sort(channels, mChannelComparator);
+                int N = channels.size();
+                for (int i = 0; i < N; i++) {
+                    final NotificationChannel channel = channels.get(i);
+                    populateSingleChannelPrefs(groupGroup, channel, group.isBlocked());
+                }
+            }
+        }
+    }
+
+    private Comparator<NotificationChannelGroup> mChannelGroupComparator =
+            new Comparator<NotificationChannelGroup>() {
+
+                @Override
+                public int compare(NotificationChannelGroup left, NotificationChannelGroup right) {
+                    // Non-grouped channels (in placeholder group with a null id) come last
+                    if (left.getId() == null && right.getId() != null) {
+                        return 1;
+                    } else if (right.getId() == null && left.getId() != null) {
+                        return -1;
+                    }
+                    return left.getId().compareTo(right.getId());
+                }
+            };
+
+    protected Comparator<NotificationChannel> mChannelComparator =
+            (left, right) -> {
+                if (left.isDeleted() != right.isDeleted()) {
+                    return Boolean.compare(left.isDeleted(), right.isDeleted());
+                } else if (left.getId().equals(NotificationChannel.DEFAULT_CHANNEL_ID)) {
+                    // Uncategorized/miscellaneous legacy channel goes last
+                    return 1;
+                } else if (right.getId().equals(NotificationChannel.DEFAULT_CHANNEL_ID)) {
+                    return -1;
+                }
+
+                return left.getId().compareTo(right.getId());
+            };
+}
diff --git a/src/com/android/settings/notification/ChannelNotificationSettings.java b/src/com/android/settings/notification/ChannelNotificationSettings.java
index 8399a49..09bf0e2 100644
--- a/src/com/android/settings/notification/ChannelNotificationSettings.java
+++ b/src/com/android/settings/notification/ChannelNotificationSettings.java
@@ -16,6 +16,8 @@
 
 package com.android.settings.notification;
 
+import static com.android.settings.notification.ChannelListPreferenceController.ARG_FROM_SETTINGS;
+
 import android.app.settings.SettingsEnums;
 import android.content.Context;
 import android.content.Intent;
diff --git a/src/com/android/settings/notification/GentleNotificationsPreferenceController.java b/src/com/android/settings/notification/GentleNotificationsPreferenceController.java
index ea16e72..67a4707 100644
--- a/src/com/android/settings/notification/GentleNotificationsPreferenceController.java
+++ b/src/com/android/settings/notification/GentleNotificationsPreferenceController.java
@@ -16,8 +16,6 @@
 
 package com.android.settings.notification;
 
-import static android.provider.Settings.Secure.NOTIFICATION_BUBBLES;
-
 import android.content.Context;
 import android.provider.Settings;
 
diff --git a/src/com/android/settings/notification/GlobalBubblePermissionObserverMixin.java b/src/com/android/settings/notification/GlobalBubblePermissionObserverMixin.java
index 398931d..0118a95 100644
--- a/src/com/android/settings/notification/GlobalBubblePermissionObserverMixin.java
+++ b/src/com/android/settings/notification/GlobalBubblePermissionObserverMixin.java
@@ -47,8 +47,8 @@
 
     public void onStart() {
         mContext.getContentResolver().registerContentObserver(
-                Settings.Secure.getUriFor(
-                        Settings.Secure.NOTIFICATION_BUBBLES),
+                Settings.Global.getUriFor(
+                        Settings.Global.NOTIFICATION_BUBBLES),
                 false /* notifyForDescendants */,
                 this /* observer */);
     }
diff --git a/src/com/android/settings/notification/NotificationPreferenceController.java b/src/com/android/settings/notification/NotificationPreferenceController.java
index 2ae7019..b5acd2d 100644
--- a/src/com/android/settings/notification/NotificationPreferenceController.java
+++ b/src/com/android/settings/notification/NotificationPreferenceController.java
@@ -113,25 +113,40 @@
     }
 
     protected boolean isChannelBlockable() {
-        if (mChannel != null && mAppRow != null) {
-            if (mChannel.isImportanceLockedByCriticalDeviceFunction()
-                    || mChannel.isImportanceLockedByOEM()) {
-                return mChannel.getImportance() == IMPORTANCE_NONE;
+        return isChannelBlockable(mChannel);
+    }
+
+    protected boolean isChannelBlockable(NotificationChannel channel) {
+        if (channel != null && mAppRow != null) {
+            if (channel.isImportanceLockedByCriticalDeviceFunction()
+                    || channel.isImportanceLockedByOEM()) {
+                return channel.getImportance() == IMPORTANCE_NONE;
             }
 
-            return mChannel.isBlockableSystem() || !mAppRow.systemApp
-                    || mChannel.getImportance() == IMPORTANCE_NONE;
+            return channel.isBlockableSystem() || !mAppRow.systemApp
+                    || channel.getImportance() == IMPORTANCE_NONE;
+        }
+        return false;
+    }
+
+    protected boolean isChannelConfigurable(NotificationChannel channel) {
+        if (channel != null && mAppRow != null) {
+            return !channel.isImportanceLockedByOEM();
         }
         return false;
     }
 
     protected boolean isChannelGroupBlockable() {
-        if (mChannelGroup != null && mAppRow != null) {
+        return isChannelGroupBlockable(mChannelGroup);
+    }
+
+    protected boolean isChannelGroupBlockable(NotificationChannelGroup group) {
+        if (group != null && mAppRow != null) {
             if (!mAppRow.systemApp) {
                 return true;
             }
 
-            return mChannelGroup.isBlocked();
+            return group.isBlocked();
         }
         return false;
     }
diff --git a/src/com/android/settings/notification/NotificationSettingsBase.java b/src/com/android/settings/notification/NotificationSettingsBase.java
index 2a728c5..27a2de0 100644
--- a/src/com/android/settings/notification/NotificationSettingsBase.java
+++ b/src/com/android/settings/notification/NotificationSettingsBase.java
@@ -67,7 +67,6 @@
 abstract public class NotificationSettingsBase extends DashboardFragment {
     private static final String TAG = "NotifiSettingsBase";
     private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
-    public static final String ARG_FROM_SETTINGS = "fromSettings";
 
     protected PackageManager mPm;
     protected NotificationBackend mBackend = new NotificationBackend();
@@ -88,7 +87,6 @@
     protected boolean mListeningToPackageRemove;
 
     protected List<NotificationPreferenceController> mControllers = new ArrayList<>();
-    protected List<Preference> mDynamicPreferences = new ArrayList<>();
     protected ImportanceListener mImportanceListener = new ImportanceListener();
 
     protected Intent mIntent;
@@ -126,7 +124,6 @@
             mSuspendedAppsAdmin = RestrictedLockUtilsInternal.checkIfApplicationIsSuspended(
                     mContext, mPkg, mUserId);
 
-
             loadChannel();
             loadAppRow();
             loadChannelGroup();
@@ -280,135 +277,6 @@
         return null;
     }
 
-    private Drawable getAlertingIcon() {
-        Drawable icon = getContext().getDrawable(R.drawable.ic_notifications_alert);
-        icon.setTintList(Utils.getColorAccent(getContext()));
-        return icon;
-    }
-
-    protected Preference populateSingleChannelPrefs(PreferenceGroup parent,
-            final NotificationChannel channel, final boolean groupBlocked) {
-        MasterSwitchPreference channelPref = new MasterSwitchPreference(getPrefContext());
-        channelPref.setSwitchEnabled(mSuspendedAppsAdmin == null
-                && isChannelBlockable(channel)
-                && isChannelConfigurable(channel)
-                && !groupBlocked);
-        channelPref.setIcon(null);
-        if (channel.getImportance() > IMPORTANCE_LOW) {
-            channelPref.setIcon(getAlertingIcon());
-        }
-        channelPref.setIconSize(MasterSwitchPreference.ICON_SIZE_SMALL);
-        channelPref.setKey(channel.getId());
-        channelPref.setTitle(channel.getName());
-        channelPref.setSummary(NotificationBackend.getSentSummary(
-                mContext, mAppRow.sentByChannel.get(channel.getId()), false));
-        channelPref.setChecked(channel.getImportance() != IMPORTANCE_NONE);
-        Bundle channelArgs = new Bundle();
-        channelArgs.putInt(AppInfoBase.ARG_PACKAGE_UID, mUid);
-        channelArgs.putString(AppInfoBase.ARG_PACKAGE_NAME, mPkg);
-        channelArgs.putString(Settings.EXTRA_CHANNEL_ID, channel.getId());
-        channelArgs.putBoolean(ARG_FROM_SETTINGS, true);
-        channelPref.setIntent(new SubSettingLauncher(getActivity())
-                .setDestination(ChannelNotificationSettings.class.getName())
-                .setArguments(channelArgs)
-                .setTitleRes(R.string.notification_channel_title)
-                .setSourceMetricsCategory(getMetricsCategory())
-                .toIntent());
-
-        channelPref.setOnPreferenceChangeListener(
-                (preference, o) -> {
-                    boolean value = (Boolean) o;
-                    int importance = value ? IMPORTANCE_LOW : IMPORTANCE_NONE;
-                    channel.setImportance(importance);
-                    channel.lockFields(
-                            NotificationChannel.USER_LOCKED_IMPORTANCE);
-                    MasterSwitchPreference channelPref1 = (MasterSwitchPreference) preference;
-                    channelPref1.setIcon(null);
-                    if (channel.getImportance() > IMPORTANCE_LOW) {
-                        channelPref1.setIcon(getAlertingIcon());
-                    }
-                    toggleBehaviorIconState(channelPref1.getIcon(),
-                            importance != IMPORTANCE_NONE);
-                    mBackend.updateChannel(mPkg, mUid, channel);
-
-                    return true;
-                });
-        if (parent.findPreference(channelPref.getKey()) == null) {
-            parent.addPreference(channelPref);
-        }
-        return channelPref;
-    }
-
-    private void toggleBehaviorIconState(Drawable icon, boolean enabled) {
-        if (icon == null) return;
-
-        LayerDrawable layerDrawable = (LayerDrawable) icon;
-        GradientDrawable background =
-                (GradientDrawable) layerDrawable.findDrawableByLayerId(R.id.back);
-
-        if (background == null) return;
-
-        if (enabled) {
-            background.clearColorFilter();
-        } else {
-            background.setColorFilter(new BlendModeColorFilter(
-                    mContext.getColor(R.color.material_grey_300),
-                    BlendMode.SRC_IN));
-        }
-    }
-
-    protected boolean isChannelConfigurable(NotificationChannel channel) {
-        if (channel != null && mAppRow != null) {
-            return !channel.isImportanceLockedByOEM();
-        }
-        return false;
-    }
-
-    protected boolean isChannelBlockable(NotificationChannel channel) {
-        if (channel != null && mAppRow != null) {
-            if (!mAppRow.systemApp) {
-                return true;
-            }
-
-            if (channel.isImportanceLockedByCriticalDeviceFunction()) {
-                return false;
-            }
-
-            if (channel.isImportanceLockedByOEM()) {
-                return false;
-            }
-
-            return channel.isBlockableSystem()
-                    || channel.getImportance() == NotificationManager.IMPORTANCE_NONE;
-        }
-        return false;
-    }
-
-    protected boolean isChannelGroupBlockable(NotificationChannelGroup group) {
-        if (group != null && mAppRow != null) {
-            if (!mAppRow.systemApp) {
-                return true;
-            }
-
-            return group.isBlocked();
-        }
-        return false;
-    }
-
-    protected void setVisible(Preference p, boolean visible) {
-        setVisible(getPreferenceScreen(), p, visible);
-    }
-
-    protected void setVisible(PreferenceGroup parent, Preference p, boolean visible) {
-        final boolean isVisible = parent.findPreference(p.getKey()) != null;
-        if (isVisible == visible) return;
-        if (visible) {
-            parent.addPreference(p);
-        } else {
-            parent.removePreference(p);
-        }
-    }
-
     protected void startListeningToPackageRemove() {
         if (mListeningToPackageRemove) {
             return;
@@ -445,20 +313,6 @@
         }
     };
 
-    protected Comparator<NotificationChannel> mChannelComparator =
-            (left, right) -> {
-                if (left.isDeleted() != right.isDeleted()) {
-                    return Boolean.compare(left.isDeleted(), right.isDeleted());
-                } else if (left.getId().equals(NotificationChannel.DEFAULT_CHANNEL_ID)) {
-                    // Uncategorized/miscellaneous legacy channel goes last
-                    return 1;
-                } else if (right.getId().equals(NotificationChannel.DEFAULT_CHANNEL_ID)) {
-                    return -1;
-                }
-
-                return left.getId().compareTo(right.getId());
-            };
-
     protected class ImportanceListener {
         protected void onImportanceChanged() {
             final PreferenceScreen screen = getPreferenceScreen();
@@ -466,20 +320,6 @@
                 controller.displayPreference(screen);
             }
             updatePreferenceStates();
-
-            boolean hideDynamicFields = false;
-            if (mAppRow == null || mAppRow.banned) {
-                hideDynamicFields = true;
-            } else {
-                if (mChannel != null) {
-                    hideDynamicFields = mChannel.getImportance() == IMPORTANCE_NONE;
-                } else if (mChannelGroup != null) {
-                    hideDynamicFields = mChannelGroup.isBlocked();
-                }
-            }
-            for (Preference preference : mDynamicPreferences) {
-                setVisible(getPreferenceScreen(), preference, !hideDynamicFields);
-            }
         }
     }
 }
diff --git a/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java b/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java
index 8b5b761..9b20e7a 100644
--- a/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java
+++ b/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java
@@ -266,14 +266,17 @@
             Bundle args = new Bundle();
             args.putString(AppInfoBase.ARG_PACKAGE_NAME, pkgName);
             args.putInt(AppInfoBase.ARG_PACKAGE_UID, appEntry.info.uid);
-            pref.setIntent(new SubSettingLauncher(mHost.getActivity())
-                    .setDestination(AppNotificationSettings.class.getName())
-                    .setTitleRes(R.string.notifications_title)
-                    .setArguments(args)
-                    .setUserHandle(new UserHandle(UserHandle.getUserId(appEntry.info.uid)))
-                    .setSourceMetricsCategory(
-                            SettingsEnums.MANAGE_APPLICATIONS_NOTIFICATIONS)
-                    .toIntent());
+            pref.setOnPreferenceClickListener(preference -> {
+                new SubSettingLauncher(mHost.getActivity())
+                        .setDestination(AppNotificationSettings.class.getName())
+                        .setTitleRes(R.string.notifications_title)
+                        .setArguments(args)
+                        .setUserHandle(new UserHandle(UserHandle.getUserId(appEntry.info.uid)))
+                        .setSourceMetricsCategory(
+                                SettingsEnums.MANAGE_APPLICATIONS_NOTIFICATIONS)
+                        .launch();
+                return true;
+            });
             pref.setSwitchEnabled(mNotificationBackend.isBlockable(mContext, appEntry.info));
             pref.setOnPreferenceChangeListener((preference, newValue) -> {
                 boolean blocked = !(Boolean) newValue;
diff --git a/src/com/android/settings/sim/SimSelectNotification.java b/src/com/android/settings/sim/SimSelectNotification.java
index fb83a4d..fbf766c 100644
--- a/src/com/android/settings/sim/SimSelectNotification.java
+++ b/src/com/android/settings/sim/SimSelectNotification.java
@@ -46,6 +46,7 @@
 import android.util.Log;
 
 import com.android.internal.annotations.VisibleForTesting;
+import com.android.settings.HelpTrampoline;
 import com.android.settings.R;
 import com.android.settings.network.SubscriptionUtil;
 import com.android.settings.network.telephony.MobileNetworkActivity;
@@ -292,10 +293,9 @@
                         .setAutoCancel(true);
 
         // Create the pending intent that will lead to the helper page.
-        Intent resultIntent = HelpUtils.getHelpIntent(
-                context,
-                context.getString(R.string.help_uri_sim_combination_warning),
-                context.getClass().getName());
+        Intent resultIntent = new Intent(context, HelpTrampoline.class);
+        resultIntent.putExtra(Intent.EXTRA_TEXT, "help_uri_sim_combination_warning");
+
         PendingIntent resultPendingIntent = PendingIntent.getActivity(context, 0, resultIntent,
                 PendingIntent.FLAG_CANCEL_CURRENT);
         builder.setContentIntent(resultPendingIntent);
diff --git a/src/com/android/settings/slices/CustomSliceable.java b/src/com/android/settings/slices/CustomSliceable.java
index 9566be1..92c604e 100644
--- a/src/com/android/settings/slices/CustomSliceable.java
+++ b/src/com/android/settings/slices/CustomSliceable.java
@@ -95,7 +95,7 @@
                 .setData(getUri())
                 .setClass(context, SliceBroadcastReceiver.class);
         return PendingIntent.getBroadcast(context, 0 /* requestCode */, intent,
-                PendingIntent.FLAG_CANCEL_CURRENT);
+                PendingIntent.FLAG_UPDATE_CURRENT);
     }
 
     @Override
diff --git a/src/com/android/settings/utils/CandidateInfoExtra.java b/src/com/android/settings/utils/CandidateInfoExtra.java
new file mode 100644
index 0000000..5bccea6
--- /dev/null
+++ b/src/com/android/settings/utils/CandidateInfoExtra.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.utils;
+
+import android.graphics.drawable.Drawable;
+
+import com.android.settingslib.widget.CandidateInfo;
+
+public class CandidateInfoExtra extends CandidateInfo {
+    private final CharSequence mLabel;
+    private final CharSequence mSummary;
+    private final String mKey;
+
+    public CandidateInfoExtra(CharSequence label, CharSequence summary, String key,
+            boolean enabled) {
+        super(enabled);
+        mLabel = label;
+        mSummary = summary;
+        mKey = key;
+    }
+
+    @Override
+    public CharSequence loadLabel() {
+        return mLabel;
+    }
+
+    public CharSequence loadSummary() {
+        return mSummary;
+    }
+
+    @Override
+    public Drawable loadIcon() {
+        return null;
+    }
+
+    @Override
+    public String getKey() {
+        return mKey;
+    }
+}
diff --git a/src/com/android/settings/wifi/NetworkRequestDialogFragment.java b/src/com/android/settings/wifi/NetworkRequestDialogFragment.java
index eb7d78f..4762403 100644
--- a/src/com/android/settings/wifi/NetworkRequestDialogFragment.java
+++ b/src/com/android/settings/wifi/NetworkRequestDialogFragment.java
@@ -340,6 +340,7 @@
         // Throws error dialog.
         final NetworkRequestErrorDialogFragment fragment = NetworkRequestErrorDialogFragment
                 .newInstance();
+        fragment.setRejectCallback(mUserSelectionCallback);
         final Bundle bundle = new Bundle();
         bundle.putSerializable(NetworkRequestErrorDialogFragment.DIALOG_TYPE, type);
         fragment.setArguments(bundle);
diff --git a/src/com/android/settings/wifi/NetworkRequestErrorDialogFragment.java b/src/com/android/settings/wifi/NetworkRequestErrorDialogFragment.java
index 261d313..9819474 100644
--- a/src/com/android/settings/wifi/NetworkRequestErrorDialogFragment.java
+++ b/src/com/android/settings/wifi/NetworkRequestErrorDialogFragment.java
@@ -20,8 +20,10 @@
 import android.app.settings.SettingsEnums;
 import android.content.DialogInterface;
 import android.os.Bundle;
+import android.net.wifi.WifiManager.NetworkRequestUserSelectionCallback;
 
 import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
 import androidx.appcompat.app.AlertDialog;
 
 import com.android.settings.R;
@@ -36,6 +38,8 @@
     public static final String DIALOG_TYPE = "DIALOG_ERROR_TYPE";
 
     public enum ERROR_DIALOG_TYPE {TIME_OUT, ABORT}
+    @Nullable
+    private NetworkRequestUserSelectionCallback mRejectCallback;
 
     public static NetworkRequestErrorDialogFragment newInstance() {
         return new NetworkRequestErrorDialogFragment();
@@ -49,7 +53,7 @@
     public void onCancel(@NonNull DialogInterface dialog) {
         super.onCancel(dialog);
         // Wants to finish the activity when user clicks back key or outside of the dialog.
-        getActivity().finish();
+        rejectNetworkRequestAndFinish();
     }
 
     @Override
@@ -65,10 +69,12 @@
             builder.setMessage(R.string.network_connection_timeout_dialog_message)
                     .setPositiveButton(R.string.network_connection_timeout_dialog_ok,
                             (dialog, which) -> startScanningDialog())
-                    .setNegativeButton(R.string.cancel, (dialog, which) -> getActivity().finish());
+                    .setNegativeButton(R.string.cancel,
+                            (dialog, which) -> rejectNetworkRequestAndFinish());
         } else {
             builder.setMessage(R.string.network_connection_errorstate_dialog_message)
-                    .setPositiveButton(R.string.okay, (dialog, which) -> getActivity().finish());
+                    .setPositiveButton(R.string.okay,
+                            (dialog, which) -> rejectNetworkRequestAndFinish());
         }
         return builder.create();
     }
@@ -78,9 +84,23 @@
         return SettingsEnums.WIFI_SCANNING_NEEDED_DIALOG;
     }
 
+    // Sets the callback for fragment to reject this request.
+    public void setRejectCallback(NetworkRequestUserSelectionCallback rejectCallback) {
+        mRejectCallback = rejectCallback;
+    }
+
     protected void startScanningDialog() {
         final NetworkRequestDialogFragment fragment = NetworkRequestDialogFragment.newInstance();
         fragment.show(getActivity().getSupportFragmentManager(),
                 NetworkRequestErrorDialogFragment.class.getSimpleName());
     }
+
+    private void rejectNetworkRequestAndFinish() {
+        if (getActivity() != null) {
+            if (mRejectCallback != null) {
+                mRejectCallback.reject();
+            }
+            getActivity().finish();
+        }
+    }
 }
diff --git a/src/com/android/settings/wifi/WifiConfigController.java b/src/com/android/settings/wifi/WifiConfigController.java
index 793ba4c..0aae89a 100644
--- a/src/com/android/settings/wifi/WifiConfigController.java
+++ b/src/com/android/settings/wifi/WifiConfigController.java
@@ -179,7 +179,9 @@
     private TextView mSsidView;
 
     private Context mContext;
-    private Integer mSecurityInPosition[];
+
+    @VisibleForTesting
+    Integer mSecurityInPosition[];
 
     private final WifiManager mWifiManager;
 
@@ -325,7 +327,7 @@
             if ((!mAccessPoint.isSaved() && !mAccessPoint.isActive()
                     && !mAccessPoint.isPasspointConfig())
                     || mMode != WifiConfigUiBase.MODE_VIEW) {
-                showSecurityFields();
+                showSecurityFields(true /* refreshEapMethods */, true /* refreshCertificates */);
                 showIpConfigFields();
                 showProxyFields();
                 final CheckBox advancedTogglebox =
@@ -956,7 +958,7 @@
         return 0;
     }
 
-    private void showSecurityFields() {
+    private void showSecurityFields(boolean refreshEapMethods, boolean refreshCertificates) {
         if (mAccessPointSecurity == AccessPoint.SECURITY_NONE ||
                 mAccessPointSecurity == AccessPoint.SECURITY_OWE ||
                 mAccessPointSecurity == AccessPoint.SECURITY_OWE_TRANSITION) {
@@ -985,19 +987,11 @@
         }
         mView.findViewById(R.id.eap).setVisibility(View.VISIBLE);
 
+        boolean initiateEnterpriseNetworkUi = false;
         if (mEapMethodSpinner == null) {
+            initiateEnterpriseNetworkUi = true;
             mEapMethodSpinner = (Spinner) mView.findViewById(R.id.method);
             mEapMethodSpinner.setOnItemSelectedListener(this);
-            if (Utils.isWifiOnly(mContext) || !mContext.getResources().getBoolean(
-                    com.android.internal.R.bool.config_eap_sim_based_auth_supported)) {
-                String[] eapMethods = mContext.getResources().getStringArray(
-                        R.array.eap_method_without_sim_auth);
-                ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<String>(mContext,
-                        android.R.layout.simple_spinner_item, eapMethods);
-                spinnerAdapter.setDropDownViewResource(
-                        android.R.layout.simple_spinner_dropdown_item);
-                mEapMethodSpinner.setAdapter(spinnerAdapter);
-            }
             mPhase2Spinner = (Spinner) mView.findViewById(R.id.phase2);
             mPhase2Spinner.setOnItemSelectedListener(this);
             mEapCaCertSpinner = (Spinner) mView.findViewById(R.id.ca_cert);
@@ -1008,11 +1002,36 @@
             mEapUserCertSpinner.setOnItemSelectedListener(this);
             mEapIdentityView = (TextView) mView.findViewById(R.id.identity);
             mEapAnonymousView = (TextView) mView.findViewById(R.id.anonymous);
+        }
 
-            if (mAccessPoint != null && mAccessPoint.isCarrierAp()) {
-                mEapMethodSpinner.setSelection(mAccessPoint.getCarrierApEapType());
+        if (refreshEapMethods) {
+            ArrayAdapter<CharSequence> eapMethodSpinnerAdapter;
+            if (mAccessPointSecurity == AccessPoint.SECURITY_EAP_SUITE_B) {
+                eapMethodSpinnerAdapter = getSpinnerAdapter(R.array.wifi_eap_method);
+                mEapMethodSpinner.setAdapter(eapMethodSpinnerAdapter);
+                // WAP3-Enterprise 192-bit only allows EAP method TLS
+                mEapMethodSpinner.setSelection(Eap.TLS);
+                mEapMethodSpinner.setEnabled(false);
+            } else if (Utils.isWifiOnly(mContext) || !mContext.getResources().getBoolean(
+                    com.android.internal.R.bool.config_eap_sim_based_auth_supported)) {
+                eapMethodSpinnerAdapter = getSpinnerAdapter(
+                        R.array.eap_method_without_sim_auth);
+                mEapMethodSpinner.setAdapter(eapMethodSpinnerAdapter);
+                mEapMethodSpinner.setEnabled(true);
+            } else {
+                eapMethodSpinnerAdapter = getSpinnerAdapter(R.array.wifi_eap_method);
+                mEapMethodSpinner.setAdapter(eapMethodSpinnerAdapter);
+                mEapMethodSpinner.setEnabled(true);
             }
+        }
 
+        if (mAccessPointSecurity != AccessPoint.SECURITY_EAP_SUITE_B
+                && mAccessPoint != null
+                && mAccessPoint.isCarrierAp()) {
+            mEapMethodSpinner.setSelection(mAccessPoint.getCarrierApEapType());
+        }
+
+        if (refreshCertificates) {
             loadCertificates(
                     mEapCaCertSpinner,
                     Credentials.CA_CERTIFICATE,
@@ -1025,76 +1044,73 @@
                     mDoNotProvideEapUserCertString,
                     false,
                     false);
+        }
 
-            // Modifying an existing network
-            if (mAccessPoint != null && mAccessPoint.isSaved()) {
-                WifiEnterpriseConfig enterpriseConfig = mAccessPoint.getConfig().enterpriseConfig;
-                int eapMethod = enterpriseConfig.getEapMethod();
-                int phase2Method = enterpriseConfig.getPhase2Method();
-                mEapMethodSpinner.setSelection(eapMethod);
-                showEapFieldsByMethod(eapMethod);
-                switch (eapMethod) {
-                    case Eap.PEAP:
-                        switch (phase2Method) {
-                            case Phase2.NONE:
-                                mPhase2Spinner.setSelection(WIFI_PEAP_PHASE2_NONE);
-                                break;
-                            case Phase2.MSCHAPV2:
-                                mPhase2Spinner.setSelection(WIFI_PEAP_PHASE2_MSCHAPV2);
-                                break;
-                            case Phase2.GTC:
-                                mPhase2Spinner.setSelection(WIFI_PEAP_PHASE2_GTC);
-                                break;
-                            case Phase2.SIM:
-                                mPhase2Spinner.setSelection(WIFI_PEAP_PHASE2_SIM);
-                                break;
-                            case Phase2.AKA:
-                                mPhase2Spinner.setSelection(WIFI_PEAP_PHASE2_AKA);
-                                break;
-                            case Phase2.AKA_PRIME:
-                                mPhase2Spinner.setSelection(WIFI_PEAP_PHASE2_AKA_PRIME);
-                                break;
-                            default:
-                                Log.e(TAG, "Invalid phase 2 method " + phase2Method);
-                                break;
-                        }
-                        break;
-                    default:
-                        mPhase2Spinner.setSelection(phase2Method);
-                        break;
-                }
-                if (!TextUtils.isEmpty(enterpriseConfig.getCaPath())) {
-                    setSelection(mEapCaCertSpinner, mUseSystemCertsString);
-                } else {
-                    String[] caCerts = enterpriseConfig.getCaCertificateAliases();
-                    if (caCerts == null) {
-                        setSelection(mEapCaCertSpinner, mDoNotValidateEapServerString);
-                    } else if (caCerts.length == 1) {
-                        setSelection(mEapCaCertSpinner, caCerts[0]);
-                    } else {
-                        // Reload the cert spinner with an extra "multiple certificates added" item.
-                        loadCertificates(
-                                mEapCaCertSpinner,
-                                Credentials.CA_CERTIFICATE,
-                                mDoNotValidateEapServerString,
-                                true,
-                                true);
-                        setSelection(mEapCaCertSpinner, mMultipleCertSetString);
+        // Modifying an existing network
+        if (initiateEnterpriseNetworkUi && mAccessPoint != null && mAccessPoint.isSaved()) {
+            final WifiEnterpriseConfig enterpriseConfig = mAccessPoint.getConfig().enterpriseConfig;
+            final int eapMethod = enterpriseConfig.getEapMethod();
+            final int phase2Method = enterpriseConfig.getPhase2Method();
+            mEapMethodSpinner.setSelection(eapMethod);
+            showEapFieldsByMethod(eapMethod);
+            switch (eapMethod) {
+                case Eap.PEAP:
+                    switch (phase2Method) {
+                        case Phase2.NONE:
+                            mPhase2Spinner.setSelection(WIFI_PEAP_PHASE2_NONE);
+                            break;
+                        case Phase2.MSCHAPV2:
+                            mPhase2Spinner.setSelection(WIFI_PEAP_PHASE2_MSCHAPV2);
+                            break;
+                        case Phase2.GTC:
+                            mPhase2Spinner.setSelection(WIFI_PEAP_PHASE2_GTC);
+                            break;
+                        case Phase2.SIM:
+                            mPhase2Spinner.setSelection(WIFI_PEAP_PHASE2_SIM);
+                            break;
+                        case Phase2.AKA:
+                            mPhase2Spinner.setSelection(WIFI_PEAP_PHASE2_AKA);
+                            break;
+                        case Phase2.AKA_PRIME:
+                            mPhase2Spinner.setSelection(WIFI_PEAP_PHASE2_AKA_PRIME);
+                            break;
+                        default:
+                            Log.e(TAG, "Invalid phase 2 method " + phase2Method);
+                            break;
                     }
-                }
-                mEapDomainView.setText(enterpriseConfig.getDomainSuffixMatch());
-                String userCert = enterpriseConfig.getClientCertificateAlias();
-                if (TextUtils.isEmpty(userCert)) {
-                    setSelection(mEapUserCertSpinner, mDoNotProvideEapUserCertString);
-                } else {
-                    setSelection(mEapUserCertSpinner, userCert);
-                }
-                mEapIdentityView.setText(enterpriseConfig.getIdentity());
-                mEapAnonymousView.setText(enterpriseConfig.getAnonymousIdentity());
-            } else {
-                mPhase2Spinner = (Spinner) mView.findViewById(R.id.phase2);
-                showEapFieldsByMethod(mEapMethodSpinner.getSelectedItemPosition());
+                    break;
+                default:
+                    mPhase2Spinner.setSelection(phase2Method);
+                    break;
             }
+            if (!TextUtils.isEmpty(enterpriseConfig.getCaPath())) {
+                setSelection(mEapCaCertSpinner, mUseSystemCertsString);
+            } else {
+                final String[] caCerts = enterpriseConfig.getCaCertificateAliases();
+                if (caCerts == null) {
+                    setSelection(mEapCaCertSpinner, mDoNotValidateEapServerString);
+                } else if (caCerts.length == 1) {
+                    setSelection(mEapCaCertSpinner, caCerts[0]);
+                } else {
+                    // Reload the cert spinner with an extra "multiple certificates added" item.
+                    loadCertificates(
+                            mEapCaCertSpinner,
+                            Credentials.CA_CERTIFICATE,
+                            mDoNotValidateEapServerString,
+                            true,
+                            true);
+                    setSelection(mEapCaCertSpinner, mMultipleCertSetString);
+                }
+            }
+            mEapDomainView.setText(enterpriseConfig.getDomainSuffixMatch());
+            final String userCert = enterpriseConfig.getClientCertificateAlias();
+            if (TextUtils.isEmpty(userCert)) {
+                setSelection(mEapUserCertSpinner, mDoNotProvideEapUserCertString);
+            } else {
+                setSelection(mEapUserCertSpinner, userCert);
+            }
+            mEapIdentityView.setText(enterpriseConfig.getIdentity());
+            mEapAnonymousView.setText(enterpriseConfig.getAnonymousIdentity());
         } else {
             showEapFieldsByMethod(mEapMethodSpinner.getSelectedItemPosition());
         }
@@ -1389,7 +1405,18 @@
         } catch (Exception e) {
             Log.e(TAG, "can't get the certificate list from KeyStore");
         }
-        certs.add(noCertificateString);
+
+        if (mAccessPointSecurity != AccessPoint.SECURITY_EAP_SUITE_B) {
+            certs.add(noCertificateString);
+        }
+
+        // If there are only mUnspecifiedCertString and one item to select, only shows the item
+        if (certs.size() == 2) {
+            certs.remove(mUnspecifiedCertString);
+            spinner.setEnabled(false);
+        } else {
+            spinner.setEnabled(true);
+        }
 
         final ArrayAdapter<String> adapter = new ArrayAdapter<String>(
                 context, android.R.layout.simple_spinner_item,
@@ -1486,15 +1513,17 @@
         if (parent == mSecuritySpinner) {
             // Convert menu position to actual Wi-Fi security type
             mAccessPointSecurity = mSecurityInPosition[position];
-            showSecurityFields();
+            showSecurityFields(true /* refreshEapMethods */, true /* refreshCertificates */);
 
             if (WifiDppUtils.isSupportEnrolleeQrCodeScanner(mContext, mAccessPointSecurity)) {
                 mSsidScanButton.setVisibility(View.VISIBLE);
             } else {
                 mSsidScanButton.setVisibility(View.GONE);
             }
-        } else if (parent == mEapMethodSpinner || parent == mEapCaCertSpinner) {
-            showSecurityFields();
+        } else if (parent == mEapMethodSpinner) {
+            showSecurityFields(false /* refreshEapMethods */, true /* refreshCertificates */);
+        } else if (parent == mEapCaCertSpinner) {
+            showSecurityFields(false /* refreshEapMethods */, false /* refreshCertificates */);
         } else if (parent == mPhase2Spinner
                 && mEapMethodSpinner.getSelectedItemPosition() == WIFI_EAP_METHOD_PEAP) {
             showPeapFields();
@@ -1585,4 +1614,15 @@
         ((CheckBox) mView.findViewById(R.id.wifi_advanced_togglebox))
                 .setOnCheckedChangeListener(this);
     }
+
+    private ArrayAdapter<CharSequence> getSpinnerAdapter(
+            int contentStringArrayResId) {
+        final String[] eapMethods = mContext.getResources().getStringArray(
+                contentStringArrayResId);
+        final ArrayAdapter<CharSequence> spinnerAdapter = new ArrayAdapter<>(mContext,
+                android.R.layout.simple_spinner_item, eapMethods);
+        spinnerAdapter.setDropDownViewResource(
+                android.R.layout.simple_spinner_dropdown_item);
+        return spinnerAdapter;
+    }
 }
diff --git a/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java b/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java
index 5dfcc25..cc80b0c 100644
--- a/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java
+++ b/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java
@@ -390,7 +390,7 @@
                     WifiDppUtils.getSecurityString(wifiConfiguration),
                     wifiConfiguration.getPrintableSsid(),
                     wifiConfiguration.preSharedKey,
-                    /* hiddenSsid */ false,
+                    wifiConfiguration.hiddenSSID,
                     wifiConfiguration.networkId,
                     /* isHotspot */ false);
             }
diff --git a/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java b/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java
index d595f79..c37bdc0a 100644
--- a/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java
+++ b/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java
@@ -172,22 +172,25 @@
 
                     // Adds all Wi-Fi networks in QR code to the set of configured networks and
                     // connects to it if it's reachable.
-                    boolean hasReachableWifiNetwork = false;
+                    boolean hasHiddenOrReachableWifiNetwork = false;
                     for (WifiConfiguration qrCodeWifiConfiguration : qrCodeWifiConfigurations) {
                         final int id = wifiManager.addNetwork(qrCodeWifiConfiguration);
                         if (id == -1) {
                             continue;
                         }
                         wifiManager.enableNetwork(id, /* attemptConnect */ false);
-                        if (isReachableWifiNetwork(qrCodeWifiConfiguration)) {
-                            hasReachableWifiNetwork = true;
+                        // WifiTracker only contains a hidden SSID Wi-Fi network if it's saved.
+                        // We can't check if a hidden SSID Wi-Fi network is reachable in advance.
+                        if (qrCodeWifiConfiguration.hiddenSSID ||
+                                isReachableWifiNetwork(qrCodeWifiConfiguration)) {
+                            hasHiddenOrReachableWifiNetwork = true;
                             mEnrolleeWifiConfiguration = qrCodeWifiConfiguration;
                             wifiManager.connect(id,
                                     /* listener */ WifiDppQrCodeScannerFragment.this);
                         }
                     }
 
-                    if (hasReachableWifiNetwork == false) {
+                    if (!hasHiddenOrReachableWifiNetwork) {
                         showErrorMessageAndRestartCamera(
                                 R.string.wifi_dpp_check_connection_try_again);
                         return;
diff --git a/src/com/android/settings/wifi/dpp/WifiDppUtils.java b/src/com/android/settings/wifi/dpp/WifiDppUtils.java
index 7e15064..2a958e8 100644
--- a/src/com/android/settings/wifi/dpp/WifiDppUtils.java
+++ b/src/com/android/settings/wifi/dpp/WifiDppUtils.java
@@ -296,6 +296,7 @@
         if (!TextUtils.isEmpty(preSharedKey)) {
             intent.putExtra(EXTRA_WIFI_PRE_SHARED_KEY, preSharedKey);
         }
+        intent.putExtra(EXTRA_WIFI_HIDDEN_SSID, wifiConfiguration.hiddenSSID);
     }
 
     /**
diff --git a/src/com/android/settings/wifi/dpp/WifiNetworkListFragment.java b/src/com/android/settings/wifi/dpp/WifiNetworkListFragment.java
index fa2dc99..372bc44 100644
--- a/src/com/android/settings/wifi/dpp/WifiNetworkListFragment.java
+++ b/src/com/android/settings/wifi/dpp/WifiNetworkListFragment.java
@@ -220,7 +220,7 @@
             }
             final WifiNetworkConfig networkConfig = WifiNetworkConfig.getValidConfigOrNull(
                     selectedAccessPoint.getSecurityString(/* concise */ true),
-                    wifiConfig.getPrintableSsid(), wifiConfig.preSharedKey, /* hiddenSsid */ false,
+                    wifiConfig.getPrintableSsid(), wifiConfig.preSharedKey, wifiConfig.hiddenSSID,
                     wifiConfig.networkId, /* isHotspot */ false);
             if (mOnChooseNetworkListener != null) {
                 mOnChooseNetworkListener.onChooseNetwork(networkConfig);
diff --git a/tests/robotests/assets/grandfather_not_implementing_index_provider b/tests/robotests/assets/grandfather_not_implementing_index_provider
index 061a81e..5d4abad 100644
--- a/tests/robotests/assets/grandfather_not_implementing_index_provider
+++ b/tests/robotests/assets/grandfather_not_implementing_index_provider
@@ -51,7 +51,6 @@
 com.android.settings.network.ApnSettings
 com.android.settings.network.telephony.NetworkSelectSettings
 com.android.settings.notification.AppNotificationSettings
-com.android.settings.notification.ChannelGroupNotificationSettings
 com.android.settings.notification.ChannelNotificationSettings
 com.android.settings.notification.NotificationStation
 com.android.settings.notification.RedactionInterstitial$RedactionInterstitialFragment
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/AppButtonsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/AppButtonsPreferenceControllerTest.java
index e42c3d2..637ffbc 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/AppButtonsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/AppButtonsPreferenceControllerTest.java
@@ -19,8 +19,8 @@
 import static com.google.common.truth.Truth.assertThat;
 
 import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.doAnswer;
@@ -39,8 +39,8 @@
 import android.app.settings.SettingsEnums;
 import android.content.Context;
 import android.content.Intent;
-import android.content.om.OverlayManager;
 import android.content.om.OverlayInfo;
+import android.content.om.OverlayManager;
 import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageInfo;
 import android.content.pm.PackageManager;
@@ -49,6 +49,8 @@
 import android.util.ArraySet;
 import android.view.View;
 
+import androidx.preference.PreferenceScreen;
+
 import com.android.settings.R;
 import com.android.settings.SettingsActivity;
 import com.android.settings.core.InstrumentedPreferenceFragment;
@@ -59,7 +61,6 @@
 import com.android.settingslib.core.lifecycle.Lifecycle;
 import com.android.settingslib.widget.ActionButtonsPreference;
 
-import java.util.Set;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -70,12 +71,15 @@
 import org.mockito.MockitoAnnotations;
 import org.mockito.stubbing.Answer;
 import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
 import org.robolectric.annotation.Config;
 import org.robolectric.annotation.Implementation;
 import org.robolectric.annotation.Implements;
 import org.robolectric.annotation.Resetter;
 import org.robolectric.util.ReflectionHelpers;
 
+import java.util.Set;
+
 @RunWith(RobolectricTestRunner.class)
 public class AppButtonsPreferenceControllerTest {
 
@@ -112,10 +116,9 @@
     @Mock
     private UserManager mUserManager;
     @Mock
-    private Application mApplication;
-    @Mock
     private PackageInfo mPackageInfo;
 
+    private Context mContext;
     private Intent mUninstallIntent;
     private ActionButtonsPreference mButtonPrefs;
     private AppButtonsPreferenceController mController;
@@ -125,14 +128,15 @@
         MockitoAnnotations.initMocks(this);
 
         FakeFeatureFactory.setupForTest();
+        mContext = RuntimeEnvironment.application;
         doReturn(mDpm).when(mSettingsActivity).getSystemService(Context.DEVICE_POLICY_SERVICE);
         doReturn(mUserManager).when(mSettingsActivity).getSystemService(Context.USER_SERVICE);
         doReturn(mPackageManger).when(mSettingsActivity).getPackageManager();
         doReturn(mAm).when(mSettingsActivity).getSystemService(Context.ACTIVITY_SERVICE);
         doReturn(mOverlayManager).when(mSettingsActivity).
-            getSystemService(OverlayManager.class);
+                getSystemService(OverlayManager.class);
         doReturn(mAppEntry).when(mState).getEntry(anyString(), anyInt());
-        when(mSettingsActivity.getApplication()).thenReturn(mApplication);
+        doReturn(mContext).when(mSettingsActivity).getApplicationContext();
         when(mSettingsActivity.getResources().getString(anyInt())).thenReturn(RESOURCE_STRING);
 
         mController = spy(new AppButtonsPreferenceController(mSettingsActivity, mFragment,
@@ -162,6 +166,21 @@
     }
 
     @Test
+    @Config(shadows = ShadowAppUtils.class)
+    public void isAvailable_validPackageName_isTrue() {
+        assertThat(mController.isAvailable()).isTrue();
+    }
+
+    @Test
+    public void isAvailable_nullPackageName_isFalse() {
+        final AppButtonsPreferenceController controller = spy(
+                new AppButtonsPreferenceController(mSettingsActivity, mFragment,
+                        mLifecycle, null, mState, REQUEST_UNINSTALL, REQUEST_REMOVE_DEVICE_ADMIN));
+
+        assertThat(controller.isAvailable()).isFalse();
+    }
+
+    @Test
     public void retrieveAppEntry_hasAppEntry_notNull()
             throws PackageManager.NameNotFoundException {
         doReturn(mPackageInfo).when(mPackageManger).getPackageInfo(anyString(), anyInt());
@@ -306,10 +325,10 @@
 
     @Test
     public void updateUninstallButton_isNonSystemRro_setButtonDisable()
-                throws RemoteException {
+            throws RemoteException {
         when(mAppInfo.isResourceOverlay()).thenReturn(true);
         when(mOverlayManager.getOverlayInfo(anyString(), any()))
-            .thenReturn(OVERLAY_ENABLED);
+                .thenReturn(OVERLAY_ENABLED);
 
         mController.updateUninstallButton();
 
@@ -318,10 +337,10 @@
 
     @Test
     public void updateUninstallButton_isNonSystemRro_setButtonEnable()
-                throws RemoteException {
+            throws RemoteException {
         when(mAppInfo.isResourceOverlay()).thenReturn(true);
         when(mOverlayManager.getOverlayInfo(anyString(), any()))
-            .thenReturn(OVERLAY_DISABLED);
+                .thenReturn(OVERLAY_DISABLED);
 
         mController.updateUninstallButton();
 
@@ -423,7 +442,7 @@
     @Test
     public void onPackageListChanged_available_shouldRefreshUi() {
         doReturn(AppButtonsPreferenceController.AVAILABLE)
-            .when(mController).getAvailabilityStatus();
+                .when(mController).getAvailabilityStatus();
         doReturn(true).when(mController).refreshUi();
 
         mController.onPackageListChanged();
@@ -434,7 +453,7 @@
     @Test
     public void onPackageListChanged_notAvailable_shouldNotRefreshUiAndNoCrash() {
         doReturn(AppButtonsPreferenceController.DISABLED_FOR_USER)
-            .when(mController).getAvailabilityStatus();
+                .when(mController).getAvailabilityStatus();
 
         mController.onPackageListChanged();
 
diff --git a/tests/robotests/src/com/android/settings/development/BubbleGlobalPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/BubbleGlobalPreferenceControllerTest.java
index 11ca63f..9e52a88 100644
--- a/tests/robotests/src/com/android/settings/development/BubbleGlobalPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/BubbleGlobalPreferenceControllerTest.java
@@ -16,7 +16,7 @@
 
 package com.android.settings.development;
 
-import static android.provider.Settings.Secure.NOTIFICATION_BUBBLES;
+import static android.provider.Settings.Global.NOTIFICATION_BUBBLES;
 
 import static com.android.settings.development.BubbleGlobalPreferenceController.OFF;
 import static com.android.settings.development.BubbleGlobalPreferenceController.ON;
@@ -77,7 +77,7 @@
 
     @Test
     public void updateState_settingEnabled_preferenceShouldBeChecked() {
-        Settings.Secure.putInt(mContext.getContentResolver(),
+        Settings.Global.putInt(mContext.getContentResolver(),
                 NOTIFICATION_BUBBLES, 1 /* enabled */);
         mController.updateState(mPreference);
 
@@ -86,7 +86,7 @@
 
     @Test
     public void updateState_settingReset_defaultDisabled_preferenceShouldNotBeChecked() {
-        Settings.Secure.putInt(mContext.getContentResolver(),
+        Settings.Global.putInt(mContext.getContentResolver(),
                 NOTIFICATION_BUBBLES, 0 /* enabled */);
         mController.updateState(mPreference);
 
@@ -104,7 +104,7 @@
     }
 
     private boolean isSettingEnabled() {
-        return Settings.Secure.getInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES,
+        return Settings.Global.getInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES,
                 OFF /* default off */) == ON;
     }
 
diff --git a/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/ContextualAdaptiveSleepSliceTest.java b/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/ContextualAdaptiveSleepSliceTest.java
index 54fb2c3..ff60aab 100644
--- a/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/ContextualAdaptiveSleepSliceTest.java
+++ b/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/ContextualAdaptiveSleepSliceTest.java
@@ -32,6 +32,7 @@
 import android.content.SharedPreferences;
 import android.content.pm.PackageManager;
 import android.net.Uri;
+import android.provider.Settings;
 
 import androidx.slice.Slice;
 import androidx.slice.SliceProvider;
@@ -65,6 +66,7 @@
         mContext = spy(RuntimeEnvironment.application);
         mContextualAdaptiveSleepSlice = spy(new ContextualAdaptiveSleepSlice(mContext));
 
+        Settings.System.putInt(mContext.getContentResolver(), Settings.System.ADAPTIVE_SLEEP, 0);
         doReturn(mPackageManager).when(mContext).getPackageManager();
         doReturn(mSharedPreferences).when(mContext).getSharedPreferences(eq(PREF), anyInt());
         doReturn(true).when(mContextualAdaptiveSleepSlice).isSettingsAvailable();
@@ -112,4 +114,20 @@
 
         assertThat(slice).isNull();
     }
+
+    @Test
+    public void getSlice_ShowIfNotTurnedOn() {
+        final Slice slice = mContextualAdaptiveSleepSlice.getSlice();
+
+        assertThat(slice).isNotNull();
+    }
+
+    @Test
+    public void getSlice_DoNotShowIfTurnedOn() {
+        Settings.System.putInt(mContext.getContentResolver(), Settings.System.ADAPTIVE_SLEEP, 1);
+
+        final Slice slice = mContextualAdaptiveSleepSlice.getSlice();
+
+        assertThat(slice).isNull();
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/FaceSetupSliceTest.java b/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/FaceSetupSliceTest.java
index 71b5c7a..eeb465b 100644
--- a/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/FaceSetupSliceTest.java
+++ b/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/FaceSetupSliceTest.java
@@ -26,6 +26,7 @@
 import android.content.pm.PackageManager;
 import android.hardware.face.FaceManager;
 import android.os.UserHandle;
+import android.provider.Settings;
 
 import androidx.slice.Slice;
 import androidx.slice.SliceProvider;
@@ -59,26 +60,58 @@
     public void getSlice_noFaceManager_shouldReturnNull() {
         when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_FACE)).thenReturn(false);
         final FaceSetupSlice setupSlice = new FaceSetupSlice(mContext);
+
         assertThat(setupSlice.getSlice()).isNull();
     }
 
     @Test
-    public void getSlice_faceEnrolled_shouldReturnNull() {
+    public void getSlice_faceEnrolled_noReEnroll_shouldReturnNull() {
         final FaceManager faceManager = mock(FaceManager.class);
         when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_FACE)).thenReturn(true);
         when(faceManager.hasEnrolledTemplates(UserHandle.myUserId())).thenReturn(true);
         when(mContext.getSystemService(Context.FACE_SERVICE)).thenReturn(faceManager);
+        Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.FACE_UNLOCK_RE_ENROLL,
+                0);
         final FaceSetupSlice setupSlice = new FaceSetupSlice(mContext);
+
         assertThat(setupSlice.getSlice()).isNull();
     }
 
     @Test
-    public void getSlice_faceNotEnrolled_shouldReturnNonNull() {
+    public void getSlice_faceNotEnrolled_shouldReturnSlice() {
         final FaceManager faceManager = mock(FaceManager.class);
         when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_FACE)).thenReturn(true);
         when(faceManager.hasEnrolledTemplates(UserHandle.myUserId())).thenReturn(false);
         when(mContext.getSystemService(Context.FACE_SERVICE)).thenReturn(faceManager);
         final FaceSetupSlice setupSlice = new FaceSetupSlice(mContext);
+
         assertThat(setupSlice.getSlice()).isNotNull();
     }
-}
\ No newline at end of file
+
+    @Test
+    public void getSlice_faceEnrolled_shouldReEnroll_shouldReturnSlice() {
+        final FaceManager faceManager = mock(FaceManager.class);
+        when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_FACE)).thenReturn(true);
+        when(faceManager.hasEnrolledTemplates(UserHandle.myUserId())).thenReturn(true);
+        when(mContext.getSystemService(Context.FACE_SERVICE)).thenReturn(faceManager);
+        Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.FACE_UNLOCK_RE_ENROLL,
+                1);
+        final FaceSetupSlice setupSlice = new FaceSetupSlice(mContext);
+
+        assertThat(setupSlice.getSlice()).isNotNull();
+    }
+
+    @Test
+    public void getSlice_faceEnrolled_musteEnroll_shouldReturnSlice() {
+        final FaceManager faceManager = mock(FaceManager.class);
+        when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_FACE)).thenReturn(true);
+        when(faceManager.hasEnrolledTemplates(UserHandle.myUserId())).thenReturn(true);
+        when(mContext.getSystemService(Context.FACE_SERVICE)).thenReturn(faceManager);
+        Settings.Secure.putInt(mContext.getContentResolver(),
+                Settings.Secure.FACE_UNLOCK_RE_ENROLL,
+                3);
+        final FaceSetupSlice setupSlice = new FaceSetupSlice(mContext);
+
+        assertThat(setupSlice.getSlice()).isNotNull();
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/network/ApnEditorTest.java b/tests/robotests/src/com/android/settings/network/ApnEditorTest.java
index 8624eb9..dc14418 100644
--- a/tests/robotests/src/com/android/settings/network/ApnEditorTest.java
+++ b/tests/robotests/src/com/android/settings/network/ApnEditorTest.java
@@ -463,6 +463,43 @@
         verify(mApnEditorUT).finish();
     }
 
+    @Test
+    public void getUserEnteredApnType_emptyApnType_shouldReturnDefault() {
+        // case 1
+        // GIVEN read only APN types with DUN
+        String[] readOnlyApnTypes = {"dun"};
+        mApnEditorUT.mReadOnlyApnTypes = readOnlyApnTypes;
+        // GIVEN read specificApnTypeForEmptyInput with DEFAULT,DUN
+        String[] defaultApnTypes = {"default", "dun"};
+        mApnEditorUT.mDefaultApnTypes = defaultApnTypes;
+
+        // Input empty in TYPE
+        final FakeApnData apnData = new FakeApnData(APN_DATA);
+        apnData.mData[ApnEditor.TYPE_INDEX] = "";
+        mApnEditorUT.mApnData = apnData;
+        mApnEditorUT.fillUI(true /* firstTime */);
+
+        // THEN APN type should be default
+        assertThat(mApnEditorUT.getUserEnteredApnType()).isEqualTo("default");
+
+        // case 2
+        // GIVEN read only APN types with DUN
+        String[] readOnlyApnTypesCase2 = {"dun"};
+        mApnEditorUT.mReadOnlyApnTypes = readOnlyApnTypesCase2;
+        // GIVEN read specificApnTypeForEmptyInput with DEFAULT
+        String[] defaultApnTypesCase2 = {"default"};
+        mApnEditorUT.mDefaultApnTypes = defaultApnTypesCase2;
+
+        // Input empty in TYPE
+        final FakeApnData apnDataCase2 = new FakeApnData(APN_DATA);
+        apnDataCase2.mData[ApnEditor.TYPE_INDEX] = "";
+        mApnEditorUT.mApnData = apnDataCase2;
+        mApnEditorUT.fillUI(true /* firstTime */);
+
+        // THEN APN type should be default
+        assertThat(mApnEditorUT.getUserEnteredApnType()).isEqualTo("default");
+    }
+
     private void initCursor() {
         doReturn(2).when(mCursor).getColumnCount();
         doReturn(2).when(mCursor).getInt(CURSOR_INTEGER_INDEX);
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 2bfaeca..c6b8689 100644
--- a/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkUtilsTest.java
+++ b/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkUtilsTest.java
@@ -22,6 +22,7 @@
 import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.ArgumentMatchers.nullable;
+import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verify;
@@ -58,6 +59,10 @@
     private static final String PACKAGE_NAME = "com.android.app";
     private static final int SUB_ID_1 = 1;
     private static final int SUB_ID_2 = 2;
+    private static final int SUB_ID_INVALID = -1;
+    private static final String PLMN_FROM_TELEPHONY_MANAGER_API = "testPlmn";
+    private static final String PLMN_FROM_SUB_ID_1 = "testPlmnSub1";
+    private static final String PLMN_FROM_SUB_ID_2 = "testPlmnSub2";
 
     @Mock
     private TelephonyManager mTelephonyManager;
@@ -89,6 +94,7 @@
 
         mContext = spy(RuntimeEnvironment.application);
         when(mContext.getSystemService(SubscriptionManager.class)).thenReturn(mSubscriptionManager);
+        when(mContext.getSystemService(TelephonyManager.class)).thenReturn(mTelephonyManager);
         when(mContext.getSystemService(Context.TELEPHONY_SERVICE)).thenReturn(mTelephonyManager);
         when(mTelephonyManager.createForSubscriptionId(SUB_ID_1)).thenReturn(mTelephonyManager);
         when(mTelephonyManager.createForSubscriptionId(SUB_ID_2)).thenReturn(mTelephonyManager2);
@@ -102,10 +108,17 @@
         when(mCarrierConfigManager.getConfigForSubId(SUB_ID_1)).thenReturn(mCarrierConfig);
 
         when(mSubscriptionInfo1.getSubscriptionId()).thenReturn(SUB_ID_1);
+        when(mSubscriptionInfo1.getCarrierName()).thenReturn(PLMN_FROM_SUB_ID_1);
         when(mSubscriptionInfo2.getSubscriptionId()).thenReturn(SUB_ID_2);
+        when(mSubscriptionInfo2.getCarrierName()).thenReturn(PLMN_FROM_SUB_ID_2);
 
         when(mSubscriptionManager.getActiveSubscriptionInfoList(eq(true))).thenReturn(
                 Arrays.asList(mSubscriptionInfo1, mSubscriptionInfo2));
+        when(mSubscriptionManager.getAccessibleSubscriptionInfoList()).thenReturn(
+                Arrays.asList(mSubscriptionInfo1, mSubscriptionInfo2));
+
+        when(mTelephonyManager.getNetworkOperatorName()).thenReturn(
+                PLMN_FROM_TELEPHONY_MANAGER_API);
     }
 
     @Test
@@ -301,4 +314,24 @@
                 TelephonyManager.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA);
         assertThat(MobileNetworkUtils.shouldSpeciallyUpdateGsmCdma(mContext, SUB_ID_1)).isTrue();
     }
+
+    @Test
+    public void getCurrentCarrierNameForDisplay_withoutValidSubId_returnNetworkOperatorName() {
+        assertThat(MobileNetworkUtils.getCurrentCarrierNameForDisplay(
+                mContext, SUB_ID_INVALID)).isEqualTo(PLMN_FROM_TELEPHONY_MANAGER_API);
+    }
+
+    @Test
+    public void getCurrentCarrierNameForDisplay_withValidSubId_returnCurrentCarrierName() {
+        assertThat(MobileNetworkUtils.getCurrentCarrierNameForDisplay(
+                mContext, SUB_ID_1)).isEqualTo(PLMN_FROM_SUB_ID_1);
+        assertThat(MobileNetworkUtils.getCurrentCarrierNameForDisplay(
+                mContext, SUB_ID_2)).isEqualTo(PLMN_FROM_SUB_ID_2);
+    }
+
+    @Test
+    public void getCurrentCarrierNameForDisplay_withoutSubId_returnNotNull() {
+        assertThat(MobileNetworkUtils.getCurrentCarrierNameForDisplay(
+                mContext)).isNotNull();
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/network/telephony/gsm/OpenNetworkSelectPagePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/network/telephony/gsm/OpenNetworkSelectPagePreferenceControllerTest.java
index d37d934..6150675 100644
--- a/tests/robotests/src/com/android/settings/network/telephony/gsm/OpenNetworkSelectPagePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/network/telephony/gsm/OpenNetworkSelectPagePreferenceControllerTest.java
@@ -17,7 +17,7 @@
 package com.android.settings.network.telephony.gsm;
 
 import static com.google.common.truth.Truth.assertThat;
-
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.when;
@@ -26,12 +26,15 @@
 import android.os.PersistableBundle;
 import android.telephony.CarrierConfigManager;
 import android.telephony.ServiceState;
+import android.telephony.SubscriptionInfo;
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
 
 import androidx.preference.Preference;
 
 import com.android.settings.R;
+import com.android.settings.network.telephony.MobileNetworkUtils;
+import java.util.Arrays;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -54,6 +57,8 @@
     private CarrierConfigManager mCarrierConfigManager;
     @Mock
     private ServiceState mServiceState;
+    @Mock
+    private SubscriptionInfo mSubscriptionInfo;
 
     private PersistableBundle mCarrierConfig;
     private OpenNetworkSelectPagePreferenceController mController;
@@ -75,6 +80,16 @@
         mCarrierConfig = new PersistableBundle();
         when(mCarrierConfigManager.getConfigForSubId(SUB_ID)).thenReturn(mCarrierConfig);
 
+        when(mSubscriptionInfo.getSubscriptionId()).thenReturn(SUB_ID);
+        when(mSubscriptionInfo.getCarrierName()).thenReturn(OPERATOR_NAME);
+
+        when(mSubscriptionManager.getActiveSubscriptionInfoList(eq(true))).thenReturn(
+                Arrays.asList(mSubscriptionInfo));
+        when(mSubscriptionManager.getAccessibleSubscriptionInfoList()).thenReturn(
+                Arrays.asList(mSubscriptionInfo));
+
+        when(mTelephonyManager.getNetworkOperatorName()).thenReturn(OPERATOR_NAME);
+
         mPreference = new Preference(mContext);
         mController = new OpenNetworkSelectPagePreferenceController(mContext,
                 "open_network_select");
@@ -94,7 +109,6 @@
     @Test
     public void getSummary_inService_returnOperatorName() {
         when(mServiceState.getState()).thenReturn(ServiceState.STATE_IN_SERVICE);
-        doReturn(OPERATOR_NAME).when(mTelephonyManager).getNetworkOperatorName();
 
         assertThat(mController.getSummary()).isEqualTo(OPERATOR_NAME);
     }
@@ -102,7 +116,6 @@
     @Test
     public void getSummary_notInService_returnDisconnect() {
         when(mServiceState.getState()).thenReturn(ServiceState.STATE_OUT_OF_SERVICE);
-        doReturn(OPERATOR_NAME).when(mTelephonyManager).getNetworkOperatorName();
 
         assertThat(mController.getSummary()).isEqualTo(
                 mContext.getString(R.string.network_disconnected));
diff --git a/tests/robotests/src/com/android/settings/notification/BubblePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/BubblePreferenceControllerTest.java
index aafefb51..470cc27 100644
--- a/tests/robotests/src/com/android/settings/notification/BubblePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/BubblePreferenceControllerTest.java
@@ -20,7 +20,7 @@
 import static android.app.NotificationManager.IMPORTANCE_HIGH;
 import static android.app.NotificationManager.IMPORTANCE_LOW;
 import static android.app.NotificationManager.IMPORTANCE_NONE;
-import static android.provider.Settings.Secure.NOTIFICATION_BUBBLES;
+import static android.provider.Settings.Global.NOTIFICATION_BUBBLES;
 
 import static com.android.settings.notification.BubblePreferenceController.SYSTEM_WIDE_OFF;
 import static com.android.settings.notification.BubblePreferenceController.SYSTEM_WIDE_ON;
@@ -103,7 +103,7 @@
 
     @Test
     public void testIsAvailable_notIfAppBlocked() {
-        Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
+        Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         appRow.banned = true;
         mController.onResume(appRow, mock(NotificationChannel.class), null, null);
@@ -112,7 +112,7 @@
 
     @Test
     public void testIsAvailable_notIfChannelBlocked() {
-        Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
+        Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         NotificationChannel channel = mock(NotificationChannel.class);
         when(channel.getImportance()).thenReturn(IMPORTANCE_NONE);
@@ -122,7 +122,7 @@
 
     @Test
     public void testIsAvailable_channel_notIfAppOff() {
-        Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
+        Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         appRow.allowBubbles = false;
         NotificationChannel channel = mock(NotificationChannel.class);
@@ -136,7 +136,7 @@
     public void testIsNotAvailable_ifOffGlobally_app() {
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         mController.onResume(appRow, null, null, null);
-        Settings.Secure.putInt(mContext.getContentResolver(),
+        Settings.Global.putInt(mContext.getContentResolver(),
                 NOTIFICATION_BUBBLES, SYSTEM_WIDE_OFF);
 
         assertFalse(mController.isAvailable());
@@ -148,7 +148,7 @@
         NotificationChannel channel = mock(NotificationChannel.class);
         when(channel.getImportance()).thenReturn(IMPORTANCE_HIGH);
         mController.onResume(appRow, channel, null, null);
-        Settings.Secure.putInt(mContext.getContentResolver(),
+        Settings.Global.putInt(mContext.getContentResolver(),
                 NOTIFICATION_BUBBLES, SYSTEM_WIDE_OFF);
 
         assertFalse(mController.isAvailable());
@@ -158,7 +158,7 @@
     public void testIsAvailable_app_evenIfOffGlobally() {
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         mAppPageController.onResume(appRow, null, null, null);
-        Settings.Secure.putInt(mContext.getContentResolver(),
+        Settings.Global.putInt(mContext.getContentResolver(),
                 NOTIFICATION_BUBBLES, SYSTEM_WIDE_OFF);
 
         assertTrue(mAppPageController.isAvailable());
@@ -168,7 +168,7 @@
     public void testIsAvailable_app() {
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         mController.onResume(appRow, null, null, null);
-        Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
+        Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
 
         assertTrue(mController.isAvailable());
     }
@@ -181,7 +181,7 @@
         when(channel.getImportance()).thenReturn(IMPORTANCE_HIGH);
         when(channel.getId()).thenReturn(DEFAULT_CHANNEL_ID);
         mController.onResume(appRow, channel, null, null);
-        Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
+        Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
 
         assertTrue(mController.isAvailable());
     }
@@ -193,7 +193,7 @@
         NotificationChannel channel = mock(NotificationChannel.class);
         when(channel.getImportance()).thenReturn(IMPORTANCE_HIGH);
         mController.onResume(appRow, channel, null, null);
-        Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
+        Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
 
         assertTrue(mController.isAvailable());
     }
@@ -205,7 +205,7 @@
         NotificationChannel channel = mock(NotificationChannel.class);
         when(channel.getImportance()).thenReturn(IMPORTANCE_HIGH);
         mController.onResume(appRow, channel, null, null);
-        Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
+        Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
 
         assertFalse(mController.isAvailable());
     }
@@ -225,7 +225,7 @@
 
     @Test
     public void testUpdateState_channelNotBlockable() {
-        Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
+        Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         NotificationChannel channel = mock(NotificationChannel.class);
         when(channel.isImportanceLockedByCriticalDeviceFunction()).thenReturn(true);
@@ -239,7 +239,7 @@
 
     @Test
     public void testUpdateState_channel() {
-        Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
+        Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         NotificationChannel channel = mock(NotificationChannel.class);
         when(channel.canBubble()).thenReturn(true);
@@ -259,7 +259,7 @@
 
     @Test
     public void testUpdateState_app() {
-        Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
+        Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         appRow.label = "App!";
         appRow.allowBubbles = true;
@@ -281,7 +281,7 @@
 
     @Test
     public void testUpdateState_app_offGlobally() {
-        Settings.Secure.putInt(mContext.getContentResolver(),
+        Settings.Global.putInt(mContext.getContentResolver(),
                 NOTIFICATION_BUBBLES, SYSTEM_WIDE_OFF);
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         appRow.label = "App!";
@@ -295,7 +295,7 @@
 
     @Test
     public void testOnPreferenceChange_on_channel() {
-        Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
+        Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         appRow.allowBubbles = true;
         NotificationChannel channel =
@@ -315,7 +315,7 @@
 
     @Test
     public void testOnPreferenceChange_off_channel() {
-        Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
+        Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         appRow.allowBubbles = true;
         NotificationChannel channel =
@@ -335,7 +335,7 @@
 
     @Test
     public void testOnPreferenceChange_on_app() {
-        Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
+        Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         appRow.allowBubbles = false;
         mController.onResume(appRow, null, null, null);
@@ -353,7 +353,7 @@
 
     @Test
     public void testOnPreferenceChange_off_app() {
-        Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
+        Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         appRow.allowBubbles = true;
         mController.onResume(appRow, null, null, null);
@@ -371,7 +371,7 @@
 
     @Test
     public void testOnPreferenceChange_on_app_offGlobally() {
-        Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES,
+        Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES,
                 SYSTEM_WIDE_OFF);
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         appRow.allowBubbles = false;
diff --git a/tests/robotests/src/com/android/settings/notification/BubbleSummaryPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/BubbleSummaryPreferenceControllerTest.java
index 04c8e4e..2710203 100644
--- a/tests/robotests/src/com/android/settings/notification/BubbleSummaryPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/BubbleSummaryPreferenceControllerTest.java
@@ -20,7 +20,7 @@
 import static android.app.NotificationManager.IMPORTANCE_HIGH;
 import static android.app.NotificationManager.IMPORTANCE_LOW;
 import static android.app.NotificationManager.IMPORTANCE_NONE;
-import static android.provider.Settings.Secure.NOTIFICATION_BUBBLES;
+import static android.provider.Settings.Global.NOTIFICATION_BUBBLES;
 
 import static com.android.settings.notification.BubbleSummaryPreferenceController.SYSTEM_WIDE_OFF;
 import static com.android.settings.notification.BubbleSummaryPreferenceController.SYSTEM_WIDE_ON;
@@ -98,7 +98,7 @@
         NotificationChannel channel = mock(NotificationChannel.class);
         when(channel.getImportance()).thenReturn(IMPORTANCE_HIGH);
         mController.onResume(appRow, channel, null, null);
-        Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES,
+        Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES,
                 SYSTEM_WIDE_OFF);
 
         assertFalse(mController.isAvailable());
@@ -108,7 +108,7 @@
     public void testIsAvailable_app() {
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         mController.onResume(appRow, null, null, null);
-        Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
+        Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
 
         assertTrue(mController.isAvailable());
     }
@@ -117,7 +117,7 @@
     public void testIsNotAvailable_app_globalOff() {
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         mController.onResume(appRow, null, null, null);
-        Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES,
+        Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES,
                 SYSTEM_WIDE_OFF);
 
         assertFalse(mController.isAvailable());
@@ -131,7 +131,7 @@
         when(channel.getImportance()).thenReturn(IMPORTANCE_HIGH);
         when(channel.getId()).thenReturn(DEFAULT_CHANNEL_ID);
         mController.onResume(appRow, channel, null, null);
-        Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
+        Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
 
         assertTrue(mController.isAvailable());
     }
@@ -149,18 +149,18 @@
 
     @Test
     public void testGetSummary() {
-        Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
+        Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         appRow.allowBubbles = true;
         mController.onResume(appRow, null, null, null);
 
         assertEquals("On", mController.getSummary());
 
-        Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES,
+        Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES,
                 SYSTEM_WIDE_OFF);
         assertEquals("Off", mController.getSummary());
 
-        Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
+        Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
         appRow.allowBubbles = false;
         mController.onResume(appRow, null, null, null);
 
diff --git a/tests/robotests/src/com/android/settings/notification/GentleNotificationsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/GentleNotificationsPreferenceControllerTest.java
index 4821322..bd01379 100644
--- a/tests/robotests/src/com/android/settings/notification/GentleNotificationsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/GentleNotificationsPreferenceControllerTest.java
@@ -16,8 +16,6 @@
 
 package com.android.settings.notification;
 
-import static android.provider.Settings.Secure.NOTIFICATION_BUBBLES;
-
 import static com.android.settings.notification.BadgingNotificationPreferenceController.OFF;
 import static com.android.settings.notification.BadgingNotificationPreferenceController.ON;
 
diff --git a/tests/robotests/src/com/android/settings/wifi/NetworkRequestDialogActivityTest.java b/tests/robotests/src/com/android/settings/wifi/NetworkRequestDialogActivityTest.java
index 107da79..4c7d02d 100644
--- a/tests/robotests/src/com/android/settings/wifi/NetworkRequestDialogActivityTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/NetworkRequestDialogActivityTest.java
@@ -26,6 +26,7 @@
 import com.android.settingslib.wifi.WifiTracker;
 import com.android.settingslib.wifi.WifiTrackerFactory;
 
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.robolectric.Robolectric;
@@ -36,15 +37,18 @@
 @Config(shadows = ShadowAlertDialogCompat.class)
 public class NetworkRequestDialogActivityTest {
 
-    @Test
-    public void LaunchActivity_shouldShowNetworkRequestDialog() {
+    @Before
+    public void setUp() {
         // Mocks fake WifiTracker, in case of exception in NetworkRequestDialogFragment.onResume().
         WifiTracker wifiTracker = mock(WifiTracker.class);
         WifiTrackerFactory.setTestingWifiTracker(wifiTracker);
+    }
 
+    @Test
+    public void launchActivity_shouldShowNetworkRequestDialog() {
         Robolectric.setupActivity(NetworkRequestDialogActivity.class);
 
-        AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
+        final AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
 
         assertThat(alertDialog.isShowing()).isTrue();
     }
diff --git a/tests/robotests/src/com/android/settings/wifi/NetworkRequestErrorDialogFragmentTest.java b/tests/robotests/src/com/android/settings/wifi/NetworkRequestErrorDialogFragmentTest.java
index 303f6af..c7b1a89 100644
--- a/tests/robotests/src/com/android/settings/wifi/NetworkRequestErrorDialogFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/NetworkRequestErrorDialogFragmentTest.java
@@ -18,11 +18,13 @@
 
 import static com.google.common.truth.Truth.assertThat;
 
+import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verify;
 import static org.mockito.internal.verification.VerificationModeFactory.times;
 
 import android.content.DialogInterface;
+import android.net.wifi.WifiManager.NetworkRequestUserSelectionCallback;
 import android.os.Bundle;
 import android.widget.Button;
 
@@ -32,6 +34,8 @@
 import com.android.settings.R;
 import com.android.settings.testutils.shadow.ShadowAlertDialogCompat;
 import com.android.settings.wifi.NetworkRequestErrorDialogFragment.ERROR_DIALOG_TYPE;
+import com.android.settingslib.wifi.WifiTracker;
+import com.android.settingslib.wifi.WifiTrackerFactory;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -47,12 +51,17 @@
 
     private FragmentActivity mActivity;
     private NetworkRequestErrorDialogFragment mFragment;
+    private WifiTracker mWifiTracker;
 
     @Before
     public void setUp() {
         mActivity = Robolectric.setupActivity(FragmentActivity.class);
         mFragment = spy(NetworkRequestErrorDialogFragment.newInstance());
         mFragment.show(mActivity.getSupportFragmentManager(), null);
+
+        // Prevents NPE when calling up NetworkRequestDialogFragment.
+        mWifiTracker = mock(WifiTracker.class);
+        WifiTrackerFactory.setTestingWifiTracker(mWifiTracker);
     }
 
     @Test
@@ -111,4 +120,17 @@
         negativeButton.performClick();
         assertThat(alertDialog.isShowing()).isFalse();
     }
+
+    @Test
+    public void clickNegativeButton_shouldCallReject() {
+        final NetworkRequestUserSelectionCallback rejectCallback =
+                mock(NetworkRequestUserSelectionCallback.class);
+        mFragment.setRejectCallback(rejectCallback);
+
+        final AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
+        final Button negativeButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE);
+        negativeButton.performClick();
+
+        verify(rejectCallback, times(1)).reject();
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java b/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java
index b16d900..669a2e6 100644
--- a/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java
@@ -28,6 +28,8 @@
 
 import android.content.Context;
 import android.net.wifi.WifiConfiguration;
+import android.net.wifi.WifiEnterpriseConfig;
+import android.net.wifi.WifiEnterpriseConfig.Eap;
 import android.net.wifi.WifiManager;
 import android.os.ServiceSpecificException;
 import android.security.KeyStore;
@@ -445,4 +447,46 @@
         WifiConfiguration config = mController.getConfig();
         assertThat(config.macRandomizationSetting).isEqualTo(WifiConfiguration.RANDOMIZATION_NONE);
     }
+
+    @Test
+    public void selectSecurity_wpa3Eap192bit_eapMethodTls() {
+        final WifiManager wifiManager = mock(WifiManager.class);
+        when(wifiManager.isWpa3SuiteBSupported()).thenReturn(true);
+        mController = new TestWifiConfigController(mConfigUiBase, mView, null /* accessPoint */,
+                WifiConfigUiBase.MODE_MODIFY, wifiManager);
+        final Spinner securitySpinner = mView.findViewById(R.id.security);
+        final Spinner eapMethodSpinner = mView.findViewById(R.id.method);
+        int wpa3Eap192bitPosition = -1;
+        final int securityCount = mController.mSecurityInPosition.length;
+        for (int i = 0; i < securityCount; i++) {
+            if (mController.mSecurityInPosition[i] != null &&
+                    mController.mSecurityInPosition[i] == AccessPoint.SECURITY_EAP_SUITE_B) {
+                wpa3Eap192bitPosition = i;
+            }
+        }
+
+        mController.onItemSelected(securitySpinner, null /* view */, wpa3Eap192bitPosition,
+                0 /* id */);
+
+        final int selectedItemPosition = eapMethodSpinner.getSelectedItemPosition();
+        assertThat(eapMethodSpinner.getSelectedItem().toString()).isEqualTo("TLS");
+    }
+
+    @Test
+    public void selectEapMethod_savedAccessPoint_shouldGetCorrectPosition() {
+        when(mAccessPoint.isSaved()).thenReturn(true);
+        when(mAccessPoint.getSecurity()).thenReturn(AccessPoint.SECURITY_EAP);
+        final WifiConfiguration mockWifiConfig = mock(WifiConfiguration.class);
+        final WifiEnterpriseConfig mockWifiEnterpriseConfig = mock(WifiEnterpriseConfig.class);
+        when(mockWifiEnterpriseConfig.getEapMethod()).thenReturn(Eap.PEAP);
+        mockWifiConfig.enterpriseConfig = mockWifiEnterpriseConfig ;
+        when(mAccessPoint.getConfig()).thenReturn(mockWifiConfig);
+        mController = new TestWifiConfigController(mConfigUiBase, mView, mAccessPoint,
+                WifiConfigUiBase.MODE_MODIFY);
+        final Spinner eapMethodSpinner = mView.findViewById(R.id.method);
+
+        eapMethodSpinner.setSelection(Eap.TLS);
+
+        assertThat(eapMethodSpinner.getSelectedItemPosition()).isEqualTo(Eap.TLS);
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/wifi/dpp/WifiDppUtilsTest.java b/tests/robotests/src/com/android/settings/wifi/dpp/WifiDppUtilsTest.java
new file mode 100644
index 0000000..694088a
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/wifi/dpp/WifiDppUtilsTest.java
@@ -0,0 +1,83 @@
+/*
+ * 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.wifi.dpp;
+
+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.content.Intent;
+import android.net.wifi.WifiConfiguration;
+import android.net.wifi.WifiConfiguration.KeyMgmt;
+import android.net.wifi.WifiManager;
+
+import com.android.settingslib.wifi.AccessPoint;
+
+import java.util.BitSet;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+import org.robolectric.shadows.ShadowApplication;
+
+@RunWith(RobolectricTestRunner.class)
+public class WifiDppUtilsTest {
+
+    @Mock
+    private WifiManager mWifiManager;
+
+    @Mock
+    private AccessPoint mAccessPoint;
+
+    @Mock
+    private WifiConfiguration mWifiConfiguration;
+
+    private Context mContext;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+
+        mContext = spy(RuntimeEnvironment.application);
+        ShadowApplication shadowApplication = ShadowApplication.getInstance();
+        shadowApplication.setSystemService(Context.WIFI_SERVICE, mWifiManager);
+    }
+
+    @Test
+    public void getConfiguratorQrCodeScannerIntentOrNull_hiddenSsidNetwork_hasHiddenSsidExtra() {
+        when(mWifiManager.isEasyConnectSupported()).thenReturn(true);
+        when(mAccessPoint.isPasspoint()).thenReturn(false);
+        when(mAccessPoint.getSecurity()).thenReturn(AccessPoint.SECURITY_PSK);
+        when(mAccessPoint.getConfig()).thenReturn(mWifiConfiguration);
+        mWifiConfiguration.SSID = "GuestNetwork";
+        mWifiConfiguration.allowedKeyManagement = new BitSet();
+        mWifiConfiguration.allowedKeyManagement.set(KeyMgmt.WPA_PSK);
+        mWifiConfiguration.hiddenSSID = true;
+
+        Intent intent = WifiDppUtils
+                .getConfiguratorQrCodeScannerIntentOrNull(mContext, mWifiManager, mAccessPoint);
+
+        assertThat(intent.getBooleanExtra(WifiDppUtils.EXTRA_WIFI_HIDDEN_SSID, false))
+                .isEqualTo(true);
+    }
+}