yashsingh1/xdaforums huggingface dataset:
[Motorola Droid X2] Peperm1nt:
You know the nuisance that was brought to us with 2.3.4? You know, the one that would not show the correct battery %? Well, here is the fix and I hope you enjoy :)

This will replace your battd and libbattd.so files with the previous 2.3.3. The files are in binary and I don't know how to convert them to a readable format, so until then, enjoy this fix and post your results for others to see the awesomeness. I will need you to do the following before you flash:

WIPE DALVIK-CACHE AND CACHE!

You may not have to do a data wipe and the battstat.bin should be fine as it is. If you flash this without a successful battery fix, then try to delete your batterystat.bin file(the file you calibrate a battery with), and see what your results are before posting that this doesn't work.

Enjoy :)

UPDATE:

The uploaded zip is not signed correctly from recent reports, so for now this is what you will need to do to get this working until I get the flashable zip working again. Sorry for the inconvience, thank sopa/pipa/FBI/whoever that shut down MultiUpload.

For now:

1. Push files to proper location.

2. Set permissions correctly to rw-r-r or

[x] [x] [ ]

[x] [ ] [ ]

[x] [ ] [ ]

3. Reboot to recovery, wipe cache and dalvik-cache.

4. Reboot the device.

GB Battery Fix v0.8

This should work for ALL future GingerBread builds and ROMs that don't have the issue resolved(ie 2.3.5)

This fix was originally found by juggernaut of the Atrix forum...didn't realize till after X0dus pm'd me.

Enjoy the fix and Happy Holidays!

Donations are not required, but always a nice gift. If you feel as though what I have did/am doing is beneficial to you or the community, then feel free to help someone out. I'm not an "Expert Developer", but I do try, and I plan on continuing my efforts to bring you a better user experience. I have enjoyed the efforts I have put in, as I'm sure you will enjoy my work. Click the Donate Button provided if you want to donate or simply push the thanks button below. Either way, Thank You for your Time.
[Motorola Droid X2] CadenH:
Excited to try this. I'm really hoping that it works.
[Motorola Droid X2] donlad:
Umm, I was on Eclipse 1.3.. I wiped the cache partition and dalvik cache, and then I flashed this file, and now my phone won't go past the "M DUAL-CORE TECHNOLOGY" bootup screen..?

Did you test this exact zip before you released it?

---------- Post added at 03:09 AM ---------- Previous post was at 03:06 AM ----------

It won't even let me get into Recovery by plugging my phone in after taking the battery out..

---------- Post added at 03:17 AM ---------- Previous post was at 03:09 AM ----------

I am now SBFing to 2.3.4 lol
[Motorola Droid X2] G2sws:
Same here. Had to reflash rom
[Motorola Droid X2] donlad:
Well I SBF'd to 2.3.4 and it won't let me activate because Verizon is doing maintenance on their activation systems. This is just great. I can't get past the activate screen to do ANYTHING with my damn phone. GRRR!
[Motorola Droid X2] Mr_GreenJeans:
we tried this on the X2 here, but it didn't work, not sure if you are doing something different, just thought i would share:

http://xdaforums.com/showthread.php?t=1305243
[Motorola Droid X2] X0dus:
Ignore.

Mr_GreenJeans already posted the same thing. :D
[Motorola Droid X2] Mr_GreenJeans:
Same time LOL :P
[Motorola Droid X2] Peperm1nt:
>????? wow....

So you wiped the cache and dalvik and didnt work? Ill check the .zip to make sure that everything is fine.... Apologise, but I thought I had it fixed.

Removed link til .zip is fixed.

OMFG! Guys I am terribly sorry about this!! I found the problem. For some reason when I edited the script it didnt save it. But it should be working now.

DEEPLY SORRY FOR THAT!
[Motorola Droid X2] Peperm1nt:
Link has been updated. The error was with the updater-script. Deeply appologize for that. But is should now work. Im sorry for that error guys.
[Motorola Droid X2] lesismore1:
To bypass activation screen, tap the android as quickly as possible/as soon as you see it! This will bring you to the normal setup and completely bypass Verizon activation until they're done with maintenance. Then you call the activation number (*228) and activate cell service as normal.
[Motorola Droid X2] Peperm1nt:
Or you can tap the four corners of the gray Android screen on sequence

