diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 1500d8b..2565914 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -15,6 +15,7 @@
     <uses-permission android:name="android.permission.CALL_PHONE" />
     <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
     <uses-permission android:name="android.permission.MASTER_CLEAR" />
+    <uses-permission android:name="android.permission.USE_CREDENTIALS" />
     <uses-permission android:name="com.google.android.googleapps.permission.GOOGLE_AUTH" />
     <uses-permission android:name="android.permission.ACCESS_DOWNLOAD_MANAGER" />
     <uses-permission android:name="android.permission.READ_CONTACTS" />
@@ -424,7 +425,7 @@
         <activity android:name=".bluetooth.ConnectSpecificProfilesActivity"
                   android:label="@string/bluetooth_connect_specific_profiles_title" />
 
-        <activity android:name=".bluetooth.BluetoothPinDialog"
+        <activity android:name=".bluetooth.BluetoothPairingDialog"
                   android:label="@string/bluetooth_pin_entry"
                   android:theme="@*android:style/Theme.Dialog.Alert">
             <intent-filter>
@@ -433,7 +434,7 @@
             </intent-filter>
         </activity>
 
-        <receiver android:name=".bluetooth.BluetoothPinRequest">
+        <receiver android:name=".bluetooth.BluetoothPairingRequest">
             <intent-filter>
                 <action android:name="android.bluetooth.intent.action.PAIRING_REQUEST" />
                 <action android:name="android.bluetooth.intent.action.PAIRING_CANCEL" />
diff --git a/res/drawable/ic_settings_about.png b/res/drawable/ic_settings_about.png
new file mode 100755
index 0000000..16db056
--- /dev/null
+++ b/res/drawable/ic_settings_about.png
Binary files differ
diff --git a/res/drawable/ic_settings_accessibility.png b/res/drawable/ic_settings_accessibility.png
new file mode 100755
index 0000000..16db056
--- /dev/null
+++ b/res/drawable/ic_settings_accessibility.png
Binary files differ
diff --git a/res/drawable/ic_settings_applications.png b/res/drawable/ic_settings_applications.png
new file mode 100755
index 0000000..16db056
--- /dev/null
+++ b/res/drawable/ic_settings_applications.png
Binary files differ
diff --git a/res/drawable/ic_settings_call.png b/res/drawable/ic_settings_call.png
new file mode 100755
index 0000000..16db056
--- /dev/null
+++ b/res/drawable/ic_settings_call.png
Binary files differ
diff --git a/res/drawable/ic_settings_date_time.png b/res/drawable/ic_settings_date_time.png
new file mode 100755
index 0000000..16db056
--- /dev/null
+++ b/res/drawable/ic_settings_date_time.png
Binary files differ
diff --git a/res/drawable/ic_settings_language.png b/res/drawable/ic_settings_language.png
new file mode 100755
index 0000000..16db056
--- /dev/null
+++ b/res/drawable/ic_settings_language.png
Binary files differ
diff --git a/res/drawable/ic_settings_search.png b/res/drawable/ic_settings_search.png
new file mode 100755
index 0000000..16db056
--- /dev/null
+++ b/res/drawable/ic_settings_search.png
Binary files differ
diff --git a/res/drawable/ic_settings_security.png b/res/drawable/ic_settings_security.png
new file mode 100755
index 0000000..16db056
--- /dev/null
+++ b/res/drawable/ic_settings_security.png
Binary files differ
diff --git a/res/drawable/ic_settings_sound_display.png b/res/drawable/ic_settings_sound_display.png
new file mode 100755
index 0000000..16db056
--- /dev/null
+++ b/res/drawable/ic_settings_sound_display.png
Binary files differ
diff --git a/res/drawable/ic_settings_speech.png b/res/drawable/ic_settings_speech.png
new file mode 100755
index 0000000..16db056
--- /dev/null
+++ b/res/drawable/ic_settings_speech.png
Binary files differ
diff --git a/res/drawable/ic_settings_storage.png b/res/drawable/ic_settings_storage.png
new file mode 100755
index 0000000..16db056
--- /dev/null
+++ b/res/drawable/ic_settings_storage.png
Binary files differ
diff --git a/res/drawable/ic_settings_sync.png b/res/drawable/ic_settings_sync.png
new file mode 100755
index 0000000..16db056
--- /dev/null
+++ b/res/drawable/ic_settings_sync.png
Binary files differ
diff --git a/res/drawable/ic_settings_wireless.png b/res/drawable/ic_settings_wireless.png
new file mode 100755
index 0000000..16db056
--- /dev/null
+++ b/res/drawable/ic_settings_wireless.png
Binary files differ
diff --git a/res/layout/preference_icon.xml b/res/layout/preference_icon.xml
new file mode 100644
index 0000000..d6bce0e
--- /dev/null
+++ b/res/layout/preference_icon.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2006 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.
+-->
+
+<!-- Layout for a Preference in a PreferenceActivity. The
+     Preference is able to place a specific widget for its particular
+     type in the "widget_frame" layout. -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+android:id/widget_frame"
+    android:layout_width="fill_parent"
+    android:layout_height="wrap_content"
+    android:minHeight="?android:attr/listPreferredItemHeight"
+    android:gravity="center_vertical"
+    android:paddingRight="?android:attr/scrollbarSize">
+    
+    <ImageView
+        android:id="@+id/icon"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="12dip"
+        android:layout_marginRight="6dip"
+        android:layout_gravity="center" />
+
+    <RelativeLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="6dip"
+        android:layout_marginRight="6dip"
+        android:layout_marginTop="6dip"
+        android:layout_marginBottom="6dip"
+        android:layout_weight="1">
+    
+        <TextView android:id="@+android:id/title"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:singleLine="true"
+            android:textAppearance="?android:attr/textAppearanceLarge"
+            android:ellipsize="marquee"
+            android:fadingEdge="horizontal" />
+            
+        <TextView android:id="@+android:id/summary"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_below="@android:id/title"
+            android:layout_alignLeft="@android:id/title"
+            android:textAppearance="?android:attr/textAppearanceSmall"
+            android:maxLines="2" />
+
+    </RelativeLayout>
+    
+</LinearLayout>
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 9bf79f9..0a2c5c5 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -18,4 +18,7 @@
     <declare-styleable name="WifiEncryptionState">
         <attr name="state_encrypted" format="boolean" />
     </declare-styleable>
+    <declare-styleable name="IconPreferenceScreen">
+        <attr name="icon" format="reference" />
+    </declare-styleable>
 </resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 5d89800..ed9cc48 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -508,15 +508,20 @@
     <string name="bluetooth_pin_entry">Bluetooth pairing request</string>
     <!-- Title for the bluetooth device info screen. -->
     <string name="bluetooth_device_info">Bluetooth device info</string>
-    <!-- Message when bluetooth dialog for pin entry is shwoing -->
+    <!-- Message when bluetooth dialog for pin entry is showing -->
     <string name="bluetooth_enter_pin_msg"><xliff:g id="device_name">%1$s</xliff:g>\n\nType PIN to pair.\n(Try 0000 or 1234.)</string>
+    <!-- Message when bluetooth dialog for passkey entry is showing -->
+    <string name="bluetooth_enter_passkey_msg"><xliff:g id="device_name">%1$s</xliff:g>\n\nType passkey to pair.\n</string>
+    <!-- Message when bluetooth dialog for confirmation of passkey is showing -->
+    <string name="bluetooth_confirm_passkey_msg">\n Passkey: <xliff:g id="passkey">%2$d</xliff:g>\n\nIs the same passkey displayed on: <xliff:g id="device_name">%1$s</xliff:g> ?\n</string>
 
     <!-- Title for BT error dialogs. -->
     <string name="bluetooth_error_title">Attention</string>
     <!-- Message for the error dialog when BT pairing fails generically. -->
     <string name="bluetooth_pairing_error_message">There was a problem pairing with <xliff:g id="device_name">%1$s</xliff:g>.</string> 
-    <!-- Message for the error dialog when BT pairing fails because the PIN entered is incorrect. -->
-    <string name="bluetooth_pairing_pin_error_message">There was a problem pairing with <xliff:g id="device_name">%1$s</xliff:g> because the typed PIN is incorrect.</string> 
+    <!-- Message for the error dialog when BT pairing fails because the PIN /
+    Passkey entered is incorrect. -->
+    <string name="bluetooth_pairing_pin_error_message">There was a problem pairing with <xliff:g id="device_name">%1$s</xliff:g> because the typed PIN or Passkey is incorrect.</string>
     <!-- Message for the error dialog when BT pairing fails because the other device is down. -->
     <string name="bluetooth_pairing_device_down_error_message">Cannot establish communication with <xliff:g id="device_name">%1$s</xliff:g>.</string>
     <!-- Message for the error dialog when BT pairing fails because the other device rejected the pairing. -->
@@ -856,10 +861,10 @@
     <!-- Sound settings screen, setting option summary text when check box is clear -->
     <string name="play_media_notification_sounds_enable_summary_off">Play sound for SD card notifications</string>
 
-    <!-- Main Settings screen setting option name to go into the screen for data sync settings-->
-    <string name="sync_settings">Data synchronization</string>
+    <!-- Acounts & Sync settings screen setting option name to go into the screen for data sync settings-->
+    <string name="sync_settings">Accounts &amp; synchronization</string>
     <!-- Main Settings screen setting option summary text for the itme to go into the screen with data sync settings-->
-    <string name="sync_settings_summary">Select which applications are synchronized</string>
+    <string name="sync_settings_summary">Add or remove accounts and change account settings</string>
 
     <!-- Main Settings screen, setting option name to go into search settings -->
     <string name="search_settings">Search</string>
@@ -1142,6 +1147,12 @@
     <string name="location_street_level">When locating, accurate to street level (deselect to conserve battery)</string>
     <!-- Security & location settings screen, setting summary when Enable GPS satellites check box is clear -->
     <string name="location_gps_disabled">Locate to street-level (requires more battery plus view of sky)</string>
+    <!-- Security & location settings screen, setting check box label if Assisted GPS should be enabled -->
+    <string name="assisted_gps">Enable assisted GPS</string>
+    <!-- Security & location settings screen, setting summary when Assisted GPS check box is selected -->
+    <string name="assisted_gps_enabled">Use server to assist GPS (deselect to reduce network usage)</string>
+    <!-- Security & location settings screen, setting summary when Assisted GPS check box is clear -->
+    <string name="assisted_gps_disabled">Use server to assist GPS (select to improve GPS performance)</string>
     <!-- Setting title for allow sending location to google -->
     <string name="use_location_title">Share with Google</string>
     <!-- Title of dialog to user requesting use of location information to improve services -->
@@ -1372,7 +1383,7 @@
     <string name="computing_size">Computing\u2026</string>
     <string name="invalid_size_value">Unable to compute package size</string>
     <!-- String displayed when list is empty -->
-    <string name="empty_list_msg">You do not have any third-party apps installed.</string>
+    <string name="empty_list_msg">You do not have any third-party applications installed.</string>
     <!-- Manage applications, version string displayed in app snippet -->
     <string name="version_text">version <xliff:g id="version_num">%1$s</xliff:g></string>
 
@@ -1811,6 +1822,8 @@
 
     <!-- Power Control Widget -->
     <string name="gadget_title">Power Control</string>
+    <string name="gadget_toggle_wifi">Updating Wi-Fi setting</string>
+    <string name="gadget_toggle_bluetooth">Updating Bluetooth setting</string>
 
     <string name="vpn_settings_activity_title">VPN settings</string>
 
@@ -1847,6 +1860,7 @@
     <string name="vpn_confirm_add_profile_cancellation">Are you sure you don\'t want to create this profile?</string>
     <string name="vpn_confirm_edit_profile_cancellation">Are you sure you want to discard the changes made to this profile?</string>
     <string name="vpn_confirm_reconnect">Unable to connect to the network. Do you want to try again?</string>
+    <string name="vpn_reconnect_from_lost">Connection lost. Do you want to connect again?</string>
     <string name="vpn_unknown_server_dialog_msg">Server name cannot be resolved. Do you want to check your server name setting?</string>
     <string name="vpn_challenge_error_dialog_msg">Challenge error. Do you want to check your secret setting?</string>
     <string name="vpn_secret_not_set_dialog_msg">One or more secrets are missing in this VPN configuration. Do you want to check your secret setting?</string>
diff --git a/res/xml/security_settings.xml b/res/xml/security_settings.xml
index 8dd9d89..5b90dba 100644
--- a/res/xml/security_settings.xml
+++ b/res/xml/security_settings.xml
@@ -33,6 +33,12 @@
             android:summaryOff="@string/location_gps_disabled"/>
 
         <CheckBoxPreference
+            android:key="assisted_gps"
+            android:title="@string/assisted_gps"
+            android:summaryOn="@string/assisted_gps_enabled"
+            android:summaryOff="@string/assisted_gps_disabled"/>
+
+        <CheckBoxPreference
             android:key="use_location"
             android:title="@string/use_location_title"
             android:persistent="false"
diff --git a/res/xml/settings.xml b/res/xml/settings.xml
index 9ca581a..4e2177e 100644
--- a/res/xml/settings.xml
+++ b/res/xml/settings.xml
@@ -16,64 +16,71 @@
 
 <PreferenceScreen
     xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
     android:title="@string/settings_label"
     android:key="parent">
-            
-        <PreferenceScreen
+
+        <com.android.settings.IconPreferenceScreen
             android:title="@string/radio_controls_title"
+            settings:icon="@drawable/ic_settings_wireless"
             android:summary="@string/radio_controls_summary">
             <intent
                 android:action="android.intent.action.MAIN"
                 android:targetPackage="com.android.settings"
                 android:targetClass="com.android.settings.WirelessSettings" />
