summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--device_base.mk1
-rwxr-xr-xinit.herring.rc2
-rw-r--r--init.herring.usb.rc47
-rw-r--r--overlay/frameworks/base/core/res/res/xml/storage_list.xml42
4 files changed, 92 insertions, 0 deletions
diff --git a/device_base.mk b/device_base.mk
index 773ada2..436c5ab 100644
--- a/device_base.mk
+++ b/device_base.mk
@@ -49,6 +49,7 @@ PRODUCT_COPY_FILES := \
# Init files
PRODUCT_COPY_FILES += \
device/samsung/crespo/init.herring.rc:root/init.herring.rc \
+ device/samsung/crespo/init.herring.usb.rc:root/init.herring.usb.rc \
device/samsung/crespo/ueventd.herring.rc:root/ueventd.herring.rc
# Prebuilt kl and kcm keymaps
diff --git a/init.herring.rc b/init.herring.rc
index 4c4d991..7c9a226 100755
--- a/init.herring.rc
+++ b/init.herring.rc
@@ -1,3 +1,5 @@
+import init.herring.usb.rc
+
on boot
mount debugfs /sys/kernel/debug /sys/kernel/debug
diff --git a/init.herring.usb.rc b/init.herring.usb.rc
new file mode 100644
index 0000000..73acf16
--- /dev/null
+++ b/init.herring.usb.rc
@@ -0,0 +1,47 @@
+on boot
+ write /sys/class/android_usb/android0/iManufacturer $ro.product.manufacturer
+ write /sys/class/android_usb/android0/iProduct $ro.product.model
+ write /sys/class/android_usb/android0/iSerial $ro.serialno
+ write /sys/class/android_usb/f_mass_storage/inquiry_string "Google Nexus S 0100"
+
+on property:sys.usb.config=none
+ stop adbd
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/bDeviceClass 0
+ setprop sys.usb.state $sys.usb.config
+
+on property:sys.usb.config=mass_storage
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 18d1
+ write /sys/class/android_usb/android0/idProduct 4e21
+ write /sys/class/android_usb/android0/functions $sys.usb.config
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state $sys.usb.config
+
+on property:sys.usb.config=mass_storage,adb
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 18d1
+ write /sys/class/android_usb/android0/idProduct 4e22
+ 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 18d1
+ write /sys/class/android_usb/android0/idProduct 4e23
+ write /sys/class/android_usb/android0/functions $sys.usb.config
+ write /sys/class/android_usb/android0/bDeviceClass 224
+ write /sys/class/android_usb/android0/enable 1
+ 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 18d1
+ write /sys/class/android_usb/android0/idProduct 4e24
+ write /sys/class/android_usb/android0/functions $sys.usb.config
+ write /sys/class/android_usb/android0/bDeviceClass 224
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state $sys.usb.config
diff --git a/overlay/frameworks/base/core/res/res/xml/storage_list.xml b/overlay/frameworks/base/core/res/res/xml/storage_list.xml
new file mode 100644
index 0000000..806edda
--- /dev/null
+++ b/overlay/frameworks/base/core/res/res/xml/storage_list.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 2011, 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.
+*/
+-->
+
+<!-- The <device> element should contain one or more <storage> elements.
+ Exactly one of these should have the attribute primary="true".
+ This storage will be the primary external storage and should have mountPoint="/mnt/sdcard".
+ Each storage should have both a mountPoint and storageDescription attribute.
+ The following attributes are optional:
+
+ primary: (boolean) this storage is the primary external storage
+ removable: (boolean) this is removable storage (for example, a real SD card)
+ emulated: (boolean) the storage is emulated via the FUSE sdcard daemon
+ mtpReserve: (integer) number of megabytes of storage MTP should reserve for free storage
+ (used for emulated storage that is shared with system's data partition)
+ allowMassStorage: (boolean) true if this volume can be shared via USB mass storage
+
+ A storage should not have both emulated and removable set to true
+-->
+
+<StorageList xmlns:android="http://schemas.android.com/apk/res/android">
+ <!-- removable is not set in nosdcard product -->
+ <storage android:mountPoint="/mnt/sdcard"
+ android:storageDescription="@string/storage_usb"
+ android:primary="true"
+ android:allowMassStorage="true" />
+</StorageList>