Fix for status bar battery indicator


Last Updated:

  1. bluemax

    bluemax Member This Topic's Starter

    Joined:
    Mar 1, 2010
    Messages:
    9
    Likes Received:
    7
    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):

    [​IMG]


    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.
     

    Attached Files:


    Advertisement
    sgx100, Zero-K, Frojd and 4 others like this.
  2. inFECT

    inFECT Well-Known Member

    Joined:
    Feb 22, 2010
    Messages:
    256
    Likes Received:
    69
    This is awesome :)

    Well done.
     
  3. MichaelW

    MichaelW Well-Known Member

    Joined:
    Oct 6, 2009
    Messages:
    364
    Likes Received:
    26
    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.
     
  4. KlaymenDK

    KlaymenDK Well-Known Member

    Joined:
    May 29, 2009
    Messages:
    1,217
    Likes Received:
    130
    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...
     
  5. michael.nights

    michael.nights Member

    Joined:
    Mar 3, 2010
    Messages:
    6
    Likes Received:
    0
    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!
     
  6. Electroz

    Electroz Active Member

    Joined:
    Feb 19, 2010
    Messages:
    37
    Likes Received:
    6
    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.
     
  7. bluemax

    bluemax Member This Topic's Starter

    Joined:
    Mar 1, 2010
    Messages:
    9
    Likes Received:
    7
  8. Rastaman-FB

    Rastaman-FB Well-Known Member

    Joined:
    Sep 11, 2009
    Messages:
    6,113
    Likes Received:
    1,010
    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"
     
  9. MichaelW

    MichaelW Well-Known Member

    Joined:
    Oct 6, 2009
    Messages:
    364
    Likes Received:
    26
  10. bluemax

    bluemax Member This Topic's Starter

    Joined:
    Mar 1, 2010
    Messages:
    9
    Likes Received:
    7
    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...
     
  11. Xenon

    Xenon Well-Known Member

    Joined:
    Aug 30, 2009
    Messages:
    243
    Likes Received:
    3
  12. KlaymenDK

    KlaymenDK Well-Known Member

    Joined:
    May 29, 2009
    Messages:
    1,217
    Likes Received:
    130
  13. Spinelli

    Spinelli New Member

    Joined:
    May 17, 2010
    Messages:
    2
    Likes Received:
    0
    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 ?
     
  14. Spinelli

    Spinelli New Member

    Joined:
    May 17, 2010
    Messages:
    2
    Likes Received:
    0
    Problem fixed, after converting .thm in .xtm for the new version of MM ;)
     
  15. nunocordeiro

    nunocordeiro New Member

    Joined:
    Oct 9, 2009
    Messages:
    3
    Likes Received:
    0
    This is awesome! I vote to have this integrated in the next Galaxo. Hopefully drakaz will find it interesting.
     
  16. Andronix

    Andronix Well-Known Member

    Joined:
    Aug 31, 2009
    Messages:
    676
    Likes Received:
    16
    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.
     
  17. KlaymenDK

    KlaymenDK Well-Known Member

    Joined:
    May 29, 2009
    Messages:
    1,217
    Likes Received:
    130
    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%...?
     
  18. Frojd

    Frojd Well-Known Member

    Joined:
    Nov 9, 2009
    Messages:
    97
    Likes Received:
    10
    Yep, samsung's original values mke the battery appear to have more charge than it actually does. This mod is great! :)
     
  19. Xenon

    Xenon Well-Known Member

    Joined:
    Aug 30, 2009
    Messages:
    243
    Likes Received:
    3
    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.
     
  20. Andronix

    Andronix Well-Known Member

    Joined:
    Aug 31, 2009
    Messages:
    676
    Likes Received:
    16
    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.
     
  21. Frojd

    Frojd Well-Known Member

    Joined:
    Nov 9, 2009
    Messages:
    97
    Likes Received:
    10
    It only changes at what percentage the icon changes.
     
  22. Andronix

    Andronix Well-Known Member

    Joined:
    Aug 31, 2009
    Messages:
    676
    Likes Received:
    16
    fine :)
     
  23. damyan5

    damyan5 New Member

    Joined:
    May 20, 2010
    Messages:
    1
    Likes Received:
    0
    Hi!

    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
     
  24. nuke777

    nuke777 Well-Known Member

    Joined:
    Aug 3, 2010
    Messages:
    116
    Likes Received:
    2
    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???
     
  25. nuke777

    nuke777 Well-Known Member

    Joined:
    Aug 3, 2010
    Messages:
    116
    Likes Received:
    2
    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.
     

Share This Page

Loading...