[automerger skipped] Import translations. DO NOT MERGE am: e73e59c562 -s ours
am: ad2542c534 -s ours
am skip reason: subject contains skip directive

Change-Id: I5738457ce2d693b01b1368dc17987ee77de9a33d
diff --git a/color-check-baseline.xml b/color-check-baseline.xml
index 41cb12d..3cb964f 100644
--- a/color-check-baseline.xml
+++ b/color-check-baseline.xml
@@ -3037,4 +3037,36 @@
             column="5"/>
     </issue>
 
+    <issue
+        id="HardCodedColor"
+        severity="Error"
+        message="Avoid using hardcoded color"
+        category="Correctness"
+        priority="4"
+        summary="Using hardcoded color"
+        explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
+        errorLine1="    &lt;color name=&quot;face_intro_outline&quot;>#ffdadce0&lt;/color> &lt;/color>"
+        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+        <location
+            file="res/values/colors.xml"
+            line="150"
+            column="40"/>
+    </issue>
+
+    <issue
+        id="HardCodedColor"
+        severity="Error"
+        message="Avoid using hardcoded color"
+        category="Correctness"
+        priority="4"
+        summary="Using hardcoded color"
+        explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
+        errorLine1="                android:fillColor=&quot;@color/face_intro_outline&quot;"
+        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+        <location
+            file="res/drawable/face_enroll_introduction.xml"
+            line="25"
+            column="40"/>
+    </issue>
+
 </issues>
diff --git a/res/drawable/face_enroll_introduction.xml b/res/drawable/face_enroll_introduction.xml
index 6065f23..217b13c 100644
--- a/res/drawable/face_enroll_introduction.xml
+++ b/res/drawable/face_enroll_introduction.xml
@@ -16,13 +16,13 @@
   -->
 
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
-    android:width="240dp"
-    android:height="240dp"
+    android:width="300dp"
+    android:height="300dp"
     android:viewportWidth="300"
     android:viewportHeight="300">
 
     <path
-        android:fillColor="#DADCE0"
+        android:fillColor="@color/face_intro_outline"
         android:fillType="evenOdd"
         android:pathData="M150,0C67.16,0,0,67.16,0,150s67.16,150,150,150 s150-67.16,150-150S232.84,0,150,0 M150,4c39,0,75.66,15.19,103.24,42.76C280.81,74.34,296,111,296,150s-15.19,75.66-42.76,103.24 C225.66,280.81,189,296,150,296s-75.66-15.19-103.24-42.76C19.19,225.66,4,189,4,150S19.19,74.34,46.76,46.76 C74.34,19.19,111,4,150,4" />
     <path
diff --git a/res/drawable/ic_arrow_down_24dp.xml b/res/drawable/ic_arrow_down_24dp.xml
index 8503511..f2efb4c 100644
--- a/res/drawable/ic_arrow_down_24dp.xml
+++ b/res/drawable/ic_arrow_down_24dp.xml
@@ -16,9 +16,10 @@
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
         android:width="24dp"
         android:height="24dp"
+        android:tint="?android:attr/colorControlNormal"
         android:viewportWidth="24.0"
         android:viewportHeight="24.0">
     <path
-        android:fillColor="?android:attr/colorControlNormal"
+        android:fillColor="@android:color/white"
         android:pathData="M12,16.41l-6.71,-6.7l1.42,-1.42l5.29,5.3l5.29,-5.3l1.42,1.42z"/>
 </vector>
diff --git a/res/drawable/ic_content_copy_grey600_24dp.xml b/res/drawable/ic_content_copy_grey600_24dp.xml
index 827c66e..ba17ab6 100644
--- a/res/drawable/ic_content_copy_grey600_24dp.xml
+++ b/res/drawable/ic_content_copy_grey600_24dp.xml
@@ -1,9 +1,10 @@
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
     android:width="24dp"
     android:height="24dp"
+    android:tint="@*android:color/material_grey_600"
     android:viewportWidth="24"
     android:viewportHeight="24">
   <path
       android:pathData="M16,1L4,1c-1.1,0 -2,0.9 -2,2v14h2L4,3h12L16,1zM19,5L8,5c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h11c1.1,0 2,-0.9 2,-2L21,7c0,-1.1 -0.9,-2 -2,-2zM19,21L8,21L8,7h11v14z"
-      android:fillColor="#757575"/>
+      android:fillColor="@android:color/white"/>
 </vector>
diff --git a/res/drawable/ic_devices_other_opaque_black.xml b/res/drawable/ic_devices_other_opaque_black.xml
index 1b5af2d..40cf527 100644
--- a/res/drawable/ic_devices_other_opaque_black.xml
+++ b/res/drawable/ic_devices_other_opaque_black.xml
@@ -16,9 +16,10 @@
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
     android:width="24dp"
     android:height="24dp"
+    android:tint="@android:color/black"
     android:viewportWidth="24"
     android:viewportHeight="24">
   <path
-      android:fillColor="#FF000000"
+      android:fillColor="@android:color/white"
       android:pathData="M3,6h18L21,4L3,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h4v-2L3,18L3,6zM13,12L9,12v1.78c-0.61,0.55 -1,1.33 -1,2.22 0,0.89 0.39,1.67 1,2.22L9,20h4v-1.78c0.61,-0.55 1,-1.34 1,-2.22s-0.39,-1.67 -1,-2.22L13,12zM11,17.5c-0.83,0 -1.5,-0.67 -1.5,-1.5s0.67,-1.5 1.5,-1.5 1.5,0.67 1.5,1.5 -0.67,1.5 -1.5,1.5zM22,8h-6c-0.5,0 -1,0.5 -1,1v10c0,0.5 0.5,1 1,1h6c0.5,0 1,-0.5 1,-1L23,9c0,-0.5 -0.5,-1 -1,-1zM21,18h-4v-8h4v8z"/>
 </vector>
diff --git a/res/drawable/ic_face_24dp.xml b/res/drawable/ic_face_24dp.xml
new file mode 100644
index 0000000..7920c12
--- /dev/null
+++ b/res/drawable/ic_face_24dp.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2019 The Android Open Source Project
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License
+  -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="24dp"
+        android:height="24dp"
+        android:viewportWidth="24"
+        android:viewportHeight="24">
+
+    <path
+        android:fillColor="#000000"
+        android:pathData="M10.25,13c0,0.69-0.56,1.25-1.25,1.25S7.75,13.69,7.75,13S8.31,11.75,9,11.75S10.25,12.31,10.25,13z M15,11.75 c-0.69,0-1.25,0.56-1.25,1.25s0.56,1.25,1.25,1.25s1.25-0.56,1.25-1.25S15.69,11.75,15,11.75z M22,12c0,5.52-4.48,10-10,10 S2,17.52,2,12S6.48,2,12,2S22,6.48,22,12z M20,12c0-0.78-0.12-1.53-0.33-2.24C18.97,9.91,18.25,10,17.5,10 c-3.13,0-5.92-1.44-7.76-3.69c-1.05,2.56-3.14,4.57-5.74,5.55C4.01,11.9,4,11.95,4,12c0,4.41,3.59,8,8,8S20,16.41,20,12z" />
+    <path
+        android:pathData="M0,0h24v24H0V0z" />
+</vector>
\ No newline at end of file
diff --git a/res/drawable/ic_friction_lock_closed.xml b/res/drawable/ic_friction_lock_closed.xml
index 2f035e7..2c34060 100644
--- a/res/drawable/ic_friction_lock_closed.xml
+++ b/res/drawable/ic_friction_lock_closed.xml
@@ -17,9 +17,10 @@
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
         android:width="24dp"
         android:height="24dp"
+        android:tint="?android:attr/colorControlNormal"
         android:viewportWidth="24"
         android:viewportHeight="24">
     <path
-        android:fillColor="?android:attr/colorControlNormal"
+        android:fillColor="@android:color/white"
         android:pathData="M18,8h-1V6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2H6c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V10C20,8.9 19.1,8 18,8zM9,6c0,-1.66 1.34,-3 3,-3s3,1.34 3,3v2H9V6zM18,20H6V10h12V20zM12,17c1.1,0 2,-0.9 2,-2c0,-1.1 -0.9,-2 -2,-2c-1.1,0 -2,0.9 -2,2C10,16.1 10.9,17 12,17z"/>
 </vector>
diff --git a/res/drawable/ic_settings_adaptive_sleep.xml b/res/drawable/ic_settings_adaptive_sleep.xml
new file mode 100644
index 0000000..ac103dd
--- /dev/null
+++ b/res/drawable/ic_settings_adaptive_sleep.xml
@@ -0,0 +1,31 @@
+<!--
+  Copyright (C) 2019 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License
+  -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="24dp"
+        android:height="24dp"
+        android:viewportWidth="24.0"
+        android:viewportHeight="24.0">
+    <path
+        android:fillColor="#12B5CB"
+        android:pathData="M10.67,21H7v-1h3.13c-0.27-0.63-0.46-1.3-0.56-2H7V6h10v3.5c0.69,0,1.36,0.1,2,0.28V3 c0-1.1-0.9-1.99-2-1.99L7,1C5.9,1,5,1.9,5,3v18c0,1.1,0.9,2,2,2h5.52C11.79,22.45,11.16,21.77,10.67,21z M7,3h10v1H7V3z" />
+    <path
+        android:fillColor="#FA903E"
+        android:pathData="M17,12.5c2.48,0,4.5,2.02,4.5,4.5s-2.02,4.5-4.5,4.5s-4.5-2.02-4.5-4.5S14.52,12.5,17,12.5 M17,11 c-3.31,0-6,2.69-6,6s2.69,6,6,6c3.31,0,6-2.69,6-6S20.31,11,17,11L17,11z" />
+    <path
+        android:fillColor="#FA903E"
+        android:pathData="M17,14v3l-2.12,2.12C15.42,19.66,16.17,20,17,20c1.66,0,3-1.34,3-3S18.66,14,17,14z" />
+</vector>
\ No newline at end of file
diff --git a/res/drawable/ic_settings_disable.xml b/res/drawable/ic_settings_disable.xml
index d0edf4a..e7a8f41 100644
--- a/res/drawable/ic_settings_disable.xml
+++ b/res/drawable/ic_settings_disable.xml
@@ -18,8 +18,9 @@
     android:width="24dp"
     android:height="24dp"
     android:viewportWidth="24"
-    android:viewportHeight="24">
-  <path
-      android:fillColor="#FF000000"
-      android:pathData="M12,2c-1.78,0 -3.44,0.46 -4.89,1.28l1.48,1.48C9.63,4.28 10.78,4 12,4c4.41,0 8,3.59 8,8c0,1.22 -0.28,2.37 -0.76,3.41l1.48,1.48C21.54,15.44 22,13.78 22,12C22,6.48 17.52,2 12,2zM18.12,17.13L6.87,5.87L3.31,2.31L1.89,3.72l2.19,2.19C2.77,7.59 2,9.71 2,12c0,5.52 4.48,10 10,10c2.29,0 4.41,-0.77 6.09,-2.08l2.19,2.19l1.41,-1.41L18.12,17.13zM12,20c-4.41,0 -8,-3.59 -8,-8c0,-1.74 0.56,-3.35 1.51,-4.66l11.15,11.15C15.35,19.44 13.74,20 12,20zM8.59,4.76L7.11,3.28"/>
+    android:viewportHeight="24"
+    android:tint="?android:attr/colorControlNormal">
+    <path
+        android:fillColor="@android:color/white"
+        android:pathData="M12,2c-1.78,0 -3.44,0.46 -4.89,1.28l1.48,1.48C9.63,4.28 10.78,4 12,4c4.41,0 8,3.59 8,8c0,1.22 -0.28,2.37 -0.76,3.41l1.48,1.48C21.54,15.44 22,13.78 22,12C22,6.48 17.52,2 12,2zM18.12,17.13L6.87,5.87L3.31,2.31L1.89,3.72l2.19,2.19C2.77,7.59 2,9.71 2,12c0,5.52 4.48,10 10,10c2.29,0 4.41,-0.77 6.09,-2.08l2.19,2.19l1.41,-1.41L18.12,17.13zM12,20c-4.41,0 -8,-3.59 -8,-8c0,-1.74 0.56,-3.35 1.51,-4.66l11.15,11.15C15.35,19.44 13.74,20 12,20zM8.59,4.76L7.11,3.28"/>
 </vector>
diff --git a/res/drawable/ic_settings_enable.xml b/res/drawable/ic_settings_enable.xml
index 560daef..673471d 100644
--- a/res/drawable/ic_settings_enable.xml
+++ b/res/drawable/ic_settings_enable.xml
@@ -18,8 +18,9 @@
     android:width="24dp"
     android:height="24dp"
     android:viewportWidth="24"
-    android:viewportHeight="24">
+    android:viewportHeight="24"
+    android:tint="?android:attr/colorControlNormal">
   <path
-      android:fillColor="#FF000000"
+      android:fillColor="@android:color/white"
       android:pathData="M15.59,10.09L13,12.67V2h-2v10.67l-2.59,-2.58L7,11.5l5,5l5,-5L15.59,10.09zM15,2.46v2.13c2.93,1.19 5,4.06 5,7.41c0,4.41 -3.59,8 -8,8s-8,-3.59 -8,-8c0,-3.35 2.07,-6.22 5,-7.41V2.46C4.94,3.74 2,7.53 2,12c0,5.52 4.48,10 10,10s10,-4.48 10,-10C22,7.53 19.06,3.74 15,2.46z"/>
 </vector>
diff --git a/res/drawable/ic_settings_gestures.xml b/res/drawable/ic_settings_gestures.xml
index c75e7c3..f1c1625 100644
--- a/res/drawable/ic_settings_gestures.xml
+++ b/res/drawable/ic_settings_gestures.xml
@@ -16,10 +16,13 @@
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
         android:width="24dp"
         android:height="24dp"
-        android:viewportWidth="32.0"
-        android:viewportHeight="32.0"
+        android:viewportWidth="24.0"
+        android:viewportHeight="24.0"
         android:tint="?android:attr/colorControlNormal">
     <path
-        android:fillColor="@android:color/white"
-        android:pathData="M4.59 6.89c0.7-0.71 1.4-1.35 1.71-1.22 0.5 0.2 0 1.03-0.3 1.52-0.25 0.42 -2.86 3.89-2.86 6.31 0 1.28 0.48 2.34 1.34 2.98 0.75 0.56 1.74 0.73 2.64 0.46 1.07-0.31 1.95-1.4 3.06-2.77 1.21-1.49 2.83-3.44 4.08-3.44 1.63 0 1.65 1.01 1.76 1.79-3.78 0.64 -5.38 3.67-5.38 5.37 0 1.7 1.44 3.09 3.21 3.09 1.63 0 4.29-1.33 4.69-6.1H21v-2.5h-2.47c-0.15-1.65-1.09-4.2-4.03-4.2-2.25 0-4.18 1.91-4.94 2.84-0.58 0.73 -2.06 2.48-2.29 2.72-0.25 0.3 -0.68 0.84 -1.11 0.84 -0.45 0-0.72-0.83-0.36-1.92 0.35 -1.09 1.4-2.86 1.85-3.52 0.78 -1.14 1.3-1.92 1.3-3.28C8.95 3.69 7.31 3 6.44 3 5.12 3 3.97 4 3.72 4.25c-0.36 0.36 -0.66 0.66 -0.88 0.93 l1.75 1.71zm9.29 11.66c-0.31 0-0.74-0.26-0.74-0.72 0-0.6 0.73 -2.2 2.87-2.76-0.3 2.69-1.43 3.48-2.13 3.48z" />
+        android:pathData="M17,18L7,18L7,6L17,6L17,7L19,7L19,3C19,1.895 18.105,1 17,1L7,1C5.895,1 5,1.895 5,3L5,21C5,22.105 5.895,23 7,23L17,23C18.105,23 19,22.105 19,21L19,17L17,17L17,18ZM7,3L17,3L17,4L7,4L7,3ZM17,21L7,21L7,20L17,20L17,21ZM17.94,12.06L20,13L17.94,13.94L17,16L16.06,13.94L14,13L16.06,12.06L17,10L17.94,12.06ZM20.63,8.38L22,9L20.63,9.63L20,11L19.38,9.63L18,9L19.38,8.38L20,7L20.63,8.38Z"
+        android:strokeColor="#00000000"
+        android:fillType="nonZero"
+        android:fillColor="#000000"
+        android:strokeWidth="1"/>
 </vector>
\ No newline at end of file
diff --git a/res/drawable/ic_sync_problem_24dp.xml b/res/drawable/ic_sync_problem_24dp.xml
index 2139e98..200a1b0 100644
--- a/res/drawable/ic_sync_problem_24dp.xml
+++ b/res/drawable/ic_sync_problem_24dp.xml
@@ -21,6 +21,6 @@
         android:viewportHeight="24.0"
         android:tint="?android:attr/colorControlNormal">
     <path
-        android:fillColor="#FF000000"
-        android:pathData="M3,12c0,2.21 0.91,4.2 2.36,5.64L3,20h6v-6l-2.24,2.24C5.68,15.15 5,13.66 5,12c0,-2.61 1.67,-4.83 4,-5.65L9,4.26C5.55,5.15 3,8.27 3,12zM11,17h2v-2h-2v2zM21,4h-6v6l2.24,-2.24C18.32,8.85 19,10.34 19,12c0,2.61 -1.67,4.83 -4,5.65v2.09c3.45,-0.89 6,-4.01 6,-7.74 0,-2.21 -0.91,-4.2 -2.36,-5.64L21,4zM11,13h2L13,7h-2v6z"/>
+        android:fillColor="@android:color/white"
+        android:pathData="M11 4.07v2.02C8.17 6.57 6 9.03 6 12c0 2.22 1.21 4.15 3 5.19V14h2v6H5v-2h1.74C5.07 16.54 4 14.4 4 12c0-4.08 3.05-7.44 7-7.93zm8.51 10.67c0.3 0.52 0.49 1.11 0.49 1.76 0 1.93-1.57 3.5-3.5 3.5-0.65 0-1.25-0.19-1.77-0.49-0.65-0.38-1.17-0.96-1.46-1.67-0.17-0.41-0.27-0.87-0.27-1.34 0-1.93 1.57-3.5 3.5-3.5 0.48 0 0.93 0.1 1.35 0.27 0.09-0.41 0.15 -0.83 0.15 -1.27 0-2.22-1.21-4.15-3-5.19V10h-2V4h6v2h-1.74C18.93 7.46 20 9.6 20 12c0 0.96-0.18 1.89-0.49 2.74zM17 18h-1v1h1v-1zm0-4h-1v3h1v-3z" />
 </vector>
