Merge "Update the settings due to a framework API change."
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 4388f0b..009f605 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -97,7 +97,7 @@
         </activity>
 
         <activity android:name="CreateShortcut" android:label="@string/settings_shortcut"
-            android:theme="@style/Theme.CreateShortCut">
+            android:theme="@style/Theme.SubSettingsDialogWhenLarge">
             <intent-filter>
                 <action android:name="android.intent.action.CREATE_SHORTCUT" />
                 <category android:name="android.intent.category.DEFAULT" />
@@ -169,6 +169,7 @@
         </activity>
 
         <activity android:name=".wifi.WifiSetupActivity"
+                android:taskAffinity="com.android.wizard"
                 android:theme="@style/SetupWizardWifiTheme"
                 android:label="@string/wifi_setup_wizard_title"
                 android:icon="@drawable/empty_icon"
@@ -205,7 +206,7 @@
         </activity>
 
         <activity android:name=".wifi.WifiInfo"
-                android:theme="@android:style/Theme.Quantum.Light.DialogWhenLarge"
+                android:theme="@style/Theme.SubSettingsDialogWhenLarge"
                 android:taskAffinity="com.android.settings"
                 android:parentActivityName="Settings$WifiSettingsActivity">
             <intent-filter>
@@ -216,7 +217,7 @@
         </activity>
 
         <activity android:name=".wifi.WifiConfigInfo"
-                android:theme="@android:style/Theme.Quantum.Light.DialogWhenLarge"
+                android:theme="@style/Theme.SubSettingsDialogWhenLarge"
                 android:taskAffinity="com.android.settings"
                 android:parentActivityName="Settings$WifiSettingsActivity">
             <intent-filter>
@@ -227,7 +228,7 @@
         </activity>
 
         <activity android:name=".wifi.WifiAPITest"
-                android:theme="@android:style/Theme.Quantum.Light.DialogWhenLarge">
+                android:theme="@style/Theme.SubSettingsDialogWhenLarge">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN"/>
                 <category android:name="android.intent.category.DEVELOPMENT_PREFERENCE" />
@@ -236,7 +237,7 @@
         </activity>
 
         <activity android:name=".wifi.WifiStatusTest"
-                android:theme="@android:style/Theme.Quantum.Light.DialogWhenLarge">
+                android:theme="@style/Theme.SubSettingsDialogWhenLarge">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN"/>
                 <category android:name="android.intent.category.DEVELOPMENT_PREFERENCE" />
@@ -297,7 +298,7 @@
         </activity-alias>
 
         <activity android:name=".bluetooth.DevicePickerActivity"
-                android:theme="@android:style/Theme.Quantum.Light.DialogWhenLarge"
+                android:theme="@style/Theme.SubSettingsDialogWhenLarge"
                 android:label="@string/device_picker"
                 android:clearTaskOnLaunch="true">
             <intent-filter>
@@ -570,7 +571,7 @@
         </activity-alias>
 
         <activity android:name="Settings$DeviceInfoSettingsActivity"
-                android:theme="@android:style/Theme.Quantum.Light.DialogWhenLarge"
+                android:theme="@style/Theme.SubSettingsDialogWhenLarge"
                 android:label="@string/device_info_settings"
                 android:taskAffinity="com.android.settings"
                 android:parentActivityName="Settings">
@@ -734,7 +735,8 @@
         </activity>
 
         <activity android:name="Settings$NotificationStationActivity"
-                android:label="@string/sound_category_notification_title"
+                android:theme="@android:style/Theme.DeviceDefault"
+                android:label="@string/notification_log_title"
                 android:taskAffinity=""
                 android:excludeFromRecents="true">
             <intent-filter>
@@ -862,7 +864,7 @@
         </activity>
 
         <activity android:name="SetFullBackupPassword"
-                android:theme="@android:style/Theme.Quantum.Light.DialogWhenLarge"
+                android:theme="@style/Theme.SubSettingsDialogWhenLarge"
                 android:exported="false">
         </activity>
 
@@ -906,7 +908,7 @@
 
         <activity android:name="DeviceAdminAdd"
                 android:label="@string/device_admin_add_title"
-                android:theme="@android:style/Theme.Quantum.Light.DialogWhenLarge"
+                android:theme="@style/Theme.SubSettingsDialogWhenLarge"
                 android:clearTaskOnLaunch="true">
             <intent-filter>
                 <action android:name="android.app.action.ADD_DEVICE_ADMIN" />
@@ -916,7 +918,7 @@
 
         <activity android:name="IccLockSettings"
                 android:label="@string/sim_lock_settings"
-                android:theme="@android:style/Theme.Quantum.Light.DialogWhenLarge"
+                android:theme="@style/Theme.SubSettingsDialogWhenLarge"
                 android:process="com.android.phone">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
@@ -1033,7 +1035,7 @@
         <!-- Runs in the phone process since it needs access to the Phone object -->
         <activity android:name=".deviceinfo.Status"
                 android:label="@string/device_status_activity_title"
-                android:theme="@android:style/Theme.Quantum.Light.DialogWhenLarge"
+                android:theme="@style/Theme.SubSettingsDialogWhenLarge"
                 android:process="com.android.phone">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
@@ -1060,7 +1062,7 @@
         </activity>
 
         <activity android:name=".deviceinfo.MiscFilesHandler"
-                android:theme="@android:style/Theme.Quantum.Light.DialogWhenLarge"/>
+                android:theme="@style/Theme.SubSettingsDialogWhenLarge"/>
 
         <activity android:name="ApnEditor"
                 android:label="@string/apn_edit">
@@ -1504,7 +1506,7 @@
         <activity android:name="com.android.settings.accounts.ChooseAccountActivity"
             android:label="@string/header_add_an_account"
             android:configChanges="orientation|keyboardHidden|screenSize"
-            android:theme="@android:style/Theme.Quantum.Light.DialogWhenLarge"/>
+            android:theme="@style/Theme.SubSettingsDialogWhenLarge"/>
 
         <activity android:name=".CryptKeeper"
                   android:immersive="true"
@@ -1512,7 +1514,8 @@
                   android:excludeFromRecents="true"
                   android:theme="@android:style/Theme.Quantum.Light.NoActionBar"
                   android:configChanges="keyboard|keyboardHidden|uiMode"
-                  android:windowSoftInputMode="adjustResize">
+                  android:windowSoftInputMode="adjustResize"
+                  android:screenOrientation="nosensor">
             <intent-filter android:priority="10">
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.HOME" />
@@ -1695,7 +1698,6 @@
                 <action android:name="android.settings.SOUND_SETTINGS" />
                 <category android:name="android.intent.category.DEFAULT" />
                 <category android:name="android.intent.category.VOICE_LAUNCH" />
-                <category android:name="com.android.settings.SHORTCUT" />
             </intent-filter>
             <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
                 android:value="com.android.settings.notification.NotificationSettings" />
diff --git a/res/drawable-hdpi/ic_wifi_lock_signal_0_dark.png b/res/drawable-hdpi/ic_wifi_lock_signal_0_dark.png
new file mode 100644
index 0000000..57f2839
--- /dev/null
+++ b/res/drawable-hdpi/ic_wifi_lock_signal_0_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_wifi_lock_signal_0_light.png b/res/drawable-hdpi/ic_wifi_lock_signal_0_light.png
new file mode 100644
index 0000000..0bc4109
--- /dev/null
+++ b/res/drawable-hdpi/ic_wifi_lock_signal_0_light.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_wifi_lock_signal_1_dark.png b/res/drawable-hdpi/ic_wifi_lock_signal_1_dark.png
index 2ec38ae..d153336 100644
--- a/res/drawable-hdpi/ic_wifi_lock_signal_1_dark.png
+++ b/res/drawable-hdpi/ic_wifi_lock_signal_1_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_wifi_lock_signal_1_light.png b/res/drawable-hdpi/ic_wifi_lock_signal_1_light.png
index 8b0009b..72ae32f 100644
--- a/res/drawable-hdpi/ic_wifi_lock_signal_1_light.png
+++ b/res/drawable-hdpi/ic_wifi_lock_signal_1_light.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_wifi_lock_signal_2_dark.png b/res/drawable-hdpi/ic_wifi_lock_signal_2_dark.png
index a3383a8..7ffbc84 100644
--- a/res/drawable-hdpi/ic_wifi_lock_signal_2_dark.png
+++ b/res/drawable-hdpi/ic_wifi_lock_signal_2_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_wifi_lock_signal_2_light.png b/res/drawable-hdpi/ic_wifi_lock_signal_2_light.png
index b79d3e5..2259d3d 100644
--- a/res/drawable-hdpi/ic_wifi_lock_signal_2_light.png
+++ b/res/drawable-hdpi/ic_wifi_lock_signal_2_light.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_wifi_lock_signal_3_dark.png b/res/drawable-hdpi/ic_wifi_lock_signal_3_dark.png
index e2cb17e..73ab082 100644
--- a/res/drawable-hdpi/ic_wifi_lock_signal_3_dark.png
+++ b/res/drawable-hdpi/ic_wifi_lock_signal_3_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_wifi_lock_signal_3_light.png b/res/drawable-hdpi/ic_wifi_lock_signal_3_light.png
index 053c7af..356f2fa 100644
--- a/res/drawable-hdpi/ic_wifi_lock_signal_3_light.png
+++ b/res/drawable-hdpi/ic_wifi_lock_signal_3_light.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_wifi_lock_signal_4_dark.png b/res/drawable-hdpi/ic_wifi_lock_signal_4_dark.png
index 65b02dd..3b47049 100644
--- a/res/drawable-hdpi/ic_wifi_lock_signal_4_dark.png
+++ b/res/drawable-hdpi/ic_wifi_lock_signal_4_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_wifi_lock_signal_4_light.png b/res/drawable-hdpi/ic_wifi_lock_signal_4_light.png
index 0516bd4..4f69b27 100644
--- a/res/drawable-hdpi/ic_wifi_lock_signal_4_light.png
+++ b/res/drawable-hdpi/ic_wifi_lock_signal_4_light.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_wifi_signal_0_dark.png b/res/drawable-hdpi/ic_wifi_signal_0_dark.png
new file mode 100644
index 0000000..20519fd
--- /dev/null
+++ b/res/drawable-hdpi/ic_wifi_signal_0_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_wifi_signal_0_light.png b/res/drawable-hdpi/ic_wifi_signal_0_light.png
new file mode 100644
index 0000000..99c4932
--- /dev/null
+++ b/res/drawable-hdpi/ic_wifi_signal_0_light.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_wifi_signal_1_dark.png b/res/drawable-hdpi/ic_wifi_signal_1_dark.png
index f3f0208..8b055b0 100644
--- a/res/drawable-hdpi/ic_wifi_signal_1_dark.png
+++ b/res/drawable-hdpi/ic_wifi_signal_1_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_wifi_signal_1_light.png b/res/drawable-hdpi/ic_wifi_signal_1_light.png
index d9968b9..217b7ff 100644
--- a/res/drawable-hdpi/ic_wifi_signal_1_light.png
+++ b/res/drawable-hdpi/ic_wifi_signal_1_light.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_wifi_signal_2_dark.png b/res/drawable-hdpi/ic_wifi_signal_2_dark.png
index 9541c38..9514eae 100644
--- a/res/drawable-hdpi/ic_wifi_signal_2_dark.png
+++ b/res/drawable-hdpi/ic_wifi_signal_2_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_wifi_signal_2_light.png b/res/drawable-hdpi/ic_wifi_signal_2_light.png
index d3065de..a992720 100644
--- a/res/drawable-hdpi/ic_wifi_signal_2_light.png
+++ b/res/drawable-hdpi/ic_wifi_signal_2_light.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_wifi_signal_3_dark.png b/res/drawable-hdpi/ic_wifi_signal_3_dark.png
index be1ba37..b8a4fe7 100644
--- a/res/drawable-hdpi/ic_wifi_signal_3_dark.png
+++ b/res/drawable-hdpi/ic_wifi_signal_3_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_wifi_signal_3_light.png b/res/drawable-hdpi/ic_wifi_signal_3_light.png
index 4a6407f..8789d64 100644
--- a/res/drawable-hdpi/ic_wifi_signal_3_light.png
+++ b/res/drawable-hdpi/ic_wifi_signal_3_light.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_wifi_signal_4_dark.png b/res/drawable-hdpi/ic_wifi_signal_4_dark.png
index 3fed8e6..ec697c8 100644
--- a/res/drawable-hdpi/ic_wifi_signal_4_dark.png
+++ b/res/drawable-hdpi/ic_wifi_signal_4_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_wifi_signal_4_light.png b/res/drawable-hdpi/ic_wifi_signal_4_light.png
index e52acd6..a8dcaaf 100644
--- a/res/drawable-hdpi/ic_wifi_signal_4_light.png
+++ b/res/drawable-hdpi/ic_wifi_signal_4_light.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_wifi_lock_signal_0_dark.png b/res/drawable-mdpi/ic_wifi_lock_signal_0_dark.png
new file mode 100644
index 0000000..1dcb7ac
--- /dev/null
+++ b/res/drawable-mdpi/ic_wifi_lock_signal_0_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_wifi_lock_signal_0_light.png b/res/drawable-mdpi/ic_wifi_lock_signal_0_light.png
new file mode 100644
index 0000000..df55614
--- /dev/null
+++ b/res/drawable-mdpi/ic_wifi_lock_signal_0_light.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_wifi_lock_signal_1_dark.png b/res/drawable-mdpi/ic_wifi_lock_signal_1_dark.png
index d6868aa..03738de 100644
--- a/res/drawable-mdpi/ic_wifi_lock_signal_1_dark.png
+++ b/res/drawable-mdpi/ic_wifi_lock_signal_1_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_wifi_lock_signal_1_light.png b/res/drawable-mdpi/ic_wifi_lock_signal_1_light.png
index eb41a10..f18211a 100644
--- a/res/drawable-mdpi/ic_wifi_lock_signal_1_light.png
+++ b/res/drawable-mdpi/ic_wifi_lock_signal_1_light.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_wifi_lock_signal_2_dark.png b/res/drawable-mdpi/ic_wifi_lock_signal_2_dark.png
index ada9739..b37d529 100644
--- a/res/drawable-mdpi/ic_wifi_lock_signal_2_dark.png
+++ b/res/drawable-mdpi/ic_wifi_lock_signal_2_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_wifi_lock_signal_2_light.png b/res/drawable-mdpi/ic_wifi_lock_signal_2_light.png
index ff041c4..ee212bc 100644
--- a/res/drawable-mdpi/ic_wifi_lock_signal_2_light.png
+++ b/res/drawable-mdpi/ic_wifi_lock_signal_2_light.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_wifi_lock_signal_3_dark.png b/res/drawable-mdpi/ic_wifi_lock_signal_3_dark.png
index 0a294ff..d456111 100644
--- a/res/drawable-mdpi/ic_wifi_lock_signal_3_dark.png
+++ b/res/drawable-mdpi/ic_wifi_lock_signal_3_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_wifi_lock_signal_3_light.png b/res/drawable-mdpi/ic_wifi_lock_signal_3_light.png
index 98cf1ff..8ab15d9 100644
--- a/res/drawable-mdpi/ic_wifi_lock_signal_3_light.png
+++ b/res/drawable-mdpi/ic_wifi_lock_signal_3_light.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_wifi_lock_signal_4_dark.png b/res/drawable-mdpi/ic_wifi_lock_signal_4_dark.png
index ccda2c7..435f768 100644
--- a/res/drawable-mdpi/ic_wifi_lock_signal_4_dark.png
+++ b/res/drawable-mdpi/ic_wifi_lock_signal_4_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_wifi_lock_signal_4_light.png b/res/drawable-mdpi/ic_wifi_lock_signal_4_light.png
index 83af4de..60a9833 100644
--- a/res/drawable-mdpi/ic_wifi_lock_signal_4_light.png
+++ b/res/drawable-mdpi/ic_wifi_lock_signal_4_light.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_wifi_signal_0_dark.png b/res/drawable-mdpi/ic_wifi_signal_0_dark.png
new file mode 100644
index 0000000..2162d2d
--- /dev/null
+++ b/res/drawable-mdpi/ic_wifi_signal_0_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_wifi_signal_0_light.png b/res/drawable-mdpi/ic_wifi_signal_0_light.png
new file mode 100644
index 0000000..c9f97e9
--- /dev/null
+++ b/res/drawable-mdpi/ic_wifi_signal_0_light.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_wifi_signal_1_dark.png b/res/drawable-mdpi/ic_wifi_signal_1_dark.png
index 6715c5d..5e186b3 100644
--- a/res/drawable-mdpi/ic_wifi_signal_1_dark.png
+++ b/res/drawable-mdpi/ic_wifi_signal_1_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_wifi_signal_1_light.png b/res/drawable-mdpi/ic_wifi_signal_1_light.png
index eec60c0..1f80018 100644
--- a/res/drawable-mdpi/ic_wifi_signal_1_light.png
+++ b/res/drawable-mdpi/ic_wifi_signal_1_light.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_wifi_signal_2_dark.png b/res/drawable-mdpi/ic_wifi_signal_2_dark.png
index e31d19f..eb0b290 100644
--- a/res/drawable-mdpi/ic_wifi_signal_2_dark.png
+++ b/res/drawable-mdpi/ic_wifi_signal_2_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_wifi_signal_2_light.png b/res/drawable-mdpi/ic_wifi_signal_2_light.png
index 7caa144..2b1ed62 100644
--- a/res/drawable-mdpi/ic_wifi_signal_2_light.png
+++ b/res/drawable-mdpi/ic_wifi_signal_2_light.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_wifi_signal_3_dark.png b/res/drawable-mdpi/ic_wifi_signal_3_dark.png
index bd6a1e8..47afa46 100644
--- a/res/drawable-mdpi/ic_wifi_signal_3_dark.png
+++ b/res/drawable-mdpi/ic_wifi_signal_3_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_wifi_signal_3_light.png b/res/drawable-mdpi/ic_wifi_signal_3_light.png
index 7be2515..ecbe438 100644
--- a/res/drawable-mdpi/ic_wifi_signal_3_light.png
+++ b/res/drawable-mdpi/ic_wifi_signal_3_light.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_wifi_signal_4_dark.png b/res/drawable-mdpi/ic_wifi_signal_4_dark.png
index af125c2..df5cbf5 100644
--- a/res/drawable-mdpi/ic_wifi_signal_4_dark.png
+++ b/res/drawable-mdpi/ic_wifi_signal_4_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_wifi_signal_4_light.png b/res/drawable-mdpi/ic_wifi_signal_4_light.png
index 658761a..4832197 100644
--- a/res/drawable-mdpi/ic_wifi_signal_4_light.png
+++ b/res/drawable-mdpi/ic_wifi_signal_4_light.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_wifi_lock_signal_0_dark.png b/res/drawable-xhdpi/ic_wifi_lock_signal_0_dark.png
new file mode 100644
index 0000000..1e29c6a
--- /dev/null
+++ b/res/drawable-xhdpi/ic_wifi_lock_signal_0_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_wifi_lock_signal_0_light.png b/res/drawable-xhdpi/ic_wifi_lock_signal_0_light.png
new file mode 100644
index 0000000..b4bf667
--- /dev/null
+++ b/res/drawable-xhdpi/ic_wifi_lock_signal_0_light.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_wifi_lock_signal_1_dark.png b/res/drawable-xhdpi/ic_wifi_lock_signal_1_dark.png
index c2be32f..c9dde7b 100644
--- a/res/drawable-xhdpi/ic_wifi_lock_signal_1_dark.png
+++ b/res/drawable-xhdpi/ic_wifi_lock_signal_1_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_wifi_lock_signal_1_light.png b/res/drawable-xhdpi/ic_wifi_lock_signal_1_light.png
index 57c8fb2..0328b63 100644
--- a/res/drawable-xhdpi/ic_wifi_lock_signal_1_light.png
+++ b/res/drawable-xhdpi/ic_wifi_lock_signal_1_light.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_wifi_lock_signal_2_dark.png b/res/drawable-xhdpi/ic_wifi_lock_signal_2_dark.png
index 9e65730..4e8f631 100644
--- a/res/drawable-xhdpi/ic_wifi_lock_signal_2_dark.png
+++ b/res/drawable-xhdpi/ic_wifi_lock_signal_2_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_wifi_lock_signal_2_light.png b/res/drawable-xhdpi/ic_wifi_lock_signal_2_light.png
index db783f8..5a64d46 100644
--- a/res/drawable-xhdpi/ic_wifi_lock_signal_2_light.png
+++ b/res/drawable-xhdpi/ic_wifi_lock_signal_2_light.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_wifi_lock_signal_3_dark.png b/res/drawable-xhdpi/ic_wifi_lock_signal_3_dark.png
index 5a12175..c50c727 100644
--- a/res/drawable-xhdpi/ic_wifi_lock_signal_3_dark.png
+++ b/res/drawable-xhdpi/ic_wifi_lock_signal_3_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_wifi_lock_signal_3_light.png b/res/drawable-xhdpi/ic_wifi_lock_signal_3_light.png
index 8b7df74..5ce95e5 100644
--- a/res/drawable-xhdpi/ic_wifi_lock_signal_3_light.png
+++ b/res/drawable-xhdpi/ic_wifi_lock_signal_3_light.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_wifi_lock_signal_4_dark.png b/res/drawable-xhdpi/ic_wifi_lock_signal_4_dark.png
index 4d2942c..7b3b9e5 100644
--- a/res/drawable-xhdpi/ic_wifi_lock_signal_4_dark.png
+++ b/res/drawable-xhdpi/ic_wifi_lock_signal_4_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_wifi_lock_signal_4_light.png b/res/drawable-xhdpi/ic_wifi_lock_signal_4_light.png
index bf26501..91bbbc2 100644
--- a/res/drawable-xhdpi/ic_wifi_lock_signal_4_light.png
+++ b/res/drawable-xhdpi/ic_wifi_lock_signal_4_light.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_wifi_signal_0_dark.png b/res/drawable-xhdpi/ic_wifi_signal_0_dark.png
new file mode 100644
index 0000000..cee9e2b
--- /dev/null
+++ b/res/drawable-xhdpi/ic_wifi_signal_0_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_wifi_signal_0_light.png b/res/drawable-xhdpi/ic_wifi_signal_0_light.png
new file mode 100644
index 0000000..c7cd1ee
--- /dev/null
+++ b/res/drawable-xhdpi/ic_wifi_signal_0_light.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_wifi_signal_1_dark.png b/res/drawable-xhdpi/ic_wifi_signal_1_dark.png
index bf1634c..142db5b 100644
--- a/res/drawable-xhdpi/ic_wifi_signal_1_dark.png
+++ b/res/drawable-xhdpi/ic_wifi_signal_1_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_wifi_signal_1_light.png b/res/drawable-xhdpi/ic_wifi_signal_1_light.png
index 0f58f3d..a3c1ce4 100644
--- a/res/drawable-xhdpi/ic_wifi_signal_1_light.png
+++ b/res/drawable-xhdpi/ic_wifi_signal_1_light.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_wifi_signal_2_dark.png b/res/drawable-xhdpi/ic_wifi_signal_2_dark.png
index 5345ff3..0c41ae0 100644
--- a/res/drawable-xhdpi/ic_wifi_signal_2_dark.png
+++ b/res/drawable-xhdpi/ic_wifi_signal_2_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_wifi_signal_2_light.png b/res/drawable-xhdpi/ic_wifi_signal_2_light.png
index c5bcc7e..0c0a3d0 100644
--- a/res/drawable-xhdpi/ic_wifi_signal_2_light.png
+++ b/res/drawable-xhdpi/ic_wifi_signal_2_light.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_wifi_signal_3_dark.png b/res/drawable-xhdpi/ic_wifi_signal_3_dark.png
index 8cc3a6e..6f0d944 100644
--- a/res/drawable-xhdpi/ic_wifi_signal_3_dark.png
+++ b/res/drawable-xhdpi/ic_wifi_signal_3_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_wifi_signal_3_light.png b/res/drawable-xhdpi/ic_wifi_signal_3_light.png
index 1cdacc5..0ac41ce 100644
--- a/res/drawable-xhdpi/ic_wifi_signal_3_light.png
+++ b/res/drawable-xhdpi/ic_wifi_signal_3_light.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_wifi_signal_4_dark.png b/res/drawable-xhdpi/ic_wifi_signal_4_dark.png
index c9aa4e5..418d53c 100644
--- a/res/drawable-xhdpi/ic_wifi_signal_4_dark.png
+++ b/res/drawable-xhdpi/ic_wifi_signal_4_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_wifi_signal_4_light.png b/res/drawable-xhdpi/ic_wifi_signal_4_light.png
index 3cf1c8d..58cf07a 100644
--- a/res/drawable-xhdpi/ic_wifi_signal_4_light.png
+++ b/res/drawable-xhdpi/ic_wifi_signal_4_light.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_wifi_lock_signal_0_dark.png b/res/drawable-xxhdpi/ic_wifi_lock_signal_0_dark.png
new file mode 100644
index 0000000..5cb27ab
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_wifi_lock_signal_0_dark.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_wifi_lock_signal_0_light.png b/res/drawable-xxhdpi/ic_wifi_lock_signal_0_light.png
new file mode 100644
index 0000000..22e7f0f
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_wifi_lock_signal_0_light.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_wifi_lock_signal_1_dark.png b/res/drawable-xxhdpi/ic_wifi_lock_signal_1_dark.png
index 20739fa..d862a5e 100644
--- a/res/drawable-xxhdpi/ic_wifi_lock_signal_1_dark.png
+++ b/res/drawable-xxhdpi/ic_wifi_lock_signal_1_dark.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_wifi_lock_signal_1_light.png b/res/drawable-xxhdpi/ic_wifi_lock_signal_1_light.png
index c13edff..526bd28 100644
--- a/res/drawable-xxhdpi/ic_wifi_lock_signal_1_light.png
+++ b/res/drawable-xxhdpi/ic_wifi_lock_signal_1_light.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_wifi_lock_signal_2_dark.png b/res/drawable-xxhdpi/ic_wifi_lock_signal_2_dark.png
index 9cd652a..1f5e563 100644
--- a/res/drawable-xxhdpi/ic_wifi_lock_signal_2_dark.png
+++ b/res/drawable-xxhdpi/ic_wifi_lock_signal_2_dark.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_wifi_lock_signal_2_light.png b/res/drawable-xxhdpi/ic_wifi_lock_signal_2_light.png
index cb7f0c2..97a01f7 100644
--- a/res/drawable-xxhdpi/ic_wifi_lock_signal_2_light.png
+++ b/res/drawable-xxhdpi/ic_wifi_lock_signal_2_light.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_wifi_lock_signal_3_dark.png b/res/drawable-xxhdpi/ic_wifi_lock_signal_3_dark.png
index 99097df..e02938b 100644
--- a/res/drawable-xxhdpi/ic_wifi_lock_signal_3_dark.png
+++ b/res/drawable-xxhdpi/ic_wifi_lock_signal_3_dark.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_wifi_lock_signal_3_light.png b/res/drawable-xxhdpi/ic_wifi_lock_signal_3_light.png
index a0961f4..7c34d42 100644
--- a/res/drawable-xxhdpi/ic_wifi_lock_signal_3_light.png
+++ b/res/drawable-xxhdpi/ic_wifi_lock_signal_3_light.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_wifi_lock_signal_4_dark.png b/res/drawable-xxhdpi/ic_wifi_lock_signal_4_dark.png
index 6c00a9c..b312c97 100644
--- a/res/drawable-xxhdpi/ic_wifi_lock_signal_4_dark.png
+++ b/res/drawable-xxhdpi/ic_wifi_lock_signal_4_dark.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_wifi_lock_signal_4_light.png b/res/drawable-xxhdpi/ic_wifi_lock_signal_4_light.png
index 74e1a40..60e39ff 100644
--- a/res/drawable-xxhdpi/ic_wifi_lock_signal_4_light.png
+++ b/res/drawable-xxhdpi/ic_wifi_lock_signal_4_light.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_wifi_signal_0_dark.png b/res/drawable-xxhdpi/ic_wifi_signal_0_dark.png
new file mode 100644
index 0000000..0fd7006
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_wifi_signal_0_dark.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_wifi_signal_0_light.png b/res/drawable-xxhdpi/ic_wifi_signal_0_light.png
new file mode 100644
index 0000000..678d3c4
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_wifi_signal_0_light.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_wifi_signal_1_dark.png b/res/drawable-xxhdpi/ic_wifi_signal_1_dark.png
index b50fda5..45adfbe 100644
--- a/res/drawable-xxhdpi/ic_wifi_signal_1_dark.png
+++ b/res/drawable-xxhdpi/ic_wifi_signal_1_dark.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_wifi_signal_1_light.png b/res/drawable-xxhdpi/ic_wifi_signal_1_light.png
index f6fad9d..698cee0 100644
--- a/res/drawable-xxhdpi/ic_wifi_signal_1_light.png
+++ b/res/drawable-xxhdpi/ic_wifi_signal_1_light.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_wifi_signal_2_dark.png b/res/drawable-xxhdpi/ic_wifi_signal_2_dark.png
index f906023..711c1f7 100644
--- a/res/drawable-xxhdpi/ic_wifi_signal_2_dark.png
+++ b/res/drawable-xxhdpi/ic_wifi_signal_2_dark.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_wifi_signal_2_light.png b/res/drawable-xxhdpi/ic_wifi_signal_2_light.png
index 7f5859b..9ae3c7c 100644
--- a/res/drawable-xxhdpi/ic_wifi_signal_2_light.png
+++ b/res/drawable-xxhdpi/ic_wifi_signal_2_light.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_wifi_signal_3_dark.png b/res/drawable-xxhdpi/ic_wifi_signal_3_dark.png
index ef40952..b8aef2d 100644
--- a/res/drawable-xxhdpi/ic_wifi_signal_3_dark.png
+++ b/res/drawable-xxhdpi/ic_wifi_signal_3_dark.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_wifi_signal_3_light.png b/res/drawable-xxhdpi/ic_wifi_signal_3_light.png
index e3151b3..6b8ef69 100644
--- a/res/drawable-xxhdpi/ic_wifi_signal_3_light.png
+++ b/res/drawable-xxhdpi/ic_wifi_signal_3_light.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_wifi_signal_4_dark.png b/res/drawable-xxhdpi/ic_wifi_signal_4_dark.png
index 13f9425..6166fdc 100644
--- a/res/drawable-xxhdpi/ic_wifi_signal_4_dark.png
+++ b/res/drawable-xxhdpi/ic_wifi_signal_4_dark.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_wifi_signal_4_light.png b/res/drawable-xxhdpi/ic_wifi_signal_4_light.png
index 96e25e5..b9d0cf2 100644
--- a/res/drawable-xxhdpi/ic_wifi_signal_4_light.png
+++ b/res/drawable-xxhdpi/ic_wifi_signal_4_light.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_wifi_lock_signal_0_dark.png b/res/drawable-xxxhdpi/ic_wifi_lock_signal_0_dark.png
new file mode 100644
index 0000000..e1e0a11
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_wifi_lock_signal_0_dark.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_wifi_lock_signal_0_light.png b/res/drawable-xxxhdpi/ic_wifi_lock_signal_0_light.png
new file mode 100644
index 0000000..b9ab604
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_wifi_lock_signal_0_light.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_wifi_lock_signal_1_dark.png b/res/drawable-xxxhdpi/ic_wifi_lock_signal_1_dark.png
new file mode 100644
index 0000000..dfc176f
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_wifi_lock_signal_1_dark.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_wifi_lock_signal_1_light.png b/res/drawable-xxxhdpi/ic_wifi_lock_signal_1_light.png
new file mode 100644
index 0000000..f31dedf
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_wifi_lock_signal_1_light.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_wifi_lock_signal_2_dark.png b/res/drawable-xxxhdpi/ic_wifi_lock_signal_2_dark.png
new file mode 100644
index 0000000..0386e0d
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_wifi_lock_signal_2_dark.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_wifi_lock_signal_2_light.png b/res/drawable-xxxhdpi/ic_wifi_lock_signal_2_light.png
new file mode 100644
index 0000000..8176741
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_wifi_lock_signal_2_light.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_wifi_lock_signal_3_dark.png b/res/drawable-xxxhdpi/ic_wifi_lock_signal_3_dark.png
new file mode 100644
index 0000000..7a9349f
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_wifi_lock_signal_3_dark.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_wifi_lock_signal_3_light.png b/res/drawable-xxxhdpi/ic_wifi_lock_signal_3_light.png
new file mode 100644
index 0000000..0c4741e
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_wifi_lock_signal_3_light.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_wifi_lock_signal_4_dark.png b/res/drawable-xxxhdpi/ic_wifi_lock_signal_4_dark.png
new file mode 100644
index 0000000..aa2eb6d
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_wifi_lock_signal_4_dark.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_wifi_lock_signal_4_light.png b/res/drawable-xxxhdpi/ic_wifi_lock_signal_4_light.png
new file mode 100644
index 0000000..68b0cb5
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_wifi_lock_signal_4_light.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_wifi_signal_0_dark.png b/res/drawable-xxxhdpi/ic_wifi_signal_0_dark.png
new file mode 100644
index 0000000..a42a6eb
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_wifi_signal_0_dark.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_wifi_signal_0_light.png b/res/drawable-xxxhdpi/ic_wifi_signal_0_light.png
new file mode 100644
index 0000000..2e67439
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_wifi_signal_0_light.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_wifi_signal_1_dark.png b/res/drawable-xxxhdpi/ic_wifi_signal_1_dark.png
new file mode 100644
index 0000000..d8ba287
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_wifi_signal_1_dark.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_wifi_signal_1_light.png b/res/drawable-xxxhdpi/ic_wifi_signal_1_light.png
new file mode 100644
index 0000000..1b2b597
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_wifi_signal_1_light.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_wifi_signal_2_dark.png b/res/drawable-xxxhdpi/ic_wifi_signal_2_dark.png
new file mode 100644
index 0000000..e700338
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_wifi_signal_2_dark.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_wifi_signal_2_light.png b/res/drawable-xxxhdpi/ic_wifi_signal_2_light.png
new file mode 100644
index 0000000..8474c53
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_wifi_signal_2_light.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_wifi_signal_3_dark.png b/res/drawable-xxxhdpi/ic_wifi_signal_3_dark.png
new file mode 100644
index 0000000..8d3c446
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_wifi_signal_3_dark.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_wifi_signal_3_light.png b/res/drawable-xxxhdpi/ic_wifi_signal_3_light.png
new file mode 100644
index 0000000..eb41081
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_wifi_signal_3_light.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_wifi_signal_4_dark.png b/res/drawable-xxxhdpi/ic_wifi_signal_4_dark.png
new file mode 100644
index 0000000..c11b797
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_wifi_signal_4_dark.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_wifi_signal_4_light.png b/res/drawable-xxxhdpi/ic_wifi_signal_4_light.png
new file mode 100644
index 0000000..62796af
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_wifi_signal_4_light.png
Binary files differ
diff --git a/res/drawable/data_usage_bar.xml b/res/drawable/data_usage_bar.xml
index 96f1cae..b98dfb6 100644
--- a/res/drawable/data_usage_bar.xml
+++ b/res/drawable/data_usage_bar.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 The Android Open Source Project
+<!-- Copyright (C) 2014 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.
@@ -16,22 +16,19 @@
 
 <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
     <item android:id="@android:id/background">
-        <shape>
-            <solid android:color="#ff28262c" />
-        </shape>
+        <nine-patch android:src="@*android:drawable/progress_qntm_alpha"
+            android:tint="@color/quantum_empty_color_light" />
     </item>
     <item android:id="@android:id/secondaryProgress">
-        <clip>
-            <shape>
-                <solid android:color="#c050ade5" />
-            </shape>
-        </clip>
+        <scale android:scaleWidth="100%">
+            <nine-patch android:src="@*android:drawable/progress_qntm_alpha"
+                android:tint="?android:attr/colorControlActivated" />
+        </scale>
     </item>
     <item android:id="@android:id/progress">
-        <clip>
-            <shape>
-                <solid android:color="#c050ade5" />
-            </shape>
-        </clip>
+        <scale android:scaleWidth="100%">
+            <nine-patch android:src="@*android:drawable/progress_primary_qntm_alpha"
+                android:tint="?android:attr/colorControlActivated" />
+        </scale>
     </item>
 </layer-list>
diff --git a/res/drawable/switchbar_background.xml b/res/drawable/switchbar_background.xml
new file mode 100644
index 0000000..d329b6b
--- /dev/null
+++ b/res/drawable/switchbar_background.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 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.
+-->
+
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+                android:tint="?android:attr/colorControlHighlight">
+    <item>
+        <color android:color="@color/switchbar_background_color" />
+    </item>
+</ripple>
+
diff --git a/res/layout/account_type_preference.xml b/res/layout/account_type_preference.xml
new file mode 100644
index 0000000..f7ba859
--- /dev/null
+++ b/res/layout/account_type_preference.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 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.
+-->
+
+<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
+        android:id="@+id/accountTypeIcon"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:contentDescription="@null" />
diff --git a/res/layout/app_percentage_item.xml b/res/layout/app_percentage_item.xml
index 03226ca..08042a9 100644
--- a/res/layout/app_percentage_item.xml
+++ b/res/layout/app_percentage_item.xml
@@ -45,16 +45,16 @@
 
     <TextView
         android:id="@android:id/text1"
-        android:layout_marginStart="8dip"
+        android:layout_marginStart="6dip"
         android:layout_marginTop="2dip"
         android:textAppearance="?android:attr/textAppearanceSmall" />
 
     <ProgressBar
         android:id="@android:id/progress"
-        android:layout_height="12dip"
+        android:layout_height="8dip"
         android:layout_columnSpan="2"
         android:layout_gravity="fill_horizontal|top"
-        android:layout_marginTop="4dip"
+        android:layout_marginTop="8dip"
         android:max="100"
         android:progressDrawable="@drawable/data_usage_bar"
         style="?android:attr/progressBarStyleHorizontal" />
@@ -64,7 +64,7 @@
         android:layout_width="0dip"
         android:layout_gravity="fill_horizontal|top"
         android:layout_columnSpan="2"
-        android:layout_marginTop="4dip"
+        android:layout_marginTop="6dip"
         android:visibility="gone"
         android:maxLines="2"
         android:textAppearance="?android:attr/textAppearanceSmall" />
diff --git a/res/layout/battery_history_chart.xml b/res/layout/battery_history_chart.xml
new file mode 100644
index 0000000..4d87a70
--- /dev/null
+++ b/res/layout/battery_history_chart.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 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.fuelgauge.BatteryHistoryChart
+        xmlns:android="http://schemas.android.com/apk/res/android"
+        xmlns:app="http://schemas.android.com/apk/res/com.android.settings"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:gravity="center_vertical"
+    android:id="@+android:id/battery_history_chart"
+    android:paddingEnd="?android:attr/scrollbarSize"
+    android:textAppearance="?android:attr/textAppearanceSmall"
+    android:textColor="#ff000000"
+    app:headerAppearance="?android:attr/textAppearanceMedium"
+    android:shadowRadius="4"
+    android:shadowColor="?android:attr/colorBackground"
+    android:shadowDx="2"
+    android:shadowDy="2"
+    app:barPrimaryColor="?android:attr/colorControlActivated"
+    app:barPredictionColor="@color/quantum_empty_color_light"
+    app:chartMinHeight="@dimen/battery_history_chart_height">
+</com.android.settings.fuelgauge.BatteryHistoryChart>
diff --git a/res/layout/captioning_preview.xml b/res/layout/captioning_preview.xml
index 0963ee9..b90c3a5 100644
--- a/res/layout/captioning_preview.xml
+++ b/res/layout/captioning_preview.xml
@@ -21,6 +21,7 @@
     android:orientation="vertical" >
 
     <FrameLayout
+        android:id="@+id/preview_viewport"
         android:layout_width="match_parent"
         android:layout_height="@dimen/captioning_preview_height" >
 
diff --git a/res/layout/dashboard.xml b/res/layout/dashboard.xml
index c6c7292..3c6e096 100644
--- a/res/layout/dashboard.xml
+++ b/res/layout/dashboard.xml
@@ -18,8 +18,8 @@
     android:id="@+id/dashboard"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:paddingStart="@*android:dimen/preference_fragment_padding_side"
-    android:paddingEnd="@*android:dimen/preference_fragment_padding_side"
+    android:paddingStart="@dimen/dashboard_padding_start"
+    android:paddingEnd="@dimen/dashboard_padding_end"
     android:scrollbarStyle="outsideOverlay"
     android:background="@color/dashboard_background_color">
 
diff --git a/res/layout/dashboard_category.xml b/res/layout/dashboard_category.xml
index 1099dda..6e90fa9 100644
--- a/res/layout/dashboard_category.xml
+++ b/res/layout/dashboard_category.xml
@@ -23,10 +23,11 @@
     <TextView android:id="@+id/category_title"
             android:layout_width="match_parent"
             android:layout_height="@dimen/dashboard_category_title_height"
+            android:paddingStart="@dimen/dashboard_category_title_padding_start"
             android:singleLine="true"
             android:ellipsize="marquee"
             android:gravity="center_vertical"
-            android:textAppearance="@style/TextAppearance.Small"
+            android:textAppearance="@style/TextAppearance.CategoryTitle"
             android:textAlignment="viewStart"
             />
 
diff --git a/res/layout/dashboard_tile.xml b/res/layout/dashboard_tile.xml
index 2a811b2..a0049be 100644
--- a/res/layout/dashboard_tile.xml
+++ b/res/layout/dashboard_tile.xml
@@ -19,15 +19,15 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:gravity="center_vertical"
-        android:minHeight="72dp" >
+        android:minHeight="@dimen/dashboard_tile_minimum_height">
 
     <ImageView
             android:id="@+id/icon"
-            android:layout_width="40dp"
-            android:layout_height="40dp"
+            android:layout_width="@dimen/dashboard_tile_image_size"
+            android:layout_height="@dimen/dashboard_tile_image_size"
             android:scaleType="centerInside"
-            android:layout_marginStart="12dp"
-            android:layout_marginEnd="16dp"
+            android:layout_marginStart="@dimen/dashboard_tile_image_margin_start"
+            android:layout_marginEnd="@dimen/dashboard_tile_image_margin_end"
             />
 
     <RelativeLayout
@@ -39,7 +39,7 @@
                   android:layout_width="wrap_content"
                   android:layout_height="wrap_content"
                   android:singleLine="true"
-                  android:textAppearance="@style/TextAppearance.Medium"
+                  android:textAppearance="@style/TextAppearance.TileTitle"
                   android:ellipsize="marquee"
                   android:fadingEdge="horizontal" />
 
diff --git a/res/layout/notification_app.xml b/res/layout/notification_app.xml
index 8f5f8e6..6818a45 100644
--- a/res/layout/notification_app.xml
+++ b/res/layout/notification_app.xml
@@ -53,8 +53,8 @@
             android:ellipsize="end"
             android:singleLine="true"
             android:textAlignment="viewStart"
-            android:textColor="#888"
-            android:textAppearance="?android:attr/textAppearanceMedium" />
+            android:textColor="?android:attr/textColorSecondary"
+            android:textAppearance="?android:attr/textAppearanceSmall" />
     </RelativeLayout>
 
     <View
diff --git a/res/layout/notification_log_row.xml b/res/layout/notification_log_row.xml
index 702e6b8..57f5a79 100644
--- a/res/layout/notification_log_row.xml
+++ b/res/layout/notification_log_row.xml
@@ -51,6 +51,7 @@
             android:layout_toEndOf="@android:id/icon"
             android:ellipsize="end"
             android:singleLine="true"
+            android:textColor="?android:attr/textColorPrimary"
             android:textAppearance="?android:attr/textAppearanceSmall"
             android:textStyle="bold"
             android:textAlignment="viewStart"
@@ -66,6 +67,7 @@
             android:layout_centerVertical="true"
             android:ellipsize="end"
             android:singleLine="true"
+            android:textColor="?android:attr/textColorPrimary"
             android:textAppearance="?android:attr/textAppearanceSmall"
             android:textAlignment="viewEnd"
             />
@@ -79,6 +81,7 @@
         android:layout_marginStart="30dp"
         android:ellipsize="end"
         android:singleLine="true"
+        android:textColor="?android:attr/textColorPrimary"
         android:textAppearance="?android:attr/textAppearanceSmall"
         android:textAlignment="viewStart"
         />
@@ -109,6 +112,7 @@
             android:layout_gravity="left|center_vertical"
             android:ellipsize="end"
             android:singleLine="true"
+            android:textColor="?android:attr/textColorPrimary"
             android:textAppearance="?android:attr/textAppearanceSmall"
             android:textAlignment="viewStart"
             />
diff --git a/res/layout/preference_batteryhistory.xml b/res/layout/preference_batteryhistory.xml
index a09c6a8..766ec51 100644
--- a/res/layout/preference_batteryhistory.xml
+++ b/res/layout/preference_batteryhistory.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 The Android Open Source Project
+<!-- Copyright (C) 2014 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.
@@ -14,19 +14,18 @@
      limitations under the License.
 -->
 
-<com.android.settings.fuelgauge.BatteryHistoryChart
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        xmlns:app="http://schemas.android.com/apk/res/com.android.settings"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:minHeight="@dimen/battery_history_chart_height"
-    android:gravity="center_vertical"
-    android:id="@+android:id/battery_history_chart"
-    android:paddingEnd="?android:attr/scrollbarSize"
-    android:textAppearance="?android:attr/textAppearanceSmall"
-    app:headerAppearance="?android:attr/textAppearanceMedium"
-    android:shadowRadius="4"
-    android:shadowColor="?android:attr/colorBackground"
-    android:shadowDx="2"
-    android:shadowDy="2">
-</com.android.settings.fuelgauge.BatteryHistoryChart>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        android:minHeight="@dimen/battery_history_chart_height"
+        android:paddingEnd="?android:attr/scrollbarSize">
+    <include layout="@layout/battery_history_chart" />
+    <TextView android:id="@+id/labelsHeader"
+              android:layout_width="match_parent" android:layout_height="48dp"
+              android:textAppearance="?android:attr/textAppearanceMedium"
+              android:textSize="14sp"
+              android:textColor="?android:attr/colorControlActivated"
+              android:gravity="left|center_vertical"
+              android:text="@string/power_usage_list_summary" />
+</LinearLayout>
diff --git a/res/layout/search_panel.xml b/res/layout/search_panel.xml
index 8837bc9..1242c73 100644
--- a/res/layout/search_panel.xml
+++ b/res/layout/search_panel.xml
@@ -18,8 +18,8 @@
         android:id="@+id/dashboard"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:paddingStart="@*android:dimen/preference_fragment_padding_side"
-        android:paddingEnd="@*android:dimen/preference_fragment_padding_side"
+        android:paddingStart="@dimen/search_results_padding_start"
+        android:paddingEnd="@dimen/search_results_padding_end"
         android:background="@color/dashboard_background_color">
 
     <LinearLayout android:layout_width="match_parent"
@@ -35,10 +35,11 @@
 
             <TextView android:layout_width="wrap_content"
                       android:layout_height="@dimen/dashboard_category_title_height"
+                      android:paddingStart="@dimen/search_title_padding_start"
                       android:singleLine="true"
                       android:ellipsize="marquee"
                       android:gravity="center_vertical"
-                      android:textAppearance="?android:attr/textAppearanceMedium"
+                      android:textAppearance="@style/TextAppearance.RecentsTitle"
                       android:textAlignment="viewStart"
                       android:text="@string/search_recents_queries_label"
                     />
@@ -59,10 +60,11 @@
 
             <TextView android:layout_width="wrap_content"
                       android:layout_height="@dimen/dashboard_category_title_height"
+                      android:paddingStart="@dimen/search_title_padding_start"
                       android:singleLine="true"
                       android:ellipsize="marquee"
                       android:gravity="center_vertical"
-                      android:textAppearance="?android:attr/textAppearanceMedium"
+                      android:textAppearance="@style/TextAppearance.ResultTitle"
                       android:textAlignment="viewStart"
                       android:text="@string/search_results_label"
                     />
diff --git a/res/layout/search_result_item.xml b/res/layout/search_result_item.xml
index 30d6fc0..b659387 100644
--- a/res/layout/search_result_item.xml
+++ b/res/layout/search_result_item.xml
@@ -19,7 +19,6 @@
               android:layout_height="wrap_content"
               android:minHeight="?android:attr/listPreferredItemHeight"
               android:gravity="center_vertical"
-              android:paddingStart="@*android:dimen/preference_item_padding_side"
               android:paddingEnd="?android:attr/scrollbarSize">
 
     <LinearLayout
@@ -31,12 +30,11 @@
 
         <ImageView
                 android:id="@+id/icon"
-                android:layout_width="48dp"
-                android:layout_height="48dp"
-                android:layout_gravity="center"
-                android:minWidth="48dp"
+                android:layout_width="@dimen/search_result_item_image_size"
+                android:layout_height="@dimen/search_result_item_image_size"
                 android:scaleType="centerInside"
-                android:layout_marginEnd="@*android:dimen/preference_item_padding_inner"
+                android:layout_marginStart="@dimen/search_result_item_image_margin_start"
+                android:layout_marginEnd="@dimen/search_result_item_image_margin_end"
                 />
 
     </LinearLayout>
@@ -44,10 +42,7 @@
     <RelativeLayout
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:paddingEnd="@*android:dimen/preference_item_padding_inner"
-            android:paddingTop="6dip"
-            android:paddingBottom="6dip">
+            android:layout_weight="1">
 
         <TextView android:id="@+id/title"
                   android:layout_width="wrap_content"
@@ -57,15 +52,6 @@
                   android:ellipsize="marquee"
                   android:fadingEdge="horizontal" />
 
-        <TextView android:id="@+id/summary"
-                  android:layout_width="wrap_content"
-                  android:layout_height="wrap_content"
-                  android:layout_below="@id/title"
-                  android:layout_alignStart="@id/title"
-                  android:textAppearance="?android:attr/textAppearanceSmall"
-                  android:textColor="?android:attr/textColorSecondary"
-                  android:maxLines="10" />
-
     </RelativeLayout>
 
 </LinearLayout>
diff --git a/res/layout/search_suggestion_item.xml b/res/layout/search_suggestion_item.xml
index 49df3ca..b92a7f0 100644
--- a/res/layout/search_suggestion_item.xml
+++ b/res/layout/search_suggestion_item.xml
@@ -18,15 +18,12 @@
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:minHeight="?android:attr/listPreferredItemHeight"
-              android:gravity="center_vertical"
-              android:paddingStart="@*android:dimen/preference_item_padding_side"
-              android:paddingEnd="?android:attr/scrollbarSize">
+              android:gravity="center_vertical">
 
     <TextView android:id="@+id/title"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
-              android:paddingStart="@*android:dimen/preference_item_padding_inner"
-              android:paddingEnd="@*android:dimen/preference_item_padding_inner"
+              android:paddingStart="@dimen/search_title_padding_start"
               android:singleLine="true"
               android:textAppearance="?android:attr/textAppearanceMedium"
               android:ellipsize="marquee"
diff --git a/res/layout/settings_main.xml b/res/layout/settings_main.xml
index 740932d..46ead18 100644
--- a/res/layout/settings_main.xml
+++ b/res/layout/settings_main.xml
@@ -31,7 +31,7 @@
         <com.android.settings.widget.SwitchBar android:id="@+id/switch_bar"
                   android:layout_height="?android:attr/actionBarSize"
                   android:layout_width="match_parent"
-                  android:background="@color/switch_bar_background_color"
+                  android:background="@drawable/switchbar_background"
                   android:theme="@android:style/Theme.Quantum" />
 
         <FrameLayout
diff --git a/res/layout/setup_preference.xml b/res/layout/setup_preference.xml
index d0cbc02..dc6130d 100644
--- a/res/layout/setup_preference.xml
+++ b/res/layout/setup_preference.xml
@@ -18,7 +18,7 @@
 -->
 <view
     xmlns:android="http://schemas.android.com/apk/res/android"
-    class="com.android.settings.wifi.WifiSettings$ProportionalOuterFrame"
+    class="com.android.settings.widget.ProportionalOuterFrame"
     android:layout_height="match_parent"
     android:layout_width="match_parent">
 
diff --git a/res/menu/print_service_settings.xml b/res/menu/print_service_settings.xml
index a9a4aed..f8a7372 100644
--- a/res/menu/print_service_settings.xml
+++ b/res/menu/print_service_settings.xml
@@ -18,9 +18,8 @@
     <item
         android:id="@+id/print_menu_item_search"
         android:title="@string/print_menu_item_search"
-        android:icon="@*android:drawable/ic_menu_search_holo_dark"
         android:actionViewClass="android.widget.SearchView"
-        android:showAsAction="ifRoom|collapseActionView"
+        android:showAsAction="never|collapseActionView"
         android:imeOptions="actionSearch">
     </item>
     <item
diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml
index 288d4e3..63550d7 100755
--- a/res/values-land/dimens.xml
+++ b/res/values-land/dimens.xml
@@ -24,4 +24,8 @@
     <integer name="keyguard_appwidget_picker_cols">2</integer>
 
     <dimen name="captioning_preview_height">100dp</dimen>
+
+    <!-- Dashboard tile minimum height -->
+    <dimen name="dashboard_tile_minimum_height">64dp</dimen>
+
 </resources>
diff --git a/res/values-sw600dp-land/config.xml b/res/values-sw600dp-land/config.xml
index eb1a7c3..543dfee 100644
--- a/res/values-sw600dp-land/config.xml
+++ b/res/values-sw600dp-land/config.xml
@@ -17,6 +17,6 @@
 <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
 
     <!-- Dashboard number of columns -->
-    <integer name="dashboard_num_columns">3</integer>
+    <integer name="dashboard_num_columns">2</integer>
 
 </resources>
