yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] real_milux:
Beta 0.11.0 released

Improved UI (Using NumberPickers, GitHub issue #13)

Show voltage and temperature in app and notification (GitHub issue #14)

---------- Post added at 03:42 PM ---------- Previous post was at 03:26 PM ----------

The store_mode implementation differs among the supported (Samsung) devices.

My Note 10.1 2014 (Android 5.1.1) freezes the level at the current percentage when store_mode is triggered until I unplug the cable and plug it in again.

This is a normal condition due to Samsung's implementation, it's not a bug.

Will add this to the FAQ section...

---------- Post added at 04:26 PM ---------- Previous post was at 04:08 PM ----------

Basically, I also tried to solve such issues by using delays. Not minutes, but 0.5 and 5 seconds for charging changes and power state changes, respectively.

For some users, however, this produces other annoying side-effects.

I would really love to fix this stupid issue once and for all, but as you mentioned... it's not that easy indeed...

If you can provide me logcat data of this issue, I might be able to understand what's going wrong on your device. That might help a lot.

---------- Post added at 04:35 PM ---------- Previous post was at 04:26 PM ----------

Please read the opening thread, especially the stuff directly above and at the beginning of the FAQ section.
[Android Apps and Games] XxFireDragonxX:
Thank you for your reply.

But in the FAQ the link to the examples of the control files is damaged.
[Android Apps and Games] Roberto_Sampaio:
Automatic stats reset stop working in my 3T with the new beta 0.11.0 .

Returned to beta 0.10.0.
[Android Apps and Games] sprocketgearzz:
Thanks it works for me (idol 3) , Beta 0.10
[Android Apps and Games] hgmichna:
Rapid charge-discharge cycle

I have had it again this morning. Settings are, stop charging at 60%, resume charging at 10% less, i.e. 50%. I chose the large distance to see whether it helps, but it didn't.

The phone was at 100%, charging for 5 seconds, then discharging for 5 seconds, and so on. The charging light went on and off, and for each change there was a toast about the service being activated or deactivated.

I pulled up the old Andy Log tool to get the logs, but unfortunately Andy Log always instantly crashed when I tried to start it.

Unfortunately I have no other simple method to get at the logs, I don't even know which ones you need, so no logs this time. Sorry.
[Android Apps and Games] real_milux:
Since yesterday the FAQ section contains detailed information about a good method to collect helpful log information.

I will try to figure it out based on your description, but without detailed timestamps and information about the event order, the chances are not that good.

---------- Post added at 06:26 PM ---------- Previous post was at 06:24 PM ----------

Logcat stuff would be useful...

---------- Post added at 06:35 PM ---------- Previous post was at 06:26 PM ----------

Information regarding this was fixed/updated.
[Android Apps and Games] eried1:
Some have reported it working when executing the command via adb, but automation doesn't seem possible at this point.
[Android Apps and Games] hgmichna:
Rapid charge-discharge cycle

I have had the rapid charge-discharge cycle again and managed to take a log snapshot (see attached file, 9 KB).

Another observation is that it seems to happen at night, when I charge with a charging current in the 1 A to 1.5 A range for several hours non-stop, but never during the day, when I occasionally charge with a 500 mA current over a thin USB cable.
[Android Apps and Games] phantom146:
[MENTION=6898873]sriharshaarangi[/MENTION], need some icon for this baby? :)
[Android Apps and Games] Midomad:
A circular icon would be neat.
[Android Apps and Games] hgmichna:
Rapid charge-discharge cycle

Here's another short log excerpt. The phone was set to charge to 60%. The log was taken just after reaching 60% and going into the dreaded charge-discharge cycle.

07-12 22:36:19.172 D/Charging State( 5523): CHARGE_STOP 86957393

07-12 22:36:25.296 D/Power State( 5523): ACTION_POWER_DISCONNECTED

07-12 22:36:31.855 D/Power State( 5523): ACTION_POWER_CONNECTED

07-12 22:36:32.525 D/Charging State( 5523): CHARGE_STOP 148825481

07-12 22:36:37.156 D/Power State( 5523): ACTION_POWER_DISCONNECTED

07-12 22:36:43.224 D/Power State( 5523): ACTION_POWER_CONNECTED

07-12 22:36:43.789 D/Charging State( 5523): CHARGE_STOP 159305882

07-12 22:36:49.192 D/Power State( 5523): ACTION_POWER_DISCONNECTED

07-12 22:36:55.221 D/Power State( 5523): ACTION_POWER_CONNECTED

07-12 22:36:55.804 D/Charging State( 5523): CHARGE_STOP 174562215

07-12 22:37:01.207 D/Power State( 5523): ACTION_POWER_DISCONNECTED

07-12 22:37:07.288 D/Power State( 5523): ACTION_POWER_CONNECTED

07-12 22:37:07.848 D/Charging State( 5523): CHARGE_STOP 220767680

07-12 22:37:13.232 D/Power State( 5523): ACTION_POWER_DISCONNECTED

07-12 22:37:19.273 D/Power State( 5523): ACTION_POWER_CONNECTED

07-12 22:37:19.859 D/Charging State( 5523): CHARGE_STOP 268211274

07-12 22:37:25.246 D/Power State( 5523): ACTION_POWER_DISCONNECTED
[Android Apps and Games] cmglng:
When I unplug the charger while on lockscreen before the charge limit is reached, the notification dismisses itself. Then if I try to open the app it will only stay at this white screen. There's nothing much I can do about it except force closing it and reopening it again. The latest version that I've been able to use and stable enough was 0.5 after that all versions have the same behavior, even the latest one.

Device: Redmi Note 3 on Pure Nexus 7.1.2 (Unofficial)

Edit: Surprisingly, the 0.5 version has the most download counts at 6k+ on afh, and at 2nd place, it's 0.9.2 at 3.5k+. Coincidence?
[Android Apps and Games] Death I:
Doesn't always work as expected

I love the app, just what I needed, but a couple of glitches!

Nearly every time it overshoots by a few of percent. For example, it's set to 78%-80%, it charged to 85% today.

Also on quickly reconnecting the charger, it doesn't limit, goes to 100%, this also happens on regularly connecting but rarely.

Doze is disabled for it.

Running 7.1.2 on Google Pixel
[Android Apps and Games] Luftwaffe:
Samsung Galaxy Tab S2 with Lineage OS. I've been using the app for 2 weeks, works great!
[Android Apps and Games] zzzhead:
Just had similar issue, whole screen on, hit the threshold, the notification icon somehow disappeared and charging carried on. Plug and unplug and the charging stopped
[Android Apps and Games] post-mortem:
Several of us have noticed the same behavior, namely that the OS seems to sometimes kill the app, allowing the device to charge to 100%. It's unpredictable, so not reliably repeatable. Personally, by phone always charges to 100% if I leave it charged overnight, but if I'm charging it for a short time it usually works. I've even captured & posted 2 logcats of the app being killed by the OS. I think having a permanent notification (or at least the option for one) would probably prevent this issue, but I seem to be the only one.
[Android Apps and Games] Ms_Julia:
Please add in app Russian translation.
[Android Apps and Games] Death I:
Do you have Doze disabled for it? Mine charges as it's supposed to overnight aside from the occasional glitches like 1 in 10 charges. I do have notification when it's charging, or does permanent notification mean something else...?
[Android Apps and Games] zer0xploit:
First of all I want to thank the developer for this precious and very very useful app!!! :)

Next I want to ask if anyone is experiencing the same issue since newer versions: after disconnecting charger app crashes and is hung until I next time connect the charge which is then producing a force close notification.. I try to get some logs for it in a few days probably... Just wanted to ask if it might be device related (Oneplus 3T) and if anyone got the same problem or maybe even a solution for this?!

Thank you all for your help!

More details: using OOS OB10/19 with elementalx custom kernel and magisk 13.3 with included magisk su, factory reset+ clean flash did not solve problem
[Android Apps and Games] Death I:
Never had the app visibly crash...
[Android Apps and Games] hgmichna:
App crashes

Me neither.

But then, if it always crashed on every phone then the author would already have fixed it. It is typical for software defects that they do not show up everywhere all the time. Usually they appear under certain circumstances.

[MENTION=8238054]zer0xploit[/MENTION] has a quite unusual, probably very rare software constellation.
[Android Apps and Games] warface9991:
When i unplug cable from phone it doesn't go into deep sleep until I reboot it. How can I fix it
[Android Apps and Games] post-mortem:
Yes, I have disabled battery optimization for this app (and whitelisted in Greenify), but I still wake up with 100% battery, every morning. The app only limits charging when plugged in for a relatively short time.

This morning, I woke up to 100% battery, and the app notification was present (so it hadn't actually been killed). I unplugged & replugged, and the phone didn't charge. I continued to use my phone in that state for a few minutes. At 96%, the phone suddenly started charging again, while the app notification was actually still present. I unplugged & replugged, and the notification went away, and the phone started charging again.

I have not had the issue others have reported with the phone repeatedly charging & discharging every few seconds.

The app isn't reliably doing the same thing every time. I haven't been able to pin it down. I just don't get it.
[Android Apps and Games] :
This app doesn't seem to be playing nice with the newer Magisk versions. If I try to disable the limit using an intent, it disables, but opening the app gives me a white screen similar to what someone else reported. If I force close the app and open it again, the limit is re-enabled. Also, automatic battery stats reset doesn't work anymore.

However, if I roll back to Magisk version 12.0 and use Magisk Manager version 4.3.3, everything works fine-- No freezes and battery stats reset perfectly.
[Android Apps and Games] cmglng:
I'm the one who reported the white screen. Older versions of the app (I'm still using 0.5) doent have this issue even with magisk v13.3. It's the recent ones that have this freezing behavior.
[Android Apps and Games] FaserF:
The new V11 Update is great! Thanks for your work.

But on my OnePlus 3T i got a bug. First start of the App went smooth, but I am not able to open it then again, it is just white and doesnt do anything anymore.
[Android Apps and Games] Archon810:
Is it possible to have Android use USB power directly and bypass the battery altogether? Because I keep ending up with bloated batteries for stuff that's always plugged in, like https://plus.google.com/u/0/+ArtemRussakovskii/posts/R7DJse3cG1X.

Battery Charge Limit would just lets the device drain, then kick in with a recharge, so the battery would still get used a lot and potentially reach its end of life much sooner.

Thoughts [MENTION=6898873]sriharshaarangi[/MENTION]?
[Android Apps and Games] Death I:
Uhm, the device should automatically be powered from the US Bus as soon as you plug it in, and charge its battery. For it to automatically cycle the battery within a few percent indefinitely makes no sense, something's not working correctly there.
[Android Apps and Games] Archon810:
I think that's exactly what ends up happening and why I sometimes hear people suggest not to leave devices on the charger for weeks because that would cause the battery to swell up (and in my experience, it does swell up, the Nexus 9 isn't the first device to do so).

I don't know exactly what the logic is, but the battery level does drop and gets topped up all the time. The question is how often, and whether Battery Charge Limit can force the system to ignore topping it up and have USB provide all of the power. In that case, the battery itself would take weeks or months to discharge on its own, with all the power provided by USB.
[Android Apps and Games] hgmichna:
Stress from charging-discharging cycles?

It is working correctly.

Perhaps you are not aware of what makes the battery age. Li-ion batteries hardly age from being charged or discharged. They age rapidly only when the charge voltage gets high, mainly when you charge the battery fully up to 100%.

For example, if you charge your battery only to 60% and thus keep its voltage below some 3.9 V, the battery will last for thousands of complete charge-discharge cycles. If you charge it up to 100%, i.e. voltages of 4.2 to 4.3 V, then the battery will lose a considerable fraction of its capacity already after 200 to 300 charge-discharge cycles. Somewhere in between these extremes is an optimum, usually around 80% max. charge, that keeps the battery healthy for the three or four years a smartphone is commonly used.

The number of cycles itself actually does not matter. It is only the charging stress at higher voltages that matter, regardless of whether that happens in very short, incomplete or in long, complete charge-discharge cycles. Repeatedly charging the battery, let it discharge a little, then recharge it again repeatedly does not harm the battery noticeably, as long as the voltage is low. Quite to the contrary, very frequent and short charge-discharge cycles lead to lower peak temperatures and can therefore be advantageous when ambient temperatures are high.

---------- Post added at 10:27 AM ---------- Previous post was at 10:22 AM ----------

I think some phones can do that, but most cannot. It would be nice to have, but it is not important.

The warning not to let batteries on the charger for extended times is only valid because normal chargers would keep the battery at or near the highest voltage of 4.2 to 4.3 V, which ages the battery rapidly. If you can limit the charging to a lower voltage and keep it there, the battery ages much less, depending on how low you set it. Below 3.92 V or around 60% the aging is minimal, and the battery will last for many years. And this is exactly the purpose of the Battery Charge Limit app, which it fulfills extremely well on compatible phones and Android versions.
[Android Apps and Games] Death I:
Nice description of how lithium ion cell life works but I don't agree that this cycling is how most chargers work, I've never seen a device that gets to 100% and then starts cycling between 99% and 100% or 96% and 100%. The power management controller will power the device from external voltage as long as it is present and as long as it is sufficient, it will charge the cell separately from powering the device, the only time it should start draining the battery is if the external power is insufficient. I had that issue with Galaxy Nexus, the 5W power was insufficient in certain cases like using GPS in sunlight where battery slowly creeped downwards because 5W was insufficient but this would go all the way down to 0%. Shut off the GPS and it would start climbing up.
[Android Apps and Games] hgmichna:
Stress from charging-discharging cycles?

You'd be surprised to learn how phones stop charging and let the voltage go down while still showing 100% to the user. If they didn't, too many users would complain about a defective charger that does not charge the battery fully.

If they did actually keep the voltage at its maximum, the battery would experience even more wear than it already does when being held between 95% and 100%.
[Android Apps and Games] Death I:
It is normal for the voltage to drop slightly after charging stops, this is to be expected. This is still considered 100% though. The charging stops after charging current reaches certain threshold, say 75mA and this is considered full charge, if they kept holding the charge voltage until the battery could draw no more, it would damage cell but provide no meaningful capacity gain.
[Android Apps and Games] Redhawk2000:
Could we have the option to see temperatures in F?
[Android Apps and Games] zer0xploit:
force closse issues

Hey guys!

I just did another clean flash and some testing and found out that (like someone else here has described as well) that my force problems disappear into nirvana when I flash Magsik v12 with according MagiskManager Version.. So it seems to be a Magisk-root related problem affecting this wonderful app - is there any way the developer of this app can find a fix for this or should I contact topjohnwu and ask him if he got a clue what to do about it.. Thank you all for your help pinning down the root of issues! :D
[Android Apps and Games] Mayex:
No Mi6 support?
[Android Apps and Games] RedSkull23:
Hi, i have a 6X too and to avoid any kind of problems i just left the app whitelisted from Greenify and battery optimization. Don't know if it works without problem even not whitelisted, but if i don't remember bad on my previous phone (S4 Mini) i had to put it in whitelist. For your 2nd question, the list that you see when u open the app are the system files that being modified while the app is on, listed per devices. Huawei looks still on experimental state, but on my 6X works flawlessly.
[Android Apps and Games] hgmichna:
Rapid charge-discharge cycle

Good news: Just reporting that I have not had this any more since then, in spite of using the app several times each day and night.

Either a newer LineageOS version fixed it or the error is rare and I had just been very unlucky at that time. (There has been no newer app version since then.)

I have now again set it to charge up to 60% and recharge below 59%, i.e. 1% lower.
[Android Apps and Games] Midomad:
So using OOS on my OP3T do you think it's ok to come back to you're method?
[Android Apps and Games] hgmichna:
Rapid charge-discharge cycle

Yes. You can anyway try it and see for yourself whether it works well.
[Android Apps and Games] realista87:
installed the 0.11.0 version i i receive the messade "your device is not supported (yet)" .

i am on lenovo k3 note SOC mt6752 resurrection remix 5.8.3 , magisk 13.3. the app asked the root permission i granted...... but idk why my device is unsupported..............
[Android Apps and Games] post-mortem:
It's not because of root, the message means that this app doesn't know which files must be modified to prevent charging on your specific device. If you identify which edits to which files must be made, the app author can update the app to include support for your device.
[Android Apps and Games] real_milux:
Well actually, as I explained over and over again, both behaviors are possible. It depends on your device and your control file selection. My device supports both the "good" and the "acceptable" behavior, but it's rather obvious which mode I use most of the time. ;)
[Android Apps and Games] RedSkull23:
Hi, i think that i discovered a bug on Huawei devices (or at least, on my Honor 6X; obviously I've read that the limit for Huawei is in experimental phase, so i notice you about this only in way to fix this issue somehow). Sometimes, when I leave debug usb option ticked from developers settings, the battery keeps charging over the limit, that becomes just ignored as if Battery Charge Limit wasn't active (of course it is, i never deactivate it). This already happened me once, but i thought that it was my fault for some settings like battery optimization, hibernate, ecc. so yesterday when this happened again, i knew that couldn't be my fault anymore. I can provide a logcat if it could be helpful, not now because I'm at work but later today. Lemme know!
[Android Apps and Games] luigi0824:
My xperia s is sadly not compatible. Is their any way to identify the control files?
[Android Apps and Games] Mr.Ak:
This app was working perfectly on my Oneplus One before flashing sultan's rom,maybe because sultan's rom uses a different battery driver for more accurate measurements(chip- http://www.ti.com/product/bq27541),better battery life and various safety mechanism.

Now even when battery charge limits to 80%,device goes on to charge more,even when app restricts.

Is there any charge control file which works correctly with sultan's rom? I'm currently using charging_enabled(generic) control file.

Automatically reset battery stats is disabled.

Let me know if anyone finds a workaround/different profile for sultan's rom..Thanks! :)
[Android Apps and Games] Dyt199412syam:
Anyone tested this on miui? Thankyu
[Android Apps and Games] real_milux:
Beta version 1.0.0 released!

Let's make BCL GREAT AGAIN! :p

I hope that this "development milestone" fixes most of the annoying issues that have been reported recently.

We are not able to reliably keep track of all (supposed) issues that are discussed here!

If you still observe bugs that have not been reported, please open an issue on GitHub:

https://github.com/sriharshaarangi/BatteryChargeLimit/issues

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

---------- Post added at 07:45 PM ---------- Previous post was at 07:40 PM ----------

Interesting... honestly, I have no idea what might be going wrong here. If it still happens in 1.0.0, please open an issue for it!

---------- Post added at 08:44 PM ---------- Previous post was at 07:45 PM ----------

One more minor update:

Added preference to disable limit enforcement aka "state fixing"

Added expert preference to enable immediate reaction to power state events (be careful!)
[Android Apps and Games] eried1:
Does the Magisk 13.x support mean reset battery stats will work? I don't think it did for anyone on previous versions.
[Android Apps and Games] real_milux:
I've tested Magisk 13.x on both a Galaxy S4 with Lineage 14.1 (Android 7.1.1) and my Moto X Style with Android 6.0.

Battery resets work on both devices!

However, I still think that this might not be a Magisk issue.

At least the user I discussed this problem with was using Android 8.0, and I think that it is actually the new Android OS that screws up the statistics reset.

Anyway - check it out and report back!
[Android Apps and Games] :
Working here with Magisk v13.3!

The guy that reported it on GitHub was running PureNexus, IIRC. Which is a ROM based on 7.1.2, not O. Unless that's not what you're talking about.
[Android Apps and Games] real_milux:
Oh, interesting. Thanks for the clarification, I obviously got something wrong here. ^^

Well in that case, it might work for him as well now.
[Android Apps and Games] RedSkull23:
First of all thanks for the good new about the 1.0 version finally reached, nice to hear this. I'll surely do a try next time I'll charge the phone, so I'll follow your advice if it'll happen again. I'll take the chance to achieve a logcat too!
[Android Apps and Games] aamadorj:
Thanks for all your hard work improving this app, [MENTION=6929614]real_milux[/MENTION].

I just reported, directly at github, the situation with the battery stats reset option still not working on my N6P running PureNexus.
[Android Apps and Games] chitose_ndy:
Hello, just dropping by to say thank you for your work and for the updates!

Keep up the good work!
[Android Apps and Games] :
I've been talking to one of the PureNexus developers and he said that the issue might be because PureNexus is signed with "user" keys while most/all other ROMs use "user-debug" builds. Apparently you need to have user-debug to use the dumpsys command...
[Android Apps and Games] poentaa:
I'm using a Honor 6X and BCL is working fine on my device. I've had what you described happen only when BCL was set to hibernate after screen off in phone manager >battery saving settings.