Merge "Draw vertical data usage sweep labels."
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index ff4f63e..c9ac1bb 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -55,6 +55,7 @@
     <application android:label="@string/settings_label"
             android:icon="@mipmap/ic_launcher_settings"
             android:taskAffinity=""
+            android:theme="@android:style/Theme.Holo.SolidActionBar.SplitActionBarWhenNarrow"
             android:hardwareAccelerated="true">
 
         <!-- Settings -->
@@ -62,9 +63,7 @@
         <activity android:name="Settings"
                 android:label="@string/settings_label_launcher"
                 android:taskAffinity="com.android.settings"
-                android:theme="@android:style/Theme.Holo"
-                android:launchMode="singleTask"
-                >
+                android:launchMode="singleTask">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <action android:name="android.settings.SETTINGS" />
@@ -74,9 +73,7 @@
         </activity>
 
         <activity android:name=".SubSettings"
-                android:taskAffinity="com.android.settings"
-                android:theme="@android:style/Theme.Holo"
-                >
+                android:taskAffinity="com.android.settings">
         </activity>
 
         <activity android:name="CreateShortcut" android:label="@string/settings_shortcut"
@@ -90,9 +87,7 @@
         <!-- Wireless Controls -->
 
         <activity android:name="Settings$WirelessSettingsActivity"
-                android:theme="@android:style/Theme.Holo"
-                android:label="@string/wireless_networks_settings_title"
-                >
+                android:label="@string/wireless_networks_settings_title">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <action android:name="android.settings.WIRELESS_SETTINGS" />
@@ -110,11 +105,9 @@
         <!-- Top-level settings -->
 
         <activity android:name="Settings$WifiSettingsActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:label="@string/wifi_settings"
-                android:configChanges="orientation|keyboardHidden"
-                android:clearTaskOnLaunch="true"
-                >
+                android:configChanges="orientation|keyboardHidden|screenSize"
+                android:clearTaskOnLaunch="true">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <action android:name="android.settings.WIFI_SETTINGS" />
@@ -125,11 +118,10 @@
             <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
                 android:value="com.android.settings.wifi.WifiSettings" />
             <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
-                android:resource="@id/wireless_settings" />
+                android:resource="@id/wifi_settings" />
         </activity>
 
         <activity android:name=".wifi.WifiPickerActivity"
-                  android:theme="@android:style/Theme.Holo"
                   android:clearTaskOnLaunch="true">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
@@ -146,29 +138,21 @@
                   android:windowSoftInputMode="adjustResize"
                   android:exported="true" />
 
-        <activity-alias android:name=".wifi.AdvancedWifiSettings"
+        <activity android:name="Settings$AdvancedWifiSettingsActivity"
                 android:label="@string/wifi_advanced_settings_label"
-                android:targetActivity="Settings"
-                >
+                android:configChanges="orientation|keyboardHidden|screenSize"
+                android:clearTaskOnLaunch="true">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <action android:name="android.settings.WIFI_IP_SETTINGS" />
                 <category android:name="android.intent.category.VOICE_LAUNCH" />
                 <category android:name="android.intent.category.DEFAULT" />
             </intent-filter>
-        </activity-alias>
-
-        <activity-alias android:name=".wifi.AdvancedSettings"
-                android:label="@string/wifi_advanced_settings_label"
-                android:targetActivity="Settings"
-                >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <action android:name="android.settings.WIFI_IP_SETTINGS" />
-                <category android:name="android.intent.category.VOICE_LAUNCH" />
-                <category android:name="android.intent.category.DEFAULT" />
-            </intent-filter>
-        </activity-alias>
+            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
+                android:value="com.android.settings.wifi.AdvancedWifiSettings" />
+            <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
+                android:resource="@id/wifi_settings" />
+        </activity>
 
         <activity android:name=".wifi.WifiInfo"
                 android:theme="@android:style/Theme.Holo.DialogWhenLarge">
@@ -206,6 +190,7 @@
             </intent-filter>
         </activity>
 
+        <!-- Suspect activity alias: targetActivity is Settings itself, does not define a name. Remove? -->
         <activity-alias android:name=".wifi.WifiApSettings"
                 android:targetActivity="Settings">
             <intent-filter>
@@ -216,9 +201,8 @@
         </activity-alias>
 
         <activity android:name="ApnSettings" android:label="@string/apn_settings"
-                  android:configChanges="orientation|keyboardHidden"
-                  android:launchMode="singleTask"
-                >
+                  android:configChanges="orientation|keyboardHidden|screenSize"
+                  android:launchMode="singleTask">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <action android:name="android.settings.APN_SETTINGS" />
@@ -228,7 +212,6 @@
         </activity>
 
         <activity android:name="Settings$BluetoothSettingsActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:label="@string/bluetooth_settings_title"
                 android:clearTaskOnLaunch="true">
             <intent-filter>
@@ -241,20 +224,23 @@
             <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
                 android:value="com.android.settings.bluetooth.BluetoothSettings" />
             <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
-                android:resource="@id/wireless_settings" />
+                android:resource="@id/bluetooth_settings" />
         </activity>
 
-        <activity-alias android:name=".bluetooth.AdvancedBluetoothSettings"
+        <activity android:name="Settings$AdvancedBluetoothSettingsActivity"
                 android:label="@string/bluetooth_advanced_settings_label"
-                android:targetActivity="Settings"
-                >
+                android:targetActivity="Settings">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <action android:name="android.settings.ADVANCED_BLUETOOTH_SETTINGS" />
                 <category android:name="android.intent.category.VOICE_LAUNCH" />
                 <category android:name="android.intent.category.DEFAULT" />
             </intent-filter>
-        </activity-alias>
+            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
+                android:value="com.android.settings.bluetooth.AdvancedBluetoothSettings" />
+            <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
+                android:resource="@id/bluetooth_settings" />
+        </activity>
 
         <activity android:name=".bluetooth.DevicePickerActivity"
                 android:theme="@android:style/Theme.Holo.DialogWhenLarge"
@@ -267,7 +253,6 @@
         </activity>
 
         <activity android:name="Settings$TetherSettingsActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:clearTaskOnLaunch="true">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
@@ -301,7 +286,6 @@
         </activity-alias>
 
         <activity android:name="Settings$VpnSettingsActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:label="@string/vpn_settings_title"
                 android:clearTaskOnLaunch="true">
             <intent-filter>
@@ -322,8 +306,7 @@
         </activity>
 
         <activity android:name="Settings$DateTimeSettingsActivity"
