Always show pairing dialog for device-specific keyboard.

Bug: 22876536
Change-Id: Ief9f6343d435747050bb7910f934e4777f5116de
This commit is contained in:
Michael Wright
2015-09-10 16:08:49 +01:00
parent 48422b52f3
commit dab743b95c
3 changed files with 26 additions and 10 deletions

View File

@@ -65,8 +65,10 @@ public final class BluetoothPairingRequest extends BroadcastReceiver {
PowerManager powerManager =
(PowerManager)context.getSystemService(Context.POWER_SERVICE);
String deviceAddress = device != null ? device.getAddress() : null;
if (powerManager.isScreenOn() &&
LocalBluetoothPreferences.shouldShowDialogInForeground(context, deviceAddress)) {
String deviceName = device != null ? device.getName() : null;
boolean shouldShowDialog= LocalBluetoothPreferences.shouldShowDialogInForeground(
context, deviceAddress, deviceName);
if (powerManager.isInteractive() && shouldShowDialog) {
// Since the screen is on and the BT-related activity is in the foreground,
// just open the dialog
context.startActivity(pairingIntent);