1 # Copyright 2012 The Android Open Source Project 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 15 on init 16 write /sys/class/android_usb/android0/f_rndis/manufacturer LGE 17 write /sys/class/android_usb/android0/f_rndis/vendorID 18D1 18 write /sys/class/android_usb/android0/f_rndis/wceis 1 19 20 on boot 21 write /sys/class/android_usb/android0/iSerial $ro.serialno 22 write /sys/class/android_usb/android0/iManufacturer $ro.product.manufacturer 23 write /sys/class/android_usb/android0/iProduct $ro.product.model 24 write /sys/module/rmnet_usb/parameters/rmnet_data_init 1 25 26 # MTP 27 on property:sys.usb.config=mtp 28 stop adbd 29 write /sys/class/android_usb/android0/enable 0 30 write /sys/class/android_usb/android0/idVendor 18D1 31 write /sys/class/android_usb/android0/idProduct 4EE1 32 write /sys/class/android_usb/android0/bDeviceClass 0 33 write /sys/class/android_usb/android0/bDeviceSubClass 0 34 write /sys/class/android_usb/android0/bDeviceProtocol 0 35 write /sys/class/android_usb/android0/functions mtp 36 write /sys/class/android_usb/android0/enable 1 37 setprop sys.usb.state ${sys.usb.config} 38 39 on property:sys.usb.config=mtp,adb 40 write /sys/class/android_usb/android0/enable 0 41 write /sys/class/android_usb/android0/idVendor 18D1 42 write /sys/class/android_usb/android0/idProduct 4EE2 43 write /sys/class/android_usb/android0/bDeviceClass 0 44 write /sys/class/android_usb/android0/bDeviceSubClass 0 45 write /sys/class/android_usb/android0/bDeviceProtocol 0 46 write /sys/class/android_usb/android0/functions mtp,adb 47 write /sys/class/android_usb/android0/enable 1 48 start adbd 49 setprop sys.usb.state ${sys.usb.config} 50 51 # rndis 52 on property:sys.usb.config=rndis 53 stop adbd 54 write /sys/class/android_usb/android0/enable 0 55 write /sys/class/android_usb/android0/idVendor 18D1 56 write /sys/class/android_usb/android0/idProduct 4EE3 57 write /sys/class/android_usb/android0/bDeviceClass 239 58 write /sys/class/android_usb/android0/bDeviceSubClass 2 59 write /sys/class/android_usb/android0/bDeviceProtocol 1 60 write /sys/class/android_usb/android0/functions rndis 61 write /sys/class/android_usb/android0/enable 1 62 setprop sys.usb.state ${sys.usb.config} 63 64 on property:sys.usb.config=rndis,adb 65 write /sys/class/android_usb/android0/enable 0 66 write /sys/class/android_usb/android0/idVendor 18D1 67 write /sys/class/android_usb/android0/idProduct 4EE4 68 write /sys/class/android_usb/android0/bDeviceClass 239 69 write /sys/class/android_usb/android0/bDeviceSubClass 2 70 write /sys/class/android_usb/android0/bDeviceProtocol 1 71 write /sys/class/android_usb/android0/functions rndis,adb 72 write /sys/class/android_usb/android0/enable 1 73 start adbd 74 setprop sys.usb.state ${sys.usb.config} 75 76 # PTP 77 on property:sys.usb.config=ptp 78 stop adbd 79 write /sys/class/android_usb/android0/enable 0 80 write /sys/class/android_usb/android0/idVendor 18D1 81 write /sys/class/android_usb/android0/idProduct 4EE5 82 write /sys/class/android_usb/android0/bDeviceClass 0 83 write /sys/class/android_usb/android0/bDeviceSubClass 0 84 write /sys/class/android_usb/android0/bDeviceProtocol 0 85 write /sys/class/android_usb/android0/functions ptp 86 write /sys/class/android_usb/android0/enable 1 87 setprop sys.usb.state ${sys.usb.config} 88 89 on property:sys.usb.config=ptp,adb 90 write /sys/class/android_usb/android0/enable 0 91 write /sys/class/android_usb/android0/idVendor 18D1 92 write /sys/class/android_usb/android0/idProduct 4EE6 93 write /sys/class/android_usb/android0/bDeviceClass 0 94 write /sys/class/android_usb/android0/bDeviceSubClass 0 95 write /sys/class/android_usb/android0/bDeviceProtocol 0 96 write /sys/class/android_usb/android0/functions ptp,adb 97 write /sys/class/android_usb/android0/enable 1 98 start adbd 99 setprop sys.usb.state ${sys.usb.config} 100 101 # diag 102 on property:sys.usb.config=diag 103 stop adbd 104 write /sys/class/android_usb/android0/enable 0 105 write /sys/class/android_usb/android0/idVendor 1004 106 write /sys/class/android_usb/android0/idProduct 631B 107 write /sys/class/android_usb/android0/bDeviceClass 239 108 write /sys/class/android_usb/android0/bDeviceSubClass 2 109 write /sys/class/android_usb/android0/bDeviceProtocol 1 110 write /sys/class/android_usb/android0/f_acm/acm_transports hsic 111 write /sys/class/android_usb/android0/f_acm/acm_transport_names serial_hsic 112 write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm 113 write /sys/class/android_usb/android0/functions acm,diag,mtp,adb 114 write /sys/class/android_usb/android0/enable 1 115 start adbd 116 setprop sys.usb.state ${sys.usb.config} 117 118 on property:sys.usb.config=diag,adb 119 stop adbd 120 write /sys/class/android_usb/android0/enable 0 121 write /sys/class/android_usb/android0/idVendor 1004 122 write /sys/class/android_usb/android0/idProduct 631B 123 write /sys/class/android_usb/android0/bDeviceClass 239 124 write /sys/class/android_usb/android0/bDeviceSubClass 2 125 write /sys/class/android_usb/android0/bDeviceProtocol 1 126 write /sys/class/android_usb/android0/f_acm/acm_transports hsic 127 write /sys/class/android_usb/android0/f_acm/acm_transport_names serial_hsic 128 write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm 129 write /sys/class/android_usb/android0/functions acm,diag,mtp,adb 130 write /sys/class/android_usb/android0/enable 1 131 start adbd 132 setprop sys.usb.state ${sys.usb.config} 133