Merge "Ensure text is visible when choosing pattern" into mnc-dev
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 68bf811..5f1f14c 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -767,7 +767,6 @@
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.DEFAULT" />
-                <category android:name="com.android.settings.SHORTCUT" />
             </intent-filter>
             <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
                 android:value="com.android.settings.notification.ZenModeScheduleRuleSettings" />
@@ -787,7 +786,6 @@
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.DEFAULT" />
-                <category android:name="com.android.settings.SHORTCUT" />
             </intent-filter>
             <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
                 android:value="com.android.settings.notification.ZenModeEventRuleSettings" />
@@ -807,7 +805,6 @@
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.DEFAULT" />
-                <category android:name="com.android.settings.SHORTCUT" />
             </intent-filter>
             <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
                 android:value="com.android.settings.notification.ZenModeExternalRuleSettings" />
@@ -926,6 +923,19 @@
                 android:value="true" />
         </activity>
 
+        <activity android:name="Settings$MemorySettingsActivity"
+                android:label="@string/memory_settings_title"
+                android:taskAffinity="">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="com.android.settings.SHORTCUT" />
+            </intent-filter>
+            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
+                android:value="com.android.settings.applications.ProcessStatsSummary" />
+            <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
+                android:resource="@id/manage_memory" />
+        </activity>
+
         <activity android:name="Settings$AllApplicationsActivity"
                 android:label="@string/applications_settings"
                 android:taskAffinity="">
@@ -944,6 +954,11 @@
         <activity android:name="Settings$HighPowerApplicationsActivity"
                 android:label="@string/high_power_apps"
                 android:taskAffinity="">
+            <intent-filter android:priority="1">
+                <action android:name="android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS" />
+                <category android:name="android.intent.category.DEFAULT" />
+                <data android:scheme="package" />
+            </intent-filter>
             <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
                 android:value="com.android.settings.applications.ManageApplications" />
             <meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
@@ -1410,7 +1425,7 @@
             android:theme="@style/Theme.ConfirmDeviceCredentials"/>
 
         <activity android:name="ConfirmLockPassword"
-            android:windowSoftInputMode="adjustResize"
+            android:windowSoftInputMode="stateHidden|adjustResize"
             android:theme="@style/Theme.ConfirmDeviceCredentials"/>
 
         <activity android:name=".fingerprint.FingerprintSettings" android:exported="false"/>
@@ -2472,6 +2487,11 @@
                 android:resource="@id/sim_settings" />
         </activity>
 
+        <activity android:name=".sim.SimPreferenceDialog"
+            android:theme="@android:style/Theme.Material.Light.Dialog.NoActionBar"
+            android:excludeFromRecents="true">
+        </activity>
+
         <activity android:name=".sim.SimDialogActivity"
                 android:theme="@android:style/Theme.Material.Light.Dialog.NoActionBar"
                 android:label="@string/sim_settings_title"
diff --git a/res/anim/confirm_credential_close_enter.xml b/res/anim/confirm_credential_close_enter.xml
new file mode 100644
index 0000000..fcc3241
--- /dev/null
+++ b/res/anim/confirm_credential_close_enter.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2015 The Android Open Source Project
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License
+  -->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shareInterpolator="false"
+    android:zAdjustment="top">
+  <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
+      android:interpolator="@*android:interpolator/decelerate_quart"
+      android:fillEnabled="true"
+      android:fillBefore="false" android:fillAfter="true"
+      android:duration="200"/>
+  <translate android:fromYDelta="8%" android:toYDelta="0"
+      android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true"
+      android:interpolator="@*android:interpolator/decelerate_quint"
+      android:duration="350"/>
+</set>
diff --git a/res/anim/confirm_credential_close_exit.xml b/res/anim/confirm_credential_close_exit.xml
new file mode 100644
index 0000000..5afd8b2
--- /dev/null
+++ b/res/anim/confirm_credential_close_exit.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2015 The Android Open Source Project
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License
+  -->
+
+<alpha xmlns:android="http://schemas.android.com/apk/res/android"
+    android:interpolator="@android:interpolator/linear_out_slow_in"
+    android:fromAlpha="1.0" android:toAlpha="0.0"
+    android:duration="350" />
diff --git a/res/anim/confirm_credential_open_enter.xml b/res/anim/confirm_credential_open_enter.xml
new file mode 100644
index 0000000..06f3af8
--- /dev/null
+++ b/res/anim/confirm_credential_open_enter.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2015 The Android Open Source Project
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License
+  -->
+
+<alpha xmlns:android="http://schemas.android.com/apk/res/android"
+    android:interpolator="@android:interpolator/linear_out_slow_in"
+    android:fromAlpha="0.0" android:toAlpha="1.0"
+    android:duration="160" />
diff --git a/res/anim/confirm_credential_open_exit.xml b/res/anim/confirm_credential_open_exit.xml
new file mode 100644
index 0000000..3f20a04
--- /dev/null
+++ b/res/anim/confirm_credential_open_exit.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2015 The Android Open Source Project
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License
+  -->
+
+<alpha xmlns:android="http://schemas.android.com/apk/res/android"
+    android:fromAlpha="1.0" android:toAlpha="1.0"
+    android:duration="160" />
diff --git a/res/drawable-nodpi/fingerprint_indicator.png b/res/drawable-nodpi/fingerprint_indicator.png
deleted file mode 100644
index fc5ef0f..0000000
--- a/res/drawable-nodpi/fingerprint_indicator.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/shortcut_base.png b/res/drawable-xxxhdpi/shortcut_base.png
new file mode 100644
index 0000000..cd509df
--- /dev/null
+++ b/res/drawable-xxxhdpi/shortcut_base.png
Binary files differ
diff --git a/res/drawable/fp_illustration_enrollment.xml b/res/drawable/fp_illustration_enrollment.xml
new file mode 100644
index 0000000..f9b7ed4
--- /dev/null
+++ b/res/drawable/fp_illustration_enrollment.xml
@@ -0,0 +1,36 @@
+<!--
+Copyright (C) 2015 The Android Open Source Project
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="88.0dp"
+        android:height="88.0dp"
+        android:viewportWidth="88.0"
+        android:viewportHeight="88.0">
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M67.74,11.59c-0.41,0.0 -0.82,-0.1 -1.2,-0.31c-7.44,-4.06 -15.0,-6.04 -23.11,-6.04c-7.92,0.0 -14.67,1.85 -21.88,6.01c-1.2,0.69 -2.73,0.28 -3.42,-0.92s-0.28,-2.72 0.92,-3.41c7.9,-4.55 15.65,-6.68 24.37,-6.68c8.97,0.0 17.32,2.17 25.51,6.65c1.21,0.66 1.66,2.18 1.0,3.39C69.48,11.12 68.62,11.59 67.74,11.59z"/>
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M9.25,34.74c-0.48,0.0 -0.96,-0.14 -1.39,-0.42c-1.15,-0.77 -1.45,-2.32 -0.68,-3.47c4.09,-6.09 9.3,-10.89 15.49,-14.27c6.52,-3.55 13.91,-5.43 21.38,-5.43c7.44,0.0 14.8,1.86 21.3,5.39c6.17,3.35 11.38,8.12 15.47,14.16c0.77,1.14 0.47,2.7 -0.67,3.47c-1.14,0.77 -2.7,0.47 -3.47,-0.67c-3.64,-5.38 -8.25,-9.61 -13.71,-12.57c-5.77,-3.13 -12.31,-4.78 -18.92,-4.78c-6.63,0.0 -13.2,1.67 -18.98,4.82c-5.48,2.99 -10.1,7.25 -13.73,12.66C10.85,34.35 10.06,34.74 9.25,34.74z"/>
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M34.76,86.82c-0.67,0.0 -1.33,-0.27 -1.82,-0.79c-3.49,-3.72 -5.51,-6.25 -8.26,-11.45c-2.84,-5.35 -4.34,-11.88 -4.34,-18.86c0.0,-13.02 10.59,-23.61 23.61,-23.61c13.02,0.0 23.61,10.59 23.61,23.61c0.0,1.38 -1.12,2.5 -2.5,2.5s-2.5,-1.12 -2.5,-2.5c0.0,-10.26 -8.35,-18.61 -18.61,-18.61c-10.26,0.0 -18.61,8.35 -18.61,18.61c0.0,6.17 1.3,11.89 3.76,16.52c2.62,4.94 4.37,7.04 7.49,10.37c0.94,1.01 0.89,2.59 -0.11,3.53C35.99,86.6 35.38,86.82 34.76,86.82z"/>
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M64.28,78.84c-4.99,0.0 -9.35,-1.32 -12.98,-3.92c-6.17,-4.43 -9.86,-11.6 -9.86,-19.19c0.0,-1.38 1.12,-2.5 2.5,-2.5s2.5,1.12 2.5,2.5c0.0,5.98 2.91,11.64 7.77,15.13c2.8,2.01 6.09,2.98 10.06,2.98c0.97,0.0 2.57,-0.11 4.17,-0.4c1.36,-0.25 2.66,0.64 2.92,2.0c0.25,1.36 -0.64,2.66 -2.0,2.92C66.93,78.8 64.86,78.84 64.28,78.84z"/>
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M55.92,87.75c-0.23,0.0 -0.46,-0.03 -0.7,-0.1c-6.6,-1.91 -10.92,-4.49 -15.4,-9.2c-5.76,-6.06 -8.94,-14.13 -8.94,-22.72c0.0,-7.2 5.86,-13.05 13.05,-13.05c7.2,0.0 13.05,5.86 13.05,13.05c0.0,4.44 3.61,8.05 8.05,8.05s8.05,-3.61 8.05,-8.05c0.0,-16.08 -13.08,-29.16 -29.16,-29.16c-11.43,0.0 -21.86,6.73 -26.58,17.15c-1.57,3.48 -2.37,7.52 -2.37,12.01c0.0,3.36 0.28,8.62 2.71,15.49c0.46,1.3 -0.22,2.73 -1.52,3.19c-1.3,0.46 -2.73,-0.22 -3.19,-1.52c-2.02,-5.7 -3.0,-11.31 -3.0,-17.16c0.0,-5.21 0.95,-9.94 2.82,-14.07c5.52,-12.2 17.74,-20.09 31.13,-20.09c18.83,0.0 34.16,15.32 34.16,34.16c0.0,7.2 -5.86,13.05 -13.05,13.05S52.0,62.92 52.0,55.73c0.0,-4.44 -3.61,-8.05 -8.05,-8.05s-8.05,3.61 -8.05,8.05c0.0,7.3 2.69,14.15 7.56,19.28c3.86,4.06 7.43,6.18 13.17,7.84c1.33,0.38 2.09,1.77 1.71,3.1C58.01,87.04 57.01,87.75 55.92,87.75z"/>
+</vector>
diff --git a/res/drawable/ic_fingerprint_success.xml b/res/drawable/ic_fingerprint_success.xml
new file mode 100644
index 0000000..e800fae
--- /dev/null
+++ b/res/drawable/ic_fingerprint_success.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+  ~ Copyright (C) 2015 The Android Open Source Project
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License
+  -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="32.0dp"
+        android:height="32.0dp"
+        android:viewportWidth="40.0"
+        android:viewportHeight="40.0">
+    <path
+        android:pathData="M20.0,20.0m-20.0,0.0a20.0,20.0 0.0,1.0 1.0,40.0 0.0a20.0,20.0 0.0,1.0 1.0,-40.0 0.0"
+        android:fillColor="?android:attr/colorAccent"/>
+    <path
+        android:pathData="M11.2,21.41l1.63,-1.619999 4.17,4.169998 10.59,-10.589999 1.619999,1.63 -12.209999,12.209999z"
+        android:fillColor="#FFFFFF"/>
+</vector>
diff --git a/res/layout-land/fingerprint_enroll_enrolling.xml b/res/layout-land/fingerprint_enroll_enrolling.xml
index c60888b..4d02c07 100644
--- a/res/layout-land/fingerprint_enroll_enrolling.xml
+++ b/res/layout-land/fingerprint_enroll_enrolling.xml
@@ -69,7 +69,8 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_marginBottom="16dp"
-                android:layout_gravity="center_horizontal|bottom"/>
+                android:layout_gravity="center_horizontal|bottom"
+                android:visibility="invisible"/>
 
         </FrameLayout>
 
diff --git a/res/layout/data_usage_detail.xml b/res/layout/data_usage_detail.xml
index 914e8ca..5113139 100644
--- a/res/layout/data_usage_detail.xml
+++ b/res/layout/data_usage_detail.xml
@@ -116,7 +116,7 @@
             android:layout_weight="0.5" />
         <Button
             android:id="@+id/app_settings"
-            android:layout_width="0dp"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_weight="0.5"
             android:text="@string/data_usage_app_settings" />
diff --git a/res/layout/fingerprint_enroll_enrolling_base.xml b/res/layout/fingerprint_enroll_enrolling_base.xml
index 37e10ba..21221cf 100644
--- a/res/layout/fingerprint_enroll_enrolling_base.xml
+++ b/res/layout/fingerprint_enroll_enrolling_base.xml
@@ -66,7 +66,8 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginTop="24dp"
-            android:layout_gravity="center_horizontal"/>
+            android:layout_gravity="center_horizontal"
+            android:visibility="invisible"/>
 
     </LinearLayout>
 
diff --git a/res/layout/fingerprint_enroll_enrolling_content.xml b/res/layout/fingerprint_enroll_enrolling_content.xml
index 9fa503b..b3171a3 100644
--- a/res/layout/fingerprint_enroll_enrolling_content.xml
+++ b/res/layout/fingerprint_enroll_enrolling_content.xml
@@ -23,17 +23,13 @@
     android:layout_gravity="center_horizontal">
 
     <ImageView
-        android:layout_width="88dp"
-        android:layout_height="88dp"
-        android:layout_centerInParent="true"
-        android:src="@drawable/fingerprint_indicator" />
-
-    <ImageView
         android:id="@+id/fingerprint_animator"
         android:layout_width="88dp"
         android:layout_height="88dp"
         android:layout_centerInParent="true"
-        android:src="@drawable/enrollment_fingerprint_isolated_animation" />
+        android:background="@drawable/fp_illustration_enrollment"
+        android:backgroundTint="@color/fingerprint_indicator_background_resting"
+        android:src="@drawable/enrollment_fingerprint_isolated_animation"/>
 
     <ProgressBar
         android:id="@+id/fingerprint_progress_bar"
diff --git a/res/layout/fingerprint_enroll_finish_base.xml b/res/layout/fingerprint_enroll_finish_base.xml
index 981c9f0..1c66103 100644
--- a/res/layout/fingerprint_enroll_finish_base.xml
+++ b/res/layout/fingerprint_enroll_finish_base.xml
@@ -63,7 +63,6 @@
                 android:id="@+id/add_another_button"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_marginEnd="8dp"
                 android:text="@string/fingerprint_enroll_button_add" />
 
             <Button
