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

Commit afba0bd6 authored by Kweku Adams's avatar Kweku Adams
Browse files

Remove CPU file updating code.

The method of capping CPU frequencies that battery saver was using isn't
supported. Remove the current CPU frequency capping code for now.

Bug: 79580230
Bug: 187909008
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/power/batterysaver
Test: atest CtsBatterySavingTestCases
Change-Id: Ib5ecad2e98e4620a758f8db21cf39485d2f923c1
parent 7a1c5d38
Loading
Loading
Loading
Loading
+0 −20
Original line number Original line Diff line number Diff line
@@ -17,7 +17,6 @@ package com.android.server.power.batterysaver;


import android.Manifest;
import android.Manifest;
import android.annotation.Nullable;
import android.annotation.Nullable;
import android.app.ActivityManagerInternal;
import android.content.BroadcastReceiver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Context;
import android.content.Intent;
import android.content.Intent;
@@ -34,13 +33,11 @@ import android.os.PowerManagerInternal;
import android.os.PowerManagerInternal.LowPowerModeListener;
import android.os.PowerManagerInternal.LowPowerModeListener;
import android.os.PowerSaveState;
import android.os.PowerSaveState;
import android.os.UserHandle;
import android.os.UserHandle;
import android.util.ArrayMap;
import android.util.Slog;
import android.util.Slog;


