diff options
Diffstat (limited to 'etc/init.rc')
-rw-r--r-- | etc/init.rc | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/etc/init.rc b/etc/init.rc index 2adecb764..fa8fe269c 100644 --- a/etc/init.rc +++ b/etc/init.rc @@ -132,11 +132,9 @@ on property:sys.usb.config=adb on property:sys.usb.config=fastboot start fastbootd -on property:sys.usb.config=none - stop adbd - stop fastbootd - on property:sys.usb.config=none && property:sys.usb.configfs=0 + stop adbd + stop fastboot write /sys/class/android_usb/android0/enable 0 setprop sys.usb.state ${sys.usb.config} @@ -146,6 +144,12 @@ on property:sys.usb.config=adb && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 1 setprop sys.usb.state ${sys.usb.config} +on property:sys.usb.config=sideload && property:sys.usb.configfs=0 + write /sys/class/android_usb/android0/idProduct D001 + write /sys/class/android_usb/android0/functions adb + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + on property:sys.usb.config=fastboot && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/idProduct 4EE0 write /sys/class/android_usb/android0/functions fastboot @@ -155,10 +159,19 @@ on property:sys.usb.config=fastboot && property:sys.usb.configfs=0 # Configfs triggers on property:sys.usb.config=none && property:sys.usb.configfs=1 write /config/usb_gadget/g1/UDC "none" + stop adbd + stop fastbootd setprop sys.usb.ffs.ready 0 rm /config/usb_gadget/g1/configs/b.1/f1 setprop sys.usb.state ${sys.usb.config} +on property:sys.usb.config=sideload && property:sys.usb.ffs.ready=1 && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0xD001 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb" + symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + on property:sys.usb.config=adb && property:sys.usb.ffs.ready=1 && property:sys.usb.configfs=1 write /config/usb_gadget/g1/idProduct 0xD001 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb" |