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

Commit 021a59c7 authored by Wei Wang's avatar Wei Wang Committed by Andre Eisenbach
Browse files

Fix a bug where batch scan wasn't stopped correctly.

Stop batch was broken as the current logic tried to find
batch client information from regular scan clients when
stopping scans.

Bug:27209867
Change-Id: I935119950de1d839a6cfce672dfc00f4540f21dc
parent d8526d67
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -235,12 +235,12 @@ public class ScanManager {
            Utils.enforceAdminPermission(mService);
            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.getClient(client.clientIf);
                client = mScanNative.getRegularScanClient(client.clientIf);
                if (client == null) return;

            if (mRegularScanClients.contains(client)) {
                mScanNative.stopRegularScan(client);
                if (!mScanNative.isOpportunisticScanClient(client)) {
                    mScanNative.configureRegularScanParams();
@@ -647,8 +647,8 @@ public class ScanManager {
            removeScanFilters(client.clientIf);
        }

        // Find the scan client information
        ScanClient getClient(int clientIf) {
        // Find the regular scan client information.
        ScanClient getRegularScanClient(int clientIf) {
            for (ScanClient client : mRegularScanClients) {
              if (client.clientIf == clientIf) return client;
            }