summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Android.mk50
-rw-r--r--AndroidProducts.mk18
-rw-r--r--BoardConfig.mk130
-rw-r--r--CleanSpec.mk51
-rw-r--r--DeviceSettings/Android.mk15
-rw-r--r--DeviceSettings/AndroidManifest.xml30
-rwxr-xr-xDeviceSettings/res/drawable/ic_launcher_cmdevicesettings.pngbin0 -> 8207 bytes
-rwxr-xr-xDeviceSettings/res/layout/top.xml5
-rw-r--r--DeviceSettings/res/values-de/arrays.xml99
-rw-r--r--DeviceSettings/res/values-de/strings.xml32
-rw-r--r--DeviceSettings/res/values-fr/arrays.xml51
-rw-r--r--DeviceSettings/res/values-fr/strings.xml34
-rw-r--r--DeviceSettings/res/values/arrays.xml99
-rw-r--r--DeviceSettings/res/values/strings.xml35
-rw-r--r--DeviceSettings/res/xml/mdnie_preferences.xml64
-rw-r--r--DeviceSettings/res/xml/radio_preferences.xml12
-rw-r--r--DeviceSettings/res/xml/sensors_preferences.xml30
-rw-r--r--DeviceSettings/src/com/cyanogenmod/settings/device/DeviceSettings.java155
-rw-r--r--DeviceSettings/src/com/cyanogenmod/settings/device/Hspa.java67
-rw-r--r--DeviceSettings/src/com/cyanogenmod/settings/device/PanelGamma.java60
-rw-r--r--DeviceSettings/src/com/cyanogenmod/settings/device/RadioFragmentActivity.java66
-rw-r--r--DeviceSettings/src/com/cyanogenmod/settings/device/SensorsFragmentActivity.java93
-rw-r--r--DeviceSettings/src/com/cyanogenmod/settings/device/Startup.java34
-rw-r--r--DeviceSettings/src/com/cyanogenmod/settings/device/TouchscreenSensitivity.java59
-rw-r--r--DeviceSettings/src/com/cyanogenmod/settings/device/Utils.java79
-rwxr-xr-xDeviceSettings/src/com/cyanogenmod/settings/device/mDNIeFragmentActivity.java57
-rw-r--r--DeviceSettings/src/com/cyanogenmod/settings/device/mDNIeMode.java59
-rw-r--r--DeviceSettings/src/com/cyanogenmod/settings/device/mDNIeNegative.java59
-rw-r--r--DeviceSettings/src/com/cyanogenmod/settings/device/mDNIeOutdoor.java58
-rw-r--r--DeviceSettings/src/com/cyanogenmod/settings/device/mDNIeScenario.java59
-rw-r--r--board-info.txt3
-rw-r--r--camera/Android.mk15
-rw-r--r--camera/CameraWrapper.cpp510
-rw-r--r--cm.mk36
-rw-r--r--configs/asound.conf61
-rw-r--r--configs/bcmdhd.cal118
-rw-r--r--configs/egl.cfg1
-rw-r--r--configs/gps.conf6
-rw-r--r--configs/media_profiles.xml497
-rw-r--r--configs/nvram_net.txt113
-rw-r--r--configs/sirfgps.conf38
-rw-r--r--configs/spn-conf.xml132
-rw-r--r--configs/vold.fstab22
-rw-r--r--configs/wpa_supplicant.conf9
-rw-r--r--full_galaxys2.mk34
-rw-r--r--galaxys2.mk75
-rw-r--r--galaxys2_base.mk150
-rwxr-xr-xgpswrapper/Android.mk21
-rw-r--r--gpswrapper/MODULE_LICENSE_APACHE20
-rw-r--r--gpswrapper/gps.c203
-rw-r--r--init.smdk4210.rc375
-rw-r--r--init.smdk4210.usb.rc89
-rw-r--r--liblights/Android.mk33
-rw-r--r--liblights/NOTICE190
-rw-r--r--liblights/lights.c240
-rw-r--r--libsensors/AkmSensor.cpp310
-rw-r--r--libsensors/AkmSensor.h62
-rw-r--r--libsensors/Android.mk45
-rw-r--r--libsensors/GyroSensor.cpp185
-rw-r--r--libsensors/GyroSensor.h55
-rw-r--r--libsensors/InputEventReader.cpp88
-rw-r--r--libsensors/InputEventReader.h47
-rw-r--r--libsensors/LightSensor.cpp160
-rw-r--r--libsensors/LightSensor.h55
-rw-r--r--libsensors/MODULE_LICENSE_APACHE20
-rw-r--r--libsensors/ProximitySensor.cpp144
-rw-r--r--libsensors/ProximitySensor.h54
-rw-r--r--libsensors/SensorBase.cpp128
-rw-r--r--libsensors/SensorBase.h65
-rw-r--r--libsensors/ak8973b.h51
-rw-r--r--libsensors/sensors.cpp326
-rw-r--r--libsensors/sensors.h144
-rw-r--r--lpm.rc84
-rwxr-xr-xmkshbootimg.py47
-rw-r--r--modules/Si4709_driver.kobin0 -> 23580 bytes
-rw-r--r--modules/dhd.kobin0 -> 409048 bytes
-rw-r--r--modules/j4fs.kobin0 -> 47596 bytes
-rw-r--r--modules/scsi_wait_scan.kobin0 -> 1900 bytes
-rw-r--r--overlay/frameworks/base/core/res/res/drawable-nodpi/default_wallpaper.jpgbin0 -> 117493 bytes
-rw-r--r--overlay/frameworks/base/core/res/res/values/arrays.xml37
-rw-r--r--overlay/frameworks/base/core/res/res/values/config.xml259
-rw-r--r--overlay/frameworks/base/core/res/res/xml/power_profile.xml69
-rw-r--r--overlay/frameworks/base/core/res/res/xml/storage_list.xml50
-rw-r--r--overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml22
-rw-r--r--overlay/frameworks/base/packages/SystemUI/res/values/config.xml26
-rw-r--r--overlay/packages/apps/Camera/res/values/config.xml25
-rw-r--r--overlay/packages/apps/Phone/res/values/config.xml23
-rw-r--r--overlay/packages/apps/Settings/res/values-af/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-am/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-ar/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-bg/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-ca/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-cs/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-da/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-de/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-el/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-en-rGB/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-es-rUS/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-es/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-fa/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-fi/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-fr/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-hi/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-hr/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-hu/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-in/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-it/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-iw/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-ja/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-ko/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-lt/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-lv/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-ms/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-nb/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-nl/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-pl/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-pt-rPT/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-pt/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-ro/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-ru/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-sk/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-sl/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-sr/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-sv/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-sw/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-th/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-tl/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-tr/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-uk/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-vi/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-zh-rCN/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-zh-rTW/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values-zu/arrays.xml31
-rw-r--r--overlay/packages/apps/Settings/res/values/arrays.xml46
-rw-r--r--recovery.fstab13
-rw-r--r--recovery.rc71
-rw-r--r--recovery/graphics.c353
-rw-r--r--recovery/recovery_keys.c62
-rwxr-xr-xreleasetools/galaxys2_common.py31
-rwxr-xr-xreleasetools/galaxys2_edify_generator.py46
-rwxr-xr-xreleasetools/galaxys2_img_from_target_files185
-rwxr-xr-xreleasetools/galaxys2_ota_from_target_files122
-rw-r--r--shbootimg.mk25
-rw-r--r--system.prop7
-rw-r--r--tvout/Android.mk16
-rw-r--r--tvout/AndroidManifest.xml24
-rw-r--r--tvout/proguard.flags1
-rw-r--r--tvout/src/android/hardware/Tvout.java102
-rw-r--r--tvout/src/com/teamhacksung/tvout/BootCompletedReceiver.java12
-rw-r--r--tvout/src/com/teamhacksung/tvout/TvOutService.java116
-rw-r--r--tvouthack/Android.mk27
-rw-r--r--tvouthack/main.cpp52
-rw-r--r--ueventd.smdk4210.rc32
-rw-r--r--usr/idc/melfas_ts.idc24
-rw-r--r--usr/idc/mxt224_ts_input.idc24
-rw-r--r--usr/idc/qwerty.idc28
-rw-r--r--usr/idc/qwerty2.idc28
-rw-r--r--usr/idc/sec_touchscreen.idc56
-rw-r--r--usr/keychars/Generic.kcm672
-rw-r--r--usr/keychars/Virtual.kcm544
-rw-r--r--usr/keychars/qwerty.kcm508
-rw-r--r--usr/keychars/qwerty2.kcm505
-rw-r--r--usr/keylayout/AVRCP.kl23
-rw-r--r--usr/keylayout/Generic.kl421
-rw-r--r--usr/keylayout/Vendor_045e_Product_028e.kl46
-rw-r--r--usr/keylayout/Vendor_046d_Product_c216.kl37
-rw-r--r--usr/keylayout/Vendor_046d_Product_c294.kl53
-rw-r--r--usr/keylayout/Vendor_046d_Product_c299.kl62
-rw-r--r--usr/keylayout/Vendor_046d_Product_c532.kl133
-rw-r--r--usr/keylayout/Vendor_054c_Product_0268.kl76
-rw-r--r--usr/keylayout/Vendor_05ac_Product_0239.kl119
-rw-r--r--usr/keylayout/Vendor_22b8_Product_093d.kl105
-rw-r--r--usr/keylayout/gpio-keys.kl11
-rw-r--r--usr/keylayout/max8997-muic.kl6
-rw-r--r--usr/keylayout/melfas-touchkey.kl3
-rw-r--r--usr/keylayout/qwerty.kl112
-rw-r--r--usr/keylayout/samsung-keypad.kl10
-rw-r--r--usr/keylayout/sec_key.kl11
-rw-r--r--usr/keylayout/sec_touchkey.kl2
-rwxr-xr-xvendorsetup.sh18
-rwxr-xr-xzImagebin0 -> 4290988 bytes
181 files changed, 13598 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..b833d4b
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,50 @@
+#
+# Copyright (C) 2012 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.
+#
+
+# WARNING: Everything listed here will be built on ALL platforms,
+# including x86, the emulator, and the SDK. Modules must be uniquely
+# named (liblights.tuna), and must build everywhere, or limit themselves
+# to only building on ARM if they include assembly. Individual makefiles
+# are responsible for having their own logic, for fine-grained control.
+
+LOCAL_PATH := $(call my-dir)
+
+ifeq ($(TARGET_DEVICE),galaxys2)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := galaxys2_hdcp_keys
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_CLASS := FAKE
+LOCAL_MODULE_SUFFIX := -timestamp
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): HDCP_KEYS_FILE := /factory/hdcp.keys
+$(LOCAL_BUILT_MODULE): SYMLINK := $(TARGET_OUT_VENDOR)/firmware/hdcp.keys
+$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/Android.mk
+$(LOCAL_BUILT_MODULE):
+ $(hide) echo "Symlink: $(SYMLINK) -> $(HDCP_KEYS_FILE)"
+ $(hide) mkdir -p $(dir $@)
+ $(hide) mkdir -p $(dir $(SYMLINK))
+ $(hide) rm -rf $@
+ $(hide) rm -rf $(SYMLINK)
+ $(hide) ln -sf $(HDCP_KEYS_FILE) $(SYMLINK)
+ $(hide) touch $@
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
+
+endif
diff --git a/AndroidProducts.mk b/AndroidProducts.mk
new file mode 100644
index 0000000..f0068da
--- /dev/null
+++ b/AndroidProducts.mk
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2012 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.
+#
+
+PRODUCT_MAKEFILES := \
+ $(LOCAL_DIR)/full_galaxys2.mk
diff --git a/BoardConfig.mk b/BoardConfig.mk
new file mode 100644
index 0000000..5950367
--- /dev/null
+++ b/BoardConfig.mk
@@ -0,0 +1,130 @@
+#
+# Copyright (C) 2012 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.
+#
+
+# This variable is set first, so it can be overridden
+# by BoardConfigVendor.mk
+USE_CAMERA_STUB := true
+BOARD_USES_GENERIC_AUDIO := false
+BOARD_USES_LIBSECRIL_STUB := true
+
+TARGET_CPU_ABI := armeabi-v7a
+TARGET_CPU_ABI2 := armeabi
+TARGET_CPU_SMP := true
+TARGET_ARCH_VARIANT := armv7-a-neon
+TARGET_ARCH_VARIANT_CPU := cortex-a9
+ARCH_ARM_HAVE_NEON := true
+ARCH_ARM_HAVE_TLS_REGISTER := true
+EXYNOS4210_ENHANCEMENTS := true
+
+ifdef EXYNOS4210_ENHANCEMENTS
+COMMON_GLOBAL_CFLAGS += -DEXYNOS4210_ENHANCEMENTS
+COMMON_GLOBAL_CFLAGS += -DSURFACEFLINGER_FORCE_SCREEN_RELEASE
+endif
+
+TARGET_BOARD_PLATFORM := exynos4
+TARGET_BOOTLOADER_BOARD_NAME := smdk4210
+TARGET_BOARD_INFO_FILE := device/samsung/galaxys2/board-info.txt
+
+TARGET_NO_BOOTLOADER := true
+TARGET_NO_RADIOIMAGE := true
+
+TARGET_PROVIDES_INIT := true
+TARGET_PROVIDES_INIT_TARGET_RC := true
+TARGET_RECOVERY_INITRC := device/samsung/galaxys2/recovery.rc
+
+BOARD_NAND_PAGE_SIZE := 4096 -s 128
+BOARD_KERNEL_PAGESIZE := 4096
+BOARD_KERNEL_BASE := 0x40000000
+BOARD_KERNEL_CMDLINE := console=ttySAC2,115200 consoleblank=0
+TARGET_PREBUILT_KERNEL := device/samsung/galaxys2/zImage
+
+# Filesystem
+TARGET_USERIMAGES_USE_EXT4 := true
+BOARD_BOOTIMAGE_PARTITION_SIZE := 8388608
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 536870912
+BOARD_USERDATAIMAGE_PARTITION_SIZE := 2147483648
+BOARD_FLASH_BLOCK_SIZE := 4096
+
+# Releasetools
+TARGET_RELEASETOOL_OTA_FROM_TARGET_SCRIPT := ./device/samsung/galaxys2/releasetools/galaxys2_ota_from_target_files
+TARGET_RELEASETOOL_IMG_FROM_TARGET_SCRIPT := ./device/samsung/galaxys2/releasetools/galaxys2_img_from_target_files
+
+# Graphics
+BOARD_EGL_CFG := device/samsung/galaxys2/configs/egl.cfg
+USE_OPENGL_RENDERER := true
+
+# HWComposer
+BOARD_USES_HWCOMPOSER := true
+BOARD_USE_SECTVOUT := true
+
+# OMX
+BOARD_HAVE_CODEC_SUPPORT := SAMSUNG_CODEC_SUPPORT
+
+# Audio
+BOARD_USE_YAMAHAPLAYER := true
+
+# Camera
+ifeq ($(USE_CAMERA_STUB),false)
+BOARD_CAMERA_LIBRARIES := libcamera
+endif
+
+# RIL
+BOARD_MOBILEDATA_INTERFACE_NAME := "pdp0"
+
+# Wifi
+BOARD_WLAN_DEVICE := bcmdhd
+BOARD_WLAN_DEVICE_REV := bcm4330_b1
+WPA_SUPPLICANT_VERSION := VER_0_8_X
+BOARD_WPA_SUPPLICANT_DRIVER := NL80211
+BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_bcmdhd
+BOARD_HOSTAPD_DRIVER := NL80211
+BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_bcmdhd
+WIFI_DRIVER_MODULE_PATH := "/lib/modules/dhd.ko"
+WIFI_DRIVER_FW_PATH_PARAM := "/sys/module/dhd/parameters/firmware_path"
+WIFI_DRIVER_FW_PATH_STA := "/system/etc/wifi/bcm4330_sta.bin"
+WIFI_DRIVER_FW_PATH_AP := "/system/etc/wifi/bcm4330_apsta.bin"
+WIFI_DRIVER_FW_PATH_P2P := "/system/etc/wifi/bcm4330_p2p.bin"
+WIFI_DRIVER_MODULE_NAME := "dhd"
+WIFI_DRIVER_MODULE_ARG := "firmware_path=/system/etc/wifi/bcm4330_sta.bin nvram_path=/system/etc/wifi/nvram_net.txt"
+WIFI_BAND := 802_11_ABG
+
+# Bluetooth
+BOARD_HAVE_BLUETOOTH := true
+BOARD_HAVE_BLUETOOTH_BCM := true
+
+# Vold
+BOARD_VOLD_MAX_PARTITIONS := 12
+BOARD_VOLD_EMMC_SHARES_DEV_MAJOR := true
+BOARD_VOLD_DISC_HAS_MULTIPLE_MAJORS := true
+
+# MTP
+BOARD_MTP_DEVICE := "/dev/usb_mtp_gadget"
+
+# Recovery
+BOARD_CUSTOM_RECOVERY_KEYMAPPING := ../../device/samsung/galaxys2/recovery/recovery_keys.c
+BOARD_CUSTOM_GRAPHICS := ../../../device/samsung/galaxys2/recovery/graphics.c
+BOARD_UMS_LUNFILE := "/sys/class/android_usb/f_mass_storage/lun0/file"
+BOARD_USES_MMCUTILS := true
+BOARD_HAS_NO_MISC_PARTITION := true
+BOARD_HAS_NO_SELECT_BUTTON := true
+
+# assert
+TARGET_OTA_ASSERT_DEVICE := galaxys2,GT-I9100,GT-I9100M,GT-I9100T
+
+# Use the non-open-source parts, if they're present
+-include vendor/samsung/galaxys2/BoardConfigVendor.mk
+
+BOARD_CUSTOM_BOOTIMG_MK := device/samsung/galaxys2/shbootimg.mk
diff --git a/CleanSpec.mk b/CleanSpec.mk
new file mode 100644
index 0000000..18fb296
--- /dev/null
+++ b/CleanSpec.mk
@@ -0,0 +1,51 @@
+# Copyright (C) 2012 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.
+#
+
+# If you don't need to do a full clean build but would like to touch
+# a file or delete some intermediate files, add a clean step to the end
+# of the list. These steps will only be run once, if they haven't been
+# run before.
+#
+# E.g.:
+# $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
+# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
+#
+# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
+# files that are missing or have been moved.
+#
+# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
+# Use $(OUT_DIR) to refer to the "out" directory.
+#
+# If you need to re-do something that's already mentioned, just copy
+# the command and add it to the bottom of the list. E.g., if a change
+# that you made last week required touching a file and a change you
+# made today requires touching the same file, just copy the old
+# touch step and add it to the end of the list.
+#
+# ************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
+# ************************************************
+
+# For example:
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
+#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
+#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
+
+# ************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
+# ************************************************
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/root/default.prop)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/APPS/Phone_intermediates)
diff --git a/DeviceSettings/Android.mk b/DeviceSettings/Android.mk
new file mode 100644
index 0000000..7225f50
--- /dev/null
+++ b/DeviceSettings/Android.mk
@@ -0,0 +1,15 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-v13
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_PACKAGE_NAME := GalaxyS2Settings
+LOCAL_CERTIFICATE := platform
+
+include $(BUILD_PACKAGE)
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/DeviceSettings/AndroidManifest.xml b/DeviceSettings/AndroidManifest.xml
new file mode 100644
index 0000000..d658983
--- /dev/null
+++ b/DeviceSettings/AndroidManifest.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.cyanogenmod.settings.device"
+ android:sharedUserId="android.uid.system" >
+
+ <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
+ <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
+
+ <application android:label="@string/app_name">
+ <activity
+ android:name="com.cyanogenmod.settings.device.DeviceSettings"
+ android:icon="@drawable/ic_launcher_cmdevicesettings"
+ android:label="@string/app_name" >
+ <intent-filter>
+ <action android:name="com.cyanogenmod.action.LAUNCH_DEVICE_SETTINGS" />
+ <action android:name="android.intent.action.MAIN" />
+ </intent-filter>
+ </activity>
+
+ <receiver android:name=".Startup">
+ <intent-filter android:priority="100">
+ <action android:name="android.intent.action.BOOT_COMPLETED" />
+ </intent-filter>
+ </receiver>
+
+ <activity android:name=".mDNIeFragmentActivity" />
+ <activity android:name=".RadioFragmentActivity" />
+
+ </application>
+</manifest>
diff --git a/DeviceSettings/res/drawable/ic_launcher_cmdevicesettings.png b/DeviceSettings/res/drawable/ic_launcher_cmdevicesettings.png
new file mode 100755
index 0000000..66de9c3
--- /dev/null
+++ b/DeviceSettings/res/drawable/ic_launcher_cmdevicesettings.png
Binary files differ
diff --git a/DeviceSettings/res/layout/top.xml b/DeviceSettings/res/layout/top.xml
new file mode 100755
index 0000000..744b568
--- /dev/null
+++ b/DeviceSettings/res/layout/top.xml
@@ -0,0 +1,5 @@
+<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/viewPager"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+
diff --git a/DeviceSettings/res/values-de/arrays.xml b/DeviceSettings/res/values-de/arrays.xml
new file mode 100644
index 0000000..3b2a54e
--- /dev/null
+++ b/DeviceSettings/res/values-de/arrays.xml
@@ -0,0 +1,99 @@
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <string-array name="mdnie_scenario_entries">
+ <item>UI (Standard)</item>
+ <item>Video</item>
+ <item>Video warm</item>
+ <item>Video kalt</item>
+ <item>Kamera</item>
+ <item>Navigation</item>
+ <item>Gallerie</item>
+ <item>VT</item>
+ </string-array>
+
+ <string-array name="mdnie_scenario_entries_values" translatable="false">
+ <item>0</item>
+ <item>1</item>
+ <item>2</item>
+ <item>3</item>
+ <item>4</item>
+ <item>5</item>
+ <item>6</item>
+ <item>7</item>
+ </string-array>
+
+ <string-array name="mdnie_mode_entries">
+ <item>Standard</item>
+ <item>Dynamisch</item>
+ <item>Natürlich</item>
+ <item>Film</item>
+ </string-array>
+
+ <string-array name="mdnie_mode_entries_values" translatable="false">
+ <item>1</item>
+ <item>0</item>
+ <item>2</item>
+ <item>3</item>
+ </string-array>
+
+ <string-array name="mdnie_negative_entries">
+ <item>Normal</item>
+ <item>Invertiert</item>
+ </string-array>
+
+ <string-array name="mdnie_negative_entries_values" translatable="false">
+ <item>0</item>
+ <item>1</item>
+ </string-array>
+
+ <string-array name="mdnie_outdoor_entries">
+ <item>Deaktiviert</item>
+ <item>Aktiviert</item>
+ </string-array>
+
+ <string-array name="mdnie_outdoor_entries_values" translatable="false">
+ <item>0</item>
+ <item>1</item>
+ </string-array>
+
+ <string-array name="panel_gamma_entries">
+ <item>2.2 (Standard)</item>
+ <item>1.9</item>
+ </string-array>
+
+ <string-array name="panel_gamma_entries_values" translatable="false">
+ <item>0</item>
+ <item>1</item>
+ </string-array>
+
+ <string-array name="touchscreen_sensitivity_entries">
+ <item>10</item>
+ <item>20</item>
+ <item>30</item>
+ <item>50 (Standard)</item>
+ <item>70</item>
+ <item>100</item>
+ </string-array>
+
+ <string-array name="touchscreen_sensitivity_entries_values" translatable="false">
+ <item>10</item>
+ <item>20</item>
+ <item>30</item>
+ <item>50</item>
+ <item>70</item>
+ <item>100</item>
+ </string-array>
+
+ <string-array name="hspa_entries">
+ <item>Nur UMTS</item>
+ <item>Nur HSDPA</item>
+ <item>HSDPA + HSUPA</item>
+ </string-array>
+
+ <string-array name="hspa_entries_values" translatable="false">
+ <item>21</item>
+ <item>22</item>
+ <item>23</item>
+ </string-array>
+
+</resources>
diff --git a/DeviceSettings/res/values-de/strings.xml b/DeviceSettings/res/values-de/strings.xml
new file mode 100644
index 0000000..a8d0577
--- /dev/null
+++ b/DeviceSettings/res/values-de/strings.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">Galaxy S II Einstellungen</string>
+
+ <string name="screen_colors_title">Farben</string>
+ <string name="category_mdnie_title">Bildschirm</string>
+ <string name="mdnie_scenario_title_head">Szenario</string>
+ <string name="mdnie_scenario_summary_head">Wähle das mDNIe Szenario</string>
+ <string name="mdnie_mode_title_head">Modus</string>
+ <string name="mdnie_mode_summary_head">Wähle den mDNIe Modus</string>
+ <string name="mdnie_negative_title_head">Negativ Modus</string>
+ <string name="mdnie_negative_summary_head">Aktiviert/Deaktiviert negierte Farben</string>
+ <string name="mdnie_outdoor_title_head">Outdoor Modus</string>
+ <string name="mdnie_outdoor_summary_head">Aktiviert/Deaktiviert den Outdoor Modus</string>
+ <string name="panel_gamma_title_head">Gamma Einstellung</string>
+ <string name="panel_gamma_summary_head">Setzt den Gamma Wert</string>
+
+ <string name="touchscreen_subcat_title">Touchscreen</string>
+ <string name="touchscreen_sensitivity_title_head">Sensitivität</string>
+ <string name="touchscreen_sensitivity_summary_head">Setzt die Touchpanel Sensitivität</string>
+
+ <string name="category_sensors_title">Sensoren</string>
+ <string name="gyro_subcat_title">Gyroskop</string>
+ <string name="use_gyro_calibration_title_head">Kalibierungsdaten</string>
+ <string name="use_gyro_calibration_summary_head">Benutze Kalibrierungswerte. Bitte nach Aktivierung eine Kalibrierung durchführen!</string>
+ <string name="calibrate_gyro_title_head">Kalibrieren</string>
+ <string name="calibrate_gyro_summary_head">Lege dein Telefon auf einen geraden Untergrund und starte die Kalibrierung.</string>
+
+ <string name="category_radio_title">Mobilfunk</string>
+ <string name="hspa_title_head">HSPA</string>
+ <string name="hspa_summary_head">Aktiviert HSDPA/HSUPA</string>
+</resources>
diff --git a/DeviceSettings/res/values-fr/arrays.xml b/DeviceSettings/res/values-fr/arrays.xml
new file mode 100644
index 0000000..d733b34
--- /dev/null
+++ b/DeviceSettings/res/values-fr/arrays.xml
@@ -0,0 +1,51 @@
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <string-array name="mdnie_scenario_entries">
+ <item>UI (Par défaut)</item>
+ <item>Vidéo</item>
+ <item>Vidéo (chaud)</item>
+ <item>Video (froid)</item>
+ <item>Caméra</item>
+ <item>Navigation</item>
+ <item>Gallerie</item>
+ <item>VT</item>
+ </string-array>
+
+ <string-array name="mdnie_mode_entries">
+ <item>Standard (Par défaut)</item>
+ <item>Dynamique</item>
+ <item>Naturel</item>
+ <item>Vidéo</item>
+ </string-array>
+
+ <string-array name="mdnie_negative_entries">
+ <item>Normal</item>
+ <item>Inversé</item>
+ </string-array>
+
+ <string-array name="mdnie_outdoor_entries">
+ <item>Inactif (Par défaut)</item>
+ <item>Actif</item>
+ </string-array>
+
+ <string-array name="panel_gamma_entries">
+ <item>2.2 (Par défaut)</item>
+ <item>1.9</item>
+ </string-array>
+
+ <string-array name="touchscreen_sensitivity_entries">
+ <item>10</item>
+ <item>20</item>
+ <item>30</item>
+ <item>50 (Par défaut)</item>
+ <item>70</item>
+ <item>100</item>
+ </string-array>
+
+ <string-array name="hspa_entries">
+ <item>UMTS seulement</item>
+ <item>HSDPA seulement</item>
+ <item>HSDPA + HSUPA</item>
+ </string-array>
+
+</resources>
diff --git a/DeviceSettings/res/values-fr/strings.xml b/DeviceSettings/res/values-fr/strings.xml
new file mode 100644
index 0000000..b978a86
--- /dev/null
+++ b/DeviceSettings/res/values-fr/strings.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">Paramètres Galaxy S II</string>
+
+ <string name="category_mdnie_title">Ecran</string>
+ <string name="screen_colors_title">Couleurs</string>
+ <string name="mdnie_scenario_title_head">Scénario</string>
+ <string name="mdnie_scenario_summary_head">Définit le scénario mDNIe</string>
+ <string name="mdnie_mode_title_head">Mode</string>
+ <string name="mdnie_mode_summary_head">Définit le mode mDNIe</string>
+ <string name="mdnie_negative_title_head">Mode négatif</string>
+ <string name="mdnie_negative_summary_head">Active/désactive les couleurs inversées</string>
+ <string name="mdnie_outdoor_title_head">Mode extérieur</string>
+ <string name="mdnie_outdoor_summary_head">Active/désactive le mode extérieur</string>
+ <string name="panel_gamma_title_head">Gamma écran</string>
+ <string name="panel_gamma_summary_head">Définit la valeur de gamma de l\'écran</string>
+ <string name="touchscreen_subcat_title">Tactile</string>
+ <string name="touchscreen_sensitivity_title_head">Sensibilité</string>
+ <string name="touchscreen_sensitivity_summary_head">Définit la sensibilité du toucher</string>
+
+ <string name="category_sensors_title">Capteurs</string>
+ <string name="gyro_subcat_title">Gyroscope</string>
+ <string name="use_gyro_calibration_title_head">Utiliser données de calibration</string>
+ <string name="use_gyro_calibration_summary_head">Utiliser les données de calibration du gyroscope. Faites une calibration après avoir coché !</string>
+ <string name="calibrate_gyro_title_head">Calibrer</string>
+ <string name="calibrate_gyro_summary_head">Posez le téléphone à plat, puis appuyez sur ce bouton pour effecter la calibration.</string>
+ <string name="touchkey_subcat_title">Touches tactiles</string>
+ <string name="touchkey_light_title_head">Activer l\'éclairage</string>
+ <string name="touchkey_light_summary_head">Illumine les touches tactiles quand l\'écran est activé.</string>
+
+ <string name="category_radio_title">Radio</string>
+ <string name="hspa_title_head">HSPA</string>
+ <string name="hspa_summary_head">Activer HSDPA/HSUPA</string>
+</resources>
diff --git a/DeviceSettings/res/values/arrays.xml b/DeviceSettings/res/values/arrays.xml
new file mode 100644
index 0000000..022006d
--- /dev/null
+++ b/DeviceSettings/res/values/arrays.xml
@@ -0,0 +1,99 @@
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <string-array name="mdnie_scenario_entries">
+ <item>UI (Default)</item>
+ <item>Video</item>
+ <item>Video Warm</item>
+ <item>Video Cold</item>
+ <item>Camera</item>
+ <item>Navigation</item>
+ <item>Gallery</item>
+ <item>VT</item>
+ </string-array>
+
+ <string-array name="mdnie_scenario_entries_values" translatable="false">
+ <item>0</item>
+ <item>1</item>
+ <item>2</item>
+ <item>3</item>
+ <item>4</item>
+ <item>5</item>
+ <item>6</item>
+ <item>7</item>
+ </string-array>
+
+ <string-array name="mdnie_mode_entries">
+ <item>Standard (Default)</item>
+ <item>Dynamic</item>
+ <item>Natural</item>
+ <item>Movie</item>
+ </string-array>
+
+ <string-array name="mdnie_mode_entries_values" translatable="false">
+ <item>1</item>
+ <item>0</item>
+ <item>2</item>
+ <item>3</item>
+ </string-array>
+
+ <string-array name="mdnie_negative_entries">
+ <item>Normal</item>
+ <item>Inverted</item>
+ </string-array>
+
+ <string-array name="mdnie_negative_entries_values" translatable="false">
+ <item>0</item>
+ <item>1</item>
+ </string-array>
+
+ <string-array name="mdnie_outdoor_entries">
+ <item>Off (Default)</item>
+ <item>On</item>
+ </string-array>
+
+ <string-array name="mdnie_outdoor_entries_values" translatable="false">
+ <item>0</item>
+ <item>1</item>
+ </string-array>
+
+ <string-array name="panel_gamma_entries">
+ <item>2.2 (Default)</item>
+ <item>1.9</item>
+ </string-array>
+
+ <string-array name="panel_gamma_entries_values" translatable="false">
+ <item>0</item>
+ <item>1</item>
+ </string-array>
+
+ <string-array name="touchscreen_sensitivity_entries">
+ <item>10</item>
+ <item>20</item>
+ <item>30</item>
+ <item>50 (Default)</item>
+ <item>70</item>
+ <item>100</item>
+ </string-array>
+
+ <string-array name="touchscreen_sensitivity_entries_values" translatable="false">
+ <item>10</item>
+ <item>20</item>
+ <item>30</item>
+ <item>50</item>
+ <item>70</item>
+ <item>100</item>
+ </string-array>
+
+ <string-array name="hspa_entries">
+ <item>UMTS Only</item>
+ <item>HSDPA Only</item>
+ <item>HSDPA + HSUPA</item>
+ </string-array>
+
+ <string-array name="hspa_entries_values" translatable="false">
+ <item>21</item>
+ <item>22</item>
+ <item>23</item>
+ </string-array>
+
+</resources>
diff --git a/DeviceSettings/res/values/strings.xml b/DeviceSettings/res/values/strings.xml
new file mode 100644
index 0000000..d4b6612
--- /dev/null
+++ b/DeviceSettings/res/values/strings.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">Galaxy S II Settings</string>
+
+ <string name="screen_colors_title">Colors</string>
+ <string name="category_mdnie_title">Screen</string>
+ <string name="mdnie_scenario_title_head">Scenario</string>
+ <string name="mdnie_scenario_summary_head">Set the mDNIe Scenario</string>
+ <string name="mdnie_mode_title_head">Mode</string>
+ <string name="mdnie_mode_summary_head">Set the mDNIe Mode</string>
+ <string name="mdnie_negative_title_head">Negative Mode</string>
+ <string name="mdnie_negative_summary_head">Enable/Disable inverted colors</string>
+ <string name="mdnie_outdoor_title_head">Outdoor Mode</string>
+ <string name="mdnie_outdoor_summary_head">Enable/Disable outdoor mode</string>
+ <string name="panel_gamma_title_head">Screen Gamma</string>
+ <string name="panel_gamma_summary_head">Set screen gamma value</string>
+
+ <string name="touchscreen_subcat_title">Touchscreen</string>
+ <string name="touchscreen_sensitivity_title_head">Touch sensitivity</string>
+ <string name="touchscreen_sensitivity_summary_head">Set touch panel sensitivity</string>
+
+ <string name="category_sensors_title">Sensors</string>
+ <string name="gyro_subcat_title">Gyroscope</string>
+ <string name="use_gyro_calibration_title_head">Use calibration data</string>
+ <string name="use_gyro_calibration_summary_head">Use the gyroscope calibration values. Do a calibration after checking this!</string>
+ <string name="calibrate_gyro_title_head">Calibrate</string>
+ <string name="calibrate_gyro_summary_head">Put your phone on a flat surface, and press this to calibrate</string>
+ <string name="touchkey_subcat_title">Touch key</string>
+ <string name="touchkey_light_title_head">Enable keys backlight</string>
+ <string name="touchkey_light_summary_head">Light up touch keys when screen is on</string>
+
+ <string name="category_radio_title">Radio</string>
+ <string name="hspa_title_head">HSPA</string>
+ <string name="hspa_summary_head">Enable HSDPA/HSUPA</string>
+</resources>
diff --git a/DeviceSettings/res/xml/mdnie_preferences.xml b/DeviceSettings/res/xml/mdnie_preferences.xml
new file mode 100644
index 0000000..f433418
--- /dev/null
+++ b/DeviceSettings/res/xml/mdnie_preferences.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ android:title="@string/app_name">
+
+ <PreferenceCategory
+ android:title="@string/screen_colors_title">
+
+ <!-- mDNIe Scenario modes -->
+ <com.cyanogenmod.settings.device.mDNIeScenario
+ android:key="mdnie_scenario"
+ android:title="@string/mdnie_scenario_title_head"
+ android:summary="@string/mdnie_scenario_summary_head"
+ android:entries="@array/mdnie_scenario_entries"
+ android:entryValues="@array/mdnie_scenario_entries_values"
+ android:defaultValue="0" />
+
+ <!-- mDNIe Mode -->
+ <com.cyanogenmod.settings.device.mDNIeMode
+ android:key="mdnie_mode"
+ android:title="@string/mdnie_mode_title_head"
+ android:summary="@string/mdnie_mode_summary_head"
+ android:entries="@array/mdnie_mode_entries"
+ android:entryValues="@array/mdnie_mode_entries_values"
+ android:defaultValue="1" />
+
+ <!-- mDNIe Negative mode -->
+ <com.cyanogenmod.settings.device.mDNIeNegative
+ android:key="mdnie_negative"
+ android:title="@string/mdnie_negative_title_head"
+ android:summary="@string/mdnie_negative_summary_head"
+ android:entries="@array/mdnie_negative_entries"
+ android:entryValues="@array/mdnie_negative_entries_values"
+ android:defaultValue="0" />
+
+ <!-- mDNIe Outdoor mode -->
+ <com.cyanogenmod.settings.device.mDNIeOutdoor
+ android:key="mdnie_outdoor"
+ android:title="@string/mdnie_outdoor_title_head"
+ android:summary="@string/mdnie_outdoor_summary_head"
+ android:entries="@array/mdnie_outdoor_entries"
+ android:entryValues="@array/mdnie_outdoor_entries_values"
+ android:defaultValue="0" />
+
+ <!-- Panel gamma -->
+ <com.cyanogenmod.settings.device.PanelGamma
+ android:key="panel_gamma"
+ android:title="@string/panel_gamma_title_head"
+ android:summary="@string/panel_gamma_summary_head"
+ android:entries="@array/panel_gamma_entries"
+ android:entryValues="@array/panel_gamma_entries_values"
+ android:defaultValue="0" />
+
+ </PreferenceCategory>
+ <PreferenceCategory
+ android:title="@string/touchscreen_subcat_title">
+ <com.cyanogenmod.settings.device.TouchscreenSensitivity
+ android:key="touchscreen_sensitivity"
+ android:title="@string/touchscreen_sensitivity_title_head"
+ android:summary="@string/touchscreen_sensitivity_summary_head"
+ android:entries="@array/touchscreen_sensitivity_entries"
+ android:entryValues="@array/touchscreen_sensitivity_entries_values"
+ android:defaultValue="50" />
+ </PreferenceCategory>
+</PreferenceScreen>
diff --git a/DeviceSettings/res/xml/radio_preferences.xml b/DeviceSettings/res/xml/radio_preferences.xml
new file mode 100644
index 0000000..b78ecde
--- /dev/null
+++ b/DeviceSettings/res/xml/radio_preferences.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+ <!-- Hspa modes -->
+ <com.cyanogenmod.settings.device.Hspa
+ android:key="hspa"
+ android:title="@string/hspa_title_head"
+ android:summary="@string/hspa_summary_head"
+ android:entries="@array/hspa_entries"
+ android:entryValues="@array/hspa_entries_values"
+ android:defaultValue="0" />
+
+</PreferenceScreen>
diff --git a/DeviceSettings/res/xml/sensors_preferences.xml b/DeviceSettings/res/xml/sensors_preferences.xml
new file mode 100644
index 0000000..9029a62
--- /dev/null
+++ b/DeviceSettings/res/xml/sensors_preferences.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+ <PreferenceCategory
+ android:title="@string/gyro_subcat_title">
+ <!-- Use sensor calibration -->
+ <CheckBoxPreference
+ android:key="use_gyro_calibration"
+ android:title="@string/use_gyro_calibration_title_head"
+ android:summary="@string/use_gyro_calibration_summary_head"
+ />
+
+ <!-- Do gyro calibration -->
+ <Preference
+ android:key="calibrate_gyro"
+ android:title="@string/calibrate_gyro_title_head"
+ android:summary="@string/calibrate_gyro_summary_head"
+ />
+ </PreferenceCategory>
+
+ <PreferenceCategory
+ android:title="@string/touchkey_subcat_title">
+ <!-- Touchkey backlight -->
+ <CheckBoxPreference
+ android:key="touchkey_light"
+ android:title="@string/touchkey_light_title_head"
+ android:summary="@string/touchkey_light_summary_head"
+ />
+ </PreferenceCategory>
+</PreferenceScreen>
+
diff --git a/DeviceSettings/src/com/cyanogenmod/settings/device/DeviceSettings.java b/DeviceSettings/src/com/cyanogenmod/settings/device/DeviceSettings.java
new file mode 100644
index 0000000..4bd1810
--- /dev/null
+++ b/DeviceSettings/src/com/cyanogenmod/settings/device/DeviceSettings.java
@@ -0,0 +1,155 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+package com.cyanogenmod.settings.device;
+
+import android.app.ActionBar;
+import android.app.ActionBar.Tab;
+import android.app.Activity;
+import android.app.Fragment;
+import android.app.FragmentTransaction;
+import android.content.Context;
+import android.os.Bundle;
+import android.support.v4.app.FragmentActivity;
+import android.support.v13.app.FragmentPagerAdapter;
+import android.support.v4.view.ViewPager;
+
+import com.cyanogenmod.settings.device.R;
+
+import java.util.ArrayList;
+
+public class DeviceSettings extends FragmentActivity {
+
+ public static final String SHARED_PREFERENCES_BASENAME = "com.cyanogenmod.settings.device";
+ public static final String ACTION_UPDATE_PREFERENCES = "com.cyanogenmod.settings.device.UPDATE";
+ public static final String KEY_MDNIE_SCENARIO = "mdnie_scenario";
+ public static final String KEY_MDNIE_MODE = "mdnie_mode";
+ public static final String KEY_MDNIE_NEGATIVE = "mdnie_negative";
+ public static final String KEY_MDNIE_OUTDOOR = "mdnie_outdoor";
+ public static final String KEY_PANEL_GAMMA = "panel_gamma";
+ public static final String KEY_HSPA = "hspa";
+ public static final String KEY_USE_GYRO_CALIBRATION = "use_gyro_calibration";
+ public static final String KEY_CALIBRATE_GYRO = "calibrate_gyro";
+ public static final String KEY_TOUCHSCREEN_SENSITIVITY = "touchscreen_sensitivity";
+ public static final String KEY_TOUCHKEY_LIGHT = "touchkey_light";
+
+ ViewPager mViewPager;
+ TabsAdapter mTabsAdapter;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ mViewPager = new ViewPager(this);
+ mViewPager.setId(R.id.viewPager);
+ setContentView(mViewPager);
+
+ final ActionBar bar = getActionBar();
+ bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
+ bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE, ActionBar.DISPLAY_SHOW_TITLE);
+ bar.setTitle(R.string.app_name);
+
+ mTabsAdapter = new TabsAdapter(this, mViewPager);
+ mTabsAdapter.addTab(bar.newTab().setText(R.string.category_radio_title),
+ RadioFragmentActivity.class, null);
+ mTabsAdapter.addTab(bar.newTab().setText(R.string.category_mdnie_title),
+ mDNIeFragmentActivity.class, null);
+ mTabsAdapter.addTab(bar.newTab().setText(R.string.category_sensors_title),
+ SensorsFragmentActivity.class, null);
+
+ if (savedInstanceState != null) {
+ bar.setSelectedNavigationItem(savedInstanceState.getInt("tab", 0));
+ }
+ }
+
+ @Override
+ protected void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+ outState.putInt("tab", getActionBar().getSelectedNavigationIndex());
+ }
+
+ public static class TabsAdapter extends FragmentPagerAdapter
+ implements ActionBar.TabListener, ViewPager.OnPageChangeListener {
+ private final Context mContext;
+ private final ActionBar mActionBar;
+ private final ViewPager mViewPager;
+ private final ArrayList<TabInfo> mTabs = new ArrayList<TabInfo>();
+
+ static final class TabInfo {
+ private final Class<?> clss;
+ private final Bundle args;
+
+ TabInfo(Class<?> _class, Bundle _args) {
+ clss = _class;
+ args = _args;
+ }
+ }
+
+ public TabsAdapter(Activity activity, ViewPager pager) {
+ super(activity.getFragmentManager());
+ mContext = activity;
+ mActionBar = activity.getActionBar();
+ mViewPager = pager;
+ mViewPager.setAdapter(this);
+ mViewPager.setOnPageChangeListener(this);
+ }
+
+ public void addTab(ActionBar.Tab tab, Class<?> clss, Bundle args) {
+ TabInfo info = new TabInfo(clss, args);
+ tab.setTag(info);
+ tab.setTabListener(this);
+ mTabs.add(info);
+ mActionBar.addTab(tab);
+ notifyDataSetChanged();
+ }
+
+ @Override
+ public int getCount() {
+ return mTabs.size();
+ }
+
+ @Override
+ public Fragment getItem(int position) {
+ TabInfo info = mTabs.get(position);
+ return Fragment.instantiate(mContext, info.clss.getName(), info.args);
+ }
+
+ public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
+ }
+
+ public void onPageSelected(int position) {
+ mActionBar.setSelectedNavigationItem(position);
+ }
+
+ public void onPageScrollStateChanged(int state) {
+ }
+
+ public void onTabSelected(Tab tab, FragmentTransaction ft) {
+ Object tag = tab.getTag();
+ for (int i=0; i<mTabs.size(); i++) {
+ if (mTabs.get(i) == tag) {
+ mViewPager.setCurrentItem(i);
+ }
+ }
+ }
+
+ public void onTabUnselected(Tab tab, FragmentTransaction ft) {
+ }
+
+ public void onTabReselected(Tab tab, FragmentTransaction ft) {
+ }
+ }
+}
diff --git a/DeviceSettings/src/com/cyanogenmod/settings/device/Hspa.java b/DeviceSettings/src/com/cyanogenmod/settings/device/Hspa.java
new file mode 100644
index 0000000..f19eff7
--- /dev/null
+++ b/DeviceSettings/src/com/cyanogenmod/settings/device/Hspa.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+package com.cyanogenmod.settings.device;
+
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.util.AttributeSet;
+import android.preference.ListPreference;
+import android.preference.Preference;
+import android.preference.Preference.OnPreferenceChangeListener;
+import android.preference.PreferenceManager;
+
+public class Hspa extends ListPreference implements OnPreferenceChangeListener {
+
+ private static final String FILE = "/system/app/SamsungServiceMode.apk";
+ private Context mCtx;
+
+ public Hspa(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ this.setOnPreferenceChangeListener(this);
+ mCtx = context;
+ }
+
+ public static boolean isSupported() {
+ return Utils.fileExists(FILE);
+ }
+
+ /**
+ * Restore hspa setting from SharedPreferences. (Write to kernel.)
+ * @param context The context to read the SharedPreferences from
+ */
+ public static void restore(Context context) {
+ if (!isSupported()) {
+ return;
+ }
+
+ SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
+ sendIntent(context, sharedPrefs.getString(DeviceSettings.KEY_HSPA, "23"));
+ }
+
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ sendIntent(mCtx, (String) newValue);
+ return true;
+ }
+
+ private static void sendIntent(Context context, String value) {
+ Intent i = new Intent("com.cyanogenmod.SamsungServiceMode.EXECUTE");
+ i.putExtra("sub_type", 20); // HSPA Setting
+ i.putExtra("data", value);
+ context.sendBroadcast(i);
+ }
+}
diff --git a/DeviceSettings/src/com/cyanogenmod/settings/device/PanelGamma.java b/DeviceSettings/src/com/cyanogenmod/settings/device/PanelGamma.java
new file mode 100644
index 0000000..81544a6
--- /dev/null
+++ b/DeviceSettings/src/com/cyanogenmod/settings/device/PanelGamma.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+package com.cyanogenmod.settings.device;
+
+import android.content.Context;
+import android.util.Log;
+import android.content.SharedPreferences;
+import android.util.AttributeSet;
+import android.preference.Preference;
+import android.preference.ListPreference;
+import android.preference.Preference.OnPreferenceChangeListener;
+import android.preference.PreferenceManager;
+
+public class PanelGamma extends ListPreference implements OnPreferenceChangeListener {
+
+ public PanelGamma(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ this.setOnPreferenceChangeListener(this);
+ }
+
+ private static final String FILE = "/sys/class/lcd/panel/gamma_mode";
+
+ public static boolean isSupported() {
+ return Utils.fileExists(FILE);
+ }
+
+ /**
+ * Restore panel gamma setting from SharedPreferences. (Write to kernel.)
+ * @param context The context to read the SharedPreferences from
+ */
+ public static void restore(Context context) {
+ if (!isSupported()) {
+ return;
+ }
+
+ SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
+ Utils.writeValue(FILE, sharedPrefs.getString(DeviceSettings.KEY_PANEL_GAMMA, "0"));
+ }
+
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ Log.d("SGS2","Writing " + ((String)newValue) + " to " + FILE);
+ Utils.writeValue(FILE, (String) newValue);
+ return true;
+ }
+
+}
diff --git a/DeviceSettings/src/com/cyanogenmod/settings/device/RadioFragmentActivity.java b/DeviceSettings/src/com/cyanogenmod/settings/device/RadioFragmentActivity.java
new file mode 100644
index 0000000..4d830b8
--- /dev/null
+++ b/DeviceSettings/src/com/cyanogenmod/settings/device/RadioFragmentActivity.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+package com.cyanogenmod.settings.device;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.preference.CheckBoxPreference;
+import android.preference.ListPreference;
+import android.preference.Preference;
+import android.preference.PreferenceActivity;
+import android.preference.PreferenceFragment;
+import android.preference.PreferenceManager;
+import android.preference.PreferenceScreen;
+import android.util.Log;
+
+import com.cyanogenmod.settings.device.R;
+
+public class RadioFragmentActivity extends PreferenceFragment {
+
+ private static final String PREF_ENABLED = "1";
+ private static final String TAG = "GalaxyS2Parts_General";
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ addPreferencesFromResource(R.xml.radio_preferences);
+
+ PreferenceScreen prefSet = getPreferenceScreen();
+
+ }
+
+ @Override
+ public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
+
+ String boxValue;
+ String key = preference.getKey();
+
+ Log.w(TAG, "key: " + key);
+
+ return true;
+ }
+
+ public static boolean isSupported(String FILE) {
+ return Utils.fileExists(FILE);
+ }
+
+ public static void restore(Context context) {
+ SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
+ }
+}
diff --git a/DeviceSettings/src/com/cyanogenmod/settings/device/SensorsFragmentActivity.java b/DeviceSettings/src/com/cyanogenmod/settings/device/SensorsFragmentActivity.java
new file mode 100644
index 0000000..2c97013
--- /dev/null
+++ b/DeviceSettings/src/com/cyanogenmod/settings/device/SensorsFragmentActivity.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+package com.cyanogenmod.settings.device;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.preference.CheckBoxPreference;
+import android.preference.ListPreference;
+import android.preference.Preference;
+import android.preference.PreferenceActivity;
+import android.preference.PreferenceFragment;
+import android.preference.PreferenceManager;
+import android.preference.PreferenceScreen;
+import android.util.Log;
+
+import com.cyanogenmod.settings.device.R;
+
+public class SensorsFragmentActivity extends PreferenceFragment {
+
+ private static final String PREF_ENABLED = "1";
+ private static final String TAG = "GalaxyS2Parts_General";
+
+ private static final String FILE_USE_GYRO_CALIB = "/sys/class/sec/gsensorcal/calibration";
+ private static final String FILE_TOUCHKEY_LIGHT = "/data/.disable_touchlight";
+ private static final String FILE_TOUCHKEY_TOGGLE = "/sys/class/sec/sec_touchkey/brightness";
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ addPreferencesFromResource(R.xml.sensors_preferences);
+
+ PreferenceScreen prefSet = getPreferenceScreen();
+
+ }
+
+ @Override
+ public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
+
+ String boxValue;
+ String key = preference.getKey();
+
+ Log.w(TAG, "key: " + key);
+
+ if (key.compareTo(DeviceSettings.KEY_USE_GYRO_CALIBRATION) == 0) {
+ boxValue = (((CheckBoxPreference)preference).isChecked() ? "1" : "0");
+ Utils.writeValue(FILE_USE_GYRO_CALIB, boxValue);
+ } else if (key.compareTo(DeviceSettings.KEY_CALIBRATE_GYRO) == 0) {
+ // when calibration data utilization is disablen and enabled back,
+ // calibration is done at the same time by driver
+ Utils.writeValue(FILE_USE_GYRO_CALIB, "0");
+ Utils.writeValue(FILE_USE_GYRO_CALIB, "1");
+ Utils.showDialog((Context)getActivity(), "Calibration done", "The gyroscope has been successfully calibrated!");
+ } else if (key.compareTo(DeviceSettings.KEY_TOUCHKEY_LIGHT) == 0) {
+ Utils.writeValue(FILE_TOUCHKEY_LIGHT, ((CheckBoxPreference)preference).isChecked() ? "1" : "0");
+ Utils.writeValue(FILE_TOUCHKEY_TOGGLE, ((CheckBoxPreference)preference).isChecked() ? "1" : "2");
+ }
+
+ return true;
+ }
+
+ public static boolean isSupported(String FILE) {
+ return Utils.fileExists(FILE);
+ }
+
+ public static void restore(Context context) {
+ SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
+ String gyroCalib = sharedPrefs.getString(DeviceSettings.KEY_USE_GYRO_CALIBRATION, "1");
+
+ // When use gyro calibration value is set to 1, calibration is done at the same time, which
+ // means it is reset at each boot, providing wrong calibration most of the time at each reboot.
+ // So we only set it to "0" if user wants it, as it defaults to 1 at boot
+ if (gyroCalib.compareTo("1") != 0)
+ Utils.writeValue(FILE_USE_GYRO_CALIB, gyroCalib);
+
+ Utils.writeValue(FILE_TOUCHKEY_LIGHT, sharedPrefs.getString(DeviceSettings.KEY_TOUCHKEY_LIGHT, "1"));
+ }
+}
diff --git a/DeviceSettings/src/com/cyanogenmod/settings/device/Startup.java b/DeviceSettings/src/com/cyanogenmod/settings/device/Startup.java
new file mode 100644
index 0000000..6951f26
--- /dev/null
+++ b/DeviceSettings/src/com/cyanogenmod/settings/device/Startup.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+package com.cyanogenmod.settings.device;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+
+public class Startup extends BroadcastReceiver {
+
+ @Override
+ public void onReceive(final Context context, final Intent bootintent) {
+ mDNIeScenario.restore(context);
+ mDNIeMode.restore(context);
+ mDNIeNegative.restore(context);
+ mDNIeOutdoor.restore(context);
+ RadioFragmentActivity.restore(context);
+ }
+
+}
diff --git a/DeviceSettings/src/com/cyanogenmod/settings/device/TouchscreenSensitivity.java b/DeviceSettings/src/com/cyanogenmod/settings/device/TouchscreenSensitivity.java
new file mode 100644
index 0000000..e066556
--- /dev/null
+++ b/DeviceSettings/src/com/cyanogenmod/settings/device/TouchscreenSensitivity.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+package com.cyanogenmod.settings.device;
+
+import java.io.IOException;
+import android.content.Context;
+import android.util.AttributeSet;
+import android.content.SharedPreferences;
+import android.preference.Preference;
+import android.preference.ListPreference;
+import android.preference.Preference.OnPreferenceChangeListener;
+import android.preference.PreferenceManager;
+
+public class TouchscreenSensitivity extends ListPreference implements OnPreferenceChangeListener {
+
+ public TouchscreenSensitivity(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ this.setOnPreferenceChangeListener(this);
+ }
+
+ private static final String FILE = "/sys/class/sec/sec_touchscreen/tsp_threshold";
+
+ public static boolean isSupported() {
+ return Utils.fileExists(FILE);
+ }
+
+ /**
+ * Restore touchscreen sensitivity setting from SharedPreferences. (Write to kernel.)
+ * @param context The context to read the SharedPreferences from
+ */
+ public static void restore(Context context) {
+ if (!isSupported()) {
+ return;
+ }
+
+ SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
+ Utils.writeValue(FILE, sharedPrefs.getString(DeviceSettings.KEY_TOUCHSCREEN_SENSITIVITY, "50"));
+ }
+
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ Utils.writeValue(FILE, (String) newValue);
+ return true;
+ }
+
+}
diff --git a/DeviceSettings/src/com/cyanogenmod/settings/device/Utils.java b/DeviceSettings/src/com/cyanogenmod/settings/device/Utils.java
new file mode 100644
index 0000000..9d4176c
--- /dev/null
+++ b/DeviceSettings/src/com/cyanogenmod/settings/device/Utils.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+package com.cyanogenmod.settings.device;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+import android.content.Context;
+
+public class Utils {
+
+ /**
+ * Write a string value to the specified file.
+ * @param filename The filename
+ * @param value The value
+ */
+ public static void writeValue(String filename, String value) {
+ try {
+ FileOutputStream fos = new FileOutputStream(new File(filename));
+ fos.write(value.getBytes());
+ fos.flush();
+ fos.getFD().sync();
+ fos.close();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Write the "color value" to the specified file. The value is scaled from
+ * an integer to an unsigned integer by multiplying by 2.
+ * @param filename The filename
+ * @param value The value of max value Integer.MAX
+ */
+ public static void writeColor(String filename, int value) {
+ writeValue(filename, String.valueOf((long) value * 2));
+ }
+
+ /**
+ * Check if the specified file exists.
+ * @param filename The filename
+ * @return Whether the file exists or not
+ */
+ public static boolean fileExists(String filename) {
+ return new File(filename).exists();
+ }
+
+
+ public static void showDialog(Context ctx, String title, String message) {
+ final AlertDialog alertDialog = new AlertDialog.Builder(ctx).create();
+ alertDialog.setTitle(title);
+ alertDialog.setMessage(message);
+ alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ alertDialog.dismiss();
+ }
+ });
+ alertDialog.show();
+ }
+}
diff --git a/DeviceSettings/src/com/cyanogenmod/settings/device/mDNIeFragmentActivity.java b/DeviceSettings/src/com/cyanogenmod/settings/device/mDNIeFragmentActivity.java
new file mode 100755
index 0000000..f14f666
--- /dev/null
+++ b/DeviceSettings/src/com/cyanogenmod/settings/device/mDNIeFragmentActivity.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+package com.cyanogenmod.settings.device;
+
+import android.os.Bundle;
+import android.preference.PreferenceFragment;
+import com.cyanogenmod.settings.device.R;
+
+public class mDNIeFragmentActivity extends PreferenceFragment {
+
+ private mDNIeScenario mmDNIeScenario;
+ private mDNIeMode mmDNIeMode;
+ private mDNIeNegative mmDNIeNegative;
+ private mDNIeOutdoor mmDNIeOutdoor;
+ private PanelGamma mPanelGamma;
+ private TouchscreenSensitivity mTouchscreenSensitivity;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ addPreferencesFromResource(R.xml.mdnie_preferences);
+
+ mmDNIeScenario = (mDNIeScenario) findPreference(DeviceSettings.KEY_MDNIE_SCENARIO);
+ mmDNIeScenario.setEnabled(mDNIeScenario.isSupported());
+
+ mmDNIeMode = (mDNIeMode) findPreference(DeviceSettings.KEY_MDNIE_MODE);
+ mmDNIeMode.setEnabled(mDNIeMode.isSupported());
+
+ mmDNIeNegative = (mDNIeNegative) findPreference(DeviceSettings.KEY_MDNIE_NEGATIVE);
+ mmDNIeNegative.setEnabled(mDNIeNegative.isSupported());
+
+ mmDNIeOutdoor = (mDNIeOutdoor) findPreference(DeviceSettings.KEY_MDNIE_OUTDOOR);
+ mmDNIeOutdoor.setEnabled(mDNIeOutdoor.isSupported());
+
+ mPanelGamma = (PanelGamma) findPreference(DeviceSettings.KEY_PANEL_GAMMA);
+ mPanelGamma.setEnabled(mPanelGamma.isSupported());
+
+ mTouchscreenSensitivity = (TouchscreenSensitivity) findPreference(DeviceSettings.KEY_TOUCHSCREEN_SENSITIVITY);
+ mTouchscreenSensitivity.setEnabled(mTouchscreenSensitivity.isSupported());
+ }
+
+}
diff --git a/DeviceSettings/src/com/cyanogenmod/settings/device/mDNIeMode.java b/DeviceSettings/src/com/cyanogenmod/settings/device/mDNIeMode.java
new file mode 100644
index 0000000..c7fc94b
--- /dev/null
+++ b/DeviceSettings/src/com/cyanogenmod/settings/device/mDNIeMode.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+package com.cyanogenmod.settings.device;
+
+import android.content.Context;
+
+import android.content.SharedPreferences;
+import android.util.AttributeSet;
+import android.preference.Preference;
+import android.preference.ListPreference;
+import android.preference.Preference.OnPreferenceChangeListener;
+import android.preference.PreferenceManager;
+
+public class mDNIeMode extends ListPreference implements OnPreferenceChangeListener {
+
+ public mDNIeMode(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ this.setOnPreferenceChangeListener(this);
+ }
+
+ private static final String FILE = "/sys/class/mdnie/mdnie/mode";
+
+ public static boolean isSupported() {
+ return Utils.fileExists(FILE);
+ }
+
+ /**
+ * Restore mdnie user mode setting from SharedPreferences. (Write to kernel.)
+ * @param context The context to read the SharedPreferences from
+ */
+ public static void restore(Context context) {
+ if (!isSupported()) {
+ return;
+ }
+
+ SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
+ Utils.writeValue(FILE, sharedPrefs.getString(DeviceSettings.KEY_MDNIE_MODE, "1"));
+ }
+
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ Utils.writeValue(FILE, (String) newValue);
+ return true;
+ }
+
+}
diff --git a/DeviceSettings/src/com/cyanogenmod/settings/device/mDNIeNegative.java b/DeviceSettings/src/com/cyanogenmod/settings/device/mDNIeNegative.java
new file mode 100644
index 0000000..c2ccc7b
--- /dev/null
+++ b/DeviceSettings/src/com/cyanogenmod/settings/device/mDNIeNegative.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+package com.cyanogenmod.settings.device;
+
+import java.io.IOException;
+import android.content.Context;
+import android.util.AttributeSet;
+import android.content.SharedPreferences;
+import android.preference.Preference;
+import android.preference.ListPreference;
+import android.preference.Preference.OnPreferenceChangeListener;
+import android.preference.PreferenceManager;
+
+public class mDNIeNegative extends ListPreference implements OnPreferenceChangeListener {
+
+ public mDNIeNegative(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ this.setOnPreferenceChangeListener(this);
+ }
+
+ private static final String FILE = "/sys/class/mdnie/mdnie/negative";
+
+ public static boolean isSupported() {
+ return Utils.fileExists(FILE);
+ }
+
+ /**
+ * Restore mdnie user mode setting from SharedPreferences. (Write to kernel.)
+ * @param context The context to read the SharedPreferences from
+ */
+ public static void restore(Context context) {
+ if (!isSupported()) {
+ return;
+ }
+
+ SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
+ Utils.writeValue(FILE, sharedPrefs.getString(DeviceSettings.KEY_MDNIE_NEGATIVE, "0"));
+ }
+
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ Utils.writeValue(FILE, (String) newValue);
+ return true;
+ }
+
+}
diff --git a/DeviceSettings/src/com/cyanogenmod/settings/device/mDNIeOutdoor.java b/DeviceSettings/src/com/cyanogenmod/settings/device/mDNIeOutdoor.java
new file mode 100644
index 0000000..7fcdacd
--- /dev/null
+++ b/DeviceSettings/src/com/cyanogenmod/settings/device/mDNIeOutdoor.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+package com.cyanogenmod.settings.device;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.content.SharedPreferences;
+import android.preference.Preference;
+import android.preference.ListPreference;
+import android.preference.Preference.OnPreferenceChangeListener;
+import android.preference.PreferenceManager;
+
+public class mDNIeOutdoor extends ListPreference implements OnPreferenceChangeListener {
+
+ public mDNIeOutdoor(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ this.setOnPreferenceChangeListener(this);
+ }
+
+ private static final String FILE = "/sys/class/mdnie/mdnie/outdoor";
+
+ public static boolean isSupported() {
+ return Utils.fileExists(FILE);
+ }
+
+ /**
+ * Restore mdnie user mode setting from SharedPreferences. (Write to kernel.)
+ * @param context The context to read the SharedPreferences from
+ */
+ public static void restore(Context context) {
+ if (!isSupported()) {
+ return;
+ }
+
+ SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
+ Utils.writeValue(FILE, sharedPrefs.getString(DeviceSettings.KEY_MDNIE_OUTDOOR, "0"));
+ }
+
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ Utils.writeValue(FILE, (String) newValue);
+ return true;
+ }
+
+}
diff --git a/DeviceSettings/src/com/cyanogenmod/settings/device/mDNIeScenario.java b/DeviceSettings/src/com/cyanogenmod/settings/device/mDNIeScenario.java
new file mode 100644
index 0000000..0963d4d
--- /dev/null
+++ b/DeviceSettings/src/com/cyanogenmod/settings/device/mDNIeScenario.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+package com.cyanogenmod.settings.device;
+
+import android.content.Context;
+
+import android.content.SharedPreferences;
+import android.util.AttributeSet;
+import android.preference.Preference;
+import android.preference.ListPreference;
+import android.preference.Preference.OnPreferenceChangeListener;
+import android.preference.PreferenceManager;
+
+public class mDNIeScenario extends ListPreference implements OnPreferenceChangeListener {
+
+ public mDNIeScenario(Context context, AttributeSet attrs) {
+ super(context,attrs);
+ this.setOnPreferenceChangeListener(this);
+ }
+
+ private static final String FILE = "/sys/class/mdnie/mdnie/scenario";
+
+ public static boolean isSupported() {
+ return Utils.fileExists(FILE);
+ }
+
+ /**
+ * Restore Mdnie ui setting setting from SharedPreferences. (Write to kernel.)
+ * @param context The context to read the SharedPreferences from
+ */
+ public static void restore(Context context) {
+ if (!isSupported()) {
+ return;
+ }
+
+ SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
+ Utils.writeValue(FILE, sharedPrefs.getString(DeviceSettings.KEY_MDNIE_SCENARIO, "0"));
+ }
+
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ Utils.writeValue(FILE, (String) newValue);
+ return true;
+ }
+
+}
diff --git a/board-info.txt b/board-info.txt
new file mode 100644
index 0000000..51f5961
--- /dev/null
+++ b/board-info.txt
@@ -0,0 +1,3 @@
+require board=smdk4210
+require version-bootloader=I9100XXLPH
+
diff --git a/camera/Android.mk b/camera/Android.mk
new file mode 100644
index 0000000..6005a54
--- /dev/null
+++ b/camera/Android.mk
@@ -0,0 +1,15 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+ CameraWrapper.cpp
+
+LOCAL_SHARED_LIBRARIES:= \
+ libhardware liblog
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
+LOCAL_MODULE:= camera.$(TARGET_BOARD_PLATFORM)
+LOCAL_MODULE_TAGS:= optional
+
+include $(BUILD_SHARED_LIBRARY)
+#include $(BUILD_HEAPTRACKED_SHARED_LIBRARY)
diff --git a/camera/CameraWrapper.cpp b/camera/CameraWrapper.cpp
new file mode 100644
index 0000000..c1f066d
--- /dev/null
+++ b/camera/CameraWrapper.cpp
@@ -0,0 +1,510 @@
+/*
+ * Copyright (C) Hacsksung
+ *
+ * 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.
+ */
+
+/**
+* @file CameraWrapper.cpp
+*
+* This file wraps a vendor camera module.
+*
+*/
+
+#define LOG_NDEBUG 0
+#define LOG_TAG "CameraWrapper"
+#include <cutils/log.h>
+
+#include <utils/threads.h>
+#include <hardware/hardware.h>
+#include <hardware/camera.h>
+
+static android::Mutex gCameraWrapperLock;
+static camera_module_t *gVendorModule = 0;
+
+static int camera_device_open(const hw_module_t* module, const char* name,
+ hw_device_t** device);
+static int camera_device_close(hw_device_t* device);
+static int camera_get_number_of_cameras(void);
+static int camera_get_camera_info(int camera_id, struct camera_info *info);
+
+static struct hw_module_methods_t camera_module_methods = {
+ open: camera_device_open
+};
+
+camera_module_t HAL_MODULE_INFO_SYM = {
+ common: {
+ tag: HARDWARE_MODULE_TAG,
+ version_major: 1,
+ version_minor: 0,
+ id: CAMERA_HARDWARE_MODULE_ID,
+ name: "Exynos Camera Wrapper",
+ author: "Hacksung",
+ methods: &camera_module_methods,
+ dso: NULL, /* remove compilation warnings */
+ reserved: {0}, /* remove compilation warnings */
+ },
+ get_number_of_cameras: camera_get_number_of_cameras,
+ get_camera_info: camera_get_camera_info,
+};
+
+typedef struct wrapper_camera_device {
+ camera_device_t base;
+ camera_device_t *vendor;
+} wrapper_camera_device_t;
+
+#define VENDOR_CALL(device, func, ...) ({ \
+ wrapper_camera_device_t *__wrapper_dev = (wrapper_camera_device_t*) device; \
+ __wrapper_dev->vendor->ops->func(__wrapper_dev->vendor, ##__VA_ARGS__); \
+})
+
+static int check_vendor_module()
+{
+ int rv = 0;
+ LOGV("%s", __FUNCTION__);
+
+ if(gVendorModule)
+ return 0;
+
+ rv = hw_get_module("vendor-camera", (const hw_module_t **)&gVendorModule);
+ if (rv)
+ LOGE("failed to open vendor camera module");
+ return rv;
+}
+
+/*******************************************************************
+ * implementation of camera_device_ops functions
+ *******************************************************************/
+
+int camera_set_preview_window(struct camera_device * device,
+ struct preview_stream_ops *window)
+{
+ LOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
+
+ if(!device)
+ return -EINVAL;
+
+ return VENDOR_CALL(device, set_preview_window, window);
+}
+
+void camera_set_callbacks(struct camera_device * device,
+ camera_notify_callback notify_cb,
+ camera_data_callback data_cb,
+ camera_data_timestamp_callback data_cb_timestamp,
+ camera_request_memory get_memory,
+ void *user)
+{
+ LOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
+ LOGV("%s", __FUNCTION__);
+
+ if(!device)
+ return;
+
+ VENDOR_CALL(device, set_callbacks, notify_cb, data_cb, data_cb_timestamp, get_memory, user);
+}
+
+void camera_enable_msg_type(struct camera_device * device, int32_t msg_type)
+{
+ LOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
+ LOGV("%s", __FUNCTION__);
+
+ if(!device)
+ return;
+
+ VENDOR_CALL(device, enable_msg_type, msg_type);
+}
+
+void camera_disable_msg_type(struct camera_device * device, int32_t msg_type)
+{
+ LOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
+ LOGV("%s", __FUNCTION__);
+
+ if(!device)
+ return;
+
+ VENDOR_CALL(device, disable_msg_type, msg_type);
+}
+
+int camera_msg_type_enabled(struct camera_device * device, int32_t msg_type)
+{
+ LOGV("%s", __FUNCTION__);
+ LOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
+
+ if(!device)
+ return 0;
+
+ return VENDOR_CALL(device, msg_type_enabled, msg_type);
+}
+
+int camera_start_preview(struct camera_device * device)
+{
+ LOGV("%s", __FUNCTION__);
+ LOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
+
+ if(!device)
+ return -EINVAL;
+
+ return VENDOR_CALL(device, start_preview);
+}
+
+void camera_stop_preview(struct camera_device * device)
+{
+ LOGV("%s", __FUNCTION__);
+ LOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
+
+ if(!device)
+ return;
+
+ VENDOR_CALL(device, stop_preview);
+}
+
+int camera_preview_enabled(struct camera_device * device)
+{
+ LOGV("%s", __FUNCTION__);
+ LOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
+
+ if(!device)
+ return -EINVAL;
+
+ return VENDOR_CALL(device, preview_enabled);
+}
+
+int camera_store_meta_data_in_buffers(struct camera_device * device, int enable)
+{
+ LOGV("%s", __FUNCTION__);
+ LOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
+
+ if(!device)
+ return -EINVAL;
+
+ return VENDOR_CALL(device, store_meta_data_in_buffers, enable);
+}
+
+int camera_start_recording(struct camera_device * device)
+{
+ LOGV("%s", __FUNCTION__);
+ LOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
+
+ if(!device)
+ return EINVAL;
+
+ return VENDOR_CALL(device, start_recording);
+}
+
+void camera_stop_recording(struct camera_device * device)
+{
+ LOGV("%s", __FUNCTION__);
+ LOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
+
+ if(!device)
+ return;
+
+
+ VENDOR_CALL(device, stop_recording);
+}
+
+int camera_recording_enabled(struct camera_device * device)
+{
+ LOGV("%s", __FUNCTION__);
+ LOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
+
+ if(!device)
+ return -EINVAL;
+
+ return VENDOR_CALL(device, recording_enabled);
+}
+
+void camera_release_recording_frame(struct camera_device * device,
+ const void *opaque)
+{
+ LOGV("%s", __FUNCTION__);
+ LOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
+
+ if(!device)
+ return;
+
+ VENDOR_CALL(device, release_recording_frame, opaque);
+}
+
+int camera_auto_focus(struct camera_device * device)
+{
+ LOGV("%s", __FUNCTION__);
+ LOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
+
+ if(!device)
+ return -EINVAL;
+
+
+ return VENDOR_CALL(device, auto_focus);
+}
+
+int camera_cancel_auto_focus(struct camera_device * device)
+{
+ LOGV("%s", __FUNCTION__);
+ LOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
+
+ if(!device)
+ return -EINVAL;
+
+
+ return VENDOR_CALL(device, cancel_auto_focus);
+}
+
+int camera_take_picture(struct camera_device * device)
+{
+ LOGV("%s", __FUNCTION__);
+ LOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
+
+ if(!device)
+ return -EINVAL;
+
+ return VENDOR_CALL(device, take_picture);
+}
+
+int camera_cancel_picture(struct camera_device * device)
+{
+ LOGV("%s", __FUNCTION__);
+ LOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
+
+ if(!device)
+ return -EINVAL;
+
+ return VENDOR_CALL(device, take_picture);
+}
+
+int camera_set_parameters(struct camera_device * device, const char *params)
+{
+ LOGV("%s", __FUNCTION__);
+ LOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
+
+ if(!device)
+ return -EINVAL;
+
+ return VENDOR_CALL(device, set_parameters, params);
+}
+
+char* camera_get_parameters(struct camera_device * device)
+{
+ LOGV("%s", __FUNCTION__);
+ LOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
+
+ if(!device)
+ return NULL;
+
+ return VENDOR_CALL(device, get_parameters);
+}
+
+static void camera_put_parameters(struct camera_device *device, char *parms)
+{
+ LOGV("%s", __FUNCTION__);
+ LOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
+
+ if(!device)
+ return;
+
+ VENDOR_CALL(device, put_parameters, parms);
+}
+
+int camera_send_command(struct camera_device * device,
+ int32_t cmd, int32_t arg1, int32_t arg2)
+{
+ LOGV("%s", __FUNCTION__);
+ LOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
+
+ if(!device)
+ return -EINVAL;
+
+ return VENDOR_CALL(device, send_command, cmd, arg1, arg2);
+}
+
+void camera_release(struct camera_device * device)
+{
+ LOGV("%s", __FUNCTION__);
+ LOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
+
+ if(!device)
+ return;
+
+ VENDOR_CALL(device, release);
+}
+
+int camera_dump(struct camera_device * device, int fd)
+{
+ if(!device)
+ return -EINVAL;
+
+ return VENDOR_CALL(device, dump, fd);
+}
+
+extern "C" void heaptracker_free_leaked_memory(void);
+
+int camera_device_close(hw_device_t* device)
+{
+ int ret = 0;
+ wrapper_camera_device_t *wrapper_dev = NULL;
+
+ LOGV("%s", __FUNCTION__);
+
+ android::Mutex::Autolock lock(gCameraWrapperLock);
+
+ if (!device) {
+ ret = -EINVAL;
+ goto done;
+ }
+
+ wrapper_dev = (wrapper_camera_device_t*) device;
+
+ wrapper_dev->vendor->common.close((hw_device_t*)wrapper_dev->vendor);
+ if (wrapper_dev->base.ops)
+ free(wrapper_dev->base.ops);
+ free(wrapper_dev);
+done:
+#ifdef HEAPTRACKER
+ heaptracker_free_leaked_memory();
+#endif
+ return ret;
+}
+
+/*******************************************************************
+ * implementation of camera_module functions
+ *******************************************************************/
+
+/* open device handle to one of the cameras
+ *
+ * assume camera service will keep singleton of each camera
+ * so this function will always only be called once per camera instance
+ */
+
+int camera_device_open(const hw_module_t* module, const char* name,
+ hw_device_t** device)
+{
+ int rv = 0;
+ int num_cameras = 0;
+ int cameraid;
+ wrapper_camera_device_t* camera_device = NULL;
+ camera_device_ops_t* camera_ops = NULL;
+
+ android::Mutex::Autolock lock(gCameraWrapperLock);
+
+ LOGV("camera_device open");
+
+ if (name != NULL) {
+ if (check_vendor_module())
+ return -EINVAL;
+
+ cameraid = atoi(name);
+ num_cameras = gVendorModule->get_number_of_cameras();
+
+ if(cameraid > num_cameras)
+ {
+ LOGE("camera service provided cameraid out of bounds, "
+ "cameraid = %d, num supported = %d",
+ cameraid, num_cameras);
+ rv = -EINVAL;
+ goto fail;
+ }
+
+ camera_device = (wrapper_camera_device_t*)malloc(sizeof(*camera_device));
+ if(!camera_device)
+ {
+ LOGE("camera_device allocation fail");
+ rv = -ENOMEM;
+ goto fail;
+ }
+ memset(camera_device, 0, sizeof(*camera_device));
+
+ if(rv = gVendorModule->common.methods->open((const hw_module_t*)gVendorModule, name, (hw_device_t**)&(camera_device->vendor)))
+ {
+ LOGE("vendor camera open fail");
+ goto fail;
+ }
+ LOGV("%s: got vendor camera device 0x%08X", __FUNCTION__, (uintptr_t)(camera_device->vendor));
+
+ camera_ops = (camera_device_ops_t*)malloc(sizeof(*camera_ops));
+ if(!camera_ops)
+ {
+ LOGE("camera_ops allocation fail");
+ rv = -ENOMEM;
+ goto fail;
+ }
+
+ memset(camera_ops, 0, sizeof(*camera_ops));
+
+ camera_device->base.common.tag = HARDWARE_DEVICE_TAG;
+ camera_device->base.common.version = 0;
+ camera_device->base.common.module = (hw_module_t *)(module);
+ camera_device->base.common.close = camera_device_close;
+ camera_device->base.ops = camera_ops;
+
+ camera_ops->set_preview_window = camera_set_preview_window;
+ camera_ops->set_callbacks = camera_set_callbacks;
+ camera_ops->enable_msg_type = camera_enable_msg_type;
+ camera_ops->disable_msg_type = camera_disable_msg_type;
+ camera_ops->msg_type_enabled = camera_msg_type_enabled;
+ camera_ops->start_preview = camera_start_preview;
+ camera_ops->stop_preview = camera_stop_preview;
+ camera_ops->preview_enabled = camera_preview_enabled;
+ camera_ops->store_meta_data_in_buffers = camera_store_meta_data_in_buffers;
+ camera_ops->start_recording = camera_start_recording;
+ camera_ops->stop_recording = camera_stop_recording;
+ camera_ops->recording_enabled = camera_recording_enabled;
+ camera_ops->release_recording_frame = camera_release_recording_frame;
+ camera_ops->auto_focus = camera_auto_focus;
+ camera_ops->cancel_auto_focus = camera_cancel_auto_focus;
+ camera_ops->take_picture = camera_take_picture;
+ camera_ops->cancel_picture = camera_cancel_picture;
+ camera_ops->set_parameters = camera_set_parameters;
+ camera_ops->get_parameters = camera_get_parameters;
+ camera_ops->put_parameters = camera_put_parameters;
+ camera_ops->send_command = camera_send_command;
+ camera_ops->release = camera_release;
+ camera_ops->dump = camera_dump;
+
+ *device = &camera_device->base.common;
+ }
+
+ return rv;
+
+fail:
+ if(camera_device) {
+ free(camera_device);
+ camera_device = NULL;
+ }
+ if(camera_ops) {
+ free(camera_ops);
+ camera_ops = NULL;
+ }
+ *device = NULL;
+ return rv;
+}
+
+int camera_get_number_of_cameras(void)
+{
+ LOGV("%s", __FUNCTION__);
+ if (check_vendor_module())
+ return 0;
+ return gVendorModule->get_number_of_cameras();
+}
+
+int camera_get_camera_info(int camera_id, struct camera_info *info)
+{
+ LOGV("%s", __FUNCTION__);
+ if (check_vendor_module())
+ return 0;
+ return gVendorModule->get_camera_info(camera_id, info);
+}
+
+
+
+
+
diff --git a/cm.mk b/cm.mk
new file mode 100644
index 0000000..d2f2c8e
--- /dev/null
+++ b/cm.mk
@@ -0,0 +1,36 @@
+#
+# Copyright (C) 2012 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.
+#
+
+## Specify phone tech before including full_phone
+$(call inherit-product, vendor/cm/config/gsm.mk)
+
+# Release name
+PRODUCT_RELEASE_NAME := SGS2
+
+# Inherit some common CM stuff.
+$(call inherit-product, vendor/cm/config/common_full_phone.mk)
+
+# Inherit device configuration
+$(call inherit-product, device/samsung/galaxys2/full_galaxys2.mk)
+
+## Device identifier. This must come after all inclusions
+PRODUCT_DEVICE := galaxys2
+PRODUCT_NAME := cm_galaxys2
+PRODUCT_BRAND := Samsung
+PRODUCT_MODEL := GT-I9100
+
+#Set build fingerprint / ID / Prduct Name ect.
+PRODUCT_BUILD_PROP_OVERRIDES += PRODUCT_NAME=GT-I9100 BUILD_ID=IML74K BUILD_DISPLAY_ID=IML74K BUILD_FINGERPRINT=samsung/GT-I9100/GT-I9100:4.0.3/IML74K/XXLPB:user/release-keys PRIVATE_BUILD_DESC="GT-I9100-user 4.0.3 IML74K XXLPB release-keys"
diff --git a/configs/asound.conf b/configs/asound.conf
new file mode 100644
index 0000000..6144596
--- /dev/null
+++ b/configs/asound.conf
@@ -0,0 +1,61 @@
+#
+# Copyright(c) 2010 Yamaha Corporation
+#
+
+# ----------------------------------------
+# PCM Interface
+#
+
+pcm.hifi {
+ type plug
+ slave.pcm {
+ type hw
+ card 0
+ device 0
+ format S16_LE
+ channels 2
+ rate 44100
+ }
+}
+
+pcm.voice {
+ type plug
+ slave.pcm {
+ type hw
+ card 0
+ device 1
+ format S16_LE
+ channels 1
+ rate 8000
+ }
+}
+
+pcm.bluetooth {
+ type plug
+ slave.pcm {
+ type hw
+ card 0
+ device 2
+ format S16_LE
+ channels 1
+ rate 8000
+ }
+}
+
+# ----------------------------------------
+# Mixer Interface
+#
+
+ctl.mc1n2 {
+ type hw
+ card 0
+}
+
+# ----------------------------------------
+# Hardware Dependant Interface
+#
+
+hwdep.mc1n2 {
+ type hw
+ card 0
+}
diff --git a/configs/bcmdhd.cal b/configs/bcmdhd.cal
new file mode 100644
index 0000000..a820b83
--- /dev/null
+++ b/configs/bcmdhd.cal
@@ -0,0 +1,118 @@
+manfid=0x2d0
+prodid=0x0532
+vendid=0x14e4
+devid=0x4360
+boardtype=0x0532
+boardrev=0x20
+boardflags=0x10080201
+
+nocrc=1
+xtalfreq=37400
+xtalmode=0x20,0x4,0
+boardnum=22
+macaddr=00:90:4c:c5:12:38
+ag0=252
+ag1=252
+aa2g=1
+aa5g=1
+ccode=GB
+
+#for BT-coexistence
+btc_params80=0
+btc_params6=10
+btc_params8=10000
+
+sd_gpout=0
+# sd_oobonly=1
+muxenab=0x10
+
+# 2G PA param_B42R 110927
+pa0b0=0x12E4
+pa0b1=0xFE09
+pa0b2=0xFF9A
+#pa0itssit=62
+rssismf2g=0xa
+rssismc2g=0x3
+rssisav2g=0x7
+
+# rssi params for 5GHz B42R_110803
+#rssismf5g=0x4
+rssismf5g=0xa
+rssismc5g=0x7
+rssisav5g=0x1
+#PA parameters for lower band
+pa1lob0=0x144F
+pa1lob1=0xFD6B
+pa1lob2=0xFF3B
+#PA parameters for midband
+pa1b0=0x139C
+pa1b1=0xFD87
+pa1b2=0xFF4F
+#PA parameters for high band
+pa1hib0=0x12CA
+pa1hib1=0xFD9A
+pa1hib2=0xFF4E
+
+# 2G PA offset
+maxp2ga0=64
+sromrev=3
+cckpo=0
+ofdm2gpo=0x66666666
+mcs2gpo0=0xaaaa
+mcs2gpo1=0xaaaa
+
+# 5G PA offset
+maxp5ga0=66
+maxp5gla0=66
+maxp5gha0=66
+ofdm5gpo=0x22222222
+ofdm5glpo=0x11111111
+ofdm5ghpo=0x22222222
+mcs5gpo0=0x6666
+mcs5gpo1=0x6666
+mcs5glpo0=0x5555
+mcs5glpo1=0x5555
+mcs5ghpo0=0x6666
+mcs5ghpo1=0x6666
+
+cckPwrOffset=4
+cckdigfilttype=22
+ofdmdigfilttype=2
+extpagain5g=2
+#wl0id=0x431b
+
+# For 2GHz Tx EVM/SM
+rfreg033=0x19
+rfreg033_cck=0x1d
+pacalidx2g=65
+dacrate2g=160
+txalpfbyp2g=1
+bphyscale=17
+
+# 5GHz LOFT and IQ CAL
+txgaintbl5g=1
+txiqlopapu5g=1
+txiqlopag5g=0x10
+iqlocalidx5g=24
+
+# 5GHz Noise CAL parameter
+noise_cal_po_5g=5
+noise_cal_enable_5g=0
+
+# 2GHz RxPER at low rates
+noise_cal_ref_2g=56
+noise_cal_po_bias_2g=-4
+noise_cal_enable_2g=1
+
+# Max input level on a-band
+triso5g=9
+
+# Tx power control, especially temp.
+tssitime=1
+
+#fc+1.7GHz Spur Elimination
+loidacmode5g=1
+
+swctrlmap_2g=0x84048404, 0x82028202, 0x84048404, 0x010202, 0x1ff
+swctrlmap_5g=0xC040C040, 0xB030A020, 0xA020C040, 0x010A02, 0x2F8
+
diff --git a/configs/egl.cfg b/configs/egl.cfg
new file mode 100644
index 0000000..4515dfd
--- /dev/null
+++ b/configs/egl.cfg
@@ -0,0 +1 @@
+0 1 mali
diff --git a/configs/gps.conf b/configs/gps.conf
new file mode 100644
index 0000000..b766326
--- /dev/null
+++ b/configs/gps.conf
@@ -0,0 +1,6 @@
+NTP_SERVER=north-america.pool.ntp.org
+XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin
+XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin
+XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin
+SUPL_HOST=supl.google.com
+SUPL_PORT=7276
diff --git a/configs/media_profiles.xml b/configs/media_profiles.xml
new file mode 100644
index 0000000..0388e58
--- /dev/null
+++ b/configs/media_profiles.xml
@@ -0,0 +1,497 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 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.
+-->
+<!DOCTYPE MediaSettings [
+ <!ELEMENT MediaSettings (CamcorderProfiles,
+ EncoderOutputFileFormat+,
+ VideoEncoderCap+,
+ AudioEncoderCap+,
+ VideoDecoderCap,
+ AudioDecoderCap)>
+ <!ELEMENT CamcorderProfiles (EncoderProfile+, ImageEncoding+, ImageDecoding, Camera)>
+ <!ELEMENT EncoderProfile (Video, Audio)>
+ <!ATTLIST EncoderProfile quality (timelapse1080p|timelapse720p|timelapse480p|timelapsehigh|timelapselow|480p|qcif|high|low) #REQUIRED>
+ <!ATTLIST EncoderProfile fileFormat (mp4|3gp) #REQUIRED>
+ <!ATTLIST EncoderProfile duration (30|60) #REQUIRED>
+ <!ATTLIST EncoderProfile cameraId (0|1) #REQUIRED>
+ <!ELEMENT Video EMPTY>
+ <!ATTLIST Video codec (h264|h263|m4v) #REQUIRED>
+ <!ATTLIST Video bitRate CDATA #REQUIRED>
+ <!ATTLIST Video width CDATA #REQUIRED>
+ <!ATTLIST Video height CDATA #REQUIRED>
+ <!ATTLIST Video frameRate CDATA #REQUIRED>
+ <!ELEMENT Audio EMPTY>
+ <!ATTLIST Audio codec (amrnb|amrwb|aac) #REQUIRED>
+ <!ATTLIST Audio bitRate CDATA #REQUIRED>
+ <!ATTLIST Audio sampleRate CDATA #REQUIRED>
+ <!ATTLIST Audio channels (1|2) #REQUIRED>
+ <!ELEMENT ImageEncoding EMPTY>
+ <!ATTLIST ImageEncoding quality (90|80|70|60|50|40) #REQUIRED>
+ <!ELEMENT ImageDecoding EMPTY>
+ <!ATTLIST ImageDecoding memCap CDATA #REQUIRED>
+ <!ELEMENT Camera EMPTY>
+ <!ATTLIST Camera previewFrameRate CDATA #REQUIRED>
+ <!ELEMENT EncoderOutputFileFormat EMPTY>
+ <!ATTLIST EncoderOutputFileFormat name (mp4|3gp) #REQUIRED>
+ <!ELEMENT VideoEncoderCap EMPTY>
+ <!ATTLIST VideoEncoderCap name (h264|h263|m4v|wmv) #REQUIRED>
+ <!ATTLIST VideoEncoderCap enabled (true|false) #REQUIRED>
+ <!ATTLIST VideoEncoderCap minBitRate CDATA #REQUIRED>
+ <!ATTLIST VideoEncoderCap maxBitRate CDATA #REQUIRED>
+ <!ATTLIST VideoEncoderCap minFrameWidth CDATA #REQUIRED>
+ <!ATTLIST VideoEncoderCap maxFrameWidth CDATA #REQUIRED>
+ <!ATTLIST VideoEncoderCap minFrameHeight CDATA #REQUIRED>
+ <!ATTLIST VideoEncoderCap maxFrameHeight CDATA #REQUIRED>
+ <!ATTLIST VideoEncoderCap minFrameRate CDATA #REQUIRED>
+ <!ATTLIST VideoEncoderCap maxFrameRate CDATA #REQUIRED>
+ <!ELEMENT AudioEncoderCap EMPTY>
+ <!ATTLIST AudioEncoderCap name (amrnb|amrwb|aac|wma) #REQUIRED>
+ <!ATTLIST AudioEncoderCap enabled (true|false) #REQUIRED>
+ <!ATTLIST AudioEncoderCap minBitRate CDATA #REQUIRED>
+ <!ATTLIST AudioEncoderCap maxBitRate CDATA #REQUIRED>
+ <!ATTLIST AudioEncoderCap minSampleRate CDATA #REQUIRED>
+ <!ATTLIST AudioEncoderCap maxSampleRate CDATA #REQUIRED>
+ <!ATTLIST AudioEncoderCap minChannels (1|2) #REQUIRED>
+ <!ATTLIST AudioEncoderCap maxChannels (1|2) #REQUIRED>
+ <!ELEMENT VideoDecoderCap EMPTY>
+ <!ATTLIST VideoDecoderCap name (wmv) #REQUIRED>
+ <!ATTLIST VideoDecoderCap enabled (true|false) #REQUIRED>
+ <!ELEMENT AudioDecoderCap EMPTY>
+ <!ATTLIST AudioDecoderCap name (wma) #REQUIRED>
+ <!ATTLIST AudioDecoderCap enabled (true|false) #REQUIRED>
+ <!ELEMENT VideoEditorCap EMPTY>
+ <!ATTLIST VideoEditorCap maxInputFrameWidth CDATA #REQUIRED>
+ <!ATTLIST VideoEditorCap maxInputFrameHeight CDATA #REQUIRED>
+ <!ATTLIST VideoEditorCap maxOutputFrameWidth CDATA #REQUIRED>
+ <!ATTLIST VideoEditorCap maxOutputFrameHeight CDATA #REQUIRED>
+ <!ATTLIST VideoEditorCap maxPrefetchYUVFrames CDATA #REQUIRED>
+ <!ELEMENT ExportVideoProfile EMPTY>
+ <!ATTLIST ExportVideoProfile name (h264|h263|m4v) #REQUIRED>
+ <!ATTLIST ExportVideoProfile profile CDATA #REQUIRED>
+ <!ATTLIST ExportVideoProfile level CDATA #REQUIRED>
+]>
+<!--
+ This file is used to declare the multimedia profiles and capabilities
+ on an android-powered device.
+-->
+<MediaSettings>
+ <!-- Each camcorder profile defines a set of predefined configuration parameters -->
+ <!-- Back Camera -->
+ <CamcorderProfiles cameraId="0">
+
+ <EncoderProfile quality="low" fileFormat="3gp" duration="30">
+ <Video codec="h264"
+ bitRate="384000"
+ width="176"
+ height="144"
+ frameRate="30" />
+
+ <Audio codec="amrnb"
+ bitRate="12200"
+ sampleRate="8000"
+ channels="1" />
+ </EncoderProfile>
+
+ <EncoderProfile quality="high" fileFormat="3gp" duration="30">
+ <Video codec="h264"
+ bitRate="17000000"
+ width="1920"
+ height="1080"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="128000"
+ sampleRate="48000"
+ channels="1" />
+ </EncoderProfile>
+
+ <EncoderProfile quality="qcif" fileFormat="3gp" duration="30">
+ <Video codec="h264"
+ bitRate="384000"
+ width="176"
+ height="144"
+ frameRate="30" />
+
+ <Audio codec="amrnb"
+ bitRate="12200"
+ sampleRate="8000"
+ channels="1" />
+ </EncoderProfile>
+
+ <EncoderProfile quality="480p" fileFormat="3gp" duration="30">
+ <Video codec="h264"
+ bitRate="3078000"
+ width="640"
+ height="480"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="96000"
+ sampleRate="16000"
+ channels="1" />
+ </EncoderProfile>
+
+ <EncoderProfile quality="720p" fileFormat="3gp" duration="30">
+ <Video codec="h264"
+ bitRate="12000000"
+ width="1280"
+ height="720"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="96000"
+ sampleRate="16000"
+ channels="1" />
+ </EncoderProfile>
+
+ <EncoderProfile quality="1080p" fileFormat="3gp" duration="30">
+ <Video codec="h264"
+ bitRate="17000000"
+ width="1920"
+ height="1080"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="128000"
+ sampleRate="48000"
+ channels="1" />
+ </EncoderProfile>
+
+ <EncoderProfile quality="timelapselow" fileFormat="3gp" duration="30">
+ <Video codec="h264"
+ bitRate="384000"
+ width="176"
+ height="144"
+ frameRate="30" />
+
+ <!--
+ The Audio part of the profile will not be used since time lapse mode
+ does not capture audio
+ -->
+ <Audio codec="amrnb"
+ bitRate="12200"
+ sampleRate="8000"
+ channels="1" />
+ </EncoderProfile>
+
+ <EncoderProfile quality="timelapsehigh" fileFormat="3gp" duration="30">
+ <Video codec="h264"
+ bitRate="17000000"
+ width="1920"
+ height="1080"
+ frameRate="30" />
+
+ <!--
+ The Audio part of the profile will not be used since time lapse mode
+ does not capture audio
+ -->
+ <Audio codec="aac"
+ bitRate="96000"
+ sampleRate="16000"
+ channels="1" />
+ </EncoderProfile>
+
+ <EncoderProfile quality="timelapseqcif" fileFormat="3gp" duration="30">
+ <Video codec="h264"
+ bitRate="384000"
+ width="176"
+ height="144"
+ frameRate="30" />
+
+ <!--
+ The Audio part of the profile will not be used since time lapse mode
+ does not capture audio
+ -->
+ <Audio codec="amrnb"
+ bitRate="12200"
+ sampleRate="8000"
+ channels="1" />
+ </EncoderProfile>
+
+ <EncoderProfile quality="timelapse480p" fileFormat="3gp" duration="30">
+ <Video codec="h264"
+ bitRate="3078000"
+ width="640"
+ height="480"
+ frameRate="30" />
+
+ <!--
+ The Audio part of the profile will not be used since time lapse mode
+ does not capture audio
+ -->
+ <Audio codec="aac"
+ bitRate="96000"
+ sampleRate="16000"
+ channels="1" />
+ </EncoderProfile>
+
+ <EncoderProfile quality="timelapse720p" fileFormat="3gp" duration="30">
+ <Video codec="h264"
+ bitRate="12000000"
+ width="1280"
+ height="720"
+ frameRate="30" />
+
+ <!--
+ The Audio part of the profile will not be used since time lapse mode
+ does not capture audio
+ -->
+ <Audio codec="aac"
+ bitRate="96000"
+ sampleRate="16000"
+ channels="1" />
+ </EncoderProfile>
+
+ <EncoderProfile quality="timelapse1080p" fileFormat="3gp" duration="30">
+ <Video codec="h264"
+ bitRate="17000000"
+ width="1920"
+ height="1080"
+ frameRate="30" />
+
+ <!--
+ The Audio part of the profile will not be used since time lapse mode
+ does not capture audio
+ -->
+ <Audio codec="aac"
+ bitRate="96000"
+ sampleRate="16000"
+ channels="1" />
+ </EncoderProfile>
+
+ <ImageEncoding quality="90" />
+ <ImageEncoding quality="80" />
+ <ImageEncoding quality="70" />
+ <ImageDecoding memCap="20000000" />
+
+ </CamcorderProfiles>
+
+ <!-- Front Camera -->
+ <CamcorderProfiles cameraId="1">
+
+ <EncoderProfile quality="low" fileFormat="3gp" duration="15">
+ <Video codec="h264"
+ bitRate="384000"
+ width="176"
+ height="144"
+ frameRate="30" />
+
+ <Audio codec="amrnb"
+ bitRate="12200"
+ sampleRate="8000"
+ channels="1" />
+ </EncoderProfile>
+
+ <EncoderProfile quality="high" fileFormat="3gp" duration="15">
+ <Video codec="h264"
+ bitRate="3078000"
+ width="640"
+ height="480"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="96000"
+ sampleRate="16000"
+ channels="1" />
+ </EncoderProfile>
+
+ <EncoderProfile quality="qcif" fileFormat="3gp" duration="15">
+ <Video codec="h264"
+ bitRate="384000"
+ width="176"
+ height="144"
+ frameRate="30" />
+
+ <Audio codec="amrnb"
+ bitRate="12200"
+ sampleRate="8000"
+ channels="1" />
+ </EncoderProfile>
+
+ <EncoderProfile quality="480p" fileFormat="3gp" duration="15">
+ <Video codec="h264"
+ bitRate="3078000"
+ width="640"
+ height="480"
+ frameRate="30" />
+
+ <Audio codec="aac"
+ bitRate="96000"
+ sampleRate="16000"
+ channels="1" />
+ </EncoderProfile>
+
+ <EncoderProfile quality="timelapselow" fileFormat="3gp" duration="15">
+ <Video codec="h264"
+ bitRate="384000"
+ width="176"
+ height="144"
+ frameRate="30" />
+
+ <!--
+ The Audio part of the profile will not be used since time lapse mode
+ does not capture audio
+ -->
+ <Audio codec="amrnb"
+ bitRate="12200"
+ sampleRate="8000"
+ channels="1" />
+ </EncoderProfile>
+
+ <EncoderProfile quality="timelapsehigh" fileFormat="3gp" duration="15">
+ <Video codec="h264"
+ bitRate="3078000"
+ width="640"
+ height="480"
+ frameRate="30" />
+
+ <!--
+ The Audio part of the profile will not be used since time lapse mode
+ does not capture audio
+ -->
+ <Audio codec="aac"
+ bitRate="96000"
+ sampleRate="16000"
+ channels="1" />
+ </EncoderProfile>
+
+ <EncoderProfile quality="timelapseqcif" fileFormat="3gp" duration="15">
+ <Video codec="h264"
+ bitRate="384000"
+ width="176"
+ height="144"
+ frameRate="30" />
+
+ <!--
+ The Audio part of the profile will not be used since time lapse mode
+ does not capture audio
+ -->
+ <Audio codec="amrnb"
+ bitRate="12200"
+ sampleRate="8000"
+ channels="1" />
+ </EncoderProfile>
+
+ <EncoderProfile quality="timelapse480p" fileFormat="3gp" duration="15">
+ <Video codec="h264"
+ bitRate="3078000"
+ width="640"
+ height="480"
+ frameRate="30" />
+
+ <!--
+ The Audio part of the profile will not be used since time lapse mode
+ does not capture audio
+ -->
+ <Audio codec="aac"
+ bitRate="96000"
+ sampleRate="16000"
+ channels="1" />
+ </EncoderProfile>
+
+ <ImageEncoding quality="90" />
+ <ImageEncoding quality="80" />
+ <ImageEncoding quality="70" />
+ <ImageDecoding memCap="20000000" />
+
+ </CamcorderProfiles>
+
+ <EncoderOutputFileFormat name="3gp" />
+ <EncoderOutputFileFormat name="mp4" />
+
+ <!--
+ If a codec is not enabled, it is invisible to the applications
+ In other words, the applications won't be able to use the codec
+ or query the capabilities of the codec at all if it is disabled
+ -->
+ <VideoEncoderCap name="h264" enabled="true"
+ minBitRate="64000" maxBitRate="20000000"
+ minFrameWidth="176" maxFrameWidth="1920"
+ minFrameHeight="144" maxFrameHeight="1080"
+ minFrameRate="1" maxFrameRate="30" />
+
+ <VideoEncoderCap name="h263" enabled="true"
+ minBitRate="64000" maxBitRate="1000000"
+ minFrameWidth="176" maxFrameWidth="800"
+ minFrameHeight="144" maxFrameHeight="480"
+ minFrameRate="1" maxFrameRate="30" />
+
+ <VideoEncoderCap name="m4v" enabled="true"
+ minBitRate="64000" maxBitRate="20000000"
+ minFrameWidth="176" maxFrameWidth="1920"
+ minFrameHeight="144" maxFrameHeight="1080"
+ minFrameRate="1" maxFrameRate="30" />
+
+ <AudioEncoderCap name="aac" enabled="true"
+ minBitRate="8192" maxBitRate="196000"
+ minSampleRate="8000" maxSampleRate="48000"
+ minChannels="1" maxChannels="2" />
+
+ <AudioEncoderCap name="amrwb" enabled="true"
+ minBitRate="6600" maxBitRate="23050"
+ minSampleRate="16000" maxSampleRate="16000"
+ minChannels="1" maxChannels="1" />
+
+ <AudioEncoderCap name="amrnb" enabled="true"
+ minBitRate="5525" maxBitRate="12200"
+ minSampleRate="8000" maxSampleRate="8000"
+ minChannels="1" maxChannels="1" />
+
+ <!--
+ FIXME:
+ We do not check decoder capabilities at present
+ At present, we only check whether windows media is visible
+ for TEST applications. For other applications, we do
+ not perform any checks at all.
+ -->
+ <VideoDecoderCap name="wmv" enabled="false"/>
+ <AudioDecoderCap name="wma" enabled="false"/>
+
+ <!--
+ The VideoEditor Capability configuration:
+ - maxInputFrameWidth: maximum video width of imported video clip.
+ - maxInputFrameHeight: maximum video height of imported video clip.
+ - maxOutputFrameWidth: maximum video width of exported video clip.
+ - maxOutputFrameHeight: maximum video height of exported video clip.
+ - maxPrefetchYUVFrames: maximum prefetch YUV frames for encoder,
+ used to limit the amount of memory for prefetched YUV frames.
+ For this platform, it allows maximum ~1MB(~0.1MB per QVGA frame x 10
+ frames) memory.
+ -->
+
+ <VideoEditorCap maxInputFrameWidth="1280"
+ maxInputFrameHeight="720" maxOutputFrameWidth="1280"
+ maxOutputFrameHeight="720" maxPrefetchYUVFrames="5"/>
+ <!--
+ The VideoEditor Export codec profile and level values
+ correspond to the values in OMX_Video.h.
+ E.g. for h264, profile value 1 means OMX_VIDEO_AVCProfileBaseline
+ and level 256 means OMX_VIDEO_AVCLevel3.
+ Please note that the values are in decimal.
+ These values are for video encoder.
+ -->
+ <!--
+ Codec = h.264, Baseline profile, level 3.1
+ -->
+ <ExportVideoProfile name="h264" profile= "1" level="512"/>
+ <!--
+ Codec = h.263, Baseline profile, level 0
+ -->
+ <ExportVideoProfile name="h263" profile= "1" level="1"/>
+ <!--
+ Codec = mpeg4, Simple profile, level 3
+ -->
+ <ExportVideoProfile name="m4v" profile= "1" level="16"/>
+</MediaSettings>
diff --git a/configs/nvram_net.txt b/configs/nvram_net.txt
new file mode 100644
index 0000000..61df36d
--- /dev/null
+++ b/configs/nvram_net.txt
@@ -0,0 +1,113 @@
+manfid=0x2d0
+prodid=0x0532
+vendid=0x14e4
+devid=0x4360
+boardtype=0x0532
+boardrev=0x20
+boardflags=0x10080201
+
+nocrc=1
+xtalfreq=37400
+xtalmode=0x20,0x4,0
+boardnum=22
+macaddr=00:90:4c:c5:12:38
+ag0=255
+ag1=255
+aa2g=1
+ccode=GB
+
+btc_params80=0
+btc_params6=10
+btc_params8=10000
+
+sd_gpout=0
+sd_oobonly=1
+
+# 2G PA param
+pa0b0=0x14AA
+pa0b1=0xFDB3
+pa0b2=0xFF6F
+#pa0itssit=62
+rssismf2g=0xa
+rssismc2g=0x3
+rssisav2g=0x7
+
+# rssi params for 5GHz B42_110728
+#rssismf5g=0x4
+rssismf5g=0xa
+rssismc5g=0x7
+rssisav5g=0x1
+#PA parameters for lower band
+pa1lob0=4676
+pa1lob1=64858
+pa1lob2=65301
+#PA parameters for midband
+pa1b0=4445
+pa1b1=64883
+pa1b2=65310
+#PA parameters for high band
+pa1hib0=4567
+pa1hib1=64876
+pa1hib2=65332
+
+# 2G PA offset
+maxp2ga0=76
+sromrev=3
+cckpo=0
+ofdm2gpo=0x66666666
+mcs2gpo0=0xaaaa
+mcs2gpo1=0xaaaa
+
+# 5G PA offset
+maxp5ga0=66
+maxp5gla0=66
+maxp5gha0=66
+ofdm5gpo=0x66666666
+ofdm5glpo=0x66666666
+ofdm5ghpo=0x55555555
+mcs5gpo0=0x6666
+mcs5gpo1=0x6666
+mcs5glpo0=0x6666
+mcs5glpo1=0x6666
+mcs5ghpo0=0x6666
+mcs5ghpo1=0x6666
+
+cckPwrOffset=4
+cckdigfilttype=21
+ofdmdigfilttype=2
+extpagain5g=2
+#wl0id=0x431b
+
+# For 2GHz Tx EVM/SM
+rfreg033=0x19
+rfreg033_cck=0x1f
+pacalidx2g=65
+dacrate2g=160
+txalpfbyp2g=1
+bphyscale=17
+
+#5GHz LOFT and IQ CAL
+txgaintbl5g=1
+txiqlopapu5g=1
+txiqlopag5g=0x10
+iqlocalidx5g=24
+#iqlocalidx5g=64 to 24
+
+# 5GHz Noise CAL parameter
+noise_cal_po_5g=5
+noise_cal_enable_5g=0
+
+# 2GHz RxPER at low rates
+noise_cal_ref_2g=56
+noise_cal_po_bias_2g=-4
+noise_cal_enable_2g=1
+
+# Max input level on a-band
+triso5g=9
+
+# Tx power control, especially temp.
+#tssitime=1
+
+swctrlmap_2g=0x84048404, 0x82028202, 0x84048404, 0x010202, 0x1ff
+swctrlmap_5g=0xC040C040, 0xB030A020, 0xA020C040, 0x010A02, 0x2F8
+
diff --git a/configs/sirfgps.conf b/configs/sirfgps.conf
new file mode 100644
index 0000000..ee35b00
--- /dev/null
+++ b/configs/sirfgps.conf
@@ -0,0 +1,38 @@
+#CSR SiRF plc
+#PROJECT_NAME : white Space is not allowed
+#UART_DRIVER : Uart Driver Path
+#RESET_GPIO : Reset GPIO Driver Path
+#ONOFF_GPIO : OnOff GPIO Driver Path
+#EXTERNAL_LNA : 1 - use External LNA, 0 - use Internal LNA only
+#REF_CLOCK_26MHZ: 1 - use 26MHz TCXO, 0 - use 16.369MHz TCXO
+#UART_BAUD_RATE : 0 - 115200bps 1 - 230400, 2 - 460800, 3 - 57600
+#FREQUENCY_AIDING : 0 - Disable, 1 - Enable
+#SENSOR_AIDING : 0 - Disable, 1 - Enable
+#SET_ID_IMSI : 1 - Use IMSI for SET ID, 0 - Use MSISDN for SET ID, especially for Japan Network Operators
+#DEBUGGING_FILES : 0 - no log file, 1 - log files enabled
+#SSL_ENABLED : 0 - SSL Disabled, 1 - SSL Enabled
+#CERTI_VERSION : 0 - TLSv1 , 1 - SSLv3 , 2 - SSLv23
+#CP_RESPONSETIME : 0 - no priority, 1 - resposne priority time, 2 - resposne priority position ,3 - resposne priority use entire response time
+#REAIDING=20
+#CONTROL_PLANE : 1 - CP Enabled, 0 - CP Disabled, for MP3 player or PND
+#ATT_NETWORK_OPERATOR : 1 - for AT&T, 0 - for other network operator
+PROJECT=SAMSUNG_S5PC210
+UART_DRIVER=/dev/ttySAC1
+RESET_GPIO=/sys/devices/virtual/sec/gps/GPS_nRST/value
+ONOFF_GPIO=/sys/devices/virtual/sec/gps/GPS_PWR_EN/value
+EXTERNAL_LNA=1
+REF_CLOCK_26MHZ=1
+UART_BAUD_RATE=2
+FREQUENCY_AIDING=0
+SENSOR_AIDING=0
+SET_ID_IMSI=1
+DEBUGGING_FILES=0
+SSL_ENABLED=0
+CERTI_VERSION=0
+CP_RESPONSETIME=2
+CONTROL_PLANE=1
+ATT_NETWORK_OPERATOR=0
+ICS_NETWORK_OPERATOR=0
+SGEE=0
+EMC_ENABLE=0
+LOG_PATH=/data \ No newline at end of file
diff --git a/configs/spn-conf.xml b/configs/spn-conf.xml
new file mode 100644
index 0000000..191bc05
--- /dev/null
+++ b/configs/spn-conf.xml
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2006, Google Inc.
+**
+** 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.
+*/
+-->
+
+<!--
+spnOverride attributes:
+ numeric: MCC+MNC from IMSI - this attribute is used as the key
+ imsi_subset: this attribute is used as a imsi filter (imsi format is: [MCC][MNC][imsi_subset][rest of imsi]) - the longest matching imsi_subset is a best match
+ spn: spn to show instead of EFSPN. locales can be specified here too, if needed
+ spn_display_rule: SPN_RULE_SHOW_SPN, SPN_RULE_SHOW_PLMN or both
+ fake_home_on: regard specified PLMN as home
+ fake_roaming_on: regard specified PLMN as roaming (comma-separated list)
+
+examples:
+ <spnOverride
+ numeric="45001" spn="ko_KR;?œêµ­??SPN,en;English SPN,fr;Français SPN,pl;Polski SPN,Default SPN"
+ spn_display_rule="SPN_RULE_SHOW_SPN" spn_override_only_on="45001" fake_home_on="00101,45008"/>
+ <spnOverride numeric="46001" spn="zh_CN;ä¸?›½?”é€? />
+-->
+<spnOverrides>
+
+<!-- Spain -->
+ <spnOverride numeric="21404" spn_display_rule="SPN_RULE_SHOW_SPN" spn_override_only_on="214"/>
+ <spnOverride numeric="21406" spn_display_rule="SPN_RULE_SHOW_SPN" spn_override_only_on="214"/>
+ <spnOverride numeric="21408" spn_display_rule="SPN_RULE_SHOW_SPN" spn_override_only_on="214"/>
+ <spnOverride numeric="21416" spn_display_rule="SPN_RULE_SHOW_SPN" spn_override_only_on="214"/>
+ <spnOverride numeric="21419" spn_display_rule="SPN_RULE_SHOW_SPN" spn_override_only_on="214"/>
+ <spnOverride numeric="214" fake_home_on="21401,21403,21404,21406,21407,21408,21416,21419"/>
+
+<!-- SENA -->
+ <spnOverride numeric="24001" spn_display_rule="SPN_RULE_SHOW_SPN" spn_override_only_on="24005"/>
+ <spnOverride numeric="24007" spn_display_rule="SPN_RULE_SHOW_SPN" spn_override_only_on="24005"/>
+
+<!-- Finland -->
+ <spnOverride numeric="24421" fake_home_on="24405"/>
+
+<!-- Japan -->
+ <spnOverride numeric="44010" spn="NTT DOCOMO"/>
+
+<!-- Poland -->
+ <spnOverride numeric="26006" spn_display_rule="SPN_RULE_SHOW_SPN" spn_override_only_on="26001"/>
+
+<!-- Belgium Telent - Proximus and Mobistar-->
+ <spnOverride numeric="20605" spn_display_rule="SPN_RULE_SHOW_SPN" fake_home_on="20610"/>
+ <spnOverride numeric="20601" imsi_subset="889" spn_display_rule="SPN_RULE_SHOW_SPN" fake_roaming_on="20601"/>
+
+<!-- Netherlands - Telfort and KPN -->
+ <spnOverride numeric="20412" fake_home_on="20408,20410" />
+
+<!-- SpainTelefonica - Tuenti and 21407 -->
+ <spnOverride numeric="21405" fake_home_on="21407"/>
+
+<!-- LTN [latin_protocol] -->
+ <spnOverride numeric="72410" spn_display_rule="SPN_RULE_SHOW_SPN" fake_home_on="72410,72411,72406,72423"/>
+ <spnOverride numeric="72411" spn_display_rule="SPN_RULE_SHOW_SPN" fake_home_on="72410,72411,72406,72423"/>
+ <spnOverride numeric="72406" spn_display_rule="SPN_RULE_SHOW_SPN" fake_home_on="72410,72411,72406,72423"/>
+ <spnOverride numeric="72423" spn_display_rule="SPN_RULE_SHOW_SPN" fake_home_on="72410,72411,72406,72423"/>
+ <spnOverride numeric="72432" spn_display_rule="SPN_RULE_SHOW_SPN" fake_home_on="72432,72433,72434"/>
+ <spnOverride numeric="72433" spn_display_rule="SPN_RULE_SHOW_SPN" fake_home_on="72432,72433,72434"/>
+ <spnOverride numeric="72434" spn_display_rule="SPN_RULE_SHOW_SPN" fake_home_on="72432,72433,72434"/>
+ <spnOverride numeric="73001" spn_display_rule="SPN_RULE_SHOW_SPN" fake_home_on="73001,73010"/>
+ <spnOverride numeric="73010" spn_display_rule="SPN_RULE_SHOW_SPN" fake_home_on="73001,73010"/>
+ <spnOverride numeric="71201" spn_display_rule="SPN_RULE_SHOW_SPN" fake_home_on="71201,71202"/>
+ <spnOverride numeric="71202" spn_display_rule="SPN_RULE_SHOW_SPN" fake_home_on="71201,71202"/>
+ <spnOverride numeric="732103" spn_display_rule="SPN_RULE_SHOW_SPN" fake_home_on="732103,732111"/>
+ <spnOverride numeric="732111" spn_display_rule="SPN_RULE_SHOW_SPN" fake_home_on="732103,732111"/>
+ <spnOverride numeric="73401" spn_display_rule="SPN_RULE_SHOW_SPN" fake_home_on="73401,73402,73403"/>
+ <spnOverride numeric="73402" spn_display_rule="SPN_RULE_SHOW_SPN" fake_home_on="73401,73402,73403"/>
+ <spnOverride numeric="73403" spn_display_rule="SPN_RULE_SHOW_SPN" fake_home_on="73401,73402,73403"/>
+
+<spnOverride numeric="338050" spn_display_rule="SPN_RULE_SHOW_SPN" fake_home_on="33805,338050"/>
+ <spnOverride numeric="33805" spn_display_rule="SPN_RULE_SHOW_SPN" fake_home_on="33805,338050"/>
+ <spnOverride numeric="73007" spn_display_rule="SPN_RULE_SHOW_SPN" fake_home_on="73002"/>
+
+<!-- South Africa -->
+ <spnOverride numeric="65507" imsi_subset="10" spn_display_rule="SPN_RULE_SHOW_SPN" spn="Virgin" spn_override_only_on="655"/> <!-- Virgin is roaming on 'Cell C' network (same mcc-mnc) and this display rule for home country -->
+ <spnOverride numeric="65507" spn_display_rule="SPN_RULE_SHOW_SPN" spn="Cell C"/>
+ <spnOverride numeric="65502" spn_display_rule="SPN_RULE_SHOW_SPN" spn="8.ta"/>
+
+<!-- H3G RM#2022-->
+ <spnOverride numeric="23420" spn_display_rule="SPN_RULE_SHOW_PLMN" spn_override_only_on="23420,23433"/>
+
+<!-- TDC Sweden -->
+ <spnOverride numeric="23801" imsi_subset="72" fake_home_on="24005,24007" fake_roaming_on="23801" />
+ <spnOverride numeric="24014" imsi_subset="72" fake_home_on="24005,24007" fake_roaming_on="23801" />
+
+ <spnOverride numeric="24004" spn_display_rule="SPN_RULE_SHOW_SPN" fake_home_on="24008,24024"/>
+ <spnOverride numeric="24008" spn_display_rule="SPN_RULE_SHOW_SPN" fake_home_on="24004,24024"/>
+ <spnOverride numeric="24024" spn_display_rule="SPN_RULE_SHOW_SPN" fake_home_on="24004,24008"/>
+
+<!-- TDC Norway -->
+ <spnOverride numeric="23801" imsi_subset="71" fake_home_on="24201" fake_roaming_on="23801" />
+ <spnOverride numeric="24208" imsi_subset="71" fake_home_on="24201" fake_roaming_on="23801" />
+
+<!-- TDC Finland -->
+ <spnOverride numeric="24412" imsi_subset="2400" fake_home_on="24412" fake_roaming_on="23801" />
+ <spnOverride numeric="23801" imsi_subset="7300" fake_home_on="24412" fake_roaming_on="23801" />
+ <spnOverride numeric="23211" fake_home_on="23201"/> <!-- bob @ A1 network -->
+ <spnOverride numeric="23212" fake_home_on="23205"/> <!-- yesss! @ Orange AT -->
+ <spnOverride numeric="23207" fake_home_on="23203"/> <!-- tele.ring @ T-Mobile A -->
+ <spnOverride numeric="23207" fake_home_on="23203"/> <!-- tele.ring @ T-Mobile A -->
+ <spnOverride numeric="23430,23431,23432" fake_home_on="23433,23434"/> <!-- T-Mobile @ Orange Network -->
+ <spnOverride numeric="23433,23434" fake_home_on="23430,23431,23432"/> <!-- Orange Network @ T-Mobile -->
+
+<!-- South Africa -->
+ <spnOverride numeric="65507" spn_display_rule="SPN_RULE_SHOW_SPN" spn="Cell C"/>
+ <spnOverride numeric="65502" spn_display_rule="SPN_RULE_SHOW_SPN" spn="8.ta"/>
+
+<!-- Everything Everywhere -->
+ <spnOverride numeric="23430" spn_display_rule="SPN_RULE_SHOW_PLMN" spn_override_only_on="23430,23431,23432,23433,23434,23486"/>
+ <spnOverride numeric="23431" spn_display_rule="SPN_RULE_SHOW_PLMN" spn_override_only_on="23430,23431,23432,23433,23434,23486"/>
+ <spnOverride numeric="23432" spn_display_rule="SPN_RULE_SHOW_PLMN" spn_override_only_on="23430,23431,23432,23433,23434,23486"/>
+ <spnOverride numeric="23433" spn_display_rule="SPN_RULE_SHOW_PLMN" spn_override_only_on="23430,23431,23432,23433,23434,23486"/>
+ <spnOverride numeric="23434" spn_display_rule="SPN_RULE_SHOW_PLMN" spn_override_only_on="23430,23431,23432,23433,23434,23486"/>
+ <spnOverride numeric="23486" spn_display_rule="SPN_RULE_SHOW_PLMN" spn_override_only_on="23430,23431,23432,23433,23434,23486"/>
+
+</spnOverrides> \ No newline at end of file
diff --git a/configs/vold.fstab b/configs/vold.fstab
new file mode 100644
index 0000000..4d50dcd
--- /dev/null
+++ b/configs/vold.fstab
@@ -0,0 +1,22 @@
+## Vold 2.0 Generic fstab
+## - San Mehat (san@android.com)
+##
+
+#######################
+## Regular device mount
+##
+## Format: dev_mount <label> <mount_point> <part> <sysfs_path1...>
+## label - Label for the volume
+## mount_point - Where the volume will be mounted
+## part - Partition # (1 based), or 'auto' for first usable partition.
+## <sysfs_path> - List of sysfs paths to source devices
+######################
+
+# internal sdcard
+dev_mount internal /mnt/sdcard 11 /devices/platform/dw_mmc/mmc_host/mmc0/mmc0 encryptable_nonremovable
+
+# external sdcard
+dev_mount sdcard /mnt/emmc auto /devices/platform/s3c-sdhci.2/mmc_host/mmc1
+
+# USB storage device
+dev_mount usbdisk /mnt/usbdisk auto /devices/platform/s3c_otghcd/usb
diff --git a/configs/wpa_supplicant.conf b/configs/wpa_supplicant.conf
new file mode 100644
index 0000000..314897f
--- /dev/null
+++ b/configs/wpa_supplicant.conf
@@ -0,0 +1,9 @@
+update_config=1
+ctrl_interface=wlan0
+eapol_version=1
+ap_scan=1
+fast_reauth=1
+p2p_listen_reg_class=81
+p2p_listen_channel=1
+p2p_oper_reg_class=115
+p2p_oper_channel=48
diff --git a/full_galaxys2.mk b/full_galaxys2.mk
new file mode 100644
index 0000000..7e57ba6
--- /dev/null
+++ b/full_galaxys2.mk
@@ -0,0 +1,34 @@
+# Copyright (C) 2012 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.
+
+#
+# This file is the build configuration for a full Android
+# build for toro hardware. This cleanly combines a set of
+# device-specific aspects (drivers) with a device-agnostic
+# product configuration (apps). Except for a few implementation
+# details, it only fundamentally contains two inherit-product
+# lines, full and toro, hence its name.
+#
+
+# Inherit from those products. Most specific first.
+$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/full.mk)
+$(call inherit-product, device/samsung/galaxys2/galaxys2.mk)
+
+# Discard inherited values and use our own instead.
+PRODUCT_NAME := full_galaxys2
+PRODUCT_DEVICE := galaxys2
+PRODUCT_BRAND := samsung
+PRODUCT_MANUFACTURER := samsung
+PRODUCT_MODEL := GT-I9100
diff --git a/galaxys2.mk b/galaxys2.mk
new file mode 100644
index 0000000..3710f9c
--- /dev/null
+++ b/galaxys2.mk
@@ -0,0 +1,75 @@
+#
+# Copyright (C) 2012 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.
+#
+
+$(call inherit-product, device/samsung/galaxys2/galaxys2_base.mk)
+
+# Keylayout
+PRODUCT_COPY_FILES += \
+ device/samsung/galaxys2/usr/keylayout/AVRCP.kl:system/usr/keylayout/AVRCP.kl \
+ device/samsung/galaxys2/usr/keylayout/Generic.kl:system/usr/keylayout/Generic.kl \
+ device/samsung/galaxys2/usr/keylayout/gpio-keys.kl:system/usr/keylayout/gpio-keys.kl \
+ device/samsung/galaxys2/usr/keylayout/max8997-muic.kl:system/usr/keylayout/max8997-muic.kl \
+ device/samsung/galaxys2/usr/keylayout/melfas-touchkey.kl:system/usr/keylayout/melfas-touchkey.kl \
+ device/samsung/galaxys2/usr/keylayout/qwerty.kl:system/usr/keylayout/qwerty.kl \
+ device/samsung/galaxys2/usr/keylayout/samsung-keypad.kl:system/usr/keylayout/samsung-keypad.kl \
+ device/samsung/galaxys2/usr/keylayout/sec_key.kl:system/usr/keylayout/sec_key.kl \
+ device/samsung/galaxys2/usr/keylayout/sec_touchkey.kl:system/usr/keylayout/sec_touchkey.kl \
+ device/samsung/galaxys2/usr/keylayout/Vendor_05ac_Product_0239.kl:system/usr/keylayout/Vendor_05ac_Product_0239.kl \
+ device/samsung/galaxys2/usr/keylayout/Vendor_22b8_Product_093d.kl:system/usr/keylayout/Vendor_22b8_Product_093d.kl \
+ device/samsung/galaxys2/usr/keylayout/Vendor_045e_Product_028e.kl:system/usr/keylayout/Vendor_045e_Product_028e.kl \
+ device/samsung/galaxys2/usr/keylayout/Vendor_046d_Product_c216.kl:system/usr/keylayout/Vendor_046d_Product_c216.kl \
+ device/samsung/galaxys2/usr/keylayout/Vendor_046d_Product_c294.kl:system/usr/keylayout/Vendor_046d_Product_c294.kl \
+ device/samsung/galaxys2/usr/keylayout/Vendor_046d_Product_c299.kl:system/usr/keylayout/Vendor_046d_Product_c299.kl \
+ device/samsung/galaxys2/usr/keylayout/Vendor_046d_Product_c532.kl:system/usr/keylayout/Vendor_046d_Product_c532.kl \
+ device/samsung/galaxys2/usr/keylayout/Vendor_054c_Product_0268.kl:system/usr/keylayout/Vendor_054c_Product_0268.kl
+
+# Keychars
+PRODUCT_COPY_FILES += \
+ device/samsung/galaxys2/usr/keychars/Generic.kcm:system/usr/keychars/Generic.kcm \
+ device/samsung/galaxys2/usr/keychars/qwerty.kcm:system/usr/keychars/qwerty.kcm \
+ device/samsung/galaxys2/usr/keychars/qwerty2.kcm:system/usr/keychars/qwerty2.kcm \
+ device/samsung/galaxys2/usr/keychars/Virtual.kcm:system/usr/keychars/Virtual.kcm
+
+#idc
+PRODUCT_COPY_FILES += \
+ device/samsung/galaxys2/usr/idc/melfas_ts.idc:system/usr/idc/melfas_ts.idc \
+ device/samsung/galaxys2/usr/idc/mxt224_ts_input.idc:system/usr/idc/mxt224_ts_input.idc \
+ device/samsung/galaxys2/usr/idc/qwerty.idc:system/usr/idc/qwerty.idc \
+ device/samsung/galaxys2/usr/idc/qwerty2.idc:system/usr/idc/qwerty2.idc \
+ device/samsung/galaxys2/usr/idc/sec_touchscreen.idc:system/usr/idc/sec_touchscreen.idc
+
+# kernel modules for ramdisk
+RAMDISK_MODULES := $(addprefix device/samsung/galaxys2/modules/,dhd.ko j4fs.ko \
+ scsi_wait_scan.ko Si4709_driver.ko)
+PRODUCT_COPY_FILES += $(foreach module,\
+ $(RAMDISK_MODULES),\
+ $(module):root/lib/modules/$(notdir $(module)))
+
+# other kernel modules not in ramdisk
+PRODUCT_COPY_FILES += $(foreach module,\
+ $(filter-out $(RAMDISK_MODULES),$(wildcard device/samsung/galaxys2/modules/*.ko)),\
+ $(module):system/lib/modules/$(notdir $(module)))
+
+# kernel modules for recovery ramdisk
+PRODUCT_COPY_FILES += \
+ device/samsung/galaxys2/modules/j4fs.ko:recovery/root/lib/modules/j4fs.ko
+
+# the kernel itself
+PRODUCT_COPY_FILES += \
+ device/samsung/galaxys2/zImage:kernel
+
+$(call inherit-product, frameworks/base/build/phone-hdpi-512-dalvik-heap.mk)
+$(call inherit-product-if-exists, vendor/samsung/galaxys2/galaxys2-vendor.mk)
diff --git a/galaxys2_base.mk b/galaxys2_base.mk
new file mode 100644
index 0000000..eb1b0ca
--- /dev/null
+++ b/galaxys2_base.mk
@@ -0,0 +1,150 @@
+#
+# Copyright (C) 2012 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.
+#
+DEVICE_PACKAGE_OVERLAYS := device/samsung/galaxys2/overlay
+
+# This device is hdpi.
+PRODUCT_AAPT_CONFIG := normal hdpi
+PRODUCT_AAPT_PREF_CONFIG := hdpi
+PRODUCT_LOCALES += hdpi
+
+# Init files
+PRODUCT_COPY_FILES := \
+ device/samsung/galaxys2/lpm.rc:root/lpm.rc \
+ device/samsung/galaxys2/init.smdk4210.usb.rc:root/init.smdk4210.usb.rc \
+ device/samsung/galaxys2/init.smdk4210.rc:root/init.smdk4210.rc \
+ device/samsung/galaxys2/ueventd.smdk4210.rc:root/ueventd.smdk4210.rc
+
+# Audio
+PRODUCT_COPY_FILES += \
+ device/samsung/galaxys2/configs/asound.conf:system/etc/asound.conf
+
+# Vold
+PRODUCT_COPY_FILES += \
+ device/samsung/galaxys2/configs/vold.fstab:system/etc/vold.fstab \
+
+# Media
+PRODUCT_COPY_FILES += \
+ device/samsung/galaxys2/configs/media_profiles.xml:system/etc/media_profiles.xml
+
+# Bluetooth configuration files
+PRODUCT_COPY_FILES += \
+ system/bluetooth/data/main.le.conf:system/etc/bluetooth/main.conf
+
+# Wifi
+PRODUCT_COPY_FILES += \
+ device/samsung/galaxys2/configs/nvram_net.txt:system/etc/nvram_net.txt \
+ device/samsung/galaxys2/configs/wpa_supplicant.conf:system/etc/wifi/wpa_supplicant.conf \
+ device/samsung/galaxys2/configs/bcmdhd.cal:system/etc/wifi/bcmdhd.cal
+
+PRODUCT_PROPERTY_OVERRIDES := \
+ wifi.interface=wlan0 \
+ wifi.supplicant_scan_interval=15
+
+$(call inherit-product-if-exists, hardware/broadcom/wlan/bcmdhd/firmware/bcm4330/device-bcm.mk)
+
+# Gps
+PRODUCT_COPY_FILES += \
+ device/samsung/galaxys2/configs/gps.conf:system/etc/gps.conf \
+ device/samsung/galaxys2/configs/sirfgps.conf:system/etc/sirfgps.conf
+
+# Packages
+PRODUCT_PACKAGES := \
+ com.android.future.usb.accessory \
+ TvOut \
+ TvOutHack \
+ camera.exynos4 \
+ GalaxyS2Settings \
+ SamsungServiceMode
+
+# Camera
+PRODUCT_PACKAGES += \
+ Camera
+
+# Sensors
+PRODUCT_PACKAGES += \
+ lights.exynos4
+
+# Ril
+PRODUCT_PROPERTY_OVERRIDES += \
+ ro.telephony.ril_class=Smdk4210RIL \
+ mobiledata.interfaces=pdp0,wlan0,gprs,ppp0
+
+# Filesystem management tools
+PRODUCT_PACKAGES += \
+ static_busybox \
+ make_ext4fs \
+ setup_fs
+
+# Live Wallpapers
+PRODUCT_PACKAGES += \
+ Galaxy4 \
+ HoloSpiralWallpaper \
+ LiveWallpapers \
+ LiveWallpapersPicker \
+ MagicSmokeWallpapers \
+ NoiseField \
+ PhaseBeam \
+ VisualizationWallpapers \
+ librs_jni
+
+# These are the hardware-specific features
+PRODUCT_COPY_FILES += \
+ frameworks/base/data/etc/android.hardware.audio.low_latency.xml:system/etc/permissions/android.hardware.audio.low_latency.xml \
+ frameworks/base/data/etc/android.hardware.camera.autofocus.xml:system/etc/permissions/android.hardware.camera.autofocus.xml \
+ frameworks/base/data/etc/android.hardware.camera.flash-autofocus.xml:system/etc/permissions/android.hardware.camera.flash-autofocus.xml \
+ frameworks/base/data/etc/android.hardware.camera.front.xml:system/etc/permissions/android.hardware.camera.front.xml \
+ frameworks/base/data/etc/android.hardware.camera.xml:system/etc/permissions/android.hardware.camera.xml \
+ frameworks/base/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml \
+ frameworks/base/data/etc/android.hardware.location.xml:system/etc/permissions/android.hardware.location.xml \
+ frameworks/base/data/etc/android.hardware.sensor.accelerometer.xml:system/etc/permissions/android.hardware.sensor.accelerometer.xml \
+ frameworks/base/data/etc/android.hardware.sensor.compass.xml:system/etc/permissions/android.hardware.sensor.compass.xml \
+ frameworks/base/data/etc/android.hardware.sensor.gyroscope.xml:system/etc/permissions/android.hardware.sensor.gyroscope.xml \
+ frameworks/base/data/etc/android.hardware.sensor.light.xml:system/etc/permissions/android.hardware.sensor.light.xml \
+ frameworks/base/data/etc/android.hardware.sensor.proximity.xml:system/etc/permissions/android.hardware.sensor.proximity.xml \
+ frameworks/base/data/etc/android.hardware.telephony.gsm.xml:system/etc/permissions/android.hardware.telephony.gsm.xml \
+ frameworks/base/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \
+ frameworks/base/data/etc/android.hardware.touchscreen.multitouch.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.xml \
+ frameworks/base/data/etc/android.hardware.touchscreen.xml:system/etc/permissions/android.hardware.touchscreen.xml \
+ frameworks/base/data/etc/android.hardware.usb.accessory.xml:system/etc/permissions/android.hardware.usb.accessory.xml \
+ frameworks/base/data/etc/android.hardware.usb.host.xml:system/etc/permissions/android.hardware.usb.host.xml \
+ frameworks/base/data/etc/android.hardware.wifi.direct.xml:system/etc/permissions/android.hardware.wifi.direct.xml \
+ frameworks/base/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml \
+ frameworks/base/data/etc/android.software.sip.voip.xml:system/etc/permissions/android.software.sip.voip.xml \
+ frameworks/base/data/etc/android.software.sip.xml:system/etc/permissions/android.software.sip.xml \
+ frameworks/base/data/etc/handheld_core_hardware.xml:system/etc/permissions/handheld_core_hardware.xml
+
+# Feature live wallpaper
+PRODUCT_COPY_FILES += \
+ packages/wallpapers/LivePicker/android.software.live_wallpaper.xml:system/etc/permissions/android.software.live_wallpaper.xml
+
+PRODUCT_PROPERTY_OVERRIDES += \
+ ro.opengles.version=131072 \
+ hwui.render_dirty_regions=false
+
+PRODUCT_PROPERTY_OVERRIDES += \
+ ro.sf.lcd_density=240
+
+PRODUCT_TAGS += dalvik.gc.type-precise
+
+# Set default USB interface
+PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
+ persist.sys.usb.config=mtp
+
+$(call inherit-product, frameworks/base/build/phone-hdpi-512-dalvik-heap.mk)
+
+# Include exynos4 platform specific parts
+#$(call inherit-product, hardware/sec/exynos4/exynos4.mk)
+#$(call inherit-product, hardware/sec/exynos4/Android.mk)
diff --git a/gpswrapper/Android.mk b/gpswrapper/Android.mk
new file mode 100755
index 0000000..a9d1ef5
--- /dev/null
+++ b/gpswrapper/Android.mk
@@ -0,0 +1,21 @@
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_MODULE := gps.$(TARGET_BOARD_PLATFORM)
+
+LOCAL_SHARED_LIBRARIES:= \
+ liblog \
+ libdl
+
+LOCAL_SRC_FILES += \
+ gps.c
+
+LOCAL_CFLAGS += \
+ -fno-short-enums
+
+LOCAL_PRELINK_MODULE := false
+LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/gpswrapper/MODULE_LICENSE_APACHE2 b/gpswrapper/MODULE_LICENSE_APACHE2
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gpswrapper/MODULE_LICENSE_APACHE2
diff --git a/gpswrapper/gps.c b/gpswrapper/gps.c
new file mode 100644
index 0000000..44efc9e
--- /dev/null
+++ b/gpswrapper/gps.c
@@ -0,0 +1,203 @@
+/******************************************************************************
+ * GPS HAL wrapper
+ * wrapps around Samsung GPS Libary and replaces a faulty pointer to
+ * a faulty function from Samsung that will cause the system_server
+ * to crash.
+ *
+ * Copyright 2010 - Kolja Dummann
+ *
+ * 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.
+ *
+ ******************************************************************************/
+
+#include <hardware/hardware.h>
+#include <hardware/gps.h>
+#include <errno.h>
+#include <dlfcn.h>
+
+//#define LOG_NDEBUG 0
+
+#include <stdlib.h>
+#define LOG_TAG "gps-wrapper"
+#include <utils/Log.h>
+
+#define ORIGINAL_HAL_PATH "/system/lib/hw/vendor-gps.exynos4.so"
+
+static const AGpsRilInterface* oldAGPSRIL = NULL;
+static AGpsRilInterface newAGPSRIL;
+
+static const GpsInterface* originalGpsInterface = NULL;
+static GpsInterface newGpsInterface;
+
+/**
+ * Load the file defined by the variant and if successful
+ * return the dlopen handle and the hmi.
+ * @return 0 = success, !0 = failure.
+ */
+static int load(const char *id,
+ const char *path,
+ const struct hw_module_t **pHmi)
+{
+ int status;
+ void *handle;
+ struct hw_module_t *hmi;
+
+ /*
+ * load the symbols resolving undefined symbols before
+ * dlopen returns. Since RTLD_GLOBAL is not or'd in with
+ * RTLD_NOW the external symbols will not be global
+ */
+ handle = dlopen(path, RTLD_NOW);
+ if (handle == NULL) {
+ char const *err_str = dlerror();
+ LOGE("load: module=%s\n%s", path, err_str?err_str:"unknown");
+ status = -EINVAL;
+ goto done;
+ }
+
+ /* Get the address of the struct hal_module_info. */
+ const char *sym = HAL_MODULE_INFO_SYM_AS_STR;
+ hmi = (struct hw_module_t *)dlsym(handle, sym);
+ if (hmi == NULL) {
+ LOGE("load: couldn't find symbol %s", sym);
+ status = -EINVAL;
+ goto done;
+ }
+
+ /* Check that the id matches */
+ if (strcmp(id, hmi->id) != 0) {
+ LOGE("load: id=%s != hmi->id=%s", id, hmi->id);
+ status = -EINVAL;
+ goto done;
+ }
+
+ hmi->dso = handle;
+
+ /* success */
+ status = 0;
+
+ done:
+ if (status != 0) {
+ hmi = NULL;
+ if (handle != NULL) {
+ dlclose(handle);
+ handle = NULL;
+ }
+ } else {
+ LOGV("loaded HAL id=%s path=%s hmi=%p handle=%p",
+ id, path, *pHmi, handle);
+ }
+
+ *pHmi = hmi;
+
+ return status;
+}
+
+static void update_network_state_wrapper(int connected, int type, int roaming, const char* extra_info)
+{
+ LOGI("%s was called and saved your from a faulty implementation ;-)", __func__);
+}
+
+static const void* wrapper_get_extension(const char* name)
+{
+ LOGV("%s was called", __func__);
+
+ if (!strcmp(name, AGPS_RIL_INTERFACE) && (oldAGPSRIL = originalGpsInterface->get_extension(name)))
+ {
+ LOGV("%s AGPS_RIL_INTERFACE extension requested", __func__);
+ /* use a wrapper to avoid calling samsungs faulty implemetation */
+ newAGPSRIL.size = sizeof(AGpsRilInterface);
+ newAGPSRIL.init = oldAGPSRIL->init;
+ newAGPSRIL.set_ref_location = oldAGPSRIL->set_ref_location;
+ newAGPSRIL.set_set_id = oldAGPSRIL->set_set_id;
+ newAGPSRIL.ni_message = oldAGPSRIL->ni_message;
+ LOGV("%s setting update_network_state_wrapper", __func__);
+ newAGPSRIL.update_network_state = update_network_state_wrapper;
+ return &newAGPSRIL;
+ }
+ return originalGpsInterface->get_extension(name);
+}
+
+/* HAL Methods */
+const GpsInterface* gps_get_gps_interface(struct gps_device_t* dev)
+{
+ hw_module_t* module;
+ int err;
+
+ LOGV("%s was called", __func__);
+
+ err = load(GPS_HARDWARE_MODULE_ID, ORIGINAL_HAL_PATH, (hw_module_t const**)&module);
+
+ if (err == 0) {
+ LOGV("%s vendor lib loaded", __func__);
+ hw_device_t* device;
+ struct gps_device_t *gps_device;
+ err = module->methods->open(module, GPS_HARDWARE_MODULE_ID, &device);
+ if (err == 0) {
+ LOGV("%s got gps device", __func__);
+ gps_device = (struct gps_device_t *)device;
+ originalGpsInterface = gps_device->get_gps_interface(gps_device);
+ LOGV("%s device set", __func__);
+ }
+ }
+
+ if(originalGpsInterface)
+ {
+ LOGV("%s exposing callbacks", __func__);
+ newGpsInterface.size = sizeof(GpsInterface);
+ newGpsInterface.init = originalGpsInterface->init;
+ newGpsInterface.start = originalGpsInterface->start;
+ newGpsInterface.stop = originalGpsInterface->stop;
+ newGpsInterface.cleanup = originalGpsInterface->cleanup;
+ newGpsInterface.inject_time = originalGpsInterface->inject_time;
+ newGpsInterface.inject_location = originalGpsInterface->inject_location;
+ newGpsInterface.delete_aiding_data = originalGpsInterface->delete_aiding_data;
+ newGpsInterface.set_position_mode = originalGpsInterface->set_position_mode;
+ LOGV("%s setting extension wrapper", __func__);
+ newGpsInterface.get_extension = wrapper_get_extension;
+
+ }
+ LOGV("%s done", __func__);
+ return &newGpsInterface;
+}
+
+static int open_gps(const struct hw_module_t* module, char const* name,
+ struct hw_device_t** device)
+{
+ struct gps_device_t *dev = malloc(sizeof(struct gps_device_t));
+ memset(dev, 0, sizeof(*dev));
+
+ LOGV("%s was called", __func__);
+
+ dev->common.tag = HARDWARE_DEVICE_TAG;
+ dev->common.version = 0;
+ dev->common.module = (struct hw_module_t*)module;
+ dev->get_gps_interface = gps_get_gps_interface;
+
+ *device = (struct hw_device_t*)dev;
+ return 0;
+}
+
+static struct hw_module_methods_t gps_module_methods = {
+ .open = open_gps
+};
+
+const struct hw_module_t HAL_MODULE_INFO_SYM = {
+ .tag = HARDWARE_MODULE_TAG,
+ .version_major = 1,
+ .version_minor = 0,
+ .id = GPS_HARDWARE_MODULE_ID,
+ .name = "GPS HAL Wrapper Module",
+ .author = "Kolja Dummann",
+ .methods = &gps_module_methods,
+};
diff --git a/init.smdk4210.rc b/init.smdk4210.rc
new file mode 100644
index 0000000..81c65b4
--- /dev/null
+++ b/init.smdk4210.rc
@@ -0,0 +1,375 @@
+import init.smdk4210.usb.rc
+
+on early-init
+ export EXTERNAL_STORAGE /mnt/sdcard
+ export SECONDARY_STORAGE /mnt/emmc
+ mkdir /mnt 0775 system system
+ mkdir /mnt/sdcard 0775 system system
+ mkdir /mnt/emmc 0775 system system
+ mkdir /mnt/usbdisk 0775 system system
+ mkdir /efs 0771 radio system
+ mkdir /preload 0771 system system
+ mkdir /mnt/.lfs 0755 root root
+
+ # for backwards compatibility
+ symlink /mnt/sdcard /sdcard
+ symlink /mnt/emmc /emmc
+
+# Disable CFQ slice idle delay
+ write /sys/block/mmcblk0/queue/iosched/slice_idle 0
+
+# FIXME: permissions for tvout
+ chmod 0777 /dev/graphics/fb0
+ chmod 0777 /dev/graphics/fb10
+ chmod 0777 /dev/graphics/fb11
+ chown media graphics /sys/class/switch/hdmi
+ chmod 0777 /sys/class/switch/hdmi
+
+# FIXME: permission for HDMI audio path
+ chown media audio /sys/class/hdmi_audio/hdmi_audio/hdmi_audio_set_ext
+ chmod 0777 /sys/class/hdmi_audio/hdmi_audio/hdmi_audio_set_ext
+
+on fs
+# mount ext4 partitions
+ mount ext4 /dev/block/mmcblk0p9 /system
+ mount ext4 /dev/block/mmcblk0p9 /system noatime wait ro
+ mount ext4 /dev/block/mmcblk0p7 /cache nosuid nodev noatime wait
+ mount ext4 /dev/block/mmcblk0p10 /data nosuid nodev noatime wait noauto_da_alloc
+ mount ext4 /dev/block/mmcblk0p12 /preload nosuid nodev noatime wait
+
+ mount ext4 /dev/block/mmcblk0p1 /efs nosuid nodev noatime wait
+ mkdir /efs/bluetooth
+ mkdir /efs/wifi
+ chown radio system /efs/bluetooth
+ chown radio system /efs/wifi
+ chmod 0775 /efs/bluetooth
+ chmod 0775 /efs/wifi
+
+ mkdir /data/misc/vpn/profiles 0770 system system
+ mkdir /data/misc/radio 0775 radio system
+ chmod 0770 /data/misc/wifi
+
+on post-fs-data
+# insmod kernel modules
+ insmod /lib/modules/Si4709_driver.ko
+ insmod /lib/modules/j4fs.ko
+
+# mount param.lfs
+ mount j4fs /dev/block/mmcblk0p4 /mnt/.lfs
+
+# GPS
+ chown root system /dev/ttySAC1
+ chmod 0660 /dev/ttySAC1
+ chown root system /sys/class/sec/gps/GPS_PWR_EN/value
+ chmod 0664 /sys/class/sec/gps/GPS_PWR_EN/value
+ chown root system /sys/class/sec/gps/GPS_nRST/value
+ chmod 0664 /sys/class/sec/gps/GPS_nRST/value
+ mkdir /data/gps 771 system system
+ chown system system /data/gps
+
+ # give system access to wpa_supplicant.conf for backup and restore
+ mkdir /data/misc/wifi 0770 wifi wifi
+ chmod 0770 /data/misc/wifi
+ chmod 0660 /data/misc/wifi/wpa_supplicant.conf
+ mkdir /data/misc/wifi/sockets 0770 wifi wifi
+ mkdir /data/misc/dhcp 0770 dhcp dhcp
+ chown dhcp dhcp /data/misc/dhcp
+
+#DRM directory creation
+ mkdir /system/etc/security/.drm 0775
+ chown root root /system/etc/security/.drm
+ chmod 0775 /system/etc/security/.drm
+
+ # Added for Playready DRM Support
+ mkdir /data/data/.drm 0775
+ chown drm system /data/data/.drm
+ chmod 0775 /data/data/.drm
+ mkdir /data/data/.drm/.playready 0775
+ chown drm system /data/data/.drm/.playready
+ chmod 0775 /data/data/.drm/.playready
+
+ #Added drm folder to copy drm plugins
+ mkdir /system/lib/drm 0775
+ chown root root /system/lib/drm
+ chmod 0775 /system/lib/drm
+
+ # DivX DRM
+ mkdir /efs/.files 0775
+ mkdir /efs/.files/.dx1 0775
+ mkdir /efs/.files/.dm33 0775
+ mkdir /efs/.files/.mp301 0775
+ chown media system /efs/.files/.dx1
+ chown media system /efs/.files/.dm33
+ chown media system /efs/.files/.mp301
+ chmod 0775 /efs/.files/.dx1
+ chmod 0775 /efs/.files/.dm33
+ chmod 0775 /efs/.files/.mp301
+
+# MTP Device permission.
+ chmod 0660 /dev/usb_mtp_gadget
+ chown system system /dev/usb_mtp_gadget
+
+# terminal mode
+ chmod 0660 /sys/class/android_usb/android0/terminal_version
+ chown system system /sys/class/android_usb/android0/terminal_version
+
+# NFC
+ setprop ro.nfc.port "I2C"
+ chmod 0600 /dev/pn544
+ chown nfc nfc /dev/pn544
+
+# setup for alsa snd device
+ chmod 0770 /dev/snd/pcmC0D0c
+ chmod 0770 /dev/snd/pcmC0D0p
+ chmod 0770 /dev/snd/controlC0
+ chmod 0770 /dev/snd/timer
+ chmod 0770 /dev/snd/hwC0D0
+
+ # create log system
+ mkdir /data/log 0775 system log
+ chown system log /data/log
+
+ chmod 0775 /data/log
+ chmod 0775 /data/anr
+
+ chmod 0662 /dev/log/radio
+ chmod 0662 /dev/log/main
+ chmod 0662 /dev/log/event
+
+#panorama directory creation
+ mkdir /data/pxtmpdir 0775
+ chown system system /data/pxtmpdir
+ chmod 0775 /data/pxtmpdir
+
+ # permission for HDMI audio path
+ chown media audio /sys/class/hdmi_audio/hdmi_audio/hdmi_audio_set_ext
+
+# Permissions for gpio_keys.
+ chown system radio /sys/class/sec/sec_key/wakeup_keys
+ write /sys/class/sec/sec_key/wakeup_keys 102,116
+
+# Add permission for ATM. 2010.03.20
+ chown system radio /sys/devices/platform/i2c-gpio.9/i2c-9/9-0036/power_supply/fuelgauge/fg_read_soc
+ chown system radio /sys/devices/platform/i2c-gpio.9/i2c-9/9-0036/power_supply/fuelgauge/fg_reset_soc
+ chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_lpm_state
+ chown system radio /sys/devices/platform/sec-battery/power_supply/battery/fg_psoc
+ chown system radio /sys/devices/platform/sec-battery/power_supply/battery/system_rev
+ chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_current_adc
+ chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_test_value
+ chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_temp_adc_spec
+ chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_temp_check
+ chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_full_check
+ chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_type
+ chown system radio /sys/devices/platform/sec-battery/power_supply/battery/mp3
+ chown system radio /sys/devices/platform/sec-battery/power_supply/battery/video
+ chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_lp_charging
+ chown system radio /sys/devices/platform/sec-battery/power_supply/battery/charging_source
+ chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_temp_adc_avg
+ chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_temp_adc
+ chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_temp
+ chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_vfocv
+ chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_soc
+ chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_vol
+
+ chown system system /sys/class/backlight/panel/brightness
+ chown system system /sys/class/power_supply/battery/temp
+
+# Permissions for input devices
+ chown system radio /sys/devices/virtual/sec/sec_key/sec_key_pressed
+
+ chown system radio /sys/devices/virtual/sec/sec_touchkey/enable_disable
+ chown system radio /sys/devices/virtual/sec/sec_touchkey/recommended_version
+ chown system radio /sys/devices/virtual/sec/sec_touchkey/touch_sensitivity
+ chown system radio /sys/devices/virtual/sec/sec_touchkey/brightness
+ chown system radio /sys/devices/virtual/sec/sec_touchkey/touchkey_brightness
+ chown system radio /sys/devices/virtual/sec/sec_touchkey/touchkey_back
+ chown system radio /sys/devices/virtual/sec/sec_touchkey/touchkey_menu
+ chown system radio /sys/devices/virtual/sec/sec_touchkey/touchkey_firm_version_panel
+ chown system radio /sys/devices/virtual/sec/sec_touchkey/touchkey_firm_version_phone
+ chown system radio /sys/devices/virtual/sec/sec_touchkey/touchkey_firm_update_status
+ chown system radio /sys/devices/virtual/sec/sec_touchkey/touchkey_firm_update
+ chown system radio /sys/devices/virtual/sec/sec_touchkey/updated_version
+
+ chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_firm_version
+ chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_threshould
+ chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_all_delta
+ chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_all_refer
+ chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_delta4
+ chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_refer4
+ chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_delta3
+ chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_refer3
+ chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_delta2
+ chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_refer2
+ chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_delta1
+ chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_refer1
+ chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_delta0
+ chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_refer0
+ chown system radio /sys/devices/virtual/sec/tsp_noise_test/disp_all_deltadata
+ chown system radio /sys/devices/virtual/sec/tsp_noise_test/disp_all_refdata
+ chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_module_off
+ chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_module_on
+
+ chown system radio /sys/devices/virtual/sec/sec_touchscreen/tsp_firm_version_panel
+ chown system radio /sys/devices/virtual/sec/sec_touchscreen/tsp_firm_version_phone
+ chown system radio /sys/devices/virtual/sec/sec_touchscreen/tsp_firm_update_status
+ chown system radio /sys/devices/virtual/sec/sec_touchscreen/tsp_firm_update
+ chown system radio /sys/devices/virtual/sec/sec_touchscreen/tsp_threshold
+ chown system radio /sys/devices/virtual/sec/sec_touchscreen/tsp_config_version
+ chown system radio /sys/devices/virtual/sec/sec_touchscreen/tsp_touchtype
+
+# Permissions for bluetooth
+ setprop ro.bt.bdaddr_path "/efs/bluetooth/bt_addr"
+ chown bluetooth bluetooth ro.bt.bdaddr_path
+ chown bluetooth bluetooth /dev/ttySAC0
+ chmod 0600 /dev/ttySAC0
+ chmod 0660 /sys/class/rfkill/rfkill0/state
+ chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
+ chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
+
+# Vibetonz
+ chmod 0660 /dev/tspdrv
+ chown root shell /dev/tspdrv
+
+# Permissions for LCD
+ chown system radio /sys/class/lcd/panel/lcd_power
+ chown system radio /sys/class/lcd/panel/lcd_type
+ chown system media_rw /sys/class/lcd/panel/gamma_mode
+ chown system media_rw /sys/class/lcd/panel/power_reduce
+
+# Permissions for mDNIe
+ chown system media_rw /sys/class/mdnie/mdnie/mode
+ chown system media_rw /sys/class/mdnie/mdnie/outdoor
+ chown system media_rw /sys/class/mdnie/mdnie/scenario
+ chown system media_rw /sys/class/mdnie/mdnie/negative
+ write /sys/class/mdnie/mdnie/scenario 4
+
+# Permissions for uart_sel and usb_sel
+ chown system radio /sys/class/sec/switch/uart_sel/value
+ chown system radio /sys/class/sec/switch/usb_sel
+ chown system radio /sys/class/sec/switch/audio_path
+ chown system radio /sys/class/sec/switch/otg_test
+ chown system radio /sys/class/sec/switch/adc_debounce_time
+ chown system radio /sys/class/sec/switch/status
+ chown system radio /sys/class/sec/switch/adc
+ chown system radio /mnt/.lfs/sw_sel
+
+# Permissions for OTG Test
+ chown system radio /sys/class/host_notify/usb_otg/booster
+ chmod 0664 /sys/class/host_notify/usb_otg/booster
+
+# Permission for radio
+ chown system radio /sys/devices/platform/s5p-ehci/ehci_power
+ chown system radio /sys/devices/platform/s5p-ehci/ehci_runtime
+ chown system radio /sys/devices/virtual/misc/multipdp/waketime
+
+# for datarouter
+ chown system system /dev/dun
+ chown system system /dev/ttyGS0
+ chown system system /dev/ttyGS1
+ chown system system /dev/ttyGS2
+ chown system system /dev/ttyGS3
+
+# DVFS - cpufreq ondemand
+ write /sys/devices/system/cpu/cpufreq/ondemand/down_differential 5
+ write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold 85
+
+on boot
+ chown system system /sys/class/backlight/pwm-backlight/brightness
+ chmod 0660 /sys/class/backlight/pwm-backlight/brightness
+ chown radio system /sys/devices/virtual/misc/melfas_touchkey/brightness
+ chmod 0660 /sys/devices/virtual/misc/melfas_touchkey/brightness
+
+#panorama directory creation
+ mkdir /data/pxtmpdir 0775
+ chown system system /data/pxtmpdir
+ chmod 0775 /data/pxtmpdir
+
+# Permissions for dvfs lock
+ chown system system /sys/power/cpufreq_max_limit
+ chown system system /sys/power/cpufreq_min_limit
+ chmod 0660 /sys/power/cpufreq_max_limit
+ chmod 0660 /sys/power/cpufreq_min_limit
+
+ mount debugfs /sys/kernel/debug /sys/kernel/debug
+
+ setprop ro.build.product GT-I9100
+ setprop ro.product.device GT-I9100
+ setprop ro.radio.noril yes
+
+# Permisions for sensors
+ chown radio system /sys/devices/virtual/K3G_GYRO-dev/k3g/gyro_selftest
+ chown radio system /sys/devices/virtual/K3G_GYRO-dev/k3g/gyro_get_temp
+ chown radio system /sys/devices/virtual/K3G_GYRO-dev/k3g/gyro_power_on
+ chown radio system /sys/devices/virtual/accelerometer/accelerometer/acc_file
+ chown radio system /sys/devices/virtual/sec/gsensorcal/calibration
+
+# permissions for NFC
+ setprop ro.nfc.port "I2C"
+ chmod 0600 /dev/pn544
+ chown nfc nfc /dev/pn544
+
+# Device Encryption by B2B Security Lab.
+ setprop ro.crypto.keyfile.userdata /efs/metadata
+
+# fake some battery state
+ setprop status.battery.state Slow
+ setprop status.battery.level 5
+ setprop status.battery.level_raw 50
+ setprop status.battery.level_scale 9
+
+service wpa_supplicant /system/bin/wpa_supplicant \
+ -Dnl80211 -puse_p2p_group_interface=1 -e/data/misc/wifi/entropy.bin
+ class main
+ socket wpa_wlan0 dgram 0660 wifi wifi
+ disabled
+ oneshot
+
+service dhcpcd_wlan0 /system/bin/dhcpcd -ABKL
+ class main
+ disabled
+ oneshot
+
+service dhcpcd_p2p /system/bin/dhcpcd -aABKL
+ class main
+ disabled
+ oneshot
+
+service iprenew_wlan0 /system/bin/dhcpcd -n
+ class main
+ disabled
+ oneshot
+
+service iprenew_p2p /system/bin/dhcpcd -n
+ class main
+ disabled
+ oneshot
+
+# for bluetooth
+service hciattach /system/bin/brcm_patchram_plus --enable_hci --enable_lpm --no2bytes --tosleep 50000 \
+ --baudrate 3000000 --use_baudrate_for_download --patchram /system/bin/bcm4330B1.hcd \
+ --scopcm=0,0,0,0,0,0,0,3,3,0 /dev/ttySAC0
+ class main
+ user bluetooth
+ group bluetooth net_bt_admin
+ disabled
+ oneshot
+
+# bluetooth mac address
+service bdaddr /system/bin/bdaddr_read
+ class main
+ user root
+ disabled
+ oneshot
+
+# TVout
+service TvoutService_C /system/bin/bintvoutservice
+ class main
+ user system
+ group graphics
+
+# bugreport is triggered by holding down volume down, volume up and power
+service bugreport /system/bin/bugmailer.sh -v
+ class main
+ disabled
+ oneshot
+ keycodes 114 115 116
diff --git a/init.smdk4210.usb.rc b/init.smdk4210.usb.rc
new file mode 100644
index 0000000..7545695
--- /dev/null
+++ b/init.smdk4210.usb.rc
@@ -0,0 +1,89 @@
+on init
+ write /sys/class/android_usb/android0/iSerial $ro.serialno
+ write /sys/class/android_usb/android0/f_rndis/manufacturer Samsung
+ write /sys/class/android_usb/android0/f_rndis/vendorID 04e8
+ write /sys/class/android_usb/android0/f_rndis/wceis 1
+
+on boot
+ write /sys/class/android_usb/android0/iManufacturer $ro.manufacturer
+ write /sys/class/android_usb/android0/iProduct $ro.model
+ write /sys/class/android_usb/android0/iSerial $ro.serialno
+ write /sys/class/android_usb/f_mass_storage/inquiry_string "Samsung"
+
+on property:sys.usb.config=mtp
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 04e8
+ write /sys/class/android_usb/android0/idProduct 6860
+ 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=mtp,adb
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 04e8
+ write /sys/class/android_usb/android0/idProduct 6860
+ 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 04e8
+ write /sys/class/android_usb/android0/idProduct 6863
+ 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 04e8
+ write /sys/class/android_usb/android0/idProduct 6864
+ 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
+
+on property:sys.usb.config=ptp
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 04e8
+ write /sys/class/android_usb/android0/idProduct 6865
+ 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=ptp,adb
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 04e8
+ write /sys/class/android_usb/android0/idProduct 6866
+ 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,dm
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 04e8
+ write /sys/class/android_usb/android0/idProduct 6862
+ 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
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 04e8
+ write /sys/class/android_usb/android0/idProduct 685B
+ 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 04e8
+ write /sys/class/android_usb/android0/idProduct 685e
+ 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/liblights/Android.mk b/liblights/Android.mk
new file mode 100644
index 0000000..995bd02
--- /dev/null
+++ b/liblights/Android.mk
@@ -0,0 +1,33 @@
+# Copyright (C) 2011 The Android Open Source Project
+# Copyright (C) 2011 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.
+
+LOCAL_PATH:= $(call my-dir)
+# HAL module implemenation, not prelinked and stored in
+# hw/<COPYPIX_HARDWARE_MODULE_ID>.<ro.board.platform>.so
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := lights.c
+
+LOCAL_PRELINK_MODULE := false
+LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
+
+LOCAL_SHARED_LIBRARIES := liblog
+
+LOCAL_MODULE := lights.$(TARGET_BOARD_PLATFORM)
+
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_SHARED_LIBRARY)
+
diff --git a/liblights/NOTICE b/liblights/NOTICE
new file mode 100644
index 0000000..f921593
--- /dev/null
+++ b/liblights/NOTICE
@@ -0,0 +1,190 @@
+
+ Copyright (C) 2008 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.
+
+ 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.
+
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
diff --git a/liblights/lights.c b/liblights/lights.c
new file mode 100644
index 0000000..06bb5f8
--- /dev/null
+++ b/liblights/lights.c
@@ -0,0 +1,240 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ * Copyright (C) 2011 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.
+ */
+
+
+#define LOG_TAG "lights"
+#define LOG_NDEBUG 0
+
+#include <cutils/log.h>
+
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <pthread.h>
+
+#include <sys/ioctl.h>
+#include <sys/types.h>
+
+#include <hardware/lights.h>
+
+/******************************************************************************/
+
+static pthread_once_t g_init = PTHREAD_ONCE_INIT;
+static pthread_mutex_t g_lock = PTHREAD_MUTEX_INITIALIZER;
+static int g_enable_touchlight = -1;
+
+char const*const PANEL_FILE
+ = "/sys/class/backlight/panel/brightness";
+
+char const*const BUTTON_POWER
+ = "/sys/class/sec/sec_touchkey/enable_disable";
+
+char const*const BUTTON_FILE
+ = "/sys/class/sec/sec_touchkey/brightness";
+
+void init_globals(void)
+{
+ // init the mutex
+ pthread_mutex_init(&g_lock, NULL);
+}
+
+void
+load_settings()
+{
+ FILE* fp = fopen("/data/.disable_touchlight", "r");
+ if (!fp) {
+ g_enable_touchlight = 1;
+ } else {
+ g_enable_touchlight = (int)(fgetc(fp));
+ if (g_enable_touchlight == '1')
+ g_enable_touchlight = 1;
+ else
+ g_enable_touchlight = 0;
+
+ fclose(fp);
+ }
+}
+
+static int
+write_int(char const* path, int value)
+{
+ int fd;
+ static int already_warned = 0;
+
+ fd = open(path, O_RDWR);
+ if (fd >= 0) {
+ char buffer[20];
+ int bytes = sprintf(buffer, "%d\n", value);
+ int amt = write(fd, buffer, bytes);
+ close(fd);
+ return amt == -1 ? -errno : 0;
+ } else {
+ if (already_warned == 0) {
+ LOGE("write_int failed to open %s\n", path);
+ already_warned = 1;
+ }
+ return -errno;
+ }
+}
+
+static int
+is_lit(struct light_state_t const* state)
+{
+ return state->color & 0x00ffffff;
+}
+
+static int
+rgb_to_brightness(struct light_state_t const* state)
+{
+ int color = state->color & 0x00ffffff;
+ return ((77*((color>>16)&0x00ff))
+ + (150*((color>>8)&0x00ff)) + (29*(color&0x00ff))) >> 8;
+}
+
+static int
+set_light_backlight(struct light_device_t* dev,
+ struct light_state_t const* state)
+{
+ load_settings();
+
+ int err = 0;
+ int brightness = rgb_to_brightness(state);
+
+ pthread_mutex_lock(&g_lock);
+ err = write_int(PANEL_FILE, brightness);
+
+ if (g_enable_touchlight == -1 || g_enable_touchlight > 0)
+ err = write_int(BUTTON_FILE, brightness > 0 ? 1 : 0);
+
+ pthread_mutex_unlock(&g_lock);
+
+ return err;
+}
+
+static int
+set_light_keyboard(struct light_device_t* dev,
+ struct light_state_t const* state)
+{
+ return 0;
+}
+
+static int
+set_light_buttons(struct light_device_t* dev,
+ struct light_state_t const* state)
+{
+ int err = 0;
+ int on = is_lit(state);
+
+ pthread_mutex_lock(&g_lock);
+ LOGD("set_light_button on=%d\n", on ? 1 : 0);
+ err = write_int(BUTTON_FILE, on ? 1:0);
+ pthread_mutex_unlock(&g_lock);
+
+ return err;
+}
+
+static int
+set_light_battery(struct light_device_t* dev,
+ struct light_state_t const* state)
+{
+ return 0;
+}
+
+static int
+set_light_notification(struct light_device_t* dev,
+ struct light_state_t const* state)
+{
+ return 0;
+}
+
+static int
+set_light_attention(struct light_device_t* dev,
+ struct light_state_t const* state)
+{
+ return 0;
+}
+
+static int
+close_lights(struct light_device_t *dev)
+{
+ if (dev) {
+ free(dev);
+ }
+ return 0;
+}
+
+
+/******************************************************************************/
+static int open_lights(const struct hw_module_t* module, char const* name,
+ struct hw_device_t** device)
+{
+ int (*set_light)(struct light_device_t* dev,
+ struct light_state_t const* state);
+
+ if (0 == strcmp(LIGHT_ID_BACKLIGHT, name)) {
+ set_light = set_light_backlight;
+ }
+ else if (0 == strcmp(LIGHT_ID_KEYBOARD, name)) {
+ set_light = set_light_keyboard;
+ }
+ else if (0 == strcmp(LIGHT_ID_BUTTONS, name)) {
+ set_light = set_light_buttons;
+ }
+ else if (0 == strcmp(LIGHT_ID_BATTERY, name)) {
+ set_light = set_light_battery;
+ }
+ else if (0 == strcmp(LIGHT_ID_NOTIFICATIONS, name)) {
+ set_light = set_light_notification;
+ }
+ else if (0 == strcmp(LIGHT_ID_ATTENTION, name)) {
+ set_light = set_light_attention;
+ }
+ else {
+ return -EINVAL;
+ }
+
+ pthread_once(&g_init, init_globals);
+
+ struct light_device_t *dev = malloc(sizeof(struct light_device_t));
+ memset(dev, 0, sizeof(*dev));
+
+ dev->common.tag = HARDWARE_DEVICE_TAG;
+ dev->common.version = 0;
+ dev->common.module = (struct hw_module_t*)module;
+ dev->common.close = (int (*)(struct hw_device_t*))close_lights;
+ dev->set_light = set_light;
+
+ *device = (struct hw_device_t*)dev;
+ return 0;
+}
+
+
+static struct hw_module_methods_t lights_module_methods = {
+ .open = open_lights,
+};
+
+const struct hw_module_t HAL_MODULE_INFO_SYM = {
+ .tag = HARDWARE_MODULE_TAG,
+ .version_major = 1,
+ .version_minor = 0,
+ .id = LIGHTS_HARDWARE_MODULE_ID,
+ .name = "Samsung Exynos4210 Lights Module",
+ .author = "The CyanogenMod Project",
+ .methods = &lights_module_methods,
+};
diff --git a/libsensors/AkmSensor.cpp b/libsensors/AkmSensor.cpp
new file mode 100644
index 0000000..c147bd6
--- /dev/null
+++ b/libsensors/AkmSensor.cpp
@@ -0,0 +1,310 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+#include <fcntl.h>
+#include <errno.h>
+#include <math.h>
+#include <poll.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <sys/select.h>
+#include <dlfcn.h>
+
+#include "ak8973b.h"
+
+#include <cutils/log.h>
+#include "AkmSensor.h"
+
+//#define LOG_NDEBUG 0
+
+/*****************************************************************************/
+
+int (*akm_is_sensor_enabled)(uint32_t sensor_type);
+int (*akm_enable_sensor)(uint32_t sensor_type);
+int (*akm_disable_sensor)(uint32_t sensor_type);
+int (*akm_set_delay)(uint32_t sensor_type, uint64_t delay);
+
+int stub_is_sensor_enabled(uint32_t sensor_type) {
+ return 0;
+}
+
+int stub_enable_disable_sensor(uint32_t sensor_type) {
+ return -ENODEV;
+}
+
+int stub_set_delay(uint32_t sensor_type, uint64_t delay) {
+ return -ENODEV;
+}
+
+AkmSensor::AkmSensor()
+: SensorBase(NULL, NULL),
+ mEnabled(0),
+ mPendingMask(0),
+ mInputReader(32)
+{
+ /* Open the library before opening the input device. The library
+ * creates a uinput device.
+ */
+ if (loadAKMLibrary() == 0) {
+ data_name = "compass_sensor";
+ data_fd = openInput("compass_sensor");
+ }
+
+ memset(mPendingEvents, 0, sizeof(mPendingEvents));
+
+ mPendingEvents[Accelerometer].version = sizeof(sensors_event_t);
+ mPendingEvents[Accelerometer].sensor = ID_A;
+ mPendingEvents[Accelerometer].type = SENSOR_TYPE_ACCELEROMETER;
+ mPendingEvents[Accelerometer].acceleration.status = SENSOR_STATUS_ACCURACY_HIGH;
+
+ mPendingEvents[MagneticField].version = sizeof(sensors_event_t);
+ mPendingEvents[MagneticField].sensor = ID_M;
+ mPendingEvents[MagneticField].type = SENSOR_TYPE_MAGNETIC_FIELD;
+ mPendingEvents[MagneticField].magnetic.status = SENSOR_STATUS_ACCURACY_HIGH;
+
+ mPendingEvents[Orientation ].version = sizeof(sensors_event_t);
+ mPendingEvents[Orientation ].sensor = ID_O;
+ mPendingEvents[Orientation ].type = SENSOR_TYPE_ORIENTATION;
+ mPendingEvents[Orientation ].orientation.status = SENSOR_STATUS_ACCURACY_HIGH;
+
+ // read the actual value of all sensors if they're enabled already
+ struct input_absinfo absinfo;
+ short flags = 0;
+
+ if (akm_is_sensor_enabled(SENSOR_TYPE_ACCELEROMETER)) {
+ mEnabled |= 1<<Accelerometer;
+ if (!ioctl(data_fd, EVIOCGABS(EVENT_TYPE_ACCEL_X), &absinfo)) {
+ mPendingEvents[Accelerometer].acceleration.x = absinfo.value * CONVERT_A_X;
+ }
+ if (!ioctl(data_fd, EVIOCGABS(EVENT_TYPE_ACCEL_Y), &absinfo)) {
+ mPendingEvents[Accelerometer].acceleration.y = absinfo.value * CONVERT_A_Y;
+ }
+ if (!ioctl(data_fd, EVIOCGABS(EVENT_TYPE_ACCEL_Z), &absinfo)) {
+ mPendingEvents[Accelerometer].acceleration.z = absinfo.value * CONVERT_A_Z;
+ }
+ }
+ if (akm_is_sensor_enabled(SENSOR_TYPE_MAGNETIC_FIELD)) {
+ mEnabled |= 1<<MagneticField;
+ if (!ioctl(data_fd, EVIOCGABS(EVENT_TYPE_MAGV_X), &absinfo)) {
+ mPendingEvents[MagneticField].magnetic.x = absinfo.value * CONVERT_M_X;
+ }
+ if (!ioctl(data_fd, EVIOCGABS(EVENT_TYPE_MAGV_Y), &absinfo)) {
+ mPendingEvents[MagneticField].magnetic.y = absinfo.value * CONVERT_M_Y;
+ }
+ if (!ioctl(data_fd, EVIOCGABS(EVENT_TYPE_MAGV_Z), &absinfo)) {
+ mPendingEvents[MagneticField].magnetic.z = absinfo.value * CONVERT_M_Z;
+ }
+ }
+ if (akm_is_sensor_enabled(SENSOR_TYPE_ORIENTATION)) {
+ mEnabled |= 1<<Orientation;
+ if (!ioctl(data_fd, EVIOCGABS(EVENT_TYPE_YAW), &absinfo)) {
+ mPendingEvents[Orientation].orientation.azimuth = absinfo.value;
+ }
+ if (!ioctl(data_fd, EVIOCGABS(EVENT_TYPE_PITCH), &absinfo)) {
+ mPendingEvents[Orientation].orientation.pitch = absinfo.value;
+ }
+ if (!ioctl(data_fd, EVIOCGABS(EVENT_TYPE_ROLL), &absinfo)) {
+ mPendingEvents[Orientation].orientation.roll = -absinfo.value;
+ }
+ if (!ioctl(data_fd, EVIOCGABS(EVENT_TYPE_ORIENT_STATUS), &absinfo)) {
+ mPendingEvents[Orientation].orientation.status = uint8_t(absinfo.value & SENSOR_STATE_MASK);
+ }
+ }
+
+ // disable temperature sensor, since it is not supported
+ akm_disable_sensor(SENSOR_TYPE_TEMPERATURE);
+}
+
+AkmSensor::~AkmSensor()
+{
+ if (mLibAKM) {
+ unsigned ref = ::dlclose(mLibAKM);
+ }
+}
+
+int AkmSensor::enable(int32_t handle, int en)
+{
+ int what = -1;
+
+ switch (handle) {
+ case ID_A: what = Accelerometer; break;
+ case ID_M: what = MagneticField; break;
+ case ID_O: what = Orientation; break;
+ }
+
+ if (uint32_t(what) >= numSensors)
+ return -EINVAL;
+
+ int newState = en ? 1 : 0;
+ int err = 0;
+
+ if ((uint32_t(newState)<<what) != (mEnabled & (1<<what))) {
+ uint32_t sensor_type;
+ switch (what) {
+ case Accelerometer: sensor_type = SENSOR_TYPE_ACCELEROMETER; break;
+ case MagneticField: sensor_type = SENSOR_TYPE_MAGNETIC_FIELD; break;
+ case Orientation: sensor_type = SENSOR_TYPE_ORIENTATION; break;
+ }
+ short flags = newState;
+ if (en)
+ err = akm_enable_sensor(sensor_type);
+ else
+ err = akm_disable_sensor(sensor_type);
+
+ LOGE_IF(err, "Could not change sensor state (%s)", strerror(-err));
+ if (!err) {
+ mEnabled &= ~(1<<what);
+ mEnabled |= (uint32_t(flags)<<what);
+ }
+ }
+ return err;
+}
+
+int AkmSensor::setDelay(int32_t handle, int64_t ns)
+{
+ uint32_t sensor_type = 0;
+
+ if (ns < 0)
+ return -EINVAL;
+
+ switch (handle) {
+ case ID_A: sensor_type = SENSOR_TYPE_ACCELEROMETER; break;
+ case ID_M: sensor_type = SENSOR_TYPE_MAGNETIC_FIELD; break;
+ case ID_O: sensor_type = SENSOR_TYPE_ORIENTATION; break;
+ }
+
+ if (sensor_type == 0)
+ return -EINVAL;
+
+ return akm_set_delay(sensor_type, ns);
+}
+
+int AkmSensor::loadAKMLibrary()
+{
+ mLibAKM = dlopen("libakm.so", RTLD_NOW);
+
+ if (!mLibAKM) {
+ akm_is_sensor_enabled = stub_is_sensor_enabled;
+ akm_enable_sensor = stub_enable_disable_sensor;
+ akm_disable_sensor = stub_enable_disable_sensor;
+ akm_set_delay = stub_set_delay;
+ LOGE("AkmSensor: unable to load AKM Library, %s", dlerror());
+ return -ENOENT;
+ }
+
+ *(void **)&akm_is_sensor_enabled = dlsym(mLibAKM, "akm_is_sensor_enabled");
+ *(void **)&akm_enable_sensor = dlsym(mLibAKM, "akm_enable_sensor");
+ *(void **)&akm_disable_sensor = dlsym(mLibAKM, "akm_disable_sensor");
+ *(void **)&akm_set_delay = dlsym(mLibAKM, "akm_set_delay");
+
+ return 0;
+}
+
+int AkmSensor::readEvents(sensors_event_t* data, int count)
+{
+ if (count < 1)
+ return -EINVAL;
+
+ ssize_t n = mInputReader.fill(data_fd);
+ if (n < 0)
+ return n;
+
+ int numEventReceived = 0;
+ input_event const* event;
+
+ while (count && mInputReader.readEvent(&event)) {
+ int type = event->type;
+ if (type == EV_REL) {
+ processEvent(event->code, event->value);
+ mInputReader.next();
+ } else if (type == EV_SYN) {
+ int64_t time = timevalToNano(event->time);
+ for (int j=0 ; count && mPendingMask && j<numSensors ; j++) {
+ if (mPendingMask & (1<<j)) {
+ mPendingMask &= ~(1<<j);
+ mPendingEvents[j].timestamp = time;
+ if (mEnabled & (1<<j)) {
+ *data++ = mPendingEvents[j];
+ count--;
+ numEventReceived++;
+ }
+ }
+ }
+ if (!mPendingMask) {
+ mInputReader.next();
+ }
+ } else {
+ LOGE("AkmSensor: unknown event (type=%d, code=%d)",
+ type, event->code);
+ mInputReader.next();
+ }
+ }
+ return numEventReceived;
+}
+
+void AkmSensor::processEvent(int code, int value)
+{
+ switch (code) {
+ case EVENT_TYPE_ACCEL_X:
+ mPendingMask |= 1<<Accelerometer;
+ mPendingEvents[Accelerometer].acceleration.x = value * CONVERT_A_X;
+ break;
+ case EVENT_TYPE_ACCEL_Y:
+ mPendingMask |= 1<<Accelerometer;
+ mPendingEvents[Accelerometer].acceleration.y = value * CONVERT_A_Y;
+ break;
+ case EVENT_TYPE_ACCEL_Z:
+ mPendingMask |= 1<<Accelerometer;
+ mPendingEvents[Accelerometer].acceleration.z = value * CONVERT_A_Z;
+ break;
+
+ case EVENT_TYPE_MAGV_X:
+ LOGV("AkmSensor: EVENT_TYPE_MAGV_X value =%d", value);
+ mPendingMask |= 1<<MagneticField;
+ mPendingEvents[MagneticField].magnetic.x = value * CONVERT_M_X;
+ break;
+ case EVENT_TYPE_MAGV_Y:
+ LOGV("AkmSensor: EVENT_TYPE_MAGV_Y value =%d", value);
+ mPendingMask |= 1<<MagneticField;
+ mPendingEvents[MagneticField].magnetic.y = value * CONVERT_M_Y;
+ break;
+ case EVENT_TYPE_MAGV_Z:
+ LOGV("AkmSensor: EVENT_TYPE_MAGV_Z value =%d", value);
+ mPendingMask |= 1<<MagneticField;
+ mPendingEvents[MagneticField].magnetic.z = value * CONVERT_M_Z;
+ break;
+
+ case EVENT_TYPE_YAW:
+ mPendingMask |= 1<<Orientation;
+ mPendingEvents[Orientation].orientation.azimuth = value * CONVERT_O_A;
+ break;
+ case EVENT_TYPE_PITCH:
+ mPendingMask |= 1<<Orientation;
+ mPendingEvents[Orientation].orientation.pitch = value * CONVERT_O_P;
+ break;
+ case EVENT_TYPE_ROLL:
+ mPendingMask |= 1<<Orientation;
+ mPendingEvents[Orientation].orientation.roll = value * CONVERT_O_R;
+ break;
+ case EVENT_TYPE_ORIENT_STATUS:
+ uint8_t status = uint8_t(value & SENSOR_STATE_MASK);
+ if (status == 4)
+ status = 0;
+ mPendingMask |= 1<<Orientation;
+ mPendingEvents[Orientation].orientation.status = status;
+ break;
+ }
+}
diff --git a/libsensors/AkmSensor.h b/libsensors/AkmSensor.h
new file mode 100644
index 0000000..44214e0
--- /dev/null
+++ b/libsensors/AkmSensor.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+#ifndef ANDROID_AKM_SENSOR_H
+#define ANDROID_AKM_SENSOR_H
+
+#include <stdint.h>
+#include <errno.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+
+#include "sensors.h"
+#include "SensorBase.h"
+#include "InputEventReader.h"
+
+/*****************************************************************************/
+
+struct input_event;
+
+class AkmSensor : public SensorBase {
+public:
+ AkmSensor();
+ virtual ~AkmSensor();
+
+ enum {
+ Accelerometer = 0,
+ MagneticField = 1,
+ Orientation = 2,
+ numSensors
+ };
+
+ virtual int setDelay(int32_t handle, int64_t ns);
+ virtual int enable(int32_t handle, int enabled);
+ virtual int readEvents(sensors_event_t* data, int count);
+ void processEvent(int code, int value);
+
+private:
+ int loadAKMLibrary();
+ void *mLibAKM;
+ uint32_t mEnabled;
+ uint32_t mPendingMask;
+ InputEventCircularReader mInputReader;
+ sensors_event_t mPendingEvents[numSensors];
+};
+
+/*****************************************************************************/
+
+#endif // ANDROID_AKM_SENSOR_H
diff --git a/libsensors/Android.mk b/libsensors/Android.mk
new file mode 100644
index 0000000..15c29a2
--- /dev/null
+++ b/libsensors/Android.mk
@@ -0,0 +1,45 @@
+# Copyright (C) 2008 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.
+
+
+LOCAL_PATH := $(call my-dir)
+
+ifneq ($(TARGET_SIMULATOR),true)
+
+# HAL module implemenation, not prelinked, and stored in
+# hw/<SENSORS_HARDWARE_MODULE_ID>.<ro.product.board>.so
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := sensors.$(TARGET_BOARD_PLATFORM)
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_CFLAGS := -DLOG_TAG=\"Sensors\"
+LOCAL_SRC_FILES := \
+ sensors.cpp \
+ SensorBase.cpp \
+ LightSensor.cpp \
+ ProximitySensor.cpp \
+ AkmSensor.cpp \
+ GyroSensor.cpp \
+ InputEventReader.cpp
+
+LOCAL_SHARED_LIBRARIES := liblog libcutils libdl
+LOCAL_PRELINK_MODULE := false
+
+include $(BUILD_SHARED_LIBRARY)
+
+endif # !TARGET_SIMULATOR
diff --git a/libsensors/GyroSensor.cpp b/libsensors/GyroSensor.cpp
new file mode 100644
index 0000000..ef0c01c
--- /dev/null
+++ b/libsensors/GyroSensor.cpp
@@ -0,0 +1,185 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+#include <fcntl.h>
+#include <errno.h>
+#include <math.h>
+#include <poll.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <sys/select.h>
+#include <cutils/log.h>
+
+#include "GyroSensor.h"
+
+#define FETCH_FULL_EVENT_BEFORE_RETURN 1
+#define IGNORE_EVENT_TIME 350000000
+/*****************************************************************************/
+
+GyroSensor::GyroSensor()
+ : SensorBase(NULL, "gyro_sensor"),
+ mEnabled(0),
+ mInputReader(4),
+ mHasPendingEvent(false),
+ mEnabledTime(0)
+{
+ mPendingEvent.version = sizeof(sensors_event_t);
+ mPendingEvent.sensor = ID_GY;
+ mPendingEvent.type = SENSOR_TYPE_GYROSCOPE;
+ memset(mPendingEvent.data, 0, sizeof(mPendingEvent.data));
+
+ if (data_fd) {
+ strcpy(input_sysfs_path, "/sys/class/input/");
+ strcat(input_sysfs_path, input_name);
+ strcat(input_sysfs_path, "/device/");
+ input_sysfs_path_len = strlen(input_sysfs_path);
+ enable(0, 1);
+ }
+}
+
+GyroSensor::~GyroSensor() {
+ if (mEnabled) {
+ enable(0, 0);
+ }
+}
+
+int GyroSensor::setInitialState() {
+ struct input_absinfo absinfo_x;
+ struct input_absinfo absinfo_y;
+ struct input_absinfo absinfo_z;
+ float value;
+ if (!ioctl(data_fd, EVIOCGABS(EVENT_TYPE_GYRO_X), &absinfo_x) &&
+ !ioctl(data_fd, EVIOCGABS(EVENT_TYPE_GYRO_X), &absinfo_y) &&
+ !ioctl(data_fd, EVIOCGABS(EVENT_TYPE_GYRO_X), &absinfo_z)) {
+ value = absinfo_x.value;
+ mPendingEvent.data[0] = value * CONVERT_GYRO_X;
+ value = absinfo_x.value;
+ mPendingEvent.data[1] = value * CONVERT_GYRO_Y;
+ value = absinfo_x.value;
+ mPendingEvent.data[2] = value * CONVERT_GYRO_Z;
+ mHasPendingEvent = true;
+ }
+ return 0;
+}
+
+int GyroSensor::enable(int32_t, int en) {
+ int flags = en ? 1 : 0;
+ if (flags != mEnabled) {
+ int fd;
+ strcpy(&input_sysfs_path[input_sysfs_path_len], "enable");
+ fd = open(input_sysfs_path, O_RDWR);
+ if (fd >= 0) {
+ char buf[2];
+ int err;
+ buf[1] = 0;
+ if (flags) {
+ buf[0] = '1';
+ mEnabledTime = getTimestamp() + IGNORE_EVENT_TIME;
+ } else {
+ buf[0] = '0';
+ }
+ err = write(fd, buf, sizeof(buf));
+ close(fd);
+ mEnabled = flags;
+ setInitialState();
+ return 0;
+ }
+ return -1;
+ }
+ return 0;
+}
+
+bool GyroSensor::hasPendingEvents() const {
+ return mHasPendingEvent;
+}
+
+int GyroSensor::setDelay(int32_t handle, int64_t delay_ns)
+{
+ int fd;
+ strcpy(&input_sysfs_path[input_sysfs_path_len], "poll_delay");
+ fd = open(input_sysfs_path, O_RDWR);
+ if (fd >= 0) {
+ char buf[80];
+ sprintf(buf, "%lld", delay_ns);
+ write(fd, buf, strlen(buf)+1);
+ close(fd);
+ return 0;
+ }
+ return -1;
+}
+
+int GyroSensor::readEvents(sensors_event_t* data, int count)
+{
+ if (count < 1)
+ return -EINVAL;
+
+ if (mHasPendingEvent) {
+ mHasPendingEvent = false;
+ mPendingEvent.timestamp = getTimestamp();
+ *data = mPendingEvent;
+ return mEnabled ? 1 : 0;
+ }
+
+ ssize_t n = mInputReader.fill(data_fd);
+ if (n < 0)
+ return n;
+
+ int numEventReceived = 0;
+ input_event const* event;
+
+#if FETCH_FULL_EVENT_BEFORE_RETURN
+again:
+#endif
+ while (count && mInputReader.readEvent(&event)) {
+ int type = event->type;
+ if (type == EV_REL) {
+ float value = event->value;
+ if (event->code == EVENT_TYPE_GYRO_X) {
+ mPendingEvent.data[0] = value * CONVERT_GYRO_X;
+ } else if (event->code == EVENT_TYPE_GYRO_Y) {
+ mPendingEvent.data[1] = value * CONVERT_GYRO_Y;
+ } else if (event->code == EVENT_TYPE_GYRO_Z) {
+ mPendingEvent.data[2] = value * CONVERT_GYRO_Z;
+ }
+ } else if (type == EV_SYN) {
+ mPendingEvent.timestamp = timevalToNano(event->time);
+ if (mEnabled) {
+ if (mPendingEvent.timestamp >= mEnabledTime) {
+ *data++ = mPendingEvent;
+ numEventReceived++;
+ }
+ count--;
+ }
+ } else {
+ LOGE("GyroSensor: unknown event (type=%d, code=%d)",
+ type, event->code);
+ }
+ mInputReader.next();
+ }
+
+#if FETCH_FULL_EVENT_BEFORE_RETURN
+ /* if we didn't read a complete event, see if we can fill and
+ try again instead of returning with nothing and redoing poll. */
+ if (numEventReceived == 0 && mEnabled == 1) {
+ n = mInputReader.fill(data_fd);
+ if (n)
+ goto again;
+ }
+#endif
+
+ return numEventReceived;
+}
+
diff --git a/libsensors/GyroSensor.h b/libsensors/GyroSensor.h
new file mode 100644
index 0000000..e8997de
--- /dev/null
+++ b/libsensors/GyroSensor.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+#ifndef ANDROID_GYRO_SENSOR_H
+#define ANDROID_GYRO_SENSOR_H
+
+#include <stdint.h>
+#include <errno.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#include "sensors.h"
+#include "SensorBase.h"
+#include "InputEventReader.h"
+
+/*****************************************************************************/
+
+struct input_event;
+
+class GyroSensor : public SensorBase {
+ int mEnabled;
+ InputEventCircularReader mInputReader;
+ sensors_event_t mPendingEvent;
+ bool mHasPendingEvent;
+ char input_sysfs_path[PATH_MAX];
+ int input_sysfs_path_len;
+ int64_t mEnabledTime;
+
+ int setInitialState();
+
+public:
+ GyroSensor();
+ virtual ~GyroSensor();
+ virtual int readEvents(sensors_event_t* data, int count);
+ virtual bool hasPendingEvents() const;
+ virtual int setDelay(int32_t handle, int64_t ns);
+ virtual int enable(int32_t handle, int enabled);
+};
+
+/*****************************************************************************/
+
+#endif // ANDROID_GYRO_SENSOR_H
diff --git a/libsensors/InputEventReader.cpp b/libsensors/InputEventReader.cpp
new file mode 100644
index 0000000..1014f29
--- /dev/null
+++ b/libsensors/InputEventReader.cpp
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+#include <stdint.h>
+#include <errno.h>
+#include <unistd.h>
+#include <poll.h>
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#include <linux/input.h>
+
+#include <cutils/log.h>
+
+#include "InputEventReader.h"
+
+/*****************************************************************************/
+
+struct input_event;
+
+InputEventCircularReader::InputEventCircularReader(size_t numEvents)
+ : mBuffer(new input_event[numEvents * 2]),
+ mBufferEnd(mBuffer + numEvents),
+ mHead(mBuffer),
+ mCurr(mBuffer),
+ mFreeSpace(numEvents)
+{
+}
+
+InputEventCircularReader::~InputEventCircularReader()
+{
+ delete [] mBuffer;
+}
+
+ssize_t InputEventCircularReader::fill(int fd)
+{
+ size_t numEventsRead = 0;
+ if (mFreeSpace) {
+ const ssize_t nread = read(fd, mHead, mFreeSpace * sizeof(input_event));
+ if (nread<0 || nread % sizeof(input_event)) {
+ // we got a partial event!!
+ return nread<0 ? -errno : -EINVAL;
+ }
+
+ numEventsRead = nread / sizeof(input_event);
+ if (numEventsRead) {
+ mHead += numEventsRead;
+ mFreeSpace -= numEventsRead;
+ if (mHead > mBufferEnd) {
+ size_t s = mHead - mBufferEnd;
+ memcpy(mBuffer, mBufferEnd, s * sizeof(input_event));
+ mHead = mBuffer + s;
+ }
+ }
+ }
+
+ return numEventsRead;
+}
+
+ssize_t InputEventCircularReader::readEvent(input_event const** events)
+{
+ *events = mCurr;
+ ssize_t available = (mBufferEnd - mBuffer) - mFreeSpace;
+ return available ? 1 : 0;
+}
+
+void InputEventCircularReader::next()
+{
+ mCurr++;
+ mFreeSpace++;
+ if (mCurr >= mBufferEnd) {
+ mCurr = mBuffer;
+ }
+}
diff --git a/libsensors/InputEventReader.h b/libsensors/InputEventReader.h
new file mode 100644
index 0000000..180aade
--- /dev/null
+++ b/libsensors/InputEventReader.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+#ifndef ANDROID_INPUT_EVENT_READER_H
+#define ANDROID_INPUT_EVENT_READER_H
+
+#include <stdint.h>
+#include <errno.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+/*****************************************************************************/
+
+struct input_event;
+
+class InputEventCircularReader
+{
+ struct input_event* const mBuffer;
+ struct input_event* const mBufferEnd;
+ struct input_event* mHead;
+ struct input_event* mCurr;
+ ssize_t mFreeSpace;
+
+public:
+ InputEventCircularReader(size_t numEvents);
+ ~InputEventCircularReader();
+ ssize_t fill(int fd);
+ ssize_t readEvent(input_event const** events);
+ void next();
+};
+
+/*****************************************************************************/
+
+#endif // ANDROID_INPUT_EVENT_READER_H
diff --git a/libsensors/LightSensor.cpp b/libsensors/LightSensor.cpp
new file mode 100644
index 0000000..1d4f0e4
--- /dev/null
+++ b/libsensors/LightSensor.cpp
@@ -0,0 +1,160 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+#include <fcntl.h>
+#include <errno.h>
+#include <math.h>
+#include <poll.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <sys/select.h>
+
+#include <linux/lightsensor.h>
+
+#include <cutils/log.h>
+
+#include "LightSensor.h"
+
+// #define LOG_NDEBUG 0
+
+/*****************************************************************************/
+
+LightSensor::LightSensor()
+ : SensorBase(NULL, "light_sensor"),
+ mEnabled(0),
+ mInputReader(4),
+ mHasPendingEvent(false)
+{
+ mPendingEvent.version = sizeof(sensors_event_t);
+ mPendingEvent.sensor = ID_L;
+ mPendingEvent.type = SENSOR_TYPE_LIGHT;
+ memset(mPendingEvent.data, 0, sizeof(mPendingEvent.data));
+
+ if (data_fd) {
+ strcpy(input_sysfs_path, "/sys/class/input/");
+ strcat(input_sysfs_path, input_name);
+ strcat(input_sysfs_path, "/device/");
+ input_sysfs_path_len = strlen(input_sysfs_path);
+ enable(0, 1);
+ }
+}
+
+LightSensor::~LightSensor() {
+ if (mEnabled) {
+ enable(0, 0);
+ }
+}
+
+int LightSensor::setInitialState() {
+ struct input_absinfo absinfo;
+ if (!ioctl(data_fd, EVIOCGABS(EVENT_TYPE_LIGHT), &absinfo)) {
+ // make sure to report an event immediately
+ mHasPendingEvent = true;
+ mPendingEvent.light = absinfo.value;
+ }
+ return 0;
+}
+
+int LightSensor::setDelay(int32_t handle, int64_t ns)
+{
+ int fd;
+ strcpy(&input_sysfs_path[input_sysfs_path_len], "poll_delay");
+ fd = open(input_sysfs_path, O_RDWR);
+ if (fd >= 0) {
+ char buf[80];
+ sprintf(buf, "%lld", ns);
+ write(fd, buf, strlen(buf)+1);
+ close(fd);
+ return 0;
+ }
+ return -1;
+}
+
+int LightSensor::enable(int32_t handle, int en)
+{
+ int flags = en ? 1 : 0;
+ if (flags != mEnabled) {
+ int fd;
+ strcpy(&input_sysfs_path[input_sysfs_path_len], "enable");
+ fd = open(input_sysfs_path, O_RDWR);
+ if (fd >= 0) {
+ char buf[2];
+ int err;
+ buf[1] = 0;
+ if (flags) {
+ buf[0] = '1';
+ } else {
+ buf[0] = '0';
+ }
+ err = write(fd, buf, sizeof(buf));
+ close(fd);
+ mEnabled = flags;
+ return 0;
+ }
+ return -1;
+ }
+ return 0;
+}
+
+bool LightSensor::hasPendingEvents() const {
+ return mHasPendingEvent;
+}
+
+int LightSensor::readEvents(sensors_event_t* data, int count)
+{
+ if (count < 1)
+ return -EINVAL;
+
+ if (mHasPendingEvent) {
+ mHasPendingEvent = false;
+ mPendingEvent.timestamp = getTimestamp();
+ *data = mPendingEvent;
+ return mEnabled ? 1 : 0;
+ }
+
+ ssize_t n = mInputReader.fill(data_fd);
+ if (n < 0)
+ return n;
+
+ int numEventReceived = 0;
+ input_event const* event;
+
+ while (count && mInputReader.readEvent(&event)) {
+ int type = event->type;
+ if (type == EV_ABS) {
+ if (event->code == EVENT_TYPE_LIGHT) {
+ if (event->value != -1) {
+ LOGV("LightSensor: event (value=%d)", event->value);
+ // FIXME: not sure why we're getting -1 sometimes
+ mPendingEvent.light = event->value;
+ }
+ }
+ } else if (type == EV_SYN) {
+ mPendingEvent.timestamp = timevalToNano(event->time);
+ if (mEnabled) {
+ *data++ = mPendingEvent;
+ count--;
+ numEventReceived++;
+ }
+ } else {
+ LOGE("LightSensor: unknown event (type=%d, code=%d)",
+ type, event->code);
+ }
+ mInputReader.next();
+ }
+
+ return numEventReceived;
+}
diff --git a/libsensors/LightSensor.h b/libsensors/LightSensor.h
new file mode 100644
index 0000000..85e65d9
--- /dev/null
+++ b/libsensors/LightSensor.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+#ifndef ANDROID_LIGHT_SENSOR_H
+#define ANDROID_LIGHT_SENSOR_H
+
+#include <stdint.h>
+#include <errno.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#include "sensors.h"
+#include "SensorBase.h"
+#include "InputEventReader.h"
+
+/*****************************************************************************/
+
+struct input_event;
+
+class LightSensor : public SensorBase {
+ int mEnabled;
+ InputEventCircularReader mInputReader;
+ sensors_event_t mPendingEvent;
+ bool mHasPendingEvent;
+ char input_sysfs_path[PATH_MAX];
+ int input_sysfs_path_len;
+
+ float indexToValue(size_t index) const;
+ int setInitialState();
+
+public:
+ LightSensor();
+ virtual ~LightSensor();
+ virtual int readEvents(sensors_event_t* data, int count);
+ virtual bool hasPendingEvents() const;
+ virtual int setDelay(int32_t handle, int64_t ns);
+ virtual int enable(int32_t handle, int enabled);
+};
+
+/*****************************************************************************/
+
+#endif // ANDROID_LIGHT_SENSOR_H
diff --git a/libsensors/MODULE_LICENSE_APACHE2 b/libsensors/MODULE_LICENSE_APACHE2
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/libsensors/MODULE_LICENSE_APACHE2
diff --git a/libsensors/ProximitySensor.cpp b/libsensors/ProximitySensor.cpp
new file mode 100644
index 0000000..46424a5
--- /dev/null
+++ b/libsensors/ProximitySensor.cpp
@@ -0,0 +1,144 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+#include <fcntl.h>
+#include <errno.h>
+#include <math.h>
+#include <poll.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <sys/select.h>
+
+#include <linux/capella_cm3602.h>
+
+#include <cutils/log.h>
+
+#include "ProximitySensor.h"
+
+/*****************************************************************************/
+
+ProximitySensor::ProximitySensor()
+ : SensorBase(NULL, "proximity_sensor"),
+ mEnabled(0),
+ mInputReader(4),
+ mHasPendingEvent(false)
+{
+ mPendingEvent.version = sizeof(sensors_event_t);
+ mPendingEvent.sensor = ID_P;
+ mPendingEvent.type = SENSOR_TYPE_PROXIMITY;
+ memset(mPendingEvent.data, 0, sizeof(mPendingEvent.data));
+
+ if (data_fd) {
+ strcpy(input_sysfs_path, "/sys/class/input/");
+ strcat(input_sysfs_path, input_name);
+ strcat(input_sysfs_path, "/device/");
+ input_sysfs_path_len = strlen(input_sysfs_path);
+ enable(0, 1);
+ }
+}
+
+ProximitySensor::~ProximitySensor() {
+ if (mEnabled) {
+ enable(0, 0);
+ }
+}
+
+int ProximitySensor::setInitialState() {
+ struct input_absinfo absinfo;
+ if (!ioctl(data_fd, EVIOCGABS(EVENT_TYPE_PROXIMITY), &absinfo)) {
+ // make sure to report an event immediately
+ mHasPendingEvent = true;
+ mPendingEvent.distance = indexToValue(absinfo.value);
+ }
+ return 0;
+}
+
+int ProximitySensor::enable(int32_t, int en) {
+ int flags = en ? 1 : 0;
+ if (flags != mEnabled) {
+ int fd;
+ strcpy(&input_sysfs_path[input_sysfs_path_len], "enable");
+ fd = open(input_sysfs_path, O_RDWR);
+ if (fd >= 0) {
+ char buf[2];
+ buf[1] = 0;
+ if (flags) {
+ buf[0] = '1';
+ } else {
+ buf[0] = '0';
+ }
+ write(fd, buf, sizeof(buf));
+ close(fd);
+ mEnabled = flags;
+ setInitialState();
+ return 0;
+ }
+ return -1;
+ }
+ return 0;
+}
+
+bool ProximitySensor::hasPendingEvents() const {
+ return mHasPendingEvent;
+}
+
+int ProximitySensor::readEvents(sensors_event_t* data, int count)
+{
+ if (count < 1)
+ return -EINVAL;
+
+ if (mHasPendingEvent) {
+ mHasPendingEvent = false;
+ mPendingEvent.timestamp = getTimestamp();
+ *data = mPendingEvent;
+ return mEnabled ? 1 : 0;
+ }
+
+ ssize_t n = mInputReader.fill(data_fd);
+ if (n < 0)
+ return n;
+
+ int numEventReceived = 0;
+ input_event const* event;
+
+ while (count && mInputReader.readEvent(&event)) {
+ int type = event->type;
+ if (type == EV_ABS) {
+ if (event->code == EVENT_TYPE_PROXIMITY) {
+ mPendingEvent.distance = indexToValue(event->value);
+ }
+ } else if (type == EV_SYN) {
+ mPendingEvent.timestamp = timevalToNano(event->time);
+ if (mEnabled) {
+ *data++ = mPendingEvent;
+ count--;
+ numEventReceived++;
+ }
+ } else {
+ LOGE("ProximitySensor: unknown event (type=%d, code=%d)",
+ type, event->code);
+ }
+ mInputReader.next();
+ }
+
+ return numEventReceived;
+}
+
+float ProximitySensor::indexToValue(size_t index) const
+{
+ LOGV("ProximitySensor: Index = %zu", index);
+ return index * PROXIMITY_THRESHOLD_CM;
+}
diff --git a/libsensors/ProximitySensor.h b/libsensors/ProximitySensor.h
new file mode 100644
index 0000000..08ea49c
--- /dev/null
+++ b/libsensors/ProximitySensor.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+#ifndef ANDROID_PROXIMITY_SENSOR_H
+#define ANDROID_PROXIMITY_SENSOR_H
+
+#include <stdint.h>
+#include <errno.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#include "sensors.h"
+#include "SensorBase.h"
+#include "InputEventReader.h"
+
+/*****************************************************************************/
+
+struct input_event;
+
+class ProximitySensor : public SensorBase {
+ int mEnabled;
+ InputEventCircularReader mInputReader;
+ sensors_event_t mPendingEvent;
+ bool mHasPendingEvent;
+ char input_sysfs_path[PATH_MAX];
+ int input_sysfs_path_len;
+
+ int setInitialState();
+ float indexToValue(size_t index) const;
+
+public:
+ ProximitySensor();
+ virtual ~ProximitySensor();
+ virtual int readEvents(sensors_event_t* data, int count);
+ virtual bool hasPendingEvents() const;
+ virtual int enable(int32_t handle, int enabled);
+};
+
+/*****************************************************************************/
+
+#endif // ANDROID_PROXIMITY_SENSOR_H
diff --git a/libsensors/SensorBase.cpp b/libsensors/SensorBase.cpp
new file mode 100644
index 0000000..d448eb2
--- /dev/null
+++ b/libsensors/SensorBase.cpp
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+#include <fcntl.h>
+#include <errno.h>
+#include <math.h>
+#include <poll.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <sys/select.h>
+
+#include <cutils/log.h>
+
+#include <linux/input.h>
+
+#include "SensorBase.h"
+
+/*****************************************************************************/
+
+SensorBase::SensorBase(
+ const char* dev_name,
+ const char* data_name)
+ : dev_name(dev_name), data_name(data_name),
+ dev_fd(-1), data_fd(-1)
+{
+ if (data_name) {
+ data_fd = openInput(data_name);
+ }
+}
+
+SensorBase::~SensorBase() {
+ if (data_fd >= 0) {
+ close(data_fd);
+ }
+ if (dev_fd >= 0) {
+ close(dev_fd);
+ }
+}
+
+int SensorBase::open_device() {
+ if (dev_fd<0 && dev_name) {
+ dev_fd = open(dev_name, O_RDONLY);
+ LOGE_IF(dev_fd<0, "Couldn't open %s (%s)", dev_name, strerror(errno));
+ }
+ return 0;
+}
+
+int SensorBase::close_device() {
+ if (dev_fd >= 0) {
+ close(dev_fd);
+ dev_fd = -1;
+ }
+ return 0;
+}
+
+int SensorBase::getFd() const {
+ if (!data_name) {
+ return dev_fd;
+ }
+ return data_fd;
+}
+
+int SensorBase::setDelay(int32_t handle, int64_t ns) {
+ return 0;
+}
+
+bool SensorBase::hasPendingEvents() const {
+ return false;
+}
+
+int64_t SensorBase::getTimestamp() {
+ struct timespec t;
+ t.tv_sec = t.tv_nsec = 0;
+ clock_gettime(CLOCK_MONOTONIC, &t);
+ return int64_t(t.tv_sec)*1000000000LL + t.tv_nsec;
+}
+
+int SensorBase::openInput(const char* inputName) {
+ int fd = -1;
+ const char *dirname = "/dev/input";
+ char devname[PATH_MAX];
+ char *filename;
+ DIR *dir;
+ struct dirent *de;
+ dir = opendir(dirname);
+ if(dir == NULL)
+ return -1;
+ strcpy(devname, dirname);
+ filename = devname + strlen(devname);
+ *filename++ = '/';
+ while((de = readdir(dir))) {
+ if(de->d_name[0] == '.' &&
+ (de->d_name[1] == '\0' ||
+ (de->d_name[1] == '.' && de->d_name[2] == '\0')))
+ continue;
+ strcpy(filename, de->d_name);
+ fd = open(devname, O_RDONLY);
+ if (fd>=0) {
+ char name[80];
+ if (ioctl(fd, EVIOCGNAME(sizeof(name) - 1), &name) < 1) {
+ name[0] = '\0';
+ }
+ if (!strcmp(name, inputName)) {
+ strcpy(input_name, filename);
+ break;
+ } else {
+ close(fd);
+ fd = -1;
+ }
+ }
+ }
+ closedir(dir);
+ LOGE_IF(fd<0, "couldn't find '%s' input device", inputName);
+ return fd;
+}
diff --git a/libsensors/SensorBase.h b/libsensors/SensorBase.h
new file mode 100644
index 0000000..bb4d055
--- /dev/null
+++ b/libsensors/SensorBase.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+#ifndef ANDROID_SENSOR_BASE_H
+#define ANDROID_SENSOR_BASE_H
+
+#include <stdint.h>
+#include <errno.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+
+/*****************************************************************************/
+
+struct sensors_event_t;
+
+class SensorBase {
+protected:
+ const char* dev_name;
+ const char* data_name;
+ char input_name[PATH_MAX];
+ int dev_fd;
+ int data_fd;
+
+ int openInput(const char* inputName);
+ static int64_t getTimestamp();
+
+
+ static int64_t timevalToNano(timeval const& t) {
+ return t.tv_sec*1000000000LL + t.tv_usec*1000;
+ }
+
+ int open_device();
+ int close_device();
+
+public:
+ SensorBase(
+ const char* dev_name,
+ const char* data_name);
+
+ virtual ~SensorBase();
+
+ virtual int readEvents(sensors_event_t* data, int count) = 0;
+ virtual bool hasPendingEvents() const;
+ virtual int getFd() const;
+ virtual int setDelay(int32_t handle, int64_t ns);
+ virtual int enable(int32_t handle, int enabled) = 0;
+};
+
+/*****************************************************************************/
+
+#endif // ANDROID_SENSOR_BASE_H
diff --git a/libsensors/ak8973b.h b/libsensors/ak8973b.h
new file mode 100644
index 0000000..9b7ab60
--- /dev/null
+++ b/libsensors/ak8973b.h
@@ -0,0 +1,51 @@
+/*
+ * Definitions for akm8973 compass chip.
+ */
+#ifndef AKM8973_H
+#define AKM8973_H
+
+#include <linux/ioctl.h>
+
+#define AKM8973_I2C_NAME "ak8973b"
+
+#define AKMIO 0xA1
+
+/* IOCTLs for AKM library */
+#define ECS_IOCTL_WRITE _IOW(AKMIO, 0x01, char*)
+#define ECS_IOCTL_READ _IOWR(AKMIO, 0x02, char*)
+#define ECS_IOCTL_RESET _IO(AKMIO, 0x03)
+#define ECS_IOCTL_SET_MODE _IOW(AKMIO, 0x04, short)
+#define ECS_IOCTL_GETDATA _IOR(AKMIO, 0x05, char[SENSOR_DATA_SIZE])
+#define ECS_IOCTL_SET_YPR _IOW(AKMIO, 0x06, short[12])
+#define ECS_IOCTL_GET_OPEN_STATUS _IOR(AKMIO, 0x07, int)
+#define ECS_IOCTL_GET_CLOSE_STATUS _IOR(AKMIO, 0x08, int)
+#define ECS_IOCTL_GET_DELAY _IOR(AKMIO, 0x30, int64_t)
+#define ECS_IOCTL_GET_PROJECT_NAME _IOR(AKMIO, 0x0D, char[64])
+#define ECS_IOCTL_GET_MATRIX _IOR(AKMIO, 0x0E, short [4][3][3])
+
+/* IOCTLs for APPs */
+#define ECS_IOCTL_APP_SET_MODE _IOW(AKMIO, 0x10, short)
+#define ECS_IOCTL_APP_SET_MFLAG _IOW(AKMIO, 0x11, short)
+#define ECS_IOCTL_APP_GET_MFLAG _IOW(AKMIO, 0x12, short)
+#define ECS_IOCTL_APP_SET_AFLAG _IOW(AKMIO, 0x13, short)
+#define ECS_IOCTL_APP_GET_AFLAG _IOR(AKMIO, 0x14, short)
+#define ECS_IOCTL_APP_SET_TFLAG _IOR(AKMIO, 0x15, short)
+#define ECS_IOCTL_APP_GET_TFLAG _IOR(AKMIO, 0x16, short)
+#define ECS_IOCTL_APP_RESET_PEDOMETER _IO(AKMIO, 0x17)
+#define ECS_IOCTL_APP_SET_DELAY _IOW(AKMIO, 0x18, int64_t)
+#define ECS_IOCTL_APP_GET_DELAY ECS_IOCTL_GET_DELAY
+
+/* Set raw magnetic vector flag */
+#define ECS_IOCTL_APP_SET_MVFLAG _IOW(AKMIO, 0x19, short)
+
+/* Get raw magnetic vector flag */
+#define ECS_IOCTL_APP_GET_MVFLAG _IOR(AKMIO, 0x1A, short)
+
+struct akm8973_platform_data {
+ short layouts[4][3][3];
+ char project_name[64];
+ int gpio_RST;
+ int gpio_INT;
+};
+
+#endif
diff --git a/libsensors/sensors.cpp b/libsensors/sensors.cpp
new file mode 100644
index 0000000..6f0bdad
--- /dev/null
+++ b/libsensors/sensors.cpp
@@ -0,0 +1,326 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+#define LOG_TAG "Sensors"
+
+#include <hardware/sensors.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <dirent.h>
+#include <math.h>
+#include <poll.h>
+#include <pthread.h>
+#include <stdlib.h>
+
+#include <linux/input.h>
+
+#include <utils/Atomic.h>
+#include <utils/Log.h>
+
+#include "sensors.h"
+
+#include "LightSensor.h"
+#include "ProximitySensor.h"
+#include "AkmSensor.h"
+#include "GyroSensor.h"
+
+/*****************************************************************************/
+
+#define DELAY_OUT_TIME 0x7FFFFFFF
+
+#define LIGHT_SENSOR_POLLTIME 2000000000
+
+
+#define SENSORS_ACCELERATION (1<<ID_A)
+#define SENSORS_MAGNETIC_FIELD (1<<ID_M)
+#define SENSORS_ORIENTATION (1<<ID_O)
+#define SENSORS_LIGHT (1<<ID_L)
+#define SENSORS_PROXIMITY (1<<ID_P)
+#define SENSORS_GYROSCOPE (1<<ID_GY)
+
+#define SENSORS_ACCELERATION_HANDLE 0
+#define SENSORS_MAGNETIC_FIELD_HANDLE 1
+#define SENSORS_ORIENTATION_HANDLE 2
+#define SENSORS_LIGHT_HANDLE 3
+#define SENSORS_PROXIMITY_HANDLE 4
+#define SENSORS_GYROSCOPE_HANDLE 5
+
+#define AKM_FTRACE 0
+#define AKM_DEBUG 0
+#define AKM_DATA 0
+
+/*****************************************************************************/
+
+/* The SENSORS Module */
+static const struct sensor_t sSensorList[] = {
+ { "KR3DM 3-axis Accelerometer",
+ "STMicroelectronics",
+ 1, SENSORS_ACCELERATION_HANDLE,
+ SENSOR_TYPE_ACCELEROMETER, RANGE_A, CONVERT_A, 0.23f, 20000, { } },
+ { "AK8975 3-axis Magnetic field sensor",
+ "Asahi Kasei Microdevices",
+ 1, SENSORS_MAGNETIC_FIELD_HANDLE,
+ SENSOR_TYPE_MAGNETIC_FIELD, 2000.0f, CONVERT_M, 6.8f, 16667, { } },
+ { "AK8973 Orientation sensor",
+ "Asahi Kasei Microdevices",
+ 1, SENSORS_ORIENTATION_HANDLE,
+ SENSOR_TYPE_ORIENTATION, 360.0f, CONVERT_O, 7.8f, 16667, { } },
+ { "CM3663 Light sensor",
+ "Capella Microsystems",
+ 1, SENSORS_LIGHT_HANDLE,
+ SENSOR_TYPE_LIGHT, 10240.0f, 1.0f, 0.75f, 0, { } },
+ { "CM3663 Proximity sensor",
+ "Capella Microsystems",
+ 1, SENSORS_PROXIMITY_HANDLE,
+ SENSOR_TYPE_PROXIMITY, 5.0f, 5.0f, 0.75f, 0, { } },
+ { "K3G Gyroscope sensor",
+ "STMicroelectronics",
+ 1, SENSORS_GYROSCOPE_HANDLE,
+ SENSOR_TYPE_GYROSCOPE, RANGE_GYRO, CONVERT_GYRO, 6.1f, 1190, { } },
+};
+
+
+static int open_sensors(const struct hw_module_t* module, const char* id,
+ struct hw_device_t** device);
+
+
+static int sensors__get_sensors_list(struct sensors_module_t* module,
+ struct sensor_t const** list)
+{
+ *list = sSensorList;
+ return ARRAY_SIZE(sSensorList);
+}
+
+static struct hw_module_methods_t sensors_module_methods = {
+ open: open_sensors
+};
+
+struct sensors_module_t HAL_MODULE_INFO_SYM = {
+ common: {
+ tag: HARDWARE_MODULE_TAG,
+ version_major: 1,
+ version_minor: 0,
+ id: SENSORS_HARDWARE_MODULE_ID,
+ name: "Samsung Sensor module",
+ author: "Samsung Electronic Company",
+ methods: &sensors_module_methods,
+ },
+ get_sensors_list: sensors__get_sensors_list,
+};
+
+struct sensors_poll_context_t {
+ struct sensors_poll_device_t device; // must be first
+
+ sensors_poll_context_t();
+ ~sensors_poll_context_t();
+ int activate(int handle, int enabled);
+ int setDelay(int handle, int64_t ns);
+ int pollEvents(sensors_event_t* data, int count);
+
+private:
+ enum {
+ light = 0,
+ proximity = 1,
+ akm = 2,
+ gyro = 3,
+ numSensorDrivers,
+ numFds,
+ };
+
+ static const size_t wake = numFds - 1;
+ static const char WAKE_MESSAGE = 'W';
+ struct pollfd mPollFds[numFds];
+ int mWritePipeFd;
+ SensorBase* mSensors[numSensorDrivers];
+
+ int handleToDriver(int handle) const {
+ switch (handle) {
+ case ID_A:
+ case ID_M:
+ case ID_O:
+ return akm;
+ case ID_P:
+ return proximity;
+ case ID_L:
+ return light;
+ case ID_GY:
+ return gyro;
+ }
+ return -EINVAL;
+ }
+};
+
+/*****************************************************************************/
+
+sensors_poll_context_t::sensors_poll_context_t()
+{
+ mSensors[light] = new LightSensor();
+ mPollFds[light].fd = mSensors[light]->getFd();
+ mPollFds[light].events = POLLIN;
+ mPollFds[light].revents = 0;
+
+ mSensors[proximity] = new ProximitySensor();
+ mPollFds[proximity].fd = mSensors[proximity]->getFd();
+ mPollFds[proximity].events = POLLIN;
+ mPollFds[proximity].revents = 0;
+
+ mSensors[akm] = new AkmSensor();
+ mPollFds[akm].fd = mSensors[akm]->getFd();
+ mPollFds[akm].events = POLLIN;
+ mPollFds[akm].revents = 0;
+
+ mSensors[gyro] = new GyroSensor();
+ mPollFds[gyro].fd = mSensors[gyro]->getFd();
+ mPollFds[gyro].events = POLLIN;
+ mPollFds[gyro].revents = 0;
+
+ int wakeFds[2];
+ int result = pipe(wakeFds);
+ LOGE_IF(result<0, "error creating wake pipe (%s)", strerror(errno));
+ fcntl(wakeFds[0], F_SETFL, O_NONBLOCK);
+ fcntl(wakeFds[1], F_SETFL, O_NONBLOCK);
+ mWritePipeFd = wakeFds[1];
+
+ mPollFds[wake].fd = wakeFds[0];
+ mPollFds[wake].events = POLLIN;
+ mPollFds[wake].revents = 0;
+}
+
+sensors_poll_context_t::~sensors_poll_context_t() {
+ for (int i=0 ; i<numSensorDrivers ; i++) {
+ delete mSensors[i];
+ }
+ close(mPollFds[wake].fd);
+ close(mWritePipeFd);
+}
+
+int sensors_poll_context_t::activate(int handle, int enabled) {
+ int index = handleToDriver(handle);
+ if (index < 0) return index;
+ int err = mSensors[index]->enable(handle, enabled);
+ if (enabled && !err) {
+ const char wakeMessage(WAKE_MESSAGE);
+ int result = write(mWritePipeFd, &wakeMessage, 1);
+ LOGE_IF(result<0, "error sending wake message (%s)", strerror(errno));
+ }
+ return err;
+}
+
+int sensors_poll_context_t::setDelay(int handle, int64_t ns) {
+
+ int index = handleToDriver(handle);
+ if (index < 0) return index;
+ return mSensors[index]->setDelay(handle, ns);
+}
+
+int sensors_poll_context_t::pollEvents(sensors_event_t* data, int count)
+{
+ int nbEvents = 0;
+ int n = 0;
+
+ do {
+ // see if we have some leftover from the last poll()
+ for (int i=0 ; count && i<numSensorDrivers ; i++) {
+ SensorBase* const sensor(mSensors[i]);
+ if ((mPollFds[i].revents & POLLIN) || (sensor->hasPendingEvents())) {
+ int nb = sensor->readEvents(data, count);
+ if (nb < count) {
+ // no more data for this sensor
+ mPollFds[i].revents = 0;
+ }
+ count -= nb;
+ nbEvents += nb;
+ data += nb;
+ }
+ }
+
+ if (count) {
+ // we still have some room, so try to see if we can get
+ // some events immediately or just wait if we don't have
+ // anything to return
+ n = poll(mPollFds, numFds, nbEvents ? 0 : -1);
+ if (n<0) {
+ LOGE("poll() failed (%s)", strerror(errno));
+ return -errno;
+ }
+ if (mPollFds[wake].revents & POLLIN) {
+ char msg;
+ int result = read(mPollFds[wake].fd, &msg, 1);
+ LOGE_IF(result<0, "error reading from wake pipe (%s)", strerror(errno));
+ LOGE_IF(msg != WAKE_MESSAGE, "unknown message on wake queue (0x%02x)", int(msg));
+ mPollFds[wake].revents = 0;
+ }
+ }
+ // if we have events and space, go read them
+ } while (n && count);
+
+ return nbEvents;
+}
+
+/*****************************************************************************/
+
+static int poll__close(struct hw_device_t *dev)
+{
+ sensors_poll_context_t *ctx = (sensors_poll_context_t *)dev;
+ if (ctx) {
+ delete ctx;
+ }
+ return 0;
+}
+
+static int poll__activate(struct sensors_poll_device_t *dev,
+ int handle, int enabled) {
+ sensors_poll_context_t *ctx = (sensors_poll_context_t *)dev;
+ return ctx->activate(handle, enabled);
+}
+
+static int poll__setDelay(struct sensors_poll_device_t *dev,
+ int handle, int64_t ns) {
+ sensors_poll_context_t *ctx = (sensors_poll_context_t *)dev;
+ return ctx->setDelay(handle, ns);
+}
+
+static int poll__poll(struct sensors_poll_device_t *dev,
+ sensors_event_t* data, int count) {
+ sensors_poll_context_t *ctx = (sensors_poll_context_t *)dev;
+ return ctx->pollEvents(data, count);
+}
+
+/*****************************************************************************/
+
+/** Open a new instance of a sensor device using name */
+static int open_sensors(const struct hw_module_t* module, const char* id,
+ struct hw_device_t** device)
+{
+ int status = -EINVAL;
+ sensors_poll_context_t *dev = new sensors_poll_context_t();
+
+ memset(&dev->device, 0, sizeof(sensors_poll_device_t));
+
+ dev->device.common.tag = HARDWARE_DEVICE_TAG;
+ dev->device.common.version = 0;
+ dev->device.common.module = const_cast<hw_module_t*>(module);
+ dev->device.common.close = poll__close;
+ dev->device.activate = poll__activate;
+ dev->device.setDelay = poll__setDelay;
+ dev->device.poll = poll__poll;
+
+ *device = &dev->device.common;
+ status = 0;
+
+ return status;
+}
+
diff --git a/libsensors/sensors.h b/libsensors/sensors.h
new file mode 100644
index 0000000..ecc6fed
--- /dev/null
+++ b/libsensors/sensors.h
@@ -0,0 +1,144 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+#ifndef ANDROID_SENSORS_H
+#define ANDROID_SENSORS_H
+
+#include <stdint.h>
+#include <errno.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#include <linux/input.h>
+
+#include <hardware/hardware.h>
+#include <hardware/sensors.h>
+
+__BEGIN_DECLS
+
+/*****************************************************************************/
+
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
+
+#define ID_A (0)
+#define ID_M (1)
+#define ID_O (2)
+#define ID_L (3)
+#define ID_P (4)
+#define ID_GY (5)
+
+/*****************************************************************************/
+
+/*
+ * The SENSORS Module
+ */
+
+/* the CM3663 is a binary proximity sensor that triggers around 6 cm on
+ * this hardware */
+#define PROXIMITY_THRESHOLD_CM 6.0f
+
+/*****************************************************************************/
+
+#define AKM_DEVICE_NAME "/dev/akm8975"
+#define CM_DEVICE_NAME "/dev/i2c11" // FIXME Proximity
+#define LS_DEVICE_NAME "/dev/i2c11" // FIXME Lig
+
+/*
+ E/Sensors ( 2656): AkmSensor: processing event (type=0, code=0)
+ E/Sensors ( 2656): AkmSensor: processing event (type=2, code=8)
+ E/Sensors ( 2656): AkmSensor: processing event (type=2, code=3)
+ E/Sensors ( 2656): AkmSensor: processing event (type=2, code=4)
+ E/Sensors ( 2656): AkmSensor: processing event (type=2, code=5)
+ E/Sensors ( 2656): AkmSensor: processing event (type=2, code=0)
+ E/Sensors ( 2656): AkmSensor: processing event (type=2, code=1)
+ E/Sensors ( 2656): AkmSensor: processing event (type=2, code=2)
+ E/Sensors ( 2656): AkmSensor: processing event (type=2, code=6)
+ E/Sensors ( 2656): AkmSensor: processing event (type=2, code=7)
+ E/Sensors ( 2656): AkmSensor: processing event (type=2, code=9)
+ E/Sensors ( 2656): AkmSensor: processing event (type=0, code=0)
+ E/Sensors ( 2656): AkmSensor: processing event (type=2, code=8)
+ E/Sensors ( 2656): AkmSensor: processing event (type=2, code=3)
+ E/Sensors ( 2656): AkmSensor: processing event (type=2, code=4)
+ E/Sensors ( 2656): AkmSensor: processing event (type=2, code=5)
+ E/Sensors ( 2656): AkmSensor: processing event (type=2, code=0)
+ E/Sensors ( 2656): AkmSensor: processing event (type=2, code=1)
+ E/Sensors ( 2656): AkmSensor: processing event (type=2, code=2)
+ E/Sensors ( 2656): AkmSensor: processing event (type=2, code=6)
+ E/Sensors ( 2656): AkmSensor: processing event (type=2, code=7)
+ E/Sensors ( 2656): AkmSensor: processing event (type=2, code=9)
+*/
+
+// for akm8975
+#define EVENT_TYPE_ACCEL_X ABS_Y //1
+#define EVENT_TYPE_ACCEL_Y ABS_X //0
+#define EVENT_TYPE_ACCEL_Z ABS_Z //2
+//#define EVENT_TYPE_ACCEL_STATUS ABS_WHEEL //8
+
+#define EVENT_TYPE_YAW ABS_RX //3
+#define EVENT_TYPE_PITCH ABS_RY //4
+#define EVENT_TYPE_ROLL ABS_RZ //5
+#define EVENT_TYPE_ORIENT_STATUS ABS_WHEEL //8
+
+#define EVENT_TYPE_MAGV_X ABS_RUDDER // 6
+#define EVENT_TYPE_MAGV_Y ABS_THROTTLE // 7
+#define EVENT_TYPE_MAGV_Z ABS_GAS // 9
+
+#define EVENT_TYPE_TEMPERATURE ABS_THROTTLE
+#define EVENT_TYPE_STEP_COUNT ABS_GAS
+#define EVENT_TYPE_PROXIMITY ABS_DISTANCE
+#define EVENT_TYPE_LIGHT ABS_MISC
+
+#define EVENT_TYPE_GYRO_X REL_RY
+#define EVENT_TYPE_GYRO_Y REL_RX
+#define EVENT_TYPE_GYRO_Z REL_RZ
+
+// 90 LSB = 1G for KR3DM
+#define LSB (90.0f)
+#define NUMOFACCDATA (8.0f)
+
+// conversion of acceleration data to SI units (m/s^2)
+#define RANGE_A (2*GRAVITY_EARTH)
+#define CONVERT_A (GRAVITY_EARTH / LSB / NUMOFACCDATA)
+#define CONVERT_A_X (CONVERT_A)
+#define CONVERT_A_Y (-CONVERT_A)
+#define CONVERT_A_Z (-CONVERT_A)
+
+// conversion of magnetic data to uT units
+#define CONVERT_M (1.0f/16.0f)
+#define CONVERT_M_X (CONVERT_M)
+#define CONVERT_M_Y (-CONVERT_M)
+#define CONVERT_M_Z (CONVERT_M)
+
+/* conversion of orientation data to degree units */
+#define CONVERT_O (1.0f/64.0f)
+#define CONVERT_O_A (CONVERT_O)
+#define CONVERT_O_P (CONVERT_O)
+#define CONVERT_O_R (-CONVERT_O)
+
+// conversion of gyro data to SI units (radian/sec)
+#define RANGE_GYRO (2000.0f*(float)M_PI/180.0f)
+#define CONVERT_GYRO ((70.0f / 1000.0f) * ((float)M_PI / 180.0f))
+#define CONVERT_GYRO_X (CONVERT_GYRO)
+#define CONVERT_GYRO_Y (-CONVERT_GYRO)
+#define CONVERT_GYRO_Z (CONVERT_GYRO)
+
+#define SENSOR_STATE_MASK (0x7FFF)
+
+/*****************************************************************************/
+
+__END_DECLS
+
+#endif // ANDROID_SENSORS_H
diff --git a/lpm.rc b/lpm.rc
new file mode 100644
index 0000000..be98378
--- /dev/null
+++ b/lpm.rc
@@ -0,0 +1,84 @@
+on early-init
+ start ueventd
+
+on init
+ export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
+ export LD_LIBRARY_PATH /vendor/lib:/system/lib
+ export ANDROID_ROOT /system
+ export ANDROID_DATA /data
+ export EXTERNAL_STORAGE /mnt/sdcard
+ export PHONE_STORAGE /mnt/emmc
+
+ symlink /system/etc /etc
+ mkdir /mnt 0775 root system
+ mkdir /mnt/sdcard 0000 system system
+ mkdir /mnt/emmc 0000 system system
+ symlink /mnt/sdcard /sdcard
+ symlink /mnt/emmc /emmc
+
+ mkdir /preload
+ mkdir /system
+ mkdir /data
+ mkdir /cache
+ mkdir /efs
+ mkdir /tmp
+ mkdir /dbdata
+ mkdir /mnt 0775 root root
+ mkdir /mnt/.lfs 0775 root root
+ #mount /tmp /tmp tmpfs
+
+on fs
+ mount ext4 /dev/block/mmcblk0p9 /system wait ro
+ mount ext4 /dev/block/mmcblk0p10 /data nosuid nodev noatime wait
+
+ mkdir /data/log 0777
+ mkdir /data/anr 0777
+ mount ext4 /dev/block/mmcblk0p10 /data remount ro
+
+ chmod 0666 /dev/log/radio
+ chmod 0666 /dev/log/main
+ chmod 0666 /dev/log/event
+
+on post-fs-data
+# insmod kernel modules
+ insmod /lib/modules/j4fs.ko
+ mount j4fs /dev/block/mmcblk0p4 /mnt/.lfs ro
+
+on boot
+# CPU Frequency Governor
+ write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor powersave
+
+ ifup lo
+ hostname localhost
+ domainname localdomain
+
+ class_start default
+
+service debuggerd /system/bin/debuggerd
+
+ service ueventd /sbin/ueventd
+ critical
+
+service console /system/bin/sh
+ console
+
+service playlpm /system/bin/playlpm
+ user root
+
+service lpmkey /system/bin/charging_mode
+ user root
+
+# adbd is controlled by the persist.service.adb.enable system property
+service adbd /sbin/adbd
+# disabled
+
+# adbd on at boot in emulator
+on property:ro.kernel.qemu=1
+ start adbd
+
+on property:persist.service.adb.enable=1
+ start adbd
+
+on property:persist.service.adb.enable=0
+# stop adbd
+
diff --git a/mkshbootimg.py b/mkshbootimg.py
new file mode 100755
index 0000000..dcc8294
--- /dev/null
+++ b/mkshbootimg.py
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+import sys, os
+
+def copydata(outfile, infile):
+ while 1:
+ data = infile.read(512)
+ if (data):
+ outfile.write(data)
+ else:
+ break
+
+def alignoffset(outfile):
+ offset = outfile.tell()
+ outfile.seek((offset + 511) & ~511)
+ return outfile.tell()
+
+def appendimage(outfile, infile):
+ offset = alignoffset(outfile)
+ copydata(outfile, infile)
+ length = alignoffset(outfile) - offset
+ assert (offset % 512 == 0)
+ assert (length % 512 == 0)
+ return (offset/512, length/512)
+
+if len(sys.argv) < 4:
+ print "Usage:", sys.argv[0], "output kernel boot [recovery]"
+ sys.exit(1)
+
+outfile = open(sys.argv[1], 'wb')
+kernel = open(sys.argv[2], 'r')
+boot = open(sys.argv[3], 'r')
+recovery = None
+if (len(sys.argv) == 5):
+ recovery = open(sys.argv[4], 'r')
+offset_table = "\n\nBOOT_IMAGE_OFFSETS\n"
+copydata(outfile, kernel)
+table_loc = alignoffset(outfile)
+outfile.write('\x00' * 512)
+offset_table += "boot_offset=%d;boot_len=%d;" % appendimage(outfile, boot)
+if recovery:
+ offset_table += "recovery_offset=%d;recovery_len=%d;" % appendimage(outfile, recovery)
+offset_table += "\n\n"
+outfile.seek(table_loc)
+outfile.write(offset_table)
+outfile.flush()
+os.fsync(outfile.fileno())
+outfile.close()
diff --git a/modules/Si4709_driver.ko b/modules/Si4709_driver.ko
new file mode 100644
index 0000000..efc575c
--- /dev/null
+++ b/modules/Si4709_driver.ko
Binary files differ
diff --git a/modules/dhd.ko b/modules/dhd.ko
new file mode 100644
index 0000000..89c9fe4
--- /dev/null
+++ b/modules/dhd.ko
Binary files differ
diff --git a/modules/j4fs.ko b/modules/j4fs.ko
new file mode 100644
index 0000000..9641205
--- /dev/null
+++ b/modules/j4fs.ko
Binary files differ
diff --git a/modules/scsi_wait_scan.ko b/modules/scsi_wait_scan.ko
new file mode 100644
index 0000000..72d0161
--- /dev/null
+++ b/modules/scsi_wait_scan.ko
Binary files differ
diff --git a/overlay/frameworks/base/core/res/res/drawable-nodpi/default_wallpaper.jpg b/overlay/frameworks/base/core/res/res/drawable-nodpi/default_wallpaper.jpg
new file mode 100644
index 0000000..e400338
--- /dev/null
+++ b/overlay/frameworks/base/core/res/res/drawable-nodpi/default_wallpaper.jpg
Binary files differ
diff --git a/overlay/frameworks/base/core/res/res/values/arrays.xml b/overlay/frameworks/base/core/res/res/values/arrays.xml
new file mode 100644
index 0000000..6d169e6
--- /dev/null
+++ b/overlay/frameworks/base/core/res/res/values/arrays.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, 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.
+*/
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- Defines the shutdown options shown in the reboot dialog. -->
+ <array name="shutdown_reboot_options" translatable="false">
+ <item>@string/reboot_reboot</item>
+ <item>@string/reboot_recovery</item>
+ <item>@string/reboot_download</item>
+ </array>
+
+ <!-- Do not translate. Defines the shutdown actions passed to the kernel.
+ The first item should be empty for regular reboot. -->
+ <string-array name="shutdown_reboot_actions" translatable="false">
+ <item></item>
+ <item>recovery</item>
+ <item>bootloader</item>
+ </string-array>
+
+</resources>
diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml
new file mode 100644
index 0000000..5892e8e
--- /dev/null
+++ b/overlay/frameworks/base/core/res/res/values/config.xml
@@ -0,0 +1,259 @@
+<?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.
+*/
+-->
+
+<!-- These resources are around just to allow their values to be customized
+ for different hardware and product builds. -->
+<resources>
+
+ <!-- Default color for notification LED is white. -->
+ <color name="config_defaultNotificationColor">#ffffffff</color>
+
+ <!-- Default LED on time for notification LED in milliseconds. -->
+ <integer name="config_defaultNotificationLedOn">1000</integer>
+
+ <!-- Default LED off time for notification LED in milliseconds. -->
+ <integer name="config_defaultNotificationLedOff">9000</integer>
+
+ <!-- Our amoled doesn't animate well. -->
+ <bool name="config_animateScreenLights">false</bool>
+
+ <integer name="config_deskDockKeepsScreenOn">0</integer>
+ <integer name="config_carDockKeepsScreenOn">1</integer>
+
+ <!-- If this is true, the screen will come on when you unplug usb/power/whatever. -->
+ <bool name="config_unplugTurnsOnScreen">true</bool>
+
+ <!-- Component name of the service providing network location support. -->
+ <string name="config_networkLocationProvider">com.google.android.location.NetworkLocationProvider</string>
+
+ <!-- Component name of the service providing geocoder API support. -->
+ <string name="config_geocodeProvider">com.google.android.location.GeocodeProvider</string>
+
+ <!-- Flag indicating whether we should enable the automatic brightness in Settings.
+ config_hardware_automatic_brightness_available is not set, so we will use software implementation -->
+ <bool name="config_automatic_brightness_available">true</bool>
+
+ <!-- Whether a software navigation bar should be shown. NOTE: in the future this may be
+ autodetected from the Configuration. -->
+ <bool name="config_showNavigationBar">false</bool>
+
+ <!-- Array of light sensor LUX values to define our levels for auto backlight brightness support.
+ The N entries of this array define N + 1 zones as follows:
+
+ Zone 0: 0 <= LUX < array[0]
+ Zone 1: array[0] <= LUX < array[1]
+ ...
+ Zone N: array[N - 1] <= LUX < array[N]
+ Zone N + 1: array[N] <= LUX < infinity
+
+ Must be overridden in platform specific overlays -->
+ <integer-array name="config_autoBrightnessLevels">
+ <item>100</item>
+ <item>200</item>
+ <item>400</item>
+ <item>1000</item>
+ <item>3000</item>
+ </integer-array>
+
+ <!-- Array of output values for LCD backlight corresponding to the LUX values
+ in the config_autoBrightnessLevels array. This array should have size one greater
+ than the size of the config_autoBrightnessLevels array.
+ -->
+ <integer-array name="config_autoBrightnessLcdBacklightValues">
+ <item>16</item>
+ <item>40</item>
+ <item>60</item>
+ <item>70</item>
+ <item>70</item>
+ <item>250</item>
+ </integer-array>
+
+ <!-- Array of output values for button backlight corresponding to the LUX values
+ in the config_autoBrightnessLevels array. This array should have size one greater
+ than the size of the config_autoBrightnessLevels array.
+ -->
+ <integer-array name="config_autoBrightnessButtonBacklightValues">
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ </integer-array>
+
+ <!-- Array of output values for keyboard backlight corresponding to the LUX values
+ in the config_autoBrightnessLevels array. This array should have size one greater
+ than the size of the config_autoBrightnessLevels array.
+ Crespo has no keyboard so all values are zero.
+ -->
+ <integer-array name="config_autoBrightnessKeyboardBacklightValues">
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ </integer-array>
+
+ <!-- Minimum screen brightness allowed by the power manager. -->
+ <integer name="config_screenBrightnessDim">10</integer>
+
+ <!-- XXXXX NOTE THE FOLLOWING RESOURCES USE THE WRONG NAMING CONVENTION.
+ Please don't copy them, copy anything else. -->
+
+ <!-- An Array of "[Connection name],[ConnectivityManager.TYPE_xxxx],
+ [associated radio-type],[priority],[restoral-timer(ms)],[dependencyMet] -->
+ <!-- the 5th element "resore-time" indicates the number of milliseconds to delay
+ before automatically restore the default connection. Set -1 if the connection
+ does not require auto-restore. -->
+ <!-- the 6th element indicates boot-time dependency-met value. -->
+ <string-array translatable="false" name="networkAttributes">
+ <item>"wifi,1,1,1,-1,true"</item>
+ <item>"mobile,0,0,0,-1,true"</item>
+ <item>"mobile_mms,2,0,2,60000,true"</item>
+ <item>"mobile_supl,3,0,2,60000,true"</item>
+ <item>"mobile_dun,4,0,3,60000,true"</item>
+ <item>"mobile_hipri,5,0,3,60000,true"</item>
+ <item>"mobile_bluetooth,7,7,1,-1,true"</item>
+ <item>"wifi_p2p,13,1,0,-1,true"</item>
+ </string-array>
+
+ <!-- An Array of "[ConnectivityManager connectionType],
+ [# simultaneous connection types]" -->
+ <string-array translatable="false" name="radioAttributes">
+ <item>"1,1"</item>
+ <item>"0,1"</item>
+ <item>"7,1"</item>
+ </string-array>
+
+ <!-- List of regexpressions describing the interface (if any) that represent tetherable
+ USB interfaces. If the device doesn't want to support tething over USB this should
+ be empty. An example would be "usb.*" -->
+ <string-array translatable="false" name="config_tether_usb_regexs">
+ <item>"rndis0"</item>
+ </string-array>
+
+ <!-- List of regexpressions describing the interface (if any) that represent tetherable
+ Wifi interfaces. If the device doesn't want to support tethering over Wifi this
+ should be empty. An example would be "softap.*" -->
+ <string-array translatable="false" name="config_tether_wifi_regexs">
+ <item>"wlan0"</item>
+ </string-array>
+
+ <!-- List of regexpressions describing the interface (if any) that represent tetherable
+ bluetooth interfaces. If the device doesn't want to support tethering over bluetooth this
+ should be empty. -->
+ <string-array translatable="false" name="config_tether_bluetooth_regexs">
+ <item>"bnep\\d"</item>
+ </string-array>
+
+ <!-- Array of ConnectivityManager.TYPE_xxxx values allowable for tethering -->
+ <!-- Common options are [1, 4] for TYPE_WIFI and TYPE_MOBILE_DUN or
+ <!== [0,1,5,7] for TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI and TYPE_BLUETOOTH -->
+ <integer-array translatable="false" name="config_tether_upstream_types">
+ <item>0</item>
+ <item>1</item>
+ <item>5</item>
+ <item>7</item>
+ </integer-array>
+
+ <!-- Boolean indicating whether the wifi chipset has dual frequency band support -->
+ <bool translatable="false" name="config_wifi_dual_band_support">true</bool>
+
+ <!-- Boolean indicating whether the wifi chipset has p2p support -->
+ <bool translatable="false" name="config_wifi_p2p_support">true</bool>
+
+ <!-- Boolean indicating whether the wifi chipset has background scan support -->
+ <bool translatable="false" name="config_wifi_background_scan_support">true</bool>
+
+ <bool name="config_ui_enableFadingMarquee">false</bool>
+
+ <!-- Component name of the service providing network location support. -->
+ <string name="config_networkLocationProvider">com.google.android.location.NetworkLocationProvider</string>
+
+ <!-- Component name of the service providing geocoder API support. -->
+ <string name="config_geocodeProvider">com.google.android.location.GeocodeProvider</string>
+
+ <!-- Is the notification LED intrusive? Used to decide if there should be a disable option -->
+ <bool name="config_intrusiveNotificationLed">true</bool>
+
+<!-- Vibrator pattern for feedback about a long screen/key press -->
+ <integer-array name="config_longPressVibePattern">
+ <item>0</item>
+ <item>1</item>
+ <item>20</item>
+ <item>21</item>
+ </integer-array>
+
+ <!-- Vibrator pattern for feedback about touching a virtual key -->
+ <integer-array name="config_virtualKeyVibePattern">
+ <item>0</item>
+ <item>1</item>
+ <item>20</item>
+ <item>21</item>
+ </integer-array>
+
+ <!-- Vibrator pattern for a very short but reliable vibration for soft keyboard tap -->
+ <integer-array name="config_keyboardTapVibePattern">
+ <item>20</item>
+ </integer-array>
+
+ <!-- Vibrator pattern for feedback about booting with safe mode disabled -->
+ <integer-array name="config_safeModeDisabledVibePattern">
+ <item>0</item>
+ <item>1</item>
+ <item>20</item>
+ <item>21</item>
+ </integer-array>
+
+ <!-- Vibrator pattern for feedback about booting with safe mode disabled -->
+ <integer-array name="config_safeModeEnabledVibePattern">
+ <item>0</item>
+ <item>1</item>
+ <item>20</item>
+ <item>21</item>
+ <item>500</item>
+ <item>600</item>
+ </integer-array>
+
+ <!-- Vibrator pattern for feedback about hitting a scroll barrier -->
+ <integer-array name="config_scrollBarrierVibePattern">
+ <item>0</item>
+ <item>15</item>
+ <item>10</item>
+ <item>10</item>
+ </integer-array>
+
+ <!-- The default iface on which to monitor data use -->
+ <string name="config_datause_iface">pdp0</string>
+
+ <!-- Allow the menu hard key to be disabled in LockScreen on some devices -->
+ <bool name="config_disableMenuKeyInLockScreen">true</bool>
+
+ <!-- CM CHANGES START HERE -->
+
+ <!-- LUN file to be used by legacy USB manager.
+ The existence of this file will be used to determine in the
+ legacy USB manager should be started. -->
+ <string name="config_legacyUmsLunFile">/sys/class/android_usb/f_mass_storage/lun0/file</string>
+
+ <!-- Workaround for devices with broken keyboards -->
+ <bool name="config_forceDisableHardwareKeyboard">true</bool>
+
+</resources>
diff --git a/overlay/frameworks/base/core/res/res/xml/power_profile.xml b/overlay/frameworks/base/core/res/res/xml/power_profile.xml
new file mode 100644
index 0000000..e6eb4e4
--- /dev/null
+++ b/overlay/frameworks/base/core/res/res/xml/power_profile.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 2009, 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.
+*/
+-->
+
+<device name="Android">
+ <!-- All values are in mAh except as noted -->
+ <item name="none">0</item>
+ <item name="screen.on">49</item>
+ <item name="bluetooth.active">142</item>
+ <item name="bluetooth.on">0.3</item>
+ <item name="bluetooth.at">35690</item>
+ <item name="screen.full">260</item>
+ <item name="wifi.on">4</item>
+ <item name="wifi.active">120</item>
+ <item name="wifi.scan">220</item>
+ <item name="dsp.audio">88</item>
+ <item name="dsp.video">88</item>
+ <item name="radio.active">185</item>
+ <!-- The current consumed by the radio when it is scanning for a signal -->
+ <item name="radio.scanning">88</item>
+ <item name="gps.on">50</item>
+ <!-- Current consumed by the radio at different signal strengths, when paging -->
+ <array name="radio.on"> <!-- Strength 0 to BINS-1 -->
+ <value>3.4</value>
+ <value>3.4</value>
+ </array>
+ <!-- Different CPU speeds as reported in
+ /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state -->
+ <array name="cpu.speeds">
+ <value>200000</value>
+ <value>500000</value>
+ <value>800000</value>
+ <value>1000000</value>
+ <value>1200000</value>
+ <value>1400000</value>
+ <value>1600000</value>
+ </array>
+ <!-- Power consumption when CPU is idle -->
+ <item name="cpu.idle">1.4</item>
+ <!-- Power consumption due to wake lock held -->
+ <item name="cpu.awake">44</item>
+ <!-- Power consumption at different speeds -->
+ <array name="cpu.active">
+ <value>55.4</value>
+ <value>82.1</value>
+ <value>113.7</value>
+ <value>140.0</value>
+ <value>170.0</value>
+ <value>200.0</value>
+ <value>230.0</value>
+ </array>
+ <!-- This is the battery capacity in mAh -->
+ <item name="battery.capacity">1650</item>
+</device>
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..0bca789
--- /dev/null
+++ b/overlay/frameworks/base/core/res/res/xml/storage_list.xml
@@ -0,0 +1,50 @@
+<?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)
+
+ A storage should not have both emulated and removable set to true
+-->
+
+<StorageList xmlns:android="http://schemas.android.com/apk/res/android">
+ <storage android:mountPoint="/mnt/sdcard"
+ android:storageDescription="@string/storage_internal"
+ android:primary="true"
+ android:removable="false" />
+
+ <storage android:mountPoint="/mnt/emmc"
+ android:storageDescription="@string/storage_sd_card"
+ android:primary="false"
+ android:removable="true" />
+
+ <storage android:mountPoint="/mnt/usbdisk"
+ android:storageDescription="@string/storage_usb"
+ android:primary="false"
+ android:removable="true" />
+</StorageList>
diff --git a/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
new file mode 100644
index 0000000..1e32354
--- /dev/null
+++ b/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/**
+ * Copyright (c) 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.
+ */
+-->
+<resources>
+ <!-- Screen timeout default = 30 seconds -->
+ <integer name="def_screen_off_timeout">30000</integer>
+</resources>
diff --git a/overlay/frameworks/base/packages/SystemUI/res/values/config.xml b/overlay/frameworks/base/packages/SystemUI/res/values/config.xml
new file mode 100644
index 0000000..88851f7
--- /dev/null
+++ b/overlay/frameworks/base/packages/SystemUI/res/values/config.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2011, 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.
+*/
+-->
+
+<!-- These resources are around just to allow their values to be customized
+ for different hardware and product builds. -->
+<resources>
+ <!-- Control whether status bar should distinguish HSPA data icon form UMTS data icon on devices -->
+ <bool name="config_hspa_data_distinguishable">true</bool>
+</resources>
+
diff --git a/overlay/packages/apps/Camera/res/values/config.xml b/overlay/packages/apps/Camera/res/values/config.xml
new file mode 100644
index 0000000..9192955
--- /dev/null
+++ b/overlay/packages/apps/Camera/res/values/config.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2011, 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.
+*/
+-->
+
+<resources>
+ <!-- Samsung Camcorder Mode -->
+ <bool name="needsSamsungCamMode">true</bool>
+ <!-- Samsung Camera Settings -->
+ <bool name="hasSamsungCamSettings">true</bool>
+</resources>
diff --git a/overlay/packages/apps/Phone/res/values/config.xml b/overlay/packages/apps/Phone/res/values/config.xml
new file mode 100644
index 0000000..29e3b62
--- /dev/null
+++ b/overlay/packages/apps/Phone/res/values/config.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<!-- Tuna-specific phone app resources. -->
+<resources>
+
+ <!-- Flag indicating if the tty is enabled -->
+ <bool name="tty_enabled">true</bool>
+
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-af/arrays.xml b/overlay/packages/apps/Settings/res/values-af/arrays.xml
new file mode 100644
index 0000000..4f2780f
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-af/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 sekondes"</item>
+ <item msgid="8672738773876256432">"30 sekondes"</item>
+ <item msgid="465923292941002466">"1 minuut"</item>
+ <item msgid="7955177189296850016">"2 minute"</item>
+ <item msgid="1244255986255344525">"5 minute"</item>
+ <item msgid="294890536998091748">"10 minute"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-am/arrays.xml b/overlay/packages/apps/Settings/res/values-am/arrays.xml
new file mode 100644
index 0000000..73deb95
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-am/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 ሰከንዶች"</item>
+ <item msgid="8672738773876256432">"30 ሰከንዶች"</item>
+ <item msgid="465923292941002466">"1 ደቂቃ"</item>
+ <item msgid="7955177189296850016">"2 ደቂቃዎች"</item>
+ <item msgid="1244255986255344525">"5 ደቂቃዎች"</item>
+ <item msgid="294890536998091748">"10 ደቂቃዎች"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-ar/arrays.xml b/overlay/packages/apps/Settings/res/values-ar/arrays.xml
new file mode 100644
index 0000000..396b12e
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-ar/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 ثانية"</item>
+ <item msgid="8672738773876256432">"30 ثانية"</item>
+ <item msgid="465923292941002466">"دقيقة واحدة"</item>
+ <item msgid="7955177189296850016">"دقيقتان"</item>
+ <item msgid="1244255986255344525">"5 دقائق"</item>
+ <item msgid="294890536998091748">"10 دقائق"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-bg/arrays.xml b/overlay/packages/apps/Settings/res/values-bg/arrays.xml
new file mode 100644
index 0000000..7c35aca
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-bg/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 Ñекунди"</item>
+ <item msgid="8672738773876256432">"30 Ñекунди"</item>
+ <item msgid="465923292941002466">"1 минута"</item>
+ <item msgid="7955177189296850016">"2 минути"</item>
+ <item msgid="1244255986255344525">"5 минути"</item>
+ <item msgid="294890536998091748">"10 минути"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-ca/arrays.xml b/overlay/packages/apps/Settings/res/values-ca/arrays.xml
new file mode 100644
index 0000000..7b8afb8
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-ca/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 segons"</item>
+ <item msgid="8672738773876256432">"30 segons"</item>
+ <item msgid="465923292941002466">"1 minut"</item>
+ <item msgid="7955177189296850016">"2 minuts"</item>
+ <item msgid="1244255986255344525">"5 minuts"</item>
+ <item msgid="294890536998091748">"10 minuts"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-cs/arrays.xml b/overlay/packages/apps/Settings/res/values-cs/arrays.xml
new file mode 100644
index 0000000..266d10e
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-cs/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 s."</item>
+ <item msgid="8672738773876256432">"30 s."</item>
+ <item msgid="465923292941002466">"1 min."</item>
+ <item msgid="7955177189296850016">"2 min."</item>
+ <item msgid="1244255986255344525">"5 min."</item>
+ <item msgid="294890536998091748">"10 min."</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-da/arrays.xml b/overlay/packages/apps/Settings/res/values-da/arrays.xml
new file mode 100644
index 0000000..5286122
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-da/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 sekunder"</item>
+ <item msgid="8672738773876256432">"30 sekunder"</item>
+ <item msgid="465923292941002466">"1 minut"</item>
+ <item msgid="7955177189296850016">"2 minutter"</item>
+ <item msgid="1244255986255344525">"5 minutter"</item>
+ <item msgid="294890536998091748">"10 minutter"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-de/arrays.xml b/overlay/packages/apps/Settings/res/values-de/arrays.xml
new file mode 100644
index 0000000..a185f05
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-de/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 Sekunden"</item>
+ <item msgid="8672738773876256432">"30 Sekunden"</item>
+ <item msgid="465923292941002466">"1 Minute"</item>
+ <item msgid="7955177189296850016">"2 Minuten"</item>
+ <item msgid="1244255986255344525">"5 Minuten"</item>
+ <item msgid="294890536998091748">"10 Minuten"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-el/arrays.xml b/overlay/packages/apps/Settings/res/values-el/arrays.xml
new file mode 100644
index 0000000..c5b4111
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-el/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 δευτεÏόλεπτα"</item>
+ <item msgid="8672738773876256432">"30 δευτεÏόλεπτα"</item>
+ <item msgid="465923292941002466">"1 λεπτό"</item>
+ <item msgid="7955177189296850016">"2 λεπτά"</item>
+ <item msgid="1244255986255344525">"5 λεπτά"</item>
+ <item msgid="294890536998091748">"10 λεπτά"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-en-rGB/arrays.xml b/overlay/packages/apps/Settings/res/values-en-rGB/arrays.xml
new file mode 100644
index 0000000..d99e0a6
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-en-rGB/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 seconds"</item>
+ <item msgid="8672738773876256432">"30 seconds"</item>
+ <item msgid="465923292941002466">"1 minute"</item>
+ <item msgid="7955177189296850016">"2 minutes"</item>
+ <item msgid="1244255986255344525">"5 minutes"</item>
+ <item msgid="294890536998091748">"10 minutes"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-es-rUS/arrays.xml b/overlay/packages/apps/Settings/res/values-es-rUS/arrays.xml
new file mode 100644
index 0000000..9d0d76b
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-es-rUS/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 segundos"</item>
+ <item msgid="8672738773876256432">"30 segundos"</item>
+ <item msgid="465923292941002466">"1 minuto"</item>
+ <item msgid="7955177189296850016">"2 minutos"</item>
+ <item msgid="1244255986255344525">"5 minutos"</item>
+ <item msgid="294890536998091748">"10 minutos"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-es/arrays.xml b/overlay/packages/apps/Settings/res/values-es/arrays.xml
new file mode 100644
index 0000000..9d0d76b
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-es/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 segundos"</item>
+ <item msgid="8672738773876256432">"30 segundos"</item>
+ <item msgid="465923292941002466">"1 minuto"</item>
+ <item msgid="7955177189296850016">"2 minutos"</item>
+ <item msgid="1244255986255344525">"5 minutos"</item>
+ <item msgid="294890536998091748">"10 minutos"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-fa/arrays.xml b/overlay/packages/apps/Settings/res/values-fa/arrays.xml
new file mode 100644
index 0000000..bf95ca8
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-fa/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 ثانیه"</item>
+ <item msgid="8672738773876256432">"30 ثانیه"</item>
+ <item msgid="465923292941002466">"1 دقیقه"</item>
+ <item msgid="7955177189296850016">"2 دقیقه"</item>
+ <item msgid="1244255986255344525">"5 دقیقه"</item>
+ <item msgid="294890536998091748">"10 دقیقه"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-fi/arrays.xml b/overlay/packages/apps/Settings/res/values-fi/arrays.xml
new file mode 100644
index 0000000..7bf4c62
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-fi/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 sekuntia"</item>
+ <item msgid="8672738773876256432">"30 sekuntia"</item>
+ <item msgid="465923292941002466">"1 minuutti"</item>
+ <item msgid="7955177189296850016">"2 minuuttia"</item>
+ <item msgid="1244255986255344525">"5 minuuttia"</item>
+ <item msgid="294890536998091748">"10 minuuttia"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-fr/arrays.xml b/overlay/packages/apps/Settings/res/values-fr/arrays.xml
new file mode 100644
index 0000000..cb9e4ff
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-fr/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 secondes"</item>
+ <item msgid="8672738773876256432">"30 secondes"</item>
+ <item msgid="465923292941002466">"1 minute"</item>
+ <item msgid="7955177189296850016">"2 minutes"</item>
+ <item msgid="1244255986255344525">"5 minutes"</item>
+ <item msgid="294890536998091748">"10 minutes"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-hi/arrays.xml b/overlay/packages/apps/Settings/res/values-hi/arrays.xml
new file mode 100644
index 0000000..7c2f835
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-hi/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 सेकंड"</item>
+ <item msgid="8672738773876256432">"30 सेकंड"</item>
+ <item msgid="465923292941002466">"1 मिनट"</item>
+ <item msgid="7955177189296850016">"2 मिनट"</item>
+ <item msgid="1244255986255344525">"5 मिनट"</item>
+ <item msgid="294890536998091748">"10 मिनट"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-hr/arrays.xml b/overlay/packages/apps/Settings/res/values-hr/arrays.xml
new file mode 100644
index 0000000..5e0c117
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-hr/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 sekundi"</item>
+ <item msgid="8672738773876256432">"30 sekundi"</item>
+ <item msgid="465923292941002466">"1 minuta"</item>
+ <item msgid="7955177189296850016">"2 minute"</item>
+ <item msgid="1244255986255344525">"5 minuta"</item>
+ <item msgid="294890536998091748">"10 minuta"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-hu/arrays.xml b/overlay/packages/apps/Settings/res/values-hu/arrays.xml
new file mode 100644
index 0000000..208464e
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-hu/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 másodperc"</item>
+ <item msgid="8672738773876256432">"30 másodperc"</item>
+ <item msgid="465923292941002466">"1 perc"</item>
+ <item msgid="7955177189296850016">"2 perc"</item>
+ <item msgid="1244255986255344525">"5 perc"</item>
+ <item msgid="294890536998091748">"10 perc"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-in/arrays.xml b/overlay/packages/apps/Settings/res/values-in/arrays.xml
new file mode 100644
index 0000000..b3c4776
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-in/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 detik"</item>
+ <item msgid="8672738773876256432">"30 detik"</item>
+ <item msgid="465923292941002466">"1 menit"</item>
+ <item msgid="7955177189296850016">"2 menit"</item>
+ <item msgid="1244255986255344525">"5 menit"</item>
+ <item msgid="294890536998091748">"10 menit"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-it/arrays.xml b/overlay/packages/apps/Settings/res/values-it/arrays.xml
new file mode 100644
index 0000000..3d923d3
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-it/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 secondi"</item>
+ <item msgid="8672738773876256432">"30 secondi"</item>
+ <item msgid="465923292941002466">"1 minuto"</item>
+ <item msgid="7955177189296850016">"2 minuti"</item>
+ <item msgid="1244255986255344525">"5 minuti"</item>
+ <item msgid="294890536998091748">"10 minuti"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-iw/arrays.xml b/overlay/packages/apps/Settings/res/values-iw/arrays.xml
new file mode 100644
index 0000000..4a90801
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-iw/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 שניות"</item>
+ <item msgid="8672738773876256432">"30 שניות"</item>
+ <item msgid="465923292941002466">"דקה ×חת"</item>
+ <item msgid="7955177189296850016">"2 דקות"</item>
+ <item msgid="1244255986255344525">"5 דקות"</item>
+ <item msgid="294890536998091748">"10 דקות"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-ja/arrays.xml b/overlay/packages/apps/Settings/res/values-ja/arrays.xml
new file mode 100644
index 0000000..abde1bf
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-ja/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15秒"</item>
+ <item msgid="8672738773876256432">"30秒"</item>
+ <item msgid="465923292941002466">"1分"</item>
+ <item msgid="7955177189296850016">"2分"</item>
+ <item msgid="1244255986255344525">"5分"</item>
+ <item msgid="294890536998091748">"10分"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-ko/arrays.xml b/overlay/packages/apps/Settings/res/values-ko/arrays.xml
new file mode 100644
index 0000000..d2b686f
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-ko/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15ì´ˆ"</item>
+ <item msgid="8672738773876256432">"30ì´ˆ"</item>
+ <item msgid="465923292941002466">"1분"</item>
+ <item msgid="7955177189296850016">"2분"</item>
+ <item msgid="1244255986255344525">"5분"</item>
+ <item msgid="294890536998091748">"10분"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-lt/arrays.xml b/overlay/packages/apps/Settings/res/values-lt/arrays.xml
new file mode 100644
index 0000000..3028803
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-lt/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 sek."</item>
+ <item msgid="8672738773876256432">"30 sek."</item>
+ <item msgid="465923292941002466">"1 min."</item>
+ <item msgid="7955177189296850016">"2 min."</item>
+ <item msgid="1244255986255344525">"5 min."</item>
+ <item msgid="294890536998091748">"10 min."</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-lv/arrays.xml b/overlay/packages/apps/Settings/res/values-lv/arrays.xml
new file mode 100644
index 0000000..19ffffd
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-lv/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 sekundes"</item>
+ <item msgid="8672738773876256432">"30 sekundes"</item>
+ <item msgid="465923292941002466">"1 minūte"</item>
+ <item msgid="7955177189296850016">"2 minūtes"</item>
+ <item msgid="1244255986255344525">"5 minūtes"</item>
+ <item msgid="294890536998091748">"10 minūtes"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-ms/arrays.xml b/overlay/packages/apps/Settings/res/values-ms/arrays.xml
new file mode 100644
index 0000000..0f5b80d
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-ms/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 saat"</item>
+ <item msgid="8672738773876256432">"30 saat"</item>
+ <item msgid="465923292941002466">"1 minit"</item>
+ <item msgid="7955177189296850016">"2 minit"</item>
+ <item msgid="1244255986255344525">"5 minit"</item>
+ <item msgid="294890536998091748">"10 minit"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-nb/arrays.xml b/overlay/packages/apps/Settings/res/values-nb/arrays.xml
new file mode 100644
index 0000000..c5db781
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-nb/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 sekunder"</item>
+ <item msgid="8672738773876256432">"30 sekunder"</item>
+ <item msgid="465923292941002466">"Ett minutt"</item>
+ <item msgid="7955177189296850016">"To minutter"</item>
+ <item msgid="1244255986255344525">"Fem minutter"</item>
+ <item msgid="294890536998091748">"Ti minutter"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-nl/arrays.xml b/overlay/packages/apps/Settings/res/values-nl/arrays.xml
new file mode 100644
index 0000000..aa15318
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-nl/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 seconden"</item>
+ <item msgid="8672738773876256432">"30 seconden"</item>
+ <item msgid="465923292941002466">"1 minuut"</item>
+ <item msgid="7955177189296850016">"2 minuten"</item>
+ <item msgid="1244255986255344525">"5 minuten"</item>
+ <item msgid="294890536998091748">"10 minuten"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-pl/arrays.xml b/overlay/packages/apps/Settings/res/values-pl/arrays.xml
new file mode 100644
index 0000000..265da14
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-pl/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 sekund"</item>
+ <item msgid="8672738773876256432">"30 sekund"</item>
+ <item msgid="465923292941002466">"1 minuta"</item>
+ <item msgid="7955177189296850016">"2 minuty"</item>
+ <item msgid="1244255986255344525">"5 minut"</item>
+ <item msgid="294890536998091748">"10 minut"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-pt-rPT/arrays.xml b/overlay/packages/apps/Settings/res/values-pt-rPT/arrays.xml
new file mode 100644
index 0000000..9d0d76b
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-pt-rPT/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 segundos"</item>
+ <item msgid="8672738773876256432">"30 segundos"</item>
+ <item msgid="465923292941002466">"1 minuto"</item>
+ <item msgid="7955177189296850016">"2 minutos"</item>
+ <item msgid="1244255986255344525">"5 minutos"</item>
+ <item msgid="294890536998091748">"10 minutos"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-pt/arrays.xml b/overlay/packages/apps/Settings/res/values-pt/arrays.xml
new file mode 100644
index 0000000..1e00250
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-pt/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 segundos"</item>
+ <item msgid="8672738773876256432">"30 segundos"</item>
+ <item msgid="465923292941002466">"Um minuto"</item>
+ <item msgid="7955177189296850016">"Dois minutos"</item>
+ <item msgid="1244255986255344525">"Cinco minutos"</item>
+ <item msgid="294890536998091748">"10 minutos"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-ro/arrays.xml b/overlay/packages/apps/Settings/res/values-ro/arrays.xml
new file mode 100644
index 0000000..903ea72
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-ro/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 secunde"</item>
+ <item msgid="8672738773876256432">"30 de secunde"</item>
+ <item msgid="465923292941002466">"1 minut"</item>
+ <item msgid="7955177189296850016">"2 minute"</item>
+ <item msgid="1244255986255344525">"5 minute"</item>
+ <item msgid="294890536998091748">"10 minute"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-ru/arrays.xml b/overlay/packages/apps/Settings/res/values-ru/arrays.xml
new file mode 100644
index 0000000..b4d5e6e
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-ru/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 Ñекунд"</item>
+ <item msgid="8672738773876256432">"30 Ñекунд"</item>
+ <item msgid="465923292941002466">"1 минута"</item>
+ <item msgid="7955177189296850016">"2 минуты"</item>
+ <item msgid="1244255986255344525">"5 минут"</item>
+ <item msgid="294890536998091748">"10 минут"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-sk/arrays.xml b/overlay/packages/apps/Settings/res/values-sk/arrays.xml
new file mode 100644
index 0000000..f6ffc42
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-sk/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 s"</item>
+ <item msgid="8672738773876256432">"30 s"</item>
+ <item msgid="465923292941002466">"1 min."</item>
+ <item msgid="7955177189296850016">"2 min."</item>
+ <item msgid="1244255986255344525">"5 min."</item>
+ <item msgid="294890536998091748">"10 min."</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-sl/arrays.xml b/overlay/packages/apps/Settings/res/values-sl/arrays.xml
new file mode 100644
index 0000000..c660d19
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-sl/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 s"</item>
+ <item msgid="8672738773876256432">"30 s"</item>
+ <item msgid="465923292941002466">"1 min"</item>
+ <item msgid="7955177189296850016">"2 min"</item>
+ <item msgid="1244255986255344525">"5 min"</item>
+ <item msgid="294890536998091748">"10 min"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-sr/arrays.xml b/overlay/packages/apps/Settings/res/values-sr/arrays.xml
new file mode 100644
index 0000000..bea8b75
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-sr/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 Ñекунди"</item>
+ <item msgid="8672738773876256432">"30 Ñекунди"</item>
+ <item msgid="465923292941002466">"1 минут"</item>
+ <item msgid="7955177189296850016">"2 минута"</item>
+ <item msgid="1244255986255344525">"5 минута"</item>
+ <item msgid="294890536998091748">"10 минута"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-sv/arrays.xml b/overlay/packages/apps/Settings/res/values-sv/arrays.xml
new file mode 100644
index 0000000..c28821f
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-sv/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 sekunder"</item>
+ <item msgid="8672738773876256432">"30 sekunder"</item>
+ <item msgid="465923292941002466">"1 minut"</item>
+ <item msgid="7955177189296850016">"2 minuter"</item>
+ <item msgid="1244255986255344525">"5 minuter"</item>
+ <item msgid="294890536998091748">"10 minuter"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-sw/arrays.xml b/overlay/packages/apps/Settings/res/values-sw/arrays.xml
new file mode 100644
index 0000000..1eda2bd
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-sw/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"Sekunde 15"</item>
+ <item msgid="8672738773876256432">"sekunde 30"</item>
+ <item msgid="465923292941002466">"Dakika 1"</item>
+ <item msgid="7955177189296850016">"Dakika 2"</item>
+ <item msgid="1244255986255344525">"Dakika 5"</item>
+ <item msgid="294890536998091748">"Dakika 10"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-th/arrays.xml b/overlay/packages/apps/Settings/res/values-th/arrays.xml
new file mode 100644
index 0000000..0a62eb2
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-th/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 วินาที"</item>
+ <item msgid="8672738773876256432">"30 วินาที"</item>
+ <item msgid="465923292941002466">"1 นาที"</item>
+ <item msgid="7955177189296850016">"2 นาที"</item>
+ <item msgid="1244255986255344525">"5 นาที"</item>
+ <item msgid="294890536998091748">"10 นาที"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-tl/arrays.xml b/overlay/packages/apps/Settings/res/values-tl/arrays.xml
new file mode 100644
index 0000000..f6eed62
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-tl/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 segundo"</item>
+ <item msgid="8672738773876256432">"30 segundo"</item>
+ <item msgid="465923292941002466">"1 minuto"</item>
+ <item msgid="7955177189296850016">"2 minuto"</item>
+ <item msgid="1244255986255344525">"5 minuto"</item>
+ <item msgid="294890536998091748">"10 minuto"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-tr/arrays.xml b/overlay/packages/apps/Settings/res/values-tr/arrays.xml
new file mode 100644
index 0000000..4c0aecc
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-tr/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 saniye"</item>
+ <item msgid="8672738773876256432">"30 saniye"</item>
+ <item msgid="465923292941002466">"1 dakika"</item>
+ <item msgid="7955177189296850016">"2 dakika"</item>
+ <item msgid="1244255986255344525">"5 dakika"</item>
+ <item msgid="294890536998091748">"10 dakika"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-uk/arrays.xml b/overlay/packages/apps/Settings/res/values-uk/arrays.xml
new file mode 100644
index 0000000..3406602
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-uk/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 Ñекунд"</item>
+ <item msgid="8672738773876256432">"30 Ñекунд"</item>
+ <item msgid="465923292941002466">"1 хвилина"</item>
+ <item msgid="7955177189296850016">"2 хвилини"</item>
+ <item msgid="1244255986255344525">"5 хвилин"</item>
+ <item msgid="294890536998091748">"10 хвилин"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-vi/arrays.xml b/overlay/packages/apps/Settings/res/values-vi/arrays.xml
new file mode 100644
index 0000000..c6de6bd
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-vi/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 giây"</item>
+ <item msgid="8672738773876256432">"30 giây"</item>
+ <item msgid="465923292941002466">"1 phút"</item>
+ <item msgid="7955177189296850016">"2 phút"</item>
+ <item msgid="1244255986255344525">"5 phút"</item>
+ <item msgid="294890536998091748">"10 phuÌt"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-zh-rCN/arrays.xml b/overlay/packages/apps/Settings/res/values-zh-rCN/arrays.xml
new file mode 100644
index 0000000..cb28ca4
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-zh-rCN/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 秒"</item>
+ <item msgid="8672738773876256432">"30 秒"</item>
+ <item msgid="465923292941002466">"1 分钟"</item>
+ <item msgid="7955177189296850016">"2 分钟"</item>
+ <item msgid="1244255986255344525">"5 分钟"</item>
+ <item msgid="294890536998091748">"10 分钟"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-zh-rTW/arrays.xml b/overlay/packages/apps/Settings/res/values-zh-rTW/arrays.xml
new file mode 100644
index 0000000..eb9329b
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-zh-rTW/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"15 秒"</item>
+ <item msgid="8672738773876256432">"30 秒"</item>
+ <item msgid="465923292941002466">"1 分é˜"</item>
+ <item msgid="7955177189296850016">"2 分é˜"</item>
+ <item msgid="1244255986255344525">"5 分é˜"</item>
+ <item msgid="294890536998091748">"10 分é˜"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values-zu/arrays.xml b/overlay/packages/apps/Settings/res/values-zu/arrays.xml
new file mode 100644
index 0000000..e675fbb
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values-zu/arrays.xml
@@ -0,0 +1,31 @@
+<?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.
+*/
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="screen_timeout_entries">
+ <item msgid="5314770629356662739">"Imizuzwana engu-15"</item>
+ <item msgid="8672738773876256432">"30 amasekhondi"</item>
+ <item msgid="465923292941002466">"1 iminithi"</item>
+ <item msgid="7955177189296850016">"2 amaminithi"</item>
+ <item msgid="1244255986255344525">"5 amaminithii"</item>
+ <item msgid="294890536998091748">"10 amaminithi"</item>
+ </string-array>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values/arrays.xml b/overlay/packages/apps/Settings/res/values/arrays.xml
new file mode 100644
index 0000000..3b47031
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values/arrays.xml
@@ -0,0 +1,46 @@
+<?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.
+*/
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- Display settings. The delay in inactivity before the screen is turned off. These are shown in a list dialog. -->
+ <string-array name="screen_timeout_entries">
+ <item msgid="3342301044271143016">15 seconds</item>
+ <item msgid="8881760709354815449">30 seconds</item>
+ <item msgid="7589406073232279088">1 minute</item>
+ <item msgid="7001195990902244174">2 minutes</item>
+ <item msgid="7489864775127957179">5 minutes</item>
+ <item msgid="2314124409517439288">10 minutes</item>
+ </string-array>
+
+ <!-- Do not translate. -->
+ <string-array name="screen_timeout_values" translatable="false">
+ <!-- Do not translate. -->
+ <item>15000</item>
+ <!-- Do not translate. -->
+ <item>30000</item>
+ <!-- Do not translate. -->
+ <item>60000</item>
+ <!-- Do not translate. -->
+ <item>120000</item>
+ <!-- Do not translate. -->
+ <item>300000</item>
+ <!-- Do not translate. -->
+ <item>600000</item>
+ </string-array>
+</resources>
diff --git a/recovery.fstab b/recovery.fstab
new file mode 100644
index 0000000..78624dc
--- /dev/null
+++ b/recovery.fstab
@@ -0,0 +1,13 @@
+# mount point fstype device
+
+/boot emmc /dev/block/mmcblk0p5
+/recovery emmc /dev/block/mmcblk0p6
+
+/efs ext4 /dev/block/mmcblk0p1
+/cache ext4 /dev/block/mmcblk0p7
+/system ext4 /dev/block/mmcblk0p9
+/data ext4 /dev/block/mmcblk0p10
+/preload ext4 /dev/block/mmcblk0p12
+
+/sdcard vfat /dev/block/mmcblk0p11
+/emmc vfat /dev/block/mmcblk1p1
diff --git a/recovery.rc b/recovery.rc
new file mode 100644
index 0000000..81cd283
--- /dev/null
+++ b/recovery.rc
@@ -0,0 +1,71 @@
+on early-init
+ start ueventd
+
+on init
+ export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
+ export ANDROID_ROOT /system
+ export ANDROID_DATA /data
+ export EXTERNAL_STORAGE /sdcard
+
+ symlink /system/etc /etc
+
+ mkdir /sdcard
+ mkdir /emmc
+ mkdir /usbdisk
+ mkdir /system
+ mkdir /data
+ mkdir /cache
+ mkdir /preload
+ mount /tmp /tmp tmpfs
+
+on fs
+ mount ext4 /dev/block/mmcblk0p9 /system
+
+on boot
+
+# Permissions for mDNIe
+ chown system media_rw /sys/class/mdnie/mdnie/mode
+ chown system media_rw /sys/class/mdnie/mdnie/outdoor
+ chown system media_rw /sys/class/mdnie/mdnie/scenario
+ write /sys/class/mdnie/mdnie/scenario 4
+
+ ifup lo
+ hostname localhost
+ domainname localdomain
+
+ class_start default
+
+service ueventd /sbin/ueventd
+ critical
+
+service console /sbin/sh
+ class core
+ console
+ disabled
+ group log
+
+on property:ro.debuggable=1
+ start console
+
+service recovery /sbin/recovery
+
+service adbd /sbin/adbd recovery
+ disabled
+
+# Always start adbd on userdebug and eng builds
+on property:ro.debuggable=1
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 04e8
+ write /sys/class/android_usb/android0/idProduct 6860
+ write /sys/class/android_usb/android0/functions adb
+ write /sys/class/android_usb/android0/enable 1
+ 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
+ start adbd
+
+# Restart adbd so it can run as root
+on property:service.adb.root=1
+ write /sys/class/android_usb/android0/enable 0
+ restart adbd
+ write /sys/class/android_usb/android0/enable 1
diff --git a/recovery/graphics.c b/recovery/graphics.c
new file mode 100644
index 0000000..87e4e29
--- /dev/null
+++ b/recovery/graphics.c
@@ -0,0 +1,353 @@
+/*
+ * Copyright (C) 2007 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.
+ */
+
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <fcntl.h>
+#include <stdio.h>
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <sys/types.h>
+
+#include <linux/fb.h>
+#include <linux/kd.h>
+
+#include <pixelflinger/pixelflinger.h>
+
+#ifndef BOARD_LDPI_RECOVERY
+ #include "font_10x18.h"
+#else
+ #include "font_7x16.h"
+#endif
+
+#include "minui.h"
+
+typedef struct {
+ GGLSurface texture;
+ unsigned cwidth;
+ unsigned cheight;
+ unsigned ascent;
+} GRFont;
+
+static GRFont *gr_font = 0;
+static GGLContext *gr_context = 0;
+static GGLSurface gr_font_texture;
+static GGLSurface gr_framebuffer[2];
+static GGLSurface gr_mem_surface;
+static unsigned gr_active_fb = 0;
+
+static int gr_fb_fd = -1;
+static int gr_vt_fd = -1;
+
+static struct fb_var_screeninfo vi;
+
+static int get_framebuffer(GGLSurface *fb)
+{
+ int fd;
+ struct fb_fix_screeninfo fi;
+ void *bits;
+
+ fd = open("/dev/graphics/fb0", O_RDWR);
+ if (fd < 0) {
+ perror("cannot open fb0");
+ return -1;
+ }
+
+ if (ioctl(fd, FBIOGET_FSCREENINFO, &fi) < 0) {
+ perror("failed to get fb0 info");
+ close(fd);
+ return -1;
+ }
+
+ if (ioctl(fd, FBIOGET_VSCREENINFO, &vi) < 0) {
+ perror("failed to get fb0 info");
+ close(fd);
+ return -1;
+ }
+
+ bits = mmap(0, fi.smem_len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+ if (bits == MAP_FAILED) {
+ perror("failed to mmap framebuffer");
+ close(fd);
+ return -1;
+ }
+
+ fb->version = sizeof(*fb);
+ fb->width = vi.xres;
+ fb->height = vi.yres;
+#ifdef BOARD_HAS_JANKY_BACKBUFFER
+ fb->stride = fi.line_length/2;
+#else
+ fb->stride = vi.xres;
+#endif
+ fb->data = bits;
+ fb->format = GGL_PIXEL_FORMAT_RGB_565;
+ memset(fb->data, 0, vi.yres * vi.xres * 2);
+
+ fb++;
+
+ fb->version = sizeof(*fb);
+ fb->width = vi.xres;
+ fb->height = vi.yres;
+#ifdef BOARD_HAS_JANKY_BACKBUFFER
+ fb->stride = fi.line_length/2;
+ fb->data = (void*) (((unsigned) bits) + vi.yres * fi.line_length);
+#else
+ fb->stride = vi.xres;
+ fb->data = (void*) (((unsigned) bits) + vi.yres * vi.xres * 2);
+#endif
+ fb->format = GGL_PIXEL_FORMAT_RGB_565;
+ memset(fb->data, 0, vi.yres * vi.xres * 2);
+
+ return fd;
+}
+
+static void get_memory_surface(GGLSurface* ms) {
+ ms->version = sizeof(*ms);
+ ms->width = vi.xres;
+ ms->height = vi.yres;
+ ms->stride = vi.xres;
+ ms->data = malloc(vi.xres * vi.yres * 2);
+ ms->format = GGL_PIXEL_FORMAT_RGB_565;
+}
+
+static void set_active_framebuffer(unsigned n)
+{
+ if (n > 1) return;
+ vi.yres_virtual = vi.yres * 2;
+ vi.yoffset = n * vi.yres;
+ vi.bits_per_pixel = 16;
+ if (ioctl(gr_fb_fd, FBIOPUT_VSCREENINFO, &vi) < 0) {
+ perror("active fb swap failed");
+ }
+}
+
+void gr_flip(void)
+{
+ GGLContext *gl = gr_context;
+
+ /* swap front and back buffers */
+ gr_active_fb = (gr_active_fb + 1) & 1;
+
+#ifdef BOARD_HAS_FLIPPED_SCREEN
+ /* flip buffer 180 degrees for devices with physicaly inverted screens */
+ unsigned int i;
+ for (i = 1; i < (vi.xres * vi.yres); i++) {
+ unsigned short tmp = gr_mem_surface.data[i];
+ gr_mem_surface.data[i] = gr_mem_surface.data[(vi.xres * vi.yres * 2) - i];
+ gr_mem_surface.data[(vi.xres * vi.yres * 2) - i] = tmp;
+ }
+#endif
+
+ /* copy data from the in-memory surface to the buffer we're about
+ * to make active. */
+ memcpy(gr_framebuffer[gr_active_fb].data, gr_mem_surface.data,
+ vi.xres * vi.yres * 2);
+
+ /* inform the display driver */
+ set_active_framebuffer(gr_active_fb);
+}
+
+void gr_color(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
+{
+ GGLContext *gl = gr_context;
+ GGLint color[4];
+ color[0] = ((r << 8) | r) + 1;
+ color[1] = ((g << 8) | g) + 1;
+ color[2] = ((b << 8) | b) + 1;
+ color[3] = ((a << 8) | a) + 1;
+ gl->color4xv(gl, color);
+}
+
+int gr_measure(const char *s)
+{
+ return gr_font->cwidth * strlen(s);
+}
+
+void gr_font_size(int *x, int *y)
+{
+ *x = gr_font->cwidth;
+ *y = gr_font->cheight;
+}
+
+int gr_text(int x, int y, const char *s)
+{
+ GGLContext *gl = gr_context;
+ GRFont *font = gr_font;
+ unsigned off;
+
+ y -= font->ascent;
+
+ gl->bindTexture(gl, &font->texture);
+ gl->texEnvi(gl, GGL_TEXTURE_ENV, GGL_TEXTURE_ENV_MODE, GGL_REPLACE);
+ gl->texGeni(gl, GGL_S, GGL_TEXTURE_GEN_MODE, GGL_ONE_TO_ONE);
+ gl->texGeni(gl, GGL_T, GGL_TEXTURE_GEN_MODE, GGL_ONE_TO_ONE);
+ gl->enable(gl, GGL_TEXTURE_2D);
+
+ while((off = *s++)) {
+ off -= 32;
+ if (off < 96) {
+ gl->texCoord2i(gl, (off * font->cwidth) - x, 0 - y);
+ gl->recti(gl, x, y, x + font->cwidth, y + font->cheight);
+ }
+ x += font->cwidth;
+ }
+
+ return x;
+}
+
+void gr_fill(int x, int y, int w, int h)
+{
+ GGLContext *gl = gr_context;
+ gl->disable(gl, GGL_TEXTURE_2D);
+ gl->recti(gl, x, y, w, h);
+}
+
+void gr_blit(gr_surface source, int sx, int sy, int w, int h, int dx, int dy) {
+ if (gr_context == NULL) {
+ return;
+ }
+ GGLContext *gl = gr_context;
+
+ gl->bindTexture(gl, (GGLSurface*) source);
+ gl->texEnvi(gl, GGL_TEXTURE_ENV, GGL_TEXTURE_ENV_MODE, GGL_REPLACE);
+ gl->texGeni(gl, GGL_S, GGL_TEXTURE_GEN_MODE, GGL_ONE_TO_ONE);
+ gl->texGeni(gl, GGL_T, GGL_TEXTURE_GEN_MODE, GGL_ONE_TO_ONE);
+ gl->enable(gl, GGL_TEXTURE_2D);
+ gl->texCoord2i(gl, sx - dx, sy - dy);
+ gl->recti(gl, dx, dy, dx + w, dy + h);
+}
+
+unsigned int gr_get_width(gr_surface surface) {
+ if (surface == NULL) {
+ return 0;
+ }
+ return ((GGLSurface*) surface)->width;
+}
+
+unsigned int gr_get_height(gr_surface surface) {
+ if (surface == NULL) {
+ return 0;
+ }
+ return ((GGLSurface*) surface)->height;
+}
+
+static void gr_init_font(void)
+{
+ GGLSurface *ftex;
+ unsigned char *bits, *rle;
+ unsigned char *in, data;
+
+ gr_font = calloc(sizeof(*gr_font), 1);
+ ftex = &gr_font->texture;
+
+ bits = malloc(font.width * font.height);
+
+ ftex->version = sizeof(*ftex);
+ ftex->width = font.width;
+ ftex->height = font.height;
+ ftex->stride = font.width;
+ ftex->data = (void*) bits;
+ ftex->format = GGL_PIXEL_FORMAT_A_8;
+
+ in = font.rundata;
+ while((data = *in++)) {
+ memset(bits, (data & 0x80) ? 255 : 0, data & 0x7f);
+ bits += (data & 0x7f);
+ }
+
+ gr_font->cwidth = font.cwidth;
+ gr_font->cheight = font.cheight;
+ gr_font->ascent = font.cheight - 2;
+}
+
+int gr_init(void)
+{
+ gglInit(&gr_context);
+ GGLContext *gl = gr_context;
+
+ gr_init_font();
+ gr_vt_fd = open("/dev/tty0", O_RDWR | O_SYNC);
+ if (gr_vt_fd < 0) {
+ // This is non-fatal; post-Cupcake kernels don't have tty0.
+ perror("can't open /dev/tty0");
+ } else if (ioctl(gr_vt_fd, KDSETMODE, (void*) KD_GRAPHICS)) {
+ // However, if we do open tty0, we expect the ioctl to work.
+ perror("failed KDSETMODE to KD_GRAPHICS on tty0");
+ gr_exit();
+ return -1;
+ }
+
+ gr_fb_fd = get_framebuffer(gr_framebuffer);
+ if (gr_fb_fd < 0) {
+ gr_exit();
+ return -1;
+ }
+
+ get_memory_surface(&gr_mem_surface);
+
+ fprintf(stderr, "framebuffer: fd %d (%d x %d)\n",
+ gr_fb_fd, gr_framebuffer[0].width, gr_framebuffer[0].height);
+
+ /* start with 0 as front (displayed) and 1 as back (drawing) */
+ gr_active_fb = 0;
+ set_active_framebuffer(0);
+ gl->colorBuffer(gl, &gr_mem_surface);
+
+ gl->activeTexture(gl, 0);
+ gl->enable(gl, GGL_BLEND);
+ gl->blendFunc(gl, GGL_SRC_ALPHA, GGL_ONE_MINUS_SRC_ALPHA);
+
+ return 0;
+}
+
+void gr_exit(void)
+{
+ close(gr_fb_fd);
+ gr_fb_fd = -1;
+
+ free(gr_mem_surface.data);
+
+ ioctl(gr_vt_fd, KDSETMODE, (void*) KD_TEXT);
+ close(gr_vt_fd);
+ gr_vt_fd = -1;
+}
+
+int gr_fb_width(void)
+{
+ return gr_framebuffer[0].width;
+}
+
+int gr_fb_height(void)
+{
+ return gr_framebuffer[0].height;
+}
+
+gr_pixel *gr_fb_data(void)
+{
+ return (unsigned short *) gr_mem_surface.data;
+}
+
+void gr_fb_blank(bool blank)
+{
+ int ret;
+
+ ret = ioctl(gr_fb_fd, FBIOBLANK, blank ? FB_BLANK_POWERDOWN : FB_BLANK_UNBLANK);
+ if (ret < 0)
+ perror("ioctl(): blank");
+}
diff --git a/recovery/recovery_keys.c b/recovery/recovery_keys.c
new file mode 100644
index 0000000..528a796
--- /dev/null
+++ b/recovery/recovery_keys.c
@@ -0,0 +1,62 @@
+#include <linux/input.h>
+
+#include "recovery_ui.h"
+#include "common.h"
+#include "extendedcommands.h"
+
+
+int device_toggle_display(volatile char* key_pressed, int key_code) {
+ int alt = key_pressed[KEY_LEFTALT] || key_pressed[KEY_RIGHTALT];
+ if (alt && key_code == KEY_L)
+ return 1;
+ // allow toggling of the display if the correct key is pressed, and the display toggle is allowed or the display is currently off
+ if (ui_get_showing_back_button()) {
+ return 0;
+ //return get_allow_toggle_display() && (key_code == KEY_HOME || key_code == KEY_MENU || key_code == KEY_END);
+ }
+ return get_allow_toggle_display() && (key_code == KEY_HOMEPAGE || key_code == KEY_MENU || key_code == KEY_POWER || key_code == KEY_END);
+}
+
+int device_handle_key(int key_code, int visible) {
+ if (visible) {
+ switch (key_code) {
+ case KEY_CAPSLOCK:
+ case KEY_DOWN:
+ case KEY_VOLUMEDOWN:
+ return HIGHLIGHT_DOWN;
+ case KEY_MENU:
+ return NO_ACTION;
+ case KEY_LEFTSHIFT:
+ case KEY_UP:
+ case KEY_VOLUMEUP:
+ return HIGHLIGHT_UP;
+ case KEY_HOMEPAGE:
+ if (ui_get_showing_back_button()) {
+ return SELECT_ITEM;
+ }
+ if (!get_allow_toggle_display())
+ return GO_BACK;
+ break;
+ case KEY_POWER:
+ if (ui_get_showing_back_button()) {
+ return SELECT_ITEM;
+ }
+ if (!get_allow_toggle_display())
+ return GO_BACK;
+ break;
+ case KEY_LEFTBRACE:
+ case KEY_ENTER:
+ case BTN_MOUSE:
+ case KEY_CAMERA:
+ case KEY_F21:
+ case KEY_SEND:
+ case KEY_END:
+ case KEY_BACKSPACE:
+ case KEY_SEARCH:
+ case KEY_BACK:
+ return GO_BACK;
+ }
+ }
+
+ return NO_ACTION;
+}
diff --git a/releasetools/galaxys2_common.py b/releasetools/galaxys2_common.py
new file mode 100755
index 0000000..93f1b8e
--- /dev/null
+++ b/releasetools/galaxys2_common.py
@@ -0,0 +1,31 @@
+#
+# Copyright (C) 2008 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.
+
+import os, sys
+
+LOCAL_DIR = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
+RELEASETOOLS_DIR = os.path.abspath(os.path.join(LOCAL_DIR, '../../../build/tools/releasetools'))
+
+# Add releasetools directory to python path
+sys.path.append(RELEASETOOLS_DIR)
+
+from common import *
+
+def load_module_from_file(module_name, filename):
+ import imp
+ f = open(filename, 'r')
+ module = imp.load_module(module_name, f, filename, ('', 'U', 1))
+ f.close()
+ return module
diff --git a/releasetools/galaxys2_edify_generator.py b/releasetools/galaxys2_edify_generator.py
new file mode 100755
index 0000000..95bdf48
--- /dev/null
+++ b/releasetools/galaxys2_edify_generator.py
@@ -0,0 +1,46 @@
+#
+# Copyright (C) 2008 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.
+
+import os, sys
+
+LOCAL_DIR = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
+RELEASETOOLS_DIR = os.path.abspath(os.path.join(LOCAL_DIR, '../../../build/tools/releasetools'))
+
+import edify_generator
+
+class EdifyGenerator(edify_generator.EdifyGenerator):
+ def UnpackPackageFile(self, src, dst):
+ """Unpack a given file from the OTA package into the given
+ destination file."""
+ self.script.append('package_extract_file("%s", "%s");' % (src, dst))
+
+ def EMMCWriteRawImage(self, partition, image):
+ """Write the given package file into the given partition."""
+
+ args = {'partition': partition, 'image': image}
+
+ self.script.append(
+ ('assert(package_extract_file("%(image)s", "/tmp/%(image)s"),\n'
+ ' write_raw_image("/tmp/%(image)s", "%(partition)s"),\n'
+ ' delete("/tmp/%(image)s"));') % args)
+
+ def Unmount(self, mount_point):
+ """Unmount the partition with the given mount_point."""
+ fstab = self.info.get("fstab", None)
+ if fstab:
+ p = fstab[mount_point]
+ self.script.append('unmount("%s");' %
+ (p.mount_point))
+ self.mounts.add(p.mount_point)
diff --git a/releasetools/galaxys2_img_from_target_files b/releasetools/galaxys2_img_from_target_files
new file mode 100755
index 0000000..240de1b
--- /dev/null
+++ b/releasetools/galaxys2_img_from_target_files
@@ -0,0 +1,185 @@
+#!/usr/bin/env python
+#
+# Copyright (C) 2008 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.
+
+"""
+Given a target-files zipfile, produces an image zipfile suitable for
+use with 'fastboot update'.
+
+Usage: img_from_target_files [flags] input_target_files output_image_zip
+
+ -b (--board_config) <file>
+ Deprecated.
+
+"""
+
+import sys
+
+if sys.hexversion < 0x02040000:
+ print >> sys.stderr, "Python 2.4 or newer is required."
+ sys.exit(1)
+
+import errno
+import os
+import re
+import shutil
+import subprocess
+import tempfile
+import zipfile
+
+# missing in Python 2.4 and before
+if not hasattr(os, "SEEK_SET"):
+ os.SEEK_SET = 0
+
+import galaxys2_common as common
+
+OPTIONS = common.OPTIONS
+
+def AddUserdata(output_zip):
+ """Create an empty userdata image and store it in output_zip."""
+
+ print "creating userdata.img..."
+
+ # The name of the directory it is making an image out of matters to
+ # mkyaffs2image. So we create a temp dir, and within it we create an
+ # empty dir named "data", and build the image from that.
+ temp_dir = tempfile.mkdtemp()
+ user_dir = os.path.join(temp_dir, "data")
+ os.mkdir(user_dir)
+ img = tempfile.NamedTemporaryFile()
+
+ build_command = []
+ if OPTIONS.info_dict["fstab"]["/data"].fs_type.startswith("ext"):
+ build_command = ["mkuserimg.sh",
+ user_dir, img.name,
+ OPTIONS.info_dict["fstab"]["/data"].fs_type, "data"]
+ if "userdata_size" in OPTIONS.info_dict:
+ build_command.append(str(OPTIONS.info_dict["userdata_size"]))
+ else:
+ build_command = ["mkyaffs2image", "-f"]
+ extra = OPTIONS.info_dict.get("mkyaffs2_extra_flags", None)
+ if extra:
+ build_command.extend(extra.split())
+ build_command.append(user_dir)
+ build_command.append(img.name)
+
+ p = common.Run(build_command)
+ p.communicate()
+ assert p.returncode == 0, "build userdata.img image failed"
+
+ common.CheckSize(img.name, "userdata.img", OPTIONS.info_dict)
+ output_zip.write(img.name, "userdata.img")
+ img.close()
+ os.rmdir(user_dir)
+ os.rmdir(temp_dir)
+
+
+def AddSystem(output_zip):
+ """Turn the contents of SYSTEM into a system image and store it in
+ output_zip."""
+
+ print "creating system.img..."
+
+ img = tempfile.NamedTemporaryFile()
+
+ # The name of the directory it is making an image out of matters to
+ # mkyaffs2image. It wants "system" but we have a directory named
+ # "SYSTEM", so create a symlink.
+ try:
+ os.symlink(os.path.join(OPTIONS.input_tmp, "SYSTEM"),
+ os.path.join(OPTIONS.input_tmp, "system"))
+ except OSError, e:
+ if (e.errno == errno.EEXIST):
+ pass
+
+ build_command = []
+ if OPTIONS.info_dict["fstab"]["/system"].fs_type.startswith("ext"):
+ build_command = ["mkuserimg.sh",
+ os.path.join(OPTIONS.input_tmp, "system"), img.name,
+ OPTIONS.info_dict["fstab"]["/system"].fs_type, "system"]
+ if "system_size" in OPTIONS.info_dict:
+ build_command.append(str(OPTIONS.info_dict["system_size"]))
+ else:
+ build_command = ["mkyaffs2image", "-f"]
+ extra = OPTIONS.info_dict.get("mkyaffs2_extra_flags", None)
+ if extra:
+ build_command.extend(extra.split())
+ build_command.append(os.path.join(OPTIONS.input_tmp, "system"))
+ build_command.append(img.name)
+
+ p = common.Run(build_command)
+ p.communicate()
+ assert p.returncode == 0, "build system.img image failed"
+
+ img.seek(os.SEEK_SET, 0)
+ data = img.read()
+ img.close()
+
+ common.CheckSize(data, "system.img", OPTIONS.info_dict)
+ common.ZipWriteStr(output_zip, "system.img", data)
+
+
+def CopyInfo(output_zip):
+ """Copy the android-info.txt file from the input to the output."""
+ output_zip.write(os.path.join(OPTIONS.input_tmp, "OTA", "android-info.txt"),
+ "android-info.txt")
+
+
+def main(argv):
+
+ def option_handler(o, a):
+ if o in ("-b", "--board_config"):
+ pass # deprecated
+ else:
+ return False
+ return True
+
+ args = common.ParseOptions(argv, __doc__,
+ extra_opts="b:",
+ extra_long_opts=["board_config="],
+ extra_option_handler=option_handler)
+
+ if len(args) != 2:
+ common.Usage(__doc__)
+ sys.exit(1)
+
+ OPTIONS.input_tmp = common.UnzipTemp(args[0])
+
+ input_zip = zipfile.ZipFile(args[0], "r")
+ OPTIONS.info_dict = common.LoadInfoDict(input_zip)
+
+ output_zip = zipfile.ZipFile(args[1], "w", compression=zipfile.ZIP_DEFLATED)
+
+ common.AddBoot(output_zip, OPTIONS.info_dict)
+ common.AddRecovery(output_zip, OPTIONS.info_dict)
+ AddSystem(output_zip)
+ AddUserdata(output_zip)
+ CopyInfo(output_zip)
+
+ print "cleaning up..."
+ output_zip.close()
+ shutil.rmtree(OPTIONS.input_tmp)
+
+ print "done."
+
+
+if __name__ == '__main__':
+ try:
+ main(sys.argv[1:])
+ except common.ExternalError, e:
+ print
+ print " ERROR: %s" % (e,)
+ print
+ sys.exit(1)
diff --git a/releasetools/galaxys2_ota_from_target_files b/releasetools/galaxys2_ota_from_target_files
new file mode 100755
index 0000000..e7cf28a
--- /dev/null
+++ b/releasetools/galaxys2_ota_from_target_files
@@ -0,0 +1,122 @@
+#!/usr/bin/env python
+#
+# Copyright (C) 2008 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.
+
+import sys
+import os
+import galaxys2_common as common
+
+LOCAL_DIR = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
+RELEASETOOLS_DIR = os.path.abspath(os.path.join(LOCAL_DIR, '../../../build/tools/releasetools'))
+TARGET_DIR = os.getenv('OUT')
+
+# Add releasetools directory to python path
+sys.path.append(RELEASETOOLS_DIR)
+
+# Import the existing file so we just have to rewrite the modules we need.
+# This is a nasty hack as the filename doesn't end in .py, but it works
+filename = os.path.join(RELEASETOOLS_DIR, "ota_from_target_files")
+ota_from_target_files = common.load_module_from_file('ota_from_target_files', filename)
+
+from ota_from_target_files import *
+import galaxys2_edify_generator as edify_generator
+
+__doc__ = ota_from_target_files.__doc__
+
+def CopyBootFiles(input_zip, output_zip):
+ output_zip.write(os.path.join(TARGET_DIR, "boot.img"),"boot.img")
+
+def WriteFullOTAPackage(input_zip, output_zip):
+ # TODO: how to determine this? We don't know what version it will
+ # be installed on top of. For now, we expect the API just won't
+ # change very often.
+ script = edify_generator.EdifyGenerator(3, OPTIONS.info_dict)
+
+ metadata = {"post-build": GetBuildProp("ro.build.fingerprint", input_zip),
+ "pre-device": GetBuildProp("ro.product.device", input_zip),
+ "post-timestamp": GetBuildProp("ro.build.date.utc", input_zip),
+ }
+
+ device_specific = common.DeviceSpecificParams(
+ input_zip=input_zip,
+ input_version=OPTIONS.info_dict["recovery_api_version"],
+ output_zip=output_zip,
+ script=script,
+ input_tmp=OPTIONS.input_tmp,
+ metadata=metadata,
+ info_dict=OPTIONS.info_dict)
+
+ AppendAssertions(script, input_zip)
+ device_specific.FullOTA_Assertions()
+ if OPTIONS.backuptool:
+ script.RunBackup("backup")
+
+ script.ShowProgress(0.5, 0)
+
+ if OPTIONS.wipe_user_data:
+ script.FormatPartition("/data")
+
+ script.Unmount("/system")
+ script.FormatPartition("/system")
+ script.Mount("/system")
+ script.UnpackPackageDir("recovery", "/system")
+ script.UnpackPackageDir("system", "/system")
+
+ (symlinks, retouch_files) = CopySystemFiles(input_zip, output_zip)
+ script.MakeSymlinks(symlinks)
+ if OPTIONS.aslr_mode:
+ script.RetouchBinaries(retouch_files)
+ else:
+ script.UndoRetouchBinaries(retouch_files)
+
+ CopyBootFiles(input_zip, output_zip)
+
+ Item.GetMetadata(input_zip)
+ Item.Get("system").SetPermissions(script)
+
+ script.ShowProgress(0.2, 0)
+
+ if OPTIONS.backuptool:
+ script.ShowProgress(0.2, 10)
+ script.RunBackup("restore")
+
+ script.ShowProgress(0.2, 10)
+ script.EMMCWriteRawImage("/dev/block/mmcblk0p5", "boot.img")
+
+ script.ShowProgress(0.1, 0)
+ device_specific.FullOTA_InstallEnd()
+
+ if OPTIONS.extra_script is not None:
+ script.AppendExtra(OPTIONS.extra_script)
+
+ script.UnmountAll()
+ script.AddToZip(input_zip, output_zip)
+ WriteMetadata(metadata, output_zip)
+ota_from_target_files.WriteFullOTAPackage = WriteFullOTAPackage
+
+
+def WriteIncrementalOTAPackage(target_zip, source_zip, output_zip):
+ print "Incremental OTA Packages are not support on the galaxys2 at this time"
+ sys.exit(1)
+ota_from_target_files.WriteIncrementalOTAPackage = WriteIncrementalOTAPackage
+
+if __name__ == '__main__':
+ try:
+ main(sys.argv[1:])
+ except common.ExternalError, e:
+ print
+ print " ERROR: %s" % (e,)
+ print
+ sys.exit(1)
diff --git a/shbootimg.mk b/shbootimg.mk
new file mode 100644
index 0000000..e95db00
--- /dev/null
+++ b/shbootimg.mk
@@ -0,0 +1,25 @@
+#
+# Copyright (C) 2012 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.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+INSTALLED_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot.img
+$(INSTALLED_BOOTIMAGE_TARGET): $(TARGET_PREBUILT_KERNEL) $(recovery_ramdisk) $(INSTALLED_RAMDISK_TARGET) $(PRODUCT_OUT)/utilities/flash_image $(PRODUCT_OUT)/utilities/busybox
+ $(call pretty,"Boot image: $@")
+ $(hide) ./device/samsung/galaxys2/mkshbootimg.py $@ $(TARGET_PREBUILT_KERNEL) $(INSTALLED_RAMDISK_TARGET) $(recovery_ramdisk)
+
+$(INSTALLED_RECOVERYIMAGE_TARGET): $(INSTALLED_BOOTIMAGE_TARGET)
+ $(ACP) $(INSTALLED_BOOTIMAGE_TARGET) $@
diff --git a/system.prop b/system.prop
new file mode 100644
index 0000000..90c6593
--- /dev/null
+++ b/system.prop
@@ -0,0 +1,7 @@
+#
+# system.prop for galaxys2
+#
+
+rild.libpath=/system/lib/libsec-ril.so
+rild.libargs=-d /dev/ttyS0
+persist.sys.strictmode.visual=0
diff --git a/tvout/Android.mk b/tvout/Android.mk
new file mode 100644
index 0000000..c73e1cf
--- /dev/null
+++ b/tvout/Android.mk
@@ -0,0 +1,16 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_PROGUARD_FLAG_FILES := proguard.flags
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_PACKAGE_NAME := TvOut
+LOCAL_CERTIFICATE := platform
+
+include $(BUILD_PACKAGE)
+
+# Use the folloing include to make our test apk.
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tvout/AndroidManifest.xml b/tvout/AndroidManifest.xml
new file mode 100644
index 0000000..79d5745
--- /dev/null
+++ b/tvout/AndroidManifest.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.teamhacksung.tvout" android:versionCode="1"
+ android:versionName="1.0">
+
+ <application android:label="TvOut">
+
+ <service android:exported="false" android:enabled="true"
+ android:name=".TvOutService">
+ </service>
+
+ <receiver android:name=".BootCompletedReceiver">
+ <intent-filter>
+ <action android:name="android.intent.action.BOOT_COMPLETED" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ </receiver>
+
+ </application>
+
+ <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"></uses-permission>
+ <uses-permission android:name="android.permission.BROADCAST_STICKY"></uses-permission>
+ <uses-permission android:name="android.permission.FACTORY_TEST"></uses-permission>
+</manifest>
diff --git a/tvout/proguard.flags b/tvout/proguard.flags
new file mode 100644
index 0000000..3725966
--- /dev/null
+++ b/tvout/proguard.flags
@@ -0,0 +1 @@
+-dontshrink
diff --git a/tvout/src/android/hardware/Tvout.java b/tvout/src/android/hardware/Tvout.java
new file mode 100644
index 0000000..f2fc3a8
--- /dev/null
+++ b/tvout/src/android/hardware/Tvout.java
@@ -0,0 +1,102 @@
+package android.hardware;
+
+import android.util.Log;
+
+public class Tvout {
+ private static final String TAG = "Tvout_java";
+
+ static {
+ System.loadLibrary("tvout_jni");
+ }
+
+ public Tvout() {
+ Log.i(TAG, "Tvout Initializing");
+ _native_setup();
+ }
+
+ private native boolean _TvoutGetCableStatus();
+
+ private native boolean _TvoutGetStatus();
+
+ private native boolean _TvoutGetSubtitleStatus();
+
+ private native boolean _TvoutGetSuspendStatus();
+
+ private native boolean _TvoutPostSubtitle(String string, int param);
+
+ private native boolean _TvoutPostSuspend(String string);
+
+ private native boolean _TvoutSetCableStatus(boolean connected);
+
+ private native boolean _TvoutSetOutputMode(int mode);
+
+ private native boolean _TvoutSetResolution(int resolution);
+
+ private native boolean _TvoutSetStatus(boolean enabled);
+
+ private native boolean _TvoutSetSubtitleStatus(boolean enabled);
+
+ private native boolean _TvoutSetSuspendStatus(boolean enabled);
+
+ private native boolean _TvoutSetDefaultString(String string);
+
+ private final native void _native_setup();
+
+ private final native void _release();
+
+ public boolean getCableStatus() {
+ return _TvoutGetCableStatus();
+ }
+
+ public boolean getStatus() {
+ return _TvoutGetStatus();
+ }
+
+ public boolean getSubtitleStatus() {
+ return _TvoutGetSubtitleStatus();
+ }
+
+ public boolean getSuspendStatus() {
+ return _TvoutGetSuspendStatus();
+ }
+
+ public boolean postSubtitle(String string, int paramInt) {
+ return _TvoutPostSubtitle(string, paramInt);
+ }
+
+ public boolean postSuspend(String string) {
+ return _TvoutPostSuspend(string);
+ }
+
+ public boolean setCableStatus(boolean connected) {
+ return _TvoutSetCableStatus(connected);
+ }
+
+ public boolean setOutputMode(int mode) {
+ return _TvoutSetOutputMode(mode);
+ }
+
+ public boolean setResolution(int resolution) {
+ return _TvoutSetResolution(resolution);
+ }
+
+ public boolean setStatus(boolean enabled) {
+ return _TvoutSetStatus(enabled);
+ }
+
+ public boolean setSubtitleStatus(boolean enabled) {
+ return _TvoutSetSubtitleStatus(enabled);
+ }
+
+ public boolean setSuspendStatus(boolean enabled) {
+ return _TvoutSetSuspendStatus(enabled);
+ }
+
+ public boolean setDefaultString(String string) {
+ return _TvoutSetDefaultString(string);
+ }
+
+ public void release() {
+ _release();
+ }
+}
diff --git a/tvout/src/com/teamhacksung/tvout/BootCompletedReceiver.java b/tvout/src/com/teamhacksung/tvout/BootCompletedReceiver.java
new file mode 100644
index 0000000..5ed6af6
--- /dev/null
+++ b/tvout/src/com/teamhacksung/tvout/BootCompletedReceiver.java
@@ -0,0 +1,12 @@
+package com.teamhacksung.tvout;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+
+public class BootCompletedReceiver extends BroadcastReceiver {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ context.startService(new Intent(context, TvOutService.class));
+ }
+}
diff --git a/tvout/src/com/teamhacksung/tvout/TvOutService.java b/tvout/src/com/teamhacksung/tvout/TvOutService.java
new file mode 100644
index 0000000..b633b3d
--- /dev/null
+++ b/tvout/src/com/teamhacksung/tvout/TvOutService.java
@@ -0,0 +1,116 @@
+package com.teamhacksung.tvout;
+
+import android.app.Service;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.hardware.Tvout;
+import android.nfc.Tag;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import android.util.Log;
+
+public class TvOutService extends Service {
+
+ public static final String TAG = "TvOutService_java";
+
+ private Tvout mTvOut;
+ private boolean mWasOn = false; // For enabling on screen on
+
+ private BroadcastReceiver mReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ String action = intent.getAction();
+ if (Intent.ACTION_HDMI_AUDIO_PLUG.equals(action)) {
+ getTvoutInstance();
+ int state = intent.getIntExtra("state", 0);
+ if (state == 1 && !mTvOut.getStatus()) {
+ // Enable when cable is plugged
+ Log.i(TAG, "HDMI plugged");
+ mWasOn = false;
+ enable();
+ } else if (mTvOut.getStatus()) {
+ // Disable when cable is unplugged
+ Log.i(TAG, "HDMI unplugged");
+ mWasOn = false;
+ disable();
+ releaseTvout();
+ }
+ } else if (Intent.ACTION_SCREEN_ON.equals(action)) {
+ if (mTvOut != null && mWasOn) {
+ Log.i(TAG, "Screen On - Resume TvOut stream");
+ mWasOn = false;
+ mTvOut.setSuspendStatus(false);
+ }
+ } else if (Intent.ACTION_SCREEN_OFF.equals(action)) {
+ if (mTvOut != null && mTvOut.getStatus()) {
+ Log.i(TAG, "Screen Off - Pausing TvOut stream");
+ mWasOn = true;
+ mTvOut.setSuspendStatus(true);
+ }
+ }
+ }
+
+ };
+
+ @Override
+ public IBinder onBind(Intent intent) {
+ return null;
+ }
+
+ @Override
+ public void onCreate() {
+ IntentFilter filter = new IntentFilter(Intent.ACTION_HDMI_AUDIO_PLUG);
+ filter.addAction(Intent.ACTION_SCREEN_OFF);
+ filter.addAction(Intent.ACTION_SCREEN_ON);
+ registerReceiver(mReceiver, filter);
+ Log.i(TAG, "Registered Receiver");
+ }
+
+ @Override
+ public int onStartCommand(Intent intent, int flags, int startId) {
+ return START_STICKY;
+ }
+
+ private boolean getTvoutInstance() {
+ if (mTvOut != null) return true;
+
+ try {
+ mTvOut = new Tvout();
+ } catch (Exception e) {
+ return false;
+ }
+
+ return true;
+ }
+
+ private void releaseTvout() {
+ if (mTvOut != null) {
+ mTvOut.release();
+ mTvOut = null;
+ }
+ }
+
+ @Override
+ public void onDestroy() {
+ unregisterReceiver(mReceiver);
+ releaseTvout();
+ super.onDestroy();
+ }
+
+ private void enable() {
+ if (mTvOut == null) return;
+ mTvOut.setStatus(true);
+ mTvOut.setCableStatus(true);
+ mTvOut.setSuspendStatus(false);
+ }
+
+ private void disable() {
+ if (mTvOut == null) return;
+ mTvOut.setStatus(false);
+ mTvOut.setCableStatus(false);
+ }
+
+}
diff --git a/tvouthack/Android.mk b/tvouthack/Android.mk
new file mode 100644
index 0000000..19ad32f
--- /dev/null
+++ b/tvouthack/Android.mk
@@ -0,0 +1,27 @@
+# Copyright (C) 2012 The CyanogenMod Project
+# Copyright (C) 2012 Pawit Pornkitprasan
+#
+# 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.
+
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := main.cpp
+
+LOCAL_SHARED_LIBRARIES := libutils libbinder
+
+LOCAL_MODULE := TvOutHack
+
+include $(BUILD_EXECUTABLE)
diff --git a/tvouthack/main.cpp b/tvouthack/main.cpp
new file mode 100644
index 0000000..a59d4a9
--- /dev/null
+++ b/tvouthack/main.cpp
@@ -0,0 +1,52 @@
+#include <stdio.h>
+#include <binder/IPCThreadState.h>
+#include <binder/ProcessState.h>
+#include <binder/IServiceManager.h>
+#include <utils/Log.h>
+
+using namespace android;
+
+int main() {
+ sp<IServiceManager> sm = defaultServiceManager();
+ sp<IBinder> binder;
+
+ do {
+ binder = sm->getService(String16("TvoutService_C"));
+ if (binder != 0) break;
+ usleep(500000); // 0.5 s
+ } while(true);
+
+ int ret;
+
+ Parcel s2, r2;
+ s2.writeInterfaceToken(String16("android.hardware.ITvoutService"));
+ binder->transact(1, s2, &r2);
+ sp<IBinder> binder2 = r2.readStrongBinder();
+
+ while (true) {
+ {
+
+ Parcel send, reply;
+ int code = 4;
+ send.writeInterfaceToken(String16("android.hardware.Tvout"));
+ int ret = binder2->transact(code, send, &reply);
+ }
+ {
+
+ Parcel send, reply;
+ int code = 27;
+ send.writeInterfaceToken(String16("android.hardware.ITvout"));
+ int ret = binder2->transact(code, send, &reply);
+ }
+ {
+
+ Parcel send, reply;
+ int code = 13;
+ send.writeInterfaceToken(String16("android.hardware.ITvout"));
+ send.writeInt32(0);
+ int ret = binder2->transact(code, send, &reply);
+ }
+ usleep(15000); // Should give ~60 fps
+ }
+ return 0;
+}
diff --git a/ueventd.smdk4210.rc b/ueventd.smdk4210.rc
new file mode 100644
index 0000000..95e6691
--- /dev/null
+++ b/ueventd.smdk4210.rc
@@ -0,0 +1,32 @@
+/dev/mali 0666 system system
+/dev/ump 0666 system graphics
+/dev/exynos-mem 0666 system graphics
+/dev/s3c-mem 0666 system system
+/dev/s3c-mfc 0666 system graphics
+/dev/s5p-mfc 0666 system graphics
+/dev/video0 0666 system m2m
+/dev/video1 0666 system camera
+/dev/video2 0666 system m2m
+/dev/video3 0666 system m2m
+/dev/video4 0666 system m2m
+/dev/s5p-jpeg 0666 system camera
+/dev/video14 0666 system system
+/dev/video21 0666 system system
+/dev/pmem 0660 system graphics
+/dev/pmem_gpu1 0660 system graphics
+# logger should be world writable (for logging) but not readable
+/dev/log/* 0662 root log
+/dev/i2c-7 0666 system system
+/dev/CEC 0666 system system
+/dev/HPD 0666 system system
+/dev/fimg2d 0666 system graphics
+/dev/fmradio 0660 system audio
+/dev/input/* 0666 root input
+/dev/srp 0666 system audio
+/dev/srp_ctrl 0666 system audio
+/dev/umts* 0660 system radio
+/dev/link_pm 0660 system radio
+/dev/block/mmcblk0p8 0660 system radio
+/dev/akm8975 0660 system system
+/dev/accelerometer 0660 system system
+/dev/graphics/fb0 0777 root graphics
diff --git a/usr/idc/melfas_ts.idc b/usr/idc/melfas_ts.idc
new file mode 100644
index 0000000..703e73b
--- /dev/null
+++ b/usr/idc/melfas_ts.idc
@@ -0,0 +1,24 @@
+# Copyright (C) 2010 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.
+
+#
+# Input Device Configuration File for the Atmel Maxtouch touch screen.
+#
+# These calibration values are derived from empirical measurements
+# and may not be appropriate for use with other touch screens.
+# Refer to the input device configuration documentation for more details.
+#
+
+# Basic Parameters
+touch.deviceType = touchScreen
diff --git a/usr/idc/mxt224_ts_input.idc b/usr/idc/mxt224_ts_input.idc
new file mode 100644
index 0000000..703e73b
--- /dev/null
+++ b/usr/idc/mxt224_ts_input.idc
@@ -0,0 +1,24 @@
+# Copyright (C) 2010 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.
+
+#
+# Input Device Configuration File for the Atmel Maxtouch touch screen.
+#
+# These calibration values are derived from empirical measurements
+# and may not be appropriate for use with other touch screens.
+# Refer to the input device configuration documentation for more details.
+#
+
+# Basic Parameters
+touch.deviceType = touchScreen
diff --git a/usr/idc/qwerty.idc b/usr/idc/qwerty.idc
new file mode 100644
index 0000000..375d785
--- /dev/null
+++ b/usr/idc/qwerty.idc
@@ -0,0 +1,28 @@
+# Copyright (C) 2010 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.
+
+#
+# Emulator keyboard configuration file #1.
+#
+
+touch.deviceType = touchScreen
+touch.orientationAware = 1
+
+keyboard.layout = qwerty
+keyboard.characterMap = qwerty
+keyboard.orientationAware = 1
+keyboard.builtIn = 1
+
+cursor.mode = navigation
+cursor.orientationAware = 1
diff --git a/usr/idc/qwerty2.idc b/usr/idc/qwerty2.idc
new file mode 100644
index 0000000..369205e
--- /dev/null
+++ b/usr/idc/qwerty2.idc
@@ -0,0 +1,28 @@
+# Copyright (C) 2010 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.
+
+#
+# Emulator keyboard configuration file #2.
+#
+
+touch.deviceType = touchScreen
+touch.orientationAware = 1
+
+keyboard.layout = qwerty
+keyboard.characterMap = qwerty2
+keyboard.orientationAware = 1
+keyboard.builtIn = 1
+
+cursor.mode = navigation
+cursor.orientationAware = 1
diff --git a/usr/idc/sec_touchscreen.idc b/usr/idc/sec_touchscreen.idc
new file mode 100644
index 0000000..4bd511a
--- /dev/null
+++ b/usr/idc/sec_touchscreen.idc
@@ -0,0 +1,56 @@
+# Copyright (C) 2010 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.
+
+#
+# Input Device Configuration File for the Atmel Maxtouch touch screen.
+#
+# These calibration values are derived from empirical measurements
+# and may not be appropriate for use with other touch screens.
+# Refer to the input device configuration documentation for more details.
+#
+
+# Basic Parameters
+touch.deviceType = touchScreen
+touch.orientationAware = 1
+
+# Touch Size
+touch.touchSize.calibration = pressure
+
+# Tool Size
+# Driver reports tool size as an area measurement.
+#
+# Based on empirical measurements, we estimate the size of the tool
+# using size = sqrt(22 * rawToolArea + 0) * 6 + 0.
+touch.toolSize.calibration = area
+touch.toolSize.areaScale = 22
+touch.toolSize.areaBias = 0
+touch.toolSize.linearScale = 6
+touch.toolSize.linearBias = 0
+touch.toolSize.isSummed = 0
+
+# Pressure
+# Driver reports signal strength as pressure.
+#
+# A normal index finger touch typically registers about 80 signal strength
+# units although we don't expect these values to be accurate.
+touch.pressure.calibration = amplitude
+touch.pressure.source = default
+touch.pressure.scale = 0.0125
+
+# Size
+touch.size.calibration = normalized
+
+# Orientation
+touch.orientation.calibration = vector
+
diff --git a/usr/keychars/Generic.kcm b/usr/keychars/Generic.kcm
new file mode 100644
index 0000000..b5f6897
--- /dev/null
+++ b/usr/keychars/Generic.kcm
@@ -0,0 +1,672 @@
+# Copyright (C) 2010 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.
+
+#
+# Generic key character map for full alphabetic US English PC style external keyboards.
+#
+# This file is intentionally very generic and is intended to support a broad rang of keyboards.
+# Do not edit the generic key character map to support a specific keyboard; instead, create
+# a new key character map file with the required keyboard configuration.
+#
+
+type FULL
+
+### Basic QWERTY keys ###
+
+key A {
+ label: 'A'
+ base: 'a'
+ shift, capslock: 'A'
+ ctrl, alt, meta: none
+}
+
+key B {
+ label: 'B'
+ base: 'b'
+ shift, capslock: 'B'
+ ctrl, alt, meta: none
+}
+
+key C {
+ label: 'C'
+ base: 'c'
+ shift, capslock: 'C'
+ alt: '\u00e7'
+ shift+alt: '\u00c7'
+ ctrl, meta: none
+}
+
+key D {
+ label: 'D'
+ base: 'd'
+ shift, capslock: 'D'
+ ctrl, alt, meta: none
+}
+
+key E {
+ label: 'E'
+ base: 'e'
+ shift, capslock: 'E'
+ alt: '\u0301'
+ ctrl, meta: none
+}
+
+key F {
+ label: 'F'
+ base: 'f'
+ shift, capslock: 'F'
+ ctrl, alt, meta: none
+}
+
+key G {
+ label: 'G'
+ base: 'g'
+ shift, capslock: 'G'
+ ctrl, alt, meta: none
+}
+
+key H {
+ label: 'H'
+ base: 'h'
+ shift, capslock: 'H'
+ ctrl, alt, meta: none
+}
+
+key I {
+ label: 'I'
+ base: 'i'
+ shift, capslock: 'I'
+ alt: '\u0302'
+ ctrl, meta: none
+}
+
+key J {
+ label: 'J'
+ base: 'j'
+ shift, capslock: 'J'
+ ctrl, alt, meta: none
+}
+
+key K {
+ label: 'K'
+ base: 'k'
+ shift, capslock: 'K'
+ ctrl, alt, meta: none
+}
+
+key L {
+ label: 'L'
+ base: 'l'
+ shift, capslock: 'L'
+ ctrl, alt, meta: none
+}
+
+key M {
+ label: 'M'
+ base: 'm'
+ shift, capslock: 'M'
+ ctrl, alt, meta: none
+}
+
+key N {
+ label: 'N'
+ base: 'n'
+ shift, capslock: 'N'
+ alt: '\u0303'
+ ctrl, meta: none
+}
+
+key O {
+ label: 'O'
+ base: 'o'
+ shift, capslock: 'O'
+ ctrl, alt, meta: none
+}
+
+key P {
+ label: 'P'
+ base: 'p'
+ shift, capslock: 'P'
+ ctrl, alt, meta: none
+}
+
+key Q {
+ label: 'Q'
+ base: 'q'
+ shift, capslock: 'Q'
+ ctrl, alt, meta: none
+}
+
+key R {
+ label: 'R'
+ base: 'r'
+ shift, capslock: 'R'
+ ctrl, alt, meta: none
+}
+
+key S {
+ label: 'S'
+ base: 's'
+ shift, capslock: 'S'
+ alt: '\u00df'
+ ctrl, meta: none
+}
+
+key T {
+ label: 'T'
+ base: 't'
+ shift, capslock: 'T'
+ ctrl, alt, meta: none
+}
+
+key U {
+ label: 'U'
+ base: 'u'
+ shift, capslock: 'U'
+ alt: '\u0308'
+ ctrl, meta: none
+}
+
+key V {
+ label: 'V'
+ base: 'v'
+ shift, capslock: 'V'
+ ctrl, alt, meta: none
+}
+
+key W {
+ label: 'W'
+ base: 'w'
+ shift, capslock: 'W'
+ ctrl, alt, meta: none
+}
+
+key X {
+ label: 'X'
+ base: 'x'
+ shift, capslock: 'X'
+ ctrl, alt, meta: none
+}
+
+key Y {
+ label: 'Y'
+ base: 'y'
+ shift, capslock: 'Y'
+ ctrl, alt, meta: none
+}
+
+key Z {
+ label: 'Z'
+ base: 'z'
+ shift, capslock: 'Z'
+ ctrl, alt, meta: none
+}
+
+key 0 {
+ label, number: '0'
+ base: '0'
+ shift: ')'
+ ctrl, alt, meta: none
+}
+
+key 1 {
+ label, number: '1'
+ base: '1'
+ shift: '!'
+ ctrl, alt, meta: none
+}
+
+key 2 {
+ label, number: '2'
+ base: '2'
+ shift: '@'
+ ctrl, alt, meta: none
+}
+
+key 3 {
+ label, number: '3'
+ base: '3'
+ shift: '#'
+ ctrl, alt, meta: none
+}
+
+key 4 {
+ label, number: '4'
+ base: '4'
+ shift: '$'
+ ctrl, alt, meta: none
+}
+
+key 5 {
+ label, number: '5'
+ base: '5'
+ shift: '%'
+ ctrl, alt, meta: none
+}
+
+key 6 {
+ label, number: '6'
+ base: '6'
+ shift: '^'
+ ctrl, alt, meta: none
+ alt+shift: '\u0302'
+}
+
+key 7 {
+ label, number: '7'
+ base: '7'
+ shift: '&'
+ ctrl, alt, meta: none
+}
+
+key 8 {
+ label, number: '8'
+ base: '8'
+ shift: '*'
+ ctrl, alt, meta: none
+}
+
+key 9 {
+ label, number: '9'
+ base: '9'
+ shift: '('
+ ctrl, alt, meta: none
+}
+
+key SPACE {
+ label: ' '
+ base: ' '
+ ctrl: none
+ alt, meta: fallback SEARCH
+}
+
+key ENTER {
+ label: '\n'
+ base: '\n'
+ ctrl, alt, meta: none
+}
+
+key TAB {
+ label: '\t'
+ base: '\t'
+ ctrl, alt, meta: none
+}
+
+key COMMA {
+ label, number: ','
+ base: ','
+ shift: '<'
+ ctrl, alt, meta: none
+}
+
+key PERIOD {
+ label, number: '.'
+ base: '.'
+ shift: '>'
+ ctrl, alt, meta: none
+}
+
+key SLASH {
+ label, number: '/'
+ base: '/'
+ shift: '?'
+ ctrl, alt, meta: none
+}
+
+key GRAVE {
+ label, number: '`'
+ base: '`'
+ shift: '~'
+ alt: '\u0300'
+ alt+shift: '\u0303'
+ ctrl, meta: none
+}
+
+key MINUS {
+ label, number: '-'
+ base: '-'
+ shift: '_'
+ ctrl, alt, meta: none
+}
+
+key EQUALS {
+ label, number: '='
+ base: '='
+ shift: '+'
+ ctrl, alt, meta: none
+}
+
+key LEFT_BRACKET {
+ label, number: '['
+ base: '['
+ shift: '{'
+ ctrl, alt, meta: none
+}
+
+key RIGHT_BRACKET {
+ label, number: ']'
+ base: ']'
+ shift: '}'
+ ctrl, alt, meta: none
+}
+
+key BACKSLASH {
+ label, number: '\\'
+ base: '\\'
+ shift: '|'
+ ctrl, alt, meta: none
+}
+
+key SEMICOLON {
+ label, number: ';'
+ base: ';'
+ shift: ':'
+ ctrl, alt, meta: none
+}
+
+key APOSTROPHE {
+ label, number: '\''
+ base: '\''
+ shift: '"'
+ ctrl, alt, meta: none
+}
+
+### Numeric keypad ###
+
+key NUMPAD_0 {
+ label, number: '0'
+ base: fallback INSERT
+ numlock: '0'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_1 {
+ label, number: '1'
+ base: fallback MOVE_END
+ numlock: '1'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_2 {
+ label, number: '2'
+ base: fallback DPAD_DOWN
+ numlock: '2'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_3 {
+ label, number: '3'
+ base: fallback PAGE_DOWN
+ numlock: '3'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_4 {
+ label, number: '4'
+ base: fallback DPAD_LEFT
+ numlock: '4'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_5 {
+ label, number: '5'
+ base: fallback DPAD_CENTER
+ numlock: '5'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_6 {
+ label, number: '6'
+ base: fallback DPAD_RIGHT
+ numlock: '6'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_7 {
+ label, number: '7'
+ base: fallback MOVE_HOME
+ numlock: '7'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_8 {
+ label, number: '8'
+ base: fallback DPAD_UP
+ numlock: '8'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_9 {
+ label, number: '9'
+ base: fallback PAGE_UP
+ numlock: '9'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_LEFT_PAREN {
+ label, number: '('
+ base: '('
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_RIGHT_PAREN {
+ label, number: ')'
+ base: ')'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_DIVIDE {
+ label, number: '/'
+ base: '/'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_MULTIPLY {
+ label, number: '*'
+ base: '*'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_SUBTRACT {
+ label, number: '-'
+ base: '-'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_ADD {
+ label, number: '+'
+ base: '+'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_DOT {
+ label, number: '.'
+ base: fallback FORWARD_DEL
+ numlock: '.'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_COMMA {
+ label, number: ','
+ base: ','
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_EQUALS {
+ label, number: '='
+ base: '='
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_ENTER {
+ label: '\n'
+ base: '\n' fallback ENTER
+ ctrl, alt, meta: none fallback ENTER
+}
+
+### Special keys on phones ###
+
+key AT {
+ label, number: '@'
+ base: '@'
+}
+
+key STAR {
+ label, number: '*'
+ base: '*'
+}
+
+key POUND {
+ label, number: '#'
+ base: '#'
+}
+
+key PLUS {
+ label, number: '+'
+ base: '+'
+}
+
+### Non-printing keys ###
+
+key ESCAPE {
+ base: fallback BACK
+ alt, meta: fallback HOME
+ ctrl: fallback MENU
+}
+
+### Gamepad buttons ###
+
+key BUTTON_A {
+ base: fallback BACK
+}
+
+key BUTTON_B {
+ base: fallback BACK
+}
+
+key BUTTON_C {
+ base: fallback BACK
+}
+
+key BUTTON_X {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_Y {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_Z {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_L1 {
+ base: none
+}
+
+key BUTTON_R1 {
+ base: none
+}
+
+key BUTTON_L2 {
+ base: none
+}
+
+key BUTTON_R2 {
+ base: none
+}
+
+key BUTTON_THUMBL {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_THUMBR {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_START {
+ base: fallback HOME
+}
+
+key BUTTON_SELECT {
+ base: fallback MENU
+}
+
+key BUTTON_MODE {
+ base: fallback MENU
+}
+
+key BUTTON_1 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_2 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_3 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_4 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_5 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_6 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_7 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_8 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_9 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_10 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_11 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_12 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_13 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_14 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_15 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_16 {
+ base: fallback DPAD_CENTER
+}
diff --git a/usr/keychars/Virtual.kcm b/usr/keychars/Virtual.kcm
new file mode 100644
index 0000000..0ce4a68
--- /dev/null
+++ b/usr/keychars/Virtual.kcm
@@ -0,0 +1,544 @@
+# Copyright (C) 2010 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.
+
+#
+# Key character map for a built-in generic virtual keyboard primarily used
+# for instrumentation and testing purposes.
+#
+
+type FULL
+
+### Basic QWERTY keys ###
+
+key A {
+ label: 'A'
+ base: 'a'
+ shift, capslock: 'A'
+ ctrl, alt, meta: none
+}
+
+key B {
+ label: 'B'
+ base: 'b'
+ shift, capslock: 'B'
+ ctrl, alt, meta: none
+}
+
+key C {
+ label: 'C'
+ base: 'c'
+ shift, capslock: 'C'
+ alt: '\u00e7'
+ shift+alt: '\u00c7'
+ ctrl, meta: none
+}
+
+key D {
+ label: 'D'
+ base: 'd'
+ shift, capslock: 'D'
+ ctrl, alt, meta: none
+}
+
+key E {
+ label: 'E'
+ base: 'e'
+ shift, capslock: 'E'
+ alt: '\u0301'
+ ctrl, meta: none
+}
+
+key F {
+ label: 'F'
+ base: 'f'
+ shift, capslock: 'F'
+ ctrl, alt, meta: none
+}
+
+key G {
+ label: 'G'
+ base: 'g'
+ shift, capslock: 'G'
+ ctrl, alt, meta: none
+}
+
+key H {
+ label: 'H'
+ base: 'h'
+ shift, capslock: 'H'
+ ctrl, alt, meta: none
+}
+
+key I {
+ label: 'I'
+ base: 'i'
+ shift, capslock: 'I'
+ alt: '\u0302'
+ ctrl, meta: none
+}
+
+key J {
+ label: 'J'
+ base: 'j'
+ shift, capslock: 'J'
+ ctrl, alt, meta: none
+}
+
+key K {
+ label: 'K'
+ base: 'k'
+ shift, capslock: 'K'
+ ctrl, alt, meta: none
+}
+
+key L {
+ label: 'L'
+ base: 'l'
+ shift, capslock: 'L'
+ ctrl, alt, meta: none
+}
+
+key M {
+ label: 'M'
+ base: 'm'
+ shift, capslock: 'M'
+ ctrl, alt, meta: none
+}
+
+key N {
+ label: 'N'
+ base: 'n'
+ shift, capslock: 'N'
+ alt: '\u0303'
+ ctrl, meta: none
+}
+
+key O {
+ label: 'O'
+ base: 'o'
+ shift, capslock: 'O'
+ ctrl, alt, meta: none
+}
+
+key P {
+ label: 'P'
+ base: 'p'
+ shift, capslock: 'P'
+ ctrl, alt, meta: none
+}
+
+key Q {
+ label: 'Q'
+ base: 'q'
+ shift, capslock: 'Q'
+ ctrl, alt, meta: none
+}
+
+key R {
+ label: 'R'
+ base: 'r'
+ shift, capslock: 'R'
+ ctrl, alt, meta: none
+}
+
+key S {
+ label: 'S'
+ base: 's'
+ shift, capslock: 'S'
+ alt: '\u00df'
+ ctrl, meta: none
+}
+
+key T {
+ label: 'T'
+ base: 't'
+ shift, capslock: 'T'
+ ctrl, alt, meta: none
+}
+
+key U {
+ label: 'U'
+ base: 'u'
+ shift, capslock: 'U'
+ alt: '\u0308'
+ ctrl, meta: none
+}
+
+key V {
+ label: 'V'
+ base: 'v'
+ shift, capslock: 'V'
+ ctrl, alt, meta: none
+}
+
+key W {
+ label: 'W'
+ base: 'w'
+ shift, capslock: 'W'
+ ctrl, alt, meta: none
+}
+
+key X {
+ label: 'X'
+ base: 'x'
+ shift, capslock: 'X'
+ ctrl, alt, meta: none
+}
+
+key Y {
+ label: 'Y'
+ base: 'y'
+ shift, capslock: 'Y'
+ ctrl, alt, meta: none
+}
+
+key Z {
+ label: 'Z'
+ base: 'z'
+ shift, capslock: 'Z'
+ ctrl, alt, meta: none
+}
+
+key 0 {
+ label, number: '0'
+ base: '0'
+ shift: ')'
+ ctrl, alt, meta: none
+}
+
+key 1 {
+ label, number: '1'
+ base: '1'
+ shift: '!'
+ ctrl, alt, meta: none
+}
+
+key 2 {
+ label, number: '2'
+ base: '2'
+ shift: '@'
+ ctrl, alt, meta: none
+}
+
+key 3 {
+ label, number: '3'
+ base: '3'
+ shift: '#'
+ ctrl, alt, meta: none
+}
+
+key 4 {
+ label, number: '4'
+ base: '4'
+ shift: '$'
+ ctrl, alt, meta: none
+}
+
+key 5 {
+ label, number: '5'
+ base: '5'
+ shift: '%'
+ ctrl, alt, meta: none
+}
+
+key 6 {
+ label, number: '6'
+ base: '6'
+ shift: '^'
+ ctrl, alt, meta: none
+ alt+shift: '\u0302'
+}
+
+key 7 {
+ label, number: '7'
+ base: '7'
+ shift: '&'
+ ctrl, alt, meta: none
+}
+
+key 8 {
+ label, number: '8'
+ base: '8'
+ shift: '*'
+ ctrl, alt, meta: none
+}
+
+key 9 {
+ label, number: '9'
+ base: '9'
+ shift: '('
+ ctrl, alt, meta: none
+}
+
+key SPACE {
+ label: ' '
+ base: ' '
+ ctrl, alt: none
+ meta: fallback SEARCH
+}
+
+key ENTER {
+ label: '\n'
+ base: '\n'
+ ctrl, alt, meta: none
+}
+
+key TAB {
+ label: '\t'
+ base: '\t'
+ ctrl, alt: none
+ meta: fallback APP_SWITCH
+}
+
+key COMMA {
+ label, number: ','
+ base: ','
+ shift: '<'
+ ctrl, alt, meta: none
+}
+
+key PERIOD {
+ label, number: '.'
+ base: '.'
+ shift: '>'
+ ctrl, alt, meta: none
+}
+
+key SLASH {
+ label, number: '/'
+ base: '/'
+ shift: '?'
+ ctrl, alt, meta: none
+}
+
+key GRAVE {
+ label, number: '`'
+ base: '`'
+ shift: '~'
+ alt: '\u0300'
+ alt+shift: '\u0303'
+ ctrl, meta: none
+}
+
+key MINUS {
+ label, number: '-'
+ base: '-'
+ shift: '_'
+ ctrl, alt, meta: none
+}
+
+key EQUALS {
+ label, number: '='
+ base: '='
+ shift: '+'
+ ctrl, alt, meta: none
+}
+
+key LEFT_BRACKET {
+ label, number: '['
+ base: '['
+ shift: '{'
+ ctrl, alt, meta: none
+}
+
+key RIGHT_BRACKET {
+ label, number: ']'
+ base: ']'
+ shift: '}'
+ ctrl, alt, meta: none
+}
+
+key BACKSLASH {
+ label, number: '\\'
+ base: '\\'
+ shift: '|'
+ ctrl, alt, meta: none
+}
+
+key SEMICOLON {
+ label, number: ';'
+ base: ';'
+ shift: ':'
+ ctrl, alt, meta: none
+}
+
+key APOSTROPHE {
+ label, number: '\''
+ base: '\''
+ shift: '"'
+ ctrl, alt, meta: none
+}
+
+### Numeric keypad ###
+
+key NUMPAD_0 {
+ label, number: '0'
+ base: fallback INSERT
+ numlock: '0'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_1 {
+ label, number: '1'
+ base: fallback MOVE_END
+ numlock: '1'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_2 {
+ label, number: '2'
+ base: fallback DPAD_DOWN
+ numlock: '2'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_3 {
+ label, number: '3'
+ base: fallback PAGE_DOWN
+ numlock: '3'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_4 {
+ label, number: '4'
+ base: fallback DPAD_LEFT
+ numlock: '4'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_5 {
+ label, number: '5'
+ base: fallback DPAD_CENTER
+ numlock: '5'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_6 {
+ label, number: '6'
+ base: fallback DPAD_RIGHT
+ numlock: '6'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_7 {
+ label, number: '7'
+ base: fallback MOVE_HOME
+ numlock: '7'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_8 {
+ label, number: '8'
+ base: fallback DPAD_UP
+ numlock: '8'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_9 {
+ label, number: '9'
+ base: fallback PAGE_UP
+ numlock: '9'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_LEFT_PAREN {
+ label, number: '('
+ base: '('
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_RIGHT_PAREN {
+ label, number: ')'
+ base: ')'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_DIVIDE {
+ label, number: '/'
+ base: '/'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_MULTIPLY {
+ label, number: '*'
+ base: '*'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_SUBTRACT {
+ label, number: '-'
+ base: '-'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_ADD {
+ label, number: '+'
+ base: '+'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_DOT {
+ label, number: '.'
+ base: fallback FORWARD_DEL
+ numlock: '.'
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_COMMA {
+ label, number: ','
+ base: ','
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_EQUALS {
+ label, number: '='
+ base: '='
+ ctrl, alt, meta: none
+}
+
+key NUMPAD_ENTER {
+ label: '\n'
+ base: '\n' fallback ENTER
+ ctrl, alt, meta: none fallback ENTER
+}
+
+### Special keys on phones ###
+
+key AT {
+ label, number: '@'
+ base: '@'
+}
+
+key STAR {
+ label, number: '*'
+ base: '*'
+}
+
+key POUND {
+ label, number: '#'
+ base: '#'
+}
+
+key PLUS {
+ label, number: '+'
+ base: '+'
+}
+
+### Non-printing keys ###
+
+key ESCAPE {
+ base: fallback BACK
+ meta: fallback HOME
+ alt: fallback MENU
+}
diff --git a/usr/keychars/qwerty.kcm b/usr/keychars/qwerty.kcm
new file mode 100644
index 0000000..f3e1524
--- /dev/null
+++ b/usr/keychars/qwerty.kcm
@@ -0,0 +1,508 @@
+# Copyright (C) 2010 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.
+
+#
+# Emulator keyboard character map #1.
+#
+# This file is no longer used as the platform's default keyboard character map.
+# Refer to Generic.kcm and Virtual.kcm instead.
+#
+
+type ALPHA
+
+key A {
+ label: 'A'
+ number: '2'
+ base: 'a'
+ shift, capslock: 'A'
+ alt: '#'
+ shift+alt, capslock+alt: none
+}
+
+key B {
+ label: 'B'
+ number: '2'
+ base: 'b'
+ shift, capslock: 'B'
+ alt: '<'
+ shift+alt, capslock+alt: none
+}
+
+key C {
+ label: 'C'
+ number: '2'
+ base: 'c'
+ shift, capslock: 'C'
+ alt: '9'
+ shift+alt, capslock+alt: '\u00e7'
+}
+
+key D {
+ label: 'D'
+ number: '3'
+ base: 'd'
+ shift, capslock: 'D'
+ alt: '5'
+ shift+alt, capslock+alt: none
+}
+
+key E {
+ label: 'E'
+ number: '3'
+ base: 'e'
+ shift, capslock: 'E'
+ alt: '2'
+ shift+alt, capslock+alt: '\u0301'
+}
+
+key F {
+ label: 'F'
+ number: '3'
+ base: 'f'
+ shift, capslock: 'F'
+ alt: '6'
+ shift+alt, capslock+alt: '\u00a5'
+}
+
+key G {
+ label: 'G'
+ number: '4'
+ base: 'g'
+ shift, capslock: 'G'
+ alt: '-'
+ shift+alt, capslock+alt: '_'
+}
+
+key H {
+ label: 'H'
+ number: '4'
+ base: 'h'
+ shift, capslock: 'H'
+ alt: '['
+ shift+alt, capslock+alt: '{'
+}
+
+key I {
+ label: 'I'
+ number: '4'
+ base: 'i'
+ shift, capslock: 'I'
+ alt: '$'
+ shift+alt, capslock+alt: '\u0302'
+}
+
+key J {
+ label: 'J'
+ number: '5'
+ base: 'j'
+ shift, capslock: 'J'
+ alt: ']'
+ shift+alt, capslock+alt: '}'
+}
+
+key K {
+ label: 'K'
+ number: '5'
+ base: 'k'
+ shift, capslock: 'K'
+ alt: '"'
+ shift+alt, capslock+alt: '~'
+}
+
+key L {
+ label: 'L'
+ number: '5'
+ base: 'l'
+ shift, capslock: 'L'
+ alt: '\''
+ shift+alt, capslock+alt: '`'
+}
+
+key M {
+ label: 'M'
+ number: '6'
+ base: 'm'
+ shift, capslock: 'M'
+ alt: '!'
+ shift+alt, capslock+alt: none
+}
+
+key N {
+ label: 'N'
+ number: '6'
+ base: 'n'
+ shift, capslock: 'N'
+ alt: '>'
+ shift+alt, capslock+alt: '\u0303'
+}
+
+key O {
+ label: 'O'
+ number: '6'
+ base: 'o'
+ shift, capslock: 'O'
+ alt: '('
+ shift+alt, capslock+alt: none
+}
+
+key P {
+ label: 'P'
+ number: '7'
+ base: 'p'
+ shift, capslock: 'P'
+ alt: ')'
+ shift+alt, capslock+alt: none
+}
+
+key Q {
+ label: 'Q'
+ number: '7'
+ base: 'q'
+ shift, capslock: 'Q'
+ alt: '*'
+ shift+alt, capslock+alt: '\u0300'
+}
+
+key R {
+ label: 'R'
+ number: '7'
+ base: 'r'
+ shift, capslock: 'R'
+ alt: '3'
+ shift+alt, capslock+alt: '\u20ac'
+}
+
+key S {
+ label: 'S'
+ number: '7'
+ base: 's'
+ shift, capslock: 'S'
+ alt: '4'
+ shift+alt, capslock+alt: '\u00df'
+}
+
+key T {
+ label: 'T'
+ number: '8'
+ base: 't'
+ shift, capslock: 'T'
+ alt: '+'
+ shift+alt, capslock+alt: '\u00a3'
+}
+
+key U {
+ label: 'U'
+ number: '8'
+ base: 'u'
+ shift, capslock: 'U'
+ alt: '&'
+ shift+alt, capslock+alt: '\u0308'
+}
+
+key V {
+ label: 'V'
+ number: '8'
+ base: 'v'
+ shift, capslock: 'V'
+ alt: '='
+ shift+alt, capslock+alt: '^'
+}
+
+key W {
+ label: 'W'
+ number: '9'
+ base: 'w'
+ shift, capslock: 'W'
+ alt: '1'
+ shift+alt, capslock+alt: none
+}
+
+key X {
+ label: 'X'
+ number: '9'
+ base: 'x'
+ shift, capslock: 'X'
+ alt: '8'
+ shift+alt, capslock+alt: '\uef00'
+}
+
+key Y {
+ label: 'Y'
+ number: '9'
+ base: 'y'
+ shift, capslock: 'Y'
+ alt: '%'
+ shift+alt, capslock+alt: '\u00a1'
+}
+
+key Z {
+ label: 'Z'
+ number: '9'
+ base: 'z'
+ shift, capslock: 'Z'
+ alt: '7'
+ shift+alt, capslock+alt: none
+}
+
+key COMMA {
+ label: ','
+ number: ','
+ base: ','
+ shift: ';'
+ alt: ';'
+ shift+alt: '|'
+}
+
+key PERIOD {
+ label: '.'
+ number: '.'
+ base: '.'
+ shift: ':'
+ alt: ':'
+ shift+alt: '\u2026'
+}
+
+key AT {
+ label: '@'
+ number: '0'
+ base: '@'
+ shift: '0'
+ alt: '0'
+ shift+alt: '\u2022'
+}
+
+key SLASH {
+ label: '/'
+ number: '/'
+ base: '/'
+ shift: '?'
+ alt: '?'
+ shift+alt: '\\'
+}
+
+key SPACE {
+ label: ' '
+ number: ' '
+ base: ' '
+ shift: ' '
+ alt: '\uef01'
+ shift+alt: '\uef01'
+}
+
+key ENTER {
+ label: '\n'
+ number: '\n'
+ base: '\n'
+ shift: '\n'
+ alt: '\n'
+ shift+alt: '\n'
+}
+
+key TAB {
+ label: '\t'
+ number: '\t'
+ base: '\t'
+ shift: '\t'
+ alt: '\t'
+ shift+alt: '\t'
+}
+
+key 0 {
+ label: '0'
+ number: '0'
+ base: '0'
+ shift: ')'
+ alt: ')'
+ shift+alt: ')'
+}
+
+key 1 {
+ label: '1'
+ number: '1'
+ base: '1'
+ shift: '!'
+ alt: '!'
+ shift+alt: '!'
+}
+
+key 2 {
+ label: '2'
+ number: '2'
+ base: '2'
+ shift: '@'
+ alt: '@'
+ shift+alt: '@'
+}
+
+key 3 {
+ label: '3'
+ number: '3'
+ base: '3'
+ shift: '#'
+ alt: '#'
+ shift+alt: '#'
+}
+
+key 4 {
+ label: '4'
+ number: '4'
+ base: '4'
+ shift: '$'
+ alt: '$'
+ shift+alt: '$'
+}
+
+key 5 {
+ label: '5'
+ number: '5'
+ base: '5'
+ shift: '%'
+ alt: '%'
+ shift+alt: '%'
+}
+
+key 6 {
+ label: '6'
+ number: '6'
+ base: '6'
+ shift: '^'
+ alt: '^'
+ shift+alt: '^'
+}
+
+key 7 {
+ label: '7'
+ number: '7'
+ base: '7'
+ shift: '&'
+ alt: '&'
+ shift+alt: '&'
+}
+
+key 8 {
+ label: '8'
+ number: '8'
+ base: '8'
+ shift: '*'
+ alt: '*'
+ shift+alt: '*'
+}
+
+key 9 {
+ label: '9'
+ number: '9'
+ base: '9'
+ shift: '('
+ alt: '('
+ shift+alt: '('
+}
+
+key GRAVE {
+ label: '`'
+ number: '`'
+ base: '`'
+ shift: '~'
+ alt: '`'
+ shift+alt: '~'
+}
+
+key MINUS {
+ label: '-'
+ number: '-'
+ base: '-'
+ shift: '_'
+ alt: '-'
+ shift+alt: '_'
+}
+
+key EQUALS {
+ label: '='
+ number: '='
+ base: '='
+ shift: '+'
+ alt: '='
+ shift+alt: '+'
+}
+
+key LEFT_BRACKET {
+ label: '['
+ number: '['
+ base: '['
+ shift: '{'
+ alt: '['
+ shift+alt: '{'
+}
+
+key RIGHT_BRACKET {
+ label: ']'
+ number: ']'
+ base: ']'
+ shift: '}'
+ alt: ']'
+ shift+alt: '}'
+}
+
+key BACKSLASH {
+ label: '\\'
+ number: '\\'
+ base: '\\'
+ shift: '|'
+ alt: '\\'
+ shift+alt: '|'
+}
+
+key SEMICOLON {
+ label: ';'
+ number: ';'
+ base: ';'
+ shift: ':'
+ alt: ';'
+ shift+alt: ':'
+}
+
+key APOSTROPHE {
+ label: '\''
+ number: '\''
+ base: '\''
+ shift: '"'
+ alt: '\''
+ shift+alt: '"'
+}
+
+key STAR {
+ label: '*'
+ number: '*'
+ base: '*'
+ shift: '*'
+ alt: '*'
+ shift+alt: '*'
+}
+
+key POUND {
+ label: '#'
+ number: '#'
+ base: '#'
+ shift: '#'
+ alt: '#'
+ shift+alt: '#'
+}
+
+key PLUS {
+ label: '+'
+ number: '+'
+ base: '+'
+ shift: '+'
+ alt: '+'
+ shift+alt: '+'
+}
diff --git a/usr/keychars/qwerty2.kcm b/usr/keychars/qwerty2.kcm
new file mode 100644
index 0000000..d96914f
--- /dev/null
+++ b/usr/keychars/qwerty2.kcm
@@ -0,0 +1,505 @@
+# Copyright (C) 2010 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.
+
+#
+# Emulator keyboard character map #2.
+#
+
+type ALPHA
+
+key A {
+ label: 'A'
+ number: '2'
+ base: 'a'
+ shift, capslock: 'A'
+ alt: 'a'
+ shift+alt, capslock+alt: 'A'
+}
+
+key B {
+ label: 'B'
+ number: '2'
+ base: 'b'
+ shift, capslock: 'B'
+ alt: 'b'
+ shift+alt, capslock+alt: 'B'
+}
+
+key C {
+ label: 'C'
+ number: '2'
+ base: 'c'
+ shift, capslock: 'C'
+ alt: '\u00e7'
+ shift+alt, capslock+alt: '\u00e7'
+}
+
+key D {
+ label: 'D'
+ number: '3'
+ base: 'd'
+ shift, capslock: 'D'
+ alt: '\''
+ shift+alt, capslock+alt: '\''
+}
+
+key E {
+ label: 'E'
+ number: '3'
+ base: 'e'
+ shift, capslock: 'E'
+ alt: '"'
+ shift+alt, capslock+alt: '\u0301'
+}
+
+key F {
+ label: 'F'
+ number: '3'
+ base: 'f'
+ shift, capslock: 'F'
+ alt: '['
+ shift+alt, capslock+alt: '['
+}
+
+key G {
+ label: 'G'
+ number: '4'
+ base: 'g'
+ shift, capslock: 'G'
+ alt: ']'
+ shift+alt, capslock+alt: ']'
+}
+
+key H {
+ label: 'H'
+ number: '4'
+ base: 'h'
+ shift, capslock: 'H'
+ alt: '<'
+ shift+alt, capslock+alt: '<'
+}
+
+key I {
+ label: 'I'
+ number: '4'
+ base: 'i'
+ shift, capslock: 'I'
+ alt: '-'
+ shift+alt, capslock+alt: '\u0302'
+}
+
+key J {
+ label: 'J'
+ number: '5'
+ base: 'j'
+ shift, capslock: 'J'
+ alt: '>'
+ shift+alt, capslock+alt: '>'
+}
+
+key K {
+ label: 'K'
+ number: '5'
+ base: 'k'
+ shift, capslock: 'K'
+ alt: ';'
+ shift+alt, capslock+alt: '~'
+}
+
+key L {
+ label: 'L'
+ number: '5'
+ base: 'l'
+ shift, capslock: 'L'
+ alt: ':'
+ shift+alt, capslock+alt: '`'
+}
+
+key M {
+ label: 'M'
+ number: '6'
+ base: 'm'
+ shift, capslock: 'M'
+ alt: '%'
+ shift+alt, capslock+alt: none
+}
+
+key N {
+ label: 'N'
+ number: '6'
+ base: 'n'
+ shift, capslock: 'N'
+ alt: none
+ shift+alt, capslock+alt: '\u0303'
+}
+
+key O {
+ label: 'O'
+ number: '6'
+ base: 'o'
+ shift, capslock: 'O'
+ alt: '+'
+ shift+alt, capslock+alt: '+'
+}
+
+key P {
+ label: 'P'
+ number: '7'
+ base: 'p'
+ shift, capslock: 'P'
+ alt: '='
+ shift+alt, capslock+alt: '\u00a5'
+}
+
+key Q {
+ label: 'Q'
+ number: '7'
+ base: 'q'
+ shift, capslock: 'Q'
+ alt: '|'
+ shift+alt, capslock+alt: '\u0300'
+}
+
+key R {
+ label: 'R'
+ number: '7'
+ base: 'r'
+ shift, capslock: 'R'
+ alt: '`'
+ shift+alt, capslock+alt: '\u20ac'
+}
+
+key S {
+ label: 'S'
+ number: '7'
+ base: 's'
+ shift, capslock: 'S'
+ alt: '\\'
+ shift+alt, capslock+alt: '\u00df'
+}
+
+key T {
+ label: 'T'
+ number: '8'
+ base: 't'
+ shift, capslock: 'T'
+ alt: '{'
+ shift+alt, capslock+alt: '\u00a3'
+}
+
+key U {
+ label: 'U'
+ number: '8'
+ base: 'u'
+ shift, capslock: 'U'
+ alt: '_'
+ shift+alt, capslock+alt: '\u0308'
+}
+
+key V {
+ label: 'V'
+ number: '8'
+ base: 'v'
+ shift, capslock: 'V'
+ alt: 'v'
+ shift+alt, capslock+alt: 'V'
+}
+
+key W {
+ label: 'W'
+ number: '9'
+ base: 'w'
+ shift, capslock: 'W'
+ alt: '~'
+ shift+alt, capslock+alt: '~'
+}
+
+key X {
+ label: 'X'
+ number: '9'
+ base: 'x'
+ shift, capslock: 'X'
+ alt: 'x'
+ shift+alt, capslock+alt: '\uef00'
+}
+
+key Y {
+ label: 'Y'
+ number: '9'
+ base: 'y'
+ shift, capslock: 'Y'
+ alt: '}'
+ shift+alt, capslock+alt: '\u00a1'
+}
+
+key Z {
+ label: 'Z'
+ number: '9'
+ base: 'z'
+ shift, capslock: 'Z'
+ alt: 'z'
+ shift+alt, capslock+alt: 'Z'
+}
+
+key COMMA {
+ label: ','
+ number: ','
+ base: ','
+ shift: '<'
+ alt: ','
+ shift+alt: ','
+}
+
+key PERIOD {
+ label: '.'
+ number: '.'
+ base: '.'
+ shift: '>'
+ alt: '.'
+ shift+alt: '\u2026'
+}
+
+key AT {
+ label: '@'
+ number: '@'
+ base: '@'
+ shift: '@'
+ alt: '@'
+ shift+alt: '\u2022'
+}
+
+key SLASH {
+ label: '/'
+ number: '/'
+ base: '/'
+ shift: '?'
+ alt: '?'
+ shift+alt: '?'
+}
+
+key SPACE {
+ label: ' '
+ number: ' '
+ base: ' '
+ shift: ' '
+ alt: '\uef01'
+ shift+alt: '\uef01'
+}
+
+key ENTER {
+ label: '\n'
+ number: '\n'
+ base: '\n'
+ shift: '\n'
+ alt: '\n'
+ shift+alt: '\n'
+}
+
+key TAB {
+ label: '\t'
+ number: '\t'
+ base: '\t'
+ shift: '\t'
+ alt: '\t'
+ shift+alt: '\t'
+}
+
+key 0 {
+ label: '0'
+ number: '0'
+ base: '0'
+ shift: ')'
+ alt: ')'
+ shift+alt: ')'
+}
+
+key 1 {
+ label: '1'
+ number: '1'
+ base: '1'
+ shift: '!'
+ alt: '!'
+ shift+alt: '!'
+}
+
+key 2 {
+ label: '2'
+ number: '2'
+ base: '2'
+ shift: '@'
+ alt: '@'
+ shift+alt: '@'
+}
+
+key 3 {
+ label: '3'
+ number: '3'
+ base: '3'
+ shift: '#'
+ alt: '#'
+ shift+alt: '#'
+}
+
+key 4 {
+ label: '4'
+ number: '4'
+ base: '4'
+ shift: '$'
+ alt: '$'
+ shift+alt: '$'
+}
+
+key 5 {
+ label: '5'
+ number: '5'
+ base: '5'
+ shift: '%'
+ alt: '%'
+ shift+alt: '%'
+}
+
+key 6 {
+ label: '6'
+ number: '6'
+ base: '6'
+ shift: '^'
+ alt: '^'
+ shift+alt: '^'
+}
+
+key 7 {
+ label: '7'
+ number: '7'
+ base: '7'
+ shift: '&'
+ alt: '&'
+ shift+alt: '&'
+}
+
+key 8 {
+ label: '8'
+ number: '8'
+ base: '8'
+ shift: '*'
+ alt: '*'
+ shift+alt: '*'
+}
+
+key 9 {
+ label: '9'
+ number: '9'
+ base: '9'
+ shift: '('
+ alt: '('
+ shift+alt: '('
+}
+
+key GRAVE {
+ label: '`'
+ number: '`'
+ base: '`'
+ shift: '~'
+ alt: '`'
+ shift+alt: '~'
+}
+
+key MINUS {
+ label: '-'
+ number: '-'
+ base: '-'
+ shift: '_'
+ alt: '-'
+ shift+alt: '_'
+}
+
+key EQUALS {
+ label: '='
+ number: '='
+ base: '='
+ shift: '+'
+ alt: '='
+ shift+alt: '+'
+}
+
+key LEFT_BRACKET {
+ label: '['
+ number: '['
+ base: '['
+ shift: '{'
+ alt: '['
+ shift+alt: '{'
+}
+
+key RIGHT_BRACKET {
+ label: ']'
+ number: ']'
+ base: ']'
+ shift: '}'
+ alt: ']'
+ shift+alt: '}'
+}
+
+key BACKSLASH {
+ label: '\\'
+ number: '\\'
+ base: '\\'
+ shift: '|'
+ alt: '\\'
+ shift+alt: '|'
+}
+
+key SEMICOLON {
+ label: ';'
+ number: ';'
+ base: ';'
+ shift: ':'
+ alt: ';'
+ shift+alt: ':'
+}
+
+key APOSTROPHE {
+ label: '\''
+ number: '\''
+ base: '\''
+ shift: '"'
+ alt: '\''
+ shift+alt: '"'
+}
+
+key STAR {
+ label: '*'
+ number: '*'
+ base: '*'
+ shift: '*'
+ alt: '*'
+ shift+alt: '*'
+}
+
+key POUND {
+ label: '#'
+ number: '#'
+ base: '#'
+ shift: '#'
+ alt: '#'
+ shift+alt: '#'
+}
+
+key PLUS {
+ label: '+'
+ number: '+'
+ base: '+'
+ shift: '+'
+ alt: '+'
+ shift+alt: '+'
+}
diff --git a/usr/keylayout/AVRCP.kl b/usr/keylayout/AVRCP.kl
new file mode 100644
index 0000000..736b43c
--- /dev/null
+++ b/usr/keylayout/AVRCP.kl
@@ -0,0 +1,23 @@
+# Copyright (C) 2010 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.
+
+# Key layout used for Bluetooth AVRCP support.
+
+key 200 MEDIA_PLAY WAKE
+key 201 MEDIA_PAUSE WAKE
+key 166 MEDIA_STOP WAKE
+key 163 MEDIA_NEXT WAKE
+key 165 MEDIA_PREVIOUS WAKE
+key 168 MEDIA_REWIND WAKE
+key 208 MEDIA_FAST_FORWARD WAKE
diff --git a/usr/keylayout/Generic.kl b/usr/keylayout/Generic.kl
new file mode 100644
index 0000000..10de6ac
--- /dev/null
+++ b/usr/keylayout/Generic.kl
@@ -0,0 +1,421 @@
+# Copyright (C) 2010 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.
+
+#
+# Generic key layout file for full alphabetic US English PC style external keyboards.
+#
+# This file is intentionally very generic and is intended to support a broad rang of keyboards.
+# Do not edit the generic key layout to support a specific keyboard; instead, create
+# a new key layout file with the required keyboard configuration.
+#
+
+key 1 ESCAPE
+key 2 1
+key 3 2
+key 4 3
+key 5 4
+key 6 5
+key 7 6
+key 8 7
+key 9 8
+key 10 9
+key 11 0
+key 12 MINUS
+key 13 EQUALS
+key 14 DEL
+key 15 TAB
+key 16 Q
+key 17 W
+key 18 E
+key 19 R
+key 20 T
+key 21 Y
+key 22 U
+key 23 I
+key 24 O
+key 25 P
+key 26 LEFT_BRACKET
+key 27 RIGHT_BRACKET
+key 28 ENTER
+key 29 CTRL_LEFT
+key 30 A
+key 31 S
+key 32 D
+key 33 F
+key 34 G
+key 35 H
+key 36 J
+key 37 K
+key 38 L
+key 39 SEMICOLON
+key 40 APOSTROPHE
+key 41 GRAVE
+key 42 SHIFT_LEFT
+key 43 BACKSLASH
+key 44 Z
+key 45 X
+key 46 C
+key 47 V
+key 48 B
+key 49 N
+key 50 M
+key 51 COMMA
+key 52 PERIOD
+key 53 SLASH
+key 54 SHIFT_RIGHT
+key 55 NUMPAD_MULTIPLY
+key 56 ALT_LEFT
+key 57 SPACE
+key 58 CAPS_LOCK
+key 59 F1
+key 60 F2
+key 61 F3
+key 62 F4
+key 63 F5
+key 64 F6
+key 65 F7
+key 66 F8
+key 67 F9
+key 68 F10
+key 69 NUM_LOCK
+key 70 SCROLL_LOCK
+key 71 NUMPAD_7
+key 72 NUMPAD_8
+key 73 NUMPAD_9
+key 74 NUMPAD_SUBTRACT
+key 75 NUMPAD_4
+key 76 NUMPAD_5
+key 77 NUMPAD_6
+key 78 NUMPAD_ADD
+key 79 NUMPAD_1
+key 80 NUMPAD_2
+key 81 NUMPAD_3
+key 82 NUMPAD_0
+key 83 NUMPAD_DOT
+# key 84 (undefined)
+# key 85 "KEY_ZENKAKUHANKAKU"
+key 86 BACKSLASH
+key 87 F11
+key 88 F12
+# key 89 "KEY_RO"
+# key 90 "KEY_KATAKANA"
+# key 91 "KEY_HIRAGANA"
+# key 92 "KEY_HENKAN"
+# key 93 "KEY_KATAKANAHIRAGANA"
+# key 94 "KEY_MUHENKAN"
+key 95 NUMPAD_COMMA
+key 96 NUMPAD_ENTER
+key 97 CTRL_RIGHT
+key 98 NUMPAD_DIVIDE
+key 99 SYSRQ
+key 100 ALT_RIGHT
+# key 101 "KEY_LINEFEED"
+key 102 MOVE_HOME
+key 103 DPAD_UP
+key 104 PAGE_UP
+key 105 DPAD_LEFT
+key 106 DPAD_RIGHT
+key 107 MOVE_END
+key 108 DPAD_DOWN
+key 109 PAGE_DOWN
+key 110 INSERT
+key 111 FORWARD_DEL
+# key 112 "KEY_MACRO"
+key 113 VOLUME_MUTE
+key 114 VOLUME_DOWN
+key 115 VOLUME_UP
+key 116 POWER WAKE
+key 117 NUMPAD_EQUALS
+# key 118 "KEY_KPPLUSMINUS"
+key 119 BREAK
+# key 120 (undefined)
+key 121 NUMPAD_COMMA
+# key 122 "KEY_HANGEUL"
+# key 123 "KEY_HANJA"
+# key 124 "KEY_YEN"
+key 125 META_LEFT
+key 126 META_RIGHT
+key 127 MENU WAKE_DROPPED
+key 128 MEDIA_STOP
+# key 129 "KEY_AGAIN"
+# key 130 "KEY_PROPS"
+# key 131 "KEY_UNDO"
+# key 132 "KEY_FRONT"
+# key 133 "KEY_COPY"
+# key 134 "KEY_OPEN"
+# key 135 "KEY_PASTE"
+# key 136 "KEY_FIND"
+# key 137 "KEY_CUT"
+# key 138 "KEY_HELP"
+key 139 MENU WAKE_DROPPED
+# key 140 "KEY_CALC"
+# key 141 "KEY_SETUP"
+key 142 POWER WAKE
+key 143 POWER WAKE
+# key 144 "KEY_FILE"
+# key 145 "KEY_SENDFILE"
+# key 146 "KEY_DELETEFILE"
+# key 147 "KEY_XFER"
+# key 148 "KEY_PROG1"
+# key 149 "KEY_PROG2"
+key 150 EXPLORER
+# key 151 "KEY_MSDOS"
+key 152 POWER WAKE
+# key 153 "KEY_DIRECTION"
+# key 154 "KEY_CYCLEWINDOWS"
+key 155 ENVELOPE
+key 156 BOOKMARK
+# key 157 "KEY_COMPUTER"
+key 158 BACK WAKE_DROPPED
+key 159 FORWARD
+key 160 MEDIA_CLOSE
+key 161 MEDIA_EJECT
+key 162 MEDIA_EJECT
+key 163 MEDIA_NEXT
+key 164 MEDIA_PLAY_PAUSE
+key 165 MEDIA_PREVIOUS
+key 166 MEDIA_STOP
+key 167 MEDIA_RECORD
+key 168 MEDIA_REWIND
+key 169 CALL
+# key 170 "KEY_ISO"
+# key 171 "KEY_CONFIG"
+key 172 HOME
+# key 173 "KEY_REFRESH"
+# key 174 "KEY_EXIT"
+# key 175 "KEY_MOVE"
+# key 176 "KEY_EDIT"
+key 177 PAGE_UP
+key 178 PAGE_DOWN
+key 179 NUMPAD_LEFT_PAREN
+key 180 NUMPAD_RIGHT_PAREN
+# key 181 "KEY_NEW"
+# key 182 "KEY_REDO"
+# key 183 F13
+# key 184 F14
+# key 185 F15
+# key 186 F16
+# key 187 F17
+# key 188 F18
+# key 189 F19
+# key 190 F20
+# key 191 F21
+# key 192 F22
+# key 193 F23
+# key 194 F24
+# key 195 (undefined)
+# key 196 (undefined)
+# key 197 (undefined)
+# key 198 (undefined)
+# key 199 (undefined)
+key 200 MEDIA_PLAY
+key 201 MEDIA_PAUSE
+# key 202 "KEY_PROG3"
+# key 203 "KEY_PROG4"
+# key 204 (undefined)
+# key 205 "KEY_SUSPEND"
+# key 206 "KEY_CLOSE"
+key 207 MEDIA_PLAY
+key 208 MEDIA_FAST_FORWARD
+# key 209 "KEY_BASSBOOST"
+# key 210 "KEY_PRINT"
+# key 211 "KEY_HP"
+key 212 CAMERA
+# key 213 "KEY_SOUND"
+# key 214 "KEY_QUESTION"
+key 215 ENVELOPE
+# key 216 "KEY_CHAT"
+key 217 SEARCH
+# key 218 "KEY_CONNECT"
+# key 219 "KEY_FINANCE"
+# key 220 "KEY_SPORT"
+# key 221 "KEY_SHOP"
+# key 222 "KEY_ALTERASE"
+# key 223 "KEY_CANCEL"
+# key 224 "KEY_BRIGHTNESSDOWN"
+# key 225 "KEY_BRIGHTNESSUP"
+key 226 HEADSETHOOK
+
+key 256 BUTTON_1
+key 257 BUTTON_2
+key 258 BUTTON_3
+key 259 BUTTON_4
+key 260 BUTTON_5
+key 261 BUTTON_6
+key 262 BUTTON_7
+key 263 BUTTON_8
+key 264 BUTTON_9
+key 265 BUTTON_10
+key 266 BUTTON_11
+key 267 BUTTON_12
+key 268 BUTTON_13
+key 269 BUTTON_14
+key 270 BUTTON_15
+key 271 BUTTON_16
+
+key 288 BUTTON_1
+key 289 BUTTON_2
+key 290 BUTTON_3
+key 291 BUTTON_4
+key 292 BUTTON_5
+key 293 BUTTON_6
+key 294 BUTTON_7
+key 295 BUTTON_8
+key 296 BUTTON_9
+key 297 BUTTON_10
+key 298 BUTTON_11
+key 299 BUTTON_12
+key 300 BUTTON_13
+key 301 BUTTON_14
+key 302 BUTTON_15
+key 303 BUTTON_16
+
+
+key 304 BUTTON_A
+key 305 BUTTON_B
+key 306 BUTTON_C
+key 307 BUTTON_X
+key 308 BUTTON_Y
+key 309 BUTTON_Z
+key 310 BUTTON_L1
+key 311 BUTTON_R1
+key 312 BUTTON_L2
+key 313 BUTTON_R2
+key 314 BUTTON_SELECT
+key 315 BUTTON_START
+key 316 BUTTON_MODE
+key 317 BUTTON_THUMBL
+key 318 BUTTON_THUMBR
+
+
+# key 352 "KEY_OK"
+# key 353 "KEY_SELECT"
+# key 354 "KEY_GOTO"
+# key 355 "KEY_CLEAR"
+# key 356 "KEY_POWER2"
+# key 357 "KEY_OPTION"
+# key 358 "KEY_INFO"
+# key 359 "KEY_TIME"
+# key 360 "KEY_VENDOR"
+# key 361 "KEY_ARCHIVE"
+key 362 GUIDE
+# key 363 "KEY_CHANNEL"
+# key 364 "KEY_FAVORITES"
+# key 365 "KEY_EPG"
+key 366 DVR
+# key 367 "KEY_MHP"
+# key 368 "KEY_LANGUAGE"
+# key 369 "KEY_TITLE"
+# key 370 "KEY_SUBTITLE"
+# key 371 "KEY_ANGLE"
+# key 372 "KEY_ZOOM"
+# key 373 "KEY_MODE"
+# key 374 "KEY_KEYBOARD"
+# key 375 "KEY_SCREEN"
+# key 376 "KEY_PC"
+key 377 TV
+# key 378 "KEY_TV2"
+# key 379 "KEY_VCR"
+# key 380 "KEY_VCR2"
+# key 381 "KEY_SAT"
+# key 382 "KEY_SAT2"
+# key 383 "KEY_CD"
+# key 384 "KEY_TAPE"
+# key 385 "KEY_RADIO"
+# key 386 "KEY_TUNER"
+# key 387 "KEY_PLAYER"
+# key 388 "KEY_TEXT"
+# key 389 "KEY_DVD"
+# key 390 "KEY_AUX"
+# key 391 "KEY_MP3"
+# key 392 "KEY_AUDIO"
+# key 393 "KEY_VIDEO"
+# key 394 "KEY_DIRECTORY"
+# key 395 "KEY_LIST"
+# key 396 "KEY_MEMO"
+# key 397 "KEY_CALENDAR"
+# key 398 "KEY_RED"
+# key 399 "KEY_GREEN"
+# key 400 "KEY_YELLOW"
+# key 401 "KEY_BLUE"
+key 402 CHANNEL_UP
+key 403 CHANNEL_DOWN
+# key 404 "KEY_FIRST"
+# key 405 "KEY_LAST"
+# key 406 "KEY_AB"
+# key 407 "KEY_NEXT"
+# key 408 "KEY_RESTART"
+# key 409 "KEY_SLOW"
+# key 410 "KEY_SHUFFLE"
+# key 411 "KEY_BREAK"
+# key 412 "KEY_PREVIOUS"
+# key 413 "KEY_DIGITS"
+# key 414 "KEY_TEEN"
+# key 415 "KEY_TWEN"
+
+
+# key 448 "KEY_DEL_EOL"
+# key 449 "KEY_DEL_EOS"
+# key 450 "KEY_INS_LINE"
+# key 451 "KEY_DEL_LINE"
+
+
+key 464 FUNCTION
+key 465 ESCAPE FUNCTION
+key 466 F1 FUNCTION
+key 467 F2 FUNCTION
+key 468 F3 FUNCTION
+key 469 F4 FUNCTION
+key 470 F5 FUNCTION
+key 471 F6 FUNCTION
+key 472 F7 FUNCTION
+key 473 F8 FUNCTION
+key 474 F9 FUNCTION
+key 475 F10 FUNCTION
+key 476 F11 FUNCTION
+key 477 F12 FUNCTION
+key 478 1 FUNCTION
+key 479 2 FUNCTION
+key 480 D FUNCTION
+key 481 E FUNCTION
+key 482 F FUNCTION
+key 483 S FUNCTION
+key 484 B FUNCTION
+
+
+# key 497 KEY_BRL_DOT1
+# key 498 KEY_BRL_DOT2
+# key 499 KEY_BRL_DOT3
+# key 500 KEY_BRL_DOT4
+# key 501 KEY_BRL_DOT5
+# key 502 KEY_BRL_DOT6
+# key 503 KEY_BRL_DOT7
+# key 504 KEY_BRL_DOT8
+
+
+# Joystick and game controller axes.
+# Axes that are not mapped will be assigned generic axis numbers by the input subsystem.
+axis 0x00 X
+axis 0x01 Y
+axis 0x02 Z
+axis 0x03 RX
+axis 0x04 RY
+axis 0x05 RZ
+axis 0x06 THROTTLE
+axis 0x07 RUDDER
+axis 0x08 WHEEL
+axis 0x09 GAS
+axis 0x0a BRAKE
+axis 0x10 HAT_X
+axis 0x11 HAT_Y
diff --git a/usr/keylayout/Vendor_045e_Product_028e.kl b/usr/keylayout/Vendor_045e_Product_028e.kl
new file mode 100644
index 0000000..99f046a
--- /dev/null
+++ b/usr/keylayout/Vendor_045e_Product_028e.kl
@@ -0,0 +1,46 @@
+# Copyright (C) 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.
+
+#
+# XBox 360 USB Controller
+#
+
+key 304 BUTTON_A
+key 305 BUTTON_B
+key 307 BUTTON_X
+key 308 BUTTON_Y
+key 310 BUTTON_L1
+key 311 BUTTON_R1
+key 314 BUTTON_SELECT
+key 315 BUTTON_START
+key 316 BUTTON_MODE
+key 317 BUTTON_THUMBL
+key 318 BUTTON_THUMBR
+
+# Left and right stick.
+# The reported value for flat is 128 out of a range from -32767 to 32768, which is absurd.
+# This confuses applications that rely on the flat value because the joystick actually
+# settles in a flat range of +/- 4096 or so.
+axis 0x00 X flat 4096
+axis 0x01 Y flat 4096
+axis 0x03 Z flat 4096
+axis 0x04 RZ flat 4096
+
+# Triggers.
+axis 0x02 LTRIGGER
+axis 0x05 RTRIGGER
+
+# Hat.
+axis 0x10 HAT_X
+axis 0x11 HAT_Y
diff --git a/usr/keylayout/Vendor_046d_Product_c216.kl b/usr/keylayout/Vendor_046d_Product_c216.kl
new file mode 100644
index 0000000..6743323
--- /dev/null
+++ b/usr/keylayout/Vendor_046d_Product_c216.kl
@@ -0,0 +1,37 @@
+# Copyright (C) 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.
+
+#
+# Logitech Dual Action Controller
+#
+
+key 0x120 BUTTON_A
+key 0x123 BUTTON_B
+key 0x121 BUTTON_X
+key 0x122 BUTTON_Y
+key 0x124 BUTTON_L1
+key 0x125 BUTTON_R1
+key 0x126 BUTTON_L2
+key 0x127 BUTTON_R2
+key 0x128 BUTTON_SELECT
+key 0x129 BUTTON_START
+key 0x12a BUTTON_THUMBL
+key 0x12b BUTTON_THUMBR
+
+axis 0x00 X
+axis 0x01 Y
+axis 0x02 Z
+axis 0x05 RZ
+axis 0x10 HAT_X
+axis 0x11 HAT_Y
diff --git a/usr/keylayout/Vendor_046d_Product_c294.kl b/usr/keylayout/Vendor_046d_Product_c294.kl
new file mode 100644
index 0000000..5492f49
--- /dev/null
+++ b/usr/keylayout/Vendor_046d_Product_c294.kl
@@ -0,0 +1,53 @@
+# Copyright (C) 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.
+
+#
+# Logitech G25 Racing Wheel (in Compatibility Mode)
+#
+
+# 4 way buttons above hat
+key 0x121 BUTTON_A
+key 0x123 BUTTON_B
+key 0x120 BUTTON_X
+key 0x122 BUTTON_Y
+
+# Row of buttons under hat
+key 0x12b BUTTON_1
+key 0x128 BUTTON_2
+key 0x129 BUTTON_3
+key 0x12a BUTTON_4
+
+# Gear shift positions
+# 0x12a top-left gear (aliased as BUTTON_4)
+# 0x12b bottom-left gear (aliased as BUTTON_1)
+
+# Buttons on wheel
+key 0x127 BUTTON_L1
+key 0x126 BUTTON_R1
+
+# Toggles under wheel
+key 0x125 BUTTON_L2
+key 0x124 BUTTON_R2
+
+# Hat
+axis 0x10 HAT_X
+axis 0x11 HAT_Y
+
+# Steering Wheel
+axis 0x00 WHEEL
+
+# Accelerator / Brake
+# 00..7e : accelerator
+# 80..ff : brake
+axis 0x01 split 0x7f GAS BRAKE
diff --git a/usr/keylayout/Vendor_046d_Product_c299.kl b/usr/keylayout/Vendor_046d_Product_c299.kl
new file mode 100644
index 0000000..d42963d
--- /dev/null
+++ b/usr/keylayout/Vendor_046d_Product_c299.kl
@@ -0,0 +1,62 @@
+# Copyright (C) 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.
+
+#
+# Logitech G25 Racing Wheel (in Native Mode)
+#
+
+# 4 way buttons above hat
+key 0x121 BUTTON_A
+key 0x123 BUTTON_B
+key 0x120 BUTTON_X
+key 0x122 BUTTON_Y
+
+# Row of buttons under hat
+key 0x12b BUTTON_1
+key 0x128 BUTTON_2
+key 0x129 BUTTON_3
+key 0x12a BUTTON_4
+
+# Gear shift positions
+key 0x12c BUTTON_5
+key 0x12d BUTTON_6
+key 0x12e BUTTON_7
+key 0x12f BUTTON_8
+key 0x2d0 BUTTON_9
+key 0x2d1 BUTTON_10
+key 0x2d2 BUTTON_11
+
+# Buttons on wheel
+key 0x127 BUTTON_L1
+key 0x126 BUTTON_R1
+
+# Toggles under wheel
+key 0x125 BUTTON_L2
+key 0x124 BUTTON_R2
+
+# Hat
+axis 0x10 HAT_X
+axis 0x11 HAT_Y
+
+# Steering Wheel
+axis 0x00 WHEEL
+
+# Clutch
+axis 0x01 invert GENERIC_1
+
+# Accelerator
+axis 0x02 invert GAS
+
+# Brake
+axis 0x05 invert BRAKE
diff --git a/usr/keylayout/Vendor_046d_Product_c532.kl b/usr/keylayout/Vendor_046d_Product_c532.kl
new file mode 100644
index 0000000..741c2e1
--- /dev/null
+++ b/usr/keylayout/Vendor_046d_Product_c532.kl
@@ -0,0 +1,133 @@
+# Copyright (C) 2010 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.
+
+#
+# Logitech Revue Wireless keyboard
+#
+# Notes:
+# - The GRAVE key is emulated by the keyboard.
+# ALT + LEFT_BRACKET produces GRAVE.
+# ALT + RIGHT_BRACKET produces SHIFT + GRAVE.
+# - FORWARD_DEL is produced by fn + BACKSPACE
+# - PAGE_UP / PAGE_DOWN is produced by fn + CHANNEL_UP / CHANNEL_DOWN
+# - The AVR / STB / TV power and input buttons seem to be non-functional
+# as well as several of the other fn buttons and the PIP button?
+
+key 1 ESCAPE
+key 2 1
+key 3 2
+key 4 3
+key 5 4
+key 6 5
+key 7 6
+key 8 7
+key 9 8
+key 10 9
+key 11 0
+key 12 MINUS
+key 13 EQUALS
+key 14 DEL
+key 15 TAB
+key 16 Q
+key 17 W
+key 18 E
+key 19 R
+key 20 T
+key 21 Y
+key 22 U
+key 23 I
+key 24 O
+key 25 P
+key 26 LEFT_BRACKET
+key 27 RIGHT_BRACKET
+key 28 ENTER
+key 29 CTRL_LEFT
+key 30 A
+key 31 S
+key 32 D
+key 33 F
+key 34 G
+key 35 H
+key 36 J
+key 37 K
+key 38 L
+key 39 SEMICOLON
+key 40 APOSTROPHE
+key 41 GRAVE
+key 42 SHIFT_LEFT
+key 43 BACKSLASH
+key 44 Z
+key 45 X
+key 46 C
+key 47 V
+key 48 B
+key 49 N
+key 50 M
+key 51 COMMA
+key 52 PERIOD
+key 53 SLASH
+key 54 SHIFT_RIGHT
+key 56 ALT_RIGHT
+key 57 SPACE
+key 58 CAPS_LOCK
+key 59 F1
+key 60 F2
+key 61 F3
+key 62 F4
+key 63 F5
+key 64 F6
+key 65 F7
+key 66 F8
+key 67 F9
+key 68 F10
+key 87 F11
+key 88 F12
+key 96 DPAD_CENTER
+key 97 CTRL_RIGHT
+key 102 MOVE_HOME
+key 103 DPAD_UP
+key 104 PAGE_UP
+key 105 DPAD_LEFT
+key 106 DPAD_RIGHT
+key 107 MOVE_END
+key 108 DPAD_DOWN
+key 109 PAGE_DOWN
+key 110 NUMPAD_ENTER
+key 111 FORWARD_DEL
+key 113 VOLUME_MUTE
+key 114 VOLUME_DOWN
+key 115 VOLUME_UP
+key 119 MEDIA_PAUSE
+key 125 SEARCH
+key 127 MENU
+key 156 BOOKMARK
+key 158 BACK
+key 163 MEDIA_NEXT
+key 165 MEDIA_PREVIOUS
+key 166 MEDIA_STOP
+key 167 MEDIA_RECORD
+key 168 MEDIA_REWIND
+key 172 HOME
+key 207 MEDIA_PLAY
+key 208 MEDIA_FAST_FORWARD
+# key 288 left mouse button
+# key 289 right mouse button (fn + button)
+key 362 GUIDE
+key 366 DVR
+key 377 TV
+key 402 CHANNEL_UP
+key 403 CHANNEL_DOWN
+key 418 ZOOM_IN
+key 419 ZOOM_OUT
+
diff --git a/usr/keylayout/Vendor_054c_Product_0268.kl b/usr/keylayout/Vendor_054c_Product_0268.kl
new file mode 100644
index 0000000..f8ac6a3
--- /dev/null
+++ b/usr/keylayout/Vendor_054c_Product_0268.kl
@@ -0,0 +1,76 @@
+# Copyright (C) 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.
+
+#
+# Sony Playstation(R)3 Controller
+#
+
+key 0x124 DPAD_UP
+key 0x125 DPAD_RIGHT
+key 0x126 DPAD_DOWN
+key 0x127 DPAD_LEFT
+
+key 0x120 BUTTON_SELECT
+key 0x123 BUTTON_START
+key 0x12f BUTTON_A
+key 0x12c BUTTON_B
+key 0x12e BUTTON_X
+key 0x12d BUTTON_Y
+key 0x12a BUTTON_L1
+key 0x12b BUTTON_R1
+key 0x128 BUTTON_L2
+key 0x129 BUTTON_R2
+key 0x121 BUTTON_THUMBL
+key 0x122 BUTTON_THUMBR
+
+# PS key
+key 0x2d0 BUTTON_1
+
+# Left Analog Stick
+axis 0x00 X
+axis 0x01 Y
+
+# Right Analog Stick
+axis 0x02 Z
+axis 0x05 RZ
+
+# DPAD
+# axis 0x2c -HAT_Y
+# axis 0x2d +HAT_X
+# axis 0x2e +HAT_Y
+# axis 0x2f -HAT_X
+
+# L2 trigger
+axis 0x30 LTRIGGER
+
+# R2 trigger
+axis 0x31 RTRIGGER
+
+# L1 trigger
+# axis 0x32
+
+# R1 trigger
+# axis 0x33
+
+# Triangle
+# axis 0x34
+
+# Circle
+# axis 0x35
+
+# Cross
+# axis 0x36
+
+# Square
+# axis 0x37
diff --git a/usr/keylayout/Vendor_05ac_Product_0239.kl b/usr/keylayout/Vendor_05ac_Product_0239.kl
new file mode 100644
index 0000000..6bd3753
--- /dev/null
+++ b/usr/keylayout/Vendor_05ac_Product_0239.kl
@@ -0,0 +1,119 @@
+# Copyright (C) 2010 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.
+
+#
+# Apple Wireless Keyboard
+#
+# Notes:
+# - Keys such as PAGE_UP and FORWARD_DEL are produced using the
+# function key.
+# - Special function keys for brightness control, etc. are not
+# implemented here.
+
+key 1 ESCAPE
+key 2 1
+key 3 2
+key 4 3
+key 5 4
+key 6 5
+key 7 6
+key 8 7
+key 9 8
+key 10 9
+key 11 0
+key 12 MINUS
+key 13 EQUALS
+key 14 DEL
+key 15 TAB
+key 16 Q
+key 17 W
+key 18 E
+key 19 R
+key 20 T
+key 21 Y
+key 22 U
+key 23 I
+key 24 O
+key 25 P
+key 26 LEFT_BRACKET
+key 27 RIGHT_BRACKET
+key 28 ENTER
+key 29 CTRL_LEFT
+key 30 A
+key 31 S
+key 32 D
+key 33 F
+key 34 G
+key 35 H
+key 36 J
+key 37 K
+key 38 L
+key 39 SEMICOLON
+key 40 APOSTROPHE
+key 41 GRAVE
+key 42 SHIFT_LEFT
+key 43 BACKSLASH
+key 44 Z
+key 45 X
+key 46 C
+key 47 V
+key 48 B
+key 49 N
+key 50 M
+key 51 COMMA
+key 52 PERIOD
+key 53 SLASH
+key 54 SHIFT_RIGHT
+key 56 ALT_LEFT
+key 57 SPACE
+key 58 CAPS_LOCK
+key 59 F1
+key 60 F2
+key 61 F3
+key 62 F4
+key 63 F5
+key 64 F6
+key 65 F7
+key 66 F8
+key 67 F9
+key 68 F10
+key 87 F11
+key 88 F12
+key 100 ALT_RIGHT
+key 102 MOVE_HOME
+key 103 DPAD_UP
+key 104 PAGE_UP
+key 105 DPAD_LEFT
+key 106 DPAD_RIGHT
+key 107 MOVE_END
+key 108 DPAD_DOWN
+key 109 PAGE_DOWN
+key 110 NUMPAD_ENTER
+key 111 FORWARD_DEL
+key 113 VOLUME_MUTE
+key 114 VOLUME_DOWN
+key 115 VOLUME_UP
+key 120 APP_SWITCH
+key 125 META_LEFT
+key 126 META_RIGHT
+key 161 MEDIA_EJECT
+key 163 MEDIA_NEXT
+key 164 MEDIA_PLAY_PAUSE
+key 165 MEDIA_PREVIOUS
+# key 204 show gadgets
+# key 224 reduce brightness
+# key 225 increase brightness
+# key 229 blank special function on F5
+# key 230 blank special function on F6
+key 464 FUNCTION
diff --git a/usr/keylayout/Vendor_22b8_Product_093d.kl b/usr/keylayout/Vendor_22b8_Product_093d.kl
new file mode 100644
index 0000000..2749c5b
--- /dev/null
+++ b/usr/keylayout/Vendor_22b8_Product_093d.kl
@@ -0,0 +1,105 @@
+# Copyright (C) 2010 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.
+
+#
+# Motorola Bluetooth Wireless Keyboard.
+#
+
+key 1 BACK
+key 2 1
+key 3 2
+key 4 3
+key 5 4
+key 6 5
+key 7 6
+key 8 7
+key 9 8
+key 10 9
+key 11 0
+key 12 MINUS
+key 13 EQUALS
+key 14 DEL
+key 15 TAB
+key 16 Q
+key 17 W
+key 18 E
+key 19 R
+key 20 T
+key 21 Y
+key 22 U
+key 23 I
+key 24 O
+key 25 P
+key 26 LEFT_BRACKET
+key 27 RIGHT_BRACKET
+key 28 ENTER
+key 29 CTRL_LEFT
+key 30 A
+key 31 S
+key 32 D
+key 33 F
+key 34 G
+key 35 H
+key 36 J
+key 37 K
+key 38 L
+key 39 SEMICOLON
+key 40 APOSTROPHE
+key 41 GRAVE
+key 42 SHIFT_LEFT
+key 43 BACKSLASH
+key 44 Z
+key 45 X
+key 46 C
+key 47 V
+key 48 B
+key 49 N
+key 50 M
+key 51 COMMA
+key 52 PERIOD
+key 53 SLASH
+key 54 SHIFT_RIGHT
+key 56 ALT_LEFT
+key 57 SPACE
+key 58 CAPS_LOCK
+key 59 F1
+key 60 F2
+key 61 F3
+key 62 F4
+key 63 F5
+key 64 F6
+key 65 F7
+key 66 F8
+key 67 F9
+key 68 F10
+key 87 F11
+key 88 F12
+key 97 CTRL_RIGHT
+key 102 HOME
+key 103 DPAD_UP
+key 105 DPAD_LEFT
+key 106 DPAD_RIGHT
+key 107 MOVE_END
+key 108 DPAD_DOWN
+key 111 FORWARD_DEL
+key 113 VOLUME_MUTE
+key 114 VOLUME_DOWN
+key 115 VOLUME_UP
+key 125 MENU
+key 127 SEARCH
+key 163 MEDIA_NEXT
+key 164 MEDIA_PLAY_PAUSE
+key 165 MEDIA_PREVIOUS
+key 166 MEDIA_STOP
+# key 226 tbd reserved key
diff --git a/usr/keylayout/gpio-keys.kl b/usr/keylayout/gpio-keys.kl
new file mode 100644
index 0000000..b7abd0b
--- /dev/null
+++ b/usr/keylayout/gpio-keys.kl
@@ -0,0 +1,11 @@
+key 115 VOLUME_UP WAKE
+key 114 VOLUME_DOWN WAKE
+key 102 HOME WAKE
+key 107 ENDCALL
+key 105 DPAD_LEFT
+key 106 DPAD_RIGHT
+key 103 DPAD_UP
+key 108 DPAD_DOWN
+key 232 DPAD_CENTER
+key 116 POWER WAKE
+key 212 CAMERA WAKE
diff --git a/usr/keylayout/max8997-muic.kl b/usr/keylayout/max8997-muic.kl
new file mode 100644
index 0000000..3357004
--- /dev/null
+++ b/usr/keylayout/max8997-muic.kl
@@ -0,0 +1,6 @@
+key 115 VOLUME_UP WAKE
+key 114 VOLUME_DOWN WAKE
+key 164 MEDIA_PLAY_PAUSE WAKE
+key 163 MEDIA_NEXT WAKE
+key 165 MEDIA_PREVIOUS WAKE
+key 226 HEADSETHOOK WAKE
diff --git a/usr/keylayout/melfas-touchkey.kl b/usr/keylayout/melfas-touchkey.kl
new file mode 100644
index 0000000..22db299
--- /dev/null
+++ b/usr/keylayout/melfas-touchkey.kl
@@ -0,0 +1,3 @@
+key 158 BACK VIRTUAL
+key 139 MENU VIRTUAL
+
diff --git a/usr/keylayout/qwerty.kl b/usr/keylayout/qwerty.kl
new file mode 100644
index 0000000..f1caacd
--- /dev/null
+++ b/usr/keylayout/qwerty.kl
@@ -0,0 +1,112 @@
+# Copyright (C) 2010 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.
+
+#
+# Emulator keyboard layout #1.
+#
+# This file is no longer used as the platform's default keyboard layout.
+# Refer to Generic.kl instead.
+#
+
+key 399 GRAVE
+key 2 1
+key 3 2
+key 4 3
+key 5 4
+key 6 5
+key 7 6
+key 8 7
+key 9 8
+key 10 9
+key 11 0
+key 158 BACK WAKE_DROPPED
+key 230 SOFT_RIGHT WAKE
+key 60 SOFT_RIGHT WAKE
+key 107 ENDCALL WAKE_DROPPED
+key 62 ENDCALL WAKE_DROPPED
+key 229 MENU WAKE_DROPPED
+key 139 MENU WAKE_DROPPED
+key 59 MENU WAKE_DROPPED
+key 127 SEARCH WAKE_DROPPED
+key 217 SEARCH WAKE_DROPPED
+key 228 POUND
+key 227 STAR
+key 231 CALL WAKE_DROPPED
+key 61 CALL WAKE_DROPPED
+key 232 DPAD_CENTER WAKE_DROPPED
+key 108 DPAD_DOWN WAKE_DROPPED
+key 103 DPAD_UP WAKE_DROPPED
+key 102 HOME WAKE
+key 105 DPAD_LEFT WAKE_DROPPED
+key 106 DPAD_RIGHT WAKE_DROPPED
+key 115 VOLUME_UP WAKE
+key 114 VOLUME_DOWN WAKE
+key 116 POWER WAKE
+key 212 CAMERA
+
+key 16 Q
+key 17 W
+key 18 E
+key 19 R
+key 20 T
+key 21 Y
+key 22 U
+key 23 I
+key 24 O
+key 25 P
+key 26 LEFT_BRACKET
+key 27 RIGHT_BRACKET
+key 43 BACKSLASH
+
+key 30 A
+key 31 S
+key 32 D
+key 33 F
+key 34 G
+key 35 H
+key 36 J
+key 37 K
+key 38 L
+key 39 SEMICOLON
+key 40 APOSTROPHE
+key 14 DEL
+
+key 44 Z
+key 45 X
+key 46 C
+key 47 V
+key 48 B
+key 49 N
+key 50 M
+key 51 COMMA
+key 52 PERIOD
+key 53 SLASH
+key 28 ENTER
+
+key 56 ALT_LEFT
+key 100 ALT_RIGHT
+key 42 SHIFT_LEFT
+key 54 SHIFT_RIGHT
+key 15 TAB
+key 57 SPACE
+key 150 EXPLORER
+key 155 ENVELOPE
+
+key 12 MINUS
+key 13 EQUALS
+key 215 AT
+
+# On an AT keyboard: ESC, F10
+key 1 BACK WAKE_DROPPED
+key 68 MENU WAKE_DROPPED
diff --git a/usr/keylayout/samsung-keypad.kl b/usr/keylayout/samsung-keypad.kl
new file mode 100644
index 0000000..36fad0e
--- /dev/null
+++ b/usr/keylayout/samsung-keypad.kl
@@ -0,0 +1,10 @@
+key 2 DPAD_UP WAKE_DROPPED
+key 3 DPAD_CENTER WAKE_DROPPED
+key 4 DPAD_DOWN WAKE_DROPPED
+key 5 DPAD_RIGHT WAKE_DROPPED
+key 6 DPAD_LEFT WAKE_DROPPED
+key 18 VOLUME_DOWN WAKE
+key 30 SEARCH WAKE_DROPPED
+key 32 MENU WAKE_DROPPED
+key 46 VOLUME_UP WAKE
+key 48 BACK WAKE_DROPPED
diff --git a/usr/keylayout/sec_key.kl b/usr/keylayout/sec_key.kl
new file mode 100644
index 0000000..b7abd0b
--- /dev/null
+++ b/usr/keylayout/sec_key.kl
@@ -0,0 +1,11 @@
+key 115 VOLUME_UP WAKE
+key 114 VOLUME_DOWN WAKE
+key 102 HOME WAKE
+key 107 ENDCALL
+key 105 DPAD_LEFT
+key 106 DPAD_RIGHT
+key 103 DPAD_UP
+key 108 DPAD_DOWN
+key 232 DPAD_CENTER
+key 116 POWER WAKE
+key 212 CAMERA WAKE
diff --git a/usr/keylayout/sec_touchkey.kl b/usr/keylayout/sec_touchkey.kl
new file mode 100644
index 0000000..7d79415
--- /dev/null
+++ b/usr/keylayout/sec_touchkey.kl
@@ -0,0 +1,2 @@
+key 158 BACK VIRTUAL
+key 139 MENU VIRTUAL
diff --git a/vendorsetup.sh b/vendorsetup.sh
new file mode 100755
index 0000000..6eaa94a
--- /dev/null
+++ b/vendorsetup.sh
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2012 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.
+#
+
+add_lunch_combo full_galaxys2-eng
+add_lunch_combo cm_galaxys2-userdebug
diff --git a/zImage b/zImage
new file mode 100755
index 0000000..c1a9d35
--- /dev/null
+++ b/zImage
Binary files differ