summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2011-12-05 21:23:29 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-12-05 21:23:29 -0800
commit3e7b412d7d6332830ceaf123edb5e211757c69ce (patch)
treee2bac9273423242f0161158c3d8457b48a082d82 /packages
parent0d9a41e74c81e8297ee439473c301a50da20cf0b (diff)
parent564f16a8d71b79b5e07a597a8f188efa8d80a0ee (diff)
downloadframeworks_base-3e7b412d7d6332830ceaf123edb5e211757c69ce.zip
frameworks_base-3e7b412d7d6332830ceaf123edb5e211757c69ce.tar.gz
frameworks_base-3e7b412d7d6332830ceaf123edb5e211757c69ce.tar.bz2
Merge "Fix statusbar crash on devices with no Bluetooth" into ics-mr1
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothController.java8
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();
}