Limit Battey Charge % Android 11

Search This thread

hawkswind1

Senior Member
Jun 11, 2012
474
211
Anyone found a consistent way to limit battery charge % on Android 11? The custom settings I used with Battery Charge Limit app on 10 work intermittently on 11. Often times I'd wake up to 100% charge.
Currently I'm using Advanced Charging Controller magisk module with it's accompanying AccA app but often AccA gets killed in the background even after not optimizing it in battery optimization. The only workaround I've found is to create a macro that opens AccA every time I plug in the charger. With that step it's consistent but I'd like to find something not so hacky.
 

jljtgr

Senior Member
I've been running A11 for about a week and did not encounter any issues with Battery Charge Limit. Maybe make sure that it's not battery optimized? I have it "not optimized" because I'm paranoid about it, rather than having direct problems.
 

hawkswind1

Senior Member
Jun 11, 2012
474
211
I've been running A11 for about a week and did not encounter any issues with Battery Charge Limit. Maybe make sure that it's not battery optimized? I have it "not optimized" because I'm paranoid about it, rather than having direct problems.
I made sure battery charge limit wasn't optimized. You're using the same custom setting from android 10? Maybe I'll try it again
This the settings you have?

Path Data: /sys/class/power_supply/charger/charge_disable
Enable Value: 0
Disabled Value: 1
 
Last edited:

jljtgr

Senior Member
I made sure battery charge limit wasn't optimized. You're using the same custom setting from android 10? Maybe I'll try it again
I didn't change anything at all... and honestly with all of the other A11 problems I've been having... I didn't even think to check that it was working. It just has been. I also double-checked with AccuBattery and the history never shows above my limit.

This is my control file settings as seen on the main screen:
Code:
/sys/class/power_supply/charger/charge_disable, 0, 1
 
  • Like
Reactions: JuloGang

hawkswind1

Senior Member
Jun 11, 2012
474
211
I didn't change anything at all... and honestly with all of the other A11 problems I've been having... I didn't even think to check that it was working. It just has been. I also double-checked with AccuBattery and the history never shows above my limit.

This is my control file settings as seen on the main screen:
Code:
/sys/class/power_supply/charger/charge_disable, 0, 1

I think that's the custom setting probably restored from your Google backup. Same one I was using. I'm gonna try it again though, thanks
 

v12xke

Senior Member
Dec 5, 2010
2,140
680
The Woodlands, TX
Google Nexus 4
Nexus 7
Anyone found a consistent way to limit battery charge % on Android 11? The custom settings I used with Battery Charge Limit app on 10 work intermittently on 11. Often times I'd wake up to 100% charge. Currently I'm using Advanced Charging Controller magisk module with it's accompanying AccA app but often AccA gets killed in the background even after not optimizing it in battery optimization. The only workaround I've found is to create a macro that opens AccA every time I plug in the charger. With that step it's consistent but I'd like to find something not so hacky.
Have you tried Accubattery? Along with charge limiting it has other useful features, including reporting battery capacity vs. new (under health).
 

jljtgr

Senior Member
Have you tried Accubattery? Along with charge limiting it has other useful features, including reporting battery capacity vs. new (under health).
Accubattery is fine and all for reporting and giving an idea of where you want to stop charging... but it has no ability to limit charging. The only thing it can do is nag you to take the phone off the charger. This thread is about root applications actually blocking the phone from charging past a certain level without making the user do anything or even notifying the user about what's being done.
 

rcbjr2

Member
Aug 12, 2010
48
4
I realize this is a couple of months old. but I just got a new OnePlus 8T, now rooted, and I'm trying to use Battery Charge Limit on it. I can't quite figure out the settings to have it work consistently. Let's say the phone is already at 100% when I plug it in. Battery Charge Limit starts, but then it flip-flops between Charging and Not Charging, starting and restarting. The phone woke me up last night because it was making a ding every time Battery Charge Limit flipped between charging and not charging. One would think that if the phone was at 100% Battery Charge Limit would turn off charging and let it drop down to my 85% limit and then back up to 91%, but never got above 91%. Thoughts? Thanks.
 

jljtgr

