| # |
| # Copyright 2015 The Android Open Source Project |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| # |
| |
| on boot |
| mkdir /dev/usb-ffs 0770 shell shell |
| mkdir /dev/usb-ffs/adb 0770 shell shell |
| |
| mount configfs none /config |
| mkdir /config/usb_gadget/g1 0770 shell shell |
| write /config/usb_gadget/g1/idVendor 0x2207 |
| mkdir /config/usb_gadget/g1/strings/0x409 0770 |
| write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno} |
| write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer} |
| write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model} |
| mkdir /config/usb_gadget/g1/functions/ffs.adb |
| mkdir /config/usb_gadget/g1/configs/b.1 0770 shell shell |
| mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell |
| symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/ffs.adb |
| mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000 |
| setprop sys.usb.configfs 1 |
| setprop sys.usb.controller "10180000.usb" |
| |
| on property:sys.usb.config=none && property:sys.usb.configfs=1 |
| setprop sys.usb.ffs.ready 0 |
| |
| on property:init.svc.adbd=stopped |
| setprop sys.usb.ffs.ready 0 |
| |
| on property:sys.usb.config=adb && property:sys.usb.configfs=1 |
| write /config/usb_gadget/g1/idProduct 0x0006 |