[APP][ROOT][4.0+]Battery Charge Limit v1.1.1

Search This thread

hgmichna

Senior Member
Aug 28, 2010
982
400
Munich
michna.com
No discharge

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.

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.
 

gonzo1963

Senior Member
Mar 25, 2013
377
41
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.
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
 
  • Like
Reactions: ganeshkulal

hgmichna

Senior Member
Aug 28, 2010
982
400
Munich
michna.com
Chargie

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.

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.
 

francus

Member
Sep 14, 2008
8
0
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
 

hgmichna

Senior Member
Aug 28, 2010
982
400
Munich
michna.com
Root required

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?

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.
 

ziki

Senior Member
Jul 15, 2005
189
10
Udine
Hello,

I'm using this app on a Samsung Galaxy S7 and it works perfectly with a wired charger. It also somewhat works with wireless QI charger - the battery isn't charged beyond the set limit, however the charger is still active, it's still trying to charge the phone, so that the phone eventually gets quite hot.

If I disable the app and let the battery charge up to 100%, the charger somehow 'knows' and changes it's status light from blue to green and stops charging, so that the phone doesn't get quite as hot.

I have no idea how this is accomplished - maybe there is some NFC communication between the phone and the charger? If so, could the app do the same to deactivate the QI charger when the set limit is reached?

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?
 
Last edited:

sueccae

Member
Mar 10, 2019
25
13
Happy with it so far.

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.

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.
 
  • Like
Reactions: a9ball

ahecht

Senior Member
Oct 23, 2010
509
304
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:

Code:
[ 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,[email protected]:qcom,[email protected]: [email protected]: configuring PON for reset
[ 2396.214196] Causing a watchdog bite!è[   €¡
 

fmaher

Senior Member
Jan 2, 2011
130
37
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.
 

bertoxo

Senior Member
Oct 23, 2014
68
4
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
 
Last edited:

Zaxx32

Senior Member
Mar 23, 2019
176
30
Morgantown
Moto G5 Plus
Moto G7
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://forum.xda-developers.com/apps/magisk/module-magic-charging-switch-cs-v2017-9-t3668427
 

yegorus

New member
Dec 22, 2019
3
0
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?
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    It does not show directly, the root is required to do this. You can also try the AIDA 64 app. It shows the value correctly on the rooted device but I don't know how the situation is on the non-rooted device.


    In my case, when the device reaches 2800 mah, the charging process stops and it shows 100% on the interface. This is actually the way it should be. Thus, the battery life of your device will be longer than normal. Now with the official version miui, I can get 5-6 hours of screen time on my 2-year-old Mi 9 device. But I want more. If I use this device for another year, it is enough for me. I don't care if the battery is dead afterwards.
    I ditch MIUI on my Xiaomi devices at the very first opportunity so I might be mistaken but I think the value being quoted by AIDA64 and many other similar apps is the ACTUAL battery capacity post degradation. For ex. in my Poco F1 around the 10 month mark the battery capacity was reduced from the original 3996mAh to 3596mAh.
    /sys/class/power_supply/battery/charge_full This is where the value is stored in my device. Third-party apps simply read this value.
    2
    I think this is not a time-based degradation. It's a voluntary thing done to extend battery life. I think the battery health of my device is extremely good. Even in the official Miui version, I can get a performance close to the performance of other users in Custom versions. At the other point, there are great reasons why I cannot give up the Miui interface. Better device compatibility than Miui launcher and Others.

    My battery should typically be 3300, but now I am getting between 2700-2800 and 5-6 hours of SOT which is not too bad for the Mi 9 device.
    Device Info HW app is a good option. Once granted root it shows both the original and current battery capacity. Accubattery as well.
    I was getting SoT ranging from 13-15 hours for the first 6-7 months but later when it fell to 12-13 hours I did a little search and stumbled upon how to derive battery capacity directly from kernel profile.
    BTW sys/class/power_supply/battery/cycle_count keeps a record of the total charge-discharge cycles undergone by the battery till date. Mine's at just under 600 currently. Isn't reset after flashing ROMs.
  • 393
    Please read the following before installing the app:
    • This app requires a rooted mobile (Android 4.0 or later)
    • Before uninstalling the app, disable limit in the app (if forgotten, reboot after uninstalling)

    Usage instructions and app details:
    • Enable limit in the app
    • Change the limit up to which it should charge (default: 80)
    • Check which control file suits best for your device, see Q/A section below for hints. In most cases, the pre-selected choice should be the best that's available for your device.
    • The app only gets kicked in while you connect a charger (or USB), and automatically closes shortly after unplugging charger (or USB) i.e it only runs in the background as long as it is plugged in, and won't affect your battery life.
    • If your device is not charging even after disabling the limit (which shouldn't happen, just in case), uninstall the app and reboot the device (The changes made by the app don't survive a reboot). Your device should charge normally then.

    If the app says "your device is not yet supported"
    There are various control files in different devices (due to OEMs), and toggling the values in them (0 and 1) makes it possible to enable and disable charging via software (might not be possible for every device), though the charging cable is still physically connected.
    Since we cannot own every device, it is impossible for us to find every file. We can support a lot more devices with information provided by testing possible files on different devices by you, the people in the community.
    Hence, for support to be provided to other devices, you need to do some detective work to find the files on the respective devices. Please refer to this file for control files of currently supported devices, so you can know where they are generally present: https://github.com/sriharshaarangi/BatteryChargeLimit/blob/master/app/src/main/res/raw/control_files.json
    You can send us a pull request or open an issue on GitHub. If necessary, you can also post the name of the device and the file here.

    FAQ
    Q) Can you please add support for... (insert arbitrary device name here)?
    A) Maybe, but we need your help. Bottom line, this app does nothing but modifying the content of a certain "control file", some more details are given above. If you find such a control file for your device, please let us know (ideally, open a GitHub issue here: https://github.com/sriharshaarangi/BatteryChargeLimit/issues) and we will add support for your device.

    Q) I think I observed a bug. Can you fix it?
    A) We'll do our best, but we need your help: Please open an issue on GitHub (https://github.com/sriharshaarangi/BatteryChargeLimit/issues) and provide as much information as possible about the problem.
    In most cases, we need the "logcat" logs of your device to find out about the exact issue. In order to provide those, you could use aLogcat (https://play.google.com/store/apps/details?id=rs.pedjaapps.alogcatroot.app).
    FOR CHARGING-RELATED ISSUES: Select the "Time" format in the preferences of aLogcat, so we can see precise timings, and filter for "(Charging|Power) State" with "Apply as regular expression" ticked.
    FOR CRASHES: Please also select the "Time" format and provide unfiltered logcat data that includes the stack trace of the crash.

    Q) Why do you want to limit charge to a lower capacity?
    A) In short, to prolong battery life in long term usage. For more information, refer this : http://batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries

    Q) How does this app work? Does it modify something in the ROM/Kernel to stop charging?
    A) It writes "0" or "1" to a control file that represents some state of the power supply hardware, as simple as that. The file is normally read-only, so you need root to overwrite it.
    The change might be automatically reversed by the OS if the power supply situation changes. Anyway, it should never survive a reboot of the device.

    Q) I can select multiple more than one control file in the radio group. Which one should I use?
    A) For most devices, battery_charging_enabled or store_mode are preferable. Try those first and see if it works. If you observe any bugs, try another file.

    Q) I have a OnePlus device, and the app doesn't work correctly for me. What to do?
    A) Check that the control file you selected is NOT battery_charging_enabled! Although it should be preferred in general, there are known issues for this file with OnePlus devices.

    Q) I use the store_mode on a Samsung device. My device always stops charging at 70 % (or other specific percentage), no matter what limit I have set.
    A) The store_mode implementation differs among the supported (Samsung) devices.
    Normally, it freezes the level at the current percentage when store_mode is triggered until the cable is unplugged for some seconds. This is a normal condition due to Samsung's kernel implementation, it's not a bug of this app.
    If this is a problem for you, try to switch to another control file (e.g. batt_slate_mode), if supported.

    Q) How does the "automatic stats reset" work?
    A) The automatic reset should perform a stats reset when your power supply is removed while the battery level is within the desired range. Everything else is wrong behavior.

    Q) No matter if I the "automatic stats reset" is enabled or not, my phone is always resetting my battery statistics. Why?
    A) Are you using a threshold above 90%? If yes, your ROM will most likely clear the stats when the power is removed. There is nothing we can do about that.

    Downloads:
    The app is available on Google Play Store

    Alternate APK download links:
    v1.1.1: https://www.androidfilehost.com/?fid=674106145207486851
    v1.1.0: https://www.androidfilehost.com/?fid=817906626617956614
    v1.0.4: https://www.androidfilehost.com/?fid=889764386195927297
    v1.0.3: https://www.androidfilehost.com/?fid=745425885120755941
    v1.0.2: https://www.androidfilehost.com/?fid=889764386195923345
    v1.0.1: https://www.androidfilehost.com/?fid=889764386195919111
    v1.0.0: https://www.androidfilehost.com/?fid=817550096634789023
    v0.11.0: https://www.androidfilehost.com/?fid=961840155545580765
    v0.10.0: https://www.androidfilehost.com/?fid=961840155545576298
    v0.9.2: https://www.androidfilehost.com/?fid=457095661767160082
    v0.8.2: https://www.androidfilehost.com/?fid=673368273298951679

    Please uninstall versions < 0.8 before installing this!

    Changelog:

    1.1.1:
    • Fix charging status layout issues and misc UI fixes @xdnax
    • Added switch to disable toasts on service changes @xdnax
    • Added switch to show temperature in notification @xdnax
    • Ensuring write permissions on the charging control file @real_milux
    • Fixed notification sound on limit reach @sriharshaarangi
    • Fixed a bug causing crash
    • Added Russian translation
    • Updated Bengali, German and Brazilian Portuguese translations
    • Added control file for Amazon Tate (LineageOS 14.1)

    1.1.0:
    • UI & icon redesign @xdnax
    • Custom control file data support @xdnax
    • Improved control file lists @real_milux
    • ICS (Android 4.0, API 14) compatibility @real_milux
    • Pixel/Pixel 2 support fixes @xdnax
    • Added control files for Pixel/Pixel 2, Xiaomi Redmi Note 2, Sony XPERIA Mini, Le 1s, Huawei P10 lite, HTC One, Motorola Defy+, Xiaomi Mi A1
    • Bengali translation @AdroitAdorKhan
    • Spanish translation @Joseahfer
    • Lots of bugfixes and minor improvements

    1.0.4:
    • New "always write" setting for devices that modify their control files in a problematic way
    • Experimental support for Xiaomi MiPad 2, Nexus 5, Nexus 9, Galaxy Nexus (maguro) and Xiaomi Mi6

    1.0.3:
    • Fixed service starting after boot when disabled

    1.0.2:
    • Fixed ignoring "ACTION_POWER_CONNECTED" when service was disabled
    • Experimental support for Nexus 10, Nvidia Shield and Xiaomi Mi6

    1.0.1:
    • Added preference to disable limit enforcement aka "state fixing"
    • Added expert preference to enable immediate reaction to power state events (be careful!)

    1.0.0:
    • Tested Magisk 13.x support
    • Improved UI
    • Even higher service priority (against being killed by Android)
    • Online limit change support (limit changeable while service is active)
    • Settings with control file selection and temperature scale
    • Fahrenheit temperature info support
    • Greatly improved "state fixing" with exponentially increasing delay (hopefully fixing GitHub issue #15 aka "rapid cycling")
    • Greatly improved SU shell speed/performance
    • German translation

    0.11.0:
    • Improved UI (Using NumberPickers, GitHub issue #13)
    • Show voltage and temperature in app and notification (GitHub issue #14)

    0.10.0:
    • The recharge threshold can now be customized between 0 and the chosen charging limit
    • Sending a charging limit of 100 via (broadcast) intent will disable the service.
    • Sending values between 40 and 99 will enable and start the service if it was previously disabled.

    0.9.2:
    • Fixed crash on some devices that are unrooted or unsupported

    0.9.1:
    • Fixed widget not showing in some devices

    0.9:
    • Added Widget to toggle service
    • Added scrollable view

    0.8.2:
    • experimental Amazon Fire support

    0.8.1:
    • Bugfixes

    0.8:
    • State check after boot (starting monitoring service as necessary)
    • Bugfixes

    0.7:
    • Experimental support for Huawei and Nexus 4 devices
    • Support for external control over charging limit
    • Bug fixes

    0.5
    • Ability to select recharge limit (Range: 10%)
    • Automatic file selection
    • Added store_mode for Samsung devices
    • Added option to auto reset stats
    • (Huge code refactoring)

    0.3
    • Updated to support 7.1.1
    • Auto-select the battery charging file for Samsung, Pixel and Nexus devices
    • Added clear battery stats button
    • Auto-whitelisting from Doze mode

    XDA:DevDB Information
    Battery Charge Limit, App for all devices (see above for details)

    Contributors
    harsha1397, real_milux
    Source Code: https://github.com/sriharshaarangi/BatteryChargeLimit


    Version Information
    Status: Stable
    Current Stable Version: 1.1.1
    Stable Release Date: 2018-10-17
    Current Beta Version: 1.0.4
    Beta Release Date: 2017-09-04

    Created 2017-02-15
    Last Updated 2020-08-05
    57
    Todo:
    - Check for charging on device boot
    - Widget for quick toggle
    - Widget to reset batterystats
    - Limit reached alert
    - Low battery alert - Needs a service running in the background
    - UI overhaul
    - on/off switch to enable/disable charging
    38
    Announcement: Official Version 1.1.0, welcome @xdnax!

    Hello everybody,

    it has been quite a while since I wrote my last post here. The reason for this is rather simple:
    Apart from being very busy in the last months, I realized some time ago that I was investing more time in reading and answering posts in this thread than doing actual implementation work for BCL, which is definitely not my intended workflow.
    Therefore, I shifted my attention completely to GitHub, where the workflow was/is much more efficient.
    Some people here suggested to officially fork this project and continue it elsewhere. I want to say the following to those people:
    While it is in general a good thing that dead projects are forked and continued, good behavior demands to first open a GitHub issue asking whether the project is to be continued before suggesting an official fork, which did afaik not happen.
    Furthermore, a simple look at GitHub would have clearly revealed at all times that I was reacting to issues there on a regular basis, so our project was hardly inactive, and surely not dead!
    Luckily, @xdnax was considerate and smart enough to keep mentioning that he wants to respect our work and keep his fork unofficial for the moment, which deserves a huge THANK YOU from my side!

    Talking about @xdnax:
    He did a great job in contributing to the development of this app during the last months.
    Unfortunately, I didn't have his contributions on my radar for quite a while.
    Since we love to work with other motivated and decent developers like him, we are happy to announce that he is now the third "official developmer" of BCL.
    Welcome to the team, @xdnax!

    Some people noticed the appearance of a semi-official version 1.0.5.
    Although I never had time to publish an official build, I indeed created this version and uploaded it with a "v1.0.5" tag to our GitHub repo.
    This is where the F-Droid build system picked it up and created an APK from it, which I myself wasn't aware of for some while. Sorry for the confusion guys...

    During the last days, we organized our internal communication and unified our contributions to bring out a new official version.
    Well, here we go: I'm happy to announce that we finally release version 1.1.0!
    Link: https://www.androidfilehost.com/?fid=817906626617956614
    Please don't get confused about the numbering: This release includes all improvements of @xdnax and more, and is not a major version step because it doesn't introduce any breaking behavior changes.
    Happy charging, opening post will be updated soon!

    Changelog:
    • UI & icon redesign @xdnax
    • Custom control file data support @xdnax
    • Improved control file lists @real_milux
    • ICS (Android 4.0, API 14) compatibility @real_milux
    • Pixel/Pixel 2 support fixes @xdnax
    • Added control files for Pixel/Pixel 2, Xiaomi Redmi Note 2, Sony XPERIA Mini, Le 1s, Huawei P10 lite, HTC One, Motorola Defy+, Xiaomi Mi A1
    • Bengali translation @AdroitAdorKhan
    • Lots of bugfixes and minor improvements
    22
    Source code: https://github.com/sriharshaarangi/BatteryChargeLimit
    App v0.3: https://www.androidfilehost.com/?fid=745425885120716170
    Changelog:
    - Updated to support 7.1.1
    - Auto-select the battery charging file for Samsung, Pixel and Newus devices
    - Added clear battery stats button
    - Auto-whitelisting from doze
    19
    Update to version 1.1.1

    This is mainly a bug fixing update, with loads of improvements. Should reduce crashes as well.
    Download link: https://www.androidfilehost.com/?fid=674106145207486851
    The update will be available on Play Store soon[UPDATE: Now available]
    Changelog:
    • Fix charging status layout issues and misc UI fixes @xdnax
    • Added (i) Switch to disable toasts on service changes (ii)Add switch to show temp. in notification @xdnax
    • Ensuring write permissions on the charging control file @real_milux
    • Fixed notification sound on limit reach @sriharshaarangi
    • Fixed a bug causing crash
    • Added Russian translation
    • Updated Bengali, German and Brazilian Portuguese translations
    • Added control file for Amazon Tate
    • Other minor fixes
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone