yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] hgmichna:
Recommended range

I can only try to answer this question, not the second one.

There is no generally recommended range. The only universal recommendation is that a limit below 60% makes little sense, as the stress for Li-ion batteries begins around that state of charge. If you keep your battery below 60% and do not quick-charge, your battery will live almost forever, thousands of cycles.

Since most users do not plan to keep their phone forever, a higher value can be a good compromise, hence the default 80% to 78%. This will likely let your battery live for quite a bit longer than the usual two years.

Your individual compromise is also determined by how much charge you actually need to get through the day. For example, if you can recharge at work, 60% may be plenty.

As to the span between charge and discharge, most users prefer a small span, like the default of 80% and 80 minus 2%, because this is again a good compromise. For example, if you charge overnight and determine that you want 80%, you don't want to set it up for 80% to 70%, because then you may find your battery at 70% in the morning, which may be too little for your demand. The battery also gets hotter when charging from 70% to 80% than from 78% to 80%.

Setting it up for 80% to 79%, i.e. only a 1% span, can lead to very many, very short charge-discharge cycles on some phones, which may cause extra power consumption and perhaps restless display activities, so that is not recommended. If, however, your phone behaves nicely at that setting, by all means use it.

If you don't need quick-charging, use a slow charger that delivers only 1 A. Ideal would be 500 mA or even less, but for the life of me I cannot find such chargers. The ones I do find advertised with 500 mA happily deliver 1 A or more. Only some computer USB ports actually limit the charge to 500 mA. But limiting the charge current to 1 A is already far better for the battery than quick-charging at 3 A or more, because the high voltages and temperatures stress and quickly age Li-ion batteries.

Background information can be found on the Battery University web site.
[Android Apps and Games] who ah way:
WOW, what a detailed, erudite reply!

I can't thank you enough for writing it. It was an education, and I have already bookmarked the post for future reference.

I hope that many others get to read your post. :)

Thank you for sharing.
[Android Apps and Games] Vovodroid:
Solved: there is known bug in CM 11-13, I open issue https://github.com/sriharshaarangi/BatteryChargeLimit/issues/169

Meanwhile there are patches on Russian mobile device forum http://4pda.ru/forum/index.php?showtopic=246233&st=17820#entry68750091 (no Russian language knowledge needed :D )
[Android Apps and Games] ×RBK×:
Good day. I faced an issue after using this app earlier today. The charging thunder icon on my phone suddenly disappeared. Even when I am charging it never shows. Is this a known problem? Please help me. Thank you.
[Android Apps and Games] b8842dc0:
Is your device, a Pixel, by chance? I've seen that with both the pixel 3 and the pixel 3 xl. One thing though, the phones weren't charging, even though the phones were plugged in. A reboot got the phones to actually charge and the charging bolt to show. But the problem would reappear again, in the future. Uninstalling the app fixed this problem.
[Android Apps and Games] ×RBK×:
I am running pixel experience plus when the issue happened. The phone was charging, it's just that the bolt icon suddenly disappeared. And fk manager is not recognizing the charging status of the phone.
[Android Apps and Games] swer21:
Service not stopping when unplugging

Hello

On my new phone (Mi9t pro a.k.a. Redmi k20 pro) the service dose not stop when the device has reached the limit and I unplug the charger. As a result the battery stats are not been reset. If I unplug the device before the limmet was reached the service get's stopped.

I tried the secound control file (status Motorola Defy +) available in the app. But this dose notstop charging.

I also tried the setting "Always process power events". The result was the App stop and startet in a loop and the device was charging.

In the moment I can close the service from the Notification when unplugging the device. The result is the battery stats get reset.
[Android Apps and Games] Tuxshine:
The app works fine while my smartphone is charging via usb/dc adapter.

But there is another behaviour while there device is charging via powerbank. My settings are charging until 80%, if the battery is below 75%. If the limit of 80% has reached and goes down to 75%, it doesn't begin to charge once more. I have to replug the cable for further charging every time.

Are there any reasons why that differs?
[Android Apps and Games] guest4711:
Perhaps the internal logic of your powerbank?
[Android Apps and Games] b8842dc0:
Sorry to hear that. But it works great on the Oneplus 6t. I don't believe that the developer has never said it should work on every device (see the OP). On my nexus 6 and oneplus 6t, it has always worked. On the pixel 3, pixel 3xl, and pixel C, I never got it working.
[Android Apps and Games] post-mortem:
Feel free to unsubscribe from this thread. We will not be offended.
[Android Apps and Games] TNSMANI:
MOD EDIT

