1

I'm looking at the "Battery" section under "Settings", and there's two major sections:

  1. a graph that shows how full the battery has been over some period
  2. Which apps have used the most battery power over (what appears to be) that same period.

There's a label between the two sections that says "Use since last full charge"

And I can't figure out what constitutes "full charge".

Things I've tried: 1. Not letting the battery get full. (thought it would be this simple a couple of months ago when I started this investigation, but it's not this simple) 2. Not letting the battery get empty (it seems to reset the stats more when the battery is low, 3. Time charging (it also seems to happen if it's a short or a long charge)

So, I guess what I'm asking is, "What is it precisely that resets the battery stats?"

Android is open source? Does this mean the code is readily available to look through? Where would I get started to try to figure it out myself? Is this kept in a battery library? Where's the source code for that?

Here's an example of when it reset at about 75%. enter image description here I'm running 7.1.1

  • 2
    On my Samsung devices (2 tablets and a phone), 90% charge,, something I experimented with early on, constitutes 'Full' and resets the counters. YMMV, based on your device. – wbogacz Mar 19 '18 at 22:12
2

"What is it precisely that resets the battery stats?"

Quoting from an old post by a Google engineer

....it is reset every time you unplug from power with a relatively full charge (thus why the battery usage UI data resets at that point)....

Relatively full is not defined AFAIK but from experience 90% charge does the trick of resetting it. IIRC on KitKat reboot also did that

Location of batterystats.bin file is /data/system/batterystats.bin

  • I can't point you to the code

  • Battery usage statistics in Android is poor though it has improved considerably in Oreo. Without specifying the Android version and an accompanying screenshot your question about interpretation cannot be answered fully, but here's an example. Suppose you charged fully (100%) and used only YouTube and Chrome till it dropped to 70%. In app usage of it shows YouTube used 60%, it means 60 % of the drop (=30%) is used by it. In outlet words, 60*30 =18% of battery capacity is used by YouTube. Similarly for Chrome and other apps. The total will never exactly match up. If you install GSam battery monitor, you get more meaningful interpretation

enter image description here

  • I think I have to disagree, because mine resets at numbers much lower than 90%. I've seen it reset at 8% and 20%, for example. – McKay Mar 21 '18 at 4:05
  • I've added an image of my battery screen. I'm running 7.1.1 – McKay Mar 21 '18 at 4:09
  • Well, I can't say why. I have explained the standard behaviour. Explanation of statistics interpretation is the same – beeshyams Mar 21 '18 at 4:51
  • It will also reset itself at some point after the time since last charge displays at least 5 days. I have managed to get it as high as 8 days once, but it becomes very sensitive after 5, one wrong move like taking it off the charger with the screen off (still well below 90%), or even with the screen on i have seen it hang for 16s still saying it's charging, then suddenly reset itself as I watched – Michael Sep 25 at 16:06
0

This answer is based on Android 9 (Pie).

I have been trying to find the answer to this question for quite a while. Preventing the battery graph from resetting has become somewhat of a game for me - a game that I lose if the graph resets.

If the battery charge reaches 90%, the graph will reset. Typically the graph will reset as soon as the battery is removed, but it may reset before this if the charge reaches full. I very rarely let the battery charge go above 80%, but this does not prevent a reset. Under the chart there is text indicating how long it has been since the graph was reset. Once it is reading more than a day, it does not seem to actually switch days based on when the graph reset, but from a fixed time in the day. For instance, I once had the graph reset at 9:47a.m. but a few days later I notice it went from 4 days to 5 around 10p.m.

One the "days ago" value reaches 5, the graph may reset any time you take it off the charger, no matter what the charge state is. The graph may also reset itself spontaneously while not being charged if the battery graph app gets killed. Ironically, putting the phone in battery saver may make this more likely! I am still trying to determine the exact sequence of steps to prevent this, but it is slow because it takes at least 5 days until I can try the next experiment. When I get more data points I will update this answer.

It is possible to prevent a reset for at least 8 days if all the conditions are right, as shown below: enter image description here

Update: This is really frustrating me. The battery guage will apparently reset even before 5 days has been reached, as early as 4 days, 9 hours. Just taking it off power, with the screen on, seeing that it has not reset, and then turning off the screen for 5 seconds and turning it back on has led to it resetting multiple times.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.