b/2226832 Showing Pairing Dialog in the foreground
Pairing Dialogs notifications (in the window shade) were not visible in full screen apps e.g. gallery. Showing Pairing Dialog in the foreground: 1) if the remote device was picked in the device picker in the last minute or 2) if the device was in discoverable mode in the last minute.
This commit is contained in:
@@ -21,7 +21,6 @@ import com.android.settings.R;
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.bluetooth.BluetoothClass;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
@@ -62,7 +61,8 @@ public class BluetoothPairingRequest extends BroadcastReceiver {
|
||||
pairingIntent.setAction(BluetoothDevice.ACTION_PAIRING_REQUEST);
|
||||
pairingIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
|
||||
if (localManager.getForegroundActivity() != null) {
|
||||
String deviceAddress = device != null ? device.getAddress() : null;
|
||||
if (localManager.shouldShowDialogInForeground(deviceAddress)) {
|
||||
// Since the BT-related activity is in the foreground, just open the dialog
|
||||
context.startActivity(pairingIntent);
|
||||
|
||||
|
Reference in New Issue
Block a user