[automerger skipped] Merge "Import translations. DO NOT MERGE ANYWHERE" am: 76947837c5 -s ours am: b372e3fbcf -s ours am: 958cb755cf -s ours am: 0b9ba3c3cd -s ours

am skip reason: subject contains skip directive

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1417618

Change-Id: I541dc626406cdff6a01bb3f16cf1c776373f5610
diff --git a/res/drawable/ic_illustration_adaptive_connectivity.xml b/res/drawable/ic_illustration_adaptive_connectivity.xml
new file mode 100644
index 0000000..748dd66
--- /dev/null
+++ b/res/drawable/ic_illustration_adaptive_connectivity.xml
@@ -0,0 +1,99 @@
+<!--
+    Copyright (C) 2020 The Android Open Source Project
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="412dp"
+    android:height="300dp"
+    android:viewportWidth="412"
+    android:viewportHeight="300">
+  <path
+      android:pathData="M0,0h412v300h-412z"
+      android:fillColor="#fff"/>
+  <path
+      android:pathData="M206,150m-118,0a118,118 0,1 1,236 0a118,118 0,1 1,-236 0"
+      android:strokeAlpha="0.2"
+      android:fillColor="#8ab4f8"
+      android:fillAlpha="0.2"/>
+  <path
+      android:pathData="M206,150m-101.17,0a101.17,101.17 0,1 1,202.34 0a101.17,101.17 0,1 1,-202.34 0"
+      android:strokeAlpha="0.2"
+      android:fillColor="#8ab4f8"
+      android:fillAlpha="0.2"/>
+  <path
+      android:pathData="M206,150m-84.44,0a84.44,84.44 0,1 1,168.88 0a84.44,84.44 0,1 1,-168.88 0"
+      android:strokeAlpha="0.2"
+      android:fillColor="#8ab4f8"
+      android:fillAlpha="0.2"/>
+  <path
+      android:pathData="M141.15,25.48h129.87v250.83h-129.87z"
+      android:fillColor="#fff"/>
+  <path
+      android:pathData="M199.19,237.66h15.2a4.83,4.83 0,0 1,4.83 4.83h0a4.84,4.84 0,0 1,-4.83 4.84h-15.2a4.84,4.84 0,0 1,-4.83 -4.84h0A4.83,4.83 0,0 1,199.19 237.66Z"
+      android:fillColor="#d2e3fc"/>
+  <path
+      android:pathData="M212.32,235.59h0a6.9,6.9 0,0 1,6.9 6.9h0a6.9,6.9 0,0 1,-6.9 6.91h0a6.91,6.91 0,0 1,-6.91 -6.91h0A6.9,6.9 0,0 1,212.32 235.59Z"
+      android:fillColor="#1a73e8"/>
+  <path
+      android:pathData="M262.43,25.48a5,5 0,0 1,5 5V269.54a5,5 0,0 1,-5 5H147.87a5,5 0,0 1,-5 -5V30.46a5,5 0,0 1,5 -5H262.43m0,-6.23H147.87a11.22,11.22 0,0 0,-11.2 11.21V269.54a11.22,11.22 0,0 0,11.2 11.21H262.43a11.22,11.22 0,0 0,11.21 -11.21V30.46a11.22,11.22 0,0 0,-11.21 -11.21Z"
+      android:fillColor="#f1f3f4"/>
+  <path
+      android:pathData="M262.43,282H147.87a12.46,12.46 0,0 1,-12.45 -12.45V30.46A12.46,12.46 0,0 1,147.87 18H262.43a12.46,12.46 0,0 1,12.45 12.45V269.54A12.46,12.46 0,0 1,262.43 282ZM147.87,20.5a10,10 0,0 0,-10 10V269.54a10,10 0,0 0,10 10H262.43a10,10 0,0 0,10 -10V30.46a10,10 0,0 0,-10 -10Z"
+      android:fillColor="#dadce0"/>
+  <path
+      android:pathData="M274.88,82.76h0.69a1.8,1.8 0,0 1,1.8 1.8V95.9a1.8,1.8 0,0 1,-1.8 1.8h-0.69a0,0 0,0 1,0 0V82.76A0,0 0,0 1,274.88 82.76Z"
+      android:fillColor="#dadce0"/>
+  <path
+      android:pathData="M274.88,117.62h0.69a1.8,1.8 0,0 1,1.8 1.8v26.28a1.8,1.8 0,0 1,-1.8 1.8h-0.69a0,0 0,0 1,0 0V117.62a0,0 0,0 1,0 0Z"
+      android:fillColor="#dadce0"/>
+  <path
+      android:pathData="M206.64,182.08m-16.56,0a16.56,16.56 0,1 1,33.12 0a16.56,16.56 0,1 1,-33.12 0"
+      android:fillColor="#f1f3f4"/>
+  <path
+      android:pathData="M190.08,182.08a16.56,16.53 0,1 0,33.12 0a16.56,16.53 0,1 0,-33.12 0z"
+      android:fillColor="#fdd663"/>
+  <path
+      android:pathData="M206.64,174.54l-6.21,4.66l0,9.32l3.88,0l0,-5.44l4.66,0l0,5.44l3.88,0l0,-9.32l-6.21,-4.66z"
+      android:fillColor="#f29900"/>
+  <path
+      android:pathData="M165.84,101.31m-16.53,0a16.53,16.53 0,1 1,33.06 0a16.53,16.53 0,1 1,-33.06 0"
+      android:fillColor="#f6aea9"/>
+  <path
+      android:pathData="M169.77,108.12V96.07a1,1 0,0 0,-1 -1h-1.32V93.46h-3.14V95H163a1,1 0,0 0,-1 1v12a1,1 0,0 0,1 1h5.76A1,1 0,0 0,169.77 108.12ZM168.2,96.6v5.64h-4.71V96.6Z"
+      android:fillColor="#ea4335"/>
+  <path
+      android:pathData="M246.16,152.08m-16.56,0a16.56,16.56 0,1 1,33.12 0a16.56,16.56 0,1 1,-33.12 0"
+      android:fillColor="#f6aea9"/>
+  <path
+      android:pathData="M251.88,146a1.18,1.18 0,0 0,-1.12 -0.79h-8.63A1.19,1.19 0,0 0,241 146l-1.63,4.7L239.37,157a0.78,0.78 0,0 0,0.78 0.79L241,157.79a0.78,0.78 0,0 0,0.78 -0.79v-0.78h9.42L251.2,157a0.79,0.79 0,0 0,0.79 0.79h0.78a0.79,0.79 0,0 0,0.79 -0.79v-6.28ZM242.88,153.84a1.18,1.18 0,1 1,1.18 -1.17A1.17,1.17 0,0 1,242.91 153.88ZM249.95,153.84a1.18,1.18 0,1 1,1.17 -1.17A1.17,1.17 0,0 1,250 153.88ZM241.52,149.22 L242.37,146.78h8.08l0.85,2.44Z"
+      android:fillColor="#ea4335"/>
+  <path
+      android:pathData="M165.84,152.08m-16.56,0a16.56,16.56 0,1 1,33.12 0a16.56,16.56 0,1 1,-33.12 0"
+      android:fillColor="#aecbfa"/>
+  <path
+      android:pathData="M173.24,149.16a4,4 0,0 0,-4 -3.34h-6.11a4.06,4.06 0,0 0,-4 3.34s-1.27,7.34 -1.27,7.45a1.73,1.73 0,0 0,1.73 1.73,1.7 1.7,0 0,0 1.22,-0.49l2.89,-2.85h5l2.88,2.85a1.71,1.71 0,0 0,1.23 0.49,1.73 1.73,0 0,0 1.73,-1.73C174.52,156.5 173.24,149.16 173.24,149.16ZM165.34,150.83h-1.67v1.67h-0.84v-1.67h-1.66L161.17,150h1.66v-1.67h0.84L163.67,150h1.67ZM167.68,151.08a0.67,0.67 0,1 1,0.66 -0.67A0.67,0.67 0,0 1,167.68 151.08ZM169.09,152.5a0.67,0.67 0,1 1,0.66 -0.67A0.67,0.67 0,0 1,169.09 152.5ZM169.09,149.66a0.67,0.67 0,1 1,0.66 -0.67A0.67,0.67 0,0 1,169.09 149.66ZM170.51,151.08a0.67,0.67 0,1 1,0.67 -0.67A0.67,0.67 0,0 1,170.51 151.08Z"
+      android:fillColor="#4285f4"/>
+  <path
+      android:pathData="M246.16,101.31m-16.53,0a16.53,16.53 0,1 1,33.06 0a16.53,16.53 0,1 1,-33.06 0"
+      android:fillColor="#aecbfa"/>
+  <path
+      android:pathData="M242.91,96.47a4.51,4.51 0,0 0,0 6.49l0.83,-0.83a3.47,3.47 0,0 1,-1 -2.42,3.23 3.23,0 0,1 1,-2.41ZM251.06,94.81 L250.23,95.64a5.84,5.84 0,0 1,0 8.14l0.83,0.83a6.77,6.77 0,0 0,2 -4.9A7.08,7.08 0,0 0,251.06 94.81ZM242.06,95.64 L241.24,94.81a7,7 0,0 0,0 9.8l0.82,-0.83a5.84,5.84 0,0 1,0 -8.14ZM249.38,96.47 L248.55,97.3a3.46,3.46 0,0 1,1 2.41,3.25 3.25,0 0,1 -1,2.42l0.83,0.83a4.61,4.61 0,0 0,1.38 -3.25A4.92,4.92 0,0 0,249.4 96.47ZM246.16,98a1.71,1.71 0,0 0,-1.73 1.72,1.76 1.76,0 0,0 1,1.59v6h1.38v-6a1.75,1.75 0,0 0,1 -1.59A1.71,1.71 0,0 0,246.16 98Z"
+      android:fillColor="#1a73e8"/>
+  <path
+      android:pathData="M206.64,71.31m-16.5,0a16.5,16.5 0,1 1,33 0a16.5,16.5 0,1 1,-33 0"
+      android:fillColor="#a8dab5"/>
+  <path
+      android:pathData="M212.14,65.81h-2.06l1.38,2.75h-2.07L208,65.81h-1.38L208,68.56L206,68.56l-1.37,-2.75L203.2,65.81l1.38,2.75h-2.06l-1.38,-2.75a1.37,1.37 0,0 0,-1.37 1.38v8.25a1.37,1.37 0,0 0,1.37 1.37h11a1.38,1.38 0,0 0,1.38 -1.37L213.52,67.19A1.38,1.38 0,0 0,212.14 65.81ZM212.14,75.44h-11v-5.5h11Z"
+      android:fillColor="#34a853"/>
+</vector>
diff --git a/res/layout/adaptive_connectivity_header.xml b/res/layout/adaptive_connectivity_header.xml
new file mode 100644
index 0000000..4c5fb0c
--- /dev/null
+++ b/res/layout/adaptive_connectivity_header.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Copyright (C) 2020 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  -->
+
+<FrameLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
+
+    <ImageView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:contentDescription="@null"
+        android:scaleType="fitCenter"
+        android:src="@drawable/ic_illustration_adaptive_connectivity"/>
+
+</FrameLayout>
diff --git a/res/layout/bubble_preference.xml b/res/layout/bubble_preference.xml
index 8a64716..08f25b4 100644
--- a/res/layout/bubble_preference.xml
+++ b/res/layout/bubble_preference.xml
@@ -44,7 +44,7 @@
             android:id="@+id/bubble_all_icon"
             android:src="@drawable/ic_bubble_all"
             android:background="@android:color/transparent"
-            android:layout_gravity="center"
+            android:layout_centerVertical="true"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:clickable="false"
@@ -53,6 +53,7 @@
             android:id="@+id/bubble_all_label"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
             android:ellipsize="end"
             android:maxLines="2"
             android:clickable="false"
@@ -75,7 +76,7 @@
             android:id="@+id/bubble_selected_icon"
             android:src="@drawable/ic_bubble_selected"
             android:background="@android:color/transparent"
-            android:layout_gravity="center"
+            android:layout_centerVertical="true"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:clickable="false"
@@ -84,6 +85,7 @@
             android:id="@+id/bubble_selected_label"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
             android:ellipsize="end"
             android:maxLines="2"
             android:clickable="false"
@@ -106,7 +108,7 @@
             android:id="@+id/bubble_none_icon"
             android:src="@drawable/ic_bubble_none"
             android:background="@android:color/transparent"
-            android:layout_gravity="center"
+            android:layout_centerVertical="true"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:clickable="false"
@@ -115,6 +117,7 @@
             android:id="@+id/bubble_none_label"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
             android:ellipsize="end"
             android:maxLines="2"
             android:clickable="false"
@@ -125,4 +128,4 @@
             android:text="@string/bubble_app_setting_none"/>
     </com.android.settings.notification.NotificationButtonRelativeLayout>
 
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
diff --git a/res/layout/notif_priority_conversation_preference.xml b/res/layout/notif_priority_conversation_preference.xml
index f68dbde..9c1a302 100644
--- a/res/layout/notif_priority_conversation_preference.xml
+++ b/res/layout/notif_priority_conversation_preference.xml
@@ -32,7 +32,7 @@
         android:clickable="true"
         android:focusable="true">
         <ImageView
-            android:id="@+id/priority_icon"
+            android:id="@+id/icon"
             android:src="@drawable/ic_important_outline"
             android:background="@android:color/transparent"
             android:layout_gravity="center"
@@ -41,19 +41,19 @@
             android:clickable="false"
             android:focusable="false"/>
         <TextView
-            android:id="@+id/priority_label"
+            android:id="@+id/label"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:ellipsize="end"
             android:maxLines="1"
             android:clickable="false"
             android:focusable="false"
-            android:layout_toEndOf="@id/priority_icon"
+            android:layout_toEndOf="@id/icon"
             android:layout_marginStart="@dimen/notification_importance_drawable_padding"
             android:textAppearance="@style/TextAppearance.NotificationImportanceButton.Unselected"
             android:text="@string/notification_priority_title"/>
         <TextView
-            android:id="@+id/priority_summary"
+            android:id="@+id/summary"
             android:paddingTop="@dimen/notification_importance_button_padding"
             android:text="@string/notification_channel_summary_priority"
             android:layout_width="match_parent"
@@ -62,7 +62,7 @@
             android:focusable="false"
             android:ellipsize="end"
             android:maxLines="3"
-            android:layout_below="@id/priority_icon"
+            android:layout_below="@id/icon"
             android:textAppearance="@style/TextAppearance.NotificationImportanceDetail"
             android:visibility="gone" />
     </com.android.settings.notification.NotificationButtonRelativeLayout>
@@ -76,7 +76,7 @@
         android:clickable="true"
         android:focusable="true">
         <ImageView
-            android:id="@+id/alert_icon"
+            android:id="@+id/icon"
             android:src="@drawable/ic_notifications_alert"
             android:background="@android:color/transparent"
             android:layout_gravity="center"
@@ -85,19 +85,19 @@
             android:clickable="false"
             android:focusable="false"/>
         <TextView
-            android:id="@+id/alert_label"
+            android:id="@+id/label"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:ellipsize="end"
             android:maxLines="1"
             android:clickable="false"
             android:focusable="false"
-            android:layout_toEndOf="@id/alert_icon"
+            android:layout_toEndOf="@id/icon"
             android:layout_marginStart="@dimen/notification_importance_drawable_padding"
             android:textAppearance="@style/TextAppearance.NotificationImportanceButton.Unselected"
             android:text="@string/notification_alert_title"/>
         <TextView
-            android:id="@+id/alert_summary"
+            android:id="@+id/summary"
             android:paddingTop="@dimen/notification_importance_button_padding"
             android:text="@string/notification_channel_summary_default"
             android:layout_width="match_parent"
@@ -106,7 +106,7 @@
             android:focusable="false"
             android:ellipsize="end"
             android:maxLines="2"
-            android:layout_below="@id/alert_icon"
+            android:layout_below="@id/icon"
             android:textAppearance="@style/TextAppearance.NotificationImportanceDetail"
             android:visibility="gone" />
     </com.android.settings.notification.NotificationButtonRelativeLayout>
@@ -120,7 +120,7 @@
         android:clickable="true"
         android:focusable="true">
         <ImageView
-            android:id="@+id/silence_icon"
+            android:id="@+id/icon"
             android:src="@drawable/ic_notifications_off_24dp"
             android:background="@android:color/transparent"
             android:layout_gravity="center"
@@ -129,19 +129,19 @@
             android:clickable="false"
             android:focusable="false"/>
         <TextView
-            android:id="@+id/silence_label"
+            android:id="@+id/label"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:ellipsize="end"
             android:maxLines="1"
             android:clickable="false"
             android:focusable="false"
-            android:layout_toEndOf="@id/silence_icon"
+            android:layout_toEndOf="@id/icon"
             android:layout_marginStart="@dimen/notification_importance_drawable_padding"
             android:textAppearance="@style/TextAppearance.NotificationImportanceButton.Unselected"
             android:text="@string/notification_silence_title"/>
         <TextView
-            android:id="@+id/silence_summary"
+            android:id="@+id/summary"
             android:paddingTop="@dimen/notification_importance_button_padding"
             android:text="@string/notification_conversation_summary_low"
             android:layout_width="match_parent"
@@ -150,7 +150,7 @@
             android:focusable="false"
             android:ellipsize="end"
             android:maxLines="2"
-            android:layout_below="@id/silence_icon"
+            android:layout_below="@id/icon"
             android:textAppearance="@style/TextAppearance.NotificationImportanceDetail"
             android:visibility="gone" />
     </com.android.settings.notification.NotificationButtonRelativeLayout>
diff --git a/res/layout/notification_history_app_layout.xml b/res/layout/notification_history_app_layout.xml
index a1b3be7..aaca0fd 100644
--- a/res/layout/notification_history_app_layout.xml
+++ b/res/layout/notification_history_app_layout.xml
@@ -24,6 +24,7 @@
         android:id="@+id/app_header"
         android:layout_height="wrap_content"
         android:layout_width="match_parent"
+        android:background="@drawable/button_ripple_radius"
         android:paddingTop="12dp"
         android:paddingBottom="12dp"
         android:paddingStart="16dp">
@@ -54,17 +55,19 @@
                 android:layout_height="wrap_content"
                 android:layout_width="wrap_content"
                 android:paddingStart="6dp"
-                android:layout_gravity="center_vertical"
+                android:layout_gravity="start|center_vertical"
+                android:textDirection="locale"
                 android:paddingTop="8dp"
                 android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Notification.Title"/>
         </LinearLayout>
-        <ImageButton
+        <ImageView
             android:id="@+id/expand"
             android:layout_alignParentEnd="true"
             android:layout_centerVertical="true"
             android:layout_height="48dp"
             android:layout_width="48dp"
-            android:background="@drawable/button_ripple_radius"
+            android:scaleType="center"
+            android:contentDescription="@null"
             android:src="@*android:drawable/ic_expand_more"/>
     </RelativeLayout>
 
diff --git a/res/layout/notification_sbn_log_row.xml b/res/layout/notification_sbn_log_row.xml
index 6156d26..ee143b0 100644
--- a/res/layout/notification_sbn_log_row.xml
+++ b/res/layout/notification_sbn_log_row.xml
@@ -130,6 +130,6 @@
     <View
         android:id="@+id/divider"
         android:layout_width="match_parent"
-        android:layout_height="0.5dp"
-        android:background="@color/material_grey_300" />
+        android:layout_height="wrap_content"
+        android:background="?android:attr/listDivider" />
 </LinearLayout>
\ No newline at end of file
diff --git a/res/layout/settings_base_layout.xml b/res/layout/settings_base_layout.xml
index 0a4437e..9fbc2a2 100644
--- a/res/layout/settings_base_layout.xml
+++ b/res/layout/settings_base_layout.xml
@@ -26,8 +26,7 @@
         style="?android:attr/actionBarStyle"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:theme="?android:attr/actionBarTheme"
-        android:navigationContentDescription="@*android:string/back_button_label" />
+        android:theme="?android:attr/actionBarTheme" />
     <FrameLayout
         android:id="@+id/content_frame"
         android:layout_width="match_parent"
diff --git a/res/layout/wifi_dialog.xml b/res/layout/wifi_dialog.xml
index 45ecd61..1914462 100644
--- a/res/layout/wifi_dialog.xml
+++ b/res/layout/wifi_dialog.xml
@@ -141,6 +141,24 @@
                             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"
@@ -196,18 +214,6 @@
                             android:entries="@array/eap_ocsp_type" />
                 </LinearLayout>
 
-                <LinearLayout android:id="@+id/no_ca_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_do_not_validate_eap_server_warning" />
-                </LinearLayout>
-
                 <LinearLayout android:id="@+id/l_domain"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
diff --git a/res/values-night/colors.xml b/res/values-night/colors.xml
index 4ce02ee..354da77 100644
--- a/res/values-night/colors.xml
+++ b/res/values-night/colors.xml
@@ -27,6 +27,7 @@
     <color name="notification_importance_selection_bg">@*android:color/material_grey_800</color>
     <color name="notification_importance_button_selected">#AECBFA</color> <!-- material blue 200 -->
     <color name="notification_importance_button_unselected">#5F6368</color>
+    <color name="notification_history_background">#202124</color>
     <color name="face_intro_outline">?android:attr/colorAccent</color>
     <!-- Palette list preference colors. -->
     <color name="palette_list_gradient_background">@android:color/black</color>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 06f135f..4904160 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -129,6 +129,7 @@
     <color name="notification_importance_button_unselected">#DADCE0</color>
     <color name="notification_importance_button_selected">#1967D2</color> <!-- material blue 700 -->
     <color name="notification_importance_selection_bg">#FFFFFF</color>
+    <color name="notification_history_background">?android:attr/colorBackgroundFloating</color>
 
     <!-- launcher icon color -->
     <color name="icon_launcher_setting_color">@*android:color/accent_device_default_light</color>
diff --git a/res/values/config.xml b/res/values/config.xml
index fa4bc93..de0dcfb 100755
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -459,4 +459,7 @@
 
     <!-- Whether to show Smooth Display feature in Settings Options -->
     <bool name="config_show_smooth_display">false</bool>
+
+    <!-- Whether to show the Preference for Adaptive connectivity -->
+    <bool name="config_show_adaptive_connectivity">false</bool>
 </resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 8c6f9ba..2fed49f 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -730,6 +730,12 @@
     <string name="security_settings_face_enroll_education_message"></string>
     <!-- Button that takes the user to the enrollment activity [CHAR LIMIT=20] -->
     <string name="security_settings_face_enroll_education_start">Start</string>
+    <!-- Confirmation dialog message shown when users with system accessibility features enabled try to start the non-accessibility version of enrollment [CHAR LIMIT=150] -->
+    <string name="security_settings_face_enroll_education_accessibility_dialog_message">If accessibility face unlock is turned off, some setup steps may not work properly with TalkBack.</string>
+    <!-- Negative button text for users who were shown the accessibility dialog [CHAR LIMIT=10] -->
+    <string name="security_settings_face_enroll_education_accessibility_dialog_negative">Go back</string>
+    <!-- Positive button text for users who were shown the accessibility dialog [CHAR LIMIT=20] -->
+    <string name="security_settings_face_enroll_education_accessibility_dialog_positive">Continue setup</string>
     <!-- Button shown which shows accessibility toggles for face enrollment when clicked. [CHAR LIMIT=32] -->
     <string name="security_settings_face_enroll_introduction_accessibility">Use accessibility setup</string>
     <!-- Additional details shown when the accessibility toggle is expanded. [CHAR LIMIT=NONE]-->
