• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root Battery stats good or bad to clear

trapperjohn

Well-Known Member
Dec 25, 2009
212
30
Hi,
I installed cm7 which really makes my phone fly compared to stock :) I can only imagine how much faster it will be with other roms that are tweaked for speed!
But before I start changing roms I wanted to get clarification on how you would recommend handling battery stats file.
Should it be cleared and if so what is the best way to have it relearn the battery usage, I ask since I have seen conflicting ways on how to handle this.
Thanks,
Bryan
 
May I ask what is the benefit of this, and don't you wipe battery stats through recovery

Yes you wipe in recovery, front to back (oh wait that is with babies), If you do not wipe your battery stats you may get inaccurate readings with the battery in the notification bar as well as any battery widgets you use, if you wipe without a full battery you will also get inaccurate readings. I have seen many things to do after you wipe, I personally wipe and go on with my life, I don't usually have the time to let the battery die completely then charge up completely without cutting the phone on.
 
Upvote 0
Yes you wipe in recovery, front to back (oh wait that is with babies), If you do not wipe your battery stats you may get inaccurate readings with the battery in the notification bar as well as any battery widgets you use, if you wipe without a full battery you will also get inaccurate readings. I have seen many things to do after you wipe, I personally wipe and go on with my life, I don't usually have the time to let the battery die completely then charge up completely without cutting the phone on.
Does it make any difference if you rarely charge your phone? I have two spares and I swap out once to twice a day 'cause I hate having to plug in my phone.
 
Upvote 0
I am not sure but I would think it would help if you swap batteries. I believe part of the calibration is how fast the phone drains the battery, because this is variable based on the amount of cycles the battery has been thru I think this would make clearing stats a moot point. Really all this is for is to try to ensure proper reading of your battery level, it should not affect actually battery life.
 
Upvote 0
Charge battery to 100%. Wipe Battery stats. Drain to 0% (let phone shut itself off) Charge to 100%. Use as normal. You can do this every time you flash something, but it becomes a pain. I usually just wipe stats with out calibrating.


Hi,
I followed your method and so far in first full day I notice less pausing on a percentage number than before, so basically I don't seem to see anymore a long pause at 64 % then a faster drop then slow all while doing the same thing at the time so battery is more consistent :)
Thanks for your help!
Bryan
 
Upvote 0
You know, the more I think about this, I think I would rather just get the battery voltage and learn to interpret it myself.

Not sure what you are saying here, you can manually undervolt but unless you are going to keep track of what the voltages are at all times and subtract that from your battery when full as well as take into account things like battery degradation from cycles I don't think you will be able to manually make an accurate estimation of your battery percentage.
 
Upvote 0
Not sure what you are saying here, you can manually undervolt but unless you are going to keep track of what the voltages are at all times and subtract that from your battery when full as well as take into account things like battery degradation from cycles I don't think you will be able to manually make an accurate estimation of your battery percentage.

I guess to me a percentage is not that much more abstracted--you have to take into account how various apps and uses (like screen brightness) affect battery life for it to have any meaning. In other words, when my battery says 50%, that means that the algorithms are estimating that my 1700 mAh battery has 850 mAh left--now it is up to me to decide what that means in terms of how many songs I can listen too if the screen is on in sunlight and 4G on but the GPS off, etc. etc. You already have to do 90% of the estimation in your head, so why not just do 100% of it?
 
Upvote 0
I am not sure we are talking about the same thing. Wipe battery stats wipes the files that the phone uses to calculate the battery % left. These can be thrown off by things like booting into recovery the time you spend making backups/wiping/flashing/looking at emo horse are not tracked so it can cause issues over time with how your phone reflects the battery remaining. It is still up to you to determine what is causing the battery drain, but I fail to see how you will calculate how much juice is left in your battery without an accurate reading from the phone to be able to tell there is 850 mAh left in your battery.
 
Upvote 0
I am not sure we are talking about the same thing. Wipe battery stats wipes the files that the phone uses to calculate the battery % left. These can be thrown off by things like booting into recovery the time you spend making backups/wiping/flashing/looking at emo horse are not tracked so it can cause issues over time with how your phone reflects the battery remaining. It is still up to you to determine what is causing the battery drain, but I fail to see how you will calculate how much juice is left in your battery without an accurate reading from the phone to be able to tell there is 850 mAh left in your battery.

I always assumed that the battery stats was storing the parameters of the voltage vs. capacity curve for the particular battery. I know that lithium ion batteries do a lot of weird stuff (i.e. temperature dependencies), but they still have a voltage vs. capacity curve. They only thing the phone can measure about the battery's state of discharge is the voltage (and I guess the temperature gives you some info, too, but it only refines the info from voltage).

I have never understood why things like booting into recovery would affect it unless they are doing something like trying to integrate the current draw...and even if they were, the program should be smart enough to only integrate through contiguous data points in terms of time. They should be able to take little chunks of this integration to refine the curve, and a block of missing data should make it less refined, not erroneous. You take the current draw at spaced times and multiply by the time intervals to get and approximate mAh drain, then compare that to the voltages over the same intervals. This gives you a small chunk of real data to compare to your model of the voltage vs. capacity curve. You then use this information to refine the model to more accurately reflect actual usage. I don't see how booting into recovery would affect this process other than stopping it...which would not ruin it--just take some data points away.

