Hello all,
Following a question in another thread (forum.xda-developers.com/showthread.php?p=10860486) and the many requests sent to battery widget developers, I decided to create this thread.
Many someone can help to make it so?
The battery data is provided by the driver through the 'fake' files located in /sys/class/power_supply/battery
The % data can be found in 2 files:
- charge_counter at 1% increment
- capacity at 10% increment
Would there be a way to revert those files in the battery driver and then bundle it in a ROM or an update for all?
Or another way to have the 1% data in the capacity file, which seems to be used by Android to report battery % as suggested in the original thread mentioned above? This thread also suggest another solution, but I'm worried that it might consume battery in doing so.
This would be great to see that happen, then it might even be possible to reuse that on other phones?
ccounotte said:
Hello all,
Following a question in another thread (forum.xda-developers.com/showthread.php?p=10860486) and the many requests sent to battery widget developers, I decided to create this thread.
Many someone can help to make it so?
The battery data is provided by the driver through the 'fake' files located in /sys/class/power_supply/battery
The % data can be found in 2 files:
- charge_counter at 1% increment
- capacity at 10% increment
Would there be a way to revert those files in the battery driver and then bundle it in a ROM or an update for all?
Or another way to have the 1% data in the capacity file, which seems to be used by Android to report battery % as suggested in the original thread mentioned above? This thread also suggest another solution, but I'm worried that it might consume battery in doing so.
This would be great to see that happen, then it might even be possible to reuse that on other phones?
Click to expand...
Click to collapse
This app has already been done and is there in the Apps Section. I am using this from almost a month now. It is a great app.
This app has already been done and is there in the Apps Section
Click to expand...
Click to collapse
can u give link plz
http://forum.xda-developers.com/showthread.php?t=930457
Thx I dont seen it before.
chaihg said:
This app has already been done and is there in the Apps Section. I am using this from almost a month now. It is a great app.
Click to expand...
Click to collapse
The thing is to have the Defy support all apps and widgets, not have only one choice...
So it's not developing a widget, but either an updated battery driver or a system service changing how things work there (merely exchanging 2 system files).
I think it´s only about reworking framework-res.apk, to have it in the status bar instead of the original one. I would try it myself, if we would have custom recovery, with possible start from cold boot.
This software display accurate power than?
Hello
I would like to have incon battery like that :
http://forum.xda-developers.com/showthread.php?t=724778
I see that it's impossible directly .
If i edit BatteryService.smali in the services.jar i can add 1% charging detection and so add icon ?
Thanks
I put the files in zip^, you can open with Notepad2 or ++
It's a driver issue, in the kernel. So it's not modifiable.
I have been doing experiments with it. The easiest thing may be copy the charge_counter info over capacity each N minutes with some kind of bash script, but the driver is programmed so that if it detects a write in any of those files, it stops updating.
I guess the solution would be some kind of kernel module which modifies that behavior, but I have not those skills.
You can see the source of the driver in /kernel/drivers/power/cpcap-battery.c, in the source that you can download from the Motorola site.
martinml said:
It's a driver issue, in the kernel. So it's not modifiable.
I have been doing experiments with it. The easiest thing may be copy the charge_counter info over capacity each N minutes with some kind of bash script, but the driver is programmed so that if it detects a write in any of those files, it stops updating.
I guess the solution would be some kind of kernel module which modifies that behavior, but I have not those skills.
You can see the source of the driver in /kernel/drivers/power/cpcap-battery.c, in the source that you can download from the Motorola site.
Click to expand...
Click to collapse
That was also one of my first ideas concerning systemwide 1% battery.
From kernelspace you have much more possibilities than from userspace if you want to modify systemstuff.
I`ve also tried to decompile cpcap-battery module. Do you have a link to the source ?
Have written some kernel modules for normal unix systems, will have a try on the android one.
rznag said:
I`ve also tried to decompile cpcap-battery module. Do you have a link to the source ?
Click to expand...
Click to collapse
Sure! I uploaded here: http://pastebin.com/TnZ3P8CN
But anyway you should download the full source from opensource.motorola.com.
I think that the problem lies here: the function cpcap_batt_ioctl() has this code:
Code:
if (sply->no_update)
return 0;
The 'no_update' variable is always set to false, except when you try to write over some of the mentioned files. The thing to do would be modifying this function to remove that return or to change the condition of the if.
With the help of this article I think I managed to dump and disassembly the code of this function, but I know nothing of ARM assembly language. This is what I think it's the equivalent assembly source of that function: http://pastebin.com/w658cwSj
Just a sidenote: since the latest update Circle Battery widget shows battery in 1% increments. Apparently they figured it out.
AgentSmith said:
Just a sidenote: since the latest update Circle Battery widget shows battery in 1% increments. Apparently they figured it out.
Click to expand...
Click to collapse
Could you post a link to it?
Is there any solution to "fix" moto original battery? I had something like this on my old galaxy i5700 - circle battery in notification bar, combined with the right driver - 1% battery...
I think it's this : https://market.android.com/details?id=fr.depoortere.android.CircleBatteryWidget
For droid x but it's not on the taskbar
I open xml files : stat-sys-battery.xml and see that :
<?xml version="1.0" encoding="utf-8" ?>
- <level-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:010802C4" android:maxLevel="1" />
<item android:drawable="@android:010802C5" android:maxLevel="10" />
<item android:drawable="@android:010802C7" android:maxLevel="30" />
<item android:drawable="@android:010802C8" android:maxLevel="50" />
<item android:drawable="@android:010802C9" android:maxLevel="70" />
<item android:drawable="@android:010802CA" android:maxLevel="90" />
<item android:drawable="@android:010802C6" android:maxLevel="100" />
</level-list>
It is possible to add 20 40 60 80 ? i don't know why 1-10-30 ?
Thanks
AgentSmith said:
Just a sidenote: since the latest update Circle Battery widget shows battery in 1% increments. Apparently they figured it out.
Click to expand...
Click to collapse
They didn`t figured it out. They just read the motorola specific variable. So with circle battery you also have no systemwide 1% increment. They read the same variable as the other apps posted in the apps section with which you can have 1% display: DefyBatt 1%, MotoCharge.
But all these apps just show the accurate batterylevel only on one place, not systemwide.
@mick771
What you found in the xml is just for displaying the batterystats but not to get it into 1% format. It just defines which icon should be shown at which batterylevel.
If you would add 20-40-..... then the phone would just change the icon in the taskbar more often, but it wouldn`t get more accurate. Only just 10% Steps.
I have a solution based on a kernelmodule, but haven`t successfully compiled it.
I just have changed some lines in the original motorola driver. Will have a try do compile it next days. At the moment i`m too busy with university stuff.
But I thought the kernel signature was checked at boot so you can't make any changes to it? How are you getting around that?
Yes, the kernel signature is checked at boot. But perhaps it`s possible to change this module at runtime. Single modules are not checked as far as i know. That`s why it`s possible to load the overclock module.
I don`t wanna build a new kernel, just change the battery driver module.
But as i said, i haven`t successfully compiled the module. So i don`t post a solution, it`s just that i know a possible way to solve the problem on codebase.
We`ll see if it works. Perhaps it does, perhaps not.
rznag said:
They didn`t figured it out. They just read the motorola specific variable. So with circle battery you also have no systemwide 1% increment. They read the same variable as the other apps posted in the apps section with which you can have 1% display: DefyBatt 1%, MotoCharge.
But all these apps just show the accurate batterylevel only on one place, not systemwide.
Click to expand...
Click to collapse
Ok my bad. I misinterpreted the whole topic here. Another more strange thing I noticed which might be worthwhile to know is that the lockscreen often already displays a full (100%) battery charge - also mentioning to unplug the charger - while Circle Battery still displays a value between 95% and 100%. Actually the battery keeps charging until it says 100%. A system wide 1% increment might solve this little hickup. Also as soon as I unplug the charger the percentage drops to 99. Probably an Android thing...
Defy shows with motorola increments for a value like (x+1)0 from x6 - (x+1)5.
Means if it shows 90% it can be from 86-95.
40% means it can be from 36-45.
So if the battery is at 96% it will show Full but you can charge further cause you haven`t reached the real 100%.
That`s also why your battery directly drops after unplugging.
Related
Now the ROM have power's settings:
20% - Warning
10% - Cut off SD power supply
Can I modify it? How?
Jackie
As far as i remember it can be modified, but i forgot how?
can someone pitch in please?
topgunarindam said:
As far as i remember it can be modified, but i forgot how?
can someone pitch in please?
Click to expand...
Click to collapse
Cry!!! Somebody can help me?
jackielo said:
Now the ROM have power's settings:
20% - Warning
10% - Cut off SD power supply
Can I modify it? How?
Jackie
Click to expand...
Click to collapse
I had a look through my Universal's registry, the wiki and google - but with no luck
My recommendation:
a) Continue searching the above 3 places
OR
b) Get a battery monitoring piece of software (eg batti)
OR
c) Don't change it? (and get a bigger battery\bring a charger\conserve power)
And finally:
Don't whine - try to add something to the community
@jackielo
XDA-Exec Sandisk-Ultra-2.0GB
jackielo said:
Now the ROM have power's settings:
20% - Warning
10% - Cut off SD power supply
Click to expand...
Click to collapse
these numbers are hardcoded in NK and battery driver. So they cannot be modified by editing registry or something else.
mamaich said:
these numbers are hardcoded in NK and battery driver. So they cannot be modified by editing registry or something else.
Click to expand...
Click to collapse
But I find some rom can using SD until battery 0%. So I think this setting which should can be modified.
Modify your X10 and change the default battery icon in the Notification bar (on the right) to display the exact battery charge level in percent.
(For a complete tutorial on modifying your choice framework to use whichever battery icons you wish, check out Calum's X10 Theme Reference – specifically post #5.)
Option 1: Install Only the Battery Icon Mod
(process and framework courtesy of MrRusch)
This tutorial will install a clean version of framework (2.1 original with the default X10 theme) with the percentage battery mod (grey colored version) applied. Choose this if you want to keep your X10 looking the same as it is by default, but you want the an accurate (ie: useful) battery icon.
Download and unrar your choice MrRusch's modified framework: framework-res.rar (from post #147).
Copy framework-res.apk to to your X10's /sdcard
In terminal client on your phone (try Android Terminal Emulator if you don't have one already installed):
- make sure you have super user permissions (su),
- remount filesystem as read-write (mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system), and
- replace framework (dd if=/sdcard/framework-res.apk of=/system/framework/framework-res.apk)
Option 2: Install Battery Icon Mod as part of the Dark10 Theme
(process and modified framework courtesy of _calum_)
(Dark10 theme and installation tool courtesy of Chewitt.)
This tutorial uses Chewitt's Dark10 theme as a basis for the modification, and will result in that theme being installed on your phone along with the battery icon mod. If applied your X10 will look like the screenshots below.
Download Calum's modified framework: framework-res.7z (from post #57).
Use 7-Zip to unzip it as: framework-res.apk
Download and unzip Chewitt's Dark10 Download Link For 2.1 Alpha theme.
Copy framework-res.apk to \Dark10 for 2.1 Alpha v3.0.0\Content\content\, overwriting the existing file.
Plug X10 into my PC's USB, ensuring USB debugging is enabled (Settings > Applications > Development > USB Debugging)
Run \Dark10 for 2.1 Alpha v3.0.0\Content\Dark10 Series Installer.cmd.
Select: #1 - Pre Install Check, and follow the on-screen prompts.
Once everything is verified OK, select: #5 - Install Framework.
Upon notice of success, phone will reboot with the beautiful Dark10 theme and (most importantly here), an animated percentage battery icon (visible on both the notification bar as well as the lock screen).
Additional Credits
Thanks to _calum_ for cracking how to modify framework-res.apk to get a working percentage battery icon.
Credit for the modified battery icons goes to Fightspit
Special thanks to: MarylandCookie.
Next Up: Lets see if we can figure out how to replace the semi-useless signal strength bars with an accurate signal strength (dBm) instead. Come join the effort!
I can't tell you for sure if it'll work on an X10, but it's no. 3 on my todo list
I hope to get around to it this week if work slows up a bit, I'll post back if noone beats me to it.
Using Gauge Battery Widget you can have something similar, but it doesn't replace the default battery icon. Can't see it being long though for the SuperCircle to be ported.
XperiaX10iUser said:
Using Gauge Battery Widget you can have something similar, but it doesn't replace the default battery icon. Can't see it being long though for the SuperCircle to be ported.
Click to expand...
Click to collapse
Yeah I use Battery Indicator Pro to show the percentage as a notification bar (left side) icon right now. However, I would really prefer to just have the default battery indicator show more useful information.
Plus, with the bigger icons on the 2.1 notification bar, we actually get less icons showing, making each space more valuable.
It's definitely possible but will probably take some work to get it running. I tried using the link provided and my battery display disappeared on reboot. I'm pretty sure those ones are froyo only.
I'll keep my eyes out for anything that may work. Calum, keep us updated.
http://forum.xda-developers.com/showthread.php?t=679937
Will probably require a bit of tweaking to get working...
Sent from my X10i using XDA App
I use battery indicator its free and it shows the percentage left as well as the original indicator
chiefy009 said:
I use battery indicator its free and it shows the percentage left as well as the original indicator
Click to expand...
Click to collapse
See post #4.
Got it working
Sent from my X10i using XDA App
gavriel18 said:
Got it working
Click to expand...
Click to collapse
SWEET! Can you post a screenshot?
Even better, can you post a guide on how to do it?
Yes, please post a "how to" for everyone.
I actually didn't get it working myself. My little brother emailed some the xmls and told me to push them.
Ill post a tut tonight when he explains
Sent from my X10i using XDA App
saltorio said:
See post #4.
Click to expand...
Click to collapse
Sorry, skim reading
Sent from my X10i using XDA App
gavriel18 said:
I actually didn't get it working myself. My little brother emailed some the xmls and told me to push them.
Ill post a tut tonight when he explains
Click to expand...
Click to collapse
Hey Gav, any updates?
Looking forward to this as well.
Sent from my X10i using XDA App
Any chance of a tutorial?
OK. My friend (who has a Samsung Galaxy S) told me how he managed to change the battery icon to a percentage graphic (see attached pic).
He edited \system\framework\framework-res.apk.
Deleted all the existing res\drawable-hdpi\stat_sys_battery_<X>.png graphics.
Replaced them with a new (more extensive) set of graphics for every percentage.
Replaced res\drawable\stat_sys_battery.xml with one that includes listings for each new graphic.
Replaced res\drawable\stat_sys_battery_charge.xml with one that includes listings for the new charging graphics.
I have attached a .rar archive (framework-res.apk.rar) with only the changed files he used.
I tried editing my own framework-res.apk using APK-Manager (http://forum.xda-developers.com/showthread.php?t=695701), but I was unable to re-compile the modified APK (kept reporting errors).
My friend states that he simply dragged the files over using WinRAR, but I haven't tried that. If someone wants to, I've also attached his compiled (and signed?) apk (framework-res.apk).
If anyone else wants to see if we can work something out, this is a place to start at least.
saltorio said:
OK. My friend (who has a Samsung Galaxy S) told me how he managed to change the battery icon to a percentage graphic (see attached pic).
He edited \system\framework\framework-res.apk.
Deleted all the existing res\drawable-hdpi\stat_sys_battery_<X>.png graphics.
Replaced them with a new (more extensive) set of graphics for every percentage.
Replaced res\drawable\stat_sys_battery.xml with one that includes listings for each new graphic.
Replaced res\drawable\stat_sys_battery_charge.xml with one that includes listings for the new charging graphics.
I have attached a .rar archive (framework-res.apk.rar) with only the changed files he used.
I tried editing my own framework-res.apk using APK-Manager (http://forum.xda-developers.com/showthread.php?t=695701), but I was unable to re-compile the modified APK (kept reporting errors).
My friend states that he simply dragged the files over using WinRAR, but I haven't tried that. If someone wants to, I've also attached his compiled (and signed?) apk (framework-res.apk).
If anyone else wants to see if we can work something out, this is a place to start at least.
Click to expand...
Click to collapse
I just tried installing those files into the framework but then nothing shows up in the notification bar.
Gav, can you please tell us how you did it, or at least send us your framework.
saltorio said:
OK. My friend (who has a Samsung Galaxy S) told me how he managed to change the battery icon to a percentage graphic (see attached pic).
He edited \system\framework\framework-res.apk.
Deleted all the existing res\drawable-hdpi\stat_sys_battery_<X>.png graphics.
Replaced them with a new (more extensive) set of graphics for every percentage.
Replaced res\drawable\stat_sys_battery.xml with one that includes listings for each new graphic.
Replaced res\drawable\stat_sys_battery_charge.xml with one that includes listings for the new charging graphics.
I have attached a .rar archive (framework-res.apk.rar) with only the changed files he used.
I tried editing my own framework-res.apk using APK-Manager (http://forum.xda-developers.com/showthread.php?t=695701), but I was unable to re-compile the modified APK (kept reporting errors).
My friend states that he simply dragged the files over using WinRAR, but I haven't tried that. If someone wants to, I've also attached his compiled (and signed?) apk (framework-res.apk).
If anyone else wants to see if we can work something out, this is a place to start at least.
Click to expand...
Click to collapse
System files do not need to be signed after editing!
Hi to all.
I've made a watchface with the stepcount % indicator.
This indicator was fine until it reach the 100%, but if you go over your daily objective the counter became unuseful (I don't know which value it exposes).
Someone else have experienced the same problem?
Thanks
GS
ITALY
PS: what about creating a new section dedicated to the Gear Watch Designe...?
Do you use the "steps counter" or "steps %" ?
For me, the % just stop when the number off steps are done, but when I put the counter, it continue until the end of the day.
Mikoube said:
Do you use the "steps counter" or "steps %" ?
For me, the % just stop when the number off steps are done, but when I put the counter, it continue until the end of the day.
Click to expand...
Click to collapse
The problem is another: I have associated a sequence of images to reproduce a toggle for the step count %.
The gauge is OK, but when I go over the 100% of the daily target, the gauge resets to the initial position and is looks like the 0% of the target.
I think this is a bug of the GWD...
GS
ITALY
Or maybe GWD don't see it as % meter, but count meter and after the defined count of steps, it just restart the count... the good thing to know is : Is it possible to record that reset to put another counter
Do you mean you used "Step Counter"?
jhonjey66 said:
Hi to all.
I've made a watchface with the stepcount % indicator.
This indicator was fine until it reach the 100%, but if you go over your daily objective the counter became unuseful (I don't know which value it exposes).
Someone else have experienced the same problem?
Thanks
GS
ITALY
PS: what about creating a new section dedicated to the Gear Watch Designe...?
Click to expand...
Click to collapse
Do you mean you used the "cumulativeTotalStepCount" of the Human Activity Monitor interface?
If yes, it will give you total steps since you last called "tizen.humanactivitymonitor.start(...)", Irrespective of any "daily objective".
API Reference - https://developer.tizen.org/dev-gui...izen/humanactivitymonitor.html#StepDifference
akhilkedia94 said:
Do you mean you used the "cumulativeTotalStepCount" of the Human Activity Monitor interface?
If yes, it will give you total steps since you last called "tizen.humanactivitymonitor.start(...)", Irrespective of any "daily objective".
API Reference - https://developer.tizen.org/dev-gui...izen/humanactivitymonitor.html#StepDifference
Click to expand...
Click to collapse
Thanks for the answer...
In any case, no, I used the GWD facility that allow to link a series of images to the stepcount %...
I attach an image in order to explain...
The problem is that the percentage seems to go over 100% but there is no option to link a further image when this condition happens...
GS
ITALY
jhonjey66 said:
Thanks for the answer...
In any case, no, I used the GWD facility that allow to link a series of images to the stepcount %...
I attach an image in order to explain...
The problem is that the percentage seems to go over 100% but there is no option to link a further image when this condition happens...
GS
ITALY
Click to expand...
Click to collapse
I have the same problem. i just want to show a simple image when goal reaches 100%
and it does. at 100% it shows. if i walk another stepp its 100.01% and it disappears...
the same here
dahod83 said:
the same here
Click to expand...
Click to collapse
Has anyone tried editing the XML by hand to put in a "ge" (greater than or equal to) operator?
kimvette said:
Has anyone tried editing the XML by hand to put in a "ge" (greater than or equal to) operator?
Click to expand...
Click to collapse
nope
Drbaldini said:
I have the same problem. i just want to show a simple image when goal reaches 100%
and it does. at 100% it shows. if i walk another stepp its 100.01% and it disappears...
Click to expand...
Click to collapse
Is that fixed with an update to GWD 1.0.2 ?
ThinkD said:
Is that fixed with an update to GWD 1.0.2 ?
Click to expand...
Click to collapse
it is at least it says so on release notes
http://developer.samsung.com/release-note/view.do?v=R000000030L
I do it with STEPS - not with %. That works fine! If the step goal is achieved appears a special image and this remains for the rest of the day.
Hello,
I have been using khadas VIM3 dev board and I want to add battery support in the OS(Android 9 TV os). I have added my battery charging/discharging and fuel gauge drivers in the kernel and I'm also able to see the battery percentage on adb shell. But my system UI is not reflecting current percentage on status bar and I have to do screen on/off to see the updated percentage.
I have been looking for the solution but did not find any. So, anyone who has idea regarding this then please guide me through this issue.
Thank You.
My guess is you have to install EdXposed framework and then therein run a module like this one.
So I damaged my phone screen and got a non-original screen as a replacement. The new screen-space is not as tall and so the top part of the status bar is getting cropped off. Is there a way for me to fix this? Probably something that could decrease the screen space my ROM is using by a few pixels?
Wich phone model and software version are you running ?
You may try changin the dpi to make it fit in , some phones have it inside the developer settings
ThatLatinGuy said:
Wich phone model and software version are you running ?
You may try changin the dpi to make it fit in , some phones have it inside the developer settings
Click to expand...
Click to collapse
I am using an Asus Zenfone Max Pro M1. Android 12 EvolutionX ROM. I will try searching the Developer Options.
EDIT: I did mess up my device and get it into a boot loop by trying to change the display cutout. It's fixed now. But yeah I couldn't find a relevant option. Would be really great if you could give me a bit more precise solution.
The system component that draws the statusbar is SystemUI.apk and, inside it, you will find the images (all the "/res/drawable/sec_stat_sys_*.spr" files) and several XML files that coordinate the overall layout.
xXx yYy said:
The system component that draws the statusbar is SystemUI.apk and, inside it, you will find the images (all the "/res/drawable/sec_stat_sys_*.spr" files) and several XML files that coordinate the overall layout.
Click to expand...
Click to collapse
I sort of understand what you're saying but this would mean some experimentation and since I don't have a backup device. I don't think with my present schedule I'll be able to spend time experimenting with it. Can you provide some more precise help? Is there no option to tweak things?