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

Commit 3e071383 authored by Himanshu Rawat's avatar Himanshu Rawat
Browse files

Log instances where removebond API is ignored

Test: m com.android.btservices
Bug: 282061758
Change-Id: I43317d2f3b41588a17bf40f8d1591e22d8aa31dc
parent 5b4d1008
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;
    }