Badhri Jagan Sridharan | e180186 | 2015-08-28 19:32:45 -0700 | [diff] [blame] | 1 | on property:sys.usb.config=none && property:sys.usb.configfs=1 |
| 2 | write /config/usb_gadget/g1/UDC "none" |
| 3 | stop adbd |
Winter Wang | 46c313b | 2016-03-24 17:45:37 +0800 | [diff] [blame] | 4 | setprop sys.usb.ffs.ready 0 |
Jerry Zhang | fb256b6 | 2017-04-14 18:48:24 -0700 | [diff] [blame] | 5 | setprop sys.usb.ffs.mtp.ready 0 |
Badhri Jagan Sridharan | e180186 | 2015-08-28 19:32:45 -0700 | [diff] [blame] | 6 | write /config/usb_gadget/g1/bDeviceClass 0 |
Badhri Jagan Sridharan | a6c377b | 2015-09-03 12:12:44 -0700 | [diff] [blame] | 7 | write /config/usb_gadget/g1/bDeviceSubClass 0 |
| 8 | write /config/usb_gadget/g1/bDeviceProtocol 0 |
Amit Pundir | aae7b49 | 2016-06-07 19:35:23 +0530 | [diff] [blame] | 9 | rm /config/usb_gadget/g1/configs/b.1/f1 |
| 10 | rm /config/usb_gadget/g1/configs/b.1/f2 |
| 11 | rm /config/usb_gadget/g1/configs/b.1/f3 |
| 12 | rmdir /config/usb_gadget/g1/functions/rndis.gs4 |
Badhri Jagan Sridharan | a6c377b | 2015-09-03 12:12:44 -0700 | [diff] [blame] | 13 | setprop sys.usb.state ${sys.usb.config} |
| 14 | |
Jerry Zhang | 75f8d89 | 2017-04-26 17:11:00 -0700 | [diff] [blame] | 15 | on property:init.svc.adbd=stopped |
| 16 | setprop sys.usb.ffs.ready 0 |
| 17 | |
Badhri Jagan Sridharan | a6c377b | 2015-09-03 12:12:44 -0700 | [diff] [blame] | 18 | on property:sys.usb.config=adb && property:sys.usb.configfs=1 |
| 19 | start adbd |
| 20 | |
| 21 | on property:sys.usb.ffs.ready=1 && property:sys.usb.config=adb && property:sys.usb.configfs=1 |
| 22 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb" |
Badhri Jagan Sridharan | a6c377b | 2015-09-03 12:12:44 -0700 | [diff] [blame] | 23 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1 |
| 24 | write /config/usb_gadget/g1/UDC ${sys.usb.controller} |
Badhri Jagan Sridharan | e180186 | 2015-08-28 19:32:45 -0700 | [diff] [blame] | 25 | setprop sys.usb.state ${sys.usb.config} |
| 26 | |
Jerry Zhang | fb256b6 | 2017-04-14 18:48:24 -0700 | [diff] [blame] | 27 | on property:sys.usb.ffs.mtp.ready=1 && property:sys.usb.config=mtp && property:sys.usb.configfs=1 |
Badhri Jagan Sridharan | a6c377b | 2015-09-03 12:12:44 -0700 | [diff] [blame] | 28 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp" |
Badhri Jagan Sridharan | e180186 | 2015-08-28 19:32:45 -0700 | [diff] [blame] | 29 | symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1 |
| 30 | write /config/usb_gadget/g1/UDC ${sys.usb.controller} |
| 31 | setprop sys.usb.state ${sys.usb.config} |
| 32 | |
| 33 | on property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1 |
| 34 | start adbd |
| 35 | |
Jerry Zhang | fb256b6 | 2017-04-14 18:48:24 -0700 | [diff] [blame] | 36 | on property:sys.usb.ffs.ready=1 && property:sys.usb.ffs.mtp.ready=1 && \ |
| 37 | property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1 |
Badhri Jagan Sridharan | a6c377b | 2015-09-03 12:12:44 -0700 | [diff] [blame] | 38 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_adb" |
Badhri Jagan Sridharan | e180186 | 2015-08-28 19:32:45 -0700 | [diff] [blame] | 39 | symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1 |
| 40 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 |
| 41 | write /config/usb_gadget/g1/UDC ${sys.usb.controller} |
| 42 | setprop sys.usb.state ${sys.usb.config} |
| 43 | |
Jerry Zhang | fb256b6 | 2017-04-14 18:48:24 -0700 | [diff] [blame] | 44 | on property:sys.usb.ffs.mtp.ready=1 && property:sys.usb.config=ptp && property:sys.usb.configfs=1 |
Badhri Jagan Sridharan | a6c377b | 2015-09-03 12:12:44 -0700 | [diff] [blame] | 45 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ptp" |
Badhri Jagan Sridharan | e180186 | 2015-08-28 19:32:45 -0700 | [diff] [blame] | 46 | symlink /config/usb_gadget/g1/functions/ptp.gs1 /config/usb_gadget/g1/configs/b.1/f1 |
| 47 | write /config/usb_gadget/g1/UDC ${sys.usb.controller} |
| 48 | setprop sys.usb.state ${sys.usb.config} |
| 49 | |
| 50 | on property:sys.usb.config=ptp,adb && property:sys.usb.configfs=1 |
| 51 | start adbd |
| 52 | |
Jerry Zhang | fb256b6 | 2017-04-14 18:48:24 -0700 | [diff] [blame] | 53 | on property:sys.usb.ffs.ready=1 && property:sys.usb.ffs.mtp.ready=1 && \ |
| 54 | property:sys.usb.config=ptp,adb && property:sys.usb.configfs=1 |
Badhri Jagan Sridharan | a6c377b | 2015-09-03 12:12:44 -0700 | [diff] [blame] | 55 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ptp_adb" |
Badhri Jagan Sridharan | e180186 | 2015-08-28 19:32:45 -0700 | [diff] [blame] | 56 | symlink /config/usb_gadget/g1/functions/ptp.gs1 /config/usb_gadget/g1/configs/b.1/f1 |
| 57 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 |
| 58 | write /config/usb_gadget/g1/UDC ${sys.usb.controller} |
| 59 | setprop sys.usb.state ${sys.usb.config} |
Badhri Jagan Sridharan | a6c377b | 2015-09-03 12:12:44 -0700 | [diff] [blame] | 60 | |
| 61 | on property:sys.usb.config=accessory && property:sys.usb.configfs=1 |
| 62 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "accessory" |
Badhri Jagan Sridharan | a6c377b | 2015-09-03 12:12:44 -0700 | [diff] [blame] | 63 | symlink /config/usb_gadget/g1/functions/accessory.gs2 /config/usb_gadget/g1/configs/b.1/f1 |
| 64 | write /config/usb_gadget/g1/UDC ${sys.usb.controller} |
| 65 | setprop sys.usb.state ${sys.usb.config} |
| 66 | |
| 67 | on property:sys.usb.config=accessory,adb && property:sys.usb.configfs=1 |
| 68 | start adbd |
| 69 | |
| 70 | on property:sys.usb.ffs.ready=1 && property:sys.usb.config=accessory,adb && property:sys.usb.configfs=1 |
| 71 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "accessory_adb" |
Badhri Jagan Sridharan | a6c377b | 2015-09-03 12:12:44 -0700 | [diff] [blame] | 72 | symlink /config/usb_gadget/g1/functions/accessory.gs2 /config/usb_gadget/g1/configs/b.1/f1 |
| 73 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 |
| 74 | write /config/usb_gadget/g1/UDC ${sys.usb.controller} |
| 75 | setprop sys.usb.state ${sys.usb.config} |
| 76 | |
| 77 | on property:sys.usb.config=audio_source && property:sys.usb.configfs=1 |
| 78 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "audiosource" |
Winter Wang | 60c763e | 2016-06-06 13:16:11 +0800 | [diff] [blame] | 79 | symlink /config/usb_gadget/g1/functions/audio_source.gs3 /config/usb_gadget/g1/configs/b.1/f1 |
Badhri Jagan Sridharan | a6c377b | 2015-09-03 12:12:44 -0700 | [diff] [blame] | 80 | write /config/usb_gadget/g1/UDC ${sys.usb.controller} |
| 81 | setprop sys.usb.state ${sys.usb.config} |
| 82 | |
| 83 | on property:sys.usb.config=audio_source,adb && property:sys.usb.configfs=1 |
| 84 | start adbd |
| 85 | |
| 86 | on property:sys.usb.ffs.ready=1 && property:sys.usb.config=audio_source,adb && property:sys.usb.configfs=1 |
| 87 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "audiosource_adb" |
Winter Wang | 60c763e | 2016-06-06 13:16:11 +0800 | [diff] [blame] | 88 | symlink /config/usb_gadget/g1/functions/audio_source.gs3 /config/usb_gadget/g1/configs/b.1/f1 |
Badhri Jagan Sridharan | a6c377b | 2015-09-03 12:12:44 -0700 | [diff] [blame] | 89 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 |
| 90 | write /config/usb_gadget/g1/UDC ${sys.usb.controller} |
| 91 | setprop sys.usb.state ${sys.usb.config} |
| 92 | |
| 93 | on property:sys.usb.config=accessory,audio_source && property:sys.usb.configfs=1 |
| 94 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "accessory_audiosource" |
Badhri Jagan Sridharan | a6c377b | 2015-09-03 12:12:44 -0700 | [diff] [blame] | 95 | symlink /config/usb_gadget/g1/functions/accessory.gs2 /config/usb_gadget/g1/configs/b.1/f1 |
| 96 | symlink /config/usb_gadget/g1/functions/audio_source.gs3 /config/usb_gadget/g1/configs/b.1/f2 |
| 97 | write /config/usb_gadget/g1/UDC ${sys.usb.controller} |
| 98 | setprop sys.usb.state ${sys.usb.config} |
| 99 | |
| 100 | on property:sys.usb.config=accessory,audio_source,adb && property:sys.usb.configfs=1 |
| 101 | start adbd |
| 102 | |
| 103 | on property:sys.usb.ffs.ready=1 && property:sys.usb.config=accessory,audio_source,adb && property:sys.usb.configfs=1 |
| 104 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "accessory_audiosource_adb" |
Badhri Jagan Sridharan | a6c377b | 2015-09-03 12:12:44 -0700 | [diff] [blame] | 105 | symlink /config/usb_gadget/g1/functions/accessory.gs2 /config/usb_gadget/g1/configs/b.1/f1 |
| 106 | symlink /config/usb_gadget/g1/functions/audio_source.gs3 /config/usb_gadget/g1/configs/b.1/f2 |
| 107 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3 |
| 108 | write /config/usb_gadget/g1/UDC ${sys.usb.controller} |
| 109 | setprop sys.usb.state ${sys.usb.config} |
| 110 | |
| 111 | on property:sys.usb.config=midi && property:sys.usb.configfs=1 |
| 112 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "midi" |
Badhri Jagan Sridharan | a6c377b | 2015-09-03 12:12:44 -0700 | [diff] [blame] | 113 | symlink /config/usb_gadget/g1/functions/midi.gs5 /config/usb_gadget/g1/configs/b.1/f1 |
| 114 | write /config/usb_gadget/g1/UDC ${sys.usb.controller} |
| 115 | setprop sys.usb.state ${sys.usb.config} |
| 116 | |
| 117 | on property:sys.usb.config=midi,adb && property:sys.usb.configfs=1 |
| 118 | start adbd |
| 119 | |
| 120 | on property:sys.usb.ffs.ready=1 && property:sys.usb.config=midi,adb && property:sys.usb.configfs=1 |
| 121 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "midi_adb" |
Badhri Jagan Sridharan | a6c377b | 2015-09-03 12:12:44 -0700 | [diff] [blame] | 122 | symlink /config/usb_gadget/g1/functions/midi.gs5 /config/usb_gadget/g1/configs/b.1/f1 |
| 123 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 |
| 124 | write /config/usb_gadget/g1/UDC ${sys.usb.controller} |
| 125 | setprop sys.usb.state ${sys.usb.config} |
| 126 | |
| 127 | on property:sys.usb.config=rndis && property:sys.usb.configfs=1 |
Amit Pundir | aae7b49 | 2016-06-07 19:35:23 +0530 | [diff] [blame] | 128 | mkdir /config/usb_gadget/g1/functions/rndis.gs4 |
Badhri Jagan Sridharan | a6c377b | 2015-09-03 12:12:44 -0700 | [diff] [blame] | 129 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis" |
Badhri Jagan Sridharan | a6c377b | 2015-09-03 12:12:44 -0700 | [diff] [blame] | 130 | symlink /config/usb_gadget/g1/functions/rndis.gs4 /config/usb_gadget/g1/configs/b.1/f1 |
| 131 | write /config/usb_gadget/g1/UDC ${sys.usb.controller} |
| 132 | setprop sys.usb.state ${sys.usb.config} |
| 133 | |
| 134 | on property:sys.usb.config=rndis,adb && property:sys.usb.configfs=1 |
| 135 | start adbd |
| 136 | |
| 137 | on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,adb && property:sys.usb.configfs=1 |
Amit Pundir | aae7b49 | 2016-06-07 19:35:23 +0530 | [diff] [blame] | 138 | mkdir /config/usb_gadget/g1/functions/rndis.gs4 |
Badhri Jagan Sridharan | a6c377b | 2015-09-03 12:12:44 -0700 | [diff] [blame] | 139 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_adb" |
Badhri Jagan Sridharan | a6c377b | 2015-09-03 12:12:44 -0700 | [diff] [blame] | 140 | symlink /config/usb_gadget/g1/functions/rndis.gs4 /config/usb_gadget/g1/configs/b.1/f1 |
| 141 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 |
| 142 | write /config/usb_gadget/g1/UDC ${sys.usb.controller} |
| 143 | setprop sys.usb.state ${sys.usb.config} |