Android disable USB Device Port

A friends USB port of his phone broke and he got real high battery drain on his sasung galaxy s3.
A quick view revealed the culprid… The USB driver constantly checked the broken usb port.

After we disabled the port, the batteryusage went down.

Use this command in a android terminal emulator of your choice. You also need Root privileges:

echo 0 > /sys/devices/virtual/android_usb/android0/enable
or this, if it doesn’t work:

su -c ‘echo 0 > /sys/devices/virtual/android_usb/android0/enable’
To automate it, you need to make a script and put it in your initd path /system/etc/init.d

Name it for example:  /system/etc/init.d/usbport_off

echo 0 > /sys/devices/virtual/android_usb/android0/enable

Now make it executable:

chmod +x /system/etc/init.d/usbport_off
If that doesn’t work, you could try this:

setprop persist.sys.usb.config ”
setprop sys.usb.config ‘