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

Root Fix for status bar battery indicator

bluemax

Lurker
Stock battery indicator in the status bar was bugging me, since it was constantly showing more charge than all other battery apps (widgets, Spare Parts...).

After looking in /system/framework/framework-res.apk/res/drawable/stat_sys_battery.xml, I could see that Samsung changed battery level thresholds compared to other Android releases (sources found on net):

explanation2.jpg



I have made a mod which changes the levels to the ones in the right column (source). Tested only on this 1.6 firmware: Baseband version I7500XXJB2, Build number Donut.XXJB6. Do not change /system/framework/framework-res.apk directly, the phone might not boot if it is not signed again after changing! Make all necessary backups!

You will need Metamorph to apply it, but since we have only 1.21 MB available on /system partition with this firmware, we will have to move Maps.apk to /data/app.

The procedure (if you are not sure what each step does, do not proceed):
1. root the phone
2. copy busybox to /data/local/bin and give it execute permissions
3. install Metamorph from the Market
4. mount /system as RW (via "Root explorer", for example)
5. Run Metamorph. It will check for necessary files, and copy zip to /system/bin/zip. You can move it to /data/local/bin/zip to save some space on /system, and create symlink with this: ln -s /data/local/bin/zip /system/bin/zip
6. copy attached Galaxy-BatteryFix-v1.0.zip to /sdcard/AndroidThemes
7. move /system/app/Maps.apk to /data/app. It seems that Maps work fine from that location, after reboot.
8. apply theme from Metamorph
9. reboot

If you have problems with Metamorph and copying zip app, run this command: ln -s /data/local/bin/busybox /system/bin/cp (after renaming /system/bin/cp to cp.old).

To restore the original, use Galaxy-BatteryFixRestore-v1.0.zip.
 

Attachments

I thought the Samsung change had been to try and make the battery reading more reliable?

As standard you'd often see the phone say 30% free only to die a few minutes later.
 
So that's why I always distrusted the battery indicator.
Stupid, stupid Samsung -- again! :mad: Is there anything they don't make a mess of?

I will try to install this asap (on IL3).
...hmm, can't figure out placing the files, will try later...
 
Stock battery indicator in the status bar was bugging me, since it was constantly showing more charge than all other battery apps (widgets, Spare Parts...).

After looking in /system/framework/framework-res.apk/res/drawable/stat_sys_battery.xml, I could see that Samsung changed battery level thresholds compared to other Android releases (sources found on net):

explanation2.jpg



I have made a mod which changes the levels to the ones in the right column (source). Tested only on this 1.6 firmware: Baseband version I7500XXJB2, Build number Donut.XXJB6. Do not change /system/framework/framework-res.apk directly, the phone might not boot if it is not signed again after changing! Make all necessary backups!

You will need Metamorph to apply it, but since we have only 1.21 MB available on /system partition with this firmware, we will have to move Maps.apk to /data/app.

The procedure (if you are not sure what each step does, do not proceed):
1. root the phone
2. copy busybox to /data/local/bin and give it execute permissions
3. install Metamorph from the Market
4. mount /system as RW (via "Root explorer", for example)
5. Run Metamorph. It will check for necessary files, and copy zip to /system/bin/zip. You can move it to /data/local/bin/zip to save some space on /system, and create symlink with this: ln -s /data/local/bin/zip /system/bin/zip
6. copy attached Galaxy-BatteryFix-v1.0.zip to /sdcard/AndroidThemes
7. move /system/app/Maps.apk to /data/app. It seems that Maps work fine from that location, after reboot.
8. apply theme from Metamorph
9. reboot

If you have problems with Metamorph and copying zip app, run this command: ln -s /data/local/bin/busybox /system/bin/cp (after renaming /system/bin/cp to cp.old).

To restore the original, use Galaxy-BatteryFixRestore-v1.0.zip.

