Show Bluetooth dialog in a specific case

If the application that initiate the bonding with
BluetoothDevice#createBond is in foreground, then should dialog only
instead of showing the notification & dialog

Bug: 175931562
Tag: #refactor
Test: manual
Change-Id: I3673a0b58cbf9caabf62c951b84b49e17cfb13b8
This commit is contained in:
My Name
2023-02-07 01:58:16 +00:00
committed by Hieu Dang
parent b0ddc1833d
commit 2e552331e9
3 changed files with 22 additions and 8 deletions

View File

@@ -108,8 +108,6 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver {
mRequestType);
connectionAccessIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mDevice);
String deviceAddress = mDevice != null ? mDevice.getAddress() : null;
String deviceName = mDevice != null ? mDevice.getName() : null;
String title = null;
String message = null;
PowerManager powerManager =
@@ -117,7 +115,7 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver {
if (powerManager.isScreenOn()
&& LocalBluetoothPreferences.shouldShowDialogInForeground(
context, deviceAddress, deviceName)) {
context, mDevice)) {
context.startActivity(connectionAccessIntent);
} else {
// Put up a notification that leads to the dialog