[APP] [UPDATE-1/28/2013] AtrixBatteryFix 0.40

Search This thread

ravilov

Senior Member
Jan 26, 2010
2,217
1,346
localhost
[UPDATE] Version 0.40 is out.


Recent changes:
  • added the uptime monitor
  • renamed "battery monitor" to "system monitor"
  • minor cleanup to make it more compatible with the newer SDK's lint checks
  • other changes


------------------------------------------------------------------------------------------------

[UPDATE] Version 0.36 is out.


Recent changes:
  • version bump with minor cosmetic changes

This is just a minor maintenance release, no need to upgrade if your 0.35-beta1 is working well.

------------------------------------------------------------------------------------------------

[UPDATE] Version 0.35-beta1 is out.


Recent changes:
  • improved the monitoring service
  • added a new option - Only if <100% (will only run the auto-action (reboot or restart service) if the battery reports less than 100% when done charging)
  • improved the "battery full" detection code, should work better now
  • other fixes and improvements
Also had to delete some old versions since I hit the 20-attachments-per-post limit.

EDIT: Just realized I uploaded the wrong screenshot. :doh: Corrected.

------------------------------------------------------------------------------------------------

[UPDATE] Version 0.31-beta1 is out.


Recent changes:
  • hopefully fixed the constant "superuser auth" issue on CM10

------------------------------------------------------------------------------------------------

[UPDATE] Version 0.30-beta1 is out.

NOTE: Due to the significant changes in the settings/preferences part, please uninstall any previous version before installing this one. Thank you.


Recent changes:
  • re-added deleting batterystats.bin as an option (off by default)
  • moved all preferences to the settings screen
  • added an option to turn charging on or off, and also an option to automatically turn charging off when USB power detected
  • added some heuristics to determine when the battery is done charging (if the voltage does not change within 30 minutes, the battery is considered to be done charging) - hopefully this works
  • bugfixes, general code cleanup

Since new features were added and a significant chunk of the code has been rewritten, this is now considered beta.
This version also makes sure to be as non-intrusive as possible - nothing will happen automatically by default, you need to initiate any actions.

------------------------------------------------------------------------------------------------

[UPDATE] Version 0.21 is out.


Recent changes:
  • disabled removing the batterystats.bin file - it seems to have only caused problems with not a lot benefit. WARNING: if you're coming from an earlier version, you need to wipe app data for this to work!
  • changed defaults - now the app won't run the fix automatically when power detected by default, this should make the app completely non-intrusive by default.

------------------------------------------------------------------------------------------------

[UPDATE] Version 0.20 is out.


Recent changes:
  • added an option to restart the battd service instead of a full reboot - seems to work but this should be considered a beta feature
  • moved some options to a separate settings screen
  • cleanup here and there
Also cleaned up the attachments to this post.

------------------------------------------------------------------------------------------------

[UPDATE] Version 0.16 is out.


Recent changes:
  • better handling of missing or invalid datadir
------------------------------------------------------------------------------------------------

[UPDATE] Version 0.15 is out.


Recent changes:
  • about box is now shown on first run
  • rearranged and cleaned up the about text, added the donate link (which hopefully works)
  • fix for busybox that has the ash applet instead of sh
  • busybox is no longer required, will try to use system shell if busybox is not found
  • fixed a progress dialog issue upon screen rotation
  • uploaded source code to github

------------------------------------------------------------------------------------------------

[UPDATE] Version 0.1 FINAL is out.


Recent changes:
  • mostly just cosmetic changes

------------------------------------------------------------------------------------------------

[UPDATE] Version 0.1-beta4 is out.


Recent changes:
  • instead of running hardcoded shell commands, now runs external shell scripts in the app's datadir (so you can modify the scripts to your own liking)
  • all shell commands/scripts are now executed through busybox instead of default system shell (so busybox is now required)
  • separated fixing the battd datafiles (which is normally needed every so often) from fixing battd permissions and ownership (which should be needed only once)
  • cleanup and other improvements

------------------------------------------------------------------------------------------------

[UPDATE] Version 0.1-beta3 is out.


Recent changes:
  • run fix and recalibration right before auto-reboot too, just in case

------------------------------------------------------------------------------------------------

[UPDATE] Version 0.1-beta2 is out.


Recent changes:
  • added deleting batterystats.bin
  • added fixing ownership and permissions of battd and friends
  • cleaned up the "about" and "licence" texts
  • possibly other fixes and improvements I forgot about

------------------------------------------------------------------------------------------------

[UPDATE] Version 0.1-beta1 is out.


Recent changes:
  • hopefully fixed the reboot-when-charged issue

------------------------------------------------------------------------------------------------

[UPDATE] Version 0.1-alpha3 is out.


Recent changes:
  • fixed some bugs that caused issues on ICS and newer
  • cleaned up the checkbox logic
  • slightly improved the UI
  • other minor fixes and improvements

Many of the issues (namely, "null" errors) should now hopefully be gone.

------------------------------------------------------------------------------------------------

[UPDATE] Version 0.1-alpha2 is out.


Changes include:
  • (hopefully) fixed su and other issues
  • added option to reboot the phone when it's done charging (hopefully that actually works :) )
  • added real-time battery monitor
  • general cleanup
  • other things I forgot

Many issues should now be fixed, but this is still considered alpha-quality software, so be warned.

------------------------------------------------------------------------------------------------

So...

Like many other people, I too am affected by the dreaded "won't charge beyond xx%" battery bug. I know in reality this is probably of little importance since (at least in my case) the battery is getting decent charge and lasts long enough anyway. But I would still like to see it fully charged, at least every so often. :)

So I did the procedure mentioned in this thread and it worked, but only once - the bug would appear again on the next charge cycle. Then I found this post and tried that too, and it also worked but also only once. So I decided to make this little app.

What the app does is, upon getting notified that the charger has been connected, it will automatically delete files in /data/battd (all except uid - namely cc_data, cc_data_old and powerup). Then all you have to do is wait for the battery to charge as far as it goes and then reboot (and then possibly charge a little more). That's it!
NOTE 1: Obviously for the app to work correctly your phone needs to be rooted.
NOTE 2: This app will not increase your battery life or change it in any way, shape or form. All it does is attempt to fix the percentage display.

Now admittedly, it can get annoying if you connect your phone to the computer just to transfer some files and the app gets triggered anyway because it detected charging. That's why the auto-triggering can also be disabled in the app. You can also leave it permanently disabled and just use the "force calibration" button to calibrate your battery only when you feel like it. ;)

Anyway, I hope the app will be useful at least to some. The app should work on all rooted GB ROMs and possibly on ICS and JB too.


