News | Profile | Code | Photography | Looking Glass | Projects | System Statistics | Uncategorized |
Blog |
Ever since I upgraded my OnePlus 3T to LineageOS 15.1 last year and then this year replaced that phone with a OnePlus 6T running OxygenOS (Android 9) notifications has been spotty. By spotty I mean sometimes I get notifications when the phone is locked with the screen off and sometimes tons of them pop up (as if they were queued up) after I unlock the phone. I've generally ignored it but it started to annoy me lately, so I looked into it.
Disabling battery optimization didn't do squat. I tried this for a day or two and then concluded it didn't do anything, so I changed all apps back to being optimized (except for Nine, since it complains if it's optimized).
I've always had the "Wi-Fi on when screen is off" setting enabled and can always ping my phone while the screen is off (and observe comms using tcpdump on my router).
It turns out that the root cause here is the Doze feature of Android, which was introduced in Android 6. Disabling it can be done with adb or from the shell (as described here), so I did it:
~$ dumpsys deviceidle disable Deep idle mode disabled Light idle mode disabled
This fixed the problem. All notifications work for me when the phone is locked and the screen is off, now.
The one thing that this doesn't explain is why I only started noticing this in Android 8 when the feature was clearly added in Android 6. Oh well.
New comments are currently disabled for this entry.
This HTML for this page was generated in 0.001 seconds. |