diff --git a/docs/html/distribute/essentials/quality/core.jd b/docs/html/distribute/essentials/quality/core.jd index cfe1a2acdec1e..d7eedf320e0f9 100644 --- a/docs/html/distribute/essentials/quality/core.jd +++ b/docs/html/distribute/essentials/quality/core.jd @@ -592,6 +592,23 @@ data-sortorder="-timestamp" data-cardsizes="6x3" data-maxresults="6"> + + + Battery + + + PS-B1 + + + App supports power management features in Android 6.0+ (Doze and App Standby) + properly. In the case where core functionality is disrupted by power management, + only qualified apps may request an exemption. + + + BA-1 + + + Media @@ -702,7 +719,7 @@ data-cardsizes="6x3" data-maxresults="6"> - + Policies @@ -740,6 +757,25 @@ data-cardsizes="6x3" data-maxresults="6"> + + + GP-P3 + + +

+ App supports power management features in Android 6.0+ (Doze and App Standby) + properly. In the case where core functionality is disrupted by power management, + only qualified apps may request an exemption. + See Support + for other use cases in Doze and App Standby.

+

+ + + GP-4 + + + App Details Page @@ -1088,8 +1124,29 @@ data-cardsizes="6x3,6x3,6x3,6x3,6x3,6x3" data-maxresults="6"> + + + Battery + + + BA-1 + + +

+ Repeat Core Suite across Doze and App Standby cycles. +

+ +

+ Pay close attention to alarms, timers, notifications, syncs, and so on. + See Testing + with Doze and App Standby. +

