Android Question Notification delayed in doze mode (reprise)

marcick

Well-Known Member
Licensed User
As we were already discussing here, doze mode create devastating effect in delaying notifications.
After a few minutes the device is put in sleep (screen off, not moving, not charging) it enters in doze mode and start a cyclic wake up for a while only during "maintainance windows".
More time the device remain in sleep, more delayed becomes these windows, so it is usual to experiment delays of several minutes in receiving notification when the device is not used.

Question is: can bring to success implementing a foreground service that does nothing but just wake-up the device every couple of minutes for example, to avoid the device enter doze mode ?
Or it is quite sure the OS sooner or later will kill that service ?
 

marcick

Well-Known Member
Licensed User
I'm actually not using any service. Everything is based on notifications.
I'll try that code. No problems at all with PlayStore ?
 

marcick

Well-Known Member
Licensed User
I attach my modified code.
I would expect a local notification every minutes but if you leave the device in standby, after some minutes it starts to work bad.
I also tried to add the code to exclude battery optimization
 

Attachments

marcick

Well-Known Member
Licensed User
Well, let's suppose the service works at exact timings.
But if then the device is not able to wake-up, turn-on screen and show/play notification when the service starts .... all become unuseful for my needings ...:confused:
 

techknight

Well-Known Member
Licensed User
Welcome to my world. With android 8 and newer, on my phone, I stopped getting timely Warning alerts iwth Weather service apps. Ill get a severe thunderstorm warning several hours after it had already blew through and passed by. Or when I wake the phone up, THEN the notification comes through.

Prior to 8, none of these issues occurred. And its only getting worse. The only way itll change is if peoples lives start getting affected by it. If someone is killed over a delayed notification and google gets drug into a lawsuit over it. Then maybe. I've seen more silly lawsuits lol.

Thats been my experience anyways.

/rant
 

marcick

Well-Known Member
Licensed User
What is absurd is that the system does not allow you to choose if use or exclude doze mode (yes, just in theory).
A lot of people is complaining about this, but I don't feel like something will change.
 
Top