-                android:theme="@android:style/Theme.Holo"
-                android:label="@string/date_and_time" >
+                android:label="@string/date_and_time">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <action android:name="android.settings.DATE_SETTINGS" />
@@ -347,7 +330,6 @@
         </activity>
 
         <activity android:name="Settings$LocalePickerActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:label="@string/language_picker_title"
                 android:clearTaskOnLaunch="true">
             <intent-filter>
@@ -363,7 +345,6 @@
         </activity>
 
         <activity android:name="Settings$InputMethodAndLanguageSettingsActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:label="@string/language_keyboard_settings_title"
                 android:clearTaskOnLaunch="true">
             <intent-filter>
@@ -381,7 +362,6 @@
         </activity>
 
         <activity android:name=".inputmethod.InputMethodAndSubtypeEnablerActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:label="@string/input_methods_and_subtype_enabler_title"
                 android:clearTaskOnLaunch="true">
             <intent-filter>
@@ -394,7 +374,6 @@
         </activity>
 
         <activity android:name=".inputmethod.InputMethodDialogActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:clearTaskOnLaunch="true">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
@@ -406,7 +385,6 @@
         </activity>
 
         <activity android:name="Settings$UserDictionarySettingsActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:label="@string/user_dict_settings_titlebar"
                 android:clearTaskOnLaunch="true">
             <intent-filter>
@@ -428,7 +406,6 @@
         </activity>
 
         <activity android:name="Settings$SoundSettingsActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:label="@string/sound_settings"
                 android:clearTaskOnLaunch="true">
             <intent-filter>
@@ -446,10 +423,8 @@
         </activity>
 
         <activity android:name="Settings$DisplaySettingsActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:label="@string/display_settings"
-                android:clearTaskOnLaunch="true"
-                >
+                android:clearTaskOnLaunch="true">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <action android:name="com.android.settings.DISPLAY_SETTINGS" />
@@ -465,7 +440,6 @@
         </activity>
 
         <activity android:name="Settings$DockSettingsActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:label="@string/dock_settings_title"
                 android:enabled="@bool/has_dock_settings"
                 android:clearTaskOnLaunch="true">
@@ -500,7 +474,7 @@
         <activity android:name="SettingsLicenseActivity"
                 android:label="@string/settings_license_activity_title"
                 android:theme="@*android:style/Theme.Holo.Dialog.Alert"
-                android:configChanges="orientation">
+                android:configChanges="orientation|screenSize">
             <intent-filter>
                 <action android:name="android.settings.LICENSE" />
                 <category android:name="android.intent.category.DEFAULT" />
@@ -516,28 +490,12 @@
             </intent-filter>
         </activity>
 
-        <activity android:name="Settings$ApplicationSettingsActivity"
-                android:theme="@android:style/Theme.Holo"
-                android:label="@string/applications_settings_header">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <action android:name="android.settings.APPLICATION_SETTINGS" />
-                <category android:name="android.intent.category.DEFAULT" />
-                <category android:name="android.intent.category.VOICE_LAUNCH" />
-            </intent-filter>
-            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
-                android:value="com.android.settings.ApplicationSettings" />
-            <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
-                android:resource="@id/application_settings" />
-        </activity>
-
         <activity android:name="Settings$ManageApplicationsActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:label="@string/manageapplications_settings_title"
                 android:clearTaskOnLaunch="true">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
-                <action android:name="android.intent.action.MANAGE_PACKAGE_STORAGE" />
+                <action android:name="android.settings.APPLICATION_SETTINGS" />
                 <action android:name="android.settings.MANAGE_APPLICATIONS_SETTINGS" />
                 <action android:name="android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS" />
                 <category android:name="android.intent.category.DEFAULT" />
@@ -548,10 +506,6 @@
                 android:value="com.android.settings.applications.ManageApplications" />
             <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
                 android:resource="@id/application_settings" />
-            <meta-data android:name="com.android.settings.PARENT_FRAGMENT_TITLE"
-                android:resource="@string/applications_settings_header" />
-            <meta-data android:name="com.android.settings.PARENT_FRAGMENT_CLASS"
-                android:value="com.android.settings.Settings$ApplicationSettingsActivity" />
         </activity>
 
         <!-- Keep compatibility with old shortcuts. -->
@@ -569,6 +523,7 @@
                   android:label="@string/application_info_label"
                   android:exported="true">
         </activity>
+
         <activity-alias android:name=".applications.InstalledAppDetails"
                   android:label="@string/application_info_label"
                   android:targetActivity=".applications.InstalledAppDetailsTop">
@@ -581,7 +536,6 @@
 
         <!-- Provide direct entry into manage apps showing running services. -->
         <activity android:name="Settings$RunningServicesActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:label="@string/runningservices_settings_title">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
@@ -594,19 +548,15 @@
                 android:value="com.android.settings.applications.ManageApplications" />
             <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
                 android:resource="@id/application_settings" />
-            <meta-data android:name="com.android.settings.PARENT_FRAGMENT_TITLE"
-                android:resource="@string/applications_settings_header" />
-            <meta-data android:name="com.android.settings.PARENT_FRAGMENT_CLASS"
-                android:value="com.android.settings.Settings$ApplicationSettingsActivity" />
         </activity>
 
         <!-- Provide direct entry into manage apps showing running services. -->
         <activity android:name="Settings$StorageUseActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:label="@string/storageuse_settings_title">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.DEFAULT" />
+                <action android:name="android.intent.action.MANAGE_PACKAGE_STORAGE" />
                 <category android:name="android.intent.category.MONKEY" />
                 <category android:name="android.intent.category.VOICE_LAUNCH" />
                 <category android:name="com.android.settings.SHORTCUT" />
@@ -615,16 +565,11 @@
                 android:value="com.android.settings.applications.ManageApplications" />
             <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
                 android:resource="@id/application_settings" />
-            <meta-data android:name="com.android.settings.PARENT_FRAGMENT_TITLE"
-                android:resource="@string/applications_settings_header" />
-            <meta-data android:name="com.android.settings.PARENT_FRAGMENT_CLASS"
-                android:value="com.android.settings.Settings$ApplicationSettingsActivity" />
         </activity>
 
         <activity android:name="Settings$LocationSettingsActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:label="@string/location_settings_title"
-                android:configChanges="orientation|keyboardHidden"
+                android:configChanges="orientation|keyboardHidden|screenSize"
                 android:clearTaskOnLaunch="true">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
@@ -641,9 +586,8 @@
         </activity>
 
         <activity android:name="Settings$SecuritySettingsActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:label="@string/security_settings_title"
-                android:configChanges="orientation|keyboardHidden"
+                android:configChanges="orientation|keyboardHidden|screenSize"
                 android:clearTaskOnLaunch="true">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
@@ -660,13 +604,13 @@
         </activity>
 
         <activity android:name="Settings$PrivacySettingsActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:label="@string/privacy_settings_title"