-        </PreferenceScreen>
+        </com.android.settings.IconPreferenceScreen>
 
-        <PreferenceScreen
+        <com.android.settings.IconPreferenceScreen
             android:key="call_settings"
+            settings:icon="@drawable/ic_settings_call"
             android:title="@string/call_settings_title"
             android:summary="@string/call_settings_summary">
             <intent
                 android:action="android.intent.action.MAIN"
                 android:targetPackage="com.android.phone"
                 android:targetClass="com.android.phone.CallFeaturesSetting" />
-        </PreferenceScreen>
+        </com.android.settings.IconPreferenceScreen>
 
         <!-- Sound and Display -->
-        
-        <PreferenceScreen
+
+        <com.android.settings.IconPreferenceScreen
+            settings:icon="@drawable/ic_settings_sound_display"
             android:title="@string/sound_and_display_settings"
             android:summary="@string/sound_and_display_settings_summary">
             <intent
                 android:action="android.intent.action.MAIN"
                 android:targetPackage="com.android.settings"
                 android:targetClass="com.android.settings.SoundAndDisplaySettings" />
-        </PreferenceScreen>
+        </com.android.settings.IconPreferenceScreen>
 
         <!-- Data Sync. The settings activity will ensure this is resolved to an
              activity on the system image, otherwise it will remove this
              preference. -->
-        
-        <PreferenceScreen
+
+        <com.android.settings.IconPreferenceScreen
+            settings:icon="@drawable/ic_settings_sync"
             android:title="@string/sync_settings"
             android:summary="@string/sync_settings_summary"
             android:key="sync_settings">
             <intent android:action="android.settings.SYNC_SETTINGS" />
-        </PreferenceScreen>
+        </com.android.settings.IconPreferenceScreen>
 
         <!-- Security & Privacy -->
-        
-        <PreferenceScreen
+
+        <com.android.settings.IconPreferenceScreen
+            settings:icon="@drawable/ic_settings_security"
             android:title="@string/security_settings_title"
             android:summary="@string/security_settings_summary">
             <intent
                 android:action="android.intent.action.MAIN"
                 android:targetPackage="com.android.settings"
                 android:targetClass="com.android.settings.SecuritySettings" />
-        </PreferenceScreen>
+        </com.android.settings.IconPreferenceScreen>
 
         <!-- Application Settings -->
-        
-        <PreferenceScreen
+
+        <com.android.settings.IconPreferenceScreen
+            settings:icon="@drawable/ic_settings_applications"
             android:title="@string/applications_settings"
             android:summary="@string/applications_settings_summary"
             android:key="applications_settings">
@@ -81,39 +88,42 @@
                 android:action="android.intent.action.MAIN"
                 android:targetPackage="com.android.settings"
                 android:targetClass="com.android.settings.ApplicationSettings" />
-        </PreferenceScreen>
+        </com.android.settings.IconPreferenceScreen>
 
         <!-- Storage -->
-        
-        <PreferenceScreen 
+
+        <com.android.settings.IconPreferenceScreen 
+            settings:icon="@drawable/ic_settings_storage"
             android:title="@string/storage_settings_title" 
             android:summary="@string/storage_settings_summary">
             <intent android:action="android.intent.action.MAIN"
                 android:targetPackage="com.android.settings"
                 android:targetClass="com.android.settings.deviceinfo.Memory" />
-        </PreferenceScreen>
+        </com.android.settings.IconPreferenceScreen>
 
         <!-- Date & Time -->
-        
-        <PreferenceScreen
+
+        <com.android.settings.IconPreferenceScreen
+            settings:icon="@drawable/ic_settings_date_time"
             android:title="@string/date_and_time_settings_title"
             android:summary="@string/date_and_time_settings_summary">
             <intent
                 android:action="android.intent.action.MAIN"
                 android:targetPackage="com.android.settings"
                 android:targetClass="com.android.settings.DateTimeSettings" />
-        </PreferenceScreen>
+        </com.android.settings.IconPreferenceScreen>
 
         <!-- Language -->
 
-        <PreferenceScreen
+        <com.android.settings.IconPreferenceScreen
+            settings:icon="@drawable/ic_settings_language"
             android:title="@string/language_settings"
             android:summary="@string/language_settings_summary">
             <intent
                 android:action="android.intent.action.MAIN"
                 android:targetPackage="com.android.settings"
                 android:targetClass="com.android.settings.LanguageSettings" />
-        </PreferenceScreen>
+        </com.android.settings.IconPreferenceScreen>
 
         <!-- Search. 
              The settings activity will ensure that this is resolved to an
@@ -123,44 +133,48 @@
              android.app.SearchManager.INTENT_ACTION_SEARCH_SETTINGS.
              -->
 
-        <PreferenceScreen
+        <com.android.settings.IconPreferenceScreen
+            settings:icon="@drawable/ic_settings_search"
             android:title="@string/search_settings"
             android:summary="@string/search_settings_summary"
             android:key="search_settings">
             <intent android:action="android.search.action.SEARCH_SETTINGS" />
-        </PreferenceScreen>
+        </com.android.settings.IconPreferenceScreen>
 
         <!-- Accessibility feedback -->
 
-        <PreferenceScreen
+        <com.android.settings.IconPreferenceScreen
+            settings:icon="@drawable/ic_settings_accessibility"
             android:title="@string/accessibility_settings_title"
             android:summary="@string/accessibility_settings_summary">
             <intent
                 android:action="android.intent.action.MAIN"
                 android:targetPackage="com.android.settings"
                 android:targetClass="com.android.settings.AccessibilitySettings" />
-        </PreferenceScreen>
+        </com.android.settings.IconPreferenceScreen>
 
         <!-- Text-To-Speech -->
-        
-        <PreferenceScreen
+
+        <com.android.settings.IconPreferenceScreen
+            settings:icon="@drawable/ic_settings_speech"
             android:title="@string/tts_settings"
             android:summary="@string/tts_settings_summary">
             <intent
                 android:action="android.intent.action.MAIN"
                 android:targetPackage="com.android.settings"
                 android:targetClass="com.android.settings.TextToSpeechSettings" />
-        </PreferenceScreen>
+        </com.android.settings.IconPreferenceScreen>
 
         <!-- About Device -->
- 
-        <PreferenceScreen
+
+        <com.android.settings.IconPreferenceScreen
+            settings:icon="@drawable/ic_settings_about"
             android:title="@string/about_settings"
             android:summary="@string/about_settings_summary">
             <intent
                 android:action="android.intent.action.MAIN"
                 android:targetPackage="com.android.settings"
                 android:targetClass="com.android.settings.DeviceInfoSettings" />
-        </PreferenceScreen>
+        </com.android.settings.IconPreferenceScreen>
 
 </PreferenceScreen>
diff --git a/res/xml/wireless_settings.xml b/res/xml/wireless_settings.xml
index 4731fb3..de62687 100644
--- a/res/xml/wireless_settings.xml
+++ b/res/xml/wireless_settings.xml
@@ -22,13 +22,12 @@
                     android:key="toggle_wifi"
                     android:title="@string/wifi_quick_toggle_title"
                     android:summary="@string/wifi_quick_toggle_summary"
-                    android:persistent="false"
-                    android:dependency="toggle_airplane" />
+                    android:persistent="false" />
 
                 <PreferenceScreen
+                    android:key="wifi_settings"
                     android:title="@string/wifi_settings"
-                    android:summary="@string/wifi_settings_summary"
-                    android:dependency="toggle_airplane">
+                    android:summary="@string/wifi_settings_summary" >
                     <intent
                         android:action="android.intent.action.MAIN"
                         android:targetPackage="com.android.settings"
@@ -53,9 +52,9 @@
                 </PreferenceScreen>
 
                 <PreferenceScreen
+                    android:key="vpn_settings"
                     android:title="@string/vpn_settings_title"
-                    android:summary="@string/vpn_settings_summary"
-                    android:dependency="toggle_airplane">
+                    android:summary="@string/vpn_settings_summary" >
                     <intent
                         android:action="android.intent.action.MAIN"
                         android:targetPackage="com.android.settings"
diff --git a/src/com/android/settings/AirplaneModeEnabler.java b/src/com/android/settings/AirplaneModeEnabler.java
index f105712..45411b2 100644
--- a/src/com/android/settings/AirplaneModeEnabler.java
+++ b/src/com/android/settings/AirplaneModeEnabler.java
@@ -74,7 +74,7 @@
         mCheckBoxPref.setOnPreferenceChangeListener(null);
     }
     
-    static boolean isAirplaneModeOn(Context context) {
+    public static boolean isAirplaneModeOn(Context context) {
         return Settings.System.getInt(context.getContentResolver(),
                 Settings.System.AIRPLANE_MODE_ON, 0) != 0;
     }
diff --git a/src/com/android/settings/ApnPreference.java b/src/com/android/settings/ApnPreference.java
index 74fb902..710eda2 100644
--- a/src/com/android/settings/ApnPreference.java
+++ b/src/com/android/settings/ApnPreference.java
@@ -107,7 +107,7 @@
         return getKey().equals(mSelectedKey);
     }
 
-    public void setChecked(boolean checked) {
+    public void setChecked() {
         mSelectedKey = getKey();
     }
 
diff --git a/src/com/android/settings/ApnSettings.java b/src/com/android/settings/ApnSettings.java
index 2624990..00ef3a7 100644
--- a/src/com/android/settings/ApnSettings.java
+++ b/src/com/android/settings/ApnSettings.java
@@ -178,7 +178,7 @@
             pref.setSelectable(selectable);
             if (selectable) {
                 if ((mSelectedKey != null) && mSelectedKey.equals(key)) {
-                    pref.setChecked(true);
+                    pref.setChecked();
                 }
                 apnList.addPreference(pref);
             } else {
diff --git a/src/com/android/settings/BandMode.java b/src/com/android/settings/BandMode.java
index 1297cad..a8c7833 100644
--- a/src/com/android/settings/BandMode.java
+++ b/src/com/android/settings/BandMode.java
@@ -97,7 +97,7 @@
                 }
             };
 
-    private class BandListItem {
+    static private class BandListItem {
         private int mBandMode = Phone.BM_UNSPECIFIED;
 
         public BandListItem(int bm) {
diff --git a/src/com/android/settings/BatteryInfo.java b/src/com/android/settings/BatteryInfo.java
index eb7ddb4..4c25570 100644
--- a/src/com/android/settings/BatteryInfo.java
+++ b/src/com/android/settings/BatteryInfo.java
@@ -67,7 +67,7 @@
      */
     private final String tenthsToFixedString(int x) {
         int tens = x / 10;
-        return new String("" + tens + "." + (x - 10*tens));
+        return Integer.toString(tens) + "." + (x - 10 * tens);
     }
 
    /**
diff --git a/src/com/android/settings/IconPreferenceScreen.java b/src/com/android/settings/IconPreferenceScreen.java
new file mode 100644
index 0000000..c7c5303
--- /dev/null
+++ b/src/com/android/settings/IconPreferenceScreen.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.graphics.drawable.Drawable;
+import android.preference.Preference;
+import android.util.AttributeSet;
+import android.view.View;
+import android.widget.ImageView;
+
+public class IconPreferenceScreen extends Preference {
+
+    private Drawable mIcon;
+
+    public IconPreferenceScreen(Context context, AttributeSet attrs) {
+        this(context, attrs, 0);
+    }
+
+    public IconPreferenceScreen(Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+        setLayoutResource(R.layout.preference_icon);
+        TypedArray a = context.obtainStyledAttributes(attrs,
+                R.styleable.IconPreferenceScreen, defStyle, 0);
+        mIcon = a.getDrawable(R.styleable.IconPreferenceScreen_icon);
+    }
+
+    @Override
+    public void onBindView(View view) {
+        super.onBindView(view);
+        ImageView imageView = (ImageView) view.findViewById(R.id.icon);
+        if (imageView != null && mIcon != null) {
+            imageView.setImageDrawable(mIcon);
+        }
+    }
+}
diff --git a/src/com/android/settings/LanguageSettings.java b/src/com/android/settings/LanguageSettings.java
index cbab390..4b805ed 100644
--- a/src/com/android/settings/LanguageSettings.java
+++ b/src/com/android/settings/LanguageSettings.java
@@ -54,8 +54,6 @@
     private String mLastInputMethodId;
     private String mLastTickedInputMethodId;
     
-    private String mRootDirectory;
-
     static public String getInputMethodIdFromKey(String key) {
         return key;
     }
diff --git a/src/com/android/settings/ManageApplications.java b/src/com/android/settings/ManageApplications.java
index 0d4895e..d352544 100644
--- a/src/com/android/settings/ManageApplications.java
+++ b/src/com/android/settings/ManageApplications.java
@@ -760,7 +760,7 @@
     
     // internal structure used to track added and deleted packages when
     // the activity has focus
-    class AddRemoveInfo {
+    static class AddRemoveInfo {
         String pkgName;
         boolean add;
         public AddRemoveInfo(String pPkgName, boolean pAdd) {
diff --git a/src/com/android/settings/RadioInfo.java b/src/com/android/settings/RadioInfo.java
index 257122b..27d8c7e 100644
--- a/src/com/android/settings/RadioInfo.java
+++ b/src/com/android/settings/RadioInfo.java
@@ -256,21 +256,21 @@
         }
     };
 
-    private class OemCommands {
+    static private class OemCommands {
 
-        public  final int OEM_QXDM_SDLOG_DEFAULT_FILE_SIZE = 32;
-        public  final int OEM_QXDM_SDLOG_DEFAULT_MASK = 0;
-        public  final int OEM_QXDM_SDLOG_DEFAULT_MAX_INDEX = 8;
+        public static final int OEM_QXDM_SDLOG_DEFAULT_FILE_SIZE = 32;
+        public static final int OEM_QXDM_SDLOG_DEFAULT_MASK = 0;
+        public static final int OEM_QXDM_SDLOG_DEFAULT_MAX_INDEX = 8;
 
-        final int SIZE_OF_INT = 4;
-        final int OEM_FEATURE_ENABLE = 1;
-        final int OEM_FEATURE_DISABLE = 0;
-        final int OEM_SIMPE_FEAUTURE_LEN = 1;
+        static final int SIZE_OF_INT = 4;
+        static final int OEM_FEATURE_ENABLE = 1;
+        static final int OEM_FEATURE_DISABLE = 0;
+        static final int OEM_SIMPE_FEAUTURE_LEN = 1;
 
-        final int OEM_QXDM_SDLOG_FUNCTAG = 0x00010000;
-        final int OEM_QXDM_SDLOG_LEN = 4;
-        final int OEM_PS_AUTO_ATTACH_FUNCTAG = 0x00020000;
-        final int OEM_CIPHERING_FUNCTAG = 0x00020001;
+        static final int OEM_QXDM_SDLOG_FUNCTAG = 0x00010000;
+        static final int OEM_QXDM_SDLOG_LEN = 4;
+        static final int OEM_PS_AUTO_ATTACH_FUNCTAG = 0x00020000;
+        static final int OEM_CIPHERING_FUNCTAG = 0x00020001;
         
         /**
          * The OEM interface to store QXDM to SD.
@@ -958,8 +958,7 @@
     private void displayQxdmEnableResult() {
         String status = mQxdmLogEnabled ? "Start QXDM Log" : "Stop QXDM Log";
 
-        DialogInterface mProgressPanel = new AlertDialog.
-                Builder(this).setMessage(status).show();
+        new AlertDialog.Builder(this).setMessage(status).show();
 
         mHandler.postDelayed(
                 new Runnable() {
diff --git a/src/com/android/settings/SdCardSettings.java b/src/com/android/settings/SdCardSettings.java
index 637babe..67f3550 100644
--- a/src/com/android/settings/SdCardSettings.java
+++ b/src/com/android/settings/SdCardSettings.java
@@ -108,48 +108,41 @@
         } catch (RemoteException ex) {
         }
 
-        String scanVolume = null; // this no longer exists: SystemProperties.get(MediaScanner.CURRENT_VOLUME_PROPERTY, "");
-        boolean scanning = "external".equals(scanVolume);
+        String status = Environment.getExternalStorageState();
+        boolean readOnly = false;
 
-        if (scanning) {
-            setLayout(mScanningLayout);
-        } else {
-            String status = Environment.getExternalStorageState();
-            boolean readOnly = false;
+        if (status.equals(Environment.MEDIA_MOUNTED_READ_ONLY)) {
+            status = Environment.MEDIA_MOUNTED;
+            readOnly = true;
+        }
 
-            if (status.equals(Environment.MEDIA_MOUNTED_READ_ONLY)) {
-                status = Environment.MEDIA_MOUNTED;
-                readOnly = true;
+        if (status.equals(Environment.MEDIA_MOUNTED)) {
+            try {
+                File path = Environment.getExternalStorageDirectory();
+                StatFs stat = new StatFs(path.getPath());
+                long blockSize = stat.getBlockSize();
+                long totalBlocks = stat.getBlockCount();
+                long availableBlocks = stat.getAvailableBlocks();
+
+                mTotalSize.setText(formatSize(totalBlocks * blockSize));
+                mUsedSize.setText(formatSize((totalBlocks - availableBlocks) * blockSize));
+                mAvailableSize.setText(formatSize(availableBlocks * blockSize));
+            } catch (IllegalArgumentException e) {
+                // this can occur if the SD card is removed, but we haven't received the
+                // ACTION_MEDIA_REMOVED Intent yet.
+                status = Environment.MEDIA_REMOVED;
             }
 
-            if (status.equals(Environment.MEDIA_MOUNTED)) {
-                try {
-                    File path = Environment.getExternalStorageDirectory();
-                    StatFs stat = new StatFs(path.getPath());
-                    long blockSize = stat.getBlockSize();
-                    long totalBlocks = stat.getBlockCount();
-                    long availableBlocks = stat.getAvailableBlocks();
-
-                    mTotalSize.setText(formatSize(totalBlocks * blockSize));
-                    mUsedSize.setText(formatSize((totalBlocks - availableBlocks) * blockSize));
-                    mAvailableSize.setText(formatSize(availableBlocks * blockSize));
-                } catch (IllegalArgumentException e) {
-                    // this can occur if the SD card is removed, but we haven't received the
-                    // ACTION_MEDIA_REMOVED Intent yet.
-                    status = Environment.MEDIA_REMOVED;
-                }
-
-                mReadOnlyStatus.setVisibility(readOnly ? View.VISIBLE : View.GONE);
-                setLayout(mMountedLayout);
-            } else if (status.equals(Environment.MEDIA_UNMOUNTED)) {
-                setLayout(mUnmountedLayout);
-            } else if (status.equals(Environment.MEDIA_REMOVED)) {
-                setLayout(mRemovedLayout);
-            } else if (status.equals(Environment.MEDIA_SHARED)) {
-                setLayout(mSharedLayout);
-            } else if (status.equals(Environment.MEDIA_BAD_REMOVAL)) {
-                setLayout(mBadRemovalLayout);
-            }
+            mReadOnlyStatus.setVisibility(readOnly ? View.VISIBLE : View.GONE);
+            setLayout(mMountedLayout);
+        } else if (status.equals(Environment.MEDIA_UNMOUNTED)) {
+            setLayout(mUnmountedLayout);
+        } else if (status.equals(Environment.MEDIA_REMOVED)) {
+            setLayout(mRemovedLayout);
+        } else if (status.equals(Environment.MEDIA_SHARED)) {
+            setLayout(mSharedLayout);
+        } else if (status.equals(Environment.MEDIA_BAD_REMOVAL)) {
+            setLayout(mBadRemovalLayout);
         }
     }
 
@@ -191,8 +184,6 @@
         }
     };
 
-
-    private int         mStatus;
     private IMountService   mMountService;
 
     private CheckBox    mMassStorage;
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index 5a5804e..e181e6e 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -80,6 +80,7 @@
     private static final String LOCATION_CATEGORY = "location_category";
     private static final String LOCATION_NETWORK = "location_network";
     private static final String LOCATION_GPS = "location_gps";
+    private static final String ASSISTED_GPS = "assisted_gps";
 
     // Credential storage
     public static final String ACTION_ADD_CREDENTIAL =
@@ -110,6 +111,7 @@
 
     private CheckBoxPreference mNetwork;
     private CheckBoxPreference mGps;
+    private CheckBoxPreference mAssistedGps;
 
     // These provide support for receiving notification when Location Manager settings change.
     // This is necessary because the Network Location Provider can change settings
@@ -132,6 +134,7 @@
 
         mNetwork = (CheckBoxPreference) getPreferenceScreen().findPreference(LOCATION_NETWORK);
         mGps = (CheckBoxPreference) getPreferenceScreen().findPreference(LOCATION_GPS);
+        mAssistedGps = (CheckBoxPreference) getPreferenceScreen().findPreference(ASSISTED_GPS);
         mUseLocation = (CheckBoxPreference) getPreferenceScreen().findPreference(USE_LOCATION);
 
         // Vendor specific
@@ -233,9 +236,10 @@
         PreferenceCategory credStoreCat = new PreferenceCategory(this);
         credStoreCat.setTitle(R.string.cstor_settings_category);
         root.addPreference(credStoreCat);
-        credStoreCat.addPreference(mCstorHelper.createAccessCheckBox());
+        int s = mCstorHelper.getCstorState();
+        credStoreCat.addPreference(mCstorHelper.createAccessCheckBox(s));
         credStoreCat.addPreference(mCstorHelper.createSetPasswordPreference());
-        credStoreCat.addPreference(mCstorHelper.createResetPreference());
+        credStoreCat.addPreference(mCstorHelper.createResetPreference(s));
 
         return root;
     }
@@ -298,8 +302,13 @@
             Settings.Secure.setLocationProviderEnabled(getContentResolver(),
                     LocationManager.NETWORK_PROVIDER, mNetwork.isChecked());
         } else if (preference == mGps) {
+            boolean enabled = mGps.isChecked();
             Settings.Secure.setLocationProviderEnabled(getContentResolver(),
-                    LocationManager.GPS_PROVIDER, mGps.isChecked());
+                    LocationManager.GPS_PROVIDER, enabled);
+            mAssistedGps.setEnabled(enabled);
+        } else if (preference == mAssistedGps) {
+            Settings.Secure.putInt(getContentResolver(), Settings.Secure.ASSISTED_GPS_ENABLED,
+                    mAssistedGps.isChecked() ? 1 : 0);
         } else if (preference == mUseLocation) {
             //normally called on the toggle click
             if (mUseLocation.isChecked()) {
@@ -341,10 +350,14 @@
      */
     private void updateToggles() {
         ContentResolver res = getContentResolver();
+        boolean gpsEnabled = Settings.Secure.isLocationProviderEnabled(
+                res, LocationManager.GPS_PROVIDER);
         mNetwork.setChecked(Settings.Secure.isLocationProviderEnabled(
                 res, LocationManager.NETWORK_PROVIDER));
-        mGps.setChecked(Settings.Secure.isLocationProviderEnabled(
-                res, LocationManager.GPS_PROVIDER));
+        mGps.setChecked(gpsEnabled);
+        mAssistedGps.setChecked(Settings.Secure.getInt(res,
+                Settings.Secure.ASSISTED_GPS_ENABLED, 2) == 1);
+        mAssistedGps.setEnabled(gpsEnabled);
         mUseLocation.setChecked(Settings.Secure.getInt(res,
                 Settings.Secure.USE_LOCATION_FOR_SERVICES, 2) == 1);
     }
@@ -485,6 +498,10 @@
             }
         }
 
+        private int getCstorState() {
+            return mKeystore.getState();
+        }
+
         private boolean isCstorUnlocked() {
             return (mKeystore.getState() == Keystore.UNLOCKED);
         }
@@ -793,27 +810,25 @@
             mResetButton.setEnabled(enabled);
         }
 
-        private Preference createAccessCheckBox() {
+        private Preference createAccessCheckBox(int state) {
             CheckBoxPreference pref = new CheckBoxPreference(
                     SecuritySettings.this);
             pref.setTitle(R.string.cstor_access_title);
             pref.setSummary(R.string.cstor_access_summary);
-            pref.setChecked(isCstorUnlocked());
+            pref.setEnabled(state != Keystore.UNINITIALIZED);
+            pref.setChecked(state == Keystore.UNLOCKED);
             pref.setOnPreferenceChangeListener(
                     new Preference.OnPreferenceChangeListener() {
                         public boolean onPreferenceChange(
                                 Preference pref, Object value) {
                             if (((Boolean) value)) {
-                                showCstorDialog(isCstorInitialized()
-                                        ? CSTOR_UNLOCK_DIALOG
-                                        : CSTOR_INIT_DIALOG);
+                                showCstorDialog(CSTOR_UNLOCK_DIALOG);
                             } else {
                                 lockCstor();
                             }
                             return true;
                         }
                     });
-            pref.setEnabled(isCstorInitialized());
             mAccessCheckBox = pref;
             return pref;
         }
@@ -834,7 +849,7 @@
             return pref;
         }
 
-        private Preference createResetPreference() {
+        private Preference createResetPreference(int state) {
             Preference pref = new Preference(SecuritySettings.this);
             pref.setTitle(R.string.cstor_reset_title);
             pref.setSummary(R.string.cstor_reset_summary);
@@ -845,7 +860,7 @@
                             return true;
                         }
                     });
-            pref.setEnabled(isCstorInitialized());
+            pref.setEnabled(state != Keystore.UNINITIALIZED);
             mResetButton = pref;
             return pref;
         }
diff --git a/src/com/android/settings/UsageStats.java b/src/com/android/settings/UsageStats.java
index 89caa54..fcb6990 100755
--- a/src/com/android/settings/UsageStats.java
+++ b/src/com/android/settings/UsageStats.java
@@ -187,7 +187,7 @@
                 holder.launchCount.setText(String.valueOf(pkgStats.launchCount));
                 holder.usageTime.setText(String.valueOf(pkgStats.usageTime)+" ms");
             } else {
-                Log.w(TAG, "No usage stats info for package:"+pkgStats.packageName);
+                Log.w(TAG, "No usage stats info for package:" + position);
             }
             return convertView;
         }
diff --git a/src/com/android/settings/WirelessSettings.java b/src/com/android/settings/WirelessSettings.java
index d112915..f160bac 100644
--- a/src/com/android/settings/WirelessSettings.java
+++ b/src/com/android/settings/WirelessSettings.java
@@ -21,14 +21,18 @@
 
 import android.net.wifi.WifiManager;
 import android.os.Bundle;
-import android.preference.PreferenceActivity;
 import android.preference.CheckBoxPreference;