diff --git a/res/values-sw600dp/dimens.xml b/res/values-sw600dp/dimens.xml
index 0cef851..fe42d69 100755
--- a/res/values-sw600dp/dimens.xml
+++ b/res/values-sw600dp/dimens.xml
@@ -39,10 +39,26 @@
     <dimen name="keyguard_appwidget_picker_margin_right">2dip</dimen>
     <integer name="keyguard_appwidget_picker_cols">2</integer>
 
-    <!-- Dashboard padding between each tiles within the layout -->
-    <dimen name="dashboard_cell_gap">8dp</dimen>
+    <!-- ActionBar contentInsetStart -->
+    <dimen name="actionbar_contentInsetStart">24dp</dimen>
+
+    <!-- Dashboard category title padding start -->
+    <dimen name="dashboard_category_title_padding_start">24dp</dimen>
+
+    <!-- Dashboard tile image padding start / end -->
+    <dimen name="dashboard_tile_image_margin_start">24dp</dimen>
+    <dimen name="dashboard_tile_image_margin_end">32dp</dimen>
 
     <!-- SwitchBar padding start -->
-    <dimen name="switchbar_padding_start">80dp</dimen>
+    <dimen name="switchbar_padding_start">24dp</dimen>
+    <!-- SwitchBar padding end -->
+    <dimen name="switchbar_padding_end">24dp</dimen>
+
+    <!-- Search title (recent / results) padding start -->
+    <dimen name="search_title_padding_start">24dp</dimen>
+
+    <!-- Result item image margin start / end -->
+    <dimen name="search_result_item_image_margin_start">24dp</dimen>
+    <dimen name="search_result_item_image_margin_end">32dp</dimen>
 
 </resources>
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 3695d3a..b95a479 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -738,6 +738,7 @@
 
     <!-- Titles for captioning character edge type preference. [CHAR LIMIT=35] -->
     <string-array name="captioning_edge_type_selector_titles">
+        <item>Default</item>
         <item>None</item>
         <item>Outline</item>
         <item>Drop shadow</item>
@@ -747,6 +748,7 @@
 
     <!-- Values for captioning character edge type preference. -->
     <integer-array name="captioning_edge_type_selector_values" translatable="false" >
+        <item>-1</item>
         <item>0</item>
         <item>1</item>
         <item>2</item>
@@ -756,6 +758,7 @@
 
     <!-- Titles for captioning color preference. -->
     <string-array name="captioning_color_selector_titles" translatable="false" >
+        <item>@string/color_unspecified</item>
         <item>@string/color_white</item>
         <item>@string/color_black</item>
         <item>@string/color_red</item>
@@ -768,6 +771,7 @@
 
     <!-- Values for captioning color preference. -->
     <integer-array name="captioning_color_selector_values" translatable="false" >
+        <item>0x00000100</item>
         <item>0xFFFFFFFF</item>
         <item>0xFF000000</item>
         <item>0xFFFF0000</item>
@@ -852,6 +856,7 @@
 
     <!-- Titles for captioning text style preset preference. [CHAR LIMIT=35] -->
     <string-array name="captioning_preset_selector_titles" >
+        <item>Use app defaults</item>
         <item>White on black</item>
         <item>Black on white</item>
         <item>Yellow on black</item>
@@ -861,6 +866,7 @@
 
     <!-- Values for captioning text style preset preference. -->
     <integer-array name="captioning_preset_selector_values" translatable="false" >
+        <item>4</item>
         <item>0</item>
         <item>1</item>
         <item>2</item>
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 3ad0375..c1cb5ae 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -43,6 +43,12 @@
         <attr name="android:shadowRadius" />
         <!-- Text color, typeface, size, and style of header. -->
         <attr name="headerAppearance" format="reference" />
+        <!-- Primary color of chart. -->
+        <attr name="barPrimaryColor" format="color|reference" />
+        <!-- Color of predicted future use part of chart. -->
+        <attr name="barPredictionColor" format="color|reference" />
+        <!-- Minimum height of the chart itself. -->
+        <attr name="chartMinHeight" format="dimension|reference" />
     </declare-styleable>
 
     <declare-styleable name="PercentageBarChart">
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 8a2c1f5..c58dffc 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -42,7 +42,10 @@
     <color name="circle_avatar_frame_shadow_color">#80000000</color>
     <color name="circle_avatar_frame_pressed_color">#ffffffff</color>
 
-    <color name="lock_pattern_background">#8000</color>
+    <color name="lock_pattern_background">#00000000</color>
+    <color name="lock_pattern_view_regular_color">#ff37474f</color>
+    <color name="lock_pattern_view_success_color">#ff009688</color>
+    <color name="lock_pattern_view_error_color">#fff4511e</color>
 
     <color name="quantum_blue_grey_50">#ffeceff1</color>
     <color name="quantum_blue_grey_100">#ffcfd8dc</color>
@@ -57,8 +60,16 @@
     <color name="quantum_orange_A200">#ffffab40</color>
     <color name="quantum_orange_A400">#ffff9100</color>
 
-    <color name="actionbar_background_color">#ff263238</color>
+    <color name="quantum_accent_color_light">#FF009688</color>
+    <color name="quantum_accent_color_dark">#FF80CBC4</color>
+    <color name="quantum_empty_color_light">#FFCED7DB</color>
+
+    <!-- Palette colors referenced by top-level themes and manually copied into base theme. -->
+    <color name="theme_primary">#ff263238</color>
+    <color name="theme_primary_dark">@color/theme_primary</color>
+    <color name="theme_accent">@color/quantum_accent_color_light</color>
+
     <color name="dashboard_background_color">#ffe1e1e0</color>
-    <color name="switch_bar_background_color">#ff384248</color>
+    <color name="switchbar_background_color">#ff384248</color>
     <color name="switch_accent_color">#ff7fcac3</color>
 </resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 460fb44..f1764fb 100755
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -87,15 +87,52 @@
     <dimen name="notification_app_settings_divider_height">48dp</dimen>
     <dimen name="zen_mode_dropdown_width">160dp</dimen>
 
+    <!-- Default text size for caption preview samples. Uses dp rather than sp because captions are not scaled. -->
+    <dimen name="caption_preview_text_size">48dp</dimen>
+
+    <!-- ActionBar contentInsetStart -->
+    <dimen name="actionbar_contentInsetStart">16dp</dimen>
+
     <!-- Dashboard padding between each tiles within the layout -->
-    <dimen name="dashboard_cell_gap">4dp</dimen>
+    <dimen name="dashboard_cell_gap">1dp</dimen>
+
+    <!-- Dashboard padding in its container -->
+    <dimen name="dashboard_padding_start">1dp</dimen>
+    <dimen name="dashboard_padding_end">1dp</dimen>
 
     <!-- Dashboard category title layout height -->
     <dimen name="dashboard_category_title_height">48dp</dimen>
 
+    <!-- Dashboard category title padding start -->
+    <dimen name="dashboard_category_title_padding_start">16dp</dimen>
+
+    <!-- Dashboard tile minimum height -->
+    <dimen name="dashboard_tile_minimum_height">72dp</dimen>
+
+    <!-- Dashboard image tile size -->
+    <dimen name="dashboard_tile_image_size">24dp</dimen>
+
+    <!-- Dashboard tile image margin start / end -->
+    <dimen name="dashboard_tile_image_margin_start">16dp</dimen>
+    <dimen name="dashboard_tile_image_margin_end">32dp</dimen>
+
     <!-- SwitchBar padding start -->
-    <dimen name="switchbar_padding_start">72dp</dimen>
-    <!-- SwitchBar padding emd -->
-    <dimen name="switchbar_padding_end">@*android:dimen/preference_fragment_padding_side</dimen>
+    <dimen name="switchbar_padding_start">16dp</dimen>
+    <!-- SwitchBar padding end. Should be n x @*android:dimen/preference_fragment_padding_side -->
+    <dimen name="switchbar_padding_end">16dp</dimen>
+
+    <!-- Search Results padding in its container -->
+    <dimen name="search_results_padding_start">1dp</dimen>
+    <dimen name="search_results_padding_end">1dp</dimen>
+
+    <!-- Search title (recent / results) padding start -->
+    <dimen name="search_title_padding_start">16dp</dimen>
+
+    <!-- Result item image size -->
+    <dimen name="search_result_item_image_size">24dp</dimen>
+
+    <!-- Result item image margin start / end -->
+    <dimen name="search_result_item_image_margin_start">16dp</dimen>
+    <dimen name="search_result_item_image_margin_end">32dp</dimen>
 
 </resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 11adc77..72f8408 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -610,7 +610,7 @@
     <!-- Wireless controls settings screen, setting check box label -->
     <string name="airplane_mode">Airplane mode</string>
     <!-- Main Settings screen settings title for things like airplane mode, tethering, NFC, VPN.  This will take you to another screen with those settings. -->
-    <string name="radio_controls_title">More\u2026</string>
+    <string name="radio_controls_title">NFC &amp; more</string>
     <!-- Wireless Settings screen title for things like Wi-Fi, bluetooth, airplane mode. -->
     <string name="wireless_networks_settings_title">Wireless &amp; networks</string>
     <!-- Main Settings screen settings summary text for the "Wireless controls" setting -->
@@ -718,6 +718,8 @@
     <string name="profile_info_settings_title">Profile info</string>
     <!-- Main Settings screen setting option title for the item to take you to the location screen -->
     <string name="location_settings_title">Location</string>
+    <!-- Main Settings screen setting option title for the item to take you to the accounts screen [CHAR LIMIT=22] -->
+    <string name="account_settings_title">Accounts</string>
     <!-- Main Settings screen setting option title for the item to take you to the security screen -->
     <string name="security_settings_title">Security</string>
     <!-- Main Settings screen setting option summary text for the item tot ake you to the security and location screen -->
@@ -1804,6 +1806,10 @@
 
     <!-- Account settings header. [CHAR LIMIT=30] -->
     <string name="account_settings">Accounts</string>
+    <!-- Header for items under the personal user [CHAR LIMIT=30] -->
+    <string name="category_personal">Personal</string>
+    <!-- Header for items under the work user [CHAR LIMIT=30] -->
+    <string name="category_work">Work</string>
 
     <!-- Main Settings screen, setting option name to go into search settings -->
     <string name="search_settings">Search</string>
@@ -1827,9 +1833,9 @@
     <string name="brightness">Brightness level</string>
     <!-- Sound & display settings screen, setting option summary to change brightness level -->
     <string name="brightness_summary">Adjust the brightness of the screen</string>
-    <!-- Sound & display settings screen, setting option name to enable adaptive brightness -->
+    <!-- Sound & display settings screen, setting option name to enable adaptive brightness [CHAR LIMIT=30] -->
     <string name="auto_brightness_title">Adaptive brightness</string>
-    <!-- Sound & display settings screen, setting option summary to enable adaptive brightness -->
+    <!-- Sound & display settings screen, setting option summary to enable adaptive brightness [CHAR LIMIT=100] -->
     <string name="auto_brightness_summary">Optimize brightness level for available light</string>
     <!-- Sound & display settings screen, setting option name to change screen timeout -->
     <string name="screen_timeout">Sleep</string>
@@ -3134,7 +3140,7 @@
     <!-- [CHAR LIMIT=NONE] Setting checkbox title for Whether to include bug report item in power menu. -->
     <string name="bugreport_in_power">Bug report shortcut</string>
     <!-- [CHAR LIMIT=NONE] Setting checkbox summary for Whether to include bug report item in power -->
-    <string name="bugreport_in_power_summary">Show a button in Quick Settings for taking a bug report</string>
+    <string name="bugreport_in_power_summary">Show a button in the power menu for taking a bug report</string>
     <!-- Setting Checkbox title whether to keep the screen on when plugged in to a power source -->
     <string name="keep_screen_on">Stay awake</string>
     <!-- setting Checkbox summary whether to keep the screen on when plugged in  -->
@@ -3373,7 +3379,9 @@
     <!-- Label for the default device locale. [CHAR LIMIT=35] -->
     <string name="locale_default">Default</string>
 
-    <!-- Label for no color. [CHAR LIMIT=35] -->
+    <!-- Label for default color. This lets the app pick the color. [CHAR LIMIT=35] -->
+    <string name="color_unspecified">Default</string>
+    <!-- Label for no color (transparent). [CHAR LIMIT=35] -->
     <string name="color_none">None</string>
     <!-- Label for the color white. [CHAR LIMIT=35] -->
     <string name="color_white">White</string>
@@ -3533,8 +3541,18 @@
             <xliff:g id="state">%2$s</xliff:g></string>
     <!-- [CHAR_LIMIT=40] Label for battery level chart when charging with duration -->
     <string name="power_charging_duration"><xliff:g id="level">%1$d</xliff:g>%% -
-            <xliff:g id="state">%2$s</xliff:g>
-            (<xliff:g id="time">%3$s</xliff:g> until full)</string>
+            <xliff:g id="time">%2$s</xliff:g> until full</string>
+    <!-- [CHAR_LIMIT=40] Label for battery level chart when charging with duration -->
+    <string name="power_charging_duration_ac"><xliff:g id="level">%1$d</xliff:g>%% -
+            <xliff:g id="time">%2$s</xliff:g> until full on AC</string>
+    <!-- [CHAR_LIMIT=40] Label for battery level chart when charging with duration -->
+    <string name="power_charging_duration_usb"><xliff:g id="level">%1$d</xliff:g>%% -
+            <xliff:g id="time">%2$s</xliff:g> until full over USB</string>
+    <!-- [CHAR_LIMIT=40] Label for battery level chart when charging with duration -->
+    <string name="power_charging_duration_wireless"><xliff:g id="level">%1$d</xliff:g>%% -
+            <xliff:g id="time">%2$s</xliff:g> until full from wireless</string>
+    <!-- [CHAR_LIMIT=40] Label for list of apps using battery in power use UI -->
+    <string name="power_usage_list_summary">Use since last full charge</string>
     <!-- Battery usage since unplugged -->
     <string name="battery_since_unplugged">Battery use since unplugged</string>
     <!-- Battery usage since user reset the stats -->
@@ -4097,7 +4115,7 @@
     <string name="untitled_apn">Untitled</string>
 
     <string name="sound_category_sound_title">General</string>
-    <string name="sound_category_notification_title">Notifications</string>
+    <string name="notification_log_title">Notification log</string>
 
     <!-- Category title for phone call's ringtone and vibration settings in the Sound Setting.
          [CHAR LIMIT=40] -->
@@ -5065,120 +5083,120 @@
 
     <!-- Sounds and Notifications -->
 
-    <!-- Sounds & notifications: Settings header. [CHAR LIMIT=20] -->
-    <string name="notification_settings">Sounds &amp; Notifications</string>
+    <!-- Sound & notifications: Settings header. [CHAR LIMIT=20] -->
+    <string name="notification_settings">Sound &amp; Notifications</string>
 
-    <!-- Sounds & notifications: Title for the option managing media volume. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications: Title for the option managing media volume. [CHAR LIMIT=30] -->
     <string name="media_volume_option_title">Media volume</string>
 
-    <!-- Sounds & notifications: Title for the option managing alarm volume. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications: Title for the option managing alarm volume. [CHAR LIMIT=30] -->
     <string name="alarm_volume_option_title">Alarm volume</string>
 
-    <!-- Sounds & notifications: Title for the option managing ringer volume. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications: Title for the option managing ringer volume. [CHAR LIMIT=30] -->
     <string name="ring_volume_option_title">Ring volume</string>
 
-    <!-- Sounds & notifications: Title for the option managing notification volume. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications: Title for the option managing notification volume. [CHAR LIMIT=30] -->
     <string name="notification_volume_option_title">Notification volume</string>
 
-    <!-- Sounds & notifications: Title for the Do not disturb option and associated settings page. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications: Title for the Do not disturb option and associated settings page. [CHAR LIMIT=30] -->
     <string name="zen_mode_settings_title">Do not disturb</string>
 
-    <!-- Sounds & notifications: Title for the ringer mode option. [CHAR LIMIT=60] -->
+    <!-- Sound & notifications: Title for the ringer mode option. [CHAR LIMIT=60] -->
     <string name="ringer_mode_title">When calls and notifications arrive</string>
 
-    <!-- Sounds & notifications: Title for the ringer mode option on devices without voice. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications: Title for the ringer mode option on devices without voice. [CHAR LIMIT=30] -->
     <string name="ringer_mode_title_novoice">When notifications arrive</string>
 
-    <!-- Sounds & notifications: Value for the ringer mode option when audible. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications: Value for the ringer mode option when audible. [CHAR LIMIT=30] -->
     <string name="ringer_mode_audible">Ring</string>
 
-    <!-- Sounds & notifications: Value for the ringer mode option when vibrate. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications: Value for the ringer mode option when vibrate. [CHAR LIMIT=30] -->
     <string name="ringer_mode_vibrate">Vibrate instead of ringing</string>
 
-    <!-- Sounds & notifications: Value for the ringer mode option when silent. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications: Value for the ringer mode option when silent. [CHAR LIMIT=30] -->
     <string name="ringer_mode_silent">Don\'t ring or vibrate</string>
 
-    <!-- Sounds & notifications: Title for the option defining the phone ringtone. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications: Title for the option defining the phone ringtone. [CHAR LIMIT=30] -->
     <string name="ringtone_title">Phone ringtone</string>
 
-    <!-- Sounds & notifications: Title for the option defining the default notification ringtone. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications: Title for the option defining the default notification ringtone. [CHAR LIMIT=30] -->
     <string name="notification_ringtone_title">Default notification ringtone</string>
 
-    <!-- Sounds & notifications: Title for the option managing whether or not to vibrate when ringing. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications: Title for the option managing whether or not to vibrate when ringing. [CHAR LIMIT=30] -->
     <string name="vibrate_when_ringing_title">Vibrate when ringing</string>
 
-    <!-- Sounds & notifications: Title for the showing notifications option and associated settings page. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications: Title for the showing notifications option and associated settings page. [CHAR LIMIT=30] -->
     <string name="notification_display_settings">Showing notifications</string>
 
-    <!-- Sounds & notifications > Showing notifications: Title for the pulse notification light option. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications > Showing notifications: Title for the pulse notification light option. [CHAR LIMIT=30] -->
     <string name="notification_pulse_title">Pulse notification light</string>
 
-    <!-- Sounds & notifications > Showing notifications: Title for the option controlling notifications on the lockscreen. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications > Showing notifications: Title for the option controlling notifications on the lockscreen. [CHAR LIMIT=30] -->
     <string name="lock_screen_notifications_title">When device is locked</string>
 
-    <!-- Sounds & notifications > Showing notifications: Value for lockscreen notifications:  all information will be
+    <!-- Sound & notifications > Showing notifications: Value for lockscreen notifications:  all information will be
          shown in notifications shown on a secure lock screen
          [CHAR LIMIT=50] -->
     <string name="lock_screen_notifications_summary_show">Show all notification content</string>
 
-    <!-- Sounds & notifications > Showing notifications: Value for lockscreen notifications: sensitive information will be
+    <!-- Sound & notifications > Showing notifications: Value for lockscreen notifications: sensitive information will be
          hidden or redacted from notifications shown on a secure lock screen
          [CHAR LIMIT=50] -->
     <string name="lock_screen_notifications_summary_hide">Hide sensitive notification content</string>
 
-    <!-- Sounds & notifications > Showing notifications: Value for lockscreen notifications: notifications will not appear on a secure lock screen
+    <!-- Sound & notifications > Showing notifications: Value for lockscreen notifications: notifications will not appear on a secure lock screen
          [CHAR LIMIT=50] -->
     <string name="lock_screen_notifications_summary_disable">Don\'t show notifications at all</string>
 
-    <!-- Sounds & notifications > Showing notifications: Title for the option managing notification display in zen mode. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications > Showing notifications: Title for the option managing notification display in zen mode. [CHAR LIMIT=30] -->
     <string name="zen_mode_notifications_title">When do not disturb is on</string>
 
-    <!-- Sounds & notifications > Showing notifications: Value for zen mode notifications: notifications will be suppressed in zen mode [CHAR LIMIT=50] -->
+    <!-- Sound & notifications > Showing notifications: Value for zen mode notifications: notifications will be suppressed in zen mode [CHAR LIMIT=50] -->
     <string name="zen_mode_notifications_summary_hide">Hide new notifications from the list</string>
 
-    <!-- Sounds & notifications > Showing notifications: Value for zen mode notifications: notifications will be displayed in zen mode [CHAR LIMIT=50] -->
+    <!-- Sound & notifications > Showing notifications: Value for zen mode notifications: notifications will be displayed in zen mode [CHAR LIMIT=50] -->
     <string name="zen_mode_notifications_summary_show">Show all notifications in the list</string>
 
-    <!-- Sounds & notifications > Showing notifications: Title for the option managing notifications per application. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications > Showing notifications: Title for the option managing notifications per application. [CHAR LIMIT=30] -->
     <string name="app_notifications_title">App notifications</string>
 
-    <!-- Sounds & notifications: Title for the other sounds option and associated settings page. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications: Title for the other sounds option and associated settings page. [CHAR LIMIT=30] -->
     <string name="other_sound_settings">Other sounds</string>
 
-    <!-- Sounds & notifications > Other sounds: Title for the option enabling touch sounds for dial pad tones. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications > Other sounds: Title for the option enabling touch sounds for dial pad tones. [CHAR LIMIT=30] -->
     <string name="dial_pad_tones_title">Dial pad tones</string>
 
-    <!-- Sounds & notifications > Other sounds: Title for the option enabling touch sounds for screen locking sounds. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications > Other sounds: Title for the option enabling touch sounds for screen locking sounds. [CHAR LIMIT=30] -->
     <string name="screen_locking_sounds_title">Screen locking sounds</string>
 
-    <!-- Sounds & notifications > Other sounds: Title for the option enabling docking sounds. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications > Other sounds: Title for the option enabling docking sounds. [CHAR LIMIT=30] -->
     <string name="docking_sounds_title">Docking sounds</string>
 
-    <!-- Sounds & notifications > Other sounds: Title for the option enabling touch sounds. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications > Other sounds: Title for the option enabling touch sounds. [CHAR LIMIT=30] -->
     <string name="touch_sounds_title">Touch sounds</string>
 
-    <!-- Sounds & notifications > Other sounds: Title for the option enabling haptic feedback on touch. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications > Other sounds: Title for the option enabling haptic feedback on touch. [CHAR LIMIT=30] -->
     <string name="vibrate_on_touch_title">Vibrate on touch</string>
 
-    <!-- Sounds & notifications > Other sounds: Title for the option enabling dock audio media. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications > Other sounds: Title for the option enabling dock audio media. [CHAR LIMIT=30] -->
     <string name="dock_audio_media_title">Dock speaker plays</string>
 
-    <!-- Sounds & notifications > Other sounds: Value for the dock audio media with value 0: disabled. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications > Other sounds: Value for the dock audio media with value 0: disabled. [CHAR LIMIT=30] -->
     <string name="dock_audio_media_disabled">All audio</string>
 
-    <!-- Sounds & notifications > Other sounds: Value for the dock audio media with value 1: enabled. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications > Other sounds: Value for the dock audio media with value 1: enabled. [CHAR LIMIT=30] -->
     <string name="dock_audio_media_enabled">Media audio only</string>
 
-    <!-- Sounds & notifications > Other sounds: Value for the emergency tone option with value 0: silent. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications > Other sounds: Value for the emergency tone option with value 0: silent. [CHAR LIMIT=30] -->
     <string name="emergency_tone_silent">Silent</string>
 
-    <!-- Sounds & notifications > Other sounds: Value for the emergency tone option with value 1: alert. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications > Other sounds: Value for the emergency tone option with value 1: alert. [CHAR LIMIT=30] -->
     <string name="emergency_tone_alert">Alert</string>
 
-    <!-- Sounds & notifications > Other sounds: Value for the emergency tone option with value 2: vibrate. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications > Other sounds: Value for the emergency tone option with value 2: vibrate. [CHAR LIMIT=30] -->
     <string name="emergency_tone_vibrate">Vibrate</string>
 
-    <!-- Sounds & notifications: Title for managing notification listeners option. [CHAR LIMIT=30] -->
+    <!-- Sound & notifications: Title for managing notification listeners option. [CHAR LIMIT=30] -->
     <string name="manage_notification_access_title">Notification access</string>
 
     <!-- Summary of preference to manage notification listeners, when none are enabled -->
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 568297f..79ed972 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -264,4 +264,21 @@
     <style name="TextAppearance.Switch" parent="TextAppearance.Medium">
     </style>
 
+    <style name="TextAppearance.CategoryTitle" parent="@android:style/TextAppearance.Quantum.Small">
+        <item name="android:textColor">#FF009688</item>
+    </style>
+
+    <style name="TextAppearance.TileTitle" parent="@android:style/TextAppearance.Quantum.Medium">
+    </style>
+
+    <style name="TextAppearance.TileSubTitle" parent="@android:style/TextAppearance.Quantum.Small">
+    </style>
+
+    <style name="TextAppearance.RecentsTitle" parent="TextAppearance.CategoryTitle">
+    </style>
+
+    <style name="TextAppearance.ResultTitle" parent="TextAppearance.CategoryTitle">
+    </style>
+
+
 </resources>
diff --git a/res/values/themes.xml b/res/values/themes.xml
index c39910b..246e253 100644
--- a/res/values/themes.xml
+++ b/res/values/themes.xml
@@ -59,19 +59,20 @@
         <item name="wifi_signal">@drawable/wifi_signal_light</item>
     </style>
 
-    <style name="Theme.CreateShortCut" parent="android:Theme.Quantum.Light.DialogWhenLarge">
-        <item name="android:actionBarWidgetTheme">@android:style/ThemeOverlay.Quantum.ActionBarWidget</item>
-        <item name="android:actionBarTheme">@android:style/ThemeOverlay.Quantum.Dark</item>
-
-        <item name="android:colorPrimary">@color/actionbar_background_color</item>
-        <!-- Used by the bouncing effect for ListView and ScrollView -->
-        <item name="android:colorPrimaryLight">@color/actionbar_background_color</item>
-        <!-- Used by the StatusBar and NavBar -->
-        <item name="android:colorPrimaryDark">@color/actionbar_background_color</item>
-        <item name="android:colorAccent">@color/quantum_orange_A200</item>
+    <!-- Theme with no local references, used by AccountPreferenceBase where we have to inflate
+         layouts against a remote context using our local theme colors. Due to the implementation
+         details of Theme, we can't reference any local resources and MUST instead use the values
+         directly. So use #ff263238 instead of @color/theme_primary and so on. -->
+    <style name="Theme.SettingsBase" parent="@android:style/Theme.Quantum.Light.DarkActionBar">
+        <!-- Should match @color/theme_primary. -->
+        <item name="android:colorPrimary">#ff263238</item>
+        <!-- Should match @color/theme_primary_dark. -->
+        <item name="android:colorPrimaryDark">#ff263238</item>
+        <!-- Should match @color/theme_accent. -->
+        <item name="android:colorAccent">#ff009688</item>
     </style>
 