diff --git a/res/layout/radio_with_summary.xml b/res/layout/radio_with_summary.xml
new file mode 100644
index 0000000..2010207
--- /dev/null
+++ b/res/layout/radio_with_summary.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2015 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<com.android.settings.CheckableLinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical"
+    android:minHeight="?android:attr/listPreferredItemHeightSmall">
+
+    <CheckedTextView
+        android:id="@android:id/title"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:textAppearance="?android:attr/textAppearanceMedium"
+        android:textColor="?android:attr/textColorAlertDialogListItem"
+        android:gravity="center_vertical"
+        android:paddingStart="20dp"
+        android:paddingEnd="?android:attr/dialogPreferredPadding"
+        android:drawableStart="?android:attr/listChoiceIndicatorSingle"
+        android:ellipsize="marquee" />
+
+
+    <TextView android:id="@+android:id/summary"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:paddingBottom="4dp"
+        android:paddingStart="52dp"
+        android:textAppearance="?android:attr/textAppearanceListItemSecondary"
+        android:textColor="?android:attr/textColorSecondary"
+        android:maxLines="10" />
+
+</com.android.settings.CheckableLinearLayout>
diff --git a/res/layout/shortcut_badge.xml b/res/layout/shortcut_badge.xml
new file mode 100644
index 0000000..117b386
--- /dev/null
+++ b/res/layout/shortcut_badge.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="@dimen/shortcut_size"
+    android:layout_height="@dimen/shortcut_size">
+
+    <ImageView
+        android:layout_width="@dimen/shortcut_size"
+        android:layout_height="@dimen/shortcut_size"
+        android:scaleType="fitXY"
+        android:src="@drawable/shortcut_base" />
+
+    <ImageView
+        android:id="@android:id/icon"
+        android:layout_width="@dimen/shortcut_size"
+        android:layout_height="@dimen/shortcut_size"
+        android:padding="12dp"
+        android:scaleType="fitXY" />
+
+</RelativeLayout>
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 36924ee..23d0582 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -1056,24 +1056,32 @@
     <!-- Titles for overlay display devices preference. [CHAR LIMIT=35] -->
     <string-array name="overlay_display_devices_entries">
         <item>None</item>
-        <item>720x480 mdpi</item>
-        <item>720x480 mdpi (secure)</item>
-        <item>1280x720 tvdpi</item>
-        <item>1280x720 tvdpi (secure)</item>
-        <item>1920x1080 xhdpi</item>
-        <item>1920x1080 xhdpi (secure)</item>
-        <item>1280x720 tvdpi and 1920x1080 xhdpi</item>
+        <item>480p</item>
+        <item>480p (secure)</item>
+        <item>720p</item>
+        <item>720p (secure)</item>
+        <item>1080p</item>
+        <item>1080p (secure)</item>
+        <item>4K</item>
+        <item>4K (secure)</item>
+        <item>4K (upscaled)</item>
+        <item>4K (upscaled, secure)</item>
+        <item>720p, 1080p (dual screen)</item>
     </string-array>
 
     <!-- Values for overlay display devices preference. -->
     <string-array name="overlay_display_devices_values" translatable="false" >
         <item></item>
-        <item>720x480/160</item>
-        <item>720x480/160,secure</item>
+        <item>720x480/142</item>
+        <item>720x480/142,secure</item>
         <item>1280x720/213</item>
         <item>1280x720/213,secure</item>
         <item>1920x1080/320</item>
         <item>1920x1080/320,secure</item>
+        <item>3840x2160/320</item>
+        <item>3840x2160/320,secure</item>
+        <item>1920x1080/320|3840x2160/640</item>
+        <item>1920x1080/320|3840x2160/640,secure</item>
         <item>1280x720/213;1920x1080/320</item>
     </string-array>
 
diff --git a/res/values/colors.xml b/res/values/colors.xml
index d0ef652..c874970 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -66,6 +66,8 @@
     <color name="fingerprint_message_color">#de000000</color>
     <color name="fingerprint_progress_ring">?android:attr/colorAccent</color>
     <color name="fingerprint_progress_ring_bg">#20000000</color>
+    <color name="fingerprint_indicator_background_resting">#12000000</color>
+    <color name="fingerprint_indicator_background_activated">#80009688</color>
 
     <color name="running_processes_system_ram">#ff384248</color>
     <color name="running_processes_apps_ram">#ff009587</color>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 5891438..c10e83f 100755
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -231,6 +231,8 @@
     <dimen name="fingerprint_find_sensor_graphic_size">200dp</dimen>
     <item name="fingerprint_illustration_aspect_ratio" format="float" type="dimen">2.6</item>
     <dimen name="fingerprint_decor_padding_top">0dp</dimen>
+    <dimen name="fingerprint_error_text_appear_distance">16dp</dimen>
+    <dimen name="fingerprint_error_text_disappear_distance">-8dp</dimen>
 
     <dimen name="confirm_credentials_security_method_margin">48dp</dimen>
     <dimen name="fab_size">56dp</dimen>
@@ -244,4 +246,7 @@
     <dimen name="mdm_app_info_height">72dp</dimen>
     <dimen name="mdm_app_info_padding_top_bottom">8dp</dimen>
     <dimen name="mdm_app_name_padding_left">16dp</dimen>
+
+    <dimen name="shortcut_size">40dp</dimen>
+    <dimen name="badge_size">10dp</dimen>
 </resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 1e48fa0..6a61aa0 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -25,6 +25,11 @@
     <!-- Strings for Dialog deny button -->
     <string name="deny">Deny</string>
 
+    <!-- Strings for Dialog close button [CHAR LIMIT=20] -->
+    <string name="dlg_close">Close</string>
+    <!-- Strings for Dialog switch button [CHAR LIMIT=20] -->
+    <string name="dlg_switch">Switch</string>
+
     <!-- Device Info --> <skip />
     <!-- Device Info screen. Used for a status item's value when the proper value is not known -->
     <string name="device_info_default">Unknown</string>
@@ -765,9 +770,21 @@
     <!-- Introduction message shown in fingerprint enrollment dialog, second item to describe what
          the user needs to do. -->
     <string name="security_settings_fingerprint_enroll_onboard_message_2">Add your fingerprint</string>
+    <!-- Introduction title shown in fingerprint enrollment to introduce the fingerprint feature[CHAR LIMIT=22] -->
+    <string name="security_settings_fingerprint_enroll_introduction_title">Unlock with fingerprint</string>
+    <!-- Introduction detail message shown in fingerprint enrollment dialog [CHAR LIMIT=NONE]-->
+    <string name="security_settings_fingerprint_enroll_introduction_message">Just touch the fingerprint sensor to unlock your phone, authorize purchases, or sign in to apps. Any fingerprints added to your phone will be able to do these things, so be careful who you add.</string>
+    <!-- Introduction detail message shown in fingerprint enrollment dialog to warn the user [CHAR LIMIT=NONE]-->
+    <string name="security_settings_fingerprint_enroll_introduction_message_warning">Note: Your fingerprint may be less secure than a strong pattern or PIN.</string>
+    <!-- Link text shown bellow the warning to learn morn about fingerprint risk [CHAR LIMIT=22]-->
+    <string name="security_settings_fingerprint_enroll_introduction_risk_link_text">Learn more</string>
+    <!-- Button text to cancel enrollment from the introduction [CHAR LIMIT=22] -->
+    <string name="security_settings_fingerprint_enroll_introduction_cancel">Cancel</string>
+    <!-- Button text to continue to the next screen from the introduction [CHAR LIMIT=22] -->
+    <string name="security_settings_fingerprint_enroll_introduction_continue">Continue</string>
     <!-- Introduction title shown in fingerprint enrollment dialog to locate the sensor [CHAR LIMIT=22] -->
     <string name="security_settings_fingerprint_enroll_find_sensor_title">Find the sensor</string>
-    <!-- Introduction detail message shown in fingerprint enrollment dialog -->
+    <!-- Message shown in fingerprint enrollment dialog to locate the sensor -->
     <string name="security_settings_fingerprint_enroll_find_sensor_message">
         Locate the fingerprint sensor on the back of your phone.</string>
     <!-- Content description of graphic that shows where the fingerprint of the device is [CHAR LIMIT=NONE] -->
@@ -806,6 +823,8 @@
     <string name="security_settings_fingerprint_enroll_disclaimer">In addition to unlocking your phone, you can also use your fingerprint to authorize purchases and app access. <annotation id="url">Learn more</annotation></string>
     <!-- Text shown in fingerprint settings explaining what the fingerprint can be used for in the case unlocking is disabled [CHAR LIMIT=NONE] -->
     <string name="security_settings_fingerprint_enroll_disclaimer_lockscreen_disabled">Screen lock option disabled. You can still use your fingerprint to authorize purchases and app access. <annotation id="url">Learn more</annotation></string>
+    <!-- Text shown in fingerprint enroll when we didn't observe progress for a few seconds. [CHAR LIMIT=100] -->
+    <string name="security_settings_fingerprint_enroll_lift_touch_again">Lift finger, then touch sensor again</string>
 
     <!-- Title of the preferences category for preference items to control encryption -->
     <string name="crypt_keeper_settings_title">Encryption</string>
@@ -1189,6 +1208,8 @@
 
     <!-- Message in pairing dialogs.  [CHAR LIMIT=NONE] -->
     <string name="bluetooth_pairing_will_share_phonebook">Pairing grants access to your contacts and call history when connected.</string>
+    <!-- Checkbox message in pairing dialogs.  [CHAR LIMIT=NONE] -->
+    <string name="bluetooth_pairing_shares_phonebook">Grant access to your contacts and call history when connected.</string>
 
     <!-- Title for BT error dialogs. -->
     <string name="bluetooth_error_title"></string>
@@ -1356,7 +1377,7 @@
     <string name="link_speed">%1$d Mbps</string>
 
     <!-- Wifi Alert message when tapping on a preference for a config locked down by device owner. [CHAR LIMIT=200] -->
-    <string name="wifi_alert_lockdown_by_device_owner"><xliff:g id="app_name">%1$s</xliff:g> manages your device and doesn\'t allow modifying or deleting this Wi-Fi network. For more information, contact your administrator.</string>
+    <string name="wifi_alert_lockdown_by_device_owner"><xliff:g id="app_name">%1$s</xliff:g> manages your device and doesn\u2019t allow modifying or deleting this Wi-Fi network. For more information, contact your administrator.</string>
 
     <!-- NFC settings -->
     <!-- Used in the 1st-level settings screen to turn on NFC -->
@@ -1452,6 +1473,9 @@
     <string name="wifi_suspend_optimizations_summary">Minimize battery usage when Wi\u2011Fi is on</string>
     <!-- Checkbox summary for option to toggle suspend power optimizations [CHAR LIMIT=30] -->
     <string name="wifi_limit_optimizations_summary">Limit battery used by Wi\u2011Fi</string>
+    <!-- Checkbox title. Should we switch to using cellular data if Wi-Fi is still connected but the Wi-Fi network we're connected to no longer has Internet access (e.g., due to an outage)? -->
+    <string name="wifi_switch_away_when_unvalidated">Switch to cellular data if Wi\u2011Fi loses Internet access.</string>
+
     <!-- Action bar text message to manually add a wifi network [CHAR LIMIT=20]-->
     <string name="wifi_add_network">Add network</string>
     <!-- Header for the list of wifi networks-->
@@ -2297,13 +2321,19 @@
     <!-- Storage setting.  Menu option for unmounting a storage device [CHAR LIMIT=30]-->
     <string name="storage_menu_unmount">Eject</string>
     <!-- Storage setting.  Menu option for erasing and formatting a storage device [CHAR LIMIT=30]-->
-    <string name="storage_menu_format">Erase &amp; format</string>
+    <string name="storage_menu_format">Format</string>
     <!-- Storage setting.  Menu option for erasing and formatting a storage device [CHAR LIMIT=30]-->
-    <string name="storage_menu_format_internal">Erase &amp; format as internal storage</string>
+    <string name="storage_menu_format_public">Format as portable</string>
+    <!-- Storage setting.  Menu option for erasing and formatting a storage device [CHAR LIMIT=30]-->
+    <string name="storage_menu_format_private">Format as internal</string>
     <!-- Storage setting.  Menu option for migrating data to a storage device [CHAR LIMIT=30]-->
     <string name="storage_menu_migrate">Migrate data</string>
     <!-- Storage setting.  Menu option for forgetting a storage device [CHAR LIMIT=30]-->
     <string name="storage_menu_forget">Forget</string>
+    <!-- Storage setting.  Menu option for setting up a storage device [CHAR LIMIT=30]-->
+    <string name="storage_menu_set_up">Set up</string>
+    <!-- Storage setting.  Menu option for exploring a storage device [CHAR LIMIT=30]-->
+    <string name="storage_menu_explore">Explore</string>
 
     <!-- Storage setting.  Title for USB transfer settings [CHAR LIMIT=30]-->
     <string name="storage_title_usb">USB computer connection</string>
@@ -2328,10 +2358,16 @@
     <!-- Section header above list of internal storage devices [CHAR LIMIT=30]-->
     <string name="storage_internal_title">Device storage</string>
     <!-- Section header above list of external storage devices [CHAR LIMIT=30]-->
-    <string name="storage_external_title">Removable storage</string>
+    <string name="storage_external_title">Portable storage</string>
 
     <!-- Summary of a single storage volume, constrasting available and total storage space. [CHAR LIMIT=48]-->
-    <string name="storage_volume_summary"><xliff:g id="free" example="1.2GB">%1$s</xliff:g> free (Total <xliff:g id="total" example="32GB">%2$s</xliff:g>)</string>
+    <string name="storage_volume_summary"><xliff:g id="used" example="1.2GB">%1$s</xliff:g> used of <xliff:g id="total" example="32GB">%2$s</xliff:g></string>
+    <!-- Summary of a single storage volume used space. [CHAR LIMIT=24] -->
+    <string name="storage_size_large"><xliff:g id="number" example="128">^1</xliff:g> <small><small><xliff:g id="unit" example="KB">^2</xliff:g></small></small></string>
+    <!-- Summary of a single storage volume total space. [CHAR LIMIT=48]-->
+    <string name="storage_volume_used">Used of <xliff:g id="total" example="32GB">%1$s</xliff:g></string>
+    <!-- Summary of a single storage volume total space. [CHAR LIMIT=48]-->
+    <string name="storage_volume_used_total">Total used of <xliff:g id="total" example="32GB">%1$s</xliff:g></string>
 
     <!-- Toast informing that storage mount operation was successful. [CHAR LIMIT=64]-->
     <string name="storage_mount_success"><xliff:g id="name" example="SD card">%1$s</xliff:g> is mounted</string>
@@ -2351,6 +2387,18 @@
     <!-- Title of dialog prompting user to rename a storage volume [CHAR LIMIT=32]-->
     <string name="storage_rename_title">Rename storage</string>
 
