am 3e7b412d: Merge "Fix statusbar crash on devices with no Bluetooth" into ics-mr1

* commit '3e7b412d7d6332830ceaf123edb5e211757c69ce':
  Fix statusbar crash on devices with no Bluetooth
This commit is contained in:
Jesse Hall
2011-12-05 21:24:53 -08:00
committed by Android Git Automerger

View File

@@ -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();
}