-                android:configChanges="orientation|keyboardHidden"
+                android:configChanges="orientation|keyboardHidden|screenSize"
                 android:clearTaskOnLaunch="true">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <action android:name="android.settings.PRIVACY_SETTINGS" />
+                <action android:name="android.settings.BACKUP_AND_RESET_SETTINGS" />
                 <category android:name="android.intent.category.DEFAULT" />
                 <category android:name="android.intent.category.VOICE_LAUNCH" />
             </intent-filter>
@@ -678,7 +622,7 @@
 
         <activity android:name="CredentialStorage"
                 android:theme="@style/Transparent"
-                android:configChanges="orientation|keyboardHidden">
+                android:configChanges="orientation|keyboardHidden|screenSize">
             <intent-filter>
                 <action android:name="com.android.credentials.UNLOCK" />
                 <action android:name="com.android.credentials.INSTALL" />
@@ -689,9 +633,7 @@
 
         <activity android:name="Settings$DeviceAdminSettingsActivity"
                 android:label="@string/device_admin_settings_title"
-                android:theme="@android:style/Theme.Holo"
-                android:clearTaskOnLaunch="true"
-                >
+                android:clearTaskOnLaunch="true">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.DEFAULT" />
@@ -711,8 +653,7 @@
         <activity android:name="DeviceAdminAdd"
                 android:label="@string/device_admin_add_title"
                 android:theme="@android:style/Theme.Holo.DialogWhenLarge"
-                android:clearTaskOnLaunch="true"
-                >
+                android:clearTaskOnLaunch="true">
             <intent-filter>
                 <action android:name="android.app.action.ADD_DEVICE_ADMIN" />
                 <category android:name="android.intent.category.DEFAULT" />
@@ -731,7 +672,6 @@
         </activity>
 
         <activity android:name="Settings$AccessibilitySettingsActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:label="@string/accessibility_settings_title">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
@@ -745,12 +685,17 @@
                 android:resource="@id/accessibility_settings" />
         </activity>
 
-        <activity android:name="TextToSpeechSettings" android:label="@string/tts_settings">
+        <activity android:name="Settings$TextToSpeechSettingsActivity"
+                android:label="@string/tts_settings">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <action android:name="com.android.settings.TTS_SETTINGS" />
                 <category android:name="android.intent.category.DEFAULT" />
             </intent-filter>
+            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
+                android:value="com.android.settings.TextToSpeechSettings" />
+            <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
+                android:resource="@id/language_settings" />
         </activity>
 
         <!-- Second and third-level settings -->
@@ -790,7 +735,6 @@
         </activity>
 
         <activity android:name="Settings$StorageSettingsActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:label="@string/storage_settings_title">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
@@ -849,7 +793,6 @@
         </activity>
 
         <activity android:name="Settings$DevelopmentSettingsActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:label="@string/development_settings_title"
                 android:clearTaskOnLaunch="true">
             <intent-filter>
@@ -861,7 +804,7 @@
             <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
                 android:value="com.android.settings.DevelopmentSettings" />
             <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
-                android:resource="@id/application_settings" />
+                android:resource="@id/development_settings" />
         </activity>
 
         <activity-alias android:name="DevelopmentSettings"
@@ -869,20 +812,13 @@
                   android:exported="true"
                   android:label="@string/development_settings_title"
                   android:targetActivity="Settings$DevelopmentSettingsActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <action android:name="android.settings.APPLICATION_DEVELOPMENT_SETTINGS" />
-                <action android:name="com.android.settings.APPLICATION_DEVELOPMENT_SETTINGS" />
-                <category android:name="android.intent.category.DEFAULT" />
-            </intent-filter>
             <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
                 android:value="com.android.settings.DevelopmentSettings" />
             <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
-                android:resource="@id/application_settings" />
+                android:resource="@id/development_settings" />
         </activity-alias>
 
         <activity android:name="Settings$UsbSettingsActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:label="@string/storage_title_usb"
                 android:clearTaskOnLaunch="true">
             <intent-filter>
@@ -1055,6 +991,7 @@
             </intent-filter>
         </activity>
 
+        <!-- Suspect activity alias: targetActivity is Settings itself, does not define a name. Remove? -->
         <activity-alias android:name="ProxySelector"
             android:label="@string/proxy_settings_label"
             android:targetActivity="Settings">
@@ -1109,7 +1046,6 @@
         </activity>
 
         <activity android:name="Settings$PowerUsageSummaryActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:label="@string/power_usage_summary_title">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
@@ -1121,15 +1057,10 @@
                 android:value="com.android.settings.fuelgauge.PowerUsageSummary" />
             <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
                 android:resource="@id/application_settings" />
-            <meta-data android:name="com.android.settings.PARENT_FRAGMENT_TITLE"
-                android:resource="@string/applications_settings_header" />
-            <meta-data android:name="com.android.settings.PARENT_FRAGMENT_CLASS"
-                android:value="com.android.settings.Settings$ApplicationSettingsActivity" />
         </activity>
 
         <activity
                 android:name="Settings$ManageAccountsSettingsActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:label="@string/sync_settings">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
@@ -1143,8 +1074,7 @@
         </activity>
 
         <activity android:name="Settings$AccountSyncSettingsActivity"
-            android:label="@string/account_sync_settings_title"
-            android:theme="@android:style/Theme.Holo">
+            android:label="@string/account_sync_settings_title">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <action android:name="android.settings.ACCOUNT_SYNC_SETTINGS" />
@@ -1198,7 +1128,6 @@
 
         <!-- Pseudo-activity used to provide an intent-filter entry point to encryption settings -->
         <activity android:name="Settings$CryptKeeperSettingsActivity"
-                android:theme="@android:style/Theme.Holo"
                 android:label="@string/crypt_keeper_encrypt_title">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
diff --git a/res/drawable-hdpi/ic_bt_config.png b/res/drawable-hdpi/ic_bt_config.png
index c6d2483..47b4ba2 100644
--- a/res/drawable-hdpi/ic_bt_config.png
+++ b/res/drawable-hdpi/ic_bt_config.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_bt_config.png b/res/drawable-mdpi/ic_bt_config.png
index eefda26..7928104 100644
--- a/res/drawable-mdpi/ic_bt_config.png
+++ b/res/drawable-mdpi/ic_bt_config.png
Binary files differ
diff --git a/res/layout/custom_preference_list_fragment.xml b/res/layout/custom_preference_list_fragment.xml
index f0bf010..4803639 100644
--- a/res/layout/custom_preference_list_fragment.xml
+++ b/res/layout/custom_preference_list_fragment.xml
@@ -1,20 +1,17 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2010, 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.
-*/
+<!-- Copyright (C) 2010 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.
 -->
 
 <!-- Based on preference_list_fragment.xml in framework -->
