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


a graph that shows how full the battery has been over some period
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%.

I'm running 7.1.1
"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