+    <!-- Dialog body informing user about an unmounted storage device. [CHAR LIMIT=NONE]-->
+    <string name="storage_dialog_unmounted">This <xliff:g id="name" example="SD card">^1</xliff:g> is safely ejected, but still available.
+\n\nTo use this <xliff:g id="name" example="SD card">^1</xliff:g>, you have to mount it first.</string>
+
+    <!-- Dialog body informing user about an unmountable storage device. [CHAR LIMIT=NONE]-->
+    <string name="storage_dialog_unmountable">This <xliff:g id="name" example="SD card">^1</xliff:g> is corrupted.
+\n\nTo use this <xliff:g id="name" example="SD card">^1</xliff:g>, you have to set it up first.</string>
+
+    <!-- Dialog body informing user about an unsupported storage device. [CHAR LIMIT=NONE]-->
+    <string name="storage_dialog_unsupported">This device doesn\u2019t support this <xliff:g id="name" example="SD card">^1</xliff:g>.
+\n\nTo use this <xliff:g id="name" example="SD card">^1</xliff:g> with this device, you have to set it up first.</string>
+
     <!-- Body of dialog informing user about consequences of formatting an internal storage device [CHAR LIMIT=NONE]-->
     <string name="storage_internal_format_details">After formatting, you can use this <xliff:g id="name" example="SD card">^1</xliff:g> in other devices.
 \n\nAll data on this <xliff:g id="name" example="SD card">^1</xliff:g> will be erased. Consider backing up first.
@@ -2369,6 +2417,34 @@
 \n\nIf you choose to forget, all the data the device contains will be lost forever.
 \n\nYou can reinstall the apps later, but their data stored on this device will be lost.</string>
 
+    <!-- Title of dialog confirming that user wants to forget an internal storage device [CHAR LIMIT=32]-->
+    <string name="storage_internal_forget_confirm_title">Forget <xliff:g id="name" example="SD card">^1</xliff:g>?</string>
+    <!-- Body of dialog confirming that user wants to forget an internal storage device [CHAR LIMIT=NONE]-->
+    <string name="storage_internal_forget_confirm">All the apps, photos, and data stored on this <xliff:g id="name" example="SD card">^1</xliff:g> will be lost forever.</string>
+
+    <!-- Item title describing storage used by apps [CHAR LIMIT=48]-->
+    <string name="storage_detail_apps">Apps</string>
+    <!-- Item title describing storage used by images [CHAR LIMIT=48]-->
+    <string name="storage_detail_images">Images</string>
+    <!-- Item title describing storage used by videos [CHAR LIMIT=48]-->
+    <string name="storage_detail_videos">Videos</string>
+    <!-- Item title describing storage used by audio [CHAR LIMIT=48]-->
+    <string name="storage_detail_audio">Audio</string>
+    <!-- Item title describing storage used by cached data [CHAR LIMIT=48]-->
+    <string name="storage_detail_cached">Cached data</string>
+    <!-- Item title describing storage used by other data [CHAR LIMIT=48]-->
+    <string name="storage_detail_other">Other</string>
+    <!-- Item title that will launch a file explorer [CHAR LIMIT=48]-->
+    <string name="storage_detail_explore">Explore <xliff:g id="name" example="SD card">^1</xliff:g></string>
+
+    <!-- Body of dialog informing user about other files on a storage device [CHAR LIMIT=NONE]-->
+    <string name="storage_detail_dialog_other">Other includes shared files saved by apps, files downloaded from the Internet or Bluetooth, Android files, and so on.
+\n\nTo see the entire contents of this <xliff:g id="name" example="SD card">^1</xliff:g>, touch Explore.</string>
+
+    <!-- Body of dialog informing user about other users on a storage device [CHAR LIMIT=NONE]-->
+    <string name="storage_detail_dialog_user"><xliff:g id="user" example="Guest user">^1</xliff:g> may have saved photos, music, movies, apps, or other data that is taking up <xliff:g id="size" example="1.2 GB">^2</xliff:g> of storage.
+\n\nTo view details, switch to <xliff:g id="user" example="Guest user">^1</xliff:g>.</string>
+
     <!-- Title of wizard step prompting user to setup a storage device [CHAR LIMIT=32] -->
     <string name="storage_wizard_init_title">Set up your <xliff:g id="name" example="SD card">^1</xliff:g></string>
     <!-- Title of wizard choice to use storage device as external storage [CHAR LIMIT=64] -->
@@ -2406,9 +2482,10 @@
     <!-- Title of wizard step prompting user to migrate data to new storage [CHAR LIMIT=32] -->
     <string name="storage_wizard_migrate_title">Move data to new storage</string>
     <!-- Body of wizard step prompting user to migrate data to new storage [CHAR LIMIT=NONE] -->
-    <string name="storage_wizard_migrate_body">You can move your photos, files, and app data to this new <xliff:g id="name" example="SD card">^1</xliff:g>.
+    <string name="storage_wizard_migrate_body">You can move your photos, files, and some apps to this new <xliff:g id="name" example="SD card">^1</xliff:g>.
 \n\nThe move takes about <xliff:g id="time" example="1 hour">^2</xliff:g> and will free <xliff:g id="size" example="1.2 GB">^3</xliff:g> on internal storage. Some apps won\u2019t work while it\u2019s underway.
     </string>
+
     <!-- Title of wizard choice to migrate data right now [CHAR LIMIT=64] -->
     <string name="storage_wizard_migrate_now">Move now</string>
     <!-- Title of wizard choice to migrate data at later time [CHAR LIMIT=NONE] -->
@@ -2458,7 +2535,7 @@
     <!-- Title of wizard button offering to cancel move [CHAR LIMIT=32] -->
     <string name="storage_wizard_move_progress_cancel">Cancel move</string>
 
-    <!-- Title of wizard step prompting user to start data migration [CHAR LIMIT=32] -->
+    <!-- Title of wizard step prompting user to start data migration [CHAR LIMIT=NONE] -->
     <string name="storage_wizard_slow_body">This <xliff:g id="name" example="SD card">^1</xliff:g> appears to be slow.
 \n\nYou can continue, but apps moved to this location may stutter and data transfers may take a long time.
 \n\nConsider using a faster <xliff:g id="name" example="SD card">^1</xliff:g> for better performance.
@@ -3117,6 +3194,8 @@
     <string name="no_applications">No apps.</string>
     <!-- [CHAR LIMIT=15] Manage applications, label for chart showing internal storage use. -->
     <string name="internal_storage">Internal storage</string>
+    <!-- [CHAR LIMIT=30] Title for internal device storage that is capitalized for placement as a phrase into another sentence -->
+    <string name="internal_storage_sentence">internal storage</string>
     <!-- [CHAR LIMIT=15] Manage applications, label for chart showing SD card storage use. -->
     <string name="sd_card_storage" product="nosdcard">USB storage</string>
     <!-- [CHAR LIMIT=15] Manage applications, label for chart showing SD card storage use. -->
@@ -5003,11 +5082,6 @@
     <!-- UI debug setting: enable various types of OpenGL traces [CHAR LIMIT=25] -->
     <string name="enable_opengl_traces_title">Enable OpenGL traces</string>
 
-    <!-- UI debug setting: force use of AwesomePlayer [CHAR LIMIT=25] -->
-    <string name="use_awesomeplayer">Use AwesomePlayer (deprecated)</string>
-    <!-- UI debug setting: force use of AwesomePlayer summary [CHAR LIMIT=50] -->
-    <string name="use_awesomeplayer_summary">Use AwesomePlayer instead of NuPlayer for most media playback</string>
-
     <!-- UI debug setting: disable USB audio routing title [CHAR LIMIT=32] -->
     <string name="usb_audio_disable_routing">Disable USB audio routing</string>
     <!-- UI debug setting: disable USB audio routing summary [CHAR LIMIT=50] -->
@@ -5124,6 +5198,8 @@
     <string name="data_usage_menu_sim_cards">SIM cards</string>
     <!-- Title for menu option to show details for all cellular networks. [CHAR LIMIT=26] -->
     <string name="data_usage_menu_cellular_networks">Cellular networks</string>
+    <!-- Summary String for Cellular data enable toggle. [CHAR LIMIT=26] -->
+    <string name="data_usage_cellular_data_summary">Paused at limit</string>
 
     <!--  Title for menu option to enable global auto-sync of personal account data [CHAR LIMIT=30] -->
     <string name="account_settings_menu_auto_sync">Auto-sync data</string>
@@ -5588,7 +5664,7 @@
     <!-- Header for text explaning how to pay at a payment terminal in a store -->
     <string name="nfc_how_it_works_title">Paying at the terminal</string>
     <!-- Content for text explaning how to pay at a payment terminal in a store -->
-    <string name="nfc_how_it_works_content">Once you\'ve set up a Tap &amp; pay app and your phone is powered on, tap your phone on any terminal with the Tap &amp; pay logo on it to make a purchase.</string>
+    <string name="nfc_how_it_works_content">Once you\u2019ve set up a Tap &amp; pay app and your phone is powered on, tap your phone on any terminal with the Tap &amp; pay logo on it to make a purchase.</string>
     <!-- Button the user can click to indicate he understood and dismiss the screen -->
     <string name="nfc_how_it_works_got_it">Got it</string>
     <!-- NFC More... title.  [CHAR LIMIT=40] -->
@@ -6674,7 +6750,7 @@
     <string name="high_power_off">Not allowed</string>
 
     <!-- Description of high power switch [CHAR LIMIT=NONE] -->
-    <string name="high_power_desc">Don\'t apply battery optimizations. May drain your battery more quickly.</string>
+    <string name="high_power_desc">Don\u2019t apply battery optimizations. May drain your battery more quickly.</string>
 
     <!-- Description of number of apps with high power turned on [CHAR LIMIT=NONE] -->
     <plurals name="high_power_count">
@@ -6689,7 +6765,7 @@
     <string name="no_battery_summary">No battery use since last full charge</string>
 
     <!-- Link to an apps notification settings [CHAR LIMIT=50] -->
-    <string name="app_notification_preferences">App notification preferences</string>
+    <string name="app_notification_preferences">App settings</string>
 
     <!-- Turn on settings for system ui tuner [CHAR LIMIT=40] -->
     <string name="system_ui_settings">Show SystemUI Tuner</string>
@@ -6732,7 +6808,7 @@
     <string name="assist_access_context_title">Use current context</string>
 
     <!-- Summary for the "context" preference to determine whether assist can access the data currently displayed on-screen [CHAR LIMIT=NONE] -->
-    <string name="assist_access_context_summary">When you open the assist app, let it see what you\'ve been doing on your screen</string>
+    <string name="assist_access_context_summary">When you open the assist app, let it see what you\u2019ve been doing on your screen</string>
 
     <!-- Footer text in the manage assist screen. [CHAR LIMIT=NONE] -->
     <string name="assist_footer">Assist apps help you identify and act on useful information without having to ask. Some apps support both launcher and voice input services to give you integrated assistance.</string>
@@ -6815,9 +6891,9 @@
     <!-- Ignore battery optimizations dialog title [CHAR LIMIT=NONE] -->
     <string name="ignore_optimizations_title">Allow <xliff:g id="app" example="Tasker">%s</xliff:g> to ignore battery optimizations?</string>
 
-    <!-- Instructions for state when SD card is unmounted [CHAR LIMIT=NONE] -->
-    <string name="sdcard_unmounted_description">The SD card is safely ejected, but still available in the SD card slot for this device.\n\nTo use this card, you have to mount it first.</string>
-
     <!-- Label for None item in AppListPreference [CHAR LIMIT=40] -->
     <string name="app_list_preference_none">None</string>
+
+    <!-- Warning message about disabling usage access on profile owner [CHAR LIMIT=NONE] -->
+    <string name="work_profile_usage_access_warning">Turning off usage access for this app doesn\u2019t prevent your administrator tracking data usage for apps in your work profile.</string>
 </resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 5e9d870..1d58779 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -225,6 +225,11 @@
         <item name="android:layout_height">wrap_content</item>
     </style>
 
+    <style name="ConfirmDeviceCredentialsAnimationStyle" parent="@*android:style/Animation.Material.Activity">
+        <item name="android:activityOpenEnterAnimation">@anim/confirm_credential_open_enter</item>
+        <item name="android:activityOpenExitAnimation">@anim/confirm_credential_open_exit</item>
+    </style>
+
     <style name="Transparent">
         <item name="android:windowBackground">@android:color/transparent</item>
         <item name="android:windowNoTitle">true</item>
diff --git a/res/values/themes.xml b/res/values/themes.xml
index c2285e2..08b8de3 100644
--- a/res/values/themes.xml
+++ b/res/values/themes.xml
@@ -199,7 +199,7 @@
         <item name="android:colorPrimaryDark">@*android:color/material_blue_grey_950</item>
         <item name="android:windowActionBar">false</item>
         <item name="android:windowNoTitle">true</item>
-        <item name="preferenceBackgroundColor">@color/confirm_device_credential_dark_background</item>
+        <item name="android:windowBackground">@color/confirm_device_credential_dark_background</item>
 
         <item name="confirmDeviceCredentialsSideMargin">32dp</item>
         <item name="confirmDeviceCredentialsTopMargin">32dp</item>
@@ -208,6 +208,8 @@
         <item name="@*android:regularColor">@color/lock_pattern_view_regular_color_dark</item>
         <item name="@*android:successColor">@color/lock_pattern_view_regular_color_dark</item>
         <item name="@*android:errorColor">@color/lock_pattern_view_error_color</item>
+
+        <item name="android:windowAnimationStyle">@style/ConfirmDeviceCredentialsAnimationStyle</item>
     </style>
 
     <style name="Theme.FingerprintEnroll" parent="@*android:style/Theme.Material.Settings.NoActionBar">
diff --git a/res/xml/development_prefs.xml b/res/xml/development_prefs.xml
index fef2623..4905f26 100644
--- a/res/xml/development_prefs.xml
+++ b/res/xml/development_prefs.xml
@@ -288,11 +288,6 @@
             android:title="@string/media_category">
 
         <SwitchPreference
-                android:key="use_awesomeplayer"
-                android:title="@string/use_awesomeplayer"
-                android:summary="@string/use_awesomeplayer_summary"/>
-
-        <SwitchPreference
                 android:key="usb_audio"
                 android:title="@string/usb_audio_disable_routing"
                 android:summary="@string/usb_audio_disable_routing_summary" />
diff --git a/src/com/android/settings/CheckableLinearLayout.java b/src/com/android/settings/CheckableLinearLayout.java
new file mode 100644
index 0000000..a86c1b5
--- /dev/null
+++ b/src/com/android/settings/CheckableLinearLayout.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.settings;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.util.TypedValue;
+import android.view.View;
+import android.widget.Checkable;
+import android.widget.LinearLayout;
+
+public class CheckableLinearLayout extends LinearLayout implements Checkable {
+
+    private boolean mChecked;
+    private float mDisabledAlpha;
+
+    public CheckableLinearLayout(Context context, AttributeSet attrs) {
+        super(context, attrs);
+        TypedValue alpha = new TypedValue();
+        context.getTheme().resolveAttribute(android.R.attr.disabledAlpha, alpha, true);
+        mDisabledAlpha = alpha.getFloat();
+    }
+
+    @Override
+    public void setEnabled(boolean enabled) {
+        super.setEnabled(enabled);
+        final int N = getChildCount();
+        for (int i = 0; i < N; i++) {
+            getChildAt(i).setAlpha(enabled ? 1 : mDisabledAlpha);
+        }
+    }
+
+    @Override
+    public void setChecked(boolean checked) {
+        mChecked = checked;
+        updateChecked();
+    }
+
+    @Override
+    public boolean isChecked() {
+        return mChecked;
+    }
+
+    @Override
+    public void toggle() {
+        setChecked(!mChecked);
+    }
+
+    private void updateChecked() {
+        final int N = getChildCount();
+        for (int i = 0; i < N; i++) {
+            View child = getChildAt(i);
+            if (child instanceof Checkable) {
+                ((Checkable) child).setChecked(mChecked);
+            }
+        }
+    }
+
+}
diff --git a/src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java b/src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java
index fe3de97..f56c315 100644
--- a/src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java
+++ b/src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java
@@ -16,17 +16,23 @@
 
 package com.android.settings;
 
