yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] RafalCOM:
Perfect!

Thx a lot, it's working for me as well.

---------- Post added at 02:35 PM ---------- Previous post was at 02:32 PM ----------

Had the same problem multiple times and it was worrying me as AA was the main reason I wanted this app as my phone has to be constantly connected so it's always charging.

What I am doing if I have this issue I am opening my phone while still connected, disabling this app to make AA work and enabling it again. After an initial start AA stays up and all is working fine.
[Android Apps and Games] Alin CG:
Anyone got the app to work on Xiaomi devices? My phone in MI 9T and the app is not working. Phone keeps charging over the limit. THX
[Android Apps and Games] cattolicboy:
Here is working on the mi6, mi mix 2s, mi9 se, mi pad 4, all with custom roms, so yes, definitely it's working on Xiaomi devices.
[Android Apps and Games] raven6679:
Working on my Mi Mix 2S also, then on Mi 8 and Mi 5. No problem at all. Over 18 months now, no trouble.

Wysłane z mojego MIX 2S przy użyciu Tapatalka
[Android Apps and Games] ganeshkulal:
Please someone tell me what settings should i chose im using poco f1. I can't see my device is listed in there ?
[Android Apps and Games] alex moymoy:
Try

/sys/class/power_supply/battery/input_suspend,0,1

Btw on Poco normally the apk set's automatically. But you can try that manual control ?
[Android Apps and Games] ganeshkulal:
Ok thank you
[Android Apps and Games] Raúl DJ:
It seems that the lower threshold, this is the "Recharge below" option, does nothing on my Lenovo Moto G4 (Stock Android 8.1.0, stock kernel 3.10.84). As soon as I plug the phone to my PC or the wall charger, it always charges the battery up to the upper limit (this feature does indeed work), no matter how low or how high the battery is or the lower threshold is configured.

I'm using the "battery_charging_enable" control file and both "Always Handle Power Events" and "Always Write CTRL File" do nothing about my issue.

Thank you very much for your software and I hope you'll be able to help me with my issue, or at least it gives you some clue on how to improve it.
[Android Apps and Games] post-mortem:
It will always charge when you plug in the charger below the upper threshold. The lower threshold comes into play when you leave the device plugged in after charging shuts off. How long do you want the device to sit there plugged in and not charging? That's what the lower threshold is for.
[Android Apps and Games] Raúl DJ:
Welp, if that's the intended behaviour, I've never seen such a strange one in my life, as I expected it to work like pretty much every laptop nowadays with this kind of feature: only charge if the battery is below certain percentage and up until the upper threshold, period. The objetive here is to reduce battery wear by charging it the less possible amount of time.

Moreover, the battery never gets discharged for me if the phone is connected but not charging, as the the USB alone powers up the phone on almost all possible situations when connected to a PC and 100% of them if it's connected to the wall charger (more current capabilities) . You'd need to wait hours for the battery to naturally get discharged even a 1% of its capacity, so I just can't comprehend at all the usefulness of this feature.
[Android Apps and Games] hgmichna:
Intended behavior

What exactly do you want and why do you want it? What exactly would be the advantage of any different behavior? The app does exactly what all users here want it to do.

Just because you want it to charge this way or that way is not enough. You would have to explain a clear advantage. I am sure, if you could do that, the author would think about changing the behavior. But I think you can't.
[Android Apps and Games] Raúl DJ:
Of course I don't want to influence the developer into changing the way his/her application works, that's why this is their application and not mine. I don't know what the people here supposedly want this application to do, so I just assumed it would work like most laptops battery charge limiter software work: just charge the battery if it is below certain threshold. It works like that because when the device is connected, its battery is not going to get drained almost anything, as the charger provides energy to the device and the battery is just sitting there, minding its own business, and getting slightly discharged over time just by the nature of its chemicals. If you use the device while not connected, but just a little bit, it will get discharged, but not by a big amount, so when you connect the device to the charger again, it won't get charged because the battery level is probably above the level you deemed "acceptable to be considered as almost fully charged", this is, the lower threshold. If you use the the device more and more while not being connected, it will eventually get below the lower threshold, and when you connect it again to the charger, it will get charged up to the upper limit and the cycle starts again.

This is the behaviour of Lenovo, Dell and other laptops right now and is what I expected this software to do, but it seems phone users prefer that other behaviour. Oh well:cool:.
[Android Apps and Games] post-mortem:
The exact specifics of how the device charges or doesn't charge, and how charging is affected by installing this app, are completely dependent on your specific kernel. For most of us, the phone discharges while plugged in after reaching max. Once the device gets below the lower threshold, charging resumes. The behavior you described where the device gets powered directly from the USB and does not discharge is considered preferable. Howeve, tthere is no way we can choose for this to happen; it is completely dependent on the kernel.
[Android Apps and Games] Raúl DJ:
Oh wow, I just assumed that the phone getting power from the USB and the battery just sitting there not being charged or discharged was common to all devices, I didn't think of phones that would always use their battery even when connected and not charging. Thank you Lenovo, I guess:D, and thank you post-mortem for your explanation, as now this option really makes sense to me.
[Android Apps and Games] domDeen:
Is the app automatically starting when you plug in the charging cable and also automatically terminating when you unplug? Because it doesn't on my Mi Pad 4, there needs to be an extra steps that requires me to enable/disable the service.
[Android Apps and Games] hgmichna:
When to start charging

I cannot recognize any advantage of one strategy over the other. You would normally set the lower limit very close to the upper limit, so it does not matter much anyway. It is also quite understandable that a user who is connecting the charger first and foremost expects it to charge.

You have still not explained any advantage of the laptop strategy that you prefer.
[Android Apps and Games] guest4711:
It depends on the last state for me: If it was loading when I disconnect the charger, it will charge after connecting again. Otherwise not.

I've put a widget on my home screen to stop and start this service on the fly.
[Android Apps and Games] raven6679:
Yes, it does. App reside in memory, always (it's excluded in battery optimization as also in MIUI native "optimizations").

But when I plug-in the cable either put Mi Mix on wireless charger, a little toast message appears from Magisk root (Battery Limit sth. sth. has been enabled - or similar) and then app is chceking battery % parameters.

When I take off the phone, service is paused.
[Android Apps and Games] zputnyq:
For the toast message, actually not really sure which one, since I have disabled both. Howeverver, It seems you can disable it on magisk manager's settings then choose none on superuser notification or probably you can set it up on battery charge limit's settings then thick hide toast on service changes.
[Android Apps and Games] domDeen:
Interesting, I've allowed the app to start in the background in permissions as well as disable battery optimizations on it. As for the MIUI native optimization, where would you find settings for that?
[Android Apps and Games] raven6679:
Long click on app icon, then App Info, then Permission section, and there:

- Autostart is on

- Other Permissions:

-- Start in Background is on (this setting is what I incorrectly described as native optimization)

- Battery Optimization is off

That's all. My ROM is Xiaomi.eu, rooted with Magisk.
[Android Apps and Games] domDeen:
Thank you for the extra information, my ROM is also Xiaomi EU as well, but for the Mi Pad 4. I have the same settings it seems but it only automatically starts sometimes. Oh well, this is a great app necessarily if you want longevity anyway. Appreciate the help!
[Android Apps and Games] Raúl DJ:
Of course I did: not charging the battery at all if it's not deemed necessary, which is what this application aims for in the first place. If this cannot be done as apparently most phones always use battery power instead of just getting the power from the USB, therefore they get discharged with time, that doesn't mean that "my" method (it is what it is on all those laptops, I didn't come up with it) doesn't work or doesn't make sense. In fact, it would make all the sense in my isolated case as I explained before: I just wan't the phone to not use the battery if it's above the selected threshold and nothing else. What exactly are you not understanding?
[Android Apps and Games] hgmichna:
Intended behavior

What would be the advantage?
[Android Apps and Games] post-mortem:
As explained before, this is entirely dependent on your OS's kernel. This app simply takes advantage of features of the kernel. If this app doesn't work the way you like on your device, you either have to change your kernel, change your OS, or change your device.
[Android Apps and Games] Raúl DJ:
Yes , I did understand you perfectly the other day so I'm fine with the application as it is, because it works the best for most of people, but hgmichna is still quoting me.

Not charging the battery if it's not necessary, this is, if the battery level is between two configured values, as simple as that. I'm just repeating myself over and over again so I'll just leave this here, as I think I made myself clear enough and we're just filling the thread with useless posts, as the reason of the behaviour of this application was already nicely explained by post-mortem the other day.
[Android Apps and Games] Zaxx32:
Moto G5?

Does any know if 1.1.1 will work with the Moto G5?

More specifically, I have a Moto G5 Plus, Magisk Rooted on stock Oreo 8.1

I did a thread search...only hits were for the 9 year old Moto Defy! :(

If anyone has advice for what settings to use on the fairly pure-ish Android that Moto is known for,

please give a noob-ish fella a hand...:D
[Android Apps and Games] dra1c:
anyone else tried to use it on the pixel 4?

the only control file offered on the pixel 4 is "status Motorola Defy+ (MB526)", but it does not work. Tried it with and without the option to enforce charge limit. Is there something else I need to do here? App always worked fine on Pixel 2 (but had a different control file option there)
[Android Apps and Games] post-mortem:
Yes, see here: https://xdaforums.com/showpost.php?p=80711455&postcount=2414
[Android Apps and Games] hgmichna:
Cahrging strategy

While the app is active, the battery level is always between the two configured values. It always goes up and down between these two levels. Usually it is favorable to set the two levels close to each other, because thus you have lower peak temperatures, and you have a more predictable charge level whenever you disconnect the phone. Let's say you want 80%, then you would sensibly set the top value to 80% and the bottom, recharge value to 78%. This way you can be sure that, whenever you need the phone away from home, you have a charge that is close to 80%.

When you connect the phone to the charger, it is of no practical consequence whether it initially goes up or down, but a reasonable assumption by the app's author is that, if you connect the charger, you want to charge.

I can still not see any advantage to doing it differently.
[Android Apps and Games] selfishjelly:
The advantage would come into play when using wider treshold difference, lets say 3.8V - 4.1V Charging from 3.8V to 4.1V causes less stress than say charging 6 times from 4.5V to 4.1V. Trough this is really inconvenient for phones with small batterry (most of them) and setting tresholds closer to the average (to get similliar usable bat.life) should cause similiar wear than the first case.
[Android Apps and Games] post-mortem:
A shallow depth of discharge is actually preferable to deeper discharge cycles, if your goal is to maximize the battery's overall usable lifespan:

https://batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries
[Android Apps and Games] Juxez:
Rog 2

Have anyone try it on ROG2? When the battery charge until the limit( 80%) , the charging indicator turn off as well as the status does not show it is charging. But apparently, the battery percentage continue to rise above the limit. Anyway to fix this?
[Android Apps and Games] MyronAz:
LOL, we are in the same boat. The problem, as far as I can tell, is finding the correct control file. The app author made a file that lists the control file location for various devices : https://github.com/sriharshaarangi/...aster/app/src/main/res/raw/control_files.json that might help in locating the correct file for the ROG2. I've looked a little but haven't found anything so far. (I did find a file "voltage_max" (/sys/class/power_supply/battery). I wonder if setting the value would limit the charge?)

There is also another similar app ACCA https://github.com/MatteCarra/AccA. I could not get it to work either.

EDIT: Looking back on this thread I see that some people are in fact using the voltage_max file to control charge level. So that may be the way to go.
[Android Apps and Games] gonzo1963:
Good afternoon,

Do you know this app: https://xdaforums.com/showthread.php?t=3980767 ?.

It seems the most complete.

We will have to try it.

Regards

Enviado desde mi unknown mediante Tapatalk
[Android Apps and Games] Technical:
On contrary, that app does not use root and just send a notification when charge is done :(
[Android Apps and Games] gonzo1963:
Good morning,

It's true!.

I have installed it to test it, and it is not the same as this.

We will continue looking for a more current one and that is updated more often than "Battery Charge Limit".

Regards

Enviado desde mi unknown mediante Tapatalk
[Android Apps and Games] Balino:
This is not working anymore on my pixel 4xl... It was really useful I hope it gets updated soon. Thank you for your work
[Android Apps and Games] sysFerto:
Hi, I have a rooted Motorola phone. I tried the app and put the correct switch file. But the battery keeps charging pass through the set charge percentage. What I found out is that the switch file is only on read only (-rw-r-r--) file permission and I cant edit it manually either. Should I change the file permission of the switch file? Thanks
[Android Apps and Games] MyronAz:
So far, I have been unable to get the Battery Charge Limit app to work so I'm trying to use the /sys/class/power_supply/battery/voltage_max file to limit charging. Using Root Explorer, I am mounting /sys R/W. I am then able to change the permissions of voltage_max file to rw-rw-rw- and open the file for editing. The file contains the value 4360000. I can change it in the text editor (to 4000000). Selecting save seems to work (no error is generated) but if I then reopen the file I see that the edit was NOT saved. I have no idea why my edits are not being saved or what to do about it. Any help would be greatly appreciated.
[Android Apps and Games] selfishjelly:
You can maybe try creating read only file with the new value and renaming it to replace the original
[Android Apps and Games] XtraWater:
I installed the module last night first time. It seemed to work. But now this:

I set 75% / 35%. The phone started to charging when level reached 34%. It charged to 75%. So far so good. But now, it keeps the level constantly at 75%.

Is this the way it is supposed to work? I thought it would discharge the battery to 34% again.
[Android Apps and Games] zputnyq:
Del
[Android Apps and Games] hgmichna:
No discharge

It works like that in some phones. Be happy, this behavior is the best you can wish for.

Essentially the phone runs on charger, while the battery does nothing. It is neither charged nor discharged. It just rests.

Why some phones can do this while others can't is not completely clear to me, so consider it just luck.
[Android Apps and Games] gonzo1963:
Good evening,

The app does not work ok on many smartphones.

It has not been updated since May 14, 2018.

It is totally abandoned.

Regards

Enviado desde mi unknown mediante Tapatalk
[Android Apps and Games] post-mortem:
The app also still works great on many devices, including mine (on Android 10).

Lucky me! If it doesn't work for you, I'm sorry, but you'll have to find another solution.
[Android Apps and Games] hgmichna:
Chargie

The only other solution I know that works without human supervision is Chargie. I use it successfully, since I use a phone without root.

Current price is around $10 plus shipping from Europe, so much cheaper than what I originally paid. You can order it on the https://chargie.org/ web site.

Since Chargie is not really competing with Battery Charge Limit, I think it is OK to mention it here. Battery Charge Limit is free, but works only on rooted phones, while Chargie costs money, but works on non-rooted phones.
[Android Apps and Games] MyronAz:
Thanks for your help.

It won't let me copy to or create a file in the folder. I changed the permission on the folder to rwxrwxrwx but still no go.
[Android Apps and Games] post-mortem:
It's possible that file is only for reporting, and is not intended to be read. You'll have to experiment with other files.
[Android Apps and Games] francus:
Sorry noob question. I never rooted a phone for security reasons.

Is it possible to root the phone, set charge limit, then unroot it? Will the new charge limit survive unrooting?

Best
[Android Apps and Games] hgmichna:
Root required

In normal operation the app has to change a system file whenever some charge limit is reached. So it is not possible.

Some here have attempted to modify the system charge limit, but that is something different and does not require the app.
[Android Apps and Games] amplatfus:
Hi. You need to stay rooted.

BR.
[Android Apps and Games] najmulbappy:
Nice app, thank you.
[Android Apps and Games] ziki:
That's is still a problem. I have a S7 too and I let say always use wireless charging and I can confirm that the charger does not stop to charge when the set limit is reached, the device does not send the correct signal to the charger.

Did someone find a solution for that?
[Android Apps and Games] sueccae:
Happy with it so far.

My phone does the same and I'm quite happy with it. I've known this feature from Lenovo Laptops.

In case someone in wondering:

Phone: Poco F1

crDroid 6.0 01.12.19 incl. Kernel

11.0.5.0 Firmware

Installed Magisk 20.1 just now and got the Battery Charge Limit App from the Play Store.

Limit is set to 80% with a lower of 75%.

Charged to 80% and is now just maintaining charge so not using the Battery and only powered by AC.

No issues whatsoever.
[Android Apps and Games] ahecht:
I have a Pixel 3a with Android 10, and the phone seems to be randomly rebooting (I think it happens when it reaches the charge limit while idle, but I'm not sure). I pulled the logs using adb shell cat /sys/fs/pstore/console-ramoops-0 > ramoops.txt and it appears that I am getting a kernel panic in "batterystats-wo". The messages look like:

[ 2391.184319] c7 1337 set_restart_msg: set restart msg = `KP: batterystats-wo PC:string+0x50/0x80 LR:vsnprintf+0x264/0x730'

[ 2391.184351] c7 1337 ipa ipa3_active_clients_panic_notifier:259
[ 2391.184351] c7 1337 ---- Active Clients Table ----
[ 2391.184351] c7 1337 IPA_CLIENT_APPS_WAN_CONS 16 ENDPOINT
[ 2391.184351] c7 1337 TRANSPORT_RESOURCE -16 SPECIAL
[ 2391.184351] c7 1337 TAG_PROCESS -59 SPECIAL
[ 2391.184351] c7 1337
[ 2391.184351] c7 1337 Total active clients count: 0
[ 2391.184351] c7 1337
[ 2391.184375] c7 1337 Kernel Offset: 0x14afc00000 from 0xffffff8008000000
[ 2391.184382] c7 1337 Memory Limit: none
[ 2391.212092] c7 1337 Rebooting in 5 seconds..
[ 2396.212477] c7 1337 SMP: stopping secondary CPUs
[ 2396.212505] c7 1337 Going down for restart now
[ 2396.213291] c7 1337 qcom,qpnp-power-on c440000.qcom,spmi:qcom,pm660l@2:qcom,power-on@800: PMIC@SID2: configuring PON for reset
[ 2396.214196] Causing a watchdog bite!è[  €¡
[Android Apps and Games] fmaher:
I set this app not to charge the battery over %85 and after a while I had battery memory issue. The phone went dead on %15 battery remaining! Don't really know why...

Just uninstalled this app, now everything backed to normal.
[Android Apps and Games] bertoxo:
Strange behaviors:

1- app charges fine at 81% limit on my tablet Samsung Galaxy Tab Pro 12.2"(with LineageOS 14.1) then the notification keeps still no matter if i unplug the charger.. It don't goes away.

Please any way to fix this?

Thanks.

2- with my old cellphone Moto e2015 custom Rom it goes away when unplug no problem, and charges up to the limit too ok.

But no matter if it reach the limit and in fact it autostop charging it anyways still shows the symbols like if its still charging (with the charger plugged), i mean a thunder symbol or a plus(+) on side of the percentage, you get that (surely every cell must be different..).

Anyway, i can live with this 'bug' np. :p
[Android Apps and Games] tinhsoftware:
It does not work on nexus 7 2013 magisk rooted stockrom 6.0.1
[Android Apps and Games] Zaxx32:
Been havin trouble with the charge complete notification and it occasionally charging to 100%.

Decided to try the ACC Magisk module with ACC interface apk. Very similar to BCL 1.1.1 actually except it's still under development!! So far it's been flawless! I highly recommend it over BCL. Head over to the Magisk mods section for deets and d/l of mod and manager apk.

ACC thread: https://xdaforums.com/apps/magisk/module-magic-charging-switch-cs-v2017-9-t3668427
[Android Apps and Games] yegorus:
Umidigi One Max

For Umidigi One Max with wireless charging I found that the following setting file works.

/sys/class/power_supply/wireless/charging_enabled, 1, 0

It works for wireless mode only as I see but this is Ok for me. However the application still works in an a little bit

unpredictable manner. It activates/deactivates charging when I turned on/off the function manually. However I can't

achieve this behaviour automatically yet.

Any advice?
[Android Apps and Games] post-mortem:
Did you try enabling the "Always Write CTRL File" option in the settings?
[Android Apps and Games] yegorus:
Yes, I enabled it. No difference found yet. I should observe its behaviour for more time to make conclusions.
[Android Apps and Games] a9ball:
Hello,

Just installed this and it's terrific! Works perfectly with my Poco F1.

Question: what is the preferred Max voltage that we should try to stop at? I've read some phones will display 100% but have been designed to really be at 80% to extend battery life. So if I knew the best voltage level to stop at I could use that to get the best setting in this great app.

Thanks in advance.