+ + + - + Google Play @@ -1123,6 +1180,17 @@ data-cardsizes="6x3,6x3,6x3,6x3,6x3,6x3" data-maxresults="6"> + + + GP-4 + + + Review Support + for other use cases in Doze and App Standby. + + + Payments diff --git a/docs/html/training/monitoring-device-state/doze-standby.jd b/docs/html/training/monitoring-device-state/doze-standby.jd index ec4da806cf1ce..77db1405bb538 100644 --- a/docs/html/training/monitoring-device-state/doze-standby.jd +++ b/docs/html/training/monitoring-device-state/doze-standby.jd @@ -1,6 +1,6 @@ page.title=Optimizing for Doze and App Standby page.metaDescription=Test and optimize your app for the power-saving features in Android 6.0. -page.tags="doze", "app standby", "marshmallow", "alarms" +page.tags=doze, app standby, marshmallow, alarms meta.tags="battery", "marshmallow", "alarms" page.image=images/cards/card-doze_16-9_2x.png page.article=true @@ -20,10 +20,10 @@ next.link=battery-monitoring.html
  • Doze Restrictions
  • Assessing Your App
  • Using GCM to Interact with Your App
  • -
  • Support for Other Use-Cases
  • Understanding App Standby
  • +
  • Support for Other Use-Cases
  • Testing
    1. With Doze
    2. @@ -110,7 +110,7 @@ next.link=battery-monitoring.html
    3. Standard {@link android.app.AlarmManager} alarms (including {@link android.app.AlarmManager#setExact(int, long, android.app.PendingIntent) setExact()} and {@link android.app.AlarmManager#setWindow(int, long, long, - android.app.PendingIntent) setWindow()} are deferred to the next mainenance window. + android.app.PendingIntent) setWindow()}) are deferred to the next maintenance window.
    4. @@ -133,7 +133,7 @@ next.link=battery-monitoring.html
    5. The system does not perform Wi-Fi scans.
    6. -
    7. The system does not permit syncs or jobs for your sync adapters. +
    8. The system does not allow {@link android.content.AbstractThreadedSyncAdapter sync adapters} to run.
    9. The system does not allow {@link android.app.job.JobScheduler} to run. @@ -156,10 +156,9 @@ next.link=battery-monitoring.html high priority message.
    10. -
    11. Place enough information in the Provide sufficient information within the initial message - payload to show in the notification; do not rely on subsequent network - access. + payload, so subsequent network access is unnecessary.
    12. Set critical alarms with {@link @@ -170,7 +169,7 @@ next.link=battery-monitoring.html
    13. - Test your app in Doze + Test your app in Doze
    @@ -181,8 +180,8 @@ next.link=battery-monitoring.html

    To assess your app in Doze, you can use adb commands to force the system to - enter and exit Doze and observe your app’s behavior. See the Testing section - for details. + enter and exit Doze and observe your app’s behavior. See Testing with Doze for details.

    @@ -226,7 +225,7 @@ next.link=battery-monitoring.html

    The Doze restriction on network access is also likely to affect your app, - especially if the app relies on realtime messages such as tickles or + especially if the app relies on real-time messages such as tickles or notifications. If your app requires a persistent connection to the network to receive messages, you should use Google Cloud Messaging (GCM) if possible, as described below. @@ -238,16 +237,16 @@ next.link=battery-monitoring.html

    Google Cloud Messaging (GCM) is a cloud-to-device service that lets you support - realtime downstream messaging between backend messaging services and apps on + real-time downstream messaging between backend services and apps on Android devices. GCM provides a single persistent connection to the cloud - that can be shared among all apps needing realtime messaging. This shared + that can be shared among all apps needing real-time messaging. This shared connection significantly optimizes battery by making it unnecessary for multiple apps to each maintain a separate persistent connection, which can deplete the battery rapidly.

    - If your app requires realtime integration with a backend service, it’s highly + If your app requires messaging integration with a backend service, it’s highly recommended that you use GCM if possible, rather than maintaining your own persistent network connection. Also, GCM is optimized to work with Doze and App Standby idle modes by means of GCM high-priority messages let you reliably wake your app to access the network, even if the user’s device is in Doze or the app is in App Standby. - In Doze or App Standby mode, the system delivers the message and gives the + In Doze or App Standby, the system delivers the message and gives the app temporary access to network services and partial wakelocks, then returns to idle state.

    @@ -277,67 +276,6 @@ next.link=battery-monitoring.html wake apps even when the device is in Doze.

    -

    Support for other use-cases

    - -

    - Almost all apps should be able to support Doze by managing network, alarms, - jobs, and syncs properly and using GCM high-priority messages. For a narrow - set of use cases, this might not be sufficient. For those, the system - provides a configurable whitelist of apps that are partially - exempt from Doze and App Standby optimizations. -

    - -

    - An app that is whitelisted can use the network and hold {@link - android.os.PowerManager#PARTIAL_WAKE_LOCK partial wake locks} during Doze and - App Standby. However, other restrictions still apply to the - whitelisted app, just as they do to other apps. For example, the whitelisted - app’s jobs and syncs are deferred and its regular AlarmManager alarms do not - fire. -

    - -

    - Users can manually configure the whitelist in Settings > Battery - > Battery Optimization. Alternatively, the system provides - low-friction ways for apps to ask users to whitelist them. -

    - - - -

    Before asking the user to add your app to the whitelist, make sure the app - -meets the acceptable use-cases for whitelisting listed below.

    - - -

    - Note: Google Play policies prohibit apps from requesting - direct exemption from Power Management features in Android 6.0+ (Doze and App - Standby) unless the core function of the app is adversely affected. -

    - -

    Understanding App Standby

    @@ -367,34 +305,77 @@ meets the acceptable use-cases for whitelisting listed below.

    time, the system allows idle apps network access around once a day.

    - -

    Support for other use-cases

    - The power-saving features of Doze and App Standby limit the amount of - background processing that your app can perform when a device is in an idle - state or while your app is not in focus. The restrictions the system may - impose on apps include limited or no network access, suspended background - tasks, suspended Notifications, ignored wake requests, and alarms. To ensure - that your app behaves properly with these power-saving optimizations, you - should test it by simulating these low-power states. + Almost all apps should be able to support Doze and App Standby by managing + network, alarms, jobs, and syncs properly and using GCM high-priority + messages. For a narrow set of use cases, this might not be sufficient. + For those, the system provides a configurable whitelist of apps that are + partially exempt from Doze and App Standby optimizations. +

    + +

    + An app that is whitelisted can use the network and hold {@link + android.os.PowerManager#PARTIAL_WAKE_LOCK partial wake locks} during Doze and + App Standby. However, other restrictions still apply to the + whitelisted app, just as they do to other apps. For example, the whitelisted + app’s jobs and syncs are deferred and its regular AlarmManager alarms do not + fire. +

    + +

    + Users can manually configure the whitelist in Settings > Battery + > Battery Optimization. Alternatively, the system provides + ways for apps to ask users to whitelist them. +

    + + + +

    + Before asking the user to add your app to the whitelist, make sure the + app meets the acceptable use-cases for whitelisting listed below. +

    + + +

    + Note: Google Play policies prohibit apps from requesting + direct exemption from Power Management features in Android 6.0+ (Doze and App + Standby) unless the core function of the app is adversely affected. +

    + +

    Testing with Doze and App Standby

    + +

    + To ensure a great experience for your users, you should test your app fully + in Doze and Standby.

    Testing your app with Doze

    -

    - The power-saving features of Doze and App Standby limit the amount of - background processing that your app can perform when a device is in an idle - state or while your app is not in focus. The restrictions the system may - impose on apps include limited or no network access, suspended background - tasks, suspended Notifications, ignored wake requests, and alarms. To ensure - that your app behaves properly with these power-saving optimizations, you - should test it by simulating these low-power states. -

    - - - -

    You can test Doze mode by following these steps:

    +

    You can test your app in Doze by following these steps:

    1. Configure a hardware device or virtual device with an Android 6.0 (API @@ -471,15 +452,15 @@ $ adb shell am get-inactive <packageName> Instant messaging, chat, or calling app. - Requires delivery of realtime messages to users while device is in Doze or app + Requires delivery of real-time messages to users while device is in Doze or app is in App Standby. Yes, using GCM Not Acceptable - Should use GCM high-priority messages to wake the app and access the netowrk. + Should use GCM high-priority messages to wake the app and access the network. - Yes, but wants to use another messaging service for non-technical reason. + Yes, but is not using GCM high-priority messages.