Merge "Import translations. DO NOT MERGE ANYWHERE" into tm-dev
diff --git a/res/layout/user_select_item.xml b/res/layout/user_select_item.xml
index fa0c91a..894f59a 100644
--- a/res/layout/user_select_item.xml
+++ b/res/layout/user_select_item.xml
@@ -15,9 +15,9 @@
 -->
 <RelativeLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@android:id/widget_frame"
     android:layout_width="120dp"
-    android:layout_height="112dp">
+    android:layout_height="112dp"
+    android:importantForAccessibility="no">
 
     <FrameLayout
         android:id="@+id/button"
@@ -41,7 +41,7 @@
         android:layout_height="wrap_content"
         android:layout_alignParentBottom="true"
         android:layout_centerHorizontal="true"
-        android:labelFor="@android:id/icon"
         android:textSize="14sp"
+        android:importantForAccessibility="no"
         style="@style/TextAppearance.PreferenceTitle.SettingsLib"/>
 </RelativeLayout>
diff --git a/res/layout/wifi_add_network_view.xml b/res/layout/wifi_add_network_view.xml
index 8c23020..d698adf 100644
--- a/res/layout/wifi_add_network_view.xml
+++ b/res/layout/wifi_add_network_view.xml
@@ -15,36 +15,16 @@
      limitations under the License.
 -->
 
-<androidx.constraintlayout.widget.ConstraintLayout
+<androidx.core.widget.NestedScrollView
     xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:clipToPadding="true"
-    android:clipChildren="true">
-        <ScrollView
+    android:layout_height="wrap_content">
+        <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:scrollIndicators="top|bottom">
-                <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="vertical">
-                        <include
-                            android:id="@+id/wifi_dialog_frame"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_above="@id/add_network_button_bar"
-                            app:layout_constraintTop_toTopOf="parent"
-                            layout="@layout/wifi_dialog"/>
+            android:orientation="vertical">
+                <include layout="@layout/wifi_network_config"/>
 
-                        <include
-                            android:id="@+id/add_network_button_bar"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            app:layout_constraintTop_toBottomOf="@id/wifi_dialog_frame"
-                            layout="@*android:layout/alert_dialog_button_bar_material"/>
-                </LinearLayout>
-        </ScrollView>
-
-</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
+                <include layout="@*android:layout/alert_dialog_button_bar_material"/>
+        </LinearLayout>
+</androidx.core.widget.NestedScrollView>
diff --git a/res/layout/wifi_dialog.xml b/res/layout/wifi_dialog.xml
index b2cdbc9..9529993 100644
--- a/res/layout/wifi_dialog.xml
+++ b/res/layout/wifi_dialog.xml
@@ -15,694 +15,10 @@
 -->
 
 <androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-        android:id="@+id/dialog_scrollview"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:fadeScrollbars="false"
         android:scrollIndicators="top|bottom">
 
-    <LinearLayout
-            android:id="@+id/l_wifidialog"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:orientation="vertical"
-            android:paddingBottom="8dip">
-
-        <LinearLayout android:id="@+id/info"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                style="@style/wifi_section" />
-
-        <LinearLayout android:id="@+id/type"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                style="@style/wifi_section"
-                android:visibility="gone">
-
-            <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    style="@style/wifi_item" >
-                <TextView
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        style="@style/wifi_item_label"
-                        android:text="@string/wifi_ssid"
-                        android:textDirection="locale" />
-
-                <androidx.constraintlayout.widget.ConstraintLayout
-                        xmlns:app="http://schemas.android.com/apk/res-auto"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content">
-                    <EditText android:id="@+id/ssid"
-                            android:layout_width="0dp"
-                            android:layout_height="wrap_content"
-                            app:layout_constraintStart_toStartOf="parent"
-                            app:layout_constraintEnd_toStartOf="@+id/ssid_scanner_button"
-                            style="@style/wifi_item_edit_content"
-                            android:hint="@string/wifi_ssid_hint"
-                            android:singleLine="true"
-                            android:inputType="textNoSuggestions"/>
-
-                    <ImageButton
-                        android:id="@+id/ssid_scanner_button"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:minWidth="@dimen/min_tap_target_size"
-                        android:minHeight="@dimen/min_tap_target_size"
-                        app:layout_constraintEnd_toEndOf="parent"
-                        android:background="?android:attr/selectableItemBackground"
-                        android:src="@drawable/ic_scan_24dp"
-                        android:contentDescription="@string/wifi_dpp_scan_qr_code"/>
-                </androidx.constraintlayout.widget.ConstraintLayout>
-
-                <LinearLayout android:id="@+id/ssid_too_long_warning"
-                              android:layout_width="match_parent"
-                              android:layout_height="wrap_content"
-                              android:visibility="gone"
-                              style="@style/wifi_item" >
-                    <TextView
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        style="@style/wifi_item_warning"
-                        android:text="@string/wifi_ssid_too_long" />
-                </LinearLayout>
-
-             </LinearLayout>
-
-            <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    style="@style/wifi_item" >
-                <TextView
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:minEms="16"
-                        style="@style/wifi_item_label"
-                        android:text="@string/wifi_security" />
-
-                <!-- Entries are added dynamically to this spinner -->
-                <!-- See WifiConfigController.configureSecuritySpinner -->
-                <Spinner android:id="@+id/security"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        style="@style/wifi_item_spinner"
-                        android:prompt="@string/wifi_security" />
-            </LinearLayout>
-        </LinearLayout>
-
-        <LinearLayout android:id="@+id/security_fields"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                style="@style/wifi_section"
-                android:visibility="gone">
-
-            <LinearLayout android:id="@+id/eap"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    style="@style/wifi_section"
-                    android:visibility="gone">
-
-                <LinearLayout android:id="@+id/l_method"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:visibility="gone"
-                        style="@style/wifi_item" >
-                    <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_label"
-                            android:text="@string/wifi_eap_method" />
-
-                    <Spinner android:id="@+id/method"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_spinner"
-                            android:prompt="@string/wifi_eap_method" />
-                </LinearLayout>
-
-                <LinearLayout android:id="@+id/l_sim"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:visibility="gone"
-                        style="@style/wifi_item" >
-                    <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_label"
-                            android:text="@string/sim_card" />
-
-                    <Spinner android:id="@+id/sim"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_spinner"
-                            android:prompt="@string/sim_card" />
-                </LinearLayout>
-
-                <LinearLayout android:id="@+id/l_phase2"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:visibility="gone"
-                        style="@style/wifi_item" >
-                    <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_label"
-                            android:text="@string/please_select_phase2" />
-
-                    <Spinner android:id="@+id/phase2"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_spinner"
-                            android:prompt="@string/please_select_phase2" />
-                </LinearLayout>
-
-                <LinearLayout android:id="@+id/l_ca_cert"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:visibility="gone"
-                        style="@style/wifi_item" >
-                    <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_label"
-                            android:text="@string/wifi_eap_ca_cert" />
-
-                    <Spinner android:id="@+id/ca_cert"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_spinner"
-                            android:prompt="@string/wifi_eap_ca_cert" />
-                </LinearLayout>
-
-                <LinearLayout android:id="@+id/l_ocsp"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:visibility="gone"
-                        style="@style/wifi_item" >
-                    <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_label"
-                            android:text="@string/wifi_eap_ocsp" />
-
-                    <Spinner android:id="@+id/ocsp"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_spinner"
-                            android:prompt="@string/wifi_eap_ocsp"
-                            android:entries="@array/eap_ocsp_type" />
-                </LinearLayout>
-
-                <LinearLayout android:id="@+id/l_domain"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    style="@style/wifi_item" >
-                    <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_label"
-                            android:text="@string/wifi_eap_domain" />
-
-                    <EditText android:id="@+id/domain"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_edit_content"
-                            android:singleLine="true"
-                            android:inputType="textNoSuggestions" />
-                </LinearLayout>
-
-                <LinearLayout android:id="@+id/no_domain_warning"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:visibility="gone"
-                        style="@style/wifi_item" >
-                    <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_warning"
-                            android:text="@string/wifi_no_domain_warning" />
-                </LinearLayout>
-
-                <LinearLayout android:id="@+id/l_user_cert"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:visibility="gone"
-                        style="@style/wifi_item" >
-                    <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_label"
-                            android:text="@string/wifi_eap_user_cert" />
-
-                    <Spinner android:id="@+id/user_cert"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_spinner"
-                            android:prompt="@string/wifi_eap_user_cert" />
-                </LinearLayout>
-
-                <LinearLayout android:id="@+id/no_user_cert_warning"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:visibility="gone"
-                        style="@style/wifi_item" >
-                    <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_warning"
-                            android:text="@string/wifi_no_user_cert_warning" />
-                </LinearLayout>
-
-                <LinearLayout android:id="@+id/l_identity"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:visibility="gone"
-                        style="@style/wifi_item" >
-                    <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_label"
-                            android:text="@string/wifi_eap_identity" />
-
-                    <EditText android:id="@+id/identity"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_edit_content"
-                            android:singleLine="true"
-                            android:inputType="textNoSuggestions" />
-                </LinearLayout>
-
-                <LinearLayout android:id="@+id/l_anonymous"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:visibility="gone"
-                        style="@style/wifi_item" >
-                    <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_label"
-                            android:text="@string/wifi_eap_anonymous" />
-
-                    <EditText android:id="@+id/anonymous"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_edit_content"
-                            android:singleLine="true"
-                            android:inputType="textNoSuggestions" />
-                </LinearLayout>
-            </LinearLayout>
-
-            <LinearLayout android:id="@+id/password_layout"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    style="@style/wifi_item" >
-                <TextView
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        style="@style/wifi_item_label"
-                        android:text="@string/wifi_password" />
-
-                <EditText android:id="@+id/password"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        style="@style/wifi_item_edit_content"
-                        android:singleLine="true"
-                        android:password="true"/>
-            </LinearLayout>
-
-            <LinearLayout android:id="@+id/show_password_layout"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    style="@style/wifi_item" >
-                <!--  Placeholder to enable right-justification of checkbox -->
-                <TextView
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        style="@style/wifi_item_label" />
-
-                <CheckBox android:id="@+id/show_password"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        style="@style/wifi_item_content"
-                        android:text="@string/wifi_show_password" />
-            </LinearLayout>
-        </LinearLayout>
-
-        <LinearLayout android:id="@+id/wifi_advanced_toggle"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                style="@style/wifi_item"
-                android:paddingTop="2dp"
-                android:paddingBottom="4dp"
-                android:importantForAccessibility="no"
-                android:visibility="gone">
-            <CheckBox android:id="@+id/wifi_advanced_togglebox"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    style="@style/wifi_advanced_toggle"
-                    android:importantForAccessibility="yes"
-                    android:contentDescription="@string/wifi_advanced_toggle_description"
-                    android:text="@string/wifi_show_advanced" />
-        </LinearLayout>
-
-        <LinearLayout android:id="@+id/wifi_advanced_fields"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="vertical"
-                    android:visibility="gone">
-
-            <LinearLayout android:id="@+id/hidden_settings_field"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:visibility="gone"
-                style="@style/wifi_item">
-
-                <TextView android:id="@+id/hidden_settings_title"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    style="@style/wifi_item_label"
-                    android:text="@string/wifi_hidden_network" />
-
-                <Spinner android:id="@+id/hidden_settings"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    style="@style/wifi_item_spinner"
-                    android:prompt="@string/wifi_hidden_network"
-                    android:entries="@array/wifi_hidden_entries"/>
-
-                <TextView android:id="@+id/hidden_settings_warning"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:padding="8dp"
-                    android:text="@string/wifi_hidden_network_warning"
-                    android:textAppearance="?android:attr/textAppearanceSmall"
-                    android:visibility="gone"/>
-            </LinearLayout>
-
-            <LinearLayout android:id="@+id/metered_settings_fields"
-                          android:layout_width="match_parent"
-                          android:layout_height="wrap_content"
-                          style="@style/wifi_item">
-
-                <TextView android:id="@+id/metered_settings_title"
-                          android:layout_width="wrap_content"
-                          android:layout_height="wrap_content"
-                          style="@style/wifi_item_label"
-                          android:text="@string/data_usage_metered_yes" />
-
-                <Spinner android:id="@+id/metered_settings"
-                         android:layout_width="match_parent"
-                         android:layout_height="wrap_content"
-                         style="@style/wifi_item_spinner"
-                         android:prompt="@string/data_usage_metered_yes"
-                         android:entries="@array/wifi_metered_entries"/>
-
-            </LinearLayout>
-
-            <LinearLayout android:id="@+id/proxy_settings_fields"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    style="@style/wifi_item"
-                    android:visibility="gone">
-
-                <TextView android:id="@+id/proxy_settings_title"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        style="@style/wifi_item_label"
-                        android:text="@string/proxy_settings_title" />
-
-                <Spinner android:id="@+id/proxy_settings"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        style="@style/wifi_item_spinner"
-                        android:prompt="@string/proxy_settings_title"
-                        android:entries="@array/wifi_proxy_settings" />
-
-            </LinearLayout>
-
-            <LinearLayout android:id="@+id/proxy_warning_limited_support"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    style="@style/wifi_item"
-                    android:visibility="gone">
-                <!--  Placeholder to enable right-justification of warning -->
-                <TextView
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        style="@style/wifi_item_label" />
-
-                <TextView
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        style="@style/wifi_item_content"
-                        android:text="@string/proxy_warning_limited_support" />
-            </LinearLayout>
-
-            <LinearLayout android:id="@+id/proxy_pac_field"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    style="@style/wifi_section"
-                    android:visibility="gone">
-                <LinearLayout
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        style="@style/wifi_item">
-                    <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_label"
-                            android:text="@string/proxy_url_title" />
-
-                    <EditText android:id="@+id/proxy_pac"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_edit_content"
-                            android:hint="@string/proxy_url_hint"
-                            android:inputType="textNoSuggestions"
-                            android:singleLine="true"/>
-                </LinearLayout>
-            </LinearLayout>
-            <LinearLayout android:id="@+id/proxy_fields"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    style="@style/wifi_section"
-                    android:visibility="gone">
-
-                <LinearLayout
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        style="@style/wifi_item">
-                    <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_label"
-                            android:text="@string/proxy_hostname_label" />
-
-                    <EditText android:id="@+id/proxy_hostname"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_edit_content"
-                            android:hint="@string/proxy_hostname_hint"
-                            android:inputType="textNoSuggestions"
-                            android:singleLine="true" />
-                </LinearLayout>
-                <LinearLayout
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        style="@style/wifi_item">
-                    <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_label"
-                            android:text="@string/proxy_port_label" />
-
-                    <EditText android:id="@+id/proxy_port"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_edit_content"
-                            android:hint="@string/proxy_port_hint"
-                            android:inputType="number"
-                            android:singleLine="true" />
-                </LinearLayout>
-                <LinearLayout
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        style="@style/wifi_item">
-                    <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_label"
-                            android:text="@string/proxy_exclusionlist_label" />
-
-                    <EditText android:id="@+id/proxy_exclusionlist"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_edit_content"
-                            android:hint="@string/proxy_exclusionlist_hint"
-                            android:inputType="textNoSuggestions"
-                            android:singleLine="true" />
-                </LinearLayout>
-            </LinearLayout>
-
-            <LinearLayout android:id="@+id/ip_fields"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    style="@style/wifi_item"
-                    android:visibility="gone">
-
-                <TextView
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        style="@style/wifi_item_label"
-                        android:text="@string/wifi_ip_settings" />
-
-                <Spinner android:id="@+id/ip_settings"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        style="@style/wifi_item_spinner"
-                        android:prompt="@string/wifi_ip_settings"
-                        android:entries="@array/wifi_ip_settings" />
-
-            </LinearLayout>
-
-            <LinearLayout android:id="@+id/staticip"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    style="@style/wifi_section"
-                    android:visibility="gone">
-                <LinearLayout
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        style="@style/wifi_item" >
-                    <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_label"
-                            android:text="@string/wifi_ip_address" />
-
-                    <EditText android:id="@+id/ipaddress"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_edit_content"
-                            android:singleLine="true"
-                            android:hint="@string/wifi_ip_address_hint"
-                            android:inputType="textNoSuggestions" />
-                </LinearLayout>
-
-                <LinearLayout
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        style="@style/wifi_item" >
-                    <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_label"
-                            android:text="@string/wifi_gateway" />
-
-                    <EditText android:id="@+id/gateway"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_edit_content"
-                            android:singleLine="true"
-                            android:hint="@string/wifi_gateway_hint"
-                            android:inputType="textNoSuggestions" />
-                </LinearLayout>
-
-                <LinearLayout
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        style="@style/wifi_item" >
-                    <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_label"
-                            android:text="@string/wifi_network_prefix_length" />
-
-                    <EditText android:id="@+id/network_prefix_length"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_edit_content"
-                            android:singleLine="true"
-                            android:hint="@string/wifi_network_prefix_length_hint"
-                            android:inputType="number" />
-                </LinearLayout>
-                <LinearLayout
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        style="@style/wifi_item" >
-                    <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_label"
-                            android:text="@string/wifi_dns1" />
-
-                    <EditText android:id="@+id/dns1"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_edit_content"
-                            android:singleLine="true"
-                            android:hint="@string/wifi_dns1_hint"
-                            android:inputType="textNoSuggestions" />
-                </LinearLayout>
-
-                <LinearLayout
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        style="@style/wifi_item" >
-                    <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_label"
-                            android:text="@string/wifi_dns2" />
-
-                    <EditText android:id="@+id/dns2"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_edit_content"
-                            android:singleLine="true"
-                            android:hint="@string/wifi_dns2_hint"
-                            android:inputType="textNoSuggestions" />
-                </LinearLayout>
-            </LinearLayout>
-
-            <LinearLayout android:id="@+id/privacy_settings_fields"
-                          android:layout_width="match_parent"
-                          android:layout_height="wrap_content"
-                          style="@style/wifi_item"
-                          android:visibility="gone">
-
-                <TextView android:id="@+id/privacy_settings_title"
-                          android:layout_width="wrap_content"
-                          android:layout_height="wrap_content"
-                          style="@style/wifi_item_label"
-                          android:text="@string/wifi_privacy_settings" />
-
-                <Spinner android:id="@+id/privacy_settings"
-                         android:layout_width="match_parent"
-                         android:layout_height="wrap_content"
-                         style="@style/wifi_item_spinner"
-                         android:prompt="@string/wifi_privacy_settings"
-                         android:entries="@array/wifi_privacy_entries"/>
-            </LinearLayout>
-
-            <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    style="@style/wifi_section">
-                <LinearLayout
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        style="@style/wifi_item" >
-                    <CheckBox android:id="@+id/shared"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            style="@style/wifi_item_content"
-                            android:textSize="14sp"
-                            android:text="@string/wifi_shared"
-                            android:checked="true" />
-                </LinearLayout>
-            </LinearLayout>
-        </LinearLayout>
-    </LinearLayout>
+    <include layout="@layout/wifi_network_config"/>
 </androidx.core.widget.NestedScrollView>