Sounds amazing! That would be really helpful... but isn't there an easier way to do this? I currently use fastboot and adb, I can flash a recovery and a custom Rom, but I don't know what busybox or Metamorph are...
Is there any chance you could have some time for writing a simplier guide?

Thanks, anyway!
 
Sounds amazing! That would be really helpful... but isn't there an easier way to do this? I currently use fastboot and adb, I can flash a recovery and a custom Rom, but I don't know what busybox or Metamorph are...
Is there any chance you could have some time for writing a simplier guide?

Thanks, anyway!

Busybox comes built in with Galaxo 1.6.1. So figure out how to install that if you don't have it installed yet and then you can download Metamorph from the Market. This was the simplest way I could figure. I couldn't find Busybox anywhere for download.
 
taken from this old post, it works
http://androidforums.com/56711-post6.html

To install busybox on a firmware on the phone, there are a few ways. Easiest is to either use the rooted recovery v3 image or a rooted kernel.

If using the recovery, you'll need to boot up in recovery mode and connect your phone to your computer. For rooted kernel, just connect the phone when it's running normally and make sure adb is enabled in settings.

1. Run "adb remount"
2. Next push busybox with "adb push busybox /system/bin/busybox"
3. Create the symlinks with "adb shell /system/bin/busybox --install -s /system/bin" (you can skip this part if you do not foresee using the rest of the commands that busybox provides)
4. Modify cp's symlink to allow file managers to copy files "adb shell rm /system/bin/cp"
"adb shell ln -s /system/bin/busybox /system/bin/cp"
 
The problem with Samsung's battery icon tresholds (in various firmwares I tested, from H to J) is that it is showing more charge than actually left, especially in the lower range.

The change in ADC reported levels mentioned above was a step in the right direction, but I feel that Samsung's tresholds were still not tweaked correctly.

On JB2/6, my battery still drains much faster in 40-0 % range than in 100-40 one, so ADC levels still need additional tweaking...
 
Can't install it... I have made all mentionned, but Metamorph tells me about a problem with the theme control file... What to do please ?
 
What Michael said, Samsun is lowering actual readings because they are trying to warn you that the battery is going to die much before than what original readings are. Original readings are suggesting that the battery at 30% will provide more 30% usage time, but it translates to maybe 5%.

I think what Samsung did is fine.
 
Andronix, maybe I'm misunderstanding you, but I read it the other way around: that Samsung is displaying a full battery for levels as low as 71%, and a half-full battery when it's actually as low as 30%...?
 
Yep, samsung's original values mke the battery appear to have more charge than it actually does. This mod is great! :)
 
Yeah, Samsung are actually playing psychological games with the
battery indicator.

If a user sees orange, he might think "What?? Already? But I charged it yesterday!". If
a user sees green right up to the moment the phone dies, the user is happier about the
battery life.
 
hmm, if this mod makes the notification go yellow before samsung settings, i'm fine with it :) the graph is confusing a bit.

does this thing change only how icon changes states, or changing values of battery percentage readings? i'm used to ignoring the icon and watching only what is the percentage via "systray monitor" app.
 
Hi!

Problem fixed, after converting .thm in .xtm for the new version of MM ;)
I've got the same "missing controll file" issue.
Can you please upload the new version somewhere since i have no idea how to convert the .thm myself.

Thanks!

--
Damyan
 
This is awesome! I vote to have this integrated in the next Galaxo. Hopefully drakaz will find it interesting.

I 100% agree with you. it is ****ing annoying as **** seeing your battery meeter at 80% green when in fact it is only about 30-20%:eek::mad::mad::mad:. I thought it was my phone but it apears it is samsung flaw! now how could you **** this up so badly???
 
I am still using 1.5 II5, I need this patch badly because it drives me nuts. will it work with my version? also would you be able to provide a more noob freidnly tutorial?

I already rooted my phone to galaxo many times so I am not a complete noob, I just went back to 1.5 because I feel it is much faster and bug free.
 
Back
Top Bottom