• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

Remove doze mode entirely

Search This thread

Nikko_93

New member
Dec 24, 2020
1
0
In a local environment I have some Android pixel 3 devices(Android 11) that are connected with a web socket in the foreground service. This socket connection only listens for messages and pushes them to the push notification. Sometimes you may not receive messages for hours or sometimes days, so this needs to be really stable.

The push notification works when the screen is on, when the goes in lock mode the connection is fine for the first few minutes. If a message is pushed after 10-15 minutes, the notification message will not be displayed. As soon as another message comes up, the previous message is suddenly picked up and displayed to. After 60 minutes or more, no messages will be displayed at all. It appears that the connection is no longer intact and the server and app logs do not show that the connection is lost.

I have been working on this for more than 5 intensive days, but to my frustration nothing works. I have found many topics related to this doze topic, the optimization for the app adjusted, send a ping every minute (StayAlive) to the server but all to no avail.
Trying to change the idle settings and disable Doze mode via ADB, but no luck.

Its an internal app so I can do pretty much everything if needed.

Is there a way to bypass or remove the Doze entirely?
Please let me know

Thank you in advance.
 

wgraz

Senior Member
Sep 22, 2012
147
17
New Jersey
In a local environment I have some Android pixel 3 devices(Android 11) that are connected with a web socket in the foreground service. This socket connection only listens for messages and pushes them to the push notification. Sometimes you may not receive messages for hours or sometimes days, so this needs to be really stable.

The push notification works when the screen is on, when the goes in lock mode the connection is fine for the first few minutes. If a message is pushed after 10-15 minutes, the notification message will not be displayed. As soon as another message comes up, the previous message is suddenly picked up and displayed to. After 60 minutes or more, no messages will be displayed at all. It appears that the connection is no longer intact and the server and app logs do not show that the connection is lost.

I have been working on this for more than 5 intensive days, but to my frustration nothing works. I have found many topics related to this doze topic, the optimization for the app adjusted, send a ping every minute (StayAlive) to the server but all to no avail.
Trying to change the idle settings and disable Doze mode via ADB, but no luck.

Its an internal app so I can do pretty much everything if needed.

Is there a way to bypass or remove the Doze entirely?
Please let me know

Thank you in advance.
Feel your pain.. Just got a Note 10+ and have been going crazy testing notifications with 7-8 email clients all with the same delayed notifications as you describe. I read there's a way to remove it, but it will return at reboot. What did you try with ADB?

I was also reading about whitelisting certain apps to be not affected by doze and supposedly it'll stick after reboot. I've never done this before so it's all new. Sitting here at 4am just starting to read about whitelisting. Gotta get to bed.. Follow up tomorrow. Not sure if whitelisting will work on Android 11. Any other help will be greatly appreciated.
 

wgraz

Senior Member
Sep 22, 2012
147
17
New Jersey
So, what's the difference between these two (I know "disable" doesn't stick on reboot):
Code:
adb shell dumpsys deviceidle unforce
VS
Code:
adb shell dumpsys deviceidle disable


I'd rather whitelist specific apps but isn't this the same as turning off Battery Optimization for an app in the Settings (which doesn't work):
Code:
adb shell dumpsys deviceidle whitelist +<package name>


Factory Unlocked Note 10+ Android 11 One UI 3.1.
 
Last edited:

wgraz

Senior Member
Sep 22, 2012
147
17
New Jersey
Disabled Doze with the ADB command: adb shell dumpsys deviceidle disable

Confirmation:
"Light state: INACTIVE
Deep state: INACTIVE"

But still getting email notifications as late as ever if phone has been inactive.

Factory Unlocked Note 10+ Android 11 One UI 3.1.
 
Last edited:

wgraz

Senior Member
Sep 22, 2012
147
17
New Jersey
Typically, one rarely gets useful replies in this forum. One typically has to fight with problems on his own...
Yeah, And this forum search sucks. I haven't found a way to search a particular thread or a group of threads. I laboriously, use "Find in Page" in one page at a time of certain threads. Takes forever. You're right, XDA seems vacant but I still try.

I started a thread almost a month ago about edge lighting... 165 views, Not one reply.
 

vp1117

Senior Member
Jan 30, 2019
55
6
Disabled Doze with the ADB command: adb shell dumpsys deviceidle disable

Confirmation:
"Light state: INACTIVE
Deep state: INACTIVE"

But still getting email notifications as late as ever if phone has been inactive.

Factory Unlocked Note 10+ Android 11 One UI 3.1.

It appears, de-activating a doze mode is not the solution. I get telegram notifications with huge delay, like half a day. At the same time, telegram application is included into witelist.

Here they mention wake locks. And, surprisingly enough, when I ran adb shell dumpsys power, I saw that out of 2 messengers that I use - whatsapp and telegram - only whatsapp shows a wake lock:

Untitled.png


However, I'm sick and tired of fighting with this s...tty android functinality and with s...tty power management tools china vendor built into their nasty china ROM for my china phone. I can live with the fact that whatsapp messenger works fine and telegram notifications are being depressed. I do not want to spend more time on this s...t, especially with zero level of expertise on this subject in this forum.
 
Last edited:
  • Angry
Reactions: -Alf-

wgraz

Senior Member
Sep 22, 2012
147
17
New Jersey
It appears, de-activating a doze mode is not the solution. I get telegram notifications with huge delay, like half a day. At the same time, telegram application is included into witelist.

Here they mention wake locks. And, surprisingly enough, when I ran adb shell dumpsys power, I saw that out of 2 messengers that I use - whatsapp and telegram - only whatsapp shows a wake lock:

View attachment 5332329

However, I'm sick and tired of fighting with this s...tty android functinality and with s...tty power management tools china vendor built into their nasty china ROM for my china phone. I can live with the fact that whatsapp messenger works fine and telegram notifications are being depressed. I do not want to spend more time on this s...t, especially with zero level of expertise on this subject in this forum.
Is it possible to add a PARTIAL_WAKE_LOCK to Telegram or any other app like email, etc?
 

nixnixnixnix4

Senior Member
Mar 15, 2021
333
65
  • Like
Reactions: wgraz

wgraz

Senior Member
Sep 22, 2012
147
17
New Jersey
I'm guessing this PARTIAL_WAKE_LOCK needs to be OK'd by Google when developing an app? Or can any developer put this in their app? Or is it not in the app at all, but Google has a "whitelist" of sorts to allow certain apps PARTIAL_WAKE_LOCK?
 

nixnixnixnix4

Senior Member
Mar 15, 2021
333
65
I'm guessing this PARTIAL_WAKE_LOCK needs to be OK'd by Google when developing an app? Or can any developer put this in their app? Or is it not in the app at all, but Google has a "whitelist" of sorts to allow certain apps PARTIAL_WAKE_LOCK?
Well, just look at the latest reviews for the GMail app on the Google Play store.
They're all complaining about notifications not being received when the phone is locked.
There was an update today. Let's see if that fixed it.

Here's a joke:
Q: How do you get Google to care about a bug?
A: Tell them you're an iOS user.
 
  • Like
Reactions: wgraz

Top Liked Posts