summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorMichael Chan <mchan@android.com>2009-11-04 17:19:48 -0800
committerMichael Chan <mchan@android.com>2009-11-04 17:19:48 -0800
commit4d004e910732565ddd449c7c525f7d6cbd353392 (patch)
tree4004f36bc201279e98c32be994671932dedb72bc /src/com
parent9d6be2baf517462d2cce818c21b25958a40e4f06 (diff)
downloadpackages_apps_Settings-4d004e910732565ddd449c7c525f7d6cbd353392.zip
packages_apps_Settings-4d004e910732565ddd449c7c525f7d6cbd353392.tar.gz
packages_apps_Settings-4d004e910732565ddd449c7c525f7d6cbd353392.tar.bz2
b/2238546 Fixed NPE in Settings when Bluetooth "class" is null
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/settings/bluetooth/CachedBluetoothDevice.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java
index 1b45628..03328b5 100644
--- a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java
+++ b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java
@@ -616,12 +616,16 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
}
public int getBtClassDrawable() {
- switch (mBtClass.getMajorDeviceClass()) {
- case BluetoothClass.Device.Major.COMPUTER:
- return R.drawable.ic_bt_laptop;
+ if (mBtClass != null) {
+ switch (mBtClass.getMajorDeviceClass()) {
+ case BluetoothClass.Device.Major.COMPUTER:
+ return R.drawable.ic_bt_laptop;
- case BluetoothClass.Device.Major.PHONE:
- return R.drawable.ic_bt_cellphone;
+ case BluetoothClass.Device.Major.PHONE:
+ return R.drawable.ic_bt_cellphone;
+ }
+ } else {
+ Log.w(TAG, "mBtClass is null");
}
if (mProfiles.size() > 0) {
@@ -630,7 +634,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
} else if (mProfiles.contains(Profile.HEADSET)) {
return R.drawable.ic_bt_headset_hfp;
}
- } else {
+ } else if (mBtClass != null) {
if (mBtClass.doesClassMatch(BluetoothClass.PROFILE_A2DP)) {
return R.drawable.ic_bt_headphones_a2dp;