by pshirshov · 3y ago · 0 comments
I've recently migrated to Pixel 7 Pro with GrapheneOS and noticed that my battery was lasting for about 6 hours. And there was nothing unusual in the battery usage report. Initially I thought that something is wrong with new Pixels or GrapheneOS.
So, I've started reading ADB logs and assumed that something might be wrong with Meta apps - (which I installed in work profile). The logs were full of various messages and stacktraces from their background services. So, I put them (facebook, messenger, whatsapp) into "restricted battery" mode and disabled background data. That was enough to keep battery for 12 hours.
I thought that it might be an issue with Graphene sandbox and bad Meta code, not a deliberately created "feature".
In the end I've also restricted Telegram and now my battery lasts for 17 hours.
So, I went to the extremes and now I do the same (restricted battery + disabled background data) for all the apps by default.
If you want to figure out what's going on with your battery, grab a bug report (adb bugreport command is one way). Then upload the resulting ZIP into battery historian - https://github.com/google/battery-historian (there's a hosted version somehwere on the web is you're willing to trust it with your debug data).
That will give you a usable graph of what's been keeping your phone awake, using radio and what the state of your signal quality was.
Do notifications for messages still work in restricted mode (sorry if silly question) ?
They are installed into a work profile. Created specifically for all the untrusted shit around. Moreover, the networking in that profile is routed through a VPN.