yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] GalaxyA325G:
I found this thread trying to help answer an unanswered question just now (which I try to do at least once a day to be nice to others).

Battery Charge Limit APK

And I just wanted to say, so that others can benefit, is that if you're NOT rooted, and if you're on Android 12, there seems to now be a native battery charge limit setting of 85% which is off by default.
[Android Apps and Games] GalaxyA325G:
I see multiple people have answered this query, where I have researched the answer in the past and while I tried about a dozen apps, I settled on ones that speak to me the percentage (which is useful when I'm in the car or I'm not looking at the device constantly).

Some screenshots are below of what I've set up on my unrooted Samsung after testing every well rated similar app.

Charging Indicator, by Jason A. Maderski​
[Android Apps and Games] pawlik79:
I have found control file for pixel 5a /sys/class/power_supply/sm7250_bms/charge_disable. You can install termux apk and run command

su
echo 80 >
/sys/class/power_supply/sm7250_bms/charge_disable

It does same thing. I've tried with command and it's works well.
[Android Apps and Games] Lada333:
I used to use AccA as well, but it has been bugging out on me lately. I've switched to Acc Settings. It's got a more barebones UI, but it's never failed on me yet.
[Android Apps and Games] Zaxx32:
Good find...will check it out. Still pre-release so it'll keep improving I'm sure. ;)
[Android Apps and Games] hamidv2:
Does anyone know the configuration file for the Redmi Note 11 Global version ?

Thanks
[Android Apps and Games] diorlee90:
try this
[Android Apps and Games] hamidv2:
Doesn't work for me
[Android Apps and Games] diorlee90:
find input_suspend file location by yourself
[Android Apps and Games] Marky__Mark:
What are the enable/disable values? 0/1?
[Android Apps and Games] immerzu2:
Hello, I haven't read everything here, but is there a solution for this xiaomi12?

Thanks.
[Android Apps and Games] pawlik79:
View attachment 5680977
[Android Apps and Games] Marky__Mark:
Thank you!
[Android Apps and Games] Marky__Mark:
For some reason this doesn't work for me. Do i need to turn off adaptive charging?
[Android Apps and Games] pawlik79:
Are you

No, you don't have to turn off adaptive charging. What phone are you using?Are you rooted? Install root explorer and see if you have actual file in the path.
[Android Apps and Games] Marky__Mark:
Pixel 5a. Its brand new. Its rooted. That file is in there and the file doesn't have any 0 or 1 values in it.

It says null (ignoring). Then it says, "cat: /sys/class/power_supply/sm7250_bms: is a directory.

This is an unlocked phone that I bought from the Google outlet.
[Android Apps and Games] pawlik79:
I have exact same unlocked phone bought right from Google but mine has Pixel experience Rom with custom kernel (I don't know if that matter). Values of that file can be only changed from Battery Charge Limit app. It should work after you set right control file. I took a screenshots with my settings.
[Android Apps and Games] pawlik79:
View attachment 5682245View attachment 5682247
[Android Apps and Games] Marky__Mark:
Thanks. This seems to have worked. I didn't add charge_disable to the path.
[Android Apps and Games] Mitezuss:
Any know the path for motorola g51 ?
[Android Apps and Games] endofwed:
Working on a project with an old android. This device will stay plugged in and have the screen on 24/7.

Does anyone have recommendations for what numbers I should set for "limit charging" and "recharge below"?
[Android Apps and Games] Paresh Kalinani:
Go with limit charging as 80 , recharge below 25
[Android Apps and Games] Paresh Kalinani:
Anyone got a problem with battery stats after using this app for years?

I use OnePlus 6T and it stays at 1% for more than two hours now. The phone basically never shows me how charged it is and the battery always has much more juice remaining than what shows up on the screen. Suggestions?
[Android Apps and Games] kos25k:
Hello.I have a Poco X3 Pro with los 19.1 how to get this work please?Which file to edit? 🤔
[Android Apps and Games] stephendt0:
IMO this is bad advice. I personally would recommend charging between 60-70%. The battery really shouldn't be dipping below 40% to start with, and then you should consider that your battery will degrade eventually and start shutting off on its own, usually around 50% charge. 60-70% will give you the best longevity for 24/7 use. 40-50% will give the best longevity overall, but you will need to increase this to 60-70%, or higher, at a later date once the battery degrades.
[Android Apps and Games] adek89:
can i use it somehow via adb?
[Android Apps and Games] I<Aow:
It's always better to keep the battery at low SOC with respect to U_min and the mismatch of SOC and voltage over lifetime. Furthermore it's useful to do small SOC changes only . But a) the positive effect of lifetime is not linear. You get the most profit if you not cross ~70% SOC. b) For a regular user it's not an option to recharge after only 10% discharge or less in order to keep the battery between 15 and 25% SOC for example.
[Android Apps and Games] mythos_:
He was answering for a very specific use case. For that case his advice is pretty reasonable.
[Android Apps and Games] SonicGold:
/sys/class/qcom-battery/input_suspend set to 0 (off, so "Enabled Value" in BCL) or 1 (on, "Disabled Value" in BCL) does work on Xiaomi 12 (rooted on LOS 19.1), thanks for the video ! 👌

