Merge change 26878 into eclair

* changes:
  b/2140751 Fixed the problem where BT device icon was showing until pairing happens (actually UUID comes in to be exact)
diff --git a/res/drawable-hdpi/ic_settings_privacy.png b/res/drawable-hdpi/ic_settings_privacy.png
new file mode 100644
index 0000000..5fb60c2
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_privacy.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_privacy.png b/res/drawable-mdpi/ic_settings_privacy.png
new file mode 100644
index 0000000..30ba317
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_privacy.png
Binary files differ
diff --git a/res/xml/device_info_settings.xml b/res/xml/device_info_settings.xml
index 81d33b2..56810b4 100644
--- a/res/xml/device_info_settings.xml
+++ b/res/xml/device_info_settings.xml
@@ -120,13 +120,4 @@
                 android:title="@string/build_number"
                 android:summary="@string/device_info_default"/>
 
-        <!-- Factory reset -->
-        <PreferenceScreen 
-            android:title="@string/master_clear_title" 
-            android:summary="@string/master_clear_summary">
-            <intent android:action="android.intent.action.MAIN"
-                android:targetPackage="com.android.settings"
-                android:targetClass="com.android.settings.MasterClear" />
-        </PreferenceScreen>
-
 </PreferenceScreen>
diff --git a/src/com/android/settings/bluetooth/LocalBluetoothManager.java b/src/com/android/settings/bluetooth/LocalBluetoothManager.java
index 775b120..e7be43d 100644
--- a/src/com/android/settings/bluetooth/LocalBluetoothManager.java
+++ b/src/com/android/settings/bluetooth/LocalBluetoothManager.java
@@ -79,6 +79,8 @@
                 return null;
             }
 
+            LocalBluetoothProfileManager.init(INSTANCE);
+
             return INSTANCE;
         }
     }
diff --git a/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java b/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java
index 2f8fbe3..f3dea85 100644
--- a/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java
+++ b/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java
@@ -22,6 +22,7 @@
 import android.bluetooth.BluetoothUuid;
 import android.bluetooth.ParcelUuid;
 import android.os.Handler;
+import android.util.Log;
 
 import com.android.settings.R;
 
@@ -57,34 +58,35 @@
 
     protected LocalBluetoothManager mLocalManager;
 
-    public static LocalBluetoothProfileManager getProfileManager(LocalBluetoothManager localManager,
-            Profile profile) {
-
-        LocalBluetoothProfileManager profileManager;
-
+    public static void init(LocalBluetoothManager localManager) {
         synchronized (sProfileMap) {
-            profileManager = sProfileMap.get(profile);
+            if (sProfileMap.size() == 0) {
+                LocalBluetoothProfileManager profileManager;
 
-            if (profileManager == null) {
-                switch (profile) {
-                case A2DP:
-                    profileManager = new A2dpProfileManager(localManager);
-                    break;
+                profileManager = new A2dpProfileManager(localManager);
+                sProfileMap.put(Profile.A2DP, profileManager);
 
-                case HEADSET:
-                    profileManager = new HeadsetProfileManager(localManager);
-                    break;
+                profileManager = new HeadsetProfileManager(localManager);
+                sProfileMap.put(Profile.HEADSET, profileManager);
 
-                case OPP:
-                    profileManager = new OppProfileManager(localManager);
-                    break;
-                }
-
-                sProfileMap.put(profile, profileManager);
+                profileManager = new OppProfileManager(localManager);
+                sProfileMap.put(Profile.OPP, profileManager);
             }
         }
+    }
 
-        return profileManager;
+    public static LocalBluetoothProfileManager getProfileManager(LocalBluetoothManager localManager,
+            Profile profile) {
+        // Note: This code assumes that "localManager" is same as the
+        // LocalBluetoothManager that was used to initialize the sProfileMap.
+        // If that every changes, we can't just keep one copy of sProfileMap.
+        synchronized (sProfileMap) {
+            LocalBluetoothProfileManager profileManager = sProfileMap.get(profile);
+            if (profileManager == null) {
+                Log.e(TAG, "profileManager can't be found for " + profile.toString());
+            }
+            return profileManager;
+        }
     }
 
     /**