How to stop an android device from being charged programmatically?

后端 未结 9 644
醉酒成梦
醉酒成梦 2020-12-23 13:20

Is there an Android API for stop charging even though physically the charging is on?

9条回答
  •  醉梦人生
    2020-12-23 14:02

    https://play.google.com/store/apps/details?id=es.guille.stopcharge uses echo "0" > /sys/class/power_supply/battery/device/charge. It works for me on a nexus 4 (rooted), as long as the device isn't fully charged (in a charging state).

    Also relevant: https://android.stackexchange.com/questions/15001/how-can-i-avoid-the-battery-charging-when-connected-via-usb

提交回复
热议问题