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

Commit 2c5fd28b authored by Stanley Tng's avatar Stanley Tng Committed by Myles Watson
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
(cherry picked from commit 73a16514)
parent 3991138f
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -632,6 +632,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;