Upper left upper right lower right lower left.

Tapin' the Talk on the xSquared
[Motorola Droid X2] donlad:
I actually tried both of those methods last night and couldn't get them to work :\

but this morning when I wokeup Verizon's activation was back online so everything is fine now.

In other news, flashing the now fixed zip in a second and will post my results.
[Motorola Droid X2] G2sws:
No need to apologize. Keep hacking away. You have done alot for the dx2 and I will try what ever you got.
[Motorola Droid X2] donlad:
Preliminary test results:

I rebooted into recovery with 87% battery life, cleared cache & dalvik cache, flashed the newly fixed battery fix, rebooted, and battery life reports at 86%, as it should've.

Rebooted a second time and battery life is reporting at 85%.

Rebooted a third time and battery life is reporting at 85%.

Rebooted a fourth time and battery life is reporting at 85%.

No jumps in 4 reboots! I will let the battery drain a bit more, perhaps to 50% and try more reboots.
[Motorola Droid X2] X0dus:
That constant 85% has me skeptical. Take it down just a few % pts and reboot. See if it jumps back to 85%. We would get similar results when we tested this mod.
[Motorola Droid X2] donlad:
Rebooted while at 80% battery, and it stayed at 80%!
[Motorola Droid X2] Peperm1nt:
What was the fix you guys tried by chance?

Tapin' the Talk on the xSquared
[Motorola Droid X2] donlad:
Rebooted at 79% and after reboot still at 79%. Will reboot once I get to 40% for more tests.
[Motorola Droid X2] X0dus:
http://xdaforums.com/showthread.php?t=1305243

I edited the OP since b/c it wasn't working for many. I left the original post I found in the Atrix forum. The mod we tested was this exact same thing. Did you edit the files at all?
[Motorola Droid X2] Peperm1nt:
Thanks for having faith man. Sorry about the original bug I made.

@xodus

I'm going to find a way to convert the binary to make changes to the current files.this is why.8 Is started. By chance where your permissions off? And are you sure you did the exact same as I am?

Tapin' the Talk on the xSquared
[Motorola Droid X2] Sandso9:
Nice I'm going to try this now
[Motorola Droid X2] Elite49:
Been running this all morning seems to be working great. Started at 71, then reboot and flash was at 70. Drained to 43, reboot stayed at 43 then went down to 42 like it should. Draining battery fully now. TY
[Motorola Droid X2] X0dus:
Exact is a bad word. My apologies. Tested the original file which were the libbatt file and the bin batt file. That didn't work so L2 pulled the same files from Eclipse .8, which are the files for 2.3.3 and couldn't imagine Nitro changing them at all, but that also failed. It would look promising for a bit then start jumping again. Can't say for sure the perms were set correctly. Maybe that was the problem. I'm still waiting for more positive feedback from this.

Edit: Got a NAND going them I'm going to test this.
[Motorola Droid X2] G2sws:
Rebooted @ 96 and back up @ 96 so far good.
[Motorola Droid X2] donlad:
Honestly I think you have nothing to be sorry for. Mistakes happen; at least you're man enough to admit you made a mistake and then you rectified the issue and even made it a point to send me an apology PM.

In my book you're the exact kind of developer this phone needs, and I appreciate it very much.

Thank you for your work and thanks for this battery fix! =D
[Motorola Droid X2] Peperm1nt:
No probs. :) I try my best and help in anyway I can with what little time I have available.

SPOILER!!

Update is almost available for gbp7.

Tapin' the Talk on the xSquared
[Motorola Droid X2] CadenH:
After several reboots below 50%, I have had no jumps whatsoever. If this holds, this could be one of the best thing's to see happen in a while!
[Motorola Droid X2] motcher41:
Thanks for all your hard work it's working great!
[Motorola Droid X2] X0dus:
Not a jump yet. Thx, m1nt!
[Motorola Droid X2] L2_n19h7m4r3:
Works. Well done.
[Motorola Droid X2] imchairmanm:
Awesome work. I'm glad we finally have what looks like a workable solution to the problem.
[Motorola Droid X2] Jacklad:
Worked without a hitch - thanks so much for this - will give your ginger 7 a shot with your next update
[Motorola Droid X2] Meticode:
You know development is slow on your phone when a bug fix for a battery indicator comes out and people say, "This is the best thing to happen in a while!" :)

