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:
@@ -36,7 +36,7 @@ public class BluetoothController extends BroadcastReceiver {
|
|||||||
|
|
||||||
private int mIconId = R.drawable.stat_sys_data_bluetooth;
|
private int mIconId = R.drawable.stat_sys_data_bluetooth;
|
||||||
private int mContentDescriptionId = 0;
|
private int mContentDescriptionId = 0;
|
||||||
private boolean mEnabled;
|
private boolean mEnabled = false;
|
||||||
|
|
||||||
public BluetoothController(Context context) {
|
public BluetoothController(Context context) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
@@ -47,8 +47,10 @@ public class BluetoothController extends BroadcastReceiver {
|
|||||||
context.registerReceiver(this, filter);
|
context.registerReceiver(this, filter);
|
||||||
|
|
||||||
final BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
|
final BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
|
||||||
handleAdapterStateChange(adapter.getState());
|
if (adapter != null) {
|
||||||
handleConnectionStateChange(adapter.getConnectionState());
|
handleAdapterStateChange(adapter.getState());
|
||||||
|
handleConnectionStateChange(adapter.getConnectionState());
|
||||||
|
}
|
||||||
refreshViews();
|
refreshViews();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user