@@ -26,14 +23,20 @@
 
     <ListView android:id="@android:id/list"
         android:layout_width="match_parent"
-        android:layout_height="0px"
-        android:layout_weight="1"
+        android:layout_height="match_parent"
         android:paddingTop="0dip"
-        android:paddingBottom="0dip"
-        android:paddingLeft="0dip"
-        android:paddingRight="0dip"
+        android:paddingBottom="@*android:dimen/preference_fragment_padding_bottom"
+        android:paddingLeft="@*android:dimen/preference_fragment_padding_side"
+        android:paddingRight="@*android:dimen/preference_fragment_padding_side"
         android:clipToPadding="false"
         android:drawSelectorOnTop="false"
         android:cacheColorHint="@android:color/transparent"
         android:scrollbarAlwaysDrawVerticalTrack="true" />
+
+    <TextView android:id="@+id/empty"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:padding="5dip"
+        android:gravity="center"
+        android:visibility="gone" />
 </LinearLayout>
diff --git a/res/layout/list_content_with_empty_view.xml b/res/layout/list_content_with_empty_view.xml
deleted file mode 100644
index 1d4dcdc..0000000
--- a/res/layout/list_content_with_empty_view.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2008 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-  
-          http://www.apache.org/licenses/LICENSE-2.0
-  
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
- 
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent" >
-
-    <ListView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/list"
-        android:layout_width="match_parent" 
-        android:layout_height="match_parent"
-        android:drawSelectorOnTop="false"
-        />
-
-    <TextView android:id="@+id/empty"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:padding="5dip"
-        android:gravity="center"
-        android:visibility="gone" />
-
-</FrameLayout>    
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 3c2bdd3..157a6c4 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -48,30 +48,6 @@
         <item>yyyy-MM-dd</item>
     </string-array>
 
-    <!-- Display settings.  The type of animations to show. -->
-    <string-array name="animations_entries">
-        <item>No animations</item>
-        <item>Some animations</item>
-        <item>All animations</item>
-    </string-array>
-
-    <!-- Display settings.  Summary for each type of animation. -->
-    <string-array name="animations_summaries">
-        <item>No window animations are shown</item>
-        <item>Some window animations are shown</item>
-        <item>All window animations are shown</item>
-    </string-array>
-
-    <!-- Do not translate. -->
-    <string-array name="animations_values">
-        <!-- Do not translate. -->
-        <item>00</item>
-        <!-- Do not translate. -->
-        <item>01</item>
-        <!-- Do not translate. -->
-        <item>11</item>
-    </string-array>
-
     <!-- Display settings.  The delay in inactivity before the screen is turned off. These are shown in a list dialog. -->
     <string-array name="screen_timeout_entries">
         <item>15 seconds</item>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 7454396..abd62bf 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -281,7 +281,7 @@
     <string name="bluetooth_ask_enablement_and_lasting_discovery" product="default">"An application on your phone is requesting permission to turn on Bluetooth and to make your phone discoverable by other devices. Do you want to do this?"</string>
 
     <!-- Strings for msg to display to user while bluetooth is turning on -->
-    <string name="bluetooth_turning_on">"Turning on Bluetooth\u2026"</string>
+    <string name="bluetooth_turning_on">"Turning Bluetooth on\u2026"</string>
 
     <!-- Strings for device profile auto connect setting -->
     <string name="bluetooth_auto_connect">Auto connect</string>
@@ -955,10 +955,10 @@
     <string name="bluetooth_searching_for_devices">Searching\u2026</string>
     <!-- Bluetooth settings: The sub heading for device settings. [CHAR LIMIT=30] -->
     <string name="bluetooth_preference_device_settings">Device settings</string>
-    <!-- Bluetooth settings: The sub heading for paired devices. [CHAR LIMIT=30] -->
+    <!-- Bluetooth settings: The sub heading for devices which have already been paired with this device. [CHAR LIMIT=40] -->
     <string name="bluetooth_preference_paired_devices">Paired devices</string>
-    <!-- Bluetooth settings: The sub heading for found devices when scanning. [CHAR LIMIT=30] -->
-    <string name="bluetooth_preference_found_devices">Found devices</string>
+    <!-- Bluetooth settings: The sub heading for available devices during and after scanning. [CHAR LIMIT=40] -->
+    <string name="bluetooth_preference_found_devices">Available devices</string>
     <!-- Bluetooth settings.  Context menu item for a device.  Action will connect to all profiles on the device. -->
     <string name="bluetooth_device_context_connect">Connect</string>
     <!-- Bluetooth settings.  Context menu item for a device.  Action will disconnect from all profiles on the device. -->
@@ -978,7 +978,7 @@
     <!-- Bluetooth Advanced settings.  Used as a label under the shortcut icon that goes to Bluetooth advanced settings. [CHAR LIMIT=20]-->
     <string name="bluetooth_advanced_settings_label">Advanced Bluetooth</string>
     <!-- Bluetooth settings. Text displayed when Bluetooth is off and device list is empty [CHAR LIMIT=50]-->
-    <string name="bluetooth_empty_list_bluetooth_off">Turn on bluetooth to see available devices</string>
+    <string name="bluetooth_empty_list_bluetooth_off">To see devices, turn Bluetooth on.</string>
 
 
     <!-- Bluetooth settings.  The title of the screen to pick which profiles to connect to on the device.  For example, headphones may have both A2DP and headset, this allows the user to choose which one he wants to connect to. -->
@@ -1084,7 +1084,7 @@
     <!-- Summary text of the Wi-fi settings screen -->
     <string name="wifi_settings_summary">Set up &amp; manage wireless access points</string>
     <!-- Summary text when turning Wi-Fi or bluetooth on -->
-    <string name="wifi_starting">Turning on Wi-Fi\u2026</string>
+    <string name="wifi_starting">Turning Wi-Fi on\u2026</string>
     <!-- Summary text when turning Wi-Fi or bluetooth off -->
     <string name="wifi_stopping">Turning off Wi-Fi\u2026</string>
     <!-- Summary text when Wi-Fi or bluetooth has error -->
@@ -1124,7 +1124,7 @@
     <!-- Menu option to modify a Wi-Fi network configuration -->
     <string name="wifi_menu_modify">Modify network</string>
     <!-- Wi-Fi settings. text displayed when WiFi is off and network list is empty [CHAR LIMIT=50]-->
