Loading android/app/src/com/android/bluetooth/gatt/ContextMap.java +11 −2 Original line number Diff line number Diff line Loading @@ -222,12 +222,13 @@ import java.util.UUID; * Remove the context for a given application ID. */ void remove(int id) { boolean find = false; synchronized (mApps) { Iterator<App> i = mApps.iterator(); while (i.hasNext()) { App entry = i.next(); if (entry.id == id) { removeConnectionsByAppId(id); find = true; entry.unlinkToDeath(); entry.appScanStats.isRegistered = false; i.remove(); Loading @@ -235,6 +236,9 @@ import java.util.UUID; } } } if (find) { removeConnectionsByAppId(id); } } List<Integer> getAllAppsIds() { Loading Loading @@ -397,14 +401,19 @@ import java.util.UUID; * Get an application context by a connection ID. */ App getByConnId(int connId) { int appId = -1; synchronized (mConnections) { Iterator<Connection> ii = mConnections.iterator(); while (ii.hasNext()) { Connection connection = ii.next(); if (connection.connId == connId) { return getById(connection.appId); appId = connection.appId; break; } } } if (appId >= 0) { return getById(appId); } return null; } Loading Loading
android/app/src/com/android/bluetooth/gatt/ContextMap.java +11 −2 Original line number Diff line number Diff line Loading @@ -222,12 +222,13 @@ import java.util.UUID; * Remove the context for a given application ID. */ void remove(int id) { boolean find = false; synchronized (mApps) { Iterator<App> i = mApps.iterator(); while (i.hasNext()) { App entry = i.next(); if (entry.id == id) { removeConnectionsByAppId(id); find = true; entry.unlinkToDeath(); entry.appScanStats.isRegistered = false; i.remove(); Loading @@ -235,6 +236,9 @@ import java.util.UUID; } } } if (find) { removeConnectionsByAppId(id); } } List<Integer> getAllAppsIds() { Loading Loading @@ -397,14 +401,19 @@ import java.util.UUID; * Get an application context by a connection ID. */ App getByConnId(int connId) { int appId = -1; synchronized (mConnections) { Iterator<Connection> ii = mConnections.iterator(); while (ii.hasNext()) { Connection connection = ii.next(); if (connection.connId == connId) { return getById(connection.appId); appId = connection.appId; break; } } } if (appId >= 0) { return getById(appId); } return null; } Loading