CPU load "advancedprivacy" process

When my device is running for several days the battery drain seems to increase (to about 4% per hour or more).
Also “deep sleep” time while “screen is off” decreases, even when in flight mode.
So I had a look at the output of top -s 11 (over an adb shell) and it seems that the process “foundation.e.advancedprivacy” (fourth line below) most of the time consumes about 3-5% CPU time (even when in flight mode) and also has quite a high total time (see column TIME+):

Can anyone confirm this? Do you have similar total CPU times (relatively comparing the listed processes)?

if you want to get into the weeds with this, I’m a big advocate of battery-historian. In the 2nd graph tab you can select custom metrics: “CPU, JobScheduler, Doze, Long Wakelocks, Fg process, Screen” on y1, and “battery level” on y2 to see steep declines in battery charge. On hover you can see what is drawing by jobscheduler or wakelock and if your screen is also active, if the battery level decline is justified or if the screen is off but CPU running at all times and keeping the device from sleeping

adb bugreport whos-eating-my-battery.zip

exec and connect to http://localhost:9999 and choose the zipfile

docker run -p 9999:9999 gcr.io/android-battery-historian/stable:3.0 --port 9999

Edit: on my device advanced privacy didn’t hold wakelocks a lot and wasn’t responsible for unusual draw in a 1.8-q /e/

2 Likes

Sounds nice!
But I’ve some problems with it:
it generates a lot of errors like:

grafik

The last error line might be related to the fact that my output x axis refers to unreliable date/time (it starts somewhere in 2022 but ends in April 2023:

Any idea what might be going wrong?

There are some issues related to the zoneinfo: 1, 2 + 3, do you build bh from Go source instead of the docker env?

Could you try this workaround where you mount the hostsystems zoneinfo into the docker run?

docker run -v /usr/share/zoneinfo:/usr/share/zoneinfo gcr.io/android-battery-historian/stable:3.0 --port 9999

Another option is to use an online instance of b-historian - https://bathist.ef.lc/

general docs for battery-historian are at

1 Like

Thanks for your advice!

I’ve now tried the mounted hostsystems zoneinfo into docker run. This makes the zoneinfo error disappear and X axis looks much better. But unfortunately data is still from 2022 to future…:

I’ll look later into the other links you’ve added…

could you run this battery-stats reset command and then use the device for another few minutes/hours and create a new report?

adb shell dumpsys batterystats --reset

is it possible the old/current bugrep spans indeed too much of a timeframe (many days or even weeks)?

1 Like