import com.android.internal.R;
import com.android.internal.R;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.ArrayUtils;
import com.android.server.EventLogTags;
import com.android.server.EventLogTags;
import com.android.server.LocalServices;
import com.android.server.LocalServices;
import com.android.server.power.PowerManagerService;
import com.android.server.power.PowerManagerService;
@@ -70,7 +67,6 @@ public class BatterySaverController implements BatterySaverPolicyListener {
    private final Object mLock;
    private final Object mLock;
    private final Context mContext;
    private final Context mContext;
    private final MyHandler mHandler;
    private final MyHandler mHandler;
    private final FileUpdater mFileUpdater;


    private PowerManager mPowerManager;
    private PowerManager mPowerManager;


@@ -212,7 +208,6 @@ public class BatterySaverController implements BatterySaverPolicyListener {
        mHandler = new MyHandler(looper);
        mHandler = new MyHandler(looper);
        mBatterySaverPolicy = policy;
        mBatterySaverPolicy = policy;
        mBatterySaverPolicy.addListener(this);
        mBatterySaverPolicy.addListener(this);
        mFileUpdater = new FileUpdater(context);
        mBatterySavingStats = batterySavingStats;
        mBatterySavingStats = batterySavingStats;


        PowerManager.invalidatePowerSaveModeCaches();
        PowerManager.invalidatePowerSaveModeCaches();
@@ -238,8 +233,6 @@ public class BatterySaverController implements BatterySaverPolicyListener {
        filter.addAction(PowerManager.ACTION_LIGHT_DEVICE_IDLE_MODE_CHANGED);
        filter.addAction(PowerManager.ACTION_LIGHT_DEVICE_IDLE_MODE_CHANGED);
        mContext.registerReceiver(mReceiver, filter);
        mContext.registerReceiver(mReceiver, filter);


        mFileUpdater.systemReady(LocalServices.getService(ActivityManagerInternal.class)
                .isRuntimeRestarted());
        mHandler.postSystemReady();
        mHandler.postSystemReady();
    }
    }


@@ -436,7 +429,6 @@ public class BatterySaverController implements BatterySaverPolicyListener {


        final boolean enabled;
        final boolean enabled;
        final boolean isInteractive = getPowerManager().isInteractive();
        final boolean isInteractive = getPowerManager().isInteractive();
        final ArrayMap<String, String> fileValues;


        synchronized (mLock) {
        synchronized (mLock) {
            enabled = getFullEnabledLocked() || getAdaptiveEnabledLocked();
            enabled = getFullEnabledLocked() || getAdaptiveEnabledLocked();
@@ -456,12 +448,6 @@ public class BatterySaverController implements BatterySaverPolicyListener {
            listeners = mListeners.toArray(new LowPowerModeListener[0]);
            listeners = mListeners.toArray(new LowPowerModeListener[0]);


            mIsInteractive = isInteractive;
            mIsInteractive = isInteractive;

            if (enabled) {
                fileValues = mBatterySaverPolicy.getFileValues(isInteractive);
            } else {
                fileValues = null;
            }
        }
        }


        final PowerManagerInternal pmi = LocalServices.getService(PowerManagerInternal.class);
        final PowerManagerInternal pmi = LocalServices.getService(PowerManagerInternal.class);
@@ -471,12 +457,6 @@ public class BatterySaverController implements BatterySaverPolicyListener {


        updateBatterySavingStats();
        updateBatterySavingStats();


        if (ArrayUtils.isEmpty(fileValues)) {
            mFileUpdater.restoreDefault();
        } else {
            mFileUpdater.writeFiles(fileValues);
        }

        if (sendBroadcast) {
        if (sendBroadcast) {


            if (DEBUG) {
            if (DEBUG) {
+5 −66
Original line number Original line Diff line number Diff line
@@ -129,7 +129,11 @@ public class BatterySaverPolicy extends ContentObserver implements
    @VisibleForTesting
    @VisibleForTesting
    static final String KEY_ENABLE_NIGHT_MODE = "enable_night_mode";
    static final String KEY_ENABLE_NIGHT_MODE = "enable_night_mode";


    /** @deprecated Old key used to set CPU frequency caps directly in sys files. */
    @Deprecated
    private static final String KEY_CPU_FREQ_INTERACTIVE = "cpufreq-i";
    private static final String KEY_CPU_FREQ_INTERACTIVE = "cpufreq-i";
    /** @deprecated Old key used to set CPU frequency caps directly in sys files. */
    @Deprecated
    private static final String KEY_CPU_FREQ_NONINTERACTIVE = "cpufreq-n";
    private static final String KEY_CPU_FREQ_NONINTERACTIVE = "cpufreq-n";


    private static final String KEY_SUFFIX_ADAPTIVE = "_adaptive";
    private static final String KEY_SUFFIX_ADAPTIVE = "_adaptive";
@@ -138,8 +142,6 @@ public class BatterySaverPolicy extends ContentObserver implements
    static final Policy OFF_POLICY = new Policy(
    static final Policy OFF_POLICY = new Policy(
            1f,    /* adjustBrightnessFactor */
            1f,    /* adjustBrightnessFactor */
            false, /* advertiseIsEnabled */
            false, /* advertiseIsEnabled */
            new CpuFrequencies(), /* cpuFrequenciesForInteractive */
            new CpuFrequencies(), /* cpuFrequenciesForNoninteractive */
            false, /* deferFullBackup */
            false, /* deferFullBackup */
            false, /* deferKeyValueBackup */
            false, /* deferKeyValueBackup */
            false, /* disableAnimation */
            false, /* disableAnimation */
@@ -163,8 +165,6 @@ public class BatterySaverPolicy extends ContentObserver implements
    private static final Policy DEFAULT_FULL_POLICY = new Policy(
    private static final Policy DEFAULT_FULL_POLICY = new Policy(
            0.5f,  /* adjustBrightnessFactor */
            0.5f,  /* adjustBrightnessFactor */
            true,  /* advertiseIsEnabled */
            true,  /* advertiseIsEnabled */
            new CpuFrequencies(), /* cpuFrequenciesForInteractive */
            new CpuFrequencies(), /* cpuFrequenciesForNoninteractive */
            true,  /* deferFullBackup */
            true,  /* deferFullBackup */
            true,  /* deferKeyValueBackup */
            true,  /* deferKeyValueBackup */
            false, /* disableAnimation */
            false, /* disableAnimation */
@@ -487,8 +487,6 @@ public class BatterySaverPolicy extends ContentObserver implements
        mEffectivePolicyRaw = new Policy(
        mEffectivePolicyRaw = new Policy(
                rawPolicy.adjustBrightnessFactor,
                rawPolicy.adjustBrightnessFactor,
                rawPolicy.advertiseIsEnabled,
                rawPolicy.advertiseIsEnabled,
                rawPolicy.cpuFrequenciesForInteractive,
                rawPolicy.cpuFrequenciesForNoninteractive,
                rawPolicy.deferFullBackup,
                rawPolicy.deferFullBackup,
                rawPolicy.deferKeyValueBackup,
                rawPolicy.deferKeyValueBackup,
                rawPolicy.disableAnimation,
                rawPolicy.disableAnimation,
@@ -647,22 +645,6 @@ public class BatterySaverPolicy extends ContentObserver implements
         */
         */
        public final boolean enableQuickDoze;
        public final boolean enableQuickDoze;


        /**
         * List of CPU frequencies that should be written when battery saver is activated
         * and the device is interactive.
         *
         * We use this to change the max CPU frequencies.
         */
        public final CpuFrequencies cpuFrequenciesForInteractive;

        /**
         * List of CPU frequencies that should be written when battery saver is activated
         * and the device is non-interactive.
         *
         * We use this to change the max CPU frequencies.
         */
        public final CpuFrequencies cpuFrequenciesForNoninteractive;

        /**
        /**
         * Whether to put all apps in the stand-by mode.
         * Whether to put all apps in the stand-by mode.
         */
         */
@@ -687,8 +669,6 @@ public class BatterySaverPolicy extends ContentObserver implements
        Policy(
        Policy(
                float adjustBrightnessFactor,
                float adjustBrightnessFactor,
                boolean advertiseIsEnabled,
                boolean advertiseIsEnabled,
                CpuFrequencies cpuFrequenciesForInteractive,
                CpuFrequencies cpuFrequenciesForNoninteractive,
                boolean deferFullBackup,
                boolean deferFullBackup,
                boolean deferKeyValueBackup,
                boolean deferKeyValueBackup,
                boolean disableAnimation,
                boolean disableAnimation,
@@ -708,8 +688,6 @@ public class BatterySaverPolicy extends ContentObserver implements


            this.adjustBrightnessFactor = Math.min(1, Math.max(0, adjustBrightnessFactor));
            this.adjustBrightnessFactor = Math.min(1, Math.max(0, adjustBrightnessFactor));
            this.advertiseIsEnabled = advertiseIsEnabled;
            this.advertiseIsEnabled = advertiseIsEnabled;
            this.cpuFrequenciesForInteractive = cpuFrequenciesForInteractive;
            this.cpuFrequenciesForNoninteractive = cpuFrequenciesForNoninteractive;
            this.deferFullBackup = deferFullBackup;
            this.deferFullBackup = deferFullBackup;
            this.deferKeyValueBackup = deferKeyValueBackup;
            this.deferKeyValueBackup = deferKeyValueBackup;
            this.disableAnimation = disableAnimation;
            this.disableAnimation = disableAnimation;
@@ -744,8 +722,6 @@ public class BatterySaverPolicy extends ContentObserver implements
            mHashCode = Objects.hash(
            mHashCode = Objects.hash(
                    adjustBrightnessFactor,
                    adjustBrightnessFactor,
                    advertiseIsEnabled,
                    advertiseIsEnabled,
                    cpuFrequenciesForInteractive,
                    cpuFrequenciesForNoninteractive,
                    deferFullBackup,
                    deferFullBackup,
                    deferKeyValueBackup,
                    deferKeyValueBackup,
                    disableAnimation,
                    disableAnimation,
@@ -772,16 +748,10 @@ public class BatterySaverPolicy extends ContentObserver implements


            // Device-specific parameters.
            // Device-specific parameters.
            Map<String, String> deviceSpecificSettings = config.getDeviceSpecificSettings();
            Map<String, String> deviceSpecificSettings = config.getDeviceSpecificSettings();
            final String cpuFreqInteractive =
                    deviceSpecificSettings.getOrDefault(KEY_CPU_FREQ_INTERACTIVE, "");
            final String cpuFreqNoninteractive =
                    deviceSpecificSettings.getOrDefault(KEY_CPU_FREQ_NONINTERACTIVE, "");


            return new Policy(
            return new Policy(
                    config.getAdjustBrightnessFactor(),
                    config.getAdjustBrightnessFactor(),
                    config.getAdvertiseIsEnabled(),
                    config.getAdvertiseIsEnabled(),
                    (new CpuFrequencies()).parseString(cpuFreqInteractive),
                    (new CpuFrequencies()).parseString(cpuFreqNoninteractive),
                    config.getDeferFullBackup(),
                    config.getDeferFullBackup(),
                    config.getDeferKeyValueBackup(),
                    config.getDeferKeyValueBackup(),
                    config.getDisableAnimation(),
                    config.getDisableAnimation(),
@@ -803,10 +773,6 @@ public class BatterySaverPolicy extends ContentObserver implements


        BatterySaverPolicyConfig toConfig() {
        BatterySaverPolicyConfig toConfig() {
            return new BatterySaverPolicyConfig.Builder()
            return new BatterySaverPolicyConfig.Builder()
                    .addDeviceSpecificSetting(KEY_CPU_FREQ_INTERACTIVE,
                            cpuFrequenciesForInteractive.toString())
                    .addDeviceSpecificSetting(KEY_CPU_FREQ_NONINTERACTIVE,
                            cpuFrequenciesForNoninteractive.toString())
                    .setAdjustBrightnessFactor(adjustBrightnessFactor)
                    .setAdjustBrightnessFactor(adjustBrightnessFactor)
                    .setAdvertiseIsEnabled(advertiseIsEnabled)
                    .setAdvertiseIsEnabled(advertiseIsEnabled)
                    .setDeferFullBackup(deferFullBackup)
                    .setDeferFullBackup(deferFullBackup)
@@ -848,9 +814,6 @@ public class BatterySaverPolicy extends ContentObserver implements
                        + deviceSpecificSettings);
                        + deviceSpecificSettings);
            }
            }


            final String cpuFreqInteractive = parser.getString(KEY_CPU_FREQ_INTERACTIVE, "");
            final String cpuFreqNoninteractive = parser.getString(KEY_CPU_FREQ_NONINTERACTIVE, "");

            // Non-device-specific parameters.
            // Non-device-specific parameters.
            try {
            try {
                parser.setString(settings == null ? "" : settings);
                parser.setString(settings == null ? "" : settings);
@@ -918,8 +881,6 @@ public class BatterySaverPolicy extends ContentObserver implements
            return new Policy(
            return new Policy(
                    adjustBrightnessFactor,
                    adjustBrightnessFactor,
                    advertiseIsEnabled,
                    advertiseIsEnabled,
                    (new CpuFrequencies()).parseString(cpuFreqInteractive),
                    (new CpuFrequencies()).parseString(cpuFreqNoninteractive),
                    deferFullBackup,
                    deferFullBackup,
                    deferKeyValueBackup,
                    deferKeyValueBackup,
                    disableAnimation,
                    disableAnimation,
@@ -962,10 +923,7 @@ public class BatterySaverPolicy extends ContentObserver implements
                    && forceAllAppsStandby == other.forceAllAppsStandby
                    && forceAllAppsStandby == other.forceAllAppsStandby
                    && forceBackgroundCheck == other.forceBackgroundCheck
                    && forceBackgroundCheck == other.forceBackgroundCheck
                    && locationMode == other.locationMode
                    && locationMode == other.locationMode
                    && soundTriggerMode == other.soundTriggerMode
                    && soundTriggerMode == other.soundTriggerMode;
                    && cpuFrequenciesForInteractive.equals(other.cpuFrequenciesForInteractive)
                    && cpuFrequenciesForNoninteractive.equals(
                            other.cpuFrequenciesForNoninteractive);
        }
        }


        @Override
        @Override
@@ -1179,14 +1137,6 @@ public class BatterySaverPolicy extends ContentObserver implements
        }
        }
    }
    }


    public ArrayMap<String, String> getFileValues(boolean interactive) {
        synchronized (mLock) {
            return interactive
                    ? getCurrentPolicyLocked().cpuFrequenciesForInteractive.toSysFileMap()
                    : getCurrentPolicyLocked().cpuFrequenciesForNoninteractive.toSysFileMap();
        }
    }

    public boolean isLaunchBoostDisabled() {
    public boolean isLaunchBoostDisabled() {
        synchronized (mLock) {
        synchronized (mLock) {
            return getCurrentPolicyLocked().disableLaunchBoost;
            return getCurrentPolicyLocked().disableLaunchBoost;
@@ -1274,17 +1224,6 @@ public class BatterySaverPolicy extends ContentObserver implements
        pw.println(KEY_ENABLE_QUICK_DOZE + "=" + p.enableQuickDoze);
        pw.println(KEY_ENABLE_QUICK_DOZE + "=" + p.enableQuickDoze);
        pw.println(KEY_ENABLE_NIGHT_MODE + "=" + p.enableNightMode);
        pw.println(KEY_ENABLE_NIGHT_MODE + "=" + p.enableNightMode);


        pw.println("Interactive File values:");
        pw.increaseIndent();
        dumpMap(pw, p.cpuFrequenciesForInteractive.toSysFileMap());
        pw.decreaseIndent();
        pw.println();

        pw.println("Noninteractive File values:");
        pw.increaseIndent();
        dumpMap(pw, p.cpuFrequenciesForNoninteractive.toSysFileMap());
        pw.decreaseIndent();

        // Decrease from indent right after "Policy" line
        // Decrease from indent right after "Policy" line
        pw.decreaseIndent();
        pw.decreaseIndent();
    }
    }
+0 −142
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2017 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.android.server.power.batterysaver;

import android.util.ArrayMap;
import android.util.Slog;

import com.android.internal.annotations.GuardedBy;

import java.util.Map;


/**
 * Helper to parse a list of "core-number:frequency" pairs concatenated with / as a separator,
 * and convert them into a map of "filename -> value" that should be written to
 * /sys/.../scaling_max_freq.
 *
 * Example input: "0:1900800/4:2500000", which will be converted into:
 *   "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq" "1900800"
 *   "/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq" "2500000"
 *
 * Test:
 atest $ANDROID_BUILD_TOP/frameworks/base/services/tests/servicestests/src/com/android/server/power/batterysaver/CpuFrequenciesTest.java
 */
public class CpuFrequencies {
    private static final String TAG = "CpuFrequencies";

    private static final String CPU_DELIM = "/";
    private static final String FREQUENCY_DELIM = ":";
    private final Object mLock = new Object();

    @GuardedBy("mLock")
    private final ArrayMap<Integer, Long> mCoreAndFrequencies = new ArrayMap<>();

    public CpuFrequencies() {
    }

    /**
     * Parse a string.
     */
    public CpuFrequencies parseString(String cpuNumberAndFrequencies) {
        synchronized (mLock) {
            mCoreAndFrequencies.clear();
            try {
                for (String pair : cpuNumberAndFrequencies.split(CPU_DELIM)) {
                    pair = pair.trim();
                    if (pair.length() == 0) {
                        continue;
                    }
                    final String[] coreAndFreq = pair.split(FREQUENCY_DELIM, 2);

                    if (coreAndFreq.length != 2) {
                        throw new IllegalArgumentException("Wrong format");
                    }
                    final int core = Integer.parseInt(coreAndFreq[0]);
                    final long freq = Long.parseLong(coreAndFreq[1]);

                    mCoreAndFrequencies.put(core, freq);
                }
            } catch (IllegalArgumentException e) {
                Slog.wtf(TAG, "Invalid configuration: '" + cpuNumberAndFrequencies + "'");
            }
        }
        return this;
    }

    /**
     * Return a new map containing the filename-value pairs.
     */
    public ArrayMap<String, String> toSysFileMap() {
        final ArrayMap<String, String> map = new ArrayMap<>();
        addToSysFileMap(map);
        return map;
    }

    /**
     * Add the filename-value pairs to an existing map.
     */
    public void addToSysFileMap(Map<String, String> map) {
        synchronized (mLock) {
            final int size = mCoreAndFrequencies.size();

            for (int i = 0; i < size; i++) {
                final int core = mCoreAndFrequencies.keyAt(i);
                final long freq = mCoreAndFrequencies.valueAt(i);

                final String file = "/sys/devices/system/cpu/cpu" + Integer.toString(core) +
                        "/cpufreq/scaling_max_freq";

                map.put(file, Long.toString(freq));
            }
        }
    }

    /**
     * Returns String describing the frequency settings used.
     * The returned String can be parsed again by {@link #parseString(String)}.
     */
    public String toString() {
        synchronized (mLock) {
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < mCoreAndFrequencies.size(); i++) {
                if (i > 0) {
                    sb.append(CPU_DELIM);
                }
                sb.append(mCoreAndFrequencies.keyAt(i));
                sb.append(FREQUENCY_DELIM);
                sb.append(mCoreAndFrequencies.valueAt(i));
            }

            return sb.toString();
        }
    }

    @Override
    public boolean equals(Object obj) {
        synchronized (mLock) {
            if (this == obj) return true;
            if (!(obj instanceof CpuFrequencies)) return false;
            CpuFrequencies other = (CpuFrequencies) obj;
            return mCoreAndFrequencies.equals(other.mCoreAndFrequencies);
        }
    }

    @Override
    public int hashCode() {
        return mCoreAndFrequencies.hashCode();
    }
}
+0 −406

File deleted.

Preview size limit exceeded, changes collapsed.

+0 −39
Original line number Original line Diff line number Diff line
@@ -290,45 +290,6 @@ public class BatterySaverPolicyTest extends AndroidTestCase {
        assertThat(batterySaverStateOff.batterySaverEnabled).isFalse();
        assertThat(batterySaverStateOff.batterySaverEnabled).isFalse();
    }
    }


    public void testDeviceSpecific() {
        mDeviceSpecificConfigResId = R.string.config_batterySaverDeviceSpecificConfig_1;
        mMockGlobalSettings.put(Global.BATTERY_SAVER_CONSTANTS, "");
        mMockGlobalSettings.put(Global.BATTERY_SAVER_DEVICE_SPECIFIC_CONSTANTS, "");

        mBatterySaverPolicy.onChange();
        assertThat(mBatterySaverPolicy.getFileValues(true).toString()).isEqualTo("{}");
        assertThat(mBatterySaverPolicy.getFileValues(false).toString()).isEqualTo("{}");


        mDeviceSpecificConfigResId = R.string.config_batterySaverDeviceSpecificConfig_2;

        mBatterySaverPolicy.onChange();
        assertThat(mBatterySaverPolicy.getFileValues(true).toString()).isEqualTo("{}");
        assertThat(mBatterySaverPolicy.getFileValues(false).toString())
                .isEqualTo("{/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq=123, "
                        + "/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq=456}");

        mDeviceSpecificConfigResId = R.string.config_batterySaverDeviceSpecificConfig_3;

        mBatterySaverPolicy.onChange();
        assertThat(mBatterySaverPolicy.getFileValues(true).toString())
                .isEqualTo("{/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq=333, "
                        + "/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq=444}");
        assertThat(mBatterySaverPolicy.getFileValues(false).toString())
                .isEqualTo("{/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq=222}");


        mMockGlobalSettings.put(Global.BATTERY_SAVER_DEVICE_SPECIFIC_CONSTANTS,
                "cpufreq-i=3:1234567890/4:014/5:015");

        mBatterySaverPolicy.onChange();
        assertThat(mBatterySaverPolicy.getFileValues(true).toString())
                .isEqualTo("{/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq=1234567890, "
                        + "/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq=14, "
                        + "/sys/devices/system/cpu/cpu5/cpufreq/scaling_max_freq=15}");
        assertThat(mBatterySaverPolicy.getFileValues(false).toString()).isEqualTo("{}");
    }

    public void testSetPolicyLevel_Off() {
    public void testSetPolicyLevel_Off() {
        mBatterySaverPolicy.setPolicyLevel(POLICY_LEVEL_OFF);
        mBatterySaverPolicy.setPolicyLevel(POLICY_LEVEL_OFF);


Loading