+import android.app.Fragment;
 import android.app.KeyguardManager;
 import android.os.Bundle;
 import android.view.MenuItem;
 import android.view.WindowManager;
 
-public class ConfirmDeviceCredentialBaseActivity extends SettingsActivity {
+public abstract class ConfirmDeviceCredentialBaseActivity extends SettingsActivity {
+
+    private boolean mRestoring;
+    private boolean mDark;
+    private boolean mEnterAnimationPending;
 
     @Override
     protected void onCreate(Bundle savedState) {
         if (getIntent().getBooleanExtra(ConfirmDeviceCredentialBaseFragment.DARK_THEME, false)) {
             setTheme(R.style.Theme_ConfirmDeviceCredentialsDark);
+            mDark = true;
         }
         super.onCreate(savedState);
         boolean deviceLocked = getSystemService(KeyguardManager.class).isKeyguardLocked();
@@ -41,6 +47,7 @@
             getActionBar().setDisplayHomeAsUpEnabled(true);
             getActionBar().setHomeButtonEnabled(true);
         }
+        mRestoring = savedState != null;
     }
 
     @Override
@@ -51,4 +58,37 @@
         }
         return super.onOptionsItemSelected(item);
     }
+
+    @Override
+    public void onResume() {
+        super.onResume();
+        if (!isChangingConfigurations() && !mRestoring && mDark) {
+            prepareEnterAnimation();
+            mEnterAnimationPending = true;
+        }
+    }
+
+    private ConfirmDeviceCredentialBaseFragment getFragment() {
+        Fragment fragment = getFragmentManager().findFragmentById(R.id.main_content);
+        if (fragment != null && fragment instanceof ConfirmDeviceCredentialBaseFragment) {
+            return (ConfirmDeviceCredentialBaseFragment) fragment;
+        }
+        return null;
+    }
+
+    @Override
+    public void onEnterAnimationComplete() {
+        super.onEnterAnimationComplete();
+        if (mEnterAnimationPending) {
+            startEnterAnimation();
+        }
+    }
+
+    public void prepareEnterAnimation() {
+        getFragment().prepareEnterAnimation();
+    }
+
+    public void startEnterAnimation() {
+        getFragment().startEnterAnimation();
+    }
 }
diff --git a/src/com/android/settings/ConfirmDeviceCredentialBaseFragment.java b/src/com/android/settings/ConfirmDeviceCredentialBaseFragment.java
index 414aa01..a8b5f2d 100644
--- a/src/com/android/settings/ConfirmDeviceCredentialBaseFragment.java
+++ b/src/com/android/settings/ConfirmDeviceCredentialBaseFragment.java
@@ -45,6 +45,8 @@
 
     private FingerprintUiHelper mFingerprintHelper;
     private boolean mAllowFpAuthentication;
+    protected Button mCancelButton;
+    protected ImageView mFingerprintIcon;
 
     @Override
     public void onCreate(@Nullable Bundle savedInstanceState) {
@@ -56,14 +58,15 @@
     @Override
     public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
         super.onViewCreated(view, savedInstanceState);
+        mCancelButton = (Button) view.findViewById(R.id.cancelButton);
+        mFingerprintIcon = (ImageView) view.findViewById(R.id.fingerprintIcon);
         mFingerprintHelper = new FingerprintUiHelper(
-                (ImageView) view.findViewById(R.id.fingerprintIcon),
+                mFingerprintIcon,
                 (TextView) view.findViewById(R.id.errorText), this);
         boolean showCancelButton = getActivity().getIntent().getBooleanExtra(
                 SHOW_CANCEL_BUTTON, false);
-        Button cancelButton = (Button) view.findViewById(R.id.cancelButton);
-        cancelButton.setVisibility(showCancelButton ? View.VISIBLE : View.GONE);
-        cancelButton.setOnClickListener(new View.OnClickListener() {
+        mCancelButton.setVisibility(showCancelButton ? View.VISIBLE : View.GONE);
+        mCancelButton.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
                 getActivity().finish();
@@ -100,4 +103,10 @@
     @Override
     public void onFingerprintIconVisibilityChanged(boolean visible) {
     }
+
+    public void prepareEnterAnimation() {
+    }
+
+    public void startEnterAnimation() {
+    }
 }
diff --git a/src/com/android/settings/ConfirmLockPassword.java b/src/com/android/settings/ConfirmLockPassword.java
index db0b44a..7761807 100644
--- a/src/com/android/settings/ConfirmLockPassword.java
+++ b/src/com/android/settings/ConfirmLockPassword.java
@@ -19,9 +19,12 @@
 import android.os.UserHandle;
 import android.text.TextUtils;
 import com.android.internal.logging.MetricsLogger;
+import com.android.internal.util.ArrayUtils;
 import com.android.internal.widget.LockPatternChecker;
 import com.android.internal.widget.LockPatternUtils;
 import com.android.internal.widget.TextViewInputDisabler;
+import com.android.settingslib.animation.AppearAnimationUtils;
+import com.android.settingslib.animation.DisappearAnimationUtils;
 
 import android.app.Fragment;
 import android.app.admin.DevicePolicyManager;
@@ -39,11 +42,14 @@
 import android.view.View;
 import android.view.View.OnClickListener;
 import android.view.ViewGroup;
+import android.view.animation.AnimationUtils;
 import android.view.inputmethod.EditorInfo;
 import android.view.inputmethod.InputMethodManager;
 import android.widget.TextView;
 import android.widget.TextView.OnEditorActionListener;
 
+import java.util.ArrayList;
+
 public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
 
     public static class InternalActivity extends ConfirmLockPassword {
@@ -89,6 +95,9 @@
         private boolean mIsAlpha;
         private InputMethodManager mImm;
         private boolean mUsingFingerprint = false;
+        private AppearAnimationUtils mAppearAnimationUtils;
+        private DisappearAnimationUtils mDisappearAnimationUtils;
+        private boolean mBlockImm;
 
         // required constructor for fragments
         public ConfirmLockPasswordFragment() {
@@ -144,6 +153,14 @@
             int currentType = mPasswordEntry.getInputType();
             mPasswordEntry.setInputType(mIsAlpha ? currentType
                     : (InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_PASSWORD));
+            mAppearAnimationUtils = new AppearAnimationUtils(getContext(),
+                    220, 2f /* translationScale */, 1f /* delayScale*/,
+                    AnimationUtils.loadInterpolator(getContext(),
+                            android.R.interpolator.linear_out_slow_in));
+            mDisappearAnimationUtils = new DisappearAnimationUtils(getContext(),
+                    110, 1f /* translationScale */,
+                    0.5f /* delayScale */, AnimationUtils.loadInterpolator(
+                            getContext(), android.R.interpolator.fast_out_linear_in));
             return view;
         }
 
@@ -163,6 +180,43 @@
         }
 
         @Override
+        public void prepareEnterAnimation() {
+            super.prepareEnterAnimation();
+            mHeaderTextView.setAlpha(0f);
+            mDetailsTextView.setAlpha(0f);
+            mCancelButton.setAlpha(0f);
+            mPasswordEntry.setAlpha(0f);
+            mFingerprintIcon.setAlpha(0f);
+            mBlockImm = true;
+        }
+
+        private View[] getActiveViews() {
+            ArrayList<View> result = new ArrayList<>();
+            result.add(mHeaderTextView);
+            result.add(mDetailsTextView);
+            if (mCancelButton.getVisibility() == View.VISIBLE) {
+                result.add(mCancelButton);
+            }
+            result.add(mPasswordEntry);
+            if (mFingerprintIcon.getVisibility() == View.VISIBLE) {
+                result.add(mFingerprintIcon);
+            }
+            return result.toArray(new View[] {});
+        }
+
+        @Override
+        public void startEnterAnimation() {
+            super.startEnterAnimation();
+            mAppearAnimationUtils.startAnimation(getActiveViews(), new Runnable() {
+                @Override
+                public void run() {
+                    mBlockImm = false;
+                    resetState();
+                }
+            });
+        }
+
+        @Override
         public void onPause() {
             super.onPause();
             if (mCountdownTimer != null) {
@@ -199,9 +253,7 @@
 
         @Override
         protected void authenticationSucceeded() {
-            Intent intent = new Intent();
-            getActivity().setResult(RESULT_OK, intent);
-            getActivity().finish();
+            startDisappearAnimation(new Intent());
         }
 
         @Override
@@ -210,6 +262,7 @@
         }
 
         private void resetState() {
+            if (mBlockImm) return;
             mPasswordEntry.setEnabled(true);
             mPasswordEntryInputDisabler.setInputEnabled(true);
             if (shouldAutoShowSoftKeyboard()) {
@@ -222,7 +275,7 @@
         }
 
         public void onWindowFocusChanged(boolean hasFocus) {
-            if (!hasFocus) {
+            if (!hasFocus || mBlockImm) {
                 return;
             }
             // Post to let window focus logic to finish to allow soft input show/hide properly.
@@ -312,11 +365,28 @@
                     });
         }
 
+        private void startDisappearAnimation(final Intent intent) {
+            if (getActivity().getThemeResId() == R.style.Theme_ConfirmDeviceCredentialsDark) {
+                mDisappearAnimationUtils.startAnimation(getActiveViews(), new Runnable() {
+                    @Override
+                    public void run() {
+                        getActivity().setResult(RESULT_OK, intent);
+                        getActivity().finish();
+                        getActivity().overridePendingTransition(
+                                R.anim.confirm_credential_close_enter,
+                                R.anim.confirm_credential_close_exit);
+                    }
+                });
+            } else {
+                getActivity().setResult(RESULT_OK, intent);
+                getActivity().finish();
+            }
+        }
+
         private void onPasswordChecked(boolean matched, Intent intent, int timeoutMs) {
             mPasswordEntryInputDisabler.setInputEnabled(true);
             if (matched) {
-                getActivity().setResult(RESULT_OK, intent);
-                getActivity().finish();
+                startDisappearAnimation(intent);
             } else {
                 if (timeoutMs > 0) {
                     long deadline = mLockPatternUtils.setLockoutAttemptDeadline(
diff --git a/src/com/android/settings/ConfirmLockPattern.java b/src/com/android/settings/ConfirmLockPattern.java
index 90a39f9..1737635 100644
--- a/src/com/android/settings/ConfirmLockPattern.java
+++ b/src/com/android/settings/ConfirmLockPattern.java
@@ -22,10 +22,21 @@
 import com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient;
 import com.android.internal.widget.LockPatternChecker;
 import com.android.internal.widget.LockPatternView.Cell;
+import com.android.settingslib.animation.AppearAnimationCreator;
+import com.android.settingslib.animation.AppearAnimationUtils;
+import com.android.settingslib.animation.DisappearAnimationUtils;
 
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.ValueAnimator;
 import android.annotation.Nullable;
 import android.app.Activity;
+import android.app.Fragment;
 import android.content.Intent;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.graphics.PorterDuff;
+import android.graphics.PorterDuffColorFilter;
 import android.os.CountDownTimer;
 import android.os.SystemClock;
 import android.os.AsyncTask;
@@ -33,11 +44,16 @@
 import android.os.UserHandle;
 import android.os.storage.StorageManager;
 import android.view.MenuItem;
+import android.view.animation.AnimationUtils;
+import android.view.animation.Interpolator;
 import android.widget.TextView;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 
 /**
@@ -70,7 +86,8 @@
         return false;
     }
 
-    public static class ConfirmLockPatternFragment extends ConfirmDeviceCredentialBaseFragment {
+    public static class ConfirmLockPatternFragment extends ConfirmDeviceCredentialBaseFragment
+            implements AppearAnimationCreator<Object> {
 
         // how long we wait to clear a wrong pattern
         private static final int WRONG_PATTERN_CLEAR_TIMEOUT_MS = 2000;
@@ -93,6 +110,9 @@
         private CharSequence mHeaderText;
         private CharSequence mDetailsText;
 
+        private AppearAnimationUtils mAppearAnimationUtils;
+        private DisappearAnimationUtils mDisappearAnimationUtils;
+
         // required constructor for fragments
         public ConfirmLockPatternFragment() {
 
@@ -144,6 +164,20 @@
                     getActivity().finish();
                 }
             }
+            mAppearAnimationUtils = new AppearAnimationUtils(getContext(),
+                    AppearAnimationUtils.DEFAULT_APPEAR_DURATION, 2f /* translationScale */,
+                    1.3f /* delayScale */, AnimationUtils.loadInterpolator(
+                    getContext(), android.R.interpolator.linear_out_slow_in));
+            mDisappearAnimationUtils = new DisappearAnimationUtils(getContext(),
+                    125, 4f /* translationScale */,
+                    0.3f /* delayScale */, AnimationUtils.loadInterpolator(
+                    getContext(), android.R.interpolator.fast_out_linear_in),
+                    new AppearAnimationUtils.RowTranslationScaler() {
+                        @Override
+                        public float getRowTranslationScale(int row, int numRows) {
+                            return (float)(numRows - row) / numRows;
+                        }
+                    });
             return view;
         }
 
@@ -187,6 +221,51 @@
             }
         }
 
+        @Override
+        public void prepareEnterAnimation() {
+            super.prepareEnterAnimation();
+            mHeaderTextView.setAlpha(0f);
+            mCancelButton.setAlpha(0f);
+            mLockPatternView.setAlpha(0f);
+            mDetailsTextView.setAlpha(0f);
+            mFingerprintIcon.setAlpha(0f);
+        }
+
+        private Object[][] getActiveViews() {
+            ArrayList<ArrayList<Object>> result = new ArrayList<>();
+            result.add(new ArrayList<Object>(Collections.singletonList(mHeaderTextView)));
+            result.add(new ArrayList<Object>(Collections.singletonList(mDetailsTextView)));
+            if (mCancelButton.getVisibility() == View.VISIBLE) {
+                result.add(new ArrayList<Object>(Collections.singletonList(mCancelButton)));
+            }
+            LockPatternView.CellState[][] cellStates = mLockPatternView.getCellStates();
+            for (int i = 0; i < cellStates.length; i++) {
+                ArrayList<Object> row = new ArrayList<>();
+                for (int j = 0; j < cellStates[i].length; j++) {
+                    row.add(cellStates[i][j]);
+                }
+                result.add(row);
+            }
+            if (mFingerprintIcon.getVisibility() == View.VISIBLE) {
+                result.add(new ArrayList<Object>(Collections.singletonList(mFingerprintIcon)));
+            }
+            Object[][] resultArr = new Object[result.size()][cellStates[0].length];
+            for (int i = 0; i < result.size(); i++) {
+                ArrayList<Object> row = result.get(i);
+                for (int j = 0; j < row.size(); j++) {
+                    resultArr[i][j] = row.get(j);
+                }
+            }
+            return resultArr;
+        }
+
+        @Override
+        public void startEnterAnimation() {
+            super.startEnterAnimation();
+            mLockPatternView.setAlpha(1f);
+            mAppearAnimationUtils.startAnimation2d(getActiveViews(), null, this);
+        }
+
         private void updateStage(Stage stage) {
             switch (stage) {
                 case NeedToUnlock:
@@ -242,9 +321,27 @@
 
         @Override
         protected void authenticationSucceeded() {
-            Intent intent = new Intent();
-            getActivity().setResult(Activity.RESULT_OK, intent);
-            getActivity().finish();
+            startDisappearAnimation(new Intent());
+        }
+
+        private void startDisappearAnimation(final Intent intent) {
+            if (getActivity().getThemeResId() == R.style.Theme_ConfirmDeviceCredentialsDark) {
+                mLockPatternView.clearPattern();
+                mDisappearAnimationUtils.startAnimation2d(getActiveViews(),
+                        new Runnable() {
+                            @Override
+                            public void run() {
+                                getActivity().setResult(RESULT_OK, intent);
+                                getActivity().finish();
+                                getActivity().overridePendingTransition(
+                                        R.anim.confirm_credential_close_enter,
+                                        R.anim.confirm_credential_close_exit);
+                            }
+                        }, this);
+            } else {
+                getActivity().setResult(RESULT_OK, intent);
+                getActivity().finish();
+            }
         }
 
         @Override
@@ -357,8 +454,7 @@
                     boolean matched, Intent intent, int timeoutMs) {
                 mLockPatternView.setEnabled(true);
                 if (matched) {
-                    getActivity().setResult(Activity.RESULT_OK, intent);
-                    getActivity().finish();
+                    startDisappearAnimation(intent);
                 } else {
                     if (timeoutMs > 0) {
                         long deadline = mLockPatternUtils.setLockoutAttemptDeadline(
@@ -394,5 +490,52 @@
                 }
             }.start();
         }
+
+        @Override
+        public void createAnimation(Object obj, long delay,
+                long duration, float translationY, final boolean appearing,
+                Interpolator interpolator,
+                final Runnable finishListener) {
+            if (obj instanceof LockPatternView.CellState) {
+                final LockPatternView.CellState animatedCell = (LockPatternView.CellState) obj;
+                if (appearing) {
+                    animatedCell.scale = 0.0f;
+                    animatedCell.alpha = 1.0f;
+                }
+                animatedCell.translateY = appearing ? translationY : 0;
+                ValueAnimator animator = ValueAnimator.ofFloat(animatedCell.translateY,
+                        appearing ? 0 : translationY);
+                animator.setInterpolator(interpolator);
+                animator.setDuration(duration);
+                animator.setStartDelay(delay);
+                animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+                    @Override
+                    public void onAnimationUpdate(ValueAnimator animation) {
+                        float animatedFraction = animation.getAnimatedFraction();
+                        if (appearing) {
+                            animatedCell.scale = animatedFraction;
+                        } else {
+                            animatedCell.alpha = 1 - animatedFraction;
+                        }
+                        animatedCell.translateY = (float) animation.getAnimatedValue();
+                        mLockPatternView.invalidate();
+                    }
+                });
+                if (finishListener != null) {
+                    animator.addListener(new AnimatorListenerAdapter() {
+                        @Override
+                        public void onAnimationEnd(Animator animation) {
+                            finishListener.run();
+                        }
+                    });
+                }
+
+                animator.start();
+                mLockPatternView.invalidate();
+            } else {
+                mAppearAnimationUtils.createAnimation((View) obj, delay, duration, translationY,
+                        appearing, interpolator, finishListener);
+            }
+        }
     }
 }
diff --git a/src/com/android/settings/CreateShortcut.java b/src/com/android/settings/CreateShortcut.java
index fa2ce7c..637bc6f 100644
--- a/src/com/android/settings/CreateShortcut.java
+++ b/src/com/android/settings/CreateShortcut.java
@@ -17,18 +17,33 @@
 package com.android.settings;
 
 import android.app.LauncherActivity;
+import android.content.Context;
 import android.content.Intent;
+import android.content.pm.ActivityInfo;
+import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
+import android.graphics.Bitmap;
+import android.graphics.Bitmap.Config;
+import android.graphics.Canvas;
+import android.view.ContextThemeWrapper;
+import android.view.LayoutInflater;
 import android.view.View;
+import android.view.View.MeasureSpec;
+import android.widget.ImageView;
 import android.widget.ListView;
 
 import com.android.settings.Settings.TetherSettingsActivity;
+import com.android.settings.dashboard.DashboardCategory;
+import com.android.settings.dashboard.DashboardTile;
 import com.android.settingslib.TetherUtil;
 
+import java.util.ArrayList;
 import java.util.List;
 
 public class CreateShortcut extends LauncherActivity {
 
+    private static final String TOP_LEVEL_HEADER = "com.android.settings.TOP_LEVEL_HEADER_ID";
+
     @Override
     protected Intent getTargetIntent() {
         Intent targetIntent = new Intent(Intent.ACTION_MAIN, null);
@@ -46,10 +61,45 @@
                 Intent.ShortcutIconResource.fromContext(this, R.mipmap.ic_launcher_settings));
         intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
         intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, itemForPosition(position).label);
+        ResolveInfo resolveInfo = itemForPosition(position).resolveInfo;
+        ActivityInfo activityInfo = resolveInfo.activityInfo;
+        if (activityInfo.metaData != null && activityInfo.metaData.containsKey(TOP_LEVEL_HEADER)) {
+            int topLevelId = activityInfo.metaData.getInt(TOP_LEVEL_HEADER);
+            int resourceId = getDrawableResource(topLevelId);
+            intent.putExtra(Intent.EXTRA_SHORTCUT_ICON, createIcon(resourceId));
+        }
         setResult(RESULT_OK, intent);
         finish();
     }
 
