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

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

Merge "Ensure LE scan clients are removed when the related app dies"

am: 310ff21b

Change-Id: I44ca3e5a4b8b24edc1095b043c158f9798085d3d
parents bea791fa 310ff21b
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -263,10 +263,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);

@@ -280,7 +276,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 */
                }