NOTE: this the initial release of the app, and is also my 3rd (if I'm counting them right) Android app as of yet. So be warned, this app is currently alpha-quality. Standard disclaimers apply, although I don't see how it could do any damage.

XDA:DevDB thread:
http://cleanimport.xda/index.php?threads/2468689/
 

Attachments

  • AtrixBatteryFix-0.1-alpha1.apk
    22.4 KB · Views: 533
  • screenshot-1349643334176.png
    screenshot-1349643334176.png
    29.3 KB · Views: 11,776
  • screenshot-1349643438153.png
    screenshot-1349643438153.png
    71 KB · Views: 9,080
  • screenshot-1349643346796.png
    screenshot-1349643346796.png
    35.8 KB · Views: 8,482
  • AtrixBatteryFix-0.21.apk
    45.2 KB · Views: 1,928
  • AtrixBatteryFix-0.30-beta1.apk
    55.9 KB · Views: 1,078
  • screenshot-20121031-115253.png
    screenshot-20121031-115253.png
    22.3 KB · Views: 7,231
  • AtrixBatteryFix-0.31-beta1.apk
    59.9 KB · Views: 890
  • AtrixBatteryFix-0.35-beta1.apk
    61.7 KB · Views: 5,374
  • screenshot-20121116-174530.png
    screenshot-20121116-174530.png
    38 KB · Views: 5,917
  • AtrixBatteryFix-0.36.apk
    61.9 KB · Views: 1,050
  • AtrixBatteryFix-0.40.apk
    62.8 KB · Views: 20,074
Last edited:

fabianowerner

Senior Member
Jan 19, 2011
625
76
Uberlândia
ne1 tried this? does it work or is it placebo, cos my atrix wont pass thru 98% even when i have 4200mh of charge. but i tried Die Hard Calibration from zeppelinrox (same builder of V6 Supercharger) and had several issues on CM7, like wont charge when turned off. I had to flash another rom, Im afraid of having this issues again.
 
  • Like
Reactions: oburixar

bimasakti85

Senior Member
Sep 22, 2010
500
79
Yogyakarta
I got error. Its says "error recallobrating battery (null)". I wonder if it is because the app doesn't have root privilege, coz I dont get the requesting root prompt from superuser.

Sent from my MB860 using xda premium
 
  • Like
Reactions: oburixar

xateeq

Senior Member
Oct 19, 2010
786
183
This app will only get ur xx% values back to 100% or 99% without u having to delete any thing manually or pulling the battery. Correct me if i am wrong and thanks for the app ill sure try this.
 

ravilov

Senior Member
Jan 26, 2010
2,217
1,346
localhost
I got error. Its says "error recallobrating battery (null)". I wonder if it is because the app doesn't have root privilege, coz I dont get the requesting root prompt from superuser.
If you don't get the prompt, the app is not getting required permissions and so it can't work.
Which ROM are you using? Can you go to terminal emulator on the phone and run
Code:
which su
and tell me what it says?

This app will only get ur xx% values back to 100% or 99% without u having to delete any thing manually or pulling the battery. Correct me if i am wrong and thanks for the app ill sure try this.
Correct. It just makes it easier to apply the fix mentioned in the OP.
 
  • Like
Reactions: xateeq
S

Soldier-2Point0

Guest
Wow, someone finally made this process easier! I had to do this every time I woke up in the morning using Root Browser. It only saves me maybe 30 seconds, but those 30 seconds it saves add up! Thanks bud.!

OP, add an auto reboot selection box that is triggered when the phone fully charged.

Sent from my MB860 on CM10
 
Last edited:

natboy

Senior Member
Mar 7, 2011
208
28
Anchorage, AK
If you don't get the prompt, the app is not getting required permissions and so it can't work.
Which ROM are you using? Can you go to terminal emulator on the phone and run
Code:
which su
and tell me what it says?


Correct. It just makes it easier to apply the fix mentioned in the OP.

I'm getting the null error as well, I'm currently using SuperSu and my su is in /system/xbin/su

Thanks for the app, excited for it to work :)
 

nh777

Senior Member
Jul 19, 2012
250
34
Wow, someone finally made this process easier! I had to do this every time I woke up in the morning using Root Browser. It only saves me maybe 30 seconds, but those 30 seconds it saves add up! Thanks bud.!

Sent from my MB860 on CM10

And here I thought it was just me.

Could have used this app this morning myself. I'll check it out and report back.


Edit: Or I would if I wasn't, too, getting an error recalibrating message. I'm running epinter's CM10, and terminal emulator tells me "/system/sbin/su"
 
Last edited:
  • Like
Reactions: Felpz

Malaquai

Senior Member
Aug 21, 2011
286
38
I'm getting the null error as well, I'm currently using SuperSu and my su is in /system/xbin/su

Thanks for the app, excited for it to work :)

Same error here, I'm in epinter jb rom.

Edit: the program don't ask for su permission. It's ok?

Edit 2: Unselect both options and press calibrate button. Here the program ask for su access, delete files and prompt for reboot. My battery was in 95% and 4200mA. After reboot, the battery is showing 100%. Excellent.
Enviado desde mi MB860 usando Tapatalk 2
 
Last edited:
  • Like
Reactions: nh777 and natboy

natboy

Senior Member
Mar 7, 2011
208
28
Anchorage, AK
Same error here, I'm in epinter jb rom.

Edit: the program don't ask for su permission. It's ok?

Edit 2: Unselect both options and press calibrate button. Here the program ask for su access, delete files and prompt for reboot. My battery was in 95% and 4200mA. After reboot, the battery is showing 100%. Excellent.
Enviado desde mi MB860 usando Tapatalk 2

Thanks for that, that worked for me as well. But also on epinter.
 

