Android Question Notification delayed in doze mode (reprise)

Discussion in 'Android Questions' started by marcick, Jul 17, 2019.

  1. marcick

    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 ?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. marcick

    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 ?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    No.
     
  5. marcick

    marcick Well-Known Member Licensed User

  6. Erel

    Erel Administrator Staff Member Licensed User

    How do you see it? Make it log a message every few seconds.
     
  7. marcick

    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
     

    Attached Files:

  8. marcick

    marcick Well-Known Member Licensed User

    If you leave the USB cable connected it detects a charge and doze mode probably does not start. I suppose.
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    It is possible that the device won't let you turn on the screen in doze mode.
     
  10. marcick

    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:
     
  11. techknight

    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
     
  12. marcick

    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.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice