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

Commit 82bae21a authored by Himanshu Rawat's avatar Himanshu Rawat Committed by Gerrit Code Review
Browse files

Merge "Retain identity address LE-only devices on BT restart" into main

parents 7e7e0c1a de51a229
Loading
Loading
Loading
Loading
+15 −9
Original line number Diff line number Diff line
@@ -1224,8 +1224,10 @@ public class RemoteDevices {
     */
    void leAddressAssociateCallback(
            byte[] mainAddress, byte[] secondaryAddress, int identityAddressTypeFromNative) {
        DeviceProperties deviceProperties;
        BluetoothDevice device = getDevice(mainAddress);
        if (device == null) {
            if (!Flags.identityRetentionOnRestart()) {
                errorLog(
                        "leAddressAssociateCallback: device is NULL, address="
                                + Utils.getRedactedAddressStringFromByte(mainAddress)
@@ -1235,6 +1237,11 @@ public class RemoteDevices {
                                + identityAddressTypeFromNative);
                return;
            }
            deviceProperties = addDeviceProperties(mainAddress);
            device = deviceProperties.getDevice();
        } else {
            deviceProperties = getDeviceProperties(device);
        }
        Log.d(
                TAG,
                "leAddressAssociateCallback device: "
@@ -1244,7 +1251,6 @@ public class RemoteDevices {
                        + ", identityAddressTypeFromNative="
                        + identityAddressTypeFromNative);

        DeviceProperties deviceProperties = getDeviceProperties(device);
        deviceProperties.setIdentityAddress(Utils.getAddressStringFromByte(secondaryAddress));
        deviceProperties.setIdentityAddressTypeFromNative(identityAddressTypeFromNative);
    }