-    <string name="wifi_empty_list_wifi_off">Turn on wifi to see available networks</string>
+    <string name="wifi_empty_list_wifi_off">To see available networks, turn Wi-Fi on.</string>
 
     <!-- Dialog for Access Points --> <skip />
     <!-- Label for network setup [CHAR LIMIT=50] -->
@@ -1476,12 +1476,6 @@
     <!-- Display settings -->
     <!-- Sound & display settings screen, section header for settings related to display -->
     <string name="display_settings">Screen settings</string>
-    <!-- Sound & display settings screen, animations check box label -->
-    <string name="animations_title">Animation</string>
-    <!-- Sound & display settings screen, animations option summary text when check box is selected -->
-    <string name="animations_summary_on">Show animation when opening &amp; closing windows</string>
-    <!-- Sound & display settings screen, animations option summary text when check box is clear -->
-    <string name="animations_summary_off">Show animation when opening &amp; closing windows</string>
     <!-- Sound & display settings screen, accelerometer-based rotation check box label -->
     <string name="accelerometer_title">Auto-rotate screen</string>
     <!-- Sound & display settings screen, accelerometer-based rotation summary text when check box is selected -->
diff --git a/res/xml/display_settings.xml b/res/xml/display_settings.xml
index b0abd9a..c13a107 100644
--- a/res/xml/display_settings.xml
+++ b/res/xml/display_settings.xml
@@ -23,18 +23,16 @@
                 android:title="@string/brightness"
                 android:dialogTitle="@string/brightness" />
 
+        <PreferenceScreen
+                android:key="wallpaper"
+                android:title="@string/wallpaper_settings_title"
+                android:fragment="com.android.settings.WallpaperTypeSettings" />
+
         <CheckBoxPreference
             android:key="accelerometer"
             android:title="@string/accelerometer_title"/>
 
         <ListPreference
-            android:key="animations"
-            android:title="@string/animations_title"
-            android:persistent="false"
-            android:entries="@array/animations_entries"
-            android:entryValues="@array/animations_values" />
-
-        <ListPreference
                 android:key="screen_timeout"
                 android:title="@string/screen_timeout"
                 android:summary="@string/screen_timeout_summary"
@@ -42,18 +40,10 @@
                 android:entries="@array/screen_timeout_entries"
                 android:entryValues="@array/screen_timeout_values" />
 
-        <PreferenceScreen
-                android:key="wallpaper"
-                android:title="@string/wallpaper_settings_title"
-                android:fragment="com.android.settings.WallpaperTypeSettings"
-            />
-
         <PreferenceScreen 
                 android:title="@string/dream_settings_title" 
                 android:summary="@string/dream_settings_summary"
-                android:fragment="com.android.settings.DreamSettings"
-                >
-        </PreferenceScreen>
+                android:fragment="com.android.settings.DreamSettings" />
 
         <ListPreference
                 android:key="font_size"
diff --git a/src/com/android/settings/DisplaySettings.java b/src/com/android/settings/DisplaySettings.java
index 682184e..6ab88d0 100644
--- a/src/com/android/settings/DisplaySettings.java
+++ b/src/com/android/settings/DisplaySettings.java
@@ -23,24 +23,16 @@
 import android.content.ContentResolver;
 import android.content.Context;
 import android.content.res.Configuration;
-
-import android.app.ActivityManagerNative;
-import android.app.admin.DevicePolicyManager;
-import android.content.ContentResolver;
-import android.content.Context;
-import android.content.res.Configuration;
 import android.database.ContentObserver;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.RemoteException;
-import android.os.ServiceManager;
 import android.preference.CheckBoxPreference;
 import android.preference.ListPreference;
 import android.preference.Preference;
 import android.preference.PreferenceScreen;
 import android.provider.Settings;
 import android.util.Log;
-import android.view.IWindowManager;
 
 import java.util.ArrayList;
 
@@ -52,19 +44,14 @@
     private static final int FALLBACK_SCREEN_TIMEOUT_VALUE = 30000;
 
     private static final String KEY_SCREEN_TIMEOUT = "screen_timeout";
-    private static final String KEY_ANIMATIONS = "animations";
     private static final String KEY_ACCELEROMETER = "accelerometer";
     private static final String KEY_FONT_SIZE = "font_size";
 
-    private ListPreference mAnimations;
     private CheckBoxPreference mAccelerometer;
-    private float[] mAnimationScales;
     private ListPreference mFontSizePref;
 
     private final Configuration mCurConfig = new Configuration();
     
-    private IWindowManager mWindowManager;
-
     private ListPreference mScreenTimeoutPreference;
 
     private ContentObserver mAccelerometerRotationObserver = new ContentObserver(new Handler()) {
@@ -78,18 +65,9 @@
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         ContentResolver resolver = getActivity().getContentResolver();
-        mWindowManager = IWindowManager.Stub.asInterface(ServiceManager.getService("window"));
 
         addPreferencesFromResource(R.xml.display_settings);
 
-        // Fetch this once before attaching a listener for changes.
-        try {
-            mAnimationScales = mWindowManager.getAnimationScales();
-        } catch (RemoteException e) {
-            // Shouldn't happen and not much can be done anyway.
-        }
-        mAnimations = (ListPreference) findPreference(KEY_ANIMATIONS);
-        mAnimations.setOnPreferenceChangeListener(this);
         mAccelerometer = (CheckBoxPreference) findPreference(KEY_ACCELEROMETER);
         mAccelerometer.setPersistent(false);
 
@@ -99,7 +77,7 @@
         mScreenTimeoutPreference.setValue(String.valueOf(currentTimeout));
         mScreenTimeoutPreference.setOnPreferenceChangeListener(this);
         disableUnusableTimeouts(mScreenTimeoutPreference);
-        updateTimeoutPreferenceDescription(resolver, mScreenTimeoutPreference,
+        updateTimeoutPreferenceDescription(mScreenTimeoutPreference,
                 R.string.screen_timeout_summary, currentTimeout);
 
         mFontSizePref = (ListPreference) findPreference(KEY_FONT_SIZE);
@@ -107,15 +85,14 @@
     }
 
     private void updateTimeoutPreferenceDescription(
-            ContentResolver resolver,
-            ListPreference pref, 
+            ListPreference pref,
             int summaryStrings,
             long currentTimeout) {
-        updateTimeoutPreferenceDescription(resolver, pref, summaryStrings, 0, currentTimeout);
+        updateTimeoutPreferenceDescription(pref, summaryStrings, 0, currentTimeout);
     }
+
     private void updateTimeoutPreferenceDescription(
-            ContentResolver resolver,
-            ListPreference pref, 
+            ListPreference pref,
             int summaryStrings,
             int zeroString,
             long currentTimeout) {
@@ -188,19 +165,18 @@
     
     public void readFontSizePreference(ListPreference pref) {
         try {
-            mCurConfig.updateFrom(
-                ActivityManagerNative.getDefault().getConfiguration());
+            mCurConfig.updateFrom(ActivityManagerNative.getDefault().getConfiguration());
         } catch (RemoteException e) {
+            Log.w(TAG, "Unable to retrieve font size");
         }
-        pref.setValueIndex(floatToIndex(mCurConfig.fontScale,
-                R.array.entryvalues_font_size));
+        pref.setValueIndex(floatToIndex(mCurConfig.fontScale, R.array.entryvalues_font_size));
     }
     
     @Override
     public void onResume() {
         super.onResume();
 
-        updateState(true);
+        updateState();
         getContentResolver().registerContentObserver(
                 Settings.System.getUriFor(Settings.System.ACCELEROMETER_ROTATION), true,
                 mAccelerometerRotationObserver);
@@ -213,33 +189,7 @@
         getContentResolver().unregisterContentObserver(mAccelerometerRotationObserver);
     }
 
-    private void updateState(boolean force) {
-        int animations = 0;
-        try {
-            mAnimationScales = mWindowManager.getAnimationScales();
-        } catch (RemoteException e) {
-            // Shouldn't happen and not much can be done anyway.
-        }
-        if (mAnimationScales != null) {
-            if (mAnimationScales.length >= 1) {
-                animations = ((int)(mAnimationScales[0]+.5f)) % 10;
-            }
-            if (mAnimationScales.length >= 2) {
-                animations += (((int)(mAnimationScales[1]+.5f)) & 0x7) * 10;
-            }
-        }
-        int idx = 0;
-        int best = 0;
-        CharSequence[] aents = mAnimations.getEntryValues();
-        for (int i=0; i<aents.length; i++) {
-            int val = Integer.parseInt(aents[i].toString());
-            if (val <= animations && val > best) {
-                best = val;
-                idx = i;
-            }
-        }
-        mAnimations.setValueIndex(idx);
-        updateAnimationsSummary(mAnimations.getValue());
+    private void updateState() {
         updateAccelerometerRotationCheckbox();
         readFontSizePreference(mFontSizePref);
     }
@@ -250,24 +200,12 @@
                 Settings.System.ACCELEROMETER_ROTATION, 0) != 0);
     }
 
