yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] victro:
Samsuns Galaxy Tab S MS-T800 that file doesn't exist. There is: " /sys/class/power_supply/battery/charge_now", which changing state from 0 to 1 when connected to USB. Looks that app need to be customized for each brand, at least.

Stock Android MM rooted Xposed
[Android Apps and Games] real_milux:
I can confirm this, I didn't pay attention to this other file, but it "freezes" the battery state.

Summarized

We know about 2 "files" that provide "battery freezing" semantics:

enable_battery_charging (various devices)

store_mode (Samsung note devices)

And there is also charging_enabled (various devices), which turns off ac power.

Further, we have charge_now (victro) for Samsung Tab devices (confirmation?).

Question: Does anybody have a phone with charging_enabled and WITHOUT enable_battery_charging?
[Android Apps and Games] Dyt199412syam:
It works on Wingtech redmi 2 running L-OS 14.1. Thanks anyway.

---------- Post added at 04:38 PM ---------- Previous post was at 04:34 PM ----------

Yep. I have phone with "charging_enabled" and WITHOUT "enable_battery_charging".
[Android Apps and Games] real_milux:
Alright, then all options have to be kept.

[MENTION=6898873]harsha1397[/MENTION]: Do you plan to do this as closed-source or open-source?

I would be interested in doing a pull-request in order to see this work before the end of your exam period. :p
[Android Apps and Games] logosA:
Also file present in Samsung Note 2 running Android N 7.1
[Android Apps and Games] real_milux:
How about the other file(s)?
[Android Apps and Games] logosA:
These are all files present in that folder
[Android Apps and Games] DocteurN:
Working great on my NEXUS 6P.

I was looking for this app for a long time, thank you very much!
[Android Apps and Games] EmirSc:
Working Ok on my Huawei G8(GX8) RIO-L03

Edit: it's possible to remove the "charging icon"? I let the charger connected and never surpassed 80%, so I asume it's working ⚒, thanks.
[Android Apps and Games] Mr.Ultimate:
(RENOVATE NOTE2.0 ROM) on my S7edge, this is not working, can it be that I need phone restarted after settings enabled?
[Android Apps and Games] EmirSc:
I didn't restart my phone and worked
[Android Apps and Games] gohamstergo:
FYI:

This happened to me. I disabled the app after I hit my specified charging limit while the phone was still plugged in. So, maybe that combination of events got the charging state setting stuck. Rebooting fixed it and I can charge now (didn't need to uninstall).
[Android Apps and Games] aamadorj:
+1

My N6P is running latest Pure Nexus, SuperSU and ElementalX kernel, just in case this information is useful.
[Android Apps and Games] Nobol:
Version 1.0.3 doesn't work on rooted Samsung Galaxy S7 android 6.0.1.

File "store_mode" is modified properly at the first time but it doesn't want to go back to "0" unless I restart the phone.
[Android Apps and Games] cmglng:
1.0.3 works perfectly now on Redmi Note 3 running PureNexus 7.1.2. I can finally leave version 0.5
[Android Apps and Games] Gregbol:
Hello.

What modifications and manipulations have to be made to ensure that the blind mode works correctly.

Thank you in advance.

Envoyé de mon SM-N930F en utilisant Tapatalk
[Android Apps and Games] Nobol:
Blind mode? What do you mean by that?
[Android Apps and Games] Gregbol:
Sorry

Store_mode

Envoyé de mon SM-N930F en utilisant Tapatalk
[Android Apps and Games] Nobol:
I don't know. It doesn't work on my phone and I didn't figure out how to make it work.
[Android Apps and Games] Gregbol:
Idem

Wait and see

Envoyé de mon SM-N930F en utilisant Tapatalk

---------- Post added at 03:15 PM ---------- Previous post was at 03:03 PM ----------

Or post in GitHub

Envoyé de mon SM-N930F en utilisant Tapatalk
[Android Apps and Games] Nobol:
Well, if I had read FAQ at first, I would have known that switching to "battery_slate_mode" is the solution :)

Now it is working correctly.
[Android Apps and Games] pathologo:
Interesting idea, interesting to think about and to evaluate, interesting app.

Now, if it could display more information, e.g. all information that are displayed in Ampere, about the battery, there would be no need for additional battery apps.
[Android Apps and Games] Bobbaloo:
Handy little app. Effective! Thankyouverymuch!!!
[Android Apps and Games] HikingMoose:
How would someone find the command to wipe battery stats in Android O? It's different than the older versions, so the app no longer can clear them.

Good news is my screen on time is off the charts now! [emoji38]
[Android Apps and Games] Bobbaloo:
Nyuk Nyuk!
[Android Apps and Games] testman86:
Hey, great app, I was looking for this kind of thing since years! Till now, on LineageOS 14.1 latest for Nexus 6 its working as it should. Thanks for the great work and this very usefull app!

Have you any plans to bring the app in the F-Droid store/repo?

This would be very usefull to get notifications about updates. As it is an OSS application it would perfectly fit there and even more people would get to know it. I had just luck that with the help of google and some sites I found it here on XDA. I take all my apps from there because I run a complete GAPPS free phone just pure LineageOS and yalp (application) to get Firefox from the playstore.
[Android Apps and Games] X46X:
Hi, I have a HTC 10 and I think that the application not working here. My phone still charging to 100% even the limiter is enabled.

I don't have a git hub account, but the file is here: /sys/class/power_supply/battery/battery_charging_enabled
[Android Apps and Games] testman86:
and first problem ^^ till this morning everything worked fine. Charged until the defined limit as exspected and worked out before.

But tonight I wanted to charge again, battery symbol is showing power supply, but its not charging anymore. My limits are 70% upper and 65% for recharge. I got the message "waiting till 70%" but it was not charging. The battery was at 42% so this should not be the problem. After a reboot (without opening the app) its working fine again.

As said, I am on LineageOS 14.1 latest build for Nexus 6 with LineageOS root.zip and no further modifications.

I just realized, when opening the app and then close it again by swiping it out of the recent apps it says "battery charge limit deactivated" and if I open the app again "battery charge limit is activated". Any ideas what might go wrong? I use the generic method (selfselected but the app after install) and rest on default in the app, just unchecked "wiping battery stats automatically".

I am an "idiot" and restarted before taking a logcat, but next time I will take one...
[Android Apps and Games] Aaron1017:
Tried a few different versions and settings of this app. None would keep my Pixel XL from charging over 80%.

After poking around in the /sys/class/power_supply/ folder I ended up creating the same thing using Tasker.

Profile: Power Any (State) (uncheck "force task order")

Start Task:

1. Run Shell: cat /sys/class/power_supply/battery/charging_source to Var %PluggedIn

3. Run Shell: echo "0" > /sys/class/power_supply/battery/battery_charging_enabled (use root) if %BATT > 79

4. Wait 60 seconds

5. goto Action number 1 if %PluggedIn neq 0

Exit Task:

1. Run Shell: echo "1" > /sys/class/power_supply/battery/battery_charging_enabled (use root).

/sys/class/power_supply/battery/charging_source

0 = Not plugged in

1 = USB

2 = A/C

Probably overkill to keep checking every minute.
[Android Apps and Games] :
You can use "run shell" in Tasker and execute

cat /sys/class/power_supply/battery/charging_source

using root. Save the output to your variable %PluggedIn.
[Android Apps and Games] post-mortem:
Won't this prevent your device from going into deep sleep?
[Android Apps and Games] Aaron1017:
Ahhhh, yes. Let me update and use that.

It prevents the phone from sleeping when its plugged in. Phone doesnt sleep when its charging.
[Android Apps and Games] post-mortem:
Oh, I see. "Power Any" is the start task, so there's nothing running every 60 seconds when not plugged in.

:highfive:
[Android Apps and Games] testman86:
I played around a bit and after a

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

in termux with root privileges its working properly again without a reboot and BatterChargerLimit directly pops-up again and says "Waiting till 70%".

So something is not properly switching back the state = 0 after a full charge.

I also recognized, after charging, and waiting till 3% dropped (to 67%) i can still charge again, even if my lower threshold is 60%. So somehow its starts charging again even if it shouldnt.

And most interesting. After

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

if I do a

"cat /sys/class/power_supply/battery/charging_enabled"

its still at 1 and not back to zero, but now it can charge again without a reboot.

and after a reboot a

"cat /sys/class/power_supply/battery/charging_enabled"

gives also a 1

and if i use

"echo "0" > /sys/class/power_supply/battery/charging_enabled" -> not charging

and

"echo "1" > /sys/class/power_supply/battery/charging_enabled" -> charging

