Loading core/api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -2358,6 +2358,7 @@ package android.os { public final class PowerManager { method public boolean areAutoPowerSaveModesEnabled(); method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_LOW_POWER_STANDBY, android.Manifest.permission.DEVICE_POWER}) public void forceLowPowerStandbyActive(boolean); method public boolean isBatterySaverSupported(); field public static final String ACTION_ENHANCED_DISCHARGE_PREDICTION_CHANGED = "android.os.action.ENHANCED_DISCHARGE_PREDICTION_CHANGED"; field @RequiresPermission(android.Manifest.permission.DEVICE_POWER) public static final int SYSTEM_WAKELOCK = -2147483648; // 0x80000000 } Loading core/java/android/os/IPowerManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ interface IPowerManager boolean isPowerSaveMode(); PowerSaveState getPowerSaveState(int serviceType); boolean setPowerSaveModeEnabled(boolean mode); boolean isBatterySaverSupported(); BatterySaverPolicyConfig getFullPowerSavePolicy(); boolean setFullPowerSavePolicy(in BatterySaverPolicyConfig config); boolean setDynamicPowerSaveHint(boolean powerSaveHint, int disableThreshold); Loading core/java/android/os/PowerManager.java +14 −0 Original line number Diff line number Diff line Loading @@ -1935,6 +1935,20 @@ public final class PowerManager { } } /** * Returns true if Battery Saver is supported on this device. * * @hide */ @TestApi public boolean isBatterySaverSupported() { try { return mService.isBatterySaverSupported(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Gets the current policy for full power save mode. * Loading core/res/res/values/config_battery_saver.xml +4 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,10 @@ <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string translatable="false" name="config_batterySaverDeviceSpecificConfig"></string> <!-- Whether or not the device supports battery saver. If false, battery saver will be disabled. --> <bool name="config_batterySaverSupported">true</bool> <!-- Whether or not battery saver should be "sticky" when manually enabled. --> <bool name="config_batterySaverStickyBehaviourDisabled">false</bool> Loading core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -4019,6 +4019,7 @@ <!-- Battery saver config --> <java-symbol type="integer" name="config_lowBatteryAutoTriggerDefaultLevel" /> <java-symbol type="bool" name="config_batterySaverSupported" /> <java-symbol type="string" name="config_batterySaverDeviceSpecificConfig" /> <java-symbol type="bool" name="config_batterySaverStickyBehaviourDisabled" /> <java-symbol type="integer" name="config_dynamicPowerSavingsDefaultDisableThreshold" /> Loading Loading
core/api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -2358,6 +2358,7 @@ package android.os { public final class PowerManager { method public boolean areAutoPowerSaveModesEnabled(); method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_LOW_POWER_STANDBY, android.Manifest.permission.DEVICE_POWER}) public void forceLowPowerStandbyActive(boolean); method public boolean isBatterySaverSupported(); field public static final String ACTION_ENHANCED_DISCHARGE_PREDICTION_CHANGED = "android.os.action.ENHANCED_DISCHARGE_PREDICTION_CHANGED"; field @RequiresPermission(android.Manifest.permission.DEVICE_POWER) public static final int SYSTEM_WAKELOCK = -2147483648; // 0x80000000 } Loading
core/java/android/os/IPowerManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ interface IPowerManager boolean isPowerSaveMode(); PowerSaveState getPowerSaveState(int serviceType); boolean setPowerSaveModeEnabled(boolean mode); boolean isBatterySaverSupported(); BatterySaverPolicyConfig getFullPowerSavePolicy(); boolean setFullPowerSavePolicy(in BatterySaverPolicyConfig config); boolean setDynamicPowerSaveHint(boolean powerSaveHint, int disableThreshold); Loading
core/java/android/os/PowerManager.java +14 −0 Original line number Diff line number Diff line Loading @@ -1935,6 +1935,20 @@ public final class PowerManager { } } /** * Returns true if Battery Saver is supported on this device. * * @hide */ @TestApi public boolean isBatterySaverSupported() { try { return mService.isBatterySaverSupported(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Gets the current policy for full power save mode. * Loading
core/res/res/values/config_battery_saver.xml +4 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,10 @@ <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string translatable="false" name="config_batterySaverDeviceSpecificConfig"></string> <!-- Whether or not the device supports battery saver. If false, battery saver will be disabled. --> <bool name="config_batterySaverSupported">true</bool> <!-- Whether or not battery saver should be "sticky" when manually enabled. --> <bool name="config_batterySaverStickyBehaviourDisabled">false</bool> Loading
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -4019,6 +4019,7 @@ <!-- Battery saver config --> <java-symbol type="integer" name="config_lowBatteryAutoTriggerDefaultLevel" /> <java-symbol type="bool" name="config_batterySaverSupported" /> <java-symbol type="string" name="config_batterySaverDeviceSpecificConfig" /> <java-symbol type="bool" name="config_batterySaverStickyBehaviourDisabled" /> <java-symbol type="integer" name="config_dynamicPowerSavingsDefaultDisableThreshold" /> Loading