From c7eee6fef0263ed4eb5aa0d934a0a8c972d41b30 Mon Sep 17 00:00:00 2001 From: bigbiff bigbiff Date: Tue, 2 Sep 2014 18:59:01 -0400 Subject: add mtp responder to TWRP. Big thanks to Dees_Troy for helping with the implementation. Change-Id: I6c9c522b9c9de5dc139e2ecb0141008182ba07f0 --- etc/init.rc | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'etc') diff --git a/etc/init.rc b/etc/init.rc index 39724d066..dda009b84 100644 --- a/etc/init.rc +++ b/etc/init.rc @@ -23,7 +23,7 @@ on init write /sys/class/android_usb/android0/enable 0 write /sys/class/android_usb/android0/idVendor 18D1 - write /sys/class/android_usb/android0/idProduct D001 + write /sys/class/android_usb/android0/idProduct D002 write /sys/class/android_usb/android0/functions adb write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer} write /sys/class/android_usb/android0/iProduct ${ro.product.model} @@ -51,6 +51,25 @@ on property:sys.storage.ums_enabled=0 write /sys/class/android_usb/android0/functions adb write /sys/class/android_usb/android0/enable ${service.adb.root} +on property:sys.usb.config=none + stop adbd + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/bDeviceClass 0 + +on property:sys.usb.config=mtp,adb + stop adbd + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/functions mtp,adb + write /sys/class/android_usb/android0/enable 1 + start adbd + +on property:sys.usb.config=adb + stop adbd + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/functions adb + write /sys/class/android_usb/android0/enable ${service.adb.root} + start adbd + service ueventd /sbin/ueventd critical @@ -73,4 +92,4 @@ on property:ro.debuggable=1 on property:service.adb.root=1 write /sys/class/android_usb/android0/enable 0 restart adbd - write /sys/class/android_usb/android0/enable 1 + write /sys/class/android_usb/android0/enable 1 \ No newline at end of file -- cgit v1.2.3