Senior Member
I realize this is a couple of months old. but I just got a new OnePlus 8T, now rooted, and I'm trying to use Battery Charge Limit on it. I can't quite figure out the settings to have it work consistently. Let's say the phone is already at 100% when I plug it in. Battery Charge Limit starts, but then it flip-flops between Charging and Not Charging, starting and restarting. The phone woke me up last night because it was making a ding every time Battery Charge Limit flipped between charging and not charging. One would think that if the phone was at 100% Battery Charge Limit would turn off charging and let it drop down to my 85% limit and then back up to 91%, but never got above 91%. Thoughts? Thanks.
It's possible it's not configured correctly for your phone. You can also just disable that notification channel, since mostly it's just annoying. It constantly fliping might mean that there's more than one control file for your phone type and it's using an ineffectual one that the OS is overriding immediately. For example, the default one it detects for Pixel 4's is not the one it should use.
 

rcbjr2

Member
Aug 12, 2010
48
4
It's possible it's not configured correctly for your phone. You can also just disable that notification channel, since mostly it's just annoying. It constantly fliping might mean that there's more than one control file for your phone type and it's using an ineffectual one that the OS is overriding immediately. For example, the default one it detects for Pixel 4's is not the one it should use.
Thanks for the reply. The problem is that I use the notification to trigger Tasker profiles, so I was hoping to figure out a way to get it to stop flipping back and forth while also retaining the notification. I think it's just the standard control file since it's a OnePlus phone, but I'm not sure I can figure out otherwise. When I first start using BCL, I found the control file and was able to manipulate it with a SQL editor and Shell commands in Tasker, but I haven't poked around the OnePlus 8T that much yet.
 

jljtgr

Senior Member
Just as a PSA, I think Adaptive Charging from the January update can conflict with this. On days where I set a morning alarm, I found that my battery was more full than it should be. I suspect that Adaptive Charging does something that Battery Charge Limit cannot block. I won't know for a few days if turning this off in settings fixes things 100% or the January update just really screws with this.
 
  • Like
Reactions: Flyview

jljtgr

Senior Member
Well, as a root method it does seem to work. Depending on your taste, it might be cleaner than an app toggling a different variable. Of course you need an app to set the file back to 100 when you want it. Some Tasker widgets work for my purposes... could probably make it a QuickSettings toggle in the shade, actually.
 

WibblyW

Senior Member
May 24, 2011
741
137
Google Nexus 4
Moto X Play
Bottom of that thread, I was wondering specifically if there might be way to force an unrooted device to think it met one of these conditions, so it only charges to 80%.

Specific post link:

i.e.

... your phone automatically limits charging to about 80% under certain conditions:
  • Continuous charging under high battery drain conditions, like game play.
  • Continuous charging for four days or more.
 
Last edited:
  • Like
Reactions: JuloGang

jljtgr

Senior Member
I've done very little research on this, but I expect the ways to fool the phone into thinking those things are happening is even more complicated than using that root file control. Meaning also requiring root but manipulating other control files.

I suppose you could have a case and a ribbon USBC connector that fools the charging logic into thinking it is constantly connected to a hardware charger even though it's still at a net negative power. After 4 days of having the case on, it might work. I don't know why anyone would have already built something like that, however.
 

WibblyW

Senior Member
May 24, 2011
741
137
Google Nexus 4
Moto X Play
I would root my phone but, as my daily driver, I need things like banking apps to work. They (at least some) detect rooted phones and refuse to load as a security measure (which is probably a good thing) :-(
 

jljtgr

Senior Member
Banking apps are usually just a frontend to their website used API. They have no problem with you using a browser on a rooted phone or Linux PC, etc. Any app that stores sensitive data on your phone and relies 100% on the filesystem being locked down was created wrong and lazily. The only thing about banking apps that might be legitimate is when things like unique CC info is stored for NFC and using a TPM can't be assured. Most banking apps, however, do not store anything sensitive on your phone aside from a login token which all websites also do. (it's called a cookie)

My personal preference is that no app is better for me than being able to root my phone. I don't play mobile games that want to keep you from cheating and I don't even care about Google Pay, which I'm not sure has legitimate need to block root either... they just do it to keep banks happy, which as I suggested, I think they're full of BS.