with BatteryChargerLimit disabled I can "manually" stop and start charging and toggle between it without any problem, so in general its working on the Nexus 6 when manually just flipping between 0 and 1.

And I found out, that BatterChargeLimit sucuessfully prevent my manual overwriting to not charging if its running.

So my guess is that something in Version 1.0.3 in general is not working properly as it should. Cause manually its perfectly working.

Hope this testing helps.
[Android Apps and Games] Gibbothegreat:
Any chance you could upload it as a module for us tasker first timers

P.S. Wait, for tasker to run you still need to identify the correct folder which I still can't find!!!
[Android Apps and Games] post-mortem:
I think you're on to something. As stated previously, I'm one of the people for whom this app only works sometimes. I always wake up to 100%. When I charge my phone during the day, it only works for a limited time, until something kills the service & the device resumes charging.

I tried charging my phone by plugging it into a computer USB port like you mentioned (500mA), and I left it in all day... The app worked as expected! I've never previously been able to leave my phone plugged in for so long with this app successfully limiting charge. Unfortunately, it is not a reliable long-term solution.
[Android Apps and Games] testman86:
And this morning (after a reboot yeseterday) it charges till 70% limit as it should.

a "cat /sys/class/power_supply/battery/charging_enabled" returns an 1 afterwards (which for me does not make sense because it stopped charging)

And if i plug in the power supply again (and beeing above the threshold) it still returns an 1 and is not charging.

I would exspect that BatterChargeLimit set it back to zero so that charging is disabled. Its set on 1 (so charging) but phone is still not charging.
[Android Apps and Games] hgmichna:
Rapid charge-discharge cycle

I am currently testing the same thing with a weak charger and a thin USB cable. This charger does not deliver more than 1 A, probably much less. The problem has not occurred since I use this weak charger.

The other charger, which I had used before, manages more than 1.5 A current, probably up to 2 A. With that the problem occurs in some overnight charging sessions.

For me this is an acceptable workaround, particularly since slower charging further reduces wear on the battery and since a night is long enough to reach the desired charging level.

But the problem is still there, waiting to be solved.

OnePlus One, always a relatively new LineageOS 14.1, never older than 2 months.
[Android Apps and Games] pamplemousse00:
It works on my Huawei P10 Plus!! Thank you!
[Android Apps and Games] gts24:
Subscribing. This worked great on my Nexus 6p , but does NOT work on my Pixel XL
[Android Apps and Games] akinkoff85:
Does this work on the Samsung S8+
[Android Apps and Games] testman86:
Found a simple workaround for the problem some (including me) have (the "not charging after reaching upper battery limit and then getting below lower threshold battery limit and then not able to charge anymore without a reboot"-problem).

1. install Termux from F-Droid or PlayStore

2. install Termux:Widget from F-Droid or Playstore

(read the manual to get bit familiar with the Termux, its really powerfull! https://termux.com/help.html)

Open Termux and enter the following code

apt update

apt upgrade

apt install nano

then

ls -a

to see all folders and then

nano .shortcuts/temp_fix

(this will create a file "temp_fix" in folder ".shortcuts" and open the editor nano to edit it.

in the file fill in:

su -c 'echo "1" > /sys/class/power_supply/battery/charging_enabled'

Make sure that all is in one line, otherwise its not working. Somehow its splitted in two lines while writing, so really make sure that all is in one line before saving!

For saving press "volume down" + "x" at the same time, you will be asked if to save, say "y" and press enter again to leave and close nano.

After this, just add the widget "Termux:Widget" to the homescreen, there select the script "temp_fix" and next time you plug in and your phone is not charging, just tap on the widget, value will be toggled to 1 and phone will charge again without any reboot till the defined limit.

For other phones or OS versions "echo "1" > /sys/class/power_supply/battery/charging_enabled" has maybe to be changed to the appropriate file and value which is needed for functioning.

For me its a clean and lean solution, based on a tiny skript including a simple command which is natively running without any tasker or other bloat.

There is also an option to run backround tasks/skripts with termux.

source: https://play.google.com/store/apps/details?id=com.termux.widget

Maybe this might be a clean and lean option to write a small skript which is running in the backround and sets the wanted limits without the need to install an app for that.

Any ideas are welcome :)
[Android Apps and Games] Gregbol:
Hello.

I do not have the "charging_enabled" files in my system.

Or I do not find it note3 phronesis v6 phantom kernel.

[emoji22]

Envoyé de mon SM-N930F en utilisant Tapatalk
[Android Apps and Games] Infy_AsiX:
Indeed it's possible to create a completely custom battery setup using only Tasker with root if the system charge files are available. My phone is missing the thermal-engine.conf normally used to modify thermal throttling affecting charging rates. So when I found these charge files I set out to fix the slow charging on my Z3C.

I've managed to set various charge rates by battery level or fast override both with a trickle like top up effect and of course a limit. A hot slower charge rate and overheat charging stop. A stop charge during the intensive boot process with init.d to prevent heat up.

I copied the idea of Qnovo's smart charging on Sony where they try to learn your charging times and top up from 90 to 100. Reading users reports Qnovo it isn't necessarily effective at learning your behaviour. This Xposed module https://xdaforums.com/x-compact/themes/app-batterycare-t3547691 helps the supported Sony's use their alarm clock to help improve the detection. Using Tasker on a non Qnovo phone, I just have a shortcut for manual overriding of limits until the new temporary limit is reached then stop. Alternatively if your alarm clock can post a title that Tasker can detect, you can automatically have a set time. Tasker can cancel the alarm from acting as a proper alarm too. I decided in the end I'd prefer to maintain more cycles and in conjunction with swappable batteries than reach a higher charge so don't use the setup.

I appreciate the devs for Battery Limit getting a limit simple solution across devices. Working across so many devices has compatibility issues, if you want a tailored setup for your device you should do it yourself. I've still got an issue with just Tasker where my modified charge rate isn't applied if plugged before boot it seems. I'm no expert, just playing around with Tasker's ability on this for a short while, hopefully I fix it. I could share or feedback tips but I'm not really sure myself :laugh:
[Android Apps and Games] chenrp:
one oneplus 3t using v 1.0.3 not working. the charging goes above the limiter.
[Android Apps and Games] rjwc1:
Did you try to change the control file? charging_enabled works for me
[Android Apps and Games] Mysticales:
Anyone try this on the Snapdragon Galaxy S8 with Root? Could this maybe help get it to charge past 80% if you use this app to set it say 90%?
[Android Apps and Games] chenrp:
i don't want to configure this file as everytime a new app or rom i will need to reconfigure it.
[Android Apps and Games] Mx WaR HaBiB:
Search "batt_slate_mode" ;)
[Android Apps and Games] freakerload:
My Bugs: I fresh reboot it is charging to the limit 85%. And if i unplug and want to charge later after use it stops @35% a reboot helps. And often i plug in it don't want to charge. If i disable the app and make a reboot it is all fine. I use a Note3…
[Android Apps and Games] Gregbol:
Thanks but either this is not the right files either to give it the value 1 does not reload.

A +

Envoyé de mon SM-N930F en utilisant Tapatalk
[Android Apps and Games] Mx WaR HaBiB:
With me it works backwards if it is "1" it no longer passes energy if the value is "0" again load.

Even so, something strange happens I leave it at night and change the file to 1 in 85% and is supposed to no longer load but upon awakening this to 100% and in theory should not have loaded 85% :crying:

any ideas? :confused:
[Android Apps and Games] Gregbol:
The same for me it does not load for 1 and it fires for 0 but just keeps the load.

Envoyé de mon SM-N930F en utilisant Tapatalk
[Android Apps and Games] eried1:
Seems like my device will only reset battery stats if I set SELinux to permissive. For the time being I'm using Tasker to automate the reset. Is there any way to modify the app to work with SElinux enforcing?
[Android Apps and Games] naifaharsy:
Why I can't find/ battery_enabled folder?? But I find tmp-mksh: <stdin>[17]: cat: /sys/class/power_supply/battery/store_battery_data: Permission denied
[Android Apps and Games] post-mortem:
battery_enabled is a file, not a folder. Also, the log excerpt showing permission denied is because you need root access to edit those files..
[Android Apps and Games] naifaharsy:
This one in folder..
[Android Apps and Games] naifaharsy:
I'm on root stock 4.4 htc d820u
[Android Apps and Games] post-mortem:
Scroll down. Your screenshot is showing batt_, so battery_ will come later.

Anyway, not all devices have all of those files.
[Android Apps and Games] naifaharsy:
This..?
[Android Apps and Games] post-mortem:
Yes, so you don't have that file. You'd have to use a different file.

Unfortunately, a quick search of this thread shows multiple people with HTC devices complaining that the app doesn't work correctly. So either HTC is using a different file than is available to choose in the app to control the charging behavior, or they don't use any of these files and they have some other method to control the charging.

If, though experimentation, you find which app to edit to control the charging, post about it here & OP will update the app to include support for your device.

Good luck!
[Android Apps and Games] naifaharsy:
Bad luck of HTC user I think..but I found/ charging_enabled is a "0",should I change to "1"?thanks for you're attention by the way...
[Android Apps and Games] sourbear:
Just an FYI that it does not work on my rooted ZTE Axon 7 running latest Android 7.1.2 Lineage OS 14.1 ROM.
[Android Apps and Games] post-mortem:
Sure. Edit the file manually using a terminal emulator or root-capable file browser. See what happens when you change the file to "0" or "1", both while plugged into a charger and while not plugged in. Also, observe if and how the file gets changed by the OS when you plug & unplug to a charger.
[Android Apps and Games] aldrin3010:
Had been looking for something like this. Great work Dev. I no longer have to worry about unplugging the phone after the battery reaches 80%. Working well on Galaxy S3(GT-I9300) Running Lineage OS 14.1 :cowboy:
[Android Apps and Games] dimm0k:
thanks for this! I've tried doing this a while back myself, but my Tasker game was a bit too weak to get it working properly. question regarding yours however, will it stop charging after it reaches 80 and keep not charging until you unplug and plug the device back?
[Android Apps and Games] Gibbothegreat:
If anyone manages to find the correct folder for the Doogee Y6 Max I'll send him/her 25$ via PayPal. Still can't find it ?.
[Android Apps and Games] Aaron1017:
Dimm0k

It will never charge over 80% unless you do 1 of 2 things.

1. Change battery charge percentage on if statement above 79.

2. Disable Tasker profile.

Once in a while the phone reaches 81% because it jumps quickly from 79 to 81%. I've since shortened the timer from 60 to 45 seconds.
[Android Apps and Games] naifaharsy:
Still not working..event many time change the number..
[Android Apps and Games] aser_elhbayeb:
I think the app is doing its magic, but for some reason it doesn't stop at the limit defined, instead it goes to 100%. I observed the charging led to make sure it is working and I noticed difference in behavior than before using the app, also I noticed the control file wether it changes value of 0 and 1, and it does change.

The only awkward thing is that it doesn't stop untill 100%, which I don't know why!

I'm on Galaxy S3 (I9300) running Nougat RR 7.1.2.
[Android Apps and Games] post-mortem:
Observe it closely, and see if it works as described in the short term. I also have an SGS3, and for me (like some others have mentioned here) it does work in the short term, but when you leave it for longer, something kills the process & the device resumes charging.
[Android Apps and Games] aser_elhbayeb:
I will retry after discharging the battery.
[Android Apps and Games] ALTAMAS:
For what recharge below function is used...?
[Android Apps and Games] RedSkull23:
Use search function... It has been asked endless times...
[Android Apps and Games] chudy_85:
Work correctly with my huawei p9
[Android Apps and Games] Kimbo82:
Thanks working on my Nexus 6p on stock Oreo with supersu!
[Android Apps and Games] verynuclear:
Thanks for the awesome mod. Working perfect here
[Android Apps and Games] Mx WaR HaBiB:
This happens to me too, does anyone know what to do? :confused:

:fingers-crossed:
[Android Apps and Games] post-mortem:
Using Tasker as described previously would probably work (of course, make sure you're editing the correct file for your device). Personally, I'm just dealing with it, for the moment. I've decided to change my ROM, and when I finally get time to do so, it's possible this app will work properly. We'll see.
[Android Apps and Games] Mx WaR HaBiB:
already does the task in Tasker but does not work in the way that is required, you mention it before, change the line of the file from 0 to 1, but something stops and although "not charging" at the end reaches 100% :(
[Android Apps and Games] post-mortem:
You mean that you're using only the Tasker implementation listed previously (and not Battery Charge Limit) to control charging, and it still charges your phone to 100%? If yes, did you change the control file to batt_slate_mode, which is the file for Samsung devices?
[Android Apps and Games] Mx WaR HaBiB:
yes my friend, with tasker at the limit of 85% change the value of the file to 1 "batt_slate_mode" in which the device shows that it no charging longer but having it connected for longer time without showing that it does to %100.

:(