I'm glad for the fix. It was really not a big deal to me since I only would reboot my phone in the morning after unplugging, but the battery jumps were annoying if I rebooted for whatever reason mid-day.
[Motorola Droid X2] Peperm1nt:
Thanks guys for checking it out. I dont mean to sound like a begger but a donate button has been put in place. If you feel what I have did here has been worth your time and efforts feel free to donate or press the thanks tab.
[Motorola Droid X2] Meticode:
Beautiful so far. I just tested it on on Eclipse 1.3 and it's worked 100% fine so far.
[Motorola Droid X2] Mr_Alexander:
I just downloaded this. Looking to finally have this bug squashed. Thanks!
[Motorola Droid X2] 1stx2:
Nice! Works perfect!
[Motorola Droid X2] Travisdroidx2:
Worked perfect on liberty x! Great job!!! And thank you!
[Motorola Droid X2] Peperm1nt:
No probs :)
[Motorola Droid X2] jimenez:
Works perfectly!
[Motorola Droid X2] Hulk0069:
Which link do I download?
[Motorola Droid X2] huskerstylee:
I'm fairly certain the OP was updated with the fix
[Motorola Droid X2] Peperm1nt:
The OP has correct link.

Tapin' the Talk on the xSquared
[Motorola Droid X2] Moon Shadow - NM:
What battery monitor are you all using? I have both Battery Left and Battery Indicator. Battery Left shows the "calibrated battery level, based on the battery voltage. Battery Indicator just shows the Droid X2 battery level. BIG discrepancy between the two. Right now, Battery Indicator shows 80% and Battery Left shows 49%... Also, was this mod supposed to decrement by 1% steps instead of 10%? Thanks!
[Motorola Droid X2] donlad:
Battery Left was mainly designed for people who use extended batteries in their phones, because Motorola phones do not properly recognize the extended battery and report incorrect battery percentages, even after calibrated correctly.

Assuming you have correctly calibrated your battery with Battery Left, it's probably more accurate than Battery Indicator, which just reads what Android says the percentage is, instead of calculating itself, as Battery Left does.

To calibrate with Battery Left, you simply charge to full, then let the battery drain until it is completely dead, and then charge to full again (all with Battery Left installed)
[Motorola Droid X2] Peperm1nt:
This is designed to fix the stock battery percentage in status bar (whether stock or modded) the files that this flash well replace is what the system needs for a battery percentage.

3rd party apps use different algorithms to give a percentage and I would imagine the apps will pull information on the initial install of the app and store the needed information for later so it doesn't have to recall every time it changes.

Try to delete the data and cache of your monitor apps and see what your results are then.this just fixes the stock battery scale.

Tapin' the Talk on the xSquared
[Motorola Droid X2] Moon Shadow - NM:
Okay, thanks! Yes, I have the extended battery. (I neglected to mention that.)

Okay, cool. I will say that I have not seen the battery jump, I was just wondering about the percentage descrepency that I was seeing... After the above post (about the extended battery) I now have a better understanding of this whole thing... Thanks for your help! :D

So to follow this all:

Stock ROM

Rooted

Deodexed

Debloated

OEM DX2 Extended Battery (1850maH)

Using Battery Left to track the battery level

V6_SuperCharger Script

Tasker
[Motorola Droid X2] Travisdroidx2:
I said thanks last night but I use my phone a lot for work. How nice it is to have a accurate battery again.
[Motorola Droid X2] kaliblazin707:
Thanks man. Works great.

Sent from my DROID X2, powered by the tortured souls of aborted children.
[Motorola Droid X2] Hulk0069:
Really tortured souls of aborted children?.....not cool
[Motorola Droid X2] IDMA.DROID.X2:
Uh-oh, I see a fight coming, then a clown coming :)

Thanks for the fix! Works great!
[Motorola Droid X2] Hulk0069:
Isn't no fight just speaking my mind, my son passed away he was 4 months Old.

Anyway back to post I've downloaded let's see what happens.
[Motorola Droid X2] Peperm1nt:
Your welcome guys and keep it on topic please
[Motorola Droid X2] IDMA.DROID.X2:
I'm sorry,

That's sad hear :(
[Motorola Droid X2] kaliblazin707:
Yea keep it on topic. No pity parties for u. Thanks for the fix pepermint

Sent from my DROID X2, powdered by the souls of tortured children.
[Motorola Droid X2] Hulk0069:
Didn't want pity, just understanding...
[Motorola Droid X2] iBolski:
Awesome job. I was at 86%, rebooted and it was still at 86% whereas before, it would jump back up to 98%.
[Motorola Droid X2] Macguyver:
Been running this for a day, works great, thanks!
[Motorola Droid X2] Jeffmeister:
Thanks to this fix my phone is stuck in boot animation. :mad:
[Motorola Droid X2] Mr_GreenJeans:
did you wipe cache and dalvik?
[Motorola Droid X2] kaliblazin707:
That's gay jeff.
[Motorola Droid X2] kaliblazin707:
I doubt it. There isn't anything in this zip that could brick the phone if he did wipe.
[Motorola Droid X2] Peperm1nt:
Actually, you NEED to wipe dalvik and cache as stated in the instructions.

You didn't wipe the cache and dalvik..... there is 7 pages of success.. then you. DO the math. Not being a ****, but you made a smartass remark, and I have a reputation for being a helpful person.

Now to solve your prob... do what I said and then post your results.......... just go into stock android recovery and you can do this.
[Motorola Droid X2] Jeffmeister:
I did wipe my cache and dalvik. For some reason on my first boot it got stuck in boot animation. After removing the battery abd rebooting it worked fine. Sorry for the preemptive post.
[Motorola Droid X2] balltongue:
The fix works great.
[Motorola Droid X2] Mr_GreenJeans:
Probably didn't wait for dalvik to be rebuilt. 1st boot after the wipe takes a while. Nothing to worry about. No need to jump the gun claiming bootloop... glad you r fixed. Happy thanksgiving. :)
[Motorola Droid X2] mrf582:
It's amazing how such a simple fix was ignored at Google. There must be some really awkward management hierarchy there where they didn't think it would be worth the trouble to fix the 2.3.4 pre-test before releasing it even though they knew about the problem. And, it didn't get fixed in 2.3.5! LOL.

Not to mention, why the hell did they touch those files in the first place?
[Motorola Droid X2] booked:
should I be at 100% battery and wipe battery stats before i install this zip or does that matter?
[Motorola Droid X2] Peperm1nt:
Doesn't matter it doesn't effect your battery values...that's a different file.

Tapin' the Talk on the xSquared
[Motorola Droid X2] booked:
I made sure I was at 100% just to be safe and it works like a charm.

Feeling Liberated with my X2
[Motorola Droid X2] T3HBR1AN:
Flashed and working. Thanks!

Sent from my Eclipsed and ICS themed X2.
[Motorola Droid X2] Peperm1nt:
No prob guys....bump for OP update everyone read!

Tapin' the Talk on the xSquared
[Motorola Droid X2] X0dus:
Ignore post #1. Nothing to see.
[Motorola Droid X2] Peperm1nt:
....stupid post sorry

Xodus check your pm
[Motorola Droid X2] X0dus:
poof. speed bump. move along. :)
[Motorola Droid X2] ashclepdia:
this is more Motorola fail then google fail.

moto dev team was DEFINITELY aware of this during the soak test along with other bugs but chose to release as is anyways without fixing the problems first...

I wish I would have saved a copy of Motorola forum managers post concerning these issues...pretty funny how he said what he said...

