Add setting/experiment for small battery devices to have

all forced app standby enabled except for when the device
is charging.

Reverting the revert of this CL. The only change is to use
EXTRA_PLUGGED instead of EXTRA_STATUS in detecting charging
state. Verified that this passes CTS test for battery saver.

Bug: 69259147
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/ForceAppStandbyTrackerTest.java
Test: atest CtsBatterySavingTestCases
Change-Id: I4f3ffc0c865a1a3a035b6d9d6838b5056b666eb9
This commit is contained in:
Nancy Zheng
2018-01-12 11:45:37 -08:00
parent a17274fb05
commit 525aaa13dc
5 changed files with 206 additions and 32 deletions

View File

@@ -9895,6 +9895,15 @@ public final class Settings {
*/
public static final String FORCED_APP_STANDBY_ENABLED = "forced_app_standby_enabled";
/**
* Whether or not to enable Forced App Standby on small battery devices.
* Type: int (0 for false, 1 for true)
* Default: 0
* @hide
*/
public static final String FORCED_APP_STANDBY_FOR_SMALL_BATTERY_ENABLED
= "forced_app_standby_for_small_battery_enabled";
/**
* Whether or not Network Watchlist feature is enabled.
* Type: int (0 for false, 1 for true)