diff --git a/res/layout/contextual_slice_deferred_setup.xml b/res/layout/contextual_slice_deferred_setup.xml
index e695d1d..7d5b688 100644
--- a/res/layout/contextual_slice_deferred_setup.xml
+++ b/res/layout/contextual_slice_deferred_setup.xml
@@ -25,7 +25,7 @@
         android:id="@+id/content"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:gravity="left"
+        android:gravity="start"
         android:orientation="vertical"
         android:paddingEnd="@dimen/contextual_card_padding_end"
         android:paddingTop="@dimen/contextual_deferred_setup_card_padding_top"
diff --git a/res/layout/face_enroll_introduction.xml b/res/layout/face_enroll_introduction.xml
index 00ab443..f551e36 100644
--- a/res/layout/face_enroll_introduction.xml
+++ b/res/layout/face_enroll_introduction.xml
@@ -56,7 +56,7 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 style="@style/SudContentIllustration"
-                app:sudVideo="@raw/face_enroll_introduction_animation"/>
+                app:sudVideo="@raw/face_settings"/>
 
         </FrameLayout>
 
@@ -65,7 +65,8 @@
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:orientation="vertical"
-            android:layout_gravity="center_horizontal|bottom">
+            android:layout_gravity="center_horizontal|bottom"
+            android:paddingTop="12dp">
 
             <LinearLayout
                 android:layout_width="match_parent"
@@ -75,6 +76,27 @@
                 <ImageView
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
+                    android:background="@drawable/ic_info_outline_24dp">
+                </ImageView>
+                <Space
+                    android:layout_width="24dp"
+                    android:layout_height="wrap_content"/>
+                <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:text="@string/security_settings_face_enroll_introduction_footer_part_0"/>
+
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal"
+                android:paddingTop="24dp">
+
+                <ImageView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
                     android:background="@drawable/ic_face_enroll_introduction_shield">
                 </ImageView>
                 <Space
diff --git a/res/values-night/colors.xml b/res/values-night/colors.xml
index f761217..b1f9dfb 100644
--- a/res/values-night/colors.xml
+++ b/res/values-night/colors.xml
@@ -27,5 +27,6 @@
     <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="face_intro_outline">?android:attr/colorAccent</color>
 </resources>
 
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 4a4c896..7114bb1 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -147,4 +147,5 @@
     <!-- Dialog background color -->
     <color name="dialog_background">@*android:color/background_device_default_light</color>
 
+    <color name="face_intro_outline">#ffdadce0</color>
 </resources>
\ No newline at end of file
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 6c9846d..047cebe 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -790,13 +790,13 @@
     <!-- Security Settings --><skip />
 
     <!-- Security settings screen, setting option name to change screen timeout -->
-    <string name="lock_after_timeout">Automatically lock</string>
+    <string name="lock_after_timeout">Lock after screen timeout</string>
     <!-- Security settings screen, setting option summary to change screen timeout -->
-    <string name="lock_after_timeout_summary"><xliff:g id="timeout_string">%1$s</xliff:g> after sleep</string>
+    <string name="lock_after_timeout_summary"><xliff:g id="timeout_string">%1$s</xliff:g> after timeout</string>
     <!-- Security settings screen, setting option summary to change screen timeout, with additional explanation-->
-    <string name="lock_immediately_summary_with_exception">Immediately after sleep, except when kept unlocked by <xliff:g id="trust_agent_name">%1$s</xliff:g></string>
+    <string name="lock_immediately_summary_with_exception">Immediately after timeout, except when kept unlocked by <xliff:g id="trust_agent_name">%1$s</xliff:g></string>
     <!-- Security settings screen, setting option summary to change screen timeout, with additional explanation-->
-    <string name="lock_after_timeout_summary_with_exception"><xliff:g id="timeout_string">%1$s</xliff:g> after sleep, except when kept unlocked by <xliff:g id="trust_agent_name">%2$s</xliff:g></string>
+    <string name="lock_after_timeout_summary_with_exception"><xliff:g id="timeout_string">%1$s</xliff:g> after timeout, except when kept unlocked by <xliff:g id="trust_agent_name">%2$s</xliff:g></string>
     <!-- Text shown next to checkbox for showing owner info on LockScreen [CHAR LIMIT=50]-->
     <string name="show_owner_info_on_lockscreen_label">Show owner info on lock screen</string>
     <!-- Text shown for title of owner info setting [CHAR LIMIT=20]-->
@@ -808,7 +808,7 @@
     <!-- Text shown for the title of the lockdown option -->
     <string name="lockdown_settings_title">Show lockdown option</string>
     <!-- Text shown for the description of the lockdown option -->
-    <string name="lockdown_settings_summary">Display power button option that turns off Smart Lock, fingerprint unlocking, and notifications on the lock screen</string>
+    <string name="lockdown_settings_summary">Display power button option that turns off Smart Lock, biometric unlocking, and notifications on the lock screen</string>
 
     <!-- Text shown for the title of the extend unlock mode option for trust agents [CHAR LIMIT=40] -->
     <string name="trust_agents_extend_unlock_title">Trust agents only extend unlock</string>
@@ -882,17 +882,19 @@
     <string name="security_dashboard_summary_no_fingerprint">Screen lock</string>
 
     <!-- Face enrollment and settings --><skip />
-    <!-- Message shown in summary field when face authentication is set up. [CHAR LIMIT=40] -->
+    <!-- Message shown in summary field when face unlock is set up. [CHAR LIMIT=40] -->
     <string name="security_settings_face_preference_summary">Face added</string>
-    <!-- Message shown in summary field when face authentication is not set up. [CHAR LIMIT=54] -->
-    <string name="security_settings_face_preference_summary_none">Tap to set up face authentication</string>
+    <!-- Message shown in summary field when face unlock is not set up. [CHAR LIMIT=54] -->
+    <string name="security_settings_face_preference_summary_none">Set up face unlock</string>
     <!-- Title shown for menu item that launches face settings or enrollment. [CHAR LIMIT=32] -->
-    <string name="security_settings_face_preference_title">Face authentication</string>
+    <string name="security_settings_face_preference_title">Face unlock</string>
+    <!-- Title shown for menu item that launches face settings or enrollment, for work profile [CHAR LIMIT=50] -->
+    <string name="security_settings_face_profile_preference_title">Face unlock for work</string>
     <!-- Introduction title shown in face enrollment education screen [CHAR LIMIT=40] -->
-    <string name="security_settings_face_enroll_education_title">How to set up Face unlock</string>
+    <string name="security_settings_face_enroll_education_title">How to set up face unlock</string>
     <!-- Introduction title shown in face enrollment education screen for accessibility [CHAR LIMI=40]-->
-    <string name="security_settings_face_enroll_education_title_accessibility">Set up Face unlock</string>
-    <!-- Introduction title shown in face enrollment education screen to show the face authentication feature, when face unlock is disabled by device admin [CHAR LIMIT=60] -->
+    <string name="security_settings_face_enroll_education_title_accessibility">Set up face unlock</string>
+    <!-- Introduction title shown in face enrollment education screen to show the face unlock feature, when face unlock is disabled by device admin [CHAR LIMIT=60] -->
     <string name="security_settings_face_enroll_education_title_unlock_disabled">Use your face to authenticate</string>
     <!-- Introduction detail message shown in face education [CHAR LIMIT=NONE] -->
     <string name="security_settings_face_enroll_education_message"></string>
@@ -910,7 +912,7 @@
     <string name="security_settings_face_enroll_introduction_cancel">Cancel</string>
     <!-- Introduction title shown in face enrollment to introduce the face unlock feature [CHAR LIMIT=40] -->
     <string name="security_settings_face_enroll_introduction_title">Unlock with your face</string>
-    <!-- Introduction title shown in face enrollment to introduce the face authentication feature, when face unlock is disabled by device admin [CHAR LIMIT=60] -->
+    <!-- Introduction title shown in face enrollment to introduce the face unlock feature, when face unlock is disabled by device admin [CHAR LIMIT=60] -->
     <string name="security_settings_face_enroll_introduction_title_unlock_disabled">Use your face to authenticate</string>
     <!-- Introduction detail message shown in face enrollment dialog [CHAR LIMIT=NONE]-->
     <string name="security_settings_face_enroll_introduction_message">Use your face to unlock your phone, authorize purchases, or sign in to apps.</string>
@@ -919,6 +921,8 @@
     <!-- Introduction detail message shown in face enrollment screen in setup wizard. [CHAR LIMIT=NONE] -->
     <string name="security_settings_face_enroll_introduction_message_setup">Use your face to unlock your phone, authorize purchases, or sign in to apps</string>
     <!-- Introduction message shown in face enrollment that provides extra detail. [CHAR LIMIT=NONE] -->
+    <string name="security_settings_face_enroll_introduction_footer_part_0"></string>
+    <!-- Introduction message shown in face enrollment that provides extra detail. [CHAR LIMIT=NONE] -->
     <string name="security_settings_face_enroll_introduction_footer_part_1"></string>
     <!-- Introduction message shown in face enrollment that provides extra detail. [CHAR LIMIT=NONE] -->
     <string name="security_settings_face_enroll_introduction_footer_part_2"></string>
@@ -950,29 +954,30 @@
     <string name="security_settings_face_settings_use_face_category">Use face unlock for</string>
     <!-- Text shown on a toggle which allows or disallows the device to use face for unlocking the device. [CHAR LIMIT=20] -->
     <string name="security_settings_face_settings_use_face_unlock_phone">Unlocking your phone</string>
-    <!-- Text shown on a toggle which allows or disallows the device to use face authentication for apps. This will be presented to the user together with the context of security_settings_face_settings_use_face_category. [CHAR LIMIT=30] -->
+    <!-- Text shown on a toggle which allows or disallows the device to use face unlock for apps. This will be presented to the user together with the context of security_settings_face_settings_use_face_category. [CHAR LIMIT=30] -->
     <string name="security_settings_face_settings_use_face_for_apps">App sign-in \u0026 payments</string>
     <!-- Title for a category shown for the face settings page, followed by items that the user can toggle on/off to require/disable. -->
-    <string name="security_settings_face_settings_require_category">Require for face unlock</string>
-    <!-- Text shown on a toggle which disables/enables face authentication, depending if the user's eyes are open. [CHAR LIMIT=30] -->
-    <string name="security_settings_face_settings_require_attention">Open eyes looking at screen</string>
-    <!-- Text shown on the details of a toggle which disables/enables face authentication, depending if the user's eyes are open. [CHAR LIMIT=70] -->
-    <string name="security_settings_face_settings_require_attention_details">To unlock the phone, always require looking at the screen with your eyes open</string>
+    <string name="security_settings_face_settings_require_category">Requirements for face unlock</string>
+    <!-- Text shown on a toggle which disables/enables face unlock, depending if the user's eyes are open. [CHAR LIMIT=30] -->
+    <string name="security_settings_face_settings_require_attention">Require eyes to be open</string>
+    <!-- Text shown on the details of a toggle which disables/enables face unlock, depending if the user's eyes are open. [CHAR LIMIT=70] -->
+    <string name="security_settings_face_settings_require_attention_details">To unlock the phone, your eyes must be open</string>
     <!-- When authenticating in apps, always require confirmation (e.g. confirm button) after a face is authenticated. [CHAR LIMIT=50] -->
-    <string name="security_settings_face_settings_require_confirmation">Confirm button</string>
+    <string name="security_settings_face_settings_require_confirmation">Always require confirmation</string>
     <!-- When authenticating in apps, always require confirmation (e.g. confirm button) after a face is authenticated. [CHAR LIMIT=70] -->
-    <string name="security_settings_face_settings_require_confirmation_details">When authenticating for apps, always require confirmation</string>
+    <string name="security_settings_face_settings_require_confirmation_details">When using face unlock in apps, always require confirmation step</string>
     <!-- Button text in face settings which removes the user's faces from the device [CHAR LIMIT=20] -->
     <string name="security_settings_face_settings_remove_face_data">Delete face data</string>
     <!-- Button text in face settings which lets the user enroll their face [CHAR LIMIT=40] -->
-    <string name="security_settings_face_settings_enroll">Set up new face unlock</string>
+    <string name="security_settings_face_settings_enroll">Set up face unlock</string>
     <!-- Text shown in face settings explaining what your face can be used for. [CHAR LIMIT=NONE] -->
-    <string name="security_settings_face_settings_footer">Use Face unlock to unlock your device, sign in to apps, and confirm payments.\n\nKeep in mind:\nLooking at the phone can unlock it when you don\u2019t intend to.\n\nYour phone can be unlocked by someone else if it\u2019s held up to your face while your eyes are open.\n\nYour phone can be unlocked by someone who looks a lot like you, say, your child or an identical sibling.</string>
+    <string name="security_settings_face_settings_footer">Use face unlock to unlock your device, sign in to apps, and confirm payments.\n\nKeep in mind:\nLooking at the phone can unlock it when you don\u2019t intend to.\n\nYour phone can be unlocked by someone else if it\u2019s held up to your face while your eyes are open.\n\nYour phone can be unlocked by someone who looks a lot like you, say, an identical sibling.</string>
     <!-- Dialog title shown when the user removes an enrollment [CHAR LIMIT=35] -->
     <string name="security_settings_face_settings_remove_dialog_title">Delete face data?</string>
     <!-- Dialog contents shown when the user removes an enrollment [CHAR LIMIT=NONE] -->
-    <string name="security_settings_face_settings_remove_dialog_details">Data recorded by face unlock will be permanently and securely deleted. After removal, you will need your PIN, pattern, or password to unlock your phone, sign in to apps, and confirm payments.</string>
-
+    <string name="security_settings_face_settings_remove_dialog_details">The images and biometric data used by face unlock will be permanently and securely deleted. After removal, you will need your PIN, pattern, or password to unlock your phone, sign in to apps, and confirm payments.</string>
+    <!-- Subtitle shown for contextual setting face enrollment [CHAR LIMIT=NONE] -->
+    <string name="security_settings_face_settings_context_subtitle">Use face unlock to unlock your phone</string>
 
     <!-- Fingerprint enrollment and settings --><skip />
     <!-- Title shown for menu item that launches fingerprint settings or enrollment [CHAR LIMIT=22] -->
@@ -1072,12 +1077,12 @@
     <string name="fingerprint_lock_screen_setup_skip_dialog_text" product="device">Protect your device with a screen lock option so no one will be able to use it if it is lost or stolen. You also need a screen lock option to set up fingerprint. Tap Cancel, then set a PIN, pattern, or password.</string>
     <!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set fingerprint. (default) [CHAR LIMIT=NONE] -->
     <string name="fingerprint_lock_screen_setup_skip_dialog_text" product="default">Protect your phone with a screen lock option so no one will be able to use it if it is lost or stolen. You also need a screen lock option to set up fingerprint. Tap Cancel, then set a PIN, pattern, or password.</string>
-    <!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set face authentication. (tablet) [CHAR LIMIT=NONE] -->
-    <string name="face_lock_screen_setup_skip_dialog_text" product="tablet">Protect your tablet with a screen lock option so no one will be able to use it if it is lost or stolen. You also need a screen lock option to set up face authentication. Tap Cancel, then set a PIN, pattern, or password.</string>
-    <!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set face authentication. (device) [CHAR LIMIT=NONE] -->
-    <string name="face_lock_screen_setup_skip_dialog_text" product="device">Protect your device with a screen lock option so no one will be able to use it if it is lost or stolen. You also need a screen lock option to set up face authentication. Tap Cancel, then set a PIN, pattern, or password.</string>
-    <!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set face authentication. (default) [CHAR LIMIT=NONE] -->
-    <string name="face_lock_screen_setup_skip_dialog_text" product="default">Protect your phone with a screen lock option so no one will be able to use it if it is lost or stolen. You also need a screen lock option to set up face authentication. Tap Cancel, then set a PIN, pattern, or password.</string>
+    <!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set face unlock. (tablet) [CHAR LIMIT=NONE] -->
+    <string name="face_lock_screen_setup_skip_dialog_text" product="tablet">By protecting your tablet with a screen lock option, no one will be able to use it if it is lost or stolen. You also need a screen lock option to set up face unlock. To go back, tap Cancel. </string>
+    <!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set face unlock. (device) [CHAR LIMIT=NONE] -->
+    <string name="face_lock_screen_setup_skip_dialog_text" product="device">By protecting your device with a screen lock option, no one will be able to use it if it is lost or stolen. You also need a screen lock option to set up face unlock. To go back, tap Cancel. </string>
+    <!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set face unlock. (default) [CHAR LIMIT=NONE] -->
+    <string name="face_lock_screen_setup_skip_dialog_text" product="default">By protecting your phone with a screen lock option, no one will be able to use it if it is lost or stolen. You also need a screen lock option to set up face unlock. To go back, tap Cancel.</string>
     <!-- Title of dialog shown when the user tries to skip setting up a PIN, warning them of potential consequences of not doing so [CHAR LIMIT=48]-->
     <string name="lock_screen_pin_skip_title">Skip PIN setup?</string>
     <!-- Title of dialog shown when the user tries to skip setting up a password, warning them of potential consequences of not doing so [CHAR LIMIT=48]-->
@@ -1321,7 +1326,7 @@
     <!-- Message shown in screen lock picker while setting up the backup/fallback screen lock method for fingerprint. Users can choose to use this method to unlock the screen instead of fingerprint, or when fingerprint is not accepted. [CHAR LIMIT=80] [BACKUP_MESSAGE_ID=2799884038398627882] -->
     <string name="lock_settings_picker_fingerprint_message">Choose your backup screen lock method</string>
 
-    <!-- Message shown in screen lock picker while setting up the backup/fallbakc screen lock method for face authentication. Users can choose to use this method to unlock the screen instead of face authentication, or when face authentication is not accepted. [CHAR LIMIT=80] -->
+    <!-- Message shown in screen lock picker while setting up the backup/fallback screen lock method for face unlock. Users can choose to use this method to unlock the screen instead of face unlock, or when face unlock is not accepted. [CHAR LIMIT=80] -->
     <string name="lock_settings_picker_face_message">Choose your backup screen lock method</string>
 
     <!-- Label for button in screen lock settings, allowing users to choose other types of screen locks. [CHAR LIMIT=40] -->
@@ -1399,19 +1404,19 @@
     <!-- Message shown in screen lock picker while setting up the new screen lock with fingerprint option. [CHAR LIMIT=NONE]-->
     <string name="fingerprint_unlock_title">You can unlock your phone using your fingerprint. For security, this option requires a backup screen lock.</string>
 
-    <!-- Title for preference that guides the user through creating a backup unlock pattern for face authentication [CHAR LIMIT=45]-->
-    <string name="face_unlock_set_unlock_pattern">Face authentication + Pattern</string>
+    <!-- Title for preference that guides the user through creating a backup unlock pattern for face unlock [CHAR LIMIT=45]-->
+    <string name="face_unlock_set_unlock_pattern">Face unlock + Pattern</string>
 
-    <!-- Title for preference that guides the user through creating a backup unlock PIN for face authentication [CHAR LIMIT=45]-->
-    <string name="face_unlock_set_unlock_pin">Face authentication + PIN</string>
+    <!-- Title for preference that guides the user through creating a backup unlock PIN for face unlock [CHAR LIMIT=45]-->
+    <string name="face_unlock_set_unlock_pin">Face unlock + PIN</string>
 
-    <!-- Title for preference that guides the user through creating a backup unlock password for face authentication [CHAR LIMIT=45]-->
-    <string name="face_unlock_set_unlock_password">Face authentication + Password</string>
+    <!-- Title for preference that guides the user through creating a backup unlock password for face unlock [CHAR LIMIT=45]-->
+    <string name="face_unlock_set_unlock_password">Face unlock + Password</string>
 
-    <!-- Title for preference that guides the user to skip face authentication setup [CHAR LIMIT=60]-->
-    <string name="face_unlock_skip_face">Continue without face authentication</string>
+    <!-- Title for preference that guides the user to skip face unlock setup [CHAR LIMIT=60]-->
+    <string name="face_unlock_skip_face">Continue without face unlock</string>
 
-    <!-- Message shown in screen lock picker while setting up the new screen lock with face authentication option. [CHAR LIMIT=NONE] -->
+    <!-- Message shown in screen lock picker while setting up the new screen lock with face unlock option. [CHAR LIMIT=NONE] -->
     <string name="face_unlock_title">You can unlock your phone using your face. For security, this option requires a backup screen lock.</string>
 
     <!-- Summary for preference that has been disabled by because of the DevicePolicyAdmin, or because device encryption is enabled, or because there are credentials in the credential storage [CHAR LIMIT=50] -->
@@ -2824,17 +2829,24 @@
 
     <!-- Display settings screen, display white balance settings title [CHAR LIMIT=30] -->
     <string name="display_white_balance_title">Display white balance</string>
+    <!-- Display settings screen, display white balance settings summary [CHAR LIMIT=NONE] -->
+    <string name="display_white_balance_summary"></string>
     <!-- Display settings screen, setting option name to enable adaptive sleep [CHAR LIMIT=30] -->
     <string name="adaptive_sleep_title">Screen attention</string>
     <!-- Setting option summary when adaptive sleep is on [CHAR LIMIT=NONE] -->
-    <string name="adaptive_sleep_summary_on">On / Screen won’t turn off if you’re looking at it</string>
+    <string name="adaptive_sleep_summary_on">On / Screen won\u2019t turn off if you\u2019re looking at it</string>
     <!-- Setting option summary when adaptive sleep is off [CHAR LIMIT=NONE] -->
     <string name="adaptive_sleep_summary_off">Off</string>
+    <!-- adaptive_sleep settings screen, title about the required permission is missing [CHAR LIMIT=NONE]-->
+    <string name="adaptive_sleep_title_no_permission">Camera access needed</string>
+    <!-- adaptive_sleep settings screen, subtitle when permission is missing [CHAR LIMIT=NONE]-->
+    <string name="adaptive_sleep_summary_no_permission">Tap to manage permissions for Device Personalization Services</string>
     <!-- Description about the feature adaptive sleep [CHAR LIMIT=NONE]-->
-    <string name="adaptive_sleep_description">Prevents your screen from turning off if you’re looking at it.</string>
+    <string name="adaptive_sleep_description">Prevents your screen from turning off if you\u2019re looking at it</string>
     <!-- Description feature's privacy sensitive details to make sure users understand what feature users, what it saves/sends etc [CHAR LIMIT=NONE]-->
     <string name="adaptive_sleep_privacy">Screen attention uses the front camera to see if someone is looking at the screen. It works on device, and images are never stored or sent to Google.</string>
-
+    <!-- Description about the contextual adaptive sleep card [CHAR LIMIT=NONE]-->
+    <string name="adaptive_sleep_contextual_slice_summary">Keep screen on when viewing it</string>
 
     <!-- Night display screen, setting option name to enable night display (renamed "Night Light" with title caps). [CHAR LIMIT=30] -->
     <string name="night_display_title">Night Light</string>
@@ -2910,7 +2922,7 @@
     <!-- Styles and Wallpaper settings title [CHAR_LIMIT=46] -->
     <string name="style_suggestion_title">Customize your Pixel</string>
     <!-- Styles and Wallpapers summary [CHAR_LIMIT=70] -->
-    <string name="style_suggestion_summary">Try different styles, wallpapers, clocks, and more</string>
+    <string name="style_suggestion_summary">Try different styles, wallpapers, and more</string>
     <!-- Display settings screen, trigger for screen saver options -->
     <string name="screensaver_settings_title">Screen saver</string>
     <!-- Display settings screen, summary fragment for screen saver options, activated when docked or asleep and charging -->
@@ -4050,12 +4062,12 @@
     <string name="lockpassword_pin_set_toast">PIN has been set</string>
     <!-- Toast shown if setting pattern was successful -->
     <string name="lockpassword_pattern_set_toast">Pattern has been set</string>
-    <!-- Header on first screen of choose password/PIN as backup for face authentication flow. If this string cannot be translated in under 40 characters, please translate "Set face authentication backup" [CHAR LIMIT=40] -->
-    <string name="lockpassword_choose_your_password_header_for_face">To use face authentication, set password</string>
-    <!-- Header on first screen of choose pattern as backup for face authentication flow. If this string cannot be translated in under 40 characters, please translate "Set face authentication backup" [CHAR LIMIT=40] -->
-    <string name="lockpassword_choose_your_pattern_header_for_face">To use face authentication, set pattern</string>
-    <!-- Header on first screen of choose password/PIN as backup for face authentication flow. If this string cannot be translated in under 40 characters, please translate "Set face authentication backup" [CHAR LIMIT=40] -->
-    <string name="lockpassword_choose_your_pin_header_for_face">To use face authentication, set PIN</string>
+    <!-- Header on first screen of choose password/PIN as backup for face unlock flow. If this string cannot be translated in under 40 characters, please translate "Set face unlock backup" [CHAR LIMIT=40] -->
+    <string name="lockpassword_choose_your_password_header_for_face">To use face unlock, set password</string>
+    <!-- Header on first screen of choose pattern as backup for face unlock flow. If this string cannot be translated in under 40 characters, please translate "Set face unlock backup" [CHAR LIMIT=40] -->
+    <string name="lockpassword_choose_your_pattern_header_for_face">To use face unlock, set pattern</string>
+    <!-- Header on first screen of choose password/PIN as backup for face unlock flow. If this string cannot be translated in under 40 characters, please translate "Set face unlock backup" [CHAR LIMIT=40] -->
+    <string name="lockpassword_choose_your_pin_header_for_face">To use face unlock, set PIN</string>
 
     <!-- Message to be used to explain the user that he needs to enter his pattern to continue a
          particular operation. [CHAR LIMIT=70]-->
@@ -4871,6 +4883,8 @@
     <string name="accessibility_tutorial_dialog_button">Got it</string>
     <!-- Summary text appearing on the accessibility preference screen to enable screen magnification from the nav bar when the feature is enabled, but the accessibility button is not configured correctly for the feature to be used [CHAR LIMIT=none] -->
     <string name="accessibility_screen_magnification_navbar_configuration_warning">The Accessibility button is set to <xliff:g id="service" example="Select to Speak">%1$s</xliff:g>. To use magnification, touch &amp; hold the Accessibility button, then select magnification.</string>
+    <!-- Summary text appearing on the accessibility preference screen to enable screen magnification from the nav bar when the feature is enabled, but the accessibility button is not configured correctly for the feature to be used [CHAR LIMIT=none] -->
+    <string name="accessibility_screen_magnification_gesture_navigation_warning">The accessibility gesture is set to the <xliff:g id="service" example="Select to Speak">%1$s</xliff:g>. To use magnification, swipe up with two fingers from the bottom of the screen and hold. Then select magnification.</string>
     <!-- Title for the preference to configure the accessibility shortcut, which uses the volume keys. [CHAR LIMIT=35] -->
     <string name="accessibility_global_gesture_preference_title">Volume key shortcut</string>
     <!-- Title for the preference to choose the service that is turned on and off by the accessibility shortcut. [CHAR LIMIT=35] -->
@@ -4947,6 +4961,8 @@
     <string name="accessibility_daltonizer_master_switch_title">Use color correction</string>
     <!-- Used in the Captions settings screen to control turning on/off the feature entirely -->
     <string name="accessibility_caption_master_switch_title">Use captions</string>
+    <!-- Used in the Captions preference to tell users that the setting doesn't support all apps. [CHAR LIMIT=NONE] -->
+    <string name="accessibility_caption_preference_summary">Not all apps support this setting.</string>
 
     <!-- Button text for the accessibility dialog continue to the next screen for hearing aid. [CHAR LIMIT=32] -->
     <string name="accessibility_hearingaid_instruction_continue_button">Continue</string>
@@ -7991,6 +8007,15 @@
     <!-- Configure Notifications: Title for the option controlling notifications on the lockscreen. [CHAR LIMIT=30] -->
     <string name="lock_screen_notifications_title">Lock screen</string>
 
+    <!-- Configure lock screen: Title for the option of unlocking directly to home. [CHAR LIMIT=30] -->
+    <string name="lockscreen_bypass_title">Skip lock screen</string>
+
+    <!-- Configure lock screen: Summary for the option of unlocking directly to home. [CHAR LIMIT=100] -->
+    <string name="lockscreen_bypass_summary">After face unlock, go directly to last used screen</string>
+
+    <!-- Configure lock screen: Search keywords for the option of unlocking directly to home. [CHAR LIMIT=100] -->
+    <string name="keywords_lockscreen_bypass">Lock screen, Lockscreen, Skip, Bypass</string>
+
     <!-- Configure Notifications: Title for the option controlling notifications for work profile. [CHAR LIMIT=30] -->
     <string name="locked_work_profile_notification_title">When work profile is locked</string>
 
@@ -9998,12 +10023,6 @@
 
     <!-- [CHAR_LIMIT=NONE] Developer Settings: Title of the settings category for theme overlays. -->
     <string name="theme_customization_category">Theming</string>
-    <!-- [CHAR_LIMIT=NONE] Developer Settings: Title of the setting which enables overlays to customize accent color. -->
-    <string name="theme_customization_accent_color_title">Accent color</string>
-    <!-- [CHAR_LIMIT=NONE] Developer Settings: Title of the setting which enables overlays to customize headline and body fonts. -->
-    <string name="theme_customization_font_title">Headline / Body font</string>
-    <!-- [CHAR_LIMIT=NONE] Developer Settings: Title of the setting which enables overlays to customize the adaptive icon shape (e.g. launcher and quick settings icons). -->
-    <string name="theme_customization_icon_shape_title">Icon shape</string>
     <!-- [CHAR_LIMIT=NONE] Developer Settings: Label for the option that turns off customizations for a given category.-->
     <string name="theme_customization_device_default">Device default</string>
 
diff --git a/res/xml/adaptive_sleep_detail.xml b/res/xml/adaptive_sleep_detail.xml
index 606bb55..568e694 100644
--- a/res/xml/adaptive_sleep_detail.xml
+++ b/res/xml/adaptive_sleep_detail.xml
@@ -28,6 +28,14 @@
         settings:preview="@drawable/adaptive_sleep"
         settings:controller="com.android.settings.widget.VideoPreferenceController"/>
 
+    <Preference
+        android:key="adaptive_sleep_permission"
+        android:title="@string/adaptive_sleep_title_no_permission"
+        android:summary="@string/adaptive_sleep_summary_no_permission"
+        android:icon="@drawable/ic_info_outline_24"
+        settings:controller="com.android.settings.display.AdaptiveSleepPermissionPreferenceController"
+    />
+
     <com.android.settingslib.RestrictedSwitchPreference
         android:key="adaptive_sleep"
         android:title="@string/adaptive_sleep_title"
diff --git a/res/xml/captioning_settings.xml b/res/xml/captioning_settings.xml
index 56e0e2d..d8dabdc 100644
--- a/res/xml/captioning_settings.xml
+++ b/res/xml/captioning_settings.xml
@@ -30,10 +30,9 @@
     <PreferenceCategory
         android:key="standard"
         android:title="@string/captioning_standard_options_title" >
-        <com.android.settings.accessibility.LocalePreference
-            android:key="captioning_locale"
-            android:summary="%s"
-            android:title="@string/captioning_locale" />
+        <SwitchPreference
+            android:key="captioning_preference_switch"
+            android:title="@string/accessibility_caption_master_switch_title" />
 
         <ListPreference
             android:entries="@array/captioning_font_size_selector_titles"
@@ -45,6 +44,11 @@
         <com.android.settings.accessibility.PresetPreference
             android:key="captioning_preset"
             android:title="@string/captioning_preset" />
+
+        <com.android.settings.accessibility.LocalePreference
+            android:key="captioning_locale"
+            android:summary="%s"
+            android:title="@string/captioning_locale" />
     </PreferenceCategory>
     <PreferenceCategory
         android:key="custom"
@@ -88,4 +92,8 @@
             android:title="@string/captioning_window_opacity" />
     </PreferenceCategory>
 
+    <com.android.settingslib.widget.FooterPreference
+        android:title="@string/accessibility_caption_preference_summary"
+        android:selectable="false" />
+
 </PreferenceScreen>
diff --git a/res/xml/development_settings.xml b/res/xml/development_settings.xml
index d1eff34..7cf52fa 100644
--- a/res/xml/development_settings.xml
+++ b/res/xml/development_settings.xml
@@ -571,7 +571,7 @@
     <com.android.settings.development.autofill.AutofillPreferenceCategory
         android:key="debug_autofill_category"
         android:title="@string/debug_autofill_category"
-        android:order="1100">
+        android:order="1100"> <!-- Incremented by 100 from last order (i.e. 1000) -->
 
         <ListPreference
             android:key="autofill_logging_level"
@@ -592,20 +592,4 @@
             android:title="@string/autofill_reset_developer_options" />
 
     </com.android.settings.development.autofill.AutofillPreferenceCategory>
-
-    <PreferenceCategory
-        android:key="theme_customization_category"
-        android:title="@string/theme_customization_category"
-        android:order="1200"> <!-- Incremented by 100 from last order (i.e. 1100) -->
-
-        <ListPreference
-            android:key="android.theme.customization.accent_color"
-            android:title="@string/theme_customization_accent_color_title"/>
-        <ListPreference
-            android:key="android.theme.customization.font"
-            android:title="@string/theme_customization_font_title"/>
-        <ListPreference
-            android:key="android.theme.customization.adaptive_icon_shape"
-            android:title="@string/theme_customization_icon_shape_title"/>
-    </PreferenceCategory>
 </PreferenceScreen>
diff --git a/res/xml/display_settings.xml b/res/xml/display_settings.xml
index ad06e95..54b43dc 100644
--- a/res/xml/display_settings.xml
+++ b/res/xml/display_settings.xml
@@ -93,6 +93,7 @@
     <SwitchPreference
         android:key="display_white_balance"
         android:title="@string/display_white_balance_title"
+        android:summary="@string/display_white_balance_summary"
         settings:controller="com.android.settings.display.DisplayWhiteBalancePreferenceController" />
 
     <Preference
diff --git a/res/xml/security_settings_face.xml b/res/xml/security_settings_face.xml
index fc812f4..7d59f30 100644
--- a/res/xml/security_settings_face.xml
+++ b/res/xml/security_settings_face.xml
@@ -17,6 +17,7 @@
 <PreferenceScreen
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:settings="http://schemas.android.com/apk/res-auto"
     android:key="security_settings_face_settings_page"
     android:title="@string/security_settings_face_preference_title">
 
@@ -39,6 +40,12 @@
             android:title="@string/security_settings_face_settings_use_face_for_apps"
             app:keywords="@string/keywords_face_unlock"
             app:controller="com.android.settings.biometrics.face.FaceSettingsAppPreferenceController"/>
