- This app requires a rooted mobile (Android 4.4 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/B...rol_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.
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/B...geLimit/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/B...geLimit/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/d...logcatroot.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/a...ased_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 (3/3T) device, and the app doesn't work correctly for me on OxygenOS. 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.
Please uninstall versions < 0.8 before installing this!
- 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
- Fixed service starting after boot when disabled
- Fixed ignoring "ACTION_POWER_CONNECTED" when service was disabled
- Experimental support for Nexus 10, Nvidia Shield and Xiaomi Mi6
- Added preference to disable limit enforcement aka "state fixing"
- Added expert preference to enable immediate reaction to power state events (be careful!)
- 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
- Improved UI (Using NumberPickers, GitHub issue #13)
- Show voltage and temperature in app and notification (GitHub issue #14)
- 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.
- Fixed crash on some devices that are unrooted or unsupported
- Fixed widget not showing in some devices
- Added Widget to toggle service
- Added scrollable view
- experimental Amazon Fire support
- State check after boot (starting monitoring service as necessary)
- Experimental support for Huawei and Nexus 4 devices
- Support for external control over charging limit
- Bug fixes
- 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)
- 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
Battery Charge Limit, App for all devices (see above for details)
Source Code: https://github.com/sriharshaarangi/BatteryChargeLimit
Current Beta Version: 1.0.4
Beta Release Date: 2017-09-04
Last Updated 2017-09-04