blob: de1aab328bef0a2d953551dba3ed337fbe2f5a5c [file] [log] [blame]
Badhri Jagan Sridharane1801862015-08-28 19:32:45 -07001on property:sys.usb.config=none && property:sys.usb.configfs=1
2 write /config/usb_gadget/g1/UDC "none"
3 stop adbd
Winter Wang46c313b2016-03-24 17:45:37 +08004 setprop sys.usb.ffs.ready 0
Jerry Zhangfb256b62017-04-14 18:48:24 -07005 setprop sys.usb.ffs.mtp.ready 0
Badhri Jagan Sridharane1801862015-08-28 19:32:45 -07006 write /config/usb_gadget/g1/bDeviceClass 0
Badhri Jagan Sridharana6c377b2015-09-03 12:12:44 -07007 write /config/usb_gadget/g1/bDeviceSubClass 0
8 write /config/usb_gadget/g1/bDeviceProtocol 0
Amit Pundiraae7b492016-06-07 19:35:23 +05309 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 Sridharana6c377b2015-09-03 12:12:44 -070013 setprop sys.usb.state ${sys.usb.config}
14
Jerry Zhang75f8d892017-04-26 17:11:00 -070015on property:init.svc.adbd=stopped
16 setprop sys.usb.ffs.ready 0
17
Badhri Jagan Sridharana6c377b2015-09-03 12:12:44 -070018on property:sys.usb.config=adb && property:sys.usb.configfs=1
19 start adbd
20
21on 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 Sridharana6c377b2015-09-03 12:12:44 -070023 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 Sridharane1801862015-08-28 19:32:45 -070025 setprop sys.usb.state ${sys.usb.config}
26
Jerry Zhangfb256b62017-04-14 18:48:24 -070027on property:sys.usb.ffs.mtp.ready=1 && property:sys.usb.config=mtp && property:sys.usb.configfs=1
Badhri Jagan Sridharana6c377b2015-09-03 12:12:44 -070028 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp"
Badhri Jagan Sridharane1801862015-08-28 19:32:45 -070029 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
33on property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1
34 start adbd
35
Jerry Zhangfb256b62017-04-14 18:48:24 -070036on property:sys.usb.ffs.ready=1 && property:sys.usb.ffs.mtp.ready=1 && \
37property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1
Badhri Jagan Sridharana6c377b2015-09-03 12:12:44 -070038 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_adb"
Badhri Jagan Sridharane1801862015-08-28 19:32:45 -070039 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 Zhangfb256b62017-04-14 18:48:24 -070044on property:sys.usb.ffs.mtp.ready=1 && property:sys.usb.config=ptp && property:sys.usb.configfs=1
Badhri Jagan Sridharana6c377b2015-09-03 12:12:44 -070045 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ptp"
Badhri Jagan Sridharane1801862015-08-28 19:32:45 -070046 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
50on property:sys.usb.config=ptp,adb && property:sys.usb.configfs=1
51 start adbd
52
Jerry Zhangfb256b62017-04-14 18:48:24 -070053on property:sys.usb.ffs.ready=1 && property:sys.usb.ffs.mtp.ready=1 && \
54property:sys.usb.config=ptp,adb && property:sys.usb.configfs=1
Badhri Jagan Sridharana6c377b2015-09-03 12:12:44 -070055 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ptp_adb"
Badhri Jagan Sridharane1801862015-08-28 19:32:45 -070056 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 Sridharana6c377b2015-09-03 12:12:44 -070060
61on 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 Sridharana6c377b2015-09-03 12:12:44 -070063 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
67on property:sys.usb.config=accessory,adb && property:sys.usb.configfs=1
68 start adbd
69
70on 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 Sridharana6c377b2015-09-03 12:12:44 -070072 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
77on 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 Wang60c763e2016-06-06 13:16:11 +080079 symlink /config/usb_gadget/g1/functions/audio_source.gs3 /config/usb_gadget/g1/configs/b.1/f1
Badhri Jagan Sridharana6c377b2015-09-03 12:12:44 -070080 write /config/usb_gadget/g1/UDC ${sys.usb.controller}
81 setprop sys.usb.state ${sys.usb.config}
82
83on property:sys.usb.config=audio_source,adb && property:sys.usb.configfs=1
84 start adbd
85
86on 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 Wang60c763e2016-06-06 13:16:11 +080088 symlink /config/usb_gadget/g1/functions/audio_source.gs3 /config/usb_gadget/g1/configs/b.1/f1
Badhri Jagan Sridharana6c377b2015-09-03 12:12:44 -070089 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
93on 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 Sridharana6c377b2015-09-03 12:12:44 -070095 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
100on property:sys.usb.config=accessory,audio_source,adb && property:sys.usb.configfs=1
101 start adbd
102
103on 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 Sridharana6c377b2015-09-03 12:12:44 -0700105 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
111on 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 Sridharana6c377b2015-09-03 12:12:44 -0700113 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
117on property:sys.usb.config=midi,adb && property:sys.usb.configfs=1
118 start adbd
119
120on 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 Sridharana6c377b2015-09-03 12:12:44 -0700122 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
127on property:sys.usb.config=rndis && property:sys.usb.configfs=1
Amit Pundiraae7b492016-06-07 19:35:23 +0530128 mkdir /config/usb_gadget/g1/functions/rndis.gs4
Badhri Jagan Sridharana6c377b2015-09-03 12:12:44 -0700129 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis"
Badhri Jagan Sridharana6c377b2015-09-03 12:12:44 -0700130 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
134on property:sys.usb.config=rndis,adb && property:sys.usb.configfs=1
135 start adbd
136
137on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,adb && property:sys.usb.configfs=1
Amit Pundiraae7b492016-06-07 19:35:23 +0530138 mkdir /config/usb_gadget/g1/functions/rndis.gs4
Badhri Jagan Sridharana6c377b2015-09-03 12:12:44 -0700139 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_adb"
Badhri Jagan Sridharana6c377b2015-09-03 12:12:44 -0700140 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}