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

Commit 6eea5f95 authored by Angela Wang's avatar Angela Wang Committed by Automerger Merge Worker
Browse files

Merge "Ignore ASHA hisyncId grouping if the device supports CSIP" into udc-qpr-dev am: b30815d3

parents 5e1b5698 b30815d3
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -1518,10 +1518,15 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
     *                      list.
     */
    public void switchMemberDeviceContent(CachedBluetoothDevice newMainDevice) {
        // Backup from main device
        // Remove the sub device from mMemberDevices first to prevent hash mismatch problem due
        // to mDevice switch
        removeMemberDevice(newMainDevice);

        // Backup from current main device
        final BluetoothDevice tmpDevice = mDevice;
        final short tmpRssi = mRssi;
        final boolean tmpJustDiscovered = mJustDiscovered;

        // Set main device from sub device
        release();
        mDevice = newMainDevice.mDevice;
@@ -1535,6 +1540,9 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
        newMainDevice.mRssi = tmpRssi;
        newMainDevice.mJustDiscovered = tmpJustDiscovered;
        newMainDevice.fillData();

        // Add the sub device back into mMemberDevices with correct hash
        addMemberDevice(newMainDevice);
    }

    /**
+8 −0
Original line number Diff line number Diff line
@@ -186,6 +186,14 @@ public class HearingAidDeviceManager {
            if (cachedDevice.getHiSyncId() != hiSyncId) {
                continue;
            }

            // The remote device supports CSIP, the other ear should be processed as a member
            // device. Ignore hiSyncId grouping from ASHA here.
            if (cachedDevice.getProfiles().stream().anyMatch(
                    profile -> profile instanceof CsipSetCoordinatorProfile)) {
                continue;
            }

            if (firstMatchedIndex == -1) {
                // Found the first one
                firstMatchedIndex = i;