bimasakti85

Senior Member
Sep 22, 2010
500
79
Yogyakarta
Same error here, I'm in epinter jb rom.

Edit: the program don't ask for su permission. It's ok?

Edit 2: Unselect both options and press calibrate button. Here the program ask for su access, delete files and prompt for reboot. My battery was in 95% and 4200mA. After reboot, the battery is showing 100%. Excellent.
Enviado desde mi MB860 usando Tapatalk 2

Got that prompt too, but now its said error because read only file system. Im using CM9 jokersax.

Sent from my MB860 using xda premium
 

Malaquai

Senior Member
Aug 21, 2011
286
38
Got that prompt too, but now its said error because read only file system. Im using CM9 jokersax.

Sent from my MB860 using xda premium

As an idea, use root explorer to see how is mounted your file system, mount as R/W if needed, try again with the fix program.

Enviado desde mi MB860 usando Tapatalk 2
 

ravilov

Senior Member
Jan 26, 2010
2,217
1,346
localhost
OP, add an auto reboot selection box that is triggered when the phone fully charged.
Good idea, I'll try to add that. Unfortunately unlike "charger connected", the "battery full" doesn't broadcast a system-wide event...
I'm working on a workaround for that.

I'm getting the null error as well, I'm currently using SuperSu and my su is in /system/xbin/su
Hm, my su is also there. But I'm using Superuser, not SuperSu. Maybe that's the catch? :dunno:

Same error here, I'm in epinter jb rom.
I guess that could be it too. I'm running CM7, don't have access to ICS or JB right now.
I'm trying to figure out what's causing this, if everything else fails I'll just have to install CM9/CM10 myself. :cowboy:

The rest of you that are affected, can you check if the files in /data/battd are deleted anyway, despite getting an error?
It would help me in pinpointing the problem. :)

Edit: the program don't ask for su permission. It's ok?
No, it should ask for permissions first time you run it.

Edit 2: Unselect both options and press calibrate button. Here the program ask for su access, delete files and prompt for reboot. My battery was in 95% and 4200mA. After reboot, the battery is showing 100%. Excellent.
Hm, that's weird that it works like that. I'll look into this too. Shouldn't be like this.
Can you also check if the files get deleted from /data/battd even when the app reports an error?

Got that prompt too, but now its said error because read only file system. Im using CM9 jokersax.
Well that's funny. So you got the reboot prompt, said yes to it, and then you got the error about read-only filesystem?
 
  • Like
Reactions: xateeq
S

Soldier-2Point0

Guest
Hey buddy. I was getting the null error, but after I de selected both boxes, the prompt showed up.

I recommend you update the app to also delete the files found under /data, /system, /usage stats. See screenshot:

40cbdf57-d5a7-d69a.jpg


It should delete all the dated usage files except for the one that ends on. Xml. Maybe this will help the system start over fresh. :good:

Sent from my MB860 on CM10
 

natboy

Senior Member
Mar 7, 2011
208
28
Anchorage, AK
Not sure how you're going to go about getting the battery stats. Briefly looking into it, there's not /proc/acpi, but `dumpsys battery` from a terminal gives battery information

you could do something like `dumpsys battery | grep level | cut -d : -f 2` which gives the value.
 

ravilov

Senior Member
Jan 26, 2010
2,217
1,346
localhost
Hey buddy. I was getting the null error, but after I de selected both boxes, the prompt showed up.
Yeah, I'm looking into that. Might have an idea what's causing it.

I recommend you update the app to also delete the files found under /data, /system, /usage stats. See screenshot:

[IMAGE]

It should delete all the dated usage files except for the one that ends on. Xml. Maybe this will help the system start over fresh. :good:
Thanks for the tip. This should be pretty easy to add to the app. However I'd rather not delete too much stuff for now. I think I'd rather wait until it's confirmed this has some actual influence on the battery percentage.

Not sure how you're going to go about getting the battery stats. Briefly looking into it, there's not /proc/acpi, but `dumpsys battery` from a terminal gives battery information

