From a13f77e8d1aca87cf1df0d00f4769d0edc0ed91b Mon Sep 17 00:00:00 2001 From: David Friedman Date: Wed, 12 Aug 2015 10:24:14 -0700 Subject: Docs: Migration, rewrite of Doze/App Standby doc from M Preview behavior page Bug: 22947123 Change-Id: I49b72e160c40ea269a98a80356d61de49c306d96 --- docs/html/preview/features/power-mgmt.jd | 121 +++++++++++++++++++++++++++++++ docs/html/preview/preview_toc.cs | 9 +++ 2 files changed, 130 insertions(+) create mode 100644 docs/html/preview/features/power-mgmt.jd (limited to 'docs/html/preview') diff --git a/docs/html/preview/features/power-mgmt.jd b/docs/html/preview/features/power-mgmt.jd new file mode 100644 index 0000000..da66181 --- /dev/null +++ b/docs/html/preview/features/power-mgmt.jd @@ -0,0 +1,121 @@ +page.title=Power-Saving Optimizations +page.keywords=preview,sdk,compatibility +sdk.platform.apiLevel=MNC +@jd:body + +
+
+ +

In this document

+ +
    +
  1. Doze
  2. +
  3. App Standby
  4. +
+ +

API Differences

+
    +
  1. API level 22 to M Preview »
  2. +
+ + +

See Also

+
    +
  1. M Developer Preview API Overview
  2. +
+ +
+
+ +

Android M Preview helps prolong battery life by introducing new power-saving optimizations: +Doze mode improves the sleep efficiency of idle devices. App Standby prevents apps +from eating up power while idle.

+ +

Doze

+

If a user leaves a device unplugged and stationary for a period of time, with the screen off, +the device enters Doze mode. Doze attempts to keep the system in a sleep state as long as the +device remains undisturbed. In this mode, devices periodically resume normal operations for brief periods of time so that the system can perform app syncing and any other pending operations.

+ +

The following restrictions apply to your apps while in Doze:

+ +

+

When the device exits Doze mode, it executes any jobs and syncs that are pending.

+ +

Testing apps with Doze

+ +

You can test Doze mode by connecting your development host to a device running the M Preview, +and calling the following commands: +

+
+$ adb shell dumpsys battery unplug
+$ adb shell dumpsys deviceidle step
+$ adb shell dumpsys deviceidle -h
+
+

Note: As of M Preview 3 release, + +Google Cloud Messaging (GCM) lets you designate + +high-priority messages. If your app receives a high-priority GCM message, the system grants +brief network access even when the device is dozing. +

+ +

See the +Testing Guide for tips on how +to test Doze in your apps.

+ +

App Standby

+

App Standby allows the system to determine that an app is idle when the user is not actively +using it. The system makes this determination when the user does not touch the app for a certain +period of time, and none of the following conditions applies:

+ + + +

When the user plugs the device into a power supply, the system releases apps from the standby +state, allowing them to freely access the network and to execute any pending jobs and syncs. If the +device is idle for long periods of time, the system allows idle apps network access around once a +day.

+ +

Testing apps with App Standby

+

You can test App Standby by connecting your development host to a device running the M Preview, +and calling the following commands: +

+
+$ adb shell dumpsys battery unplug
+$ adb shell am set-idle <packageName> true
+$ adb shell am set-idle <packageName> false
+$ adb shell am get-idle <packageName>
+
+ +

Note: +As of M Preview 3 release, + +Google Cloud Messaging (GCM) lets you +designate + +high-priority messages. If your app receives high-priority GCM messages, the system grants +brief network access even when the app is idle. +

+ +

See the +Testing Guide for tips on how +to test App Standby in your apps.

diff --git a/docs/html/preview/preview_toc.cs b/docs/html/preview/preview_toc.cs index 83f69a4..90df59e 100644 --- a/docs/html/preview/preview_toc.cs +++ b/docs/html/preview/preview_toc.cs @@ -98,6 +98,15 @@ zh-cn-lang="自动备份应用" zh-tw-lang="針對應用程式進行自動備份"> Auto Backup for Apps +
  • + Power-Saving Optimizations
  • -- cgit v1.1