+    private Bitmap createIcon(int resource) {
+        Context context = new ContextThemeWrapper(this, android.R.style.Theme_Material_Light);
+        View view = LayoutInflater.from(context).inflate(R.layout.shortcut_badge, null);
+        ((ImageView) view.findViewById(android.R.id.icon)).setImageResource(resource);
+
+        int spec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
+        view.measure(spec, spec);
+        Bitmap bitmap = Bitmap.createBitmap(view.getMeasuredWidth(), view.getMeasuredHeight(),
+                Config.ARGB_8888);
+        Canvas canvas = new Canvas(bitmap);
+        view.layout(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight());
+        view.draw(canvas);
+        return bitmap;
+    }
+
+    private int getDrawableResource(int topLevelId) {
+        ArrayList<DashboardCategory> categories = new ArrayList<>();
+        SettingsActivity.loadCategoriesFromResource(R.xml.dashboard_categories, categories, this);
+        for (DashboardCategory category : categories) {
+            for (DashboardTile tile : category.tiles) {
+                if (tile.id == topLevelId) {
+                    return tile.iconRes;
+                }
+            }
+        }
+        return 0;
+    }
+
     @Override
     protected boolean onEvaluateShowIcons() {
         return false;
@@ -60,7 +110,8 @@
      * implementation queries for activities.
      */
     protected List<ResolveInfo> onQueryPackageManager(Intent queryIntent) {
-        List<ResolveInfo> activities = super.onQueryPackageManager(queryIntent);
+        List<ResolveInfo> activities = getPackageManager().queryIntentActivities(queryIntent,
+                PackageManager.GET_META_DATA);
         if (activities == null) return null;
         for (int i = activities.size() - 1; i >= 0; i--) {
             ResolveInfo info = activities.get(i);
diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java
index 0c527fa..759c2a5 100644
--- a/src/com/android/settings/DevelopmentSettings.java
+++ b/src/com/android/settings/DevelopmentSettings.java
@@ -132,9 +132,7 @@
     private static final String SHOW_SCREEN_UPDATES_KEY = "show_screen_updates";
     private static final String DISABLE_OVERLAYS_KEY = "disable_overlays";
     private static final String SIMULATE_COLOR_SPACE = "simulate_color_space";
-    private static final String USE_AWESOMEPLAYER_KEY = "use_awesomeplayer";
     private static final String USB_AUDIO_KEY = "usb_audio";
-    private static final String USE_AWESOMEPLAYER_PROPERTY = "persist.sys.media.use-awesome";
     private static final String SHOW_CPU_USAGE_KEY = "show_cpu_usage";
     private static final String FORCE_HARDWARE_UI_KEY = "force_hw_ui";
     private static final String FORCE_MSAA_KEY = "force_msaa";
@@ -257,7 +255,6 @@
 
     private ListPreference mSimulateColorSpace;
 
-    private SwitchPreference mUseAwesomePlayer;
     private SwitchPreference mUSBAudio;
     private SwitchPreference mImmediatelyDestroyActivities;
 
@@ -404,7 +401,6 @@
         }
         mOpenGLTraces = addListPreference(OPENGL_TRACES_KEY);
         mSimulateColorSpace = addListPreference(SIMULATE_COLOR_SPACE);
-        mUseAwesomePlayer = findAndInitSwitchPref(USE_AWESOMEPLAYER_KEY);
         mUSBAudio = findAndInitSwitchPref(USB_AUDIO_KEY);
 
         mImmediatelyDestroyActivities = (SwitchPreference) findPreference(
@@ -640,7 +636,6 @@
         updateLegacyDhcpClientOptions();
         updateMobileDataAlwaysOnOptions();
         updateSimulateColorSpace();
-        updateUseNuplayerOptions();
         updateUSBAudioOptions();
         updateTweakUi();
     }
@@ -1202,17 +1197,6 @@
                         PackageManager.DONT_KILL_APP);
     }
 
-    private void updateUseNuplayerOptions() {
-        updateSwitchPreference(
-                mUseAwesomePlayer, SystemProperties.getBoolean(USE_AWESOMEPLAYER_PROPERTY, false));
-    }
-
-    private void writeUseAwesomePlayerOptions() {
-        SystemProperties.set(
-                USE_AWESOMEPLAYER_PROPERTY, mUseAwesomePlayer.isChecked() ? "true" : "false");
-        pokeSystemProperties();
-    }
-
     private void updateUSBAudioOptions() {
         updateSwitchPreference(mUSBAudio, Settings.Secure.getInt(getContentResolver(),
                 Settings.Secure.USB_AUDIO_AUTOMATIC_ROUTING_DISABLED, 0) != 0);
@@ -1752,8 +1736,6 @@
             writeLegacyDhcpClientOptions();
         } else if (preference == mMobileDataAlwaysOn) {
             writeMobileDataAlwaysOnOptions();
-        } else if (preference == mUseAwesomePlayer) {
-            writeUseAwesomePlayerOptions();
         } else if (preference == mUSBAudio) {
             writeUSBAudioOptions();
         } else if (INACTIVE_APPS_KEY.equals(preference.getKey())) {
diff --git a/src/com/android/settings/DisplaySettings.java b/src/com/android/settings/DisplaySettings.java
index 271c993..eef3c6b 100644
--- a/src/com/android/settings/DisplaySettings.java
+++ b/src/com/android/settings/DisplaySettings.java
@@ -490,6 +490,9 @@
                     if (!RotationPolicy.isRotationLockToggleVisible(context)) {
                         result.add(KEY_AUTO_ROTATE);
                     }
+                    if (!isTapToWakeAvailable(context.getResources())) {
+                        result.add(KEY_TAP_TO_WAKE);
+                    }
                     return result;
                 }
             };
diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index 5fb94f0..ea4f77a 100644
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -113,5 +113,6 @@
     public static class TopLevelSettings extends SettingsActivity { /* empty */ }
     public static class ApnSettingsActivity extends SettingsActivity { /* empty */ }
     public static class WifiCallingSettingsActivity extends SettingsActivity { /* empty */ }
+    public static class MemorySettingsActivity extends SettingsActivity { /* empty */ }
 }
 
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index 89231df..f376644 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -1039,7 +1039,7 @@
      */
     private void buildDashboardCategories(List<DashboardCategory> categories) {
         categories.clear();
-        loadCategoriesFromResource(R.xml.dashboard_categories, categories);
+        loadCategoriesFromResource(R.xml.dashboard_categories, categories, this);
         updateTilesList(categories);
     }
 
@@ -1050,10 +1050,11 @@
      * @param resid The XML resource to load and parse.
      * @param target The list in which the parsed categories and tiles should be placed.
      */
