File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
packages/SystemUI/src/com/android/systemui/statusbar/policy Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ public class BluetoothController extends BroadcastReceiver {
3636
3737 private int mIconId = R .drawable .stat_sys_data_bluetooth ;
3838 private int mContentDescriptionId = 0 ;
39- private boolean mEnabled ;
39+ private boolean mEnabled = false ;
4040
4141 public BluetoothController (Context context ) {
4242 mContext = context ;
@@ -47,8 +47,10 @@ public BluetoothController(Context context) {
4747 context .registerReceiver (this , filter );
4848
4949 final BluetoothAdapter adapter = BluetoothAdapter .getDefaultAdapter ();
50- handleAdapterStateChange (adapter .getState ());
51- handleConnectionStateChange (adapter .getConnectionState ());
50+ if (adapter != null ) {
51+ handleAdapterStateChange (adapter .getState ());
52+ handleConnectionStateChange (adapter .getConnectionState ());
53+ }
5254 refreshViews ();
5355 }
5456
You can’t perform that action at this time.
0 commit comments