Thread cleaned.
[Android Apps and Games] demil7:
Is anyone using a Redmi Note 7? I'm on the most recent Pixel Experience update with default kernel that comes with the ROM, and the phone continues to charge past the limit, albeit at a much slower rate.
[Android Apps and Games] onolox:
it's a known bug that this app don't work in android 9.
[Android Apps and Games] guest4711:
No it is not. It depends on your device and your kernel. I use it without problems on my klte and my fltexx, all running Android 9 aka Pie.
[Android Apps and Games] PJK2011:
I installed the app a couple of days ago on Pixel XL with AOSP 10. It worked the first day, but hasn't worked since. I've tried clearing cache, reinstalling, keeping the app on the foreground, but nothing works. The persistent notification says it's controlling the charge and system notifies the app got root permissions, but the charge keeps going up beyond 80%.
[Android Apps and Games] b8842dc0:
I'm using this app on a Oneplus 6t, with Lineage 16 (Android 9), and it works great!
[Android Apps and Games] onolox:
I tested in 3 devices and various ROMs and in no one it worked anymore, various different problems.

But I will investigate.
[Android Apps and Games] armyav8tor:
Causes random reboots on my Nexus 6P running Android 10. Never had any issues with it previously. Now I manually run the below script to get it to hold charge at 77%.

#!/system/bin/sh

chmod 644 /sys/class/power_supply/battery/voltage_max

echo 4100 > /sys/class/power_supply/battery/voltage_max

# check if done

cat /sys/class/power_supply/battery/voltage_max

exit 0
[Android Apps and Games] Safwan_noor:
Battery is stll charging even after limit reached, I set the limit to 80% but it started charging over 80%.
[Android Apps and Games] rcbjr2:
I'm using OnePlus 6, rooted (of course), and still on Android 8.x. The app worked fine until about two weeks ago. The only thing that might have changed is that Google updated. Now phone charges to 100% all the time. I tried changing 1 to 0 manually in battery_enabled file and when I plugged in phone it started charging (with the app tuned off). So, somehow it flipped itself to 1. Anyone have any suggestions? Know why it no longer works? I have rebooted. I have uninstalled and reinstalled. I might uninstall and try manually changing the file again just to see. Thanks!
[Android Apps and Games] paul_ius:
I'm facing the same issue on my 9T Pro. It is not a huge issue, more of an inconvenience, but before I was using it on P9 Lite and it was working flawlessly. Would love for that trend to continue.
[Android Apps and Games] Joe333x:
This a simple question that's bugging me, what does the "U:" stand for that displays the voltage in the notification? My only guess is usage or units.
[Android Apps and Games] MDV106:
Works well on redmi 7A
[Android Apps and Games] selfishjelly:
U is just a symbol for voltage, used in most non-english speaking countries
[Android Apps and Games] guest4711:
It's the ISO symbol for voltage. Ohm's law is written as U = R * I (voltage is resistance multiplied by current).
[Android Apps and Games] Joe333x:
Thanks guys
[Android Apps and Games] gohamstergo:
Attached my mod of your original version.

I changed the variable names to my preference and temp disabled the batt stats dialog (having issues with it popping up over my alarm when i grab phone off charge pad)

You'll see what I did with cycling the number branching off of step 36 and at steps 70/6. It's not pretty, but it works!
[Android Apps and Games] real_milux:
Thanks. First, I need to know what control file your device is using. It's sadly not contained in the flowchart.

Second, I tried out your suggestion, but there is a problem: Devices using store_mode (Samsung) do not charge at all after the charge stop command is issued, just keeping their voltage. While that's nice because it avoids any cycling (making most of the flow logic redundant), it also means that the modification breaks the charging for those devices - they will simply stop charging immediately.

This problem has already been mentioned in this thread before.

I see two possible solutions to this problem, and I'm currently not 100% sure which way to go:

Implementing arrays of root commands instead of single commands, or a device-specific switch set during initialization, that controls whether to execute just the charge_on or both charge_off and charge_on. This will further increase the already remarkable complexity of the script.

