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

Commit 5913f476 authored by Himanshu Rawat's avatar Himanshu Rawat Committed by Automerger Merge Worker
Browse files

Merge "Log instances where removebond API is ignored" into main am: bde5aaf2 am: 52519f88

parents da2fb405 52519f88
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ import static com.android.bluetooth.Utils.getBytesFromAddress;
import static com.android.bluetooth.Utils.hasBluetoothPrivilegedPermission;
import static com.android.bluetooth.Utils.isDualModeAudioEnabled;
import static com.android.bluetooth.Utils.isPackageNameAccurate;

import static java.util.Objects.requireNonNull;

import android.annotation.NonNull;
@@ -2801,6 +2800,13 @@ public class AdapterService extends Service {

            DeviceProperties deviceProp = service.mRemoteDevices.getDeviceProperties(device);
            if (deviceProp == null || deviceProp.getBondState() != BluetoothDevice.BOND_BONDED) {
                Log.w(
                        TAG,
                        device.getAddressForLogging()
                                + " cannot be removed since "
                                + ((deviceProp == null)
                                        ? "properties are empty"
                                        : "bond state is " + deviceProp.getBondState()));
                return false;
            }
            service.mBondAttemptCallerInfo.remove(device.getAddress());
+8 −0
Original line number Diff line number Diff line
@@ -343,6 +343,14 @@ final class BondStateMachine extends StateMachine {
                return true;
            }
        }

        Log.w(
                TAG,
                dev.getAddressForLogging()
                        + " cannot be removed since "
                        + ((devProp == null)
                                ? "properties are empty"
                                : "bond state is " + devProp.getBondState()));
        return false;
    }