How to disable battery charging during ADB connection?

Description of the problem: Each time I connect a USB cable between a PC and a mobile phone, the battery automatically charges. I want to use the ADB protocol, but I do not want to charge my battery during the ADB connection. Can I turn off this charge? And of course, how can I do this?

Environment: Mobile phone with Android os 4 and above

I only need to mention that my linking device works on android 5, so there is no file / sys / class / power_supply / battery / force_usb_charging

+4
source share
3 answers

Dear, you can probably do it through (root privileges): /sys/devices/battery.XX/power_supply/battery/hv_charger_set 0 - Disable USB charging 1 - Enable USB charging

+1

BEWARE: adb shell dumpsys battery unplug MOCKS . USB-, , . , , , , Google , ...

, /sys/devices/battery.XX/power_supply/battery/hv_charger_set 0, , . , yotaphone 2 snapdragon 805 : /sys/devices/qpnp-charger-14/power_supply/battery/charging_enabled

, script, tasker ( root):

echo $1 > /sys/devices/qpnp-charger-14/power_supply/battery/charging_enabled

/data/setcharging.sh, script /data/setcharging.sh 0 /data/setcharging.sh 1 .

, USB-, , . , adb shell dumpsys battery unplug / reset, , , , tasker, , , , ve ...

, , (twrp) . , . , , , . , ( , adb).

, , , , USB-, , , , .

+1

All Articles