Hahaha ...they probably did this to give a false sense of "better battery life" Hahaha
[Motorola Droid X2] Elite49:
OMG Guys it's Christmas already according to the date in title! lol
[Motorola Droid X2] IDMA.DROID.X2:
Time travel!!! :)
[Motorola Droid X2] Peperm1nt:
Updated lol we are now back to the present haha

Tapin' the Talk on the xSquared
[Motorola Droid X2] prj71:
Does this fix also adjust the battery icon display up by the clock so that it is showing the correct level?
[Motorola Droid X2] X0dus:
EDIT: Misread your post. My icon has always showed the correct lvl for what the system reports..
[Motorola Droid X2] IDMA.DROID.X2:
Will it change my battery icons on the status bar?
[Motorola Droid X2] Peperm1nt:
No image changes are made with this fix. The only change will be how the system reads the battery. The only visible change it's the battery icon doesn't jump with a reboot.

Tapin' the Talk on the xSquared
[Motorola Droid X2] xtel:
Does anyone have a mirror of the file? Multiupload is not connecting.
[Motorola Droid X2] Peperm1nt:
Yeh, I'll reupload it for you guys. Thanks for the notice. It's on the GitHub site as well.
[Motorola Droid X2] king..kranium:
Has this been confirmed?
[Motorola Droid X2] robocuff:
Yes. It works.
[Motorola Droid X2] ashclepdia:
hells to the yeah its been confirmed

Hell

most roms incorporated it at some point lol
[Motorola Droid X2] Peperm1nt:
OP Updated with a New Download Link. Confirm the signing of the .zip worked please. If it doesn't, let me know.

**New to signing stuff in Linux ;) but it should work. If not, it's a signing error and I'll fix it. Thanks for letting me know it was down.
[Motorola Droid X2] Maximinus I:
Doesn't work for me just freezes while trying to update.
[Motorola Droid X2] Peperm1nt:
hmm never signed on linux b4 lol... im sorry..

I'll try to get it working, but you can push the files in place if you want till its fixed.
[Motorola Droid X2] Maximinus I:
No problem I already pushed them. Was just letting you know to help. Thank you for putting it out so we can use it.
[Motorola Droid X2] smallzfsu:
I have to assume this is already in cm7 as I don't see the battery level jump at reboot ever?
[Motorola Droid X2] Peperm1nt:
It is already on it. This is intended for those that just use a stock root.... and developers. Most of the roms have this preinstalled.
[Motorola Droid X2] Peperm1nt:
The .zip should be fixed now, Sorry for the issues with flashing. Enjoy
[Motorola Droid X2] dkahs23:
I tried it today and it freezes. Just FYI Thanks
[Motorola Droid X2] Peperm1nt:
Well, I'll try and solve the issue, my x2 is on its way to me(my dev one was traded off and my main was lost). So I'll try and solve it when it gets here. The problem lies in the signing aspect of this so yeh, I'll see what I can do when it gets here, sorry for the inconvenience.

For now:

1. Push files to proper location.

2. Set permissions correctly to rw-r-r or

[x] [x] [ ]

[x] [ ] [ ]

[x] [ ] [ ]

3. Reboot to recovery, wipe cache and dalvik-cache.

4. Reboot the device.
[Motorola Droid X2] Lorenzo VonMatterhorn:
te mediafire link to this is not working. just sayin.. anywhere else to get it?
[Motorola Droid X2] lordforex:
Try this:

http://www.mediafire.com/?xrmgvy1rh3qeg4w
[Motorola Droid X2] Ban-Hammer:
Has the signing problem been fixed? If not, has anyone decided to make their own script to do this instead of manually setting permissions?
[Motorola Droid X2] DroidMaster18:
I don't know if its different if you use adb to push files but just in case your not good with adb and wanna push files using something like ES Root Explorer, proper permissions are

[×][×][×]

[×][ ][ ]

[×][ ][ ]

Or rwx-r-r.

Sent from my Stock Rooted Droid X2
[Motorola Droid X2] DroidMaster18:
Took me about 8 hours to figure out what was wrong but found out it won't work with just rw-r-r.

Hope that helps someone! :)

-DroidMaster

