b/2367861 Auto connect if the user turns on BT while docked.
Change-Id: I855d0448af9c9c665fb8288c83cd13ae9c3d6050
This commit is contained in:
@@ -27,7 +27,7 @@ import android.util.Log;
|
||||
|
||||
public class DockEventReceiver extends BroadcastReceiver {
|
||||
|
||||
private static final boolean DEBUG = false;
|
||||
private static final boolean DEBUG = DockService.DEBUG;
|
||||
|
||||
private static final String TAG = "DockEventReceiver";
|
||||
|
||||
@@ -74,6 +74,13 @@ public class DockEventReceiver extends BroadcastReceiver {
|
||||
if (DEBUG) Log.e(TAG, "Unknown state");
|
||||
break;
|
||||
}
|
||||
} else if (BluetoothAdapter.ACTION_STATE_CHANGED.equals(intent.getAction())) {
|
||||
int btState = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR);
|
||||
if (btState == BluetoothAdapter.STATE_ON) {
|
||||
Intent i = new Intent(intent);
|
||||
i.setClass(context, DockService.class);
|
||||
beginStartingService(context, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user