@@ -2112,9 +2118,7 @@
          when signal of the Wi-Fi network is reachable [CHAR LIMIT=50]  -->
     <string name="wifi_auto_connect_title">Auto\u2011connect</string>
     <!-- Hint for Wi-Fi Auto-connect [CHAR LIMIT=NONE]  -->
-    <string name="wifi_auto_connect_summary" product="default">Allow phone to automatically connect near this network</string>
-    <!-- Hint for Wi-Fi Auto-connect [CHAR LIMIT=NONE]  -->
-    <string name="wifi_auto_connect_summary" product="tablet">Allow tablet to automatically connect near this network</string>
+    <string name="wifi_auto_connect_summary">Allow connection to this network when in range</string>
     <!-- Label for "Use a QR code to add a device to this network" [CHAR LIMIT=50]  -->
     <string name="wifi_dpp_add_device">Add device</string>
     <!-- Hint for "Add device" [CHAR LIMIT=NONE]  -->
@@ -2137,8 +2141,6 @@
     <string name="wifi_do_not_provide_eap_user_cert">Do not provide</string>
     <!-- Menu option for not validating the EAP server -->
     <string name="wifi_do_not_validate_eap_server">Do not validate</string>
-    <!-- Warning message displayed if user choses not to validate the EAP server -->
-    <string name="wifi_do_not_validate_eap_server_warning">No certificate specified. Your connection will not be private.</string>
     <!-- Warning message displayed if network name (ssid) is too long -->
     <string name="wifi_ssid_too_long">Network name is too long.</string>
     <!-- Warning message displayed if user does not specify a domain for the CA certificate.
@@ -3868,7 +3870,7 @@
     <!-- Label for ethernet tether checkbox [CHAR LIMIT=NONE]-->
     <string name="ethernet_tether_checkbox_text">Ethernet tethering</string>
     <!-- Ethernet Tethering subtext [CHAR LIMIT=NONE]-->
-    <string name="ethernet_tethering_subtext" product="default">Share phone\u2019s internet connection via USB Ethernet</string>
+    <string name="ethernet_tethering_subtext" product="default">Share phone\u2019s internet connection via Ethernet</string>
 
     <!-- Tethering footer info [CHAR LIMIT=NONE]-->
     <string name="tethering_footer_info">Use hotspot and tethering to provide internet to other devices through your mobile data connection. Apps can also create a hotspot to share content with nearby devices.</string>
@@ -6190,6 +6192,11 @@
     <!-- Title of preference to enter the VPN settings activity -->
     <string name="vpn_settings_title">VPN</string>
 
+    <!-- Title of Adaptive connectivity. Adaptive connectivity is a feature which automatically manages network connections for better battery life and performance. [CHAR LIMIT=60] -->
+    <string name="adaptive_connectivity_title">Adaptive connectivity</string>
+    <!-- Summary of Adaptive connectivity preference. [CHAR LIMIT=NONE] -->
+    <string name="adaptive_connectivity_summary">Extends battery life and improves device performance by automatically managing your network connections</string>
+
     <!-- Title of preference group for credential storage settings [CHAR LIMIT=30] -->
     <string name="credentials_title">Credential storage</string>
     <!-- Title of preference to install certificates [CHAR LIMIT=30] -->
@@ -11487,6 +11494,17 @@
     <!-- Message informs the user that has no SIM card in personalized Settings [CHAR LIMIT=30] -->
     <string name="no_sim_card">No SIM card</string>
 
+    <!-- A title for a SIM card spinner UI component which users can choose a SIM card. [CHAR LIMIT=NONE] -->
+    <string name="sim_card">SIM</string>
+    <!-- A label when there is no SIM card to choose. [CHAR LIMIT=NONE] -->
+    <string name="wifi_no_sim_card">No SIM</string>
+    <!-- A label when there is no SIM card information of a Wi-Fi network. [CHAR LIMIT=NONE] -->
+    <string name="wifi_no_related_sim_card">None</string>
+    <!-- A label wen a user needs a SIM to connect to the Wi-Fi network. [CHAR LIMIT=NONE] -->
+    <string name="wifi_require_sim_card_to_connect">Requires SIM to connect</string>
+    <!-- A label wen a user needs a specific SIM to connect to the Wi-Fi network. [CHAR LIMIT=NONE] -->
+    <string name="wifi_require_specific_sim_card_to_connect">Requires <xliff:g id="wireless_carrier" example="Verizon">%s</xliff:g> SIM to connect</string>
+
     <!-- The following strings are summaries for preferred network modes in Mobile network settings,
      and have a character limit of 100 -->
     <!-- WCDMA preferred [CHAR LIMIT=NONE] -->
@@ -12144,16 +12162,18 @@
 
     <!-- Title for media control settings [CHAR LIMIT=50]-->
     <string name="media_controls_title">Media</string>
-    <!-- Summary for media control settings [CHAR LIMIT=60]-->
-    <string name="media_controls_summary">Hide player when the media session has ended</string>
+    <!-- Summary for media control settings [CHAR LIMIT=NONE]-->
+    <string name="media_controls_summary">Media player in Quick Settings</string>
     <!-- Description of toggle to enable or disable the media resumption feature in quick settings [CHAR LIMIT=NONE]-->
-    <string name="media_controls_resume_description">The player allows you to resume a session from the expanded Quick Settings panel.</string>
+    <string name="media_controls_resume_description">Show media player for an extended period to easily resume playback</string>
     <!-- Subtext for media settings when the player will be hidden [CHAR LIMIT=50] -->
     <string name="media_controls_hide_player">Hide player</string>
     <!-- Subtext for media settings when the player will be shown [CHAR LIMIT=50] -->
     <string name="media_controls_show_player">Show player</string>
     <!-- Subtext for media settings when no players can be shown [CHAR LIMIT=50] -->
     <string name="media_controls_no_players">No players available</string>
+    <!-- Subtitle for section of media control settings that shows which apps are allowed [CHAR LIMIT=50] -->
+    <string name="media_controls_apps_title">Allowed apps</string>
     <!-- Keywords for the media controls setting [CHAR LIMIT=NONE]-->
     <string name="keywords_media_controls">media</string>
 </resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index c74a1a2..1be8ba0 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -618,7 +618,7 @@
 
     <style name="TextAppearance.NotificationImportanceButton">
         <item name="android:textSize">@dimen/notification_importance_button_text</item>
-        <item name="android:fontFamily">@*android:string/config_bodyFontFamilyMedium</item>
+        <item name="android:fontFamily">@*android:string/config_headlineFontFamilyMedium</item>
         <item name="android:gravity">center</item>
     </style>
 
diff --git a/res/xml/adaptive_connectivity_settings.xml b/res/xml/adaptive_connectivity_settings.xml
new file mode 100644
index 0000000..ff9bdb0
--- /dev/null
+++ b/res/xml/adaptive_connectivity_settings.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2020 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<PreferenceScreen
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:settings="http://schemas.android.com/apk/res-auto"
+    android:title="@string/adaptive_connectivity_title">
+
+    <com.android.settingslib.widget.LayoutPreference
+        android:key="adaptive_connectivity_header"
+        android:layout="@layout/adaptive_connectivity_header"
+        android:persistent="false"
+        android:selectable="false"
+        android:title="@string/summary_placeholder"
+        settings:allowDividerBelow="true"
+        settings:searchable="false"/>
+
+    <SwitchPreference
+        android:key="adaptive_connectivity"
+        android:title="@string/adaptive_connectivity_title"
+        android:summary="@string/adaptive_connectivity_summary"
+        settings:allowDividerAbove="true"
+        settings:controller="com.android.settings.network.AdaptiveConnectivityTogglePreferenceController"/>
+
+</PreferenceScreen>
diff --git a/res/xml/media_controls_settings.xml b/res/xml/media_controls_settings.xml
index 3f0483f..3ace6a0 100644
--- a/res/xml/media_controls_settings.xml
+++ b/res/xml/media_controls_settings.xml
@@ -28,4 +28,9 @@
         app:controller="com.android.settings.sound.MediaControlsPreferenceController"
         app:allowDividerAbove="true" />
 
+    <PreferenceCategory
+        android:key="media_controls_resumable_apps"
+        android:title="@string/media_controls_apps_title"
+        app:controller="com.android.settings.sound.ResumableMediaAppsController" />
+
 </PreferenceScreen>
diff --git a/res/xml/network_and_internet.xml b/res/xml/network_and_internet.xml
index eaa7808..6bf6dba 100644
--- a/res/xml/network_and_internet.xml
+++ b/res/xml/network_and_internet.xml
@@ -118,4 +118,11 @@
         android:positiveButtonText="@string/save"
         android:negativeButtonText="@android:string/cancel" />
 
+    <Preference
+        android:fragment="com.android.settings.network.AdaptiveConnectivitySettings"
+        android:key="adaptive_connectivity"
+        android:title="@string/adaptive_connectivity_title"
+        android:summary="@string/summary_placeholder"
+        android:order="25"
+        settings:controller="com.android.settings.network.AdaptiveConnectivityPreferenceController"/>
 </PreferenceScreen>
diff --git a/res/xml/wifi_network_details_fragment2.xml b/res/xml/wifi_network_details_fragment2.xml
index 92f68cc..181b799 100644
--- a/res/xml/wifi_network_details_fragment2.xml
+++ b/res/xml/wifi_network_details_fragment2.xml
@@ -106,6 +106,11 @@
                 android:selectable="false"
                 settings:enableCopying="true"/>
         <Preference
+                android:key="eap_sim_subscription"
+                android:title="@string/sim_card"
+                android:selectable="false"
+                settings:enableCopying="true"/>
+        <Preference
                 android:key="mac_address"
                 android:title="@string/wifi_advanced_randomized_mac_address_title"
                 android:selectable="false"
diff --git a/src/com/android/settings/applications/manageapplications/AppFilterRegistry.java b/src/com/android/settings/applications/manageapplications/AppFilterRegistry.java
index 58907a7..28e0850 100644
--- a/src/com/android/settings/applications/manageapplications/AppFilterRegistry.java
+++ b/src/com/android/settings/applications/manageapplications/AppFilterRegistry.java
@@ -58,12 +58,12 @@
     // Filters will appear sorted based on their value defined here.
     public static final int FILTER_APPS_POWER_WHITELIST = 0;
     public static final int FILTER_APPS_POWER_WHITELIST_ALL = 1;
-    public static final int FILTER_APPS_ALL = 2;
-    public static final int FILTER_APPS_ENABLED = 3;
-    public static final int FILTER_APPS_INSTANT = 4;
-    public static final int FILTER_APPS_DISABLED = 5;
-    public static final int FILTER_APPS_RECENT = 6;
-    public static final int FILTER_APPS_FREQUENT = 7;
+    public static final int FILTER_APPS_RECENT = 2;
+    public static final int FILTER_APPS_FREQUENT = 3;
+    public static final int FILTER_APPS_ALL = 4;
+    public static final int FILTER_APPS_ENABLED = 5;
+    public static final int FILTER_APPS_INSTANT = 6;
+    public static final int FILTER_APPS_DISABLED = 7;
     public static final int FILTER_APPS_PERSONAL = 8;
     public static final int FILTER_APPS_WORK = 9;
     public static final int FILTER_APPS_USAGE_ACCESS = 10;
diff --git a/src/com/android/settings/applications/manageapplications/ManageApplications.java b/src/com/android/settings/applications/manageapplications/ManageApplications.java
index 5ef1232..b46e11c 100644
--- a/src/com/android/settings/applications/manageapplications/ManageApplications.java
+++ b/src/com/android/settings/applications/manageapplications/ManageApplications.java
@@ -476,7 +476,7 @@
             mFilterAdapter.enableFilter(FILTER_APPS_RECENT);
             mFilterAdapter.enableFilter(FILTER_APPS_FREQUENT);
             mFilterAdapter.enableFilter(FILTER_APPS_BLOCKED);
