Modding the HtcPowerManager SMALI help needed - One (M7) Q&A, Help & Troubleshooting

I've noticed that the stock battery for Sense 5 turns yellow at 20% (ok) but red at 8%(random).
I've figured out how to mod the SystemUI apk to change it so that the battery turns red w/ 10% left but I can't figure out how to change the HtcPowerManager apk to reflect the changes in the large battery widget.
I know how to change it's color (by modding the drawable.xml file) but I can't change the number of bars left at 10% there are 2 instead of 1 at 10% and 9% (again, it oddly changes at 8%) even tho each bar represents 10% of the battery level.
I'm assuming it has to do with smali (java) but I can't isolate the code.
Anyone want to help me "fix" this?
Sent from my HTC One using xda app-developers app

Related

Battery display in status bar

Is there anyway to just change that without having to install a whole different rom? Thanks!
What do you mean?
I was wondering something similar (i think), that would put a percentage on the already existing battery meter. Much like the battery status app that you can download off the market.
Is that what you mean?
The battery would always be there. If you want something like a percentage then you would have to download an app from the market but the original battery will always be there.
He wants there to be a different battery color or design or something, am I correct? To find the answer to the question I would ask one of the many theme devs, they're the one's that would most likely know something about this.
You can change the battery icon in the status bar by editting the framework\res\drawable battery icons. There are only 7 of them tho, so putting in a percentage wouldn't really be feasible. You can do it, but the icons are set by the system to change only at certain intervals. They are:
100%
80%
60%
40%
20%
10%
0%
You can change the icons for each of the listed percentages. Or you could make it a written percentage in 20% increments.
the rom/theme I am using has the regular horizontal battery meter, but I like the round one and was wondering if there was any easy way of just changing that
Change the images in the framework\res\drawables.

Battery Percentage on Froyo

Anyone know how to get the battery percentage to show in the battery icon in Froyo? Thanks.
moved to Q&A
cant happen until froyo source is out.
You can, but not perfect
I too wanted the percentage in the battery. In the development thread you'll see that the phoenrom has it included in the rom. I ended up making my own custom rom with the kitchen made by dsixda just to get that damn percentage in the battery icon! Its also not a very accurate measurer of percentage as it only works in percentages of 10(40,50,60etc). I still like it though.
Now that the source is out,
I tried to apply the bat. %, but failed.
I edited the xml to link to the pngs from 0 to 100.
I edited the PNGs.
Compilation warns me about bad pngs and when I reboot, the framework is totally messed up or even worst, as I unlock my phone, it just reboots...
Any help on how to do this?
I use Battery Widget (free). Takes up one icon space on your home screen (shows battery percentage in 1% increments), also allows quick toggling of Wifi/GPS/Bluetooth, and access to Screen settings.
RashaMatt said:
I use Battery Widget (free). Takes up one icon space on your home screen (shows battery percentage in 1% increments), also allows quick toggling of Wifi/GPS/Bluetooth, and access to Screen settings.
Click to expand...
Click to collapse
You know it has been released, no?
Check to forum: a simple jar to push

Battery mod not showing correct percent left

I have a problem with a battery mod I just applied to my SGS.
I downloaded a set of clockwork batt icon mod that shows from 0% to 100% with 1% increments.
However after doing the necessary changes of replacing the stock files in the framework-res.apk, the icon loads but only at 10% increment and it shows a different reading as what my battery status is in settings.
i.e settings shows 44% but icon and top right shows 60%.
Your help is much appreciated.
Thanks
Sent from my GT-I9000 using XDA App
To add on, the image files I copied into framework-res.apk has images from 0% to 100%.
Thanks in advance.
Sent from my GT-I9000 using XDA App
Anyone can help with this problem?
Sent from my GT-I9000 using XDA App
The icon pack you downloaded is actually meant for this particular mod which should be installed from recovery mode to sort out the xmls and what not.

battery meter theming

I just recently installed a new theme with the battery meter showing percentages in the notification bar (rooted Captivate running stock 2.1). To learn more about themes, I was poking around at the framework-res.apk files - comparing the original backed-up file with the one that was in the new notification bar package.
It seems the stock battery icons were in 20% increments, so there were files like stat_sys_battery_20.png, stat_sys_battery_40.png, etc.
On the percentage battery framework, there were a lot more files with names like stat_sys_battery_20.png, stat_sys_battery_21.png, etc.
Obviously one file for each meter increment you want. My question is: Is that all it takes to set up a battery meter? i.e., if I want to create a battery meter in, say, 10% increments - all I have to do is create one for each increment and save it in there? Is there no place else that I have to define whether there will be 5 battery icons, 10 battery icons, and which file corresponds to which battery level read by the system? Or is just the filename enough for it to figure out which battery icon goes with which battery level?
So does no one know or did I do a really crappy job of asking my question?
MobileNick said:
So does no one know or did I do a really crappy job of asking my question?
Click to expand...
Click to collapse
Yes.
. . . . .
LOL ... no... no such thing as a stupid question - only stupid posts like I BRICKED MY PHONE (because... they didn't read the Q&A sticky)
But I don't know if I can answer your question with 100% accuracy.
It is true that you need 100 images to indicate the % increment vs. the 5 used for the 20% increment (if my math is off... IDK I fail at basic math )
... The part I'm not sure if it is needed is if the framework-res.apk has *.xml edits so that it recognizes the use of those images.
Best thing to do is test (which I can see you have it installed) and find out if it works without doing the *.xml edits.
avgjoegeek said:
... The part I'm not sure if it is needed is if the framework-res.apk has *.xml edits so that it recognizes the use of those images.
Click to expand...
Click to collapse
Thanks for the info! This point what I was thinking about. i.e., is it enough to just stick the appropriate images in there or does there have to be some kind of reference that says for example 83% battery corresponds to the file labeled stat_sys_battery_83.png
Yes, I did install the % meter. However, I installed it as an update.zip, so I'm not sure all the little changes - such as the .xml edits - that may have happened in the background. I can try to compare the other files with the stock framework.

[Q] SGS - Battery status not updated normally

Hello everyone, this is my first post here.
I flashed leaked Gingerbread 2.3.5 (samfirmware.com) to my Galaxy S GT-I9000 two days ago. Then I customized battery status icons:
1. Extracted framework-res.apk and replaced icons with some nice Android icons I found here http://forum.xda-developers.com/showthread.php?p=13496547. I used Winrar to open the framework.
2. Then I copied my new framework to my phone.
The icons looked great, but they are not refreshed properly. The battery status went from 80% to 60%, then to 40% and finally to 20%. It is not a draining problem since it takes hours to go from one status to another.
I doubled checked icons in customized framework and thery are named correctly. Original framework had icons for every 5% and these new icons are for every 1%. Only difference I can see is that some of the new icons are 2KB in size, instead of 1KB, but this also applies for icons for 20%, 40%, 60%, 80%.
I have not calibrated battery yet, but I think that is not the problem.
I couldn't say this behaviour is the same with original framework, since battery icons do not show percentage in that case.
Do you think it is a problem with this "official" leaked buenROM ?
Thanks in advance for any help.
Well, I restored original framework and the behaviour is the same with default battery status. It must be something in the ROM.

Categories

Resources