+        <SwitchPreference
+            android:key="security_lockscreen_bypass"
+            android:title="@string/lockscreen_bypass_title"
+            android:summary="@string/lockscreen_bypass_summary"
+            settings:keywords="@string/keywords_lockscreen_bypass"
+            settings:controller="com.android.settings.biometrics.face.FaceSettingsLockscreenBypassPreferenceController" />
     </PreferenceCategory>
 
     <PreferenceCategory
diff --git a/src/com/android/settings/accessibility/AccessibilitySettingsForSetupWizardActivity.java b/src/com/android/settings/accessibility/AccessibilitySettingsForSetupWizardActivity.java
index 0ed1644..1a6c8e8 100644
--- a/src/com/android/settings/accessibility/AccessibilitySettingsForSetupWizardActivity.java
+++ b/src/com/android/settings/accessibility/AccessibilitySettingsForSetupWizardActivity.java
@@ -26,6 +26,7 @@
 import androidx.preference.Preference;
 import androidx.preference.PreferenceFragmentCompat;
 
+import com.android.settings.R;
 import com.android.settings.SettingsActivity;
 import com.android.settings.SetupWizardUtils;
 import com.android.settings.core.SubSettingLauncher;
@@ -97,6 +98,7 @@
         super.onCreate(savedState);
 
         tryLaunchFontSizeSettings();
+        findViewById(R.id.content_parent).setFitsSystemWindows(false);
     }
 
     @VisibleForTesting
diff --git a/src/com/android/settings/accessibility/CaptionPropertiesFragment.java b/src/com/android/settings/accessibility/CaptionPropertiesFragment.java
index bddca9c..9c344df 100644
--- a/src/com/android/settings/accessibility/CaptionPropertiesFragment.java
+++ b/src/com/android/settings/accessibility/CaptionPropertiesFragment.java
@@ -31,18 +31,17 @@
 import androidx.preference.Preference;
 import androidx.preference.Preference.OnPreferenceChangeListener;
 import androidx.preference.PreferenceCategory;
+import androidx.preference.SwitchPreference;
 
 import com.android.internal.widget.SubtitleView;
 import com.android.settings.R;
-import com.android.settings.SettingsActivity;
 import com.android.settings.SettingsPreferenceFragment;
 import com.android.settings.accessibility.ListDialogPreference.OnValueChangedListener;
-import com.android.settings.widget.SwitchBar;
-import com.android.settings.widget.ToggleSwitch;
-import com.android.settings.widget.ToggleSwitch.OnBeforeCheckedChangeListener;
 import com.android.settingslib.accessibility.AccessibilityUtils;
 import com.android.settingslib.widget.LayoutPreference;
 
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Locale;
 
 /**
@@ -63,6 +62,7 @@
     private static final String PREF_TYPEFACE = "captioning_typeface";
     private static final String PREF_LOCALE = "captioning_locale";
     private static final String PREF_PRESET = "captioning_preset";
+    private static final String PREF_SWITCH = "captioning_preference_switch";
     private static final String PREF_CUSTOM = "custom";
 
     /** WebVtt specifies line height as 5.3% of the viewport height. */
@@ -72,10 +72,9 @@
     private SubtitleView mPreviewText;
     private View mPreviewWindow;
     private View mPreviewViewport;
-    private SwitchBar mSwitchBar;
-    private ToggleSwitch mToggleSwitch;
 
     // Standard options.
+    private SwitchPreference mSwitch;
     private LocalePreference mLocale;
     private ListPreference mFontSize;
     private PresetPreference mPreset;
@@ -94,6 +93,8 @@
 
     private boolean mShowingCustom;
 
+    private final List<Preference> mPreferenceList = new ArrayList<>();
+
     @Override
     public int getMetricsCategory() {
         return SettingsEnums.ACCESSIBILITY_CAPTION_PROPERTIES;
@@ -110,31 +111,18 @@
         updateAllPreferences();
         refreshShowingCustom();
         installUpdateListeners();
-    }
-
-    @Override
-    public void onActivityCreated(Bundle savedInstanceState) {
-        super.onActivityCreated(savedInstanceState);
-
-        final boolean enabled = mCaptioningManager.isEnabled();
-        SettingsActivity activity = (SettingsActivity) getActivity();
-        mSwitchBar = activity.getSwitchBar();
-        mSwitchBar.setSwitchBarText(R.string.accessibility_caption_master_switch_title,
-                R.string.accessibility_caption_master_switch_title);
-        mSwitchBar.setCheckedInternal(enabled);
-        mToggleSwitch = mSwitchBar.getSwitch();
-
-        getPreferenceScreen().setEnabled(enabled);
-
         refreshPreviewText();
-
-        installSwitchBarToggleSwitch();
     }
 
-    @Override
-    public void onDestroyView() {
-        super.onDestroyView();
-        removeSwitchBarToggleSwitch();
+    private void setPreferenceViewEnabled(boolean enabled) {
+        for (Preference preference : mPreferenceList) {
+            preference.setEnabled(enabled);
+        }
+    }
+
+    private void refreshPreferenceViewEnabled(boolean enabled) {
+        setPreferenceViewEnabled(enabled);
+        mPreviewText.setVisibility(enabled ? View.VISIBLE : View.INVISIBLE);
     }
 
     private void refreshPreviewText() {
@@ -196,38 +184,10 @@
         }
     }
 
-    protected void onInstallSwitchBarToggleSwitch() {
-        mToggleSwitch.setOnBeforeCheckedChangeListener(new OnBeforeCheckedChangeListener() {
-            @Override
-            public boolean onBeforeCheckedChanged(ToggleSwitch toggleSwitch, boolean checked) {
-                mSwitchBar.setCheckedInternal(checked);
-                Settings.Secure.putInt(getActivity().getContentResolver(),
-                        Settings.Secure.ACCESSIBILITY_CAPTIONING_ENABLED, checked ? 1 : 0);
-                getPreferenceScreen().setEnabled(checked);
-                if (mPreviewText != null) {
-                    mPreviewText.setVisibility(checked ? View.VISIBLE : View.INVISIBLE);
-                }
-                return false;
-            }
-        });
-    }
-
-    private void installSwitchBarToggleSwitch() {
-        onInstallSwitchBarToggleSwitch();
-        mSwitchBar.show();
-    }
-
-    private void removeSwitchBarToggleSwitch() {
-        mSwitchBar.hide();
-        mToggleSwitch.setOnBeforeCheckedChangeListener(null);
-    }
-
     private void initializeAllPreferences() {
         final LayoutPreference captionPreview = findPreference(PREF_CAPTION_PREVIEW);
 
-        final boolean enabled = mCaptioningManager.isEnabled();
         mPreviewText = captionPreview.findViewById(R.id.preview_text);
-        mPreviewText.setVisibility(enabled ? View.VISIBLE : View.INVISIBLE);
 
         mPreviewWindow = captionPreview.findViewById(R.id.preview_window);
 
@@ -236,9 +196,6 @@
                 (v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom)
                         -> refreshPreviewText());
 
-        mLocale = (LocalePreference) findPreference(PREF_LOCALE);
-        mFontSize = (ListPreference) findPreference(PREF_FONT_SIZE);
-
         final Resources res = getResources();
         final int[] presetValues = res.getIntArray(R.array.captioning_preset_selector_values);
         final String[] presetTitles = res.getStringArray(R.array.captioning_preset_selector_titles);
@@ -246,6 +203,17 @@
         mPreset.setValues(presetValues);
         mPreset.setTitles(presetTitles);
 
+        mSwitch = (SwitchPreference) findPreference(PREF_SWITCH);
+        mLocale = (LocalePreference) findPreference(PREF_LOCALE);
+        mFontSize = (ListPreference) findPreference(PREF_FONT_SIZE);
+
+        // Initialize the preference list
+        mPreferenceList.add(mLocale);
+        mPreferenceList.add(mFontSize);
+        mPreferenceList.add(mPreset);
+
+        refreshPreferenceViewEnabled(mCaptioningManager.isEnabled());
+
         mCustom = (PreferenceCategory) findPreference(PREF_CUSTOM);
         mShowingCustom = true;
 
@@ -304,6 +272,7 @@
         mWindowOpacity.setOnValueChangedListener(this);
         mEdgeType.setOnValueChangedListener(this);
 
+        mSwitch.setOnPreferenceChangeListener(this);
         mTypeface.setOnPreferenceChangeListener(this);
         mFontSize.setOnPreferenceChangeListener(this);
         mLocale.setOnPreferenceChangeListener(this);
@@ -338,6 +307,8 @@
 
         final String rawLocale = mCaptioningManager.getRawLocale();
         mLocale.setValue(rawLocale == null ? "" : rawLocale);
