diff options
author | Jesse Hall <jessehall@google.com> | 2011-12-05 11:10:32 -0800 |
---|---|---|
committer | Jesse Hall <jessehall@google.com> | 2011-12-05 11:10:32 -0800 |
commit | 564f16a8d71b79b5e07a597a8f188efa8d80a0ee (patch) | |
tree | 323ba31bf746f1180a7b5cf98971a3c44c742afa /packages/SystemUI | |
parent | f57c1388860486a70cc773f2cfeaa3ea3b38a473 (diff) | |
download | frameworks_base-564f16a8d71b79b5e07a597a8f188efa8d80a0ee.zip frameworks_base-564f16a8d71b79b5e07a597a8f188efa8d80a0ee.tar.gz frameworks_base-564f16a8d71b79b5e07a597a8f188efa8d80a0ee.tar.bz2 |
Fix statusbar crash on devices with no Bluetooth
Change-Id: Ib2290f9cde54d0d52c2692b11b0232848bbbc8b0
Diffstat (limited to 'packages/SystemUI')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothController.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothController.java index 903a300..603808e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothController.java @@ -36,7 +36,7 @@ public class BluetoothController extends BroadcastReceiver { private int mIconId = R.drawable.stat_sys_data_bluetooth; private int mContentDescriptionId = 0; - private boolean mEnabled; + private boolean mEnabled = false; public BluetoothController(Context context) { mContext = context; @@ -47,8 +47,10 @@ public class BluetoothController extends BroadcastReceiver { context.registerReceiver(this, filter); final BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); - handleAdapterStateChange(adapter.getState()); - handleConnectionStateChange(adapter.getConnectionState()); + if (adapter != null) { + handleAdapterStateChange(adapter.getState()); + handleConnectionStateChange(adapter.getConnectionState()); + } refreshViews(); } |