From dcc52fea6feadf946d0541265648987e2379b2b6 Mon Sep 17 00:00:00 2001 From: David Viteri Date: Fri, 15 May 2015 09:13:37 +0200 Subject: shinano: init: create common usb.rc Following AOSP https://github.com/sonyxperiadev/device-sony-shinano/blob/master/rootdir/init.shinano.usb.rc Change-Id: I2cf6613e0aa887755da8061a3a7fea7b08b4b946 Signed-off-by: David Viteri --- rootdir/init.sony.usb.rc | 96 ++++++++++++++++++++++++++++++++++++++++++++++++ shinano.mk | 1 + 2 files changed, 97 insertions(+) create mode 100644 rootdir/init.sony.usb.rc 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} diff --git a/shinano.mk b/shinano.mk index e35a0fe..9bfa512 100644 --- a/shinano.mk +++ b/shinano.mk @@ -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 -- cgit v1.2.3