+import android.preference.Preference;
+import android.preference.PreferenceActivity;
+import android.provider.Settings;
 
 public class WirelessSettings extends PreferenceActivity {
 
     private static final String KEY_TOGGLE_AIRPLANE = "toggle_airplane";
     private static final String KEY_TOGGLE_BLUETOOTH = "toggle_bluetooth";
     private static final String KEY_TOGGLE_WIFI = "toggle_wifi";
+    private static final String KEY_WIFI_SETTINGS = "wifi_settings";
+    private static final String KEY_VPN_SETTINGS = "vpn_settings";
 
     private WifiEnabler mWifiEnabler;
     private AirplaneModeEnabler mAirplaneModeEnabler;
@@ -63,18 +67,27 @@
     
     private void initToggles() {
         
+        Preference airplanePreference = findPreference(KEY_TOGGLE_AIRPLANE);
+        Preference wifiPreference = findPreference(KEY_TOGGLE_WIFI);
+        Preference btPreference = findPreference(KEY_TOGGLE_BLUETOOTH);
+        Preference wifiSettings = findPreference(KEY_WIFI_SETTINGS);
+        Preference vpnSettings = findPreference(KEY_VPN_SETTINGS);
+
         mWifiEnabler = new WifiEnabler(
-                this,
-                (WifiManager) getSystemService(WIFI_SERVICE),
-                (CheckBoxPreference) findPreference(KEY_TOGGLE_WIFI));
-        
+                this, (WifiManager) getSystemService(WIFI_SERVICE),
+                (CheckBoxPreference) wifiPreference);
         mAirplaneModeEnabler = new AirplaneModeEnabler(
-                this,
-                (CheckBoxPreference) findPreference(KEY_TOGGLE_AIRPLANE));
-        
-        mBtEnabler = new BluetoothEnabler(
-                this,
-                (CheckBoxPreference) findPreference(KEY_TOGGLE_BLUETOOTH));
+                this, (CheckBoxPreference) airplanePreference);
+        mBtEnabler = new BluetoothEnabler(this, (CheckBoxPreference) btPreference);
+
+        // manually set up dependencies for Wifi if its radio is not toggleable in airplane mode
+        String toggleableRadios = Settings.System.getString(getContentResolver(),
+                Settings.System.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
+        if (toggleableRadios == null || !toggleableRadios.contains(Settings.System.RADIO_WIFI)) {
+            wifiPreference.setDependency(airplanePreference.getKey());
+            wifiSettings.setDependency(airplanePreference.getKey());
+            vpnSettings.setDependency(airplanePreference.getKey());
+        }
     }
-    
+
 }
diff --git a/src/com/android/settings/ZoneList.java b/src/com/android/settings/ZoneList.java
index 2877f00..aaaf989 100644
--- a/src/com/android/settings/ZoneList.java
+++ b/src/com/android/settings/ZoneList.java
@@ -160,7 +160,7 @@
         try {
             XmlResourceParser xrp = getResources().getXml(R.xml.timezones);
             while (xrp.next() != XmlResourceParser.START_TAG)
-                ;
+                continue;
             xrp.next();
             while (xrp.getEventType() != XmlResourceParser.END_TAG) {
                 while (xrp.getEventType() != XmlResourceParser.START_TAG) {
diff --git a/src/com/android/settings/bluetooth/BluetoothDevicePreference.java b/src/com/android/settings/bluetooth/BluetoothDevicePreference.java
index 7053ff5..a49ea75 100644
--- a/src/com/android/settings/bluetooth/BluetoothDevicePreference.java
+++ b/src/com/android/settings/bluetooth/BluetoothDevicePreference.java
@@ -102,11 +102,11 @@
 
     @Override
     protected void onBindView(View view) {
-        super.onBindView(view);
-
         // Disable this view if the bluetooth enable/disable preference view is off
         setDependency("bt_checkbox");
 
+        super.onBindView(view);
+
         ImageView btClass = (ImageView) view.findViewById(R.id.btClass);
         btClass.setImageResource(mLocalDevice.getBtClassDrawable());
         btClass.setAlpha(isEnabled() ? 255 : sDimAlpha);        
diff --git a/src/com/android/settings/bluetooth/BluetoothDiscoverableEnabler.java b/src/com/android/settings/bluetooth/BluetoothDiscoverableEnabler.java
index 58fb569..665fba4 100644
--- a/src/com/android/settings/bluetooth/BluetoothDiscoverableEnabler.java
+++ b/src/com/android/settings/bluetooth/BluetoothDiscoverableEnabler.java
@@ -38,20 +38,20 @@
  */
 public class BluetoothDiscoverableEnabler implements Preference.OnPreferenceChangeListener {
     private static final String TAG = "BluetoothDiscoverableEnabler";
-    
+
     private static final String SYSTEM_PROPERTY_DISCOVERABLE_TIMEOUT =
             "debug.bt.discoverable_time";
-    private static final int DISCOVERABLE_TIMEOUT = 120; 
+    private static final int DISCOVERABLE_TIMEOUT = 120;
 
     private static final String SHARED_PREFERENCES_KEY_DISCOVERABLE_END_TIMESTAMP =
             "discoverable_end_timestamp";
-    
+
     private final Context mContext;
     private final Handler mUiHandler;
     private final CheckBoxPreference mCheckBoxPreference;
-    
+
     private final LocalBluetoothManager mLocalManager;
-    
+
     private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
         @Override
         public void onReceive(Context context, Intent intent) {
@@ -66,17 +66,17 @@
 
     private final Runnable mUpdateCountdownSummaryRunnable = new Runnable() {
         public void run() {
-            updateCountdownSummary();        
-        } 
+            updateCountdownSummary();
+        }
     };
 
     public BluetoothDiscoverableEnabler(Context context, CheckBoxPreference checkBoxPreference) {
         mContext = context;
         mUiHandler = new Handler();
         mCheckBoxPreference = checkBoxPreference;
-        
+
         checkBoxPreference.setPersistent(false);
-        
+
         mLocalManager = LocalBluetoothManager.getInstance(context);
         if (mLocalManager == null) {
             // Bluetooth not supported
@@ -92,30 +92,30 @@
         IntentFilter filter = new IntentFilter(BluetoothIntent.SCAN_MODE_CHANGED_ACTION);
         mContext.registerReceiver(mReceiver, filter);
         mCheckBoxPreference.setOnPreferenceChangeListener(this);
-        
+
         handleModeChanged(mLocalManager.getBluetoothManager().getScanMode());
     }
-    
+
     public void pause() {
         if (mLocalManager == null) {
             return;
         }
-        
+
         mUiHandler.removeCallbacks(mUpdateCountdownSummaryRunnable);
         mCheckBoxPreference.setOnPreferenceChangeListener(null);
         mContext.unregisterReceiver(mReceiver);
     }
-    
+
     public boolean onPreferenceChange(Preference preference, Object value) {
         // Turn on/off BT discoverability
         setEnabled((Boolean) value);
-        
+
         return true;
     }
-    
+
     private void setEnabled(final boolean enable) {
         BluetoothDevice manager = mLocalManager.getBluetoothManager();
-        
+
         if (enable) {
 
             int timeout = getDiscoverableTimeout();
@@ -126,7 +126,7 @@
 
             long endTimestamp = System.currentTimeMillis() + timeout * 1000;
             persistDiscoverableEndTimestamp(endTimestamp);
-            
+
             manager.setScanMode(BluetoothDevice.SCAN_MODE_CONNECTABLE_DISCOVERABLE);
         } else {
             manager.setScanMode(BluetoothDevice.SCAN_MODE_CONNECTABLE);
@@ -138,7 +138,7 @@
         if (timeout <= 0) {
             timeout = DISCOVERABLE_TIMEOUT;
         }
-        
+
         return timeout;
     }
 
@@ -147,44 +147,44 @@
         editor.putLong(SHARED_PREFERENCES_KEY_DISCOVERABLE_END_TIMESTAMP, endTimestamp);
         editor.commit();
     }
-    
+
     private void handleModeChanged(int mode) {
         if (mode == BluetoothDevice.SCAN_MODE_CONNECTABLE_DISCOVERABLE) {
             mCheckBoxPreference.setChecked(true);
             updateCountdownSummary();
-            
+
         } else {
             mCheckBoxPreference.setChecked(false);
         }
     }
-    
+
     private void updateCountdownSummary() {
         int mode = mLocalManager.getBluetoothManager().getScanMode();
         if (mode != BluetoothDevice.SCAN_MODE_CONNECTABLE_DISCOVERABLE) {
             return;
         }
-            
+
         long currentTimestamp = System.currentTimeMillis();
         long endTimestamp = mLocalManager.getSharedPreferences().getLong(
                 SHARED_PREFERENCES_KEY_DISCOVERABLE_END_TIMESTAMP, 0);
-            
+
         if (currentTimestamp > endTimestamp) {
             // We're still in discoverable mode, but maybe there isn't a timeout.
             mCheckBoxPreference.setSummaryOn(null);
             return;
         }
-        
+
         String formattedTimeLeft = String.valueOf((endTimestamp - currentTimestamp) / 1000);
-        
+
         mCheckBoxPreference.setSummaryOn(
                 mContext.getResources().getString(R.string.bluetooth_is_discoverable,
                         formattedTimeLeft));
-        
+
         synchronized (this) {
             mUiHandler.removeCallbacks(mUpdateCountdownSummaryRunnable);
             mUiHandler.postDelayed(mUpdateCountdownSummaryRunnable, 1000);
         }
     }
-    
-        
+
+
 }
diff --git a/src/com/android/settings/bluetooth/BluetoothEventRedirector.java b/src/com/android/settings/bluetooth/BluetoothEventRedirector.java
index af64c98..55b2b77 100644
--- a/src/com/android/settings/bluetooth/BluetoothEventRedirector.java
+++ b/src/com/android/settings/bluetooth/BluetoothEventRedirector.java
@@ -17,6 +17,7 @@
 package com.android.settings.bluetooth;
 
 import android.bluetooth.BluetoothA2dp;
+import android.bluetooth.BluetoothClass;
 import android.bluetooth.BluetoothDevice;
 import android.bluetooth.BluetoothError;
 import android.bluetooth.BluetoothHeadset;
@@ -37,39 +38,41 @@
 public class BluetoothEventRedirector {
     private static final String TAG = "BluetoothEventRedirector";
     private static final boolean V = LocalBluetoothManager.V;
-    
+
     private LocalBluetoothManager mManager;
-    
+
     private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
         @Override
         public void onReceive(Context context, Intent intent) {
             if (V) {
                 Log.v(TAG, "Received " + intent.getAction());
             }
-            
+
             String action = intent.getAction();
             String address = intent.getStringExtra(BluetoothIntent.ADDRESS);
-                
+
             if (action.equals(BluetoothIntent.BLUETOOTH_STATE_CHANGED_ACTION)) {
                 int state = intent.getIntExtra(BluetoothIntent.BLUETOOTH_STATE,
                                         BluetoothError.ERROR);
                 mManager.setBluetoothStateInt(state);
             } else if (action.equals(BluetoothIntent.DISCOVERY_STARTED_ACTION)) {
                 mManager.onScanningStateChanged(true);
-                
+
             } else if (action.equals(BluetoothIntent.DISCOVERY_COMPLETED_ACTION)) {
                 mManager.onScanningStateChanged(false);
-                    
+
             } else if (action.equals(BluetoothIntent.REMOTE_DEVICE_FOUND_ACTION)) {
                 short rssi = intent.getShortExtra(BluetoothIntent.RSSI, Short.MIN_VALUE);
-                mManager.getLocalDeviceManager().onDeviceAppeared(address, rssi);
-                
+                int btClass = intent.getIntExtra(BluetoothIntent.CLASS, BluetoothClass.ERROR);
+                String name = intent.getStringExtra(BluetoothIntent.NAME);
+                mManager.getLocalDeviceManager().onDeviceAppeared(address, rssi, btClass, name);
+
             } else if (action.equals(BluetoothIntent.REMOTE_DEVICE_DISAPPEARED_ACTION)) {
                 mManager.getLocalDeviceManager().onDeviceDisappeared(address);
-                
+
             } else if (action.equals(BluetoothIntent.REMOTE_NAME_UPDATED_ACTION)) {
                 mManager.getLocalDeviceManager().onDeviceNameUpdated(address);
-                
+
             } else if (action.equals(BluetoothIntent.BOND_STATE_CHANGED_ACTION)) {
                 int bondState = intent.getIntExtra(BluetoothIntent.BOND_STATE,
                                                    BluetoothError.ERROR);
@@ -82,7 +85,7 @@
                         mManager.getLocalDeviceManager().onBondingError(address, reason);
                     }
                 }
-                
+
             } else if (action.equals(BluetoothIntent.HEADSET_STATE_CHANGED_ACTION)) {
                 int newState = intent.getIntExtra(BluetoothIntent.HEADSET_STATE, 0);
                 int oldState = intent.getIntExtra(BluetoothIntent.HEADSET_PREVIOUS_STATE, 0);
@@ -107,7 +110,7 @@
 
             } else if (action.equals(BluetoothIntent.REMOTE_DEVICE_CLASS_UPDATED_ACTION)) {
                 mManager.getLocalDeviceManager().onBtClassChanged(address);
-                
+
             }
         }
     };
@@ -118,29 +121,29 @@
 
     public void start() {
         IntentFilter filter = new IntentFilter();
-        
+
         // Bluetooth on/off broadcasts
         filter.addAction(BluetoothIntent.BLUETOOTH_STATE_CHANGED_ACTION);
-        
+
         // Discovery broadcasts
         filter.addAction(BluetoothIntent.DISCOVERY_STARTED_ACTION);
         filter.addAction(BluetoothIntent.DISCOVERY_COMPLETED_ACTION);
         filter.addAction(BluetoothIntent.REMOTE_DEVICE_DISAPPEARED_ACTION);
         filter.addAction(BluetoothIntent.REMOTE_DEVICE_FOUND_ACTION);
         filter.addAction(BluetoothIntent.REMOTE_NAME_UPDATED_ACTION);
-        
+
         // Pairing broadcasts
         filter.addAction(BluetoothIntent.BOND_STATE_CHANGED_ACTION);
-        
+
         // Fine-grained state broadcasts
         filter.addAction(BluetoothA2dp.SINK_STATE_CHANGED_ACTION);
         filter.addAction(BluetoothIntent.HEADSET_STATE_CHANGED_ACTION);
         filter.addAction(BluetoothIntent.REMOTE_DEVICE_CLASS_UPDATED_ACTION);
-        
+
         mManager.getContext().registerReceiver(mBroadcastReceiver, filter);
     }
-    
+
     public void stop() {
-        mManager.getContext().unregisterReceiver(mBroadcastReceiver);   
+        mManager.getContext().unregisterReceiver(mBroadcastReceiver);
     }
 }
diff --git a/src/com/android/settings/bluetooth/BluetoothPairingDialog.java b/src/com/android/settings/bluetooth/BluetoothPairingDialog.java
new file mode 100644
index 0000000..bbe094f
--- /dev/null
+++ b/src/com/android/settings/bluetooth/BluetoothPairingDialog.java
@@ -0,0 +1,261 @@
+/*
+ * 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.
+ */
+
+package com.android.settings.bluetooth;
+
+import android.bluetooth.BluetoothClass;
+import android.bluetooth.BluetoothDevice;
+import android.bluetooth.BluetoothIntent;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.Bundle;
+import android.text.Editable;
+import android.text.InputFilter;
+import android.text.InputType;
+import android.text.TextWatcher;
+import android.text.InputFilter.LengthFilter;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.TextView;
+
+import com.android.internal.app.AlertActivity;
+import com.android.internal.app.AlertController;
+import com.android.settings.R;
+
+/**
+ * BluetoothPairingDialog asks the user to enter a PIN / Passkey / simple confirmation
+ * for pairing with a remote Bluetooth device. It is an activity that appears as a dialog.
+ */
+public class BluetoothPairingDialog extends AlertActivity implements DialogInterface.OnClickListener,
+        TextWatcher {
+    private static final String TAG = "BluetoothPairingDialog";
+
+    private final int BLUETOOTH_PIN_MAX_LENGTH = 16;
+    private final int BLUETOOTH_PASSKEY_MAX_LENGTH = 6;
+    private LocalBluetoothManager mLocalManager;
+    private String mAddress;
+    private int mType;
+    private int mConfirmationPasskey;
+    private EditText mPairingView;
+    private Button mOkButton;
+
+    private static final String INSTANCE_KEY_PAIRING_CANCELED = "received_pairing_canceled";
+    private boolean mReceivedPairingCanceled;
+
+    private BroadcastReceiver mReceiver = new BroadcastReceiver() {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            if (!BluetoothIntent.PAIRING_CANCEL_ACTION.equals(intent.getAction())) {
+                return;
+            }
+
+            String address = intent.getStringExtra(BluetoothIntent.ADDRESS);
+            if (address == null || address.equals(mAddress)) {
+                onReceivedPairingCanceled();
+            }
+        }
+    };
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        Intent intent = getIntent();
+        if (!intent.getAction().equals(BluetoothIntent.PAIRING_REQUEST_ACTION))
+        {
+            Log.e(TAG,
+                  "Error: this activity may be started only with intent " +
+                  BluetoothIntent.PAIRING_REQUEST_ACTION);
+            finish();
+        }
+
+        mLocalManager = LocalBluetoothManager.getInstance(this);
+        mAddress = intent.getStringExtra(BluetoothIntent.ADDRESS);
+        mType = intent.getIntExtra(BluetoothIntent.PAIRING_VARIANT, BluetoothClass.ERROR);
+        if (mType == BluetoothDevice.PAIRING_VARIANT_PIN) {
+            createUserEntryDialog();
+        } else if (mType == BluetoothDevice.PAIRING_VARIANT_PASSKEY) {
+            createUserEntryDialog();
+        } else if (mType == BluetoothDevice.PAIRING_VARIANT_CONFIRMATION){
+            mConfirmationPasskey =
+                intent.getIntExtra(BluetoothIntent.PASSKEY, BluetoothClass.ERROR);
+            if (mConfirmationPasskey == BluetoothClass.ERROR) {
+                Log.e(TAG, "Invalid ConfirmationPasskey received, not showing any dialog");
+                return;
+            }
+            createConfirmationDialog();
+        } else {
+            Log.e(TAG, "Incorrect pairing type received, not showing any dialog");
+        }
+
+        /*
+         * Leave this registered through pause/resume since we still want to
+         * finish the activity in the background if pairing is canceled.
+         */
+        registerReceiver(mReceiver, new IntentFilter(BluetoothIntent.PAIRING_CANCEL_ACTION));
+    }
+
+    private void createUserEntryDialog() {
+        final AlertController.AlertParams p = mAlertParams;
+        p.mIconId = android.R.drawable.ic_dialog_info;
+        p.mTitle = getString(R.string.bluetooth_pin_entry);
+        p.mView = createView();
+        p.mPositiveButtonText = getString(android.R.string.ok);
+        p.mPositiveButtonListener = this;
+        p.mNegativeButtonText = getString(android.R.string.cancel);
+        p.mNegativeButtonListener = this;
+        setupAlert();
+
+        mOkButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE);
+        mOkButton.setEnabled(false);
+    }
+
+    private View createView() {
+        View view = getLayoutInflater().inflate(R.layout.bluetooth_pin_entry, null);
+
+        String name = mLocalManager.getLocalDeviceManager().getName(mAddress);
+        TextView messageView = (TextView) view.findViewById(R.id.message);
+        mPairingView = (EditText) view.findViewById(R.id.text);
+        mPairingView.addTextChangedListener(this);
+
+        if (mType == BluetoothDevice.PAIRING_VARIANT_PIN) {
+            messageView.setText(getString(R.string.bluetooth_enter_pin_msg, name));
+            // Maximum of 16 characters in a PIN adb sync
+            mPairingView.setFilters(new InputFilter[] {
+                    new LengthFilter(BLUETOOTH_PIN_MAX_LENGTH) });
+        } else if (mType == BluetoothDevice.PAIRING_VARIANT_PASSKEY){
+            messageView.setText(getString(R.string.bluetooth_enter_passkey_msg, name));
+            // Maximum of 6 digits for passkey
+            mPairingView.setInputType(InputType.TYPE_NUMBER_FLAG_SIGNED);
+            mPairingView.setFilters(new InputFilter[] {
+                    new LengthFilter(BLUETOOTH_PASSKEY_MAX_LENGTH)});
+        } else {
+            mPairingView.setVisibility(View.GONE);
+            messageView.setText(getString(R.string.bluetooth_confirm_passkey_msg, name,
+                    mConfirmationPasskey));
+        }
+        return view;
+    }
+
+    private void createConfirmationDialog() {
+        final AlertController.AlertParams p = mAlertParams;
+        p.mIconId = android.R.drawable.ic_dialog_info;
+        p.mTitle = getString(R.string.bluetooth_pin_entry);
+        p.mView = createView();
+        p.mPositiveButtonText = getString(android.R.string.yes);
+        p.mPositiveButtonListener = this;
+        p.mNegativeButtonText = getString(android.R.string.no);
+        p.mNegativeButtonListener = this;
+        setupAlert();
+    }
+
+    @Override
+    protected void onRestoreInstanceState(Bundle savedInstanceState) {
+        super.onRestoreInstanceState(savedInstanceState);
+
+        mReceivedPairingCanceled = savedInstanceState.getBoolean(INSTANCE_KEY_PAIRING_CANCELED);
+        if (mReceivedPairingCanceled) {
+            onReceivedPairingCanceled();
+        }
+    }
+
+    @Override
+    protected void onSaveInstanceState(Bundle outState) {
+        super.onSaveInstanceState(outState);
+
+        outState.putBoolean(INSTANCE_KEY_PAIRING_CANCELED, mReceivedPairingCanceled);
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+
+        unregisterReceiver(mReceiver);
+    }
+
+
+
+    public void afterTextChanged(Editable s) {
+        if (s.length() > 0) {
+            mOkButton.setEnabled(true);
+        }
+    }
+
+    private void onReceivedPairingCanceled() {
+        mReceivedPairingCanceled = true;
+
+        TextView messageView = (TextView) findViewById(R.id.message);
+        messageView.setText(getString(R.string.bluetooth_pairing_error_message,
+                mLocalManager.getLocalDeviceManager().getName(mAddress)));
+
+        mPairingView.setVisibility(View.GONE);
+        mPairingView.clearFocus();
+        mPairingView.removeTextChangedListener(this);
+
+        mOkButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE);
+        mOkButton.setEnabled(true);
+        mAlert.getButton(DialogInterface.BUTTON_NEGATIVE).setVisibility(View.GONE);
+    }
+
+    private void onPair(String value) {
+        if (mType == BluetoothDevice.PAIRING_VARIANT_PIN) {
+            byte[] pinBytes = BluetoothDevice.convertPinToBytes(value);
+            if (pinBytes == null) {
+                return;
+            }
+            mLocalManager.getBluetoothManager().setPin(mAddress, pinBytes);
+        } else if (mType == BluetoothDevice.PAIRING_VARIANT_PASSKEY) {
+            int passkey = Integer.getInteger(value);
+            mLocalManager.getBluetoothManager().setPasskey(mAddress, passkey);
+        } else {
+            mLocalManager.getBluetoothManager().setPairingConfirmation(mAddress, true);
+        }
+    }
+
+    private void onCancel() {
+        if (mType == BluetoothDevice.PAIRING_VARIANT_CONFIRMATION) {
+            mLocalManager.getBluetoothManager().setPairingConfirmation(mAddress, false);
+        } else {
+            mLocalManager.getBluetoothManager().cancelBondProcess(mAddress);
+        }
+    }
+
+    public void onClick(DialogInterface dialog, int which) {
+        switch (which) {
+            case DialogInterface.BUTTON_POSITIVE:
+                onPair(mPairingView.getText().toString());
+                break;
+
+            case DialogInterface.BUTTON_NEGATIVE:
+                onCancel();
+                break;
+        }
+    }
+
+    /* Not used */
+    public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+    }
+
+    /* Not used */
+    public void onTextChanged(CharSequence s, int start, int before, int count) {
+    }
+
+}
diff --git a/src/com/android/settings/bluetooth/BluetoothPinRequest.java b/src/com/android/settings/bluetooth/BluetoothPairingRequest.java
similarity index 69%
rename from src/com/android/settings/bluetooth/BluetoothPinRequest.java
rename to src/com/android/settings/bluetooth/BluetoothPairingRequest.java
index 619052d..d57628a 100644
--- a/src/com/android/settings/bluetooth/BluetoothPinRequest.java
+++ b/src/com/android/settings/bluetooth/BluetoothPairingRequest.java
@@ -21,6 +21,7 @@
 import android.app.Notification;
 import android.app.NotificationManager;
 import android.app.PendingIntent;
