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

Commit 626e2f53 authored by Andre Eisenbach's avatar Andre Eisenbach Committed by android-build-merger
Browse files

Merge "Fix cleanup of dead GATT clients" am: 529ae49e am: 25a2c7c8

am: 904f0b50

Change-Id: I7a87ceffb64611b64e148915f15face79ef8b077
parents 7deedef3 904f0b50
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -305,6 +305,19 @@ public class GattService extends ProfileService {
        }
    }

    class ClientDeathRecipient implements IBinder.DeathRecipient {
        int mAppIf;

        public ClientDeathRecipient(int appIf) {
            mAppIf = appIf;
        }

        public void binderDied() {
            if (DBG) Log.d(TAG, "Binder is dead - unregistering client (" + mAppIf + ")!");
            unregisterClient(mAppIf);
        }
    }

    /**
     * Handlers for incoming service calls
     */
@@ -675,6 +688,7 @@ public class GattService extends ProfileService {
        if (app != null) {
            if (status == 0) {
                app.id = clientIf;
                app.linkToDeath(new ClientDeathRecipient(clientIf));
            } else {
                mClientMap.remove(uuid);
            }