Provide a customized version for devices that need this special kind of "attention".

At the moment, option 2 seems more suitable for me. What's your opinion?

Third, there is another problem with your modified flow: It will crash when you unplug, the "no" path of the power check block is not connected.

I would recommend you to edit the dialog block and remove the tick at "Show window directly if possible", that should do the job whilst maintaining the functionality, in case you need it. ;)
[Android Apps and Games] sriharshaarangi:
I am a bit busy with the assignments and exams, and I am not getting enough time to work on the app.

Regarding open sourcing the app: I want to open source the app, but since I started this app as a personal project, the code is not well written ("I was like just make things work, don't bother about code quality, because of time constraint due to academics"). So, before I open source it, I want to clean up the code, so please bear for some more time. Hence, what I am thinking to do is clean up the code, make it open source and then add new features, as the present version 0.2 does the necessary job for most of the devices. I will change the samsung to store_mode, update the OP to the newer version, and start cleaning the code. This is what is on my mind. If you have any suggestions, I am glad to hear them.
[Android Apps and Games] gohamstergo:
1. My Nexus 6 uses charging_enabled. I've attached the .flo (based off of your original), so you can dig around, but it's still mostly your stuff, just little changes.

2. Ya, my fix for my phone's sabotage is a hacky one. Hard to know what little quirks every different phone is gonna have. I haven't heard anyone else post about my issue, so probably don't need to add that in general. Maybe add a checker for the voltage when it's SUPPOSED to be charging. For example, when my phone was set to charge, but wasn't, I could check 'current_now' and it was a negative number, meaning power usage, not charging. But then there's more flow complexity.. Not to mention that file is probably different for different brands.

3. Left that dead end on purpose, it's actually never used. The reason: The 'is battery level' question was already answered 'no' by step 34. So, when it gets to step 23, it waits for the answer to be yes (WHEN battery level), so it will never answer 'no' there. On unplug, this particular fiber is taken over by step 36, which runs my hacky reset, then the fiber dies. It gets restarted when plugged in and when it hits step 28 again. :)

FYI, there are multiple duplicate entries for your stuff in the Automate repo, seems like. Or can you not delete old stuff?

And not sure if you should make your own thread.. just don't want [MENTION=6898873]harsha1397[/MENTION] feeling hijacked. :P

EDIT: I added your "manual input" stuff to my mod.

Removed attachment since other people were downloading it.

No worries, good luck! Will keep an eye here to try and help test if I can, when new versions come.
[Android Apps and Games] blueberry.sky:
Here is a new upload. I also removed one of the unnecessary toasts, so I guess it's v1.1 now. :confused:
[Android Apps and Games] HikingMoose:
Shoot. I have a Nexus 6P, and the new ROM updates with the March security patch broke the app. The ROMs run fine until you plug in for the first time with this app installed, then all hell breaks loose and 75% of your apps stop working. I really need this app though! Maybe I'll roll back ROMs....
[Android Apps and Games] aaron74:
Neat idea, I've never thought about before. Thanks for sharing!
[Android Apps and Games] sriharshaarangi:
Even I have March Security update installed on my op3 (open beta 12, 7.1.1), but everything is working fine........
[Android Apps and Games] HikingMoose:
EDIT: So the force closings I was having, just happened again without this app installed. So it's likely not the app, unless it's changed settings that persist even after uninstall? But I don't think it does. So ignore my earlier post.
[Android Apps and Games] billubakra:
An offtopic question, are the batteries in cordless phones(landline phones) also lithium ones? The cordless phones with battery backup are advised to be power plugged even when they are fully charged. Won't that hurt the life of the batteries if they are plugged 24x7 considering that there is no power cut?
[Android Apps and Games] toskala:
Often those are nimh batteries, there are lithium based ones around and as far as I know their numbers are increasing.

However, their charging cradle should have some sort of charge management to prevent over charging. Speaking of battery life the same problems occur as in every other lithium battery.
[Android Apps and Games] billubakra:
Thanks for replying. Yes the phone about which I am talking about has Ni-MH rechargable batteries. Are the lithium one's better? I read in this thread that the phones should be charged between say 20%-90%. Does that hold true for the landline ones also?
[Android Apps and Games] toskala:
In general nimh batteries should never be overcharged, which is the reason nimh chargers do usually have a feature called trickle charge. It ensures the battery is always at the optimum charge. This usually is done because nimh batteries do have a pretty hefty self discharge effect within the first 24h they often tend to lose about 20% current. There are low self discharge nimh batteries available, however cordless phone manufacturers don't care.

