init.rc: Changes for new USB gadget drivers

Change-Id: I68fcf167c9fc71bb5f44793648a35d3181fd36d7
Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
Mike Lockwood 2011-06-08 17:40:00 -07:00
parent 9f7ad372b3
commit 352dfdfaea
1 changed files with 26 additions and 7 deletions

View File

@ -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