View attachment 5727839

Also a few more settings to make it work properly :

View attachment 5849429
[Android Apps and Games] denyo81:
Hey guys after a long search I found a working alternative for battery charge limit. Works perfectly on my Galaxy S8. I hope you too...

Charge Control [ROOT] – Apps bei Google Play

This app helps you stop device charging at desired level.

www.google.de
[Android Apps and Games] wilberfan:
Oh, man, you had me goin' there for a second.

Didn't work on my Pixel 7 Pro. 😞
[Android Apps and Games] dangercl0se:
Same
[Android Apps and Games] smokinu:
Is there a quick tutorial on how to locate and edit the control file? I have a Pixel 7 Pro and would be willing to try and find the control file so I can limit the charge.
[Android Apps and Games] woody4165:
Hi all

Any support for Xiaomi Redmi Note 10 Pro with MIUI 13?

Thanks
[Android Apps and Games] deechte:
BCL stopped working on my Oneplus 7T Pro after I updated it to Android 12. I struggled for a while but finally found the new file that works. Here's my working config:

View attachment 5756377
[Android Apps and Games] mythos_:
On the Oneplus Nord mmi_charging_enable doesn't exist. I've tried all likely files in that folder but nothing works. Everything was ok in OOS 10 but something changed with 12 and I haven't found a solution yet. Is there any other folder that might be worth investigating?
[Android Apps and Games] deechte:
In my case there are many folders in that tree, like USB, AC, wireless, etc. You could check them out. But it can be like searching for a needle in a haystack. Look for any file whose contents change when connecting a charger. Or do a file search for *enabled* or any other part of filename people have reported in this thread.
[Android Apps and Games] mythos_:
I spent a lot of time trying out several files in the battery folder and subfolders but nothing worked. Some files had names that seemed relevant and they even changed value during charging but I couldn't stop charging with them. Input_suspend is a weird case. With 1,0 the phone doesn't charge at all but with 0,1 it never stops charging.

I finally got the idea to search for mmi_charging_enable under the sys folder. I thought since it's the same OS it could exist somewhere. Turns out it does exist in /sys/devices/virtual/oplus_chg/battery and with that I was finally able to make the phone stop charging.
[Android Apps and Games] mobilityguy:
Sorry if this is a double post, I searched and didn't find any relevant posts in this thread.

I just upgraded a OnePlus 7 Pro from Lineage 18.1 to Lineage 19.1, and Battery Charge Limit stopped working. It reports it has reached its limit, but it doesn't stop charging. I know this is caused by the software looking for the wrong control file, but it worked fine in 18.1 so the control file has apparently changed. Can anyone tell me what the correct control file and values are for this phone and OS? Thanks in advance.
[Android Apps and Games] mobilityguy:
Do you expect this will also work for the 7 Pro?
[Android Apps and Games] deechte:
I don't know, try it. I'm not on LOS but on OOS.
[Android Apps and Games] mobilityguy:
I tried it on one phone. It works but differently. In LOS 18.1, charging cut off when the upper limit was reached and the phone started to drain even though it was still plugged in. In LOS 19.1 with this setting, the upper limit is maintained as long as the phone is getting power. I'm not sure this is a good thing in terms of battery wear. It could be trickle charging or it could be shutting off charging and immediately restarting it when the phone drops below the upper limit. I'm not sure this phone supports trickle charging. I'm trying to monitor the contents of the status file in Termux when the charge level is reached but I can't see it constantly.
[Android Apps and Games] mobilityguy:
tl;dr: this is not the correct configuration for the OnePlus 7 Pro, and probably not for the 7T Pro either.

I'm reporting this from a 7 Pro, not a 7T pro, but it's likely this problem exists on both phones.

I installed this config on my OnePlus 7 Pro and monitored the value in mmi_charging_enable, and found these issues:

1. Battery Charge Limit does not set the disabled value in mmi_charging_enable unless the battery level is at exactly the upper limit set by the user. Further, as soon as the battery level drops below that level, it resets the file to the enabled value, which recharges the battery, presumably at full current.

2. The lower limit set by the user is completely ignored - if I plug the phone in and the battery level is 1% under my upper limit, the phone will charge.

This sets up the undesirable situation that the phone will maintain the battery at the upper limit set by the user - not by trickle charging, but by alternating between full charging and draining until the phone is unplugged. I have to think that this will create undue wear on the battery.

For now I'm assuming that this situation is still better than letting the battery charge to 100%, but I'm very careful about unplugging the phone as soon as it reaches my maximum. Long story short, this is not the correct configuration for Battery Charge Limit for the OP7P and may cause excessive battery wear, so I'm still looking.

I have tried this configuration in the Charge Control app, with the same result, so the problem is almost certainly that this is the wrong configuration, not any fault of the OS.
[Android Apps and Games] deechte:
No, it works perfectly on my 7T Pro with stock software. Maybe your situation is different because you use a custom ROM. A bit strange to presume that I am wrong while I hold the proof in my hand and you yourself are on custom ROM, don't you think?
[Android Apps and Games] mobilityguy:
Sorry, I wasn't implying that. It makes sense that stock software would behave differently than a custom ROM; my bad.

Still looking for a solution for Lineage on the OP7P.
[Android Apps and Games] mobilityguy:
I'm making slow progress on getting BCL to work with LineageOS 19.1 on the OnePlus 7 Pro. It's astounding how every phone and ROM seems to track the charge status in a different file. I was having some success with deechte's file, /sys/class/power_supply/battery/mmi_charging_enable, but found that on my phone there was significant delay between a charging event and the file being updated. Looking through the /sys directory I found another instance of mmi_charging_enable that updated instantly when the cable was plugged or unplugged, or the battery level reached its charge limit. That instance is here:

/sys/devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-02/c440000.qcom,spmi:qcom,pm8150b@2:qcom,qpnp-smb5/power_supply/battery/mmi_charging_enable

After that file is updated, there is a delay of up to a few minutes before the copy in /sys/class/power_supply/battery/ is updated, but once it is, it has the same time stamp as the one in /sys/devices/ which reflects the actual time the event happened.

My original thought that the file is updated as soon as the battery drops 1% below the specified charge level appears to be wrong. The time stamp would be updated if that happened, and it seems to keep its time stamp until the next time a charge cable is plugged or unplugged.

This still doesn't seem to do anything about the phone maintaining the maximum battery level set in BCL, but at least now for me it's doing whatever it's doing with no delay.

I'm no better off than I was before, but at least I'm no better off sooner. ;)
[Android Apps and Games] Krzeszny:
IMO your advice is bad. What is your opinion based on? Why are you recommending charging between 60%-70% SoC and not discharging below 40%, assuming generic states of charge/voltages? Also, do you realize that different devices have different charging curves, so SoC is meaningless? Samsung charges to 100% SoC at 4.35 V, some others charge to 100% SoC at 4.2 V or less. What we should care about is the voltage.

TBH, I don't understand your 15%-25% example but despite that, SoC is still meaningless. What voltage is 70% SoC? For each device it's a different voltage (much higher for Samsung's 3.85 V super-short-lived batteries), and I think we can all agree that it's high voltage that damages lithium-ion batteries the most.

According to AccuBattery's research, 3.94 V is the point below which it's not worth limiting charging. In other words, charge to not less than 3.94 V, not some arbitrary percentage (which is somewhere between 60% and 90%.) We should see what SoC our own devices show at 3.94 V if we want to extend battery life to the maximum.

Another interesting fact is that it's not charging at a high voltage that stresses batteries so much, it's keeping them at a high voltage (especially overnight). If you fully charge a battery and immediately drain it to below 4 V, it's not so bad for the battery (as several other users have mentioned.)
[Android Apps and Games] Donzi84:
Hi

can I contact UpInTheAir in this site?
[Android Apps and Games] deechte:
I have now moved on to a custom ROM (Pixel Experience Android 13) on my Oneplus 7T Pro. This configuration still works though!
[Android Apps and Games] mythos_:
What I've noticed is that although I have set the limits to 80% stop, 70% start, if I leave the phone on the charger all night it stays at 80%. Seems it's micro-charged constantly.

Accubattery shows the phone as charging while the charger is connected even though the current is 0 when it reaches 80%. This wasn't the behaviour of OOS 10 which showed that charging had stopped when it reached 80% and the phone would discharge normally during the night.

Is that the same with the 7T?
[Android Apps and Games] deechte:
Yes I have the same behavior on 7T Pro.
[Android Apps and Games] mythos_:
Better than nothing I suppose...
[Android Apps and Games] computer_user:
Thank you both for your work on this and posting it here. I was able to get it to work!
[Android Apps and Games] rodken:
Incidentally, what you have posted is actually the default setting for most devices.
[Android Apps and Games] deechte:
Maybe, but it wasn't on my device before Android 12. And it wasn't among the default options in BCL.
[Android Apps and Games] Feenix0:
I tried this with my OP 7T. No luck so far.
[Android Apps and Games] Feenix0:
Apparently there isn't much interest in maintaining this app any longer, so I've moved on. AccA is a suitable replacement, and appears to be active. I had to flash the acc zip through Magisk before the AccA app actually worked, so bear that in mind.
[Android Apps and Games] bizkit_120:
Is acc works for you? Is your 7T runs on custom ROM or stock one? I tried all the tricks on the book with my OnePlus 9 stock oos13, no dice.. it keeps charging over the threshold limit...
[Android Apps and Games] j8048188:
I've been super happy with this app for years on my Pixel 4XL but I recently upgraded to a Pixel 7 Pro.

After a bunch of digging and reading, I was able to get this app working with my Pixel 7 Pro / Cheetah.

(This will also work with the Pixel 7 / Panther, Pixel 6 Pro / Raven, and Pixel 6 / Oriole. I'm also expecting it'll work with the Pixel 6a / Bluejay.)

The Pixel 7 uses a different method of controlling charge state, with the file containing the battery % the charge should run to and stop at.

Instead of a binary, I set the Enable value to 100. I set the Disable value to 10 for my own peace of mind, but it could be set as low at 1.

Control file is at /sys/devices/platform/google,charger/charge_stop_level

These values work for both wired and wireless charging.

Cheers!
[Android Apps and Games] blueberry.sky:
Thank you.

/sys/devices/virtual/oplus_chg/battery/mmi_charging_enable looks to be working for the OnePlus Nord n200 running lineage 19.1 (Android 12L). 1 for enable, 0 for disable.

For some reason the "BatteryChargeLimiter" fork by MuntashirAkon crashes on the n200 when trying to enable but the the original BatteryChargeLimit app works.

„Battery Charge Limiter (BCL)“ – IzzyOnDroid F-Droid Repository

Control when to start and stop charging your battery

apt.izzysoft.de
[Android Apps and Games] ashok:
not working anymore in Oneplus OOS13. Any work around or other app?
[Android Apps and Games] blueberry.sky:
Which phone?

Have you tired /sys/devices/virtual/oplus_chg/battery/mmi_charging_enable and /sys/class/power_supply/battery/mmi_charging_enable ?
[Android Apps and Games] ashok:
Adding the config file seems to work. But the phone keeps vibrating intermittently. Why is that?
[Android Apps and Games] deechte:
I've solved the intermittent vibrating by setting BCL's notification to silent.
[Android Apps and Games] krzbor:
I have my Galaxy Tab 2 connected to power all the time. Charging is cut off for a short while and resumed when the PIR sensor detects movement. This operation causes the screen to light up. This works very well, but after a few years of fully charging the battery in the tablet swelled up and I had to replace it. I installed ROOT and uploaded BatteryChargeLimit to save battery. In general, it works very well (guards the limits), unfortunately, the key functionality for me does not work - momentary disconnection of charging and its restoration does not wake up the tablet. Is it possible to add this functionality? So, regardless of the charge level, if the tablet detects the connection of the charger, the screen simply lights up.
[Android Apps and Games] xdagee:
Can we get an updated version of this app, and can anyone confirm it works on the P7 running A13?
[Android Apps and Games] blueberry.sky:
There is a fork that is somewhat newer

„Battery Charge Limiter (BCL)“ – IzzyOnDroid F-Droid Repository

Control when to start and stop charging your battery

apt.izzysoft.de

But if the default control file doesn't work, you need to search the thread to see if anyone posted one for your device. Many devices from the same manufacturer seem to share the same control file, so you may find it if you search for the manufacturer. If the default doesn't work and nobody posted one then you'd need to find your control file yourself.
[Android Apps and Games] xdagee:
thanks, where can i find the control file myself? and there any alternatives to this particular one or a fork?
[Android Apps and Games] blueberry.sky:
Finding a new control file:

The built-in control files provide examples of places to look. https://github.com/MuntashirAkon/Ba...aster/app/src/main/res/raw/control_files.json

You can check potential control files by using a terminal app like Termux. You need to be rooted.

su

cat /sys/class/power_supply/battery/battery_charging_enabled

Will show you the file's current contents. A potentially usable control file will change when the device is charging. You can see example values in control_files.json. Usually "1"/"0", "Charging"/"Discharging", or "enabled"/"disabled".

su (if you haven't already)

echo "0" > /sys/class/power_supply/battery/battery_charging_enabled

Will let you test a file. You can use any current monitoring app (like Ampere) is see if its had an effect, since it might still look like it's charging in normal system notifications.

If a file doesn't work to disable charging it's best to return it to the state you found it in with echo. A reboot also resets most things.

Of course, if you find a new control file, please post it in the thread here for others.

Full manufacturer, name / model, android version is best to allow others to find it. E.g. OnePlus Nord n200 running lineage 19.1 (Android 12L) control file: /sys/devices/virtual/oplus_chg/battery/mmi_charging_enable 1 for enable, 0 for disable.
[Android Apps and Games] xdagee:
doesn't work for the Pixel 7 on Android 13. Feb Security Patch. The app force closes when tried enabling settings.
[Android Apps and Games] blueberry.sky:
Which app? Battery Charge Limit, the Battery Charge Limiter fork, or Termux?

The post you quoted was about using a terminal app to manually test a control file.

You have a Google Pixel 7? Thought "P7" was something else. Did the control file posted in the thread for the Pixel 7 Pro not work?

And it sounds like the Battery Charge Limiter apps might not even be strictly needed. You might be able to just set the file to your desired limit with tasker, some automation app (like automate) or even just via terminal.
[Android Apps and Games] xdagee:
the Battery Charge Limiter fork,
[Android Apps and Games] blueberry.sky:
The Battery Charge Limiter fork crashes for me too when enabling settings (on OnePlus nord n200 android 12L). But the original Battery Charge Limit app works for me, provided you give it the right control file.

Try the original app with the control file for the Pixel 7 Pro. He said it works for the Pixel 7 too. As well as a bunch of other Pixels.
[Android Apps and Games] xdagee:
alright, so i will try with the original app,
[Android Apps and Games] j8048188:
I just use the original app and it doesn't crash after the correct config is set up.

If you're looking for more features that let you set charge temp or current limits, or if you want an app to help find the correct control file, check out ACC Settings.
[Android Apps and Games] auto-matic:
I want to use Battery Charge Limit to improve battery life. This app does a great job in turning off or on the recharge process based on battery level.

Regrettably, when the charge process has been stopped, the device does not go into deep sleep (or idle mode) as I would expect.

The screen remains off, but Android battery stats screen shows that the device is actually still awake all the time the USB is plugged.

In order to go deep-sleep I have to manually unplug the USB cable.

Does anybody know how it would be possible to have the battery charge process stopped and device go into idle mode?

I'm using Samsung Core Prime with Android 6
[Android Apps and Games] baggino:
Unfortunately on little f4 does not work
[Android Apps and Games] Droid_Nut:
I tested, this works on the Pixel 4 just as well. But is kind of flaky, saying 4 hrs left on rapid charging at 80%?

Edit, this setting is wonky, works, and then don't.
[Android Apps and Games] blueberry.sky:
But does it continue to charge above your limit?

Android thinking that there is x hours left to charge is just how android behaves on my devices too. It doesn't seem like android was given logic to understand a case like this, where charging has been stopped but usb is still connected.
[Android Apps and Games] Droid_Nut:
Yes it is flaky, going to try the one that works on a 4A.
[Android Apps and Games] Droid_Nut:
Trying this on my Pixel 4.....