如何在ADB连接期间禁用电池充电? [英] How to disable battery charging during ADB connection?
问题描述
问题描述:每当我在PC和手机之间连接USB电缆时,电池就会自动充电.我想使用ADB协议,但是我不想在ADB连接期间给电池充电.是否可以关闭此充电?当然,我该怎么做呢?
Problem description: Each time wen I connect USB cable between PC and my mobile phone the battery automatically is charged. I want to use ADB protocol but I don't want to charge my battery during ADB connection. Is it possible to to turn off this charging? And ofcourse how can I do this?
环境:装有Android os 4及更高版本的手机
Environment: Mobile phone with Android os 4 and higher
我只需要提到我的参照设备可以在android 5上运行,因此就没有/sys/class/power_supply/battery/force_usb_charging文件
I need only mention that my referential device working on android 5 so there is no /sys/class/power_supply/battery/force_usb_charging file
推荐答案
可能可以通过(root特权)完成:
Probably it can be done via (root privileges):
/sys/devices/battery.XX/power_supply/battery/hv_charger_set
0-禁用USB充电
1-启用USB充电
这篇关于如何在ADB连接期间禁用电池充电?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!