Add battery support in Android 9 TV os - General Questions and Answers

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.

Related

battery icon percentage

hi all, i am sorry if this topic is already around, but i was wondering if a app is available that replaces your battery icon in your status bar with one that shows the percentage level. Like the one on iOS (sorry dont hate)
Replaces, no.
There are mods that require root and lots of fiddling or a custom rom, to replace it.
There's also several apps on the market that add it in as an extra icon on the left side of the notification bar. They don't require root or any other fiddling.
ok thanks, what apps are these?
they are called battery widgets... theres a ton of them in the market...
i used this one
http://forum.xda-developers.com/showthread.php?t=809588
All it takes is a Google search...
Here's a few free ones:
http://www.appbrain.com/app/batteryminder-battery-status/com.rollerbush.batteryminder
http://www.appbrain.com/app/battery-indicator/com.darshancomputing.BatteryIndicator
http://www.appbrain.com/app/battery-e-t-a/com.ac19.beta
Plus I just released an update to my Battery Diviner that does this, but it's only accessible in the Full (paid) version.

[Q] Defy 1% universal battery increment?

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.

[GUIDE] for a better battery life on Nougat

Hi to all. I would insert also here the fantastic guide of Rommco05 for extend the battery life.
It refers to the Honor 8 but it's also valid for the 9.
Here is the GUIDE.
Credits and thanks to Rommco05.
Anyone know how to disable the changing background images on lockscreen? My guess is that the downloading of these uses a significant amount of battery and data.

Temperature Layer for Xperia 5

This application is not my work, I only found an old application on the Playstore that was discontinued, I just edited it a little so that it could run normally on Android 11,especially for Xperia 5 because I did a test and used it for that device, maybe it can work normally on other devices with the same operating system.the function of this application is to display the battery temperature in the statusbar to monitor the battery temperature so that users do not overuse the device when the temperature is too hot.
the name of the application developer is in the picture, if he is here and is not pleased if his work is edited, please delete it. thank you

Question Full immersive mode??

Just got 7a from google store online (no carrier lock), coming from OP7 pro on Android 10 been running without navigation pill or status bar... (well it was invisible? if icons were hidden) used System UI tuner for that phone.
Seems every command I want to use in System UI tuner is broken in Android 13 on this 7a device because I can't get immersive mode or transparent "pill" nav to work...
Read ADB commands stopped doing these commands a while back as well. I don't care to do much more to the phone but get immersive full use of screen. I would also like to get rid of date and time on home screen and the google widget at the bottom of home screen BUT not a priority.
Haven't had to root a phone in ages.... is this the only way I am going to accomplish this? If so is there a guide to follow to get this end result? Apparently I'm a born again noob.
Thank you to anyone for insight
kraftwerksfit said:
Just got 7a from google store online (no carrier lock), coming from OP7 pro on Android 10 been running without navigation pill or status bar... (well it was invisible? if icons were hidden) used System UI tuner for that phone.
Seems every command I want to use in System UI tuner is broken in Android 13 on this 7a device because I can't get immersive mode or transparent "pill" nav to work...
Read ADB commands stopped doing these commands a while back as well. I don't care to do much more to the phone but get immersive full use of screen. I would also like to get rid of date and time on home screen and the google widget at the bottom of home screen BUT not a priority.
Haven't had to root a phone in ages.... is this the only way I am going to accomplish this? If so is there a guide to follow to get this end result? Apparently I'm a born again noob.
Thank you to anyone for insight
Click to expand...
Click to collapse
Rooting is easy. You can check the PixelFlasher tool here on XDA. And using Xposed + AOSP mods will do the trick.
[MOD][Xposed+Magisk][13 Compatible] AOSP Mods - System modifications for AOSP-based Android 12+
This is a mixed Xposed+Magisk module, which is made to allow customizations that are not originally designed in AOSP (Android Open Source Project). Features: Currently, AOSP Mods offers customizations on different aspects of system framework and...
forum.xda-developers.com
📳🔥PixelFlasher for Google Pixel 7 Support Thread.
This is the support thread of PixelFlasher (PixelFlasher is an open-source self contained GUI tool to facilitate Pixel phone device flashing/rooting/updating with extra features). Note: This thread is meant for issues and problems faced in...
forum.xda-developers.com

Categories

Resources