Doze and App Standby mode in Android 6.0
Asked Answered
A

1

2

Google introduced Doze and App Standby mode with Android 6.0 OS.
Device will enter in Doze mode if device is unplugged and unused for some amount of time and if application stays inactive for some amount of time, that app goes in StandBy mode (Correct me if I am wrong).

  1. Can we (developer) know, device entered in Doze mode or application entered in StandBy mode? How?


http://developer.android.com/training/monitoring-device-state/doze-standby.html#whitelisting-cases In this link, Google says that Voip or Chat or Calling application will still work when device is in Doze mode.

  1. How OS will come to know that this is Voip or chat or Calling app, so i will keep it awake in Doze mode too.?
  2. What callback I need to register to complete maintenance task when application is out of Doze mode.?
Annice answered 5/3, 2016 at 6:44 Comment(0)
C
1
  1. Yes, you can get informed of idle mode changes, by listening for DEVICE_IDLE_MODE_CHANGED intents, see: Android M listening to android.os.action.DEVICE_IDLE_MODE_CHANGED

  2. You will need to whitelist your app, details here: https://developer.android.com/training/monitoring-device-state/doze-standby.html#support_for_other_use_cases

  3. Same as for 1.

This page is also a really useful explanation of doze mode and how to test your app's handling of idle state: https://newcircle.com/s/post/1739/2015/06/12/diving-into-android-m-doze

Celindaceline answered 25/1, 2017 at 22:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.