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

Commit 406d4f91 authored by Stanley Tng's avatar Stanley Tng
Browse files

Remove BLE App entry from mBleApps list when App died

When a registered BLE App unexpectedly dies, its entry in mBleApps
list needs to be cleanup/removed.

Test: Manual test by repeatedly killing the gms core process.
Bug: 74076974
Change-Id: I2dc86b782dd6b07017a360a0b709504f0a375969
parent 3f23873b
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -640,6 +640,16 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
            if (DBG) {
                Slog.d(TAG, "Binder is dead - unregister " + mPackageName);
            }

            for (Map.Entry<IBinder, ClientDeathRecipient> entry : mBleApps.entrySet()) {
                IBinder token = entry.getKey();
                ClientDeathRecipient deathRec = entry.getValue();
                if (deathRec.equals(this)) {
                    mBleApps.remove(token);
                    break;
                }
            }

            if (isBleAppPresent()) {
                // Nothing to do, another app is here.
                return;