+
+        mSwitch.setChecked(mCaptioningManager.isEnabled());
     }
 
     /**
@@ -431,16 +402,22 @@
         if (mTypeface == preference) {
             Settings.Secure.putString(
                     cr, Settings.Secure.ACCESSIBILITY_CAPTIONING_TYPEFACE, (String) value);
+            refreshPreviewText();
         } else if (mFontSize == preference) {
             Settings.Secure.putFloat(
                     cr, Settings.Secure.ACCESSIBILITY_CAPTIONING_FONT_SCALE,
                     Float.parseFloat((String) value));
+            refreshPreviewText();
         } else if (mLocale == preference) {
             Settings.Secure.putString(
                     cr, Settings.Secure.ACCESSIBILITY_CAPTIONING_LOCALE, (String) value);
+            refreshPreviewText();
+        } else if (mSwitch == preference) {
+            Settings.Secure.putInt(
+                    cr, Settings.Secure.ACCESSIBILITY_CAPTIONING_ENABLED, (boolean) value ? 1 : 0);
+            refreshPreferenceViewEnabled((boolean) value);
         }
 
-        refreshPreviewText();
         return true;
     }
 }
diff --git a/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java b/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java
index c3cb34f..b96d2b7 100644
--- a/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java
@@ -16,6 +16,8 @@
 
 package com.android.settings.accessibility;
 
+import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL;
+
 import android.accessibilityservice.AccessibilityServiceInfo;
 import android.app.settings.SettingsEnums;
 import android.content.ComponentName;
@@ -132,9 +134,10 @@
                 if (info.getComponentName().equals(assignedComponentName)) {
                     final CharSequence assignedServiceName = info.getResolveInfo().loadLabel(
                             context.getPackageManager());
-                    return context.getString(
-                            R.string.accessibility_screen_magnification_navbar_configuration_warning,
-                            assignedServiceName);
+                    final int messageId = isGestureNavigateEnabled(context)
+                            ? R.string.accessibility_screen_magnification_gesture_navigation_warning
+                            : R.string.accessibility_screen_magnification_navbar_configuration_warning;
+                    return context.getString(messageId, assignedServiceName);
                 }
             }
         }
@@ -158,6 +161,12 @@
         return res.getBoolean(com.android.internal.R.bool.config_showNavigationBar);
     }
 
+    private static boolean isGestureNavigateEnabled(Context context) {
+        return context.getResources().getInteger(
+                com.android.internal.R.integer.config_navBarInteractionMode)
+                == NAV_BAR_MODE_GESTURAL;
+    }
+
     public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
             new BaseSearchIndexProvider() {
                 @Override
@@ -173,4 +182,4 @@
                     return isApplicable(context.getResources());
                 }
             };
-}
+}
\ No newline at end of file
diff --git a/src/com/android/settings/biometrics/BiometricEnrollIntroduction.java b/src/com/android/settings/biometrics/BiometricEnrollIntroduction.java
index d5414c9..d94686e 100644
--- a/src/com/android/settings/biometrics/BiometricEnrollIntroduction.java
+++ b/src/com/android/settings/biometrics/BiometricEnrollIntroduction.java
@@ -47,6 +47,8 @@
     private boolean mHasPassword;
     private boolean mBiometricUnlockDisabledByAdmin;
     private TextView mErrorText;
+    protected boolean mConfirmingCredentials;
+    protected boolean mNextClicked;
 
     /**
      * @return true if the biometric is disabled by a device administrator
@@ -149,10 +151,12 @@
 
         if (!mHasPassword) {
             // No password registered, launch into enrollment wizard.
+            mConfirmingCredentials = true;
             launchChooseLock();
         } else if (mToken == null) {
             // It's possible to have a token but mLaunchedConfirmLock == false, since
             // ChooseLockGeneric can pass us a token.
+            mConfirmingCredentials = true;
             launchConfirmLock(getConfirmLockTitleResId(), getChallenge());
         }
     }
@@ -182,6 +186,7 @@
 
     @Override
     protected void onNextButtonClick(View view) {
+        mNextClicked = true;
         if (checkMaxEnrolled() == 0) {
             // Lock thingy is already set up, launch directly to the next page
             launchNextEnrollingActivity(mToken);
@@ -249,12 +254,14 @@
                 mToken = data.getByteArrayExtra(
                         ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN);
                 overridePendingTransition(R.anim.sud_slide_next_in, R.anim.sud_slide_next_out);
+                mConfirmingCredentials = false;
                 return;
             } else {
                 setResult(resultCode, data);
                 finish();
             }
         } else if (requestCode == CONFIRM_REQUEST) {
+            mConfirmingCredentials = false;
             if (resultCode == RESULT_OK && data != null) {
                 mToken = data.getByteArrayExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN);
                 overridePendingTransition(R.anim.sud_slide_next_in, R.anim.sud_slide_next_out);
diff --git a/src/com/android/settings/biometrics/face/FaceEnrollAccessibilityToggle.java b/src/com/android/settings/biometrics/face/FaceEnrollAccessibilityToggle.java
index dffc67d..f6ba0f9 100644
--- a/src/com/android/settings/biometrics/face/FaceEnrollAccessibilityToggle.java
+++ b/src/com/android/settings/biometrics/face/FaceEnrollAccessibilityToggle.java
@@ -60,6 +60,8 @@
         }
         mSwitch = findViewById(R.id.toggle);
         mSwitch.setChecked(false);
+        mSwitch.setClickable(false);
+        mSwitch.setFocusable(false);
     }
 
     public boolean isChecked() {
diff --git a/src/com/android/settings/biometrics/face/FaceEnrollEducation.java b/src/com/android/settings/biometrics/face/FaceEnrollEducation.java
index 956ba49..99d96dd 100644
--- a/src/com/android/settings/biometrics/face/FaceEnrollEducation.java
+++ b/src/com/android/settings/biometrics/face/FaceEnrollEducation.java
@@ -51,7 +51,7 @@
     private static final int ON = 1;
     private static final int OFF = 0;
     // 8 seconds.
-    private static final long FACE_ENROLL_EDUCATION_DELAY = 8000;
+    private static final long FACE_ENROLL_EDUCATION_DELAY = 3000;
 
     private FaceManager mFaceManager;
     private FaceEnrollAccessibilityToggle mSwitchDiversity;
@@ -61,6 +61,7 @@
     private Handler mHandler;
     private Intent mResultIntent;
     private TextView mDescriptionText;
+    private boolean mNextClicked;
 
     private CompoundButton.OnCheckedChangeListener mSwitchDiversityListener =
             new CompoundButton.OnCheckedChangeListener() {
@@ -101,14 +102,26 @@
         mDescriptionText = findViewById(R.id.sud_layout_description);
 
         mFooterBarMixin = getLayout().getMixin(FooterBarMixin.class);
-        mFooterBarMixin.setSecondaryButton(
-                new FooterButton.Builder(this)
-                        .setText(R.string.security_settings_face_enroll_enrolling_skip)
-                        .setListener(this::onSkipButtonClick)
-                        .setButtonType(FooterButton.ButtonType.SKIP)
-                        .setTheme(R.style.SudGlifButton_Secondary)
-                        .build()
-        );
+
+        if (WizardManagerHelper.isAnySetupWizard(getIntent())) {
+            mFooterBarMixin.setSecondaryButton(
+                    new FooterButton.Builder(this)
+                            .setText(R.string.skip_label)
+                            .setListener(this::onSkipButtonClick)
+                            .setButtonType(FooterButton.ButtonType.SKIP)
+                            .setTheme(R.style.SudGlifButton_Secondary)
+                            .build()
+            );
+        } else {
+            mFooterBarMixin.setSecondaryButton(
+                    new FooterButton.Builder(this)
+                            .setText(R.string.security_settings_face_enroll_introduction_cancel)
+                            .setListener(this::onSkipButtonClick)
+                            .setButtonType(FooterButton.ButtonType.CANCEL)
+                            .setTheme(R.style.SudGlifButton_Secondary)
+                            .build()
+            );
+        }
 
         final FooterButton footerButton = new FooterButton.Builder(this)
                 .setText(R.string.security_settings_face_enroll_education_start)
@@ -146,6 +159,9 @@
 
         mSwitchDiversity = findViewById(R.id.toggle_diversity);
         mSwitchDiversity.setListener(mSwitchDiversityListener);
+        mSwitchDiversity.setOnClickListener(v -> {
+            mSwitchDiversity.getSwitch().toggle();
+        });
 
         if (accessibilityEnabled) {
             accessibilityButton.callOnClick();
@@ -157,6 +173,26 @@
         super.onResume();
         mSwitchDiversityListener.onCheckedChanged(mSwitchDiversity.getSwitch(),
                 mSwitchDiversity.isChecked());
+
+        // If the user goes back after enrollment, we should send them back to the intro page
+        // if they've met the max limit.
+        final int max = getResources().getInteger(
+                com.android.internal.R.integer.config_faceMaxTemplatesPerUser);
+        final int numEnrolledFaces = mFaceManager.getEnrolledFaces(mUserId).size();
+        if (numEnrolledFaces >= max) {
+            finish();
+        }
+    }
+
+    @Override
+    protected void onStop() {
+        super.onStop();
+
+        if (!isChangingConfigurations() && !WizardManagerHelper.isAnySetupWizard(getIntent())
+                && !mNextClicked) {
+            setResult(RESULT_SKIP);
+            finish();
+        }
     }
 
     @Override
@@ -168,6 +204,7 @@
         if (mUserId != UserHandle.USER_NULL) {
             intent.putExtra(Intent.EXTRA_USER_ID, mUserId);
         }
+        intent.putExtra(EXTRA_FROM_SETTINGS_SUMMARY, mFromSettingsSummary);
         final String flattenedString = getString(R.string.config_face_enroll);
         if (!TextUtils.isEmpty(flattenedString)) {
             ComponentName componentName = ComponentName.unflattenFromString(flattenedString);
@@ -175,11 +212,12 @@
         } else {
             intent.setClass(this, FaceEnrollEnrolling.class);
         }
-        intent.putExtra(EXTRA_KEY_REQUIRE_DIVERSITY, !mSwitchDiversity.isChecked());
+        WizardManagerHelper.copyWizardManagerExtras(getIntent(), intent);
         if (mResultIntent != null) {
             intent.putExtras(mResultIntent);
         }
-        WizardManagerHelper.copyWizardManagerExtras(getIntent(), intent);
+        mNextClicked = true;
+        intent.putExtra(EXTRA_KEY_REQUIRE_DIVERSITY, !mSwitchDiversity.isChecked());
         startActivityForResult(intent, BIOMETRIC_FIND_SENSOR_REQUEST);
     }
 
diff --git a/src/com/android/settings/biometrics/face/FaceEnrollEnrolling.java b/src/com/android/settings/biometrics/face/FaceEnrollEnrolling.java
index ea2fa5c..bf4a1d4 100644
--- a/src/com/android/settings/biometrics/face/FaceEnrollEnrolling.java
+++ b/src/com/android/settings/biometrics/face/FaceEnrollEnrolling.java
@@ -32,6 +32,7 @@
 import com.android.settings.biometrics.BiometricEnrollSidecar;
 import com.android.settings.biometrics.BiometricErrorDialog;
 import com.android.settings.biometrics.BiometricsEnrollEnrolling;
+import com.android.settings.slices.CustomSliceRegistry;
 
 import com.google.android.setupcompat.template.FooterBarMixin;
 import com.google.android.setupcompat.template.FooterButton;
@@ -184,6 +185,10 @@
 
         // TODO: Have this match any animations that UX comes up with
         if (remaining == 0) {
+            // Force the reload of the FaceEnroll slice in case a user has enrolled,
+            // this will cause the slice to no longer appear.
+            getApplicationContext().getContentResolver().notifyChange(
+                    CustomSliceRegistry.FACE_ENROLL_SLICE_URI, null);
             launchFinish(mToken);
         }
     }
diff --git a/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java b/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java
index 525c1a3..6686c96 100644
--- a/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java
+++ b/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java
@@ -78,6 +78,16 @@
     }
 
     @Override
+    protected void onStop() {
+        super.onStop();
+
+        if (!isChangingConfigurations() && !mConfirmingCredentials && !mNextClicked
+                && !WizardManagerHelper.isAnySetupWizard(getIntent())) {
+            finish();
+        }
+    }
+
+    @Override
     protected boolean isDisabledByAdmin() {
         return RestrictedLockUtilsInternal.checkIfKeyguardFeaturesDisabled(
                 this, DevicePolicyManager.KEYGUARD_DISABLE_FACE, mUserId) != null;
diff --git a/src/com/android/settings/biometrics/face/FaceEnrollSidecar.java b/src/com/android/settings/biometrics/face/FaceEnrollSidecar.java
index c75f300..512d8fe 100644
--- a/src/com/android/settings/biometrics/face/FaceEnrollSidecar.java
+++ b/src/com/android/settings/biometrics/face/FaceEnrollSidecar.java
@@ -52,7 +52,7 @@
             mFaceManager.setActiveUser(mUserId);
         }
 
-        mFaceManager.enroll(mToken, mEnrollmentCancel,
+        mFaceManager.enroll(mUserId, mToken, mEnrollmentCancel,
                 mEnrollmentCallback, mDisabledFeatures);
     }
 
diff --git a/src/com/android/settings/biometrics/face/FaceProfileStatusPreferenceController.java b/src/com/android/settings/biometrics/face/FaceProfileStatusPreferenceController.java
index 196992d..56b325b 100644
--- a/src/com/android/settings/biometrics/face/FaceProfileStatusPreferenceController.java
+++ b/src/com/android/settings/biometrics/face/FaceProfileStatusPreferenceController.java
@@ -19,15 +19,31 @@
 import android.content.Context;
 import android.os.UserHandle;
 
+import com.android.settings.R;
+
+import androidx.preference.Preference;
+
 public class FaceProfileStatusPreferenceController extends FaceStatusPreferenceController {
 
-    public static final String KEY_FACE_SETTINGS = "face_settings_profile";
+    private static final String KEY_FACE_SETTINGS = "face_settings_profile";
 
     public FaceProfileStatusPreferenceController(Context context) {
         super(context, KEY_FACE_SETTINGS);
     }
 
     @Override
+    public int getAvailabilityStatus() {
+        // Check if Face for Profile is available.
+        final int isAvailable = super.getAvailabilityStatus();
+        if (isAvailable != AVAILABLE) {
+            return isAvailable;
+        }
+        // Make the profile unsearchable so the user preference controller gets highlighted
+        // when searched for.
+        return AVAILABLE_UNSEARCHABLE;
+    }
+
+    @Override
     protected boolean isUserSupported() {
         return mProfileChallengeUserId != UserHandle.USER_NULL
                 && mLockPatternUtils.isSeparateProfileChallengeAllowed(mProfileChallengeUserId);
@@ -37,4 +53,11 @@
     protected int getUserId() {
         return mProfileChallengeUserId;
     }
+
+    @Override
+    public void updateState(Preference preference) {
+        super.updateState(preference);
+        preference.setTitle(mContext.getResources().getString(
+                R.string.security_settings_face_profile_preference_title));
+    }
 }
diff --git a/src/com/android/settings/biometrics/face/FaceSettings.java b/src/com/android/settings/biometrics/face/FaceSettings.java
index 48370d9..9c81055 100644
--- a/src/com/android/settings/biometrics/face/FaceSettings.java
+++ b/src/com/android/settings/biometrics/face/FaceSettings.java
@@ -69,6 +69,8 @@
     private Preference mRemoveButton;
     private Preference mEnrollButton;
 
+    private boolean mConfirmingPassword;
+
     private final FaceSettingsRemoveButtonPreferenceController.Listener mRemovalListener = () -> {
 
         // Disable the toggles until the user re-enrolls
@@ -117,12 +119,19 @@
         mUserId = getActivity().getIntent().getIntExtra(
                 Intent.EXTRA_USER_ID, UserHandle.myUserId());
 
+        if (mUserManager.getUserInfo(mUserId).isManagedProfile()) {
+            getActivity().setTitle(getActivity().getResources().getString(
+                    R.string.security_settings_face_profile_preference_title));
+        }
+
         Preference keyguardPref = findPreference(FaceSettingsKeyguardPreferenceController.KEY);
         Preference appPref = findPreference(FaceSettingsAppPreferenceController.KEY);
         Preference attentionPref = findPreference(FaceSettingsAttentionPreferenceController.KEY);
         Preference confirmPref = findPreference(FaceSettingsConfirmPreferenceController.KEY);
+        Preference bypassPref =
+                findPreference(FaceSettingsLockscreenBypassPreferenceController.KEY);
         mTogglePreferences = new ArrayList<>(
-                Arrays.asList(keyguardPref, appPref, attentionPref, confirmPref));
+                Arrays.asList(keyguardPref, appPref, attentionPref, confirmPref, bypassPref));
 
         mRemoveButton = findPreference(FaceSettingsRemoveButtonPreferenceController.KEY);
         mEnrollButton = findPreference(FaceSettingsEnrollButtonPreferenceController.KEY);
@@ -140,28 +149,33 @@
         // Don't show keyguard controller for work profile settings.
         if (mUserManager.isManagedProfile(mUserId)) {
             removePreference(FaceSettingsKeyguardPreferenceController.KEY);
+            removePreference(FaceSettingsLockscreenBypassPreferenceController.KEY);
         }
 
         if (savedInstanceState != null) {
             mToken = savedInstanceState.getByteArray(KEY_TOKEN);
         }
-
-        if (mToken == null) {
-            final long challenge = mFaceManager.generateChallenge();
-            ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(getActivity(), this);
-            if (!helper.launchConfirmationActivity(CONFIRM_REQUEST,
-                    getString(R.string.security_settings_face_preference_title),
-                    null, null, challenge, mUserId)) {
-                Log.e(TAG, "Password not set");
-                finish();
-            }
-        }
     }
 
     @Override
     public void onResume() {
         super.onResume();
-        if (mToken != null) {
+
+        if (mToken == null && !mConfirmingPassword) {
+            // Generate challenge in onResume instead of onCreate, since FaceSettings can be
+            // created while Keyguard is showing, in which case the resetLockout revokeChallenge
+            // will invalidate the too-early created challenge here.
+            final long challenge = mFaceManager.generateChallenge();
+            ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(getActivity(), this);
+
+            mConfirmingPassword = true;
+            if (!helper.launchConfirmationActivity(CONFIRM_REQUEST,
+                    getString(R.string.security_settings_face_preference_title),
+                    null, null, challenge, mUserId)) {
+                Log.e(TAG, "Password not set");
+                finish();
+            }
+        } else {
             mAttentionController.setToken(mToken);
             mEnrollController.setToken(mToken);
         }
@@ -175,6 +189,7 @@
     public void onActivityResult(int requestCode, int resultCode, Intent data) {
         super.onActivityResult(requestCode, resultCode, data);
         if (requestCode == CONFIRM_REQUEST) {
+            mConfirmingPassword = false;
             if (resultCode == RESULT_FINISHED || resultCode == RESULT_OK) {
                 mFaceManager.setActiveUser(mUserId);
                 // The pin/pattern/password was set.
@@ -196,17 +211,29 @@
     }
 
     @Override
-    public void onDestroy() {
-        super.onDestroy();
-        if (getActivity().isFinishing()) {
-            final int result = mFaceManager.revokeChallenge();
-            if (result < 0) {
-                Log.w(TAG, "revokeChallenge failed, result: " + result);
+    public void onStop() {
+        super.onStop();
+
+        if (!mEnrollController.isClicked() && !getActivity().isChangingConfigurations()
+                && !mConfirmingPassword) {
+            // Revoke challenge and finish
+            if (mToken != null) {
+                final int result = mFaceManager.revokeChallenge();
+                if (result < 0) {
+                    Log.w(TAG, "revokeChallenge failed, result: " + result);
+                }
+                mToken = null;
             }
+            getActivity().finish();
         }
     }
 
     @Override
+    public int getHelpResource() {
+        return R.string.help_url_face;
+    }
+
+    @Override
     protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
         if (!isAvailable(context)) {
             return null;
@@ -234,6 +261,7 @@
         final List<AbstractPreferenceController> controllers = new ArrayList<>();
         controllers.add(new FaceSettingsVideoPreferenceController(context));
         controllers.add(new FaceSettingsKeyguardPreferenceController(context));
+        controllers.add(new FaceSettingsLockscreenBypassPreferenceController(context));
         controllers.add(new FaceSettingsAppPreferenceController(context));
         controllers.add(new FaceSettingsAttentionPreferenceController(context));
         controllers.add(new FaceSettingsRemoveButtonPreferenceController(context));
diff --git a/src/com/android/settings/biometrics/face/FaceSettingsAppPreferenceController.java b/src/com/android/settings/biometrics/face/FaceSettingsAppPreferenceController.java
index 70c00e5..a54171e 100644
--- a/src/com/android/settings/biometrics/face/FaceSettingsAppPreferenceController.java
+++ b/src/com/android/settings/biometrics/face/FaceSettingsAppPreferenceController.java
@@ -78,6 +78,19 @@
 
     @Override
     public int getAvailabilityStatus() {
-        return AVAILABLE;
+        if(mFaceManager == null){
+            return AVAILABLE_UNSEARCHABLE;
+        }
+
+        // By only allowing this preference controller to be searchable when the feature is turned
+        // off, it will give preference to the face setup controller.
+        final boolean hasEnrolledUser = mFaceManager.hasEnrolledTemplates(getUserId());
+        final boolean appUnlockEnabled = Settings.Secure.getIntForUser(
+                mContext.getContentResolver(), FACE_UNLOCK_APP_ENABLED, OFF, getUserId()) == ON;
+        if (hasEnrolledUser && !appUnlockEnabled) {
+            return AVAILABLE;
+        } else {
+            return AVAILABLE_UNSEARCHABLE;
+        }
     }
 }
diff --git a/src/com/android/settings/biometrics/face/FaceSettingsAttentionPreferenceController.java b/src/com/android/settings/biometrics/face/FaceSettingsAttentionPreferenceController.java
index ef90b1e..9ae6a87 100644
--- a/src/com/android/settings/biometrics/face/FaceSettingsAttentionPreferenceController.java
+++ b/src/com/android/settings/biometrics/face/FaceSettingsAttentionPreferenceController.java
@@ -99,7 +99,8 @@
         }
         // Set to disabled until we know the true value.
         mPreference.setEnabled(false);
-        mFaceManager.getFeature(FaceManager.FEATURE_REQUIRE_ATTENTION, mGetFeatureCallback);
+        mFaceManager.getFeature(getUserId(), FaceManager.FEATURE_REQUIRE_ATTENTION,
+                mGetFeatureCallback);
 
         // Ideally returns a cached value.
         return true;
@@ -111,8 +112,8 @@
         mPreference.setEnabled(false);
         mPreference.setChecked(isChecked);
 
-        mFaceManager.setFeature(FaceManager.FEATURE_REQUIRE_ATTENTION, isChecked, mToken,
-                mSetFeatureCallback);
+        mFaceManager.setFeature(getUserId(), FaceManager.FEATURE_REQUIRE_ATTENTION, isChecked,
+                mToken, mSetFeatureCallback);
         return true;
     }
 
diff --git a/src/com/android/settings/biometrics/face/FaceSettingsEnrollButtonPreferenceController.java b/src/com/android/settings/biometrics/face/FaceSettingsEnrollButtonPreferenceController.java
index ec7b194..a087ccc 100644
--- a/src/com/android/settings/biometrics/face/FaceSettingsEnrollButtonPreferenceController.java
+++ b/src/com/android/settings/biometrics/face/FaceSettingsEnrollButtonPreferenceController.java
@@ -42,6 +42,7 @@
     private byte[] mToken;
     private SettingsActivity mActivity;
     private Button mButton;
+    private boolean mIsClicked;
 
     public FaceSettingsEnrollButtonPreferenceController(Context context) {
         this(context, KEY);
@@ -63,6 +64,7 @@
 
     @Override
     public void onClick(View v) {
+        mIsClicked = true;
         final Intent intent = new Intent();
         intent.setClassName("com.android.settings", FaceEnrollIntroduction.class.getName());
         intent.putExtra(Intent.EXTRA_USER_ID, mUserId);
@@ -83,6 +85,13 @@
         mToken = token;
     }
 
+    // Return the click state, then clear its state.
+    public boolean isClicked() {
+        final boolean wasClicked = mIsClicked;
+        mIsClicked = false;
+        return wasClicked;
+    }
+
     public void setActivity(SettingsActivity activity) {
         mActivity = activity;
     }
diff --git a/src/com/android/settings/biometrics/face/FaceSettingsKeyguardPreferenceController.java b/src/com/android/settings/biometrics/face/FaceSettingsKeyguardPreferenceController.java
index c64455a..9ec1ad1 100644
--- a/src/com/android/settings/biometrics/face/FaceSettingsKeyguardPreferenceController.java
+++ b/src/com/android/settings/biometrics/face/FaceSettingsKeyguardPreferenceController.java
@@ -18,16 +18,13 @@
 
 import static android.provider.Settings.Secure.FACE_UNLOCK_KEYGUARD_ENABLED;
 
-import android.app.admin.DevicePolicyManager;
 import android.content.Context;
 import android.hardware.face.FaceManager;
-import android.os.UserHandle;
 import android.provider.Settings;
 
 import androidx.preference.Preference;
 
 import com.android.settings.Utils;
-import com.android.settings.core.TogglePreferenceController;
 
 /**
  * Preference controller for Face settings page controlling the ability to unlock the phone
@@ -87,13 +84,4 @@
             preference.setEnabled(true);
         }
     }
-
-    private boolean adminDisabled() {
-        DevicePolicyManager dpm =
-                (DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
-        return dpm != null &&
-                (dpm.getKeyguardDisabledFeatures(null, UserHandle.myUserId())
-                        & DevicePolicyManager.KEYGUARD_DISABLE_FACE)
-                        != 0;
-    }
 }
diff --git a/src/com/android/settings/biometrics/face/FaceSettingsLockscreenBypassPreferenceController.java b/src/com/android/settings/biometrics/face/FaceSettingsLockscreenBypassPreferenceController.java
new file mode 100644
index 0000000..8d1b543
--- /dev/null
+++ b/src/com/android/settings/biometrics/face/FaceSettingsLockscreenBypassPreferenceController.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.settings.biometrics.face;
+
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.hardware.face.FaceManager;
+import android.provider.Settings;
+
+import androidx.preference.Preference;
+
+import com.android.internal.annotations.VisibleForTesting;
+
+public class FaceSettingsLockscreenBypassPreferenceController
+        extends FaceSettingsPreferenceController {
+
+    static final String KEY = "security_lockscreen_bypass";
+
+    @VisibleForTesting
+    protected FaceManager mFaceManager;
+
+    public FaceSettingsLockscreenBypassPreferenceController(Context context) {
+        this(context, KEY);
+    }
+
+    public FaceSettingsLockscreenBypassPreferenceController(Context context, String preferenceKey) {
+        super(context, preferenceKey);
+        if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_FACE)) {
+            mFaceManager = context.getSystemService(FaceManager.class);
+        }
+    }
+
+    @Override
+    public boolean isChecked() {
+        boolean defaultValue = mContext.getResources().getBoolean(
+                com.android.internal.R.bool.config_faceAuthDismissesKeyguard);
+        return Settings.Secure.getInt(mContext.getContentResolver(),
+                Settings.Secure.FACE_UNLOCK_DISMISSES_KEYGUARD, defaultValue ? 1 : 0) != 0;
+    }
+
+    @Override
+    public boolean setChecked(boolean isChecked) {
+        Settings.Secure.putInt(mContext.getContentResolver(),
+                Settings.Secure.FACE_UNLOCK_DISMISSES_KEYGUARD, isChecked ? 1 : 0);
+        return true;
+    }
+
+    @Override
+    public void updateState(Preference preference) {
+        super.updateState(preference);
+        if (!FaceSettings.isAvailable(mContext)) {
+            preference.setEnabled(false);
+        } else if (adminDisabled()) {
+            preference.setEnabled(false);
+        } else if (!mFaceManager.hasEnrolledTemplates(getUserId())) {
+            preference.setEnabled(false);
+        } else {
+            preference.setEnabled(true);
+        }
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        if (mFaceManager != null && mFaceManager.isHardwareDetected()) {
+            return mFaceManager.hasEnrolledTemplates() ? AVAILABLE : DISABLED_DEPENDENT_SETTING;
+        } else {
+            return UNSUPPORTED_ON_DEVICE;
+        }
+    }
+}
diff --git a/src/com/android/settings/biometrics/face/FaceSettingsPreferenceController.java b/src/com/android/settings/biometrics/face/FaceSettingsPreferenceController.java
index b8ac118..55e093b 100644
--- a/src/com/android/settings/biometrics/face/FaceSettingsPreferenceController.java
+++ b/src/com/android/settings/biometrics/face/FaceSettingsPreferenceController.java
@@ -16,7 +16,9 @@
 
 package com.android.settings.biometrics.face;
 
+import android.app.admin.DevicePolicyManager;
 import android.content.Context;
+import android.os.UserHandle;
 
 import com.android.settings.core.TogglePreferenceController;
 
@@ -38,4 +40,13 @@
     protected int getUserId() {
         return mUserId;
     }
+
+    protected boolean adminDisabled() {
+        DevicePolicyManager dpm =
+                (DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
+        return dpm != null &&
+                (dpm.getKeyguardDisabledFeatures(null, UserHandle.myUserId())
+                        & DevicePolicyManager.KEYGUARD_DISABLE_FACE)
+                        != 0;
+    }
 }
diff --git a/src/com/android/settings/biometrics/face/FaceSettingsRemoveButtonPreferenceController.java b/src/com/android/settings/biometrics/face/FaceSettingsRemoveButtonPreferenceController.java
index d532a76..1c1b81d 100644
--- a/src/com/android/settings/biometrics/face/FaceSettingsRemoveButtonPreferenceController.java
+++ b/src/com/android/settings/biometrics/face/FaceSettingsRemoveButtonPreferenceController.java
@@ -64,7 +64,7 @@
 
             builder.setTitle(R.string.security_settings_face_settings_remove_dialog_title)
                     .setMessage(R.string.security_settings_face_settings_remove_dialog_details)
-                    .setPositiveButton(R.string.okay, mOnClickListener)
+                    .setPositiveButton(R.string.delete, mOnClickListener)
                     .setNegativeButton(R.string.cancel, mOnClickListener);
             AlertDialog dialog = builder.create();
             dialog.setCanceledOnTouchOutside(false);
diff --git a/src/com/android/settings/biometrics/face/FaceStatusPreferenceController.java b/src/com/android/settings/biometrics/face/FaceStatusPreferenceController.java
index 8450577..cb82b5e 100644
--- a/src/com/android/settings/biometrics/face/FaceStatusPreferenceController.java
+++ b/src/com/android/settings/biometrics/face/FaceStatusPreferenceController.java
@@ -26,7 +26,7 @@
 
 public class FaceStatusPreferenceController extends BiometricStatusPreferenceController {
 
-    private static final String KEY_FACE_SETTINGS = "face_settings";
+    public static final String KEY_FACE_SETTINGS = "face_settings";
 
     protected final FaceManager mFaceManager;
 
diff --git a/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java b/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
index aba95c8..f384d85 100644
--- a/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
+++ b/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
@@ -494,12 +494,6 @@
         controllers.add(new DefaultLaunchPreferenceController(context, "inactive_apps"));
         controllers.add(new AutofillLoggingLevelPreferenceController(context, lifecycle));
         controllers.add(new AutofillResetOptionsPreferenceController(context));
-        controllers.add(new OverlayCategoryPreferenceController(context,
-                "android.theme.customization.accent_color"));
-        controllers.add(new OverlayCategoryPreferenceController(context,
-                "android.theme.customization.font"));
-        controllers.add(new OverlayCategoryPreferenceController(context,
-                "android.theme.customization.adaptive_icon_shape"));
         controllers.add(new TrustAgentsExtendUnlockPreferenceController(context));
         controllers.add(new TrustLostLocksScreenPreferenceController(context));
         return controllers;
diff --git a/src/com/android/settings/display/AdaptiveSleepDetailPreferenceController.java b/src/com/android/settings/display/AdaptiveSleepDetailPreferenceController.java
index 5ce7be5..0e2358c 100644
--- a/src/com/android/settings/display/AdaptiveSleepDetailPreferenceController.java
+++ b/src/com/android/settings/display/AdaptiveSleepDetailPreferenceController.java
@@ -21,6 +21,7 @@
 import androidx.preference.Preference;
 
 public class AdaptiveSleepDetailPreferenceController extends AdaptiveSleepPreferenceController {
+
     public AdaptiveSleepDetailPreferenceController(Context context, String key) {
         super(context, key);
     }
@@ -42,6 +43,6 @@
     @Override
     public void updateState(Preference preference) {
         super.updateState(preference);
-        preference.setEnabled(super.hasSufficientPermissions);
+        preference.setEnabled(hasSufficientPermission(mContext.getPackageManager()));
     }
-}
+}
\ No newline at end of file
diff --git a/src/com/android/settings/display/AdaptiveSleepPermissionPreferenceController.java b/src/com/android/settings/display/AdaptiveSleepPermissionPreferenceController.java
new file mode 100644
index 0000000..9e6bca4
--- /dev/null
+++ b/src/com/android/settings/display/AdaptiveSleepPermissionPreferenceController.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.settings.display;
+
+import static com.android.settings.display.AdaptiveSleepPreferenceController.hasSufficientPermission;
+
+import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
+import android.text.TextUtils;
+
+import androidx.preference.Preference;
+
+import com.android.settings.core.BasePreferenceController;
+
+public class AdaptiveSleepPermissionPreferenceController extends BasePreferenceController {
+    final static String PREF_NAME = "adaptive_sleep_permission";
+    private final Intent mIntent;
+
+    public AdaptiveSleepPermissionPreferenceController(Context context, String key) {
+        super(context, key);
+        final String packageName = context.getPackageManager().getAttentionServicePackageName();
+        mIntent = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
+        mIntent.setData(Uri.parse("package:" + packageName));
+    }
+
+    @Override
+    @AvailabilityStatus
+    public int getAvailabilityStatus() {
+        return AVAILABLE_UNSEARCHABLE;
+    }
+
+    @Override
+    public boolean handlePreferenceTreeClick(Preference preference) {
+        if (TextUtils.equals(getPreferenceKey(), preference.getKey())) {
+            mContext.startActivity(mIntent);
+            return true;
+        }
+        return super.handlePreferenceTreeClick(preference);
+    }
+
+    @Override
+    public void updateState(Preference preference) {
+        super.updateState(preference);
+        if (TextUtils.equals(getPreferenceKey(), preference.getKey())) {
+            preference.setVisible(!hasSufficientPermission(mContext.getPackageManager()));
+        }
+    }
+}
diff --git a/src/com/android/settings/display/AdaptiveSleepPreferenceController.java b/src/com/android/settings/display/AdaptiveSleepPreferenceController.java
index 6b91792..b736b79 100644
--- a/src/com/android/settings/display/AdaptiveSleepPreferenceController.java
+++ b/src/com/android/settings/display/AdaptiveSleepPreferenceController.java
@@ -25,28 +25,20 @@
 
 
 public class AdaptiveSleepPreferenceController extends TogglePreferenceController {
-
-    private final String SYSTEM_KEY = ADAPTIVE_SLEEP;
-    private final int DEFAULT_VALUE = 0;
-
-    final boolean hasSufficientPermissions;
+    public static final String PREF_NAME = "adaptive_sleep";
+    private static final String SYSTEM_KEY = ADAPTIVE_SLEEP;
+    private static final int DEFAULT_VALUE = 0;
 
     public AdaptiveSleepPreferenceController(Context context, String key) {
         super(context, key);
-
-        final PackageManager packageManager = mContext.getPackageManager();
-        final String attentionPackage = packageManager.getAttentionServicePackageName();
-        hasSufficientPermissions = attentionPackage != null && packageManager.checkPermission(
-                Manifest.permission.CAMERA, attentionPackage) == PackageManager.PERMISSION_GRANTED;
     }
 
     @Override
     public boolean isChecked() {
-        return hasSufficientPermissions && Settings.System.getInt(mContext.getContentResolver(),
-                SYSTEM_KEY, DEFAULT_VALUE) != DEFAULT_VALUE;
+        return hasSufficientPermission(mContext.getPackageManager()) && Settings.System.getInt(
+                mContext.getContentResolver(), SYSTEM_KEY, DEFAULT_VALUE) != DEFAULT_VALUE;
     }
 
-
     @Override
     public boolean setChecked(boolean isChecked) {
         Settings.System.putInt(mContext.getContentResolver(), SYSTEM_KEY,
@@ -57,10 +49,7 @@
     @Override
     @AvailabilityStatus
     public int getAvailabilityStatus() {
-        return mContext.getResources().getBoolean(
-                com.android.internal.R.bool.config_adaptive_sleep_available)
-                ? AVAILABLE_UNSEARCHABLE
-                : UNSUPPORTED_ON_DEVICE;
+        return isControllerAvailable(mContext);
     }
 
     @Override
@@ -69,4 +58,17 @@
                 ? R.string.adaptive_sleep_summary_on
                 : R.string.adaptive_sleep_summary_off);
     }
+
+    public static int isControllerAvailable(Context context) {
+        return context.getResources().getBoolean(
+                com.android.internal.R.bool.config_adaptive_sleep_available)
+                ? AVAILABLE_UNSEARCHABLE
+                : UNSUPPORTED_ON_DEVICE;
+    }
+
+    static boolean hasSufficientPermission(PackageManager packageManager) {
+        final String attentionPackage = packageManager.getAttentionServicePackageName();
+        return attentionPackage != null && packageManager.checkPermission(
+                Manifest.permission.CAMERA, attentionPackage) == PackageManager.PERMISSION_GRANTED;
+    }
 }
diff --git a/src/com/android/settings/display/AdaptiveSleepSettings.java b/src/com/android/settings/display/AdaptiveSleepSettings.java
index 4c17a67..66e20b4 100644
--- a/src/com/android/settings/display/AdaptiveSleepSettings.java
+++ b/src/com/android/settings/display/AdaptiveSleepSettings.java
@@ -16,11 +16,16 @@
 
 package com.android.settings.display;
 
+import static com.android.settings.homepage.contextualcards.slices.ContextualAdaptiveSleepSlice.PREF;
+import static com.android.settings.homepage.contextualcards.slices.ContextualAdaptiveSleepSlice.PREF_KEY_INTERACTED;
+
 import android.app.settings.SettingsEnums;
 import android.content.Context;
 import android.os.Bundle;
 import android.provider.SearchIndexableResource;
 
+import androidx.preference.Preference;
+
 import com.android.settings.R;
 import com.android.settings.dashboard.DashboardFragment;
 import com.android.settings.search.BaseSearchIndexProvider;
@@ -34,14 +39,28 @@
 public class AdaptiveSleepSettings extends DashboardFragment {
 
     private static final String TAG = "AdaptiveSleepSettings";
+    private Context mContext;
 
     @Override
     public void onCreate(Bundle icicle) {
         super.onCreate(icicle);
         final FooterPreference footerPreference =
                 mFooterPreferenceMixin.createFooterPreference();
+        mContext = getContext();
+
         footerPreference.setIcon(R.drawable.ic_privacy_shield_24dp);
         footerPreference.setTitle(R.string.adaptive_sleep_privacy);
+
+        Preference permissionPreference = findPreference(
+                AdaptiveSleepPermissionPreferenceController.PREF_NAME);
+        if (permissionPreference != null) {
+            permissionPreference.setVisible(false);
+        }
+
+        mContext.getSharedPreferences(PREF, Context.MODE_PRIVATE)
+                .edit()
+                .putBoolean(PREF_KEY_INTERACTED, true)
+                .apply();
     }
 
     @Override
diff --git a/src/com/android/settings/display/ColorModePreferenceFragment.java b/src/com/android/settings/display/ColorModePreferenceFragment.java
index c28de73..598d9c1 100644
--- a/src/com/android/settings/display/ColorModePreferenceFragment.java
+++ b/src/com/android/settings/display/ColorModePreferenceFragment.java
@@ -213,5 +213,13 @@
                     sir.xmlResId = R.xml.color_mode_settings;
                     return Arrays.asList(sir);
                 }
+
+                @Override
+                protected boolean isPageSearchEnabled(Context context) {
+                    final int[] availableColorModes = context.getResources().getIntArray(
+                            com.android.internal.R.array.config_availableColorModes);
+                    return availableColorModes != null && availableColorModes.length > 0
+                            && !ColorDisplayManager.areAccessibilityTransformsEnabled(context);
+                }
             };
 }
diff --git a/src/com/android/settings/homepage/contextualcards/SettingsContextualCardProvider.java b/src/com/android/settings/homepage/contextualcards/SettingsContextualCardProvider.java
index 86fee03..385f8cd 100644
--- a/src/com/android/settings/homepage/contextualcards/SettingsContextualCardProvider.java
+++ b/src/com/android/settings/homepage/contextualcards/SettingsContextualCardProvider.java
@@ -64,12 +64,28 @@
                         .setCardName(contextualNotificationChannelSliceUri)
                         .setCardCategory(ContextualCard.Category.POSSIBLE)
                         .build();
+        final String contextualAdaptiveSleepSliceUri =
+                CustomSliceRegistry.CONTEXTUAL_ADAPTIVE_SLEEP_URI.toString();
+        final ContextualCard contextualAdaptiveSleepCard =
+                ContextualCard.newBuilder()
+                        .setSliceUri(contextualAdaptiveSleepSliceUri)
+                        .setCardName(contextualAdaptiveSleepSliceUri)
+                        .setCardCategory(ContextualCard.Category.DEFAULT)
+                        .build();
+        final ContextualCard contextualFaceSettingsCard =
+                ContextualCard.newBuilder()
+                        .setSliceUri(CustomSliceRegistry.FACE_ENROLL_SLICE_URI.toString())
+                        .setCardName(CustomSliceRegistry.FACE_ENROLL_SLICE_URI.toString())
+                        .setCardCategory(ContextualCard.Category.DEFAULT)
+                        .build();
         final ContextualCardList cards = ContextualCardList.newBuilder()
                 .addCard(wifiCard)
                 .addCard(connectedDeviceCard)
                 .addCard(lowStorageCard)
                 .addCard(batteryFixCard)
                 .addCard(notificationChannelCard)
+                .addCard(contextualAdaptiveSleepCard)
+                .addCard(contextualFaceSettingsCard)
                 .build();
 
         return cards;
diff --git a/src/com/android/settings/homepage/contextualcards/slices/ContextualAdaptiveSleepSlice.java b/src/com/android/settings/homepage/contextualcards/slices/ContextualAdaptiveSleepSlice.java
new file mode 100644
index 0000000..3da5763
--- /dev/null
+++ b/src/com/android/settings/homepage/contextualcards/slices/ContextualAdaptiveSleepSlice.java
@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.settings.homepage.contextualcards.slices;
+
+import static com.android.settings.core.BasePreferenceController.AVAILABLE_UNSEARCHABLE;
+import static com.android.settings.display.AdaptiveSleepPreferenceController.PREF_NAME;
+import static com.android.settings.display.AdaptiveSleepPreferenceController.isControllerAvailable;
+import static com.android.settings.slices.CustomSliceRegistry.CONTEXTUAL_ADAPTIVE_SLEEP_URI;
+
+import android.app.PendingIntent;
+import android.app.settings.SettingsEnums;
+import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
+
+import androidx.core.graphics.drawable.IconCompat;
+import androidx.slice.Slice;
+import androidx.slice.builders.ListBuilder;
+import androidx.slice.builders.SliceAction;
+
+import com.android.settings.R;
+import com.android.settings.SubSettings;
+import com.android.settings.display.AdaptiveSleepSettings;
+import com.android.settings.slices.CustomSliceable;
+import com.android.settings.slices.SliceBuilderUtils;
+
+import com.google.common.annotations.VisibleForTesting;
+
+import java.util.concurrent.TimeUnit;
+
+public class ContextualAdaptiveSleepSlice implements CustomSliceable {
+    private static final String TAG = "ContextualAdaptiveSleepSlice";
+    private static final long DEFAULT_SETUP_TIME = 0;
+    private Context mContext;
+
+    @VisibleForTesting
+    static final long DEFERRED_TIME_DAYS = TimeUnit.DAYS.toMillis(14);
+    @VisibleForTesting
+    static final String PREF_KEY_SETUP_TIME = "adaptive_sleep_setup_time";
+
+    public static final String PREF_KEY_INTERACTED = "adaptive_sleep_interacted";
+    public static final String PREF = "adaptive_sleep_slice";
+
+    public ContextualAdaptiveSleepSlice(Context context) {
+        mContext = context;
+    }
+
+    @Override
+    public Slice getSlice() {
+        final long setupTime = mContext.getSharedPreferences(PREF, Context.MODE_PRIVATE).getLong(
+                PREF_KEY_SETUP_TIME, DEFAULT_SETUP_TIME);
+        if (setupTime == DEFAULT_SETUP_TIME) {
+            // Set the first setup time.
+            mContext.getSharedPreferences(PREF, Context.MODE_PRIVATE)
+                    .edit()
+                    .putLong(PREF_KEY_SETUP_TIME, System.currentTimeMillis())
+                    .apply();
+            return null;
+        }
+
+        // Display the contextual card only if all the following 3 conditions hold:
+        // 1. The Screen Attention is enabled in Settings.
+        // 2. The device is not recently set up.
+        // 3. Current user hasn't opened Screen Attention's settings page before.
+        if (isSettingsAvailable() && !isUserInteracted() && !isRecentlySetup()) {
+            final IconCompat icon = IconCompat.createWithResource(mContext,
+                    R.drawable.ic_settings_adaptive_sleep);
+            final CharSequence title = mContext.getText(R.string.adaptive_sleep_title);
+            final CharSequence subtitle = mContext.getText(
+                    R.string.adaptive_sleep_contextual_slice_summary);
+
+            final SliceAction pAction = SliceAction.createDeeplink(getPrimaryAction(),
+                    icon,
+                    ListBuilder.ICON_IMAGE,
+                    title);
+            final ListBuilder listBuilder = new ListBuilder(mContext,
+                    CONTEXTUAL_ADAPTIVE_SLEEP_URI,
+                    ListBuilder.INFINITY)
+                    .setAccentColor(COLOR_NOT_TINTED)
+                    .addRow(new ListBuilder.RowBuilder()
+                            .setTitleItem(icon, ListBuilder.ICON_IMAGE)
+                            .setTitle(title)
+                            .setSubtitle(subtitle)
+                            .setPrimaryAction(pAction));
+            return listBuilder.build();
+        } else {
+            return null;
+        }
+    }
+
+    @Override
+    public Uri getUri() {
+        return CONTEXTUAL_ADAPTIVE_SLEEP_URI;
+    }
+
+    @Override
+    public Intent getIntent() {
+        final CharSequence screenTitle = mContext.getText(R.string.adaptive_sleep_title);
+        final Uri contentUri = new Uri.Builder().appendPath(PREF_NAME).build();
+        return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
+                AdaptiveSleepSettings.class.getName(), PREF_NAME, screenTitle.toString(),
+                SettingsEnums.SLICE).setClassName(mContext.getPackageName(),
+                SubSettings.class.getName()).setData(contentUri);
+    }
+
+    private PendingIntent getPrimaryAction() {
+        final Intent intent = getIntent();
+        return PendingIntent.getActivity(mContext, 0  /* requestCode */, intent, 0  /* flags */);
+    }
+
+    /**
+     * @return {@code true} if the current user has opened the Screen Attention settings page
+     * before, otherwise {@code false}.
+     */
+    private boolean isUserInteracted() {
+        return mContext.getSharedPreferences(PREF, Context.MODE_PRIVATE).getBoolean(
+                PREF_KEY_INTERACTED, false);
+    }
+
+    /**
+     * The device is recently set up means its first settings-open time is within 2 weeks ago.
+     *
+     * @return {@code true} if the device is recently set up, otherwise {@code false}.
+     */
+    private boolean isRecentlySetup() {
+        final long endTime = System.currentTimeMillis() - DEFERRED_TIME_DAYS;
+        final long firstSetupTime = mContext.getSharedPreferences(PREF,
+                Context.MODE_PRIVATE).getLong(PREF_KEY_SETUP_TIME, DEFAULT_SETUP_TIME);
+        return firstSetupTime > endTime;
+    }
+
+    /**
+     * Check whether the screen attention settings is enabled. Contextual card will only appear
+     * when the screen attention settings is available.
+     *
+     * @return {@code true} if screen attention settings is enabled, otherwise {@code false}
+     */
+    @VisibleForTesting
+    boolean isSettingsAvailable() {
+        return isControllerAvailable(mContext) == AVAILABLE_UNSEARCHABLE;
+    }
+}
\ No newline at end of file
diff --git a/src/com/android/settings/homepage/contextualcards/slices/FaceSetupSlice.java b/src/com/android/settings/homepage/contextualcards/slices/FaceSetupSlice.java
new file mode 100644
index 0000000..112f655
--- /dev/null
+++ b/src/com/android/settings/homepage/contextualcards/slices/FaceSetupSlice.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.settings.homepage.contextualcards.slices;
+
+
+import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_SUCCESS;
+
+import android.app.PendingIntent;
+import android.app.settings.SettingsEnums;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.hardware.biometrics.BiometricManager;
+import android.hardware.face.FaceManager;
+import android.net.Uri;
+import android.os.UserHandle;
+
+import androidx.core.graphics.drawable.IconCompat;
+import androidx.slice.Slice;
+import androidx.slice.builders.ListBuilder;
+import androidx.slice.builders.ListBuilder.RowBuilder;
+import androidx.slice.builders.SliceAction;
+
+import com.android.settings.R;
+import com.android.settings.SubSettings;
+import com.android.settings.Utils;
+import com.android.settings.biometrics.face.FaceStatusPreferenceController;
+import com.android.settings.security.SecuritySettings;
+import com.android.settings.slices.CustomSliceRegistry;
+import com.android.settings.slices.CustomSliceable;
+import com.android.settings.slices.SliceBuilderUtils;
+
+public class FaceSetupSlice implements CustomSliceable {
+
+    private final Context mContext;
+
+    public FaceSetupSlice(Context context) {
+        mContext = context;
+    }
+
+    @Override
+    public Slice getSlice() {
+        final FaceManager faceManager = Utils.getFaceManagerOrNull(mContext);
+        if (faceManager == null || faceManager.hasEnrolledTemplates(UserHandle.myUserId())) {
+            return null;
+        }
+
+        final CharSequence title = mContext.getText(
+                R.string.security_settings_face_settings_enroll);
+        final ListBuilder listBuilder = new ListBuilder(mContext,
+                CustomSliceRegistry.FACE_ENROLL_SLICE_URI, ListBuilder.INFINITY)
+                .setAccentColor(Utils.getColorAccentDefaultColor(mContext));
+        final IconCompat icon = IconCompat.createWithResource(mContext, R.drawable.ic_face_24dp);
+        return listBuilder
+                .addRow(buildRowBuilder(title,
+                        mContext.getText(R.string.security_settings_face_settings_context_subtitle),
+                        icon, mContext, getIntent()))
+                .build();
+    }
+
+    @Override
+    public Uri getUri() {
+        return CustomSliceRegistry.FACE_ENROLL_SLICE_URI;
+    }
+
+    @Override
+    public Intent getIntent() {
+        return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
+                SecuritySettings.class.getName(),
+                FaceStatusPreferenceController.KEY_FACE_SETTINGS,
+                mContext.getText(R.string.security_settings_face_settings_enroll).toString(),
+                SettingsEnums.SLICE)
+                .setClassName(mContext.getPackageName(), SubSettings.class.getName());
+    }
+
+    private static RowBuilder buildRowBuilder(CharSequence title, CharSequence subTitle,
+            IconCompat icon, Context context, Intent intent) {
+        final SliceAction primarySliceAction = SliceAction.createDeeplink(
+                PendingIntent.getActivity(context, 0, intent, 0), icon, ListBuilder.ICON_IMAGE,
+                title);
+        return new RowBuilder()
+                .setTitleItem(icon, ListBuilder.ICON_IMAGE)
+                .setTitle(title)
+                .setSubtitle(subTitle)
+                .setPrimaryAction(primarySliceAction);
+    }
+}
\ No newline at end of file
diff --git a/src/com/android/settings/network/TetherProvisioningActivity.java b/src/com/android/settings/network/TetherProvisioningActivity.java
index 48c5707..53a86cb 100644
--- a/src/com/android/settings/network/TetherProvisioningActivity.java
+++ b/src/com/android/settings/network/TetherProvisioningActivity.java
@@ -55,7 +55,7 @@
 
         final int tetherSubId = getIntent().getIntExtra(EXTRA_SUBID,
                 SubscriptionManager.INVALID_SUBSCRIPTION_ID);