-    private void updateAnimationsSummary(Object value) {
-        CharSequence[] summaries = getResources().getTextArray(R.array.animations_summaries);
-        CharSequence[] values = mAnimations.getEntryValues();
-        for (int i=0; i<values.length; i++) {
-            //Log.i("foo", "Comparing entry "+ values[i] + " to current "
-            //        + mAnimations.getValue());
-            if (values[i].equals(value)) {
-                mAnimations.setSummary(summaries[i]);
-                break;
-            }
-        }
-    }
-
     public void writeFontSizePreference(Object objValue) {
         try {
             mCurConfig.fontScale = Float.parseFloat(objValue.toString());
             ActivityManagerNative.getDefault().updateConfiguration(mCurConfig);
         } catch (RemoteException e) {
+            Log.w(TAG, "Unable to save font size");
         }
     }
     
@@ -283,31 +221,12 @@
 
     public boolean onPreferenceChange(Preference preference, Object objValue) {
         final String key = preference.getKey();
-        if (KEY_ANIMATIONS.equals(key)) {
-            try {
-                int value = Integer.parseInt((String) objValue);
-                if (mAnimationScales.length >= 1) {
-                    mAnimationScales[0] = value%10;
-                }
-                if (mAnimationScales.length >= 2) {
-                    mAnimationScales[1] = (value/10)%10;
-                }
-                try {
-                    mWindowManager.setAnimationScales(mAnimationScales);
-                } catch (RemoteException e) {
-                }
-                updateAnimationsSummary(objValue);
-            } catch (NumberFormatException e) {
-                Log.e(TAG, "could not persist animation setting", e);
-            }
-
-        }
         if (KEY_SCREEN_TIMEOUT.equals(key)) {
             int value = Integer.parseInt((String) objValue);
             try {
                 Settings.System.putInt(getContentResolver(),
                         SCREEN_OFF_TIMEOUT, value);
-                updateTimeoutPreferenceDescription(getContentResolver(), mScreenTimeoutPreference,
+                updateTimeoutPreferenceDescription(mScreenTimeoutPreference,
                         R.string.screen_timeout_summary, value);
             } catch (NumberFormatException e) {
                 Log.e(TAG, "could not persist screen timeout setting", e);
diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index 16531e3..518d0ee 100644
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -76,7 +76,6 @@
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
-        setTheme(android.R.style.Theme_Holo_SplitActionBarWhenNarrow);
         getMetaData();
         mInLocalHeaderSwitch = true;
         super.onCreate(savedInstanceState);
@@ -567,4 +566,7 @@
     public static class CryptKeeperSettingsActivity extends Settings { /* empty */ }
     public static class DeviceAdminSettingsActivity extends Settings { /* empty */ }
     public static class DataUsageSummaryActivity extends Settings { /* empty */ }
+    public static class AdvancedWifiSettingsActivity extends Settings { /* empty */ }
+    public static class AdvancedBluetoothSettingsActivity extends Settings { /* empty */ }
+    public static class TextToSpeechSettingsActivity extends Settings { /* empty */ }
 }
diff --git a/src/com/android/settings/UserDictionarySettings.java b/src/com/android/settings/UserDictionarySettings.java
index 22112d7..ea89a1b 100644
--- a/src/com/android/settings/UserDictionarySettings.java
+++ b/src/com/android/settings/UserDictionarySettings.java
@@ -46,7 +46,6 @@
 
 import com.android.settings.SettingsPreferenceFragment.SettingsDialogFragment;
 
-import java.util.Arrays;
 import java.util.Locale;
 
 public class UserDictionarySettings extends ListFragment implements DialogCreatable {
@@ -100,7 +99,7 @@
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container,
             Bundle savedInstanceState) {
-        mView = inflater.inflate(R.layout.list_content_with_empty_view, container, false);
+        mView = inflater.inflate(R.layout.custom_preference_list_fragment, container, false);
         return mView;
     }
 
diff --git a/src/com/android/settings/accounts/AccountSyncSettings.java b/src/com/android/settings/accounts/AccountSyncSettings.java
index 9ef0481..547b0e1 100644
--- a/src/com/android/settings/accounts/AccountSyncSettings.java
+++ b/src/com/android/settings/accounts/AccountSyncSettings.java
@@ -16,10 +16,6 @@
 
 package com.android.settings.accounts;
 
-import com.android.settings.R;
-import com.google.android.collect.Lists;
-import com.google.android.collect.Maps;
-
 import android.accounts.Account;
 import android.accounts.AccountManager;
 import android.accounts.AccountManagerCallback;
@@ -53,6 +49,10 @@
 import android.widget.ImageView;
 import android.widget.TextView;
 
+import com.android.settings.R;
+import com.google.android.collect.Lists;
+import com.google.android.collect.Maps;
+
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -175,7 +175,13 @@
         mDateFormat = DateFormat.getDateFormat(activity);
         mTimeFormat = DateFormat.getTimeFormat(activity);
 
-        mAccount = (Account) getArguments().getParcelable(ACCOUNT_KEY);
+        Bundle arguments = getArguments();
+        if (arguments == null) {
+            Log.e(TAG, "No arguments provided when starting intent. ACCOUNT_KEY needed.");
+            return;
+        }
+
+        mAccount = (Account) arguments.getParcelable(ACCOUNT_KEY);
         if (mAccount != null) {
             if (Log.isLoggable(TAG, Log.VERBOSE)) Log.v(TAG, "Got account: " + mAccount);
             mUserId.setText(mAccount.name);
@@ -486,11 +492,13 @@
     protected void onAuthDescriptionsUpdated() {
         super.onAuthDescriptionsUpdated();
         getPreferenceScreen().removeAll();
-        mProviderIcon.setImageDrawable(getDrawableForType(mAccount.type));
-        mProviderId.setText(getLabelForType(mAccount.type));
-        PreferenceScreen prefs = addPreferencesForType(mAccount.type);
-        if (prefs != null) {
-            updatePreferenceIntents(prefs);
+        if (mAccount != null) {
+            mProviderIcon.setImageDrawable(getDrawableForType(mAccount.type));
+            mProviderId.setText(getLabelForType(mAccount.type));
+            PreferenceScreen prefs = addPreferencesForType(mAccount.type);
+            if (prefs != null) {
+                updatePreferenceIntents(prefs);
+            }
         }
         addPreferencesFromResource(R.xml.account_sync_settings);
     }
diff --git a/src/com/android/settings/bluetooth/BluetoothSettings.java b/src/com/android/settings/bluetooth/BluetoothSettings.java
index cd37309..2208223 100644
--- a/src/com/android/settings/bluetooth/BluetoothSettings.java
+++ b/src/com/android/settings/bluetooth/BluetoothSettings.java
@@ -20,17 +20,22 @@
 import android.app.Activity;
 import android.bluetooth.BluetoothAdapter;
 import android.bluetooth.BluetoothDevice;
+import android.os.Bundle;
 import android.preference.Preference;
 import android.preference.PreferenceActivity;
+import android.preference.PreferenceCategory;
 import android.preference.PreferenceGroup;
 import android.preference.PreferenceScreen;
 import android.util.Log;
 import android.view.Gravity;
+import android.view.LayoutInflater;
 import android.view.Menu;
 import android.view.MenuInflater;
 import android.view.MenuItem;
 import android.view.View;
+import android.view.ViewGroup;
 import android.widget.Switch;
+import android.widget.TextView;
 
 import com.android.settings.ProgressCategory;
 import com.android.settings.R;
@@ -47,8 +52,26 @@
 
     private BluetoothEnabler mBluetoothEnabler;
 
-    private PreferenceGroup mFoundDevicesCategory;
-    private boolean mFoundDevicesCategoryIsPresent;
+    private PreferenceGroup mAvailableDevicesCategory;
+    private boolean mAvailableDevicesCategoryIsPresent;
+
+    private View mView;
+    private TextView mEmptyView;
+
+    @Override
+    public View onCreateView(LayoutInflater inflater, ViewGroup container,
+            Bundle savedInstanceState) {
+        mView = inflater.inflate(R.layout.custom_preference_list_fragment, container, false);
+        return mView;
+    }
+
+    @Override
+    public void onActivityCreated(Bundle savedInstanceState) {
+        super.onActivityCreated(savedInstanceState);
+
+        mEmptyView = (TextView) mView.findViewById(R.id.empty);
+        getListView().setEmptyView(mEmptyView);
+    }
 
     @Override
     void addPreferencesForActivity() {
@@ -75,10 +98,6 @@
 
         mBluetoothEnabler = new BluetoothEnabler(activity, actionBarSwitch);
 
-        if (mLocalAdapter != null && mLocalAdapter.isEnabled()) {
-            activity.getActionBar().setSubtitle(mLocalAdapter.getName());
-        }
-
         setHasOptionsMenu(true);
     }
 
@@ -137,8 +156,8 @@
     }
 
     private void startScanning() {
-        if (!mFoundDevicesCategoryIsPresent) {
-            getPreferenceScreen().addPreference(mFoundDevicesCategory);
+        if (!mAvailableDevicesCategoryIsPresent) {
+            getPreferenceScreen().addPreference(mAvailableDevicesCategory);
         }
         mLocalAdapter.startScanning(true);
     }
@@ -149,6 +168,16 @@
         super.onDevicePreferenceClick(btPreference);
     }
 
+    private void addDeviceCategory(PreferenceGroup preferenceGroup, int titleId,
+            BluetoothDeviceFilter.Filter filter) {
+        preferenceGroup.setTitle(titleId);
+        getPreferenceScreen().addPreference(preferenceGroup);
+        setFilter(filter);
+        setDeviceListGroup(preferenceGroup);
+        addCachedDevices();
+        preferenceGroup.setEnabled(true);
+    }
+
     private void updateContent(int bluetoothState) {
         final PreferenceScreen preferenceScreen = getPreferenceScreen();
         getActivity().invalidateOptionsMenu();
@@ -157,42 +186,58 @@
         switch (bluetoothState) {
             case BluetoothAdapter.STATE_ON:
                 preferenceScreen.removeAll();
-
-                // Add bonded devices from cache first
-                setFilter(BluetoothDeviceFilter.BONDED_DEVICE_FILTER);
-                setDeviceListGroup(preferenceScreen);
                 preferenceScreen.setOrderingAsAdded(true);
 
-                addCachedDevices();
-                int numberOfPairedDevices = preferenceScreen.getPreferenceCount();
+                // This device
+                if (mMyDevicePreference == null) {
+                    mMyDevicePreference = new Preference(getActivity());
+                }
+                if (mLocalAdapter != null) {
+                    mMyDevicePreference.setTitle(mLocalAdapter.getName());
+                }
+                mMyDevicePreference.setEnabled(true);
+                preferenceScreen.addPreference(mMyDevicePreference);
 
-                // Found devices category
-                mFoundDevicesCategory = new ProgressCategory(getActivity(), null);
-                mFoundDevicesCategory.setTitle(R.string.bluetooth_preference_found_devices);
-                preferenceScreen.addPreference(mFoundDevicesCategory);
-                mFoundDevicesCategoryIsPresent = true;
+                // Paired devices category
+                if (mPairedDevicesCategory == null) {
+                    mPairedDevicesCategory = new PreferenceCategory(getActivity());
+                } else {
+                    mPairedDevicesCategory.removeAll();
+                }
+                addDeviceCategory(mPairedDevicesCategory,
+                        R.string.bluetooth_preference_paired_devices,
+                        BluetoothDeviceFilter.BONDED_DEVICE_FILTER);
+                int numberOfPairedDevices = mPairedDevicesCategory.getPreferenceCount();
 
-                // Unbonded found devices from cache
-                setFilter(BluetoothDeviceFilter.UNBONDED_DEVICE_FILTER);
-                setDeviceListGroup(mFoundDevicesCategory);
-                addCachedDevices();
+                // Available devices category
+                if (mAvailableDevicesCategory == null) {
+                    mAvailableDevicesCategory = new ProgressCategory(getActivity(), null);
+                } else {
+                    mAvailableDevicesCategory.removeAll();
+                }
+                addDeviceCategory(mAvailableDevicesCategory,
+                        R.string.bluetooth_preference_found_devices,
+                        BluetoothDeviceFilter.UNBONDED_DEVICE_FILTER);
+                int numberOfAvailableDevices = mAvailableDevicesCategory.getPreferenceCount();
+                mAvailableDevicesCategoryIsPresent = true;
 
-                int numberOfUnpairedDevices = mFoundDevicesCategory.getPreferenceCount();
-                if (numberOfUnpairedDevices == 0) {
-                    preferenceScreen.removePreference(mFoundDevicesCategory);
-                    mFoundDevicesCategoryIsPresent = false;
+                if (numberOfAvailableDevices == 0) {
+                    preferenceScreen.removePreference(mAvailableDevicesCategory);
+                    mAvailableDevicesCategoryIsPresent = false;
                 }
 
-                if (numberOfPairedDevices == 0) startScanning();
-
-                return;
+                if (numberOfPairedDevices == 0) {
+                    preferenceScreen.removePreference(mPairedDevicesCategory);
+                    startScanning();
+                }
+                return; // not break
 
             case BluetoothAdapter.STATE_TURNING_OFF:
                 int preferenceCount = preferenceScreen.getPreferenceCount();
                 for (int i = 0; i < preferenceCount; i++) {
                     preferenceScreen.getPreference(i).setEnabled(false);
                 }
-                return;
+                return; // not break
 
             case BluetoothAdapter.STATE_OFF:
                 messageId = R.string.bluetooth_empty_list_bluetooth_off;
@@ -205,11 +250,7 @@
 
         setDeviceListGroup(preferenceScreen);
         removeAllDevices();
-
-        // TODO: from xml, add top padding. Same as in wifi
-        Preference emptyListPreference = new Preference(getActivity());
-        emptyListPreference.setTitle(messageId);
-        preferenceScreen.addPreference(emptyListPreference);
+        mEmptyView.setText(messageId);
     }
 
     @Override
@@ -250,6 +291,10 @@
         }
     };
 
+    private Preference mMyDevicePreference;
+
+    private PreferenceGroup mPairedDevicesCategory;
+
     /**
      * Add a listener, which enables the advanced settings icon.
      * @param preference the newly added preference
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index 3fd1bef..74400d4 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -56,6 +56,7 @@
 import android.view.ViewGroup;
 import android.widget.AdapterView.AdapterContextMenuInfo;
 import android.widget.Switch;
+import android.widget.TextView;
 import android.widget.Toast;
 
 import com.android.internal.util.AsyncChannel;
@@ -106,6 +107,9 @@
 
     private WifiDialog mDialog;
 
+    private View mView;
+    private TextView mEmptyView;
+
     /* Used in Wifi Setup context */
 
     // this boolean extra specifies whether to disable the Next button when not connected
@@ -149,11 +153,8 @@
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container,
             Bundle savedInstanceState) {
-        if (mInXlSetupWizard) {
-            return inflater.inflate(R.layout.custom_preference_list_fragment, container, false);
-        } else {
-            return super.onCreateView(inflater, container, savedInstanceState);
-        }
+        mView = inflater.inflate(R.layout.custom_preference_list_fragment, container, false);
+        return mView;
     }
 
     @Override
@@ -209,6 +210,9 @@
             mWifiEnabler = new WifiEnabler(activity, actionBarSwitch);
         }
 
+        mEmptyView = (TextView) mView.findViewById(R.id.empty);
+        getListView().setEmptyView(mEmptyView);
+
         registerForContextMenu(getListView());
         setHasOptionsMenu(true);
 
@@ -398,12 +402,11 @@
      * the strength of network and the security for it.
      */
     private void updateAccessPoints() {
-        final PreferenceScreen preferenceScreen = getPreferenceScreen();
-        preferenceScreen.removeAll();
         final int wifiState = mWifiManager.getWifiState();
 
         switch (wifiState) {
             case WifiManager.WIFI_STATE_ENABLED:
+                getPreferenceScreen().removeAll();
                 // AccessPoints are automatically sorted with TreeSet.
                 final Collection<AccessPoint> accessPoints = constructAccessPoints();
                 if (mInXlSetupWizard) {
@@ -416,6 +419,10 @@
                 }
                 break;
 
+            case WifiManager.WIFI_STATE_ENABLING:
+                getPreferenceScreen().removeAll();
+                break;
+
             case WifiManager.WIFI_STATE_DISABLING:
                 addMessagePreference(R.string.wifi_stopping);
                 break;
@@ -427,9 +434,8 @@
     }
 
     private void addMessagePreference(int messageId) {
-        Preference emptyListPreference = new Preference(getActivity());
-        emptyListPreference.setTitle(messageId);
-        getPreferenceScreen().addPreference(emptyListPreference);
+        if (mEmptyView != null) mEmptyView.setText(messageId);
+        getPreferenceScreen().removeAll();
     }
 
     private Collection<AccessPoint> constructAccessPoints() {
@@ -550,15 +556,13 @@
         switch (state) {
             case WifiManager.WIFI_STATE_ENABLED:
                 mScanner.resume();
-                return; // not break, to avoid pause
+                return; // not break, to avoid the call to pause() below
 
             case WifiManager.WIFI_STATE_ENABLING:
-                getPreferenceScreen().removeAll();
                 addMessagePreference(R.string.wifi_starting);
                 break;
 
             case WifiManager.WIFI_STATE_DISABLED:
-                getPreferenceScreen().removeAll();
                 addMessagePreference(R.string.wifi_empty_list_wifi_off);
                 break;
         }