summaryrefslogtreecommitdiffstats
path: root/etc/init.rc
diff options
context:
space:
mode:
Diffstat (limited to 'etc/init.rc')
-rw-r--r--etc/init.rc18
1 files changed, 15 insertions, 3 deletions
diff --git a/etc/init.rc b/etc/init.rc
index a675a4b0c..554d4e634 100644
--- a/etc/init.rc
+++ b/etc/init.rc
@@ -31,8 +31,20 @@ service recovery /sbin/recovery
service adbd /sbin/adbd recovery
disabled
-on property:persist.service.adb.enable=1
+# Always start adbd on userdebug and eng builds
+on property:ro.debuggable=1
+ 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/functions adb
+ write /sys/class/android_usb/android0/enable 1
+ write /sys/class/android_usb/android0/iManufacturer $ro.product.manufacturer
+ write /sys/class/android_usb/android0/iProduct $ro.product.model
+ write /sys/class/android_usb/android0/iSerial $ro.serialno
start adbd
-on property:persist.service.adb.enable=0
- stop adbd
+# Restart adbd so it can run as root
+on property:service.adb.root=1
+ write /sys/class/android_usb/android0/enable 0
+ restart adbd
+ write /sys/class/android_usb/android0/enable 1