Sent from my Stock Rooted Droid X2
[Motorola Droid X2] SlimMan:
So does this actually work / do anything...?
[Motorola Droid X2] apacseven:
Of course it actually works/does something. When we got the GB update, battery reporting was fudged. Peperm1nt took a couple battery files from the previous release (found in this fix) and replaced the files causing misreporting battery levels.
[Motorola Droid X2] Hulk0069:
Sooooo we just flash this now as a zip? Where would we push this into like....system/?/?.
[Motorola Droid X2] DroidMaster18:
When trying to flash zip in bsr/cwr, it will freeze so that's a no go. To manually push, the battd.so file goes in system/bin and the libattd.so file goes in system/lib. :) but don't forget to set permissions properly or it won't work right.
[Motorola Droid X2] Lorenzo VonMatterhorn:
thank you sir. going back top liberty today from eclipse. so just cut and paste into the appropriate folders and fix permissions?
[Motorola Droid X2] lordforex:
Yep. I just loaded Liberty again this morning and added the battd.so to system/bin and the libattd.so to system/lib, fixed permissions, and all is working fine.
[Motorola Droid X2] Lorenzo VonMatterhorn:
nice. yeah i have the hdmi cord for this piece so i figure stay on something that atleast lets me use it....lol and i dont care for the ics look too much . especially on a GB phone. eclipse is awesome, dont get me wrong. but i just like the android green of gb. one more thing, i know that most of the stuff in rom toolbox doesnt work, but i should be able to change battery icons correct?
[Motorola Droid X2] apacseven:
Yep, changing icons will work just fine.
[Motorola Droid X2] Lorenzo VonMatterhorn:
i figured it would. thanks man.
[Motorola Droid X2] lordforex:
The one thing I love about this rom (Liberty) is the battery life. More than 48 hours with my extended battery is the norm.:silly:
[Motorola Droid X2] Lorenzo VonMatterhorn:
thats awesome. yeah i just noticed battery life today. forgot how good it was on liberty. no charge since yesterday morning and still 43 %. :good:
[Motorola Droid X2] Lorenzo VonMatterhorn:
permissions.

so after moving the two files into lib and fixing permissions like so

[x][x][ ]

[x][ ][ ]

[x][ ][ ]

it does not work. i get the ? battery . any ideas.? dude above said it took him eight hours to figure something out, but didnt share? i mean im not that worried about it but if its something easy to do i would like to do it. thanks.
[Motorola Droid X2] DroidMaster18:
Yeah that's what I did but it didn't work and I got that question mark. I was saying it took me 8 hours to figure out what was wrong. U have to set permissions to

[×][×][×]

[×]

[×]

for it too work properly.

Sent from my Stock Rooted Droid X2
[Motorola Droid X2] lordforex:
I'll post mine.
[Motorola Droid X2] DroidMaster18:
Actually I had shared the fix in the post right before the one u mentioned. :)

Sent from my Stock Rooted Droid X2
[Motorola Droid X2] lordforex:
battd.so to system/bin and the libbattd.so to system/lib

Both permission settings should be:

[x][x][x]

[x][ ][x]

[x][ ][x]

Then reboot.
[Motorola Droid X2] DroidMaster18:
Well u can do that too but u don't have to give it all those permissions for it too work. I tested it. Plus I wipe cache and dalvik cache in bsr afterward and reboot. Just going by the OP there.

Sent from my Stock Rooted Droid X2
[Motorola Droid X2] Lorenzo VonMatterhorn:
thought that i would mention that this permission set works. rebooted at 94 and got 94. rebooted 3 more times got 94. rebooted again. got 93. follow these permissions and youre gold. any other seemed to cause problems of some sort. :cowboy:
[Motorola Droid X2] DroidMaster18:
Well fine then. I'll just go back to my cave. Lol
[Motorola Droid X2] germmeetsworld:
Hey guys, I was helping my little brother out with rooting his phone and came back to this thread and saw that the zip didn't work. Well I've had the zip on my drop box since I flashed it way back when.

Here it is http://db.tt/xoK5LYrs I believe that link should work.

Peperm1nt i'm not sure if you wanted me to do that or not, you can just as well host the link yourself, it doesn't matter to me.