The major downside is, they can lose about 0,05V if constantly charged or overcharged, but that shouldn't affect a cordless phone.

Edit: corrected voltage
[Android Apps and Games] HikingMoose:
Yes, it does hurt them. My parents still have a land line (probably the only customer left for their phone company), and even the phones are new, they can have 12+ conversions off charge. After a couple year's, they only get 1-3 conversions per charge.

There's new battery technology in development, I just don't understand why it's taking so long to be released. Salt water is far superior lithium. No memory, more capacity, less to no degradation, and IT CAN'T EXPLODE!
[Android Apps and Games] billubakra:
I don't think that my cordless phone has the trickle charge thing. Is there anything that I can do to extend the battery life or any tip of any sort?

....

No memory, more capacity, less to no degradation.... Maybe it means low sales for the manufacturers so that is why they are not releasing the same.
[Android Apps and Games] HikingMoose:
Precisely. Exactly like hydrogen fuel cells and electric vehicles. Big oil buys up all the patents.
[Android Apps and Games] gohamstergo:
can you guys move to PM? no need to reply to me, that would add more clutter. thanks ;)
[Android Apps and Games] Joe333x:
Just want to post a small bug report. On my Galaxy S5 running Lineage OS 16 the notification does not update the volts and temp. Took a screenshot so you can see the app shows current info while the notification does not.
[Android Apps and Games] Icetea:
Do somebody know why the version 1.1.1 from here and the version from playstore have different sizes?

Normally they should have the same size, or not?

And do this app stop qi inductive charge too?

Btw.: It seems, that further developement is interrupted.
[Android Apps and Games] soulstormfan:
It works perfectly on oreo and impossible to make it work on pie so maybe they will continue decelopment when android 10 will be stable
[Android Apps and Games] guest4711:
For me it's working on pie, too... It depends on your kernel - if your kernel does not offer the needed controls you are out of luck.
[Android Apps and Games] soulstormfan:
Your rom can be pie but firmware oreo. None of pie firmware kernels work with battery charge limit for me. I have pie rom but downgraded firmware to oreo. Your rom provider couldve just updated your rom to pie but not firmware. Might be wrong tho. Everyones phone is different
[Android Apps and Games] x86cpu:
Works for me. Lineage Asus Zenfone 6. Pie kernel, pie firmware. Also a Pixel 3. Lineage, pie kernel and pie firmware.

But like you said it will all be dependent on each phone.
[Android Apps and Games] eraser0:
Just wanted to say

