sriharshaarangi / BatteryChargeLimit

GNU General Public License v3.0
382 stars 103 forks source link

Pixel 3 disables charging until control file manually written #214

Open Noorquacker opened 3 years ago

Noorquacker commented 3 years ago

Hi, I'm a Pixel 3 user and sometimes, my phone will stop charging indefinitely no matter if I enable or disable the app. My control file is /sys/class/power_supply/battery/input_suspend, and thankfully this app tells me that, otherwise I wouldn't have been able to figure out the following: Using Termux, cat /sys/class/power_supply/battery/input_suspend always returns 0, meaning that it should be charging, so it's not an app issue. Running echo 0 > /sys/class/power_supply/battery/input_suspend does nothing. However, doing echo 1 > /sys/class/power_supply/battery/input_suspend and then writing 0 to it will make it charge. I've now got a shell script in Termux for whenever my phone starts refusing to charge, all it does is write 1 and 0 to the control file and then it'll return to normal. This issue is really bad for the night, sometimes I come home with a battery at 50%, think I'm still able to use my phone without it dying, and end up waking up with a battery at 25%.

Possible solutions: Hands-free: if the app detects that it's a few percent below the minimum and still isn't charging, write 1 and 0 to the control file, maybe? I don't know if this is possible, but it's an idea and is the most convenient for users. On/Off: on/off buttons like #49 Reset button: have a button that force writes 1 and 0 to the control file to re-enable charging

milux commented 1 year ago

Have you tried the "enforce limit" option? That was exactly developed for such purposes...