diff options
author | Jesse Hall <jessehall@google.com> | 2011-12-05 21:27:30 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-12-05 21:27:30 -0800 |
commit | 4a3d5b04daa74dc3bd5084b3395892b5565e6288 (patch) | |
tree | 886e218e3f66ba70e5f9d0fc2344834f199d3098 | |
parent | 1c2bfd4af9da972895830888cd9ab3426af9062f (diff) | |
parent | 2eb4a5ee5bebf4120de217adf5a9f72b0c94951b (diff) | |
download | frameworks_base-4a3d5b04daa74dc3bd5084b3395892b5565e6288.zip frameworks_base-4a3d5b04daa74dc3bd5084b3395892b5565e6288.tar.gz frameworks_base-4a3d5b04daa74dc3bd5084b3395892b5565e6288.tar.bz2 |
am 2eb4a5ee: am 3e7b412d: Merge "Fix statusbar crash on devices with no Bluetooth" into ics-mr1
* commit '2eb4a5ee5bebf4120de217adf5a9f72b0c94951b':
Fix statusbar crash on devices with no Bluetooth
-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(); } |