| Start |
|---|
| Whitelisting an Android application programmatically Whitelisting won't disable the doze mode for your app, but you can do that by using network and hold-wake locks. Whitelisting an Android application programmatically can be done as follows: The result of starting the activity above can be verfied by the following code: |
Exclude app from using doze mode
Now this app will show under not optimized apps. An app can check whether it's whitelisted by calling RemarksDoze Mode is a set of changes and rules that put your phone to sleep when idle. On Android 6.0 Marshmallow:
Doze mode gets activated after a while the screen is off, the device is stationary and it's running on battery.
On Android 7.0 Nougat:
Imagine if your phone is on your pocket (the screen is off, it's running on battery, but it's not stationary) you might want to get the Doze Mode features as well, right?
So that's why Google announced the Extended Doze Mode: It runs when the screen is off, but not stationary.
You can find more information here: https://developer.android.com/training/monitoring-device-state/doze-standby.html (opens new window) |
Read Article
https://develop.horje.com/learn/1434/reference