├── liblight ├── MODULE_LICENSE_APACHE2 ├── Android.mk ├── lights.h ├── lights.c └── NOTICE ├── board-info.txt ├── config ├── egl.cfg ├── pmic8058_pwrkey.kl ├── simple_remote.kl ├── atdaemon.kl ├── clearpad.kl ├── vold.fstab ├── gpio-key.kl ├── keypad-pmic-fuji.kl ├── fuji-keypad.kl ├── fstab.lt26 ├── calibration ├── clearpad.idc ├── init.qcom.efs.sync.sh ├── init.semc.usb.rc ├── ueventd.semc.rc └── init.semc.rc ├── AndroidProducts.mk ├── kernel ├── system.prop ├── apply_patches ├── recovery.fstab ├── rootdir └── system │ └── etc │ └── sensors.conf ├── vendorsetup.sh ├── full_lt26.mk ├── overlay └── frameworks │ └── base │ └── core │ └── res │ └── res │ ├── values │ └── config.xml │ └── xml │ └── storage_list.xml ├── prebuilt └── hw_config.sh ├── patches ├── 0002-eglsubAndroid-compatibility-hack.patch └── 0001-egl-Reintroduce-eglGetRenderBufferANDROID.patch ├── README.md ├── CleanSpec.mk ├── BoardConfig.mk ├── tools ├── mkbootimg.py └── mkelf.py └── device.mk /liblight/MODULE_LICENSE_APACHE2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /board-info.txt: -------------------------------------------------------------------------------- 1 | require board=LT26i 2 | -------------------------------------------------------------------------------- /config/egl.cfg: -------------------------------------------------------------------------------- 1 | 0 0 android 2 | 0 1 adreno200 3 | -------------------------------------------------------------------------------- /config/pmic8058_pwrkey.kl: -------------------------------------------------------------------------------- 1 | key 116 POWER WAKE 2 | 3 | -------------------------------------------------------------------------------- /AndroidProducts.mk: -------------------------------------------------------------------------------- 1 | PRODUCT_MAKEFILES := \ 2 | $(LOCAL_DIR)/full_lt26.mk 3 | -------------------------------------------------------------------------------- /kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sonyxperiadev/device-sony-lt26/HEAD/kernel -------------------------------------------------------------------------------- /config/simple_remote.kl: -------------------------------------------------------------------------------- 1 | key 256 HEADSETHOOK WAKE 2 | key 257 VOLUME_UP WAKE 3 | key 258 VOLUME_DOWN WAKE 4 | -------------------------------------------------------------------------------- /config/atdaemon.kl: -------------------------------------------------------------------------------- 1 | # There need to exist a .kl file for each input device or the platform will 2 | # fallback to qwerty.kl and think that a hardware keyboard exist. 3 | 4 | -------------------------------------------------------------------------------- /config/clearpad.kl: -------------------------------------------------------------------------------- 1 | # KEY_MENU, KEY_HOME, KEY_BACK 2 | key 139 MENU VIRTUAL 3 | key 102 HOME VIRTUAL 4 | key 158 BACK VIRTUAL 5 | 6 | -------------------------------------------------------------------------------- /config/vold.fstab: -------------------------------------------------------------------------------- 1 | dev_mount sdcard /storage/sdcard0 15 /devices/platform/msm_sdcc.1/mmc_host/mmc0 2 | dev_mount usbdisk /storage/usbdisk auto /devices/platform/msm_hsusb_host.0 3 | -------------------------------------------------------------------------------- /system.prop: -------------------------------------------------------------------------------- 1 | ro.sf.lcd_density=320 2 | 3 | wifi.interface=wlan0 4 | wifi.supplicant_scan_interval=15 5 | 6 | rild.libpath=/system/lib/libril-qc-qmi-1.so 7 | rild.libargs=-d /dev/smd0 8 | -------------------------------------------------------------------------------- /apply_patches: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd frameworks/native 4 | git apply ../../device/sony/lt26/patches/0001-egl-Reintroduce-eglGetRenderBufferANDROID.patch 5 | git apply ../../device/sony/lt26/patches/0002-eglsubAndroid-compatibility-hack.patch 6 | -------------------------------------------------------------------------------- /config/gpio-key.kl: -------------------------------------------------------------------------------- 1 | # this corresponds to kernel/arch/arm/mach-msm/keypad-fuji_nozomi.c 2 | # 3 | # defines for values are in frameworks/base/include/ui/KeycodeLabels.h 4 | 5 | # KEY_VOLUMEDOWN 6 | 7 | key 114 VOLUME_DOWN WAKE 8 | 9 | -------------------------------------------------------------------------------- /config/keypad-pmic-fuji.kl: -------------------------------------------------------------------------------- 1 | # this corresponds to kernel/arch/arm/mach-msm/keypad-fuji_nozomi.c 2 | # 3 | # defines for values are in frameworks/base/include/ui/KeycodeLabels.h 4 | 5 | # KEY_VOLUMEUP 6 | 7 | key 115 VOLUME_UP WAKE 8 | 9 | -------------------------------------------------------------------------------- /config/fuji-keypad.kl: -------------------------------------------------------------------------------- 1 | # this corresponds to kernel/arch/arm/mach-msm/keypad-fuji_nozomi.c 2 | # 3 | # defines for values are in frameworks/base/include/ui/KeycodeLabels.h 4 | 5 | # CAMERA Related Key 6 | key 212 CAMERA WAKE 7 | key 528 FOCUS 8 | 9 | -------------------------------------------------------------------------------- /recovery.fstab: -------------------------------------------------------------------------------- 1 | # mount point fstype device [device2] fstype2 2 | 3 | /boot emmc /dev/block/mmcblk0p3 4 | /system ext4 /dev/block/mmcblk0p12 5 | /cache ext4 /dev/block/mmcblk0p13 6 | /data ext4 /dev/block/mmcblk0p14 7 | /sdcard vfat /dev/block/mmcblk0p15 -------------------------------------------------------------------------------- /rootdir/system/etc/sensors.conf: -------------------------------------------------------------------------------- 1 | # Setup accelerometer axis 2 | bma250input_axis_x = 0 3 | bma250input_axis_y = 1 4 | bma250input_axis_z = 2 5 | 6 | bma250input_neg_x = 1 7 | bma250input_neg_y = 0 8 | bma250input_neg_z = 1 9 | 10 | # Setup AKM8963 axis 11 | ak896xmagnetic_layout = 0,0,1,0,1,0,-1,0,0 12 | 13 | # Setup accelerometer calibration threshold and axis 14 | accel_threshold_first = 300 15 | accel_threshold_second = 50 16 | accel_axis_x = 0 17 | accel_axis_y = 0 18 | accel_axis_z = 1 19 | -------------------------------------------------------------------------------- /config/fstab.lt26: -------------------------------------------------------------------------------- 1 | # Android fstab file. 2 | # 3 | # The filesystem that contains the filesystem checker binary (typically /system) cannot 4 | # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK 5 | 6 | /dev/block/mmcblk0p12 /system ext4 ro wait 7 | /dev/block/mmcblk0p13 /cache ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait,check 8 | /dev/block/mmcblk0p14 /data ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait,check 9 | -------------------------------------------------------------------------------- /vendorsetup.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2008 The Android Open Source Project 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # This file is executed by build/envsetup.sh, and can use anything 18 | # defined in envsetup.sh. 19 | # 20 | # In particular, you can add lunch options with the add_lunch_combo 21 | # function: add_lunch_combo generic-eng 22 | 23 | add_lunch_combo full_lt26-userdebug 24 | -------------------------------------------------------------------------------- /liblight/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2008 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | LOCAL_PATH:= $(call my-dir) 15 | # HAL module implemenation, not prelinked and stored in 16 | # hw/..so 17 | include $(CLEAR_VARS) 18 | 19 | LOCAL_SRC_FILES := lights.c 20 | LOCAL_C_INCLUDES += $(LOCAL_PATH) 21 | 22 | LOCAL_PRELINK_MODULE := false 23 | LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw 24 | 25 | LOCAL_SHARED_LIBRARIES := liblog 26 | 27 | LOCAL_MODULE := lights.lt26 28 | 29 | LOCAL_MODULE_TAGS := optional 30 | 31 | include $(BUILD_SHARED_LIBRARY) 32 | -------------------------------------------------------------------------------- /config/calibration: -------------------------------------------------------------------------------- 1 | # Sample variables file for BCM94330 wlbga 2.4G only SEMC board CDB board 2 | # TSSI calibration 3 | manfid=0x2d0 4 | prodid=0x0552 5 | vendid=0x14e4 6 | devid=0x4360 7 | boardtype=0x0552 8 | boardrev=0x10 9 | # this design has 2.4GHz iLNA/iPA SP3T switch 10 | boardflags=0x00080201 11 | nocrc=1 12 | xtalfreq=37400 13 | boardnum=22 14 | macaddr=00:90:4c:c5:12:38 15 | ag0=255 16 | aa2g=1 17 | ccode=US 18 | # 2.4G PA parameters 19 | pa0b0=5220 20 | pa0b1=-635 21 | pa0b2=-165 22 | rssismf2g=0xa 23 | rssismc2g=0x3 24 | rssisav2g=0x7 25 | cckPwrOffset=4 26 | maxp2ga0=0x36 27 | ofdm2gpo=0x11111111 28 | mcs2gpo0=0x3333 29 | mcs2gpo1=0x3333 30 | sromrev=3 31 | wl0id=0x431b 32 | swctrlmap_2g=0x44844484,0x42824282,0x40804484,0x18282,0x1ff 33 | # added parameter for 5g as dummy 34 | swctrlmap_5g=0x00100010,0x00280020,0x00200020,0x14202,0x2f8 35 | rfreg033=0x19 36 | rfreg033_cck=0x1f 37 | dacrate2g=160 38 | txalpfbyp2g=1 39 | bphyscale=17 40 | cckPwrIdxCorr=-15 41 | pacalidx2g=60 42 | #xtalmode=0x20,0x4,0 43 | 44 | #noise_cal_ref_2g=56 45 | #pa0itssit=0x20 46 | #sd_gpout=0 47 | sd_gpval=0 48 | sd_gpdc=0x10001E 49 | #sd_oobonly=1 50 | muxenab=0x10 51 | rxgaintblwlbga=1 52 | btc_params80=0 53 | # added as the result of WAR 54 | triso2g=12 55 | -------------------------------------------------------------------------------- /config/clearpad.idc: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2011 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # 16 | # Input Device Calibration File for the Tuna touch screen. 17 | # 18 | 19 | # Basic Parameters 20 | touch.deviceType = touchScreen 21 | touch.orientationAware = 1 22 | 23 | # Size 24 | touch.size.calibration = diameter 25 | touch.size.scale = 10 26 | touch.size.bias = 0 27 | touch.size.isSummed = 0 28 | 29 | # Pressure 30 | # Driver reports signal strength as pressure. 31 | # 32 | # A normal thumb touch typically registers about 200 signal strength 33 | # units although we don't expect these values to be accurate. 34 | touch.pressure.calibration = amplitude 35 | touch.pressure.scale = 0.005 36 | 37 | # Orientation 38 | touch.orientation.calibration = none 39 | 40 | -------------------------------------------------------------------------------- /full_lt26.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2010 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # 16 | # This file is the build configuration for a full Android 17 | # build for lt26 hardware. This cleanly combines a set of 18 | # device-specific aspects (drivers) with a device-agnostic 19 | # product configuration (apps). 20 | # 21 | 22 | # Inherit from those products. Most specific first. 23 | $(call inherit-product, device/sony/lt26/device.mk) 24 | # This is where we'd set a backup provider if we had one 25 | #$(call inherit-product, device/sample/products/backup_overlay.mk) 26 | $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) 27 | 28 | # Discard inherited values and use our own instead. 29 | PRODUCT_NAME := full_lt26 30 | PRODUCT_DEVICE := lt26 31 | PRODUCT_BRAND := Android 32 | PRODUCT_MODEL := Full Android on LT26 33 | -------------------------------------------------------------------------------- /liblight/lights.h: -------------------------------------------------------------------------------- 1 | char const*const RED_LED_FILE = "/sys/class/leds/red/brightness"; 2 | char const*const GREEN_LED_FILE = "/sys/class/leds/green/brightness"; 3 | char const*const BLUE_LED_FILE = "/sys/class/leds/blue/brightness"; 4 | 5 | char const*const RED_LED_FILE_TRIGGER = "/sys/class/leds/red/trigger"; 6 | char const*const GREEN_LED_FILE_TRIGGER = "/sys/class/leds/green/trigger"; 7 | char const*const BLUE_LED_FILE_TRIGGER = "/sys/class/leds/blue/trigger"; 8 | 9 | char const*const RED_LED_FILE_DELAYON = "/sys/class/leds/red/delay_on"; 10 | char const*const GREEN_LED_FILE_DELAYON = "/sys/class/leds/green/delay_on"; 11 | char const*const BLUE_LED_FILE_DELAYON = "/sys/class/leds/blue/delay_on"; 12 | 13 | char const*const RED_LED_FILE_DELAYOFF = "/sys/class/leds/red/delay_off"; 14 | char const*const GREEN_LED_FILE_DELAYOFF = "/sys/class/leds/green/delay_off"; 15 | char const*const BLUE_LED_FILE_DELAYOFF = "/sys/class/leds/blue/delay_off"; 16 | 17 | 18 | char const*const BUTTON_BACKLIGHT_FILE[] = { 19 | "/sys/class/leds/button-backlight/brightness", 20 | "/sys/class/leds/button-backlight-rgb1/brightness", 21 | "/sys/class/leds/button-backlight-rgb2/brightness", 22 | "/sys/class/leds/keyboard-backlight/brightness" 23 | }; 24 | 25 | char const*const LCD_BACKLIGHT_FILE = "/sys/class/leds/lcd-backlight/brightness"; 26 | 27 | char const*const ALS_FILE = "/sys/class/leds/lcd-backlight/als/enable"; 28 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | "wlan0" 22 | 23 | 24 | 25 | "mobile,0,0,0,-1,true" 26 | "wifi,1,1,1,-1,true" 27 | "wifi_p2p,13,1,0,-1,true" 28 | 29 | 30 | 31 | 0 32 | 1 33 | 5 34 | 7 35 | 36 | 37 | -------------------------------------------------------------------------------- /prebuilt/hw_config.sh: -------------------------------------------------------------------------------- 1 | # Audio jack configuration 2 | dev=/sys/devices/platform/msm_ssbi.0/pm8058-core/simple_remote_pf/simple_remote 3 | echo 0,201 > $dev/accessory_min_vals 4 | echo 200,1599 > $dev/accessory_max_vals 5 | echo 0,100,280,500 > $dev/button_min_vals 6 | echo 99,199,399,699 > $dev/button_max_vals 7 | echo 512 > $dev/btn_trig_period_freq # Button Period Freq(Hz) 8 | echo 16 > $dev/btn_trig_period_time # Button Period Time(Cycle) 9 | echo 512 > $dev/btn_trig_hyst_freq # Button Hysteresis Freq(Hz) 10 | echo 16 > $dev/btn_trig_hyst_time # Button Hysteresis Time(Cycle) 11 | echo 400 > $dev/btn_trig_level 12 | 13 | # Proximity sensor configuration 14 | dev=/sys/bus/i2c/devices/3-0054/ 15 | val_cycle=1 16 | val_nburst=8 17 | val_freq=1 18 | val_threshold=4 19 | val_filter=2 20 | 21 | nv_param_loader 60240 prox_cal 22 | val_calibrated=$? 23 | case $val_calibrated in 24 | 1) 25 | nv_param_loader 60240 threshold 26 | val_threshold=$? 27 | nv_param_loader 60240 rfilter 28 | val_filter=$? 29 | ;; 30 | esac 31 | 32 | echo $val_cycle > $dev/cycle # Duration Cycle. Valid range is 0 - 3. 33 | echo $val_nburst > $dev/nburst # Number of pulses in burst. Valid range is 0 - 15. 34 | echo $val_freq > $dev/freq # Burst frequency. Valid range is 0 - 3. 35 | echo $val_threshold > $dev/threshold # sensor threshold. Valid range is 0 - 15 (0.12V - 0.87V) 36 | echo $val_filter > $dev/filter # RFilter. Valid range is 0 - 3. 37 | 38 | # LMU AS3676 Configuration 39 | dev=/sys/class/leds 40 | echo 1,51,255,39,20,6,84 > $dev/lcd-backlight/als/curve # ALS curve for group1 41 | echo 1,0,0,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset] 42 | echo 1 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h 43 | echo 2000 > $dev/button-backlight/max_current 44 | 45 | # TI BQ275xx firmware loader 46 | bq275xx_fwloader 47 | -------------------------------------------------------------------------------- /config/init.qcom.efs.sync.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # Copyright (c) 2012, Code Aurora Forum. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are 6 | # met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above 10 | # copyright notice, this list of conditions and the following 11 | # disclaimer in the documentation and/or other materials provided 12 | # with the distribution. 13 | # * Neither the name of Code Aurora Forum, Inc. nor the names of its 14 | # contributors may be used to endorse or promote products derived 15 | # from this software without specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 18 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 21 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # 29 | # 30 | 31 | PATH=/system/bin:$PATH 32 | export PATH 33 | cat /sys/devices/platform/rs300000a7.65536/force_sync 34 | cat /sys/devices/platform/rs300100a7.65536/force_sync 35 | -------------------------------------------------------------------------------- /patches/0002-eglsubAndroid-compatibility-hack.patch: -------------------------------------------------------------------------------- 1 | From 65f85fa81de92cbf036d10b447f45c05b5cc8f7c Mon Sep 17 00:00:00 2001 2 | From: Johan Redestig 3 | Date: Fri, 12 Oct 2012 08:22:45 +0200 4 | Subject: [PATCH 2/2] eglsubAndroid compatibility hack 5 | 6 | Change-Id: I1d645f3bb3979ce36b6e26945bbfcf3ec5a737b0 7 | --- 8 | include/gui/SurfaceComposerClient.h | 2 ++ 9 | libs/gui/SurfaceComposerClient.cpp | 6 ++++++ 10 | 2 files changed, 8 insertions(+) 11 | 12 | diff --git a/include/gui/SurfaceComposerClient.h b/include/gui/SurfaceComposerClient.h 13 | index ae5d69a..28baf70 100644 14 | --- a/include/gui/SurfaceComposerClient.h 15 | +++ b/include/gui/SurfaceComposerClient.h 16 | @@ -66,6 +66,8 @@ public: 17 | 18 | // Get information about a display 19 | static status_t getDisplayInfo(const sp& display, DisplayInfo* info); 20 | + static status_t getDisplayInfo(int32_t display, DisplayInfo* info); 21 | + 22 | 23 | /* triggers screen off and waits for it to complete */ 24 | static void blankDisplay(const sp& display); 25 | diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp 26 | index 80dd6ee..8391bcd 100644 27 | --- a/libs/gui/SurfaceComposerClient.cpp 28 | +++ b/libs/gui/SurfaceComposerClient.cpp 29 | @@ -570,6 +570,12 @@ void SurfaceComposerClient::setDisplayProjection(const sp& token, 30 | // ---------------------------------------------------------------------------- 31 | 32 | status_t SurfaceComposerClient::getDisplayInfo( 33 | + int32_t display, DisplayInfo* info) 34 | +{ 35 | + return ComposerService::getComposerService()->getDisplayInfo(0, info); 36 | +} 37 | + 38 | +status_t SurfaceComposerClient::getDisplayInfo( 39 | const sp& display, DisplayInfo* info) 40 | { 41 | return ComposerService::getComposerService()->getDisplayInfo(display, info); 42 | -- 43 | 1.8.2.2 44 | 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Copyright (C) Sony Mobile Communications 2012 2 | ============================================= 3 | 4 | This is the Android device configuration for Xperia S. 5 | 6 | To setup a tree and build images for the device do the following: 7 | 8 | `repo init` as described by Google over at: 9 | http://source.android.com/source/downloading.html 10 | 11 | Put the following snippet in `.repo/local_manifests/lt26.xml`: 12 | 13 | ```xml 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | ``` 22 | 23 | Download the zip file with vendor binaries from: 24 | http://developer.sonymobile.com/knowledge-base/open-source/android-open-source-project-for-xperia-devices/ 25 | 26 | In the root of your Android code tree unzip the `SW_binaries_for_Xperia_S_v1.tar.zip`. 27 | 28 | 29 | You should now have a directory named `vendor/sony/lt26` in your tree. 30 | 31 | Unfortunately the vendor binaries needs a couple of patches to be compatible with 32 | AOSP. Apply the patches by running the `apply_patch` tool in the root of your Android code 33 | tree. 34 | 35 | * `repo sync` 36 | * `source ./build/envsetup.sh` 37 | * `./device/sony/lt26/apply_patches` 38 | * `lunch full_lt26-userdebug` 39 | * `make` 40 | 41 | To flash the images produced make sure your device is unlocked, as described on 42 | http://unlockbootloader.sonymobile.com/ 43 | 44 | Enter fastboot mode on the device by pressing volume up while inserting the USB 45 | cable or execute `adb reboot bootloader`. 46 | 47 | * `fastboot flash userdata out/target/product/lt26/userdata.img` 48 | * `fastboot flashall` 49 | 50 | Reflashing userdata is not necessary every time, but incompatibilities with 51 | previous content might result in a device that doesn't boot. If this happens 52 | try to reflash just the userdata again. 53 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/xml/storage_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 36 | 37 | 43 | 46 | 47 | -------------------------------------------------------------------------------- /CleanSpec.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2007 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | # If you don't need to do a full clean build but would like to touch 17 | # a file or delete some intermediate files, add a clean step to the end 18 | # of the list. These steps will only be run once, if they haven't been 19 | # run before. 20 | # 21 | # E.g.: 22 | # $(call add-clean-step, touch -c external/sqlite/sqlite3.h) 23 | # $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates) 24 | # 25 | # Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with 26 | # files that are missing or have been moved. 27 | # 28 | # Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory. 29 | # Use $(OUT_DIR) to refer to the "out" directory. 30 | # 31 | # If you need to re-do something that's already mentioned, just copy 32 | # the command and add it to the bottom of the list. E.g., if a change 33 | # that you made last week required touching a file and a change you 34 | # made today requires touching the same file, just copy the old 35 | # touch step and add it to the end of the list. 36 | # 37 | # ************************************************ 38 | # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST 39 | # ************************************************ 40 | 41 | # For example: 42 | #$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates) 43 | #$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates) 44 | #$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f) 45 | #$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*) 46 | 47 | # ************************************************ 48 | # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST 49 | # ************************************************ 50 | -------------------------------------------------------------------------------- /BoardConfig.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2010 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # 16 | # This file sets variables that control the way modules are built 17 | # thorughout the system. It should not be used to conditionally 18 | # disable makefiles (the proper mechanism to control what gets 19 | # included in a build is to use PRODUCT_PACKAGES in a product 20 | # definition file). 21 | # 22 | 23 | USE_CAMERA_STUB := true 24 | USE_PROPRIETARY_AUDIO_EXTENSIONS := false 25 | 26 | TARGET_BOARD_PLATFORM := msm8660 27 | TARGET_BOOTLOADER_BOARD_NAME := lt26 28 | 29 | TARGET_CPU_ABI := armeabi-v7a 30 | TARGET_CPU_ABI2 := armeabi 31 | TARGET_CPU_SMP := true 32 | TARGET_CPU_VARIANT := krait 33 | TARGET_ARCH := arm 34 | TARGET_ARCH_VARIANT := armv7-a-neon 35 | ARCH_ARM_HAVE_TLS_REGISTER := true 36 | 37 | USE_OPENGL_RENDERER := true 38 | BOARD_EGL_CFG := device/sony/lt26/config/egl.cfg 39 | 40 | BOARD_USES_GENERIC_AUDIO := false 41 | BOARD_USES_ALSA_AUDIO := false 42 | 43 | BOARD_HAVE_BLUETOOTH := true 44 | BOARD_HAVE_BLUETOOTH_BCM := true 45 | 46 | # Wifi related defines 47 | BOARD_WPA_SUPPLICANT_DRIVER := NL80211 48 | WPA_SUPPLICANT_VERSION := VER_0_8_X 49 | BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_bcmdhd 50 | BOARD_HOSTAPD_DRIVER := NL80211 51 | BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_bcmdhd 52 | BOARD_WLAN_DEVICE := bcmdhd 53 | WIFI_DRIVER_FW_PATH_PARAM := "/sys/module/bcmdhd/parameters/firmware_path" 54 | WIFI_DRIVER_FW_PATH_STA := "/vendor/firmware/fw_bcmdhd.bin" 55 | WIFI_DRIVER_FW_PATH_AP := "/vendor/firmware/fw_bcmdhd_apsta.bin" 56 | WIFI_DRIVER_FW_PATH_P2P := "/vendor/firmware/fw_bcmdhd_p2p.bin" 57 | 58 | TARGET_USERIMAGES_USE_EXT4 := true 59 | TARGET_NO_RECOVERY := true 60 | 61 | BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1056964608 62 | BOARD_USERDATAIMAGE_PARTITION_SIZE := 2147483648 63 | BOARD_FLASH_BLOCK_SIZE := 131072 64 | 65 | BOARD_CUSTOM_MKBOOTIMG := device/sony/lt26/tools/mkbootimg.py 66 | -------------------------------------------------------------------------------- /tools/mkbootimg.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (c) 2012, Sony Mobile Communications AB 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions 8 | # are met: 9 | # * Redistributions of source code must retain the above copyright 10 | # notice, this list of conditions and the following disclaimer. 11 | # * Redistributions in binary form must reproduce the above copyright 12 | # notice, this list of conditions and the following disclaimer in 13 | # the documentation and/or other materials provided with the 14 | # distribution. 15 | # * Neither the name of Sony Mobile Communications AB nor the names 16 | # of its contributors may be used to endorse or promote products 17 | # derived from this software without specific prior written 18 | # permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 26 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 27 | # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 28 | # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 30 | # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | # SUCH DAMAGE. 32 | # 33 | # DESCRIPTION 34 | # 35 | # mkbootimg wrapper to create the custom boot.img format used by LT26 36 | # 37 | # SYNOPSIS 38 | # 39 | # usage: mkbootimg 40 | # --kernel 41 | # --ramdisk 42 | # -o|--output 43 | # 44 | # For compatibility the following mkbootimg arguments are gracefully ignored 45 | # [ --second <2ndbootloader-filename> ] 46 | # [ --cmdline ] 47 | # [ --board ] 48 | # [ --base
] 49 | # [ --pagesize ] 50 | # 51 | 52 | import os 53 | import sys 54 | from optparse import OptionParser 55 | from string import Template 56 | 57 | mkelf_template = Template('device/sony/lt26/tools/mkelf.py -o $output $kernel@0x40208000 $ramdisk@0x41300000,ramdisk $rpm@0x20000,rpm') 58 | 59 | def main(args): 60 | parser = OptionParser("usage: %prog options") 61 | parser.add_option("--kernel", dest="kernel", help="path to the kernel image") 62 | parser.add_option("--ramdisk", dest="ramdisk", help="path to the ramdisk image") 63 | parser.add_option("-o", "--output", dest="output", help="path to the output file") 64 | parser.add_option("--second", dest="ignore_second", help="2ndbootloader-filename (mkbootimg compatibility)") 65 | parser.add_option("--cmdline", dest="ignore_cmdline", help="kernel-commandline (mkbootimg compatibility)") 66 | parser.add_option("--board", dest="ignore_boardname", help="boardname (mkbootimg compatibility)") 67 | parser.add_option("--base", dest="ignore_base", help="base (mkbootimg compatibility)") 68 | parser.add_option("--pagesize", dest="ignore_pagesize", help="pagesize (mkbootimg compatibility)") 69 | parser.add_option("--rpm", dest="rpm", default="vendor/sony/lt26/proprietary/boot/RPM.bin") 70 | 71 | (opts, args) = parser.parse_args() 72 | 73 | os.system(mkelf_template.substitute(vars(opts))) 74 | 75 | if __name__ == "__main__": 76 | main(sys.argv[1:]) 77 | 78 | -------------------------------------------------------------------------------- /config/init.semc.usb.rc: -------------------------------------------------------------------------------- 1 | on init 2 | write /sys/class/android_usb/android0/iSerial ${ro.serialno} 3 | write /sys/class/android_usb/android0/f_rndis/manufacturer Sony 4 | write /sys/class/android_usb/android0/f_rndis/vendorID 0FCE 5 | write /sys/class/android_usb/android0/f_rndis/wceis 1 6 | 7 | on boot 8 | write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer} 9 | write /sys/class/android_usb/android0/iProduct ${ro.product.model} 10 | 11 | on property:sys.usb.config=mass_storage 12 | write /sys/class/android_usb/android0/enable 0 13 | write /sys/class/android_usb/android0/idVendor 0FCE 14 | write /sys/class/android_usb/android0/idProduct E169 15 | write /sys/class/android_usb/android0/functions ${sys.usb.config} 16 | write /sys/class/android_usb/android0/enable 1 17 | setprop sys.usb.state ${sys.usb.config} 18 | 19 | on property:sys.usb.config=mass_storage,adb 20 | write /sys/class/android_usb/android0/enable 0 21 | write /sys/class/android_usb/android0/idVendor 0FCE 22 | write /sys/class/android_usb/android0/idProduct 6169 23 | write /sys/class/android_usb/android0/functions ${sys.usb.config} 24 | write /sys/class/android_usb/android0/enable 1 25 | start adbd 26 | setprop sys.usb.state ${sys.usb.config} 27 | 28 | on property:sys.usb.config=mtp 29 | write /sys/class/android_usb/android0/enable 0 30 | write /sys/class/android_usb/android0/idVendor 0FCE 31 | write /sys/class/android_usb/android0/idProduct 0169 32 | write /sys/class/android_usb/android0/functions ${sys.usb.config} 33 | write /sys/class/android_usb/android0/enable 1 34 | setprop sys.usb.state ${sys.usb.config} 35 | 36 | on property:sys.usb.config=mtp,adb 37 | write /sys/class/android_usb/android0/enable 0 38 | write /sys/class/android_usb/android0/idVendor 0FCE 39 | write /sys/class/android_usb/android0/idProduct 5169 40 | write /sys/class/android_usb/android0/functions ${sys.usb.config} 41 | write /sys/class/android_usb/android0/enable 1 42 | start adbd 43 | setprop sys.usb.state ${sys.usb.config} 44 | 45 | on property:sys.usb.config=rndis 46 | write /sys/class/android_usb/android0/enable 0 47 | write /sys/class/android_usb/android0/idVendor 0FCE 48 | write /sys/class/android_usb/android0/idProduct 7169 49 | write /sys/class/android_usb/android0/functions ${sys.usb.config} 50 | write /sys/class/android_usb/android0/bDeviceClass 224 51 | write /sys/class/android_usb/android0/enable 1 52 | setprop sys.usb.state ${sys.usb.config} 53 | 54 | on property:sys.usb.config=rndis,adb 55 | write /sys/class/android_usb/android0/enable 0 56 | write /sys/class/android_usb/android0/idVendor 0FCE 57 | write /sys/class/android_usb/android0/idProduct 8169 58 | write /sys/class/android_usb/android0/functions ${sys.usb.config} 59 | write /sys/class/android_usb/android0/bDeviceClass 224 60 | write /sys/class/android_usb/android0/enable 1 61 | start adbd 62 | setprop sys.usb.state ${sys.usb.config} 63 | 64 | on property:sys.usb.config=ptp 65 | write /sys/class/android_usb/android0/enable 0 66 | write /sys/class/android_usb/android0/idVendor 0FCE 67 | write /sys/class/android_usb/android0/idProduct 9169 68 | write /sys/class/android_usb/android0/functions ${sys.usb.config} 69 | write /sys/class/android_usb/android0/enable 1 70 | setprop sys.usb.state ${sys.usb.config} 71 | 72 | on property:sys.usb.config=ptp,adb 73 | write /sys/class/android_usb/android0/enable 0 74 | write /sys/class/android_usb/android0/idVendor 0FCE 75 | write /sys/class/android_usb/android0/idProduct A169 76 | write /sys/class/android_usb/android0/functions ${sys.usb.config} 77 | write /sys/class/android_usb/android0/enable 1 78 | start adbd 79 | setprop sys.usb.state ${sys.usb.config} 80 | -------------------------------------------------------------------------------- /device.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2012 The Android Open Source Project 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | ifeq ($(TARGET_PREBUILT_KERNEL),) 18 | LOCAL_KERNEL := device/sony/lt26/kernel 19 | else 20 | LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL) 21 | endif 22 | 23 | PRODUCT_COPY_FILES += \ 24 | $(LOCAL_KERNEL):kernel 25 | 26 | PRODUCT_PACKAGES := \ 27 | lights.lt26 \ 28 | e2fsck \ 29 | sensors.default 30 | 31 | PRODUCT_CHARACTERISTICS := nosdcard 32 | 33 | DEVICE_PACKAGE_OVERLAYS += device/sony/lt26/overlay 34 | 35 | # The gps config appropriate for this device 36 | $(call inherit-product, device/common/gps/gps_eu_supl.mk) 37 | 38 | # These are the hardware-specific features 39 | PRODUCT_COPY_FILES += \ 40 | frameworks/native/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml \ 41 | frameworks/native/data/etc/android.hardware.touchscreen.multitouch.distinct.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.distinct.xml \ 42 | frameworks/native/data/etc/android.hardware.touchscreen.multitouch.distinct.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \ 43 | frameworks/native/data/etc/android.hardware.telephony.gsm.xml:system/etc/permissions/android.hardware.telephony.gsm.xml \ 44 | frameworks/native/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml 45 | 46 | # This device is xhdpi. However the platform doesn't 47 | # currently contain all of the bitmaps at xhdpi density so 48 | # we do this little trick to fall back to the hdpi version 49 | # if the xhdpi doesn't exist. 50 | PRODUCT_AAPT_CONFIG := normal hdpi xhdpi 51 | PRODUCT_AAPT_PREF_CONFIG := xhdpi 52 | 53 | 54 | # Configuration scripts 55 | PRODUCT_COPY_FILES += \ 56 | $(LOCAL_PATH)/recovery.fstab:root/recovery.fstab \ 57 | $(LOCAL_PATH)/config/fstab.lt26:root/fstab.lt26 \ 58 | $(LOCAL_PATH)/config/vold.fstab:system/etc/vold.fstab \ 59 | $(LOCAL_PATH)/prebuilt/hw_config.sh:system/etc/hw_config.sh 60 | 61 | # Common Qualcomm scripts 62 | PRODUCT_COPY_FILES += \ 63 | device/sony/lt26/config/init.qcom.efs.sync.sh:system/etc/init.qcom.efs.sync.sh 64 | 65 | # Custom init / uevent 66 | PRODUCT_COPY_FILES += \ 67 | device/sony/lt26/config/init.semc.rc:root/init.semc.rc \ 68 | device/sony/lt26/config/ueventd.semc.rc:root/ueventd.semc.rc 69 | 70 | # USB function switching 71 | PRODUCT_COPY_FILES += \ 72 | $(LOCAL_PATH)/config/init.semc.usb.rc:root/init.semc.usb.rc 73 | 74 | # Key layouts and touchscreen 75 | PRODUCT_COPY_FILES += \ 76 | $(LOCAL_PATH)/config/atdaemon.kl:system/usr/keylayout/atdaemon.kl \ 77 | $(LOCAL_PATH)/config/clearpad.kl:system/usr/keylayout/clearpad.kl \ 78 | $(LOCAL_PATH)/config/clearpad.idc:system/usr/idc/clearpad.idc \ 79 | $(LOCAL_PATH)/config/fuji-keypad.kl:system/usr/keylayout/fuji-keypad.kl \ 80 | $(LOCAL_PATH)/config/gpio-key.kl:system/usr/keylayout/gpio-key.kl \ 81 | $(LOCAL_PATH)/config/keypad-pmic-fuji.kl:system/usr/keylayout/keypad-pmic-fuji.kl \ 82 | $(LOCAL_PATH)/config/pmic8058_pwrkey.kl:system/usr/keylayout/pmic8058_pwrkey.kl \ 83 | $(LOCAL_PATH)/config/simple_remote.kl:system/usr/keylayout/simple_remote.kl \ 84 | $(LOCAL_PATH)/rootdir/system/etc/sensors.conf:system/etc/sensors.conf 85 | 86 | $(call inherit-product, frameworks/native/build/phone-xhdpi-1024-dalvik-heap.mk) 87 | 88 | $(call inherit-product-if-exists, vendor/sony/lt26/lt26-vendor.mk) 89 | 90 | # Wifi 91 | BOARD_WLAN_DEVICE_REV := bcm4330_b2 92 | WIFI_BAND := 802_11_ABG 93 | $(call inherit-product-if-exists, hardware/broadcom/wlan/bcmdhd/firmware/bcm4330/device-bcm.mk) 94 | 95 | PRODUCT_COPY_FILES += \ 96 | $(LOCAL_PATH)/config/calibration:system/etc/wifi/calibration 97 | 98 | SOMC_CFG_SENSORS_PROXIMITY_APDS9702 := yes 99 | SOMC_CFG_SENSORS_ACCEL_BMA250NA_INPUT := yes 100 | 101 | -------------------------------------------------------------------------------- /config/ueventd.semc.rc: -------------------------------------------------------------------------------- 1 | /dev/msm_vpe_standalone 0777 system system 2 | 3 | /sys/devices/i2c-3/3-0040/leds/lcd-backlight als/enable 0600 system system 4 | /sys/devices/i2c-3/3-0040/leds/* delay_on 0600 system system 5 | /sys/devices/i2c-3/3-0040/leds/* delay_off 0600 system system 6 | /sys/devices/i2c-3/3-0040/leds/* brightness 0600 system system 7 | /sys/devices/i2c-3/3-0040/leds/* trigger 0600 system system 8 | 9 | ### start from CAF/system/core/rootdir/ueventd.rc 10 | /dev/rtc0 0600 system system 11 | 12 | # the DIAG device node is world writable/readable. 13 | /dev/diag 0666 root root 14 | 15 | # the genlock client device node is world writable/readable. 16 | /dev/genlock 0666 root root 17 | 18 | # gpu driver for adreno200 is globally accessible 19 | /dev/kgsl-3d0 0666 root root 20 | /dev/kgsl-2d0 0666 root root 21 | /dev/kgsl-2d1 0666 root root 22 | 23 | /dev/ion 0664 system system 24 | 25 | /dev/rfkill 0660 wifi wifi 26 | 27 | # these should not be world writable 28 | /dev/ttyHS0 0600 bluetooth bluetooth 29 | /dev/sdio_tty_ciq_00 0660 system system 30 | /dev/msm_rotator 0664 system system 31 | /dev/pmem_audio 0660 system audio 32 | /dev/pmem_smipool* 0660 system camera 33 | /dev/pmem_swiqi 0660 system audio 34 | /dev/msm_camera/* 0660 system camera 35 | /dev/radio0 0644 fm_radio fm_radio 36 | /dev/i2c-2 0664 root system 37 | /dev/i2c-4 0664 root system 38 | /dev/msm_mvs 0660 system audio 39 | /dev/msm_voicememo 0660 system audio 40 | /dev/tzcom 0660 system audio 41 | /dev/qseecom 0660 system audio 42 | /dev/qce 0660 system audio 43 | /dev/msm_pcm_lp_dec 0660 system audio 44 | /dev/smd4 0660 system system 45 | /dev/smd7 0640 radio radio 46 | /dev/smdcntl0 0640 radio radio 47 | /dev/smdcntl1 0640 radio radio 48 | /dev/smdcntl2 0640 radio radio 49 | /dev/smdcntl3 0640 radio radio 50 | /dev/smdcntl4 0640 radio radio 51 | /dev/smdcntl5 0640 radio radio 52 | /dev/smdcntl6 0640 radio radio 53 | /dev/smdcntl7 0640 radio radio 54 | /dev/sdioctl0 0640 radio radio 55 | /dev/sdioctl1 0640 radio radio 56 | /dev/sdioctl2 0640 radio radio 57 | /dev/sdioctl3 0640 radio radio 58 | /dev/sdioctl4 0640 radio radio 59 | /dev/sdioctl4 0640 radio radio 60 | /dev/sdioctl5 0640 radio radio 61 | /dev/sdioctl6 0640 radio radio 62 | /dev/sdioctl7 0640 radio radio 63 | /dev/sdioctl8 0640 radio radio 64 | /dev/qemu_trace 0666 system system 65 | /dev/rmnet_ctrl 0640 radio radio 66 | /dev/hsicctl0 0640 radio radio 67 | /dev/hsicctl1 0640 radio radio 68 | /dev/hsicctl2 0640 radio radio 69 | /dev/hsicctl3 0640 radio radio 70 | /dev/gemini0 0660 system camera 71 | /dev/mdm 0660 system system 72 | /dev/ttyHSL1 0660 system system 73 | /dev/tty_sdio_00 0660 system system 74 | /dev/block/mmcblk0 0440 system system 75 | 76 | #permissions for video 77 | /dev/msm_vidc_reg 0660 system audio 78 | /dev/msm_vidc_dec 0660 system audio 79 | /dev/msm_vidc_dec_sec 0660 system audio 80 | /dev/msm_vidc_enc 0660 system audio 81 | #permissions for audio 82 | /dev/msm_audio_dev_ctrl 0660 system audio 83 | /dev/msm_amrnb 0660 system audio 84 | /dev/msm_amrwb 0660 system audio 85 | /dev/msm_aac 0660 system audio 86 | /dev/msm_multi_aac 0660 system audio 87 | /dev/msm_aac_in 0660 system audio 88 | /dev/msm_qcelp 0660 system audio 89 | /dev/msm_evrc 0660 system audio 90 | /dev/msm_fm 0660 system audio 91 | /dev/msm_acdb 0660 system audio 92 | /dev/msm_rtac 0660 system audio 93 | /dev/msm_wma 0660 system audio 94 | /dev/msm_wmapro 0660 system audio 95 | /dev/msm_qcelp_in 0660 system audio 96 | /dev/msm_evrc_in 0660 system audio 97 | /dev/msm_preproc_ctl 0660 system audio 98 | /dev/msm_a2dp_in 0640 system audio 99 | /dev/msm_amrnb_in 0640 system audio 100 | 101 | /dev/cpu_dma_latency 0660 system system 102 | 103 | /dev/rmnet_mux_ctrl 0640 radio radio 104 | 105 | #permissions for sensors 106 | /dev/msm_dsps 0660 system system 107 | ### end from CAF 108 | 109 | /dev/oncrpc/* 0660 root system 110 | /dev/oncrpc/30000017:* 0660 radio radio 111 | /dev/oncrpc/30000000:* 0660 radio radio 112 | /dev/oncrpc/30000016:* 0660 radio radio 113 | /dev/oncrpc/3000003c:* 0660 radio radio 114 | /dev/oncrpc/30000019:* 0660 radio radio 115 | /dev/oncrpc/3000000e:* 0660 radio radio 116 | /dev/oncrpc/30000012:* 0660 radio radio 117 | /dev/oncrpc/30000003:* 0660 radio radio 118 | /dev/oncrpc/3000001b:* 0660 radio radio 119 | 120 | # NFC device permission 121 | /dev/pn544 0600 nfc nfc 122 | 123 | # USB device permission 124 | /sys/devices/platform/msm_hsusb_host.0/usb* uevent 0660 root usb 125 | 126 | # Gyroscope device permission 127 | /dev/mpu 0600 system system 128 | /dev/mpuirq 0600 system system 129 | /dev/timerirq 0600 system system 130 | 131 | # Accelerometer device permission 132 | /sys/devices/virtual/input/input* bma250_rate 0640 system system 133 | 134 | 135 | -------------------------------------------------------------------------------- /patches/0001-egl-Reintroduce-eglGetRenderBufferANDROID.patch: -------------------------------------------------------------------------------- 1 | From 4e85c47d1af0d5a50ec830eccf374874f6683982 Mon Sep 17 00:00:00 2001 2 | From: Bjorn Andersson 3 | Date: Tue, 21 Aug 2012 22:22:02 -0700 4 | Subject: [PATCH] egl: Reintroduce eglGetRenderBufferANDROID 5 | 6 | eglGetRenderBufferANDROID was removed as it had no users. This commit 7 | reintroduces this extensions as it's used by Qualcomm graphics HAL. 8 | 9 | Change-Id: I493306830a0d4f8722a42bcc84fb49236afdabeb 10 | 11 | Conflicts: 12 | opengl/libs/EGL/eglApi.cpp 13 | --- 14 | opengl/include/EGL/eglext.h | 10 ++++++++++ 15 | opengl/libagl/egl.cpp | 28 ++++++++++++++++++++++++++++ 16 | opengl/libs/EGL/eglApi.cpp | 18 ++++++++++++++++++ 17 | 3 files changed, 56 insertions(+) 18 | 19 | diff --git a/opengl/include/EGL/eglext.h b/opengl/include/EGL/eglext.h 20 | index 8578874..38145e3 100644 21 | --- a/opengl/include/EGL/eglext.h 22 | +++ b/opengl/include/EGL/eglext.h 23 | @@ -213,6 +213,7 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync); 24 | typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); 25 | typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode); 26 | typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value); 27 | +typedef EGLClientBuffer (EGLAPIENTRYP PFNEGLGETRENDERBUFFERANDROIDPROC) (EGLDisplay dpy, EGLSurface draw); 28 | #endif 29 | 30 | #ifndef EGL_KHR_fence_sync 31 | @@ -272,6 +273,15 @@ typedef void (EGLAPIENTRYP PFNEGLSETBLOBCACHEFUNCSANDROIDPROC) (EGLDisplay dpy, 32 | EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get); 33 | #endif 34 | 35 | +/* EGL_ANDROID_get_render_buffer 36 | + */ 37 | +#ifndef EGL_ANDROID_get_render_buffer 38 | +#define EGL_ANDROID_get_render_buffer 1 39 | +#ifdef EGL_EGLEXT_PROTOTYPES 40 | +EGLAPI EGLClientBuffer EGLAPIENTRY eglGetRenderBufferANDROID(EGLDisplay dpy, EGLSurface draw); 41 | +#endif 42 | +#endif 43 | + 44 | /* EGL_IMG_hibernate_process 45 | */ 46 | #ifndef EGL_IMG_hibernate_process 47 | diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp 48 | index 172ef95..e650c33 100644 49 | --- a/opengl/libagl/egl.cpp 50 | +++ b/opengl/libagl/egl.cpp 51 | @@ -166,6 +166,7 @@ struct egl_surface_t 52 | virtual EGLint getSwapBehavior() const; 53 | virtual EGLBoolean swapBuffers(); 54 | virtual EGLBoolean setSwapRectangle(EGLint l, EGLint t, EGLint w, EGLint h); 55 | + virtual EGLClientBuffer getRenderBuffer() const; 56 | protected: 57 | GGLSurface depth; 58 | }; 59 | @@ -209,6 +210,9 @@ EGLBoolean egl_surface_t::setSwapRectangle( 60 | { 61 | return EGL_FALSE; 62 | } 63 | +EGLClientBuffer egl_surface_t::getRenderBuffer() const { 64 | + return 0; 65 | +} 66 | 67 | // ---------------------------------------------------------------------------- 68 | 69 | @@ -234,6 +238,7 @@ struct egl_window_surface_v2_t : public egl_surface_t 70 | virtual EGLint getRefreshRate() const; 71 | virtual EGLint getSwapBehavior() const; 72 | virtual EGLBoolean setSwapRectangle(EGLint l, EGLint t, EGLint w, EGLint h); 73 | + virtual EGLClientBuffer getRenderBuffer() const; 74 | 75 | private: 76 | status_t lock(ANativeWindowBuffer* buf, int usage, void** vaddr); 77 | @@ -581,6 +586,11 @@ EGLBoolean egl_window_surface_v2_t::setSwapRectangle( 78 | return EGL_TRUE; 79 | } 80 | 81 | +EGLClientBuffer egl_window_surface_v2_t::getRenderBuffer() const 82 | +{ 83 | + return buffer; 84 | +} 85 | + 86 | EGLBoolean egl_window_surface_v2_t::bindDrawSurface(ogles_context_t* gl) 87 | { 88 | GGLSurface buffer; 89 | @@ -811,6 +821,7 @@ static char const * const gExtensionsString = 90 | // "KHR_image_pixmap " 91 | "EGL_ANDROID_image_native_buffer " 92 | "EGL_ANDROID_swap_rectangle " 93 | + "EGL_ANDROID_get_render_buffer " 94 | ; 95 | 96 | // ---------------------------------------------------------------------------- 97 | @@ -871,6 +882,8 @@ static const extention_map_t gExtentionMap[] = { 98 | (__eglMustCastToProperFunctionPointerType)&eglGetSyncAttribKHR }, 99 | { "eglSetSwapRectangleANDROID", 100 | (__eglMustCastToProperFunctionPointerType)&eglSetSwapRectangleANDROID }, 101 | + { "eglGetRenderBufferANDROID", 102 | + (__eglMustCastToProperFunctionPointerType)&eglGetRenderBufferANDROID }, 103 | }; 104 | 105 | /* 106 | @@ -2164,3 +2177,18 @@ EGLBoolean eglSetSwapRectangleANDROID(EGLDisplay dpy, EGLSurface draw, 107 | 108 | return EGL_TRUE; 109 | } 110 | + 111 | +EGLClientBuffer eglGetRenderBufferANDROID(EGLDisplay dpy, EGLSurface draw) 112 | +{ 113 | + if (egl_display_t::is_valid(dpy) == EGL_FALSE) 114 | + return setError(EGL_BAD_DISPLAY, (EGLClientBuffer)0); 115 | + 116 | + egl_surface_t* d = static_cast(draw); 117 | + if (!d->isValid()) 118 | + return setError(EGL_BAD_SURFACE, (EGLClientBuffer)0); 119 | + if (d->dpy != dpy) 120 | + return setError(EGL_BAD_DISPLAY, (EGLClientBuffer)0); 121 | + 122 | + // post the surface 123 | + return d->getRenderBuffer(); 124 | +} 125 | diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp 126 | index 065faf2..40eac75 100644 127 | --- a/opengl/libs/EGL/eglApi.cpp 128 | +++ b/opengl/libs/EGL/eglApi.cpp 129 | @@ -70,6 +70,8 @@ static const extention_map_t sExtentionMap[] = { 130 | (__eglMustCastToProperFunctionPointerType)&eglCreateImageKHR }, 131 | { "eglDestroyImageKHR", 132 | (__eglMustCastToProperFunctionPointerType)&eglDestroyImageKHR }, 133 | + { "eglGetRenderBufferANDROID", 134 | + (__eglMustCastToProperFunctionPointerType)&eglGetRenderBufferANDROID }, 135 | { "eglGetSystemTimeFrequencyNV", 136 | (__eglMustCastToProperFunctionPointerType)&eglGetSystemTimeFrequencyNV }, 137 | { "eglGetSystemTimeNV", 138 | @@ -1285,6 +1287,22 @@ EGLint eglWaitSyncANDROID(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags) 139 | return result; 140 | } 141 | 142 | +EGLClientBuffer eglGetRenderBufferANDROID(EGLDisplay dpy, EGLSurface draw) 143 | +{ 144 | + clearError(); 145 | + 146 | + const egl_display_ptr dp = validate_display(dpy); 147 | + if (!dp) return EGL_FALSE; 148 | + 149 | + egl_surface_t const * const s = get_surface(draw); 150 | + 151 | + egl_connection_t* const cnx = &gEGLImpl; 152 | + if (cnx->dso && cnx->egl.eglGetRenderBufferANDROID) { 153 | + return cnx->egl.eglGetRenderBufferANDROID(dp->disp.dpy, s->surface); 154 | + } 155 | + return setError(EGL_BAD_DISPLAY, (EGLClientBuffer*)0); 156 | +} 157 | + 158 | // ---------------------------------------------------------------------------- 159 | // NVIDIA extensions 160 | // ---------------------------------------------------------------------------- 161 | -- 162 | 1.8.2.2 163 | 164 | -------------------------------------------------------------------------------- /tools/mkelf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (c) 2012, Sony Mobile Communications AB 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions 8 | # are met: 9 | # * Redistributions of source code must retain the above copyright 10 | # notice, this list of conditions and the following disclaimer. 11 | # * Redistributions in binary form must reproduce the above copyright 12 | # notice, this list of conditions and the following disclaimer in 13 | # the documentation and/or other materials provided with the 14 | # distribution. 15 | # * Neither the name of Sony Mobile Communications AB nor the names 16 | # of its contributors may be used to endorse or promote products 17 | # derived from this software without specific prior written 18 | # permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 26 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 27 | # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 28 | # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 30 | # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | # SUCH DAMAGE. 32 | # 33 | # DESCRIPTION 34 | # 35 | # Combine one or more files to a elf file. 36 | # 37 | # SYNOPSIS 38 | # 39 | # mkelf.py -o elf file@addr[,ramdisk] ... 40 | # 41 | # elf The path to the output file 42 | # file Input file 43 | # addr ELF vaddr and paddr of this file 44 | # ramdisk Mark this segment to be presented in ATAG list as ramdisk (optional) 45 | # ipl Mark this segment to be handled by the boot code as IPL (optional) 46 | # cmdline Mark this segment to be handled by the boot code as kernel cmdline (optional) 47 | # 48 | 49 | import re 50 | import os 51 | import sys 52 | import struct 53 | from optparse import OptionParser 54 | 55 | # Elf definitions 56 | PT_NULL = 0 57 | PT_LOAD = 1 58 | PT_NOTE = 4 59 | 60 | # SEMC Elf definitions 61 | P_FLAGS_RAMDISK = 0x80000000 62 | P_FLAGS_IPL = 0x40000000 # used for STE U8500 63 | P_FLAGS_CMDLINE = 0x20000000 64 | P_FLAGS_RPM = 0x01000000 # used for QCT MSM8x60 65 | 66 | def fatal(message): 67 | print >> sys.stderr, '%s: %s' % (os.path.basename(sys.argv[0]), message) 68 | sys.exit(1) 69 | 70 | def parse_inputs(args): 71 | segs = [] 72 | for arg in args: 73 | try: 74 | seg = {} 75 | tokens = arg.split('@') 76 | if len(tokens) != 2: 77 | fatal('Incorrect format of input parameter: ' + arg) 78 | 79 | seg['file'] = tokens[0] 80 | if tokens[1] == 'cmdline': 81 | seg['addr'] = '0' 82 | seg['flags'] = 'cmdline' 83 | else: 84 | input = re.match("^(0x[0-9a-fA-F]+)(?:,(ramdisk|ipl|entry|rpm))?$", tokens[1]).groups() 85 | seg['addr'] = input[0] 86 | seg['flags'] = input[1] 87 | segs.append(seg) 88 | except AttributeError: 89 | fatal("Incorrect format of input parameter: " + arg) 90 | return segs 91 | 92 | def write_elf_header(elf, entry, phnum): 93 | elfhdr = { 94 | 'e_ident': '\x7fELF\x01\x01\x01\x61', 95 | 'e_type': 2, 96 | 'e_machine': 40, 97 | 'e_version': 1, 98 | 'e_entry': long(entry, 16), 99 | 'e_phoff': 52, 100 | 'e_shoff': 0, 101 | 'e_flags': 0, 102 | 'e_ehsize': 52, 103 | 'e_phentsize': 32, 104 | 'e_phnum': phnum, 105 | 'e_shentsize': 0, 106 | 'e_shnum': 0, 107 | 'e_shstrndx': 0 108 | } 109 | 110 | elf.write(struct.pack('<8s8xHHLLLLLHHHHHH', 111 | elfhdr['e_ident'], elfhdr['e_type'], elfhdr['e_machine'], 112 | elfhdr['e_version'], elfhdr['e_entry'], elfhdr['e_phoff'], 113 | elfhdr['e_shoff'], elfhdr['e_flags'], elfhdr['e_ehsize'], 114 | elfhdr['e_phentsize'], elfhdr['e_phnum'], elfhdr['e_shentsize'], 115 | elfhdr['e_shnum'], elfhdr['e_shstrndx'])) 116 | 117 | def write_elf_phdr(elf, seg): 118 | type = PT_LOAD 119 | flags = 0 120 | 121 | if seg['flags'] == 'ramdisk': 122 | flags = P_FLAGS_RAMDISK 123 | elif seg['flags'] == 'ipl': 124 | flags = P_FLAGS_IPL 125 | elif seg['flags'] == 'cmdline': 126 | flags = P_FLAGS_CMDLINE 127 | type = PT_NOTE 128 | elif seg['flags'] == 'rpm': 129 | flags = P_FLAGS_RPM 130 | 131 | elfphdr = { 132 | 'p_type': type, 133 | 'p_offset': seg['offset'], 134 | 'p_vaddr': long(seg['addr'], 16), 135 | 'p_paddr': long(seg['addr'], 16), 136 | 'p_filesz': seg['size'], 137 | 'p_memsz': seg['size'], 138 | 'p_flags': flags, 139 | 'p_align': 0 140 | } 141 | 142 | elf.write(struct.pack(' 4 | * Copyright (C) 2012 Andreas Makris 5 | * Copyright (C) 2012 The CyanogenMod Project 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #define LOG_TAG "lights.lt26" 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #include 31 | #include 32 | 33 | #include 34 | #include "lights.h" 35 | 36 | /* Synchronization primities */ 37 | static pthread_once_t g_init = PTHREAD_ONCE_INIT; 38 | static pthread_mutex_t g_lock = PTHREAD_MUTEX_INITIALIZER; 39 | 40 | /* Mini-led state machine */ 41 | static struct light_state_t g_notification; 42 | static struct light_state_t g_battery; 43 | 44 | static int g_backlight = 255; 45 | 46 | /* The leds we have */ 47 | enum { 48 | LED_RED, 49 | LED_GREEN, 50 | LED_BLUE, 51 | LED_BLANK 52 | }; 53 | 54 | enum { 55 | MANUAL = 0, 56 | AUTOMATIC, 57 | MANUAL_SENSOR 58 | }; 59 | 60 | static int write_int (const char *path, int value) { 61 | int fd; 62 | static int already_warned = 0; 63 | 64 | fd = open(path, O_RDWR); 65 | if (fd < 0) { 66 | if (already_warned == 0) { 67 | ALOGE("write_int failed to open %s\n", path); 68 | already_warned = 1; 69 | } 70 | return -errno; 71 | } 72 | 73 | char buffer[20]; 74 | int bytes = snprintf(buffer, sizeof(buffer), "%d\n", value); 75 | int written = write (fd, buffer, bytes); 76 | close(fd); 77 | 78 | return written == -1 ? -errno : 0; 79 | } 80 | 81 | static int write_string (const char *path, const char *value) { 82 | int fd; 83 | static int already_warned = 0; 84 | 85 | fd = open(path, O_RDWR); 86 | if (fd < 0) { 87 | if (already_warned == 0) { 88 | ALOGE("write_string failed to open %s\n", path); 89 | already_warned = 1; 90 | } 91 | return -errno; 92 | } 93 | 94 | char buffer[20]; 95 | int bytes = snprintf(buffer, sizeof(buffer), "%s\n", value); 96 | int written = write (fd, buffer, bytes); 97 | close(fd); 98 | 99 | return written == -1 ? -errno : 0; 100 | } 101 | 102 | 103 | /* Color tools */ 104 | static int is_lit (struct light_state_t const* state) { 105 | return state->color & 0x00ffffff; 106 | } 107 | 108 | static int rgb_to_brightness (struct light_state_t const* state) { 109 | int color = state->color & 0x00ffffff; 110 | return ((77*((color>>16)&0x00ff)) 111 | + (150*((color>>8)&0x00ff)) + (29*(color&0x00ff))) >> 8; 112 | } 113 | 114 | /* The actual lights controlling section */ 115 | static int set_light_backlight (struct light_device_t *dev, struct light_state_t const *state) { 116 | int brightness = rgb_to_brightness(state); 117 | int als_mode; 118 | 119 | switch (state->brightnessMode) { 120 | case BRIGHTNESS_MODE_SENSOR: 121 | als_mode = AUTOMATIC; 122 | break; 123 | case BRIGHTNESS_MODE_USER: 124 | als_mode = BRIGHTNESS_MODE_USER; 125 | break; 126 | default: 127 | als_mode = MANUAL_SENSOR; 128 | break; 129 | } 130 | 131 | ALOGV("%s brightness=%d color=0x%08x", __func__,brightness,state->color); 132 | pthread_mutex_lock(&g_lock); 133 | g_backlight = brightness; 134 | write_int (ALS_FILE, als_mode); 135 | write_int (LCD_BACKLIGHT_FILE, brightness); 136 | pthread_mutex_unlock(&g_lock); 137 | return 0; 138 | } 139 | 140 | static int set_light_buttons (struct light_device_t *dev, struct light_state_t const* state) { 141 | size_t i; 142 | int on = is_lit(state); 143 | pthread_mutex_lock(&g_lock); 144 | 145 | for (i = 0; i < sizeof(BUTTON_BACKLIGHT_FILE)/sizeof(BUTTON_BACKLIGHT_FILE[0]); i++) { 146 | write_int (BUTTON_BACKLIGHT_FILE[i],on?255:0); 147 | } 148 | 149 | pthread_mutex_unlock(&g_lock); 150 | 151 | return 0; 152 | } 153 | 154 | static void set_shared_light_locked (struct light_device_t *dev, struct light_state_t *state) { 155 | int r, g, b; 156 | int delayOn,delayOff; 157 | 158 | r = (state->color >> 16) & 0xFF; 159 | g = (state->color >> 8) & 0xFF; 160 | b = (state->color) & 0xFF; 161 | 162 | delayOn = state->flashOnMS; 163 | delayOff = state->flashOffMS; 164 | 165 | if (state->flashMode != LIGHT_FLASH_NONE) { 166 | write_string (RED_LED_FILE_TRIGGER, "timer"); 167 | write_string (GREEN_LED_FILE_TRIGGER, "timer"); 168 | write_string (BLUE_LED_FILE_TRIGGER, "timer"); 169 | 170 | write_int (RED_LED_FILE_DELAYON, delayOn); 171 | write_int (GREEN_LED_FILE_DELAYON, delayOn); 172 | write_int (BLUE_LED_FILE_DELAYON, delayOn); 173 | 174 | write_int (RED_LED_FILE_DELAYOFF, delayOff); 175 | write_int (GREEN_LED_FILE_DELAYOFF, delayOff); 176 | write_int (BLUE_LED_FILE_DELAYOFF, delayOff); 177 | } else { 178 | write_string (RED_LED_FILE_TRIGGER, "none"); 179 | write_string (GREEN_LED_FILE_TRIGGER, "none"); 180 | write_string (BLUE_LED_FILE_TRIGGER, "none"); 181 | } 182 | 183 | write_int (RED_LED_FILE, r); 184 | write_int (GREEN_LED_FILE, g); 185 | write_int (BLUE_LED_FILE, b); 186 | } 187 | 188 | static void handle_shared_battery_locked (struct light_device_t *dev) { 189 | if (is_lit (&g_notification)) { 190 | set_shared_light_locked (dev, &g_notification); 191 | } else { 192 | set_shared_light_locked (dev, &g_battery); 193 | } 194 | } 195 | 196 | static int set_light_battery (struct light_device_t *dev, struct light_state_t const* state) { 197 | pthread_mutex_lock (&g_lock); 198 | g_battery = *state; 199 | handle_shared_battery_locked(dev); 200 | pthread_mutex_unlock (&g_lock); 201 | return 0; 202 | } 203 | 204 | static int set_light_notifications (struct light_device_t *dev, struct light_state_t const* state) { 205 | pthread_mutex_lock (&g_lock); 206 | g_notification = *state; 207 | handle_shared_battery_locked(dev); 208 | pthread_mutex_unlock (&g_lock); 209 | return 0; 210 | } 211 | 212 | /* Initializations */ 213 | void init_globals () { 214 | pthread_mutex_init (&g_lock, NULL); 215 | } 216 | 217 | /* Glueing boilerplate */ 218 | static int close_lights (struct light_device_t *dev) { 219 | if (dev) 220 | free(dev); 221 | 222 | return 0; 223 | } 224 | 225 | static int open_lights (const struct hw_module_t* module, char const* name, 226 | struct hw_device_t** device) { 227 | int (*set_light)(struct light_device_t* dev, 228 | struct light_state_t const *state); 229 | 230 | if (0 == strcmp(LIGHT_ID_BACKLIGHT, name)) { 231 | set_light = set_light_backlight; 232 | } 233 | else if (0 == strcmp(LIGHT_ID_BUTTONS, name)) { 234 | set_light = set_light_buttons; 235 | } 236 | else if (0 == strcmp(LIGHT_ID_BATTERY, name)) { 237 | set_light = set_light_battery; 238 | } 239 | else if (0 == strcmp(LIGHT_ID_NOTIFICATIONS, name)) { 240 | set_light = set_light_notifications; 241 | } 242 | else { 243 | return -EINVAL; 244 | } 245 | 246 | pthread_once (&g_init, init_globals); 247 | struct light_device_t *dev = malloc(sizeof (struct light_device_t)); 248 | memset(dev, 0, sizeof(*dev)); 249 | 250 | dev->common.tag = HARDWARE_DEVICE_TAG; 251 | dev->common.version = 0; 252 | dev->common.module = (struct hw_module_t*)module; 253 | dev->common.close = (int (*)(struct hw_device_t*))close_lights; 254 | dev->set_light = set_light; 255 | 256 | *device = (struct hw_device_t*)dev; 257 | return 0; 258 | } 259 | 260 | static struct hw_module_methods_t lights_module_methods = { 261 | .open = open_lights, 262 | }; 263 | 264 | 265 | struct hw_module_t HAL_MODULE_INFO_SYM = { 266 | .tag = HARDWARE_MODULE_TAG, 267 | .version_major = 1, 268 | .version_minor = 0, 269 | .id = LIGHTS_HARDWARE_MODULE_ID, 270 | .name = "Sony lights module", 271 | .author = "Diogo Ferreira , Andreas Makris ", 272 | .methods = &lights_module_methods, 273 | }; 274 | -------------------------------------------------------------------------------- /liblight/NOTICE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) 2008, The Android Open Source Project 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | 13 | 14 | Apache License 15 | Version 2.0, January 2004 16 | http://www.apache.org/licenses/ 17 | 18 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 19 | 20 | 1. Definitions. 21 | 22 | "License" shall mean the terms and conditions for use, reproduction, 23 | and distribution as defined by Sections 1 through 9 of this document. 24 | 25 | "Licensor" shall mean the copyright owner or entity authorized by 26 | the copyright owner that is granting the License. 27 | 28 | "Legal Entity" shall mean the union of the acting entity and all 29 | other entities that control, are controlled by, or are under common 30 | control with that entity. For the purposes of this definition, 31 | "control" means (i) the power, direct or indirect, to cause the 32 | direction or management of such entity, whether by contract or 33 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 34 | outstanding shares, or (iii) beneficial ownership of such entity. 35 | 36 | "You" (or "Your") shall mean an individual or Legal Entity 37 | exercising permissions granted by this License. 38 | 39 | "Source" form shall mean the preferred form for making modifications, 40 | including but not limited to software source code, documentation 41 | source, and configuration files. 42 | 43 | "Object" form shall mean any form resulting from mechanical 44 | transformation or translation of a Source form, including but 45 | not limited to compiled object code, generated documentation, 46 | and conversions to other media types. 47 | 48 | "Work" shall mean the work of authorship, whether in Source or 49 | Object form, made available under the License, as indicated by a 50 | copyright notice that is included in or attached to the work 51 | (an example is provided in the Appendix below). 52 | 53 | "Derivative Works" shall mean any work, whether in Source or Object 54 | form, that is based on (or derived from) the Work and for which the 55 | editorial revisions, annotations, elaborations, or other modifications 56 | represent, as a whole, an original work of authorship. For the purposes 57 | of this License, Derivative Works shall not include works that remain 58 | separable from, or merely link (or bind by name) to the interfaces of, 59 | the Work and Derivative Works thereof. 60 | 61 | "Contribution" shall mean any work of authorship, including 62 | the original version of the Work and any modifications or additions 63 | to that Work or Derivative Works thereof, that is intentionally 64 | submitted to Licensor for inclusion in the Work by the copyright owner 65 | or by an individual or Legal Entity authorized to submit on behalf of 66 | the copyright owner. For the purposes of this definition, "submitted" 67 | means any form of electronic, verbal, or written communication sent 68 | to the Licensor or its representatives, including but not limited to 69 | communication on electronic mailing lists, source code control systems, 70 | and issue tracking systems that are managed by, or on behalf of, the 71 | Licensor for the purpose of discussing and improving the Work, but 72 | excluding communication that is conspicuously marked or otherwise 73 | designated in writing by the copyright owner as "Not a Contribution." 74 | 75 | "Contributor" shall mean Licensor and any individual or Legal Entity 76 | on behalf of whom a Contribution has been received by Licensor and 77 | subsequently incorporated within the Work. 78 | 79 | 2. Grant of Copyright License. Subject to the terms and conditions of 80 | this License, each Contributor hereby grants to You a perpetual, 81 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 82 | copyright license to reproduce, prepare Derivative Works of, 83 | publicly display, publicly perform, sublicense, and distribute the 84 | Work and such Derivative Works in Source or Object form. 85 | 86 | 3. Grant of Patent License. Subject to the terms and conditions of 87 | this License, each Contributor hereby grants to You a perpetual, 88 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 89 | (except as stated in this section) patent license to make, have made, 90 | use, offer to sell, sell, import, and otherwise transfer the Work, 91 | where such license applies only to those patent claims licensable 92 | by such Contributor that are necessarily infringed by their 93 | Contribution(s) alone or by combination of their Contribution(s) 94 | with the Work to which such Contribution(s) was submitted. If You 95 | institute patent litigation against any entity (including a 96 | cross-claim or counterclaim in a lawsuit) alleging that the Work 97 | or a Contribution incorporated within the Work constitutes direct 98 | or contributory patent infringement, then any patent licenses 99 | granted to You under this License for that Work shall terminate 100 | as of the date such litigation is filed. 101 | 102 | 4. Redistribution. You may reproduce and distribute copies of the 103 | Work or Derivative Works thereof in any medium, with or without 104 | modifications, and in Source or Object form, provided that You 105 | meet the following conditions: 106 | 107 | (a) You must give any other recipients of the Work or 108 | Derivative Works a copy of this License; and 109 | 110 | (b) You must cause any modified files to carry prominent notices 111 | stating that You changed the files; and 112 | 113 | (c) You must retain, in the Source form of any Derivative Works 114 | that You distribute, all copyright, patent, trademark, and 115 | attribution notices from the Source form of the Work, 116 | excluding those notices that do not pertain to any part of 117 | the Derivative Works; and 118 | 119 | (d) If the Work includes a "NOTICE" text file as part of its 120 | distribution, then any Derivative Works that You distribute must 121 | include a readable copy of the attribution notices contained 122 | within such NOTICE file, excluding those notices that do not 123 | pertain to any part of the Derivative Works, in at least one 124 | of the following places: within a NOTICE text file distributed 125 | as part of the Derivative Works; within the Source form or 126 | documentation, if provided along with the Derivative Works; or, 127 | within a display generated by the Derivative Works, if and 128 | wherever such third-party notices normally appear. The contents 129 | of the NOTICE file are for informational purposes only and 130 | do not modify the License. You may add Your own attribution 131 | notices within Derivative Works that You distribute, alongside 132 | or as an addendum to the NOTICE text from the Work, provided 133 | that such additional attribution notices cannot be construed 134 | as modifying the License. 135 | 136 | You may add Your own copyright statement to Your modifications and 137 | may provide additional or different license terms and conditions 138 | for use, reproduction, or distribution of Your modifications, or 139 | for any such Derivative Works as a whole, provided Your use, 140 | reproduction, and distribution of the Work otherwise complies with 141 | the conditions stated in this License. 142 | 143 | 5. Submission of Contributions. Unless You explicitly state otherwise, 144 | any Contribution intentionally submitted for inclusion in the Work 145 | by You to the Licensor shall be under the terms and conditions of 146 | this License, without any additional terms or conditions. 147 | Notwithstanding the above, nothing herein shall supersede or modify 148 | the terms of any separate license agreement you may have executed 149 | with Licensor regarding such Contributions. 150 | 151 | 6. Trademarks. This License does not grant permission to use the trade 152 | names, trademarks, service marks, or product names of the Licensor, 153 | except as required for reasonable and customary use in describing the 154 | origin of the Work and reproducing the content of the NOTICE file. 155 | 156 | 7. Disclaimer of Warranty. Unless required by applicable law or 157 | agreed to in writing, Licensor provides the Work (and each 158 | Contributor provides its Contributions) on an "AS IS" BASIS, 159 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 160 | implied, including, without limitation, any warranties or conditions 161 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 162 | PARTICULAR PURPOSE. You are solely responsible for determining the 163 | appropriateness of using or redistributing the Work and assume any 164 | risks associated with Your exercise of permissions under this License. 165 | 166 | 8. Limitation of Liability. In no event and under no legal theory, 167 | whether in tort (including negligence), contract, or otherwise, 168 | unless required by applicable law (such as deliberate and grossly 169 | negligent acts) or agreed to in writing, shall any Contributor be 170 | liable to You for damages, including any direct, indirect, special, 171 | incidental, or consequential damages of any character arising as a 172 | result of this License or out of the use or inability to use the 173 | Work (including but not limited to damages for loss of goodwill, 174 | work stoppage, computer failure or malfunction, or any and all 175 | other commercial damages or losses), even if such Contributor 176 | has been advised of the possibility of such damages. 177 | 178 | 9. Accepting Warranty or Additional Liability. While redistributing 179 | the Work or Derivative Works thereof, You may choose to offer, 180 | and charge a fee for, acceptance of support, warranty, indemnity, 181 | or other liability obligations and/or rights consistent with this 182 | License. However, in accepting such obligations, You may act only 183 | on Your own behalf and on Your sole responsibility, not on behalf 184 | of any other Contributor, and only if You agree to indemnify, 185 | defend, and hold each Contributor harmless for any liability 186 | incurred by, or claims asserted against, such Contributor by reason 187 | of your accepting any such warranty or additional liability. 188 | 189 | END OF TERMS AND CONDITIONS 190 | 191 | -------------------------------------------------------------------------------- /config/init.semc.rc: -------------------------------------------------------------------------------- 1 | import init.semc.usb.rc 2 | 3 | on early-init 4 | export EXTERNAL_STORAGE /storage/sdcard0 5 | mkdir /storage 0050 system sdcard_r 6 | mkdir /storage/sdcard0 0000 system system 7 | # for backwards compatibility 8 | symlink /storage/sdcard0 /sdcard 9 | symlink /storage/sdcard0 /mnt/sdcard 10 | 11 | on fs 12 | mount_all /fstab.lt26 13 | 14 | setprop ro.crypto.state unsupported 15 | 16 | setprop ro.emmc 1 17 | 18 | # SEMC, TA Daemon 19 | class_start trimarea 20 | exec /system/bin/wait4tad 21 | 22 | on post-fs 23 | mkdir /system/etc/firmware/misc 0771 system system 24 | mkdir /data/tombstones 0755 system system 25 | mkdir /data/mediaserver 0740 media media 26 | 27 | # Change to socket location on libkeyctrl/suntory for /data encryption 28 | mkdir /dev/socket/suntory 0755 system system 29 | 30 | chmod 0664 /sys/devices/platform/msm_sdcc.1/polling 31 | chmod 0664 /sys/devices/platform/msm_sdcc.3/polling 32 | chmod 0664 /sys/devices/platform/msm_sdcc.4/polling 33 | 34 | mkdir /data/radio 0770 radio radio 35 | 36 | mkdir /data/idd 0755 idd idd 37 | mount ext4 /dev/block/mmcblk0p10 /data/idd nosuid nodev noatime barrier=0 38 | chown idd idd /data/idd 39 | chmod 0755 /data/idd 40 | 41 | # Camera 42 | mkdir /data/camera 0771 root camera 43 | 44 | #Create QMUX deamon socket area 45 | mkdir /dev/socket/qmux_radio 0770 radio radio 46 | chmod 2770 /dev/socket/qmux_radio 47 | mkdir /dev/socket/qmux_audio 0770 media audio 48 | chmod 2770 /dev/socket/qmux_audio 49 | mkdir /dev/socket/qmux_bluetooth 0770 bluetooth bluetooth 50 | chmod 2770 /dev/socket/qmux_bluetooth 51 | 52 | on early-boot 53 | # set RLIMIT_MEMLOCK to 64MB 54 | setrlimit 8 67108864 67108864 55 | 56 | # Remove write permissions to video related nodes 57 | chmod 0660 /sys/devices/virtual/graphics/fb1/video_mode 58 | chmod 0440 /sys/devices/virtual/graphics/fb1/video_mode_str 59 | chmod 0440 /sys/devices/virtual/graphics/fb1/connected 60 | chmod 0440 /sys/devices/virtual/graphics/fb1/edid_modes 61 | chmod 0440 /sys/devices/virtual/graphics/fb1/hdcp 62 | chmod 0660 /sys/devices/virtual/graphics/fb1/hpd 63 | chmod 0440 /sys/devices/virtual/graphics/fb1/3d_present 64 | chmod 0440 /sys/devices/virtual/graphics/fb1/hdcp_present 65 | chmod 0660 /sys/devices/virtual/graphics/fb1/format_3d 66 | chmod 0660 /sys/devices/virtual/graphics/fb1/edid_3d_modes 67 | chmod 0440 /sys/devices/virtual/graphics/fb1/underscan 68 | chmod 0440 /sys/devices/virtual/graphics/fb1/dvi 69 | chmod 0440 /sys/devices/virtual/graphics/fb1/pa 70 | chmod 0660 /sys/devices/virtual/graphics/fb1/cec 71 | chmod 0660 /sys/devices/virtual/graphics/fb1/cec_logical_addr 72 | chmod 0660 /sys/devices/virtual/graphics/fb1/cec_wr_frame 73 | chmod 0660 /sys/devices/virtual/graphics/fb1/product_description 74 | chmod 0660 /sys/devices/virtual/graphics/fb1/vendor_name 75 | 76 | # Change owner and group for system server and surface flinger 77 | chown system graphics /sys/devices/virtual/graphics/fb1/video_mode 78 | chown system graphics /sys/devices/virtual/graphics/fb1/video_mode_str 79 | chown system graphics /sys/devices/virtual/graphics/fb1/connected 80 | chown system graphics /sys/devices/virtual/graphics/fb1/edid_modes 81 | chown system graphics /sys/devices/virtual/graphics/fb1/hdcp 82 | chown system graphics /sys/devices/virtual/graphics/fb1/hpd 83 | chown system graphics /sys/devices/virtual/graphics/fb1/3d_present 84 | chown system graphics /sys/devices/virtual/graphics/fb1/hdcp_present 85 | chown system graphics /sys/devices/virtual/graphics/fb1/format_3d 86 | chown system graphics /sys/devices/virtual/graphics/fb1/edid_3d_modes 87 | chown system graphics /sys/devices/virtual/graphics/fb1/underscan 88 | chown system graphics /sys/devices/virtual/graphics/fb1/dvi 89 | chown system graphics /sys/devices/virtual/graphics/fb1/pa 90 | chown system graphics /sys/devices/virtual/graphics/fb1/cec 91 | chown system graphics /sys/devices/virtual/graphics/fb1/cec_logical_addr 92 | chown system graphics /sys/devices/virtual/graphics/fb1/cec_wr_frame 93 | chown system graphics /sys/devices/virtual/graphics/fb1/product_description 94 | chown system graphics /sys/devices/virtual/graphics/fb1/vendor_name 95 | 96 | # Permissions for AKM897x sensor 97 | chown system system /data/misc/akm_set.txt 98 | chown system system /sys/class/compass/akm8972/interval 99 | chown system system /sys/class/compass/akm8972/single 100 | chown system system /sys/class/compass/akm8972/registers 101 | chown system system /sys/class/compass/akm8975/interval 102 | chown system system /sys/class/compass/akm8975/single 103 | chown system system /sys/class/compass/akm8975/registers 104 | 105 | on boot 106 | # Optimized browser caching and connection handling 107 | setprop net.http.idle_cache.size 40 108 | setprop net.http.threads 10 109 | setprop net.webkit.cache.size 12582912 110 | setprop net.nw.cache.prioadvstep 86400000 111 | setprop net.nw.cache.weightadvstep 3600000 112 | setprop net.nw.cache.orderby weight 113 | setprop net.http.idle_cache.shutdown true 114 | setprop net.webkit.cache.mindeadsize 4194304 115 | setprop net.webkit.cache.maxdeadsize 4194304 116 | 117 | # USB Host support 118 | mkdir /dev/bus 0711 system system 119 | mkdir /dev/bus/usb 0711 system system 120 | 121 | setprop ro.wifi.wps_enable true 122 | 123 | write /proc/sys/kernel/sysrq 0 124 | write /proc/sys/kernel/watchdog_thresh 5 125 | 126 | exec /system/bin/cal_data_manager 127 | 128 | # Enable Wifi EAP SIM 129 | setprop ro.wifi.eap_sim_enabled true 130 | 131 | chown system system /sys/module/sco/parameters/disable_esco 132 | 133 | chmod 0660 /sys/devices/platform/msm_serial_hs.0/clock 134 | 135 | #Set SUID bit for diag_mdlog 136 | chmod 4755 /system/bin/diag_mdlog 137 | 138 | # LM35xx/cameralight 139 | chown system camera /sys/devices/i2c-3/3-0053/torch_enable 140 | chown system camera /sys/devices/i2c-3/3-0053/torch_current 141 | chown system camera /sys/devices/i2c-3/3-0053/privacy_enable 142 | chown system camera /sys/devices/i2c-3/3-0053/privacy_current 143 | chown system camera /sys/devices/i2c-3/3-0053/flash_enable 144 | chown system camera /sys/devices/i2c-3/3-0053/flash_duration 145 | chown system camera /sys/devices/i2c-3/3-0053/flash_synchronization 146 | chown system camera /sys/devices/i2c-3/3-0053/flash_current 147 | chown system camera /sys/devices/i2c-3/3-0053/status 148 | 149 | # Owner for the proximity sensor 150 | chown system system /sys/devices/i2c-3/3-0054/threshold 151 | chown system system /sys/devices/i2c-3/3-0054/nburst 152 | 153 | # Default tcp buffersizes for hsdpa 154 | setprop net.tcp.buffersize.hsdpa 4094,87380,1220608,4096,16384,1220608 155 | setprop net.tcp.buffersize.hspa 4094,87380,1220608,4096,16384,1220608 156 | 157 | # bluetooth power up/down interface 158 | chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type 159 | chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state 160 | chmod 0660 /sys/class/rfkill/rfkill0/state 161 | 162 | # bluetooth address programming 163 | setprop ro.bt.bdaddr_path /data/etc/bluetooth_bdaddr 164 | 165 | # power-management 166 | write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ondemand 167 | 168 | write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor ondemand 169 | write /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate 50000 170 | write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold 90 171 | write /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy 1 172 | write /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor 4 173 | write /sys/devices/system/cpu/cpufreq/ondemand/down_differential 10 174 | write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 384000 175 | write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 384000 176 | 177 | write /sys/module/rpm_resources/enable_low_power/L2_cache 1 178 | write /sys/module/rpm_resources/enable_low_power/pxo 1 179 | write /sys/module/rpm_resources/enable_low_power/vdd_dig 2 180 | write /sys/module/rpm_resources/enable_low_power/vdd_mem 2 181 | write /sys/module/rpm_resources/enable_low_power/rpm_cpu 1 182 | 183 | write /sys/module/pm_8x60/modes/cpu0/power_collapse/suspend_enabled 1 184 | write /sys/module/pm_8x60/modes/cpu1/power_collapse/suspend_enabled 1 185 | write /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/suspend_enabled 1 186 | write /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/suspend_enabled 1 187 | write /sys/module/pm_8x60/modes/cpu0/power_collapse/idle_enabled 1 188 | write /sys/module/pm_8x60/modes/cpu1/power_collapse/idle_enabled 1 189 | write /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/idle_enabled 1 190 | write /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/idle_enabled 1 191 | 192 | chown root.system /sys/devices/system/cpu/mfreq 193 | chmod 220 /sys/devices/system/cpu/mfreq 194 | chown root.system /sys/devices/system/cpu/cpu1/online 195 | chmod 664 /sys/devices/system/cpu/cpu1/online 196 | 197 | # Create the directories and files expected by the lcatp service 198 | # only found in eng builds. 199 | # Preferably the ONLY_IN_VARIANT macro should be used but 200 | # seems like the build system does not parse this file properly. 201 | mkdir /data/misc/tsce 0770 system system 202 | write /data/misc/tsce/userfile.txt 0 203 | write /data/misc/tsce/userfile2.txt 0 204 | write /data/misc/tsce/logfile.txt 0 205 | chown system system /data/misc/tsce/userfile.txt 206 | chown system system /data/misc/tsce/userfile2.txt 207 | chown system system /data/misc/tsce/logfile.txt 208 | chmod 0660 /data/misc/tsce/userfile.txt 209 | chmod 0660 /data/misc/tsce/userfile2.txt 210 | chmod 0660 /data/misc/tsce/logfile.txt 211 | 212 | mount debugfs /sys/kernel/debug /sys/kernel/debug 213 | 214 | insmod /system/lib/modules/bcmdhd.ko nvram_path=/system/etc/wifi/calibration iface_name=wlan0 215 | 216 | on init 217 | # create mountpoint 218 | mkdir /storage/usbdisk 0000 system system 219 | 220 | # Create symlink 221 | symlink /storage/usbdisk /usbdisk 222 | symlink /storage/usbdisk /mnt/usbdisk 223 | 224 | # setup the global environment 225 | export SECONDARY_STORAGE /storage/usbdisk 226 | 227 | on post-fs-data 228 | mkdir /data/misc/wifi 0770 wifi wifi 229 | mkdir /data/misc/wifi/sockets 0770 wifi wifi 230 | mkdir /data/misc/dhcp 0770 dhcp dhcp 231 | chown dhcp dhcp /data/misc/dhcp 232 | 233 | chown system system /sys/devices/platform/msm_hsusb/gadget/lun1/file 234 | chmod 0660 /sys/devices/platform/msm_hsusb/gadget/lun1/file 235 | write /sys/class/android_usb/f_mass_storage/inquiry_string "SONY Mass Storage 0100" 236 | write /sys/class/android_usb/f_cdrom/cdrom_inquiry_string "SONY CD-ROM 0100" 237 | write /sys/class/android_usb/f_mass_storage/serial_number ${ro.serialno} 238 | write /sys/class/android_usb/f_mass_storage/eui64_id 000AD90000000000 239 | write /sys/devices/platform/msm_hsusb/gadget/lun0/nofua 1 240 | write /sys/devices/platform/msm_hsusb/gadget/lun1/nofua 1 241 | 242 | setprop vold.post_fs_data_done 1 243 | 244 | # Start suntrold 245 | service suntrold /system/bin/suntrold 246 | class main 247 | user system 248 | group system 249 | oneshot 250 | 251 | service secchan /system/bin/secchand 252 | class main 253 | user system 254 | group system 255 | 256 | service time_daemon /system/bin/time_daemon 257 | class main 258 | user root 259 | group root 260 | oneshot 261 | disabled 262 | 263 | on property:persist.timed.enable=true 264 | mkdir /data/time/ 0700 system system 265 | start time_daemon 266 | 267 | service hciattach /system/bin/brcm_patchram_plus --enable_hci --enable_lpm \ 268 | --use_baudrate_for_download --tosleep 20000 --scopcm 0,4,0,0,0,0,0,0,3,0 \ 269 | --no2bytes --baudrate 3000000 --patchram /system/etc/firmware/BCM4330.hcd \ 270 | /dev/ttyHS0 271 | class main 272 | user bluetooth 273 | group bluetooth net_bt_admin 274 | disabled 275 | oneshot 276 | 277 | service updatemiscta /system/bin/updatemiscta 278 | class core 279 | user root 280 | disabled 281 | oneshot 282 | 283 | service rmt_storage /system/bin/rmt_storage 284 | class main 285 | user root 286 | 287 | # SEMC, TA rmt service 288 | service ta_rmt_service /system/bin/ta_rmt_service 289 | class main 290 | user root 291 | 292 | # Copy calibration data from NV to kernel drivers 293 | service nvimport /system/bin/nvimport 294 | class main 295 | user root 296 | oneshot 297 | 298 | service p2p_supplicant /system/bin/wpa_supplicant \ 299 | -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -N \ 300 | -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf -e/data/misc/wifi/entropy.bin -puse_p2p_group_interface=1 301 | # we will start as root and wpa_supplicant will switch to user wifi 302 | # after setting up the capabilities required for WEXT 303 | # user wifi 304 | # group wifi inet keystore 305 | class main 306 | socket wpa_wlan0 dgram 660 wifi wifi 307 | disabled 308 | oneshot 309 | 310 | service wpa_supplicant /system/bin/wpa_supplicant \ 311 | -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -e/data/misc/wifi/entropy.bin 312 | # we will start as root and wpa_supplicant will switch to user wifi 313 | # after setting up the capabilities required for WEXT 314 | # user wifi 315 | # group wifi inet keystore 316 | class main 317 | socket wpa_wlan0 dgram 660 wifi wifi 318 | disabled 319 | oneshot 320 | 321 | service dhcpcd_wlan0 /system/bin/dhcpcd -aABKL 322 | class main 323 | disabled 324 | oneshot 325 | 326 | service dhcpcd_p2p /system/bin/dhcpcd -aABKL 327 | class main 328 | disabled 329 | oneshot 330 | 331 | service dhcpcd_bnep0 /system/bin/dhcpcd -ABKL 332 | class main 333 | disabled 334 | oneshot 335 | 336 | service iprenew_wlan0 /system/bin/dhcpcd -n 337 | class main 338 | disabled 339 | oneshot 340 | 341 | service iprenew_p2p /system/bin/dhcpcd -n 342 | class main 343 | disabled 344 | oneshot 345 | 346 | service iprenew_bnep0 /system/bin/dhcpcd -n 347 | class main 348 | disabled 349 | oneshot 350 | 351 | service qmuxd /system/bin/qmuxd 352 | class late_start 353 | user radio 354 | group radio audio bluetooth gps 355 | 356 | service netmgrd /system/bin/netmgrd 357 | class late_start 358 | 359 | # SEMC, TA Daemon 360 | service tad /system/bin/tad /dev/block/mmcblk0p1 0,16,256 361 | class trimarea 362 | user root 363 | group root 364 | socket tad stream 0660 system system 365 | 366 | service hw_config /system/bin/sh /system/etc/hw_config.sh 367 | class main 368 | user root 369 | oneshot 370 | 371 | on property:ro.use_data_netmgrd=false 372 | # netmgr not supported on specific target 373 | stop netmgrd 374 | 375 | service mpdecision /system/bin/mpdecision --no_sleep --avg_comp 376 | class main 377 | user root 378 | disabled 379 | 380 | service thermald /system/bin/thermald -c /system/etc/thermald-lt26.conf 381 | class main 382 | socket thermald stream 0666 root root 383 | user root 384 | disabled 385 | 386 | on property:init.svc.bootanim=stopped 387 | start mpdecision 388 | start thermald 389 | 390 | service nvcustomizer /system/bin/nvcustomizer 391 | class late_start 392 | user root 393 | oneshot 394 | disabled 395 | 396 | on property:ro.nvcust=1 397 | start nvcustomizer 398 | 399 | on property:vold.decrypt=trigger_post_fs_data 400 | mkdir /data/idd 0755 idd idd 401 | mount ext4 /dev/block/mmcblk0p10 /data/idd nosuid nodev noatime barrier=0 402 | chown idd idd /data/idd 403 | 404 | service hdmid /system/bin/hdmid 405 | class late_start 406 | socket hdmid stream 0660 root system graphics 407 | disabled 408 | 409 | on property:ro.hdmi.enable=true 410 | start hdmid 411 | 412 | on property:sys.radio.shutdown=true 413 | exec /system/bin/sh /system/etc/init.qcom.efs.sync.sh 414 | --------------------------------------------------------------------------------