Battery life is a perennial user concern. To extend battery life, Android
continually adds new features to help the platform optimize the off-charger
behavior of apps and devices.
Android includes the following battery life enhancements:
-
App restrictions
.
The platform can suggest apps that negatively affect battery life, so
that users can choose to restrict those apps from consuming resources. Apps
aren't background restricted by default.
- App standby
. The
platform can place unused apps in App standby mode, temporarily
restricting network access and deferring syncs and jobs for those
apps.
-
Doze
. The platform can
enter a state of deep sleep (periodically resuming normal operations) if
users haven't actively used their device (screen off and stationary) for
extended periods of time. Android 7.0 and higher also enables Doze to
trigger a lighter set of optimizations when users turn off the device
screen yet continue to move around.
- Limiting power transfer during USB backup and restore. When performing a USB
backup or restore, set the
UsbPort
class's
enableLimitPowerTransfer
method to
true
to disable charging and limit the sourcing power. To verify that
power is limited, call
UsbPortStatus
class's
isPowerTransferLimited
method. When
isPowerTransferLimited
is
true
, the Android device
reduces the power draw as a sink to 0 (or the lowest possible value allowed by hardware) and
limits the source current to 0. Limiting source power can be enforced only when both port
partners support USB power delivery (PD) specification. To return power usage to the defatult
state, set
enableLimitPowerTransfer
to
false
. The default state is
also returned when the USB cable is disconnected.
-
Exemptions
. Preloaded system apps and cloud
messaging services are typically exempted from App standby and Doze by
default. App developers can use intents to apply these settings to their
apps. Users can exempt apps from App standby and Doze power-saving modes
in the Settings menu.
-
Trackers
. App background behavior trackers monitor
apps' foreground and background battery usage to determine if the apps violate some policy.
Exempt apps
You can exempt apps from being subject to Doze or App standby.
Exemptions may be needed in the following use cases:
- Device manufacturers using a cloud messaging platform other than
Firebase
cloud messaging (FCM)
- Carrier using non-FCM cloud messaging platform
- Third-party app using non-FCM cloud messaging platform
Warning:
Don't exempt apps to avoid testing
and optimizing. Unnecessary exemptions undermine the benefits of Doze and App
standby and can compromise the user experience, so we strongly suggest
minimizing such exemptions as they allow apps to defeat beneficial
controls the platform has over power use. If users become unhappy about the
power consumption of these apps, it can lead to frustration, bad experiences
(and negative reviews for the app), and customer support questions. For these
reasons, we strongly recommend that you don't exempt third-party apps
and instead exempt only cloud messaging services or apps with similar
functions.
Apps exempted by default are listed in
Settings > App &
Notifications > Special app access > Battery Optimization
. This list is
used for exempting the app from both Doze and App standby modes. To provide
transparency to the user, the Settings menu
MUST
show all
exempted apps.
Users can manually exempt apps using
Settings > App & Notifications >
APP-NAME
> Battery > Battery Optimization
and then selecting the
app to turn off (or back on) optimization. However, users can't change the except status of any
app or service that is exempted by default in the system image.