Loading android/app/src/com/android/bluetooth/gatt/ContextMap.java +17 −0 Original line number Diff line number Diff line Loading @@ -133,6 +133,23 @@ import java.util.UUID; } } /** * Remove the context for a given UUID */ void remove(UUID uuid) { synchronized (mApps) { Iterator<App> i = mApps.iterator(); while(i.hasNext()) { App entry = i.next(); if (entry.uuid.equals(uuid)) { entry.unlinkToDeath(); i.remove(); break; } } } } /** * Remove the context for a given application ID. */ Loading android/app/src/com/android/bluetooth/gatt/GattService.java +6 −2 Original line number Diff line number Diff line Loading @@ -638,8 +638,12 @@ public class GattService extends ProfileService { if (DBG) Log.d(TAG, "onClientRegistered() - UUID=" + uuid + ", clientIf=" + clientIf); ClientMap.App app = mClientMap.getByUuid(uuid); if (app != null) { if (status == 0) { app.id = clientIf; app.linkToDeath(new ClientDeathRecipient(clientIf)); } else { mClientMap.remove(uuid); } app.callback.onClientRegistered(status, clientIf); } } Loading Loading
android/app/src/com/android/bluetooth/gatt/ContextMap.java +17 −0 Original line number Diff line number Diff line Loading @@ -133,6 +133,23 @@ import java.util.UUID; } } /** * Remove the context for a given UUID */ void remove(UUID uuid) { synchronized (mApps) { Iterator<App> i = mApps.iterator(); while(i.hasNext()) { App entry = i.next(); if (entry.uuid.equals(uuid)) { entry.unlinkToDeath(); i.remove(); break; } } } } /** * Remove the context for a given application ID. */ Loading
android/app/src/com/android/bluetooth/gatt/GattService.java +6 −2 Original line number Diff line number Diff line Loading @@ -638,8 +638,12 @@ public class GattService extends ProfileService { if (DBG) Log.d(TAG, "onClientRegistered() - UUID=" + uuid + ", clientIf=" + clientIf); ClientMap.App app = mClientMap.getByUuid(uuid); if (app != null) { if (status == 0) { app.id = clientIf; app.linkToDeath(new ClientDeathRecipient(clientIf)); } else { mClientMap.remove(uuid); } app.callback.onClientRegistered(status, clientIf); } } Loading