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

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

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

Merge "Retain identity address LE-only devices on BT restart" into main am: 82bae21a am: aad59980

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3416464



Change-Id: Ie77fe9305b3fb3f13ec1eb143f92b143e1ad1ffa
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 6197b6f1 aad59980
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);
    }