What I really would like to know is why a nominal curve would not be 90-95% accurate--which is close enough (e.g. 21% or 22% left vs. 20% left is close enough). Gonna have to read up a bit more on this if I can find anything.

Edit: one more thing--I kind of over simplified things a bit--it is more of a manifold than a curve since the effective capacity is affected by the current draw because of losses due to internal resistance--in other words, rapid discharge effectively reduces the capacity of the battery because the higher current results in higher internal resistance losses. Still--the booting into recovery does not affect this either.
 
Upvote 0
I'm really tired and may have to edit this tomorrow by I think the reason booting into recovery causes the stats to get messed up is with the OS not running it has no way of keeping track of how much the battery has discharged between when you entered recovery and rebooted. I could be easily wrong, in fact there may be a place within one of the recoveries that show battery level, but it could be the recovery is looking at the same stats the is looks at and doing it's own approximations to show this.
 
Upvote 0
Some things you may want to look at. BatteryManager | Android Developers()
Intent | Android Developers
and
https://market.android.com/details?id=com.manor.currentwidget&feature=search_result
and
https://market.android.com/details?id=ccc71.bmw&feature=related_apps

The first two links are to the SDK reference guide. From what I can tell battery stats are calculated here. With EXTRA_SCALE being max charge and EXTRA_LEVEL being current charge between 0 and EXTRA_SCALE. I would assume EXTRA_ICON_SMALL is calculated with those other two strings. From what I can tell it look like it only uses voltage and temp as well as history (battery stats like max charge) to calculate these so I would also guess you are on the right path to coming up with a manual way to calculate it very close to what the system does as well. I actually doubt android takes temp into account with it's calculations, it likely relies only on discharge. Wiping battery stats should wipe the graph clean, you charge it up and it creates a new graph based on the data it collects after the wipe. This also would help explain why what worm said would work for calibrating, the OS could get a reading at all levels, if you were to do it more than once it *should* get more refined. I think all you would need to calculate it manually would be a way to read the string EXTRA_VOLTAGE and you could then be set.

The market links are the only 2 apps I could find that I thought would relate to this at all, I don't know if they would assist you at all but I figured I would link them anyways. Let me know if I am way out in left field with this or not :D
 
Upvote 0
Close to on topic :D

Thought about it and if the battery stats do keep track like I am thinking I do not think android would take temp into account on it at all. I am not as knowledgeable about the specific dynamics of batteries as I could be but I would think that if the battery heated up and caused drain that would be reflected in the voltage reading?
 
Upvote 0
Close to on topic :D

Thought about it and if the battery stats do keep track like I am thinking I do not think android would take temp into account on it at all. I am not as knowledgeable about the specific dynamics of batteries as I could be but I would think that if the battery heated up and caused drain that would be reflected in the voltage reading?

Sort of. If the temperature is higher, the battery had higher internal losses at at given current draw. And here is the complicated part--a higher current draw increases the battery temperature temporarily. So drawing 100 mA for 2 hours is not the same as drawing 200 mA for one hour. Both are 200 mAh, but the 200 mA draw will increase the battery temperature, so more energy is lost to heat within the battery. In practical terms, I think it basically means that our obsession with single digit precision for battery capacity is kind of pointless since we do not know if the next thing we do will be low current draw or high current draw.

Oh, and lithium ion batteries have very low but not negligible self drain (mostly due to the onboard voltage monitors). They also lose a lot of capacity as time goes on, but in something as active as a smartphone, this loss of capacity should be able to be monitored (it is a fraction of a percent per day).
 
  • Like
Reactions: trapperjohn
Upvote 0
Sort of. If the temperature is higher, the battery had higher internal losses at at given current draw. And here is the complicated part--a higher current draw increases the battery temperature temporarily. So drawing 100 mA for 2 hours is not the same as drawing 200 mA for one hour. Both are 200 mAh, but the 200 mA draw will increase the battery temperature, so more energy is lost to heat within the battery. In practical terms, I think it basically means that our obsession with single digit precision for battery capacity is kind of pointless since we do not know if the next thing we do will be low current draw or high current draw.

Oh, and lithium ion batteries have very low but not negligible self drain (mostly due to the onboard voltage monitors). They also lose a lot of capacity as time goes on, but in something as active as a smartphone, this loss of capacity should be able to be monitored (it is a fraction of a percent per day).


I would think after the heat loss the voltage would show as diminished, meaning with the correct amount of data you should still be able to get an accurate reading of battery level.

It would be interesting to know what all the battery stats collect. If they keep things like average draw and average battery temp the calculations could compensate for unknown variables. If that is the case it also helps explain why it is important to wipe battery stats, if you undervolt but have average draw stats from stock for 2 months before undervolting it would give inaccurate readings.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones