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

Commit c499e6df authored by Omair Kamil's avatar Omair Kamil Committed by Automerger Merge Worker
Browse files

Merge "Update removeConnection method to use the provided app ID when looking...

Merge "Update removeConnection method to use the provided app ID when looking for connections to remove." into main am: a024e4c3

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



Change-Id: Ib5078c1b2d670e9ca151cc7ba4b96b0f5772e79b
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 64903b80 a024e4c3
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import android.util.Log;


import com.android.bluetooth.BluetoothMethodProxy;
import com.android.bluetooth.flags.Flags;
import com.android.bluetooth.le_scan.AppScanStats;
import com.android.bluetooth.le_scan.TransitionalScanHelper;
import com.android.bluetooth.le_scan.TransitionalScanHelper.PendingIntentInfo;
@@ -335,6 +336,9 @@ public class ContextMap<C, T> {
     */
    void removeConnection(int id, int connId) {
        synchronized (mConnectionsLock) {
            if (Flags.bleContextMapRemoveFix()) {
                mConnections.removeIf(conn -> conn.appId == id && conn.connId == connId);
            } else {
                Iterator<Connection> i = mConnections.iterator();
                while (i.hasNext()) {
                    Connection connection = i.next();
@@ -345,6 +349,7 @@ public class ContextMap<C, T> {
                }
            }
        }
    }

    /**
     * Remove all connections for a given application ID.