-            mFilterAdapter.disableFilter(FILTER_APPS_ALL);
+            mFilterAdapter.enableFilter(FILTER_APPS_ALL);
         }
         if (mListType == LIST_TYPE_HIGH_POWER) {
             mFilterAdapter.enableFilter(FILTER_APPS_POWER_WHITELIST_ALL);
@@ -1089,12 +1089,16 @@
             mAppFilter = appFilter;
 
             // Notification filters require resorting the list
-            if (FILTER_APPS_FREQUENT == appFilter.getFilterType()) {
-                rebuild(R.id.sort_order_frequent_notification);
-            } else if (FILTER_APPS_RECENT == appFilter.getFilterType()) {
-                rebuild(R.id.sort_order_recent_notification);
-            } else if (FILTER_APPS_BLOCKED == appFilter.getFilterType()) {
-                rebuild(R.id.sort_order_alpha);
+            if (mManageApplications.mListType == LIST_TYPE_NOTIFICATION) {
+                if (FILTER_APPS_FREQUENT == appFilter.getFilterType()) {
+                    rebuild(R.id.sort_order_frequent_notification);
+                } else if (FILTER_APPS_RECENT == appFilter.getFilterType()) {
+                    rebuild(R.id.sort_order_recent_notification);
+                } else if (FILTER_APPS_BLOCKED == appFilter.getFilterType()) {
+                    rebuild(R.id.sort_order_alpha);
+                } else {
+                    rebuild(R.id.sort_order_alpha);
+                }
             } else {
                 rebuild();
             }
diff --git a/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessController.java b/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessController.java
index 727870c..e6b389a 100644
--- a/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessController.java
+++ b/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessController.java
@@ -40,20 +40,13 @@
 
     private static final String TAG = "ZenAccessController";
 
-    private final ActivityManager mActivityManager;
-
     public ZenAccessController(Context context, String preferenceKey) {
         super(context, preferenceKey);
-        mActivityManager = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
     }
 
     @Override
     public int getAvailabilityStatus() {
-        return isSupported(mActivityManager) ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
-    }
-
-    public static boolean isSupported(ActivityManager activityManager) {
-        return !activityManager.isLowRamDevice();
+        return AVAILABLE;
     }
 
     public static Set<String> getPackagesRequestingNotificationPolicyAccess() {
diff --git a/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessDetails.java b/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessDetails.java
index a18e7d6..ba6bb1d 100644
--- a/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessDetails.java
+++ b/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessDetails.java
@@ -50,9 +50,6 @@
     @Override
     protected boolean refreshUi() {
         final Context context = getContext();
-        if (!ZenAccessController.isSupported(context.getSystemService(ActivityManager.class))) {
-            return false;
-        }
         // If this app didn't declare this permission in their manifest, don't bother showing UI.
         final Set<String> needAccessApps =
                 ZenAccessController.getPackagesRequestingNotificationPolicyAccess();
diff --git a/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessSettingObserverMixin.java b/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessSettingObserverMixin.java
index 30507ef..da238f6 100644
--- a/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessSettingObserverMixin.java
+++ b/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessSettingObserverMixin.java
@@ -53,9 +53,6 @@
 
     @Override
     public void onStart() {
-        if (!ZenAccessController.isSupported(mContext.getSystemService(ActivityManager.class))) {
-            return;
-        }
         mContext.getContentResolver().registerContentObserver(
                 Settings.Secure.getUriFor(
                         Settings.Secure.ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES),
@@ -69,9 +66,6 @@
 
     @Override
     public void onStop() {
-        if (!ZenAccessController.isSupported(mContext.getSystemService(ActivityManager.class))) {
-            return;
-        }
         mContext.getContentResolver().unregisterContentObserver(this /* observer */);
     }
 }
diff --git a/src/com/android/settings/biometrics/face/FaceEnrollAccessibilityDialog.java b/src/com/android/settings/biometrics/face/FaceEnrollAccessibilityDialog.java
new file mode 100644
index 0000000..7042870
--- /dev/null
+++ b/src/com/android/settings/biometrics/face/FaceEnrollAccessibilityDialog.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2020 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.biometrics.face;
+
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.app.settings.SettingsEnums;
+import android.os.Bundle;
+
+import com.android.settings.R;
+import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
+
+/**
+ * Confirmation dialog shown to users with accessibility enabled who are trying to start the
+ * non-accessibility enrollment flow.
+ */
+public class FaceEnrollAccessibilityDialog extends InstrumentedDialogFragment {
+    private AlertDialog.OnClickListener mPositiveButtonListener;
+
+    /**
+     * @return new instance of the dialog
+     */
+    public static FaceEnrollAccessibilityDialog newInstance() {
+        return new FaceEnrollAccessibilityDialog();
+    }
+
+    public void setPositiveButtonListener(AlertDialog.OnClickListener listener) {
+        mPositiveButtonListener = listener;
+    }
+
+    @Override
+    public Dialog onCreateDialog(Bundle savedInstanceState) {
+        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
+
+        final int titleResId =
+                R.string.security_settings_face_enroll_education_accessibility_dialog_message;
+        final int negativeButtonResId =
+                R.string.security_settings_face_enroll_education_accessibility_dialog_negative;
+        final int positiveButtonResId =
+                R.string.security_settings_face_enroll_education_accessibility_dialog_positive;
+
+        builder.setMessage(titleResId)
+                .setNegativeButton(negativeButtonResId, (dialog, which) -> {
+                    dialog.cancel();
+                })
+                .setPositiveButton(positiveButtonResId, (dialog, which) -> {
+                    mPositiveButtonListener.onClick(dialog, which);
+                });
+
+        return builder.create();
+    }
+
+    @Override
+    public int getMetricsCategory() {
+        return SettingsEnums.FACE_ENROLL_INTRO;
+    }
+}
diff --git a/src/com/android/settings/biometrics/face/FaceEnrollEducation.java b/src/com/android/settings/biometrics/face/FaceEnrollEducation.java
index 3b84c35..4c4fa11 100644
--- a/src/com/android/settings/biometrics/face/FaceEnrollEducation.java
+++ b/src/com/android/settings/biometrics/face/FaceEnrollEducation.java
@@ -55,6 +55,7 @@
     private Intent mResultIntent;
     private TextView mDescriptionText;
     private boolean mNextClicked;
+    private boolean mAccessibilityEnabled;
 
     private CompoundButton.OnCheckedChangeListener mSwitchDiversityListener =
             new CompoundButton.OnCheckedChangeListener() {
@@ -123,13 +124,12 @@
                 .setTheme(R.style.SudGlifButton_Primary)
                 .build();
 
-        boolean accessibilityEnabled = false;
         final AccessibilityManager accessibilityManager = getApplicationContext().getSystemService(
                 AccessibilityManager.class);
         if (accessibilityManager != null) {
             // Add additional check for touch exploration. This prevents other accessibility
             // features such as Live Transcribe from defaulting to the accessibility setup.
-            accessibilityEnabled = accessibilityManager.isEnabled()
+            mAccessibilityEnabled = accessibilityManager.isEnabled()
                     && accessibilityManager.isTouchExplorationEnabled();
         }
         mFooterBarMixin.setPrimaryButton(footerButton);
@@ -147,7 +147,7 @@
             mSwitchDiversity.getSwitch().toggle();
         });
 
-        if (accessibilityEnabled) {
+        if (mAccessibilityEnabled) {
             accessibilityButton.callOnClick();
         }
     }
@@ -194,9 +194,20 @@
         if (mResultIntent != null) {
             intent.putExtras(mResultIntent);
         }
-        mNextClicked = true;
+
         intent.putExtra(EXTRA_KEY_REQUIRE_DIVERSITY, !mSwitchDiversity.isChecked());
-        startActivityForResult(intent, BIOMETRIC_FIND_SENSOR_REQUEST);
+
+        if (!mSwitchDiversity.isChecked() && mAccessibilityEnabled) {
+            FaceEnrollAccessibilityDialog dialog = FaceEnrollAccessibilityDialog.newInstance();
+            dialog.setPositiveButtonListener((dialog1, which) -> {
+                startActivityForResult(intent, BIOMETRIC_FIND_SENSOR_REQUEST);
+                mNextClicked = true;
+            });
+            dialog.show(getSupportFragmentManager(), FaceEnrollAccessibilityDialog.class.getName());
+        } else {
+            startActivityForResult(intent, BIOMETRIC_FIND_SENSOR_REQUEST);
+            mNextClicked = true;
+        }
     }
 
     protected void onSkipButtonClick(View view) {
diff --git a/src/com/android/settings/fuelgauge/BatteryHeaderPreferenceController.java b/src/com/android/settings/fuelgauge/BatteryHeaderPreferenceController.java
index bfa43d1..468d8c5 100644
--- a/src/com/android/settings/fuelgauge/BatteryHeaderPreferenceController.java
+++ b/src/com/android/settings/fuelgauge/BatteryHeaderPreferenceController.java
@@ -34,6 +34,7 @@
 import com.android.settings.R;
 import com.android.settings.core.BasePreferenceController;
 import com.android.settings.core.PreferenceControllerMixin;
+import com.android.settings.overlay.FeatureFactory;
 import com.android.settings.widget.EntityHeaderController;
 import com.android.settingslib.Utils;
 import com.android.settingslib.core.lifecycle.Lifecycle;
@@ -50,6 +51,8 @@
     static final String KEY_BATTERY_HEADER = "battery_header";
 
     @VisibleForTesting
+    BatteryStatusFeatureProvider mBatteryStatusFeatureProvider;
+    @VisibleForTesting
     BatteryMeterView mBatteryMeterView;
     @VisibleForTesting
     TextView mBatteryPercentText;
@@ -66,6 +69,8 @@
     public BatteryHeaderPreferenceController(Context context, String key) {
         super(context, key);
         mPowerManager = context.getSystemService(PowerManager.class);
+        mBatteryStatusFeatureProvider = FeatureFactory.getFactory(context)
+                .getBatteryStatusFeatureProvider(context);
     }
 
     public void setActivity(Activity activity) {
@@ -107,10 +112,12 @@
 
     public void updateHeaderPreference(BatteryInfo info) {
         mBatteryPercentText.setText(formatBatteryPercentageText(info.batteryLevel));
-        if (info.remainingLabel == null) {
-            mSummary1.setText(info.statusLabel);
-        } else {
-            mSummary1.setText(info.remainingLabel);
+        if (!mBatteryStatusFeatureProvider.triggerBatteryStatusUpdate(this, info)) {
+            if (info.remainingLabel == null) {
+                mSummary1.setText(info.statusLabel);
+            } else {
+                mSummary1.setText(info.remainingLabel);
+            }
         }
 
         mBatteryMeterView.setBatteryLevel(info.batteryLevel);
@@ -118,6 +125,13 @@
         mBatteryMeterView.setPowerSave(mPowerManager.isPowerSaveMode());
     }
 
+    /**
+     * Callback which receives text for the summary line.
+     */
+    public void updateBatteryStatus(String statusLabel) {
+        mSummary1.setText(statusLabel);
+    }
+
     public void quickUpdateHeaderPreference() {
         Intent batteryBroadcast = mContext.registerReceiver(null,
                 new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
diff --git a/src/com/android/settings/fuelgauge/BatteryStatusFeatureProvider.java b/src/com/android/settings/fuelgauge/BatteryStatusFeatureProvider.java
new file mode 100644
index 0000000..c3fc247
--- /dev/null
+++ b/src/com/android/settings/fuelgauge/BatteryStatusFeatureProvider.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2020 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.fuelgauge;
+
+/**
+ * Feature Provider used to retrieve battery status
+ */
+public interface BatteryStatusFeatureProvider {
+
+    /**
+     * Trigger a battery status update; return false if built-in status should be used.
+     */
+    boolean triggerBatteryStatusUpdate(
+            BatteryHeaderPreferenceController batteryHeaderPreferenceController, BatteryInfo info);
+}
diff --git a/src/com/android/settings/fuelgauge/BatteryStatusFeatureProviderImpl.java b/src/com/android/settings/fuelgauge/BatteryStatusFeatureProviderImpl.java
new file mode 100644
index 0000000..47d376d
--- /dev/null
+++ b/src/com/android/settings/fuelgauge/BatteryStatusFeatureProviderImpl.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2020 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.fuelgauge;
+
+import android.content.Context;
+
+/**
+ * Used to override battery status string in Battery Header.
+ */
+public class BatteryStatusFeatureProviderImpl implements BatteryStatusFeatureProvider {
+
+    protected Context mContext;
+
+    public BatteryStatusFeatureProviderImpl(Context context) {
+        mContext = context.getApplicationContext();
+    }
+
+    @Override
+    public boolean triggerBatteryStatusUpdate(
+            BatteryHeaderPreferenceController batteryHeaderPreferenceController, BatteryInfo info) {
+        return false;
+    }
+}
diff --git a/src/com/android/settings/network/AdaptiveConnectivityPreferenceController.java b/src/com/android/settings/network/AdaptiveConnectivityPreferenceController.java
new file mode 100644
index 0000000..33d1d5b
--- /dev/null
+++ b/src/com/android/settings/network/AdaptiveConnectivityPreferenceController.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.network;
+
+import android.content.Context;
+import android.provider.Settings;
+
+import androidx.preference.PreferenceScreen;
+
+import com.android.settings.R;
+import com.android.settings.core.BasePreferenceController;
+
+/**
+ * {@link BasePreferenceController} that shows Adaptive connectivity on/off state.
+ */
+public class AdaptiveConnectivityPreferenceController extends BasePreferenceController {
+
+    public AdaptiveConnectivityPreferenceController(Context context, String preferenceKey) {
+        super(context, preferenceKey);
+    }
+
+    @Override
+    public void displayPreference(PreferenceScreen screen) {
+        super.displayPreference(screen);
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        return mContext.getResources().getBoolean(R.bool.config_show_adaptive_connectivity)
+                ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
+    }
+
+    @Override
+    public CharSequence getSummary() {
+        return Settings.Secure.getInt(mContext.getContentResolver(),
+                Settings.Secure.ADAPTIVE_CONNECTIVITY_ENABLED, 1) == 1
+                ? mContext.getString(R.string.switch_on_text)
+                : mContext.getString(R.string.switch_off_text);
+    }
+}
diff --git a/src/com/android/settings/network/AdaptiveConnectivitySettings.java b/src/com/android/settings/network/AdaptiveConnectivitySettings.java
new file mode 100644
index 0000000..5e1dc12
--- /dev/null
+++ b/src/com/android/settings/network/AdaptiveConnectivitySettings.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.settings.network;
+
+import android.app.settings.SettingsEnums;
+
+import com.android.settings.R;
+import com.android.settings.dashboard.DashboardFragment;
+import com.android.settings.search.BaseSearchIndexProvider;
+import com.android.settingslib.search.SearchIndexable;
+
+/**
+ * Adaptive connectivity is a feature which automatically manages network connections.
+ */
+@SearchIndexable
+public class AdaptiveConnectivitySettings extends DashboardFragment {
+
+    private static final String TAG = "AdaptiveConnectivitySettings";
+
+    private static final String KEY_ADAPTIVE_CONNECTIVITY_PREFERENCE = "adaptive_connectivity";
+
+    @Override
+    public int getMetricsCategory() {
+        return SettingsEnums.ADAPTIVE_CONNECTIVITY_CATEGORY;
+    }
+
+    @Override
+    protected String getLogTag() {
+        return TAG;
+    }
+
+    @Override
+    protected int getPreferenceScreenResId() {
+        return R.xml.adaptive_connectivity_settings;
+    }
+
+    public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
+            new BaseSearchIndexProvider(R.xml.adaptive_connectivity_settings);
+}
diff --git a/src/com/android/settings/network/AdaptiveConnectivityTogglePreferenceController.java b/src/com/android/settings/network/AdaptiveConnectivityTogglePreferenceController.java
new file mode 100644
index 0000000..e072b5c
--- /dev/null
+++ b/src/com/android/settings/network/AdaptiveConnectivityTogglePreferenceController.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.network;
+
+import android.content.Context;
+import android.provider.Settings;
+
+import androidx.preference.PreferenceScreen;
+
+import com.android.settings.core.TogglePreferenceController;
+
+/**
+ * {@link TogglePreferenceController} that controls whether Adaptive connectivity option is enabled.
+ */
+public class AdaptiveConnectivityTogglePreferenceController extends TogglePreferenceController {
+
+    public AdaptiveConnectivityTogglePreferenceController(Context context, String preferenceKey) {
+        super(context, preferenceKey);
+    }
+
+    @Override
+    public void displayPreference(PreferenceScreen screen) {
+        super.displayPreference(screen);
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        return AVAILABLE;
+    }
+
+    @Override
+    public boolean isChecked() {
+        return Settings.Secure.getInt(mContext.getContentResolver(),
+                Settings.Secure.ADAPTIVE_CONNECTIVITY_ENABLED, 1) == 1;
+    }
+
+    @Override
+    public boolean setChecked(boolean isChecked) {
+        Settings.Secure.putInt(mContext.getContentResolver(),
+                Settings.Secure.ADAPTIVE_CONNECTIVITY_ENABLED,
+                isChecked ? 1 : 0);
+        return true;
+    }
+}
diff --git a/src/com/android/settings/network/telephony/MobileNetworkUtils.java b/src/com/android/settings/network/telephony/MobileNetworkUtils.java
index 3b5e6e0..9339d68 100644
--- a/src/com/android/settings/network/telephony/MobileNetworkUtils.java
+++ b/src/com/android/settings/network/telephony/MobileNetworkUtils.java
@@ -48,6 +48,7 @@
 import android.telecom.PhoneAccountHandle;
 import android.telecom.TelecomManager;
 import android.telephony.CarrierConfigManager;
+import android.telephony.ServiceState;
 import android.telephony.SubscriptionInfo;
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
@@ -475,8 +476,9 @@
         if (carrierConfig.getBoolean(CarrierConfigManager.KEY_SUPPORT_TDSCDMA_BOOL)) {
             return true;
         }
-
-        final String operatorNumeric = telephonyManager.getServiceState().getOperatorNumeric();
+        final ServiceState serviceState = telephonyManager.getServiceState();
+        final String operatorNumeric =
+                (serviceState != null) ? serviceState.getOperatorNumeric() : null;
         final String[] numericArray = carrierConfig.getStringArray(
                 CarrierConfigManager.KEY_SUPPORT_TDSCDMA_ROAMING_NETWORKS_STRING_ARRAY);
         if (numericArray == null || operatorNumeric == null) {
diff --git a/src/com/android/settings/network/telephony/NetworkSelectSettings.java b/src/com/android/settings/network/telephony/NetworkSelectSettings.java
index ba803e3..ff641e9 100644
--- a/src/com/android/settings/network/telephony/NetworkSelectSettings.java
+++ b/src/com/android/settings/network/telephony/NetworkSelectSettings.java
@@ -405,6 +405,9 @@
         if (mTelephonyManager.getDataState() == mTelephonyManager.DATA_CONNECTED) {
             // Try to get the network registration states
             final ServiceState ss = mTelephonyManager.getServiceState();
+            if (ss == null) {
+                return;
+            }
             final List<NetworkRegistrationInfo> networkList =
                     ss.getNetworkRegistrationInfoListForTransportType(
                             AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
diff --git a/src/com/android/settings/network/telephony/RenameMobileNetworkDialogFragment.java b/src/com/android/settings/network/telephony/RenameMobileNetworkDialogFragment.java
index e53a452..abcf621 100644
--- a/src/com/android/settings/network/telephony/RenameMobileNetworkDialogFragment.java
+++ b/src/com/android/settings/network/telephony/RenameMobileNetworkDialogFragment.java
@@ -163,7 +163,7 @@
         final TextView operatorName = view.findViewById(R.id.operator_name_value);
         mTelephonyManager = mTelephonyManager.createForSubscriptionId(mSubId);
         final ServiceState serviceState = mTelephonyManager.getServiceState();
-        operatorName.setText(serviceState.getOperatorAlphaLong());
+        operatorName.setText(serviceState == null ? "" : serviceState.getOperatorAlphaLong());
 
         final TextView phoneTitle = view.findViewById(R.id.number_label);
         phoneTitle.setVisibility(info.isOpportunistic() ? View.GONE : View.VISIBLE);
diff --git a/src/com/android/settings/network/telephony/gsm/AutoSelectPreferenceController.java b/src/com/android/settings/network/telephony/gsm/AutoSelectPreferenceController.java
index 361f58e..d981362 100644
--- a/src/com/android/settings/network/telephony/gsm/AutoSelectPreferenceController.java
+++ b/src/com/android/settings/network/telephony/gsm/AutoSelectPreferenceController.java
@@ -29,6 +29,7 @@
 import android.os.SystemClock;
 import android.provider.Settings;
 import android.telephony.CarrierConfigManager;
+import android.telephony.ServiceState;
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
 
@@ -125,7 +126,13 @@
         super.updateState(preference);
 
         preference.setSummary(null);
-        if (mTelephonyManager.getServiceState().getRoaming()) {
+        final ServiceState serviceState = mTelephonyManager.getServiceState();
+        if (serviceState == null) {
+            preference.setEnabled(false);
+            return;
+        }
+
+        if (serviceState.getRoaming()) {
             preference.setEnabled(true);
         } else {
             preference.setEnabled(!mOnlyAutoSelectInHome);
diff --git a/src/com/android/settings/notification/app/BlockPreferenceController.java b/src/com/android/settings/notification/app/BlockPreferenceController.java
index f55ea8c..2738962 100644
--- a/src/com/android/settings/notification/app/BlockPreferenceController.java
+++ b/src/com/android/settings/notification/app/BlockPreferenceController.java
@@ -106,8 +106,11 @@
             // It's always safe to override the importance if it's meant to be blocked or if
             // it was blocked and we are unblocking it.
             if (blocked || originalImportance == IMPORTANCE_NONE) {
-                final int importance = blocked ? IMPORTANCE_NONE
-                        : isDefaultChannel() ? IMPORTANCE_UNSPECIFIED : IMPORTANCE_DEFAULT;
+                final int importance = blocked
+                        ? IMPORTANCE_NONE
+                        : isDefaultChannel()
+                                ? IMPORTANCE_UNSPECIFIED
+                                : mChannel.getOriginalImportance();
                 mChannel.setImportance(importance);
                 saveChannel();
             }
diff --git a/src/com/android/settings/notification/app/BubblePreference.java b/src/com/android/settings/notification/app/BubblePreference.java
index 7e071ff..f0046d7 100644
--- a/src/com/android/settings/notification/app/BubblePreference.java
+++ b/src/com/android/settings/notification/app/BubblePreference.java
@@ -45,8 +45,6 @@
     private int mSelectedPreference;
 
     private Context mContext;
-    private Drawable mSelectedBackground;
-    private Drawable mUnselectedBackground;
 
     private ButtonViewHolder mBubbleAllButton;
     private ButtonViewHolder mBubbleSelectedButton;
@@ -72,8 +70,6 @@
         mHelper = new RestrictedPreferenceHelper(context, this, attrs);
         mHelper.useAdminDisabledSummary(true);
         mContext = context;
-        mSelectedBackground = mContext.getDrawable(R.drawable.button_border_selected);
-        mUnselectedBackground = mContext.getDrawable(R.drawable.button_border_unselected);
         setLayoutResource(R.layout.bubble_preference);
     }
 
@@ -167,7 +163,9 @@
         }
 
         void setSelected(Context context, boolean selected) {
-            mView.setBackground(selected ?  mSelectedBackground : mUnselectedBackground);
+            mView.setBackground(mContext.getDrawable(selected
+                ? R.drawable.button_border_selected
+                : R.drawable.button_border_unselected));
             mView.setSelected(selected);
 
             ColorStateList stateList = selected
diff --git a/src/com/android/settings/notification/app/BubblePreferenceController.java b/src/com/android/settings/notification/app/BubblePreferenceController.java
index 1aed156..722b279 100644
--- a/src/com/android/settings/notification/app/BubblePreferenceController.java
+++ b/src/com/android/settings/notification/app/BubblePreferenceController.java
@@ -77,7 +77,7 @@
             if (isDefaultChannel()) {
                 return true;
             } else {
-                return mAppRow != null;
+                return mAppRow != null &&  mAppRow.bubblePreference != BUBBLE_PREFERENCE_NONE;
             }
         }
         return true;
diff --git a/src/com/android/settings/notification/app/ChannelListPreferenceController.java b/src/com/android/settings/notification/app/ChannelListPreferenceController.java
index b19fc71..8a34672 100644
--- a/src/com/android/settings/notification/app/ChannelListPreferenceController.java
+++ b/src/com/android/settings/notification/app/ChannelListPreferenceController.java
@@ -207,17 +207,14 @@
         channelPref.setOnPreferenceChangeListener(
                 (preference, o) -> {
                     boolean value = (Boolean) o;
-                    int importance = value ? IMPORTANCE_LOW : IMPORTANCE_NONE;
+                    int importance = value ? channel.getOriginalImportance() : IMPORTANCE_NONE;
                     channel.setImportance(importance);
-                    channel.lockFields(
-                            NotificationChannel.USER_LOCKED_IMPORTANCE);
+                    channel.lockFields(NotificationChannel.USER_LOCKED_IMPORTANCE);
                     MasterSwitchPreference channelPref1 = (MasterSwitchPreference) preference;
                     channelPref1.setIcon(null);
                     if (channel.getImportance() > IMPORTANCE_LOW) {
                         channelPref1.setIcon(getAlertingIcon());
                     }
-                    toggleBehaviorIconState(channelPref1.getIcon(),
-                            importance != IMPORTANCE_NONE);
                     mBackend.updateChannel(mAppRow.pkg, mAppRow.uid, channel);
 
                     return true;
@@ -234,24 +231,6 @@
         return icon;
     }
 
-    private void toggleBehaviorIconState(Drawable icon, boolean enabled) {
-        if (icon == null) return;
-
-        LayerDrawable layerDrawable = (LayerDrawable) icon;
-        GradientDrawable background =
-                (GradientDrawable) layerDrawable.findDrawableByLayerId(R.id.back);
-
-        if (background == null) return;
-
-        if (enabled) {
-            background.clearColorFilter();
-        } else {
-            background.setColorFilter(new BlendModeColorFilter(
-                    mContext.getColor(R.color.material_grey_300),
-                    BlendMode.SRC_IN));
-        }
-    }
-
     protected void onGroupBlockStateChanged(NotificationChannelGroup group) {
         if (group == null) {
             return;
diff --git a/src/com/android/settings/notification/app/ConversationPriorityPreference.java b/src/com/android/settings/notification/app/ConversationPriorityPreference.java
index 307abec..67bffbf 100644
--- a/src/com/android/settings/notification/app/ConversationPriorityPreference.java
+++ b/src/com/android/settings/notification/app/ConversationPriorityPreference.java
@@ -50,8 +50,6 @@
     private View mAlertButton;
     private View mPriorityButton;
     private Context mContext;
-    Drawable selectedBackground;
-    Drawable unselectedBackground;
     private static final int BUTTON_ANIM_TIME_MS = 100;
 
     public ConversationPriorityPreference(Context context, AttributeSet attrs,
@@ -77,8 +75,6 @@
 
     private void init(Context context) {
         mContext = context;
-        selectedBackground = mContext.getDrawable(R.drawable.button_border_selected);
-        unselectedBackground = mContext.getDrawable(R.drawable.button_border_unselected);
         setLayoutResource(R.layout.notif_priority_conversation_preference);
     }
 
@@ -148,86 +144,43 @@
             TransitionManager.beginDelayedTransition(parent, transition);
         }
 
-        ColorStateList colorAccent = getAccentTint();
-        ColorStateList colorNormal = getRegularTint();
-        ImageView silenceIcon = parent.findViewById(R.id.silence_icon);
-        TextView silenceLabel = parent.findViewById(R.id.silence_label);
-        TextView silenceSummary = parent.findViewById(R.id.silence_summary);
-        ImageView alertIcon = parent.findViewById(R.id.alert_icon);
-        TextView alertLabel = parent.findViewById(R.id.alert_label);
-        TextView alertSummary = parent.findViewById(R.id.alert_summary);
-        ImageView priorityIcon = parent.findViewById(R.id.priority_icon);
-        TextView priorityLabel = parent.findViewById(R.id.priority_label);
-        TextView prioritySummary = parent.findViewById(R.id.priority_summary);
-
         if (importance <= IMPORTANCE_LOW && importance > IMPORTANCE_UNSPECIFIED) {
-            alertSummary.setVisibility(GONE);
-            alertIcon.setImageTintList(colorNormal);
-            alertLabel.setTextColor(colorNormal);
-
-            prioritySummary.setVisibility(GONE);
-            priorityIcon.setImageTintList(colorNormal);
-            priorityLabel.setTextColor(colorNormal);
-
-            silenceIcon.setImageTintList(colorAccent);
-            silenceLabel.setTextColor(colorAccent);
-            silenceSummary.setVisibility(VISIBLE);
-
-            mAlertButton.setBackground(unselectedBackground);
-            mPriorityButton.setBackground(unselectedBackground);
-            mSilenceButton.setBackground(selectedBackground);
-            // a11y service won't always read the newly appearing text in the right order if the
-            // selection happens too soon (readback happens on a different thread as layout). post
-            // the selection to make that conflict less likely
-            parent.post(() -> {
-                mSilenceButton.setSelected(true);
-                mAlertButton.setSelected(false);
-                mPriorityButton.setSelected(false);
-            });
+            setSelected(mPriorityButton, false);
+            setSelected(mAlertButton, false);
+            setSelected(mSilenceButton, true);
         } else {
             if (isPriority) {
-                alertSummary.setVisibility(GONE);
-                alertIcon.setImageTintList(colorNormal);
-                alertLabel.setTextColor(colorNormal);
-
-                prioritySummary.setVisibility(VISIBLE);
-                priorityIcon.setImageTintList(colorAccent);
-                priorityLabel.setTextColor(colorAccent);
-
-                silenceIcon.setImageTintList(colorNormal);
-                silenceLabel.setTextColor(colorNormal);
-                silenceSummary.setVisibility(GONE);
-
-                mAlertButton.setBackground(unselectedBackground);
-                mPriorityButton.setBackground(selectedBackground);
-                mSilenceButton.setBackground(unselectedBackground);
-                parent.post(() -> {
-                    mSilenceButton.setSelected(false);
-                    mAlertButton.setSelected(false);
-                    mPriorityButton.setSelected(true);
-                });
+                setSelected(mPriorityButton, true);
+                setSelected(mAlertButton, false);
+                setSelected(mSilenceButton, false);
             } else {
-                alertSummary.setVisibility(VISIBLE);
-                alertIcon.setImageTintList(colorAccent);
-                alertLabel.setTextColor(colorAccent);
-
-                prioritySummary.setVisibility(GONE);
-                priorityIcon.setImageTintList(colorNormal);
-                priorityLabel.setTextColor(colorNormal);
-
-                silenceIcon.setImageTintList(colorNormal);
-                silenceLabel.setTextColor(colorNormal);
-                silenceSummary.setVisibility(GONE);
-
-                mAlertButton.setBackground(selectedBackground);
-                mPriorityButton.setBackground(unselectedBackground);
-                mSilenceButton.setBackground(unselectedBackground);
-                parent.post(() -> {
-                    mSilenceButton.setSelected(false);
-                    mAlertButton.setSelected(true);
-                    mPriorityButton.setSelected(false);
-                });
+                setSelected(mPriorityButton, false);
+                setSelected(mAlertButton, true);
+                setSelected(mSilenceButton, false);
             }
         }
     }
+
+    void setSelected(View view, boolean selected) {
+        ColorStateList colorAccent = getAccentTint();
+        ColorStateList colorNormal = getRegularTint();
+
+        ImageView icon = view.findViewById(R.id.icon);
+        TextView label = view.findViewById(R.id.label);
+        TextView summary = view.findViewById(R.id.summary);
+
+        icon.setImageTintList(selected ? colorAccent : colorNormal);
+        label.setTextColor(selected ? colorAccent : colorNormal);
+        summary.setVisibility(selected ? VISIBLE : GONE);
+
+        view.setBackground(mContext.getDrawable(selected
+                ? R.drawable.button_border_selected
+                : R.drawable.button_border_unselected));
+        // a11y service won't always read the newly appearing text in the right order if the
+        // selection happens too soon (readback happens on a different thread as layout). post
+        // the selection to make that conflict less likely
+        view.post(() -> {
+            view.setSelected(selected);
+        });
+    }
 }
diff --git a/src/com/android/settings/notification/history/NotificationHistoryActivity.java b/src/com/android/settings/notification/history/NotificationHistoryActivity.java
index 7635a4f..b184740 100644
--- a/src/com/android/settings/notification/history/NotificationHistoryActivity.java
+++ b/src/com/android/settings/notification/history/NotificationHistoryActivity.java
@@ -155,21 +155,22 @@
 
             final View container = viewForPackage.findViewById(R.id.notification_list);
             container.setVisibility(View.GONE);
-            ImageButton expand = viewForPackage.findViewById(R.id.expand);
-            expand.setContentDescription(container.getVisibility() == View.VISIBLE
+            View header = viewForPackage.findViewById(R.id.app_header);
+            ImageView expand = viewForPackage.findViewById(R.id.expand);
+            header.setStateDescription(container.getVisibility() == View.VISIBLE
                     ? getString(R.string.condition_expand_hide)
                     : getString(R.string.condition_expand_show));
             int finalI = i;
-            expand.setOnClickListener(v -> {
+            header.setOnClickListener(v -> {
                 container.setVisibility(container.getVisibility() == View.VISIBLE
                         ? View.GONE : View.VISIBLE);
                 expand.setImageResource(container.getVisibility() == View.VISIBLE
                         ? R.drawable.ic_expand_less
                         : com.android.internal.R.drawable.ic_expand_more);
-                expand.setContentDescription(container.getVisibility() == View.VISIBLE
+                header.setStateDescription(container.getVisibility() == View.VISIBLE
                         ? getString(R.string.condition_expand_hide)
                         : getString(R.string.condition_expand_show));
-                expand.sendAccessibilityEvent(TYPE_VIEW_ACCESSIBILITY_FOCUSED);
+                header.sendAccessibilityEvent(TYPE_VIEW_ACCESSIBILITY_FOCUSED);
                 mUiEventLogger.logWithPosition(
                         (container.getVisibility() == View.VISIBLE)
                             ? NotificationHistoryEvent.NOTIFICATION_HISTORY_PACKAGE_HISTORY_OPEN
diff --git a/src/com/android/settings/notification/history/NotificationHistoryViewHolder.java b/src/com/android/settings/notification/history/NotificationHistoryViewHolder.java
index 4991548..da1ed11 100644
--- a/src/com/android/settings/notification/history/NotificationHistoryViewHolder.java
+++ b/src/com/android/settings/notification/history/NotificationHistoryViewHolder.java
@@ -33,7 +33,6 @@
     NotificationHistoryViewHolder(View itemView) {
         super(itemView);
         mTime = itemView.findViewById(R.id.timestamp);
-        mTime.setShowRelativeTime(true);
         mTitle = itemView.findViewById(R.id.title);
         mSummary = itemView.findViewById(R.id.text);
     }
diff --git a/src/com/android/settings/notification/history/NotificationSbnViewHolder.java b/src/com/android/settings/notification/history/NotificationSbnViewHolder.java
index de12847..ac39f88 100644
--- a/src/com/android/settings/notification/history/NotificationSbnViewHolder.java
+++ b/src/com/android/settings/notification/history/NotificationSbnViewHolder.java
@@ -108,7 +108,7 @@
                                 : NotificationHistoryActivity.NotificationHistoryEvent
                                 .NOTIFICATION_HISTORY_RECENT_ITEM_CLICK,
                         uid, pkg, instanceId, position);
-                if (pi != null) {
+                if (pi != null && isPendingIntentValid) {
                     try {
                         pi.send();
                     } catch (PendingIntent.CanceledException e) {
diff --git a/src/com/android/settings/overlay/FeatureFactory.java b/src/com/android/settings/overlay/FeatureFactory.java
index afbce09..b9aa68a 100644
--- a/src/com/android/settings/overlay/FeatureFactory.java
+++ b/src/com/android/settings/overlay/FeatureFactory.java
@@ -31,6 +31,7 @@
 import com.android.settings.dashboard.DashboardFeatureProvider;
 import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
 import com.android.settings.enterprise.EnterprisePrivacyFeatureProvider;
+import com.android.settings.fuelgauge.BatteryStatusFeatureProvider;
 import com.android.settings.fuelgauge.PowerUsageFeatureProvider;
 import com.android.settings.gestures.AssistGestureFeatureProvider;
 import com.android.settings.homepage.contextualcards.ContextualCardFeatureProvider;
@@ -103,6 +104,12 @@
 
     public abstract PowerUsageFeatureProvider getPowerUsageFeatureProvider(Context context);
 
+    /**
+     * Retrieve implementation for Battery Status feature.
+     */
+    public abstract BatteryStatusFeatureProvider getBatteryStatusFeatureProvider(
+            Context context);
+
     public abstract DashboardFeatureProvider getDashboardFeatureProvider(Context context);
 
     public abstract DockUpdaterFeatureProvider getDockUpdaterFeatureProvider();
diff --git a/src/com/android/settings/overlay/FeatureFactoryImpl.java b/src/com/android/settings/overlay/FeatureFactoryImpl.java
index 29beb5b..d4d396f 100644
--- a/src/com/android/settings/overlay/FeatureFactoryImpl.java
+++ b/src/com/android/settings/overlay/FeatureFactoryImpl.java
@@ -42,6 +42,8 @@
 import com.android.settings.dashboard.suggestions.SuggestionFeatureProviderImpl;
 import com.android.settings.enterprise.EnterprisePrivacyFeatureProvider;
 import com.android.settings.enterprise.EnterprisePrivacyFeatureProviderImpl;
+import com.android.settings.fuelgauge.BatteryStatusFeatureProvider;
+import com.android.settings.fuelgauge.BatteryStatusFeatureProviderImpl;
 import com.android.settings.fuelgauge.PowerUsageFeatureProvider;
 import com.android.settings.fuelgauge.PowerUsageFeatureProviderImpl;
 import com.android.settings.gestures.AssistGestureFeatureProvider;
@@ -78,6 +80,7 @@
     private SecurityFeatureProvider mSecurityFeatureProvider;
     private SuggestionFeatureProvider mSuggestionFeatureProvider;
     private PowerUsageFeatureProvider mPowerUsageFeatureProvider;
+    private BatteryStatusFeatureProvider mBatteryStatusFeatureProvider;
     private AssistGestureFeatureProvider mAssistGestureFeatureProvider;
     private UserFeatureProvider mUserFeatureProvider;
     private SlicesFeatureProvider mSlicesFeatureProvider;
@@ -111,6 +114,15 @@
     }
 
     @Override
+    public BatteryStatusFeatureProvider getBatteryStatusFeatureProvider(Context context) {
+        if (mBatteryStatusFeatureProvider == null) {
+            mBatteryStatusFeatureProvider = new BatteryStatusFeatureProviderImpl(
+                    context.getApplicationContext());
+        }
+        return mBatteryStatusFeatureProvider;
+    }
+
+    @Override
     public DashboardFeatureProvider getDashboardFeatureProvider(Context context) {
         if (mDashboardFeatureProvider == null) {
             mDashboardFeatureProvider = new DashboardFeatureProviderImpl(
diff --git a/src/com/android/settings/sim/SimSelectNotification.java b/src/com/android/settings/sim/SimSelectNotification.java
index ae36f35..6bd4c24 100644
--- a/src/com/android/settings/sim/SimSelectNotification.java
+++ b/src/com/android/settings/sim/SimSelectNotification.java
@@ -20,6 +20,7 @@
 import static android.provider.Settings.ENABLE_MMS_DATA_REQUEST_REASON_OUTGOING_MMS;
 import static android.provider.Settings.EXTRA_ENABLE_MMS_DATA_REQUEST_REASON;
 import static android.provider.Settings.EXTRA_SUB_ID;
+import static com.android.settings.Utils.SETTINGS_PACKAGE_NAME;
 import static android.telephony.TelephonyManager.EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE;
 import static android.telephony.TelephonyManager.EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE_ALL;
 import static android.telephony.TelephonyManager.EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE_DATA;
@@ -209,6 +210,7 @@
                 .setContentText(resources.getText(R.string.sim_notification_summary))
                 .setAutoCancel(true);
         Intent resultIntent = new Intent(Settings.ACTION_WIRELESS_SETTINGS);
+        resultIntent.setPackage(SETTINGS_PACKAGE_NAME);
         resultIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         PendingIntent resultPendingIntent = PendingIntent.getActivity(context, 0, resultIntent,
                 PendingIntent.FLAG_CANCEL_CURRENT);
diff --git a/src/com/android/settings/sound/MediaControlsPreferenceController.java b/src/com/android/settings/sound/MediaControlsPreferenceController.java
index 050cf93..219eb24 100644
--- a/src/com/android/settings/sound/MediaControlsPreferenceController.java
+++ b/src/com/android/settings/sound/MediaControlsPreferenceController.java
@@ -35,12 +35,12 @@
     @Override
     public boolean isChecked() {
         int val = Settings.Secure.getInt(mContext.getContentResolver(), MEDIA_CONTROLS_RESUME, 1);
-        return val == 0;
+        return val == 1;
     }
 
     @Override
     public boolean setChecked(boolean isChecked) {
-        int val = isChecked ? 0 : 1;
+        int val = isChecked ? 1 : 0;
         return Settings.Secure.putInt(mContext.getContentResolver(), MEDIA_CONTROLS_RESUME, val);
     }
 
diff --git a/src/com/android/settings/sound/ResumableMediaAppsController.java b/src/com/android/settings/sound/ResumableMediaAppsController.java
new file mode 100644
index 0000000..383cd41
--- /dev/null
+++ b/src/com/android/settings/sound/ResumableMediaAppsController.java
@@ -0,0 +1,138 @@
+/*
+ * Copyright (C) 2020 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.sound;
+
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.graphics.drawable.Drawable;
+import android.provider.Settings;
+import android.service.media.MediaBrowserService;
+import android.text.TextUtils;
+import android.util.ArraySet;
+import android.util.Log;
+
+import androidx.preference.PreferenceGroup;
+import androidx.preference.PreferenceScreen;
+import androidx.preference.SwitchPreference;
+
+import com.android.settings.core.BasePreferenceController;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Section of media controls settings that contains a list of potentially resumable apps
+ */
+public class ResumableMediaAppsController extends BasePreferenceController {
+    private static final String TAG = "ResumableMediaAppsCtrl";
+
+    private PreferenceGroup mPreferenceGroup;
+    private PackageManager mPackageManager;
+    private List<ResolveInfo> mResumeInfo;
+
+    public ResumableMediaAppsController(Context context, String key) {
+        super(context, key);
+        mPackageManager = mContext.getPackageManager();
+        Intent serviceIntent = new Intent(MediaBrowserService.SERVICE_INTERFACE);
+        mResumeInfo = mPackageManager.queryIntentServices(serviceIntent, 0);
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        // Update list, since this will be called when the app goes to onStart / onPause
+        Intent serviceIntent = new Intent(MediaBrowserService.SERVICE_INTERFACE);
+        mResumeInfo = mPackageManager.queryIntentServices(serviceIntent, 0);
+        return (mResumeInfo.size() > 0) ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
+    }
+
+    @Override
+    public void displayPreference(PreferenceScreen screen) {
+        super.displayPreference(screen);
+        mPreferenceGroup = screen.findPreference(getPreferenceKey());
+        Set<String> blockedApps = getBlockedMediaApps();
+        for (ResolveInfo inf : mResumeInfo) {
+            String packageName = inf.getComponentInfo().packageName;
+            MediaSwitchPreference pref = new MediaSwitchPreference(mContext, packageName);
+            CharSequence appTitle = packageName;
+            try {
+                appTitle = mPackageManager.getApplicationLabel(
+                        mPackageManager.getApplicationInfo(packageName, 0));
+                Drawable appIcon = mPackageManager.getApplicationIcon(packageName);
+                pref.setIcon(appIcon);
+            } catch (PackageManager.NameNotFoundException e) {
+                Log.e(TAG, "Couldn't get app title", e);
+            }
+            pref.setTitle(appTitle);
+
+            pref.setOnPreferenceChangeListener((preference, status) -> {
+                MediaSwitchPreference mediaPreference = (MediaSwitchPreference) preference;
+                boolean isEnabled = (boolean) status;
+                Log.d(TAG, "preference " + mediaPreference + " changed " + isEnabled);
+
+                if (isEnabled) {
+                    blockedApps.remove(mediaPreference.getPackageName());
+                } else {
+                    blockedApps.add(mediaPreference.getPackageName());
+                }
+                setBlockedMediaApps(blockedApps);
+                return true;
+            });
+
+            pref.setChecked(!blockedApps.contains(packageName));
+            mPreferenceGroup.addPreference(pref);
+        }
+    }
+
+    class MediaSwitchPreference extends SwitchPreference {
+        private String mPackageName;
+
+        MediaSwitchPreference(Context context, String packageName) {
+            super(context);
+            mPackageName = packageName;
+        }
+
+        public String getPackageName() {
+            return mPackageName;
+        }
+    }
+
+    private Set<String> getBlockedMediaApps() {
+        String list = Settings.Secure.getString(mContext.getContentResolver(),
+                Settings.Secure.MEDIA_CONTROLS_RESUME_BLOCKED);
+        if (TextUtils.isEmpty(list)) {
+            return new ArraySet<>();
+        }
+        String[] names = list.split(":");
+        Set<String> set = new ArraySet<>(names.length);
+        Collections.addAll(set, names);
+        return set;
+    }
+
+    private void setBlockedMediaApps(Set<String> apps) {
+        if (apps == null || apps.size() == 0) {
+            Settings.Secure.putString(mContext.getContentResolver(),
+                    Settings.Secure.MEDIA_CONTROLS_RESUME_BLOCKED, "");
+            return;
+        }
+        String list = String.join(":", apps);
+        Settings.Secure.putString(mContext.getContentResolver(),
+                Settings.Secure.MEDIA_CONTROLS_RESUME_BLOCKED, list);
+    }
+}
diff --git a/src/com/android/settings/wifi/WifiConfigController.java b/src/com/android/settings/wifi/WifiConfigController.java
index 1579188..07d270d 100644
--- a/src/com/android/settings/wifi/WifiConfigController.java
+++ b/src/com/android/settings/wifi/WifiConfigController.java
@@ -37,6 +37,8 @@
 import android.os.UserManager;
 import android.security.Credentials;
 import android.security.KeyStore;
+import android.telephony.SubscriptionInfo;
+import android.telephony.SubscriptionManager;
 import android.text.Editable;
 import android.text.InputType;
 import android.text.SpannableString;
@@ -80,7 +82,9 @@
 import java.net.InetAddress;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.Iterator;
+import java.util.List;
 import java.util.stream.Collectors;
 
 /**
@@ -159,11 +163,11 @@
     private String mMultipleCertSetString;
     private String mUseSystemCertsString;
     private String mDoNotProvideEapUserCertString;
-    private String mDoNotValidateEapServerString;
 
     private ScrollView mDialogContainer;
     private Spinner mSecuritySpinner;
-    private Spinner mEapMethodSpinner;
+    @VisibleForTesting Spinner mEapMethodSpinner;
+    @VisibleForTesting Spinner mEapSimSpinner;    // For EAP-SIM, EAP-AKA and EAP-AKA-PRIME.
     private Spinner mEapCaCertSpinner;
     private Spinner mEapOcspSpinner;
     private TextView mEapDomainView;
@@ -209,6 +213,8 @@
 
     private final WifiManager mWifiManager;
 
+    private final List<SubscriptionInfo> mActiveSubscriptionInfos = new ArrayList<>();
+
     public WifiConfigController(WifiConfigUiBase parent, View view, AccessPoint accessPoint,
             int mode) {
         this (parent, view, accessPoint, mode, true /* requestFocus */);
@@ -264,8 +270,6 @@
         mUseSystemCertsString = mContext.getString(R.string.wifi_use_system_certs);
         mDoNotProvideEapUserCertString =
             mContext.getString(R.string.wifi_do_not_provide_eap_user_cert);
-        mDoNotValidateEapServerString =
-            mContext.getString(R.string.wifi_do_not_validate_eap_server);
 
         mSsidScanButton = (ImageButton) mView.findViewById(R.id.ssid_scanner_button);
         mDialogContainer = mView.findViewById(R.id.dialog_scrollview);
@@ -554,12 +558,10 @@
                 // Disallow submit if the user has not selected a CA certificate for an EAP network
                 // configuration.
                 enabled = false;
-            }
-            if (caCertSelection.equals(mUseSystemCertsString)
-                    && mEapDomainView != null
+            } else if (mEapDomainView != null
                     && mView.findViewById(R.id.l_domain).getVisibility() != View.GONE
                     && TextUtils.isEmpty(mEapDomainView.getText().toString())) {
-                // Disallow submit if the user chooses to use system certificates for EAP server
+                // Disallow submit if the user chooses to use a certificate for EAP server
                 // validation, but does not provide a domain.
                 enabled = false;
             }
@@ -577,7 +579,6 @@
     }
 
     void showWarningMessagesIfAppropriate() {
-        mView.findViewById(R.id.no_ca_cert_warning).setVisibility(View.GONE);
         mView.findViewById(R.id.no_user_cert_warning).setVisibility(View.GONE);
         mView.findViewById(R.id.no_domain_warning).setVisibility(View.GONE);
         mView.findViewById(R.id.ssid_too_long_warning).setVisibility(View.GONE);
@@ -590,19 +591,11 @@
         }
         if (mEapCaCertSpinner != null
                 && mView.findViewById(R.id.l_ca_cert).getVisibility() != View.GONE) {
-            String caCertSelection = (String) mEapCaCertSpinner.getSelectedItem();
-            if (caCertSelection.equals(mDoNotValidateEapServerString)) {
-                // Display warning if user chooses not to validate the EAP server with a
-                // user-supplied CA certificate in an EAP network configuration.
-                mView.findViewById(R.id.no_ca_cert_warning).setVisibility(View.VISIBLE);
-            }
-            if (caCertSelection.equals(mUseSystemCertsString)
-                    && mEapDomainView != null
+            if (mEapDomainView != null
                     && mView.findViewById(R.id.l_domain).getVisibility() != View.GONE
                     && TextUtils.isEmpty(mEapDomainView.getText().toString())) {
-                // Display warning if user chooses to use pre-installed public CA certificates
-                // without restricting the server domain that these certificates can be used to
-                // validate.
+                // Display warning if user chooses to use a certificate without restricting the
+                // server domain that these certificates can be used to validate.
                 mView.findViewById(R.id.no_domain_warning).setVisibility(View.VISIBLE);
             }
         }
@@ -736,8 +729,7 @@
                 config.enterpriseConfig.setCaCertificateAliases(null);
                 config.enterpriseConfig.setCaPath(null);
                 config.enterpriseConfig.setDomainSuffixMatch(mEapDomainView.getText().toString());
-                if (caCert.equals(mUnspecifiedCertString)
-                        || caCert.equals(mDoNotValidateEapServerString)) {
+                if (caCert.equals(mUnspecifiedCertString)) {
                     // ca_cert already set to null, so do nothing.
                 } else if (caCert.equals(mUseSystemCertsString)) {
                     config.enterpriseConfig.setCaPath(SYSTEM_CA_STORE_PATH);
@@ -771,8 +763,7 @@
                 }
 
                 // Only set OCSP option if there is a valid CA certificate.
-                if (caCert.equals(mUnspecifiedCertString)
-                        || caCert.equals(mDoNotValidateEapServerString)) {
+                if (caCert.equals(mUnspecifiedCertString)) {
                     config.enterpriseConfig.setOcsp(WifiEnterpriseConfig.OCSP_NONE);
                 } else {
                     config.enterpriseConfig.setOcsp(mEapOcspSpinner.getSelectedItemPosition());
@@ -825,6 +816,12 @@
                 return null;
         }
 
+        if (config.enterpriseConfig.isAuthenticationSimBased()
+                && mActiveSubscriptionInfos.size() > 0) {
+            config.carrierId = mActiveSubscriptionInfos
+                    .get(mEapSimSpinner.getSelectedItemPosition()).getCarrierId();
+        }
+
         config.setIpConfiguration(
                 new IpConfiguration(mIpAssignment, mProxySettings,
                                     mStaticIpConfiguration, mHttpProxy));
@@ -1013,6 +1010,7 @@
             initiateEnterpriseNetworkUi = true;
             mEapMethodSpinner = (Spinner) mView.findViewById(R.id.method);
             mEapMethodSpinner.setOnItemSelectedListener(this);
+            mEapSimSpinner = (Spinner) mView.findViewById(R.id.sim);
             mPhase2Spinner = (Spinner) mView.findViewById(R.id.phase2);
             mPhase2Spinner.setOnItemSelectedListener(this);
             mEapCaCertSpinner = (Spinner) mView.findViewById(R.id.ca_cert);
@@ -1049,18 +1047,20 @@
         }
 
         if (refreshCertificates) {
+            loadSims();
+
             loadCertificates(
                     mEapCaCertSpinner,
                     Credentials.CA_CERTIFICATE,
-                    mDoNotValidateEapServerString,
-                    false,
-                    true);
+                    null /* noCertificateString */,
+                    false /* showMultipleCerts */,
+                    true /* showUsePreinstalledCertOption */);
             loadCertificates(
                     mEapUserCertSpinner,
                     Credentials.USER_PRIVATE_KEY,
                     mDoNotProvideEapUserCertString,
-                    false,
-                    false);
+                    false /* showMultipleCerts */,
+                    false /* showUsePreinstalledCertOption */);
             // To avoid the user connects to a non-secure network unexpectedly,
             // request using system trusted certificates by default
             // unless the user explicitly chooses "Do not validate" or other
@@ -1070,9 +1070,10 @@
 
         // Modifying an existing network
         if (initiateEnterpriseNetworkUi && mAccessPoint != null && mAccessPoint.isSaved()) {
-            WifiEnterpriseConfig enterpriseConfig = mAccessPoint.getConfig().enterpriseConfig;
-            int eapMethod = enterpriseConfig.getEapMethod();
-            int phase2Method = enterpriseConfig.getPhase2Method();
+            final WifiConfiguration wifiConfig = mAccessPoint.getConfig();
+            final WifiEnterpriseConfig enterpriseConfig = wifiConfig.enterpriseConfig;
+            final int eapMethod = enterpriseConfig.getEapMethod();
+            final int phase2Method = enterpriseConfig.getPhase2Method();
             mEapMethodSpinner.setSelection(eapMethod);
             showEapFieldsByMethod(eapMethod);
             switch (eapMethod) {
@@ -1120,12 +1121,22 @@
                 default:
                     break;
             }
+
+            if (enterpriseConfig.isAuthenticationSimBased()) {
+                for (int i = 0; i < mActiveSubscriptionInfos.size(); i++) {
+                    if (wifiConfig.carrierId == mActiveSubscriptionInfos.get(i).getCarrierId()) {
+                        mEapSimSpinner.setSelection(i);
+                        break;
+                    }
+                }
+            }
+
             if (!TextUtils.isEmpty(enterpriseConfig.getCaPath())) {
                 setSelection(mEapCaCertSpinner, mUseSystemCertsString);
             } else {
                 String[] caCerts = enterpriseConfig.getCaCertificateAliases();
                 if (caCerts == null) {
-                    setSelection(mEapCaCertSpinner, mDoNotValidateEapServerString);
+                    setSelection(mEapCaCertSpinner, mUnspecifiedCertString);
                 } else if (caCerts.length == 1) {
                     setSelection(mEapCaCertSpinner, caCerts[0]);
                 } else {
@@ -1133,9 +1144,9 @@
                     loadCertificates(
                             mEapCaCertSpinner,
                             Credentials.CA_CERTIFICATE,
-                            mDoNotValidateEapServerString,
-                            true,
-                            true);
+                            null /* noCertificateString */,
+                            true /* showMultipleCerts */,
+                            true /* showUsePreinstalledCertOption */);
                     setSelection(mEapCaCertSpinner, mMultipleCertSetString);
                 }
             }
@@ -1208,6 +1219,7 @@
         mView.findViewById(R.id.l_ocsp).setVisibility(View.VISIBLE);
         mView.findViewById(R.id.password_layout).setVisibility(View.VISIBLE);
         mView.findViewById(R.id.show_password_layout).setVisibility(View.VISIBLE);
+        mView.findViewById(R.id.l_sim).setVisibility(View.VISIBLE);
 
         Context context = mConfigUi.getContext();
         switch (eapMethod) {
@@ -1218,12 +1230,14 @@
                 setDomainInvisible();
                 setAnonymousIdentInvisible();
                 setUserCertInvisible();
+                mView.findViewById(R.id.l_sim).setVisibility(View.GONE);
                 break;
             case WIFI_EAP_METHOD_TLS:
                 mView.findViewById(R.id.l_user_cert).setVisibility(View.VISIBLE);
                 setPhase2Invisible();
                 setAnonymousIdentInvisible();
                 setPasswordInvisible();
+                mView.findViewById(R.id.l_sim).setVisibility(View.GONE);
                 break;
             case WIFI_EAP_METHOD_PEAP:
                 // Reset adapter if needed
@@ -1245,6 +1259,7 @@
                 mView.findViewById(R.id.l_phase2).setVisibility(View.VISIBLE);
                 mView.findViewById(R.id.l_anonymous).setVisibility(View.VISIBLE);
                 setUserCertInvisible();
+                mView.findViewById(R.id.l_sim).setVisibility(View.GONE);
                 break;
             case WIFI_EAP_METHOD_SIM:
             case WIFI_EAP_METHOD_AKA:
@@ -1262,8 +1277,7 @@
 
         if (mView.findViewById(R.id.l_ca_cert).getVisibility() != View.GONE) {
             String eapCertSelection = (String) mEapCaCertSpinner.getSelectedItem();
-            if (eapCertSelection.equals(mDoNotValidateEapServerString)
-                    || eapCertSelection.equals(mUnspecifiedCertString)) {
+            if (eapCertSelection.equals(mUnspecifiedCertString)) {
                 // Domain suffix matching is not relevant if the user hasn't chosen a CA
                 // certificate yet, or chooses not to validate the EAP server.
                 setDomainInvisible();
@@ -1282,11 +1296,13 @@
             mEapIdentityView.setText("");
             mView.findViewById(R.id.l_identity).setVisibility(View.GONE);
             setPasswordInvisible();
+            mView.findViewById(R.id.l_sim).setVisibility(View.VISIBLE);
         } else {
             mView.findViewById(R.id.l_identity).setVisibility(View.VISIBLE);
             mView.findViewById(R.id.l_anonymous).setVisibility(View.VISIBLE);
             mView.findViewById(R.id.password_layout).setVisibility(View.VISIBLE);
             mView.findViewById(R.id.show_password_layout).setVisibility(View.VISIBLE);
+            mView.findViewById(R.id.l_sim).setVisibility(View.GONE);
         }
     }
 
@@ -1450,6 +1466,44 @@
     }
 
     @VisibleForTesting
+    void loadSims() {
+        List<SubscriptionInfo> activeSubscriptionInfos = mContext
+                .getSystemService(SubscriptionManager.class).getActiveSubscriptionInfoList();
+        if (activeSubscriptionInfos == null) {
+            activeSubscriptionInfos = Collections.EMPTY_LIST;
+        }
+        mActiveSubscriptionInfos.clear();
+
+        // De-duplicates active subscriptions and caches in mActiveSubscriptionInfos.
+        for (SubscriptionInfo newInfo : activeSubscriptionInfos) {
+            for (SubscriptionInfo cachedInfo : mActiveSubscriptionInfos) {
+                if (newInfo.getCarrierId() == cachedInfo.getCarrierId()) {
+                    continue;
+                }
+            }
+            mActiveSubscriptionInfos.add(newInfo);
+        }
+
+        // Shows disabled 'No SIM' when there is no active subscription.
+        if (mActiveSubscriptionInfos.size() == 0) {
+            final String[] noSim = new String[]{mContext.getString(R.string.wifi_no_sim_card)};
+            mEapSimSpinner.setAdapter(getSpinnerAdapter(noSim));
+            mEapSimSpinner.setSelection(0 /* position */);
+            mEapSimSpinner.setEnabled(false);
+            return;
+        }
+
+        // Shows display name of each active subscription.
+        final String[] displayNames = mActiveSubscriptionInfos.stream().map(
+                SubscriptionInfo::getDisplayName).toArray(String[]::new);
+        mEapSimSpinner.setAdapter(getSpinnerAdapter(displayNames));
+        mEapSimSpinner.setSelection(0 /* position */);
+        if (displayNames.length == 1) {
+            mEapSimSpinner.setEnabled(false);
+        }
+    }
+
+    @VisibleForTesting
     void loadCertificates(
             Spinner spinner,
             String prefix,
@@ -1485,7 +1539,8 @@
                     }).collect(Collectors.toList()));
         }
 
-        if (mAccessPointSecurity != AccessPoint.SECURITY_EAP_SUITE_B) {
+        if (!TextUtils.isEmpty(noCertificateString)
+                && mAccessPointSecurity != AccessPoint.SECURITY_EAP_SUITE_B) {
             certs.add(noCertificateString);
         }
 
@@ -1713,7 +1768,8 @@
                 mContext.getResources().getStringArray(contentStringArrayResId));
     }
 
-    private ArrayAdapter<CharSequence> getSpinnerAdapter(
+    @VisibleForTesting
+    ArrayAdapter<CharSequence> getSpinnerAdapter(
             String[] contentStringArray) {
         ArrayAdapter<CharSequence> spinnerAdapter = new ArrayAdapter<>(mContext,
                 android.R.layout.simple_spinner_item, contentStringArray);
diff --git a/src/com/android/settings/wifi/WifiConfigController2.java b/src/com/android/settings/wifi/WifiConfigController2.java
index 99907f3..7ae6061 100644
--- a/src/com/android/settings/wifi/WifiConfigController2.java
+++ b/src/com/android/settings/wifi/WifiConfigController2.java
@@ -35,6 +35,8 @@
 import android.os.UserManager;
 import android.security.Credentials;
 import android.security.KeyStore;
+import android.telephony.SubscriptionInfo;
+import android.telephony.SubscriptionManager;
 import android.text.Editable;
 import android.text.InputType;
 import android.text.SpannableString;
@@ -80,7 +82,9 @@
 import java.net.InetAddress;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.Iterator;
+import java.util.List;
 import java.util.stream.Collectors;
 
 /**
@@ -156,11 +160,11 @@
     private String mMultipleCertSetString;
     private String mUseSystemCertsString;
     private String mDoNotProvideEapUserCertString;
-    private String mDoNotValidateEapServerString;
 
     private ScrollView mDialogContainer;
     private Spinner mSecuritySpinner;
-    private Spinner mEapMethodSpinner;
+    @VisibleForTesting Spinner mEapMethodSpinner;
+    @VisibleForTesting Spinner mEapSimSpinner;    // For EAP-SIM, EAP-AKA and EAP-AKA-PRIME.
     private Spinner mEapCaCertSpinner;
     private Spinner mEapOcspSpinner;
     private TextView mEapDomainView;
@@ -205,6 +209,8 @@
 
     private final WifiManager mWifiManager;
 
+    private final List<SubscriptionInfo> mActiveSubscriptionInfos = new ArrayList<>();
+
     public WifiConfigController2(WifiConfigUiBase2 parent, View view, WifiEntry wifiEntry,
             int mode) {
         mConfigUi = parent;
@@ -253,8 +259,6 @@
         mUseSystemCertsString = mContext.getString(R.string.wifi_use_system_certs);
         mDoNotProvideEapUserCertString =
             mContext.getString(R.string.wifi_do_not_provide_eap_user_cert);
-        mDoNotValidateEapServerString =
-            mContext.getString(R.string.wifi_do_not_validate_eap_server);
 
         mSsidScanButton = (ImageButton) mView.findViewById(R.id.ssid_scanner_button);
         mDialogContainer = mView.findViewById(R.id.dialog_scrollview);
@@ -533,12 +537,10 @@
                 // Disallow submit if the user has not selected a CA certificate for an EAP network
                 // configuration.
                 enabled = false;
-            }
-            if (caCertSelection.equals(mUseSystemCertsString)
-                    && mEapDomainView != null
+            } else if (mEapDomainView != null
                     && mView.findViewById(R.id.l_domain).getVisibility() != View.GONE
                     && TextUtils.isEmpty(mEapDomainView.getText().toString())) {
-                // Disallow submit if the user chooses to use system certificates for EAP server
+                // Disallow submit if the user chooses to use a certificate for EAP server
                 // validation, but does not provide a domain.
                 enabled = false;
             }
@@ -556,7 +558,6 @@
     }
 
     void showWarningMessagesIfAppropriate() {
-        mView.findViewById(R.id.no_ca_cert_warning).setVisibility(View.GONE);
         mView.findViewById(R.id.no_user_cert_warning).setVisibility(View.GONE);
         mView.findViewById(R.id.no_domain_warning).setVisibility(View.GONE);
         mView.findViewById(R.id.ssid_too_long_warning).setVisibility(View.GONE);
@@ -569,19 +570,11 @@
         }
         if (mEapCaCertSpinner != null
                 && mView.findViewById(R.id.l_ca_cert).getVisibility() != View.GONE) {
-            String caCertSelection = (String) mEapCaCertSpinner.getSelectedItem();
-            if (caCertSelection.equals(mDoNotValidateEapServerString)) {
-                // Display warning if user chooses not to validate the EAP server with a
-                // user-supplied CA certificate in an EAP network configuration.
-                mView.findViewById(R.id.no_ca_cert_warning).setVisibility(View.VISIBLE);
-            }
-            if (caCertSelection.equals(mUseSystemCertsString)
-                    && mEapDomainView != null
+            if (mEapDomainView != null
                     && mView.findViewById(R.id.l_domain).getVisibility() != View.GONE
                     && TextUtils.isEmpty(mEapDomainView.getText().toString())) {
-                // Display warning if user chooses to use pre-installed public CA certificates
-                // without restricting the server domain that these certificates can be used to
-                // validate.
+                // Display warning if user chooses to use a certificate without restricting the
+                // server domain that these certificates can be used to validate.
                 mView.findViewById(R.id.no_domain_warning).setVisibility(View.VISIBLE);
             }
         }
@@ -714,12 +707,17 @@
                         break;
                 }
 
+                if (config.enterpriseConfig.isAuthenticationSimBased()
+                        && mActiveSubscriptionInfos.size() > 0) {
+                    config.carrierId = mActiveSubscriptionInfos
+                            .get(mEapSimSpinner.getSelectedItemPosition()).getCarrierId();
+                }
+
                 String caCert = (String) mEapCaCertSpinner.getSelectedItem();
                 config.enterpriseConfig.setCaCertificateAliases(null);
                 config.enterpriseConfig.setCaPath(null);
                 config.enterpriseConfig.setDomainSuffixMatch(mEapDomainView.getText().toString());
-                if (caCert.equals(mUnspecifiedCertString)
-                        || caCert.equals(mDoNotValidateEapServerString)) {
+                if (caCert.equals(mUnspecifiedCertString)) {
                     // ca_cert already set to null, so do nothing.
                 } else if (caCert.equals(mUseSystemCertsString)) {
                     config.enterpriseConfig.setCaPath(SYSTEM_CA_STORE_PATH);
@@ -752,8 +750,7 @@
                 }
 
                 // Only set OCSP option if there is a valid CA certificate.
-                if (caCert.equals(mUnspecifiedCertString)
-                        || caCert.equals(mDoNotValidateEapServerString)) {
+                if (caCert.equals(mUnspecifiedCertString)) {
                     config.enterpriseConfig.setOcsp(WifiEnterpriseConfig.OCSP_NONE);
                 } else {
                     config.enterpriseConfig.setOcsp(mEapOcspSpinner.getSelectedItemPosition());
@@ -994,6 +991,7 @@
             initiateEnterpriseNetworkUi = true;
             mEapMethodSpinner = (Spinner) mView.findViewById(R.id.method);
             mEapMethodSpinner.setOnItemSelectedListener(this);
+            mEapSimSpinner = (Spinner) mView.findViewById(R.id.sim);
             mPhase2Spinner = (Spinner) mView.findViewById(R.id.phase2);
             mPhase2Spinner.setOnItemSelectedListener(this);
             mEapCaCertSpinner = (Spinner) mView.findViewById(R.id.ca_cert);
@@ -1031,18 +1029,20 @@
         }
 
         if (refreshCertificates) {
+            loadSims();
+
             loadCertificates(
                     mEapCaCertSpinner,
                     Credentials.CA_CERTIFICATE,
-                    mDoNotValidateEapServerString,
-                    false,
-                    true);
+                    null /* noCertificateString */,
+                    false /* showMultipleCerts */,
+                    true /* showUsePreinstalledCertOption */);
             loadCertificates(
                     mEapUserCertSpinner,
                     Credentials.USER_PRIVATE_KEY,
                     mDoNotProvideEapUserCertString,
-                    false,
-                    false);
+                    false /* showMultipleCerts */,
+                    false /* showUsePreinstalledCertOption */);
             // To avoid the user connects to a non-secure network unexpectedly,
             // request using system trusted certificates by default
             // unless the user explicitly chooses "Do not validate" or other
@@ -1052,10 +1052,10 @@
 
         // Modifying an existing network
         if (initiateEnterpriseNetworkUi && mWifiEntry != null && mWifiEntry.isSaved()) {
-            WifiEnterpriseConfig enterpriseConfig = mWifiEntry.getWifiConfiguration()
-                    .enterpriseConfig;
-            int eapMethod = enterpriseConfig.getEapMethod();
-            int phase2Method = enterpriseConfig.getPhase2Method();
+            final WifiConfiguration wifiConfig = mWifiEntry.getWifiConfiguration();
+            final WifiEnterpriseConfig enterpriseConfig = wifiConfig.enterpriseConfig;
+            final int eapMethod = enterpriseConfig.getEapMethod();
+            final int phase2Method = enterpriseConfig.getPhase2Method();
             mEapMethodSpinner.setSelection(eapMethod);
             showEapFieldsByMethod(eapMethod);
             switch (eapMethod) {
@@ -1103,12 +1103,22 @@
                 default:
                     break;
             }
+
+            if (enterpriseConfig.isAuthenticationSimBased()) {
+                for (int i = 0; i < mActiveSubscriptionInfos.size(); i++) {
+                    if (wifiConfig.carrierId == mActiveSubscriptionInfos.get(i).getCarrierId()) {
+                        mEapSimSpinner.setSelection(i);
+                        break;
+                    }
+                }
+            }
+
             if (!TextUtils.isEmpty(enterpriseConfig.getCaPath())) {
                 setSelection(mEapCaCertSpinner, mUseSystemCertsString);
             } else {
                 String[] caCerts = enterpriseConfig.getCaCertificateAliases();
                 if (caCerts == null) {
-                    setSelection(mEapCaCertSpinner, mDoNotValidateEapServerString);
+                    setSelection(mEapCaCertSpinner, mUnspecifiedCertString);
                 } else if (caCerts.length == 1) {
                     setSelection(mEapCaCertSpinner, caCerts[0]);
                 } else {
@@ -1116,9 +1126,9 @@
                     loadCertificates(
                             mEapCaCertSpinner,
                             Credentials.CA_CERTIFICATE,
-                            mDoNotValidateEapServerString,
-                            true,
-                            true);
+                            null /* noCertificateString */,
+                            true /* showMultipleCerts */,
+                            true /* showUsePreinstalledCertOption */);
                     setSelection(mEapCaCertSpinner, mMultipleCertSetString);
                 }
             }
@@ -1191,6 +1201,7 @@
         mView.findViewById(R.id.l_ocsp).setVisibility(View.VISIBLE);
         mView.findViewById(R.id.password_layout).setVisibility(View.VISIBLE);
         mView.findViewById(R.id.show_password_layout).setVisibility(View.VISIBLE);
+        mView.findViewById(R.id.l_sim).setVisibility(View.VISIBLE);
 
         Context context = mConfigUi.getContext();
         switch (eapMethod) {
@@ -1201,12 +1212,14 @@
                 setDomainInvisible();
                 setAnonymousIdentInvisible();
                 setUserCertInvisible();
+                mView.findViewById(R.id.l_sim).setVisibility(View.GONE);
                 break;
             case WIFI_EAP_METHOD_TLS:
                 mView.findViewById(R.id.l_user_cert).setVisibility(View.VISIBLE);
                 setPhase2Invisible();
                 setAnonymousIdentInvisible();
                 setPasswordInvisible();
+                mView.findViewById(R.id.l_sim).setVisibility(View.GONE);
                 break;
             case WIFI_EAP_METHOD_PEAP:
                 // Reset adapter if needed
@@ -1228,6 +1241,7 @@
                 mView.findViewById(R.id.l_phase2).setVisibility(View.VISIBLE);
                 mView.findViewById(R.id.l_anonymous).setVisibility(View.VISIBLE);
                 setUserCertInvisible();
+                mView.findViewById(R.id.l_sim).setVisibility(View.GONE);
                 break;
             case WIFI_EAP_METHOD_SIM:
             case WIFI_EAP_METHOD_AKA:
@@ -1245,8 +1259,7 @@
 
         if (mView.findViewById(R.id.l_ca_cert).getVisibility() != View.GONE) {
             String eapCertSelection = (String) mEapCaCertSpinner.getSelectedItem();
-            if (eapCertSelection.equals(mDoNotValidateEapServerString)
-                    || eapCertSelection.equals(mUnspecifiedCertString)) {
+            if (eapCertSelection.equals(mUnspecifiedCertString)) {
                 // Domain suffix matching is not relevant if the user hasn't chosen a CA
                 // certificate yet, or chooses not to validate the EAP server.
                 setDomainInvisible();
@@ -1265,11 +1278,13 @@
             mEapIdentityView.setText("");
             mView.findViewById(R.id.l_identity).setVisibility(View.GONE);
             setPasswordInvisible();
+            mView.findViewById(R.id.l_sim).setVisibility(View.VISIBLE);
         } else {
             mView.findViewById(R.id.l_identity).setVisibility(View.VISIBLE);
             mView.findViewById(R.id.l_anonymous).setVisibility(View.VISIBLE);
             mView.findViewById(R.id.password_layout).setVisibility(View.VISIBLE);
             mView.findViewById(R.id.show_password_layout).setVisibility(View.VISIBLE);
+            mView.findViewById(R.id.l_sim).setVisibility(View.GONE);
         }
     }
 
@@ -1433,6 +1448,44 @@
     }
 
     @VisibleForTesting
+    void loadSims() {
+        List<SubscriptionInfo> activeSubscriptionInfos = mContext
+                .getSystemService(SubscriptionManager.class).getActiveSubscriptionInfoList();
+        if (activeSubscriptionInfos == null) {
+            activeSubscriptionInfos = Collections.EMPTY_LIST;
+        }
+        mActiveSubscriptionInfos.clear();
+
+        // De-duplicates active subscriptions and caches in mActiveSubscriptionInfos.
+        for (SubscriptionInfo newInfo : activeSubscriptionInfos) {
+            for (SubscriptionInfo cachedInfo : mActiveSubscriptionInfos) {
+                if (newInfo.getCarrierId() == cachedInfo.getCarrierId()) {
+                    continue;
+                }
+            }
+            mActiveSubscriptionInfos.add(newInfo);
+        }
+
+        // Shows disabled 'No SIM' when there is no active subscription.
+        if (mActiveSubscriptionInfos.size() == 0) {
+            final String[] noSim = new String[]{mContext.getString(R.string.wifi_no_sim_card)};
+            mEapSimSpinner.setAdapter(getSpinnerAdapter(noSim));
+            mEapSimSpinner.setSelection(0 /* position */);
+            mEapSimSpinner.setEnabled(false);
+            return;
+        }
+
+        // Shows display name of each active subscription.
+        final String[] displayNames = mActiveSubscriptionInfos.stream().map(
+                SubscriptionInfo::getDisplayName).toArray(String[]::new);
+        mEapSimSpinner.setAdapter(getSpinnerAdapter(displayNames));
+        mEapSimSpinner.setSelection(0 /* position */);
+        if (displayNames.length == 1) {
+            mEapSimSpinner.setEnabled(false);
+        }
+    }
+
+    @VisibleForTesting
     void loadCertificates(
             Spinner spinner,
             String prefix,
@@ -1468,7 +1521,8 @@
                     }).collect(Collectors.toList()));
         }
 
-        if (mWifiEntrySecurity != WifiEntry.SECURITY_EAP_SUITE_B) {
+        if (!TextUtils.isEmpty(noCertificateString)
+                && mWifiEntrySecurity != WifiEntry.SECURITY_EAP_SUITE_B) {
             certs.add(noCertificateString);
         }
 
@@ -1696,7 +1750,8 @@
                 mContext.getResources().getStringArray(contentStringArrayResId));
     }
 
-    private ArrayAdapter<CharSequence> getSpinnerAdapter(
+    @VisibleForTesting
+    ArrayAdapter<CharSequence> getSpinnerAdapter(
             String[] contentStringArray) {
         ArrayAdapter<CharSequence> spinnerAdapter = new ArrayAdapter<>(mContext,
                 android.R.layout.simple_spinner_item, contentStringArray);
diff --git a/src/com/android/settings/wifi/WifiConnectionPreferenceController.java b/src/com/android/settings/wifi/WifiConnectionPreferenceController.java
index 742edd1..12a6d14 100644
--- a/src/com/android/settings/wifi/WifiConnectionPreferenceController.java
+++ b/src/com/android/settings/wifi/WifiConnectionPreferenceController.java
@@ -17,32 +17,22 @@
 package com.android.settings.wifi;
 
 import android.content.Context;
-import android.net.ConnectivityManager;
-import android.net.NetworkScoreManager;
-import android.net.wifi.WifiManager;
 import android.os.Bundle;
-import android.os.Handler;
-import android.os.HandlerThread;
-import android.os.Looper;
-import android.os.Process;
-import android.os.SimpleClock;
-import android.os.SystemClock;
+import android.util.FeatureFlagUtils;
 
-import androidx.annotation.VisibleForTesting;
 import androidx.preference.PreferenceGroup;
 import androidx.preference.PreferenceScreen;
 
 import com.android.settings.R;
 import com.android.settings.core.SubSettingLauncher;
+import com.android.settings.wifi.details.WifiNetworkDetailsFragment;
 import com.android.settings.wifi.details2.WifiNetworkDetailsFragment2;
 import com.android.settingslib.core.AbstractPreferenceController;
 import com.android.settingslib.core.lifecycle.Lifecycle;
-import com.android.settingslib.wifi.WifiEntryPreference;
-import com.android.wifitrackerlib.WifiEntry;
-import com.android.wifitrackerlib.WifiPickerTracker;
-
-import java.time.Clock;
-import java.time.ZoneOffset;
+import com.android.settingslib.wifi.AccessPoint;
+import com.android.settingslib.wifi.AccessPointPreference;
+import com.android.settingslib.wifi.WifiTracker;
+import com.android.settingslib.wifi.WifiTrackerFactory;
 
 // TODO(b/151133650): Replace AbstractPreferenceController with BasePreferenceController.
 /**
@@ -50,28 +40,21 @@
  * controller class when there is a wifi connection present.
  */
 public class WifiConnectionPreferenceController extends AbstractPreferenceController implements
-        WifiPickerTracker.WifiPickerTrackerCallback {
+        WifiTracker.WifiListener {
 
     private static final String TAG = "WifiConnPrefCtrl";
 
     private static final String KEY = "active_wifi_connection";
 
-    // Max age of tracked WifiEntries.
-    private static final long MAX_SCAN_AGE_MILLIS = 15_000;
-    // Interval between initiating WifiPickerTracker scans.
-    private static final long SCAN_INTERVAL_MILLIS = 10_000;
-
     private UpdateListener mUpdateListener;
     private Context mPrefContext;
     private String mPreferenceGroupKey;
     private PreferenceGroup mPreferenceGroup;
-    @VisibleForTesting
-    public WifiPickerTracker mWifiPickerTracker;
-    private WifiEntryPreference mPreference;
+    private WifiTracker mWifiTracker;
+    private AccessPointPreference mPreference;
+    private AccessPointPreference.UserBadgeCache mBadgeCache;
     private int order;
     private int mMetricsCategory;
-    // Worker thread used for WifiPickerTracker work.
-    private HandlerThread mWorkerThread;
 
     /**
      * Used to notify a parent controller that this controller has changed in availability, or has
@@ -99,34 +82,16 @@
         super(context);
         mUpdateListener = updateListener;
         mPreferenceGroupKey = preferenceGroupKey;
+        mWifiTracker = WifiTrackerFactory.create(context, this, lifecycle, true /* includeSaved */,
+                true /* includeScans */);
         this.order = order;
         mMetricsCategory = metricsCategory;
-
-        mWorkerThread = new HandlerThread(
-                TAG + "{" + Integer.toHexString(System.identityHashCode(this)) + "}",
-                Process.THREAD_PRIORITY_BACKGROUND);
-        mWorkerThread.start();
-        final Clock elapsedRealtimeClock = new SimpleClock(ZoneOffset.UTC) {
-            @Override
-            public long millis() {
-                return SystemClock.elapsedRealtime();
-            }
-        };
-        mWifiPickerTracker = new WifiPickerTracker(lifecycle, context,
-                context.getSystemService(WifiManager.class),
-                context.getSystemService(ConnectivityManager.class),
-                context.getSystemService(NetworkScoreManager.class),
-                new Handler(Looper.getMainLooper()),
-                mWorkerThread.getThreadHandler(),
-                elapsedRealtimeClock,
-                MAX_SCAN_AGE_MILLIS,
-                SCAN_INTERVAL_MILLIS,
-                this);
+        mBadgeCache = new AccessPointPreference.UserBadgeCache(context.getPackageManager());
     }
 
     @Override
     public boolean isAvailable() {
-        return mWifiPickerTracker.getConnectedWifiEntry() != null;
+        return mWifiTracker.isConnected() && getCurrentAccessPoint() != null;
     }
 
     @Override
@@ -142,69 +107,88 @@
         update();
     }
 
-    private void updatePreference(WifiEntry wifiEntry) {
+    private AccessPoint getCurrentAccessPoint() {
+        for (AccessPoint accessPoint : mWifiTracker.getAccessPoints()) {
+            if (accessPoint.isActive()) {
+                return accessPoint;
+            }
+        }
+        return null;
+    }
+
+    private void updatePreference(AccessPoint accessPoint) {
         if (mPreference != null) {
             mPreferenceGroup.removePreference(mPreference);
             mPreference = null;
         }
-        if (wifiEntry == null || mPrefContext == null) {
+        if (accessPoint == null) {
             return;
         }
+        if (mPrefContext != null) {
+            mPreference = new AccessPointPreference(accessPoint, mPrefContext, mBadgeCache,
+                    R.drawable.ic_wifi_signal_0, false /* forSavedNetworks */);
+            mPreference.setKey(KEY);
+            mPreference.refresh();
+            mPreference.setOrder(order);
 
-        mPreference = new WifiEntryPreference(mPrefContext, wifiEntry);
-        mPreference.setKey(KEY);
-        mPreference.refresh();
-        mPreference.setOrder(order);
-        mPreference.setOnPreferenceClickListener(pref -> {
-            final Bundle args = new Bundle();
-            args.putString(WifiNetworkDetailsFragment2.KEY_CHOSEN_WIFIENTRY_KEY,
-                    wifiEntry.getKey());
-            new SubSettingLauncher(mPrefContext)
-                    .setTitleRes(R.string.pref_title_network_details)
-                    .setDestination(WifiNetworkDetailsFragment2.class.getName())
-                    .setArguments(args)
-                    .setSourceMetricsCategory(mMetricsCategory)
-                    .launch();
-            return true;
-        });
-        mPreferenceGroup.addPreference(mPreference);
+            if (FeatureFlagUtils.isEnabled(mPrefContext, FeatureFlagUtils.SETTINGS_WIFITRACKER2)) {
+                mPreference.setOnPreferenceClickListener(pref -> {
+                    Bundle args = new Bundle();
+                    mPreference.getAccessPoint().saveWifiState(args);
+                    new SubSettingLauncher(mPrefContext)
+                            .setTitleRes(R.string.pref_title_network_details)
+                            .setDestination(WifiNetworkDetailsFragment2.class.getName())
+                            .setArguments(args)
+                            .setSourceMetricsCategory(mMetricsCategory)
+                            .launch();
+                    return true;
+                });
+            } else {
+                mPreference.setOnPreferenceClickListener(pref -> {
+                    Bundle args = new Bundle();
+                    mPreference.getAccessPoint().saveWifiState(args);
+                    new SubSettingLauncher(mPrefContext)
+                            .setTitleRes(R.string.pref_title_network_details)
+                            .setDestination(WifiNetworkDetailsFragment.class.getName())
+                            .setArguments(args)
+                            .setSourceMetricsCategory(mMetricsCategory)
+                            .launch();
+                    return true;
+                });
+            }
+            mPreferenceGroup.addPreference(mPreference);
+        }
     }
 
     private void update() {
-        final WifiEntry connectedWifiEntry = mWifiPickerTracker.getConnectedWifiEntry();
-        if (connectedWifiEntry == null) {
+        AccessPoint connectedAccessPoint = null;
+        if (mWifiTracker.isConnected()) {
+            connectedAccessPoint = getCurrentAccessPoint();
+        }
+        if (connectedAccessPoint == null) {
             updatePreference(null);
         } else {
-            if (mPreference == null || !mPreference.getWifiEntry().equals(connectedWifiEntry)) {
-                updatePreference(connectedWifiEntry);
-            } else if (mPreference != null) {
-                mPreference.refresh();
-            }
+          if (mPreference == null || !mPreference.getAccessPoint().equals(connectedAccessPoint)) {
+              updatePreference(connectedAccessPoint);
+          } else if (mPreference != null) {
+              mPreference.refresh();
+          }
         }
         mUpdateListener.onChildrenUpdated();
     }
 
-    /** Called when the state of Wifi has changed. */
     @Override
-    public void onWifiStateChanged() {
-        update();
-    }
-
-    /**
-     * Update the results when data changes.
-     */
-    @Override
-    public void onWifiEntriesChanged() {
+    public void onWifiStateChanged(int state) {
         update();
     }
 
     @Override
-    public void onNumSavedSubscriptionsChanged() {
-        // Do nothing.
+    public void onConnectedChanged() {
+        update();
     }
 
     @Override
-    public void onNumSavedNetworksChanged() {
-        // Do nothing.
+    public void onAccessPointsChanged() {
+        update();
     }
 }
diff --git a/src/com/android/settings/wifi/WifiUtils.java b/src/com/android/settings/wifi/WifiUtils.java
index 1333ab4..2214605 100644
--- a/src/com/android/settings/wifi/WifiUtils.java
+++ b/src/com/android/settings/wifi/WifiUtils.java
@@ -23,6 +23,7 @@
 import android.content.pm.PackageManager;
 import android.net.NetworkCapabilities;
 import android.net.wifi.ScanResult;
+import android.net.wifi.SoftApConfiguration;
 import android.net.wifi.WifiConfiguration;
 import android.os.UserHandle;
 import android.os.UserManager;
@@ -38,8 +39,6 @@
 
     private static final int SSID_ASCII_MIN_LENGTH = 1;
     private static final int SSID_ASCII_MAX_LENGTH = 32;
-    private static final int PASSWORD_MIN_LENGTH = 8;
-    private static final int PASSWORD_MAX_LENGTH = 63;
 
 
     public static boolean isSSIDTooLong(String ssid) {
@@ -56,13 +55,17 @@
         return ssid.length() < SSID_ASCII_MIN_LENGTH;
     }
 
-    public static boolean isHotspotPasswordValid(String password) {
-        if (TextUtils.isEmpty(password)) {
+    /**
+     * Check if the WPA2-PSK hotspot password is valid.
+     */
+    public static boolean isHotspotWpa2PasswordValid(String password) {
+        final SoftApConfiguration.Builder configBuilder = new SoftApConfiguration.Builder();
+        try {
+            configBuilder.setPassphrase(password, SoftApConfiguration.SECURITY_TYPE_WPA2_PSK);
+        } catch (IllegalArgumentException e) {
             return false;
         }
-
-        final int length = password.length();
-        return length >= PASSWORD_MIN_LENGTH && length <= PASSWORD_MAX_LENGTH;
+        return true;
     }
 
     /**
diff --git a/src/com/android/settings/wifi/details2/WifiDetailPreferenceController2.java b/src/com/android/settings/wifi/details2/WifiDetailPreferenceController2.java
index 5c48dfd..ef57e54 100644
--- a/src/com/android/settings/wifi/details2/WifiDetailPreferenceController2.java
+++ b/src/com/android/settings/wifi/details2/WifiDetailPreferenceController2.java
@@ -23,8 +23,10 @@
 import android.app.Activity;
 import android.app.AlertDialog;
 import android.app.settings.SettingsEnums;
+import android.content.AsyncQueryHandler;
 import android.content.Context;
 import android.content.Intent;
+import android.database.Cursor;
 import android.graphics.Bitmap;
 import android.graphics.drawable.BitmapDrawable;
 import android.graphics.drawable.Drawable;
@@ -41,9 +43,14 @@
 import android.net.NetworkUtils;
 import android.net.RouteInfo;
 import android.net.Uri;
+import android.net.wifi.WifiConfiguration;
 import android.net.wifi.WifiInfo;
 import android.net.wifi.WifiManager;
 import android.os.Handler;
+import android.provider.Telephony.CarrierId;
+import android.telephony.SubscriptionInfo;
+import android.telephony.SubscriptionManager;
+import android.telephony.TelephonyManager;
 import android.text.TextUtils;
 import android.util.FeatureFlagUtils;
 import android.util.Log;
@@ -98,6 +105,7 @@
 import java.time.ZonedDateTime;
 import java.time.format.DateTimeFormatter;
 import java.time.format.FormatStyle;
+import java.util.List;
 import java.util.StringJoiner;
 import java.util.stream.Collectors;
 
@@ -133,6 +141,8 @@
     @VisibleForTesting
     static final String KEY_SSID_PREF = "ssid";
     @VisibleForTesting
+    static final String KEY_EAP_SIM_SUBSCRIPTION_PREF = "eap_sim_subscription";
+    @VisibleForTesting
     static final String KEY_MAC_ADDRESS_PREF = "mac_address";
     @VisibleForTesting
     static final String KEY_IP_ADDRESS_PREF = "ip_address";
@@ -170,6 +180,7 @@
     private Preference mFrequencyPref;
     private Preference mSecurityPref;
     private Preference mSsidPref;
+    private Preference mEapSimSubscriptionPref;
     private Preference mMacAddressPref;
     private Preference mIpAddressPref;
     private Preference mGatewayPref;
@@ -187,6 +198,35 @@
     private final NetworkRequest mNetworkRequest = new NetworkRequest.Builder()
             .clearCapabilities().addTransportType(TRANSPORT_WIFI).build();
 
+    private CarrierIdAsyncQueryHandler mCarrierIdAsyncQueryHandler;
+    private static final int TOKEN_QUERY_CARRIER_ID_AND_UPDATE_SIM_SUMMARY = 1;
+    private static final int COLUMN_CARRIER_NAME = 0;
+
+    private class CarrierIdAsyncQueryHandler extends AsyncQueryHandler {
+
+        private CarrierIdAsyncQueryHandler(Context context) {
+            super(context.getContentResolver());
+        }
+
+        @Override
+        protected void onQueryComplete(int token, Object cookie, Cursor cursor) {
+            if (token == TOKEN_QUERY_CARRIER_ID_AND_UPDATE_SIM_SUMMARY) {
+                if (mContext == null || cursor == null || !cursor.moveToFirst()) {
+                    if (cursor != null) {
+                        cursor.close();
+                    }
+                    mEapSimSubscriptionPref.setSummary(R.string.wifi_require_sim_card_to_connect);
+                    return;
+                }
+                mEapSimSubscriptionPref.setSummary(mContext.getString(
+                        R.string.wifi_require_specific_sim_card_to_connect,
+                        cursor.getString(COLUMN_CARRIER_NAME)));
+                cursor.close();
+                return;
+            }
+        }
+    }
+
     // Must be run on the UI thread since it directly manipulates UI state.
     private final NetworkCallback mNetworkCallback = new NetworkCallback() {
         @Override
@@ -336,6 +376,7 @@
         mSecurityPref = screen.findPreference(KEY_SECURITY_PREF);
 
         mSsidPref = screen.findPreference(KEY_SSID_PREF);
+        mEapSimSubscriptionPref = screen.findPreference(KEY_EAP_SIM_SUBSCRIPTION_PREF);
         mMacAddressPref = screen.findPreference(KEY_MAC_ADDRESS_PREF);
         mIpAddressPref = screen.findPreference(KEY_IP_ADDRESS_PREF);
         mGatewayPref = screen.findPreference(KEY_GATEWAY_PREF);
@@ -507,6 +548,8 @@
         refreshIpLayerInfo();
         // SSID Pref
         refreshSsid();
+        // EAP SIM subscription
+        refreshEapSimSubscription();
         // MAC Address Pref
         refreshMacAddress();
     }
@@ -630,6 +673,62 @@
         }
     }
 
+    private void refreshEapSimSubscription() {
+        mEapSimSubscriptionPref.setVisible(false);
+
+        if (mWifiEntry.getSecurity() != WifiEntry.SECURITY_EAP) {
+            return;
+        }
+        final WifiConfiguration config = mWifiEntry.getWifiConfiguration();
+        if (config == null || config.enterpriseConfig == null) {
+            return;
+        }
+        if (!config.enterpriseConfig.isAuthenticationSimBased()) {
+            return;
+        }
+
+        mEapSimSubscriptionPref.setVisible(true);
+
+        // Checks if the SIM subscription is active.
+        final List<SubscriptionInfo> activeSubscriptionInfos = mContext
+                .getSystemService(SubscriptionManager.class).getActiveSubscriptionInfoList();
+        final int defaultDataSubscriptionId = SubscriptionManager.getDefaultDataSubscriptionId();
+        if (activeSubscriptionInfos != null) {
+            for (SubscriptionInfo subscriptionInfo : activeSubscriptionInfos) {
+                if (config.carrierId == subscriptionInfo.getCarrierId()) {
+                    mEapSimSubscriptionPref.setSummary(subscriptionInfo.getDisplayName());
+                    return;
+                }
+
+                // When it's UNKNOWN_CARRIER_ID, devices connects it with the SIM subscription of
+                // defaultDataSubscriptionId.
+                if (config.carrierId == TelephonyManager.UNKNOWN_CARRIER_ID
+                        && defaultDataSubscriptionId == subscriptionInfo.getSubscriptionId()) {
+                    mEapSimSubscriptionPref.setSummary(subscriptionInfo.getDisplayName());
+                    return;
+                }
+            }
+        }
+
+        if (config.carrierId == TelephonyManager.UNKNOWN_CARRIER_ID) {
+            mEapSimSubscriptionPref.setSummary(R.string.wifi_no_related_sim_card);
+            return;
+        }
+
+        // The Wi-Fi network has specified carrier id, query carrier name from CarrierIdProvider.
+        if (mCarrierIdAsyncQueryHandler == null) {
+            mCarrierIdAsyncQueryHandler = new CarrierIdAsyncQueryHandler(mContext);
+        }
+        mCarrierIdAsyncQueryHandler.cancelOperation(TOKEN_QUERY_CARRIER_ID_AND_UPDATE_SIM_SUMMARY);
+        mCarrierIdAsyncQueryHandler.startQuery(TOKEN_QUERY_CARRIER_ID_AND_UPDATE_SIM_SUMMARY,
+                null /* cookie */,
+                CarrierId.All.CONTENT_URI,
+                new String[]{CarrierId.CARRIER_NAME},
+                CarrierId.CARRIER_ID + "=?",
+                new String[] {Integer.toString(config.carrierId)},
+                null /* orderBy */);
+    }
+
     private void refreshMacAddress() {
         final String macAddress = mWifiEntry.getMacAddress();
         if (TextUtils.isEmpty(macAddress)) {
diff --git a/src/com/android/settings/wifi/tether/WifiTetherPasswordPreferenceController.java b/src/com/android/settings/wifi/tether/WifiTetherPasswordPreferenceController.java
index a4a51dc..be67d22 100644
--- a/src/com/android/settings/wifi/tether/WifiTetherPasswordPreferenceController.java
+++ b/src/com/android/settings/wifi/tether/WifiTetherPasswordPreferenceController.java
@@ -118,7 +118,7 @@
 
     @Override
     public boolean isTextValid(String value) {
-        return WifiUtils.isHotspotPasswordValid(value);
+        return WifiUtils.isHotspotWpa2PasswordValid(value);
     }
 
     private static String generateRandomPassword() {
diff --git a/tests/robotests/src/com/android/settings/applications/manageapplications/ManageApplicationsTest.java b/tests/robotests/src/com/android/settings/applications/manageapplications/ManageApplicationsTest.java
index 4d420d1..a27e40d 100644
--- a/tests/robotests/src/com/android/settings/applications/manageapplications/ManageApplicationsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/manageapplications/ManageApplicationsTest.java
@@ -570,12 +570,14 @@
 
         mFragment.createHeader();
 
-        assertThat(mFragment.mFilterAdapter.getCount()).isEqualTo(3);
+        assertThat(mFragment.mFilterAdapter.getCount()).isEqualTo(4);
         assertThat(mFragment.mFilterAdapter.getItem(0)).isEqualTo(
                 mContext.getString(R.string.sort_order_recent_notification));
         assertThat(mFragment.mFilterAdapter.getItem(1)).isEqualTo(
                 mContext.getString(R.string.sort_order_frequent_notification));
         assertThat(mFragment.mFilterAdapter.getItem(2)).isEqualTo(
+                mContext.getString(R.string.filter_all_apps));
+        assertThat(mFragment.mFilterAdapter.getItem(3)).isEqualTo(
                 mContext.getString(R.string.filter_notif_blocked_apps));
     }
 
diff --git a/tests/robotests/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessControllerTest.java b/tests/robotests/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessControllerTest.java
index 6041e9d..8febbc6 100644
--- a/tests/robotests/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessControllerTest.java
@@ -63,12 +63,6 @@
     }
 
     @Test
-    public void isAvailable_lowMemory_false() {
-        mActivityManager.setIsLowRamDevice(true);
-        assertThat(mController.isAvailable()).isFalse();
-    }
-
-    @Test
     public void logSpecialPermissionChange() {
         ZenAccessController.logSpecialPermissionChange(true, "app", mContext);
         verify(mFeatureFactory.metricsFeatureProvider).action(any(Context.class),
diff --git a/tests/robotests/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessSettingObserverMixinTest.java b/tests/robotests/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessSettingObserverMixinTest.java
index cba1a51..fb565b6 100644
--- a/tests/robotests/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessSettingObserverMixinTest.java
+++ b/tests/robotests/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessSettingObserverMixinTest.java
@@ -65,7 +65,7 @@
     }
 
     @Test
-    public void onStart_lowMemory_shouldNotRegisterListener() {
+    public void onStart_shouldRegisterListener() {
         final ShadowActivityManager sam = Shadow.extract(
                 mContext.getSystemService(ActivityManager.class));
         sam.setIsLowRamDevice(true);
@@ -75,29 +75,11 @@
         mContext.getContentResolver().notifyChange(Settings.Secure.getUriFor(
                 Settings.Secure.ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES), null);
 
-        verify(mListener, never()).onZenAccessPolicyChanged();
-    }
-
-    @Test
-    public void onStart_highMemory_shouldRegisterListener() {
-        final ShadowActivityManager sam = Shadow.extract(
-                mContext.getSystemService(ActivityManager.class));
-        sam.setIsLowRamDevice(false);
-
-        mLifecycle.handleLifecycleEvent(ON_START);
-
-        mContext.getContentResolver().notifyChange(Settings.Secure.getUriFor(
-                Settings.Secure.ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES), null);
-
         verify(mListener).onZenAccessPolicyChanged();
     }
 
     @Test
     public void onStop_shouldUnregisterListener() {
-        final ShadowActivityManager sam = Shadow.extract(
-                mContext.getSystemService(ActivityManager.class));
-        sam.setIsLowRamDevice(false);
-
         mLifecycle.handleLifecycleEvent(ON_START);
         mLifecycle.handleLifecycleEvent(ON_STOP);
 
diff --git a/tests/robotests/src/com/android/settings/network/AdaptiveConnectivityPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/network/AdaptiveConnectivityPreferenceControllerTest.java
new file mode 100644
index 0000000..9ba6238
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/network/AdaptiveConnectivityPreferenceControllerTest.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.network;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.provider.Settings;
+
+import com.android.settings.R;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+
+@RunWith(RobolectricTestRunner.class)
+public class AdaptiveConnectivityPreferenceControllerTest {
+
+    private static final String PREF_KEY = "adaptive_connectivity";
+
+    private Context mContext;
+    @Mock private Resources mResources;
+    private AdaptiveConnectivityPreferenceController mController;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        mContext = spy(RuntimeEnvironment.application);
+        doReturn(mResources).when(mContext).getResources();
+        mController = new AdaptiveConnectivityPreferenceController(mContext, PREF_KEY);
+    }
+
+    @Test
+    public void isAvailable_supportAdaptiveConnectivity_shouldReturnTrue() {
+        when(mResources.getBoolean(R.bool.config_show_adaptive_connectivity))
+                .thenReturn(true);
+
+        assertThat(mController.isAvailable()).isTrue();
+    }
+
+    @Test
+    public void isAvailable_notSupportAdaptiveConnectivity_shouldReturnFalse() {
+        when(mResources.getBoolean(R.bool.config_show_adaptive_connectivity))
+                .thenReturn(false);
+
+        assertThat(mController.isAvailable()).isFalse();
+    }
+
+    @Test
+    public void getSummary_adaptiveConnectivityEnabled_shouldShowOn() {
+        Settings.Secure.putInt(mContext.getContentResolver(),
+                Settings.Secure.ADAPTIVE_CONNECTIVITY_ENABLED, 1);
+
+        assertThat(mController.getSummary()).isEqualTo(mContext.getString(R.string.switch_on_text));
+    }
+
+    @Test
+    public void getSummary_adaptiveConnectivityEnabled_shouldShowOff() {
+        Settings.Secure.putInt(mContext.getContentResolver(),
+                Settings.Secure.ADAPTIVE_CONNECTIVITY_ENABLED, 0);
+
+        assertThat(mController.getSummary())
+                .isEqualTo(mContext.getString(R.string.switch_off_text));
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/network/AdaptiveConnectivityTogglePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/network/AdaptiveConnectivityTogglePreferenceControllerTest.java
new file mode 100644
index 0000000..dfb9a8f
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/network/AdaptiveConnectivityTogglePreferenceControllerTest.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.network;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Answers.RETURNS_DEEP_STUBS;
+
+import android.content.Context;
+import android.provider.Settings;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+
+@RunWith(RobolectricTestRunner.class)
+public class AdaptiveConnectivityTogglePreferenceControllerTest {
+
+    private static final String PREF_KEY = "adaptive_connectivity";
+
+    @Mock(answer = RETURNS_DEEP_STUBS)
+    private Context mContext;
+
+    private AdaptiveConnectivityTogglePreferenceController mController;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        mController = new AdaptiveConnectivityTogglePreferenceController(mContext, PREF_KEY);
+    }
+
+    @Test
+    public void isAvailable_shouldReturnTrue() {
+        assertThat(mController.isAvailable()).isTrue();
+    }
+
+    @Test
+    public void setChecked_withTrue_shouldUpdateSetting() {
+        Settings.Secure.putInt(mContext.getContentResolver(),
+                Settings.Secure.ADAPTIVE_CONNECTIVITY_ENABLED, 0);
+
+        mController.setChecked(true);
+
+        assertThat(Settings.Secure.getInt(mContext.getContentResolver(),
+                Settings.Secure.ADAPTIVE_CONNECTIVITY_ENABLED, 1))
+                .isEqualTo(1);
+    }
+
+    @Test
+    public void setChecked_withFalse_shouldUpdateSetting() {
+        Settings.Secure.putInt(mContext.getContentResolver(),
+                Settings.Secure.ADAPTIVE_CONNECTIVITY_ENABLED, 1);
+
+        mController.setChecked(false);
+
+        assertThat(Settings.Secure.getInt(mContext.getContentResolver(),
+                Settings.Secure.ADAPTIVE_CONNECTIVITY_ENABLED, 1))
+                .isEqualTo(0);
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/network/WifiConnectionPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/network/WifiConnectionPreferenceControllerTest.java
index ea957c3..7037318 100644
--- a/tests/robotests/src/com/android/settings/network/WifiConnectionPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/network/WifiConnectionPreferenceControllerTest.java
@@ -29,15 +29,12 @@
 
 import android.content.Context;
 
-import androidx.lifecycle.LifecycleOwner;
-import androidx.preference.PreferenceCategory;
-import androidx.preference.PreferenceScreen;
-
 import com.android.settings.wifi.WifiConnectionPreferenceController;
 import com.android.settingslib.core.lifecycle.Lifecycle;
-import com.android.settingslib.wifi.WifiEntryPreference;
-import com.android.wifitrackerlib.WifiEntry;
-import com.android.wifitrackerlib.WifiPickerTracker;
+import com.android.settingslib.wifi.AccessPoint;
+import com.android.settingslib.wifi.AccessPointPreference;
+import com.android.settingslib.wifi.WifiTracker;
+import com.android.settingslib.wifi.WifiTrackerFactory;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -48,12 +45,19 @@
 import org.robolectric.RobolectricTestRunner;
 import org.robolectric.RuntimeEnvironment;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import androidx.lifecycle.LifecycleOwner;
+import androidx.preference.PreferenceCategory;
+import androidx.preference.PreferenceScreen;
+
 @RunWith(RobolectricTestRunner.class)
 public class WifiConnectionPreferenceControllerTest {
     private static final String KEY = "wifi_connection";
 
     @Mock
-    WifiPickerTracker mWifiPickerTracker;
+    WifiTracker mWifiTracker;
     @Mock
     PreferenceScreen mScreen;
     @Mock
@@ -70,6 +74,7 @@
     public void setUp() {
         MockitoAnnotations.initMocks(this);
         mContext = spy(RuntimeEnvironment.application);
+        WifiTrackerFactory.setTestingWifiTracker(mWifiTracker);
         mLifecycleOwner = () -> mLifecycle;
         mLifecycle = new Lifecycle(mLifecycleOwner);
         when(mScreen.findPreference(eq(KEY))).thenReturn(mPreferenceCategory);
@@ -78,51 +83,49 @@
 
         mController = new WifiConnectionPreferenceController(mContext, mLifecycle, mUpdateListener,
                 KEY, 0, 0);
-        mController.mWifiPickerTracker = mWifiPickerTracker;
     }
 
     @Test
-    public void isAvailable_noConnectedWifiEntry_availableIsFalse() {
-        when(mWifiPickerTracker.getConnectedWifiEntry()).thenReturn(null);
-
+    public void isAvailable_noWiFiConnection_availableIsFalse() {
+        when(mWifiTracker.isConnected()).thenReturn(false);
         assertThat(mController.isAvailable()).isFalse();
     }
 
     @Test
-    public void displayPreference_noConnectedWifiEntry_noPreferenceAdded() {
-        when(mWifiPickerTracker.getConnectedWifiEntry()).thenReturn(null);
-
+    public void displayPreference_noWiFiConnection_noPreferenceAdded() {
+        when(mWifiTracker.isConnected()).thenReturn(false);
+        when(mWifiTracker.getAccessPoints()).thenReturn(new ArrayList<>());
         mController.displayPreference(mScreen);
-
         verify(mPreferenceCategory, never()).addPreference(any());
     }
 
     @Test
-    public void displayPreference_hasConnectedWifiEntry_preferenceAdded() {
-        final WifiEntry wifiEntry = mock(WifiEntry.class);
-        when(mWifiPickerTracker.getConnectedWifiEntry()).thenReturn(wifiEntry);
-
+    public void displayPreference_hasWiFiConnection_preferenceAdded() {
+        when(mWifiTracker.isConnected()).thenReturn(true);
+        final AccessPoint accessPoint = mock(AccessPoint.class);
+        when(accessPoint.isActive()).thenReturn(true);
+        when(mWifiTracker.getAccessPoints()).thenReturn(Arrays.asList(accessPoint));
         mController.displayPreference(mScreen);
-        verify(mPreferenceCategory).addPreference(any(WifiEntryPreference.class));
+        verify(mPreferenceCategory).addPreference(any(AccessPointPreference.class));
     }
 
     @Test
     public void onConnectedChanged_wifiBecameDisconnected_preferenceRemoved() {
-        final WifiEntry wifiEntry = mock(WifiEntry.class);
-        when(mWifiPickerTracker.getConnectedWifiEntry()).thenReturn(wifiEntry);
+        when(mWifiTracker.isConnected()).thenReturn(true);
+        final AccessPoint accessPoint = mock(AccessPoint.class);
 
+        when(accessPoint.isActive()).thenReturn(true);
+        when(mWifiTracker.getAccessPoints()).thenReturn(Arrays.asList(accessPoint));
         mController.displayPreference(mScreen);
-        final ArgumentCaptor<WifiEntryPreference> captor = ArgumentCaptor.forClass(
-                WifiEntryPreference.class);
+        final ArgumentCaptor<AccessPointPreference> captor = ArgumentCaptor.forClass(
+                AccessPointPreference.class);
         verify(mPreferenceCategory).addPreference(captor.capture());
-        final WifiEntryPreference pref = captor.getValue();
+        final AccessPointPreference pref = captor.getValue();
 
-        // Become disconnected.
-        when(mWifiPickerTracker.getConnectedWifiEntry()).thenReturn(null);
+        when(mWifiTracker.isConnected()).thenReturn(false);
+        when(mWifiTracker.getAccessPoints()).thenReturn(new ArrayList<>());
         final int onUpdatedCountBefore = mOnChildUpdatedCount;
-
-        mController.onWifiStateChanged();
-
+        mController.onConnectedChanged();
         verify(mPreferenceCategory).removePreference(pref);
         assertThat(mOnChildUpdatedCount).isEqualTo(onUpdatedCountBefore + 1);
     }
@@ -130,24 +133,28 @@
 
     @Test
     public void onAccessPointsChanged_wifiBecameConnectedToDifferentAP_preferenceReplaced() {
-        final WifiEntry wifiEntry1 = mock(WifiEntry.class);
-        when(wifiEntry1.getKey()).thenReturn("KEY_1");
-        when(mWifiPickerTracker.getConnectedWifiEntry()).thenReturn(wifiEntry1);
-        mController.displayPreference(mScreen);
-        final ArgumentCaptor<WifiEntryPreference> captor = ArgumentCaptor.forClass(
-                WifiEntryPreference.class);
+        when(mWifiTracker.isConnected()).thenReturn(true);
+        final AccessPoint accessPoint1 = mock(AccessPoint.class);
 
-        final WifiEntry wifiEntry2 = mock(WifiEntry.class);
-        when(wifiEntry1.getKey()).thenReturn("KEY_2");
-        when(mWifiPickerTracker.getConnectedWifiEntry()).thenReturn(wifiEntry2);
+        when(accessPoint1.isActive()).thenReturn(true);
+        when(mWifiTracker.getAccessPoints()).thenReturn(Arrays.asList(accessPoint1));
+        mController.displayPreference(mScreen);
+        final ArgumentCaptor<AccessPointPreference> captor = ArgumentCaptor.forClass(
+                AccessPointPreference.class);
+
+
+        final AccessPoint accessPoint2 = mock(AccessPoint.class);
+        when(accessPoint1.isActive()).thenReturn(false);
+        when(accessPoint2.isActive()).thenReturn(true);
+        when(mWifiTracker.getAccessPoints()).thenReturn(Arrays.asList(accessPoint1, accessPoint2));
         final int onUpdatedCountBefore = mOnChildUpdatedCount;
-        mController.onWifiEntriesChanged();
+        mController.onAccessPointsChanged();
 
         verify(mPreferenceCategory, times(2)).addPreference(captor.capture());
-        final WifiEntryPreference pref1 = captor.getAllValues().get(0);
-        final WifiEntryPreference pref2 = captor.getAllValues().get(1);
-        assertThat(pref1.getWifiEntry()).isEqualTo(wifiEntry1);
-        assertThat(pref2.getWifiEntry()).isEqualTo(wifiEntry2);
+        final AccessPointPreference pref1 = captor.getAllValues().get(0);
+        final AccessPointPreference pref2 = captor.getAllValues().get(1);
+        assertThat(pref1.getAccessPoint()).isEqualTo(accessPoint1);
+        assertThat(pref2.getAccessPoint()).isEqualTo(accessPoint2);
         verify(mPreferenceCategory).removePreference(eq(pref1));
         assertThat(mOnChildUpdatedCount).isEqualTo(onUpdatedCountBefore + 1);
     }
diff --git a/tests/robotests/src/com/android/settings/notification/app/BlockPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/app/BlockPreferenceControllerTest.java
index d203c47..2ea240e 100644
--- a/tests/robotests/src/com/android/settings/notification/app/BlockPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/app/BlockPreferenceControllerTest.java
@@ -368,6 +368,7 @@
     public void testOnSwitchChanged_channel_nonDefault() {
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         NotificationChannel channel = new NotificationChannel("a", "a", IMPORTANCE_HIGH);
+        channel.setOriginalImportance(IMPORTANCE_HIGH);
         mController.onResume(appRow, channel, null, null, null, null);
         mController.updateState(mPreference);
 
@@ -375,7 +376,7 @@
         assertEquals(IMPORTANCE_NONE, channel.getImportance());
 
         mController.onSwitchChanged(null, true);
-        assertEquals(IMPORTANCE_DEFAULT, channel.getImportance());
+        assertEquals(IMPORTANCE_HIGH, channel.getImportance());
 
         verify(mBackend, times(2)).updateChannel(any(), anyInt(), any());
     }
diff --git a/tests/robotests/src/com/android/settings/notification/app/BubblePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/app/BubblePreferenceControllerTest.java
index 6fec525..afb3d1b 100644
--- a/tests/robotests/src/com/android/settings/notification/app/BubblePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/app/BubblePreferenceControllerTest.java
@@ -137,7 +137,7 @@
     }
 
     @Test
-    public void isAvailable_channel_yesIfAppOff() {
+    public void isAvailable_channel_notIfAppOff() {
         Settings.Global.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         appRow.bubblePreference = BUBBLE_PREFERENCE_NONE;
@@ -145,7 +145,7 @@
         when(channel.getImportance()).thenReturn(IMPORTANCE_HIGH);
         mController.onResume(appRow, channel, null, null, null, null);
 
-        assertTrue(mController.isAvailable());
+        assertFalse(mController.isAvailable());
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/notification/app/ConversationPriorityPreferenceTest.java b/tests/robotests/src/com/android/settings/notification/app/ConversationPriorityPreferenceTest.java
index 12e1f35..2d2fcc8 100644
--- a/tests/robotests/src/com/android/settings/notification/app/ConversationPriorityPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/notification/app/ConversationPriorityPreferenceTest.java
@@ -68,10 +68,6 @@
         final LayoutInflater inflater = LayoutInflater.from(mContext);
         PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(
                 inflater.inflate(preference.getLayoutResource(), null));
-        Drawable unselected = mock(Drawable.class);
-        Drawable selected = mock(Drawable.class);
-        preference.selectedBackground = selected;
-        preference.unselectedBackground = unselected;
 
         preference.setConfigurable(false);
         preference.setImportance(IMPORTANCE_DEFAULT);
@@ -81,35 +77,6 @@
         assertThat(holder.itemView.findViewById(R.id.silence).isEnabled()).isFalse();
         assertThat(holder.itemView.findViewById(R.id.priority_group).isEnabled()).isFalse();
         assertThat(holder.itemView.findViewById(R.id.alert).isEnabled()).isFalse();
-
-        assertThat(holder.itemView.findViewById(R.id.priority_group).getBackground())
-                .isEqualTo(selected);
-        assertThat(holder.itemView.findViewById(R.id.alert).getBackground()).isEqualTo(unselected);
-        assertThat(holder.itemView.findViewById(R.id.silence).getBackground())
-                .isEqualTo(unselected);
-
-        // other button
-        preference.setPriorityConversation(false);
-        holder = PreferenceViewHolder.createInstanceForTests(
-                inflater.inflate(preference.getLayoutResource(), null));
-        preference.onBindViewHolder(holder);
-
-        assertThat(holder.itemView.findViewById(R.id.alert).getBackground()).isEqualTo(selected);
-        assertThat(holder.itemView.findViewById(R.id.silence).getBackground())
-                .isEqualTo(unselected);
-        assertThat(holder.itemView.findViewById(R.id.priority_group).getBackground())
-                .isEqualTo(unselected);
-
-        // other other button
-        preference.setImportance(IMPORTANCE_LOW);
-        holder = PreferenceViewHolder.createInstanceForTests(
-                inflater.inflate(preference.getLayoutResource(), null));
-        preference.onBindViewHolder(holder);
-
-        assertThat(holder.itemView.findViewById(R.id.priority_group).getBackground())
-                .isEqualTo(unselected);
-        assertThat(holder.itemView.findViewById(R.id.alert).getBackground()).isEqualTo(unselected);
-        assertThat(holder.itemView.findViewById(R.id.silence).getBackground()).isEqualTo(selected);
     }
 
     @Test
@@ -119,10 +86,6 @@
         final LayoutInflater inflater = LayoutInflater.from(mContext);
         final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(
                 inflater.inflate(preference.getLayoutResource(), null));
-        Drawable unselected = mock(Drawable.class);
-        Drawable selected = mock(Drawable.class);
-        preference.selectedBackground = selected;
-        preference.unselectedBackground = unselected;
 
         preference.setConfigurable(true);
         preference.setImportance(IMPORTANCE_LOW);
@@ -130,12 +93,8 @@
 
         preference.onBindViewHolder(holder);
 
-        assertThat(holder.itemView.findViewById(R.id.priority_group).getBackground())
-                .isEqualTo(unselected);
-        assertThat(holder.itemView.findViewById(R.id.alert).getBackground()).isEqualTo(unselected);
-        assertThat(holder.itemView.findViewById(R.id.silence).getBackground())
-                .isEqualTo(selected);
-        assertThat(holder.itemView.findViewById(R.id.silence_summary).getVisibility())
+        assertThat(holder.itemView.findViewById(R.id.silence)
+                .findViewById(R.id.summary).getVisibility())
                 .isEqualTo(View.VISIBLE);
     }
 
@@ -146,10 +105,6 @@
         final LayoutInflater inflater = LayoutInflater.from(mContext);
         final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(
                 inflater.inflate(preference.getLayoutResource(), null));
-        Drawable unselected = mock(Drawable.class);
-        Drawable selected = mock(Drawable.class);
-        preference.selectedBackground = selected;
-        preference.unselectedBackground = unselected;
 
         preference.setConfigurable(true);
         preference.setImportance(IMPORTANCE_DEFAULT);
@@ -161,12 +116,6 @@
 
         silenceButton.callOnClick();
 
-        assertThat(holder.itemView.findViewById(R.id.alert).getBackground()).isEqualTo(unselected);
-        assertThat(holder.itemView.findViewById(R.id.priority_group).getBackground())
-                .isEqualTo(unselected);
-        assertThat(holder.itemView.findViewById(R.id.silence).getBackground())
-                .isEqualTo(selected);
-
         verify(preference, times(1)).callChangeListener(new Pair(IMPORTANCE_LOW, false));
     }
 }
diff --git a/tests/robotests/src/com/android/settings/sound/MediaControlsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/sound/MediaControlsPreferenceControllerTest.java
index b8cc709..f281e25 100644
--- a/tests/robotests/src/com/android/settings/sound/MediaControlsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/sound/MediaControlsPreferenceControllerTest.java
@@ -69,26 +69,26 @@
     }
 
     @Test
-    public void setChecked_enable_shouldTurnOff() {
+    public void setChecked_enable_shouldTurnOn() {
         Settings.Global.putInt(mContentResolver, Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS, 1);
         Settings.Secure.putInt(mContentResolver, Settings.Secure.MEDIA_CONTROLS_RESUME, 1);
 
-        assertThat(mController.isChecked()).isFalse();
+        assertThat(mController.isChecked()).isTrue();
 
-        mController.setChecked(true);
+        mController.setChecked(false);
 
         assertThat(Settings.Secure.getInt(mContentResolver,
                 Settings.Secure.MEDIA_CONTROLS_RESUME, -1)).isEqualTo(0);
     }
 
     @Test
-    public void setChecked_disable_shouldTurnOn() {
+    public void setChecked_disable_shouldTurnOff() {
         Settings.Global.putInt(mContentResolver, Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS, 1);
         Settings.Secure.putInt(mContentResolver, Settings.Secure.MEDIA_CONTROLS_RESUME, 0);
 
-        assertThat(mController.isChecked()).isTrue();
+        assertThat(mController.isChecked()).isFalse();
 
-        mController.setChecked(false);
+        mController.setChecked(true);
 
         assertThat(Settings.Secure.getInt(mContentResolver,
                 Settings.Secure.MEDIA_CONTROLS_RESUME, -1)).isEqualTo(1);
diff --git a/tests/robotests/src/com/android/settings/sound/ResumableMediaAppsControllerTest.java b/tests/robotests/src/com/android/settings/sound/ResumableMediaAppsControllerTest.java
new file mode 100644
index 0000000..797560a
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/sound/ResumableMediaAppsControllerTest.java
@@ -0,0 +1,168 @@
+/*
+ * Copyright (C) 2020 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.sound;
+
+import static com.android.settings.core.BasePreferenceController.AVAILABLE;
+import static com.android.settings.core.BasePreferenceController.CONDITIONALLY_UNAVAILABLE;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.provider.Settings;
+
+import androidx.preference.PreferenceGroup;
+import androidx.preference.PreferenceScreen;
+
+import com.android.settings.testutils.ResolveInfoBuilder;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Mock;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@RunWith(RobolectricTestRunner.class)
+public class ResumableMediaAppsControllerTest {
+
+    private static final String KEY = "media_controls_resumable_apps";
+
+    private static final String FAKE_APP = "com.test.fakeapp1";
+
+    private Context mContext;
+    private int mOriginalQs;
+    private int mOriginalResume;
+    private String mOriginalBlocked;
+    private ContentResolver mContentResolver;
+    private ResumableMediaAppsController mController;
+    @Mock
+    private PackageManager mPackageManager;
+    @Mock
+    private PreferenceScreen mPreferenceScreen;
+    @Mock
+    private PreferenceGroup mPreferenceGroup;
+
+    @Before
+    public void setUp() {
+        mContext = spy(RuntimeEnvironment.application);
+        mContentResolver = mContext.getContentResolver();
+        mOriginalQs = Settings.Global.getInt(mContentResolver,
+                Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS, 1);
+        mOriginalResume = Settings.Secure.getInt(mContentResolver,
+                Settings.Secure.MEDIA_CONTROLS_RESUME, 1);
+        mOriginalBlocked = Settings.Secure.getString(mContentResolver,
+                Settings.Secure.MEDIA_CONTROLS_RESUME_BLOCKED);
+
+        // Start all tests with feature enabled, nothing blocked
+        Settings.Global.putInt(mContentResolver, Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS, 1);
+        Settings.Secure.putInt(mContentResolver, Settings.Secure.MEDIA_CONTROLS_RESUME, 1);
+        Settings.Secure.putString(mContentResolver, Settings.Secure.MEDIA_CONTROLS_RESUME_BLOCKED,
+                mOriginalBlocked);
+
+        mPreferenceScreen = mock(PreferenceScreen.class);
+        mPreferenceGroup = mock(PreferenceGroup.class);
+        mPackageManager = mock(PackageManager.class);
+
+        List<ResolveInfo> fakeInfo = new ArrayList<>();
+        fakeInfo.add(createResolveInfo(FAKE_APP));
+        when(mPackageManager.queryIntentServices(any(), anyInt())).thenReturn(fakeInfo);
+
+        when(mContext.getPackageManager()).thenReturn(mPackageManager);
+        when(mPreferenceScreen.findPreference(KEY)).thenReturn(mPreferenceGroup);
+
+        mController = new ResumableMediaAppsController(mContext, KEY);
+    }
+
+    @After
+    public void tearDown() {
+        Settings.Global.putInt(mContentResolver, Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS,
+                mOriginalQs);
+        Settings.Secure.putInt(mContentResolver, Settings.Secure.MEDIA_CONTROLS_RESUME,
+                mOriginalResume);
+        Settings.Secure.putString(mContentResolver, Settings.Secure.MEDIA_CONTROLS_RESUME_BLOCKED,
+                mOriginalBlocked);
+    }
+
+    @Test
+    public void getAvailability_hasEligibleApps_isAvailable() {
+        // The package manager already has an eligible app from setUp()
+        assertEquals(AVAILABLE, mController.getAvailabilityStatus());
+    }
+
+    @Test
+    public void getAvailability_noEligibleApps_isConditionallyUnavailable() {
+        Context context = mock(Context.class);
+        PackageManager packageManager = mock(PackageManager.class);
+        List<ResolveInfo> fakeInfo = new ArrayList<>();
+        when(packageManager.queryIntentServices(any(), anyInt())).thenReturn(fakeInfo);
+        when(context.getPackageManager()).thenReturn(packageManager);
+        ResumableMediaAppsController controller = new ResumableMediaAppsController(context, KEY);
+
+        assertEquals(CONDITIONALLY_UNAVAILABLE, controller.getAvailabilityStatus());
+    }
+
+    @Test
+    public void displayPreference_addsApps() {
+        mController.displayPreference(mPreferenceScreen);
+        verify(mPreferenceGroup, times(1)).addPreference(any());
+    }
+
+    @Test
+    public void unblockedApp_isChecked() {
+        ArgumentCaptor<ResumableMediaAppsController.MediaSwitchPreference> argument =
+                ArgumentCaptor.forClass(ResumableMediaAppsController.MediaSwitchPreference.class);
+        mController.displayPreference(mPreferenceScreen);
+        verify(mPreferenceGroup).addPreference(argument.capture());
+        assertTrue(argument.getValue().isChecked());
+    }
+
+    @Test
+    public void blockedApp_isNotChecked() {
+        Settings.Secure.putString(mContentResolver, Settings.Secure.MEDIA_CONTROLS_RESUME_BLOCKED,
+                FAKE_APP);
+
+        ArgumentCaptor<ResumableMediaAppsController.MediaSwitchPreference> argument =
+                ArgumentCaptor.forClass(ResumableMediaAppsController.MediaSwitchPreference.class);
+        mController.displayPreference(mPreferenceScreen);
+        verify(mPreferenceGroup).addPreference(argument.capture());
+
+        assertFalse(argument.getValue().isChecked());
+    }
+
+    private ResolveInfo createResolveInfo(String name) {
+        ResolveInfoBuilder builder = new ResolveInfoBuilder(name);
+        builder.setActivity(name, name);
+        return builder.build();
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/testutils/FakeFeatureFactory.java b/tests/robotests/src/com/android/settings/testutils/FakeFeatureFactory.java
index b6c4fb7..2c68269 100644
--- a/tests/robotests/src/com/android/settings/testutils/FakeFeatureFactory.java
+++ b/tests/robotests/src/com/android/settings/testutils/FakeFeatureFactory.java
@@ -29,6 +29,7 @@
 import com.android.settings.dashboard.DashboardFeatureProvider;
 import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
 import com.android.settings.enterprise.EnterprisePrivacyFeatureProvider;
+import com.android.settings.fuelgauge.BatteryStatusFeatureProvider;
 import com.android.settings.fuelgauge.PowerUsageFeatureProvider;
 import com.android.settings.gestures.AssistGestureFeatureProvider;
 import com.android.settings.homepage.contextualcards.ContextualCardFeatureProvider;
@@ -54,6 +55,7 @@
 
     public final SupportFeatureProvider supportFeatureProvider;
     public final MetricsFeatureProvider metricsFeatureProvider;
+    public final BatteryStatusFeatureProvider batteryStatusFeatureProvider;
     public final PowerUsageFeatureProvider powerUsageFeatureProvider;
     public final DashboardFeatureProvider dashboardFeatureProvider;
     public final DockUpdaterFeatureProvider dockUpdaterFeatureProvider;
@@ -98,6 +100,7 @@
     public FakeFeatureFactory() {
         supportFeatureProvider = mock(SupportFeatureProvider.class);
         metricsFeatureProvider = mock(MetricsFeatureProvider.class);
+        batteryStatusFeatureProvider = mock(BatteryStatusFeatureProvider.class);
         powerUsageFeatureProvider = mock(PowerUsageFeatureProvider.class);
         dashboardFeatureProvider = mock(DashboardFeatureProvider.class);
         dockUpdaterFeatureProvider = mock(DockUpdaterFeatureProvider.class);
@@ -135,6 +138,11 @@
     }
 
     @Override
+    public BatteryStatusFeatureProvider getBatteryStatusFeatureProvider(Context context) {
+        return batteryStatusFeatureProvider;
+    }
+
+    @Override
     public PowerUsageFeatureProvider getPowerUsageFeatureProvider(Context context) {
         return powerUsageFeatureProvider;
     }
diff --git a/tests/robotests/src/com/android/settings/wifi/WifiConfigController2Test.java b/tests/robotests/src/com/android/settings/wifi/WifiConfigController2Test.java
index e588799..779044c 100644
--- a/tests/robotests/src/com/android/settings/wifi/WifiConfigController2Test.java
+++ b/tests/robotests/src/com/android/settings/wifi/WifiConfigController2Test.java
@@ -21,6 +21,7 @@
 import static org.mockito.Mockito.anyString;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
+import static org.robolectric.Shadows.shadowOf;
 
 import android.content.Context;
 import android.content.res.Resources;
@@ -32,6 +33,9 @@
 import android.net.wifi.WifiManager;
 import android.os.ServiceSpecificException;
 import android.security.KeyStore;
+import android.telephony.SubscriptionInfo;
+import android.telephony.SubscriptionManager;
+import android.telephony.TelephonyManager;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.inputmethod.InputMethodManager;
@@ -56,6 +60,9 @@
 import org.robolectric.Shadows;
 import org.robolectric.annotation.Config;
 import org.robolectric.shadows.ShadowInputMethodManager;
+import org.robolectric.shadows.ShadowSubscriptionManager;
+
+import java.util.Arrays;
 
 @RunWith(RobolectricTestRunner.class)
 @Config(shadows = ShadowConnectivityManager.class)
@@ -71,6 +78,7 @@
     private KeyStore mKeyStore;
     private View mView;
     private Spinner mHiddenSettingsSpinner;
+    private ShadowSubscriptionManager mShadowSubscriptionManager;
 
     public WifiConfigController2 mController;
     private static final String HEX_PSK = "01234567012345670123456701234567012345670123456701234567"
@@ -101,6 +109,7 @@
         final Spinner ipSettingsSpinner = mView.findViewById(R.id.ip_settings);
         mHiddenSettingsSpinner = mView.findViewById(R.id.hidden_settings);
         ipSettingsSpinner.setSelection(DHCP);
+        mShadowSubscriptionManager = shadowOf(mContext.getSystemService(SubscriptionManager.class));
 
         mController = new TestWifiConfigController2(mConfigUiBase, mView, mWifiEntry,
                 WifiConfigUiBase2.MODE_CONNECT);
@@ -225,6 +234,35 @@
     }
 
     @Test
+    public void isSubmittable_caCertWithoutDomain_shouldReturnFalse() {
+        when(mWifiEntry.getSecurity()).thenReturn(WifiEntry.SECURITY_EAP);
+        mController = new TestWifiConfigController2(mConfigUiBase, mView, mWifiEntry,
+                WifiConfigUiBase2.MODE_CONNECT);
+        mView.findViewById(R.id.l_ca_cert).setVisibility(View.VISIBLE);
+        final Spinner eapCaCertSpinner = mView.findViewById(R.id.ca_cert);
+        eapCaCertSpinner.setAdapter(mController.getSpinnerAdapter(new String[]{"certificate"}));
+        eapCaCertSpinner.setSelection(0);
+        mView.findViewById(R.id.l_domain).setVisibility(View.VISIBLE);
+
+        assertThat(mController.isSubmittable()).isFalse();
+    }
+
+    @Test
+    public void isSubmittable_caCertWithDomain_shouldReturnTrue() {
+        when(mWifiEntry.getSecurity()).thenReturn(WifiEntry.SECURITY_EAP);
+        mController = new TestWifiConfigController2(mConfigUiBase, mView, mWifiEntry,
+                WifiConfigUiBase2.MODE_CONNECT);
+        mView.findViewById(R.id.l_ca_cert).setVisibility(View.VISIBLE);
+        final Spinner eapCaCertSpinner = mView.findViewById(R.id.ca_cert);
+        eapCaCertSpinner.setAdapter(mController.getSpinnerAdapter(new String[]{"certificate"}));
+        eapCaCertSpinner.setSelection(0);
+        mView.findViewById(R.id.l_domain).setVisibility(View.VISIBLE);
+        ((TextView) mView.findViewById(R.id.domain)).setText("fakeDomain");
+
+        assertThat(mController.isSubmittable()).isTrue();
+    }
+
+    @Test
     public void getSignalString_notReachable_shouldHaveNoSignalString() {
         when(mWifiEntry.getLevel()).thenReturn(WifiEntry.WIFI_LEVEL_UNREACHABLE);
 
@@ -760,4 +798,41 @@
         mController = new TestWifiConfigController2(mConfigUiBase, mView, mWifiEntry,
                 WifiConfigUiBase2.MODE_MODIFY);
     }
+
+    @Test
+    public void loadSims_noSim_simSpinnerDefaultNoSim() {
+        when(mWifiEntry.getSecurity()).thenReturn(WifiEntry.SECURITY_EAP);
+        mController = new TestWifiConfigController2(mConfigUiBase, mView, mWifiEntry,
+                WifiConfigUiBase2.MODE_CONNECT);
+        final Spinner eapMethodSpinner = mock(Spinner.class);
+        when(eapMethodSpinner.getSelectedItemPosition()).thenReturn(
+                WifiConfigController2.WIFI_EAP_METHOD_SIM);
+        mController.mEapMethodSpinner = eapMethodSpinner;
+
+        mController.loadSims();
+
+        final WifiConfiguration wifiConfiguration = mController.getConfig();
+        assertThat(wifiConfiguration.carrierId).isEqualTo(TelephonyManager.UNKNOWN_CARRIER_ID);
+    }
+
+    @Test
+    public void loadSims_oneSim_simSpinnerDefaultSubscription() {
+        when(mWifiEntry.getSecurity()).thenReturn(WifiEntry.SECURITY_EAP);
+        final SubscriptionInfo subscriptionInfo = mock(SubscriptionInfo.class);
+        final int carrierId = 6;
+        when(subscriptionInfo.getCarrierId()).thenReturn(carrierId);
+        when(subscriptionInfo.getCarrierName()).thenReturn("FAKE-CARRIER");
+        mShadowSubscriptionManager.setActiveSubscriptionInfoList(Arrays.asList(subscriptionInfo));
+        mController = new TestWifiConfigController2(mConfigUiBase, mView, mWifiEntry,
+                WifiConfigUiBase2.MODE_CONNECT);
+        final Spinner eapMethodSpinner = mock(Spinner.class);
+        when(eapMethodSpinner.getSelectedItemPosition()).thenReturn(
+                WifiConfigController2.WIFI_EAP_METHOD_SIM);
+        mController.mEapMethodSpinner = eapMethodSpinner;
+
+        mController.loadSims();
+
+        final WifiConfiguration wifiConfiguration = mController.getConfig();
+        assertThat(wifiConfiguration.carrierId).isEqualTo(carrierId);
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java b/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java
index 9146998..9e62b25 100644
--- a/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java
@@ -21,6 +21,7 @@
 import static org.mockito.Mockito.anyString;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
+import static org.robolectric.Shadows.shadowOf;
 
 import android.content.Context;
 import android.content.res.Resources;
@@ -32,6 +33,9 @@
 import android.net.wifi.WifiManager;
 import android.os.ServiceSpecificException;
 import android.security.KeyStore;
+import android.telephony.SubscriptionInfo;
+import android.telephony.SubscriptionManager;
+import android.telephony.TelephonyManager;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.inputmethod.InputMethodManager;
@@ -56,6 +60,9 @@
 import org.robolectric.Shadows;
 import org.robolectric.annotation.Config;
 import org.robolectric.shadows.ShadowInputMethodManager;
+import org.robolectric.shadows.ShadowSubscriptionManager;
+
+import java.util.Arrays;
 
 @RunWith(RobolectricTestRunner.class)
 @Config(shadows = ShadowConnectivityManager.class)
@@ -71,6 +78,7 @@
     private KeyStore mKeyStore;
     private View mView;
     private Spinner mHiddenSettingsSpinner;
+    private ShadowSubscriptionManager mShadowSubscriptionManager;
 
     public WifiConfigController mController;
     private static final String HEX_PSK = "01234567012345670123456701234567012345670123456701234567"
@@ -95,6 +103,7 @@
         final Spinner ipSettingsSpinner = mView.findViewById(R.id.ip_settings);
         mHiddenSettingsSpinner = mView.findViewById(R.id.hidden_settings);
         ipSettingsSpinner.setSelection(DHCP);
+        mShadowSubscriptionManager = shadowOf(mContext.getSystemService(SubscriptionManager.class));
 
         mController = new TestWifiConfigController(mConfigUiBase, mView, mAccessPoint,
                 WifiConfigUiBase.MODE_CONNECT);
@@ -219,6 +228,35 @@
     }
 
     @Test
+    public void isSubmittable_caCertWithoutDomain_shouldReturnFalse() {
+        when(mAccessPoint.getSecurity()).thenReturn(AccessPoint.SECURITY_EAP);
+        mController = new TestWifiConfigController(mConfigUiBase, mView, mAccessPoint,
+                WifiConfigUiBase.MODE_CONNECT);
+        mView.findViewById(R.id.l_ca_cert).setVisibility(View.VISIBLE);
+        final Spinner eapCaCertSpinner = mView.findViewById(R.id.ca_cert);
+        eapCaCertSpinner.setAdapter(mController.getSpinnerAdapter(new String[]{"certificate"}));
+        eapCaCertSpinner.setSelection(0);
+        mView.findViewById(R.id.l_domain).setVisibility(View.VISIBLE);
+
+        assertThat(mController.isSubmittable()).isFalse();
+    }
+
+    @Test
+    public void isSubmittable_caCertWithDomain_shouldReturnTrue() {
+        when(mAccessPoint.getSecurity()).thenReturn(AccessPoint.SECURITY_EAP);
+        mController = new TestWifiConfigController(mConfigUiBase, mView, mAccessPoint,
+                WifiConfigUiBase.MODE_CONNECT);
+        mView.findViewById(R.id.l_ca_cert).setVisibility(View.VISIBLE);
+        final Spinner eapCaCertSpinner = mView.findViewById(R.id.ca_cert);
+        eapCaCertSpinner.setAdapter(mController.getSpinnerAdapter(new String[]{"certificate"}));
+        eapCaCertSpinner.setSelection(0);
+        mView.findViewById(R.id.l_domain).setVisibility(View.VISIBLE);
+        ((TextView) mView.findViewById(R.id.domain)).setText("fakeDomain");
+
+        assertThat(mController.isSubmittable()).isTrue();
+    }
+
+    @Test
     public void getSignalString_notReachable_shouldHaveNoSignalString() {
         when(mAccessPoint.isReachable()).thenReturn(false);
 
@@ -575,4 +613,41 @@
 
         assertThat(advButton.getVisibility()).isEqualTo(View.GONE);
     }
+
+    @Test
+    public void loadSims_noSim_simSpinnerDefaultNoSim() {
+        when(mAccessPoint.getSecurity()).thenReturn(AccessPoint.SECURITY_EAP);
+        mController = new TestWifiConfigController(mConfigUiBase, mView, mAccessPoint,
+                WifiConfigUiBase.MODE_CONNECT);
+        final Spinner eapMethodSpinner = mock(Spinner.class);
+        when(eapMethodSpinner.getSelectedItemPosition()).thenReturn(
+                WifiConfigController2.WIFI_EAP_METHOD_SIM);
+        mController.mEapMethodSpinner = eapMethodSpinner;
+
+        mController.loadSims();
+
+        final WifiConfiguration wifiConfiguration = mController.getConfig();
+        assertThat(wifiConfiguration.carrierId).isEqualTo(TelephonyManager.UNKNOWN_CARRIER_ID);
+    }
+
+    @Test
+    public void loadSims_oneSim_simSpinnerDefaultSubscription() {
+        when(mAccessPoint.getSecurity()).thenReturn(AccessPoint.SECURITY_EAP);
+        final SubscriptionInfo subscriptionInfo = mock(SubscriptionInfo.class);
+        final int carrierId = 6;
+        when(subscriptionInfo.getCarrierId()).thenReturn(carrierId);
+        when(subscriptionInfo.getCarrierName()).thenReturn("FAKE-CARRIER");
+        mShadowSubscriptionManager.setActiveSubscriptionInfoList(Arrays.asList(subscriptionInfo));
+        mController = new TestWifiConfigController(mConfigUiBase, mView, mAccessPoint,
+                WifiConfigUiBase.MODE_CONNECT);
+        final Spinner eapMethodSpinner = mock(Spinner.class);
+        when(eapMethodSpinner.getSelectedItemPosition()).thenReturn(
+                WifiConfigController2.WIFI_EAP_METHOD_SIM);
+        mController.mEapMethodSpinner = eapMethodSpinner;
+
+        mController.loadSims();
+
+        final WifiConfiguration wifiConfiguration = mController.getConfig();
+        assertThat(wifiConfiguration.carrierId).isEqualTo(carrierId);
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/wifi/WifiUtilsTest.java b/tests/robotests/src/com/android/settings/wifi/WifiUtilsTest.java
index 9de095d..dffd87d 100644
--- a/tests/robotests/src/com/android/settings/wifi/WifiUtilsTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/WifiUtilsTest.java
@@ -18,10 +18,6 @@
 
 import static com.google.common.truth.Truth.assertThat;
 
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.robolectric.RobolectricTestRunner;
-
 import static org.mockito.Mockito.spy;
 
 import android.content.Context;
@@ -30,6 +26,9 @@
 
 import com.android.settingslib.wifi.AccessPoint;
 
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.robolectric.RobolectricTestRunner;
 import org.robolectric.RuntimeEnvironment;
 
 @RunWith(RobolectricTestRunner.class)
@@ -48,11 +47,12 @@
     public void testPassword() {
         final String longPassword = "123456789012345678901234567890"
                 + "1234567890123456789012345678901234567890";
-        assertThat(WifiUtils.isHotspotPasswordValid("123")).isFalse();
-        assertThat(WifiUtils.isHotspotPasswordValid("12345678")).isTrue();
-        assertThat(WifiUtils.isHotspotPasswordValid("1234567890")).isTrue();
-        assertThat(WifiUtils.isHotspotPasswordValid(longPassword)).isFalse();
-        assertThat(WifiUtils.isHotspotPasswordValid("")).isFalse();
+        assertThat(WifiUtils.isHotspotWpa2PasswordValid("123")).isFalse();
+        assertThat(WifiUtils.isHotspotWpa2PasswordValid("12345678")).isTrue();
+        assertThat(WifiUtils.isHotspotWpa2PasswordValid("1234567890")).isTrue();
+        assertThat(WifiUtils.isHotspotWpa2PasswordValid(longPassword)).isFalse();
+        assertThat(WifiUtils.isHotspotWpa2PasswordValid("")).isFalse();
+        assertThat(WifiUtils.isHotspotWpa2PasswordValid("€¥£")).isFalse();
     }
 
     @Test
@@ -73,4 +73,4 @@
     public void getWifiConfigWithNullInput_ThrowIllegalArgumentException() {
         WifiConfiguration config = WifiUtils.getWifiConfig(null, null, null);
     }
-}
\ No newline at end of file
+}
diff --git a/tests/robotests/src/com/android/settings/wifi/details2/WifiDetailPreferenceController2Test.java b/tests/robotests/src/com/android/settings/wifi/details2/WifiDetailPreferenceController2Test.java
index 8d3405c..9aaaa43 100644
--- a/tests/robotests/src/com/android/settings/wifi/details2/WifiDetailPreferenceController2Test.java
+++ b/tests/robotests/src/com/android/settings/wifi/details2/WifiDetailPreferenceController2Test.java
@@ -53,10 +53,12 @@
 import android.net.RouteInfo;
 import android.net.Uri;
 import android.net.wifi.WifiConfiguration;
+import android.net.wifi.WifiEnterpriseConfig;
 import android.net.wifi.WifiInfo;
 import android.net.wifi.WifiManager;
 import android.os.Handler;
 import android.provider.Settings;
+import android.telephony.TelephonyManager;
 import android.view.View;
 import android.view.View.OnClickListener;
 import android.widget.ImageView;
@@ -175,6 +177,8 @@
     @Mock
     private Preference mMockSsidPref;
     @Mock
+    private Preference mMockEapSimSubscriptionPref;
+    @Mock
     private Preference mMockMacAddressPref;
     @Mock
     private Preference mMockIpAddressPref;
@@ -374,6 +378,8 @@
                 .thenReturn(mMockSecurityPref);
         when(mMockScreen.findPreference(WifiDetailPreferenceController2.KEY_SSID_PREF))
                 .thenReturn(mMockSsidPref);
+        when(mMockScreen.findPreference(WifiDetailPreferenceController2
+                .KEY_EAP_SIM_SUBSCRIPTION_PREF)).thenReturn(mMockEapSimSubscriptionPref);
         when(mMockScreen.findPreference(WifiDetailPreferenceController2.KEY_MAC_ADDRESS_PREF))
                 .thenReturn(mMockMacAddressPref);
         when(mMockScreen.findPreference(WifiDetailPreferenceController2.KEY_IP_ADDRESS_PREF))
@@ -1582,6 +1588,82 @@
         verify(mMockHeaderController).setSummary(expired);
     }
 
+    @Test
+    public void refreshEapSimSubscription_nonEapSecurity_invisibleEapSimSubscriptionPref() {
+        setUpForDisconnectedNetwork();
+        when(mMockWifiEntry.getSecurity()).thenReturn(WifiEntry.SECURITY_NONE);
+
+        displayAndResume();
+
+        verify(mMockEapSimSubscriptionPref, times(1)).setVisible(false);
+
+        when(mMockWifiEntry.getSecurity()).thenReturn(WifiEntry.SECURITY_OWE);
+
+        displayAndResume();
+
+        verify(mMockEapSimSubscriptionPref, times(2)).setVisible(false);
+
+        when(mMockWifiEntry.getSecurity()).thenReturn(WifiEntry.SECURITY_PSK);
+
+        displayAndResume();
+
+        verify(mMockEapSimSubscriptionPref, times(3)).setVisible(false);
+
+        when(mMockWifiEntry.getSecurity()).thenReturn(WifiEntry.SECURITY_SAE);
+
+        displayAndResume();
+
+        verify(mMockEapSimSubscriptionPref, times(4)).setVisible(false);
+        verify(mMockEapSimSubscriptionPref, never()).setVisible(true);
+    }
+
+    @Test
+    public void refreshEapSimSubscription_nonSimEapMethod_invisibleEapSimSubscriptionPref() {
+        setUpForDisconnectedNetwork();
+        when(mMockWifiEntry.getSecurity()).thenReturn(WifiEntry.SECURITY_EAP);
+        final WifiConfiguration mockWifiConfiguration = mock(WifiConfiguration.class);
+        final WifiEnterpriseConfig mockWifiEnterpriseConfig = mock(WifiEnterpriseConfig.class);
+        when(mockWifiEnterpriseConfig.isAuthenticationSimBased()).thenReturn(false);
+        mockWifiConfiguration.enterpriseConfig = mockWifiEnterpriseConfig;
+        when(mMockWifiEntry.getWifiConfiguration()).thenReturn(mockWifiConfiguration);
+
+        displayAndResume();
+
+        verify(mMockEapSimSubscriptionPref, times(1)).setVisible(false);
+    }
+
+    @Test
+    public void refreshEapSimSubscription_simEapMethod_visibleEapSimSubscriptionPref() {
+        setUpForDisconnectedNetwork();
+        when(mMockWifiEntry.getSecurity()).thenReturn(WifiEntry.SECURITY_EAP);
+        final WifiConfiguration mockWifiConfiguration = mock(WifiConfiguration.class);
+        final WifiEnterpriseConfig mockWifiEnterpriseConfig = mock(WifiEnterpriseConfig.class);
+        when(mockWifiEnterpriseConfig.isAuthenticationSimBased()).thenReturn(true);
+        mockWifiConfiguration.enterpriseConfig = mockWifiEnterpriseConfig;
+        when(mMockWifiEntry.getWifiConfiguration()).thenReturn(mockWifiConfiguration);
+
+        displayAndResume();
+
+        verify(mMockEapSimSubscriptionPref).setVisible(true);
+    }
+
+    @Test
+    public void refreshEapSimSubscription_unknownCarrierId_noSimEapSimSubscriptionPref() {
+        setUpForDisconnectedNetwork();
+        when(mMockWifiEntry.getSecurity()).thenReturn(WifiEntry.SECURITY_EAP);
+        final WifiConfiguration mockWifiConfiguration = mock(WifiConfiguration.class);
+        mockWifiConfiguration.carrierId = TelephonyManager.UNKNOWN_CARRIER_ID;
+        final WifiEnterpriseConfig mockWifiEnterpriseConfig = mock(WifiEnterpriseConfig.class);
+        when(mockWifiEnterpriseConfig.isAuthenticationSimBased()).thenReturn(true);
+        mockWifiConfiguration.enterpriseConfig = mockWifiEnterpriseConfig;
+        when(mMockWifiEntry.getWifiConfiguration()).thenReturn(mockWifiConfiguration);
+
+        displayAndResume();
+
+        verify(mMockEapSimSubscriptionPref).setVisible(true);
+        verify(mMockEapSimSubscriptionPref).setSummary(R.string.wifi_no_related_sim_card);
+    }
+
     private ActionButtonsPreference createMock() {
         final ActionButtonsPreference pref = mock(ActionButtonsPreference.class);
         when(pref.setButton1Text(anyInt())).thenReturn(pref);