-    <style name="Theme.Settings" parent="@android:style/Theme.Quantum.Light.DarkActionBar">
+    <style name="Theme.Settings" parent="Theme.SettingsBase">
         <item name="@*android:preferenceHeaderPanelStyle">@style/PreferenceHeaderPanelSinglePane</item>
         <item name="@*android:preferencePanelStyle">@style/PreferencePanelSinglePane</item>
         <item name="@*android:preferenceListStyle">@style/PreferenceHeaderListSinglePane</item>
@@ -83,12 +84,51 @@
         <item name="ic_wps">@drawable/ic_wps_dark</item>
         <item name="wifi_signal">@drawable/wifi_signal_dark</item>
 
-        <item name="android:colorPrimary">@color/actionbar_background_color</item>
-        <!-- Used by the bouncing effect for ListView and ScrollView -->
-        <item name="android:colorPrimaryLight">@color/actionbar_background_color</item>
-        <!-- Used by the StatusBar and NavBar -->
-        <item name="android:colorPrimaryDark">@color/actionbar_background_color</item>
-        <item name="android:colorAccent">@color/quantum_orange_A200</item>
+        <!-- Redefine the ActionBar style for contentInsetStart -->
+        <item name="android:actionBarStyle">@style/Theme.ActionBar</item>
+
+        <item name="android:alertDialogTheme">@style/Theme.AlertDialog</item>
+
+        <!-- LockPatternView colors -->
+        <item name="@*android:regularColor">@color/lock_pattern_view_regular_color</item>
+        <item name="@*android:successColor">@color/lock_pattern_view_success_color</item>
+        <item name="@*android:errorColor">@color/lock_pattern_view_error_color</item>
+
+    </style>
+
+    <style name="Theme.ActionBar" parent="@android:style/Widget.Quantum.Light.ActionBar.Solid">
+        <item name="android:contentInsetStart">@dimen/actionbar_contentInsetStart</item>
+    </style>
+
+    <style name="Theme.DialogWhenLarge" parent="android:style/Theme.Quantum.Light.DialogWhenLarge">
+        <!-- Used by the ActionBar -->
+        <item name="android:colorPrimary">@color/theme_primary</item>
+        <!-- Used by the StatusBar -->
+        <item name="android:colorPrimaryDark">@color/theme_primary_dark</item>
+        <!-- Used by controls, e.g. CheckBox, ProgressBar, etc. -->
+        <item name="android:colorAccent">@color/theme_accent</item>
+
+        <!-- Redefine the ActionBar style for contentInsetStart -->
+        <item name="android:actionBarStyle">@style/Theme.ActionBar</item>
+    </style>
+
+    <style name="Theme.SubSettingsDialogWhenLarge" parent="Theme.DialogWhenLarge">
+        <item name="android:actionBarWidgetTheme">@null</item>
+        <item name="android:actionBarTheme">@android:style/ThemeOverlay.Quantum.Dark.ActionBar</item>
+    </style>
+
+    <style name="Theme.AlertDialog" parent="@*android:style/Theme.Quantum.Light.Dialog.Alert">
+        <item name="android:windowSoftInputMode">adjustResize</item>
+
+        <!-- Used by the ActionBar -->
+        <item name="android:colorPrimary">@color/theme_primary</item>
+        <!-- Used by the StatusBar -->
+        <item name="android:colorPrimaryDark">@color/theme_primary_dark</item>
+        <!-- Used by controls, e.g. CheckBox, ProgressBar, etc. -->
+        <item name="android:colorAccent">@color/theme_accent</item>
+
+        <!-- Redefine the ActionBar style for contentInsetStart -->
+        <item name="android:actionBarStyle">@style/Theme.ActionBar</item>
     </style>
 
 </resources>
diff --git a/res/xml/accessibility_daltonizer_settings.xml b/res/xml/accessibility_daltonizer_settings.xml
index 2e8ad34..30a5444 100644
--- a/res/xml/accessibility_daltonizer_settings.xml
+++ b/res/xml/accessibility_daltonizer_settings.xml
@@ -17,11 +17,6 @@
 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
     android:title="@string/accessibility_display_daltonizer_preference_title" >
 
-    <CheckBoxPreference
-        android:key="enable_quick_setting"
-        android:persistent="false"
-        android:title="@string/enable_quick_setting" />
-
     <ListPreference
         android:entries="@array/daltonizer_type_entries"
         android:entryValues="@array/daltonizer_type_values"
diff --git a/res/xml/account_settings.xml b/res/xml/account_settings.xml
new file mode 100644
index 0000000..236a26d
--- /dev/null
+++ b/res/xml/account_settings.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+        android:key="account"
+        android:title="@string/account_settings_title">
+
+        <Preference
+            android:key="add_account"
+            android:title="@string/add_account_label"
+            android:icon="@drawable/ic_menu_add_dark"
+            android:order="2147483648" />
+
+        <PreferenceCategory
+            android:key="account_personal"
+            android:title="@string/category_personal" >
+
+                <Preference
+                    android:key="add_account_personal"
+                    android:title="@string/add_account_label"
+                    android:icon="@drawable/ic_menu_add_dark"
+                    android:order="2147483648" />
+
+        </PreferenceCategory>
+
+        <PreferenceCategory
+            android:key="account_work"
+            android:title="@string/category_work" >
+
+                <Preference
+                    android:key="add_account_work"
+                    android:title="@string/add_account_label"
+                    android:icon="@drawable/ic_menu_add_dark"
+                    android:order="2147483648" />
+
+        </PreferenceCategory>
+
+</PreferenceScreen>
diff --git a/res/xml/dashboard_categories.xml b/res/xml/dashboard_categories.xml
index 44ec960..ab669d1 100644
--- a/res/xml/dashboard_categories.xml
+++ b/res/xml/dashboard_categories.xml
@@ -162,6 +162,15 @@
                 android:icon="@drawable/ic_settings_security"
                 />
 
+        <!-- Account -->
+        <!-- TODO: add accounts icon -->
+        <dashboard-tile
+                android:id="@+id/account_settings"
+                android:title="@string/account_settings_title"
+                android:fragment="com.android.settings.accounts.AccountSettings"
+                android:icon="@null"
+                />
+
         <!-- Language -->
         <dashboard-tile
                 android:id="@+id/language_settings"
diff --git a/res/xml/device_info_settings.xml b/res/xml/device_info_settings.xml
index 0261b67..c9a9a48 100644
--- a/res/xml/device_info_settings.xml
+++ b/res/xml/device_info_settings.xml
@@ -80,15 +80,6 @@
             <intent android:action="android.settings.SAFETY" />
         </PreferenceScreen>
 
-        <!-- Contributors -->
-        <!-- 
-        <PreferenceScreen
-                android:key="contributors"
-                android:title="@string/contributors_title">
-            <intent android:action="android.settings.TEAM" />
-        </PreferenceScreen>
-        -->
-
         <PreferenceScreen
                 android:key="regulatory_info"
                 android:title="@string/regulatory_information">
diff --git a/src/com/android/settings/AdvancedSecuritySettings.java b/src/com/android/settings/AdvancedSecuritySettings.java
index c497ac4..2a8c623 100644
--- a/src/com/android/settings/AdvancedSecuritySettings.java
+++ b/src/com/android/settings/AdvancedSecuritySettings.java
@@ -109,6 +109,7 @@
 
         for (ResolveInfo resolveInfo : resolveInfos) {
             if (resolveInfo.serviceInfo == null) continue;
+            if (!TrustAgentUtils.checkProvidePermission(resolveInfo, pm)) continue;
             ComponentName name = TrustAgentUtils.getComponentName(resolveInfo);
             if (!mAvailableAgents.containsKey(name)) {
                 AgentInfo agentInfo = new AgentInfo();
diff --git a/src/com/android/settings/CryptKeeper.java b/src/com/android/settings/CryptKeeper.java
index 661e304..d24c741 100644
--- a/src/com/android/settings/CryptKeeper.java
+++ b/src/com/android/settings/CryptKeeper.java
@@ -58,7 +58,6 @@
 import android.widget.TextView;
 
 import com.android.internal.statusbar.StatusBarIcon;
-import com.android.internal.telephony.ITelephony;
 import com.android.internal.telephony.Phone;
 import com.android.internal.telephony.PhoneConstants;
 import com.android.internal.widget.LockPatternUtils;
@@ -409,6 +408,7 @@
 
                     final TextView status = (TextView) findViewById(R.id.owner_info);
                     status.setText(owner_info);
+                    status.setSelected(true); // Required for marquee'ing to work
                     passwordEntryInit();
                 }
             }.execute();
@@ -605,8 +605,7 @@
         }
 
         // Disable the Emergency call button if the device has no voice telephone capability