-        final int subId = SubscriptionManager.getDefaultDataSubscriptionId();
+        final int subId = SubscriptionManager.getActiveDataSubscriptionId();
         if (tetherSubId != subId) {
             Log.e(TAG, "This Provisioning request is outdated, current subId: " + subId);
             return;
@@ -67,6 +67,7 @@
         final Intent intent = new Intent(Intent.ACTION_MAIN);
         intent.setClassName(provisionApp[0], provisionApp[1]);
         intent.putExtra(EXTRA_TETHER_TYPE, tetherType);
+        intent.putExtra(SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX, subId);
         if (DEBUG) {
             Log.d(TAG, "Starting provisioning app: " + provisionApp[0] + "." + provisionApp[1]);
         }
diff --git a/src/com/android/settings/password/SetupChooseLockGeneric.java b/src/com/android/settings/password/SetupChooseLockGeneric.java
index 9a165297..aa17f8e 100644
--- a/src/com/android/settings/password/SetupChooseLockGeneric.java
+++ b/src/com/android/settings/password/SetupChooseLockGeneric.java
@@ -111,7 +111,7 @@
 
             layout.setIcon(getContext().getDrawable(R.drawable.ic_lock));
 
-            int titleResource = mForFingerprint ?
+            int titleResource = isForBiometric() ?
                     R.string.lock_settings_picker_title : R.string.setup_lock_settings_picker_title;
             if (getActivity() != null) {
                 getActivity().setTitle(titleResource);
@@ -125,7 +125,7 @@
 
         @Override
         protected void addHeaderView() {
-            if (mForFingerprint || mForFace) {
+            if (isForBiometric()) {
                 setHeaderView(R.layout.setup_choose_lock_generic_biometrics_header);
             } else {
                 setHeaderView(R.layout.setup_choose_lock_generic_header);
@@ -183,7 +183,7 @@
 
         @Override
         protected void addPreferences() {
-            if (mForFingerprint) {
+            if (isForBiometric()) {
                 super.addPreferences();
             } else {
                 addPreferencesFromResource(R.xml.setup_security_settings_picker);
@@ -240,6 +240,10 @@
             SetupWizardUtils.copySetupExtras(getActivity().getIntent(), intent);
             return intent;
         }
+
+        private boolean isForBiometric() {
+            return mForFingerprint || mForFace;
+        }
     }
 
     public static class InternalActivity extends ChooseLockGeneric.InternalActivity {
@@ -261,5 +265,4 @@
             }
         }
     }
-
 }
diff --git a/src/com/android/settings/privacy/EnableContentCaptureWithServiceSettingsPreferenceController.java b/src/com/android/settings/privacy/EnableContentCaptureWithServiceSettingsPreferenceController.java
index 809bfbd..77aab34 100644
--- a/src/com/android/settings/privacy/EnableContentCaptureWithServiceSettingsPreferenceController.java
+++ b/src/com/android/settings/privacy/EnableContentCaptureWithServiceSettingsPreferenceController.java
@@ -96,18 +96,23 @@
             for (UserInfo info: userInfos) {
                 userHandles.add(info.getUserHandle());
             }
-
-            AlertDialog.Builder builder = new AlertDialog.Builder(context);
-            UserAdapter adapter = UserAdapter.createUserAdapter(userManager, context, userHandles);
-            builder.setTitle(com.android.settingslib.R.string.choose_profile)
-                    .setAdapter(adapter, (DialogInterface dialog, int which) -> {
-                        final UserHandle user = userHandles.get(which);
-                        // Show menu on top level items.
-                        final Intent intent = pref.getIntent();
-                        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
-                        context.startActivityAsUser(intent, user);
-                    })
-                    .show();
+            if (userHandles.size() == 1) {
+                final Intent intent = pref.getIntent().addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
+                context.startActivityAsUser(intent, userHandles.get(0));
+            } else {
+                AlertDialog.Builder builder = new AlertDialog.Builder(context);
+                UserAdapter adapter = UserAdapter.createUserAdapter(userManager, context,
+                        userHandles);
+                builder.setTitle(com.android.settingslib.R.string.choose_profile)
+                        .setAdapter(adapter, (DialogInterface dialog, int which) -> {
+                            final UserHandle user = userHandles.get(which);
+                            // Show menu on top level items.
+                            final Intent intent = pref.getIntent()
+                                    .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
+                            context.startActivityAsUser(intent, user);
+                        })
+                        .show();
+            }
         }
     }
 
diff --git a/src/com/android/settings/slices/CustomSliceRegistry.java b/src/com/android/settings/slices/CustomSliceRegistry.java
index dc3324b..946a9d3 100644
--- a/src/com/android/settings/slices/CustomSliceRegistry.java
+++ b/src/com/android/settings/slices/CustomSliceRegistry.java
@@ -26,6 +26,7 @@
 
 import androidx.annotation.VisibleForTesting;
 
+import com.android.settings.display.AdaptiveSleepPreferenceController;
 import com.android.settings.flashlight.FlashlightSlice;
 import com.android.settings.fuelgauge.batterytip.BatteryTipPreferenceController;
 import com.android.settings.homepage.contextualcards.deviceinfo.DataUsageSlice;
@@ -34,7 +35,9 @@
 import com.android.settings.homepage.contextualcards.deviceinfo.StorageSlice;
 import com.android.settings.homepage.contextualcards.slices.BatteryFixSlice;
 import com.android.settings.homepage.contextualcards.slices.BluetoothDevicesSlice;
+import com.android.settings.homepage.contextualcards.slices.ContextualAdaptiveSleepSlice;
 import com.android.settings.homepage.contextualcards.slices.ContextualNotificationChannelSlice;
+import com.android.settings.homepage.contextualcards.slices.FaceSetupSlice;
 import com.android.settings.homepage.contextualcards.slices.LowStorageSlice;
 import com.android.settings.homepage.contextualcards.slices.NotificationChannelSlice;
 import com.android.settings.location.LocationSlice;
@@ -65,6 +68,16 @@
             .build();
 
     /**
+     *  Uri for Contextual Adaptive Sleep Slice
+     */
+    public static final Uri CONTEXTUAL_ADAPTIVE_SLEEP_URI = new Uri.Builder()
+            .scheme(ContentResolver.SCHEME_CONTENT)
+            .authority(SettingsSliceProvider.SLICE_AUTHORITY)
+            .appendPath(SettingsSlicesContract.PATH_SETTING_INTENT)
+            .appendPath(AdaptiveSleepPreferenceController.PREF_NAME)
+            .build();
+
+    /**
      * Uri for Battery Fix Slice.
      */
     public static final Uri BATTERY_FIX_SLICE_URI = new Uri.Builder()
@@ -151,6 +164,15 @@
             .appendPath("enhanced_4g_lte")
             .build();
     /**
+     * Slice Uri for Face Enrollment
+     */
+    public static final Uri FACE_ENROLL_SLICE_URI = new Uri.Builder()
+            .scheme(ContentResolver.SCHEME_CONTENT)
+            .authority(SettingsSliceProvider.SLICE_AUTHORITY)
+            .appendPath(SettingsSlicesContract.PATH_SETTING_ACTION)
+            .appendPath("face_unlock_greeting_card")
+            .build();
+    /**
      * Backing Uri for the Flashlight Slice.
      */
     public static final Uri FLASHLIGHT_SLICE_URI = new Uri.Builder()
@@ -328,21 +350,23 @@
 
         sUriToSlice.put(BATTERY_FIX_SLICE_URI, BatteryFixSlice.class);
         sUriToSlice.put(BLUETOOTH_DEVICES_SLICE_URI, BluetoothDevicesSlice.class);
+        sUriToSlice.put(CONTEXTUAL_ADAPTIVE_SLEEP_URI, ContextualAdaptiveSleepSlice.class);
         sUriToSlice.put(CONTEXTUAL_NOTIFICATION_CHANNEL_SLICE_URI,
                 ContextualNotificationChannelSlice.class);
         sUriToSlice.put(CONTEXTUAL_WIFI_SLICE_URI, ContextualWifiSlice.class);
         sUriToSlice.put(DATA_USAGE_SLICE_URI, DataUsageSlice.class);
         sUriToSlice.put(DEVICE_INFO_SLICE_URI, DeviceInfoSlice.class);
         sUriToSlice.put(EMERGENCY_INFO_SLICE_URI, EmergencyInfoSlice.class);
+        sUriToSlice.put(FACE_ENROLL_SLICE_URI, FaceSetupSlice.class);
         sUriToSlice.put(FLASHLIGHT_SLICE_URI, FlashlightSlice.class);
         sUriToSlice.put(LOCATION_SLICE_URI, LocationSlice.class);
         sUriToSlice.put(LOW_STORAGE_SLICE_URI, LowStorageSlice.class);
+        sUriToSlice.put(MEDIA_OUTPUT_INDICATOR_SLICE_URI, MediaOutputIndicatorSlice.class);
+        sUriToSlice.put(MEDIA_OUTPUT_SLICE_URI, MediaOutputSlice.class);
         sUriToSlice.put(MOBILE_DATA_SLICE_URI, MobileDataSlice.class);
         sUriToSlice.put(NOTIFICATION_CHANNEL_SLICE_URI, NotificationChannelSlice.class);
         sUriToSlice.put(STORAGE_SLICE_URI, StorageSlice.class);
         sUriToSlice.put(WIFI_SLICE_URI, WifiSlice.class);
-        sUriToSlice.put(MEDIA_OUTPUT_SLICE_URI, MediaOutputSlice.class);
-        sUriToSlice.put(MEDIA_OUTPUT_INDICATOR_SLICE_URI, MediaOutputIndicatorSlice.class);
     }
 
     public static Class<? extends CustomSliceable> getSliceClassByUri(Uri uri) {
diff --git a/src/com/android/settings/wifi/tether/TetherService.java b/src/com/android/settings/wifi/tether/TetherService.java
index 34daccf..058bba7 100644
--- a/src/com/android/settings/wifi/tether/TetherService.java
+++ b/src/com/android/settings/wifi/tether/TetherService.java
@@ -85,7 +85,7 @@
     public void onCreate() {
         super.onCreate();
         if (DEBUG) Log.d(TAG, "Creating TetherService");
-        String provisionResponse = getResourceForDefaultDataSubId().getString(
+        String provisionResponse = getResourceForActiveDataSubId().getString(
                 com.android.internal.R.string.config_mobile_hotspot_provision_response);
         registerReceiver(mReceiver, new IntentFilter(provisionResponse),
                 android.Manifest.permission.CONNECTIVITY_INTERNAL, null);
@@ -105,7 +105,7 @@
         if (intent.hasExtra(EXTRA_SUBID)) {
             final int tetherSubId = intent.getIntExtra(EXTRA_SUBID,
                     SubscriptionManager.INVALID_SUBSCRIPTION_ID);
-            final int subId = getTetherServiceWrapper().getDefaultDataSubscriptionId();
+            final int subId = getTetherServiceWrapper().getActiveDataSubscriptionId();
             if (tetherSubId != subId) {
                 Log.e(TAG, "This Provisioning request is outdated, current subId: " + subId);
                 if (!mInProvisionCheck) {
@@ -273,11 +273,13 @@
     }
 
     private Intent getProvisionBroadcastIntent(int index) {
-        String provisionAction = getResourceForDefaultDataSubId().getString(
+        String provisionAction = getResourceForActiveDataSubId().getString(
                 com.android.internal.R.string.config_mobile_hotspot_provision_app_no_ui);
+        final int subId = getTetherServiceWrapper().getActiveDataSubscriptionId();
         Intent intent = new Intent(provisionAction);
         int type = mCurrentTethers.get(index);
         intent.putExtra(TETHER_CHOICE, type);
+        intent.putExtra(SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX, subId);
         intent.setFlags(Intent.FLAG_RECEIVER_FOREGROUND
                 | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
 
@@ -309,7 +311,7 @@
 
         PendingIntent pendingIntent = PendingIntent.getService(this, 0, intent, 0);
         AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
-        int period = getResourceForDefaultDataSubId().getInteger(
+        int period = getResourceForActiveDataSubId().getInteger(
                 com.android.internal.R.integer.config_mobile_hotspot_provision_check_period);
         long periodMs = period * MS_PER_HOUR;
         long firstTime = SystemClock.elapsedRealtime() + periodMs;
@@ -362,7 +364,7 @@
         @Override
         public void onReceive(Context context, Intent intent) {
             if (DEBUG) Log.d(TAG, "Got provision result " + intent);
-            String provisionResponse = getResourceForDefaultDataSubId().getString(
+            String provisionResponse = getResourceForActiveDataSubId().getString(
                     com.android.internal.R.string.config_mobile_hotspot_provision_response);
 
             if (provisionResponse.equals(intent.getAction())) {
@@ -429,14 +431,14 @@
             mUsageStatsManager.setAppInactive(packageName, isInactive);
         }
 
-        int getDefaultDataSubscriptionId() {
-            return SubscriptionManager.getDefaultDataSubscriptionId();
+        int getActiveDataSubscriptionId() {
+            return SubscriptionManager.getActiveDataSubscriptionId();
         }
     }
 
     @VisibleForTesting
-    Resources getResourceForDefaultDataSubId() {
-        final int subId = getTetherServiceWrapper().getDefaultDataSubscriptionId();
+    Resources getResourceForActiveDataSubId() {
+        final int subId = getTetherServiceWrapper().getActiveDataSubscriptionId();
         return Utils.getResourcesForSubId(this, subId);
     }
 }
diff --git a/tests/robotests/res/values/overlayable_icons_test.xml b/tests/robotests/res/values/overlayable_icons_test.xml
index bf87f3b..0dab9cf 100644
--- a/tests/robotests/res/values/overlayable_icons_test.xml
+++ b/tests/robotests/res/values/overlayable_icons_test.xml
@@ -26,8 +26,6 @@
     <item>@drawable/ic_arrow_back</item>
     <item>@drawable/ic_arrow_down_24dp</item>
     <item>@drawable/ic_battery_charging_full</item>
-    <item>@drawable/ic_battery_saver_accent_24dp</item>
-    <item>@drawable/ic_battery_status_bad_24dp</item>
     <item>@drawable/ic_battery_status_good_24dp</item>
     <item>@drawable/ic_battery_status_maybe_24dp</item>
     <item>@drawable/ic_call_24dp</item>
@@ -38,13 +36,13 @@
     <item>@drawable/ic_content_copy_grey600_24dp</item>
     <item>@drawable/ic_data_saver</item>
     <item>@drawable/ic_delete</item>
-    <item>@drawable/ic_delete_accent</item>
     <item>@drawable/ic_devices_other</item>
     <item>@drawable/ic_devices_other_opaque_black</item>
     <item>@drawable/ic_do_not_disturb_on_24dp</item>
     <item>@drawable/ic_eject_24dp</item>
     <item>@drawable/ic_expand_less</item>
     <item>@drawable/ic_expand_more_inverse</item>
+    <item>@drawable/ic_find_in_page_24px</item>
     <item>@drawable/ic_folder_vd_theme_24</item>
     <item>@drawable/ic_friction_lock_closed</item>
     <item>@drawable/ic_gray_scale_24dp</item>
@@ -71,9 +69,13 @@
     <item>@drawable/ic_settings_data_usage</item>
     <item>@drawable/ic_settings_date_time</item>
     <item>@drawable/ic_settings_delete</item>
+    <item>@drawable/ic_settings_disable</item>
     <item>@drawable/ic_settings_display_white</item>
+    <item>@drawable/ic_settings_enable</item>
     <item>@drawable/ic_settings_home</item>
+    <item>@drawable/ic_settings_language</item>
     <item>@drawable/ic_settings_location</item>
+    <item>@drawable/ic_settings_multiuser</item>
     <item>@drawable/ic_settings_night_display</item>
     <item>@drawable/ic_settings_open</item>
     <item>@drawable/ic_settings_print</item>
@@ -82,15 +84,16 @@
     <item>@drawable/ic_settings_sim</item>
     <item>@drawable/ic_settings_system_dashboard_white</item>
     <item>@drawable/ic_settings_wireless</item>
-    <item>@drawable/ic_settings_wireless_white</item>
     <item>@drawable/ic_storage</item>
     <item>@drawable/ic_storage_white</item>
     <item>@drawable/ic_suggestion_night_display</item>
     <item>@drawable/ic_sync</item>
+    <item>@drawable/ic_sync_problem_24dp</item>
     <item>@drawable/ic_system_update</item>
     <item>@drawable/ic_videogame_vd_theme_24</item>
     <item>@drawable/ic_volume_ringer_vibrate</item>
     <item>@drawable/ic_volume_up_24dp</item>
     <item>@drawable/ic_vpn_key</item>
+    <item>@drawable/ic_wifi_tethering</item>
   </array>
 </resources>
diff --git a/tests/robotests/src/com/android/settings/biometrics/face/FaceSettingsLockscreenBypassPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/biometrics/face/FaceSettingsLockscreenBypassPreferenceControllerTest.java
new file mode 100644
index 0000000..cbcebfc
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/biometrics/face/FaceSettingsLockscreenBypassPreferenceControllerTest.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.settings.biometrics.face;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.hardware.face.FaceManager;
+import android.provider.Settings;
+
+import androidx.preference.SwitchPreference;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+import org.robolectric.util.ReflectionHelpers;
+
+@RunWith(RobolectricTestRunner.class)
+public class FaceSettingsLockscreenBypassPreferenceControllerTest {
+
+    @Mock
+    private FaceManager mFaceManager;
+    private SwitchPreference mPreference;
+
+    private Context mContext;
+    private FaceSettingsLockscreenBypassPreferenceController mController;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        mContext = RuntimeEnvironment.application;
+        mPreference = new SwitchPreference(mContext);
+
+        mController = new FaceSettingsLockscreenBypassPreferenceController(mContext);
+        ReflectionHelpers.setField(mController, "mFaceManager", mFaceManager);
+    }
+
+    @Test
+    public void isAvailable_whenHardwareDetected() {
+        assertThat(mController.isAvailable()).isFalse();
+        when(mFaceManager.isHardwareDetected()).thenReturn(true);
+        assertThat(mController.isAvailable()).isTrue();
+    }
+
+    @Test
+    public void onPreferenceChange_settingIsUpdated() {
+        boolean defaultValue = mContext.getResources().getBoolean(
+                com.android.internal.R.bool.config_faceAuthDismissesKeyguard);
+        boolean state = Settings.Secure.getInt(mContext.getContentResolver(),
+                Settings.Secure.FACE_UNLOCK_DISMISSES_KEYGUARD, defaultValue ? 1 : 0) != 0;
+
+        assertThat(mController.onPreferenceChange(mPreference, !state)).isTrue();
+        boolean newState = Settings.Secure.getInt(mContext.getContentResolver(),
+                Settings.Secure.FACE_UNLOCK_DISMISSES_KEYGUARD, 0) != 0;
+        assertThat(newState).isEqualTo(!state);
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/display/AdaptiveSleepPermissionPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/display/AdaptiveSleepPermissionPreferenceControllerTest.java
new file mode 100644
index 0000000..f2edf98
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/display/AdaptiveSleepPermissionPreferenceControllerTest.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.settings.display;
+
+import static com.android.settings.core.BasePreferenceController.AVAILABLE_UNSEARCHABLE;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.verify;
+
+import android.Manifest;
+import android.content.Context;
+import android.content.pm.PackageManager;
+
+import androidx.preference.Preference;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+
+@RunWith(RobolectricTestRunner.class)
+public class AdaptiveSleepPermissionPreferenceControllerTest {
+    private final static String PACKAGE_NAME = "package_name";
+    private AdaptiveSleepPermissionPreferenceController mController;
+    @Mock
+    private PackageManager mPackageManager;
+    @Mock
+    private Preference mPreference;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        Context context = Mockito.spy(RuntimeEnvironment.application);
+        doReturn(mPackageManager).when(context).getPackageManager();
+        doReturn(PACKAGE_NAME).when(mPackageManager).getAttentionServicePackageName();
+        doReturn(PackageManager.PERMISSION_GRANTED).when(mPackageManager).checkPermission(
+                Manifest.permission.CAMERA, PACKAGE_NAME);
+        mController = new AdaptiveSleepPermissionPreferenceController(context, "test_key");
+        doReturn(mController.getPreferenceKey()).when(mPreference).getKey();
+    }
+
+    @Test
+    public void getAvailabilityStatus_returnAvailableUnsearchable() {
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE_UNSEARCHABLE);
+    }
+
+    @Test
+    public void updateStates_permissionGranted_preferenceInvisible() {
+        mController.updateState(mPreference);
+
+        verify(mPreference).setVisible(false);
+    }
+
+    @Test
+    public void updateStates_permissionRevoked_preferenceVisible() {
+        doReturn(PackageManager.PERMISSION_DENIED).when(mPackageManager).checkPermission(
+                Manifest.permission.CAMERA, PACKAGE_NAME);
+
+        mController.updateState(mPreference);
+
+        verify(mPreference).setVisible(true);
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/ContextualAdaptiveSleepSliceTest.java b/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/ContextualAdaptiveSleepSliceTest.java
new file mode 100644
index 0000000..54fb2c3
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/ContextualAdaptiveSleepSliceTest.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.settings.homepage.contextualcards.slices;
+
+import static com.android.settings.homepage.contextualcards.slices.ContextualAdaptiveSleepSlice.DEFERRED_TIME_DAYS;
+import static com.android.settings.homepage.contextualcards.slices.ContextualAdaptiveSleepSlice.PREF;
+import static com.android.settings.homepage.contextualcards.slices.ContextualAdaptiveSleepSlice.PREF_KEY_SETUP_TIME;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.anyLong;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.spy;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.content.pm.PackageManager;
+import android.net.Uri;
+
+import androidx.slice.Slice;
+import androidx.slice.SliceProvider;
+import androidx.slice.widget.SliceLiveData;
+
+import com.android.settings.slices.CustomSliceRegistry;
+
+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 ContextualAdaptiveSleepSliceTest {
+
+    private static final String pkgName = "adaptive_sleep";
+    private Context mContext;
+    private ContextualAdaptiveSleepSlice mContextualAdaptiveSleepSlice;
+    @Mock
+    private PackageManager mPackageManager;
+    @Mock
+    private SharedPreferences mSharedPreferences;
+
+    @Before
+    public void setup() {
+        MockitoAnnotations.initMocks(this);
+        SliceProvider.setSpecs(SliceLiveData.SUPPORTED_SPECS);
+        mContext = spy(RuntimeEnvironment.application);
+        mContextualAdaptiveSleepSlice = spy(new ContextualAdaptiveSleepSlice(mContext));
+
+        doReturn(mPackageManager).when(mContext).getPackageManager();
+        doReturn(mSharedPreferences).when(mContext).getSharedPreferences(eq(PREF), anyInt());
+        doReturn(true).when(mContextualAdaptiveSleepSlice).isSettingsAvailable();
+        doReturn(pkgName).when(mPackageManager).getAttentionServicePackageName();
+        doReturn(-DEFERRED_TIME_DAYS).when(mSharedPreferences).getLong(eq(PREF_KEY_SETUP_TIME),
+                anyLong());
+    }
+
+    @Test
+    public void getUri_shouldReturnContextualAdaptiveSleepSliceUri() {
+        final Uri uri = mContextualAdaptiveSleepSlice.getUri();
+
+        assertThat(uri).isEqualTo(CustomSliceRegistry.CONTEXTUAL_ADAPTIVE_SLEEP_URI);
+    }
+
+    @Test
+    public void getSlice_ShowIfFeatureIsAvailable() {
+        final Slice slice = mContextualAdaptiveSleepSlice.getSlice();
+
+        assertThat(slice).isNotNull();
+    }
+
+    @Test
+    public void getSlice_DoNotShowIfFeatureIsUnavailable() {
+        doReturn(false).when(mContextualAdaptiveSleepSlice).isSettingsAvailable();
+
+        final Slice slice = mContextualAdaptiveSleepSlice.getSlice();
+
+        assertThat(slice).isNull();
+    }
+
+    @Test
+    public void getSlice_ShowIfNotRecentlySetup() {
+        final Slice slice = mContextualAdaptiveSleepSlice.getSlice();
+
+        assertThat(slice).isNotNull();
+    }
+
+    @Test
+    public void getSlice_DoNotShowIfRecentlySetup() {
+        doReturn(System.currentTimeMillis()).when(mSharedPreferences).getLong(
+                eq(PREF_KEY_SETUP_TIME), anyLong());
+
+        final Slice slice = mContextualAdaptiveSleepSlice.getSlice();
+
+        assertThat(slice).isNull();
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/FaceSetupSliceTest.java b/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/FaceSetupSliceTest.java
new file mode 100644
index 0000000..71b5c7a
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/FaceSetupSliceTest.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.settings.homepage.contextualcards.slices;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.hardware.face.FaceManager;
+import android.os.UserHandle;
+
+import androidx.slice.Slice;
+import androidx.slice.SliceProvider;
+import androidx.slice.widget.SliceLiveData;
+
+import com.android.settings.R;
+import com.android.settings.Utils;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+
+@RunWith(RobolectricTestRunner.class)
+public class FaceSetupSliceTest {
+
+    private Context mContext;
+    private PackageManager mPackageManager;
+
+    @Before
+    public void setUp() {
+        // Set-up specs for SliceMetadata.
+        SliceProvider.setSpecs(SliceLiveData.SUPPORTED_SPECS);
+        mContext = spy(RuntimeEnvironment.application);
+        mPackageManager = mock(PackageManager.class);
+        when(mContext.getPackageManager()).thenReturn(mPackageManager);
+    }
+
+    @Test
+    public void getSlice_noFaceManager_shouldReturnNull() {
+        when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_FACE)).thenReturn(false);
+        final FaceSetupSlice setupSlice = new FaceSetupSlice(mContext);
+        assertThat(setupSlice.getSlice()).isNull();
+    }
+
+    @Test
+    public void getSlice_faceEnrolled_shouldReturnNull() {
+        final FaceManager faceManager = mock(FaceManager.class);
+        when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_FACE)).thenReturn(true);
+        when(faceManager.hasEnrolledTemplates(UserHandle.myUserId())).thenReturn(true);
+        when(mContext.getSystemService(Context.FACE_SERVICE)).thenReturn(faceManager);
+        final FaceSetupSlice setupSlice = new FaceSetupSlice(mContext);
+        assertThat(setupSlice.getSlice()).isNull();
+    }
+
+    @Test
+    public void getSlice_faceNotEnrolled_shouldReturnNonNull() {
+        final FaceManager faceManager = mock(FaceManager.class);
+        when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_FACE)).thenReturn(true);
+        when(faceManager.hasEnrolledTemplates(UserHandle.myUserId())).thenReturn(false);
+        when(mContext.getSystemService(Context.FACE_SERVICE)).thenReturn(faceManager);
+        final FaceSetupSlice setupSlice = new FaceSetupSlice(mContext);
+        assertThat(setupSlice.getSlice()).isNotNull();
+    }
+}
\ No newline at end of file
diff --git a/tests/unit/src/com/android/settings/wifi/tether/TetherServiceTest.java b/tests/unit/src/com/android/settings/wifi/tether/TetherServiceTest.java
index 0739ef0..24d1bcc 100644
--- a/tests/unit/src/com/android/settings/wifi/tether/TetherServiceTest.java
+++ b/tests/unit/src/com/android/settings/wifi/tether/TetherServiceTest.java
@@ -458,7 +458,7 @@
         }
 
         @Override
-        int getDefaultDataSubscriptionId() {
+        int getActiveDataSubscriptionId() {
             return INVALID_SUBSCRIPTION_ID;
         }
     }