you could do something like `dumpsys battery | grep level | cut -d : -f 2` which gives the value.
Oh no, Android has a nice API to fetch all that info, no need to twiddle around with random shell pipelines and such. :)
BTW, there's also cat /sys/class/power_supply/battery/capacity ;)
 
Last edited:

bimasakti85

Senior Member
Sep 22, 2010
500
79
Yogyakarta
Well that's funny. So you got the reboot prompt, said yes to it, and then you got the error about read-only filesystem?

Well I not kidding, it shows up like that. After that prompt asking root access and allowed it, I pressed the force button. But Its says like that, read only file system. Already tried setting read and write from root explorer but It wont help.


Sent from my MB860 using xda premium

---------- Post added at 02:39 AM ---------- Previous post was at 02:34 AM ----------

This is the Screen shot :




Sent from my MB860 using xda premium
 

Top Liked Posts

  • There are no posts matching your filters.
  • 106
    [UPDATE] Version 0.40 is out.


    Recent changes:
    • added the uptime monitor
    • renamed "battery monitor" to "system monitor"
    • minor cleanup to make it more compatible with the newer SDK's lint checks
    • other changes


    ------------------------------------------------------------------------------------------------

    [UPDATE] Version 0.36 is out.


    Recent changes:
    • version bump with minor cosmetic changes

    This is just a minor maintenance release, no need to upgrade if your 0.35-beta1 is working well.

    ------------------------------------------------------------------------------------------------

    [UPDATE] Version 0.35-beta1 is out.


    Recent changes:
    • improved the monitoring service
    • added a new option - Only if <100% (will only run the auto-action (reboot or restart service) if the battery reports less than 100% when done charging)
    • improved the "battery full" detection code, should work better now
    • other fixes and improvements
    Also had to delete some old versions since I hit the 20-attachments-per-post limit.

    EDIT: Just realized I uploaded the wrong screenshot. :doh: Corrected.

    ------------------------------------------------------------------------------------------------

    [UPDATE] Version 0.31-beta1 is out.


    Recent changes:
    • hopefully fixed the constant "superuser auth" issue on CM10

    ------------------------------------------------------------------------------------------------

    [UPDATE] Version 0.30-beta1 is out.

    NOTE: Due to the significant changes in the settings/preferences part, please uninstall any previous version before installing this one. Thank you.


    Recent changes:
    • re-added deleting batterystats.bin as an option (off by default)
    • moved all preferences to the settings screen
    • added an option to turn charging on or off, and also an option to automatically turn charging off when USB power detected
    • added some heuristics to determine when the battery is done charging (if the voltage does not change within 30 minutes, the battery is considered to be done charging) - hopefully this works
    • bugfixes, general code cleanup

    Since new features were added and a significant chunk of the code has been rewritten, this is now considered beta.
    This version also makes sure to be as non-intrusive as possible - nothing will happen automatically by default, you need to initiate any actions.

    ------------------------------------------------------------------------------------------------

    [UPDATE] Version 0.21 is out.


    Recent changes:
    • disabled removing the batterystats.bin file - it seems to have only caused problems with not a lot benefit. WARNING: if you're coming from an earlier version, you need to wipe app data for this to work!
    • changed defaults - now the app won't run the fix automatically when power detected by default, this should make the app completely non-intrusive by default.

    ------------------------------------------------------------------------------------------------

    [UPDATE] Version 0.20 is out.


    Recent changes:
    • added an option to restart the battd service instead of a full reboot - seems to work but this should be considered a beta feature
    • moved some options to a separate settings screen
    • cleanup here and there
    Also cleaned up the attachments to this post.

    ------------------------------------------------------------------------------------------------

    [UPDATE] Version 0.16 is out.


    Recent changes:
    • better handling of missing or invalid datadir
    ------------------------------------------------------------------------------------------------

    [UPDATE] Version 0.15 is out.


    Recent changes:
    • about box is now shown on first run
    • rearranged and cleaned up the about text, added the donate link (which hopefully works)
    • fix for busybox that has the ash applet instead of sh
    • busybox is no longer required, will try to use system shell if busybox is not found
    • fixed a progress dialog issue upon screen rotation
    • uploaded source code to github

    ------------------------------------------------------------------------------------------------

    [UPDATE] Version 0.1 FINAL is out.


    Recent changes:
    • mostly just cosmetic changes

    ------------------------------------------------------------------------------------------------

    [UPDATE] Version 0.1-beta4 is out.


    Recent changes:
    • instead of running hardcoded shell commands, now runs external shell scripts in the app's datadir (so you can modify the scripts to your own liking)
    • all shell commands/scripts are now executed through busybox instead of default system shell (so busybox is now required)
    • separated fixing the battd datafiles (which is normally needed every so often) from fixing battd permissions and ownership (which should be needed only once)
    • cleanup and other improvements

    ------------------------------------------------------------------------------------------------

    [UPDATE] Version 0.1-beta3 is out.


    Recent changes:
    • run fix and recalibration right before auto-reboot too, just in case

    ------------------------------------------------------------------------------------------------

    [UPDATE] Version 0.1-beta2 is out.


    Recent changes:
    • added deleting batterystats.bin
    • added fixing ownership and permissions of battd and friends
    • cleaned up the "about" and "licence" texts
    • possibly other fixes and improvements I forgot about

    ------------------------------------------------------------------------------------------------

    [UPDATE] Version 0.1-beta1 is out.


    Recent changes:
    • hopefully fixed the reboot-when-charged issue

    ------------------------------------------------------------------------------------------------

    [UPDATE] Version 0.1-alpha3 is out.


    Recent changes:
    • fixed some bugs that caused issues on ICS and newer
    • cleaned up the checkbox logic
    • slightly improved the UI
    • other minor fixes and improvements

    Many of the issues (namely, "null" errors) should now hopefully be gone.

    ------------------------------------------------------------------------------------------------

    [UPDATE] Version 0.1-alpha2 is out.


    Changes include:
    • (hopefully) fixed su and other issues
    • added option to reboot the phone when it's done charging (hopefully that actually works :) )
    • added real-time battery monitor
    • general cleanup
    • other things I forgot

    Many issues should now be fixed, but this is still considered alpha-quality software, so be warned.

    ------------------------------------------------------------------------------------------------

    So...

    Like many other people, I too am affected by the dreaded "won't charge beyond xx%" battery bug. I know in reality this is probably of little importance since (at least in my case) the battery is getting decent charge and lasts long enough anyway. But I would still like to see it fully charged, at least every so often. :)

    So I did the procedure mentioned in this thread and it worked, but only once - the bug would appear again on the next charge cycle. Then I found this post and tried that too, and it also worked but also only once. So I decided to make this little app.

    What the app does is, upon getting notified that the charger has been connected, it will automatically delete files in /data/battd (all except uid - namely cc_data, cc_data_old and powerup). Then all you have to do is wait for the battery to charge as far as it goes and then reboot (and then possibly charge a little more). That's it!
    NOTE 1: Obviously for the app to work correctly your phone needs to be rooted.
    NOTE 2: This app will not increase your battery life or change it in any way, shape or form. All it does is attempt to fix the percentage display.

    Now admittedly, it can get annoying if you connect your phone to the computer just to transfer some files and the app gets triggered anyway because it detected charging. That's why the auto-triggering can also be disabled in the app. You can also leave it permanently disabled and just use the "force calibration" button to calibrate your battery only when you feel like it. ;)

    Anyway, I hope the app will be useful at least to some. The app should work on all rooted GB ROMs and possibly on ICS and JB too.


    NOTE: this the initial release of the app, and is also my 3rd (if I'm counting them right) Android app as of yet. So be warned, this app is currently alpha-quality. Standard disclaimers apply, although I don't see how it could do any damage.

    XDA:DevDB thread:
    http://cleanimport.xda/index.php?threads/2468689/
    8
    Everythings seems to be relatively stable so far, so releasing version 0.1 FINAL.
    This time with source code. :)

    OP updated.
    6
    Version 0.35-beta1 is out. OP updated.
    5
    Version 0.31-beta1 is out. OP updated.
    This release hopefully fixes the constant "superuser auth" issue on CM10 and others.
    4
    Version 0.20 released. OP updated.

    Added the option to restart just the battd service instead of a full system reboot.
    Seems to work okay but this feature should be considered beta.