summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rootdir/init.rc33
1 files changed, 26 insertions, 7 deletions
diff --git a/rootdir/init.rc b/rootdir/init.rc
index a2c6beb..dc209f3 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -186,6 +186,9 @@ on post-fs-data
# Set indication (checked by vold) that we have finished this action
#setprop vold.post_fs_data_done 1
+ chown system system /sys/class/android_usb/android0/f_mass_storage/lun/file
+ chmod 0660 /sys/class/android_usb/android0/f_mass_storage/lun/file
+
on boot
# basic network init
ifup lo
@@ -325,6 +328,28 @@ on property:vold.decrypt=trigger_shutdown_framework
class_reset late_start
class_reset main
+# USB accessory configuration
+on property:sys.usb.config=accessory
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 18d1
+ write /sys/class/android_usb/android0/idProduct 2d00
+ write /sys/class/android_usb/android0/functions $sys.usb.config
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state $sys.usb.config
+
+# USB accessory configuration, with adb
+on property:sys.usb.config=accessory,adb
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 18d1
+ write /sys/class/android_usb/android0/idProduct 2d01
+ write /sys/class/android_usb/android0/functions $sys.usb.config
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state $sys.usb.config
+
+on property:persist.sys.usb.config=*
+ setprop sys.usb.config $persist.sys.usb.config
+
## Daemon processes to be run by init.
##
service ueventd /sbin/ueventd
@@ -341,7 +366,7 @@ service console /system/bin/sh
on property:ro.debuggable=1
start console
-# adbd is controlled by the persist.service.adb.enable system property
+# adbd is controlled via property triggers in init.<platform>.usb.rc
service adbd /sbin/adbd
class core
disabled
@@ -350,12 +375,6 @@ service adbd /sbin/adbd
on property:ro.kernel.qemu=1
start adbd
-on property:persist.service.adb.enable=1
- start adbd
-
-on property:persist.service.adb.enable=0
- stop adbd
-
service servicemanager /system/bin/servicemanager
class core
user system