From cb844e2eab4efa03513c0e0a2de7bc18c79dd128 Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Thu, 24 Sep 2009 11:39:34 -0700 Subject: [PATCH] b/2140751 Fixed the problem where BT device icon was showing until pairing happens (actually UUID comes in to be exact) Change-Id: I670f29d5f9a577ec177b049cfd9c775bf91b60c3 --- .../bluetooth/CachedBluetoothDevice.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java index e70f85f70f2..0582aa1f261 100644 --- a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java +++ b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java @@ -610,13 +610,22 @@ public class CachedBluetoothDevice implements Comparable return R.drawable.ic_bt_cellphone; } - 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; + if (mProfiles.size() > 0) { + 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; + if (mBtClass.doesClassMatch(BluetoothClass.PROFILE_A2DP)) { + return R.drawable.ic_bt_headphones_a2dp; + + } + if (mBtClass.doesClassMatch(BluetoothClass.PROFILE_HEADSET)) { + return R.drawable.ic_bt_headset_hfp; + } } + return 0; } /**