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

Commit 5d9edbd0 authored by Kihong Seong's avatar Kihong Seong
Browse files

Add log for updateScanModeScreenOff

Unlike updateScanModeScreenOn, the screen off equivalent doesn't have
logs as informative. Thus adding logs.

Bug: 355111772
Test: m com.android.btservices
Flag: EXEMPT, adding logs only
Change-Id: I3a10d1c050162366f13473dcec0213fd1b8b5a58
parent 6ddb61d6
Loading
Loading
Loading
Loading
+27 −16
Original line number Diff line number Diff line
@@ -677,25 +677,36 @@ public class ScanManager {
            if (mScanNative.isOpportunisticScanClient(client)) {
                return false;
            }
            int updatedScanMode = client.scanModeApp;
            if (!isAppForeground(client) || mScanNative.isForceDowngradedScanClient(client)) {
                return client.updateScanMode(ScanSettings.SCAN_MODE_SCREEN_OFF);
            }

                updatedScanMode = ScanSettings.SCAN_MODE_SCREEN_OFF;
            } else {
                // The following codes are effectively only for services
                // Apps are either already or will be soon handled by handleImportanceChange().
                switch (client.scanModeApp) {
                    case ScanSettings.SCAN_MODE_LOW_POWER:
                    return client.updateScanMode(ScanSettings.SCAN_MODE_SCREEN_OFF);
                        updatedScanMode = ScanSettings.SCAN_MODE_SCREEN_OFF;
                        break;
                    case ScanSettings.SCAN_MODE_BALANCED:
                    case ScanSettings.SCAN_MODE_AMBIENT_DISCOVERY:
                    return client.updateScanMode(ScanSettings.SCAN_MODE_SCREEN_OFF_BALANCED);
                        updatedScanMode = ScanSettings.SCAN_MODE_SCREEN_OFF_BALANCED;
                        break;
                    case ScanSettings.SCAN_MODE_LOW_LATENCY:
                    return client.updateScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY);
                        updatedScanMode = ScanSettings.SCAN_MODE_LOW_LATENCY;
                        break;
                    case ScanSettings.SCAN_MODE_OPPORTUNISTIC:
                    default:
                        return false;
                }
            }
            Log.d(
                    TAG,
                    "Scan mode update during screen off from "
                            + client.scanModeApp
                            + " to "
                            + updatedScanMode);
            return client.updateScanMode(updatedScanMode);
        }

        /**
         * Services and Apps are assumed to be in the foreground by default unless it changes to the