diff options
-rw-r--r-- | rootdir/init.sony.usb.rc | 96 | ||||
-rw-r--r-- | shinano.mk | 1 |
2 files changed, 97 insertions, 0 deletions
diff --git a/rootdir/init.sony.usb.rc b/rootdir/init.sony.usb.rc new file mode 100644 index 0000000..d83cf69 --- /dev/null +++ b/rootdir/init.sony.usb.rc @@ -0,0 +1,96 @@ +# Copyright 2012 The Android Open Source Project +# Copyright (C) 2015 The CyanogenMod 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 init + write /sys/class/android_usb/android0/f_rndis/manufacturer Sony + write /sys/class/android_usb/android0/f_rndis/vendorID 0fce + write /sys/class/android_usb/android0/f_rndis/wceis 1 + +on boot + write /sys/class/android_usb/android0/iSerial ${ro.serialno} + write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer} + write /sys/class/android_usb/android0/iProduct ${ro.product.model} + +on property:sys.usb.config=mtp + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 0FCE + write /sys/class/android_usb/android0/idProduct 0${ro.usb.pid_suffix} + write /sys/class/android_usb/android0/bDeviceClass 0 + write /sys/class/android_usb/android0/bDeviceSubClass 0 + write /sys/class/android_usb/android0/bDeviceProtocol 0 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + stop adb + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mtp,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 0FCE + write /sys/class/android_usb/android0/idProduct 5${ro.usb.pid_suffix} + write /sys/class/android_usb/android0/bDeviceClass 0 + write /sys/class/android_usb/android0/bDeviceSubClass 0 + write /sys/class/android_usb/android0/bDeviceProtocol 0 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rndis + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 0FCE + write /sys/class/android_usb/android0/idProduct 7${ro.usb.pid_suffix} + write /sys/class/android_usb/android0/bDeviceClass 239 + write /sys/class/android_usb/android0/bDeviceSubClass 2 + write /sys/class/android_usb/android0/bDeviceProtocol 1 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + stop adb + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rndis,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 0FCE + write /sys/class/android_usb/android0/idProduct 8${ro.usb.pid_suffix} + write /sys/class/android_usb/android0/bDeviceClass 239 + write /sys/class/android_usb/android0/bDeviceSubClass 2 + write /sys/class/android_usb/android0/bDeviceProtocol 1 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=ptp + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 0FCE + write /sys/class/android_usb/android0/idProduct 9${ro.usb.pid_suffix} + write /sys/class/android_usb/android0/bDeviceClass 0 + write /sys/class/android_usb/android0/bDeviceSubClass 0 + write /sys/class/android_usb/android0/bDeviceProtocol 0 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + stop adb + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=ptp,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 0FCE + write /sys/class/android_usb/android0/idProduct A${ro.usb.pid_suffix} + write /sys/class/android_usb/android0/bDeviceClass 0 + write /sys/class/android_usb/android0/bDeviceSubClass 0 + write /sys/class/android_usb/android0/bDeviceProtocol 0 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} @@ -42,6 +42,7 @@ PRODUCT_COPY_FILES += \ $(COMMON_PATH)/rootdir/fstab.qcom:root/fstab.qcom \ $(COMMON_PATH)/rootdir/init.qcom.rc:root/init.qcom.rc \ $(COMMON_PATH)/rootdir/init.recovery.qcom.rc:root/init.recovery.qcom.rc \ + $(COMMON_PATH)/rootdir/init.sony.usb.rc:root/init.sony.usb.rc \ $(COMMON_PATH)/rootdir/ueventd.qcom.rc:root/ueventd.qcom.rc # Recovery |