Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doze mode and foreground service

Checking my app's behavior on M Preview device, it seems that its foreground (with active notification) service playing music is not affected by Doze mode. But reading docs it seems that foreground services are exempt only from AppStandby.

What is the real rule?

like image 835
GPack Avatar asked Oct 08 '15 14:10

GPack


People also ask

What is doze mode in Android?

In Doze mode, the system attempts to conserve battery by restricting apps' access to network and CPU-intensive services. It also prevents apps from accessing the network and defers their jobs, syncs, and standard alarms.

What does doze mode mean?

Starting from Android 6 Marshmallow, Doze mode helps preserve battery life by putting your phone in a deep sleep state when you're not using it for an extended period of time.

What does it mean when an app is using foreground service?

Foreground services perform operations that are noticeable to the user. Foreground services show a status bar notification, so that users are actively aware that your app is performing a task in the foreground and is consuming system resources.

Does WorkManager work in doze mode?

Another nice feature of WorkManager is that it respects power-management features so that if a job is scheduled to run at a defined time and the device is in Doze at that time, WorkManager will try to run the task during a maintenance window if the constraints are met or after Doze is lifted.


1 Answers

In this post's comments on Sep 17 Dianne Hackborn writes:

Apps that have been running foreground services (with the associated notification) are not restricted by doze.

So yes, your findings seem to be the intended behavior.

like image 152
sec_aw Avatar answered Oct 14 '22 01:10

sec_aw