Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6aa53808 authored by Alice Kuo's avatar Alice Kuo Committed by Automerger Merge Worker
Browse files

Accept the pairing request automatically for the set member pairing am: 61460a1a

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1903832

Change-Id: I2cce585de893512005af7abf35f5729351512cea
parents f0b73dad 61460a1a
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@ import android.content.Intent;
import android.os.PowerManager;
import android.os.UserHandle;

import com.android.settingslib.bluetooth.LocalBluetoothManager;

/**
 * BluetoothPairingRequest is a receiver for any Bluetooth pairing request. It
 * checks if the Bluetooth Settings is currently visible and brings up the PIN, the passkey or a
@@ -47,9 +49,11 @@ public final class BluetoothPairingRequest extends BroadcastReceiver {
        boolean shouldShowDialog = LocalBluetoothPreferences.shouldShowDialogInForeground(
                context, deviceAddress, deviceName);

        final LocalBluetoothManager mBluetoothManager = Utils.getLocalBtManager(context);
        // Skips consent pairing dialog if the device was recently associated with CDM
        if (pairingVariant == BluetoothDevice.PAIRING_VARIANT_CONSENT
                && device.canBondWithoutDialog()) {
                && (device.canBondWithoutDialog()
                || mBluetoothManager.getCachedDeviceManager().isOngoingPairByCsip(device))) {
            device.setPairingConfirmation(true);
        } else if (powerManager.isInteractive() && shouldShowDialog) {
            // Since the screen is on and the BT-related activity is in the foreground,