Share your experience!
Hello, I need a feature that allows me to stop charging the battery of my mobile phone.
I use android USB debugging, so my phone is always 100% charged. Being an electronics engineer I don't really like it, I'd rather stop the charge at a level of 80% and then leave my phone powered by the USB port.
I am a programmer and I saw that some phone models seemed to provide a flag to stop the phone charger:
/sys/class/power_supply/battery/charging_enabled
From: https://android.gadgethacks.com/how-to/set-charging-limit-your-android-device-avoid-excess-battery-w...
(Many other sites talk about this method).
Nevertheless, my phone (a Sony Xperia XZ2c) is not rooted, and I really (really really) don't want to root it, I risk losing DRM keys and I don't consider my phone as a toy but rather as a tool. I need to keep it intact for many reasons.
Could you provide us a new feature to limit battery charging? For more security it would not be very good to let the user cut the charger but rather offer him cut-off thresholds: from 70% to 95% in increments of 5% for example. It would prevent malicious applications from preventing the phone from charging.
If you know or can provide me with a method to access this flag (/sys/class/power_supply/battery/charging_enabled) without rooting my phone I would be grateful.
Thanks.