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

Commit dba5c339 authored by Andre Eisenbach's avatar Andre Eisenbach Committed by Android Git Automerger
Browse files

am 36be12f9: am ba6cc96d: am 23755a67: Merge "Remove GATT context if client...

am 36be12f9: am ba6cc96d: am 23755a67: Merge "Remove GATT context if client registration did not succeed" into lmp-mr1-dev

* commit '36be12f9':
  Remove GATT context if client registration did not succeed
parents e4023e9c 36be12f9
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -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.
     */
+6 −2
Original line number Diff line number Diff line
@@ -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);
        }
    }