Doze has been bringing great benefit for my aging Nexus 5. But sadly, its presence also marks an end for my WhatsApp Web experience; since their "web" app is actually just a mere "interface" and still requires the phone to be actively connected to the Internet.

As we all know, Doze puts one's phone into a stand-by state where every unnecessary connection is halted. This means it will also halt the WhatsApp app in my phone (and thus in my computer's browser).

Now, is there a way to exclude WhatsApp from Doze? I mean, is something like that possible?

p.s., I prefer a non-rooted approach to this problem, but should rooting be my only option, so be it.

Hi! Please read How do I ask a good question? Did you thoroughly search/research for an answer before asking your question? Tell us what have you tried so far and why it didn't meet your needs? This demonstrates that you've taken the time to try to help yourself and it saves us from reiterating obvious answers.
– Firelord♦Nov 17 '15 at 18:09

To be honest, I don't see a point in your argument: I tried searching but it yields no results. I admit that I didn't try anything prior to asking this question apart from the basic digging into the settings; hence why I asked this question. Looking from the votes, it seems useful for quite a few people; it obviously is for me.
– ridsatrioNov 17 '15 at 18:18

It's immaterial to me at the moment whether you see a point in my argument or not. I voted on your question and I felt the need to justify my vote. That's all I did. My argument and vote are not affected by the amount of votes currently retained by the post. Instead, I only judge the content and take action. Please avoid arguing further, should you find a need to do that. Use flags for moderation attention requiring clean-up, if feels necessary.
– Firelord♦Nov 17 '15 at 18:21

2

Well, if that's the case then let me thank you for taking the time to vote. Do note, however, that a question might deemed "not good enough" by a certain standard while it could be proven useful for people who are in need. And in the end, the usefulness of a content is what actually matters in a site dedicated to help people; not how much it follows a certain standard.
– ridsatrioNov 17 '15 at 18:31

@ridsatrio did this fix the issue for you? I still get "your phone is disconnected" when my screen turns off and the phone goes into Doze even though WhatsApp is marked "Not optimized"
– swrobelNov 18 '15 at 0:19

1

@swrobel that might be due to a number of causes other than Doze. You might as well check through your Wi-Fi and data settings to check if there aren't any issues there.
– Tamoghna ChowdhuryNov 18 '15 at 4:05

If this doesn't work for you, I assume that you, like me, switch to Wi-Fi only and disable data. The problem is that Doze also turns off Wi-Fi, so even if an app like WhatsApp is excluded from Doze, it won't be able to connect. Andriod only re-connects to the Wi-Fi when you turn the screen back on. I notice because I also tend to hook my phone to an amp to listen to Spotify, and after a while it will stop playing because Wi-Fi is turned off. On another forum, I read that excluding "Google Connection Services" from Doze would solve this issue, but I don't see such a service on my phone.
– Daniel SanerMar 31 '16 at 9:52

Note that both the GUI and command-line method make changes in the file /data/system/deviceidle.xml. If you're up to the task and have root access, you can edit that file, reboot the device and your app would be found under "Not Optimized" tab of Battery Optimization.

Remount your system partition mount -o remount,rw /system and copy the file to your /system/etc/sysconfig/ folder. You may also remove the preinstalled *.xml files to disable the forced system services.