This app killed my battery
[Android Apps and Games] soulstormfan:
Battery was killed by you not by this app. Im using this app over a year and didnt notice any battery damage.
[Android Apps and Games] selfishjelly:
Can you share any details? Saved my battery so far.
[Android Apps and Games] eraser0:
Well, the primary thing (n6p) I was using it in order to protect the battery while sleeping and the charger is connected, then my battery died (device related, no compatibility issues)
[Android Apps and Games] selfishjelly:
What did you set the limits to and how did the battery die? I leave it overnight at 75% (under 4V) with no ill effects. (Mi 5s, luckily for me, the phone stays powered from charger and doesn't cycle the battery)
[Android Apps and Games] post-mortem:
Are you saying that the app allowed your battery to overcharge?
[Android Apps and Games] larsdennert:
One plus 7pro updated to Android 10 the control filename appears to have changed to

/sys/class/power_supply/battery/charging_enabled

I think it was charge_enabled previously

---------- Post added at 12:02 PM ---------- Previous post was at 12:02 PM ----------

One plus 7pro updated to Android 10 the control filename appears to have changed to

/sys/class/power_supply/battery/charging_enabled

I think it was charge_enabled previously
[Android Apps and Games] palmbeach05:
What do you expect? The app is a non-sar era app, and you're trying it on a sar system.
[Android Apps and Games] amn1987:
+1. Almost 3 years in 2 devices. Battery life is still more than decent. No more than the expected wear levels.
[Android Apps and Games] Sadegh:
I want to use the app on amazfit pace watch

I looked in sys/class/power_state there is no file for battery, but present and state files are there.

but I cant edit these files to see if they can disable charging or not, and permission denied to push the file with adb.

can you help how to edit them?

thanks
[Android Apps and Games] larsdennert:
You have root on the watch? look in /sys/class/power_supply many devices vary.
[Android Apps and Games] RafalCOM:
Anyone has any luck on Pixel 4 XL?
[Android Apps and Games] palmbeach05:
Non-sar apk build designed and built for non-sar devices on a sar device. Think about that for a sec and tell me if there's going to be compatibility issues.....
[Android Apps and Games] Sadegh:
yes, it rooted

I found some files, but I cant edit them and adb pull and push not working on them.

It says permission denied.
[Android Apps and Games] RafalCOM:
Do you have any links so I can educate myself? Not sure what's the difference.
[Android Apps and Games] palmbeach05:
Sure, i can do that for you. From personal experience, i have built android 4.4, and have seen what the layout of a 10 looks like. What this page is saying speaks the truth, the stucture has changed.

https://source.android.com/devices/bootloader/system-as-root

Unfortunately, this means that this app will have to get rewritten. Options that i see are 1. Release two versions of the app, one for sar and one for non-sar, or 2. Release a unified app build that can be compatible with both sar and non-sar.
[Android Apps and Games] x86cpu:
The only thing this apk does is write (with root) into /sys which is not on /system or sat. /sys is kernel related, so as long as you have root and have a proper path for the limit, why not? I don't have a Pixel 4 though. I do have a sar device pie and seems to work just fine.
[Android Apps and Games] RafalCOM:
So I am not sure what would be a difference between Pixel 2 XL on Android 10 and P4 XL. It works fine on P2 XL and it's the same OS and partitions are the same as well I think.
[Android Apps and Games] guest4711:
The kernel used in P4 XL may not provide the necessary controls...
[Android Apps and Games] RafalCOM:
That's why I asked about any success on P4 but someone answered about non-sar and sar and I've got lost. My guess was I do not know which control file to pick or maybe there is a new one not yet implemented.
[Android Apps and Games] Ridianod:
Guys i cant edit voltage_max with root Explorer latest version on xiaomi mi9t. Which app do you use to edit voltage_max? Thanks.
[Android Apps and Games] zputnyq:
You can try by going to setting of battery charge limit and then choose "Configurable CTRL File Data".
[Android Apps and Games] suhailsayed:
Can you please advise what these last two settings do, and is it better to turn it on or off?
[Android Apps and Games] Ridianod:
Ty so much. It limit the voltage but this time wait at %75 but never stop charging.

edit: found it. I disabled CTRL file in option. then I used adb to change voltage_max. Here is my code;

adb root
adb shell
su
chmod 644 /sys/class/power_supply/battery/voltage_max
echo '4200000' > /sys/class/power_supply/battery/voltage_max
[Android Apps and Games] Infestor:
I got it working on my Pixel 4 XL by digging around the control files and finding one that sounds right :D. The file you need to set is:

/sys/class/power_supply/charger/charge_disable

Enabled value: 0

Disabled value: 1

I have attached a screenshot how I set it up on my phone.
[Android Apps and Games] Rukbat:
Any chance of getting a selectable notification tone added? (I have one for low battery that GSam kicks off and I was using acc to charge with GSam kicking off a "charge reached" tone. One app will make it easier, but I'd like to be able to select the notification.)
[Android Apps and Games] Tuxshine:
This app works fine after all. But Android Auto and the connectivity to my car environment don't work anymore while the limitations are enabled in this app.

I installed this app as system app on my rooted Galaxy S7 (SM-G930F).

If charge limit is disabled, everything works fine and I can use Android Auto (Google Maps, TuneIn, Deezer ... ) in my car and make hands-free phone calls.

Is there any way to change this behaviour? I think, it is recommended that the smartphone don't charge the whole time at 100%.
[Android Apps and Games] post-mortem:
Can you clarify what you mean by this? What exactly are the connectivity issues? Does the Bluetooth remain connected?

Also, when do the issues appear? If the app is enabled but the battery level is low, do you have problems? Please give more details.