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

Commit badfa948 authored by Anthony Stange's avatar Anthony Stange
Browse files

DO NOT MERGE Retrieve the background scan mode from Settings.Global.

The default value stays the same. Reading from Settings.Global will
enable us to experiment with the value in the future.

Bug: 71765044
Test: Built successfully.
Change-Id: Ie52938f022ed6cd4402e22a28620d5f19e550917
parent fb3f9770
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1340,12 +1340,17 @@ public class ScanManager {
                }
            }
        } else {
            ContentResolver resolver = mService.getContentResolver();
            int backgroundScanMode = Settings.Global.getInt(
                    resolver,
                    Settings.Global.BLE_SCAN_BACKGROUND_MODE,
                    ScanSettings.SCAN_MODE_LOW_POWER);
            for (ScanClient client : mRegularScanClients) {
                if (client.appUid == uid && !mScanNative.isOpportunisticScanClient(client)) {
                    client.passiveSettings = client.settings;
                    ScanSettings.Builder builder = new ScanSettings.Builder();
                    ScanSettings settings = client.settings;
                    builder.setScanMode(ScanSettings.SCAN_MODE_LOW_POWER);
                    builder.setScanMode(backgroundScanMode);
                    builder.setCallbackType(settings.getCallbackType());
                    builder.setScanResultType(settings.getScanResultType());
                    builder.setReportDelay(settings.getReportDelayMillis());