Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,810,757 Members 36,536 Now Online
XDA Developers Android and Mobile Development Forum

Wrong state of charge calculation by android

Tip us?
Junior Member - OP
Thanks Meter 0
Posts: 1
Join Date: Apr 2014
Battery Full Wrong state of charge calculation by android

I've i9195 with stock battery and rom, all was normal. Then I replaced it with double sized battery+new back cover. Not a microUSB batterycase. After many cycles and weeks of use it still didn't calibrated to new capacity. Fully charged battery lasts about a day and phone shuts down. If I switch it back ON after couple of minutes - I see 50% charged and can use phone another day.After second 'full discharge' I'll have about 15% more. All techniques for 'calibrating' battery with deleting batterystats doesn't work. Charge, off, remove bat, wait, place it back - either. /sys/class/power_supply/battery/uevent have string POWER_SUPPLY_ENERGY_FULL=1940000000 and it is always the same. So phone simply downcount from this level and tells that charge is 0% while voltage is about 3.7v. Interesting that "energy_full" file has number of 3880000000 but it seems that it's not used in calculations.
After all I installed CWM, root, cyanogenmod 11 and used it for about a week. SAME problems, except that "energy_full" is 1940000000.
I want to solve this very much, I can program or recompile kernel, if needed. It's pm8921 charger ic there. Maybe this number was programmed in it in factory mode or smth. Maybe threis a way to correct it. Thanks in advance.
(Last edited by JulianAT; 1st September 2014 at 11:23 PM.)
Junior Member
Thanks Meter 0
Posts: 3
Join Date: Sep 2012
Same here with stock-rom, CyanogenMod and MoKee's rom.
I think the only way will be to recompile the used kernel with the correct value of 3880000000 instead of 1940000000 in file "drivers/power/pm8921-bms.c" in kernel sources (function "calculate_fcc_uah", part "scalefactor". Scalefactor has to be change into scalefactor *= 2;).

Huge work for a little problem...
Junior Member
Thanks Meter 1
Posts: 20
Join Date: Aug 2014
Instead of making any advanced config, have you tried this little app (needs root privileges)?

After migrating to CM11 my battery was draining very fast. I used this app and it apparently fixed a part of the issue (battery still drains fast, but not as fast as before).
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes