yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] rowad1985:
How to fix? or how to back normal charging! ?

xiaomi mi max 3

Battery 5500

System pie 9

Device %70 only stop charging

Stop program & delete not fix issues?
[Android Apps and Games] @kitokit:
Try reboot your device

See first post instructions

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
[Android Apps and Games] sodade21:
Hello. I have Lenovo Phab 2 pro. I finally was able to rooted it with magisk. mostly cause I wanted this app. sadly It does not work... It doesnt say its not supported but whatever options i did chose i could not make it to obay to the limits i had set. I have read that if the device is not supported I might be able to find the right file at sys/class/power_supply/battery and try to see if something seems to working. I found a file called "Status" and with the text editor i saw that had Discharge and when i connected the power it changed to Charge. So i tried to edit it while i was charging it to the option "Discharge" but I couldnt save the file i didnt had permissions. i had the root explorer and all... so I don't know why I couldn't. then i tried to manually put that Status file on the app with Charge/Discharge as on/off tried it but still did not applied the limits.... Is it possible that the app cannot get the needed permissions to edit what it needs thus is not able to work? if thats so is there any way to fix it? Any other tips? thanks

EDIT: After all the right one was elsewhere. /sys/device/USB/soc.0/something i cant recall now/power_supply/online 1for on and 0 for off!... U can go with your root manager and at sys search for online its the one that its NOT cpu but power_supply. open the online file and thats your file.

So when i found that Online is the right one for my Lenovo i opened the app and i have setting where that online file is. checked the rewrite battery stats and now when it reach the limit it stop charging and sometimes when its about to drop gives a bit juice so it is stay about that range...its what a read somewhere that some models keeping the same amount just from the AC. also because if its nature of going on and off regulary i chose to disable toast notification from the app settings.

Also i suspect that exactly the same its on Lenovo tab 3 pro (the one with the projector) i saw the file there first but because the app say its not supported i couldnt test it.. maybe a dev here can make it happen for that tab as well...

PS: the location might vary a bit the key factors are sys/device/usb/power_supply and online at the end.... -thus try searching for "Online" at /sys. i dont have the phone atm i gave it to my mother thats why its mandatory to have that app cause she charge it 24/7..... I hope it helps a few Lenovo friends

PS2: its sound so stupid that no more devs looking up that issue with todays phones.. specially since nowdays all the phones have their batteries non-removable so we cannot change it when we like and we have to stick as soon as possible with the first one.... :/
[Android Apps and Games] JonnyX93:
Is there a way to kill the app, when the charge limit is hit?

Background: My phone doesn't go to deep sleep, while the app is running. So it would great if the app closes itself after it did its work. Atm I lose about 8% every night after charging stopped.
[Android Apps and Games] hansxl:
Yes you can do that a.o. with a macro (I use macrdroid for macro's)

But when the app is killed your phone will start charging further ofcourse :laugh:
[Android Apps and Games] JonnyX93:
As the charging-state file is not changed, when the app is killed, the phone doesn't start charging. At least it doesn't when I kill the app manually.

The problem mith macrodroid is, that this app is also preventing my device from entering deep sleep.
[Android Apps and Games] hansxl:
yes you're right, I used the wrong precondition in macrodroid :laugh:

but then you not only have to kill BCL but also an extra action to kill macrodroid itself. I tried and it works.

To be safe you could wait a few seconds after reaching your precondition to give BCL a chance to change the charging state file before killing it
[Android Apps and Games] TheVadam:
Hello!

I've a problem with charging limitation. Android skips the limit set in the application and still charges. My device is Lenovo Tab2 A7 30hc. Please help.
[Android Apps and Games] jal3223:
Hey man, thank you for giving your settings. Does the app still limit your charging? Mine seems to stop for a minute with that setup, and then eventually starts to charge to 100 again if not unplugged.

Has anyone had any similar issues with the Pixel 4 XL?
[Android Apps and Games] Infestor:
Still working nicely for me, I'm on the latest OTA using Magisk 20.3. It seems a bit wonky sometimes on wireless charging but generally limits the charge to what I set it.
[Android Apps and Games] nortsov:
Hello everybody!

Most smartphones start recharge (while cable is connected) when charget falls to 99%, can I only change this with help of this app? Without any control of STOP charging.
[Android Apps and Games] zputnyq:
Yes, I think but you must find the correct control file used by your device first & I can't help much on this case.
[Android Apps and Games] Revontheus:
Does this work on Android Oreo? Thanks in advance!
[Android Apps and Games] nortsov:
Problem is charge will stop at 99% because there is no higher values in settings.

Should be (i suppose) even values over 100%. It lets original charging process finish it's work completely.
[Android Apps and Games] zputnyq:
I get what you meant.

At the time I answered I thought you want your smartphone to recharge below 99%, you didn't mention complete charge (100%). Then the answer is you cannot do it with this app.
[Android Apps and Games] guest4711:
Depends on your device and the kernel used. For me its working...
[Android Apps and Games] cmglng:
It used to work on my previous device Redmi Note 3, now I moved to a Redmi 8A running Havoc OS GSI Android 10. How can I make this work on GSI ROM? It doesn't limit the charge.
[Android Apps and Games] amn1987:
Check out the various control files in Settings.
[Android Apps and Games] cmglng:
I manually added the control file, it does work to rhe extent that it stops charging (stays at the set limit) but the device still draws power cause the charging icon is still persistent and it it's not discharging like it's supposed to.
[Android Apps and Games] cmglng:
Status changes to not charging, is this how it's supposed to work now? It's just gonna stay at 76% and draw power directly from the charger and bypass the battery like on some laptops? I'm confused. Cause when I was using this on Redmi Note 3, it discharges as if you actually unplugged the charger.
[Android Apps and Games] gonzo1963:
Good afternoon,

After everything you've said ...

What do you suggest?

- ls this app not valid?

- This one: https://xdaforums.com/showthread.php?t=3668427 either?.

Finally, what should we do to prolong the life of our batteries?

Regards

Enviado desde mi unknown mediante Tapatalk
[Android Apps and Games] amn1987:
That's weird cuz in my Redmi Note 3 and Redmi 3s after reaching the set limit the battery won't discharge, similar to laptops. It would still be drawing a little current which I assume is directly supplied to the device bypassing the battery. In my Poco F1 unfortunately its different.
[Android Apps and Games] cmglng:
So the charging behavior on my Redmi 8A is perfectly normal? Btw forgot to mention that I retired that RNote 3 a year ago so I was using quite an older version of Battery Charge Limit on that device
[Android Apps and Games] amn1987:
Yes if I understand correctly. Directly drawing from the charger is the desirable and not many phones have this feature.
[Android Apps and Games] cmglng:
Yeah. But the status doesn't change automatically for me, I had to unplug the cable so that it would change staus from charging to not charging. Is it the same on yours?
[Android Apps and Games] amn1987:
No. Have you tried all the different control files?
[Android Apps and Games] cmglng:
Yes. They don't work so I'm using custom cause my config file is located in a special directory.
[Android Apps and Games] Jollyriffic:
validity is a tricky thing; "no and yes! not helpful, in the sense that people think it's helping and is helpful because of the limitations it puts on the length of charge time since you're effectively spending 20% less time charging".

Let's say you're testing between 20-80% vs 40-80% with your standard "quick charger".

the 40-80 needs less time to charge, so you're not heating up the battery/stressing it out as much, even though you'll be charging more often, than the 20-80%.

Think of that Like sprinting for 1 block vs 10 blocks as a human, the more time using power, the hotter you'll become. Same thing for a battery, more so the higher the wattage.

Lithium deteriorate slowly due to unwanted chemical reactions taking place. Heat speeds up most chemical reactions by a factor of about two for every 10deg.C (18deg.F) rise in temperature.

This means that if you work the battery so hard that it runs at 65deg.C (149deg.F) it deteriorates 16 times as fast as if it was running at 25deg.C (77deg.F).

The killer is the charge time + wattage used to charge, as longer charging and/or higher wattage = more heat the battery and the charge controller will generate.

This app "works" because you're limiting the amount of "time" you're charging, reducing the duration of heat, or even reducing the heat because the longer you're charging, the more heat generated.

The second part, is the level you let the battery get down to. Low voltage = killer with lithium.

I've tried to find this same "killer" with 100% charging, but haven't been successful. This is the one area, that i didn't do an ungodly amount of testing with. however i DO store my lithiums at 100% charge without any noticeable difference in cells life vs storing them at 50, 60, 70, 80%

The tests were controlled ambient 69f, tandem time with charging so if 1 battery gets XYZ time on the charger, that's what the other one gets.

battery voltages by percent 100% 4.14v, 90% 4.05v, 80% 3.96v, 20% 3.4v

the best solution If you're trying to keep them from degradation:

lower overall wattage when charging (quick charging is bad)

keep the cells away from heat sources, sun, heaters, hot car, etc

don't hit 20% if you can, attempt not to go below 30%.

basically trickle/slow charge as much as you can, anytime you can. The reason for that, is say you're at 80% throw it back on the charger, you're just doing a 20% charge, thus time needed, heat generated is lower overall than doing something like 50% from 30-80.

great thing about cell phones, there's so many cheap $1 -5 chargers at all sorts of places that are low amps.

where a quick charger will run you a lot more, yet reduce battery life. Kinda like paying more, to kill your battery much quicker.

so there is validity, it can and likely will help, but it's not needed if you just treat the cells correctly

Hopefully that clears up/defines more of what i was talking about.
[Android Apps and Games] amn1987:
Why have you set the percentage at which it will charge again so low? It should be in the 2-3% range. Micro-cycles aren't that big a concern at lower charge levels.
[Android Apps and Games] cmglng:
As I've mentioned my battery doesn't actually discharge when it reaches the max limit, so it wouldn't really matter what battery% I set for it to start charging again.
[Android Apps and Games] gonzo1963:
Good morning,

Does anyone know what "control file data" is or could be, for a Motorola One Vision with Android 10?.

Regards

Enviado desde mi unknown mediante Tapatalk
[Android Apps and Games] marbertshere:
Is it still working for you guys? I picked the same control file mentioned earlier in the thread and it worked the first time I plugged in the phone. Since then it will charge to 100. Do I need to tick off any other options?
[Android Apps and Games] guest4711:
It depends on your phone and the kernel used. For me the best setting is as shown:
[Android Apps and Games] Galaxea:
Not working on Samsung S3 mini. No file, and also cannot edit any files in the folder even with root explorer enabled....!
[Android Apps and Games] sriharshaarangi:
I will be releasing source code and next version within 24hrs :D
[Android Apps and Games] Bornstud:
I didn't find any charging_enable file in that folder.

I am using infocus epic1
[Android Apps and Games] sriharshaarangi:
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
[Android Apps and Games] blueberry.sky:
Thank you for open sourcing!

[MENTION=6898873]sriharshaarangi[/MENTION]

On Amazon Fire tablets I've found the file used is /sys/class/power_supply/battery/device/Charging_Enable

Perhaps you could add it in the next version. :angel:
[Android Apps and Games] HikingMoose:
Oh man, just down for the first time today, and found this. Awesome! Thanks for adding a battery stats clear button.
[Android Apps and Games] str8str:
Doesn't stop charging at set percentage. I'm using an n6 set to 90 and continued charging past it. Any suggestions?
[Android Apps and Games] sriharshaarangi:
Try to manually change the battery_charging_enabled to 1 or charging_enabled to 0 in /sys/class/power_supply/battery folder while charging(Try both of them individually), and see whether charging stops in either one of the cases.
[Android Apps and Games] ash001:
I don't have that file...is there any other way???
[Android Apps and Games] MounirHero:
Working on OnePlus 3

Android 7.1.1

LineageOS
[Android Apps and Games] HikingMoose:
Works perfect on a 6P on an AOSP based 7.1.1 build.

You're sure you granted it root permission right?
[Android Apps and Games] realista87:
hi, idk if it's a bug or not but when i press the 3 dots and click on settings, nothing occurs. is it normal? i can't enter into settings....

i also have a little advice for your 0,4v, please consider the introduction of a feature that allows a user to sed a FULL charge every X limited charge.

like a counter of charges that every x ( setted by user) charges, disables the limit ...just because i think that it's not a great idea to ALWAYS limit the maxvoltage of a battery, maybe every 10/15 charges.... a 100% charge is adviced. i hope you cold set it into the app....
[Android Apps and Games] blueberry.sky:
Is there a reason to believe that this is beneficial for li-ions? I haven't read anything.

Although I think a button to allow a full charge (disable limiting until unplug) would be great. Plan to go out for many hours & need a full charge? Touch to disable for one charge, no need to remember to re-enable afterwards. Would be great if the option is on the notification the app shows when it's actively limiting. Similarly, an option to disable at a particular times & days could be useful to some people. Mon-Fri automatically have full charge only right before you head to work.
[Android Apps and Games] billubakra:
The app is not stopping charging in rooted SGS3.
[Android Apps and Games] Jormana:
Working on Samsung TabPro SM-T520 LineageOS 7.1.1

Thank YOU! What a great program!
[Android Apps and Games] Astridxx:
Thanks bro
[Android Apps and Games] realista87:
something like a widget? it can be ok to put it on the homepage..press it and the app disables until 100% is "read by the app", then automatically reactivate the limiting function.
[Android Apps and Games] jokerpappu:
Awesome app. I wish you could make tye charging stop right at 100% instead of 99. That would of been awesome but nothing less overall an awesome app to have
[Android Apps and Games] realista87:
what's the purpose of 100% charge.... in an app that's made for LIMIT the charging voltage ?:confused::confused:

the best is to limit 90 or 85. on my tests 90% is perfectly 4,2v .... great savings from the full voltage of 4,4v
[Android Apps and Games] savvymatthew:
Seems to be working on my OnePlus3 7.1.1. Pretty well!!!!! I always forget to remove my charger. So this is extremely beneficial to me. Thanks so much for your work

Settings also do not work for me when clicked if there are any?

A feature to have it not to maintain charging would be nice, personally I need that. Would be a nice option.
[Android Apps and Games] whitedavidp:
Supported on LG V40?

Hello. I just got an LG-V40, rooted. It seems this app wants to use /sys/class/power_supply/battery/battery_charging_enabled (1, 0). Although I had set the limit charging to 80%, and the current level was 90+, this app did not stop the charging and it went up to 100%. At that point the status went from green to grey and says full. Is this how it is supposed to work? I would think that if the app finds the level anytime above the limit it should stop the charging then and there and keep it off until it falls below the recharge level. But I could be wrong. Of course, the service has been enabled during all of this. And this is Android 9 if that matters. Any help is appreciated. Thanks
[Android Apps and Games] vivekpf:
Massive idle drain...

I used this app on poco f1 pie rom first, it used to be fine. Now i am on q and battery drain is very high after limit reached.. looks like q problem
[Android Apps and Games] guest4711:
So it's not the right control file for your kernel. Perhaps someone in your ROM's thread could help you to find the one best suited for your setup.
[Android Apps and Games] whitedavidp:
Thanks. It is interesting that the named file exists. However, it contained 1 until it was at 100% and then it went to 0. I have disconnected the power and the power is now down to 94 and it contains 1. So I can see how this would be sim-construed as a switch of some sort. On this device it clearly is not. More of a flag or semaphore, it seems.
[Android Apps and Games] whitedavidp:
After some significant searching and trial/error I found that the correct file for my LG V40 (and perhaps other LG models) - at least for the USB charger (no idea about wireless) - is /sys/devices/platform/lge-unified-nodes/charging_enable: 1 (enabled), 0 (disabled).

A good source of files to check on is shown here <https://github.com/VR-25/acc/blob/master/acc/switches.txt>. This is documentation for a Magisk module called Advanced Charging Controller (acc) that does basically the same as this app. I am not endorsing this as I have not tried it. Indeed, I am not using this app either. I have rolled my own using Tasker. No need to have yet another service running when Tasker's is always running on my device.

Cheers
[Android Apps and Games] guest4711:
Thanks for the fine info.
[Android Apps and Games] baldybill:
Could you provide info on how you made your own on Tasker, either here or through a message to me?
[Android Apps and Games] whitedavidp:
Sure, I have attached the backup xml from my power management project. This is running on an LG V40 with Android 9. The control file and values are references in the taskes EnableCharging and DisableCharging. These files will most likely vary on your device. This app found a file in a "standard" location on my device. However, that file was not the switch. I had to do a bunch of searching to find the one I am using. Please refer to the link posted earlier for suggestions if you do not know the file on your device. To test, I found it easiest to simply copy the echo command from my tasks and paste them into a rooted terminal using different files from the list that I actually found on my device.

Cheers.

PS - I added one thing I did not see in this app but wanted: the shut down of the device if the battery level falls to low. The device will do this eventually on its own. But the discharge level was too low for my liking in trying to preserve the battery.
[Android Apps and Games] larsdennert:
I'm going to have a look through your power management script. Great job.

OnePlus is coming out with something called Charging Optimization. It basically charges the phone to 80% and then learns when you use your phone. It anticipates your schedule and shortly before, charges your phone to 100% such as in the morning before heading out. This way it doesn't charge cycle all night to 100% and you don't have to live with using only part of the battery. I used the hooks in Battery Charge Limit to mimic this also using Tasker. Here's how.

Have the Battery Charge Limit app otherwise configured and working properly.

Open Tasker and create two tasks. One called battery 100 and one called battery 85 (or whatever)

[IMG="tasks"]https://www.dropbox.com/s/hiqwdotddh0n38d/Screenshot_20200419-091149.jpg?raw=1[/IMG]

In the new task select the "+" (New Action) - System - Send Intent. You'll get this screen to enter some info (see below the screenshot for the actual full text that is cut off):

[IMG="intent"]https://www.dropbox.com/s/cbjmwdnqmxy1oov/Screenshot_20200419-091040.jpg?raw=1[/IMG]

In the Action input type com.slash.batterychargelimit.CHANGE_LIMIT

In the first Extra input type android.intent.extra.TEXT:99 (there is no way to specify 100 as it seems limited to two digits)

Save that off and do the same for the other task, creating one at 85% or somthing.

After that, you will create two profiles that each run a task at a specific time.

[IMG="profiles"]https://www.dropbox.com/s/lyslaiz5lc706jb/Screenshot_20200421-105223.jpg?raw=1[/IMG]

Each time based profile should have the same "From" and "To" time so they are each trigger-type profiles. In my case, at 7am the profile switches to 100% charging which is enough time for the phone to get there in the morning from 85%. I don't plug my phone in during the day, but if I had to there's probably a good reason and I'd want as much back to 100% I'm guessing. The second profile runs at 7pm and changes the phone to 85%. If anytime in the evening I plug it in, it will stop at 85% and wait until 7am the next day. I may lower the 85% to an even more chemistry neutral charge of 50% or 60% in the long term.

There are a couple of oddities. The manual settings in Battery Charge Limit do not change to reflect the intent action. They are somehow separate and only change somewhere internally. The charging indicator on your phone may not accurately reflect what's going on. IE it may show charging when in fact it isn't. You can verify that using the status in Battery Charge Limit or another app like Ampere.
[Android Apps and Games] whitedavidp:
Yes, thanks. Of course, my own stuff is simple-minded but it meets my simple needs. There are any number of ways of doing this sort of thing once you find the control file for your device.

PS - on the later Android versions, must you also supply the package? I have had to do that myself on Android 9 to make send intent work. Cheers
[Android Apps and Games] larsdennert:
I messed with it a few ways and it seemed to want all the text in the extra. In the Action, I don't see a way around specifying the full package name. Note that the image I posted had info cut off but I posted the full path in the instructions below it. I think I'll revise so people don't go entirely by the screenshot.