diff --git a/res/layout/wifi_network_config.xml b/res/layout/wifi_network_config.xml
new file mode 100644
index 0000000..f91f738
--- /dev/null
+++ b/res/layout/wifi_network_config.xml
@@ -0,0 +1,699 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2022 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:id="@+id/l_wifidialog"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical"
+    android:paddingBottom="8dip">
+
+    <LinearLayout android:id="@+id/info"
+                  android:layout_width="match_parent"
+                  android:layout_height="wrap_content"
+                  style="@style/wifi_section"/>
+
+    <LinearLayout android:id="@+id/type"
+                  android:layout_width="match_parent"
+                  android:layout_height="wrap_content"
+                  style="@style/wifi_section"
+                  android:visibility="gone">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            style="@style/wifi_item">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                style="@style/wifi_item_label"
+                android:text="@string/wifi_ssid"
+                android:textDirection="locale"/>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal">
+                <EditText android:id="@+id/ssid"
+                          android:layout_width="0dp"
+                          android:layout_height="wrap_content"
+                          android:layout_weight="1"
+                          style="@style/wifi_item_edit_content"
+                          android:hint="@string/wifi_ssid_hint"
+                          android:singleLine="true"
+                          android:inputType="textNoSuggestions"/>
+
+                <ImageButton
+                    android:id="@+id/ssid_scanner_button"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:minWidth="@dimen/min_tap_target_size"
+                    android:minHeight="@dimen/min_tap_target_size"
+                    android:background="?android:attr/selectableItemBackground"
+                    android:src="@drawable/ic_scan_24dp"
+                    android:contentDescription="@string/wifi_dpp_scan_qr_code"/>
+            </LinearLayout>
+
+            <LinearLayout android:id="@+id/ssid_too_long_warning"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          android:visibility="gone"
+                          style="@style/wifi_item">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    style="@style/wifi_item_warning"
+                    android:text="@string/wifi_ssid_too_long"/>
+            </LinearLayout>
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            style="@style/wifi_item">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:minEms="16"
+                style="@style/wifi_item_label"
+                android:text="@string/wifi_security"/>
+
+            <!-- Entries are added dynamically to this spinner -->
+            <!-- See WifiConfigController.configureSecuritySpinner -->
+            <Spinner android:id="@+id/security"
+                     android:layout_width="match_parent"
+                     android:layout_height="wrap_content"
+                     style="@style/wifi_item_spinner"
+                     android:prompt="@string/wifi_security"/>
+        </LinearLayout>
+    </LinearLayout>
+
+    <LinearLayout android:id="@+id/security_fields"
+                  android:layout_width="match_parent"
+                  android:layout_height="wrap_content"
+                  style="@style/wifi_section"
+                  android:visibility="gone">
+
+        <LinearLayout android:id="@+id/eap"
+                      android:layout_width="match_parent"
+                      android:layout_height="wrap_content"
+                      style="@style/wifi_section"
+                      android:visibility="gone">
+
+            <LinearLayout android:id="@+id/l_method"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          android:visibility="gone"
+                          style="@style/wifi_item">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    style="@style/wifi_item_label"
+                    android:text="@string/wifi_eap_method"/>
+
+                <Spinner android:id="@+id/method"
+                         android:layout_width="match_parent"
+                         android:layout_height="wrap_content"
+                         style="@style/wifi_item_spinner"
+                         android:prompt="@string/wifi_eap_method"/>
+            </LinearLayout>
+
+            <LinearLayout android:id="@+id/l_sim"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          android:visibility="gone"
+                          style="@style/wifi_item">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    style="@style/wifi_item_label"
+                    android:text="@string/sim_card"/>
+
+                <Spinner android:id="@+id/sim"
+                         android:layout_width="match_parent"
+                         android:layout_height="wrap_content"
+                         style="@style/wifi_item_spinner"
+                         android:prompt="@string/sim_card"/>
+            </LinearLayout>
+
+            <LinearLayout android:id="@+id/l_phase2"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          android:visibility="gone"
+                          style="@style/wifi_item">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    style="@style/wifi_item_label"
+                    android:text="@string/please_select_phase2"/>
+
+                <Spinner android:id="@+id/phase2"
+                         android:layout_width="match_parent"
+                         android:layout_height="wrap_content"
+                         style="@style/wifi_item_spinner"
+                         android:prompt="@string/please_select_phase2"/>
+            </LinearLayout>
+
+            <LinearLayout android:id="@+id/l_ca_cert"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          android:visibility="gone"
+                          style="@style/wifi_item">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    style="@style/wifi_item_label"
+                    android:text="@string/wifi_eap_ca_cert"/>
+
+                <Spinner android:id="@+id/ca_cert"
+                         android:layout_width="match_parent"
+                         android:layout_height="wrap_content"
+                         style="@style/wifi_item_spinner"
+                         android:prompt="@string/wifi_eap_ca_cert"/>
+            </LinearLayout>
+
+            <LinearLayout android:id="@+id/l_ocsp"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          android:visibility="gone"
+                          style="@style/wifi_item">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    style="@style/wifi_item_label"
+                    android:text="@string/wifi_eap_ocsp"/>
+
+                <Spinner android:id="@+id/ocsp"
+                         android:layout_width="match_parent"
+                         android:layout_height="wrap_content"
+                         style="@style/wifi_item_spinner"
+                         android:prompt="@string/wifi_eap_ocsp"
+                         android:entries="@array/eap_ocsp_type"/>
+            </LinearLayout>
+
+            <LinearLayout android:id="@+id/l_domain"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          style="@style/wifi_item">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    style="@style/wifi_item_label"
+                    android:text="@string/wifi_eap_domain"/>
+
+                <EditText android:id="@+id/domain"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          style="@style/wifi_item_edit_content"
+                          android:singleLine="true"
+                          android:inputType="textNoSuggestions"/>
+            </LinearLayout>
+
+            <LinearLayout android:id="@+id/no_domain_warning"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          android:visibility="gone"
+                          style="@style/wifi_item">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    style="@style/wifi_item_warning"
+                    android:text="@string/wifi_no_domain_warning"/>
+            </LinearLayout>
+
+            <LinearLayout android:id="@+id/l_user_cert"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          android:visibility="gone"
+                          style="@style/wifi_item">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    style="@style/wifi_item_label"
+                    android:text="@string/wifi_eap_user_cert"/>
+
+                <Spinner android:id="@+id/user_cert"
+                         android:layout_width="match_parent"
+                         android:layout_height="wrap_content"
+                         style="@style/wifi_item_spinner"
+                         android:prompt="@string/wifi_eap_user_cert"/>
+            </LinearLayout>
+
+            <LinearLayout android:id="@+id/no_user_cert_warning"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          android:visibility="gone"
+                          style="@style/wifi_item">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    style="@style/wifi_item_warning"
+                    android:text="@string/wifi_no_user_cert_warning"/>
+            </LinearLayout>
+
+            <LinearLayout android:id="@+id/l_identity"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          android:visibility="gone"
+                          style="@style/wifi_item">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    style="@style/wifi_item_label"
+                    android:text="@string/wifi_eap_identity"/>
+
+                <EditText android:id="@+id/identity"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          style="@style/wifi_item_edit_content"
+                          android:singleLine="true"
+                          android:inputType="textNoSuggestions"/>
+            </LinearLayout>
+
+            <LinearLayout android:id="@+id/l_anonymous"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          android:visibility="gone"
+                          style="@style/wifi_item">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    style="@style/wifi_item_label"
+                    android:text="@string/wifi_eap_anonymous"/>
+
+                <EditText android:id="@+id/anonymous"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          style="@style/wifi_item_edit_content"
+                          android:singleLine="true"
+                          android:inputType="textNoSuggestions"/>
+            </LinearLayout>
+        </LinearLayout>
+
+        <LinearLayout android:id="@+id/password_layout"
+                      android:layout_width="match_parent"
+                      android:layout_height="wrap_content"
+                      style="@style/wifi_item">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                style="@style/wifi_item_label"
+                android:text="@string/wifi_password"/>
+
+            <EditText android:id="@+id/password"
+                      android:layout_width="match_parent"
+                      android:layout_height="wrap_content"
+                      style="@style/wifi_item_edit_content"
+                      android:inputType="textPassword"
+                      android:singleLine="true"/>
+        </LinearLayout>
+
+        <LinearLayout android:id="@+id/show_password_layout"
+                      android:layout_width="match_parent"
+                      android:layout_height="wrap_content"
+                      style="@style/wifi_item">
+            <!--  Placeholder to enable right-justification of checkbox -->
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                style="@style/wifi_item_label"/>
+
+            <CheckBox android:id="@+id/show_password"
+                      android:layout_width="match_parent"
+                      android:layout_height="wrap_content"
+                      style="@style/wifi_item_content"
+                      android:text="@string/wifi_show_password"/>
+        </LinearLayout>
+    </LinearLayout>
+
+    <LinearLayout android:id="@+id/wifi_advanced_toggle"
+                  android:layout_width="match_parent"
+                  android:layout_height="wrap_content"
+                  style="@style/wifi_item"
+                  android:paddingTop="2dp"
+                  android:paddingBottom="4dp"
+                  android:importantForAccessibility="no"
+                  android:visibility="gone">
+        <CheckBox android:id="@+id/wifi_advanced_togglebox"
+                  android:layout_width="match_parent"
+                  android:layout_height="wrap_content"
+                  style="@style/wifi_advanced_toggle"
+                  android:importantForAccessibility="yes"
+                  android:contentDescription="@string/wifi_advanced_toggle_description"
+                  android:text="@string/wifi_show_advanced"/>
+    </LinearLayout>
+
+    <LinearLayout android:id="@+id/wifi_advanced_fields"
+                  android:layout_width="match_parent"
+                  android:layout_height="wrap_content"
+                  android:orientation="vertical"
+                  android:visibility="gone">
+
+        <LinearLayout android:id="@+id/hidden_settings_field"
+                      android:layout_width="match_parent"
+                      android:layout_height="wrap_content"
+                      android:visibility="gone"
+                      style="@style/wifi_item">
+
+            <TextView android:id="@+id/hidden_settings_title"
+                      android:layout_width="wrap_content"
+                      android:layout_height="wrap_content"
+                      style="@style/wifi_item_label"
+                      android:text="@string/wifi_hidden_network"/>
+
+            <Spinner android:id="@+id/hidden_settings"
+                     android:layout_width="match_parent"
+                     android:layout_height="wrap_content"
+                     style="@style/wifi_item_spinner"
+                     android:prompt="@string/wifi_hidden_network"
+                     android:entries="@array/wifi_hidden_entries"/>
+
+            <TextView android:id="@+id/hidden_settings_warning"
+                      android:layout_width="wrap_content"
+                      android:layout_height="wrap_content"
+                      android:padding="8dp"
+                      android:text="@string/wifi_hidden_network_warning"
+                      android:textAppearance="?android:attr/textAppearanceSmall"
+                      android:visibility="gone"/>
+        </LinearLayout>
+
+        <LinearLayout android:id="@+id/metered_settings_fields"
+                      android:layout_width="match_parent"
+                      android:layout_height="wrap_content"
+                      style="@style/wifi_item">
+
+            <TextView android:id="@+id/metered_settings_title"
+                      android:layout_width="wrap_content"
+                      android:layout_height="wrap_content"
+                      style="@style/wifi_item_label"
+                      android:text="@string/data_usage_metered_yes"/>
+
+            <Spinner android:id="@+id/metered_settings"
+                     android:layout_width="match_parent"
+                     android:layout_height="wrap_content"
+                     style="@style/wifi_item_spinner"
+                     android:prompt="@string/data_usage_metered_yes"
+                     android:entries="@array/wifi_metered_entries"/>
+
+        </LinearLayout>
+
+        <LinearLayout android:id="@+id/proxy_settings_fields"
+                      android:layout_width="match_parent"
+                      android:layout_height="wrap_content"
+                      style="@style/wifi_item"
+                      android:visibility="gone">
+
+            <TextView android:id="@+id/proxy_settings_title"
+                      android:layout_width="wrap_content"
+                      android:layout_height="wrap_content"
+                      style="@style/wifi_item_label"
+                      android:text="@string/proxy_settings_title"/>
+
+            <Spinner android:id="@+id/proxy_settings"
+                     android:layout_width="match_parent"
+                     android:layout_height="wrap_content"
+                     style="@style/wifi_item_spinner"
+                     android:prompt="@string/proxy_settings_title"
+                     android:entries="@array/wifi_proxy_settings"/>
+
+        </LinearLayout>
+
+        <LinearLayout android:id="@+id/proxy_warning_limited_support"
+                      android:layout_width="match_parent"
+                      android:layout_height="wrap_content"
+                      style="@style/wifi_item"
+                      android:visibility="gone">
+            <!--  Placeholder to enable right-justification of warning -->
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                style="@style/wifi_item_label"/>
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                style="@style/wifi_item_content"
+                android:text="@string/proxy_warning_limited_support"/>
+        </LinearLayout>
+
+        <LinearLayout android:id="@+id/proxy_pac_field"
+                      android:layout_width="match_parent"
+                      android:layout_height="wrap_content"
+                      style="@style/wifi_section"
+                      android:visibility="gone">
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                style="@style/wifi_item">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    style="@style/wifi_item_label"
+                    android:text="@string/proxy_url_title"/>
+
+                <EditText android:id="@+id/proxy_pac"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          style="@style/wifi_item_edit_content"
+                          android:hint="@string/proxy_url_hint"
+                          android:inputType="textNoSuggestions"
+                          android:singleLine="true"/>
+            </LinearLayout>
+        </LinearLayout>
+        <LinearLayout android:id="@+id/proxy_fields"
+                      android:layout_width="match_parent"
+                      android:layout_height="wrap_content"
+                      style="@style/wifi_section"
+                      android:visibility="gone">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                style="@style/wifi_item">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    style="@style/wifi_item_label"
+                    android:text="@string/proxy_hostname_label"/>
+
+                <EditText android:id="@+id/proxy_hostname"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          style="@style/wifi_item_edit_content"
+                          android:hint="@string/proxy_hostname_hint"
+                          android:inputType="textNoSuggestions"
+                          android:singleLine="true"/>
+            </LinearLayout>
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                style="@style/wifi_item">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    style="@style/wifi_item_label"
+                    android:text="@string/proxy_port_label"/>
+
+                <EditText android:id="@+id/proxy_port"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          style="@style/wifi_item_edit_content"
+                          android:hint="@string/proxy_port_hint"
+                          android:inputType="number"
+                          android:singleLine="true"/>
+            </LinearLayout>
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                style="@style/wifi_item">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    style="@style/wifi_item_label"
+                    android:text="@string/proxy_exclusionlist_label"/>
+
+                <EditText android:id="@+id/proxy_exclusionlist"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          style="@style/wifi_item_edit_content"
+                          android:hint="@string/proxy_exclusionlist_hint"
+                          android:inputType="textNoSuggestions"
+                          android:singleLine="true"/>
+            </LinearLayout>
+        </LinearLayout>
+
+        <LinearLayout android:id="@+id/ip_fields"
+                      android:layout_width="match_parent"
+                      android:layout_height="wrap_content"
+                      style="@style/wifi_item"
+                      android:visibility="gone">
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                style="@style/wifi_item_label"
+                android:text="@string/wifi_ip_settings"/>
+
+            <Spinner android:id="@+id/ip_settings"
+                     android:layout_width="match_parent"
+                     android:layout_height="wrap_content"
+                     style="@style/wifi_item_spinner"
+                     android:prompt="@string/wifi_ip_settings"
+                     android:entries="@array/wifi_ip_settings"/>
+
+        </LinearLayout>
+
+        <LinearLayout android:id="@+id/staticip"
+                      android:layout_width="match_parent"
+                      android:layout_height="wrap_content"
+                      style="@style/wifi_section"
+                      android:visibility="gone">
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                style="@style/wifi_item">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    style="@style/wifi_item_label"
+                    android:text="@string/wifi_ip_address"/>
+
+                <EditText android:id="@+id/ipaddress"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          style="@style/wifi_item_edit_content"
+                          android:singleLine="true"
+                          android:hint="@string/wifi_ip_address_hint"
+                          android:inputType="textNoSuggestions"/>
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                style="@style/wifi_item">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    style="@style/wifi_item_label"
+                    android:text="@string/wifi_gateway"/>
+
+                <EditText android:id="@+id/gateway"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          style="@style/wifi_item_edit_content"
+                          android:singleLine="true"
+                          android:hint="@string/wifi_gateway_hint"
+                          android:inputType="textNoSuggestions"/>
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                style="@style/wifi_item">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    style="@style/wifi_item_label"
+                    android:text="@string/wifi_network_prefix_length"/>
+
+                <EditText android:id="@+id/network_prefix_length"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          style="@style/wifi_item_edit_content"
+                          android:singleLine="true"
+                          android:hint="@string/wifi_network_prefix_length_hint"
+                          android:inputType="number"/>
+            </LinearLayout>
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                style="@style/wifi_item">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    style="@style/wifi_item_label"
+                    android:text="@string/wifi_dns1"/>
+
+                <EditText android:id="@+id/dns1"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          style="@style/wifi_item_edit_content"
+                          android:singleLine="true"
+                          android:hint="@string/wifi_dns1_hint"
+                          android:inputType="textNoSuggestions"/>
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                style="@style/wifi_item">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    style="@style/wifi_item_label"
+                    android:text="@string/wifi_dns2"/>
+
+                <EditText android:id="@+id/dns2"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          style="@style/wifi_item_edit_content"
+                          android:singleLine="true"
+                          android:hint="@string/wifi_dns2_hint"
+                          android:inputType="textNoSuggestions"/>
+            </LinearLayout>
+        </LinearLayout>
+
+        <LinearLayout android:id="@+id/privacy_settings_fields"
+                      android:layout_width="match_parent"
+                      android:layout_height="wrap_content"
+                      style="@style/wifi_item"
+                      android:visibility="gone">
+
+            <TextView android:id="@+id/privacy_settings_title"
+                      android:layout_width="wrap_content"
+                      android:layout_height="wrap_content"
+                      style="@style/wifi_item_label"
+                      android:text="@string/wifi_privacy_settings"/>
+
+            <Spinner android:id="@+id/privacy_settings"
+                     android:layout_width="match_parent"
+                     android:layout_height="wrap_content"
+                     style="@style/wifi_item_spinner"
+                     android:prompt="@string/wifi_privacy_settings"
+                     android:entries="@array/wifi_privacy_entries"/>
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            style="@style/wifi_section">
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                style="@style/wifi_item">
+                <CheckBox android:id="@+id/shared"
+                          android:layout_width="match_parent"
+                          android:layout_height="wrap_content"
+                          style="@style/wifi_item_content"
+                          android:textSize="14sp"
+                          android:text="@string/wifi_shared"
+                          android:checked="true"/>
+            </LinearLayout>
+        </LinearLayout>
+    </LinearLayout>
+</LinearLayout>
diff --git a/res/values-et/arrays.xml b/res/values-et/arrays.xml
index 22e5ce6..e2a9606 100644
--- a/res/values-et/arrays.xml
+++ b/res/values-et/arrays.xml
@@ -509,7 +509,7 @@
     <item msgid="2047166446768045816">"Käsitle mittemahupõhisena"</item>
   </string-array>
   <string-array name="wifi_privacy_entries">
-    <item msgid="3485945604919292489">"Kasuta juhulikustatud MAC-aadr. (vaikeseade)"</item>
+    <item msgid="3485945604919292489">"Kasuta juhuslikustatud MAC-aadr. (vaikeseade)"</item>
     <item msgid="741680937828608749">"Kasuta seadme MAC-aadressi"</item>
   </string-array>
   <string-array name="wifi_hidden_entries">
diff --git a/res/values-km/arrays.xml b/res/values-km/arrays.xml
index 0923ab8..ecfd8c1 100644
--- a/res/values-km/arrays.xml
+++ b/res/values-km/arrays.xml
@@ -490,7 +490,7 @@
     <item msgid="1219738214736244749">"បៃតង"</item>
     <item msgid="6331809026622602308">"ពណ៍ស្វាយ"</item>
     <item msgid="6390546163902724700">"ផ្កាឈូក"</item>
-    <item msgid="6500473130620545980">"ទឹកក្រូច"</item>
+    <item msgid="6500473130620545980">"ពណ៌ទឹកក្រូច"</item>
   </string-array>
   <string-array name="automatic_storage_management_days">
     <item msgid="8896644025110620477">"លើសពី 30 ថ្ងៃ"</item>
diff --git a/res/values-th/arrays.xml b/res/values-th/arrays.xml
index 1aa3054..f4705c9 100644
--- a/res/values-th/arrays.xml
+++ b/res/values-th/arrays.xml
@@ -471,7 +471,7 @@
   <string-array name="proc_stats_process_states">
     <item msgid="7389344075996860704">"ต่อเนื่อง"</item>
     <item msgid="5777152116210127847">"กิจกรรมแรก"</item>
-    <item msgid="1834030155560727324">"สำคัญ (พื้นหน้า)"</item>
+    <item msgid="1834030155560727324">"สำคัญ (เบื้องหน้า)"</item>
     <item msgid="8494424742994426350">"สำคัญ (พื้นหลัง)"</item>
     <item msgid="5099332663422156149">"การสำรองข้อมูล"</item>
     <item msgid="7701089238529887617">"ใช้หน่วยความจำมาก"</item>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 68de584..81303b0 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1291,11 +1291,9 @@
     <!-- Text shown in fingerprint settings explaining what the fingerprint can be used for. [CHAR LIMIT=NONE] -->
     <string name="security_settings_fingerprint_enroll_disclaimer">In addition to unlocking your phone, you can also use your fingerprint to authorize purchases and app access. <annotation id="url">Learn more</annotation></string>
     <!-- Text shown in fingerprint settings explaining what the fingerprint can be used for in the case unlocking is disabled [CHAR LIMIT=NONE] -->
-    <string name="security_settings_fingerprint_enroll_disclaimer_lockscreen_disabled">
-        The screen lock option is disabled. To learn more, contact your organization\'s admin.
-        <annotation id="admin_details">More details</annotation>\n\nYou can still use your
-        fingerprint to authorize purchases and app access.
-        <annotation id="url">Learn more</annotation></string>
+    <string name="security_fingerprint_disclaimer_lockscreen_disabled_1">The screen lock option is disabled. To learn more, contact your organization\u2019s admin.</string>
+    <!-- Text shown in fingerprint settings explaining what the fingerprint can be used for in the case unlocking is disabled [CHAR LIMIT=NONE] -->
+    <string name="security_fingerprint_disclaimer_lockscreen_disabled_2">You can still use your fingerprint to authorize purchases and app access.</string>
     <!-- Text shown in fingerprint enroll when we didn't observe progress for a few seconds. [CHAR LIMIT=100] -->
     <string name="security_settings_fingerprint_enroll_lift_touch_again">Lift finger, then touch sensor again</string>
     <!-- Text shown during fingerprint enrollment to indicate bad sensor calibration. [CHAR LIMIT=100] -->
@@ -1622,6 +1620,13 @@
         <item quantity="one">Must contain at least <xliff:g id="count" example="1">%d</xliff:g> character</item>
         <item quantity="other">Must be at least <xliff:g id="count" example="3">%d</xliff:g> characters</item>
     </plurals>
+    <!-- Hint shown in dialog screen when password is too short and only using numbers. [CHAR LIMIT=NONE] -->
+    <string name="lockpassword_password_too_short_all_numeric">
+        {count, plural,
+            =1    {If using only numbers, must be at least 1 digit}
+            other {If using only numbers, must be at least # digits}
+        }
+    </string>
     <!-- Hint shown in dialog screen when PIN is too short -->
     <plurals name="lockpassword_pin_too_short">
         <item quantity="one">PIN must contain at least <xliff:g id="count" example="1">%d</xliff:g> digit</item>
diff --git a/res/xml/accessibility_settings_for_setup_wizard.xml b/res/xml/accessibility_settings_for_setup_wizard.xml
index 6929d54..0926d2d 100644
--- a/res/xml/accessibility_settings_for_setup_wizard.xml
+++ b/res/xml/accessibility_settings_for_setup_wizard.xml
@@ -48,12 +48,4 @@
         android:persistent="true"
         android:summary="@string/talkback_summary"/>
 
-    <SwitchPreference
-        android:icon="@drawable/ic_accessibility_animation"
-        android:key="toggle_disable_animations"
-        android:persistent="false"
-        android:summary="@string/accessibility_disable_animations_summary"
-        android:title="@string/accessibility_disable_animations"
-        settings:controller="com.android.settings.accessibility.DisableAnimationsPreferenceController"/>
-
 </PreferenceScreen>
diff --git a/res/xml/app_locale_details.xml b/res/xml/app_locale_details.xml
index 8b1b370..e01db2f 100644
--- a/res/xml/app_locale_details.xml
+++ b/res/xml/app_locale_details.xml
@@ -20,6 +20,7 @@
     android:title="@string/app_locale_picker_title">
 
     <com.android.settingslib.widget.TopIntroPreference
+        android:key="app_locale_disclaimer"
         android:title="@string/desc_app_locale_disclaimer"
         android:order="1"/>
 
diff --git a/res/xml/wifi_network_details_fragment2.xml b/res/xml/wifi_network_details_fragment2.xml
index 1c4fe91..eb9add1 100644
--- a/res/xml/wifi_network_details_fragment2.xml
+++ b/res/xml/wifi_network_details_fragment2.xml
@@ -58,14 +58,14 @@
         android:title="@string/wifi_security"
         android:selectable="false"/>
 
-    <DropDownPreference
+    <ListPreference
         android:key="metered"
         android:icon="@drawable/ic_attach_money_black_24dp"
         android:title="@string/wifi_metered_title"
         android:entries="@array/wifi_metered_entries"
         android:entryValues="@array/wifi_metered_values"/>
 
-    <DropDownPreference
+    <ListPreference
         android:key="privacy"
         android:icon="@drawable/ic_wifi_privacy_24dp"
         android:title="@string/wifi_privacy_settings"
diff --git a/src/com/android/settings/DefaultRingtonePreference.java b/src/com/android/settings/DefaultRingtonePreference.java
index 9f9f832..914c4b2 100644
--- a/src/com/android/settings/DefaultRingtonePreference.java
+++ b/src/com/android/settings/DefaultRingtonePreference.java
@@ -22,6 +22,9 @@
 import android.media.RingtoneManager;
 import android.net.Uri;
 import android.util.AttributeSet;
+import android.util.Log;
+
+import androidx.annotation.VisibleForTesting;
 
 public class DefaultRingtonePreference extends RingtonePreference {
     private static final String TAG = "DefaultRingtonePreference";
@@ -43,6 +46,24 @@
 
     @Override
     protected void onSaveRingtone(Uri ringtoneUri) {
+        String mimeType = getContext().getContentResolver().getType(ringtoneUri);
+        if (mimeType == null) {
+            Log.e(TAG, "onSaveRingtone for URI:" + ringtoneUri
+                    + " ignored: failure to find mimeType (no access from this context?)");
+            return;
+        }
+
+        if (!(mimeType.startsWith("audio/") || mimeType.equals("application/ogg"))) {
+            Log.e(TAG, "onSaveRingtone for URI:" + ringtoneUri
+                    + " ignored: associated mimeType:" + mimeType + " is not an audio type");
+            return;
+        }
+
+        setActualDefaultRingtoneUri(ringtoneUri);
+    }
+
+    @VisibleForTesting
+    void setActualDefaultRingtoneUri(Uri ringtoneUri) {
         RingtoneManager.setActualDefaultRingtoneUri(mUserContext, getRingtoneType(), ringtoneUri);
     }
 
diff --git a/src/com/android/settings/applications/AppLocaleUtil.java b/src/com/android/settings/applications/AppLocaleUtil.java
index 3cba27c..77fba89 100644
--- a/src/com/android/settings/applications/AppLocaleUtil.java
+++ b/src/com/android/settings/applications/AppLocaleUtil.java
@@ -18,11 +18,14 @@
 
 import android.annotation.NonNull;
 import android.app.ActivityManager;
+import android.app.LocaleConfig;
 import android.content.Context;
 import android.content.Intent;
 import android.content.pm.PackageInfo;
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
+import android.os.LocaleList;
+import android.util.FeatureFlagUtils;
 import android.util.Log;
 
 import com.android.settings.R;
@@ -46,12 +49,17 @@
         boolean isDisallowedPackage = isDisallowedPackage(context, packageName);
         boolean hasLauncherEntry = hasLauncherEntry(packageName, infos);
         boolean isSignedWithPlatformKey = isSignedWithPlatformKey(context, packageName);
+        boolean isAppLocaleSupported = isAppLocaleSupported(context, packageName);
         Log.i(TAG, "Can display preference - [" + packageName + "] :"
                 + " isDisallowedPackage : " + isDisallowedPackage
                 + " / isSignedWithPlatformKey : " + isSignedWithPlatformKey
-                + " / hasLauncherEntry : " + hasLauncherEntry);
+                + " / hasLauncherEntry : " + hasLauncherEntry
+                + " / isAppLocaleSupported : " + isAppLocaleSupported);
 
-        return !isDisallowedPackage && !isSignedWithPlatformKey && hasLauncherEntry;
+        return !isDisallowedPackage
+                && !isSignedWithPlatformKey
+                && hasLauncherEntry
+                && isAppLocaleSupported;
     }
 
     private static boolean isDisallowedPackage(Context context, String packageName) {
@@ -86,4 +94,61 @@
         return infos.stream()
                 .anyMatch(info -> info.activityInfo.packageName.equals(packageName));
     }
+
+    /**
+     * Check the function of per app language is supported by current application.
+     */
+    public static boolean isAppLocaleSupported(Context context, String packageName) {
+        if (getPackageLocales(context, packageName) != null) {
+            return true;
+        }
+
+        if (FeatureFlagUtils.isEnabled(
+                context, FeatureFlagUtils.SETTINGS_APP_LOCALE_OPT_IN_ENABLED)) {
+            return false;
+        }
+
+        return getAssetLocales(context, packageName).length > 0;
+    }
+
+    /**
+     * Get locales fron AssetManager.
+     */
+    public static String[] getAssetLocales(Context context, String packageName) {
+        try {
+            PackageManager packageManager = context.getPackageManager();
+            String[] locales = packageManager.getResourcesForApplication(
+                    packageManager.getPackageInfo(packageName, PackageManager.MATCH_ALL)
+                            .applicationInfo).getAssets().getNonSystemLocales();
+            if (locales == null) {
+                Log.i(TAG, "[" + packageName + "] locales are null.");
+            }
+            if (locales.length <= 0) {
+                Log.i(TAG, "[" + packageName + "] locales length is 0.");
+                return new String[0];
+            }
+            String locale = locales[0];
+            Log.i(TAG, "First asset locale - [" + packageName + "] " + locale);
+            return locales;
+        } catch (PackageManager.NameNotFoundException e) {
+            Log.w(TAG, "Can not found the package name : " + packageName + " / " + e);
+        }
+        return new String[0];
+    }
+
+    /**
+     * Get locales from LocaleConfig.
+     */
+    public static LocaleList getPackageLocales(Context context, String packageName) {
+        try {
+            LocaleConfig localeConfig =
+                    new LocaleConfig(context.createPackageContext(packageName, 0));
+            if (localeConfig.getStatus() == LocaleConfig.STATUS_SUCCESS) {
+                return localeConfig.getSupportedLocales();
+            }
+        } catch (PackageManager.NameNotFoundException e) {
+            Log.w(TAG, "Can not found the package name : " + packageName + " / " + e);
+        }
+        return null;
+    }
 }
diff --git a/src/com/android/settings/applications/AppStateBaseBridge.java b/src/com/android/settings/applications/AppStateBaseBridge.java
index 1a39483..d7f253b 100644
--- a/src/com/android/settings/applications/AppStateBaseBridge.java
+++ b/src/com/android/settings/applications/AppStateBaseBridge.java
@@ -36,6 +36,8 @@
     protected final BackgroundHandler mHandler;
     protected final MainHandler mMainHandler;
 
+    private boolean mForceLoadAllApps;
+
     public AppStateBaseBridge(ApplicationsState appState, Callback callback) {
         mAppState = appState;
         mAppSession = mAppState != null ? mAppState.newSession(this) : null;
@@ -48,13 +50,22 @@
         mMainHandler = new MainHandler(Looper.getMainLooper());
     }
 
-    public void resume() {
+    public void resume(boolean forceLoadAllApps) {
+        mForceLoadAllApps = forceLoadAllApps;
         mHandler.sendEmptyMessage(BackgroundHandler.MSG_LOAD_ALL);
-        mAppSession.onResume();
+        if (mForceLoadAllApps) {
+            mAppSession.onResume();
+        } else {
+            mAppSession.activateSession();
+        }
     }
 
     public void pause() {
-        mAppSession.onPause();
+        if (mForceLoadAllApps) {
+            mAppSession.onPause();
+        } else {
+            mAppSession.deactivateSession();
+        }
     }
 
     public void release() {
diff --git a/src/com/android/settings/applications/SpecialAppAccessPreferenceController.java b/src/com/android/settings/applications/SpecialAppAccessPreferenceController.java
index 19b8f50..42f5930 100644
--- a/src/com/android/settings/applications/SpecialAppAccessPreferenceController.java
+++ b/src/com/android/settings/applications/SpecialAppAccessPreferenceController.java
@@ -74,7 +74,7 @@
 
     @Override
     public void onStart() {
-        mDataUsageBridge.resume();
+        mDataUsageBridge.resume(true /* forceLoadAllApps */);
     }
 
     @Override
diff --git a/src/com/android/settings/applications/appinfo/AppBatteryPreferenceController.java b/src/com/android/settings/applications/appinfo/AppBatteryPreferenceController.java
index 3cb22e0..d69c2c8 100644
--- a/src/com/android/settings/applications/appinfo/AppBatteryPreferenceController.java
+++ b/src/com/android/settings/applications/appinfo/AppBatteryPreferenceController.java
@@ -45,6 +45,7 @@
 import com.android.settings.fuelgauge.BatteryUtils;
 import com.android.settings.fuelgauge.PowerUsageFeatureProvider;
 import com.android.settings.overlay.FeatureFactory;
+import com.android.settingslib.applications.AppUtils;
 import com.android.settingslib.core.lifecycle.Lifecycle;
 import com.android.settingslib.core.lifecycle.LifecycleObserver;
 import com.android.settingslib.core.lifecycle.events.OnPause;
@@ -71,9 +72,10 @@
     BatteryDiffEntry mBatteryDiffEntry;
     @VisibleForTesting
     boolean mIsChartGraphEnabled;
+    @VisibleForTesting
+    final AppInfoDashboardFragment mParent;
 
     private Preference mPreference;
-    private final AppInfoDashboardFragment mParent;
     private String mBatteryPercent;
     private final String mPackageName;
     private final int mUid;
@@ -107,6 +109,11 @@
         super.displayPreference(screen);
         mPreference = screen.findPreference(getPreferenceKey());
         mPreference.setEnabled(false);
+        if (!AppUtils.isAppInstalled(mParent.getAppEntry())) {
+            mPreference.setSummary("");
+            return;
+        }
+
         loadBatteryDiffEntries();
     }
 
diff --git a/src/com/android/settings/applications/appinfo/AppDataUsagePreferenceController.java b/src/com/android/settings/applications/appinfo/AppDataUsagePreferenceController.java
index 6a254cb..e827325 100644
--- a/src/com/android/settings/applications/appinfo/AppDataUsagePreferenceController.java
+++ b/src/com/android/settings/applications/appinfo/AppDataUsagePreferenceController.java
@@ -20,6 +20,7 @@
 import android.net.NetworkStats;
 import android.net.NetworkTemplate;
 import android.os.Bundle;
+import android.os.Process;
 import android.text.format.DateUtils;
 import android.text.format.Formatter;
 
@@ -35,6 +36,7 @@
 import com.android.settings.datausage.AppDataUsage;
 import com.android.settings.datausage.DataUsageUtils;
 import com.android.settingslib.AppItem;
+import com.android.settingslib.applications.AppUtils;
 import com.android.settingslib.core.lifecycle.LifecycleObserver;
 import com.android.settingslib.core.lifecycle.events.OnPause;
 import com.android.settingslib.core.lifecycle.events.OnResume;
@@ -61,6 +63,7 @@
     @Override
     public void displayPreference(PreferenceScreen screen) {
         super.displayPreference(screen);
+        mPreference.setEnabled(AppUtils.isAppInstalled(mAppEntry));
     }
 
     @Override
@@ -89,11 +92,19 @@
     @Override
     public Loader<List<NetworkCycleDataForUid>> onCreateLoader(int id, Bundle args) {
         final NetworkTemplate template = getTemplate(mContext);
-        return NetworkCycleDataForUidLoader.builder(mContext)
-            .addUid(mParent.getAppEntry().info.uid)
-            .setRetrieveDetail(false)
-            .setNetworkTemplate(template)
-            .build();
+        final int uid = mParent.getAppEntry().info.uid;
+
+        final NetworkCycleDataForUidLoader.Builder builder =
+                NetworkCycleDataForUidLoader.builder(mContext);
+        builder.setRetrieveDetail(false)
+               .setNetworkTemplate(template);
+
+        builder.addUid(uid);
+        if (Process.isApplicationUid(uid)) {
+            // Also add in network usage for the app's SDK sandbox
+            builder.addUid(Process.toSdkSandboxUid(uid));
+        }
+        return builder.build();
     }
 
     @Override
diff --git a/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java b/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java
index 4cf5911..18cb4b3 100755
--- a/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java
+++ b/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java
@@ -154,6 +154,7 @@
         final TimeSpentInAppPreferenceController timeSpentInAppPreferenceController = use(
                 TimeSpentInAppPreferenceController.class);
         timeSpentInAppPreferenceController.setPackageName(packageName);
+        timeSpentInAppPreferenceController.setParentFragment(this);
         timeSpentInAppPreferenceController.initLifeCycleOwner(this);
 
         use(AppDataUsagePreferenceController.class).setParentFragment(this);
diff --git a/src/com/android/settings/applications/appinfo/AppInfoPreferenceControllerBase.java b/src/com/android/settings/applications/appinfo/AppInfoPreferenceControllerBase.java
index c495cbc..718ddb8 100644
--- a/src/com/android/settings/applications/appinfo/AppInfoPreferenceControllerBase.java
+++ b/src/com/android/settings/applications/appinfo/AppInfoPreferenceControllerBase.java
@@ -25,6 +25,7 @@
 
 import com.android.settings.SettingsPreferenceFragment;
 import com.android.settings.core.BasePreferenceController;
+import com.android.settingslib.applications.ApplicationsState;
 
 /*
  * Abstract base controller for the app detail preferences that refresh the state when the app state
@@ -35,6 +36,7 @@
 
     protected AppInfoDashboardFragment mParent;
     protected Preference mPreference;
+    protected ApplicationsState.AppEntry mAppEntry;
 
     private final Class<? extends SettingsPreferenceFragment> mDetailFragmentClass;
 
@@ -72,10 +74,12 @@
     public void setParentFragment(AppInfoDashboardFragment parent) {
         mParent = parent;
         parent.addToCallbackList(this);
+        mAppEntry = mParent.getAppEntry();
     }
 
     /**
      * Gets the fragment class to be launched when the preference is clicked.
+     *
      * @return the fragment to launch
      */
     protected Class<? extends SettingsPreferenceFragment> getDetailFragmentClass() {
@@ -84,10 +88,10 @@
 
     /**
      * Gets any extras that should be passed to the fragment class when the preference is clicked.
+     *
      * @return a bundle of extras to include in the launch intent
      */
     protected Bundle getArguments() {
         return null;
     }
-
 }
diff --git a/src/com/android/settings/applications/appinfo/AppLocaleDetails.java b/src/com/android/settings/applications/appinfo/AppLocaleDetails.java
index e6caafc..20cddec 100644
--- a/src/com/android/settings/applications/appinfo/AppLocaleDetails.java
+++ b/src/com/android/settings/applications/appinfo/AppLocaleDetails.java
@@ -18,7 +18,6 @@
 import static com.android.settings.widget.EntityHeaderController.ActionType;
 
 import android.app.Activity;
-import android.app.LocaleConfig;
 import android.app.LocaleManager;
 import android.app.settings.SettingsEnums;
 import android.content.Context;
@@ -31,6 +30,7 @@
 import android.os.Bundle;
 import android.os.LocaleList;
 import android.os.UserHandle;
+import android.util.FeatureFlagUtils;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -44,6 +44,7 @@
 import com.android.settings.SettingsPreferenceFragment;
 import com.android.settings.Utils;
 import com.android.settings.applications.AppInfoBase;
+import com.android.settings.applications.AppLocaleUtil;
 import com.android.settings.widget.EntityHeaderController;
 import com.android.settingslib.applications.AppUtils;
 import com.android.settingslib.applications.ApplicationsState.AppEntry;
@@ -62,10 +63,12 @@
 
     private static final String KEY_APP_DESCRIPTION = "app_locale_description";
     private static final String KEY_WARNINGS = "key_warnings";
+    private static final String KEY_APP_DISCLAIMER = "app_locale_disclaimer";
 
     private boolean mCreated = false;
     private String mPackageName;
     private LayoutPreference mPrefOfDescription;
+    private Preference mPrefOfDisclaimer;
     private ApplicationInfo mApplicationInfo;
 
     /**
@@ -91,8 +94,10 @@
         }
         addPreferencesFromResource(R.xml.app_locale_details);
         mPrefOfDescription = getPreferenceScreen().findPreference(KEY_APP_DESCRIPTION);
+        mPrefOfDisclaimer = getPreferenceScreen().findPreference(KEY_APP_DISCLAIMER);
         mApplicationInfo = getApplicationInfo(mPackageName, getContext().getUserId());
         setWarningMessage();
+        setDisclaimerPreference();
     }
 
     // Override here so we don't have an empty screen
@@ -171,6 +176,13 @@
         }
     }
 
+    private void setDisclaimerPreference() {
+        if (FeatureFlagUtils.isEnabled(
+                getContext(), FeatureFlagUtils.SETTINGS_APP_LOCALE_OPT_IN_ENABLED)) {
+            mPrefOfDisclaimer.setVisible(false);
+        }
+    }
+
     private void setDescription() {
         int res = getAppDescription();
         if (res != -1) {
@@ -206,8 +218,8 @@
     }
 
     private int getAppDescription() {
-        LocaleList packageLocaleList = getPackageLocales();
-        String[] assetLocaleList = getAssetLocales();
+        LocaleList packageLocaleList = AppLocaleUtil.getPackageLocales(getContext(), mPackageName);
+        String[] assetLocaleList = AppLocaleUtil.getAssetLocales(getContext(), mPackageName);
         // TODO add apended url string, "Learn more", to these both sentenses.
         if ((packageLocaleList != null && packageLocaleList.isEmpty())
                 || (packageLocaleList == null && assetLocaleList.length == 0)) {
@@ -216,41 +228,6 @@
         return -1;
     }
 
-    private String[] getAssetLocales() {
-        try {
-            PackageManager packageManager = getContext().getPackageManager();
-            String[] locales = packageManager.getResourcesForApplication(
-                    packageManager.getPackageInfo(mPackageName, PackageManager.MATCH_ALL)
-                            .applicationInfo).getAssets().getNonSystemLocales();
-            if (locales == null) {
-                Log.i(TAG, "[" + mPackageName + "] locales are null.");
-            }
-            if (locales.length <= 0) {
-                Log.i(TAG, "[" + mPackageName + "] locales length is 0.");
-                return new String[0];
-            }
-            String locale = locales[0];
-            Log.i(TAG, "First asset locale - [" + mPackageName + "] " + locale);
-            return locales;
-        } catch (PackageManager.NameNotFoundException e) {
-            Log.w(TAG, "Can not found the package name : " + mPackageName + " / " + e);
-        }
-        return new String[0];
-    }
-
-    private LocaleList getPackageLocales() {
-        try {
-            LocaleConfig localeConfig =
-                    new LocaleConfig(getContext().createPackageContext(mPackageName, 0));
-            if (localeConfig.getStatus() == LocaleConfig.STATUS_SUCCESS) {
-                return localeConfig.getSupportedLocales();
-            }
-        } catch (PackageManager.NameNotFoundException e) {
-            Log.w(TAG, "Can not found the package name : " + mPackageName + " / " + e);
-        }
-        return null;
-    }
-
     /** Gets per app's default locale */
     public static Locale getAppDefaultLocale(Context context, String packageName) {
         LocaleManager localeManager = context.getSystemService(LocaleManager.class);
diff --git a/src/com/android/settings/applications/appinfo/AppNotificationPreferenceController.java b/src/com/android/settings/applications/appinfo/AppNotificationPreferenceController.java
index bc87b44..a32205b 100644
--- a/src/com/android/settings/applications/appinfo/AppNotificationPreferenceController.java
+++ b/src/com/android/settings/applications/appinfo/AppNotificationPreferenceController.java
@@ -22,11 +22,13 @@
 import android.os.Bundle;
 
 import androidx.preference.Preference;
+import androidx.preference.PreferenceScreen;
 
 import com.android.settings.R;
 import com.android.settings.SettingsPreferenceFragment;
-import com.android.settings.notification.app.AppNotificationSettings;
 import com.android.settings.notification.NotificationBackend;
+import com.android.settings.notification.app.AppNotificationSettings;
+import com.android.settingslib.applications.AppUtils;
 import com.android.settingslib.applications.ApplicationsState;
 
 public class AppNotificationPreferenceController extends AppInfoPreferenceControllerBase {
@@ -50,6 +52,12 @@
     }
 
     @Override
+    public void displayPreference(PreferenceScreen screen) {
+        super.displayPreference(screen);
+        mPreference.setEnabled(AppUtils.isAppInstalled(mAppEntry));
+    }
+
+    @Override
     public void updateState(Preference preference) {
         preference.setSummary(getNotificationSummary(mParent.getAppEntry(), mContext, mBackend));
     }
diff --git a/src/com/android/settings/applications/appinfo/AppStoragePreferenceController.java b/src/com/android/settings/applications/appinfo/AppStoragePreferenceController.java
index 4e6bf4e..490fa0e 100644
--- a/src/com/android/settings/applications/appinfo/AppStoragePreferenceController.java
+++ b/src/com/android/settings/applications/appinfo/AppStoragePreferenceController.java
@@ -26,12 +26,13 @@
 import androidx.loader.app.LoaderManager;
 import androidx.loader.content.Loader;
 import androidx.preference.Preference;
+import androidx.preference.PreferenceScreen;
 
 import com.android.settings.R;
 import com.android.settings.SettingsPreferenceFragment;
 import com.android.settings.applications.AppStorageSettings;
 import com.android.settings.applications.FetchPackageStorageAsyncLoader;
-import com.android.settingslib.applications.ApplicationsState;
+import com.android.settingslib.applications.AppUtils;
 import com.android.settingslib.applications.StorageStatsSource;
 import com.android.settingslib.core.lifecycle.LifecycleObserver;
 import com.android.settingslib.core.lifecycle.events.OnPause;
@@ -48,13 +49,21 @@
     }
 
     @Override
+    public void displayPreference(PreferenceScreen screen) {
+        super.displayPreference(screen);
+        mPreference.setEnabled(AppUtils.isAppInstalled(mAppEntry));
+    }
+
+    @Override
     public void updateState(Preference preference) {
-        final ApplicationsState.AppEntry entry = mParent.getAppEntry();
-        if (entry != null && entry.info != null) {
-            final boolean isExternal =
-                    (entry.info.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0;
-            preference.setSummary(getStorageSummary(mLastResult, isExternal));
+        if (!AppUtils.isAppInstalled(mAppEntry)) {
+            preference.setSummary("");
+            return;
         }
+
+        final boolean isExternal =
+                (mAppEntry.info.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0;
+        preference.setSummary(getStorageSummary(mLastResult, isExternal));
     }
 
     @Override
@@ -102,5 +111,4 @@
     @Override
     public void onLoaderReset(Loader<StorageStatsSource.AppStorageStats> loader) {
     }
-
 }
diff --git a/src/com/android/settings/applications/appinfo/TimeSpentInAppPreferenceController.java b/src/com/android/settings/applications/appinfo/TimeSpentInAppPreferenceController.java
index 27d9026..3682af2 100644
--- a/src/com/android/settings/applications/appinfo/TimeSpentInAppPreferenceController.java
+++ b/src/com/android/settings/applications/appinfo/TimeSpentInAppPreferenceController.java
@@ -31,6 +31,8 @@
 import com.android.settings.applications.ApplicationFeatureProvider;
 import com.android.settings.core.LiveDataController;
 import com.android.settings.overlay.FeatureFactory;
+import com.android.settingslib.applications.AppUtils;
+import com.android.settingslib.applications.ApplicationsState;
 
 import java.util.List;
 
@@ -45,6 +47,8 @@
     private final ApplicationFeatureProvider mAppFeatureProvider;
     private Intent mIntent;
     private String mPackageName;
+    protected AppInfoDashboardFragment mParent;
+    protected ApplicationsState.AppEntry mAppEntry;
 
     public TimeSpentInAppPreferenceController(Context context, String preferenceKey) {
         super(context, preferenceKey);
@@ -59,6 +63,14 @@
                 .putExtra(Intent.EXTRA_PACKAGE_NAME, mPackageName);
     }
 
+    /**
+     * Set a parent fragment for this controller.
+     */
+    public void setParentFragment(AppInfoDashboardFragment parent) {
+        mParent = parent;
+        mAppEntry = mParent.getAppEntry();
+    }
+
     @Override
     public int getAvailabilityStatus() {
         if (TextUtils.isEmpty(mPackageName)) {
@@ -84,6 +96,7 @@
         if (pref != null) {
             pref.setIntent(mIntent);
         }
+        pref.setEnabled(AppUtils.isAppInstalled(mAppEntry));
     }
 
     @Override
diff --git a/src/com/android/settings/applications/manageapplications/ManageApplications.java b/src/com/android/settings/applications/manageapplications/ManageApplications.java
index c081ef9..a6abd10 100644
--- a/src/com/android/settings/applications/manageapplications/ManageApplications.java
+++ b/src/com/android/settings/applications/manageapplications/ManageApplications.java
@@ -1185,7 +1185,7 @@
                 mSession.onResume();
                 mLastSortMode = sort;
                 if (mExtraInfoBridge != null) {
-                    mExtraInfoBridge.resume();
+                    mExtraInfoBridge.resume(false /* forceLoadAllApps */);
                 }
                 rebuild();
             } else {
diff --git a/src/com/android/settings/applications/manageapplications/ResetAppsHelper.java b/src/com/android/settings/applications/manageapplications/ResetAppsHelper.java
index 670b5a8..9cb5a3f 100644
--- a/src/com/android/settings/applications/manageapplications/ResetAppsHelper.java
+++ b/src/com/android/settings/applications/manageapplications/ResetAppsHelper.java
@@ -32,6 +32,8 @@
 import android.os.RemoteException;
 import android.os.ServiceManager;
 import android.os.UserHandle;
+import android.os.UserManager;
+import android.util.Log;
 
 import androidx.appcompat.app.AlertDialog;
 
@@ -44,6 +46,7 @@
         DialogInterface.OnDismissListener {
 
     private static final String EXTRA_RESET_DIALOG = "resetDialog";
+    private static final String TAG = "ResetAppsHelper";
 
     private final PackageManager mPm;
     private final IPackageManager mIPm;
@@ -51,6 +54,7 @@
     private final NetworkPolicyManager mNpm;
     private final AppOpsManager mAom;
     private final Context mContext;
+    private final UserManager mUm;
 
     private AlertDialog mResetDialog;
 
@@ -62,6 +66,7 @@
                 ServiceManager.getService(Context.NOTIFICATION_SERVICE));
         mNpm = NetworkPolicyManager.from(context);
         mAom = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
+        mUm = (UserManager) context.getSystemService(Context.USER_SERVICE);
     }
 
     public void onRestoreInstanceState(Bundle savedInstanceState) {
@@ -110,27 +115,35 @@
         AsyncTask.execute(new Runnable() {
             @Override
             public void run() {
-                final List<ApplicationInfo> apps = mPm.getInstalledApplications(
-                        PackageManager.GET_DISABLED_COMPONENTS);
                 final List<String> allowList = Arrays.asList(
                         mContext.getResources().getStringArray(
                                 R.array.config_skip_reset_apps_package_name));
-
-                for (int i = 0; i < apps.size(); i++) {
-                    ApplicationInfo app = apps.get(i);
-                    if (allowList.contains(app.packageName)) {
-                        continue;
-                    }
-                    try {
-                        mNm.clearData(app.packageName, app.uid, false);
-                    } catch (android.os.RemoteException ex) {
-                    }
-                    if (!app.enabled) {
-                        if (mPm.getApplicationEnabledSetting(app.packageName)
-                                == PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER) {
-                            mPm.setApplicationEnabledSetting(app.packageName,
-                                    PackageManager.COMPONENT_ENABLED_STATE_DEFAULT,
-                                    PackageManager.DONT_KILL_APP);
+                for (UserHandle userHandle : mUm.getEnabledProfiles()) {
+                    final int userId = userHandle.getIdentifier();
+                    final List<ApplicationInfo> apps = mPm.getInstalledApplicationsAsUser(
+                            PackageManager.GET_DISABLED_COMPONENTS, userId);
+                    for (int i = 0; i < apps.size(); i++) {
+                        ApplicationInfo app = apps.get(i);
+                        if (allowList.contains(app.packageName)) {
+                            continue;
+                        }
+                        try {
+                            mNm.clearData(app.packageName, app.uid, false);
+                        } catch (android.os.RemoteException ex) {
+                        }
+                        if (!app.enabled) {
+                            try {
+                                if (mIPm.getApplicationEnabledSetting(app.packageName, userId)
+                                        == PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER) {
+                                    mIPm.setApplicationEnabledSetting(app.packageName,
+                                            PackageManager.COMPONENT_ENABLED_STATE_DEFAULT,
+                                            PackageManager.DONT_KILL_APP,
+                                            userId,
+                                            mContext.getPackageName());
+                                }
+                            } catch (RemoteException e) {
+                                Log.e(TAG, "Error during reset disabled apps.", e);
+                            }
                         }
                     }
                 }
diff --git a/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminListPreferenceController.java b/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminListPreferenceController.java
index dd16006..9403316 100644
--- a/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminListPreferenceController.java
+++ b/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminListPreferenceController.java
@@ -92,6 +92,7 @@
 
     private PreferenceGroup mPreferenceGroup;
     private FooterPreference mFooterPreference;
+    private boolean mFirstLaunch = true;
 
     static {
         FILTER.addAction(ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED);
@@ -121,6 +122,17 @@
     }
 
     @Override
+    public void updateState(Preference preference) {
+        super.updateState(preference);
+        if (mFirstLaunch) {
+            mFirstLaunch = false;
+            // When first launch, updateList() is already be called in displayPreference().
+        } else {
+            updateList();
+        }
+    }
+
+    @Override
     public void onStart() {
         mContext.registerReceiverAsUser(
                 mBroadcastReceiver, UserHandle.ALL, FILTER,
diff --git a/src/com/android/settings/applications/specialaccess/premiumsms/PremiumSmsAccess.java b/src/com/android/settings/applications/specialaccess/premiumsms/PremiumSmsAccess.java
index 3df19be..54ac63e 100644
--- a/src/com/android/settings/applications/specialaccess/premiumsms/PremiumSmsAccess.java
+++ b/src/com/android/settings/applications/specialaccess/premiumsms/PremiumSmsAccess.java
@@ -74,7 +74,7 @@
     @Override
     public void onResume() {
         super.onResume();
-        mSmsBackend.resume();
+        mSmsBackend.resume(true /* forceLoadAllApps */);
     }
 
     @Override
diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintSettings.java b/src/com/android/settings/biometrics/fingerprint/FingerprintSettings.java
index 408f859..e42574f 100644
--- a/src/com/android/settings/biometrics/fingerprint/FingerprintSettings.java
+++ b/src/com/android/settings/biometrics/fingerprint/FingerprintSettings.java
@@ -65,7 +65,6 @@
 import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
 import com.android.settings.password.ChooseLockGeneric;
 import com.android.settings.password.ChooseLockSettingsHelper;
-import com.android.settings.utils.AnnotationSpan;
 import com.android.settingslib.HelpUtils;
 import com.android.settingslib.RestrictedLockUtils;
 import com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
@@ -73,6 +72,7 @@
 import com.android.settingslib.widget.FooterPreference;
 import com.android.settingslib.widget.TwoTargetPreference;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 
@@ -114,6 +114,13 @@
 
     public static class FingerprintSettingsFragment extends SettingsPreferenceFragment
             implements OnPreferenceChangeListener, FingerprintPreference.OnDeleteClickListener {
+
+        private static class FooterColumn {
+            CharSequence mTitle = null;
+            CharSequence mLearnMoreOverrideText = null;
+            View.OnClickListener mLearnMoreClickListener = null;
+        }
+
         private static final int RESET_HIGHLIGHT_DELAY_MS = 500;
 
         private static final String TAG = "FingerprintSettings";
@@ -144,8 +151,7 @@
         private boolean mLaunchedConfirm;
         private Drawable mHighlightDrawable;
         private int mUserId;
-        private CharSequence mFooterTitle;
-        private View.OnClickListener mLearnMoreListener = null;
+        private final List<FooterColumn> mFooterColumns = new ArrayList<>();
         private boolean mEnrollClicked;
 
         private long mChallenge;
@@ -352,32 +358,45 @@
                 mLaunchedConfirm = true;
                 launchChooseOrConfirmLock();
             }
+            updateFooterColumns(activity);
+        }
 
+        private void updateFooterColumns(@NonNull Activity activity) {
             final EnforcedAdmin admin = RestrictedLockUtilsInternal.checkIfKeyguardFeaturesDisabled(
                     activity, DevicePolicyManager.KEYGUARD_DISABLE_FINGERPRINT, mUserId);
-            final AnnotationSpan.LinkInfo adminLinkInfo = new AnnotationSpan.LinkInfo(
-                    ANNOTATION_ADMIN_DETAILS, (view) -> {
-                RestrictedLockUtils.sendShowAdminSupportDetailsIntent(activity, admin);
-            });
             final Intent helpIntent = HelpUtils.getHelpIntent(
                     activity, getString(getHelpResource()), activity.getClass().getName());
-            final AnnotationSpan.LinkInfo linkInfo = new AnnotationSpan.LinkInfo(
-                    activity, ANNOTATION_URL, helpIntent);
+            final View.OnClickListener learnMoreClickListener = (v) ->
+                    activity.startActivityForResult(helpIntent, 0);
 
+            mFooterColumns.clear();
             if (admin != null) {
-                DevicePolicyManager devicePolicyManager =
+                final DevicePolicyManager devicePolicyManager =
                         getSystemService(DevicePolicyManager.class);
-                String footerText = devicePolicyManager.getResources().getString(
+                final FooterColumn column1 = new FooterColumn();
+                column1.mTitle = devicePolicyManager.getResources().getString(
                         FINGERPRINT_UNLOCK_DISABLED_EXPLANATION,
-                        () -> getString(R.string.security_settings_fingerprint_enroll_disclaimer_lockscreen_disabled));
+                        () -> getString(
+                                R.string.security_fingerprint_disclaimer_lockscreen_disabled_1
+                        )
+                );
+                column1.mLearnMoreClickListener = (v) -> RestrictedLockUtils
+                        .sendShowAdminSupportDetailsIntent(activity, admin);
+                column1.mLearnMoreOverrideText = getText(R.string.admin_support_more_info);
+                mFooterColumns.add(column1);
 
-                mFooterTitle = AnnotationSpan.linkify(footerText, linkInfo, adminLinkInfo);
+                final FooterColumn column2 = new FooterColumn();
+                column2.mTitle = getText(
+                        R.string.security_fingerprint_disclaimer_lockscreen_disabled_2
+                );
+                column2.mLearnMoreClickListener = learnMoreClickListener;
+                mFooterColumns.add(column2);
             } else {
-                mFooterTitle = getText(R.string.security_settings_fingerprint_v2_home_screen_text);
-                mLearnMoreListener = (v) -> activity.startActivityForResult(helpIntent, 0);
+                final FooterColumn column = new FooterColumn();
+                column.mTitle = getText(R.string.security_settings_fingerprint_v2_home_screen_text);
+                column.mLearnMoreClickListener = learnMoreClickListener;
+                mFooterColumns.add(column);
             }
-
-
         }
 
         private boolean isUdfps() {
@@ -474,12 +493,21 @@
             if (context == null) {
                 return;
             }
-            final FooterPreference footer = new FooterPreference.Builder(context)
-                    .setTitle(mFooterTitle).build();
-            if (mLearnMoreListener != null) {
-                footer.setLearnMoreAction(mLearnMoreListener);
+            for (int i = 0; i < mFooterColumns.size(); ++i) {
+                final FooterColumn column = mFooterColumns.get(i);
+                final FooterPreference footer = new FooterPreference.Builder(context)
+                        .setTitle(column.mTitle).build();
+                if (i > 0) {
+                    footer.setIconVisibility(View.GONE);
+                }
+                if (column.mLearnMoreClickListener != null) {
+                    footer.setLearnMoreAction(column.mLearnMoreClickListener);
+                    if (!TextUtils.isEmpty(column.mLearnMoreOverrideText)) {
+                        footer.setLearnMoreText(column.mLearnMoreOverrideText);
+                    }
+                }
+                root.addPreference(footer);
             }
-            root.addPreference(footer);
         }
 
         private static String genKey(int id) {
diff --git a/src/com/android/settings/bluetooth/BluetoothPairingDialogFragment.java b/src/com/android/settings/bluetooth/BluetoothPairingDialogFragment.java
index 9e36247..14b4a7a 100644
--- a/src/com/android/settings/bluetooth/BluetoothPairingDialogFragment.java
+++ b/src/com/android/settings/bluetooth/BluetoothPairingDialogFragment.java
@@ -83,6 +83,12 @@
     }
 
     @Override
+    public void onDestroy() {
+        super.onDestroy();
+        mPairingController.onCancel();
+    }
+
+    @Override
     public void beforeTextChanged(CharSequence s, int start, int count, int after) {
     }
 
diff --git a/src/com/android/settings/core/CategoryMixin.java b/src/com/android/settings/core/CategoryMixin.java
index 8d0a412..151ed7b 100644
--- a/src/com/android/settings/core/CategoryMixin.java
+++ b/src/com/android/settings/core/CategoryMixin.java
@@ -58,6 +58,7 @@
     private final PackageReceiver mPackageReceiver = new PackageReceiver();
     private final List<CategoryListener> mCategoryListeners = new ArrayList<>();
     private int mCategoriesUpdateTaskCount;
+    private boolean mFirstOnResume = true;
 
     public CategoryMixin(Context context) {
         mContext = context;
@@ -75,6 +76,12 @@
         filter.addDataScheme(DATA_SCHEME_PKG);
         mContext.registerReceiver(mPackageReceiver, filter);
 
+        if (mFirstOnResume) {
+            // Skip since all tiles have been refreshed in DashboardFragment.onCreatePreferences().
+            Log.d(TAG, "Skip categories update");
+            mFirstOnResume = false;
+            return;
+        }
         updateCategories();
     }
 
diff --git a/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java b/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
index 8ad66d2..2ae2057 100644
--- a/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
+++ b/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
@@ -235,13 +235,13 @@
             public void onDataChanged() {
                 switch (method) {
                     case METHOD_GET_DYNAMIC_TITLE:
-                        refreshTitle(uri, pref);
+                        refreshTitle(uri, pref, this);
                         break;
                     case METHOD_GET_DYNAMIC_SUMMARY:
-                        refreshSummary(uri, pref);
+                        refreshSummary(uri, pref, this);
                         break;
                     case METHOD_IS_CHECKED:
-                        refreshSwitch(uri, pref);
+                        refreshSwitch(uri, pref, this);
                         break;
                 }
             }
@@ -262,19 +262,18 @@
 
             final Uri uri = TileUtils.getCompleteUri(tile, META_DATA_PREFERENCE_TITLE_URI,
                     METHOD_GET_DYNAMIC_TITLE);
-            refreshTitle(uri, preference);
             return createDynamicDataObserver(METHOD_GET_DYNAMIC_TITLE, uri, preference);
         }
         return null;
     }
 
-    private void refreshTitle(Uri uri, Preference preference) {
+    private void refreshTitle(Uri uri, Preference preference, DynamicDataObserver observer) {
         ThreadUtils.postOnBackgroundThread(() -> {
             final Map<String, IContentProvider> providerMap = new ArrayMap<>();
             final String titleFromUri = TileUtils.getTextFromUri(
                     mContext, uri, providerMap, META_DATA_PREFERENCE_TITLE);
             if (!TextUtils.equals(titleFromUri, preference.getTitle())) {
-                ThreadUtils.postOnMainThread(() -> preference.setTitle(titleFromUri));
+                observer.post(() -> preference.setTitle(titleFromUri));
             }
         });
     }
@@ -291,19 +290,18 @@
 
             final Uri uri = TileUtils.getCompleteUri(tile, META_DATA_PREFERENCE_SUMMARY_URI,
                     METHOD_GET_DYNAMIC_SUMMARY);
-            refreshSummary(uri, preference);
             return createDynamicDataObserver(METHOD_GET_DYNAMIC_SUMMARY, uri, preference);
         }
         return null;
     }
 
-    private void refreshSummary(Uri uri, Preference preference) {
+    private void refreshSummary(Uri uri, Preference preference, DynamicDataObserver observer) {
         ThreadUtils.postOnBackgroundThread(() -> {
             final Map<String, IContentProvider> providerMap = new ArrayMap<>();
             final String summaryFromUri = TileUtils.getTextFromUri(
                     mContext, uri, providerMap, META_DATA_PREFERENCE_SUMMARY);
             if (!TextUtils.equals(summaryFromUri, preference.getSummary())) {
-                ThreadUtils.postOnMainThread(() -> preference.setSummary(summaryFromUri));
+                observer.post(() -> preference.setSummary(summaryFromUri));
             }
         });
     }
@@ -323,7 +321,6 @@
         final Uri isCheckedUri = TileUtils.getCompleteUri(tile, META_DATA_PREFERENCE_SWITCH_URI,
                 METHOD_IS_CHECKED);
         setSwitchEnabled(preference, false);
-        refreshSwitch(isCheckedUri, preference);
         return createDynamicDataObserver(METHOD_IS_CHECKED, isCheckedUri, preference);
     }
 
@@ -350,12 +347,12 @@
         });
     }
 
-    private void refreshSwitch(Uri uri, Preference preference) {
+    private void refreshSwitch(Uri uri, Preference preference, DynamicDataObserver observer) {
         ThreadUtils.postOnBackgroundThread(() -> {
             final Map<String, IContentProvider> providerMap = new ArrayMap<>();
             final boolean checked = TileUtils.getBooleanFromUri(mContext, uri, providerMap,
                     EXTRA_SWITCH_CHECKED_STATE);
-            ThreadUtils.postOnMainThread(() -> {
+            observer.post(() -> {
                 setSwitchChecked(preference, checked);
                 setSwitchEnabled(preference, true);
             });
diff --git a/src/com/android/settings/dashboard/DashboardFragment.java b/src/com/android/settings/dashboard/DashboardFragment.java
index 378d55e..fb0a09d 100644
--- a/src/com/android/settings/dashboard/DashboardFragment.java
+++ b/src/com/android/settings/dashboard/DashboardFragment.java
@@ -16,7 +16,6 @@
 package com.android.settings.dashboard;
 
 import android.app.Activity;
-import android.app.admin.DevicePolicyManager;
 import android.app.settings.SettingsEnums;
 import android.content.ContentResolver;
 import android.content.Context;
@@ -57,6 +56,8 @@
 import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 
 /**
  * Base fragment for dashboard style UI containing a list of static and dynamic setting items.
@@ -66,6 +67,7 @@
         BasePreferenceController.UiBlockListener {
     public static final String CATEGORY = "category";
     private static final String TAG = "DashboardFragment";
+    private static final long TIMEOUT_MILLIS = 50L;
 
     @VisibleForTesting
     final ArrayMap<String, List<DynamicDataObserver>> mDashboardTilePrefKeys = new ArrayMap<>();
@@ -461,8 +463,9 @@
         // Create a list to track which tiles are to be removed.
         final Map<String, List<DynamicDataObserver>> remove = new ArrayMap(mDashboardTilePrefKeys);
 
-        // Install dashboard tiles.
+        // Install dashboard tiles and collect pending observers.
         final boolean forceRoundedIcons = shouldForceRoundedIcon();
+        final List<DynamicDataObserver> pendingObservers = new ArrayList<>();
         for (Tile tile : tiles) {
             final String key = mDashboardFeatureProvider.getDashboardKeyForTile(tile);
             if (TextUtils.isEmpty(key)) {
@@ -472,26 +475,30 @@
             if (!displayTile(tile)) {
                 continue;
             }
+            final List<DynamicDataObserver> observers;
             if (mDashboardTilePrefKeys.containsKey(key)) {
                 // Have the key already, will rebind.
                 final Preference preference = screen.findPreference(key);
-                mDashboardFeatureProvider.bindPreferenceToTileAndGetObservers(getActivity(), this,
-                        forceRoundedIcons, preference, tile, key,
+                observers = mDashboardFeatureProvider.bindPreferenceToTileAndGetObservers(
+                        getActivity(), this, forceRoundedIcons, preference, tile, key,
                         mPlaceholderPreferenceController.getOrder());
             } else {
                 // Don't have this key, add it.
                 final Preference pref = createPreference(tile);
-                final List<DynamicDataObserver> observers =
-                        mDashboardFeatureProvider.bindPreferenceToTileAndGetObservers(getActivity(),
-                                this, forceRoundedIcons, pref, tile, key,
-                                mPlaceholderPreferenceController.getOrder());
+                observers = mDashboardFeatureProvider.bindPreferenceToTileAndGetObservers(
+                        getActivity(), this, forceRoundedIcons, pref, tile, key,
+                        mPlaceholderPreferenceController.getOrder());
                 screen.addPreference(pref);
                 registerDynamicDataObservers(observers);
                 mDashboardTilePrefKeys.put(key, observers);
             }
+            if (observers != null) {
+                pendingObservers.addAll(observers);
+            }
             remove.remove(key);
         }
-        // Finally remove tiles that are gone.
+
+        // Remove tiles that are gone.
         for (Map.Entry<String, List<DynamicDataObserver>> entry : remove.entrySet()) {
             final String key = entry.getKey();
             mDashboardTilePrefKeys.remove(key);
@@ -501,6 +508,20 @@
             }
             unregisterDynamicDataObservers(entry.getValue());
         }
+
+        // Wait for pending observers to update UI.
+        if (!pendingObservers.isEmpty()) {
+            final CountDownLatch mainLatch = new CountDownLatch(1);
+            new Thread(() -> {
+                pendingObservers.forEach(observer ->
+                        awaitObserverLatch(observer.getCountDownLatch()));
+                mainLatch.countDown();
+            }).start();
+            Log.d(tag, "Start waiting observers");
+            awaitObserverLatch(mainLatch);
+            Log.d(tag, "Stop waiting observers");
+            pendingObservers.forEach(DynamicDataObserver::updateUi);
+        }
     }
 
     @Override
@@ -546,4 +567,12 @@
             resolver.unregisterContentObserver(observer);
         });
     }
+
+    private void awaitObserverLatch(CountDownLatch latch) {
+        try {
+            latch.await(TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);
+        } catch (InterruptedException e) {
+            // Do nothing
+        }
+    }
 }
diff --git a/src/com/android/settings/dashboard/DynamicDataObserver.java b/src/com/android/settings/dashboard/DynamicDataObserver.java
index f5299be..41bc563 100644
--- a/src/com/android/settings/dashboard/DynamicDataObserver.java
+++ b/src/com/android/settings/dashboard/DynamicDataObserver.java
@@ -20,13 +20,24 @@
 import android.os.Handler;
 import android.os.Looper;
 
+import com.android.settingslib.utils.ThreadUtils;
+
+import java.util.concurrent.CountDownLatch;
+
 /**
  * Observer for updating injected dynamic data.
  */
 public abstract class DynamicDataObserver extends ContentObserver {
 
+    private Runnable mUpdateRunnable;
+    private CountDownLatch mCountDownLatch;
+    private boolean mUpdateDelegated;
+
     protected DynamicDataObserver() {
         super(new Handler(Looper.getMainLooper()));
+        mCountDownLatch = new CountDownLatch(1);
+        // Load data for the first time
+        onDataChanged();
     }
 
     /** Returns the uri of the callback. */
@@ -35,8 +46,30 @@
     /** Called when data changes. */
     public abstract void onDataChanged();
 
+    /** Calls the runnable to update UI */
+    public synchronized void updateUi() {
+        mUpdateDelegated = true;
+        if (mUpdateRunnable != null) {
+            mUpdateRunnable.run();
+        }
+    }
+
+    /** Returns the count-down latch */
+    public CountDownLatch getCountDownLatch() {
+        return mCountDownLatch;
+    }
+
     @Override
     public void onChange(boolean selfChange) {
         onDataChanged();
     }
+
+    protected synchronized void post(Runnable runnable) {
+        if (mUpdateDelegated) {
+            ThreadUtils.postOnMainThread(runnable);
+        } else {
+            mUpdateRunnable = runnable;
+            mCountDownLatch.countDown();
+        }
+    }
 }
diff --git a/src/com/android/settings/dashboard/profileselector/UserAdapter.java b/src/com/android/settings/dashboard/profileselector/UserAdapter.java
index 2573d11..e88b9cb 100644
--- a/src/com/android/settings/dashboard/profileselector/UserAdapter.java
+++ b/src/com/android/settings/dashboard/profileselector/UserAdapter.java
@@ -120,7 +120,7 @@
     private void bindViewHolder(ViewHolder holder, int position) {
         UserDetails userDetails = getItem(position);
         holder.getIconView().setImageDrawable(userDetails.mIcon);
-        holder.getTitleView().setText(userDetails.mTitle);
+        holder.setTitle(userDetails.mTitle);
     }
 
     @Override
@@ -206,18 +206,19 @@
     static class ViewHolder extends RecyclerView.ViewHolder {
         private final ImageView mIconView;
         private final TextView mTitleView;
+        private final View mButtonView;
 
         private ViewHolder(View view) {
             super(view);
             mIconView = view.findViewById(android.R.id.icon);
             mTitleView = view.findViewById(android.R.id.title);
+            mButtonView = view.findViewById(R.id.button);
         }
 
         private ViewHolder(View view, OnClickListener onClickListener) {
             this(view);
-            View button = view.findViewById(R.id.button);
-            if (button != null) {
-                button.setOnClickListener(v -> onClickListener.onClick(getAdapterPosition()));
+            if (mButtonView != null) {
+                mButtonView.setOnClickListener(v -> onClickListener.onClick(getAdapterPosition()));
             }
         }
 
@@ -225,8 +226,11 @@
             return mIconView;
         }
 
-        private TextView getTitleView() {
-            return mTitleView;
+        private void setTitle(CharSequence title) {
+            mTitleView.setText(title);
+            if (mButtonView != null) {
+                mButtonView.setContentDescription(title);
+            }
         }
     }
 
diff --git a/src/com/android/settings/datausage/AppDataUsage.java b/src/com/android/settings/datausage/AppDataUsage.java
index 531a341..f0d2799 100644
--- a/src/com/android/settings/datausage/AppDataUsage.java
+++ b/src/com/android/settings/datausage/AppDataUsage.java
@@ -25,6 +25,7 @@
 import android.graphics.drawable.Drawable;
 import android.net.NetworkTemplate;
 import android.os.Bundle;
+import android.os.Process;
 import android.os.UserHandle;
 import android.telephony.SubscriptionManager;
 import android.util.ArraySet;
@@ -140,6 +141,14 @@
             }
         }
 
+        if (mAppItem.key > 0 && UserHandle.isApp(mAppItem.key)) {
+            // In case we've been asked data usage for an app, automatically
+            // include data usage of the corresponding SDK sandbox
+            final int appSandboxUid = Process.toSdkSandboxUid(mAppItem.key);
+            if (!mAppItem.uids.get(appSandboxUid)) {
+                mAppItem.addUid(appSandboxUid);
+            }
+        }
         mTotalUsage = findPreference(KEY_TOTAL_USAGE);
         mForegroundUsage = findPreference(KEY_FOREGROUND_USAGE);
         mBackgroundUsage = findPreference(KEY_BACKGROUND_USAGE);
@@ -307,6 +316,10 @@
     }
 
     private void addUid(int uid) {
+        if (Process.isSdkSandboxUid(uid)) {
+            // For a sandbox process, get the associated app UID
+            uid = Process.getAppUidForSdkSandboxUid(uid);
+        }
         String[] packages = mPackageManager.getPackagesForUid(uid);
         if (packages != null) {
             for (int i = 0; i < packages.length; i++) {
@@ -404,12 +417,8 @@
                     = NetworkCycleDataForUidLoader.builder(mContext);
                 builder.setRetrieveDetail(true)
                     .setNetworkTemplate(mTemplate);
-                if (mAppItem.category == AppItem.CATEGORY_USER) {
-                    for (int i = 0; i < mAppItem.uids.size(); i++) {
-                        builder.addUid(mAppItem.uids.keyAt(i));
-                    }
-                } else {
-                    builder.addUid(mAppItem.key);
+                for (int i = 0; i < mAppItem.uids.size(); i++) {
+                    builder.addUid(mAppItem.uids.keyAt(i));
                 }
                 if (mCycles != null) {
                     builder.setCycles(mCycles);
diff --git a/src/com/android/settings/datausage/BillingCyclePreferenceController.java b/src/com/android/settings/datausage/BillingCyclePreferenceController.java
index 9592c5e..73216ab 100644
--- a/src/com/android/settings/datausage/BillingCyclePreferenceController.java
+++ b/src/com/android/settings/datausage/BillingCyclePreferenceController.java
@@ -28,6 +28,7 @@
 import androidx.preference.PreferenceScreen;
 
 import com.android.settings.core.BasePreferenceController;
+import com.android.settings.datausage.DataUsageUtils;
 import com.android.settings.datausage.lib.DataUsageLib;
 import com.android.settingslib.NetworkPolicyEditor;
 
@@ -63,6 +64,6 @@
 
     @Override
     public int getAvailabilityStatus() {
-        return AVAILABLE;
+        return DataUsageUtils.hasMobileData(mContext) ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
     }
 }
diff --git a/src/com/android/settings/datausage/DataSaverSummary.java b/src/com/android/settings/datausage/DataSaverSummary.java
index 2e52e38..744f692 100644
--- a/src/com/android/settings/datausage/DataSaverSummary.java
+++ b/src/com/android/settings/datausage/DataSaverSummary.java
@@ -83,7 +83,7 @@
         mDataSaverBackend.refreshAllowlist();
         mDataSaverBackend.refreshDenylist();
         mDataSaverBackend.addListener(this);
-        mDataUsageBridge.resume();
+        mDataUsageBridge.resume(true /* forceLoadAllApps */);
     }
 
     @Override
diff --git a/src/com/android/settings/datausage/DataUsageList.java b/src/com/android/settings/datausage/DataUsageList.java
index 4ee6530..4a44a16 100644
--- a/src/com/android/settings/datausage/DataUsageList.java
+++ b/src/com/android/settings/datausage/DataUsageList.java
@@ -369,7 +369,7 @@
             final int collapseKey;
             final int category;
             final int userId = UserHandle.getUserId(uid);
-            if (UserHandle.isApp(uid)) {
+            if (UserHandle.isApp(uid) || Process.isSdkSandboxUid(uid)) {
                 if (profiles.contains(new UserHandle(userId))) {
                     if (userId != currentUserId) {
                         // Add to a managed user item.
@@ -377,8 +377,12 @@
                         largest = accumulate(managedKey, knownItems, bucket,
                             AppItem.CATEGORY_USER, items, largest);
                     }
-                    // Add to app item.
-                    collapseKey = uid;
+                    // Map SDK sandbox back to its corresponding app
+                    if (Process.isSdkSandboxUid(uid)) {
+                        collapseKey = Process.getAppUidForSdkSandboxUid(uid);
+                    } else {
+                        collapseKey = uid;
+                    }
                     category = AppItem.CATEGORY_APP;
                 } else {
                     // If it is a removed user add it to the removed users' key
@@ -416,6 +420,7 @@
             if (item == null) {
                 item = new AppItem(uid);
                 item.total = -1;
+                item.addUid(uid);
                 items.add(item);
                 knownItems.put(item.key, item);
             }
diff --git a/src/com/android/settings/datausage/UnrestrictedDataAccessPreferenceController.java b/src/com/android/settings/datausage/UnrestrictedDataAccessPreferenceController.java
index ac088c0..06cf8ed 100644
--- a/src/com/android/settings/datausage/UnrestrictedDataAccessPreferenceController.java
+++ b/src/com/android/settings/datausage/UnrestrictedDataAccessPreferenceController.java
@@ -91,7 +91,7 @@
 
     @Override
     public void onStart() {
-        mDataUsageBridge.resume();
+        mDataUsageBridge.resume(true /* forceLoadAllApps */);
     }
 
     @Override
diff --git a/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java b/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java
index 34edf98..a00b036 100644
--- a/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java
+++ b/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java
@@ -525,20 +525,24 @@
         final long foregroundTimeMs = bundle.getLong(EXTRA_FOREGROUND_TIME);
         final long backgroundTimeMs = bundle.getLong(EXTRA_BACKGROUND_TIME);
         final int consumedPower = bundle.getInt(EXTRA_POWER_USAGE_AMOUNT);
+        final int uid = bundle.getInt(EXTRA_UID, 0);
         final String slotTime = bundle.getString(EXTRA_SLOT_TIME, null);
         final long totalTimeMs = foregroundTimeMs + backgroundTimeMs;
         final CharSequence usageTimeSummary;
-        final PowerUsageFeatureProvider powerFeatureProvider =
-                FeatureFactory.getFactory(getContext()).getPowerUsageFeatureProvider(getContext());
+        final boolean isChartGraphEnabled = FeatureFactory.getFactory(getContext())
+                .getPowerUsageFeatureProvider(getContext()).isChartGraphEnabled(getContext());
 
+        if (!isChartGraphEnabled && BatteryEntry.isSystemUid(uid)) {
+            return null;
+        }
         if (totalTimeMs == 0) {
             final int batteryWithoutUsageTime = consumedPower > 0
                     ? R.string.battery_usage_without_time : R.string.battery_not_usage_24hr;
-            usageTimeSummary = getText(powerFeatureProvider.isChartGraphEnabled(getContext())
+            usageTimeSummary = getText(isChartGraphEnabled
                     ? batteryWithoutUsageTime : R.string.battery_not_usage);
         } else if (slotTime == null) {
             // Shows summary text with past 24 hr or full charge if slot time is null.
-            usageTimeSummary = powerFeatureProvider.isChartGraphEnabled(getContext())
+            usageTimeSummary = isChartGraphEnabled
                     ? getAppPast24HrActiveSummary(foregroundTimeMs, backgroundTimeMs, totalTimeMs)
                     : getAppFullChargeActiveSummary(
                             foregroundTimeMs, backgroundTimeMs, totalTimeMs);
diff --git a/src/com/android/settings/fuelgauge/BatteryAppListPreferenceController.java b/src/com/android/settings/fuelgauge/BatteryAppListPreferenceController.java
index 9e1bbb3..9731ab7 100644
--- a/src/com/android/settings/fuelgauge/BatteryAppListPreferenceController.java
+++ b/src/com/android/settings/fuelgauge/BatteryAppListPreferenceController.java
@@ -434,7 +434,7 @@
 
     @VisibleForTesting
     void setUsageSummary(Preference preference, BatteryEntry entry) {
-        if (entry.getUid() == Process.SYSTEM_UID) {
+        if (BatteryEntry.isSystemUid(entry.getUid())) {
             return;
         }
         String packageName = entry.getDefaultPackageName();
diff --git a/src/com/android/settings/fuelgauge/BatteryEntry.java b/src/com/android/settings/fuelgauge/BatteryEntry.java
index 518dc96..9dcbd05 100644
--- a/src/com/android/settings/fuelgauge/BatteryEntry.java
+++ b/src/com/android/settings/fuelgauge/BatteryEntry.java
@@ -209,7 +209,8 @@
                 if (packages != null && packages.length == 1) {
                     mDefaultPackageName = packages[0];
                 } else {
-                    mDefaultPackageName = uidBatteryConsumer.getPackageWithHighestDrain();
+                    mDefaultPackageName = isSystemUid(uid)
+                            ? PACKAGE_SYSTEM : uidBatteryConsumer.getPackageWithHighestDrain();
                 }
             }
             if (mDefaultPackageName != null) {
@@ -352,13 +353,8 @@
         }
 
         final PackageManager pm = context.getPackageManager();
-        final String[] packages;
-        if (uid == Process.SYSTEM_UID) {
-            packages = new String[] {PACKAGE_SYSTEM};
-        } else {
-            packages = pm.getPackagesForUid(uid);
-        }
-
+        final String[] packages = isSystemUid(uid)
+                ? new String[] {PACKAGE_SYSTEM} : pm.getPackagesForUid(uid);
         if (packages != null) {
             final String[] packageLabels = new String[packages.length];
             System.arraycopy(packages, 0, packageLabels, 0, packages.length);
@@ -615,4 +611,8 @@
         }
         return new NameAndIcon(name, null /* icon */, iconId);
     }
+
+    static boolean isSystemUid(int uid) {
+        return uid == Process.SYSTEM_UID;
+    }
 }
diff --git a/src/com/android/settings/homepage/contextualcards/slices/BluetoothDevicesSlice.java b/src/com/android/settings/homepage/contextualcards/slices/BluetoothDevicesSlice.java
index 7e4730c..4e276c1 100644
--- a/src/com/android/settings/homepage/contextualcards/slices/BluetoothDevicesSlice.java
+++ b/src/com/android/settings/homepage/contextualcards/slices/BluetoothDevicesSlice.java
@@ -176,7 +176,7 @@
     List<CachedBluetoothDevice> getPairedBluetoothDevices() {
         final List<CachedBluetoothDevice> bluetoothDeviceList = new ArrayList<>();
 
-        // If Bluetooth is disable, skip getting the Bluetooth devices.
+        // If Bluetooth is disabled, skip getting the Bluetooth devices.
         if (!BluetoothAdapter.getDefaultAdapter().isEnabled()) {
             Log.i(TAG, "Cannot get Bluetooth devices, Bluetooth is disabled.");
             return bluetoothDeviceList;
diff --git a/src/com/android/settings/language/LanguageAndInputSettings.java b/src/com/android/settings/language/LanguageAndInputSettings.java
index 23e37ba..71b48f9 100644
--- a/src/com/android/settings/language/LanguageAndInputSettings.java
+++ b/src/com/android/settings/language/LanguageAndInputSettings.java
@@ -16,6 +16,8 @@
 
 package com.android.settings.language;
 
+import static android.app.admin.DevicePolicyResources.Strings.Settings.PERSONAL_DICTIONARY_FOR_WORK;
+import static android.app.admin.DevicePolicyResources.Strings.Settings.SPELL_CHECKER_FOR_WORK;
 import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_KEYBOARDS_AND_TOOLS;
 
 import android.app.Activity;
@@ -80,6 +82,12 @@
         replaceEnterpriseStringTitle("language_and_input_for_work_category",
                 WORK_PROFILE_KEYBOARDS_AND_TOOLS,
                 R.string.language_and_input_for_work_category_title);
+        replaceEnterpriseStringTitle("spellcheckers_settings_for_work_pref",
+                SPELL_CHECKER_FOR_WORK,
+                R.string.spellcheckers_settings_for_work_title);
+        replaceEnterpriseStringTitle("user_dictionary_settings_for_work_pref",
+                PERSONAL_DICTIONARY_FOR_WORK,
+                R.string.user_dict_settings_for_work_title);
     }
 
     @Override
diff --git a/src/com/android/settings/network/SwitchToEuiccSubscriptionSidecar.java b/src/com/android/settings/network/SwitchToEuiccSubscriptionSidecar.java
index 0b39d6a..935e235 100644
--- a/src/com/android/settings/network/SwitchToEuiccSubscriptionSidecar.java
+++ b/src/com/android/settings/network/SwitchToEuiccSubscriptionSidecar.java
@@ -21,12 +21,14 @@
 import android.telephony.SubscriptionInfo;
 import android.telephony.SubscriptionManager;
 import android.telephony.UiccCardInfo;
+import android.telephony.UiccSlotMapping;
 import android.telephony.euicc.EuiccManager;
 import android.util.Log;
 
 import com.android.settings.SidecarFragment;
 import com.android.settings.network.telephony.EuiccOperationSidecar;
 
+import java.util.Collection;
 import java.util.Comparator;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -94,7 +96,7 @@
 
         // To check whether the esim slot's port is active. If yes, skip setSlotMapping. If no,
         // set this slot+port into setSimSlotMapping.
-        mPort = (port < 0) ? getTargetPortId(removedSubInfo) : port;
+        mPort = (port < 0) ? getTargetPortId(targetSlot, removedSubInfo) : port;
         mRemovedSubInfo = removedSubInfo;
         Log.d(TAG,
                 String.format("set esim into the SubId%d Slot%d:Port%d",
@@ -114,12 +116,24 @@
         }
     }
 
-    private int getTargetPortId(SubscriptionInfo removedSubInfo) {
-        if (!mTelephonyManager.isMultiSimEnabled() || !isMultipleEnabledProfilesSupported()) {
-            // In the 'SS mode' or 'DSDS+no MEP', the port is 0.
+    private int getTargetPortId(int physicalEsimSlotIndex, SubscriptionInfo removedSubInfo) {
+        if (!isMultipleEnabledProfilesSupported()) {
+            Log.d(TAG, "The device is no MEP, port is 0");
             return 0;
         }
 
+        if (!mTelephonyManager.isMultiSimEnabled()) {
+            // In the 'SS mode'
+            // If there is the esim slot is active, the port is from the current esim slot.
+            // If there is no esim slot in device, then the esim's port is 0.
+            Collection<UiccSlotMapping> uiccSlotMappings = mTelephonyManager.getSimSlotMapping();
+            Log.d(TAG, "In SS mode, the UiccSlotMapping: " + uiccSlotMappings);
+            return uiccSlotMappings.stream()
+                    .filter(i -> i.getPhysicalSlotIndex() == physicalEsimSlotIndex)
+                    .mapToInt(i -> i.getPortIndex())
+                    .findFirst().orElse(0);
+        }
+
         // In the 'DSDS+MEP', if the removedSubInfo is esim, then the port is
         // removedSubInfo's port.
         if (removedSubInfo != null && removedSubInfo.isEmbedded()) {
diff --git a/src/com/android/settings/network/UiccSlotUtil.java b/src/com/android/settings/network/UiccSlotUtil.java
index 8fdc370..813b9d6 100644
--- a/src/com/android/settings/network/UiccSlotUtil.java
+++ b/src/com/android/settings/network/UiccSlotUtil.java
@@ -282,6 +282,21 @@
     // 1. pSIM's logical slots always is [RIL 0].
     // 2. assign the new active port to the same stack that will be de-activated
     //    For example: mode#3->mode#4
+    // 3. Add an eSIM carrier or enable eSIM carrier. The cases are at the below.
+    //    1) 1   => 2 / 2.1 / 3 / 3.1
+    //    2) 2   => 1 / 3 / 3.2
+    //    3) 2.1 => 3.1 / 4
+    //    4) 3   => 4
+    //    5) 3.1 => 3.2
+    //    Note:
+    //        1) 2 <=> 2.1  blocked by LPA (reason: existing active port in SS so just re-use)
+    //        2) 3 <=> 3.1 blocked by LPA (reason: if pSIM+an active port, re-use the active port)
+    // 4. pSIM insertion or enabling
+    //     1) 2   => 1 / 3
+    //     2) 2.1 => 1 / 3.1
+    //     3) 3.2 => 3 / 3.1
+    //     4) 4   => 3 / 3.1
+
 
     @VisibleForTesting
     static Collection<UiccSlotMapping> prepareUiccSlotMappings(
diff --git a/src/com/android/settings/network/telephony/DataDuringCallsPreferenceController.java b/src/com/android/settings/network/telephony/DataDuringCallsPreferenceController.java
index 110c582..2bbb1ca 100644
--- a/src/com/android/settings/network/telephony/DataDuringCallsPreferenceController.java
+++ b/src/com/android/settings/network/telephony/DataDuringCallsPreferenceController.java
@@ -33,6 +33,7 @@
 import androidx.preference.SwitchPreference;
 
 import com.android.internal.annotations.VisibleForTesting;
+import com.android.settings.datausage.DataUsageUtils;
 import com.android.settings.network.MobileDataContentObserver;
 import com.android.settings.network.SubscriptionsChangeListener;
 
@@ -102,10 +103,16 @@
         return true;
     }
 
+    @VisibleForTesting
+    protected boolean hasMobileData() {
+        return DataUsageUtils.hasMobileData(mContext);
+    }
+
     @Override
     public int getAvailabilityStatus(int subId) {
         if (!SubscriptionManager.isValidSubscriptionId(subId)
-                || SubscriptionManager.getDefaultDataSubscriptionId() == subId) {
+                || SubscriptionManager.getDefaultDataSubscriptionId() == subId
+                || (!hasMobileData())) {
             return CONDITIONALLY_UNAVAILABLE;
         }
         return AVAILABLE;
diff --git a/src/com/android/settings/network/telephony/DataUsagePreferenceController.java b/src/com/android/settings/network/telephony/DataUsagePreferenceController.java
index 40eb549..a536c1d 100644
--- a/src/com/android/settings/network/telephony/DataUsagePreferenceController.java
+++ b/src/com/android/settings/network/telephony/DataUsagePreferenceController.java
@@ -56,6 +56,7 @@
     @Override
     public int getAvailabilityStatus(int subId) {
         return (SubscriptionManager.isValidSubscriptionId(subId))
+                && DataUsageUtils.hasMobileData(mContext)
                 ? AVAILABLE
                 : AVAILABLE_UNSEARCHABLE;
     }
diff --git a/src/com/android/settings/network/telephony/VideoCallingPreferenceController.java b/src/com/android/settings/network/telephony/VideoCallingPreferenceController.java
index 698f6e1..4064181 100644
--- a/src/com/android/settings/network/telephony/VideoCallingPreferenceController.java
+++ b/src/com/android/settings/network/telephony/VideoCallingPreferenceController.java
@@ -17,6 +17,7 @@
 package com.android.settings.network.telephony;
 
 import android.content.Context;
+import android.content.pm.PackageManager;
 import android.os.PersistableBundle;
 import android.telephony.CarrierConfigManager;
 import android.telephony.SubscriptionManager;
@@ -129,6 +130,12 @@
         return queryImsState(mSubId).isEnabledByUser();
     }
 
+    @VisibleForTesting
+    protected boolean isImsSupported() {
+        return mContext.getPackageManager().hasSystemFeature(
+                PackageManager.FEATURE_TELEPHONY_IMS);
+    }
+
     public VideoCallingPreferenceController init(int subId) {
         mSubId = subId;
 
@@ -154,7 +161,7 @@
             return false;
         }
 
-        return queryImsState(subId).isReadyToVideoCall();
+        return isImsSupported() && queryImsState(subId).isReadyToVideoCall();
     }
 
     @Override
diff --git a/src/com/android/settings/notification/NotificationAccessConfirmationActivity.java b/src/com/android/settings/notification/NotificationAccessConfirmationActivity.java
index a7d9f68..dfe6df2 100644
--- a/src/com/android/settings/notification/NotificationAccessConfirmationActivity.java
+++ b/src/com/android/settings/notification/NotificationAccessConfirmationActivity.java
@@ -20,7 +20,6 @@
 import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
 
 import static com.android.internal.notification.NotificationAccessConfirmationActivityContract.EXTRA_COMPONENT_NAME;
-import static com.android.internal.notification.NotificationAccessConfirmationActivityContract.EXTRA_PACKAGE_TITLE;
 import static com.android.internal.notification.NotificationAccessConfirmationActivityContract.EXTRA_USER_ID;
 
 import android.Manifest;
@@ -30,10 +29,13 @@
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.DialogInterface;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageItemInfo;
 import android.content.pm.PackageManager;
 import android.content.pm.ServiceInfo;
 import android.os.Bundle;
 import android.os.UserHandle;
+import android.text.TextUtils;
 import android.util.Slog;
 import android.view.WindowManager;
 import android.view.accessibility.AccessibilityEvent;
@@ -63,15 +65,38 @@
 
         mComponentName = getIntent().getParcelableExtra(EXTRA_COMPONENT_NAME);
         mUserId = getIntent().getIntExtra(EXTRA_USER_ID, UserHandle.USER_NULL);
-        String pkgTitle = getIntent().getStringExtra(EXTRA_PACKAGE_TITLE);
+        CharSequence mAppLabel;
+
+        if (mComponentName == null || mComponentName.getPackageName() == null) {
+            finish();
+            return;
+        }
+
+        try {
+            ApplicationInfo applicationInfo = getPackageManager().getApplicationInfo(
+                    mComponentName.getPackageName(), 0);
+            mAppLabel = applicationInfo.loadSafeLabel(getPackageManager(),
+                    PackageItemInfo.DEFAULT_MAX_LABEL_SIZE_PX,
+                    PackageItemInfo.SAFE_LABEL_FLAG_TRIM
+                            | PackageItemInfo.SAFE_LABEL_FLAG_FIRST_LINE);
+        } catch (PackageManager.NameNotFoundException e) {
+            Slog.e(LOG_TAG, "Couldn't find app with package name for " + mComponentName, e);
+            finish();
+            return;
+        }
+
+        if (TextUtils.isEmpty(mAppLabel)) {
+            finish();
+            return;
+        }
 
         AlertController.AlertParams p = new AlertController.AlertParams(this);
         p.mTitle = getString(
                 R.string.notification_listener_security_warning_title,
-                pkgTitle);
+                mAppLabel);
         p.mMessage = getString(
                 R.string.notification_listener_security_warning_summary,
-                pkgTitle);
+                mAppLabel);
         p.mPositiveButtonText = getString(R.string.allow);
         p.mPositiveButtonListener = (a, b) -> onAllow();
         p.mNegativeButtonText = getString(R.string.deny);
diff --git a/src/com/android/settings/notification/NotificationBackend.java b/src/com/android/settings/notification/NotificationBackend.java
index 2ae91e2..5215a33 100644
--- a/src/com/android/settings/notification/NotificationBackend.java
+++ b/src/com/android/settings/notification/NotificationBackend.java
@@ -115,40 +115,27 @@
 
     void recordCanBeBlocked(Context context, PackageManager pm, RoleManager rm, PackageInfo app,
             AppRow row) {
-        if (Settings.Secure.getIntForUser(context.getContentResolver(),
-                Settings.Secure.NOTIFICATION_PERMISSION_ENABLED, 0, USER_SYSTEM) != 0) {
-            try {
-                row.systemApp = row.lockedImportance =
-                        sINM.isPermissionFixed(app.packageName, row.userId);
-            } catch (RemoteException e) {
-                Log.w(TAG, "Error calling NMS", e);
-            }
-            // The permission system cannot make role permissions 'fixed', so check for these
-            // roles explicitly
-            List<String> roles = rm.getHeldRolesFromController(app.packageName);
-            if (roles.contains(RoleManager.ROLE_DIALER)
-                    || roles.contains(RoleManager.ROLE_EMERGENCY)) {
-                row.systemApp = row.lockedImportance = true;
-            }
-            // if the app targets T but has not requested the permission, we cannot change the
-            // permission state
-            if (app.applicationInfo.targetSdkVersion > Build.VERSION_CODES.S_V2) {
-                if (app.requestedPermissions == null || Arrays.stream(app.requestedPermissions)
-                        .noneMatch(p -> p.equals(android.Manifest.permission.POST_NOTIFICATIONS))) {
-                    row.lockedImportance = true;
-                }
-            }
 
-        } else {
-            row.systemApp = Utils.isSystemPackage(context.getResources(), pm, app);
-            List<String> roles = rm.getHeldRolesFromController(app.packageName);
-            if (roles.contains(RoleManager.ROLE_DIALER)
-                    || roles.contains(RoleManager.ROLE_EMERGENCY)) {
-                row.systemApp = true;
+        try {
+            row.systemApp = row.lockedImportance =
+                    sINM.isPermissionFixed(app.packageName, row.userId);
+        } catch (RemoteException e) {
+            Log.w(TAG, "Error calling NMS", e);
+        }
+        // The permission system cannot make role permissions 'fixed', so check for these
+        // roles explicitly
+        List<String> roles = rm.getHeldRolesFromController(app.packageName);
+        if (roles.contains(RoleManager.ROLE_DIALER)
+                || roles.contains(RoleManager.ROLE_EMERGENCY)) {
+            row.systemApp = row.lockedImportance = true;
+        }
+        // if the app targets T but has not requested the permission, we cannot change the
+        // permission state
+        if (app.applicationInfo.targetSdkVersion > Build.VERSION_CODES.S_V2) {
+            if (app.requestedPermissions == null || Arrays.stream(app.requestedPermissions)
+                    .noneMatch(p -> p.equals(android.Manifest.permission.POST_NOTIFICATIONS))) {
+                row.lockedImportance = true;
             }
-            final String[] nonBlockablePkgs = context.getResources().getStringArray(
-                    com.android.internal.R.array.config_nonBlockableNotificationPackages);
-            markAppRowWithBlockables(nonBlockablePkgs, row, app.packageName);
         }
     }
 
diff --git a/src/com/android/settings/notification/SpatialAudioParentPreferenceController.java b/src/com/android/settings/notification/SpatialAudioParentPreferenceController.java
index c9eaa65..8ae0493 100644
--- a/src/com/android/settings/notification/SpatialAudioParentPreferenceController.java
+++ b/src/com/android/settings/notification/SpatialAudioParentPreferenceController.java
@@ -57,7 +57,7 @@
     @Override
     public CharSequence getSummary() {
         boolean speakerOn = mSpatialAudioPreferenceController.isAvailable()
-                && mSpatialAudioWiredHeadphonesController.isChecked();
+                && mSpatialAudioPreferenceController.isChecked();
         boolean wiredHeadphonesOn = mSpatialAudioWiredHeadphonesController.isAvailable()
                 && mSpatialAudioWiredHeadphonesController.isChecked();
         if (speakerOn && wiredHeadphonesOn) {
diff --git a/src/com/android/settings/notification/app/NotificationPreferenceController.java b/src/com/android/settings/notification/app/NotificationPreferenceController.java
index 289f1ed..9d339f0 100644
--- a/src/com/android/settings/notification/app/NotificationPreferenceController.java
+++ b/src/com/android/settings/notification/app/NotificationPreferenceController.java
@@ -64,7 +64,6 @@
     @Nullable
     protected ShortcutInfo mConversationInfo;
     protected List<String> mPreferenceFilter;
-    boolean mMigratedPermission;
 
     boolean overrideCanBlock;
     boolean overrideCanConfigure;
@@ -78,8 +77,6 @@
         mBackend = backend;
         mUm = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
         mPm = mContext.getPackageManager();
-        mMigratedPermission = Settings.Secure.getIntForUser(context.getContentResolver(),
-                Settings.Secure.NOTIFICATION_PERMISSION_ENABLED, 0, USER_SYSTEM) != 0;
     }
 
     /**
@@ -155,9 +152,7 @@
             return overrideCanConfigureValue;
         }
         if (channel != null && mAppRow != null) {
-            boolean locked = mMigratedPermission ? mAppRow.lockedImportance
-                    : channel.isImportanceLockedByCriticalDeviceFunction()
-                            || channel.isImportanceLockedByOEM();
+            boolean locked = mAppRow.lockedImportance;
             if (locked) {
                 return channel.isBlockable() || channel.getImportance() == IMPORTANCE_NONE;
             }
@@ -186,8 +181,7 @@
             return overrideCanConfigureValue;
         }
         if (channel != null && mAppRow != null) {
-            boolean locked = mMigratedPermission ? mAppRow.lockedImportance
-                    : channel.isImportanceLockedByOEM();
+            boolean locked = mAppRow.lockedImportance;
             return !locked || channel.isBlockable();
         }
         return false;
diff --git a/src/com/android/settings/notification/zen/ZenModeAutomaticRulesPreferenceController.java b/src/com/android/settings/notification/zen/ZenModeAutomaticRulesPreferenceController.java
index c6d735c..ee6e828 100644
--- a/src/com/android/settings/notification/zen/ZenModeAutomaticRulesPreferenceController.java
+++ b/src/com/android/settings/notification/zen/ZenModeAutomaticRulesPreferenceController.java
@@ -18,6 +18,7 @@
 
 import android.app.AutomaticZenRule;
 import android.content.Context;
+import android.util.ArrayMap;
 
 import androidx.annotation.VisibleForTesting;
 import androidx.fragment.app.Fragment;
@@ -28,7 +29,6 @@
 import com.android.settingslib.core.lifecycle.Lifecycle;
 
 import java.util.Map;
-import java.util.Objects;
 
 public class ZenModeAutomaticRulesPreferenceController extends
         AbstractZenModeAutomaticRulePreferenceController {
@@ -38,6 +38,10 @@
     @VisibleForTesting
     protected PreferenceCategory mPreferenceCategory;
 
+    // Map of rule key -> preference so that we can update each preference as needed
+    @VisibleForTesting
+    protected Map<String, ZenRulePreference> mZenRulePreferences = new ArrayMap<>();
+
     public ZenModeAutomaticRulesPreferenceController(Context context, Fragment parent, Lifecycle
             lifecycle) {
         super(context, KEY, parent, lifecycle);
@@ -58,38 +62,73 @@
         super.displayPreference(screen);
         mPreferenceCategory = screen.findPreference(getPreferenceKey());
         mPreferenceCategory.setPersistent(false);
+
+        // if mPreferenceCategory was un-set, make sure to clear out mZenRulePreferences too, just
+        // in case
+        if (mPreferenceCategory.getPreferenceCount() == 0) {
+            mZenRulePreferences.clear();
+        }
     }
 
     @Override
     public void updateState(Preference preference) {
         super.updateState(preference);
         Map.Entry<String, AutomaticZenRule>[] sortedRules = getRules();
-        final int currNumPreferences = mPreferenceCategory.getPreferenceCount();
-        if (currNumPreferences == sortedRules.length) {
+
+        // refresh the whole preference category list if the total number of rules has changed, or
+        // if any individual rules have changed, so we can rebuild the list & keep things in sync
+        boolean refreshPrefs = false;
+        if (mPreferenceCategory.getPreferenceCount() != sortedRules.length) {
+            refreshPrefs = true;
+        } else {
+            // check whether any rules in sortedRules are not in mZenRulePreferences; that should
+            // be enough to see whether something has changed
             for (int i = 0; i < sortedRules.length; i++) {
-                ZenRulePreference pref = (ZenRulePreference) mPreferenceCategory.getPreference(i);
-                // we are either:
-                // 1. updating everything about the rule
-                // 2. rule was added or deleted, so reload the entire list
-                if (Objects.equals(pref.mId, sortedRules[i].getKey())) {
-                    AutomaticZenRule rule = sortedRules[i].getValue();
-                    pref.updatePreference(rule);
-                } else {
-                    reloadAllRules(sortedRules);
+                if (!mZenRulePreferences.containsKey(sortedRules[i].getKey())) {
+                    refreshPrefs = true;
                     break;
                 }
             }
-        } else {
-            reloadAllRules(sortedRules);
         }
-    }
 
-    @VisibleForTesting
-    void reloadAllRules(Map.Entry<String, AutomaticZenRule>[] rules) {
-        mPreferenceCategory.removeAll();
-        for (Map.Entry<String, AutomaticZenRule> rule : rules) {
-            ZenRulePreference pref = createZenRulePreference(rule);
-            mPreferenceCategory.addPreference(pref);
+        // if we need to refresh the whole list, clear the preference category and also start a
+        // new map of preferences according to the preference category contents
+        // we need to not update the existing one yet, as we'll need to know what preferences
+        // previously existed in order to update and re-attach them to the preference category
+        Map<String, ZenRulePreference> newPrefs = new ArrayMap<>();
+        if (refreshPrefs) {
+            mPreferenceCategory.removeAll();
+        }
+
+        // Loop through each rule, either updating the existing rule or creating the rule's
+        // preference if needed (and, in the case where we need to rebuild the preference category
+        // list, do so as well)
+        for (int i = 0; i < sortedRules.length; i++) {
+            String key = sortedRules[i].getKey();
+            if (mZenRulePreferences.containsKey(key)) {
+                // existing rule; update its info if it's changed since the last display
+                AutomaticZenRule rule = sortedRules[i].getValue();
+                ZenRulePreference pref = mZenRulePreferences.get(key);
+                pref.updatePreference(rule);
+
+                // only add to preference category if the overall set of rules has changed so this
+                // needs to be rearranged
+                if (refreshPrefs) {
+                    mPreferenceCategory.addPreference(pref);
+                    newPrefs.put(key, pref);
+                }
+            } else {
+                // new rule; create a new ZenRulePreference & add it to the preference category
+                // and the map so we'll know about it later
+                ZenRulePreference pref = createZenRulePreference(sortedRules[i]);
+                mPreferenceCategory.addPreference(pref);
+                newPrefs.put(key, pref);
+            }
+        }
+
+        // If anything was new, then make sure we overwrite mZenRulePreferences with our new data
+        if (refreshPrefs) {
+            mZenRulePreferences = newPrefs;
         }
     }
 
diff --git a/src/com/android/settings/password/ChooseLockGeneric.java b/src/com/android/settings/password/ChooseLockGeneric.java
index e2b91c7..d3988fa 100644
--- a/src/com/android/settings/password/ChooseLockGeneric.java
+++ b/src/com/android/settings/password/ChooseLockGeneric.java
@@ -23,6 +23,7 @@
 import static android.app.admin.DevicePolicyManager.PASSWORD_COMPLEXITY_MEDIUM;
 import static android.app.admin.DevicePolicyManager.PASSWORD_COMPLEXITY_NONE;
 import static android.app.admin.DevicePolicyResources.Strings.Settings.LOCK_SETTINGS_NEW_PROFILE_LOCK_TITLE;
+import static android.app.admin.DevicePolicyResources.Strings.Settings.LOCK_SETTINGS_UPDATE_PROFILE_LOCK_TITLE;
 import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_IT_ADMIN_CANT_RESET_SCREEN_LOCK;
 import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_SCREEN_LOCK_SETUP_MESSAGE;
 
@@ -347,7 +348,10 @@
                 // it's an update.
                 updateExistingLock = mLockPatternUtils.isSeparateProfileChallengeEnabled(mUserId);
                 if (updateExistingLock) {
-                    getActivity().setTitle(R.string.lock_settings_picker_update_profile_lock_title);
+                    getActivity().setTitle(mDpm.getResources().getString(
+                            LOCK_SETTINGS_UPDATE_PROFILE_LOCK_TITLE,
+                            () -> getString(
+                                    R.string.lock_settings_picker_update_profile_lock_title)));
                 } else {
                     getActivity().setTitle(mDpm.getResources().getString(
                             LOCK_SETTINGS_NEW_PROFILE_LOCK_TITLE,
diff --git a/src/com/android/settings/password/ChooseLockPassword.java b/src/com/android/settings/password/ChooseLockPassword.java
index 7b0955e..199d584 100644
--- a/src/com/android/settings/password/ChooseLockPassword.java
+++ b/src/com/android/settings/password/ChooseLockPassword.java
@@ -39,6 +39,7 @@
 import static com.android.internal.widget.PasswordValidationError.RECENTLY_USED;
 import static com.android.internal.widget.PasswordValidationError.TOO_LONG;
 import static com.android.internal.widget.PasswordValidationError.TOO_SHORT;
+import static com.android.internal.widget.PasswordValidationError.TOO_SHORT_WHEN_ALL_NUMERIC;
 import static com.android.settings.password.ChooseLockSettingsHelper.EXTRA_KEY_UNIFICATION_PROFILE_CREDENTIAL;
 import static com.android.settings.password.ChooseLockSettingsHelper.EXTRA_KEY_UNIFICATION_PROFILE_ID;
 
@@ -91,6 +92,7 @@
 import com.android.settings.Utils;
 import com.android.settings.core.InstrumentedFragment;
 import com.android.settings.notification.RedactionInterstitial;
+import com.android.settingslib.utils.StringUtil;
 
 import com.google.android.setupcompat.template.FooterBarMixin;
 import com.google.android.setupcompat.template.FooterButton;
@@ -834,6 +836,11 @@
                                         : R.plurals.lockpassword_pin_too_short,
                                 error.requirement, error.requirement));
                         break;
+                    case TOO_SHORT_WHEN_ALL_NUMERIC:
+                        messages.add(
+                                StringUtil.getIcuPluralsString(getContext(), error.requirement,
+                                        R.string.lockpassword_password_too_short_all_numeric));
+                        break;
                     case TOO_LONG:
                         messages.add(getResources().getQuantityString(
                                 mIsAlphaMode
diff --git a/src/com/android/settings/wifi/details2/WifiMeteredPreferenceController2.java b/src/com/android/settings/wifi/details2/WifiMeteredPreferenceController2.java
index 52645aa..85dc2e4 100644
--- a/src/com/android/settings/wifi/details2/WifiMeteredPreferenceController2.java
+++ b/src/com/android/settings/wifi/details2/WifiMeteredPreferenceController2.java
@@ -21,7 +21,7 @@
 import android.net.wifi.WifiConfiguration;
 
 import androidx.annotation.VisibleForTesting;
-import androidx.preference.DropDownPreference;
+import androidx.preference.ListPreference;
 import androidx.preference.Preference;
 import androidx.preference.PreferenceScreen;
 
@@ -30,13 +30,13 @@
 import com.android.wifitrackerlib.WifiEntry;
 
 /**
- * {@link AbstractPreferenceController} that controls whether the wifi network is metered or not
+ * A controller that controls whether the Wi-Fi network is metered or not.
  */
 public class WifiMeteredPreferenceController2 extends BasePreferenceController implements
         Preference.OnPreferenceChangeListener, WifiDialog2.WifiDialog2Listener {
 
     private static final String KEY_WIFI_METERED = "metered";
-    private WifiEntry mWifiEntry;
+    private final WifiEntry mWifiEntry;
     private Preference mPreference;
 
     public WifiMeteredPreferenceController2(Context context, WifiEntry wifiEntry) {
@@ -46,11 +46,11 @@
 
     @Override
     public void updateState(Preference preference) {
-        final DropDownPreference dropDownPreference = (DropDownPreference) preference;
+        final ListPreference listPreference = (ListPreference) preference;
         final int meteredOverride = getMeteredOverride();
         preference.setSelectable(mWifiEntry.canSetMeteredChoice());
-        dropDownPreference.setValue(Integer.toString(meteredOverride));
-        updateSummary(dropDownPreference, meteredOverride);
+        listPreference.setValue(Integer.toString(meteredOverride));
+        updateSummary(listPreference, meteredOverride);
     }
 
     @Override
@@ -66,7 +66,7 @@
 
         // Stage the backup of the SettingsProvider package which backs this up
         BackupManager.dataChanged("com.android.providers.settings");
-        updateSummary((DropDownPreference) preference, getMeteredOverride());
+        updateSummary((ListPreference) preference, getMeteredOverride());
         return true;
     }
 
@@ -79,7 +79,7 @@
         return WifiEntry.METERED_CHOICE_AUTO;
     }
 
-    private void updateSummary(DropDownPreference preference, int meteredOverride) {
+    private void updateSummary(ListPreference preference, int meteredOverride) {
         preference.setSummary(preference.getEntries()[meteredOverride]);
     }
 
diff --git a/src/com/android/settings/wifi/details2/WifiPrivacyPreferenceController2.java b/src/com/android/settings/wifi/details2/WifiPrivacyPreferenceController2.java
index c484922..632a562 100644
--- a/src/com/android/settings/wifi/details2/WifiPrivacyPreferenceController2.java
+++ b/src/com/android/settings/wifi/details2/WifiPrivacyPreferenceController2.java
@@ -21,7 +21,7 @@
 import android.net.wifi.WifiManager;
 
 import androidx.annotation.VisibleForTesting;
-import androidx.preference.DropDownPreference;
+import androidx.preference.ListPreference;
 import androidx.preference.Preference;
 import androidx.preference.PreferenceScreen;
 
@@ -31,14 +31,13 @@
 import com.android.wifitrackerlib.WifiEntry;
 
 /**
- * {@link AbstractPreferenceController} that controls whether the wifi network is mac randomized
- * or not
+ * A controller that controls whether the Wi-Fi network is mac randomized or not.
  */
 public class WifiPrivacyPreferenceController2 extends BasePreferenceController implements
         Preference.OnPreferenceChangeListener, WifiDialog2.WifiDialog2Listener {
 
     private static final String KEY_WIFI_PRIVACY = "privacy";
-    private WifiManager mWifiManager;
+    private final WifiManager mWifiManager;
     private WifiEntry mWifiEntry;
     private Preference mPreference;
 
@@ -66,16 +65,16 @@
 
     @Override
     public void updateState(Preference preference) {
-        final DropDownPreference dropDownPreference = (DropDownPreference) preference;
+        final ListPreference listPreference = (ListPreference) preference;
         final int randomizationLevel = getRandomizationValue();
         final boolean isSelectable = mWifiEntry.canSetPrivacy();
         preference.setSelectable(isSelectable);
-        dropDownPreference.setValue(Integer.toString(randomizationLevel));
-        updateSummary(dropDownPreference, randomizationLevel);
+        listPreference.setValue(Integer.toString(randomizationLevel));
+        updateSummary(listPreference, randomizationLevel);
 
         // If the preference cannot be selectable, display a temporary network in the summary.
         if (!isSelectable) {
-            dropDownPreference.setSummary(R.string.wifi_privacy_settings_ephemeral_summary);
+            listPreference.setSummary(R.string.wifi_privacy_settings_ephemeral_summary);
         }
     }
 
@@ -90,7 +89,7 @@
             mWifiEntry.disconnect(null /* callback */);
             mWifiEntry.connect(null /* callback */);
         }
-        updateSummary((DropDownPreference) preference, privacy);
+        updateSummary((ListPreference) preference, privacy);
         return true;
     }
 
@@ -124,7 +123,7 @@
             ? WifiEntry.PRIVACY_RANDOMIZED_MAC : WifiEntry.PRIVACY_DEVICE_MAC;
     }
 
-    private void updateSummary(DropDownPreference preference, int macRandomized) {
+    private void updateSummary(ListPreference preference, int macRandomized) {
         // Translates value here to set RANDOMIZATION_PERSISTENT as first item in UI for better UX.
         final int prefMacRandomized = translateMacRandomizedValueToPrefValue(macRandomized);
         preference.setSummary(preference.getEntries()[prefMacRandomized]);
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/AppBatteryPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/AppBatteryPreferenceControllerTest.java
index bcca0f2..03b3a47 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/AppBatteryPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/AppBatteryPreferenceControllerTest.java
@@ -28,6 +28,7 @@
 
 import android.app.AppOpsManager;
 import android.content.Context;
+import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageManager;
 import android.content.pm.PackageManager.NameNotFoundException;
 import android.os.BatteryUsageStats;
@@ -41,6 +42,7 @@
 import com.android.settings.SettingsActivity;
 import com.android.settings.fuelgauge.BatteryDiffEntry;
 import com.android.settings.fuelgauge.BatteryUtils;
+import com.android.settingslib.applications.ApplicationsState;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -177,6 +179,26 @@
     }
 
     @Test
+    public void displayPreference_noEntry_preferenceShouldSetEmptySummary() {
+        mController.mParent.setAppEntry(null);
+
+        mController.displayPreference(mScreen);
+
+        assertThat(mBatteryPreference.getSummary()).isEqualTo("");
+    }
+
+    @Test
+    public void displayPreference_appIsNotInstalled_preferenceShouldSetEmptySummary() {
+        final ApplicationsState.AppEntry appEntry = mock(ApplicationsState.AppEntry.class);
+        appEntry.info = new ApplicationInfo();
+        mController.mParent.setAppEntry(appEntry);
+
+        mController.displayPreference(mScreen);
+
+        assertThat(mBatteryPreference.getSummary()).isEqualTo("");
+    }
+
+    @Test
     public void isBatteryStatsAvailable_hasBatteryStatsHelperAndSipper_returnTrue() {
         mController.mBatteryUsageStats = mBatteryUsageStats;
         mController.mUidBatteryConsumer = mUidBatteryConsumer;
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/AppDataUsagePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/AppDataUsagePreferenceControllerTest.java
index 472bf22..aa7d6bc 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/AppDataUsagePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/AppDataUsagePreferenceControllerTest.java
@@ -34,6 +34,7 @@
 
 import androidx.loader.app.LoaderManager;
 import androidx.preference.Preference;
+import androidx.preference.PreferenceScreen;
 
 import com.android.settings.core.BasePreferenceController;
 import com.android.settings.datausage.AppDataUsage;
@@ -54,6 +55,8 @@
     private LoaderManager mLoaderManager;
     @Mock
     private AppInfoDashboardFragment mFragment;
+    @Mock
+    private PreferenceScreen mScreen;
 
     private Context mContext;
     private AppDataUsagePreferenceController mController;
@@ -71,7 +74,7 @@
         doReturn(true).when(mController).isBandwidthControlEnabled();
 
         assertThat(mController.getAvailabilityStatus())
-            .isEqualTo(BasePreferenceController.AVAILABLE);
+                .isEqualTo(BasePreferenceController.AVAILABLE);
     }
 
     @Test
@@ -79,13 +82,14 @@
         doReturn(false).when(mController).isBandwidthControlEnabled();
 
         assertThat(mController.getAvailabilityStatus())
-            .isEqualTo(BasePreferenceController.CONDITIONALLY_UNAVAILABLE);
+                .isEqualTo(BasePreferenceController.CONDITIONALLY_UNAVAILABLE);
     }
 
     @Test
     public void onResume_notAvailable_shouldNotRestartDataLoader() {
         doReturn(mLoaderManager).when(mFragment).getLoaderManager();
-        doReturn(BasePreferenceController.CONDITIONALLY_UNAVAILABLE).when(mController).getAvailabilityStatus();
+        doReturn(BasePreferenceController.CONDITIONALLY_UNAVAILABLE).when(
+                mController).getAvailabilityStatus();
 
         mController.onResume();
 
@@ -130,4 +134,45 @@
 
         verify(preference).setSummary(any());
     }
+
+    @Test
+    public void displayPreference_noEntry_preferenceShouldNotEnable() {
+        mController.mAppEntry = null;
+        Preference preference = new Preference(mContext);
+        when(mScreen.findPreference(any())).thenReturn(preference);
+        doReturn(true).when(mController).isBandwidthControlEnabled();
+
+        mController.displayPreference(mScreen);
+
+        assertThat(preference.isEnabled()).isFalse();
+    }
+
+    @Test
+    public void displayPreference_appIsInstalled_preferenceShouldEnable() {
+        final AppEntry appEntry = mock(AppEntry.class);
+        appEntry.info = new ApplicationInfo();
+        appEntry.info.flags = ApplicationInfo.FLAG_INSTALLED;
+        mController.mAppEntry = appEntry;
+        Preference preference = new Preference(mContext);
+        when(mScreen.findPreference(any())).thenReturn(preference);
+        doReturn(true).when(mController).isBandwidthControlEnabled();
+
+        mController.displayPreference(mScreen);
+
+        assertThat(preference.isEnabled()).isTrue();
+    }
+
+    @Test
+    public void displayPreference_appIsNotInstalled_preferenceShouldDisable() {
+        final AppEntry appEntry = mock(AppEntry.class);
+        appEntry.info = new ApplicationInfo();
+        mController.mAppEntry = appEntry;
+        Preference preference = new Preference(mContext);
+        when(mScreen.findPreference(any())).thenReturn(preference);
+        doReturn(true).when(mController).isBandwidthControlEnabled();
+
+        mController.displayPreference(mScreen);
+
+        assertThat(preference.isEnabled()).isFalse();
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/AppStoragePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/AppStoragePreferenceControllerTest.java
index 065544b..27e5db7 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/AppStoragePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/AppStoragePreferenceControllerTest.java
@@ -21,7 +21,6 @@
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
@@ -32,6 +31,7 @@
 
 import androidx.loader.app.LoaderManager;
 import androidx.preference.Preference;
+import androidx.preference.PreferenceScreen;
 
 import com.android.settings.applications.AppStorageSettings;
 import com.android.settingslib.applications.ApplicationsState.AppEntry;
@@ -52,6 +52,8 @@
     private LoaderManager mLoaderManager;
     @Mock
     private AppInfoDashboardFragment mFragment;
+    @Mock
+    private PreferenceScreen mScreen;
 
     private Context mContext;
     private AppStoragePreferenceController mController;
@@ -89,10 +91,48 @@
     }
 
     @Test
-    public void updateState_shouldUpdatePreferenceSummary() {
+    public void displayPreference_noEntry_preferenceShouldNotEnable() {
+        mController.mAppEntry = null;
+        Preference preference = new Preference(mContext);
+        when(mScreen.findPreference(any())).thenReturn(preference);
+
+        mController.displayPreference(mScreen);
+
+        assertThat(preference.isEnabled()).isFalse();
+    }
+
+    @Test
+    public void displayPreference_appIsInstalled_preferenceShouldEnable() {
         final AppEntry appEntry = mock(AppEntry.class);
         appEntry.info = new ApplicationInfo();
-        when(mFragment.getAppEntry()).thenReturn(appEntry);
+        appEntry.info.flags = ApplicationInfo.FLAG_INSTALLED;
+        mController.mAppEntry = appEntry;
+        Preference preference = new Preference(mContext);
+        when(mScreen.findPreference(any())).thenReturn(preference);
+
+        mController.displayPreference(mScreen);
+
+        assertThat(preference.isEnabled()).isTrue();
+    }
+
+    @Test
+    public void displayPreference_appIsNotInstalled_preferenceShouldDisable() {
+        final AppEntry appEntry = mock(AppEntry.class);
+        appEntry.info = new ApplicationInfo();
+        mController.mAppEntry = appEntry;
+        Preference preference = new Preference(mContext);
+        when(mScreen.findPreference(any())).thenReturn(preference);
+
+        mController.displayPreference(mScreen);
+
+        assertThat(preference.isEnabled()).isFalse();
+    }
+
+    @Test
+    public void updateState_hasAppEntry_shouldUpdatePreferenceSummary() {
+        final AppEntry appEntry = mock(AppEntry.class);
+        appEntry.info = new ApplicationInfo();
+        mController.mAppEntry = appEntry;
         Preference preference = mock(Preference.class);
 
         mController.updateState(preference);
@@ -102,12 +142,12 @@
 
     @Test
     public void updateState_entryIsNull_shouldNotUpdatePreferenceSummary() {
-        when(mFragment.getAppEntry()).thenReturn(null);
-        Preference preference = mock(Preference.class);
+        mController.mAppEntry = null;
+        Preference preference = new Preference(mContext);
 
         mController.updateState(preference);
 
-        verify(preference, never()).setSummary(any());
+        assertThat(preference.getSummary()).isEqualTo("");
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/TimeSpentInAppPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/TimeSpentInAppPreferenceControllerTest.java
index 7750256..0f3e746 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/TimeSpentInAppPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/TimeSpentInAppPreferenceControllerTest.java
@@ -20,7 +20,9 @@
 
 import static com.google.common.truth.Truth.assertThat;
 
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.nullable;
+import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
@@ -35,6 +37,7 @@
 
 import com.android.settings.core.BasePreferenceController;
 import com.android.settings.testutils.FakeFeatureFactory;
+import com.android.settingslib.applications.ApplicationsState;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -125,4 +128,42 @@
         verify(mFeatureFactory.applicationFeatureProvider).getTimeSpentInApp(
                 nullable(String.class));
     }
+
+    @Test
+    public void displayPreference_noEntry_preferenceShouldNotEnable() {
+        mController.mAppEntry = null;
+        Preference preference = new Preference(mContext);
+        when(mScreen.findPreference(any())).thenReturn(preference);
+
+        mController.displayPreference(mScreen);
+
+        assertThat(preference.isEnabled()).isFalse();
+    }
+
+    @Test
+    public void displayPreference_appIsInstalled_preferenceShouldEnable() {
+        final ApplicationsState.AppEntry appEntry = mock(ApplicationsState.AppEntry.class);
+        appEntry.info = new ApplicationInfo();
+        appEntry.info.flags = ApplicationInfo.FLAG_INSTALLED;
+        mController.mAppEntry = appEntry;
+        Preference preference = new Preference(mContext);
+        when(mScreen.findPreference(any())).thenReturn(preference);
+
+        mController.displayPreference(mScreen);
+
+        assertThat(preference.isEnabled()).isTrue();
+    }
+
+    @Test
+    public void displayPreference_appIsNotInstalled_preferenceShouldDisable() {
+        final ApplicationsState.AppEntry appEntry = mock(ApplicationsState.AppEntry.class);
+        appEntry.info = new ApplicationInfo();
+        mController.mAppEntry = appEntry;
+        Preference preference = new Preference(mContext);
+        when(mScreen.findPreference(any())).thenReturn(preference);
+
+        mController.displayPreference(mScreen);
+
+        assertThat(preference.isEnabled()).isFalse();
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/dashboard/DashboardFeatureProviderImplTest.java b/tests/robotests/src/com/android/settings/dashboard/DashboardFeatureProviderImplTest.java
index e7c99c8..f2b0acd 100644
--- a/tests/robotests/src/com/android/settings/dashboard/DashboardFeatureProviderImplTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/DashboardFeatureProviderImplTest.java
@@ -308,8 +308,12 @@
                 mActivity, mFragment, mForceRoundedIcon, preference, tile, null /* key */,
                 Preference.DEFAULT_ORDER);
 
-        assertThat(preference.getSummary()).isEqualTo(ShadowTileUtils.MOCK_SUMMARY);
         assertThat(observers.get(0).getUri().toString()).isEqualTo(uriString);
+        assertThat(preference.getSummary()).isNotEqualTo(ShadowTileUtils.MOCK_TEXT);
+
+        observers.get(0).updateUi();
+
+        assertThat(preference.getSummary()).isEqualTo(ShadowTileUtils.MOCK_TEXT);
     }
 
     @Test
@@ -324,8 +328,12 @@
                 mActivity, mFragment, mForceRoundedIcon, preference, tile, null /* key */,
                 Preference.DEFAULT_ORDER);
 
-        assertThat(preference.getTitle()).isEqualTo(ShadowTileUtils.MOCK_SUMMARY);
         assertThat(observers.get(0).getUri().toString()).isEqualTo(uriString);
+        assertThat(preference.getTitle()).isNotEqualTo(ShadowTileUtils.MOCK_TEXT);
+
+        observers.get(0).updateUi();
+
+        assertThat(preference.getTitle()).isEqualTo(ShadowTileUtils.MOCK_TEXT);
     }
 
     @Test
@@ -379,6 +387,7 @@
         final List<DynamicDataObserver> observers = mImpl.bindPreferenceToTileAndGetObservers(
                 mActivity, mFragment, mForceRoundedIcon, preference, tile, null /* key */,
                 Preference.DEFAULT_ORDER);
+        observers.get(0).updateUi();
 
         ShadowTileUtils.setProviderChecked(false);
         observers.get(0).onDataChanged();
diff --git a/tests/robotests/src/com/android/settings/datausage/AppDataUsageTest.java b/tests/robotests/src/com/android/settings/datausage/AppDataUsageTest.java
index f043ec7..14431ee 100644
--- a/tests/robotests/src/com/android/settings/datausage/AppDataUsageTest.java
+++ b/tests/robotests/src/com/android/settings/datausage/AppDataUsageTest.java
@@ -302,6 +302,7 @@
         final Context context = RuntimeEnvironment.application;
         final int testUid = 123123;
         final AppItem appItem = new AppItem(testUid);
+        appItem.addUid(testUid);
         appItem.category = AppItem.CATEGORY_APP;
         ReflectionHelpers.setField(mFragment, "mContext", context);
         ReflectionHelpers.setField(mFragment, "mAppItem", appItem);
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetailTest.java b/tests/robotests/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetailTest.java
index aaa1487..269c810 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetailTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetailTest.java
@@ -43,6 +43,7 @@
 import android.graphics.drawable.Drawable;
 import android.os.BatteryStats;
 import android.os.Bundle;
+import android.os.Process;
 import android.os.UserHandle;
 import android.util.Pair;
 
@@ -548,6 +549,7 @@
         bundle.putLong(AdvancedPowerUsageDetail.EXTRA_BACKGROUND_TIME, backgroundTimeFourMinute);
         bundle.putLong(AdvancedPowerUsageDetail.EXTRA_FOREGROUND_TIME, foregroundTimeTwoMinutes);
         when(mFragment.getArguments()).thenReturn(bundle);
+
         mFragment.initHeader();
 
         ArgumentCaptor<CharSequence> captor = ArgumentCaptor.forClass(CharSequence.class);
@@ -560,7 +562,7 @@
     public void testInitHeader_totalUsageLessThanAMinWithSlotTime_hasCorrectSummary() {
         final long backgroundTimeLessThanHalfMinute = 20000;
         final long foregroundTimeLessThanHalfMinute = 20000;
-        Bundle bundle = new Bundle(2);
+        Bundle bundle = new Bundle(3);
         bundle.putLong(
                 AdvancedPowerUsageDetail.EXTRA_BACKGROUND_TIME, backgroundTimeLessThanHalfMinute);
         bundle.putLong(
@@ -580,7 +582,7 @@
     public void testInitHeader_TotalAMinBackgroundLessThanAMinWithSlotTime_hasCorrectSummary() {
         final long backgroundTimeZero = 59999;
         final long foregroundTimeTwoMinutes = 1;
-        Bundle bundle = new Bundle(2);
+        Bundle bundle = new Bundle(3);
         bundle.putLong(AdvancedPowerUsageDetail.EXTRA_BACKGROUND_TIME, backgroundTimeZero);
         bundle.putLong(AdvancedPowerUsageDetail.EXTRA_FOREGROUND_TIME, foregroundTimeTwoMinutes);
         bundle.putString(AdvancedPowerUsageDetail.EXTRA_SLOT_TIME, SLOT_TIME);
@@ -598,7 +600,7 @@
     public void testInitHeader_TotalAMinBackgroundZeroWithSlotTime_hasCorrectSummary() {
         final long backgroundTimeZero = 0;
         final long foregroundTimeAMinutes = 60000;
-        Bundle bundle = new Bundle(2);
+        Bundle bundle = new Bundle(3);
         bundle.putLong(AdvancedPowerUsageDetail.EXTRA_BACKGROUND_TIME, backgroundTimeZero);
         bundle.putLong(AdvancedPowerUsageDetail.EXTRA_FOREGROUND_TIME, foregroundTimeAMinutes);
         bundle.putString(AdvancedPowerUsageDetail.EXTRA_SLOT_TIME, SLOT_TIME);
@@ -616,11 +618,12 @@
     public void testInitHeader_foregroundTwoMinBackgroundFourMinWithSlotTime_hasCorrectSummary() {
         final long backgroundTimeFourMinute = 240000;
         final long foregroundTimeTwoMinutes = 120000;
-        Bundle bundle = new Bundle(2);
+        Bundle bundle = new Bundle(3);
         bundle.putLong(AdvancedPowerUsageDetail.EXTRA_BACKGROUND_TIME, backgroundTimeFourMinute);
         bundle.putLong(AdvancedPowerUsageDetail.EXTRA_FOREGROUND_TIME, foregroundTimeTwoMinutes);
         bundle.putString(AdvancedPowerUsageDetail.EXTRA_SLOT_TIME, SLOT_TIME);
         when(mFragment.getArguments()).thenReturn(bundle);
+
         mFragment.initHeader();
 
         ArgumentCaptor<CharSequence> captor = ArgumentCaptor.forClass(CharSequence.class);
@@ -630,6 +633,38 @@
     }
 
     @Test
+    public void testInitHeader_systemUidWithChartIsDisabled_nullSummary() {
+        Bundle bundle = new Bundle(3);
+        bundle.putLong(AdvancedPowerUsageDetail.EXTRA_BACKGROUND_TIME, 240000);
+        bundle.putLong(AdvancedPowerUsageDetail.EXTRA_FOREGROUND_TIME, 120000);
+        bundle.putInt(AdvancedPowerUsageDetail.EXTRA_UID, Process.SYSTEM_UID);
+        when(mFragment.getArguments()).thenReturn(bundle);
+        when(mFeatureFactory.powerUsageFeatureProvider.isChartGraphEnabled(mContext))
+                .thenReturn(false);
+
+        mFragment.initHeader();
+
+        ArgumentCaptor<CharSequence> captor = ArgumentCaptor.forClass(CharSequence.class);
+        verify(mEntityHeaderController).setSummary(captor.capture());
+        assertThat(captor.getValue()).isNull();
+    }
+
+    @Test
+    public void testInitHeader_systemUidWithChartIsEnabled_notNullSummary() {
+        Bundle bundle = new Bundle(3);
+        bundle.putLong(AdvancedPowerUsageDetail.EXTRA_BACKGROUND_TIME, 240000);
+        bundle.putLong(AdvancedPowerUsageDetail.EXTRA_FOREGROUND_TIME, 120000);
+        bundle.putInt(AdvancedPowerUsageDetail.EXTRA_UID, Process.SYSTEM_UID);
+        when(mFragment.getArguments()).thenReturn(bundle);
+
+        mFragment.initHeader();
+
+        ArgumentCaptor<CharSequence> captor = ArgumentCaptor.forClass(CharSequence.class);
+        verify(mEntityHeaderController).setSummary(captor.capture());
+        assertThat(captor.getValue()).isNotNull();
+    }
+
+    @Test
     public void testStartBatteryDetailPage_hasBasicData() {
         AdvancedPowerUsageDetail.startBatteryDetailPage(mActivity, mFragment,
                 mBatteryEntry, USAGE_PERCENT, /*isValidToShowSummary=*/ true);
diff --git a/tests/robotests/src/com/android/settings/network/DataDuringCallsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/network/telephony/DataDuringCallsPreferenceControllerTest.java
similarity index 96%
rename from tests/robotests/src/com/android/settings/network/DataDuringCallsPreferenceControllerTest.java
rename to tests/robotests/src/com/android/settings/network/telephony/DataDuringCallsPreferenceControllerTest.java
index d366dfd..62d9974 100644
--- a/tests/robotests/src/com/android/settings/network/DataDuringCallsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/network/telephony/DataDuringCallsPreferenceControllerTest.java
@@ -14,7 +14,7 @@
  * limitations under the License
  */
 
-package com.android.settings.network;
+package com.android.settings.network.telephony;
 
 import static android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID;
 
@@ -74,7 +74,10 @@
         when(mTelephonyManager.createForSubscriptionId(anyInt())).thenReturn(mTelephonyManager);
         mSwitchPreference = new SwitchPreference(mContext);
         when(mPreferenceScreen.findPreference(PREF_KEY)).thenReturn(mSwitchPreference);
-        mController = new DataDuringCallsPreferenceController(mContext, PREF_KEY);
+        mController = new DataDuringCallsPreferenceController(mContext, PREF_KEY) {
+            @Override
+            protected boolean hasMobileData() { return true; }
+        };
         mController.init(mLifecycle, SUB_ID_1);
     }
 
diff --git a/tests/robotests/src/com/android/settings/network/telephony/VideoCallingPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/network/telephony/VideoCallingPreferenceControllerTest.java
index 668d7f3..9b44faa 100644
--- a/tests/robotests/src/com/android/settings/network/telephony/VideoCallingPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/network/telephony/VideoCallingPreferenceControllerTest.java
@@ -89,6 +89,7 @@
         mController.init(SUB_ID);
         doReturn(mQueryImsState).when(mController).queryImsState(anyInt());
         doReturn(mQueryVoLteState).when(mController).queryVoLteState(anyInt());
+        doReturn(true).when(mController).isImsSupported();
         mPreference.setKey(mController.getPreferenceKey());
 
         mQueryImsState.setIsEnabledByPlatform(true);
diff --git a/tests/robotests/src/com/android/settings/notification/NotificationBackendTest.java b/tests/robotests/src/com/android/settings/notification/NotificationBackendTest.java
index a7ddec3..5745aa0 100644
--- a/tests/robotests/src/com/android/settings/notification/NotificationBackendTest.java
+++ b/tests/robotests/src/com/android/settings/notification/NotificationBackendTest.java
@@ -16,9 +16,6 @@
 
 package com.android.settings.notification;
 
-import static android.os.UserHandle.USER_SYSTEM;
-import static android.provider.Settings.*;
-
 import static com.google.common.truth.Truth.assertThat;
 
 import static org.junit.Assert.assertFalse;
@@ -37,11 +34,9 @@
 import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageInfo;
 import android.content.pm.PackageManager;
-import android.content.pm.PermissionInfo;
 import android.net.MacAddress;
 import android.os.Build;
 import android.os.Parcel;
-import android.provider.Settings;
 
 import com.android.settings.notification.NotificationBackend.AppRow;
 import com.android.settingslib.bluetooth.CachedBluetoothDevice;
@@ -117,9 +112,6 @@
 
     @Test
     public void testMarkAppRow_fixedPermission_withRole() throws Exception {
-        Secure.putIntForUser(RuntimeEnvironment.application.getContentResolver(),
-                Settings.Secure.NOTIFICATION_PERMISSION_ENABLED, 1, USER_SYSTEM);
-
         PackageInfo pi = new PackageInfo();
         pi.packageName = "test";
         pi.applicationInfo = new ApplicationInfo();
@@ -141,9 +133,6 @@
 
     @Test
     public void testMarkAppRow_fixedPermission() throws Exception {
-        Secure.putIntForUser(RuntimeEnvironment.application.getContentResolver(),
-                Settings.Secure.NOTIFICATION_PERMISSION_ENABLED, 1, USER_SYSTEM);
-
         PackageInfo pi = new PackageInfo();
         pi.packageName = "test";
         pi.applicationInfo = new ApplicationInfo();
@@ -161,9 +150,6 @@
 
     @Test
     public void testMarkAppRow_notFixedPermission() throws Exception {
-        Secure.putIntForUser(RuntimeEnvironment.application.getContentResolver(),
-                Settings.Secure.NOTIFICATION_PERMISSION_ENABLED, 1, USER_SYSTEM);
-
         PackageInfo pi = new PackageInfo();
         pi.packageName = "test";
         pi.applicationInfo = new ApplicationInfo();
@@ -181,9 +167,6 @@
 
     @Test
     public void testMarkAppRow_targetsT_noPermissionRequest() throws Exception {
-        Secure.putIntForUser(RuntimeEnvironment.application.getContentResolver(),
-                Settings.Secure.NOTIFICATION_PERMISSION_ENABLED, 1, USER_SYSTEM);
-
         PackageInfo pi = new PackageInfo();
         pi.packageName = "test";
         pi.applicationInfo = new ApplicationInfo();
@@ -203,9 +186,6 @@
 
     @Test
     public void testMarkAppRow_targetsT_permissionRequest() throws Exception {
-        Secure.putIntForUser(RuntimeEnvironment.application.getContentResolver(),
-                Settings.Secure.NOTIFICATION_PERMISSION_ENABLED, 1, USER_SYSTEM);
-
         PackageInfo pi = new PackageInfo();
         pi.packageName = "test";
         pi.applicationInfo = new ApplicationInfo();
diff --git a/tests/robotests/src/com/android/settings/notification/app/NotificationPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/app/NotificationPreferenceControllerTest.java
index 8d31fe5..4ba5fe7 100644
--- a/tests/robotests/src/com/android/settings/notification/app/NotificationPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/app/NotificationPreferenceControllerTest.java
@@ -225,9 +225,6 @@
 
     @Test
     public void testIsChannelBlockable_postMigration_locked() {
-        Settings.Secure.putIntForUser(RuntimeEnvironment.application.getContentResolver(),
-                Settings.Secure.NOTIFICATION_PERMISSION_ENABLED, 1, USER_SYSTEM);
-
         mController = new TestPreferenceController(mContext, mBackend);
 
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
@@ -240,9 +237,6 @@
 
     @Test
     public void testIsChannelBlockable_postMigration_locked_butChannelOff() {
-        Settings.Secure.putIntForUser(RuntimeEnvironment.application.getContentResolver(),
-                Settings.Secure.NOTIFICATION_PERMISSION_ENABLED, 1, USER_SYSTEM);
-
         mController = new TestPreferenceController(mContext, mBackend);
 
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
@@ -255,9 +249,6 @@
 
     @Test
     public void testIsChannelBlockable_postMigration_locked_butChannelBlockable() {
-        Settings.Secure.putIntForUser(RuntimeEnvironment.application.getContentResolver(),
-                Settings.Secure.NOTIFICATION_PERMISSION_ENABLED, 1, USER_SYSTEM);
-
         mController = new TestPreferenceController(mContext, mBackend);
 
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
@@ -271,9 +262,6 @@
 
     @Test
     public void testIsChannelGroupBlockable_postMigration_locked() {
-        Settings.Secure.putIntForUser(RuntimeEnvironment.application.getContentResolver(),
-                Settings.Secure.NOTIFICATION_PERMISSION_ENABLED, 1, USER_SYSTEM);
-
         mController = new TestPreferenceController(mContext, mBackend);
 
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
@@ -285,9 +273,6 @@
 
     @Test
     public void testIsChannelGroupBlockable_postMigration_locked_butChannelGroupOff() {
-        Settings.Secure.putIntForUser(RuntimeEnvironment.application.getContentResolver(),
-                Settings.Secure.NOTIFICATION_PERMISSION_ENABLED, 1, USER_SYSTEM);
-
         mController = new TestPreferenceController(mContext, mBackend);
 
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
@@ -300,9 +285,6 @@
 
     @Test
     public void testIsAppBlockable_postMigration_locked() {
-        Settings.Secure.putIntForUser(RuntimeEnvironment.application.getContentResolver(),
-                Settings.Secure.NOTIFICATION_PERMISSION_ENABLED, 1, USER_SYSTEM);
-
         mController = new TestPreferenceController(mContext, mBackend);
 
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
@@ -314,9 +296,6 @@
 
     @Test
     public void testIsAppBlockable_postMigration_locked_butAppOff() {
-        Settings.Secure.putIntForUser(RuntimeEnvironment.application.getContentResolver(),
-                Settings.Secure.NOTIFICATION_PERMISSION_ENABLED, 1, USER_SYSTEM);
-
         mController = new TestPreferenceController(mContext, mBackend);
 
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
@@ -327,32 +306,6 @@
     }
 
     @Test
-    public void testIsBlockable_oemAllowlist() {
-        NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
-        NotificationChannel channel = mock(NotificationChannel.class);
-        when(channel.isImportanceLockedByOEM()).thenReturn(true);
-        when(channel.getImportance()).thenReturn(IMPORTANCE_LOW);
-
-        mController.onResume(appRow, channel, null, null, null, null, null);
-        assertFalse(mController.isChannelBlockable());
-
-        when(channel.isImportanceLockedByOEM()).thenReturn(false);
-        mController.onResume(appRow, channel, null, null, null, null, null);
-        assertTrue(mController.isChannelBlockable());
-    }
-
-    @Test
-    public void testIsBlockable_defaultApp() {
-        NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
-        NotificationChannel channel = mock(NotificationChannel.class);
-        when(channel.getImportance()).thenReturn(IMPORTANCE_LOW);
-        when(channel.isImportanceLockedByCriticalDeviceFunction()).thenReturn(true);
-
-        mController.onResume(appRow, channel, null, null, null, null, null);
-        assertFalse(mController.isChannelBlockable());
-    }
-
-    @Test
     public void testIsChannelBlockable_nonSystemAppsBlockable() {
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         appRow.systemApp = false;
@@ -410,30 +363,6 @@
     }
 
     @Test
-    public void testIsChannelBlockable_oemLocked() {
-        NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
-        appRow.systemApp = false;
-        NotificationChannel channel = mock(NotificationChannel.class);
-        when(channel.isImportanceLockedByOEM()).thenReturn(true);
-        when(channel.getImportance()).thenReturn(IMPORTANCE_DEFAULT);
-
-        mController.onResume(appRow, channel, null, null, null, null, null);
-        assertFalse(mController.isChannelBlockable());
-    }
-
-    @Test
-    public void testIsChannelBlockable_criticalDeviceFunction() {
-        NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
-        appRow.systemApp = false;
-        NotificationChannel channel = mock(NotificationChannel.class);
-        when(channel.isImportanceLockedByCriticalDeviceFunction()).thenReturn(true);
-        when(channel.getImportance()).thenReturn(IMPORTANCE_DEFAULT);
-
-        mController.onResume(appRow, channel, null, null, null, null, null);
-        assertFalse(mController.isChannelBlockable());
-    }
-
-    @Test
     public void testIsChannelGroupBlockable_SystemNotBlockable() {
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         appRow.systemApp = true;
diff --git a/tests/robotests/src/com/android/settings/notification/zen/ZenModeAutomaticRulesPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/zen/ZenModeAutomaticRulesPreferenceControllerTest.java
index b2a54ca..1660955 100644
--- a/tests/robotests/src/com/android/settings/notification/zen/ZenModeAutomaticRulesPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/zen/ZenModeAutomaticRulesPreferenceControllerTest.java
@@ -16,6 +16,8 @@
 
 package com.android.settings.notification.zen;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.Mockito.doReturn;
@@ -33,10 +35,7 @@
 import androidx.fragment.app.Fragment;
 import androidx.preference.PreferenceCategory;
 import androidx.preference.PreferenceScreen;
-
-import com.android.settings.notification.zen.ZenModeAutomaticRulesPreferenceController;
-import com.android.settings.notification.zen.ZenModeBackend;
-import com.android.settings.notification.zen.ZenRulePreference;
+import androidx.test.core.app.ApplicationProvider;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -45,7 +44,6 @@
 import org.mockito.MockitoAnnotations;
 import org.mockito.internal.util.reflection.FieldSetter;
 import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
 import org.robolectric.util.ReflectionHelpers;
 
 import java.util.HashMap;
@@ -68,7 +66,7 @@
     @Before
     public void setup() {
         MockitoAnnotations.initMocks(this);
-        mContext = RuntimeEnvironment.application;
+        mContext = ApplicationProvider.getApplicationContext();
         mController = spy(new ZenModeAutomaticRulesPreferenceController(mContext, mock(Fragment.class),
             null));
         ReflectionHelpers.setField(mController, "mBackend", mBackend);
@@ -79,6 +77,16 @@
     }
 
     @Test
+    public void testDisplayPreference_resetsPreferencesWhenCategoryEmpty() {
+        // when the PreferenceCategory is empty (no preferences), make sure we clear out any
+        // stale state in the cached set of zen rule preferences
+        mController.mZenRulePreferences.put("test1_id", mZenRulePreference);
+        when(mockPref.getPreferenceCount()).thenReturn(0);
+        mController.displayPreference(mPreferenceScreen);
+        assertTrue(mController.mZenRulePreferences.isEmpty());
+    }
+
+    @Test
     public void testUpdateState_clearsPreferencesWhenAddingNewPreferences() {
         final int NUM_RULES = 3;
         Map<String, AutomaticZenRule> rMap = new HashMap<>();
@@ -103,6 +111,7 @@
         mController.updateState(mockPref);
         verify(mockPref, times(1)).removeAll();
         verify(mockPref, times(NUM_RULES)).addPreference(any());
+        assertEquals(NUM_RULES, mController.mZenRulePreferences.size());
     }
 
     @Test
@@ -121,12 +130,49 @@
         rMap.put(ruleId1, autoRule1);
         rMap.put(ruleId2, autoRule2);
 
+        // Add three preferences to the set of previously-known-about ZenRulePreferences; in this
+        // case, test3_id is "deleted"
+        mController.mZenRulePreferences.put("test1_id", mZenRulePreference);
+        mController.mZenRulePreferences.put("test2_id", mZenRulePreference);
+        mController.mZenRulePreferences.put("test3_id", mZenRulePreference);
+
         // update state should re-add all preferences since a preference was deleted
-        when(mockPref.getPreferenceCount()).thenReturn(NUM_RULES + 2);
+        when(mockPref.getPreferenceCount()).thenReturn(NUM_RULES + 1);
         mockGetAutomaticZenRules(NUM_RULES, rMap);
         mController.updateState(mockPref);
         verify(mockPref, times(1)).removeAll();
         verify(mockPref, times(NUM_RULES)).addPreference(any());
+        assertEquals(NUM_RULES, mController.mZenRulePreferences.size());
+    }
+
+    @Test
+    public void testUpdateState_clearsPreferencesWhenSameNumberButDifferentPrefs() {
+        final int NUM_RULES = 2;
+        Map<String, AutomaticZenRule> rMap = new HashMap<>();
+
+        String ruleId1 = "test1_id";
+        String ruleId2 = "test2_id";
+
+        AutomaticZenRule autoRule1 = new AutomaticZenRule("test_rule_1", null, null,
+                null, null, Settings.Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS, true, 10);
+        AutomaticZenRule autoRule2 = new AutomaticZenRule("test_rule_2", null, null,
+                null, null, Settings.Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS, true, 20);
+
+        rMap.put(ruleId1, autoRule1);
+        rMap.put(ruleId2, autoRule2);
+
+        // Add two preferences to the set of previously-known-about ZenRulePreferences; in this
+        // case, test3_id is "deleted" but test2_id is "added"
+        mController.mZenRulePreferences.put("test1_id", mZenRulePreference);
+        mController.mZenRulePreferences.put("test3_id", mZenRulePreference);
+
+        // update state should re-add all preferences since a preference was deleted
+        when(mockPref.getPreferenceCount()).thenReturn(NUM_RULES);
+        mockGetAutomaticZenRules(NUM_RULES, rMap);
+        mController.updateState(mockPref);
+        verify(mockPref, times(1)).removeAll();
+        verify(mockPref, times(NUM_RULES)).addPreference(any());
+        assertEquals(NUM_RULES, mController.mZenRulePreferences.size());
     }
 
     @Test
@@ -140,6 +186,7 @@
 
         when(mockPref.getPreferenceCount()).thenReturn(NUM_RULES);
         when(mockPref.getPreference(anyInt())).thenReturn(mZenRulePreference);
+        mController.mZenRulePreferences.put("test1_id", mZenRulePreference);
 
         // update state should NOT re-add all the preferences, should only update enable state
         rule.setEnabled(false);
@@ -148,7 +195,8 @@
         FieldSetter.setField(mZenRulePreference, ZenRulePreference.class.getDeclaredField("mId"), testId);
         mController.updateState(mockPref);
         verify(mZenRulePreference, times(1)).updatePreference(any());
-        verify(mController, never()).reloadAllRules(any());
+        verify(mockPref, never()).removeAll();
+        assertEquals(NUM_RULES, mController.mZenRulePreferences.size());
     }
 
     private void mockGetAutomaticZenRules(int numRules, Map<String, AutomaticZenRule> rules) {
diff --git a/tests/robotests/src/com/android/settings/password/ChooseLockPasswordTest.java b/tests/robotests/src/com/android/settings/password/ChooseLockPasswordTest.java
index e789b61..3c50c6b 100644
--- a/tests/robotests/src/com/android/settings/password/ChooseLockPasswordTest.java
+++ b/tests/robotests/src/com/android/settings/password/ChooseLockPasswordTest.java
@@ -56,7 +56,6 @@
 
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.robolectric.Robolectric;
@@ -74,13 +73,10 @@
 })
 public class ChooseLockPasswordTest {
 
-    private ShadowDevicePolicyManager mShadowDpm;
-
     @Before
     public void setUp() {
         SettingsShadowResources.overrideResource(
                 com.android.internal.R.string.config_headlineFontFamily, "");
-        mShadowDpm = ShadowDevicePolicyManager.getShadow();
     }
 
     @After
@@ -191,7 +187,6 @@
     }
 
     @Test
-    @Ignore
     public void processAndValidatePasswordRequirements_minPasswordComplexityStricter_password() {
         PasswordPolicy policy = new PasswordPolicy();
         policy.quality = PASSWORD_QUALITY_SOMETHING;
@@ -201,7 +196,6 @@
                 /* minComplexity= */ PASSWORD_COMPLEXITY_MEDIUM,
                 /* passwordType= */ PASSWORD_QUALITY_ALPHABETIC,
                 /* userEnteredPassword= */ LockscreenCredential.createNone(),
-                "Must contain at least 1 non-numerical character",
                 "Must be at least 4 characters");
     }
 
@@ -323,7 +317,6 @@
     }
 
     @Test
-    @Ignore
     public void processAndValidatePasswordRequirements_requirementsUpdateAccordingToMinComplexityAndUserInput_empty() {
         PasswordPolicy policy = new PasswordPolicy();
         policy.quality = PASSWORD_QUALITY_UNSPECIFIED;
@@ -334,11 +327,10 @@
                 /* passwordType= */ PASSWORD_QUALITY_ALPHABETIC,
                 /* userEnteredPassword= */ LockscreenCredential.createNone(),
                 "Must be at least 6 characters",
-                "Must contain at least 1 non-numerical character");
+                "If using only numbers, must be at least 8 digits");
     }
 
     @Test
-    @Ignore
     public void processAndValidatePasswordRequirements_requirementsUpdateAccordingToMinComplexityAndUserInput_numeric() {
         PasswordPolicy policy = new PasswordPolicy();
         policy.quality = PASSWORD_QUALITY_UNSPECIFIED;
@@ -349,7 +341,7 @@
                 /* passwordType= */ PASSWORD_QUALITY_ALPHABETIC,
                 /* userEnteredPassword= */ LockscreenCredential.createPassword("1"),
                 "Must be at least 6 characters",
-                "Must contain at least 1 non-numerical character");
+                "If using only numbers, must be at least 8 digits");
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/testutils/shadow/ShadowTileUtils.java b/tests/robotests/src/com/android/settings/testutils/shadow/ShadowTileUtils.java
index 45a9dd6..d164cb9 100644
--- a/tests/robotests/src/com/android/settings/testutils/shadow/ShadowTileUtils.java
+++ b/tests/robotests/src/com/android/settings/testutils/shadow/ShadowTileUtils.java
@@ -34,7 +34,7 @@
 @Implements(TileUtils.class)
 public class ShadowTileUtils {
 
-    public static final String MOCK_SUMMARY = "summary";
+    public static final String MOCK_TEXT = "text";
 
     private static boolean sChecked;
     private static Bundle sResult;
@@ -42,13 +42,14 @@
     @Implementation
     protected static String getTextFromUri(Context context, Uri uri,
             Map<String, IContentProvider> providerMap, String key) {
-        return MOCK_SUMMARY;
+        return MOCK_TEXT;
     }
 
     @Implementation
     protected static Pair<String, Integer> getIconFromUri(Context context, String packageName,
             Uri uri, Map<String, IContentProvider> providerMap) {
-        return Pair.create(RuntimeEnvironment.application.getPackageName(), R.drawable.ic_settings_accent);
+        return Pair.create(RuntimeEnvironment.application.getPackageName(),
+                R.drawable.ic_settings_accent);
     }
 
     @Implementation
diff --git a/tests/unit/src/com/android/settings/DefaultRingtonePreferenceTest.java b/tests/unit/src/com/android/settings/DefaultRingtonePreferenceTest.java
new file mode 100644
index 0000000..b9dea01
--- /dev/null
+++ b/tests/unit/src/com/android/settings/DefaultRingtonePreferenceTest.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings;
+
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.media.RingtoneManager;
+import android.net.Uri;
+
+import androidx.test.core.app.ApplicationProvider;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+/** Unittest for DefaultRingtonePreference. */
+@RunWith(AndroidJUnit4.class)
+public class DefaultRingtonePreferenceTest {
+
+    private DefaultRingtonePreference mDefaultRingtonePreference;
+
+    @Mock
+    private ContentResolver mContentResolver;
+    @Mock
+    private Uri mRingtoneUri;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+
+        Context context = spy(ApplicationProvider.getApplicationContext());
+        doReturn(mContentResolver).when(context).getContentResolver();
+
+        mDefaultRingtonePreference = spy(new DefaultRingtonePreference(context, null /* attrs */));
+        doReturn(context).when(mDefaultRingtonePreference).getContext();
+        when(mDefaultRingtonePreference.getRingtoneType())
+                .thenReturn(RingtoneManager.TYPE_RINGTONE);
+        mDefaultRingtonePreference.setUserId(1);
+    }
+
+    @Test
+    public void onSaveRingtone_nullMimeType_shouldNotSetRingtone() {
+        when(mContentResolver.getType(mRingtoneUri)).thenReturn(null);
+
+        mDefaultRingtonePreference.onSaveRingtone(mRingtoneUri);
+
+        verify(mDefaultRingtonePreference, never()).setActualDefaultRingtoneUri(mRingtoneUri);
+    }
+
+    @Test
+    public void onSaveRingtone_notAudioMimeType_shouldNotSetRingtone() {
+        when(mContentResolver.getType(mRingtoneUri)).thenReturn("text/plain");
+
+        mDefaultRingtonePreference.onSaveRingtone(mRingtoneUri);
+
+        verify(mDefaultRingtonePreference, never()).setActualDefaultRingtoneUri(mRingtoneUri);
+    }
+}
diff --git a/tests/unit/src/com/android/settings/applications/AppLocaleUtilTest.java b/tests/unit/src/com/android/settings/applications/AppLocaleUtilTest.java
index 9bc3ef5..8350bc7 100644
--- a/tests/unit/src/com/android/settings/applications/AppLocaleUtilTest.java
+++ b/tests/unit/src/com/android/settings/applications/AppLocaleUtilTest.java
@@ -37,6 +37,7 @@
 import androidx.test.ext.junit.runners.AndroidJUnit4;
 
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
@@ -71,6 +72,7 @@
     }
 
     @Test
+    @Ignore("b/231904717")
     public void canDisplayLocaleUi_showUI() throws PackageManager.NameNotFoundException {
         setApplicationInfo(/*no platform key*/ false);
         setActivityInfo(mAllowedPackage);
@@ -79,6 +81,7 @@
     }
 
     @Test
+    @Ignore("b/231904717")
     public void canDisplayLocaleUi_notShowUI_hasPlatformKey()
             throws PackageManager.NameNotFoundException {
         setApplicationInfo(/*has platform key*/ true);
@@ -88,6 +91,7 @@
     }
 
     @Test
+    @Ignore("b/231904717")
     public void canDisplayLocaleUi_notShowUI_noLauncherEntry()
             throws PackageManager.NameNotFoundException {
         setApplicationInfo(/*no platform key*/false);
@@ -97,6 +101,7 @@
     }
 
     @Test
+    @Ignore("b/231904717")
     public void canDisplayLocaleUi_notShowUI_matchDisallowedPackageList()
             throws PackageManager.NameNotFoundException {
         setApplicationInfo(/*no platform key*/false);
diff --git a/tests/unit/src/com/android/settings/deviceinfo/simstatus/SimStatusDialogControllerTest.java b/tests/unit/src/com/android/settings/deviceinfo/simstatus/SimStatusDialogControllerTest.java
index 9cd6f2d..428c575 100644
--- a/tests/unit/src/com/android/settings/deviceinfo/simstatus/SimStatusDialogControllerTest.java
+++ b/tests/unit/src/com/android/settings/deviceinfo/simstatus/SimStatusDialogControllerTest.java
@@ -157,6 +157,9 @@
             }
 
             @Override
+            protected void requestForUpdateEid() {}
+
+            @Override
             public AtomicReference<String> getEid(int slotIndex) {
                 return mEuiccEnabled.get() ? mEid : null;
             }
@@ -202,6 +205,7 @@
         doReturn(carrierName).when(mSubscriptionInfo).getCarrierName();
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         verify(mDialog).setText(NETWORK_PROVIDER_VALUE_ID, carrierName);
     }
@@ -209,6 +213,7 @@
     @Test
     public void initialize_shouldUpdatePhoneNumber() {
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         assertTrue(mUpdatePhoneNumberCount.get() > 0);
     }
@@ -218,6 +223,7 @@
         when(mTelephonyManager.getPhoneType()).thenReturn(TelephonyManager.PHONE_TYPE_CDMA);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         verify(mDialog).removeSettingFromScreen(OPERATOR_INFO_LABEL_ID);
         verify(mDialog).removeSettingFromScreen(OPERATOR_INFO_VALUE_ID);
@@ -228,6 +234,7 @@
         when(mServiceState.getState()).thenReturn(ServiceState.STATE_IN_SERVICE);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         final String inServiceText = ResourcesUtils.getResourcesString(
                 mContext, "radioInfo_service_in");
@@ -239,6 +246,7 @@
         when(mServiceState.getState()).thenReturn(ServiceState.STATE_POWER_OFF);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         final String offServiceText = ResourcesUtils.getResourcesString(
                 mContext, "radioInfo_service_off");
@@ -253,6 +261,7 @@
                 ServiceState.STATE_OUT_OF_SERVICE);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         final String offServiceText = ResourcesUtils.getResourcesString(
                 mContext, "radioInfo_service_out");
@@ -266,6 +275,7 @@
         when(mServiceState.getDataRegistrationState()).thenReturn(ServiceState.STATE_IN_SERVICE);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         final String inServiceText = ResourcesUtils.getResourcesString(
                 mContext, "radioInfo_service_in");
@@ -281,6 +291,7 @@
         setupCellSignalStrength_lteWcdma(lteDbm, lteAsu, wcdmaDbm, wcdmaAsu);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         final String signalStrengthString = ResourcesUtils.getResourcesString(
                 mContext, "sim_signal_strength", lteDbm, lteAsu);
@@ -296,6 +307,7 @@
         setupCellSignalStrength_lteCdma(lteDbm, lteAsu, cdmaDbm, cdmaAsu);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         final String signalStrengthString = ResourcesUtils.getResourcesString(
                 mContext, "sim_signal_strength", lteDbm, lteAsu);
@@ -312,6 +324,7 @@
         setupCellSignalStrength_lteOnly(lteDbm, lteAsu);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         final String signalStrengthString = ResourcesUtils.getResourcesString(
                 mContext, "sim_signal_strength", lteDbm, lteAsu);
@@ -324,6 +337,7 @@
                 TelephonyManager.NETWORK_TYPE_EDGE);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         verify(mDialog).setText(CELL_VOICE_NETWORK_TYPE_VALUE_ID,
                 SimStatusDialogController.getNetworkTypeName(TelephonyManager.NETWORK_TYPE_EDGE));
@@ -335,6 +349,7 @@
                 TelephonyManager.NETWORK_TYPE_EDGE);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         verify(mDialog).setText(CELL_DATA_NETWORK_TYPE_VALUE_ID,
                 SimStatusDialogController.getNetworkTypeName(TelephonyManager.NETWORK_TYPE_EDGE));
@@ -345,6 +360,7 @@
         when(mServiceState.getRoaming()).thenReturn(true);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         final String roamingOnString = ResourcesUtils.getResourcesString(
                 mContext, "radioInfo_roaming_in");
@@ -356,6 +372,7 @@
         when(mServiceState.getRoaming()).thenReturn(false);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         final String roamingOffString = ResourcesUtils.getResourcesString(
                 mContext, "radioInfo_roaming_not");
@@ -368,6 +385,7 @@
                 CarrierConfigManager.KEY_SHOW_ICCID_IN_SIM_STATUS_BOOL, false);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         verify(mDialog).removeSettingFromScreen(ICCID_INFO_LABEL_ID);
         verify(mDialog).removeSettingFromScreen(ICCID_INFO_VALUE_ID);
@@ -379,6 +397,7 @@
                 CarrierConfigManager.KEY_SHOW_SIGNAL_STRENGTH_IN_SIM_STATUS_BOOL, false);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         verify(mDialog, times(2)).removeSettingFromScreen(SIGNAL_STRENGTH_LABEL_ID);
         verify(mDialog, times(2)).removeSettingFromScreen(SIGNAL_STRENGTH_VALUE_ID);
@@ -390,6 +409,7 @@
         when(mCarrierConfigManager.getConfigForSubId(anyInt())).thenReturn(null);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         verify(mDialog, times(2)).setText(eq(SIGNAL_STRENGTH_VALUE_ID), any());
         verify(mDialog).removeSettingFromScreen(ICCID_INFO_LABEL_ID);
@@ -403,6 +423,7 @@
         doReturn(iccid).when(mTelephonyManager).getSimSerialNumber();
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         verify(mDialog).setText(ICCID_INFO_VALUE_ID, iccid);
     }
@@ -457,6 +478,7 @@
         mEid.set(null);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         // Keep 'Not available' if neither the card nor the associated manager can provide EID.
         verify(mDialog, never()).setText(eq(EID_INFO_VALUE_ID), any());
@@ -511,6 +533,7 @@
         when(mEuiccManager.createForCardId(0)).thenReturn(mEuiccManager);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         // Set EID retrieved from the card.
         verify(mDialog).setText(EID_INFO_VALUE_ID, TEST_EID_FROM_CARD);
@@ -570,14 +593,15 @@
         when(mEuiccManager.createForCardId(1)).thenReturn(mEuiccManager);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         // Set EID retrieved from the manager associated with the card which cannot provide EID.
         verify(mDialog).setText(EID_INFO_VALUE_ID, TEST_EID_FROM_MANAGER);
         verify(mDialog, never()).removeSettingFromScreen(eq(EID_INFO_VALUE_ID));
     }
 
-    @Ignore
     @Test
+    @Ignore
     public void initialize_updateEid_shouldRemoveEid() {
         when(mTelephonyManager.getActiveModemCount()).thenReturn(MAX_PHONE_COUNT_DUAL_SIM);
 
@@ -623,10 +647,10 @@
 
         when(mEuiccManager.isEnabled()).thenReturn(true);
         mEuiccEnabled.set(true);
-        mEid.set(TEST_EID_FROM_MANAGER);
+        mEid.set(null);
 
-        mController.updateEid(mController.getEid(0));
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         // Remove EID if the card is not eUICC.
         verify(mDialog, never()).setText(eq(EID_INFO_VALUE_ID), any());
@@ -666,6 +690,7 @@
         mEid.set(null);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         // Keep 'Not available' if the default eUICC manager cannot provide EID in Single SIM mode.
         verify(mDialog, never()).setText(eq(EID_INFO_VALUE_ID), any());
@@ -707,6 +732,7 @@
                 new RuntimeException("EID shall be retrieved from the default eUICC manager"));
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         // Set EID retrieved from the default eUICC manager in Single SIM mode.
         verify(mDialog).setText(EID_INFO_VALUE_ID, TEST_EID_FROM_MANAGER);
@@ -748,6 +774,7 @@
                 new RuntimeException("EID shall be retrieved from the default eUICC manager"));
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         // Set EID retrieved from the default eUICC manager in Single SIM mode.
         verify(mDialog).setText(EID_INFO_VALUE_ID, TEST_EID_FROM_MANAGER);
@@ -786,6 +813,7 @@
         mEid.set(null);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         // Remove EID if the default eUICC manager indicates that eSIM is not enabled.
         verify(mDialog).removeSettingFromScreen(eq(EID_INFO_LABEL_ID));
@@ -800,6 +828,7 @@
         when(mTelephonyManager.isImsRegistered(anyInt())).thenReturn(true);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         verify(mDialog).setText(IMS_REGISTRATION_STATE_VALUE_ID,
                 mContext.getString(R.string.ims_reg_status_registered));
@@ -813,6 +842,7 @@
         when(mTelephonyManager.isImsRegistered(anyInt())).thenReturn(false);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         verify(mDialog).setText(IMS_REGISTRATION_STATE_VALUE_ID,
                 mContext.getString(R.string.ims_reg_status_not_registered));
@@ -825,6 +855,7 @@
                 CarrierConfigManager.KEY_SHOW_IMS_REGISTRATION_STATUS_BOOL, true);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         verify(mDialog, never()).removeSettingFromScreen(IMS_REGISTRATION_STATE_VALUE_ID);
     }
@@ -836,6 +867,7 @@
                 CarrierConfigManager.KEY_SHOW_IMS_REGISTRATION_STATUS_BOOL, false);
 
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
 
         verify(mDialog).removeSettingFromScreen(IMS_REGISTRATION_STATE_LABEL_ID);
         verify(mDialog).removeSettingFromScreen(IMS_REGISTRATION_STATE_VALUE_ID);
@@ -846,6 +878,7 @@
         doReturn(null).when(mTelephonyManager).getSignalStrength();
         // we should not crash when running the following line
         mController.initialize();
+        mController.updateEid(mController.getEid(0));
     }
 
     private void setupCellSignalStrength_lteWcdma(int lteDbm, int lteAsu, int wcdmaDbm,
diff --git a/tests/unit/src/com/android/settings/network/NetworkProviderSimListControllerTest.java b/tests/unit/src/com/android/settings/network/NetworkProviderSimListControllerTest.java
index 066cf6b..b5020db 100644
--- a/tests/unit/src/com/android/settings/network/NetworkProviderSimListControllerTest.java
+++ b/tests/unit/src/com/android/settings/network/NetworkProviderSimListControllerTest.java
@@ -46,6 +46,7 @@
 import com.android.settingslib.core.lifecycle.Lifecycle;
 
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
@@ -230,6 +231,7 @@
         assertTrue(TextUtils.equals(mController.getSummary(SUB_ID_1, DISPLAY_NAME_1), summary));
     }
 
+    @Ignore
     @Test
     @UiThreadTest
     public void getAvailablePhysicalSubscription_withTwoPhysicalSims_returnTwo() {
diff --git a/tests/unit/src/com/android/settings/network/ProviderModelSliceHelperTest.java b/tests/unit/src/com/android/settings/network/ProviderModelSliceHelperTest.java
index 8687e5a..436d37f 100644
--- a/tests/unit/src/com/android/settings/network/ProviderModelSliceHelperTest.java
+++ b/tests/unit/src/com/android/settings/network/ProviderModelSliceHelperTest.java
@@ -56,6 +56,7 @@
 import com.android.wifitrackerlib.WifiEntry;
 
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
@@ -165,6 +166,7 @@
         assertThat(testItem).isNull();
     }
 
+    @Ignore
     @Test
     public void createCarrierRow_hasDdsAndActiveNetworkIsNotCellular_verifyTitleAndSummary() {
         String expectDisplayName = "Name1";
@@ -181,6 +183,7 @@
         assertThat(testRowBuild.getSubtitle()).isEqualTo(expectedSubtitle);
     }
 
+    @Ignore
     @Test
     public void createCarrierRow_wifiOnhasDdsAndActiveNetworkIsCellular_verifyTitleAndSummary() {
         String expectDisplayName = "Name1";
@@ -201,6 +204,7 @@
         assertThat(testRowBuild.getSubtitle()).isEqualTo(expectedSubtitle);
     }
 
+    @Ignore
     @Test
     public void createCarrierRow_noNetworkAvailable_verifyTitleAndSummary() {
         String expectDisplayName = "Name1";
diff --git a/tests/unit/src/com/android/settings/network/SubscriptionUtilTest.java b/tests/unit/src/com/android/settings/network/SubscriptionUtilTest.java
index b0d6365..43a32b5 100644
--- a/tests/unit/src/com/android/settings/network/SubscriptionUtilTest.java
+++ b/tests/unit/src/com/android/settings/network/SubscriptionUtilTest.java
@@ -69,6 +69,7 @@
         when(mTelMgr.getUiccSlotsInfo()).thenReturn(null);
     }
 
+    @Ignore
     @Test
     public void getAvailableSubscriptions_nullInfoFromSubscriptionManager_nonNullResult() {
         when(mSubMgr.getAvailableSubscriptionInfoList()).thenReturn(null);
@@ -90,6 +91,7 @@
         assertThat(subs).hasSize(1);
     }
 
+    @Ignore
     @Test
     public void getAvailableSubscriptions_twoSubscriptions_twoResults() {
         final SubscriptionInfo info1 = mock(SubscriptionInfo.class);
@@ -138,6 +140,7 @@
         assertThat(subs).hasSize(2);
     }
 
+    @Ignore
     @Test
     public void getUniqueDisplayNames_uniqueCarriers_originalUsed() {
         // Each subscription's default display name is unique.
@@ -228,6 +231,7 @@
         assertEquals(CARRIER_1 + " 4444", idNames.get(SUBID_2));
     }
 
+    @Ignore
     @Test
     public void getUniqueDisplayNames_phoneNumberBlocked_subscriptoinIdFallback() {
         // Both subscriptoins have the same display name.
@@ -295,6 +299,7 @@
         assertEquals(CARRIER_1 + " 3", idNames.get(SUBID_3));
     }
 
+    @Ignore
     @Test
     public void getUniqueDisplayName_onlyOneSubscription_correctNameReturned() {
         // Each subscription's default display name is unique.
@@ -394,6 +399,7 @@
         assertTrue(TextUtils.isEmpty(name));
     }
 
+    @Ignore
     @Test
     public void getUniqueDisplayName_fullSubscriptionInfo_correctNameReturned() {
         // Each subscription's default display name is unique.
diff --git a/tests/unit/src/com/android/settings/network/SubscriptionsPreferenceControllerTest.java b/tests/unit/src/com/android/settings/network/SubscriptionsPreferenceControllerTest.java
index ac07fae..3bcfcb4 100644
--- a/tests/unit/src/com/android/settings/network/SubscriptionsPreferenceControllerTest.java
+++ b/tests/unit/src/com/android/settings/network/SubscriptionsPreferenceControllerTest.java
@@ -200,7 +200,7 @@
     }
 
     @Test
-    public void isAvailable_airplaneModeOnWifiOffWithCarrierNetwork_availableTrue() {
+    public void isAvailable_airplaneModeOnWifiOffWithCarrierNetwork_availableFalse() {
         setupMockSubscriptions(1);
 
         when(mWifiManager.isWifiEnabled()).thenReturn(false);
@@ -212,7 +212,7 @@
     }
 
     @Test
-    public void isAvailable_airplaneModeOff_availableFalse() {
+    public void isAvailable_airplaneModeOff_availableTrue() {
         setupMockSubscriptions(2);
 
         assertThat(mController.isAvailable()).isTrue();
@@ -235,12 +235,11 @@
         mController.displayPreference(mPreferenceScreen);
 
         assertThat(mPreferenceCategory.getPreferenceCount()).isEqualTo(1);
-        assertThat(mPreferenceCategory.getPreference(0).getTitle()).isEqualTo("sub1");
     }
 
     @Test
     @UiThreadTest
-    public void displayPreference_providerAndHasMultiSim_showDataSubPreference() {
+    public void displayPreference_providerAndHasMultiSim_showOnePreference() {
         final List<SubscriptionInfo> sub = setupMockSubscriptions(2);
         doReturn(sub.get(0)).when(mSubscriptionManager).getDefaultDataSubscriptionInfo();
         doReturn(sub).when(mSubscriptionManager).getAvailableSubscriptionInfoList();
@@ -249,7 +248,6 @@
         mController.displayPreference(mPreferenceScreen);
 
         assertThat(mPreferenceCategory.getPreferenceCount()).isEqualTo(1);
-        assertThat(mPreferenceCategory.getPreference(0).getTitle()).isEqualTo("sub1");
     }
 
     @Test
@@ -437,7 +435,7 @@
 
     @Test
     @UiThreadTest
-    public void dataSubscriptionChanged_providerAndHasMultiSim_showSubId1Preference() {
+    public void dataSubscriptionChanged_providerAndHasMultiSim_showOnePreference() {
         final List<SubscriptionInfo> sub = setupMockSubscriptions(2);
         doReturn(sub.get(0)).when(mSubscriptionManager).getDefaultDataSubscriptionInfo();
         doReturn(sub).when(mSubscriptionManager).getAvailableSubscriptionInfoList();
@@ -449,12 +447,11 @@
 
         assertThat(mController.isAvailable()).isTrue();
         assertThat(mPreferenceCategory.getPreferenceCount()).isEqualTo(1);
-        assertThat(mPreferenceCategory.getPreference(0).getTitle()).isEqualTo("sub1");
     }
 
     @Test
     @UiThreadTest
-    public void dataSubscriptionChanged_providerAndHasMultiSim_showSubId2Preference() {
+    public void dataSubscriptionChanged_providerAndHasMultiSim_showOnlyOnePreference() {
         final List<SubscriptionInfo> sub = setupMockSubscriptions(2);
         final int subId = sub.get(0).getSubscriptionId();
         doReturn(sub.get(0)).when(mSubscriptionManager).getDefaultDataSubscriptionInfo();
@@ -464,17 +461,12 @@
         mController.onResume();
         mController.displayPreference(mPreferenceScreen);
 
-        assertThat(mController.isAvailable()).isTrue();
-        assertThat(mPreferenceCategory.getPreferenceCount()).isEqualTo(1);
-        assertThat(mPreferenceCategory.getPreference(0).getTitle()).isEqualTo("sub1");
-
         doReturn(sub.get(1)).when(mSubscriptionManager).getDefaultDataSubscriptionInfo();
 
         mController.mConnectionChangeReceiver.onReceive(mContext, intent);
 
         assertThat(mController.isAvailable()).isTrue();
         assertThat(mPreferenceCategory.getPreferenceCount()).isEqualTo(1);
-        assertThat(mPreferenceCategory.getPreference(0).getTitle()).isEqualTo("sub2");
     }
 
     @Test
diff --git a/tests/unit/src/com/android/settings/network/telephony/DefaultSubscriptionControllerTest.java b/tests/unit/src/com/android/settings/network/telephony/DefaultSubscriptionControllerTest.java
index c48941f..57e38d3 100644
--- a/tests/unit/src/com/android/settings/network/telephony/DefaultSubscriptionControllerTest.java
+++ b/tests/unit/src/com/android/settings/network/telephony/DefaultSubscriptionControllerTest.java
@@ -44,6 +44,7 @@
 
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
@@ -111,6 +112,7 @@
         assertThat(mController.getLabelFromCallingAccount(null)).isEqualTo("");
     }
 
+    @Ignore
     @Test
     public void displayPreference_twoSubscriptionsSub1Default_correctListPreferenceValues() {
         final SubscriptionInfo sub1 = createMockSub(111, "sub1");
@@ -141,6 +143,7 @@
                 Integer.toString(SubscriptionManager.INVALID_SUBSCRIPTION_ID));
     }
 
+    @Ignore
     @Test
     public void displayPreference_twoSubscriptionsSub2Default_correctListPreferenceValues() {
         final SubscriptionInfo sub1 = createMockSub(111, "sub1");
@@ -171,6 +174,7 @@
                 Integer.toString(SubscriptionManager.INVALID_SUBSCRIPTION_ID));
     }
 
+    @Ignore
     @Test
     public void displayPreference_threeSubsOneIsOpportunistic_correctListPreferenceValues() {
         final SubscriptionInfo sub1 = createMockSub(111, "sub1");
@@ -254,6 +258,7 @@
         assertThat(mController.getDefaultSubscriptionId()).isEqualTo(222);
     }
 
+    @Ignore
     @Test
     public void onSubscriptionsChanged_twoSubscriptionsDefaultChanges_selectedEntryGetsUpdated() {
         final SubscriptionInfo sub1 = createMockSub(111, "sub1");
@@ -314,6 +319,7 @@
         assertThat(mListPreference.isEnabled()).isTrue();
     }
 
+    @Ignore
     @Test
     public void onSubscriptionsChanged_goFromTwoToThreeSubscriptions_listGetsUpdated() {
         final SubscriptionInfo sub1 = createMockSub(111, "sub1");