Bluetooth: Add pairing initiator extra
Bug: 150156492 Test: pair two devices, unpair on one device, try to reconnect Change-Id: I96379d0afe5b624f09e2825dedaef8f9883a924c
This commit is contained in:
@@ -37,9 +37,6 @@ public final class BluetoothPairingRequest extends BroadcastReceiver {
|
||||
if (!action.equals(BluetoothDevice.ACTION_PAIRING_REQUEST)) {
|
||||
return;
|
||||
}
|
||||
// convert broadcast intent into activity intent (same action string)
|
||||
Intent pairingIntent = BluetoothPairingService.getPairingDialogIntent(context, intent);
|
||||
|
||||
PowerManager powerManager =
|
||||
(PowerManager)context.getSystemService(Context.POWER_SERVICE);
|
||||
BluetoothDevice device =
|
||||
@@ -51,6 +48,10 @@ public final class BluetoothPairingRequest extends BroadcastReceiver {
|
||||
if (powerManager.isInteractive() && shouldShowDialog) {
|
||||
// Since the screen is on and the BT-related activity is in the foreground,
|
||||
// just open the dialog
|
||||
// convert broadcast intent into activity intent (same action string)
|
||||
Intent pairingIntent = BluetoothPairingService.getPairingDialogIntent(context, intent,
|
||||
BluetoothDevice.EXTRA_PAIRING_INITIATOR_FOREGROUND);
|
||||
|
||||
context.startActivityAsUser(pairingIntent, UserHandle.CURRENT);
|
||||
} else {
|
||||
// Put up a notification that leads to the dialog
|
||||
|
Reference in New Issue
Block a user