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

Commit dd7efc32 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic "cleanup-ble-app-list-at-death" into pi-dev

* changes:
  Calls unlinkToDeath in binderDied to deregister
  Remove BLE App entry from mBleApps list when App died
parents ad06c5f6 600109cb
Loading
Loading
Loading
Loading
+7 −16
Original line number Original line Diff line number Diff line
@@ -632,23 +632,14 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
            if (DBG) {
            if (DBG) {
                Slog.d(TAG, "Binder is dead - unregister " + mPackageName);
                Slog.d(TAG, "Binder is dead - unregister " + mPackageName);
            }
            }
            if (isBleAppPresent()) {

                // Nothing to do, another app is here.
            for (Map.Entry<IBinder, ClientDeathRecipient> entry : mBleApps.entrySet()) {
                return;
                IBinder token = entry.getKey();
            }
                ClientDeathRecipient deathRec = entry.getValue();
            if (DBG) {
                if (deathRec.equals(this)) {
                Slog.d(TAG, "Disabling LE only mode after application crash");
                    updateBleAppCount(token, false, mPackageName);
            }
                    break;
            try {
                mBluetoothLock.readLock().lock();
                if (mBluetooth != null && mBluetooth.getState() == BluetoothAdapter.STATE_BLE_ON) {
                    mEnable = false;
                    mBluetooth.onBrEdrDown();
                }
                }
            } catch (RemoteException e) {
                Slog.e(TAG, "Unable to call onBrEdrDown", e);
            } finally {
                mBluetoothLock.readLock().unlock();
            }
            }
        }
        }