1## 8.3\. Power-Saving Modes
2
3If device implementations include features to improve device power management
4that are included in AOSP or extend the features that are included in AOSP,
5they:
6
7*   [C-1-1] MUST NOT deviate from the AOSP implementation for the triggering,
8    maintenance, wakeup algorithms and the use of global system settings of App
9    Standby and Doze power-saving modes.
10*   [C-1-2] MUST NOT deviate from the AOSP implementation for the use of global
11    settings to manage the throttling of jobs, alarm and network for apps in
12    each bucket for App standby.
13*   [C-1-3] MUST NOT deviate from the AOSP implementation for the number of the
14    [App Standby Buckets](
15    https://developer.android.com/topic/performance/appstandby) used for App
16    Standby.
17*   [C-1-4] MUST implement [App Standby Buckets](
18    https://developer.android.com/topic/performance/appstandby) and Doze as
19    described in [Power Management](
20    https://source.android.com/devices/tech/power/mgmt).
21*   [C-1-5] MUST return `true` for [`PowerManager.isPowerSaveMode()`](
22    https://developer.android.com/reference/android/os/PowerManager#isPowerSaveMode%28%29)
23    when the device is on power save mode.
24*   [C-SR] Are STRONGLY RECOMMENDED to provide user affordance to enable and
25    disable the battery saver feature.
26*   [C-SR] Are STRONGLY RECOMMENDED to provide user affordance to display all
27    Apps that are exempted from App Standby and Doze power-saving modes.
28
29In addition to the power-saving modes, Android device implementations MAY
30implement any or all of the 4 sleeping power states as defined by the Advanced
31Configuration and Power Interface (ACPI).
32
33If device implementations implement S4 power states as defined by the
34ACPI, they:
35
36*   [C-1-1] MUST enter this state only after the user has taken an explicit action
37    to put the device in an inactive state (e.g. by closing a lid that is physically
38    part of the device or turning off a vehicle or television) and before the
39    user re-activates the device (e.g. by opening the lid or turning the vehicle
40    or television back on).
41
42If device implementations implement S3 power states as defined by the
43ACPI, they:
44
45*   [C-2-1] MUST meet C-1-1 above, or, MUST enter S3 state only when third-party
46    applications do not need the system resources (e.g. the screen, CPU).
47
48    Conversely, MUST exit from S3 state when third-party applications need the
49    system resources, as described on this SDK.
50
51    For example, while the third-party applications request to keep the screen
52    on through `FLAG_KEEP_SCREEN_ON` or keep CPU running through
53    `PARTIAL_WAKE_LOCK`, the device MUST NOT enter S3 state unless, as described
54    in C-1-1, the user has taken explicit action to put the device in an
55    inactive state. Conversely, at a time when a task that third-party apps
56    implement through JobScheduler is triggered or Firebase Cloud Messaging is
57    delivered to third-party apps, the device MUST exit the S3 state unless the
58    user has put the device in an inactive state. These are not comprehensive
59    examples and AOSP implements extensive wake-up signals that trigger a wakeup
60    from this state.
61