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

Commit 1ae1a22a 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 am: c499e6df

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



Change-Id: Ieea29fe43194eb5a264a84c5d58f8cd371d3626a
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 789b63a3 c499e6df
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.