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

Commit 9987ebfa authored by Kihong Seong's avatar Kihong Seong Committed by Gerrit Code Review
Browse files

Merge "Fix AdapterPropertiesTest#testCleanupPrevBondRecordsFor" into main

parents 7e4e72ba b7681157
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -237,6 +237,19 @@ public final class Utils {
        return identity != null ? identity : address;
    }

    /**
     * Returns the correct device address to be used for connections over BR/EDR transport.
     *
     * @param device the device for which to obtain the connection address
     * @param service the adapter service to make the identity address retrieval call
     * @return either identity address or device address in String format
     */
    public static String getBrEdrAddress(BluetoothDevice device, AdapterService service) {
        final String address = device.getAddress();
        String identity = service.getIdentityAddress(address);
        return identity != null ? identity : address;
    }

    /**
     * Returns the correct device address to be used for connections over BR/EDR transport.
     *
+2 −2
Original line number Diff line number Diff line
@@ -672,7 +672,7 @@ class AdapterProperties {
        String currentAddress = currentDevice.getAddress();
        String currentBrEdrAddress =
                Flags.identityAddressNullIfUnknown()
                        ? Utils.getBrEdrAddress(currentDevice)
                        ? Utils.getBrEdrAddress(currentDevice, mService)
                        : mService.getIdentityAddress(currentAddress);
        debugLog("cleanupPrevBondRecordsFor: " + currentDevice);
        if (currentBrEdrAddress == null) {
@@ -683,7 +683,7 @@ class AdapterProperties {
            String address = device.getAddress();
            String brEdrAddress =
                    Flags.identityAddressNullIfUnknown()
                            ? Utils.getBrEdrAddress(device)
                            ? Utils.getBrEdrAddress(device, mService)
                            : mService.getIdentityAddress(address);
            if (currentBrEdrAddress.equals(brEdrAddress) && !currentAddress.equals(address)) {
                if (mService.getNative()