summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2011-06-19 08:52:01 +0200
committerThe Android Automerger <android-build@android.com>2011-06-20 22:30:30 +0200
commit1fe452c4379ccd798034963c282d3659ff00ca8e (patch)
tree73834489d40ae7b537793bc2b9e6d7926fe8eba2
parentam f84b2524: am 6ebedf00: am 82da01d6: Merge from gingerbread (diff)
downloadandroid_bootable_recovery-1fe452c4379ccd798034963c282d3659ff00ca8e.tar
android_bootable_recovery-1fe452c4379ccd798034963c282d3659ff00ca8e.tar.gz
android_bootable_recovery-1fe452c4379ccd798034963c282d3659ff00ca8e.tar.bz2
android_bootable_recovery-1fe452c4379ccd798034963c282d3659ff00ca8e.tar.lz
android_bootable_recovery-1fe452c4379ccd798034963c282d3659ff00ca8e.tar.xz
android_bootable_recovery-1fe452c4379ccd798034963c282d3659ff00ca8e.tar.zst
android_bootable_recovery-1fe452c4379ccd798034963c282d3659ff00ca8e.zip
-rw-r--r--etc/init.rc30
1 files changed, 27 insertions, 3 deletions
diff --git a/etc/init.rc b/etc/init.rc
index a675a4b0c..e2b4236dd 100644
--- a/etc/init.rc
+++ b/etc/init.rc
@@ -31,8 +31,32 @@ service recovery /sbin/recovery
service adbd /sbin/adbd recovery
disabled
-on property:persist.service.adb.enable=1
+on property:persist.sys.usb.config=*
+ setprop sys.usb.config $persist.sys.usb.config
+
+#one of the following property triggers will enable adb if it is enabled in regular operation
+
+on property:sys.usb.config=mass_storage,adb
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 18d1
+ write /sys/class/android_usb/android0/idProduct Fec0
+ write /sys/class/android_usb/android0/functions $sys.usb.config
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+
+on property:sys.usb.config=mtp,adb
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 18d1
+ write /sys/class/android_usb/android0/idProduct Fec0
+ write /sys/class/android_usb/android0/functions $sys.usb.config
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+
+on property:sys.usb.config=ptp,adb
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 18d1
+ write /sys/class/android_usb/android0/idProduct Fec0
+ write /sys/class/android_usb/android0/functions $sys.usb.config
+ write /sys/class/android_usb/android0/enable 1
start adbd
-on property:persist.service.adb.enable=0
- stop adbd