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

Commit 434af06a authored by Andre Eisenbach's avatar Andre Eisenbach Committed by android-build-merger
Browse files

Ensure LE scan clients are removed when the related app dies

am: a75cf68a

Change-Id: I1e88954325ae3483442391357579fbf614805e46
parents ae5a4fdc a75cf68a
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -253,10 +253,6 @@ public class ScanManager {
            if (client == null) return;

            if (mRegularScanClients.contains(client)) {
                // The ScanClient passed in just holds the clientIf. We retrieve the real client,
                // which may have workSource set.
                client = mScanNative.getRegularScanClient(client.clientIf);
                if (client == null) return;

                mScanNative.stopRegularScan(client);

@@ -270,7 +266,11 @@ public class ScanManager {

                // Update BatteryStats with this workload.
                try {
                    mBatteryStats.noteBleScanStopped(client.workSource);
                    // The ScanClient passed in just holds the clientIf. We retrieve the real client,
                    // which may have workSource set.
                    ScanClient workClient = mScanNative.getRegularScanClient(client.clientIf);
                    if (workClient != null)
                        mBatteryStats.noteBleScanStopped(workClient.workSource);
                } catch (RemoteException e) {
                    /* ignore */
                }