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

Commit 4c82914b authored by Himanshu Rawat's avatar Himanshu Rawat Committed by Gerrit Code Review
Browse files

Merge "Retain identity address in device properties on BT restart" into main

parents f71c22ff ce429263
Loading
Loading
Loading
Loading
+14 −7
Original line number Diff line number Diff line
@@ -1183,8 +1183,10 @@ public class RemoteDevices {
    }

    void addressConsolidateCallback(byte[] mainAddress, byte[] secondaryAddress) {
        DeviceProperties deviceProperties;
        BluetoothDevice device = getDevice(mainAddress);
        if (device == null) {
            if (!Flags.identityRetentionOnRestart()) {
                errorLog(
                        "addressConsolidateCallback: device is NULL, address="
                                + Utils.getRedactedAddressStringFromByte(mainAddress)
@@ -1192,6 +1194,12 @@ public class RemoteDevices {
                                + Utils.getRedactedAddressStringFromByte(secondaryAddress));
                return;
            }

            deviceProperties = addDeviceProperties(mainAddress);
            device = deviceProperties.getDevice();
        } else {
            deviceProperties = getDeviceProperties(device);
        }
        Log.d(
                TAG,
                "addressConsolidateCallback device: "
@@ -1199,7 +1207,6 @@ public class RemoteDevices {
                        + ", secondaryAddress:"
                        + Utils.getRedactedAddressStringFromByte(secondaryAddress));

        DeviceProperties deviceProperties = getDeviceProperties(device);
        deviceProperties.setIsConsolidated(true);
        deviceProperties.setDeviceType(BluetoothDevice.DEVICE_TYPE_DUAL);
        deviceProperties.setIdentityAddress(Utils.getAddressStringFromByte(secondaryAddress));