The only thing more BS than this no-root nonsense from app companies is when carriers do it by locking bootloaders. I try to re-use my phones for as long as possible and without the ability to limit battery charge, the batteries swell and die quickly, every time. It's good news that Google added code where phones plugged in constantly will limit charge automatically... but I doubt there is a way to trick it from the outside. (without root)
 
  • Like
Reactions: craiger27

jljtgr

Senior Member
Back to the topic... I don't think I'm ready to trust the /sys/devices/platform/soc/soc:google,charger/charge_stop_level method. Several times I found my phone at low battery and not pulling any current from the USB port, but not losing charge either. It had put itself into a stalemate where it was stuck below 10% for hours. Resetting the value from 60 to 100 allowed charging again. The battery charge limit app never really caused this. So I guess I'm going back to the full app method.
 
  • Like
Reactions: JuloGang

JuloGang

Member
Oct 6, 2017
8
0
Back to the topic... I don't think I'm ready to trust the /sys/devices/platform/soc/soc:google,charger/charge_stop_level method. Several times I found my phone at low battery and not pulling any current from the USB port, but not losing charge either. It had put itself into a stalemate where it was stuck below 10% for hours. Resetting the value from 60 to 100 allowed charging again. The battery charge limit app never really caused this. So I guess I'm going back to the full app method.
I would like to definitely solve this problem I have been struggling with for years. What did you do, can you please help me? It seems extremely similar to what you wrote here.

I have been using battery charge limit on my Xiaomi Mi Mix (1st model) since android 7.1 (lineageos) (and I might have messed with a couple files, not sure, can't remember). When updating to android 9 (lineageos) couple years ago I started having the problem you described. Also I notice sometimes I plug the phone at safe levels such as 35% or 60% and it doesn't charge same thing. Also it only charges with certain chargers and not others.

Earlier today it was 11% battery, could not boot android, didn't charge. I got the idea for the first time to try booting in TWRP (on+volume up buttons) and it immediately started charging at full speed. So there's obviously nothing wrong in the hardware, it's software or just config.

I would like to definitely solve this problem, but I don't understand exactly what you did on your side to fix it. Please reply or message me if you have any suggestion :) Thank you!
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    I made sure battery charge limit wasn't optimized. You're using the same custom setting from android 10? Maybe I'll try it again
    I didn't change anything at all... and honestly with all of the other A11 problems I've been having... I didn't even think to check that it was working. It just has been. I also double-checked with AccuBattery and the history never shows above my limit.

    This is my control file settings as seen on the main screen:
    Code:
    /sys/class/power_supply/charger/charge_disable, 0, 1
    1
    Just as a PSA, I think Adaptive Charging from the January update can conflict with this. On days where I set a morning alarm, I found that my battery was more full than it should be. I suspect that Adaptive Charging does something that Battery Charge Limit cannot block. I won't know for a few days if turning this off in settings fixes things 100% or the January update just really screws with this.
    1
    Bottom of that thread, I was wondering specifically if there might be way to force an unrooted device to think it met one of these conditions, so it only charges to 80%.

    Specific post link:

    i.e.

    ... your phone automatically limits charging to about 80% under certain conditions:
    • Continuous charging under high battery drain conditions, like game play.
    • Continuous charging for four days or more.
    1
    Banking apps are usually just a frontend to their website used API. They have no problem with you using a browser on a rooted phone or Linux PC, etc. Any app that stores sensitive data on your phone and relies 100% on the filesystem being locked down was created wrong and lazily. The only thing about banking apps that might be legitimate is when things like unique CC info is stored for NFC and using a TPM can't be assured. Most banking apps, however, do not store anything sensitive on your phone aside from a login token which all websites also do. (it's called a cookie)

    My personal preference is that no app is better for me than being able to root my phone. I don't play mobile games that want to keep you from cheating and I don't even care about Google Pay, which I'm not sure has legitimate need to block root either... they just do it to keep banks happy, which as I suggested, I think they're full of BS.

    The only thing more BS than this no-root nonsense from app companies is when carriers do it by locking bootloaders. I try to re-use my phones for as long as possible and without the ability to limit battery charge, the batteries swell and die quickly, every time. It's good news that Google added code where phones plugged in constantly will limit charge automatically... but I doubt there is a way to trick it from the outside. (without root)