0

I have an requirement where I need to Wakeup the screen for non-whitelisted app to display the Alarm notifications while application is in Doze mode.

I have gone through the android.developer.guide and I could see we can display the alarm notification for whilelisted app using the following methods setAndAllowWhileIdle() and setExactAndAllowWhileIdle()

Reference Link: https://developer.android.com/training/monitoring-device-state/doze-standby.html#testing_doze

Could some please suggest whether I can wakeup the screen for non-whitelisted application and display the Alarm notifications?

NikhilReddy
  • 6,904
  • 11
  • 38
  • 58

1 Answers1

0

I could see we can display the alarm notification for whilelisted app using the following methods setAndAllowWhileIdle() and setExactAndAllowWhileIdle()

not exactly right,

setAndAllowWhileIdle() and setExactAndAllowWhileIdle() are both provide solution to the Doze restrictions , whitelisting your app as you can see here is another way of handling doze mode.

You should implement a simple AlarmManager with one of the methods above , then Test with Doze and App Standby and you will get the results.

Edit:

According to setAndAllowWhileIdle and setExactAndAllowWhileIdle

... this alarm will be allowed to execute even when the system is in low-power idle (a.k.a. doze) modes ...

When the alarm is dispatched, the app will also be added to the system's temporary whitelist for approximately 10 seconds to allow that application to acquire further wake locks in which to complete its work.

Community
  • 1
  • 1
Ben Shmuel
  • 1,819
  • 1
  • 11
  • 20
  • Thanks for you reply, whether I can wakeup the screen for non-whitelisted application and display the Alarm notifications?? – NikhilReddy Jun 13 '19 at 01:59