-    private void loadCategoriesFromResource(int resid, List<DashboardCategory> target) {
+    public static void loadCategoriesFromResource(int resid, List<DashboardCategory> target,
+            Context context) {
         XmlResourceParser parser = null;
         try {
-            parser = getResources().getXml(resid);
+            parser = context.getResources().getXml(resid);
             AttributeSet attrs = Xml.asAttributeSet(parser);
 
             int type;
@@ -1082,7 +1083,7 @@
                 if ("dashboard-category".equals(nodeName)) {
                     DashboardCategory category = new DashboardCategory();
 
-                    TypedArray sa = obtainStyledAttributes(
+                    TypedArray sa = context.obtainStyledAttributes(
                             attrs, com.android.internal.R.styleable.PreferenceHeader);
                     category.id = sa.getResourceId(
                             com.android.internal.R.styleable.PreferenceHeader_id,
@@ -1098,12 +1099,13 @@
                         }
                     }
                     sa.recycle();
-                    sa = obtainStyledAttributes(attrs, com.android.internal.R.styleable.Preference);
+                    sa = context.obtainStyledAttributes(attrs,
+                            com.android.internal.R.styleable.Preference);
                     tv = sa.peekValue(
                             com.android.internal.R.styleable.Preference_key);
                     if (tv != null && tv.type == TypedValue.TYPE_STRING) {
                         if (tv.resourceId != 0) {
-                            category.key = getString(tv.resourceId);
+                            category.key = context.getString(tv.resourceId);
                         } else {
                             category.key = tv.string.toString();
                         }
@@ -1121,7 +1123,7 @@
                         if (innerNodeName.equals("dashboard-tile")) {
                             DashboardTile tile = new DashboardTile();
 
-                            sa = obtainStyledAttributes(
+                            sa = context.obtainStyledAttributes(
                                     attrs, com.android.internal.R.styleable.PreferenceHeader);
                             tile.id = sa.getResourceId(
                                     com.android.internal.R.styleable.PreferenceHeader_id,
@@ -1163,11 +1165,13 @@
 
                                 String innerNodeName2 = parser.getName();
                                 if (innerNodeName2.equals("extra")) {
-                                    getResources().parseBundleExtra("extra", attrs, curBundle);
+                                    context.getResources().parseBundleExtra("extra", attrs,
+                                            curBundle);
                                     XmlUtils.skipCurrentTag(parser);
 
                                 } else if (innerNodeName2.equals("intent")) {
-                                    tile.intent = Intent.parseIntent(getResources(), parser, attrs);
+                                    tile.intent = Intent.parseIntent(context.getResources(), parser,
+                                            attrs);
 
                                 } else {
                                     XmlUtils.skipCurrentTag(parser);
@@ -1180,7 +1184,7 @@
                             }
 
                             // Show the SIM Cards setting if there are more than 2 SIMs installed.
-                            if(tile.id != R.id.sim_settings || Utils.showSimCardTile(this)){
+                            if(tile.id != R.id.sim_settings || Utils.showSimCardTile(context)){
                                 category.addTile(tile);
                             }
 
diff --git a/src/com/android/settings/SetupChooseLockGeneric.java b/src/com/android/settings/SetupChooseLockGeneric.java
index 82157c0..8b09a10 100644
--- a/src/com/android/settings/SetupChooseLockGeneric.java
+++ b/src/com/android/settings/SetupChooseLockGeneric.java
@@ -16,6 +16,7 @@
 
 package com.android.settings;
 
+import com.android.internal.widget.LockPatternUtils;
 import com.android.setupwizardlib.SetupWizardListLayout;
 import com.android.setupwizardlib.view.NavigationBar;
 
@@ -25,6 +26,7 @@
 import android.content.Intent;
 import android.content.res.Resources;
 import android.os.Bundle;
+import android.os.UserHandle;
 import android.preference.PreferenceFragment;
 import android.hardware.fingerprint.FingerprintManager;
 import android.view.LayoutInflater;
@@ -60,6 +62,8 @@
     public static class SetupChooseLockGenericFragment extends ChooseLockGenericFragment
             implements NavigationBar.NavigationBarListener {
 
+        private static final String EXTRA_PASSWORD_QUALITY = ":settings:password_quality";
+
         @Override
         public View onCreateView(LayoutInflater inflater, ViewGroup container,
                 Bundle savedInstanceState) {
@@ -91,6 +95,15 @@
         @Override
         public void onActivityResult(int requestCode, int resultCode, Intent data) {
             if (resultCode != RESULT_CANCELED) {
+                if (data == null) {
+                    data = new Intent();
+                }
+                // Add the password quality extra to the intent data that will be sent back for
+                // Setup Wizard.
+                LockPatternUtils lockPatternUtils = new LockPatternUtils(getActivity());
+                data.putExtra(EXTRA_PASSWORD_QUALITY,
+                        lockPatternUtils.getKeyguardStoredPasswordQuality(UserHandle.myUserId()));
+
                 super.onActivityResult(requestCode, resultCode, data);
             }
             // If the started activity was cancelled (e.g. the user presses back), then this
diff --git a/src/com/android/settings/applications/AppStorageSettings.java b/src/com/android/settings/applications/AppStorageSettings.java
index 808f738..739aa3c 100644
--- a/src/com/android/settings/applications/AppStorageSettings.java
+++ b/src/com/android/settings/applications/AppStorageSettings.java
@@ -121,6 +121,12 @@
         setupViews();
     }
 
+    @Override
+    public void onResume() {
+        super.onResume();
+        mState.requestSize(mPackageName, mUserId);
+    }
+
     private void setupViews() {
         mComputingStr = getActivity().getText(R.string.computing_size);
         mInvalidSizeStr = getActivity().getText(R.string.invalid_size_value);
diff --git a/src/com/android/settings/applications/ManageApplications.java b/src/com/android/settings/applications/ManageApplications.java
index 267c2b1..8281885 100644
--- a/src/com/android/settings/applications/ManageApplications.java
+++ b/src/com/android/settings/applications/ManageApplications.java
@@ -27,6 +27,7 @@
 import android.os.UserHandle;
 import android.os.UserManager;
 import android.preference.PreferenceFrameLayout;
+import android.provider.Settings;
 import android.util.ArraySet;
 import android.util.Log;
 import android.view.LayoutInflater;
@@ -239,6 +240,15 @@
             mListType = LIST_TYPE_HIGH_POWER;
             // Default to showing system.
             mShowSystem = true;
+            if (intent != null && Settings.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS
+                    .equals(intent.getAction())) {
+                mCurrentPkgName = intent.getData().getSchemeSpecificPart();
+                if (mCurrentPkgName != null) {
+                    mCurrentUid = mApplicationsState.getEntry(mCurrentPkgName,
+                            UserHandle.myUserId()).info.uid;
+                    startApplicationDetailsActivity();
+                }
+            }
         } else {
             mListType = LIST_TYPE_MAIN;
         }
@@ -440,7 +450,7 @@
                 startAppInfoFragment(AppStorageSettings.class, R.string.storage_settings);
                 break;
             case LIST_TYPE_HIGH_POWER:
-                startAppInfoFragment(HighPowerDetail.class, R.string.high_power_apps);
+                HighPowerDetail.show(getActivity(), mCurrentPkgName);
                 break;
             // TODO: Figure out if there is a way where we can spin up the profile's settings
             // process ahead of time, to avoid a long load of data when user clicks on a managed app.
diff --git a/src/com/android/settings/deviceinfo/MigrateEstimateTask.java b/src/com/android/settings/deviceinfo/MigrateEstimateTask.java
index bc8ff92..34a44ac 100644
--- a/src/com/android/settings/deviceinfo/MigrateEstimateTask.java
+++ b/src/com/android/settings/deviceinfo/MigrateEstimateTask.java
@@ -104,6 +104,7 @@
     protected void onPostExecute(Long result) {
         mSizeBytes = result;
         mTimeMillis = (mSizeBytes * DateUtils.SECOND_IN_MILLIS) / SPEED_ESTIMATE_BPS;
+        mTimeMillis = Math.max(mTimeMillis, DateUtils.SECOND_IN_MILLIS);
 
         final String size = Formatter.formatFileSize(mContext, mSizeBytes);
         final String time = DateUtils.formatDuration(mTimeMillis).toString();
diff --git a/src/com/android/settings/deviceinfo/PublicVolumeSettings.java b/src/com/android/settings/deviceinfo/PublicVolumeSettings.java
index dee644a..44c60e9 100644
--- a/src/com/android/settings/deviceinfo/PublicVolumeSettings.java
+++ b/src/com/android/settings/deviceinfo/PublicVolumeSettings.java
@@ -107,7 +107,7 @@
         mMount = buildAction(R.string.storage_menu_mount);
         mUnmount = buildAction(R.string.storage_menu_unmount);
         mFormat = buildAction(R.string.storage_menu_format);
-        mFormatInternal = buildAction(R.string.storage_menu_format_internal);
+        mFormatInternal = buildAction(R.string.storage_menu_format_private);
     }
 
     public void update() {
diff --git a/src/com/android/settings/deviceinfo/UsbModeChooserActivity.java b/src/com/android/settings/deviceinfo/UsbModeChooserActivity.java
index e0369d6..a6af01a 100644
--- a/src/com/android/settings/deviceinfo/UsbModeChooserActivity.java
+++ b/src/com/android/settings/deviceinfo/UsbModeChooserActivity.java
@@ -76,7 +76,9 @@
      * so that everything matches.
      */
     private int getCurrentFunction() {
-        if (mUsbManager.isFunctionEnabled(UsbManager.USB_FUNCTION_MTP)) {
+        if (!mUsbManager.isUsbDataUnlocked()) {
+            return 0;
+        } else if (mUsbManager.isFunctionEnabled(UsbManager.USB_FUNCTION_MTP)) {
             return 1;
         } else if (mUsbManager.isFunctionEnabled(UsbManager.USB_FUNCTION_PTP)) {
             return 2;
@@ -93,16 +95,20 @@
     private void setCurrentFunction(int which) {
         switch (which) {
             case 0:
-                mUsbManager.setCurrentFunction("none");
+                mUsbManager.setCurrentFunction(UsbManager.USB_FUNCTION_MTP);
+                mUsbManager.setUsbDataUnlocked(false);
                 break;
             case 1:
                 mUsbManager.setCurrentFunction(UsbManager.USB_FUNCTION_MTP);
+                mUsbManager.setUsbDataUnlocked(true);
                 break;
             case 2:
                 mUsbManager.setCurrentFunction(UsbManager.USB_FUNCTION_PTP);
+                mUsbManager.setUsbDataUnlocked(true);
                 break;
             case 3:
                 mUsbManager.setCurrentFunction(UsbManager.USB_FUNCTION_MIDI);
+                mUsbManager.setUsbDataUnlocked(true);
                 break;
         }
     }
diff --git a/src/com/android/settings/fingerprint/FingerprintEnrollEnrolling.java b/src/com/android/settings/fingerprint/FingerprintEnrollEnrolling.java
index 886cdb2..49c5e82 100644
--- a/src/com/android/settings/fingerprint/FingerprintEnrollEnrolling.java
+++ b/src/com/android/settings/fingerprint/FingerprintEnrollEnrolling.java
@@ -17,12 +17,15 @@
 package com.android.settings.fingerprint;
 
 import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
 import android.animation.ObjectAnimator;
+import android.animation.ValueAnimator;
 import android.app.AlertDialog;
 import android.app.Dialog;
 import android.app.DialogFragment;
 import android.content.DialogInterface;
 import android.content.Intent;
+import android.content.res.ColorStateList;
 import android.graphics.drawable.Animatable2;
 import android.graphics.drawable.AnimatedVectorDrawable;
 import android.graphics.drawable.Drawable;
@@ -50,6 +53,12 @@
     private static final int FINISH_DELAY = 250;
 
     /**
+     * If we don't see progress during this time, we show an error message to remind the user that
+     * he needs to lift the finger and touch again.
+     */
+    private static final int HINT_TIMEOUT_DURATION = 2500;
+
+    /**
      * How long the user needs to touch the icon until we show the dialog.
      */
     private static final long ICON_TOUCH_DURATION_UNTIL_DIALOG_SHOWN = 500;
@@ -67,10 +76,15 @@
     private TextView mRepeatMessage;
     private TextView mErrorText;
     private Interpolator mFastOutSlowInInterpolator;
+    private Interpolator mLinearOutSlowInInterpolator;
+    private Interpolator mFastOutLinearInInterpolator;
     private int mIconTouchCount;
     private FingerprintEnrollSidecar mSidecar;
     private boolean mAnimationCancelled;
     private AnimatedVectorDrawable mIconAnimationDrawable;
+    private int mIndicatorBackgroundRestingColor;
+    private int mIndicatorBackgroundActivatedColor;
+    private boolean mRestoring;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -86,6 +100,10 @@
         mIconAnimationDrawable.registerAnimationCallback(mIconAnimationCallback);
         mFastOutSlowInInterpolator = AnimationUtils.loadInterpolator(
                 this, android.R.interpolator.fast_out_slow_in);
+        mLinearOutSlowInInterpolator = AnimationUtils.loadInterpolator(
+                this, android.R.interpolator.linear_out_slow_in);
+        mFastOutLinearInInterpolator = AnimationUtils.loadInterpolator(
+                this, android.R.interpolator.fast_out_linear_in);
         mFingerprintAnimator.setOnTouchListener(new View.OnTouchListener() {
             @Override
             public boolean onTouch(View v, MotionEvent event) {
@@ -104,6 +122,11 @@
                 return true;
             }
         });
+        mIndicatorBackgroundRestingColor
+                = getColor(R.color.fingerprint_indicator_background_resting);
+        mIndicatorBackgroundActivatedColor
+                = getColor(R.color.fingerprint_indicator_background_activated);
+        mRestoring = savedInstanceState != null;
     }
 
     @Override
@@ -117,6 +140,9 @@
         mSidecar.setListener(this);
         updateProgress(false /* animate */);
         updateDescription();
+        if (mRestoring) {
+            startIconAnimation();
+        }
     }
 
     @Override
@@ -158,6 +184,34 @@
         mProgressAnim = anim;
     }
 
+    private void animateFlash() {
+        ValueAnimator anim = ValueAnimator.ofArgb(mIndicatorBackgroundRestingColor,
+                mIndicatorBackgroundActivatedColor);
+        final ValueAnimator.AnimatorUpdateListener listener =
+                new ValueAnimator.AnimatorUpdateListener() {
+            @Override
+            public void onAnimationUpdate(ValueAnimator animation) {
+                mFingerprintAnimator.setBackgroundTintList(ColorStateList.valueOf(
+                        (Integer) animation.getAnimatedValue()));
+            }
+        };
+        anim.addUpdateListener(listener);
+        anim.addListener(new AnimatorListenerAdapter() {
+            @Override
+            public void onAnimationEnd(Animator animation) {
+                ValueAnimator anim = ValueAnimator.ofArgb(mIndicatorBackgroundActivatedColor,
+                        mIndicatorBackgroundRestingColor);
+                anim.addUpdateListener(listener);
+                anim.setDuration(300);
+                anim.setInterpolator(mLinearOutSlowInInterpolator);
+                anim.start();
+            }
+        });
+        anim.setInterpolator(mFastOutSlowInInterpolator);
+        anim.setDuration(300);
+        anim.start();
+    }
+
     private void launchFinish(byte[] token) {
         Intent intent = new Intent();
         intent.setClassName("com.android.settings", FingerprintEnrollFinish.class.getName());
@@ -187,7 +241,7 @@
 
     @Override
     public void onEnrollmentError(CharSequence errString) {
-        mErrorText.setText(errString);
+        showError(errString);
         stopIconAnimation();
     }
 
@@ -195,7 +249,10 @@
     public void onEnrollmentProgressChange(int steps, int remaining) {
         updateProgress(true /* animate */);
         updateDescription();
-        mErrorText.setText("");
+        clearError();
+        animateFlash();
+        mErrorText.removeCallbacks(mTouchAgainRunnable);
+        mErrorText.postDelayed(mTouchAgainRunnable, HINT_TIMEOUT_DURATION);
     }
 
     private void updateProgress(boolean animate) {
@@ -221,6 +278,44 @@
         new IconTouchDialog().show(getFragmentManager(), null /* tag */);
     }
 
+    private void showError(CharSequence error) {
+        mErrorText.setText(error);
+        if (mErrorText.getVisibility() == View.INVISIBLE) {
+            mErrorText.setVisibility(View.VISIBLE);
+            mErrorText.setTranslationY(getResources().getDimensionPixelSize(
+                    R.dimen.fingerprint_error_text_appear_distance));
+            mErrorText.setAlpha(0f);
+            mErrorText.animate()
+                    .alpha(1f)
+                    .translationY(0f)
+                    .setDuration(200)
+                    .setInterpolator(mLinearOutSlowInInterpolator)
+                    .start();
+        } else {
+            mErrorText.animate().cancel();
+            mErrorText.setAlpha(1f);
+            mErrorText.setTranslationY(0f);
+        }
+    }
+
+    private void clearError() {
+        if (mErrorText.getVisibility() == View.VISIBLE) {
+            mErrorText.animate()
+                    .alpha(0f)
+                    .translationY(getResources().getDimensionPixelSize(
+                            R.dimen.fingerprint_error_text_disappear_distance))
+                    .setDuration(100)
+                    .setInterpolator(mFastOutLinearInInterpolator)
+                    .withEndAction(new Runnable() {
+                        @Override
+                        public void run() {
+                            mErrorText.setVisibility(View.INVISIBLE);
+                        }
+                    })
+                    .start();
+        }
+    }
+
     private final Animator.AnimatorListener mProgressAnimationListener
             = new Animator.AnimatorListener() {
 
@@ -274,6 +369,13 @@
         }
     };
 
+    private final Runnable mTouchAgainRunnable = new Runnable() {
+        @Override
+        public void run() {
+            showError(getString(R.string.security_settings_fingerprint_enroll_lift_touch_again));
+        }
+    };
+
     private static class IconTouchDialog extends DialogFragment {
 
         @Override
diff --git a/src/com/android/settings/fingerprint/FingerprintUiHelper.java b/src/com/android/settings/fingerprint/FingerprintUiHelper.java
index 10c0fe6..245cbb4 100644
--- a/src/com/android/settings/fingerprint/FingerprintUiHelper.java
+++ b/src/com/android/settings/fingerprint/FingerprintUiHelper.java
@@ -18,7 +18,6 @@
 
 import android.hardware.fingerprint.FingerprintManager;
 import android.os.CancellationSignal;
-import android.os.Vibrator;
 import android.view.View;
 import android.widget.ImageView;
 import android.widget.TextView;
@@ -31,8 +30,6 @@
 public class FingerprintUiHelper extends FingerprintManager.AuthenticationCallback {
 
     private static final long ERROR_TIMEOUT = 1300;
-    private static final long[] FP_ERROR_VIBRATE_PATTERN = new long[] {0, 30, 100, 30};
-    private static final long[] FP_SUCCESS_VIBRATE_PATTERN = new long[] {0, 30};
 
     private ImageView mIcon;
     private TextView mErrorTextView;
@@ -92,7 +89,7 @@
 
     @Override
     public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
-        vibrateFingerprintSuccess();
+        mIcon.setImageResource(R.drawable.ic_fingerprint_success);
         mCallback.onAuthenticated();
     }
 
@@ -101,21 +98,12 @@
             return;
         }
 
-        vibrateFingerprintError();
         mIcon.setImageResource(R.drawable.ic_fingerprint_error);
         mErrorTextView.setText(error);
         mErrorTextView.removeCallbacks(mResetErrorTextRunnable);
         mErrorTextView.postDelayed(mResetErrorTextRunnable, ERROR_TIMEOUT);
     }
 
-    private void vibrateFingerprintError() {
-        mIcon.getContext().getSystemService(Vibrator.class).vibrate(FP_ERROR_VIBRATE_PATTERN, -1);
-    }
-
-    private void vibrateFingerprintSuccess() {
-        mIcon.getContext().getSystemService(Vibrator.class).vibrate(FP_SUCCESS_VIBRATE_PATTERN, -1);
-    }
-
     private Runnable mResetErrorTextRunnable = new Runnable() {
         @Override
         public void run() {
diff --git a/src/com/android/settings/fuelgauge/HighPowerDetail.java b/src/com/android/settings/fuelgauge/HighPowerDetail.java
index e399a34..f6964af 100644
--- a/src/com/android/settings/fuelgauge/HighPowerDetail.java
+++ b/src/com/android/settings/fuelgauge/HighPowerDetail.java
@@ -16,60 +16,85 @@
 
 package com.android.settings.fuelgauge;
 
+import android.app.Activity;
 import android.app.AlertDialog;
+import android.app.Dialog;
+import android.app.DialogFragment;
 import android.content.Context;
+import android.content.DialogInterface;
+import android.content.DialogInterface.OnClickListener;
+import android.content.pm.PackageManager;
+import android.content.pm.PackageManager.NameNotFoundException;
 import android.os.Bundle;
-import android.preference.Preference;
-import android.preference.Preference.OnPreferenceChangeListener;
-import android.preference.SwitchPreference;
+import android.util.Pair;
+import android.util.SparseBooleanArray;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.TextView;
 
-import com.android.internal.logging.MetricsLogger;
 import com.android.settings.R;
-import com.android.settings.applications.AppInfoWithHeader;
+import com.android.settings.applications.AppInfoBase;
 import com.android.settingslib.applications.ApplicationsState.AppEntry;
 
-public class HighPowerDetail extends AppInfoWithHeader implements OnPreferenceChangeListener {
-
-    private static final String KEY_HIGH_POWER_SWITCH = "high_power_switch";
+public class HighPowerDetail extends DialogFragment implements OnClickListener {
 
     private final PowerWhitelistBackend mBackend = PowerWhitelistBackend.getInstance();
 
-    private SwitchPreference mUsageSwitch;
+    private String mPackageName;
+    private CharSequence mLabel;
+    private Adapter mAdapter;
+    private int mSelectedIndex;
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
-        addPreferencesFromResource(R.xml.high_power_details);
-        mUsageSwitch = (SwitchPreference) findPreference(KEY_HIGH_POWER_SWITCH);
-        mUsageSwitch.setOnPreferenceChangeListener(this);
-    }
-
-    @Override
-    protected boolean refreshUi() {
-        mUsageSwitch.setEnabled(!mBackend.isSysWhitelisted(mPackageName));
-        mUsageSwitch.setChecked(mBackend.isWhitelisted(mPackageName));
-        return true;
-    }
-
-    @Override
-    public boolean onPreferenceChange(Preference preference, Object newValue) {
-        if (newValue == Boolean.TRUE) {
-            mBackend.addApp(mPackageName);
-        } else {
-            mBackend.removeApp(mPackageName);
+        mPackageName = getArguments().getString(AppInfoBase.ARG_PACKAGE_NAME);
+        PackageManager pm = getContext().getPackageManager();
+        try {
+            mLabel = pm.getApplicationInfo(mPackageName, 0).loadLabel(pm);
+        } catch (NameNotFoundException e) {
+            mLabel = mPackageName;
         }
-        return true;
+        mAdapter = new Adapter(getContext(), R.layout.radio_with_summary);
+        mAdapter.add(new Pair<String, String>(getString(R.string.ignore_optimizations_on),
+                getString(R.string.ignore_optimizations_on_desc)));
+        mAdapter.add(new Pair<String, String>(getString(R.string.ignore_optimizations_off),
+                getString(R.string.ignore_optimizations_off_desc)));
+        mSelectedIndex = mBackend.isWhitelisted(mPackageName) ? 0 : 1;
+        if (mBackend.isSysWhitelisted(mPackageName)) {
+            mAdapter.setEnabled(1, false);
+        }
     }
 
     @Override
-    protected AlertDialog createDialog(int id, int errorCode) {
-        return null;
+    public Dialog onCreateDialog(Bundle savedInstanceState) {
+        AlertDialog.Builder b = new AlertDialog.Builder(getContext())
+                .setTitle(getString(R.string.ignore_optimizations_title, mLabel))
+                .setNegativeButton(R.string.cancel, null)
+                .setSingleChoiceItems(mAdapter, mSelectedIndex, this);
+        if (!mBackend.isSysWhitelisted(mPackageName)) {
+            b.setPositiveButton(R.string.done, this);
+        }
+        return b.create();
     }
 
     @Override
-    protected int getMetricsCategory() {
-        return MetricsLogger.FUELGAUGE_HIGH_POWER_DETAILS;
+    public void onClick(DialogInterface dialog, int which) {
+        if (which == DialogInterface.BUTTON_POSITIVE) {
+            boolean newValue = mSelectedIndex == 0;
+            boolean oldValue = mBackend.isWhitelisted(mPackageName);
+            if (newValue != oldValue) {
+                if (newValue) {
+                    mBackend.addApp(mPackageName);
+                } else {
+                    mBackend.removeApp(mPackageName);
+                }
+            }
+        } else {
+            mSelectedIndex = which;
+        }
     }
 
     public static CharSequence getSummary(Context context, AppEntry entry) {
@@ -81,4 +106,36 @@
                 ? R.string.high_power_on : R.string.high_power_off);
     }
 
+    public static void show(Activity activity, String packageName) {
+        HighPowerDetail fragment = new HighPowerDetail();
+        Bundle args = new Bundle();
+        args.putString(AppInfoBase.ARG_PACKAGE_NAME, packageName);
+        fragment.setArguments(args);
+        fragment.show(activity.getFragmentManager(), HighPowerDetail.class.getSimpleName());
+    }
+
+    private class Adapter extends ArrayAdapter<Pair<String, String>> {
+        private final SparseBooleanArray mEnabled = new SparseBooleanArray();
+
+        public Adapter(Context context, int resource) {
+            super(context, resource, android.R.id.title);
+        }
+
+        public void setEnabled(int index, boolean enabled) {
+            mEnabled.put(index, enabled);
+        }
+
+        public boolean isEnabled(int position) {
+            return mEnabled.get(position, true);
+        }
+
+        @Override
+        public View getView(int position, View convertView, ViewGroup parent) {
+            View view = super.getView(position, convertView, parent);
+            ((TextView) view.findViewById(android.R.id.title)).setText(getItem(position).first);
+            ((TextView) view.findViewById(android.R.id.summary)).setText(getItem(position).second);
+            view.setEnabled(isEnabled(position));
+            return view;
+        }
+    }
 }
diff --git a/src/com/android/settings/notification/NotificationSettings.java b/src/com/android/settings/notification/NotificationSettings.java
index 00f5497..98f2517 100644
--- a/src/com/android/settings/notification/NotificationSettings.java
+++ b/src/com/android/settings/notification/NotificationSettings.java
@@ -198,11 +198,16 @@
     private void updateRingOrNotificationPreference() {
         mRingOrNotificationPreference.showIcon(mSuppressor != null
                 ? com.android.internal.R.drawable.ic_audio_ring_notif_mute
-                : mRingerMode == AudioManager.RINGER_MODE_VIBRATE
+                : mRingerMode == AudioManager.RINGER_MODE_VIBRATE || wasRingerModeVibrate()
                 ? com.android.internal.R.drawable.ic_audio_ring_notif_vibrate
                 : com.android.internal.R.drawable.ic_audio_ring_notif);
     }
 
+    private boolean wasRingerModeVibrate() {
+        return mVibrator != null && mRingerMode == AudioManager.RINGER_MODE_SILENT
+                && mAudioManager.getLastAudibleStreamVolume(AudioManager.STREAM_RING) == 0;
+    }
+
     private void updateRingerMode() {
         final int ringerMode = mAudioManager.getRingerModeInternal();
         if (mRingerMode == ringerMode) return;
diff --git a/src/com/android/settings/notification/VolumeSeekBarPreference.java b/src/com/android/settings/notification/VolumeSeekBarPreference.java
index 409944f..2bbf9ef 100644
--- a/src/com/android/settings/notification/VolumeSeekBarPreference.java
+++ b/src/com/android/settings/notification/VolumeSeekBarPreference.java
@@ -48,6 +48,7 @@
     private TextView mSuppressionTextView;
     private String mSuppressionText;
     private boolean mMuted;
+    private boolean mZenMuted;
     private int mIconResId;
     private int mMuteIconResId;
     private boolean mStopped;
@@ -122,9 +123,10 @@
                 }
             }
             @Override
-            public void onMuted(boolean muted) {
-                if (mMuted == muted) return;
+            public void onMuted(boolean muted, boolean zenMuted) {
+                if (mMuted == muted && mZenMuted == zenMuted) return;
                 mMuted = muted;
+                mZenMuted = zenMuted;
                 updateIconView();
             }
         };
@@ -150,7 +152,7 @@
         if (mIconView == null) return;
         if (mIconResId != 0) {
             mIconView.setImageResource(mIconResId);
-        } else if (mMuteIconResId != 0 && mMuted) {
+        } else if (mMuteIconResId != 0 && mMuted && !mZenMuted) {
             mIconView.setImageResource(mMuteIconResId);
         } else {
             mIconView.setImageDrawable(getIcon());
diff --git a/src/com/android/settings/sim/SimPreferenceDialog.java b/src/com/android/settings/sim/SimPreferenceDialog.java
new file mode 100644
index 0000000..f03b452
--- /dev/null
+++ b/src/com/android/settings/sim/SimPreferenceDialog.java
@@ -0,0 +1,254 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.settings.sim;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.res.Resources;
+import android.graphics.Paint;
+import android.graphics.drawable.ShapeDrawable;
+import android.graphics.drawable.shapes.OvalShape;
+import android.os.Bundle;
+import android.telephony.PhoneNumberUtils;
+import android.telephony.SubscriptionInfo;
+import android.telephony.SubscriptionManager;
+import android.telephony.TelephonyManager;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.Spinner;
+import android.widget.TextView;
+
+import com.android.settings.R;
+
+public class SimPreferenceDialog extends Activity {
+
+    private Context mContext;
+    private SubscriptionInfo mSubInfoRecord;
+    private int mSlotId;
+    private int[] mTintArr;
+    private String[] mColorStrings;
+    private int mTintSelectorPos;
+    private SubscriptionManager mSubscriptionManager;
+    AlertDialog.Builder mBuilder;
+    View mDialogLayout;
+    private final String SIM_NAME = "sim_name";
+    private final String TINT_POS = "tint_pos";
+
+    @Override
+    public void onCreate(Bundle bundle) {
+        super.onCreate(bundle);
+        mContext = this;
+        final Bundle extras = getIntent().getExtras();
+        mSlotId = extras.getInt(SimSettings.EXTRA_SLOT_ID, -1);
+        mSubscriptionManager = SubscriptionManager.from(mContext);
+        mSubInfoRecord = mSubscriptionManager.getActiveSubscriptionInfoForSimSlotIndex(mSlotId);
+        mTintArr = mContext.getResources().getIntArray(com.android.internal.R.array.sim_colors);
+        mColorStrings = mContext.getResources().getStringArray(R.array.color_picker);
+        mTintSelectorPos = 0;
+
+        mBuilder = new AlertDialog.Builder(mContext);
+        LayoutInflater inflater = (LayoutInflater)mContext
+                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+        mDialogLayout = inflater.inflate(R.layout.multi_sim_dialog, null);
+        mBuilder.setView(mDialogLayout);
+
+        createEditDialog(bundle);
+    }
+
+    @Override
+    public void onSaveInstanceState(Bundle savedInstanceState) {
+        savedInstanceState.putInt(TINT_POS, mTintSelectorPos);
+
+        final EditText nameText = (EditText)mDialogLayout.findViewById(R.id.sim_name);
+        savedInstanceState.putString(SIM_NAME, nameText.getText().toString());
+
+        super.onSaveInstanceState(savedInstanceState);
+
+    }
+
+    @Override
+    public void onRestoreInstanceState(Bundle savedInstanceState) {
+        super.onRestoreInstanceState(savedInstanceState);
+
+        int pos = savedInstanceState.getInt(TINT_POS);
+        final Spinner tintSpinner = (Spinner) mDialogLayout.findViewById(R.id.spinner);
+        tintSpinner.setSelection(pos);
+        mTintSelectorPos = pos;
+
+        EditText nameText = (EditText)mDialogLayout.findViewById(R.id.sim_name);
+        nameText.setText(savedInstanceState.getString(SIM_NAME));
+    }
+
+    private void createEditDialog(Bundle bundle) {
+        final Resources res = mContext.getResources();
+        EditText nameText = (EditText)mDialogLayout.findViewById(R.id.sim_name);
+        nameText.setText(mSubInfoRecord.getDisplayName());
+
+        final Spinner tintSpinner = (Spinner) mDialogLayout.findViewById(R.id.spinner);
+        SelectColorAdapter adapter = new SelectColorAdapter(mContext,
+                R.layout.settings_color_picker_item, mColorStrings);
+        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+        tintSpinner.setAdapter(adapter);
+
+        for (int i = 0; i < mTintArr.length; i++) {
+            if (mTintArr[i] == mSubInfoRecord.getIconTint()) {
+                tintSpinner.setSelection(i);
+                mTintSelectorPos = i;
+                break;
+            }
+        }
+
+        tintSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+            @Override
+            public void onItemSelected(AdapterView<?> parent, View view,
+                                       int pos, long id){
+                tintSpinner.setSelection(pos);
+                mTintSelectorPos = pos;
+            }
+
+            @Override
+            public void onNothingSelected(AdapterView<?> parent) {
+            }
+        });
+
+        final TelephonyManager tm = (TelephonyManager) mContext.getSystemService(
+                Context.TELEPHONY_SERVICE);
+        TextView numberView = (TextView)mDialogLayout.findViewById(R.id.number);
+        final String rawNumber =  tm.getLine1NumberForSubscriber(
+                mSubInfoRecord.getSubscriptionId());
+        if (TextUtils.isEmpty(rawNumber)) {
+            numberView.setText(res.getString(com.android.internal.R.string.unknownName));
+        } else {
+            numberView.setText(PhoneNumberUtils.formatNumber(rawNumber));
+        }
+
+        String simCarrierName = tm.getSimOperatorNameForSubscription(mSubInfoRecord
+                .getSubscriptionId());
+        TextView carrierView = (TextView)mDialogLayout.findViewById(R.id.carrier);
+        carrierView.setText(!TextUtils.isEmpty(simCarrierName) ? simCarrierName :
+                mContext.getString(com.android.internal.R.string.unknownName));
+
+        mBuilder.setTitle(String.format(res.getString(R.string.sim_editor_title),
+                (mSubInfoRecord.getSimSlotIndex() + 1)));
+
+        mBuilder.setPositiveButton(R.string.okay, new DialogInterface.OnClickListener() {
+            @Override
+            public void onClick(DialogInterface dialog, int whichButton) {
+                final EditText nameText = (EditText)mDialogLayout.findViewById(R.id.sim_name);
+
+                String displayName = nameText.getText().toString();
+                int subId = mSubInfoRecord.getSubscriptionId();
+                mSubInfoRecord.setDisplayName(displayName);
+                mSubscriptionManager.setDisplayName(displayName, subId,
+                        SubscriptionManager.NAME_SOURCE_USER_INPUT);
+
+                final int tintSelected = tintSpinner.getSelectedItemPosition();
+                int subscriptionId = mSubInfoRecord.getSubscriptionId();
+                int tint = mTintArr[tintSelected];
+                mSubInfoRecord.setIconTint(tint);
+                mSubscriptionManager.setIconTint(tint, subscriptionId);
+                dialog.dismiss();
+                finish();
+            }
+        });
+
+        mBuilder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
+            @Override
+            public void onClick(DialogInterface dialog, int whichButton) {
+                dialog.dismiss();
+                finish();
+            }
+        });
+
+        mBuilder.create().show();
+    }
+
+    private class SelectColorAdapter extends ArrayAdapter<CharSequence> {
+        private Context mContext;
+        private int mResId;
+
+        public SelectColorAdapter(
+                Context context, int resource, String[] arr) {
+            super(context, resource, arr);
+            mContext = context;
+            mResId = resource;
+        }
+
+        @Override
+        public View getView(int position, View convertView, ViewGroup parent) {
+            LayoutInflater inflater = (LayoutInflater)
+                    mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+
+            View rowView;
+            final ViewHolder holder;
+            Resources res = mContext.getResources();
+            int iconSize = res.getDimensionPixelSize(R.dimen.color_swatch_size);
+            int strokeWidth = res.getDimensionPixelSize(R.dimen.color_swatch_stroke_width);
+
+            if (convertView == null) {
+                // Cache views for faster scrolling
+                rowView = inflater.inflate(mResId, null);
+                holder = new ViewHolder();
+                ShapeDrawable drawable = new ShapeDrawable(new OvalShape());
+                drawable.setIntrinsicHeight(iconSize);
+                drawable.setIntrinsicWidth(iconSize);
+                drawable.getPaint().setStrokeWidth(strokeWidth);
+                holder.label = (TextView) rowView.findViewById(R.id.color_text);
+                holder.icon = (ImageView) rowView.findViewById(R.id.color_icon);
+                holder.swatch = drawable;
+                rowView.setTag(holder);
+            } else {
+                rowView = convertView;
+                holder = (ViewHolder) rowView.getTag();
+            }
+
+            holder.label.setText(getItem(position));
+            holder.swatch.getPaint().setColor(mTintArr[position]);
+            holder.swatch.getPaint().setStyle(Paint.Style.FILL_AND_STROKE);
+            holder.icon.setVisibility(View.VISIBLE);
+            holder.icon.setImageDrawable(holder.swatch);
+            return rowView;
+        }
+
+        @Override
+        public View getDropDownView(int position, View convertView, ViewGroup parent) {
+            View rowView = getView(position, convertView, parent);
+            final ViewHolder holder = (ViewHolder) rowView.getTag();
+
+            if (mTintSelectorPos == position) {
+                holder.swatch.getPaint().setStyle(Paint.Style.FILL_AND_STROKE);
+            } else {
+                holder.swatch.getPaint().setStyle(Paint.Style.STROKE);
+            }
+            holder.icon.setVisibility(View.VISIBLE);
+            return rowView;
+        }
+
+        private class ViewHolder {
+            TextView label;
+            ImageView icon;
+            ShapeDrawable swatch;
+        }
+    }
+}
diff --git a/src/com/android/settings/sim/SimSettings.java b/src/com/android/settings/sim/SimSettings.java
index 6d7ee4f..23e6275 100644
--- a/src/com/android/settings/sim/SimSettings.java
+++ b/src/com/android/settings/sim/SimSettings.java
@@ -16,15 +16,10 @@
 
 package com.android.settings.sim;
 
-import android.app.AlertDialog;
 import android.content.Context;
-import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.res.Resources;
-import android.graphics.Paint;
 import android.graphics.drawable.BitmapDrawable;
-import android.graphics.drawable.ShapeDrawable;
-import android.graphics.drawable.shapes.OvalShape;
 import android.os.Bundle;
 import android.preference.Preference;
 import android.preference.PreferenceScreen;
@@ -33,20 +28,10 @@
 import android.telephony.SubscriptionInfo;
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
-import android.telephony.PhoneNumberUtils;
 import android.telecom.PhoneAccountHandle;
 import android.telecom.TelecomManager;
 import android.text.TextUtils;
 import android.util.Log;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.widget.ArrayAdapter;
-import android.widget.EditText;
-import android.widget.ImageView;
-import android.widget.Spinner;
-import android.widget.TextView;
-import android.view.ViewGroup;
-import android.widget.AdapterView;
 import com.android.internal.logging.MetricsLogger;
 import com.android.settings.RestrictedSettingsFragment;
 import com.android.settings.Utils;
@@ -68,6 +53,7 @@
     private static final String KEY_CELLULAR_DATA = "sim_cellular_data";
     private static final String KEY_CALLS = "sim_calls";
     private static final String KEY_SMS = "sim_sms";
+    public static final String EXTRA_SLOT_ID = "slot_id";
 
     /**
      * By UX design we use only one Subscription Information(SubInfo) record per SIM slot.
@@ -250,7 +236,9 @@
         intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
 
         if (preference instanceof SimPreference) {
-            ((SimPreference)preference).createEditDialog((SimPreference)preference);
+            Intent newIntent = new Intent(context, SimPreferenceDialog.class);
+            newIntent.putExtra(EXTRA_SLOT_ID, ((SimPreference)preference).getSlotId());
+            startActivity(newIntent);
         } else if (findPreference(KEY_CELLULAR_DATA) == preference) {
             intent.putExtra(SimDialogActivity.DIALOG_TYPE_KEY, SimDialogActivity.DATA_PICK);
             context.startActivity(intent);
@@ -265,13 +253,10 @@
         return true;
     }
 
-    private class SimPreference extends Preference{
+    private class SimPreference extends Preference {
         private SubscriptionInfo mSubInfoRecord;
         private int mSlotId;
-        private int[] mTintArr;
         Context mContext;
-        private String[] mColorStrings;
-        private int mTintSelectorPos;
 
         public SimPreference(Context context, SubscriptionInfo subInfoRecord, int slotId) {
             super(context);
@@ -281,9 +266,6 @@
             mSlotId = slotId;
             setKey("sim" + mSlotId);
             update();
-            mTintArr = context.getResources().getIntArray(com.android.internal.R.array.sim_colors);
-            mColorStrings = context.getResources().getStringArray(R.array.color_picker);
-            mTintSelectorPos = 0;
         }
 
         public void update() {
@@ -307,172 +289,9 @@
             }
         }
 
-        public SubscriptionInfo getSubInfoRecord() {
-            return mSubInfoRecord;
+        private int getSlotId() {
+            return mSlotId;
         }
-
-        public void createEditDialog(SimPreference simPref) {
-            final Resources res = mContext.getResources();
-
-            AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
-
-            LayoutInflater inflater = (LayoutInflater)mContext
-                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-            final View dialogLayout = inflater.inflate(
-                    R.layout.multi_sim_dialog, null);
-            builder.setView(dialogLayout);
-
-            EditText nameText = (EditText)dialogLayout.findViewById(R.id.sim_name);
-            nameText.setText(mSubInfoRecord.getDisplayName());
-
-            final Spinner tintSpinner = (Spinner) dialogLayout.findViewById(R.id.spinner);
-            SelectColorAdapter adapter = new SelectColorAdapter(getContext(),
-                     R.layout.settings_color_picker_item, mColorStrings);
-            adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
-            tintSpinner.setAdapter(adapter);
-
-            for (int i = 0; i < mTintArr.length; i++) {
-                if (mTintArr[i] == mSubInfoRecord.getIconTint()) {
-                    tintSpinner.setSelection(i);
-                    mTintSelectorPos = i;
-                    break;
-                }
-            }
-
-            tintSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
-                @Override
-                public void onItemSelected(AdapterView<?> parent, View view,
-                    int pos, long id){
-                    tintSpinner.setSelection(pos);
-                    mTintSelectorPos = pos;
-                }
-
-                @Override
-                public void onNothingSelected(AdapterView<?> parent) {
-                }
-            });
-
-            TextView numberView = (TextView)dialogLayout.findViewById(R.id.number);
-            final String rawNumber = getPhoneNumber(mSubInfoRecord);
-            if (TextUtils.isEmpty(rawNumber)) {
-                numberView.setText(res.getString(com.android.internal.R.string.unknownName));
-            } else {
-                numberView.setText(PhoneNumberUtils.formatNumber(rawNumber));
-            }
-
-            final TelephonyManager tm =
-                        (TelephonyManager) mContext.getSystemService(
-                        Context.TELEPHONY_SERVICE);
-            String simCarrierName = tm.getSimOperatorNameForSubscription(mSubInfoRecord
-                        .getSubscriptionId());
-            TextView carrierView = (TextView)dialogLayout.findViewById(R.id.carrier);
-            carrierView.setText(!TextUtils.isEmpty(simCarrierName) ? simCarrierName :
-                    getContext().getString(com.android.internal.R.string.unknownName));
-
-            builder.setTitle(String.format(res.getString(R.string.sim_editor_title),
-                    (mSubInfoRecord.getSimSlotIndex() + 1)));
-
-            builder.setPositiveButton(R.string.okay, new DialogInterface.OnClickListener() {
-                @Override
-                public void onClick(DialogInterface dialog, int whichButton) {
-                    final EditText nameText = (EditText)dialogLayout.findViewById(R.id.sim_name);
-
-                    String displayName = nameText.getText().toString();
-                    int subId = mSubInfoRecord.getSubscriptionId();
-                    mSubInfoRecord.setDisplayName(displayName);
-                    mSubscriptionManager.setDisplayName(displayName, subId,
-                            SubscriptionManager.NAME_SOURCE_USER_INPUT);
-
-                    final int tintSelected = tintSpinner.getSelectedItemPosition();
-                    int subscriptionId = mSubInfoRecord.getSubscriptionId();
-                    int tint = mTintArr[tintSelected];
-                    mSubInfoRecord.setIconTint(tint);
-                    mSubscriptionManager.setIconTint(tint, subscriptionId);
-
-                    updateAllOptions();
-                    update();
-                }
-            });
-
-            builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
-                @Override
-                public void onClick(DialogInterface dialog, int whichButton) {
-                    dialog.dismiss();
-                }
-            });
-
-            builder.create().show();
-        }
-
-        private class SelectColorAdapter extends ArrayAdapter<CharSequence> {
-            private Context mContext;
-            private int mResId;
-
-            public SelectColorAdapter(
-                Context context, int resource, String[] arr) {
-                super(context, resource, arr);
-                mContext = context;
-                mResId = resource;
-            }
-
-            @Override
-            public View getView(int position, View convertView, ViewGroup parent) {
-                LayoutInflater inflater = (LayoutInflater)
-                    mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-
-                View rowView;
-                final ViewHolder holder;
-                Resources res = mContext.getResources();
-                int iconSize = res.getDimensionPixelSize(R.dimen.color_swatch_size);
-                int strokeWidth = res.getDimensionPixelSize(R.dimen.color_swatch_stroke_width);
-
-                if (convertView == null) {
-                    // Cache views for faster scrolling
-                    rowView = inflater.inflate(mResId, null);
-                    holder = new ViewHolder();
-                    ShapeDrawable drawable = new ShapeDrawable(new OvalShape());
-                    drawable.setIntrinsicHeight(iconSize);
-                    drawable.setIntrinsicWidth(iconSize);
-                    drawable.getPaint().setStrokeWidth(strokeWidth);
-                    holder.label = (TextView) rowView.findViewById(R.id.color_text);
-                    holder.icon = (ImageView) rowView.findViewById(R.id.color_icon);
-                    holder.swatch = drawable;
-                    rowView.setTag(holder);
-                } else {
-                    rowView = convertView;
-                    holder = (ViewHolder) rowView.getTag();
-                }
-
-                holder.label.setText(getItem(position));
-                holder.swatch.getPaint().setColor(mTintArr[position]);
-                holder.swatch.getPaint().setStyle(Paint.Style.FILL_AND_STROKE);
-                holder.icon.setVisibility(View.VISIBLE);
-                holder.icon.setImageDrawable(holder.swatch);
-                return rowView;
-            }
-
-            @Override
-            public View getDropDownView(int position, View convertView, ViewGroup parent) {
-                View rowView = getView(position, convertView, parent);
-                final ViewHolder holder = (ViewHolder) rowView.getTag();
-
-                if (mTintSelectorPos == position) {
-                    holder.swatch.getPaint().setStyle(Paint.Style.FILL_AND_STROKE);
-                } else {
-                    holder.swatch.getPaint().setStyle(Paint.Style.STROKE);
-                }
-                holder.icon.setVisibility(View.VISIBLE);
-                return rowView;
-            }
-
-            private class ViewHolder {
-                TextView label;
-                ImageView icon;
-                ShapeDrawable swatch;
-            }
-        }
-
-
     }
 
     // Returns the line1Number. Line1number should always be read from TelephonyManager since it can