-        final TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
-        if (!tm.isVoiceCapable()) {
+        if (!getTelephonyManager().isVoiceCapable()) {
             final View emergencyCall = findViewById(R.id.emergencyCallButton);
             if (emergencyCall != null) {
                 Log.d(TAG, "Removing the emergency Call button");
@@ -760,7 +759,7 @@
      */
     private final void setAirplaneModeIfNecessary() {
         final boolean isLteDevice =
-                TelephonyManager.getDefault().getLteOnCdmaMode() == PhoneConstants.LTE_ON_CDMA_TRUE;
+                getTelephonyManager().getLteOnCdmaMode() == PhoneConstants.LTE_ON_CDMA_TRUE;
         if (!isLteDevice) {
             Log.d(TAG, "Going into airplane mode.");
             Settings.Global.putInt(getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, 1);
@@ -796,7 +795,7 @@
             return;
         }
 
-        final int newState = TelephonyManager.getDefault().getCallState();
+        final int newState = getTelephonyManager().getCallState();
         int textId;
         if (newState == TelephonyManager.CALL_STATE_OFFHOOK) {
             // Show "return to call" text and show phone icon
@@ -816,23 +815,14 @@
     }
 
     private void takeEmergencyCallAction() {
-        if (TelephonyManager.getDefault().getCallState() == TelephonyManager.CALL_STATE_OFFHOOK) {
-            resumeCall();
+        TelephonyManager telephonyManager = getTelephonyManager();
+        if (telephonyManager.getCallState() == TelephonyManager.CALL_STATE_OFFHOOK) {
+            telephonyManager.showCallScreen();
         } else {
             launchEmergencyDialer();
         }
     }
 
-    private void resumeCall() {
-        final ITelephony phone = ITelephony.Stub.asInterface(ServiceManager.checkService("phone"));
-        if (phone != null) {
-            try {
-                phone.showCallScreen();
-            } catch (RemoteException e) {
-                Log.e(TAG, "Error calling ITelephony service: " + e);
-            }
-        }
-    }
 
     private void launchEmergencyDialer() {
         final Intent intent = new Intent(ACTION_EMERGENCY_DIAL);
@@ -841,6 +831,10 @@
         startActivity(intent);
     }
 
+    private TelephonyManager getTelephonyManager() {
+        return (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
+    }
+
     /**
      * Listen to key events so we can disable sounds when we get a keyinput in EditText.
      */
diff --git a/src/com/android/settings/DeviceInfoSettings.java b/src/com/android/settings/DeviceInfoSettings.java
index 9d10ecb..c26e4ab 100644
--- a/src/com/android/settings/DeviceInfoSettings.java
+++ b/src/com/android/settings/DeviceInfoSettings.java
@@ -35,27 +35,30 @@
 import android.preference.Preference;
 import android.preference.PreferenceGroup;
 import android.preference.PreferenceScreen;
+import android.provider.SearchIndexableResource;
 import android.provider.Settings;
 import android.text.TextUtils;
 import android.util.Log;
 import android.widget.Toast;
+import com.android.settings.search.BaseSearchIndexProvider;
+import com.android.settings.search.Indexable;
 
 import java.io.BufferedReader;
 import java.io.FileReader;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-public class DeviceInfoSettings extends SettingsPreferenceFragment {
+public class DeviceInfoSettings extends SettingsPreferenceFragment implements Indexable {
 
     private static final String LOG_TAG = "DeviceInfoSettings";
     private static final String FILENAME_PROC_VERSION = "/proc/version";
     private static final String FILENAME_MSV = "/sys/board_properties/soc/msv";
 
     private static final String KEY_CONTAINER = "container";
-    private static final String KEY_TEAM = "team";
-    private static final String KEY_CONTRIBUTORS = "contributors";
     private static final String KEY_REGULATORY_INFO = "regulatory_info";
     private static final String KEY_TERMS = "terms";
     private static final String KEY_LICENSE = "license";
@@ -73,6 +76,7 @@
     private static final String KEY_EQUIPMENT_ID = "fcc_equipment_id";
     private static final String PROPERTY_EQUIPMENT_ID = "ro.ril.fccid";
     private static final String KEY_DEVICE_FEEDBACK = "device_feedback";
+    private static final String KEY_SAFETY_LEGAL = "safetylegal";
 
     static final int TAPS_TO_BE_A_DEVELOPER = 7;
 
@@ -109,7 +113,7 @@
                 PROPERTY_SELINUX_STATUS);
 
         // Remove Safety information preference if PROPERTY_URL_SAFETYLEGAL is not set
-        removePreferenceIfPropertyMissing(getPreferenceScreen(), "safetylegal",
+        removePreferenceIfPropertyMissing(getPreferenceScreen(), KEY_SAFETY_LEGAL,
                 PROPERTY_URL_SAFETYLEGAL);
 
         // Remove Equipment id preference if FCC ID is not set by RIL
@@ -139,8 +143,6 @@
                 Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY);
         Utils.updatePreferenceToSpecificActivityOrRemove(act, parentPreference, KEY_COPYRIGHT,
                 Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY);
-        Utils.updatePreferenceToSpecificActivityOrRemove(act, parentPreference, KEY_TEAM,
-                Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY);
 
         // These are contained by the root preference screen
         parentPreference = getPreferenceScreen();
@@ -152,8 +154,6 @@
             // Remove for secondary users
             removePreference(KEY_SYSTEM_UPDATE_SETTINGS);
         }
-        Utils.updatePreferenceToSpecificActivityOrRemove(act, parentPreference, KEY_CONTRIBUTORS,
-                Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY);
 
         // Read platform settings for additional system update setting
         removePreferenceIfBoolFalse(KEY_UPDATE_SETTING,
@@ -365,7 +365,7 @@
     }
 
     private static String getFeedbackReporterPackage(Context context) {
-        String feedbackReporter =
+        final String feedbackReporter =
                 context.getResources().getString(R.string.oem_preferred_feedback_reporter);
         if (TextUtils.isEmpty(feedbackReporter)) {
             // Reporter not configured. Return.
@@ -373,7 +373,7 @@
         }
         // Additional checks to ensure the reporter is on system image, and reporter is
         // configured to listen to the intent. Otherwise, dont show the "send feedback" option.
-        Intent intent = new Intent(Intent.ACTION_BUG_REPORT);
+        final Intent intent = new Intent(Intent.ACTION_BUG_REPORT);
 
         PackageManager pm = context.getPackageManager();
         List<ResolveInfo> resolvedPackages =
@@ -398,5 +398,83 @@
         }
         return null;
     }
+
+    /**
+     * For Search.
+     */
+    public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
+        new BaseSearchIndexProvider() {
+
+            @Override
+            public List<SearchIndexableResource> getXmlResourcesToIndex(
+                    Context context, boolean enabled) {
+                final SearchIndexableResource sir = new SearchIndexableResource(context);
+                sir.xmlResId = R.xml.device_info_settings;
+                return Arrays.asList(sir);
+            }
+
+            @Override
+            public List<String> getNonIndexableKeys(Context context) {
+                final List<String> keys = new ArrayList<String>();
+                if (isPropertyMissing(PROPERTY_SELINUX_STATUS)) {
+                    keys.add(KEY_SELINUX_STATUS);
+                }
+                if (isPropertyMissing(PROPERTY_URL_SAFETYLEGAL)) {
+                    keys.add(KEY_SAFETY_LEGAL);
+                }
+                if (isPropertyMissing(PROPERTY_EQUIPMENT_ID)) {
+                    keys.add(KEY_EQUIPMENT_ID);
+                }
+                // Remove Baseband version if wifi-only device
+                if (Utils.isWifiOnly(context)) {
+                    keys.add((KEY_BASEBAND_VERSION));
+                }
+                // Dont show feedback option if there is no reporter.
+                if (TextUtils.isEmpty(getFeedbackReporterPackage(context))) {
+                    keys.add(KEY_DEVICE_FEEDBACK);
+                }
+                if (!checkIntentAction(context, "android.settings.TERMS")) {
+                    keys.add(KEY_TERMS);
+                }
+                if (!checkIntentAction(context, "android.settings.LICENSE")) {
+                    keys.add(KEY_LICENSE);
+                }
+                if (!checkIntentAction(context, "android.settings.COPYRIGHT")) {
+                    keys.add(KEY_COPYRIGHT);
+                }
+                if (UserHandle.myUserId() != UserHandle.USER_OWNER) {
+                    keys.add(KEY_SYSTEM_UPDATE_SETTINGS);
+                }
+                if (!context.getResources().getBoolean(
+                        R.bool.config_additional_system_update_setting_enable)) {
+                    keys.add(KEY_UPDATE_SETTING);
+                }
+                return keys;
+            }
+
+            private boolean isPropertyMissing(String property) {
+                return SystemProperties.get(property).equals("");
+            }
+
+            private boolean checkIntentAction(Context context, String action) {
+                final Intent intent = new Intent(action);
+
+                // Find the activity that is in the system image
+                final PackageManager pm = context.getPackageManager();
+                final List<ResolveInfo> list = pm.queryIntentActivities(intent, 0);
+                final int listSize = list.size();
+
+                for (int i = 0; i < listSize; i++) {
+                    ResolveInfo resolveInfo = list.get(i);
+                    if ((resolveInfo.activityInfo.applicationInfo.flags &
+                            ApplicationInfo.FLAG_SYSTEM) != 0) {
+                        return true;
+                    }
+                }
+
+                return false;
+            }
+        };
+
 }
 
diff --git a/src/com/android/settings/DisplaySettings.java b/src/com/android/settings/DisplaySettings.java
index 3bf7cce..75236de 100644
--- a/src/com/android/settings/DisplaySettings.java
+++ b/src/com/android/settings/DisplaySettings.java
@@ -16,6 +16,9 @@
 
 package com.android.settings;
 
+import com.android.settings.search.BaseSearchIndexProvider;
+import com.android.settings.search.Indexable;
+
 import static android.provider.Settings.System.SCREEN_BRIGHTNESS_MODE;
 import static android.provider.Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC;
 import static android.provider.Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL;
@@ -36,13 +39,15 @@
 import android.preference.Preference;
 import android.preference.Preference.OnPreferenceClickListener;
 import android.preference.PreferenceScreen;
+import android.provider.SearchIndexableResource;
 import android.provider.Settings;
 import android.util.Log;
 
 import java.util.ArrayList;
+import java.util.List;
 
 public class DisplaySettings extends SettingsPreferenceFragment implements
-        Preference.OnPreferenceChangeListener, OnPreferenceClickListener {
+        Preference.OnPreferenceChangeListener, OnPreferenceClickListener, Indexable {
     private static final String TAG = "DisplaySettings";
 
     /** If there is no setting in the provider, use this. */
@@ -90,9 +95,7 @@
         mFontSizePref.setOnPreferenceChangeListener(this);
         mFontSizePref.setOnPreferenceClickListener(this);
 
-        boolean automaticBrightnessAvailable = getResources().getBoolean(
-                com.android.internal.R.bool.config_automatic_brightness_available);
-        if (automaticBrightnessAvailable) {
+        if (isAutomaticBrightnessAvailable(getResources())) {
             mAutoBrightnessPreference = (CheckBoxPreference) findPreference(KEY_AUTO_BRIGHTNESS);
             mAutoBrightnessPreference.setOnPreferenceChangeListener(this);
         } else {
@@ -100,6 +103,10 @@
         }
     }
 
+    private static boolean isAutomaticBrightnessAvailable(Resources res) {
+        return res.getBoolean(com.android.internal.R.bool.config_automatic_brightness_available);
+    }
+
     private void updateTimeoutPreferenceDescription(long currentTimeout) {
         ListPreference preference = mScreenTimeoutPreference;
         String summary;
@@ -286,4 +293,28 @@
         }
         return false;
     }
+
+    public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
+            new BaseSearchIndexProvider() {
+                @Override
+                public List<SearchIndexableResource> getXmlResourcesToIndex(Context context,
+                        boolean enabled) {
+                    ArrayList<SearchIndexableResource> result = new ArrayList<>(1);
+
+                    SearchIndexableResource sir = new SearchIndexableResource(context);
+                    sir.xmlResId = R.xml.display_settings;
+                    result.add(sir);
+
+                    return result;
+                }
+
+                @Override
+                public List<String> getNonIndexableKeys(Context context) {
+                    ArrayList<String> nonIndexableKeys = new ArrayList<>(1);
+                    if (!isAutomaticBrightnessAvailable(context.getResources())) {
+                        nonIndexableKeys.add(KEY_AUTO_BRIGHTNESS);
+                    }
+                    return nonIndexableKeys;
+                }
+            };
 }
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index ab03853..b35a362 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -317,6 +317,7 @@
                     PackageManager.GET_META_DATA);
             for (ResolveInfo resolveInfo : resolveInfos) {
                 if (resolveInfo.serviceInfo == null) continue;
+                if (!TrustAgentUtils.checkProvidePermission(resolveInfo, pm)) continue;
                 TrustAgentUtils.TrustAgentComponentInfo trustAgentComponentInfo =
                         TrustAgentUtils.getSettingsComponent(pm, resolveInfo);
                 if (trustAgentComponentInfo.componentName == null ||
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index 18bab2c..e602fa6 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -630,6 +630,7 @@
         mDevelopmentPreferencesListener = new SharedPreferences.OnSharedPreferenceChangeListener() {
             @Override
             public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
+                setNeedToRebuildCategories(true);
                 invalidateCategories();
             }
         };
diff --git a/src/com/android/settings/TrustAgentUtils.java b/src/com/android/settings/TrustAgentUtils.java
index 64829a2..31a073c 100644
--- a/src/com/android/settings/TrustAgentUtils.java
+++ b/src/com/android/settings/TrustAgentUtils.java
@@ -24,6 +24,7 @@
 import android.content.res.XmlResourceParser;
 import android.service.trust.TrustAgentService;
 import android.util.AttributeSet;
+import android.util.Log;
 import android.util.Slog;
 import android.util.Xml;
 
@@ -36,6 +37,21 @@
     static final String TAG = "TrustAgentUtils";
 
     private static final String TRUST_AGENT_META_DATA = TrustAgentService.TRUST_AGENT_META_DATA;
+    private static final String PERMISSION_PROVIDE_AGENT = android.Manifest.permission.PROVIDE_TRUST_AGENT;
+
+    /**
+     * @return true, if the service in resolveInfo has the permission to provide a trust agent.
+     */
+    public static boolean checkProvidePermission(ResolveInfo resolveInfo, PackageManager pm) {
+        String packageName = resolveInfo.serviceInfo.packageName;
+        if (pm.checkPermission(PERMISSION_PROVIDE_AGENT, packageName)
+                != PackageManager.PERMISSION_GRANTED) {
+            Log.w(TAG, "Skipping agent because package " + packageName
+                    + " does not have permission " + PERMISSION_PROVIDE_AGENT + ".");
+            return false;
+        }
+        return true;
+    }
 
     public static class TrustAgentComponentInfo {
         ComponentName componentName;
diff --git a/src/com/android/settings/accessibility/CaptionPropertiesFragment.java b/src/com/android/settings/accessibility/CaptionPropertiesFragment.java
index 5dcf121..41c80ae 100644
--- a/src/com/android/settings/accessibility/CaptionPropertiesFragment.java
+++ b/src/com/android/settings/accessibility/CaptionPropertiesFragment.java
@@ -29,6 +29,7 @@
 import android.provider.Settings;
 import android.view.LayoutInflater;
 import android.view.View;
+import android.view.View.OnLayoutChangeListener;
 import android.view.ViewGroup;
 import android.view.ViewGroup.LayoutParams;
 import android.view.accessibility.CaptioningManager;
@@ -64,11 +65,13 @@
     private static final String PREF_PRESET = "captioning_preset";
     private static final String PREF_CUSTOM = "custom";
 
-    private static final float DEFAULT_FONT_SIZE = 48f;
+    /** WebVtt specifies line height as 5.3% of the viewport height. */
+    private static final float LINE_HEIGHT_RATIO = 0.0533f;
 
     private CaptioningManager mCaptioningManager;
     private SubtitleView mPreviewText;
     private View mPreviewWindow;
+    private View mPreviewViewport;
     private SwitchBar mSwitchBar;
     private ToggleSwitch mToggleSwitch;
 
@@ -130,13 +133,21 @@
         mPreviewText = (SubtitleView) view.findViewById(R.id.preview_text);
         mPreviewText.setVisibility(enabled ? View.VISIBLE : View.INVISIBLE);
 
+        mPreviewWindow = view.findViewById(R.id.preview_window);
+        mPreviewViewport = view.findViewById(R.id.preview_viewport);
+        mPreviewViewport.addOnLayoutChangeListener(new OnLayoutChangeListener() {
+            @Override
+            public void onLayoutChange(View v, int left, int top, int right, int bottom,
+                    int oldLeft, int oldTop, int oldRight, int oldBottom) {
+                refreshPreviewText();
+            }
+        });
+
         SettingsActivity activity = (SettingsActivity) getActivity();
         mSwitchBar = activity.getSwitchBar();
         mToggleSwitch = mSwitchBar.getSwitch();
         mToggleSwitch.setCheckedInternal(enabled);
 
-        mPreviewWindow = view.findViewById(R.id.preview_window);
-
         getPreferenceScreen().setEnabled(enabled);
 
         refreshPreviewText();
@@ -164,7 +175,7 @@
         final SubtitleView preview = mPreviewText;
         if (preview != null) {
             final int styleId = mCaptioningManager.getRawUserStyle();
-            applyCaptionProperties(mCaptioningManager, preview, styleId);
+            applyCaptionProperties(mCaptioningManager, preview, mPreviewViewport, styleId);
 
             final Locale locale = mCaptioningManager.getLocale();
             if (locale != null) {
@@ -176,18 +187,29 @@
             }
 
             final CaptionStyle style = mCaptioningManager.getUserStyle();
-            mPreviewWindow.setBackgroundColor(style.windowColor);
+            if (style.hasWindowColor()) {
+                mPreviewWindow.setBackgroundColor(style.windowColor);
+            } else {
+                final CaptionStyle defStyle = CaptionStyle.DEFAULT;
+                mPreviewWindow.setBackgroundColor(defStyle.windowColor);
+            }
         }
     }
 
-    public static void applyCaptionProperties(
-            CaptioningManager manager, SubtitleView previewText, int styleId) {
+    public static void applyCaptionProperties(CaptioningManager manager, SubtitleView previewText,
+            View previewWindow, int styleId) {
         previewText.setStyle(styleId);
 
         final Context context = previewText.getContext();
         final ContentResolver cr = context.getContentResolver();
         final float fontScale = manager.getFontScale();
-        previewText.setTextSize(fontScale * DEFAULT_FONT_SIZE);
+        if (previewWindow != null) {
+            previewText.setTextSize(previewWindow.getHeight() * LINE_HEIGHT_RATIO * fontScale);
+        } else {
+            final float textSize = context.getResources().getDimension(
+                    R.dimen.caption_preview_text_size);
+            previewText.setTextSize(textSize * fontScale);
+        }
 
         final Locale locale = manager.getLocale();
         if (locale != null) {
@@ -341,7 +363,7 @@
         final int opacityValue = opacity.getValue();
         final int value;
         if (Color.alpha(colorValue) == 0) {
-            value = Color.alpha(opacityValue);
+            value = colorValue & 0x00FFFF00 | Color.alpha(opacityValue);
         } else {
             value = colorValue & 0x00FFFFFF | opacityValue & 0xFF000000;
         }
diff --git a/src/com/android/settings/accessibility/ColorPreference.java b/src/com/android/settings/accessibility/ColorPreference.java
index f4a5ba7..39e555a 100644
--- a/src/com/android/settings/accessibility/ColorPreference.java
+++ b/src/com/android/settings/accessibility/ColorPreference.java
@@ -60,7 +60,7 @@
 
     @Override
     public boolean shouldDisableDependents() {
-        return getValue() == Color.TRANSPARENT || super.shouldDisableDependents();
+        return Color.alpha(getValue()) == 0 || super.shouldDisableDependents();
     }
 
     @Override
diff --git a/src/com/android/settings/accessibility/PresetPreference.java b/src/com/android/settings/accessibility/PresetPreference.java
index 9f1aee3..fe5ca68 100644
--- a/src/com/android/settings/accessibility/PresetPreference.java
+++ b/src/com/android/settings/accessibility/PresetPreference.java
@@ -49,10 +49,11 @@
 
     @Override
     protected void onBindListItem(View view, int index) {
+        final View previewViewport = view.findViewById(R.id.preview_viewport);
         final SubtitleView previewText = (SubtitleView) view.findViewById(R.id.preview);
         final int value = getValueAt(index);
         CaptionPropertiesFragment.applyCaptionProperties(
-                mCaptioningManager, previewText, value);
+                mCaptioningManager, previewText, previewViewport, value);
 
         final float density = getContext().getResources().getDisplayMetrics().density;
         previewText.setTextSize(DEFAULT_FONT_SIZE * density);
diff --git a/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
index b910f796a..54a34f2 100644
--- a/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
@@ -17,7 +17,6 @@
 package com.android.settings.accessibility;
 
 import android.os.Bundle;
-import android.preference.CheckBoxPreference;
 import android.preference.ListPreference;
 import android.preference.Preference;
 import android.provider.Settings;
@@ -32,11 +31,8 @@
         implements Preference.OnPreferenceChangeListener, SwitchBar.OnSwitchChangeListener {
     private static final String ENABLED = Settings.Secure.ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED;
     private static final String TYPE = Settings.Secure.ACCESSIBILITY_DISPLAY_DALTONIZER;
-    private static final String QUICK_SETTING_ENABLED =
-            Settings.Secure.ACCESSIBILITY_DISPLAY_DALTONIZER_QUICK_SETTING_ENABLED;
     private static final int DEFAULT_TYPE = AccessibilityManager.DALTONIZER_CORRECT_DEUTERANOMALY;
 
-    private CheckBoxPreference mEnableQuickSetting;
     private ListPreference mType;
 
     @Override
@@ -45,7 +41,6 @@
 
         addPreferencesFromResource(R.xml.accessibility_daltonizer_settings);
 
-        mEnableQuickSetting = (CheckBoxPreference) findPreference("enable_quick_setting");
         mType = (ListPreference) findPreference("type");
 
         initPreferences();
@@ -58,10 +53,7 @@
 
     @Override
     public boolean onPreferenceChange(Preference preference, Object newValue) {
-        if (preference == mEnableQuickSetting) {
-            Settings.Secure.putInt(
-                    getContentResolver(), QUICK_SETTING_ENABLED, ((Boolean) newValue) ? 1 : 0);
-        } else if (preference == mType) {
+        if (preference == mType) {
             Settings.Secure.putInt(getContentResolver(), TYPE, Integer.parseInt((String) newValue));
             preference.setSummary("%s");
         }
@@ -92,10 +84,6 @@
     }
 
     private void initPreferences() {
-        mEnableQuickSetting.setChecked(
-                Settings.Secure.getInt(getContentResolver(), QUICK_SETTING_ENABLED, 0) == 1);
-        mEnableQuickSetting.setOnPreferenceChangeListener(this);
-
         final String value = Integer.toString(
                 Settings.Secure.getInt(getContentResolver(), TYPE, DEFAULT_TYPE));
         mType.setValue(value);
diff --git a/src/com/android/settings/accounts/AccountPreferenceBase.java b/src/com/android/settings/accounts/AccountPreferenceBase.java
index f533263..37dffca 100644
--- a/src/com/android/settings/accounts/AccountPreferenceBase.java
+++ b/src/com/android/settings/accounts/AccountPreferenceBase.java
@@ -22,6 +22,7 @@
 import java.util.Map;
 
 import com.android.settings.SettingsPreferenceFragment;
+
 import com.google.android.collect.Maps;
 
 import android.accounts.Account;
@@ -35,12 +36,14 @@
 import android.content.SyncStatusObserver;
 import android.content.pm.PackageManager;
 import android.content.res.Resources;
+import android.content.res.Resources.Theme;
 import android.graphics.drawable.Drawable;
 import android.os.Bundle;
 import android.os.Handler;
 import android.preference.PreferenceScreen;
 import android.text.format.DateFormat;
 import android.util.Log;
+import android.view.ContextThemeWrapper;
 
 class AccountPreferenceBase extends SettingsPreferenceFragment
         implements OnAccountsUpdateListener {
@@ -147,8 +150,19 @@
             try {
                 desc = mAuthenticatorHelper.getAccountTypeDescription(accountType);
                 if (desc != null && desc.accountPreferencesId != 0) {
-                    Context authContext = getActivity().createPackageContext(desc.packageName, 0);
-                    prefs = getPreferenceManager().inflateFromResource(authContext,
+                    // Load the context of the target package, then apply the
+                    // base Settings theme (no references to local resources)
+                    // and create a context theme wrapper so that we get the
+                    // correct text colors. Control colors will still be wrong,
+                    // but there's not much we can do about it since we can't
+                    // reference local color resources.
+                    final Context targetCtx = getActivity().createPackageContext(
+                            desc.packageName, 0);
+                    final Theme baseTheme = getResources().newTheme();
+                    baseTheme.applyStyle(com.android.settings.R.style.Theme_SettingsBase, true);
+                    final Context themedCtx = new ContextThemeWrapper(targetCtx, 0);
+                    themedCtx.getTheme().setTo(baseTheme);
+                    prefs = getPreferenceManager().inflateFromResource(themedCtx,
                             desc.accountPreferencesId, parent);
                 }
             } catch (PackageManager.NameNotFoundException e) {
diff --git a/src/com/android/settings/accounts/AccountSettings.java b/src/com/android/settings/accounts/AccountSettings.java
new file mode 100644
index 0000000..2477877
--- /dev/null
+++ b/src/com/android/settings/accounts/AccountSettings.java
@@ -0,0 +1,249 @@
+/*
+ * Copyright (C) 2014 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.accounts;
+
+import android.accounts.Account;
+import android.accounts.AccountManager;
+import android.accounts.OnAccountsUpdateListener;
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.os.UserManager;
+import android.preference.Preference;
+import android.preference.Preference.OnPreferenceClickListener;
+import android.preference.PreferenceGroup;
+
+import com.android.settings.R;
+import com.android.settings.SettingsPreferenceFragment;
+import com.android.settings.Utils;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+/**
+ * Settings screen for the account types on the device.
+ * This shows all account types available for personal and work profiles.
+ */
+public class AccountSettings extends SettingsPreferenceFragment
+        implements OnAccountsUpdateListener, OnPreferenceClickListener {
+    public static final String TAG = "AccountSettings";
+
+    private static final String KEY_ACCOUNT = "account";
+    private static final String KEY_ADD_ACCOUNT = "add_account";
+
+    private static final String KEY_CATEGORY_PERSONAL = "account_personal";
+    private static final String KEY_ADD_ACCOUNT_PERSONAL = "add_account_personal";
+    private static final String KEY_CATEGORY_WORK = "account_work";
+
+    private AuthenticatorHelper mAuthenticatorHelper;
+    private boolean mListeningToAccountUpdates;
+
+    private PreferenceGroup mAccountTypesForUser;
+    private Preference mAddAccountForUser;
+
+    private UserManager mUm;
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        mUm = (UserManager) getSystemService(Context.USER_SERVICE);
+
+        mAuthenticatorHelper = new AuthenticatorHelper();
+        mAuthenticatorHelper.updateAuthDescriptions(getActivity());
+        mAuthenticatorHelper.onAccountsUpdated(getActivity(), null);
+
+        // Load the preferences from an XML resource
+        addPreferencesFromResource(R.xml.account_settings);
+
+        if(mUm.isLinkedUser()) {
+            // Restricted user or similar
+            // TODO: Do we disallow modifying accounts for restricted profiles?
+            mAccountTypesForUser = (PreferenceGroup) findPreference(KEY_ACCOUNT);
+            if (mUm.hasUserRestriction(UserManager.DISALLOW_MODIFY_ACCOUNTS)) {
+                removePreference(KEY_ADD_ACCOUNT);
+            } else {
+                mAddAccountForUser = findPreference(KEY_ADD_ACCOUNT);
+                mAddAccountForUser.setOnPreferenceClickListener(this);
+            }
+            removePreference(KEY_CATEGORY_PERSONAL);
+            removePreference(KEY_CATEGORY_WORK);
+        } else {
+            mAccountTypesForUser = (PreferenceGroup) findPreference(KEY_CATEGORY_PERSONAL);
+            mAddAccountForUser = findPreference(KEY_ADD_ACCOUNT_PERSONAL);
+            mAddAccountForUser.setOnPreferenceClickListener(this);
+
+            // TODO: Show the work accounts also
+            // TODO: Handle the case where there is only one account
+            removePreference(KEY_CATEGORY_WORK);
+            removePreference(KEY_ADD_ACCOUNT);
+        }
+        updateAccountTypes(mAccountTypesForUser);
+    }
+
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+        stopListeningToAccountUpdates();
+    }
+
+    @Override
+    public void onAccountsUpdated(Account[] accounts) {
+        // TODO: watch for package upgrades to invalidate cache; see 7206643
+        mAuthenticatorHelper.updateAuthDescriptions(getActivity());
+        mAuthenticatorHelper.onAccountsUpdated(getActivity(), accounts);
+        listenToAccountUpdates();
+        updateAccountTypes(mAccountTypesForUser);
+    }
+
+    @Override
+    public boolean onPreferenceClick(Preference preference) {
+        // Check the preference
+        if (preference == mAddAccountForUser) {
+            Intent intent = new Intent("android.settings.ADD_ACCOUNT_SETTINGS");
+            startActivity(intent);
+            return true;
+        }
+        return false;
+    }
+
+    private void updateAccountTypes(PreferenceGroup preferenceGroup) {
+        preferenceGroup.removeAll();
+        preferenceGroup.setOrderingAsAdded(true);
+        for (AccountPreference preference : getAccountTypePreferences()) {
+            preferenceGroup.addPreference(preference);
+        }
+        if (mAddAccountForUser != null) {
+            preferenceGroup.addPreference(mAddAccountForUser);
+        }
+    }
+
+    private List<AccountPreference> getAccountTypePreferences() {
+        String[] accountTypes = mAuthenticatorHelper.getEnabledAccountTypes();
+        List<AccountPreference> accountTypePreferences =
+                new ArrayList<AccountPreference>(accountTypes.length);
+        for (String accountType : accountTypes) {
+            CharSequence label = mAuthenticatorHelper.getLabelForType(getActivity(), accountType);
+            if (label == null) {
+                continue;
+            }
+
+            Account[] accounts = AccountManager.get(getActivity()).getAccountsByType(accountType);
+            boolean skipToAccount = accounts.length == 1
+                    && !mAuthenticatorHelper.hasAccountPreferences(accountType);
+
+            if (skipToAccount) {
+                Bundle fragmentArguments = new Bundle();
+                fragmentArguments.putParcelable(AccountSyncSettings.ACCOUNT_KEY,
+                        accounts[0]);
+
+                accountTypePreferences.add(new AccountPreference(
+                        getActivity(),
+                        label,
+                        accountType,
+                        AccountSyncSettings.class.getName(),
+                        fragmentArguments));
+            } else {
+                Bundle fragmentArguments = new Bundle();
+                fragmentArguments.putString(ManageAccountsSettings.KEY_ACCOUNT_TYPE, accountType);
+                fragmentArguments.putString(ManageAccountsSettings.KEY_ACCOUNT_LABEL,
+                        label.toString());
+
+                accountTypePreferences.add(new AccountPreference(
+                        getActivity(),
+                        label,
+                        accountType,
+                        ManageAccountsSettings.class.getName(),
+                        fragmentArguments));
+            }
+            mAuthenticatorHelper.preloadDrawableForType(getActivity(), accountType);
+        }
+        // Sort by label
+        Collections.sort(accountTypePreferences, new Comparator<AccountPreference>() {
+            @Override
+            public int compare(AccountPreference t1, AccountPreference t2) {
+                return t1.mTitle.toString().compareTo(t2.mTitle.toString());
+            }
+        });
+        return accountTypePreferences;
+    }
+
+    private void listenToAccountUpdates() {
+        if (!mListeningToAccountUpdates) {
+            AccountManager.get(getActivity()).addOnAccountsUpdatedListener(this, null, true);
+            mListeningToAccountUpdates = true;
+        }
+    }
+
+    private void stopListeningToAccountUpdates() {
+        if (mListeningToAccountUpdates) {
+            AccountManager.get(getActivity()).removeOnAccountsUpdatedListener(this);
+            mListeningToAccountUpdates = false;
+        }
+    }
+
+    private class AccountPreference extends Preference implements OnPreferenceClickListener {
+        /**
+         * Title of the tile that is shown to the user.
+         * @attr ref android.R.styleable#PreferenceHeader_title
+         */
+        private final CharSequence mTitle;
+
+        /**
+         * Full class name of the fragment to display when this tile is
+         * selected.
+         * @attr ref android.R.styleable#PreferenceHeader_fragment
+         */
+        private final String mFragment;
+
+        /**
+         * Optional arguments to supply to the fragment when it is
+         * instantiated.
+         */
+        private final Bundle mFragmentArguments;
+
+
+        public AccountPreference(Context context, CharSequence title,
+                String accountType, String fragment, Bundle fragmentArguments) {
+            super(context);
+            mTitle = title;
+            mFragment = fragment;
+            mFragmentArguments = fragmentArguments;
+            setWidgetLayoutResource(R.layout.account_type_preference);
+
+            Drawable drawable = mAuthenticatorHelper.getDrawableForType(context, accountType);
+            setTitle(title);
+            setIcon(drawable);
+
+            setOnPreferenceClickListener(this);
+        }
+
+        @Override
+        public boolean onPreferenceClick(Preference preference) {
+            if (mFragment != null) {
+                Utils.startWithFragment(
+                        getContext(), mFragment, mFragmentArguments, null, 0, mTitle);
+                return true;
+            }
+            return false;
+        }
+    }
+    // TODO Implement a {@link SearchIndexProvider} to allow Indexing and Search of account types
+    // See http://b/15403806
+}
diff --git a/src/com/android/settings/dashboard/SearchResultsSummary.java b/src/com/android/settings/dashboard/SearchResultsSummary.java
index 1bd0bf0..910d661 100644
--- a/src/com/android/settings/dashboard/SearchResultsSummary.java
+++ b/src/com/android/settings/dashboard/SearchResultsSummary.java
@@ -572,7 +572,6 @@
 
             View view;
             TextView textTitle;
-            TextView textSummary;
             ImageView imageView;
 
             if (convertView == null) {
@@ -580,35 +579,13 @@
             } else {
                 view = convertView;
             }
+
             textTitle = (TextView) view.findViewById(R.id.title);
-            textSummary = (TextView) view.findViewById(R.id.summary);
             imageView = (ImageView) view.findViewById(R.id.icon);
 
-            SearchResult result = (SearchResult) getItem(position);
-
+            final SearchResult result = (SearchResult) getItem(position);
             textTitle.setText(result.title);
 
-            String summaryOn = result.summaryOn;
-            String entries = result.entries;
-
-            final StringBuilder sb = new StringBuilder();
-
-            if (!TextUtils.isEmpty(summaryOn) &&
-                    !summaryOn.contains(PERCENT_RECLACE) && !summaryOn.contains(DOLLAR_REPLACE)) {
-                sb.append(summaryOn);
-                sb.append(ELLIPSIS);
-            } else if (!TextUtils.isEmpty(entries)) {
-                final int index  = entries.indexOf(Index.ENTRIES_SEPARATOR);
-                if (index > 0) {
-                    final String firstEntriesValue = entries.substring(0, index);
-                    sb.append(firstEntriesValue);
-                } else {
-                    sb.append(entries);
-                }
-                sb.append(ELLIPSIS);
-            }
-            textSummary.setText(sb.toString());
-
             if (result.iconResId != R.drawable.empty_icon) {
                 final Context packageContext = result.context;
                 final Drawable drawable;
diff --git a/src/com/android/settings/fuelgauge/BatteryHistoryChart.java b/src/com/android/settings/fuelgauge/BatteryHistoryChart.java
index 47e887a..4c6a503 100644
--- a/src/com/android/settings/fuelgauge/BatteryHistoryChart.java
+++ b/src/com/android/settings/fuelgauge/BatteryHistoryChart.java
@@ -117,9 +117,6 @@
     static final int SERIF = 2;
     static final int MONOSPACE = 3;
 
-    static final int BATTERY_WARN = 29;
-    static final int BATTERY_CRITICAL = 14;
-    
     // First value if for phone off; first value is "scanning"; following values
     // are battery stats signal strength buckets.
     static final int NUM_PHONE_SIGNALS = 7;
@@ -167,7 +164,13 @@
     String mWifiRunningLabel;
     String mCpuRunningLabel;
     String mPhoneSignalLabel;
-    
+
+    int mChartMinHeight;
+    int mHeaderHeight;
+
+    int mBatteryWarnLevel;
+    int mBatteryCriticalLevel;
+
     int mTextAscent;
     int mTextDescent;
     int mHeaderTextAscent;
@@ -352,19 +355,24 @@
 
     public BatteryHistoryChart(Context context, AttributeSet attrs) {
         super(context, attrs);
-        
+
+        mBatteryWarnLevel = mContext.getResources().getInteger(
+                com.android.internal.R.integer.config_lowBatteryWarningLevel);
+        mBatteryCriticalLevel = mContext.getResources().getInteger(
+                com.android.internal.R.integer.config_criticalBatteryWarningLevel);
+
         mThinLineWidth = (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
                 2, getResources().getDisplayMetrics());
 
-        mBatteryBackgroundPaint.setColor(0xff263238);
+        mBatteryBackgroundPaint.setColor(0xFF009688);
         mBatteryBackgroundPaint.setStyle(Paint.Style.FILL);
-        mBatteryGoodPaint.setARGB(128, 0, 255, 0);
+        mBatteryGoodPaint.setARGB(128, 0, 128, 0);
         mBatteryGoodPaint.setStyle(Paint.Style.STROKE);
-        mBatteryWarnPaint.setARGB(128, 255, 255, 0);
+        mBatteryWarnPaint.setARGB(128, 128, 128, 0);
         mBatteryWarnPaint.setStyle(Paint.Style.STROKE);
-        mBatteryCriticalPaint.setARGB(192, 255, 0, 0);
+        mBatteryCriticalPaint.setARGB(192, 128, 0, 0);
         mBatteryCriticalPaint.setStyle(Paint.Style.STROKE);
-        mTimeRemainPaint.setColor(0xffA5B1B7);
+        mTimeRemainPaint.setColor(0xFFCED7BB);
         mTimeRemainPaint.setStyle(Paint.Style.FILL);
         mChargingPaint.setARGB(255, 0, 128, 0);
         mChargingPaint.setStyle(Paint.Style.STROKE);
@@ -431,6 +439,18 @@
                     mainTextAttrs.styleIndex = a.getInt(attr, mainTextAttrs.styleIndex);
                     headTextAttrs.styleIndex = a.getInt(attr, headTextAttrs.styleIndex);
                     break;
+
+                case R.styleable.BatteryHistoryChart_barPrimaryColor:
+                    mBatteryBackgroundPaint.setColor(a.getInt(attr, 0));
+                    break;
+
+                case R.styleable.BatteryHistoryChart_barPredictionColor:
+                    mTimeRemainPaint.setColor(a.getInt(attr, 0));
+                    break;
+
+                case R.styleable.BatteryHistoryChart_chartMinHeight:
+                    mChartMinHeight = a.getDimensionPixelSize(attr, 0);
+                    break;
             }
         }
         
@@ -502,8 +522,19 @@
                 remainingTimeUs = chargeTime;
                 String timeString = Formatter.formatShortElapsedTime(getContext(),
                         chargeTime / 1000);
+                int plugType = mBatteryBroadcast.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0);
+                int resId;
+                if (plugType == BatteryManager.BATTERY_PLUGGED_AC) {
+                    resId = R.string.power_charging_duration_ac;
+                } else if (plugType == BatteryManager.BATTERY_PLUGGED_USB) {
+                    resId = R.string.power_charging_duration_usb;
+                } else if (plugType == BatteryManager.BATTERY_PLUGGED_WIRELESS) {
+                    resId = R.string.power_charging_duration_wireless;
+                } else {
+                    resId = R.string.power_charging_duration;
+                }
                 mChargeLabelString = getContext().getResources().getString(
-                        R.string.power_charging_duration, batteryLevel, statusLabel, timeString);
+                        resId, batteryLevel, timeString);
             } else {
                 mChargeLabelString = getContext().getResources().getString(
                         R.string.power_charging, batteryLevel, statusLabel);
@@ -562,19 +593,12 @@
             mHavePhoneSignal = true;
         }
         if (mHistEnd <= mHistStart) mHistEnd = mHistStart+1;
-
-        //String durationString = Utils.formatElapsedTime(getContext(), mStatsPeriod / 1000, true);
-        //mDurationString = getContext().getString(R.string.battery_stats_on_battery,
-        //        durationString);
-        mDurationString = Utils.formatElapsedTime(getContext(), mHistEnd - mHistStart, true);
     }
 
     @Override
     protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
         mMaxPercentLabelStringWidth = (int)mTextPaint.measureText(mMaxPercentLabelString);
         mMinPercentLabelStringWidth = (int)mTextPaint.measureText(mMinPercentLabelString);
-        mDurationStringWidth = (int)mTextPaint.measureText(mDurationString);
         mDrainStringWidth = (int)mHeaderTextPaint.measureText(mDrainString);
         mChargeLabelStringWidth = (int)mHeaderTextPaint.measureText(mChargeLabelString);
         mChargeDurationStringWidth = (int)mHeaderTextPaint.measureText(mChargeDurationString);
@@ -582,6 +606,10 @@
         mTextDescent = (int)mTextPaint.descent();
         mHeaderTextAscent = (int)mHeaderTextPaint.ascent();
         mHeaderTextDescent = (int)mHeaderTextPaint.descent();
+        int headerTextHeight = mHeaderTextDescent - mHeaderTextAscent;
+        mHeaderHeight = headerTextHeight*2 - mTextAscent;
+        setMeasuredDimension(getDefaultSize(getSuggestedMinimumWidth(), widthMeasureSpec),
+                getDefaultSize(mChartMinHeight+mHeaderHeight, heightMeasureSpec));
     }
 
     void finishPaths(int w, int h, int levelh, int startX, int y, Path curLevelPath,
@@ -669,8 +697,7 @@
         mLastHeight = h;
 
         int textHeight = mTextDescent - mTextAscent;
-        int headerTextHeight = mHeaderTextDescent - mHeaderTextAscent;
-        if (h > (textHeight*12)) {
+        if (h > ((textHeight*10)+mChartMinHeight)) {
             mLargeMode = true;
             if (h > (textHeight*15)) {
                 // Plenty of room for the chart.
@@ -693,7 +720,7 @@
         }
         if (mLineWidth <= 0) mLineWidth = 1;
 
-        mLevelTop = headerTextHeight*2 - mTextAscent;
+        mLevelTop = mHeaderHeight;
         mLevelLeft = mMaxPercentLabelStringWidth + mThinLineWidth*3;
         mLevelRight = w;
         int levelWidth = mLevelRight-mLevelLeft;
@@ -798,17 +825,19 @@
                             // Don't plot changes within a pixel.
                             Path path;
                             byte value = rec.batteryLevel;
-                            if (value <= BATTERY_CRITICAL) path = mBatCriticalPath;
-                            else if (value <= BATTERY_WARN) path = mBatWarnPath;
-                            else path = mBatGoodPath;
+                            if (value <= mBatteryCriticalLevel) path = mBatCriticalPath;
+                            else if (value <= mBatteryWarnLevel) path = mBatWarnPath;
+                            else path = null; //mBatGoodPath;
 
                             if (path != lastLinePath) {
                                 if (lastLinePath != null) {
                                     lastLinePath.lineTo(x, y);
                                 }
-                                path.moveTo(x, y);
+                                if (path != null) {
+                                    path.moveTo(x, y);
+                                }
                                 lastLinePath = path;
-                            } else {
+                            } else if (path != null) {
                                 path.lineTo(x, y);
                             }
 
@@ -937,54 +966,67 @@
             mTimeRemainPath.close();
         }
 
-        // Create the time labels at the bottom.
-        boolean is24hr = is24Hour();
-        Calendar calStart = Calendar.getInstance();
-        calStart.setTimeInMillis(mStartWallTime);
-        calStart.set(Calendar.MILLISECOND, 0);
-        calStart.set(Calendar.SECOND, 0);
-        calStart.set(Calendar.MINUTE, 0);
-        long startRoundTime = calStart.getTimeInMillis();
-        if (startRoundTime < mStartWallTime) {
-            calStart.set(Calendar.HOUR_OF_DAY, calStart.get(Calendar.HOUR_OF_DAY)+1);
-            startRoundTime = calStart.getTimeInMillis();
-        }
-        Calendar calEnd = Calendar.getInstance();
-        calEnd.setTimeInMillis(mEndWallTime);
-        calEnd.set(Calendar.MILLISECOND, 0);
-        calEnd.set(Calendar.SECOND, 0);
-        calEnd.set(Calendar.MINUTE, 0);
-        long endRoundTime = calEnd.getTimeInMillis();
-        if (startRoundTime < endRoundTime) {
-            addTimeLabel(calStart, mLevelLeft, mLevelRight, is24hr);
-            Calendar calMid = Calendar.getInstance();
-            calMid.setTimeInMillis(mStartWallTime+((mEndWallTime-mStartWallTime)/2));
-            calMid.set(Calendar.MILLISECOND, 0);
-            calMid.set(Calendar.SECOND, 0);
-            calMid.set(Calendar.MINUTE, 0);
-            long calMidMillis = calMid.getTimeInMillis();
-            if (calMidMillis > startRoundTime && calMidMillis < endRoundTime) {
-                addTimeLabel(calMid, mLevelLeft, mLevelRight, is24hr);
-            }
-            addTimeLabel(calEnd, mLevelLeft, mLevelRight, is24hr);
-        }
-
-        // Create the date labels if the chart includes multiple days
-        if (calStart.get(Calendar.DAY_OF_YEAR) != calEnd.get(Calendar.DAY_OF_YEAR) ||
-                calStart.get(Calendar.YEAR) != calEnd.get(Calendar.YEAR)) {
-            boolean isDayFirst = isDayFirst();
-            calStart.set(Calendar.HOUR_OF_DAY, 0);
-            startRoundTime = calStart.getTimeInMillis();
+        if (mStartWallTime > 0) {
+            // Create the time labels at the bottom.
+            boolean is24hr = is24Hour();
+            Calendar calStart = Calendar.getInstance();
+            calStart.setTimeInMillis(mStartWallTime);
+            calStart.set(Calendar.MILLISECOND, 0);
+            calStart.set(Calendar.SECOND, 0);
+            calStart.set(Calendar.MINUTE, 0);
+            long startRoundTime = calStart.getTimeInMillis();
             if (startRoundTime < mStartWallTime) {
-                calStart.set(Calendar.DAY_OF_YEAR, calStart.get(Calendar.DAY_OF_YEAR) + 1);
+                calStart.set(Calendar.HOUR_OF_DAY, calStart.get(Calendar.HOUR_OF_DAY)+1);
                 startRoundTime = calStart.getTimeInMillis();
             }
-            calEnd.set(Calendar.HOUR_OF_DAY, 0);
-            endRoundTime = calEnd.getTimeInMillis();
+            Calendar calEnd = Calendar.getInstance();
+            calEnd.setTimeInMillis(mEndWallTime);
+            calEnd.set(Calendar.MILLISECOND, 0);
+            calEnd.set(Calendar.SECOND, 0);
+            calEnd.set(Calendar.MINUTE, 0);
+            long endRoundTime = calEnd.getTimeInMillis();
             if (startRoundTime < endRoundTime) {
-                addDateLabel(calStart, mLevelLeft, mLevelRight, isDayFirst);
+                addTimeLabel(calStart, mLevelLeft, mLevelRight, is24hr);
+                Calendar calMid = Calendar.getInstance();
+                calMid.setTimeInMillis(mStartWallTime+((mEndWallTime-mStartWallTime)/2));
+                calMid.set(Calendar.MILLISECOND, 0);
+                calMid.set(Calendar.SECOND, 0);
+                calMid.set(Calendar.MINUTE, 0);
+                long calMidMillis = calMid.getTimeInMillis();
+                if (calMidMillis > startRoundTime && calMidMillis < endRoundTime) {
+                    addTimeLabel(calMid, mLevelLeft, mLevelRight, is24hr);
+                }
+                addTimeLabel(calEnd, mLevelLeft, mLevelRight, is24hr);
             }
-            addDateLabel(calEnd, mLevelLeft, mLevelRight, isDayFirst);
+
+            // Create the date labels if the chart includes multiple days
+            if (calStart.get(Calendar.DAY_OF_YEAR) != calEnd.get(Calendar.DAY_OF_YEAR) ||
+                    calStart.get(Calendar.YEAR) != calEnd.get(Calendar.YEAR)) {
+                boolean isDayFirst = isDayFirst();
+                calStart.set(Calendar.HOUR_OF_DAY, 0);
+                startRoundTime = calStart.getTimeInMillis();
+                if (startRoundTime < mStartWallTime) {
+                    calStart.set(Calendar.DAY_OF_YEAR, calStart.get(Calendar.DAY_OF_YEAR) + 1);
+                    startRoundTime = calStart.getTimeInMillis();
+                }
+                calEnd.set(Calendar.HOUR_OF_DAY, 0);
+                endRoundTime = calEnd.getTimeInMillis();
+                if (startRoundTime < endRoundTime) {
+                    addDateLabel(calStart, mLevelLeft, mLevelRight, isDayFirst);
+                }
+                addDateLabel(calEnd, mLevelLeft, mLevelRight, isDayFirst);
+            }
+        }
+
+        if (mTimeLabels.size() < 2) {
+            // If there are fewer than 2 time labels, then they are useless.  Just
+            // show an axis label giving the entire duration.
+            mDurationString = Formatter.formatShortElapsedTime(getContext(),
+                    mEndWallTime - mStartWallTime);
+            mDurationStringWidth = (int)mTextPaint.measureText(mDurationString);
+        } else {
+            mDurationString = null;
+            mDurationStringWidth = 0;
         }
     }
 
@@ -1031,9 +1073,7 @@
             if (DEBUG) Log.d(TAG, "Drawing time remain path.");
             canvas.drawPath(mTimeRemainPath, mTimeRemainPaint);
         }
-        int durationHalfWidth = mDurationStringWidth / 2;
-        if (layoutRtl) durationHalfWidth = -durationHalfWidth;
-        if (mTimeLabels.size() > 0) {
+        if (mTimeLabels.size() > 1) {
             int y = mLevelBottom - mTextAscent + (mThinLineWidth*4);
             int ytick = mLevelBottom+mThinLineWidth+(mThinLineWidth/2);
             mTextPaint.setTextAlign(Paint.Align.LEFT);
@@ -1072,31 +1112,24 @@
                     canvas.drawLine(label.x, ytick, label.x, ytick+mThinLineWidth, mTextPaint);
                 }
             }
-        }
-
-        if (false) {
-            // Old code for printing label.
-            mTextPaint.setTextAlign(textAlignLeft);
-            if (mLargeMode) {
-                canvas.drawText(mDurationString, (width / 2) - durationHalfWidth,
-                        mLevelBottom - mTextAscent + mThinLineWidth, mTextPaint);
-            } else {
-                canvas.drawText(mDurationString, (width / 2) - durationHalfWidth,
-                        mLevelTop + ((height-mLevelTop) / 2) - ((mTextDescent - mTextAscent) / 2)
-                                - mTextAscent, mTextPaint);
-            }
+        } else if (mDurationString != null) {
+            int y = mLevelBottom - mTextAscent + (mThinLineWidth*4);
+            mTextPaint.setTextAlign(Paint.Align.LEFT);
+            canvas.drawText(mDurationString,
+                    mLevelLeft + (mLevelRight-mLevelLeft)/2 - mDurationStringWidth/2,
+                    y, mTextPaint);
         }
 
         int headerTop = -mHeaderTextAscent + (mHeaderTextDescent-mHeaderTextAscent)/3;
         mHeaderTextPaint.setTextAlign(textAlignLeft);
         if (DEBUG) Log.d(TAG, "Drawing charge label string: " + mChargeLabelString);
         canvas.drawText(mChargeLabelString, textStartX, headerTop, mHeaderTextPaint);
-        durationHalfWidth = mChargeDurationStringWidth / 2;
-        if (layoutRtl) durationHalfWidth = -durationHalfWidth;
+        int stringHalfWidth = mChargeDurationStringWidth / 2;
+        if (layoutRtl) stringHalfWidth = -stringHalfWidth;
         int headerCenter = ((width-mChargeDurationStringWidth-mDrainStringWidth)/2)
                 + (layoutRtl ? mDrainStringWidth : mChargeLabelStringWidth);
         if (DEBUG) Log.d(TAG, "Drawing charge duration string: " + mChargeDurationString);
-        canvas.drawText(mChargeDurationString, headerCenter - durationHalfWidth, headerTop,
+        canvas.drawText(mChargeDurationString, headerCenter - stringHalfWidth, headerTop,
                 mHeaderTextPaint);
         mHeaderTextPaint.setTextAlign(textAlignRight);
         if (DEBUG) Log.d(TAG, "Drawing drain string: " + mDrainString);
@@ -1181,7 +1214,7 @@
         canvas.drawText(mMinPercentLabelString,
                 mMaxPercentLabelStringWidth-mMinPercentLabelStringWidth,
                 mLevelBottom - mThinLineWidth, mTextPaint);
-        canvas.drawLine(0, mLevelBottom+mThinLineWidth, width,
+        canvas.drawLine(mLevelLeft/2, mLevelBottom+mThinLineWidth, width,
                 mLevelBottom+mThinLineWidth, mTextPaint);
 
         if (mDateLabels.size() > 0) {
diff --git a/src/com/android/settings/fuelgauge/BatteryHistoryDetail.java b/src/com/android/settings/fuelgauge/BatteryHistoryDetail.java
index 0cbb9b7..248d471 100644
--- a/src/com/android/settings/fuelgauge/BatteryHistoryDetail.java
+++ b/src/com/android/settings/fuelgauge/BatteryHistoryDetail.java
@@ -48,7 +48,7 @@
     
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
-        View view = inflater.inflate(R.layout.preference_batteryhistory, null);
+        View view = inflater.inflate(R.layout.battery_history_chart, null);
         BatteryHistoryChart chart = (BatteryHistoryChart)view.findViewById(
                 R.id.battery_history_chart);
         chart.setStats(mStats, mBatteryBroadcast);
diff --git a/src/com/android/settings/fuelgauge/BatteryHistoryPreference.java b/src/com/android/settings/fuelgauge/BatteryHistoryPreference.java
index bdea852..fd7d87a 100644
--- a/src/com/android/settings/fuelgauge/BatteryHistoryPreference.java
+++ b/src/com/android/settings/fuelgauge/BatteryHistoryPreference.java
@@ -37,6 +37,9 @@
     final private BatteryStats mStats;
     final private Intent mBatteryBroadcast;
 
+    private boolean mHideLabels;
+    private View mLabelHeader;
+
     public BatteryHistoryPreference(Context context, BatteryStats stats, Intent batteryBroadcast) {
         super(context);
         setLayoutResource(R.layout.preference_batteryhistory);
@@ -48,6 +51,15 @@
         return mStats;
     }
 
+    public void setHideLabels(boolean hide) {
+        if (mHideLabels != hide) {
+            mHideLabels = hide;
+            if (mLabelHeader != null) {
+                mLabelHeader.setVisibility(hide ? View.GONE : View.VISIBLE);
+            }
+        }
+    }
+
     @Override
     protected void onBindView(View view) {
         super.onBindView(view);
@@ -55,5 +67,7 @@
         BatteryHistoryChart chart = (BatteryHistoryChart)view.findViewById(
                 R.id.battery_history_chart);
         chart.setStats(mStats, mBatteryBroadcast);
+        mLabelHeader = view.findViewById(R.id.labelsHeader);
+        mLabelHeader.setVisibility(mHideLabels ? View.GONE : View.VISIBLE);
     }
 }
diff --git a/src/com/android/settings/fuelgauge/PowerUsageSummary.java b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
index e00e20b..e4e2b0a 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageSummary.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
@@ -64,6 +64,7 @@
 
     private UserManager mUm;
 
+    private BatteryHistoryPreference mHistPref;
     private PreferenceGroup mAppListGroup;
     private String mBatteryLevel;
     private String mBatteryStatus;
@@ -210,6 +211,7 @@
     private void addNotAvailableMessage() {
         Preference notAvailable = new Preference(getActivity());
         notAvailable.setTitle(R.string.power_usage_not_available);
+        mHistPref.setHideLabels(true);
         mAppListGroup.addPreference(notAvailable);
     }
 
@@ -233,16 +235,17 @@
 
         mStatsHelper.refreshStats(BatteryStats.STATS_SINCE_CHARGED, UserHandle.myUserId());
 
-        BatteryHistoryPreference hist = new BatteryHistoryPreference(
+        mHistPref = new BatteryHistoryPreference(
                 getActivity(), mStatsHelper.getStats(), mStatsHelper.getBatteryBroadcast());
-        hist.setOrder(-1);
-        mAppListGroup.addPreference(hist);
+        mHistPref.setOrder(-1);
+        mAppListGroup.addPreference(mHistPref);
 
         if (mStatsHelper.getPowerProfile().getAveragePower(
                 PowerProfile.POWER_SCREEN_FULL) < 10) {
             addNotAvailableMessage();
             return;
         }
+        boolean addedSome = false;
         final int dischargeAmount = mStatsHelper.getStats().getDischargeAmount(mStatsType);
         List<BatterySipper> usageList = mStatsHelper.getUsageList();
         for (int i=0; i<usageList.size(); i++) {
@@ -263,9 +266,13 @@
             if (sipper.uidObj != null) {
                 pref.setKey(Integer.toString(sipper.uidObj.getUid()));
             }
+            addedSome = true;
             mAppListGroup.addPreference(pref);
             if (mAppListGroup.getPreferenceCount() > (MAX_ITEMS_TO_LIST+1)) break;
         }
+        if (!addedSome) {
+            addNotAvailableMessage();
+        }
 
         BatteryEntry.startRequestQueue();
     }
diff --git a/src/com/android/settings/inputmethod/UserDictionaryAddWordContents.java b/src/com/android/settings/inputmethod/UserDictionaryAddWordContents.java
index d81703e..638818a 100644
--- a/src/com/android/settings/inputmethod/UserDictionaryAddWordContents.java
+++ b/src/com/android/settings/inputmethod/UserDictionaryAddWordContents.java
@@ -146,7 +146,9 @@
         // should not insert, because either A. the word exists with no shortcut, in which
         // case the exact same thing we want to insert is already there, or B. the word
         // exists with at least one shortcut, in which case it has priority on our word.
-        if (hasWord(newWord, context)) return UserDictionaryAddWordActivity.CODE_ALREADY_PRESENT;
+        if (TextUtils.isEmpty(newShortcut) && hasWord(newWord, context)) {
+            return UserDictionaryAddWordActivity.CODE_ALREADY_PRESENT;
+        }
 
         // Disallow duplicates. If the same word with no shortcut is defined, remove it; if
         // the same word with the same shortcut is defined, remove it; but we don't mind if
diff --git a/src/com/android/settings/notification/ZenModeSettings.java b/src/com/android/settings/notification/ZenModeSettings.java
index 8a66d1b..e9323d8 100644
--- a/src/com/android/settings/notification/ZenModeSettings.java
+++ b/src/com/android/settings/notification/ZenModeSettings.java
@@ -70,10 +70,12 @@
         SwitchBar.OnSwitchChangeListener {
     private static final String TAG = "ZenModeSettings";
     private static final boolean DEBUG = true;
+    private static final boolean SHOW_CONDITION_DIALOG = false;
 
     private static final String KEY_GENERAL = "general";
     private static final String KEY_CALLS = "phone_calls";
     private static final String KEY_MESSAGES = "messages";
+    private static final String KEY_STARRED = "starred";
 
     private static final String KEY_AUTOMATIC = "automatic";
     private static final String KEY_WHEN = "when";
@@ -91,6 +93,7 @@
             rt.put(R.string.zen_mode_phone_calls, KEY_CALLS);
         }
         rt.put(R.string.zen_mode_messages, KEY_MESSAGES);
+        rt.put(R.string.zen_mode_from_starred, KEY_STARRED);
         rt.put(R.string.zen_mode_automatic_category, KEY_AUTOMATIC);
         rt.put(R.string.zen_mode_when, KEY_WHEN);
         rt.put(R.string.zen_mode_start_time, KEY_START_TIME);
@@ -134,7 +137,7 @@
                 final int v = isChecked ? Global.ZEN_MODE_ON : Global.ZEN_MODE_OFF;
                 putZenModeSetting(v);
                 final int n = ConditionProviderSettings.getEnabledProviderCount(mContext);
-                if (n > 0) {
+                if (SHOW_CONDITION_DIALOG && n > 0) {
                     mHandler.post(isChecked ? mShowDialog : mHideDialog);
                 }
             }
@@ -194,12 +197,25 @@
         });
 
         mStarred = new DropDownPreference(mContext);
-        mStarred.setEnabled(false);
+        mStarred.setKey(KEY_STARRED);
         mStarred.setTitle(R.string.zen_mode_from);
         mStarred.setDropDownWidth(R.dimen.zen_mode_dropdown_width);
-        mStarred.addItem(R.string.zen_mode_from_anyone, null);
-        mStarred.addItem(R.string.zen_mode_from_starred, null);
-        mStarred.addItem(R.string.zen_mode_from_contacts, null);
+        mStarred.addItem(R.string.zen_mode_from_anyone, ZenModeConfig.SOURCE_ANYONE);
+        mStarred.addItem(R.string.zen_mode_from_starred, ZenModeConfig.SOURCE_STAR);
+        mStarred.addItem(R.string.zen_mode_from_contacts, ZenModeConfig.SOURCE_CONTACT);
+        mStarred.setCallback(new DropDownPreference.Callback() {
+            @Override
+            public boolean onItemSelected(int pos, Object newValue) {
+                if (mDisableListeners) return true;
+                final int val = (Integer) newValue;
+                if (val == mConfig.allowFrom) return true;
+                if (DEBUG) Log.d(TAG, "onPrefChange allowFrom=" +
+                        ZenModeConfig.sourceToString(val));
+                final ZenModeConfig newConfig = mConfig.copy();
+                newConfig.allowFrom = val;
+                return setZenModeConfig(newConfig);
+            }
+        });
         general.addPreference(mStarred);
 
         final Preference alarmInfo = new Preference(mContext) {
@@ -266,7 +282,6 @@
         mEnd = new TimePickerPreference(mContext, mgr);
         mEnd.setKey(KEY_END_TIME);
         mEnd.setTitle(R.string.zen_mode_end_time);
-        mEnd.setSummaryFormat(R.string.zen_mode_end_time_summary_format);
         mEnd.setCallback(new TimePickerPreference.Callback() {
             @Override
             public boolean onSetTime(int hour, int minute) {
@@ -311,18 +326,26 @@
         updateControls();
     }
 
+    private void updateEndSummary() {
+        final int startMin = 60 * mConfig.sleepStartHour + mConfig.sleepStartMinute;
+        final int endMin = 60 * mConfig.sleepEndHour + mConfig.sleepEndMinute;
+        final boolean nextDay = startMin >= endMin;
+        mEnd.setSummaryFormat(nextDay ? R.string.zen_mode_end_time_summary_format : 0);
+    }
+
     private void updateControls() {
         mDisableListeners = true;
         if (mCalls != null) {
             mCalls.setChecked(mConfig.allowCalls);
         }
         mMessages.setChecked(mConfig.allowMessages);
-        mStarred.setSelectedItem(0);
+        mStarred.setSelectedValue(mConfig.allowFrom);
         mWhen.setSelectedValue(mConfig.sleepMode);
         mStart.setTime(mConfig.sleepStartHour, mConfig.sleepStartMinute);
         mEnd.setTime(mConfig.sleepEndHour, mConfig.sleepEndMinute);
         mDisableListeners = false;
         refreshAutomationSection();
+        updateEndSummary();
     }
 
     private void refreshAutomationSection() {
@@ -425,6 +448,7 @@
             if (success) {
                 mConfig = config;
                 if (DEBUG) Log.d(TAG, "Saved mConfig=" + mConfig);
+                updateEndSummary();
             }
             return success;
         } catch (Exception e) {
diff --git a/src/com/android/settings/print/PrintSettingsFragment.java b/src/com/android/settings/print/PrintSettingsFragment.java
index 3f7362c..f512db5 100644
--- a/src/com/android/settings/print/PrintSettingsFragment.java
+++ b/src/com/android/settings/print/PrintSettingsFragment.java
@@ -154,7 +154,7 @@
                 Settings.Secure.PRINT_SERVICE_SEARCH_URI);
         if (!TextUtils.isEmpty(searchUri)) {
             MenuItem menuItem = menu.add(R.string.print_menu_item_add_service);
-            menuItem.setShowAsActionFlags(MenuItem.SHOW_AS_ACTION_IF_ROOM);
+            menuItem.setShowAsActionFlags(MenuItem.SHOW_AS_ACTION_NEVER);
             menuItem.setIntent(new Intent(Intent.ACTION_VIEW, Uri.parse(searchUri)));
         }
     }
diff --git a/src/com/android/settings/search/Index.java b/src/com/android/settings/search/Index.java
index b1d21af..1b1825c 100644
--- a/src/com/android/settings/search/Index.java
+++ b/src/com/android/settings/search/Index.java
@@ -284,15 +284,17 @@
 
     private boolean addIndexablesFromRemoteProvider(String packageName, String authority) {
         try {
+            final int baseRank = Ranking.getBaseRankForAuthority(authority);
+
             final Context packageContext = mContext.createPackageContext(packageName, 0);
 
             final Uri uriForResources = buildUriForXmlResources(authority);
             addIndexablesForXmlResourceUri(packageContext, packageName, uriForResources,
-                    SearchIndexablesContract.INDEXABLES_XML_RES_COLUMNS);
+                    SearchIndexablesContract.INDEXABLES_XML_RES_COLUMNS, baseRank);
 
             final Uri uriForRawData = buildUriForRawData(authority);
             addIndexablesForRawDataUri(packageContext, packageName, uriForRawData,
-                    SearchIndexablesContract.INDEXABLES_RAW_COLUMNS);
+                    SearchIndexablesContract.INDEXABLES_RAW_COLUMNS, baseRank);
             return true;
         } catch (PackageManager.NameNotFoundException e) {
             Log.w(LOG_TAG, "Could not create context for " + packageName + ": "
@@ -501,7 +503,7 @@
     }
 
     private void addIndexablesForXmlResourceUri(Context packageContext, String packageName,
-            Uri uri, String[] projection) {
+            Uri uri, String[] projection, int baseRank) {
 
         final ContentResolver resolver = packageContext.getContentResolver();
         final Cursor cursor = resolver.query(uri, projection, null, null, null);
@@ -515,7 +517,9 @@
             final int count = cursor.getCount();
             if (count > 0) {
                 while (cursor.moveToNext()) {
-                    final int rank = cursor.getInt(COLUMN_INDEX_XML_RES_RANK);
+                    final int providerRank = cursor.getInt(COLUMN_INDEX_XML_RES_RANK);
+                    final int rank = (providerRank > 0) ? baseRank + providerRank : baseRank;
+
                     final int xmlResId = cursor.getInt(COLUMN_INDEX_XML_RES_RESID);
 
                     final String className = cursor.getString(COLUMN_INDEX_XML_RES_CLASS_NAME);
@@ -546,7 +550,7 @@
     }
 
     private void addIndexablesForRawDataUri(Context packageContext, String packageName,
-            Uri uri, String[] projection) {
+            Uri uri, String[] projection, int baseRank) {
 
         final ContentResolver resolver = packageContext.getContentResolver();
         final Cursor cursor = resolver.query(uri, projection, null, null, null);
@@ -560,7 +564,9 @@
             final int count = cursor.getCount();
             if (count > 0) {
                 while (cursor.moveToNext()) {
-                    final int rank = cursor.getInt(COLUMN_INDEX_RAW_RANK);
+                    final int providerRank = cursor.getInt(COLUMN_INDEX_RAW_RANK);
+                    final int rank = (providerRank > 0) ? baseRank + providerRank : baseRank;
+
                     final String title = cursor.getString(COLUMN_INDEX_RAW_TITLE);
                     final String summaryOn = cursor.getString(COLUMN_INDEX_RAW_SUMMARY_ON);
                     final String summaryOff = cursor.getString(COLUMN_INDEX_RAW_SUMMARY_OFF);
diff --git a/src/com/android/settings/search/Ranking.java b/src/com/android/settings/search/Ranking.java
new file mode 100644
index 0000000..074a8d7
--- /dev/null
+++ b/src/com/android/settings/search/Ranking.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright (C) 2014 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.search;
+
+import com.android.settings.ChooseLockGeneric;
+import com.android.settings.DataUsageSummary;
+import com.android.settings.DateTimeSettings;
+import com.android.settings.DevelopmentSettings;
+import com.android.settings.DeviceInfoSettings;
+import com.android.settings.DisplaySettings;
+import com.android.settings.HomeSettings;
+import com.android.settings.PrivacySettings;
+import com.android.settings.SecuritySettings;
+import com.android.settings.WallpaperTypeSettings;
+import com.android.settings.WirelessSettings;
+import com.android.settings.accessibility.AccessibilitySettings;
+import com.android.settings.bluetooth.BluetoothSettings;
+import com.android.settings.deviceinfo.Memory;
+import com.android.settings.fuelgauge.PowerUsageSummary;
+import com.android.settings.inputmethod.InputMethodAndLanguageSettings;
+import com.android.settings.location.LocationSettings;
+import com.android.settings.notification.NotificationDisplaySettings;
+import com.android.settings.notification.NotificationSettings;
+import com.android.settings.notification.OtherSoundSettings;
+import com.android.settings.notification.ZenModeSettings;
+import com.android.settings.print.PrintSettingsFragment;
+import com.android.settings.users.UserSettings;
+import com.android.settings.wifi.AdvancedWifiSettings;
+import com.android.settings.wifi.WifiSettings;
+
+import java.util.HashMap;
+
+/**
+ * Utility class for dealing with Search Ranking.
+ */
+public final class Ranking {
+
+    public static final int RANK_WIFI = 1;
+    public static final int RANK_BT = 2;
+    public static final int RANK_DATA_USAGE = 3;
+    public static final int RANK_WIRELESS = 4;
+    public static final int RANK_HOME = 5;
+    public static final int RANK_DISPLAY = 6;
+    public static final int RANK_WALLPAPER = 7;
+    public static final int RANK_NOTIFICATIONS = 8;
+    public static final int RANK_MEMORY = 9;
+    public static final int RANK_POWER_USAGE = 10;
+    public static final int RANK_USERS = 11;
+    public static final int RANK_LOCATION = 12;
+    public static final int RANK_SECURITY = 13;
+    public static final int RANK_IME = 14;
+    public static final int RANK_PRIVACY = 15;
+    public static final int RANK_DATE_TIME = 16;
+    public static final int RANK_ACCESSIBILITY = 17;
+    public static final int RANK_PRINTING = 18;
+    public static final int RANK_DEVELOPEMENT = 19;
+    public static final int RANK_DEVICE_INFO = 20;
+
+    public static final int RANK_UNDEFINED = -1;
+    public static final int RANK_OTHERS = 1024;
+    public static final int BASE_RANK_DEFAULT = 2048;
+
+    public static int sCurrentBaseRank = BASE_RANK_DEFAULT;
+
+    private static HashMap<String, Integer> sRankMap = new HashMap<String, Integer>();
+    private static HashMap<String, Integer> sBaseRankMap = new HashMap<String, Integer>();
+
+    static {
+        sRankMap.put(WifiSettings.class.getName(), RANK_WIFI);
+        sRankMap.put(AdvancedWifiSettings.class.getName(), RANK_WIFI);
+
+        sRankMap.put(BluetoothSettings.class.getName(), RANK_BT);
+
+        sRankMap.put(DataUsageSummary.class.getName(), RANK_DATA_USAGE);
+
+        sRankMap.put(WirelessSettings.class.getName(), RANK_WIRELESS);
+
+        sRankMap.put(HomeSettings.class.getName(), RANK_HOME);
+
+        sRankMap.put(DisplaySettings.class.getName(), RANK_DISPLAY);
+
+        sRankMap.put(WallpaperTypeSettings.class.getName(), RANK_WALLPAPER);
+
+        sRankMap.put(NotificationSettings.class.getName(), RANK_NOTIFICATIONS);
+        sRankMap.put(NotificationDisplaySettings.class.getName(), RANK_NOTIFICATIONS);
+        sRankMap.put(OtherSoundSettings.class.getName(), RANK_NOTIFICATIONS);
+        sRankMap.put(ZenModeSettings.class.getName(), RANK_NOTIFICATIONS);
+
+        sRankMap.put(Memory.class.getName(), RANK_MEMORY);
+
+        sRankMap.put(PowerUsageSummary.class.getName(), RANK_POWER_USAGE);
+
+        sRankMap.put(UserSettings.class.getName(), RANK_USERS);
+
+        sRankMap.put(LocationSettings.class.getName(), RANK_LOCATION);
+
+        sRankMap.put(SecuritySettings.class.getName(), RANK_SECURITY);
+        sRankMap.put(ChooseLockGeneric.ChooseLockGenericFragment.class.getName(), RANK_SECURITY);
+
+        sRankMap.put(InputMethodAndLanguageSettings.class.getName(), RANK_IME);
+
+        sRankMap.put(PrivacySettings.class.getName(), RANK_PRIVACY);
+
+        sRankMap.put(DateTimeSettings.class.getName(), RANK_DATE_TIME);
+
+        sRankMap.put(AccessibilitySettings.class.getName(), RANK_ACCESSIBILITY);
+
+        sRankMap.put(PrintSettingsFragment.class.getName(), RANK_PRINTING);
+
+        sRankMap.put(DevelopmentSettings.class.getName(), RANK_DEVELOPEMENT);
+
+        sRankMap.put(DeviceInfoSettings.class.getName(), RANK_DEVICE_INFO);
+
+        sBaseRankMap.put("com.android.settings", 0);
+    }
+
+    public static int getRankForClassName(String className) {
+        Integer rank = sRankMap.get(className);
+        return (rank != null) ? (int) rank: RANK_OTHERS;
+    }
+
+    public static int getBaseRankForAuthority(String authority) {
+        synchronized (sBaseRankMap) {
+            Integer base = sBaseRankMap.get(authority);
+            if (base != null) {
+                return base;
+            }
+            sCurrentBaseRank++;
+            sBaseRankMap.put(authority, sCurrentBaseRank);
+            return sCurrentBaseRank;
+        }
+    }
+}
diff --git a/src/com/android/settings/search/SearchIndexableResources.java b/src/com/android/settings/search/SearchIndexableResources.java
index 2d6388f..01d3c07 100644
--- a/src/com/android/settings/search/SearchIndexableResources.java
+++ b/src/com/android/settings/search/SearchIndexableResources.java
@@ -52,179 +52,183 @@
 
     public static int NO_DATA_RES_ID = 0;
 
-    public static final int RANK_WIFI = 1;
-    public static final int RANK_BT = 2;
-    public static final int RANK_DATA_USAGE = 3;
-    public static final int RANK_WIRELESS = 4;
-    public static final int RANK_HOME = 5;
-    public static final int RANK_DISPLAY = 7;
-    public static final int RANK_WALLPAPER = 7;
-    public static final int RANK_NOTIFICATIONS = 8;
-    public static final int RANK_MEMORY = 9;
-    public static final int RANK_POWER_USAGE = 10;
-    public static final int RANK_USERS = 11;
-    public static final int RANK_LOCATION = 12;
-    public static final int RANK_SECURITY = 13;
-    public static final int RANK_IME = 14;
-    public static final int RANK_PRIVACY = 15;
-    public static final int RANK_DATE_TIME = 16;
-    public static final int RANK_ACCESSIBILITY = 17;
-    public static final int RANK_PRINTING = 18;
-    public static final int RANK_DEVELOPEMENT = 19;
-    public static final int RANK_DEVICE_INFO = 20;
-
     private static HashMap<String, SearchIndexableResource> sResMap =
             new HashMap<String, SearchIndexableResource>();
 
-
     static {
         sResMap.put(WifiSettings.class.getName(),
-                new SearchIndexableResource(RANK_WIFI,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(WifiSettings.class.getName()),
                         NO_DATA_RES_ID,
                         WifiSettings.class.getName(),
                         R.drawable.ic_settings_wireless));
 
         sResMap.put(WifiSettings.class.getName(),
-                new SearchIndexableResource(RANK_WIFI,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(AdvancedWifiSettings.class.getName()),
                         R.xml.wifi_advanced_settings,
                         AdvancedWifiSettings.class.getName(),
                         R.drawable.ic_settings_wireless));
 
         sResMap.put(BluetoothSettings.class.getName(),
-                new SearchIndexableResource(RANK_BT,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(BluetoothSettings.class.getName()),
                         NO_DATA_RES_ID,
                         BluetoothSettings.class.getName(),
                         R.drawable.ic_settings_bluetooth2));
 
         sResMap.put(DataUsageSummary.class.getName(),
-                new SearchIndexableResource(RANK_DATA_USAGE,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(DataUsageSummary.class.getName()),
                         NO_DATA_RES_ID,
                         DataUsageSummary.class.getName(),
                         R.drawable.ic_settings_data_usage));
 
         sResMap.put(WirelessSettings.class.getName(),
-                new SearchIndexableResource(RANK_WIRELESS,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(WirelessSettings.class.getName()),
                         R.xml.wireless_settings,
                         WirelessSettings.class.getName(),
                         R.drawable.empty_icon));
 
         sResMap.put(HomeSettings.class.getName(),
-                new SearchIndexableResource(RANK_HOME,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(HomeSettings.class.getName()),
                         R.xml.home_selection,
                         HomeSettings.class.getName(),
                         R.drawable.ic_settings_home));
 
         sResMap.put(DisplaySettings.class.getName(),
-                new SearchIndexableResource(RANK_DISPLAY,
-                        R.xml.display_settings,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(DisplaySettings.class.getName()),
+                        NO_DATA_RES_ID,
                         DisplaySettings.class.getName(),
                         R.drawable.ic_settings_display));
 
         sResMap.put(WallpaperTypeSettings.class.getName(),
-                new SearchIndexableResource(RANK_WALLPAPER,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(WallpaperTypeSettings.class.getName()),
                         NO_DATA_RES_ID,
                         WallpaperTypeSettings.class.getName(),
                         R.drawable.ic_settings_display));
 
         sResMap.put(NotificationSettings.class.getName(),
-                new SearchIndexableResource(RANK_NOTIFICATIONS,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(NotificationSettings.class.getName()),
                         NO_DATA_RES_ID,
                         NotificationSettings.class.getName(),
                         R.drawable.ic_settings_notifications));
 
         sResMap.put(NotificationDisplaySettings.class.getName(),
-                new SearchIndexableResource(RANK_NOTIFICATIONS,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(NotificationDisplaySettings.class.getName()),
                         R.xml.notification_display_settings,
                         NotificationDisplaySettings.class.getName(),
                         R.drawable.ic_settings_notifications));
 
         sResMap.put(OtherSoundSettings.class.getName(),
-                new SearchIndexableResource(RANK_NOTIFICATIONS,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(OtherSoundSettings.class.getName()),
                         NO_DATA_RES_ID,
                         OtherSoundSettings.class.getName(),
                         R.drawable.ic_settings_notifications));
 
         sResMap.put(ZenModeSettings.class.getName(),
-                new SearchIndexableResource(RANK_NOTIFICATIONS,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(ZenModeSettings.class.getName()),
                         NO_DATA_RES_ID,
                         ZenModeSettings.class.getName(),
                         R.drawable.ic_settings_notifications));
 
         sResMap.put(Memory.class.getName(),
-                new SearchIndexableResource(RANK_MEMORY,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(Memory.class.getName()),
                         NO_DATA_RES_ID,
                         Memory.class.getName(),
                         R.drawable.ic_settings_storage));
 
         sResMap.put(PowerUsageSummary.class.getName(),
-                new SearchIndexableResource(RANK_POWER_USAGE,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(PowerUsageSummary.class.getName()),
                         R.xml.power_usage_summary,
                         PowerUsageSummary.class.getName(),
                         R.drawable.ic_settings_battery));
 
         sResMap.put(UserSettings.class.getName(),
-                new SearchIndexableResource(RANK_USERS,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(UserSettings.class.getName()),
                         R.xml.user_settings,
                         UserSettings.class.getName(),
                         R.drawable.ic_settings_multiuser));
 
         sResMap.put(LocationSettings.class.getName(),
-                new SearchIndexableResource(RANK_LOCATION,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(LocationSettings.class.getName()),
                         R.xml.location_settings,
                         LocationSettings.class.getName(),
                         R.drawable.ic_settings_location));
 
         sResMap.put(SecuritySettings.class.getName(),
-                new SearchIndexableResource(RANK_SECURITY,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(SecuritySettings.class.getName()),
                         NO_DATA_RES_ID,
                         SecuritySettings.class.getName(),
                         R.drawable.ic_settings_security));
 
         sResMap.put(ChooseLockGeneric.ChooseLockGenericFragment.class.getName(),
-                new SearchIndexableResource(RANK_SECURITY,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(
+                                ChooseLockGeneric.ChooseLockGenericFragment.class.getName()),
                         R.xml.security_settings_picker,
                         ChooseLockGeneric.ChooseLockGenericFragment.class.getName(),
                         R.drawable.ic_settings_security));
 
         sResMap.put(InputMethodAndLanguageSettings.class.getName(),
-                new SearchIndexableResource(RANK_IME,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(InputMethodAndLanguageSettings.class.getName()),
                         NO_DATA_RES_ID,
                         InputMethodAndLanguageSettings.class.getName(),
                         R.drawable.ic_settings_language));
 
         sResMap.put(PrivacySettings.class.getName(),
-                new SearchIndexableResource(RANK_PRIVACY,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(PrivacySettings.class.getName()),
                         R.xml.privacy_settings,
                         PrivacySettings.class.getName(),
                         R.drawable.ic_settings_backup));
 
         sResMap.put(DateTimeSettings.class.getName(),
-                new SearchIndexableResource(RANK_DATE_TIME,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(DateTimeSettings.class.getName()),
                         R.xml.date_time_prefs,
                         DateTimeSettings.class.getName(),
                         R.drawable.ic_settings_date_time));
 
         sResMap.put(AccessibilitySettings.class.getName(),
-                new SearchIndexableResource(RANK_ACCESSIBILITY,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(AccessibilitySettings.class.getName()),
                         NO_DATA_RES_ID,
                         AccessibilitySettings.class.getName(),
                         R.drawable.ic_settings_accessibility));
 
         sResMap.put(PrintSettingsFragment.class.getName(),
-                new SearchIndexableResource(RANK_PRINTING,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(PrintSettingsFragment.class.getName()),
                         NO_DATA_RES_ID,
                         PrintSettingsFragment.class.getName(),
                         R.drawable.ic_settings_print));
 
         sResMap.put(DevelopmentSettings.class.getName(),
-                new SearchIndexableResource(RANK_DEVELOPEMENT,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(DevelopmentSettings.class.getName()),
                         R.xml.development_prefs,
                         DevelopmentSettings.class.getName(),
                         R.drawable.ic_settings_development));
 
         sResMap.put(DeviceInfoSettings.class.getName(),
-                new SearchIndexableResource(RANK_DEVICE_INFO,
-                        R.xml.device_info_settings,
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(DeviceInfoSettings.class.getName()),
+                        NO_DATA_RES_ID,
                         DeviceInfoSettings.class.getName(),
                         R.drawable.ic_settings_about));
     }
diff --git a/src/com/android/settings/widget/ProportionalOuterFrame.java b/src/com/android/settings/widget/ProportionalOuterFrame.java
new file mode 100644
index 0000000..d23d2c4
--- /dev/null
+++ b/src/com/android/settings/widget/ProportionalOuterFrame.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2011 Google Inc.
+ *
+ * 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.widget;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.util.AttributeSet;
+import android.view.View;
+import android.widget.RelativeLayout;
+
+import com.android.settings.R;
+
+/**
+ * Used as the outer frame of all setup wizard pages that need to adjust their margins based
+ * on the total size of the available display. (e.g. side margins set to 10% of total width.)
+ */
+public class ProportionalOuterFrame extends RelativeLayout {
+    public ProportionalOuterFrame(Context context) {
+        super(context);
+    }
+
+    public ProportionalOuterFrame(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public ProportionalOuterFrame(Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+    }
+
+    /**
+     * Set our margins and title area height proportionally to the available display size
+     */
+    @Override
+    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+        final int parentWidth = MeasureSpec.getSize(widthMeasureSpec);
+        final int parentHeight = MeasureSpec.getSize(heightMeasureSpec);
+        final Resources res = getContext().getResources();
+        final float titleHeight = res.getFraction(R.dimen.setup_title_height, 1, 1);
+        final float sideMargin = res.getFraction(R.dimen.setup_border_width, 1, 1);
+        final int bottom = res.getDimensionPixelSize(R.dimen.setup_margin_bottom);
+        setPaddingRelative((int) (parentWidth * sideMargin), 0,
+                (int) (parentWidth * sideMargin), bottom);
+        final View title = findViewById(R.id.title_area);
+        if (title != null) {
+            title.setMinimumHeight((int) (parentHeight * titleHeight));
+        }
+        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+    }
+}
diff --git a/src/com/android/settings/widget/SwitchBar.java b/src/com/android/settings/widget/SwitchBar.java
index 40c8481..bc06d87 100644
--- a/src/com/android/settings/widget/SwitchBar.java
+++ b/src/com/android/settings/widget/SwitchBar.java
@@ -20,6 +20,7 @@
 import android.transition.TransitionManager;
 import android.util.AttributeSet;
 import android.view.LayoutInflater;
+import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.CompoundButton;
@@ -31,7 +32,8 @@
 
 import java.util.ArrayList;
 
-public class SwitchBar extends LinearLayout implements CompoundButton.OnCheckedChangeListener {
+public class SwitchBar extends LinearLayout implements CompoundButton.OnCheckedChangeListener,
+        View.OnClickListener {
 
     private ToggleSwitch mSwitch;
     private TextView mTextView;
@@ -82,6 +84,8 @@
         mSwitch.setTrackResource(R.drawable.switch_track);
         mSwitch.setThumbResource(R.drawable.switch_inner);
 
+        setOnClickListener(this);
+
         // Default is hide
         setVisibility(View.GONE);
     }
@@ -105,13 +109,23 @@
     }
 
     @Override
-    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+    public void onClick(View v) {
+        final boolean isChecked = !mSwitch.isChecked();
+        mSwitch.setChecked(isChecked);
+    }
+
+    public void propagateChecked(boolean isChecked) {
         final int count = mSwitchChangeListeners.size();
         for (int n = 0; n < count; n++) {
-            mSwitchChangeListeners.get(n).onSwitchChanged(mSwitch,isChecked);
+            mSwitchChangeListeners.get(n).onSwitchChanged(mSwitch, isChecked);
         }
     }
 
+    @Override
+    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+        propagateChecked(isChecked);
+    }
+
     public void addOnSwitchChangeListener(OnSwitchChangeListener listener) {
         if (mSwitchChangeListeners.contains(listener)) {
             throw new IllegalStateException("Cannot add twice the same OnSwitchChangeListener");
diff --git a/src/com/android/settings/wifi/WifiPickerActivity.java b/src/com/android/settings/wifi/WifiPickerActivity.java
index 6dea82e..4cb78bd 100644
--- a/src/com/android/settings/wifi/WifiPickerActivity.java
+++ b/src/com/android/settings/wifi/WifiPickerActivity.java
@@ -21,22 +21,28 @@
 
 import android.content.Intent;
 
+import java.lang.Class;
+
 public class WifiPickerActivity extends SettingsActivity implements ButtonBarHandler {
 
     @Override
     public Intent getIntent() {
         Intent modIntent = new Intent(super.getIntent());
         if (!modIntent.hasExtra(EXTRA_SHOW_FRAGMENT)) {
-            modIntent.putExtra(EXTRA_SHOW_FRAGMENT, WifiSettings.class.getName());
+            modIntent.putExtra(EXTRA_SHOW_FRAGMENT, getWifiSettingsClass().getName());
         }
         return modIntent;
     }
 
     @Override
     protected boolean isValidFragment(String fragmentName) {
-        if (WifiSettings.class.getName().equals(fragmentName)
+        if (getWifiSettingsClass().getName().equals(fragmentName)
                 || WifiP2pSettings.class.getName().equals(fragmentName)
                 || AdvancedWifiSettings.class.getName().equals(fragmentName)) return true;
         return false;
     }
+
+    /* package */ Class getWifiSettingsClass() {
+        return WifiSettings.class;
+    }
 }
\ No newline at end of file
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index a653910..3420f36 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -29,7 +29,6 @@
 import com.android.settings.wifi.p2p.WifiP2pSettings;
 
 import android.app.Activity;
-import android.app.AlertDialog;
 import android.app.Dialog;
 import android.content.BroadcastReceiver;
 import android.content.Context;
@@ -40,7 +39,6 @@
 import android.content.res.Resources;
 import android.content.res.TypedArray;
 import android.location.LocationManager;
-import android.net.ConnectivityManager;
 import android.net.NetworkInfo;
 import android.net.NetworkInfo.DetailedState;
 import android.net.wifi.ScanResult;
@@ -54,23 +52,14 @@
 import android.os.Message;
 import android.preference.Preference;
 import android.preference.PreferenceScreen;
-import android.util.AttributeSet;
 import android.util.Log;
 import android.view.ContextMenu;
 import android.view.ContextMenu.ContextMenuInfo;
-import android.view.LayoutInflater;
 import android.view.Menu;
 import android.view.MenuInflater;
 import android.view.MenuItem;
 import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.ViewGroup;
 import android.widget.AdapterView.AdapterContextMenuInfo;
-import android.widget.Button;
-import android.widget.ImageButton;
-import android.widget.PopupMenu;
-import android.widget.PopupMenu.OnMenuItemClickListener;
-import android.widget.RelativeLayout;
 import android.widget.TextView;
 import android.widget.Toast;
 
@@ -93,10 +82,10 @@
         implements DialogInterface.OnClickListener, Indexable  {
 
     private static final String TAG = "WifiSettings";
-    private static final int MENU_ID_WPS_PBC = Menu.FIRST;
+    /* package */ static final int MENU_ID_WPS_PBC = Menu.FIRST;
     private static final int MENU_ID_WPS_PIN = Menu.FIRST + 1;
     private static final int MENU_ID_P2P = Menu.FIRST + 2;
-    private static final int MENU_ID_ADD_NETWORK = Menu.FIRST + 3;
+    /* package */ static final int MENU_ID_ADD_NETWORK = Menu.FIRST + 3;
     private static final int MENU_ID_ADVANCED = Menu.FIRST + 4;
     private static final int MENU_ID_SCAN = Menu.FIRST + 5;
     private static final int MENU_ID_CONNECT = Menu.FIRST + 6;
@@ -105,10 +94,10 @@
     private static final int MENU_ID_WRITE_NFC = Menu.FIRST + 9;
 
     private static final int WIFI_DIALOG_ID = 1;
-    private static final int WPS_PBC_DIALOG_ID = 2;
+    /* package */ static final int WPS_PBC_DIALOG_ID = 2;
     private static final int WPS_PIN_DIALOG_ID = 3;
-    private static final int WIFI_SKIPPED_DIALOG_ID = 4;
-    private static final int WIFI_AND_MOBILE_SKIPPED_DIALOG_ID = 5;
+    /* package */ static final int WIFI_SKIPPED_DIALOG_ID = 4;
+    /* package */ static final int WIFI_AND_MOBILE_SKIPPED_DIALOG_ID = 5;
     private static final int WRITE_NFC_DIALOG_ID = 6;
 
     // Combo scans can take 5-6s to complete - set to 10s.
@@ -118,14 +107,11 @@
     private static final String SAVE_DIALOG_EDIT_MODE = "edit_mode";
     private static final String SAVE_DIALOG_ACCESS_POINT_STATE = "wifi_ap_state";
 
-    // Activity result when pressing the Skip button
-    private static final int RESULT_SKIP = Activity.RESULT_FIRST_USER;
-
     private final IntentFilter mFilter;
     private final BroadcastReceiver mReceiver;
     private final Scanner mScanner;
 
-    private WifiManager mWifiManager;
+    /* package */ WifiManager mWifiManager;
     private WifiManager.ActionListener mConnectListener;
     private WifiManager.ActionListener mSaveListener;
     private WifiManager.ActionListener mForgetListener;
@@ -145,37 +131,11 @@
 
     private TextView mEmptyView;
 
-    /* Used in Wifi Setup context */
-
-    // this boolean extra specifies whether to disable the Next button when not connected
-    private static final String EXTRA_ENABLE_NEXT_ON_CONNECT = "wifi_enable_next_on_connect";
-
-    // this boolean extra specifies whether to auto finish when connection is established
-    private static final String EXTRA_AUTO_FINISH_ON_CONNECT = "wifi_auto_finish_on_connect";
-
-    // this boolean extra shows a custom button that we can control
-    protected static final String EXTRA_SHOW_CUSTOM_BUTTON = "wifi_show_custom_button";
-
-    // show a text regarding data charges when wifi connection is required during setup wizard
-    protected static final String EXTRA_SHOW_WIFI_REQUIRED_INFO = "wifi_show_wifi_required_info";
-
-    // this boolean extra is set if we are being invoked by the Setup Wizard
-    private static final String EXTRA_IS_FIRST_RUN = "firstRun";
-
-    // should Next button only be enabled when we have a connection?
-    private boolean mEnableNextOnConnection;
-
-    // should activity finish once we have a connection?
-    private boolean mAutoFinishOnConnection;
-
     // Save the dialog details
     private boolean mDlgEdit;
     private AccessPoint mDlgAccessPoint;
     private Bundle mAccessPointSavedState;
 
-    // the action bar uses a different set of controls for Setup Wizard
-    private boolean mSetupWizardMode;
-
     private SwitchBar mSwitchBar;
 
     /** verbose logging flag. this flag is set thru developer debugging options
@@ -207,93 +167,6 @@
     }
 
     @Override
-    public void onCreate(Bundle icicle) {
-        // Set this flag early, as it's needed by getHelpResource(), which is called by super
-        mSetupWizardMode = getActivity().getIntent().getBooleanExtra(EXTRA_IS_FIRST_RUN, false);
-        super.onCreate(icicle);
-    }
-
-    @Override
-    public View onCreateView(final LayoutInflater inflater, ViewGroup container,
-            Bundle savedInstanceState) {
-
-        if (mSetupWizardMode) {
-            View view = inflater.inflate(R.layout.setup_preference, container, false);
-            View other = view.findViewById(R.id.other_network);
-            other.setOnClickListener(new OnClickListener() {
-                @Override
-                public void onClick(View v) {
-                    if (mWifiManager.isWifiEnabled()) {
-                        onAddNetworkPressed();
-                    }
-                }
-            });
-            final ImageButton b = (ImageButton) view.findViewById(R.id.more);
-            if (b != null) {
-                b.setOnClickListener(new OnClickListener() {
-                    @Override
-                    public void onClick(View v) {
-                        if (mWifiManager.isWifiEnabled()) {
-                            PopupMenu pm = new PopupMenu(inflater.getContext(), b);
-                            pm.inflate(R.menu.wifi_setup);
-                            pm.setOnMenuItemClickListener(new OnMenuItemClickListener() {
-                                @Override
-                                public boolean onMenuItemClick(MenuItem item) {
-                                    if (R.id.wifi_wps == item.getItemId()) {
-                                        showDialog(WPS_PBC_DIALOG_ID);
-                                        return true;
-                                    }
-                                    return false;
-                                }
-                            });
-                            pm.show();
-                        }
-                    }
-                });
-            }
-
-            Intent intent = getActivity().getIntent();
-            if (intent.getBooleanExtra(EXTRA_SHOW_CUSTOM_BUTTON, false)) {
-                view.findViewById(R.id.button_bar).setVisibility(View.VISIBLE);
-                view.findViewById(R.id.back_button).setVisibility(View.INVISIBLE);
-                view.findViewById(R.id.skip_button).setVisibility(View.INVISIBLE);
-                view.findViewById(R.id.next_button).setVisibility(View.INVISIBLE);
-
-                Button customButton = (Button) view.findViewById(R.id.custom_button);
-                customButton.setVisibility(View.VISIBLE);
-                customButton.setOnClickListener(new OnClickListener() {
-                    @Override
-                    public void onClick(View v) {
-                        boolean isConnected = false;
-                        Activity activity = getActivity();
-                        final ConnectivityManager connectivity = (ConnectivityManager)
-                                activity.getSystemService(Context.CONNECTIVITY_SERVICE);
-                        if (connectivity != null) {
-                            final NetworkInfo info = connectivity.getActiveNetworkInfo();
-                            isConnected = (info != null) && info.isConnected();
-                        }
-                        if (isConnected) {
-                            // Warn of possible data charges
-                            showDialog(WIFI_SKIPPED_DIALOG_ID);
-                        } else {
-                            // Warn of lack of updates
-                            showDialog(WIFI_AND_MOBILE_SKIPPED_DIALOG_ID);
-                        }
-                    }
-                });
-            }
-
-            if (intent.getBooleanExtra(EXTRA_SHOW_WIFI_REQUIRED_INFO, false)) {
-                view.findViewById(R.id.wifi_required_info).setVisibility(View.VISIBLE);
-            }
-
-            return view;
-        } else {
-            return super.onCreateView(inflater, container, savedInstanceState);
-        }
-    }
-
-    @Override
     public void onActivityCreated(Bundle savedInstanceState) {
         super.onActivityCreated(savedInstanceState);
 
@@ -351,60 +224,11 @@
             mAccessPointSavedState = savedInstanceState.getBundle(SAVE_DIALOG_ACCESS_POINT_STATE);
         }
 
-        final Activity activity = getActivity();
-        final Intent intent = activity.getIntent();
-
-        // first if we're supposed to finish once we have a connection
-        mAutoFinishOnConnection = intent.getBooleanExtra(EXTRA_AUTO_FINISH_ON_CONNECT, false);
-
-        if (mAutoFinishOnConnection) {
-            // Hide the next button
-            if (hasNextButton()) {
-                getNextButton().setVisibility(View.GONE);
-            }
-
-            final ConnectivityManager connectivity = (ConnectivityManager)
-                    activity.getSystemService(Context.CONNECTIVITY_SERVICE);
-            if (connectivity != null
-                    && connectivity.getNetworkInfo(ConnectivityManager.TYPE_WIFI).isConnected()) {
-                activity.setResult(Activity.RESULT_OK);
-                activity.finish();
-                return;
-            }
-        }
-
-        // if we're supposed to enable/disable the Next button based on our current connection
-        // state, start it off in the right state
-        mEnableNextOnConnection = intent.getBooleanExtra(EXTRA_ENABLE_NEXT_ON_CONNECT, false);
-
-        if (mEnableNextOnConnection) {
-            if (hasNextButton()) {
-                final ConnectivityManager connectivity = (ConnectivityManager)
-                        activity.getSystemService(Context.CONNECTIVITY_SERVICE);
-                if (connectivity != null) {
-                    NetworkInfo info = connectivity.getNetworkInfo(
-                            ConnectivityManager.TYPE_WIFI);
-                    changeNextButtonState(info.isConnected());
-                }
-            }
-        }
-
         addPreferencesFromResource(R.xml.wifi_settings);
 
-        if (mSetupWizardMode) {
-            getView().setSystemUiVisibility(
-                    View.STATUS_BAR_DISABLE_HOME |
-                    View.STATUS_BAR_DISABLE_RECENT |
-                    View.STATUS_BAR_DISABLE_NOTIFICATION_ALERTS |
-                    View.STATUS_BAR_DISABLE_CLOCK);
-        }
-
         mEmptyView = (TextView) getView().findViewById(android.R.id.empty);
         getListView().setEmptyView(mEmptyView);
-
-        if (!mSetupWizardMode) {
-            registerForContextMenu(getListView());
-        }
+        registerForContextMenu(getListView());
         setHasOptionsMenu(true);
     }
 
@@ -412,13 +236,16 @@
     public void onStart() {
         super.onStart();
 
-        // On/off switch is hidden for Setup Wizard
-        if (!mSetupWizardMode) {
-            final SettingsActivity activity = (SettingsActivity) getActivity();
+        // On/off switch is hidden for Setup Wizard (returns null)
+        mWifiEnabler = createWifiEnabler();
+    }
 
-            mSwitchBar = activity.getSwitchBar();
-            mWifiEnabler = new WifiEnabler(activity, mSwitchBar);
-        }
+    /**
+     * @return new WifiEnabler or null (as overridden by WifiSettingsForSetupWizard)
+     */
+    /* package */ WifiEnabler createWifiEnabler() {
+        final SettingsActivity activity = (SettingsActivity) getActivity();
+        return new WifiEnabler(activity, activity.getSwitchBar());
     }
 
     @Override
@@ -449,44 +276,41 @@
         // If the user is not allowed to configure wifi, do not show the menu.
         if (isRestrictedAndNotPinProtected()) return;
 
+        addOptionsMenuItems(menu);
+        super.onCreateOptionsMenu(menu, inflater);
+    }
+
+    /**
+     * @param menu
+     */
+    void addOptionsMenuItems(Menu menu) {
         final boolean wifiIsEnabled = mWifiManager.isWifiEnabled();
         TypedArray ta = getActivity().getTheme().obtainStyledAttributes(
                 new int[] {R.attr.ic_menu_add, R.attr.ic_wps});
-        if (mSetupWizardMode) {
-            menu.add(Menu.NONE, MENU_ID_WPS_PBC, 0, R.string.wifi_menu_wps_pbc)
-                    .setIcon(ta.getDrawable(1))
+        menu.add(Menu.NONE, MENU_ID_WPS_PBC, 0, R.string.wifi_menu_wps_pbc)
+                .setIcon(ta.getDrawable(1))
+                .setEnabled(wifiIsEnabled)
+                .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
+        menu.add(Menu.NONE, MENU_ID_ADD_NETWORK, 0, R.string.wifi_add_network)
+                .setIcon(ta.getDrawable(0))
+                .setEnabled(wifiIsEnabled)
+                .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
+        menu.add(Menu.NONE, MENU_ID_SCAN, 0, R.string.wifi_menu_scan)
+                //.setIcon(R.drawable.ic_menu_scan_network)
+                .setEnabled(wifiIsEnabled)
+                .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
+        menu.add(Menu.NONE, MENU_ID_WPS_PIN, 0, R.string.wifi_menu_wps_pin)
+                .setEnabled(wifiIsEnabled)
+                .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
+        if (mP2pSupported) {
+            menu.add(Menu.NONE, MENU_ID_P2P, 0, R.string.wifi_menu_p2p)
                     .setEnabled(wifiIsEnabled)
-                    .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
-            menu.add(Menu.NONE, MENU_ID_ADD_NETWORK, 0, R.string.wifi_add_network)
-                    .setEnabled(wifiIsEnabled)
-                    .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
-        } else {
-            menu.add(Menu.NONE, MENU_ID_WPS_PBC, 0, R.string.wifi_menu_wps_pbc)
-                    .setIcon(ta.getDrawable(1))
-                    .setEnabled(wifiIsEnabled)
-                    .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
-            menu.add(Menu.NONE, MENU_ID_ADD_NETWORK, 0, R.string.wifi_add_network)
-                    .setIcon(ta.getDrawable(0))
-                    .setEnabled(wifiIsEnabled)
-                    .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
-            menu.add(Menu.NONE, MENU_ID_SCAN, 0, R.string.wifi_menu_scan)
-                    //.setIcon(R.drawable.ic_menu_scan_network)
-                    .setEnabled(wifiIsEnabled)
-                    .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
-            menu.add(Menu.NONE, MENU_ID_WPS_PIN, 0, R.string.wifi_menu_wps_pin)
-                    .setEnabled(wifiIsEnabled)
-                    .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
-            if (mP2pSupported) {
-                menu.add(Menu.NONE, MENU_ID_P2P, 0, R.string.wifi_menu_p2p)
-                        .setEnabled(wifiIsEnabled)
-                        .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
-            }
-            menu.add(Menu.NONE, MENU_ID_ADVANCED, 0, R.string.wifi_menu_advanced)
-                    //.setIcon(android.R.drawable.ic_menu_manage)
                     .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
         }
+        menu.add(Menu.NONE, MENU_ID_ADVANCED, 0, R.string.wifi_menu_advanced)
+                //.setIcon(android.R.drawable.ic_menu_manage)
+                .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
         ta.recycle();
-        super.onCreateOptionsMenu(menu, inflater);
     }
 
     @Override
@@ -667,44 +491,6 @@
                 return new WpsDialog(getActivity(), WpsInfo.PBC);
             case WPS_PIN_DIALOG_ID:
                 return new WpsDialog(getActivity(), WpsInfo.DISPLAY);
-            case WIFI_SKIPPED_DIALOG_ID:
-                return new AlertDialog.Builder(getActivity())
-                            .setMessage(R.string.wifi_skipped_message)
-                            .setCancelable(false)
-                            .setNegativeButton(R.string.wifi_skip_anyway,
-                                    new DialogInterface.OnClickListener() {
-                                @Override
-                                public void onClick(DialogInterface dialog, int id) {
-                                    getActivity().setResult(RESULT_SKIP);
-                                    getActivity().finish();
-                                }
-                            })
-                            .setPositiveButton(R.string.wifi_dont_skip,
-                                    new DialogInterface.OnClickListener() {
-                                @Override
-                                public void onClick(DialogInterface dialog, int id) {
-                                }
-                            })
-                            .create();
-            case WIFI_AND_MOBILE_SKIPPED_DIALOG_ID:
-                return new AlertDialog.Builder(getActivity())
-                            .setMessage(R.string.wifi_and_mobile_skipped_message)
-                            .setCancelable(false)
-                            .setNegativeButton(R.string.wifi_skip_anyway,
-                                    new DialogInterface.OnClickListener() {
-                                @Override
-                                public void onClick(DialogInterface dialog, int id) {
-                                    getActivity().setResult(RESULT_SKIP);
-                                    getActivity().finish();
-                                }
-                            })
-                            .setPositiveButton(R.string.wifi_dont_skip,
-                                    new DialogInterface.OnClickListener() {
-                                @Override
-                                public void onClick(DialogInterface dialog, int id) {
-                                }
-                            })
-                            .create();
             case WRITE_NFC_DIALOG_ID:
                 if (mSelectedAccessPoint != null) {
                     mWifiToNfcDialog = new WriteWifiConfigToNfcDialog(
@@ -717,7 +503,7 @@
     }
 
     /**
-     * Shows the latest access points available with supplimental information like
+     * Shows the latest access points available with supplemental information like
      * the strength of network and the security for it.
      */
     private void updateAccessPoints() {
@@ -882,17 +668,8 @@
             NetworkInfo info = (NetworkInfo) intent.getParcelableExtra(
                     WifiManager.EXTRA_NETWORK_INFO);
             mConnected.set(info.isConnected());
-            changeNextButtonState(info.isConnected());
             updateAccessPoints();
             updateConnectionState(info.getDetailedState());
-            if (mAutoFinishOnConnection && info.isConnected()) {
-                Activity activity = getActivity();
-                if (activity != null) {
-                    activity.setResult(Activity.RESULT_OK);
-                    activity.finish();
-                }
-                return;
-            }
         } else if (WifiManager.RSSI_CHANGED_ACTION.equals(action)) {
             updateConnectionState(null);
         }
@@ -986,18 +763,6 @@
         }
     }
 
-    /**
-     * Renames/replaces "Next" button when appropriate. "Next" button usually exists in
-     * Wifi setup screens, not in usual wifi settings screen.
-     *
-     * @param connected true when the device is connected to a wifi network.
-     */
-    private void changeNextButtonState(boolean connected) {
-        if (mEnableNextOnConnection && hasNextButton()) {
-            getNextButton().setEnabled(connected);
-        }
-    }
-
     @Override
     public void onClick(DialogInterface dialogInterface, int button) {
         if (button == WifiDialog.BUTTON_FORGET && mSelectedAccessPoint != null) {
@@ -1039,7 +804,7 @@
 
     /* package */ void forget() {
         if (mSelectedAccessPoint.networkId == INVALID_NETWORK_ID) {
-            // Should not happen, but a monkey seems to triger it
+            // Should not happen, but a monkey seems to trigger it
             Log.e(TAG, "Failed to forget invalid network " + mSelectedAccessPoint.getConfig());
             return;
         }
@@ -1050,9 +815,6 @@
             mScanner.resume();
         }
         updateAccessPoints();
-
-        // We need to rename/replace "Next" button in wifi setup context.
-        changeNextButtonState(false);
     }
 
     /**
@@ -1104,51 +866,9 @@
 
     @Override
     protected int getHelpResource() {
-        if (mSetupWizardMode) {
-            return 0;
-        }
         return R.string.help_url_wifi;
     }
 
-    /**
-     * Used as the outer frame of all setup wizard pages that need to adjust their margins based
-     * on the total size of the available display. (e.g. side margins set to 10% of total width.)
-     */
-    public static class ProportionalOuterFrame extends RelativeLayout {
-        public ProportionalOuterFrame(Context context) {
-            super(context);
-        }
-        public ProportionalOuterFrame(Context context, AttributeSet attrs) {
-            super(context, attrs);
-        }
-        public ProportionalOuterFrame(Context context, AttributeSet attrs, int defStyle) {
-            super(context, attrs, defStyle);
-        }
-
-        /**
-         * Set our margins and title area height proportionally to the available display size
-         */
-        @Override
-        protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-            int parentWidth = MeasureSpec.getSize(widthMeasureSpec);
-            int parentHeight = MeasureSpec.getSize(heightMeasureSpec);
-            final Resources res = getContext().getResources();
-            float titleHeight = res.getFraction(R.dimen.setup_title_height, 1, 1);
-            float sideMargin = res.getFraction(R.dimen.setup_border_width, 1, 1);
-            int bottom = res.getDimensionPixelSize(R.dimen.setup_margin_bottom);
-            setPaddingRelative(
-                    (int) (parentWidth * sideMargin),
-                    0,
-                    (int) (parentWidth * sideMargin),
-                    bottom);
-            View title = findViewById(R.id.title_area);
-            if (title != null) {
-                title.setMinimumHeight((int) (parentHeight * titleHeight));
-            }
-            super.onMeasure(widthMeasureSpec, heightMeasureSpec);
-        }
-    }
-
     public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
         new BaseSearchIndexProvider() {
             @Override
diff --git a/src/com/android/settings/wifi/WifiSettingsForSetupWizard.java b/src/com/android/settings/wifi/WifiSettingsForSetupWizard.java
new file mode 100644
index 0000000..17fca9f
--- /dev/null
+++ b/src/com/android/settings/wifi/WifiSettingsForSetupWizard.java
@@ -0,0 +1,397 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.wifi;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.content.res.TypedArray;
+import android.net.ConnectivityManager;
+import android.net.NetworkInfo;
+import android.net.wifi.WifiConfiguration;
+import android.net.wifi.WifiInfo;
+import android.net.wifi.WifiManager;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.ImageButton;
+import android.widget.PopupMenu;
+import android.widget.PopupMenu.OnMenuItemClickListener;
+
+import com.android.settings.R;
+
+/**
+ * This customized version of WifiSettings is shown to the user only during Setup Wizard. Menu
+ * selections are limited, clicking on an access point will auto-advance to the next screen (once
+ * connected), and, if the user opts to skip ahead without a wifi connection, a warning message
+ * alerts of possible carrier data charges or missing software updates.
+ */
+public class WifiSettingsForSetupWizard extends WifiSettings {
+
+    private static final String TAG = "WifiSettingsForSetupWizard";
+
+    /* Used in Wifi Setup context */
+
+    // this boolean extra specifies whether to disable the Next button when not connected
+    private static final String EXTRA_ENABLE_NEXT_ON_CONNECT = "wifi_enable_next_on_connect";
+
+    // this boolean extra specifies whether to auto finish when connection is established
+    private static final String EXTRA_AUTO_FINISH_ON_CONNECT = "wifi_auto_finish_on_connect";
+
+    // this boolean extra shows a custom button that we can control
+    protected static final String EXTRA_SHOW_CUSTOM_BUTTON = "wifi_show_custom_button";
+
+    // show a text regarding data charges when wifi connection is required during setup wizard
+    protected static final String EXTRA_SHOW_WIFI_REQUIRED_INFO = "wifi_show_wifi_required_info";
+
+    // this boolean extra is set if we are being invoked by the Setup Wizard
+    private static final String EXTRA_IS_FIRST_RUN = "firstRun";
+
+    // Activity result when pressing the Skip button
+    private static final int RESULT_SKIP = Activity.RESULT_FIRST_USER;
+
+    // From WizardManager (must match constants maintained there)
+    private static final String ACTION_NEXT = "com.android.wizard.NEXT";
+    private static final String EXTRA_SCRIPT_URI = "scriptUri";
+    private static final String EXTRA_ACTION_ID = "actionId";
+    private static final String EXTRA_RESULT_CODE = "com.android.setupwizard.ResultCode";
+    private static final int NEXT_REQUEST = 10000;
+
+    // should Next button only be enabled when we have a connection?
+    private boolean mEnableNextOnConnection;
+
+    // should activity finish once we have a connection?
+    private boolean mAutoFinishOnConnection;
+
+    private final IntentFilter mFilter;
+    private final BroadcastReceiver mReceiver;
+
+    public WifiSettingsForSetupWizard() {
+        super();
+
+        mFilter = new IntentFilter();
+        mFilter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
+
+        mReceiver = new BroadcastReceiver() {
+            @Override
+            public void onReceive(Context context, Intent intent) {
+                NetworkInfo info = (NetworkInfo) intent.getParcelableExtra(
+                        WifiManager.EXTRA_NETWORK_INFO);
+                changeNextButtonState(info.isConnected());
+                if (mAutoFinishOnConnection && info.isConnected()) {
+                    Log.d(TAG, "mReceiver.onReceive context=" + context + " intent=" + intent);
+                    finishOrNext(Activity.RESULT_OK);
+                }
+            }
+        };
+    }
+
+    @Override
+    public View onCreateView(final LayoutInflater inflater, ViewGroup container,
+            Bundle savedInstanceState) {
+
+        final View view = inflater.inflate(R.layout.setup_preference, container, false);
+        final View other = view.findViewById(R.id.other_network);
+        other.setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (mWifiManager.isWifiEnabled()) {
+                    onAddNetworkPressed();
+                }
+            }
+        });
+        final ImageButton b = (ImageButton) view.findViewById(R.id.more);
+        if (b != null) {
+            b.setOnClickListener(new OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    if (mWifiManager.isWifiEnabled()) {
+                        PopupMenu pm = new PopupMenu(inflater.getContext(), b);
+                        pm.inflate(R.menu.wifi_setup);
+                        pm.setOnMenuItemClickListener(new OnMenuItemClickListener() {
+                            @Override
+                            public boolean onMenuItemClick(MenuItem item) {
+                                if (R.id.wifi_wps == item.getItemId()) {
+                                    showDialog(WPS_PBC_DIALOG_ID);
+                                    return true;
+                                }
+                                return false;
+                            }
+                        });
+                        pm.show();
+                    }
+                }
+            });
+        }
+
+        final Intent intent = getActivity().getIntent();
+        if (intent.getBooleanExtra(EXTRA_SHOW_CUSTOM_BUTTON, false)) {
+            view.findViewById(R.id.button_bar).setVisibility(View.VISIBLE);
+            view.findViewById(R.id.back_button).setVisibility(View.INVISIBLE);
+            view.findViewById(R.id.skip_button).setVisibility(View.INVISIBLE);
+            view.findViewById(R.id.next_button).setVisibility(View.INVISIBLE);
+
+            Button customButton = (Button) view.findViewById(R.id.custom_button);
+            customButton.setVisibility(View.VISIBLE);
+            customButton.setOnClickListener(new OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    boolean isConnected = false;
+                    Activity activity = getActivity();
+                    final ConnectivityManager connectivity = (ConnectivityManager)
+                            activity.getSystemService(Context.CONNECTIVITY_SERVICE);
+                    if (connectivity != null) {
+                        final NetworkInfo info = connectivity.getActiveNetworkInfo();
+                        isConnected = (info != null) && info.isConnected();
+                    }
+                    if (isConnected) {
+                        // Warn of possible data charges
+                        showDialog(WIFI_SKIPPED_DIALOG_ID);
+                    } else {
+                        // Warn of lack of updates
+                        showDialog(WIFI_AND_MOBILE_SKIPPED_DIALOG_ID);
+                    }
+                }
+            });
+        }
+
+        if (intent.getBooleanExtra(EXTRA_SHOW_WIFI_REQUIRED_INFO, false)) {
+            view.findViewById(R.id.wifi_required_info).setVisibility(View.VISIBLE);
+        }
+
+        return view;
+    }
+
+    @Override
+    public void onActivityCreated(Bundle savedInstanceState) {
+        super.onActivityCreated(savedInstanceState);
+
+        getView().setSystemUiVisibility(
+                View.STATUS_BAR_DISABLE_HOME |
+                View.STATUS_BAR_DISABLE_RECENT |
+                View.STATUS_BAR_DISABLE_NOTIFICATION_ALERTS |
+                View.STATUS_BAR_DISABLE_CLOCK);
+
+        final Activity activity = getActivity();
+        final Intent intent = activity.getIntent();
+
+        // first if we're supposed to finish once we have a connection
+        mAutoFinishOnConnection = intent.getBooleanExtra(EXTRA_AUTO_FINISH_ON_CONNECT, false);
+
+        /*
+         * When entering with a savedInstanceState, we may be returning from a later activity in the
+         * setup flow. It's not clear yet if there are other possible circumstances. It's not
+         * appropriate to refire our activity results, so we skip that here.
+         */
+        if (mAutoFinishOnConnection && null == savedInstanceState) {
+            // Hide the next button
+            if (hasNextButton()) {
+                getNextButton().setVisibility(View.GONE);
+            }
+
+            final ConnectivityManager connectivity = (ConnectivityManager)
+                    activity.getSystemService(Context.CONNECTIVITY_SERVICE);
+            if (connectivity != null
+                    && connectivity.getNetworkInfo(ConnectivityManager.TYPE_WIFI).isConnected()) {
+                Log.d(TAG, "onActivityCreated Auto-finishing");
+                finishOrNext(Activity.RESULT_OK);
+                return;
+            }
+        }
+
+        // if we're supposed to enable/disable the Next button based on our current connection
+        // state, start it off in the right state
+        mEnableNextOnConnection = intent.getBooleanExtra(EXTRA_ENABLE_NEXT_ON_CONNECT, false);
+
+        if (mEnableNextOnConnection) {
+            if (hasNextButton()) {
+                final ConnectivityManager connectivity = (ConnectivityManager)
+                        activity.getSystemService(Context.CONNECTIVITY_SERVICE);
+                if (connectivity != null) {
+                    NetworkInfo info = connectivity.getNetworkInfo(
+                            ConnectivityManager.TYPE_WIFI);
+                    changeNextButtonState(info.isConnected());
+                }
+            }
+        }
+    }
+
+    @Override
+    public Dialog onCreateDialog(int dialogId) {
+        switch (dialogId) {
+            case WIFI_SKIPPED_DIALOG_ID:
+                return new AlertDialog.Builder(getActivity())
+                            .setMessage(R.string.wifi_skipped_message)
+                            .setCancelable(false)
+                            .setNegativeButton(R.string.wifi_skip_anyway,
+                                    new DialogInterface.OnClickListener() {
+                                @Override
+                                public void onClick(DialogInterface dialog, int id) {
+                                    finishOrNext(RESULT_SKIP);
+                                }
+                            })
+                            .setPositiveButton(R.string.wifi_dont_skip,
+                                    new DialogInterface.OnClickListener() {
+                                @Override
+                                public void onClick(DialogInterface dialog, int id) {
+                                }
+                            })
+                            .create();
+            case WIFI_AND_MOBILE_SKIPPED_DIALOG_ID:
+                return new AlertDialog.Builder(getActivity())
+                            .setMessage(R.string.wifi_and_mobile_skipped_message)
+                            .setCancelable(false)
+                            .setNegativeButton(R.string.wifi_skip_anyway,
+                                    new DialogInterface.OnClickListener() {
+                                @Override
+                                public void onClick(DialogInterface dialog, int id) {
+                                    finishOrNext(RESULT_SKIP);
+                                }
+                            })
+                            .setPositiveButton(R.string.wifi_dont_skip,
+                                    new DialogInterface.OnClickListener() {
+                                @Override
+                                public void onClick(DialogInterface dialog, int id) {
+                                }
+                            })
+                            .create();
+        }
+        return super.onCreateDialog(dialogId);
+    }
+
+    @Override
+    public void onResume() {
+        super.onResume();
+        getActivity().registerReceiver(mReceiver, mFilter);
+    }
+
+    @Override
+    public void onPause() {
+        super.onPause();
+        getActivity().unregisterReceiver(mReceiver);
+    }
+
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        if (resultCode == Activity.RESULT_CANCELED) {
+            // Before returning to the settings panel, forget any current access point so it will
+            // not attempt to automatically reconnect and advance
+            // FIXME: when coming back, it would be better to keep the current connection and
+            // override the auto-advance feature
+            final WifiInfo info = mWifiManager.getConnectionInfo();
+            if (null != info) {
+                int netId = info.getNetworkId();
+                if (netId != WifiConfiguration.INVALID_NETWORK_ID) {
+                    mWifiManager.forget(netId, null);
+                }
+            }
+        }
+        super.onActivityResult(requestCode, resultCode, data);
+    }
+
+    @Override
+    public void registerForContextMenu(View view) {
+        // Suppressed during setup wizard
+    }
+
+    @Override
+    /* package */ WifiEnabler createWifiEnabler() {
+        // Not shown during setup wizard
+        return null;
+    }
+
+    @Override
+    /* package */ void addOptionsMenuItems(Menu menu) {
+        final boolean wifiIsEnabled = mWifiManager.isWifiEnabled();
+        final TypedArray ta = getActivity().getTheme()
+                .obtainStyledAttributes(new int[] {R.attr.ic_wps});
+        menu.add(Menu.NONE, MENU_ID_WPS_PBC, 0, R.string.wifi_menu_wps_pbc)
+                .setIcon(ta.getDrawable(0))
+                .setEnabled(wifiIsEnabled)
+                .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
+        menu.add(Menu.NONE, MENU_ID_ADD_NETWORK, 0, R.string.wifi_add_network)
+                .setEnabled(wifiIsEnabled)
+                .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
+        ta.recycle();
+    }
+
+    @Override
+    /* package */ void forget() {
+        super.forget();
+
+        // We need to rename/replace "Next" button in wifi setup context.
+        changeNextButtonState(false);
+    }
+
+    /**
+     * Renames/replaces "Next" button when appropriate. "Next" button usually exists in
+     * Wifi setup screens, not in usual wifi settings screen.
+     *
+     * @param enabled true when the device is connected to a wifi network.
+     */
+    private void changeNextButtonState(boolean enabled) {
+        if (mEnableNextOnConnection && hasNextButton()) {
+            getNextButton().setEnabled(enabled);
+        }
+    }
+
+    /**
+     * Complete this activity and return the results to the caller. If using WizardManager, this
+     * will invoke the next scripted action; otherwise, we simply finish.
+     */
+    private void finishOrNext(int resultCode) {
+        Log.d(TAG, "finishOrNext resultCode=" + resultCode
+                + " isUsingWizardManager=" + isUsingWizardManager());
+        if (isUsingWizardManager()) {
+            sendResultsToSetupWizard(resultCode);
+        } else {
+            Activity activity = getActivity();
+            activity.setResult(resultCode);
+            activity.finish();
+        }
+    }
+
+    private boolean isUsingWizardManager() {
+        return getActivity().getIntent().hasExtra(EXTRA_SCRIPT_URI);
+    }
+
+    /**
+     * Send the results of this activity to WizardManager, which will then send out the next
+     * scripted activity. WizardManager does not actually return an activity result, but if we
+     * invoke WizardManager without requesting a result, the framework will choose not to issue a
+     * call to onActivityResult with RESULT_CANCELED when navigating backward.
+     */
+    private void sendResultsToSetupWizard(int resultCode) {
+        final Intent intent = getActivity().getIntent();
+        final Intent nextIntent = new Intent(ACTION_NEXT);
+        nextIntent.putExtra(EXTRA_SCRIPT_URI, intent.getStringExtra(EXTRA_SCRIPT_URI));
+        nextIntent.putExtra(EXTRA_ACTION_ID, intent.getStringExtra(EXTRA_ACTION_ID));
+        nextIntent.putExtra(EXTRA_RESULT_CODE, resultCode);
+        startActivityForResult(nextIntent, NEXT_REQUEST);
+    }
+}
diff --git a/src/com/android/settings/wifi/WifiSetupActivity.java b/src/com/android/settings/wifi/WifiSetupActivity.java
index 70ee56d..d4811ed 100644
--- a/src/com/android/settings/wifi/WifiSetupActivity.java
+++ b/src/com/android/settings/wifi/WifiSetupActivity.java
@@ -19,6 +19,8 @@
 
 import android.content.res.Resources;
 
+import java.lang.Class;
+
 public class WifiSetupActivity extends WifiPickerActivity implements ButtonBarHandler {
     // Extra containing the resource name of the theme to be used
     private static final String EXTRA_THEME = "theme";
@@ -41,4 +43,9 @@
         }
         super.onApplyThemeResource(theme, resid, first);
     }
+
+    @Override
+    /* package */ Class getWifiSettingsClass() {
+        return WifiSettingsForSetupWizard.class;
+    }
 }