+import android.bluetooth.BluetoothClass;
 import android.bluetooth.BluetoothDevice;
 import android.bluetooth.BluetoothIntent;
 import android.content.BroadcastReceiver;
@@ -30,35 +31,41 @@
 import android.text.TextUtils;
 
 /**
- * BluetoothPinRequest is a receiver for any Bluetooth pairing PIN request. It
- * checks if the Bluetooth Settings is currently visible and brings up the PIN
- * entry dialog. Otherwise it puts a Notification in the status bar, which can
- * be clicked to bring up the PIN entry dialog.
+ * BluetoothPairingRequest is a receiver for any Bluetooth pairing request. It
+ * checks if the Bluetooth Settings is currently visible and brings up the PIN, the passkey or a
+ * confirmation entry dialog. Otherwise it puts a Notification in the status bar, which can
+ * be clicked to bring up the Pairing entry dialog.
  */
-public class BluetoothPinRequest extends BroadcastReceiver {
+public class BluetoothPairingRequest extends BroadcastReceiver {
 
     public static final int NOTIFICATION_ID = android.R.drawable.stat_sys_data_bluetooth;
-    
+
     @Override
     public void onReceive(Context context, Intent intent) {
         String action = intent.getAction();
         if (action.equals(BluetoothIntent.PAIRING_REQUEST_ACTION)) {
 
-            LocalBluetoothManager localManager = LocalBluetoothManager.getInstance(context);        
-        
+            LocalBluetoothManager localManager = LocalBluetoothManager.getInstance(context);
+
             String address = intent.getStringExtra(BluetoothIntent.ADDRESS);
-            Intent pinIntent = new Intent();
-            pinIntent.setClass(context, BluetoothPinDialog.class);
-            pinIntent.putExtra(BluetoothIntent.ADDRESS, address); 
-            pinIntent.setAction(BluetoothIntent.PAIRING_REQUEST_ACTION);
-            pinIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-            
+            int type = intent.getIntExtra(BluetoothIntent.PAIRING_VARIANT, BluetoothClass.ERROR);
+            Intent pairingIntent = new Intent();
+            pairingIntent.setClass(context, BluetoothPairingDialog.class);
+            pairingIntent.putExtra(BluetoothIntent.ADDRESS, address);
+            pairingIntent.putExtra(BluetoothIntent.PAIRING_VARIANT, type);
+            if (type == BluetoothDevice.PAIRING_VARIANT_CONFIRMATION) {
+                int passkey = intent.getIntExtra(BluetoothIntent.PASSKEY, BluetoothClass.ERROR);
+                pairingIntent.putExtra(BluetoothIntent.PASSKEY, passkey);
+            }
+            pairingIntent.setAction(BluetoothIntent.PAIRING_REQUEST_ACTION);
+            pairingIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+
             if (localManager.getForegroundActivity() != null) {
                 // Since the BT-related activity is in the foreground, just open the dialog
-                context.startActivity(pinIntent);
-                
+                context.startActivity(pairingIntent);
+
             } else {
-                
+
                 // Put up a notification that leads to the dialog
                 Resources res = context.getResources();
                 Notification notification = new Notification(
@@ -66,27 +73,27 @@
                         res.getString(R.string.bluetooth_notif_ticker),
                         System.currentTimeMillis());
 
-                PendingIntent pending = PendingIntent.getActivity(context, 0, 
-                        pinIntent, PendingIntent.FLAG_ONE_SHOT);
-                
+                PendingIntent pending = PendingIntent.getActivity(context, 0,
+                        pairingIntent, PendingIntent.FLAG_ONE_SHOT);
+
                 String name = intent.getStringExtra(BluetoothIntent.NAME);
                 if (TextUtils.isEmpty(name)) {
                     name = localManager.getLocalDeviceManager().getName(address);
                 }
-                
-                notification.setLatestEventInfo(context, 
-                        res.getString(R.string.bluetooth_notif_title), 
-                        res.getString(R.string.bluetooth_notif_message) + name, 
+
+                notification.setLatestEventInfo(context,
+                        res.getString(R.string.bluetooth_notif_title),
+                        res.getString(R.string.bluetooth_notif_message) + name,
                         pending);
                 notification.flags |= Notification.FLAG_AUTO_CANCEL;
-                
-                NotificationManager manager = (NotificationManager) 
+
+                NotificationManager manager = (NotificationManager)
                         context.getSystemService(Context.NOTIFICATION_SERVICE);
                 manager.notify(NOTIFICATION_ID, notification);
             }
-            
+
         } else if (action.equals(BluetoothIntent.PAIRING_CANCEL_ACTION)) {
-            
+
             // Remove the notification
             NotificationManager manager = (NotificationManager) context
                     .getSystemService(Context.NOTIFICATION_SERVICE);
diff --git a/src/com/android/settings/bluetooth/BluetoothPinDialog.java b/src/com/android/settings/bluetooth/BluetoothPinDialog.java
deleted file mode 100644
index 087fbb2..0000000
--- a/src/com/android/settings/bluetooth/BluetoothPinDialog.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * 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.
- */
-
-package com.android.settings.bluetooth;
-
-import android.bluetooth.BluetoothDevice;
-import android.bluetooth.BluetoothIntent;
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.os.Bundle;
-import android.text.Editable;
-import android.text.InputFilter;
-import android.text.TextWatcher;
-import android.text.InputFilter.LengthFilter;
-import android.util.Log;
-import android.view.View;
-import android.widget.Button;
-import android.widget.EditText;
-import android.widget.TextView;
-
-import com.android.internal.app.AlertActivity;
-import com.android.internal.app.AlertController;
-import com.android.settings.R;
-
-/**
- * BluetoothPinDialog asks the user to enter a PIN for pairing with a remote
- * Bluetooth device. It is an activity that appears as a dialog.
- */
-public class BluetoothPinDialog extends AlertActivity implements DialogInterface.OnClickListener,
-        TextWatcher {
-    private static final String TAG = "BluetoothPinDialog";
-
-    private final int BLUETOOTH_PIN_MAX_LENGTH = 16;
-    private LocalBluetoothManager mLocalManager;
-    private String mAddress;
-    private EditText mPinView;
-    private Button mOkButton;
-
-    private static final String INSTANCE_KEY_PAIRING_CANCELED = "received_pairing_canceled";
-    private boolean mReceivedPairingCanceled;
-    
-    private BroadcastReceiver mReceiver = new BroadcastReceiver() {
-        @Override
-        public void onReceive(Context context, Intent intent) {
-            if (!BluetoothIntent.PAIRING_CANCEL_ACTION.equals(intent.getAction())) {
-                return;
-            }
-            
-            String address = intent.getStringExtra(BluetoothIntent.ADDRESS);
-            if (address == null || address.equals(mAddress)) {
-                onReceivedPairingCanceled();
-            }
-        }
-    };
-    
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-
-        Intent intent = getIntent();
-        if (!intent.getAction().equals(BluetoothIntent.PAIRING_REQUEST_ACTION))
-        {
-            Log.e(TAG,
-                  "Error: this activity may be started only with intent " +
-                  BluetoothIntent.PAIRING_REQUEST_ACTION);
-            finish();
-        }
-        
-        mLocalManager = LocalBluetoothManager.getInstance(this);
-        mAddress = intent.getStringExtra(BluetoothIntent.ADDRESS);
-        
-        // Set up the "dialog"
-        final AlertController.AlertParams p = mAlertParams;
-        p.mIconId = android.R.drawable.ic_dialog_info;
-        p.mTitle = getString(R.string.bluetooth_pin_entry);
-        p.mView = createView();
-        p.mPositiveButtonText = getString(android.R.string.ok);
-        p.mPositiveButtonListener = this;
-        p.mNegativeButtonText = getString(android.R.string.cancel);
-        p.mNegativeButtonListener = this;
-        setupAlert();
-        
-        mOkButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE);
-        mOkButton.setEnabled(false);
-
-        /*
-         * Leave this registered through pause/resume since we still want to
-         * finish the activity in the background if pairing is canceled.
-         */
-        registerReceiver(mReceiver, new IntentFilter(BluetoothIntent.PAIRING_CANCEL_ACTION));
-    }
-
-    @Override
-    protected void onRestoreInstanceState(Bundle savedInstanceState) {
-        super.onRestoreInstanceState(savedInstanceState);
-        
-        mReceivedPairingCanceled = savedInstanceState.getBoolean(INSTANCE_KEY_PAIRING_CANCELED);
-        if (mReceivedPairingCanceled) {
-            onReceivedPairingCanceled();
-        }
-    }
-
-    @Override
-    protected void onSaveInstanceState(Bundle outState) {
-        super.onSaveInstanceState(outState);
-        
-        outState.putBoolean(INSTANCE_KEY_PAIRING_CANCELED, mReceivedPairingCanceled);
-    }
-
-    @Override
-    protected void onDestroy() {
-        super.onDestroy();
-        
-        unregisterReceiver(mReceiver);
-    }
-
-    private View createView() {
-        View view = getLayoutInflater().inflate(R.layout.bluetooth_pin_entry, null);
-        
-        String name = mLocalManager.getLocalDeviceManager().getName(mAddress);
-        TextView messageView = (TextView) view.findViewById(R.id.message);
-        messageView.setText(getString(R.string.bluetooth_enter_pin_msg, name));
-        
-        mPinView = (EditText) view.findViewById(R.id.text);
-        mPinView.addTextChangedListener(this);
-        // Maximum of 16 characters in a PIN
-        mPinView.setFilters(new InputFilter[] { new LengthFilter(BLUETOOTH_PIN_MAX_LENGTH) });
-        
-        return view;
-    }
-
-    public void afterTextChanged(Editable s) {
-        if (s.length() > 0) {
-            mOkButton.setEnabled(true);
-        }
-    }
-
-    private void onReceivedPairingCanceled() {
-        mReceivedPairingCanceled = true;
-        
-        TextView messageView = (TextView) findViewById(R.id.message);
-        messageView.setText(getString(R.string.bluetooth_pairing_error_message,
-                mLocalManager.getLocalDeviceManager().getName(mAddress)));
-        
-        mPinView.setVisibility(View.GONE);
-        mPinView.clearFocus();
-        mPinView.removeTextChangedListener(this);
-
-        mOkButton.setEnabled(true);
-        mAlert.getButton(DialogInterface.BUTTON_NEGATIVE).setVisibility(View.GONE);
-    }
-    
-    private void onPair(String pin) {
-        byte[] pinBytes = BluetoothDevice.convertPinToBytes(pin);
-        
-        if (pinBytes == null) {
-            return;
-        }
-        
-        mLocalManager.getBluetoothManager().setPin(mAddress, pinBytes);
-    }
-
-    private void onCancel() {
-        mLocalManager.getBluetoothManager().cancelBondProcess(mAddress);
-    }
-    
-    public void onClick(DialogInterface dialog, int which) {
-        switch (which) {
-            case DialogInterface.BUTTON_POSITIVE:
-                onPair(mPinView.getText().toString());
-                break;
-                
-            case DialogInterface.BUTTON_NEGATIVE:
-                onCancel();
-                break;
-        }
-    }
-
-    /* Not used */
-    public void beforeTextChanged(CharSequence s, int start, int count, int after) {
-    }
-
-    /* Not used */
-    public void onTextChanged(CharSequence s, int start, int before, int count) {
-    }
-
-}
diff --git a/src/com/android/settings/bluetooth/LocalBluetoothDevice.java b/src/com/android/settings/bluetooth/LocalBluetoothDevice.java
index 5259d7b..cb2973f 100644
--- a/src/com/android/settings/bluetooth/LocalBluetoothDevice.java
+++ b/src/com/android/settings/bluetooth/LocalBluetoothDevice.java
@@ -82,7 +82,7 @@
         CONNECT, DISCONNECT,
     }
 
-    class BluetoothJob {
+    static class BluetoothJob {
         final BluetoothCommand command; // CONNECT, DISCONNECT
         final LocalBluetoothDevice device;
         final Profile profile; // HEADSET, A2DP, etc
@@ -96,7 +96,7 @@
             this.profile = profile;
             this.timeSent = 0;
         }
-        
+
         @Override
         public String toString() {
             StringBuilder sb = new StringBuilder();
@@ -147,7 +147,7 @@
             }
         }
     }
-    
+
     private boolean pruneQueue(BluetoothJob job) {
         boolean removedStaleItems = false;
         long now = System.currentTimeMillis();
@@ -186,7 +186,7 @@
     private boolean processCommand(BluetoothJob job) {
         boolean successful = false;
         if (job.timeSent == 0) {
-            job.timeSent = System.currentTimeMillis();                
+            job.timeSent = System.currentTimeMillis();
             switch (job.command) {
             case CONNECT:
                 successful = connectInt(job.device, job.profile);
@@ -349,7 +349,7 @@
             }
         };
 
-        AlertDialog ad = new AlertDialog.Builder(context)
+        new AlertDialog.Builder(context)
                 .setTitle(getName())
                 .setMessage(message)
                 .setPositiveButton(android.R.string.ok, disconnectListener)
@@ -363,7 +363,6 @@
         // Reset the only-show-one-error-dialog tracking variable
         mIsConnectingErrorPossible = true;
 
-        Context context = mLocalManager.getContext();
         boolean hasAtLeastOnePreferredProfile = false;
         for (Profile profile : mProfiles) {
             LocalBluetoothProfileManager profileManager =
@@ -385,7 +384,6 @@
         // Reset the only-show-one-error-dialog tracking variable
         mIsConnectingErrorPossible = true;
 
-        Context context = mLocalManager.getContext();
         for (Profile profile : mProfiles) {
             LocalBluetoothProfileManager profileManager =
                     LocalBluetoothProfileManager.getProfileManager(mLocalManager, profile);
@@ -450,7 +448,7 @@
     public void unpair() {
         synchronized (workQueue) {
             // Remove any pending commands for this device
-            boolean processNow = false;            
+            boolean processNow = false;
             Iterator<BluetoothJob> it = workQueue.iterator();
             while (it.hasNext()) {
                 BluetoothJob job = it.next();
@@ -480,8 +478,6 @@
     }
 
     private void fillData() {
-        BluetoothDevice manager = mLocalManager.getBluetoothManager();
-
         fetchName();
         fetchBtClass();
 
@@ -498,6 +494,17 @@
         return mName;
     }
 
+    public void setName(String name) {
+        if (!mName.equals(name)) {
+            if (TextUtils.isEmpty(name)) {
+                mName = mAddress;
+            } else {
+                mName = name;
+            }
+            dispatchAttributesChanged();
+        }
+    }
+
     public void refreshName() {
         fetchName();
         dispatchAttributesChanged();
@@ -571,23 +578,19 @@
     }
 
     public int getBtClassDrawable() {
-
-        // First try looking at profiles
-        if (mProfiles.contains(Profile.A2DP)) {
-            return R.drawable.ic_bt_headphones_a2dp;
-        } else if (mProfiles.contains(Profile.HEADSET)) {
-            return R.drawable.ic_bt_headset_hfp;
-        }
-
-        // Fallback on class
         switch (BluetoothClass.Device.Major.getDeviceMajor(mBtClass)) {
         case BluetoothClass.Device.Major.COMPUTER:
             return R.drawable.ic_bt_laptop;
 
         case BluetoothClass.Device.Major.PHONE:
             return R.drawable.ic_bt_cellphone;
+        }
 
-        default:
+        if (mProfiles.contains(Profile.A2DP)) {
+            return R.drawable.ic_bt_headphones_a2dp;
+        } else if (mProfiles.contains(Profile.HEADSET)) {
+            return R.drawable.ic_bt_headset_hfp;
+        } else {
             return 0;
         }
     }
@@ -611,6 +614,14 @@
         dispatchAttributesChanged();
     }
 
+    public void setBtClass(int btClass) {
+        if (mBtClass != btClass && btClass != BluetoothClass.ERROR) {
+            mBtClass = btClass;
+            LocalBluetoothProfileManager.fill(mBtClass, mProfiles);
+            dispatchAttributesChanged();
+        }
+    }
+
     public int getSummary() {
         // TODO: clean up
         int oneOffSummary = getOneOffSummary();
@@ -679,7 +690,9 @@
 
     public void onCreateContextMenu(ContextMenu menu) {
         // No context menu if it is busy (none of these items are applicable if busy)
-        if (isBusy()) return;
+        if (mLocalManager.getBluetoothState() != BluetoothDevice.BLUETOOTH_STATE_ON || isBusy()) {
+            return;
+        }
 
         int bondState = getBondState();
         boolean isConnected = isConnected();
@@ -726,7 +739,6 @@
                 break;
 
             case CONTEXT_ITEM_UNPAIR:
-                mLocalManager.getBluetoothManager().disconnectRemoteDeviceAcl(mAddress);
                 unpair();
                 break;
 
diff --git a/src/com/android/settings/bluetooth/LocalBluetoothDeviceManager.java b/src/com/android/settings/bluetooth/LocalBluetoothDeviceManager.java
index 2c70fd2..819d482 100644
--- a/src/com/android/settings/bluetooth/LocalBluetoothDeviceManager.java
+++ b/src/com/android/settings/bluetooth/LocalBluetoothDeviceManager.java
@@ -34,7 +34,7 @@
 
     final LocalBluetoothManager mLocalManager;
     final List<Callback> mCallbacks;
-    
+
     final List<LocalBluetoothDevice> mDevices = new ArrayList<LocalBluetoothDevice>();
 
     public LocalBluetoothDeviceManager(LocalBluetoothManager localManager) {
@@ -47,7 +47,7 @@
         BluetoothDevice manager = mLocalManager.getBluetoothManager();
         String[] bondedAddresses = manager.listBonds();
         if (bondedAddresses == null) return false;
-        
+
         boolean deviceAdded = false;
         for (String address : bondedAddresses) {
             LocalBluetoothDevice device = findDevice(address);
@@ -58,55 +58,58 @@
                 deviceAdded = true;
             }
         }
-        
+
         return deviceAdded;
     }
-    
+
     public synchronized List<LocalBluetoothDevice> getDevicesCopy() {
         return new ArrayList<LocalBluetoothDevice>(mDevices);
     }
-    
+
     void onBluetoothStateChanged(boolean enabled) {
         if (enabled) {
             readPairedDevices();
         }
     }
 
-    public synchronized void onDeviceAppeared(String address, short rssi) {
+    public synchronized void onDeviceAppeared(String address, short rssi, int btClass,
+            String name) {
         boolean deviceAdded = false;
-        
+
         LocalBluetoothDevice device = findDevice(address);
         if (device == null) {
             device = new LocalBluetoothDevice(mLocalManager.getContext(), address);
             mDevices.add(device);
             deviceAdded = true;
         }
-        
+
         device.setRssi(rssi);
+        device.setBtClass(btClass);
+        device.setName(name);
         device.setVisible(true);
-        
+
         if (deviceAdded) {
             dispatchDeviceAdded(device);
         }
     }
-    
+
     public synchronized void onDeviceDisappeared(String address) {
         LocalBluetoothDevice device = findDevice(address);
         if (device == null) return;
-        
+
         device.setVisible(false);
         checkForDeviceRemoval(device);
     }
-    
+
     private void checkForDeviceRemoval(LocalBluetoothDevice device) {
         if (device.getBondState() == BluetoothDevice.BOND_NOT_BONDED &&
                 !device.isVisible()) {
             // If device isn't paired, remove it altogether
             mDevices.remove(device);
             dispatchDeviceDeleted(device);
-        }            
+        }
     }
-    
+
     public synchronized void onDeviceNameUpdated(String address) {
         LocalBluetoothDevice device = findDevice(address);
         if (device != null) {
@@ -115,21 +118,21 @@
     }
 
     public synchronized LocalBluetoothDevice findDevice(String address) {
-        
+
         for (int i = mDevices.size() - 1; i >= 0; i--) {
             LocalBluetoothDevice device = mDevices.get(i);
-            
+
             if (device.getAddress().equals(address)) {
                 return device;
             }
         }
-        
+
         return null;
     }
-    
+
     /**
      * Attempts to get the name of a remote device, otherwise returns the address.
-     * 
+     *
      * @param address The address.
      * @return The name, or if unavailable, the address.
      */
@@ -137,17 +140,17 @@
         LocalBluetoothDevice device = findDevice(address);
         return device != null ? device.getName() : address;
     }
-    
+
     private void dispatchDeviceAdded(LocalBluetoothDevice device) {
         synchronized (mCallbacks) {
             for (Callback callback : mCallbacks) {
                 callback.onDeviceAdded(device);
             }
         }
-        
+
         // TODO: divider between prev paired/connected and scanned
     }
-    
+
     private void dispatchDeviceDeleted(LocalBluetoothDevice device) {
         synchronized (mCallbacks) {
             for (Callback callback : mCallbacks) {
@@ -176,7 +179,7 @@
 
     /**
      * Called when there is a bonding error.
-     * 
+     *
      * @param address The address of the remote device.
      * @param reason The reason, one of the error reasons from
      *            BluetoothDevice.UNBOND_REASON_*
@@ -199,7 +202,7 @@
         }
         mLocalManager.showError(address, R.string.bluetooth_error_title, errorMsg);
     }
-    
+
     public synchronized void onProfileStateChanged(String address, Profile profile,
             int newProfileState) {
         LocalBluetoothDevice device = findDevice(address);
@@ -208,11 +211,11 @@
         device.onProfileStateChanged(profile, newProfileState);
         device.refresh();
     }
-    
+
     public synchronized void onConnectingError(String address) {
         LocalBluetoothDevice device = findDevice(address);
         if (device == null) return;
-        
+
         /*
          * Go through the device's delegate so we don't spam the user with
          * errors connecting to different profiles, and instead make sure the
@@ -220,10 +223,10 @@
          */
         device.showConnectingError();
     }
-    
+
     public synchronized void onScanningStateChanged(boolean started) {
         if (!started) return;
-        
+
         // If starting a new scan, clear old visibility
         for (int i = mDevices.size() - 1; i >= 0; i--) {
             LocalBluetoothDevice device = mDevices.get(i);
@@ -231,7 +234,7 @@
             checkForDeviceRemoval(device);
         }
     }
-    
+
     public synchronized void onBtClassChanged(String address) {
         LocalBluetoothDevice device = findDevice(address);
         if (device != null) {
diff --git a/src/com/android/settings/bluetooth/LocalBluetoothManager.java b/src/com/android/settings/bluetooth/LocalBluetoothManager.java
index 2e84338..a6e9d50 100644
--- a/src/com/android/settings/bluetooth/LocalBluetoothManager.java
+++ b/src/com/android/settings/bluetooth/LocalBluetoothManager.java
@@ -42,15 +42,15 @@
 public class LocalBluetoothManager {
     private static final String TAG = "LocalBluetoothManager";
     static final boolean V = Config.LOGV;
-    static final boolean D = Config.LOGD && false;
-    
+    static final boolean D = Config.LOGD;
+
     private static final String SHARED_PREFERENCES_NAME = "bluetooth_settings";
-    
+
     private static LocalBluetoothManager INSTANCE;
     /** Used when obtaining a reference to the singleton instance. */
     private static Object INSTANCE_LOCK = new Object();
     private boolean mInitialized;
-    
+
     private Context mContext;
     /** If a BT-related activity is in the foreground, this will be it. */
     private Activity mForegroundActivity;
@@ -61,24 +61,24 @@
     private LocalBluetoothDeviceManager mLocalDeviceManager;
     private BluetoothEventRedirector mEventRedirector;
     private BluetoothA2dp mBluetoothA2dp;
-    
+
     private int mState = BluetoothError.ERROR;
 
     private List<Callback> mCallbacks = new ArrayList<Callback>();
-    
+
     private static final int SCAN_EXPIRATION_MS = 5 * 60 * 1000; // 5 mins
     private long mLastScan;
-    
+
     public static LocalBluetoothManager getInstance(Context context) {
         synchronized (INSTANCE_LOCK) {
             if (INSTANCE == null) {
                 INSTANCE = new LocalBluetoothManager();
             }
-            
+
             if (!INSTANCE.init(context)) {
                 return null;
             }
-            
+
             return INSTANCE;
         }
     }
@@ -86,15 +86,15 @@
     private boolean init(Context context) {
         if (mInitialized) return true;
         mInitialized = true;
-        
+
         // This will be around as long as this process is
         mContext = context.getApplicationContext();
-        
+
         mManager = (BluetoothDevice) context.getSystemService(Context.BLUETOOTH_SERVICE);
         if (mManager == null) {
             return false;
         }
-        
+
         mLocalDeviceManager = new LocalBluetoothDeviceManager(this);
 
         mEventRedirector = new BluetoothEventRedirector(this);
@@ -104,11 +104,11 @@
 
         return true;
     }
-    
+
     public BluetoothDevice getBluetoothManager() {
         return mManager;
     }
-    
+
     public Context getContext() {
         return mContext;
     }
@@ -116,7 +116,7 @@
     public Activity getForegroundActivity() {
         return mForegroundActivity;
     }
-    
+
     public void setForegroundActivity(Activity activity) {
         if (mErrorDialog != null) {
             mErrorDialog.dismiss();
@@ -124,31 +124,31 @@
         }
         mForegroundActivity = activity;
     }
-    
+
     public SharedPreferences getSharedPreferences() {
         return mContext.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
     }
-    
+
     public LocalBluetoothDeviceManager getLocalDeviceManager() {
         return mLocalDeviceManager;
     }
-    
+
     List<Callback> getCallbacks() {
         return mCallbacks;
     }
-    
+
     public void registerCallback(Callback callback) {
         synchronized (mCallbacks) {
             mCallbacks.add(callback);
         }
     }
-    
+
     public void unregisterCallback(Callback callback) {
         synchronized (mCallbacks) {
             mCallbacks.remove(callback);
         }
     }
-    
+
     public void startScanning(boolean force) {
         if (mManager.isDiscovering()) {
             /*
@@ -156,7 +156,7 @@
              * Note: we only call the callbacks, not the same path as if the
              * scanning state had really changed (in that case the device
              * manager would clear its list of unpaired scanned devices).
-             */ 
+             */
             dispatchScanningStateChanged(true);
         } else {
             if (!force) {
@@ -176,22 +176,22 @@
                     }
                 }
             }
-            
-            if (mManager.startDiscovery(true)) {
+
+            if (mManager.startDiscovery()) {
                 mLastScan = System.currentTimeMillis();
             }
         }
     }
-    
+
     public int getBluetoothState() {
-        
+
         if (mState == BluetoothError.ERROR) {
             syncBluetoothState();
         }
-            
+
         return mState;
     }
-    
+
     void setBluetoothStateInt(int state) {
         mState = state;
         if (state == BluetoothDevice.BLUETOOTH_STATE_ON ||
@@ -199,7 +199,7 @@
             mLocalDeviceManager.onBluetoothStateChanged(state == BluetoothDevice.BLUETOOTH_STATE_ON);
         }
     }
-    
+
     private void syncBluetoothState() {
         int bluetoothState;
 
@@ -218,7 +218,7 @@
         boolean wasSetStateSuccessful = enabled
                 ? mManager.enable()
                 : mManager.disable();
-                
+
         if (wasSetStateSuccessful) {
             setBluetoothStateInt(enabled
                 ? BluetoothDevice.BLUETOOTH_STATE_TURNING_ON
@@ -229,11 +229,11 @@
                         "setBluetoothEnabled call, manager didn't return success for enabled: "
                                 + enabled);
             }
-            
+
             syncBluetoothState();
         }
     }
-    
+
     /**
      * @param started True if scanning started, false if scanning finished.
      */
@@ -242,7 +242,7 @@
         mLocalDeviceManager.onScanningStateChanged(started);
         dispatchScanningStateChanged(started);
     }
-    
+
     private void dispatchScanningStateChanged(boolean started) {
         synchronized (mCallbacks) {
             for (Callback callback : mCallbacks) {
@@ -267,7 +267,7 @@
                 .setPositiveButton(android.R.string.ok, null)
                 .show();
         } else {
-            // Fallback on a toast 
+            // Fallback on a toast
             Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show();
         }
     }
@@ -277,5 +277,5 @@
         void onDeviceAdded(LocalBluetoothDevice device);
         void onDeviceDeleted(LocalBluetoothDevice device);
     }
-    
+
 }
diff --git a/src/com/android/settings/deviceinfo/Status.java b/src/com/android/settings/deviceinfo/Status.java
index 7d22d91..1341989 100644
--- a/src/com/android/settings/deviceinfo/Status.java
+++ b/src/com/android/settings/deviceinfo/Status.java
@@ -393,7 +393,6 @@
     void updateTimes() {
         long at = SystemClock.uptimeMillis() / 1000;
         long ut = SystemClock.elapsedRealtime() / 1000;
-        long st = ut - at;
 
         if (ut == 0) {
             ut = 1;
diff --git a/src/com/android/settings/quicklaunch/QuickLaunchSettings.java b/src/com/android/settings/quicklaunch/QuickLaunchSettings.java
index 40316b5..fb9fbcd 100644
--- a/src/com/android/settings/quicklaunch/QuickLaunchSettings.java
+++ b/src/com/android/settings/quicklaunch/QuickLaunchSettings.java
@@ -226,8 +226,7 @@
                 Log.w(TAG, "Result from bookmark picker does not have an intent.");
                 return;
             }
-            
-            String title = data.getStringExtra(BookmarkPicker.EXTRA_TITLE);
+
             char shortcut = data.getCharExtra(BookmarkPicker.EXTRA_SHORTCUT, (char) 0);
             updateShortcut(shortcut, data);
             
diff --git a/src/com/android/settings/vpn/VpnSettings.java b/src/com/android/settings/vpn/VpnSettings.java
index 4dda152..7d4ea25 100644
--- a/src/com/android/settings/vpn/VpnSettings.java
+++ b/src/com/android/settings/vpn/VpnSettings.java
@@ -111,6 +111,7 @@
     private static final int DIALOG_SECRET_NOT_SET = 5;
     private static final int DIALOG_CHALLENGE_ERROR = 6;
     private static final int DIALOG_REMOTE_HUNG_UP_ERROR = 7;
+    private static final int DIALOG_CONNECTION_LOST = 8;
 
     private static final int NO_ERROR = 0;
 
@@ -218,6 +219,9 @@
             case DIALOG_SECRET_NOT_SET:
                 return createSecretNotSetDialog();
 
+            case DIALOG_CONNECTION_LOST:
+                return createConnectionLostDialog();
+
             default:
                 return super.onCreateDialog(id);
         }
@@ -227,7 +231,7 @@
         return new AlertDialog.Builder(this)
                 .setView(mConnectingActor.createConnectView())
                 .setTitle(String.format(getString(R.string.vpn_connect_to),
-                        mConnectingActor.getProfile().getName()))
+                        mActiveProfile.getName()))
                 .setPositiveButton(getString(R.string.vpn_connect_button),
                         this)
                 .setNegativeButton(getString(android.R.string.cancel),
@@ -277,8 +281,7 @@
                 .setPositiveButton(R.string.vpn_yes_button,
                         new DialogInterface.OnClickListener() {
                             public void onClick(DialogInterface dialog, int w) {
-                                VpnProfile p = mConnectingActor.getProfile();
-                                startVpnEditor(p);
+                                startVpnEditor(mActiveProfile);
                             }
                         })
                 .create();
@@ -289,13 +292,19 @@
                 .setPositiveButton(R.string.vpn_yes_button,
                         new DialogInterface.OnClickListener() {
                             public void onClick(DialogInterface dialog, int w) {
-                                VpnProfile p = mConnectingActor.getProfile();
+                                VpnProfile p = mActiveProfile;
                                 onIdle();
                                 startVpnEditor(p);
                             }
                         });
     }
 
+    private Dialog createConnectionLostDialog() {
+        return createCommonDialogBuilder()
+                .setMessage(R.string.vpn_reconnect_from_lost)
+                .create();
+    }
+
     private AlertDialog.Builder createCommonDialogBuilder() {
         return new AlertDialog.Builder(this)
                 .setTitle(android.R.string.dialog_alert_title)
@@ -303,7 +312,7 @@
                 .setPositiveButton(R.string.vpn_yes_button,
                         new DialogInterface.OnClickListener() {
                             public void onClick(DialogInterface dialog, int w) {
-                                connectOrDisconnect(mConnectingActor.getProfile());
+                                connectOrDisconnect(mActiveProfile);
                             }
                         })
                 .setNegativeButton(R.string.vpn_no_button,
@@ -442,7 +451,7 @@
             Dialog d = (Dialog) dialog;
             String error = mConnectingActor.validateInputs(d);
             if (error == null) {
-                changeState(mConnectingActor.getProfile(), VpnState.CONNECTING);
+                changeState(mActiveProfile, VpnState.CONNECTING);
                 mConnectingActor.connect(d);
                 removeDialog(DIALOG_CONNECT);
                 return;
@@ -760,6 +769,10 @@
                     showDialog(DIALOG_UNKNOWN_SERVER);
                     break;
 
+                case VpnManager.VPN_ERROR_CONNECTION_LOST:
+                    showDialog(DIALOG_CONNECTION_LOST);
+                    break;
+
                 default:
                     showDialog(DIALOG_RECONNECT);
                     break;
diff --git a/src/com/android/settings/widget/SettingsAppWidgetProvider.java b/src/com/android/settings/widget/SettingsAppWidgetProvider.java
index d8747c9..caffea2 100644
--- a/src/com/android/settings/widget/SettingsAppWidgetProvider.java
+++ b/src/com/android/settings/widget/SettingsAppWidgetProvider.java
@@ -36,6 +36,7 @@
 import android.provider.Settings;
 import android.util.Log;
 import android.widget.RemoteViews;
+import android.widget.Toast;
 import com.android.settings.R;
 import com.android.settings.bluetooth.LocalBluetoothManager;
 
@@ -175,7 +176,8 @@
                 views.setImageViewResource(R.id.btn_bluetooth, R.drawable.widget_btn_bluetooth);
                 break;
             case STATE_INTERMEDIATE:
-                views.setImageViewResource(R.id.btn_bluetooth, R.drawable.widget_btn_bluetooth_gray);
+                views.setImageViewResource(R.id.btn_bluetooth,
+                        R.drawable.widget_btn_bluetooth_gray);
                 break;
         }
     }
@@ -187,7 +189,8 @@
      * @param appWidgetId
      * @return
      */
-    private static PendingIntent getLaunchPendingIntent(Context context, int appWidgetId, int buttonId) {
+    private static PendingIntent getLaunchPendingIntent(Context context, int appWidgetId,
+            int buttonId) {
         Intent launchIntent = new Intent();
         launchIntent.setClass(context, SettingsAppWidgetProvider.class);
         launchIntent.addCategory(Intent.CATEGORY_ALTERNATIVE);
@@ -256,6 +259,7 @@
         } else if (wifiState == STATE_DISABLED) {
             wifiManager.setWifiEnabled(true);
         }
+        Toast.makeText(context, R.string.gadget_toggle_wifi, Toast.LENGTH_SHORT).show();
     }
 
     /**
@@ -265,7 +269,8 @@
      * @return true if enabled
      */
     private static boolean getBackgroundDataState(Context context) {
-        ConnectivityManager connManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
+        ConnectivityManager connManager =
+                (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
         return connManager.getBackgroundDataSetting();
     }
 
@@ -275,16 +280,11 @@
      * @param context
      */
     private void toggleBackgroundData(Context context) {
-        ConnectivityManager connManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
+        ConnectivityManager connManager =
+                (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
         boolean sync = getBackgroundDataState(context);
         connManager.setBackgroundDataSetting(!sync);
-
-        IContentService contentService = ContentResolver.getContentService();
-        try {
-            contentService.setListenForNetworkTickles(!sync);
-        } catch (RemoteException e) {
-            Log.d(TAG, "toggleBackgroundData: " + e);
-        }
+        ContentResolver.setMasterSyncAutomatically(!sync);
     }
 
     /**
@@ -306,7 +306,8 @@
     private void toggleGps(Context context) {
         ContentResolver resolver = context.getContentResolver();
         boolean enabled = getGpsState(context);
-        Settings.Secure.setLocationProviderEnabled(resolver, LocationManager.GPS_PROVIDER, !enabled);
+        Settings.Secure.setLocationProviderEnabled(resolver, LocationManager.GPS_PROVIDER,
+                !enabled);
     }
 
     /**
@@ -399,5 +400,6 @@
         } else if (state == STATE_DISABLED) {
             mLocalBluetoothManager.setBluetoothEnabled(true);
         }
+        Toast.makeText(context, R.string.gadget_toggle_bluetooth, Toast.LENGTH_SHORT).show();
     }
 }
diff --git a/src/com/android/settings/wifi/AccessPointDialog.java b/src/com/android/settings/wifi/AccessPointDialog.java
index 5851a18..c4984cd 100644
--- a/src/com/android/settings/wifi/AccessPointDialog.java
+++ b/src/com/android/settings/wifi/AccessPointDialog.java
@@ -455,12 +455,12 @@
     }
 
     private void updatePasswordCaption(String security) {
-        
-        if (mPasswordText != null && security != null
-                && security.equals(AccessPointState.WEP)) {
-            mPasswordText.setText(R.string.please_type_hex_key);
-        } else {
-            mPasswordText.setText(R.string.please_type_passphrase);
+        if (mPasswordText != null) {
+            if (security != null && security.equals(AccessPointState.WEP)) {
+                mPasswordText.setText(R.string.please_type_hex_key);
+            } else {
+                mPasswordText.setText(R.string.please_type_passphrase);
+            }
         }
     }
     
diff --git a/src/com/android/settings/wifi/AccessPointPreference.java b/src/com/android/settings/wifi/AccessPointPreference.java
index 10e0947..6dd5492 100644
--- a/src/com/android/settings/wifi/AccessPointPreference.java
+++ b/src/com/android/settings/wifi/AccessPointPreference.java
@@ -33,14 +33,11 @@
     // Signal strength indicator
     private static final int UI_SIGNAL_LEVELS = 4;
 
-    private WifiSettings mWifiSettings;
-    
     private AccessPointState mState;
 
     public AccessPointPreference(WifiSettings wifiSettings, AccessPointState state) {
         super(wifiSettings, null);
         
-        mWifiSettings = wifiSettings;
         mState = state;
         
         setWidgetLayoutResource(R.layout.preference_widget_wifi_signal);
diff --git a/src/com/android/settings/wifi/AdvancedSettings.java b/src/com/android/settings/wifi/AdvancedSettings.java
index 323d5c7..2adf072 100644
--- a/src/com/android/settings/wifi/AdvancedSettings.java
+++ b/src/com/android/settings/wifi/AdvancedSettings.java
@@ -69,6 +69,13 @@
             Preference preference = findPreference(mPreferenceKeys[i]);
             preference.setOnPreferenceChangeListener(this);
         }
+
+        /*
+         * Fix the Run-time IllegalStateException that ListPreference requires an entries
+         * array and an entryValues array, this exception occurs when user open/close the
+         * slider in the Regulatory domain dialog.
+         */
+        initNumChannelsPreference();
     }
     
     @Override
@@ -141,7 +148,7 @@
             try {
                 int numChannels = Integer.parseInt((String) newValue);
                 WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE);
-                if (!wifiManager.setNumAllowedChannels(numChannels)) {
+                if (!wifiManager.setNumAllowedChannels(numChannels, true)) {
                     Toast.makeText(this, R.string.wifi_setting_num_channels_error,
                             Toast.LENGTH_SHORT).show();
                 }
diff --git a/src/com/android/settings/wifi/WifiEnabler.java b/src/com/android/settings/wifi/WifiEnabler.java
index 88cfe06..10a672b 100644
--- a/src/com/android/settings/wifi/WifiEnabler.java
+++ b/src/com/android/settings/wifi/WifiEnabler.java
@@ -23,6 +23,7 @@
 import static android.net.wifi.WifiManager.WIFI_STATE_UNKNOWN;
 
 import com.android.settings.R;
+import com.android.settings.AirplaneModeEnabler;
 
 import android.content.BroadcastReceiver;
 import android.content.Context;
@@ -32,6 +33,7 @@
 import android.net.wifi.WifiManager;
 import android.preference.Preference;
 import android.preference.CheckBoxPreference;
+import android.provider.Settings;
 import android.text.TextUtils;
 import android.util.Config;
 import android.util.Log;
@@ -121,7 +123,7 @@
             mWifiCheckBoxPref
                     .setSummary(wifiState == WIFI_STATE_DISABLED ? mOriginalSummary : null);
             
-            mWifiCheckBoxPref.setEnabled(isEnabledByDependency());
+            mWifiCheckBoxPref.setEnabled(isWifiAllowed(mContext));
             
         } else if (wifiState == WIFI_STATE_DISABLING || wifiState == WIFI_STATE_ENABLING) {
             mWifiCheckBoxPref.setSummary(wifiState == WIFI_STATE_ENABLING ? R.string.wifi_starting
@@ -151,24 +153,23 @@
         }
     }
 
-    private boolean isEnabledByDependency() {
-        Preference dep = getDependencyPreference();
-        if (dep == null) {
+    private static boolean isWifiAllowed(Context context) {
+        // allowed if we are not in airplane mode
+        if (!AirplaneModeEnabler.isAirplaneModeOn(context)) {
             return true;
         }
-        
-        return !dep.shouldDisableDependents();
-    }
-    
-    private Preference getDependencyPreference() {
-        String depKey = mWifiCheckBoxPref.getDependency();
-        if (TextUtils.isEmpty(depKey)) {
-            return null;
+        // allowed if wifi is not in AIRPLANE_MODE_RADIOS
+        String radios = Settings.System.getString(context.getContentResolver(),
+                Settings.System.AIRPLANE_MODE_RADIOS);
+        if (radios == null || !radios.contains(Settings.System.RADIO_WIFI)) {
+            return true;
         }
-        
-        return mWifiCheckBoxPref.getPreferenceManager().findPreference(depKey);
+        // allowed if wifi is in AIRPLANE_MODE_TOGGLEABLE_RADIOS
+        radios = Settings.System.getString(context.getContentResolver(),
+                Settings.System.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
+        return (radios != null && radios.contains(Settings.System.RADIO_WIFI));
     }
-    
+
     private static String getHumanReadableWifiState(int wifiState) {
         switch (wifiState) {
             case WIFI_STATE_DISABLED:
diff --git a/src/com/android/settings/wifi/WifiLayer.java b/src/com/android/settings/wifi/WifiLayer.java
index 5d896aa..ce518e1 100644
--- a/src/com/android/settings/wifi/WifiLayer.java
+++ b/src/com/android/settings/wifi/WifiLayer.java
@@ -774,7 +774,9 @@
              * We pass null for security since we have a network ID (i.e., it's
              * not a wildcard), and rely on it matching.
              */
-            return findApLocked(wifiInfo.getNetworkId(), wifiInfo.getBSSID(), ssid, null);
+            synchronized (this) {
+                return findApLocked(wifiInfo.getNetworkId(), wifiInfo.getBSSID(), ssid, null);
+            }
         } else {
             return null;
         }
@@ -1013,8 +1015,10 @@
              * We pass null for security since we have a network ID (i.e., it's
              * not a wildcard), and rely on it matching.
              */
-            ap = findApLocked(wifiInfo.getNetworkId(), wifiInfo.getBSSID(), wifiInfo
-                    .getSSID(), null);
+            synchronized (this) {
+                ap = findApLocked(wifiInfo.getNetworkId(), wifiInfo.getBSSID(), wifiInfo
+                        .getSSID(), null);
+            }
         }
 
         if (ap != null) {
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index f18992a..adf4519 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -394,8 +394,8 @@
         }
         
         mDialog = dialog;
-        dialog.setOnDismissListener(this);
         if (dialog != null) {
+            dialog.setOnDismissListener(this);
             dialog.show();
         }
     }
