Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Used to disable USB when switching states
- on property:sys.usb.config=none
- stop adbd
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/bDeviceClass 0
- setprop sys.usb.state $sys.usb.config
- # adb only USB configuration
- # This should only be used during device bringup
- # and as a fallback if the USB manager fails to set a standard configuration
- on property:sys.usb.config=adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 18d1
- write /sys/class/android_usb/android0/idProduct D002
- 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
- # 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
- # Used to set USB configuration at boot and to switch the configuration
- # when changing the default configuration
- on property:persist.sys.usb.config=*
- setprop sys.usb.config $persist.sys.usb.config
- # //--> Further on near the bottom ....
- # This property trigger has added to imitiate the previous behavior of "adb root".
- # The adb gadget driver used to reset the USB bus when the adbd daemon exited,
- # and the host side adb relied on this behavior to force it to reconnect with the
- # new adbd instance after init relaunches it. So now we force the USB bus to reset
- # here when adbd sets the service.adb.root property to 1. We also restart adbd here
- # rather than waiting for init to notice its death and restarting it so the timing
- # of USB resetting and adb restarting more closely matches the previous behavior.
- on property:service.adb.root=1
- write /sys/class/android_usb/android0/enable 0
- restart adbd
- write /sys/class/android_usb/android0/enable 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement