diff --git a/AndroidBoard.mk b/AndroidBoard.mk index 184912f..e1e9c28 100644 --- a/AndroidBoard.mk +++ b/AndroidBoard.mk @@ -2,7 +2,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -ALL_PREBUILT += $(INSTALLED_KERNEL_TARGET) +#ALL_PREBUILT += $(INSTALLED_KERNEL_TARGET) # include the non-open-source counterpart to this file -include vendor/lge/thunderc/AndroidBoardVendor.mk diff --git a/BoardConfig.mk b/BoardConfig.mk index debd855..4cbed6b 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -1,11 +1,31 @@ -include vendor/lge/thunderc/BoardConfigVendor.mk -include device/lge/msm7x27-common/BoardConfigCommon.mk -#TARGET_KERNEL_CONFIG := cyanogenmod_p500_p509_defconfig +TARGET_KERNEL_CONFIG := aaathunderc-test1_defconfig BOARD_KERNEL_CMDLINE := mem=471M console=ttyMSM2,115200n8 androidboot.hardware=thunderc -BOARD_USE_USB_MASS_STORAGE_SWITCH := true -BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/lge/thunderc/bluetooth -SMALLER_FONT_FOOTPRINT := true +COMMON_GLOBAL_CFLAGS += -DBOARD_CHARGING_CMDLINE_NAME='"lge.reboot"' -DBOARD_CHARGING_CMDLINE_VALUE='"pwroff"' TARGET_BOOTLOADER_BOARD_NAME := thunderc -TARGET_OTA_ASSERT_DEVICE := thunderc,LS670,VM670 +TARGET_OTA_ASSERT_DEVICE := thunderc,LS670,VM670,thunderc_LS670,thunderc_VM670 + +#TARGET_RECOVERY_PIXEL_FORMAT := RGBX_8888 +#BOARD_HAS_NO_SELECT_BUTTON := true +#TARGET_NO_BOOTLOADER := true +#BOARD_USES_RECOVERY_CHARGEMODE := false +#TARGET_RECOVERY_INITRC := device/lge/thunderc/init.recovery.rc +#twrp +#DEVICE_RESOLUTION := 320x480 +#RECOVERY_GRAPHICS_USE_LINELENGTH := true +#TW_NO_REBOOT_BOOTLOADER := true +#LOCAL_CFLAGS += -DTW_NO_REBOOT_BOOTLOADER +#TW_CUSTOM_POWER_BUTTON := 107 + +#TARGET_RECOVERY_PIXEL_FORMAT := RGB_565 +#TARGET_RECOVERY_PIXEL_FORMAT := "RGB_565" + +SMALLER_FONT_FOOTPRINT := true + + +#BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/lge/thunderc/bluetooth + +P500_SPEAKER_IN_CALL_FIX := true diff --git a/bluetooth/bdroid_buildcfg.h b/bluetooth/bdroid_buildcfg.h index 4e9b35a..6c23d88 100644 --- a/bluetooth/bdroid_buildcfg.h +++ b/bluetooth/bdroid_buildcfg.h @@ -17,7 +17,7 @@ #ifndef _BDROID_BUILDCFG_H #define _BDROID_BUILDCFG_H -#define BTM_DEF_LOCAL_NAME "P500" +#define BTM_DEF_LOCAL_NAME "LGE-LS670" #define BTA_DISABLE_DELAY 1000 /* in milliseconds */ #endif diff --git a/bluetooth/bt_vendor.conf b/bluetooth/bt_vendor.conf new file mode 100644 index 0000000..e566ce7 --- /dev/null +++ b/bluetooth/bt_vendor.conf @@ -0,0 +1,8 @@ +# UART device port where Bluetooth controller is attached +UartPort = /dev/ttyHS0 + +# Firmware patch file location +FwPatchFilePath = /etc/firmware/ + +# Firmware patch file name +FwPatchFileName = BCM4325D1_004.002.004.0218.0248.hcd diff --git a/chargemode/chargerimages/battery_ani_01.rle b/chargemode/chargerimages/battery_ani_01.rle new file mode 100644 index 0000000..a016452 Binary files /dev/null and b/chargemode/chargerimages/battery_ani_01.rle differ diff --git a/chargemode/chargerimages/battery_ani_02.rle b/chargemode/chargerimages/battery_ani_02.rle new file mode 100644 index 0000000..16e52ed Binary files /dev/null and b/chargemode/chargerimages/battery_ani_02.rle differ diff --git a/chargemode/chargerimages/battery_ani_03.rle b/chargemode/chargerimages/battery_ani_03.rle new file mode 100644 index 0000000..88989ee Binary files /dev/null and b/chargemode/chargerimages/battery_ani_03.rle differ diff --git a/chargemode/chargerimages/battery_ani_04.rle b/chargemode/chargerimages/battery_ani_04.rle new file mode 100644 index 0000000..97f531e Binary files /dev/null and b/chargemode/chargerimages/battery_ani_04.rle differ diff --git a/chargemode/chargerimages/battery_ani_05.rle b/chargemode/chargerimages/battery_ani_05.rle new file mode 100644 index 0000000..cfb81d2 Binary files /dev/null and b/chargemode/chargerimages/battery_ani_05.rle differ diff --git a/chargemode/chargerimages/battery_bg.rle b/chargemode/chargerimages/battery_bg.rle new file mode 100644 index 0000000..015dbb1 Binary files /dev/null and b/chargemode/chargerimages/battery_bg.rle differ diff --git a/chargemode/chargerimages/battery_charging_01.rle b/chargemode/chargerimages/battery_charging_01.rle new file mode 100644 index 0000000..e3d2a02 Binary files /dev/null and b/chargemode/chargerimages/battery_charging_01.rle differ diff --git a/chargemode/chargerimages/battery_charging_02.rle b/chargemode/chargerimages/battery_charging_02.rle new file mode 100644 index 0000000..001594f Binary files /dev/null and b/chargemode/chargerimages/battery_charging_02.rle differ diff --git a/chargemode/chargerimages/battery_charging_03.rle b/chargemode/chargerimages/battery_charging_03.rle new file mode 100644 index 0000000..deaf900 Binary files /dev/null and b/chargemode/chargerimages/battery_charging_03.rle differ diff --git a/chargemode/chargerimages/battery_charging_04.rle b/chargemode/chargerimages/battery_charging_04.rle new file mode 100644 index 0000000..55c2363 Binary files /dev/null and b/chargemode/chargerimages/battery_charging_04.rle differ diff --git a/chargemode/chargerimages/battery_charging_05.rle b/chargemode/chargerimages/battery_charging_05.rle new file mode 100644 index 0000000..bb1b0e8 Binary files /dev/null and b/chargemode/chargerimages/battery_charging_05.rle differ diff --git a/chargemode/chargerimages/battery_charging_06.rle b/chargemode/chargerimages/battery_charging_06.rle new file mode 100644 index 0000000..9df5f5f Binary files /dev/null and b/chargemode/chargerimages/battery_charging_06.rle differ diff --git a/chargemode/chargerimages/battery_wait_ani_01.rle b/chargemode/chargerimages/battery_wait_ani_01.rle new file mode 100644 index 0000000..6945d9d Binary files /dev/null and b/chargemode/chargerimages/battery_wait_ani_01.rle differ diff --git a/chargemode/chargerimages/battery_wait_ani_02.rle b/chargemode/chargerimages/battery_wait_ani_02.rle new file mode 100644 index 0000000..7b7c9d2 Binary files /dev/null and b/chargemode/chargerimages/battery_wait_ani_02.rle differ diff --git a/chargemode/chargerimages/black_bg.rle b/chargemode/chargerimages/black_bg.rle new file mode 100644 index 0000000..dccb29f Binary files /dev/null and b/chargemode/chargerimages/black_bg.rle differ diff --git a/chargemode/chargerlogo b/chargemode/chargerlogo new file mode 100644 index 0000000..da353f2 Binary files /dev/null and b/chargemode/chargerlogo differ diff --git a/checkbootreason b/checkbootreason new file mode 100644 index 0000000..a6b879f --- /dev/null +++ b/checkbootreason @@ -0,0 +1,11 @@ +#!/system/bin/sh + +sleep 3 +# See: Documentation/arm/msm/boot.txt +boot_reason=`cat /proc/sys/kernel/boot_reason` +# "reboot charge_reset" if boot_reason&1==1 (power button long press) +((($boot_reason&1)==1)) && reboot charge_reset + +# Start CHARGER after boot_reason to prevent charging anims +exec /sbin/chargerlogo + diff --git a/cm.dependencies b/cm.dependencies~ similarity index 92% rename from cm.dependencies rename to cm.dependencies~ index ee13019..4b4282e 100644 --- a/cm.dependencies +++ b/cm.dependencies~ @@ -8,7 +8,7 @@ "target_path": "device/lge/msm7x27-common", "branch": "cm-10.1" }, { - "repository": "android_vendor_lge_thunderc", + "repository": "android_vendor_lge", "target_path": "vendor/lge/thunderc", "branch": "cm-10.1" }, { diff --git a/cm.mk b/cm.mk index 696ad6c..25640c1 100644 --- a/cm.mk +++ b/cm.mk @@ -1,17 +1,12 @@ -# Boot Animation -TARGET_SCREEN_HEIGHT := 480 -TARGET_SCREEN_WIDTH := 320 - # Include GSM stuff $(call inherit-product, vendor/cm/config/cdma.mk) # Inherit device configuration for thunderc. $(call inherit-product, device/lge/thunderc/thunderc.mk) +# Boot Animation +TARGET_SCREEN_HEIGHT := 480 +TARGET_SCREEN_WIDTH := 320 -# Inherit some common cyanogenmod stuff. -$(call inherit-product, vendor/cm/config/tiny.mk) - -# Include FM-Radio stuff -#$(call inherit-product, vendor/cyanogen/products/bcm_fm_radio.mk) +$(call inherit-product, vendor/cm/config/mini.mk) PRODUCT_NAME := cm_thunderc PRODUCT_BRAND := lge @@ -20,12 +15,10 @@ PRODUCT_MODEL := LG-LS670 PRODUCT_MANUFACTURER := LGE PRODUCT_CHARACTERISTICS := phone -PRODUCT_BUILD_PROP_OVERRIDES += \ - PRODUCT_NAME=lge_thunderc \ - BUILD_FINGERPRINT="lge/LS670/LS670:2.3.3/GRI40/LG-LS670-V20g.19C11F164C:user/release-keys" \ - PRIVATE_BUILD_DESC="thunderc-user 2.3.3 GRI40 LG-LS670-V20g.19C11F164C release-keys" - # Release name and versioning PRODUCT_RELEASE_NAME := LS670 PRODUCT_VERSION_DEVICE_SPECIFIC := --include vendor/cyanogen/products/common_versions.mk +PRODUCT_BUILD_PROP_OVERRIDES += \ + PRODUCT_NAME=lge_LS670 \ + BUILD_FINGERPRINT="lge/LS670/LS670:2.3.3/GRI40/LG-LS670-V20g.19C11F164C:user/release-keys" \ + PRIVATE_BUILD_DESC="thunderc-user 2.3.3 GRI40 LG-LS670-V20g.19C11F164C release-keys" diff --git a/configs/05mountsd b/configs/05mountsd new file mode 100644 index 0000000..7bc5bd5 --- /dev/null +++ b/configs/05mountsd @@ -0,0 +1,55 @@ +#!/system/bin/sh +# +# mount ext partition from sd card + +BB="logwrapper busybox"; + +if [ "$SD_EXT_DIRECTORY" = "" ]; +then + SD_EXT_DIRECTORY=/sd-ext; +fi; + +# find SD Card +for MMC_NUM in `seq 0 9`; +do + MMC_TYPE=`cat /sys/block/mmcblk$MMC_NUM/device/type` + if [ "$MMC_TYPE" = "SD" ]; + then + # 2nd partition of sdcard should be the sd-ext if exist + SD_EXT_PART=/dev/block/mmcblk${MMC_NUM}p2 + break + fi +done + +if [ -b "$SD_EXT_PART" ]; +then + log -p i -t mountsd "Checking filesystems.."; + + # fsck the sdcard filesystem first + if [ -x `which e2fsck` ]; + then + e2fsck -y $SD_EXT_PART + e2fsk_exitcode=$? + else + echo "executable e2fsck not found, assuming no filesystem errors" + e2fsk_exitcode=0 + fi + + # set property with exit code in case an error occurs + setprop cm.e2fsck.errors $e2fsk_exitcode; + if [ "$e2fsk_exitcode" -lt 2 ]; + then + # mount and set perms + $BB mount -o noatime,nodiratime,barrier=1 $SD_EXT_PART $SD_EXT_DIRECTORY; + if [ "$?" = 0 ]; + then + $BB chown 1000:1000 $SD_EXT_DIRECTORY; + $BB chmod 771 $SD_EXT_DIRECTORY; + log -p i -t mountsd "$SD_EXT_DIRECTORY successfully mounted"; + else + log -p e -t mountsd "Unable to mount filesystem for $SD_EXT_DIRECTORY!"; + fi + else + log -p e -t mountsd "Unable to repair filesystem, disabling apps2sd"; + fi +fi diff --git a/configs/12Seeder b/configs/12Seeder new file mode 100644 index 0000000..1420241 --- /dev/null +++ b/configs/12Seeder @@ -0,0 +1,8 @@ +#!/system/bin/sh +#Script to initiate rngd at boot by Ryuinferno @ XDA 2012 + +mount -o remount,rw -t auto /data +rngd +sleep 2 +echo -8 > /proc/$(pgrep rngd)/oom_adj +renice +8 rngd diff --git a/configs/40a2sd b/configs/40a2sd new file mode 100644 index 0000000..24c3edd --- /dev/null +++ b/configs/40a2sd @@ -0,0 +1,90 @@ +#!/system/bin/sh +################################# +## CronMod A2SD+ - Final ## +## Written by CronicCorey @xda ## +## 40a2sd ## +################################# + +## Set SD cache size +if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ] +then + /system/xbin/echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb; +fi; + +## Unmount /sd-ext if it already mounted +busybox umount /sd-ext; + +## Mount mmcblk0p2 to /sd-ext +busybox mount -o noatime,nodiratime,nosuid,nodev /dev/block/mmcblk0p2 /sd-ext; +mountext=`busybox mount | egrep 'ext2|ext3|ext4'`; +if [ -n "$mountext" ]; +then +busybox chown 1000:1000 /sd-ext; +busybox chmod 771 /sd-ext; +fi; + +## Create A2SD directories +if [ ! -e /sd-ext/app ] +then +busybox mkdir /sd-ext/app; +busybox mv /data/app/* /sd-ext/app; +fi; + +if [ ! -e /sd-ext/app-private ] +then +busybox mkdir /sd-ext/app-private; +busybox mv /data/app-private/* /sd-ext/app-private; +fi; + +if [ ! -e /sd-ext/dalvik-cache ] +then +busybox mkdir /sd-ext/dalvik-cache; +busybox mv /data/dalvik-cache/* /sd-ext/dalvik-cache; +fi; + +## Bind A2SD directories +busybox mount -o bind /sd-ext/app /data/app; +busybox chown 1000:1000 /sd-ext/app; +busybox chmod 771 /sd-ext/app; + +busybox mount -o bind /sd-ext/app-private /data/app-private; +busybox chown 1000:1000 /sd-ext/app-private; +busybox chmod 771 /sd-ext/app-private; + +busybox mount -o bind /sd-ext/dalvik-cache /data/dalvik-cache; +busybox chown 1000:1000 /sd-ext/dalvik-cache; +busybox chmod 771 /sd-ext/dalvik-cache; + +sync; + +############################################################################################################################################################ + +###################################################################### +## Automatic ZipAlign by Wes Garner ## +## ZipAlign files in /data that have not been previously ZipAligned ## +## Thanks to oknowton for the changes ## +###################################################################### + +LOG_FILE=/data/zipalign.log + if [ -e $LOG_FILE ]; then + rm $LOG_FILE; + fi; + +echo "Starting Automatic ZipAlign" | tee -a $LOG_FILE; + for apk in /data/app/*.apk ; do + zipalign -c 4 $apk; + ZIPCHECK=$?; + if [ $ZIPCHECK -eq 1 ]; then + echo ZipAligning $(basename $apk) | tee -a $LOG_FILE; + zipalign -f 4 $apk /cache/$(basename $apk); + if [ -e /cache/$(basename $apk) ]; then + cp -f -p /cache/$(basename $apk) $apk | tee -a $LOG_FILE; + rm /cache/$(basename $apk); + else + echo ZipAligning $(basename $apk) Failed | tee -a $LOG_FILE; + fi; + else + echo ZipAlign already completed on $apk | tee -a $LOG_FILE; + fi; + done; +echo "Automatic ZipAlign finished" | tee -a $LOG_FILE; diff --git a/configs/999youtube b/configs/999youtube new file mode 100644 index 0000000..5f4b933 --- /dev/null +++ b/configs/999youtube @@ -0,0 +1,3 @@ +#!/system/bin/sh +sysctl -w fs.file-max=165164 + diff --git a/configs/audio_policy.conf b/configs/audio_policy.conf new file mode 100644 index 0000000..b9a943e --- /dev/null +++ b/configs/audio_policy.conf @@ -0,0 +1,52 @@ +# Global configuration section: lists input and output devices always present on the device +# as well as the output device selected by default. +# Devices are designated by a string that corresponds to the enum in audio.h + +global_configuration { + attached_output_devices AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_SPEAKER + default_output_device AUDIO_DEVICE_OUT_SPEAKER + attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC +} + +# audio hardware module section: contains descriptors for all audio hw modules present on the +# device. Each hw module node is named after the corresponding hw module library base name. +# For instance, "primary" corresponds to audio.primary..so. +# The "primary" module is mandatory and must include at least one output with +# AUDIO_OUTPUT_FLAG_PRIMARY flag. +# Each module descriptor contains one or more output profile descriptors and zero or more +# input profile descriptors. Each profile lists all the parameters supported by a given output +# or input stream category. +# The "channel_masks", "formats", "devices" and "flags" are specified using strings corresponding +# to enums in audio.h and audio_policy.h. They are concatenated by use of "|" without space or "\n". + +audio_hw_modules { + primary { + outputs { + primary { + sampling_rates 44100 + channel_masks AUDIO_CHANNEL_OUT_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_FM|AUDIO_DEVICE_OUT_PROXY + flags AUDIO_OUTPUT_FLAG_PRIMARY + } + } + inputs { + primary { + sampling_rates 8000|11025|16000|22050|32000|44100 + channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET|AUDIO_DEVICE_IN_WIRED_HEADSET + } + } + } + a2dp { + outputs { + a2dp { + sampling_rates 44100 + channel_masks AUDIO_CHANNEL_OUT_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_OUT_ALL_A2DP + } + } + } +} diff --git a/configs/librasdioif.ko b/configs/librasdioif23.ko similarity index 100% rename from configs/librasdioif.ko rename to configs/librasdioif23.ko diff --git a/configs/rngd b/configs/rngd new file mode 100644 index 0000000..af6e296 Binary files /dev/null and b/configs/rngd differ diff --git a/configs/wireless.ko b/configs/wireless23.ko similarity index 100% rename from configs/wireless.ko rename to configs/wireless23.ko diff --git a/configs/wpa_supplicant.conf b/configs/wpa_supplicant.conf new file mode 100644 index 0000000..7039af0 --- /dev/null +++ b/configs/wpa_supplicant.conf @@ -0,0 +1 @@ +##### Example wpa_supplicant configuration file ############################### # # This file describes configuration file format and lists all available option. # Please also take a look at simpler configuration examples in 'examples' # subdirectory. # # Empty lines and lines starting with # are ignored # NOTE! This file may contain password information and should probably be made # readable only by root user on multiuser systems. # Note: All file paths in this configuration file should use full (absolute, # not relative to working directory) path in order to allow working directory # to be changed. This can happen if wpa_supplicant is run in the background. # Whether to allow wpa_supplicant to update (overwrite) configuration # # This option can be used to allow wpa_supplicant to overwrite configuration # file whenever configuration is changed (e.g., new network block is added with # wpa_cli or wpa_gui, or a password is changed). This is required for # wpa_cli/wpa_gui to be able to store the configuration changes permanently. # Please note that overwriting configuration file will remove the comments from # it. update_config=1 # global configuration (shared by all network blocks) # # Parameters for the control interface. If this is specified, wpa_supplicant # will open a control interface that is available for external programs to # manage wpa_supplicant. The meaning of this string depends on which control # interface mechanism is used. For all cases, the existance of this parameter # in configuration is used to determine whether the control interface is # enabled. # # For UNIX domain sockets (default on Linux and BSD): This is a directory that # will be created for UNIX domain sockets for listening to requests from # external programs (CLI/GUI, etc.) for status information and configuration. # The socket file will be named based on the interface name, so multiple # wpa_supplicant processes can be run at the same time if more than one # interface is used. # /var/run/wpa_supplicant is the recommended directory for sockets and by # default, wpa_cli will use it when trying to connect with wpa_supplicant. # # Access control for the control interface can be configured by setting the # directory to allow only members of a group to use sockets. This way, it is # possible to run wpa_supplicant as root (since it needs to change network # configuration and open raw sockets) and still allow GUI/CLI components to be # run as non-root users. However, since the control interface can be used to # change the network configuration, this access needs to be protected in many # cases. By default, wpa_supplicant is configured to use gid 0 (root). If you # want to allow non-root users to use the control interface, add a new group # and change this value to match with that group. Add users that should have # control interface access to this group. If this variable is commented out or # not included in the configuration file, group will not be changed from the # value it got by default when the directory or socket was created. # # When configuring both the directory and group, use following format: # DIR=/var/run/wpa_supplicant GROUP=wheel # DIR=/var/run/wpa_supplicant GROUP=0 # (group can be either group name or gid) # # For UDP connections (default on Windows): The value will be ignored. This # variable is just used to select that the control interface is to be created. # The value can be set to, e.g., udp (ctrl_interface=udp) # # For Windows Named Pipe: This value can be used to set the security descriptor # for controlling access to the control interface. Security descriptor can be # set using Security Descriptor String Format (see http://msdn.microsoft.com/ # library/default.asp?url=/library/en-us/secauthz/security/ # security_descriptor_string_format.asp). The descriptor string needs to be # prefixed with SDDL=. For example, ctrl_interface=SDDL=D: would set an empty # DACL (which will reject all connections). See README-Windows.txt for more # information about SDDL string format. # ctrl_interface=wlan0 # IEEE 802.1X/EAPOL version # wpa_supplicant is implemented based on IEEE Std 802.1X-2004 which defines # EAPOL version 2. However, there are many APs that do not handle the new # version number correctly (they seem to drop the frames completely). In order # to make wpa_supplicant interoperate with these APs, the version number is set # to 1 by default. This configuration value can be used to set it to the new # version (2). eapol_version=1 # AP scanning/selection # By default, wpa_supplicant requests driver to perform AP scanning and then # uses the scan results to select a suitable AP. Another alternative is to # allow the driver to take care of AP scanning and selection and use # wpa_supplicant just to process EAPOL frames based on IEEE 802.11 association # information from the driver. # 1: wpa_supplicant initiates scanning and AP selection # 0: driver takes care of scanning, AP selection, and IEEE 802.11 association # parameters (e.g., WPA IE generation); this mode can also be used with # non-WPA drivers when using IEEE 802.1X mode; do not try to associate with # APs (i.e., external program needs to control association). This mode must # also be used when using wired Ethernet drivers. # 2: like 0, but associate with APs using security policy and SSID (but not # BSSID); this can be used, e.g., with ndiswrapper and NDIS drivers to # enable operation with hidden SSIDs and optimized roaming; in this mode, # the network blocks in the configuration file are tried one by one until # the driver reports successful association; each network block should have # explicit security policy (i.e., only one option in the lists) for # key_mgmt, pairwise, group, proto variables ap_scan=1 # EAP fast re-authentication # By default, fast re-authentication is enabled for all EAP methods that # support it. This variable can be used to disable fast re-authentication. # Normally, there is no need to disable this. fast_reauth=1 # OpenSSL Engine support # These options can be used to load OpenSSL engines. # The two engines that are supported currently are shown below: # They are both from the opensc project (http://www.opensc.org/) # By default no engines are loaded. # make the opensc engine available #opensc_engine_path=/usr/lib/opensc/engine_opensc.so # make the pkcs11 engine available #pkcs11_engine_path=/usr/lib/opensc/engine_pkcs11.so # configure the path to the pkcs11 module required by the pkcs11 engine #pkcs11_module_path=/usr/lib/pkcs11/opensc-pkcs11.so # Dynamic EAP methods # If EAP methods were built dynamically as shared object files, they need to be # loaded here before being used in the network blocks. By default, EAP methods # are included statically in the build, so these lines are not needed #load_dynamic_eap=/usr/lib/wpa_supplicant/eap_tls.so #load_dynamic_eap=/usr/lib/wpa_supplicant/eap_md5.so # Driver interface parameters # This field can be used to configure arbitrary driver interace parameters. The # format is specific to the selected driver interface. This field is not used # in most cases. #driver_param="field=value" # Maximum lifetime for PMKSA in seconds; default 43200 #dot11RSNAConfigPMKLifetime=43200 # Threshold for reauthentication (percentage of PMK lifetime); default 70 #dot11RSNAConfigPMKReauthThreshold=70 # Timeout for security association negotiation in seconds; default 60 #dot11RSNAConfigSATimeout=60 # network block # # Each network (usually AP's sharing the same SSID) is configured as a separate # block in this configuration file. The network blocks are in preference order # (the first match is used). # # network block fields: # # disabled: # 0 = this network can be used (default) # 1 = this network block is disabled (can be enabled through ctrl_iface, # e.g., with wpa_cli or wpa_gui) # # id_str: Network identifier string for external scripts. This value is passed # to external action script through wpa_cli as WPA_ID_STR environment # variable to make it easier to do network specific configuration. # # ssid: SSID (mandatory); either as an ASCII string with double quotation or # as hex string; network name # # scan_ssid: # 0 = do not scan this SSID with specific Probe Request frames (default) # 1 = scan with SSID-specific Probe Request frames (this can be used to # find APs that do not accept broadcast SSID or use multiple SSIDs; # this will add latency to scanning, so enable this only when needed) # # bssid: BSSID (optional); if set, this network block is used only when # associating with the AP using the configured BSSID # # priority: priority group (integer) # By default, all networks will get same priority group (0). If some of the # networks are more desirable, this field can be used to change the order in # which wpa_supplicant goes through the networks when selecting a BSS. The # priority groups will be iterated in decreasing priority (i.e., the larger the # priority value, the sooner the network is matched against the scan results). # Within each priority group, networks will be selected based on security # policy, signal strength, etc. # Please note that AP scanning with scan_ssid=1 and ap_scan=2 mode are not # using this priority to select the order for scanning. Instead, they try the # networks in the order that used in the configuration file. # # mode: IEEE 802.11 operation mode # 0 = infrastructure (Managed) mode, i.e., associate with an AP (default) # 1 = IBSS (ad-hoc, peer-to-peer) # Note: IBSS can only be used with key_mgmt NONE (plaintext and static WEP) # and key_mgmt=WPA-NONE (fixed group key TKIP/CCMP). In addition, ap_scan has # to be set to 2 for IBSS. WPA-None requires following network block options: # proto=WPA, key_mgmt=WPA-NONE, pairwise=NONE, group=TKIP (or CCMP, but not # both), and psk must also be set. # # frequency: Channel frequency in megahertz (MHz) for IBSS, e.g., # 2412 = IEEE 802.11b/g channel 1. This value is used to configure the initial # channel for IBSS (adhoc) networks. It is ignored in the infrastructure mode. # In addition, this value is only used by the station that creates the IBSS. If # an IBSS network with the configured SSID is already present, the frequency of # the network will be used instead of this configured value. # # proto: list of accepted protocols # WPA = WPA/IEEE 802.11i/D3.0 # RSN = WPA2/IEEE 802.11i (also WPA2 can be used as an alias for RSN) # If not set, this defaults to: WPA RSN # # key_mgmt: list of accepted authenticated key management protocols # WPA-PSK = WPA pre-shared key (this requires 'psk' field) # WPA-EAP = WPA using EAP authentication (this can use an external # program, e.g., Xsupplicant, for IEEE 802.1X EAP Authentication # IEEE8021X = IEEE 802.1X using EAP authentication and (optionally) dynamically # generated WEP keys # NONE = WPA is not used; plaintext or static WEP could be used # If not set, this defaults to: WPA-PSK WPA-EAP # # auth_alg: list of allowed IEEE 802.11 authentication algorithms # OPEN = Open System authentication (required for WPA/WPA2) # SHARED = Shared Key authentication (requires static WEP keys) # LEAP = LEAP/Network EAP (only used with LEAP) # If not set, automatic selection is used (Open System with LEAP enabled if # LEAP is allowed as one of the EAP methods). # # pairwise: list of accepted pairwise (unicast) ciphers for WPA # CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0] # TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0] # NONE = Use only Group Keys (deprecated, should not be included if APs support # pairwise keys) # If not set, this defaults to: CCMP TKIP # # group: list of accepted group (broadcast/multicast) ciphers for WPA # CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0] # TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0] # WEP104 = WEP (Wired Equivalent Privacy) with 104-bit key # WEP40 = WEP (Wired Equivalent Privacy) with 40-bit key [IEEE 802.11] # If not set, this defaults to: CCMP TKIP WEP104 WEP40 # # psk: WPA preshared key; 256-bit pre-shared key # The key used in WPA-PSK mode can be entered either as 64 hex-digits, i.e., # 32 bytes or as an ASCII passphrase (in which case, the real PSK will be # generated using the passphrase and SSID). ASCII passphrase must be between # 8 and 63 characters (inclusive). # This field is not needed, if WPA-EAP is used. # Note: Separate tool, wpa_passphrase, can be used to generate 256-bit keys # from ASCII passphrase. This process uses lot of CPU and wpa_supplicant # startup and reconfiguration time can be optimized by generating the PSK only # only when the passphrase or SSID has actually changed. # # eapol_flags: IEEE 802.1X/EAPOL options (bit field) # Dynamic WEP key required for non-WPA mode # bit0 (1): require dynamically generated unicast WEP key # bit1 (2): require dynamically generated broadcast WEP key # (3 = require both keys; default) # Note: When using wired authentication, eapol_flags must be set to 0 for the # authentication to be completed successfully. # # mixed_cell: This option can be used to configure whether so called mixed # cells, i.e., networks that use both plaintext and encryption in the same # SSID, are allowed when selecting a BSS form scan results. # 0 = disabled (default) # 1 = enabled # # proactive_key_caching: # Enable/disable opportunistic PMKSA caching for WPA2. # 0 = disabled (default) # 1 = enabled # # wep_key0..3: Static WEP key (ASCII in double quotation, e.g. "abcde" or # hex without quotation, e.g., 0102030405) # wep_tx_keyidx: Default WEP key index (TX) (0..3) # # peerkey: Whether PeerKey negotiation for direct links (IEEE 802.11e DLS) is # allowed. This is only used with RSN/WPA2. # 0 = disabled (default) # 1 = enabled #peerkey=1 # # Following fields are only used with internal EAP implementation. # eap: space-separated list of accepted EAP methods # MD5 = EAP-MD5 (unsecure and does not generate keying material -> # cannot be used with WPA; to be used as a Phase 2 method # with EAP-PEAP or EAP-TTLS) # MSCHAPV2 = EAP-MSCHAPv2 (cannot be used separately with WPA; to be used # as a Phase 2 method with EAP-PEAP or EAP-TTLS) # OTP = EAP-OTP (cannot be used separately with WPA; to be used # as a Phase 2 method with EAP-PEAP or EAP-TTLS) # GTC = EAP-GTC (cannot be used separately with WPA; to be used # as a Phase 2 method with EAP-PEAP or EAP-TTLS) # TLS = EAP-TLS (client and server certificate) # PEAP = EAP-PEAP (with tunnelled EAP authentication) # TTLS = EAP-TTLS (with tunnelled EAP or PAP/CHAP/MSCHAP/MSCHAPV2 # authentication) # If not set, all compiled in methods are allowed. # # identity: Identity string for EAP # anonymous_identity: Anonymous identity string for EAP (to be used as the # unencrypted identity with EAP types that support different tunnelled # identity, e.g., EAP-TTLS) # password: Password string for EAP # ca_cert: File path to CA certificate file (PEM/DER). This file can have one # or more trusted CA certificates. If ca_cert and ca_path are not # included, server certificate will not be verified. This is insecure and # a trusted CA certificate should always be configured when using # EAP-TLS/TTLS/PEAP. Full path should be used since working directory may # change when wpa_supplicant is run in the background. # On Windows, trusted CA certificates can be loaded from the system # certificate store by setting this to cert_store://, e.g., # ca_cert="cert_store://CA" or ca_cert="cert_store://ROOT". # Note that when running wpa_supplicant as an application, the user # certificate store (My user account) is used, whereas computer store # (Computer account) is used when running wpasvc as a service. # ca_path: Directory path for CA certificate files (PEM). This path may # contain multiple CA certificates in OpenSSL format. Common use for this # is to point to system trusted CA list which is often installed into # directory like /etc/ssl/certs. If configured, these certificates are # added to the list of trusted CAs. ca_cert may also be included in that # case, but it is not required. # client_cert: File path to client certificate file (PEM/DER) # Full path should be used since working directory may change when # wpa_supplicant is run in the background. # Alternatively, a named configuration blob can be used by setting this # to blob://. # private_key: File path to client private key file (PEM/DER/PFX) # When PKCS#12/PFX file (.p12/.pfx) is used, client_cert should be # commented out. Both the private key and certificate will be read from # the PKCS#12 file in this case. Full path should be used since working # directory may change when wpa_supplicant is run in the background. # Windows certificate store can be used by leaving client_cert out and # configuring private_key in one of the following formats: # cert://substring_to_match # hash://certificate_thumbprint_in_hex # for example: private_key="hash://63093aa9c47f56ae88334c7b65a4" # Note that when running wpa_supplicant as an application, the user # certificate store (My user account) is used, whereas computer store # (Computer account) is used when running wpasvc as a service. # Alternatively, a named configuration blob can be used by setting this # to blob://. # private_key_passwd: Password for private key file (if left out, this will be # asked through control interface) # dh_file: File path to DH/DSA parameters file (in PEM format) # This is an optional configuration file for setting parameters for an # ephemeral DH key exchange. In most cases, the default RSA # authentication does not use this configuration. However, it is possible # setup RSA to use ephemeral DH key exchange. In addition, ciphers with # DSA keys always use ephemeral DH keys. This can be used to achieve # forward secrecy. If the file is in DSA parameters format, it will be # automatically converted into DH params. # subject_match: Substring to be matched against the subject of the # authentication server certificate. If this string is set, the server # sertificate is only accepted if it contains this string in the subject. # The subject string is in following format: # /C=US/ST=CA/L=San Francisco/CN=Test AS/emailAddress=as@example.com # altsubject_match: Semicolon separated string of entries to be matched against # the alternative subject name of the authentication server certificate. # If this string is set, the server sertificate is only accepted if it # contains one of the entries in an alternative subject name extension. # altSubjectName string is in following format: TYPE:VALUE # Example: EMAIL:server@example.com # Example: DNS:server.example.com;DNS:server2.example.com # Following types are supported: EMAIL, DNS, URI # phase1: Phase1 (outer authentication, i.e., TLS tunnel) parameters # (string with field-value pairs, e.g., "peapver=0" or # "peapver=1 peaplabel=1") # 'peapver' can be used to force which PEAP version (0 or 1) is used. # 'peaplabel=1' can be used to force new label, "client PEAP encryption", # to be used during key derivation when PEAPv1 or newer. Most existing # PEAPv1 implementation seem to be using the old label, "client EAP # encryption", and wpa_supplicant is now using that as the default value. # Some servers, e.g., Radiator, may require peaplabel=1 configuration to # interoperate with PEAPv1; see eap_testing.txt for more details. # 'peap_outer_success=0' can be used to terminate PEAP authentication on # tunneled EAP-Success. This is required with some RADIUS servers that # implement draft-josefsson-pppext-eap-tls-eap-05.txt (e.g., # Lucent NavisRadius v4.4.0 with PEAP in "IETF Draft 5" mode) # include_tls_length=1 can be used to force wpa_supplicant to include # TLS Message Length field in all TLS messages even if they are not # fragmented. # sim_min_num_chal=3 can be used to configure EAP-SIM to require three # challenges (by default, it accepts 2 or 3) # phase2: Phase2 (inner authentication with TLS tunnel) parameters # (string with field-value pairs, e.g., "auth=MSCHAPV2" for EAP-PEAP or # "autheap=MSCHAPV2 autheap=MD5" for EAP-TTLS) # Following certificate/private key fields are used in inner Phase2 # authentication when using EAP-TTLS or EAP-PEAP. # ca_cert2: File path to CA certificate file. This file can have one or more # trusted CA certificates. If ca_cert2 and ca_path2 are not included, # server certificate will not be verified. This is insecure and a trusted # CA certificate should always be configured. # ca_path2: Directory path for CA certificate files (PEM) # client_cert2: File path to client certificate file # private_key2: File path to client private key file # private_key2_passwd: Password for private key file # dh_file2: File path to DH/DSA parameters file (in PEM format) # subject_match2: Substring to be matched against the subject of the # authentication server certificate. # altsubject_match2: Substring to be matched against the alternative subject # name of the authentication server certificate. # # fragment_size: Maximum EAP fragment size in bytes (default 1398). # This value limits the fragment size for EAP methods that support # fragmentation (e.g., EAP-TLS and EAP-PEAP). This value should be set # small enough to make the EAP messages fit in MTU of the network # interface used for EAPOL. The default value is suitable for most # cases. # # EAP-PSK variables: # eappsk: 16-byte (128-bit, 32 hex digits) pre-shared key in hex format # nai: user NAI # # EAP-PAX variables: # eappsk: 16-byte (128-bit, 32 hex digits) pre-shared key in hex format # # EAP-SAKE variables: # eappsk: 32-byte (256-bit, 64 hex digits) pre-shared key in hex format # (this is concatenation of Root-Secret-A and Root-Secret-B) # nai: user NAI (PEERID) # # EAP-GPSK variables: # eappsk: Pre-shared key in hex format (at least 128 bits, i.e., 32 hex digits) # nai: user NAI (ID_Client) # # EAP-FAST variables: # pac_file: File path for the PAC entries. wpa_supplicant will need to be able # to create this file and write updates to it when PAC is being # provisioned or refreshed. Full path to the file should be used since # working directory may change when wpa_supplicant is run in the # background. Alternatively, a named configuration blob can be used by # setting this to blob:// # phase1: fast_provisioning=1 option enables in-line provisioning of EAP-FAST # credentials (PAC) # # wpa_supplicant supports number of "EAP workarounds" to work around # interoperability issues with incorrectly behaving authentication servers. # These are enabled by default because some of the issues are present in large # number of authentication servers. Strict EAP conformance mode can be # configured by disabling workarounds with eap_workaround=0. # Example blocks: # Simple case: WPA-PSK, PSK as an ASCII passphrase, allow all valid ciphers #network={ # ssid="simple" # psk="very secret passphrase" # priority=5 #} # Same as previous, but request SSID-specific scanning (for APs that reject # broadcast SSID) #network={ # ssid="second ssid" # scan_ssid=1 # psk="very secret passphrase" # priority=2 #} # Only WPA-PSK is used. Any valid cipher combination is accepted. #network={ # ssid="example" # proto=WPA # key_mgmt=WPA-PSK # pairwise=CCMP TKIP # group=CCMP TKIP WEP104 WEP40 # psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb # priority=2 #} # Only WPA-EAP is used. Both CCMP and TKIP is accepted. An AP that used WEP104 # or WEP40 as the group cipher will not be accepted. #network={ # ssid="example" # proto=RSN # key_mgmt=WPA-EAP # pairwise=CCMP TKIP # group=CCMP TKIP # eap=TLS # identity="user@example.com" # ca_cert="/etc/cert/ca.pem" # client_cert="/etc/cert/user.pem" # private_key="/etc/cert/user.prv" # private_key_passwd="password" # priority=1 #} # EAP-PEAP/MSCHAPv2 configuration for RADIUS servers that use the new peaplabel # (e.g., Radiator) #network={ # ssid="example" # key_mgmt=WPA-EAP # eap=PEAP # identity="user@example.com" # password="foobar" # ca_cert="/etc/cert/ca.pem" # phase1="peaplabel=1" # phase2="auth=MSCHAPV2" # priority=10 #} # EAP-TTLS/EAP-MD5-Challenge configuration with anonymous identity for the # unencrypted use. Real identity is sent only within an encrypted TLS tunnel. #network={ # ssid="example" # key_mgmt=WPA-EAP # eap=TTLS # identity="user@example.com" # anonymous_identity="anonymous@example.com" # password="foobar" # ca_cert="/etc/cert/ca.pem" # priority=2 #} # EAP-TTLS/MSCHAPv2 configuration with anonymous identity for the unencrypted # use. Real identity is sent only within an encrypted TLS tunnel. #network={ # ssid="example" # key_mgmt=WPA-EAP # eap=TTLS # identity="user@example.com" # anonymous_identity="anonymous@example.com" # password="foobar" # ca_cert="/etc/cert/ca.pem" # phase2="auth=MSCHAPV2" #} # WPA-EAP, EAP-TTLS with different CA certificate used for outer and inner # authentication. #network={ # ssid="example" # key_mgmt=WPA-EAP # eap=TTLS # # Phase1 / outer authentication # anonymous_identity="anonymous@example.com" # ca_cert="/etc/cert/ca.pem" # # Phase 2 / inner authentication # phase2="autheap=TLS" # ca_cert2="/etc/cert/ca2.pem" # client_cert2="/etc/cer/user.pem" # private_key2="/etc/cer/user.prv" # private_key2_passwd="password" # priority=2 #} # Both WPA-PSK and WPA-EAP is accepted. Only CCMP is accepted as pairwise and # group cipher. #network={ # ssid="example" # bssid=00:11:22:33:44:55 # proto=WPA RSN # key_mgmt=WPA-PSK WPA-EAP # pairwise=CCMP # group=CCMP # psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb #} # Special characters in SSID, so use hex string. Default to WPA-PSK, WPA-EAP # and all valid ciphers. #network={ # ssid=00010203 # psk=000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f #} # EAP-SIM with a GSM SIM or USIM #network={ # ssid="eap-sim-test" # key_mgmt=WPA-EAP # eap=SIM # pin="1234" # pcsc="" #} # EAP-PSK #network={ # ssid="eap-psk-test" # key_mgmt=WPA-EAP # eap=PSK # identity="eap_psk_user" # eappsk=06b4be19da289f475aa46a33cb793029 # nai="eap_psk_user@example.com" #} # IEEE 802.1X/EAPOL with dynamically generated WEP keys (i.e., no WPA) using # EAP-TLS for authentication and key generation; require both unicast and # broadcast WEP keys. #network={ # ssid="1x-test" # key_mgmt=IEEE8021X # eap=TLS # identity="user@example.com" # ca_cert="/etc/cert/ca.pem" # client_cert="/etc/cert/user.pem" # private_key="/etc/cert/user.prv" # private_key_passwd="password" # eapol_flags=3 #} # LEAP with dynamic WEP keys #network={ # ssid="leap-example" # key_mgmt=IEEE8021X # eap=LEAP # identity="user" # password="foobar" #} # EAP-FAST with WPA (WPA or WPA2) #network={ # ssid="eap-fast-test" # key_mgmt=WPA-EAP # eap=FAST # anonymous_identity="FAST-000102030405" # identity="username" # password="password" # phase1="fast_provisioning=1" # pac_file="/etc/wpa_supplicant.eap-fast-pac" #} #network={ # ssid="eap-fast-test" # key_mgmt=WPA-EAP # eap=FAST # anonymous_identity="FAST-000102030405" # identity="username" # password="password" # phase1="fast_provisioning=1" # pac_file="blob://eap-fast-pac" #} # Plaintext connection (no WPA, no IEEE 802.1X) #network={ # ssid="plaintext-test" # key_mgmt=NONE #} # Shared WEP key connection (no WPA, no IEEE 802.1X) #network={ # ssid="static-wep-test" # key_mgmt=NONE # wep_key0="abcde" # wep_key1=0102030405 # wep_key2="1234567890123" # wep_tx_keyidx=0 # priority=5 #} # Shared WEP key connection (no WPA, no IEEE 802.1X) using Shared Key # IEEE 802.11 authentication #network={ # ssid="static-wep-test2" # key_mgmt=NONE # wep_key0="abcde" # wep_key1=0102030405 # wep_key2="1234567890123" # wep_tx_keyidx=0 # priority=5 # auth_alg=SHARED #} # IBSS/ad-hoc network with WPA-None/TKIP. #network={ # ssid="test adhoc" # mode=1 # frequency=2412 # proto=WPA # key_mgmt=WPA-NONE # pairwise=NONE # group=TKIP # psk="secret passphrase" #} # Catch all example that allows more or less all configuration modes #network={ # ssid="example" # scan_ssid=1 # key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE # pairwise=CCMP TKIP # group=CCMP TKIP WEP104 WEP40 # psk="very secret passphrase" # eap=TTLS PEAP TLS # identity="user@example.com" # password="foobar" # ca_cert="/etc/cert/ca.pem" # client_cert="/etc/cert/user.pem" # private_key="/etc/cert/user.prv" # private_key_passwd="password" # phase1="peaplabel=0" #} # Example of EAP-TLS with smartcard (openssl engine) #network={ # ssid="example" # key_mgmt=WPA-EAP # eap=TLS # proto=RSN # pairwise=CCMP TKIP # group=CCMP TKIP # identity="user@example.com" # ca_cert="/etc/cert/ca.pem" # client_cert="/etc/cert/user.pem" # # engine=1 # # The engine configured here must be available. Look at # OpenSSL engine support in the global section. # The key available through the engine must be the private key # matching the client certificate configured above. # use the opensc engine #engine_id="opensc" #key_id="45" # use the pkcs11 engine # engine_id="pkcs11" # key_id="id_45" # Optional PIN configuration; this can be left out and PIN will be # asked through the control interface # pin="1234" #} # Example configuration showing how to use an inlined blob as a CA certificate # data instead of using external file #network={ # ssid="example" # key_mgmt=WPA-EAP # eap=TTLS # identity="user@example.com" # anonymous_identity="anonymous@example.com" # password="foobar" # ca_cert="blob://exampleblob" # priority=20 #} #blob-base64-exampleblob={ #SGVsbG8gV29ybGQhCg== #} # Wildcard match for SSID (plaintext APs only). This example selects any # open AP regardless of its SSID. #network={ # key_mgmt=NONE #} \ No newline at end of file diff --git a/init.recovery.rc b/init.recovery.rc new file mode 100644 index 0000000..b72721b --- /dev/null +++ b/init.recovery.rc @@ -0,0 +1,63 @@ +on early-init + start ueventd + +on init + export PATH /sbin + export LD_LIBRARY_PATH .:/sbin + export ANDROID_ROOT /system + export ANDROID_DATA /data + export EXTERNAL_STORAGE /sdcard + + symlink /system/etc /etc + + mkdir /boot + mkdir /sdcard + mkdir /sd-ext + mkdir /datadata + mkdir /emmc + mkdir /system + mkdir /data + mkdir /cache + mount /tmp /tmp tmpfs + +on boot + + ifup lo + hostname localhost + domainname localdomain + + class_start default + +service ueventd /sbin/ueventd + critical + +service recovery /sbin/recovery + +service adbd /sbin/adbd recovery + disabled + +# Always start adbd on userdebug and eng builds +# In recovery, always run adbd as root. +on property:ro.debuggable=1 + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 1004 + write /sys/class/android_usb/android0/idProduct 61A6 + write /sys/class/android_usb/android0/functions mtp,adb + #write /sys/class/android_usb/android0/enable 1 + write /sys/class/android_usb/android0/iManufacturer LGE + write /sys/class/android_usb/android0/iProduct p500 + write /sys/class/android_usb/android0/iSerial $ro.serialno + #start adbd + setprop service.adb.root 1 + +# Restart adbd so it can run as root +on property:service.adb.root=1 + write /sys/class/android_usb/android0/enable 0 + restart adbd + write /sys/class/android_usb/android0/enable 1 + +on property:persist.service.adb.enable=1 + start adbd + +on property:persist.service.adb.enable=0 + stop adbd diff --git a/init.thunderc.rc b/init.thunderc.rc index b008f71..13a8a82 100644 --- a/init.thunderc.rc +++ b/init.thunderc.rc @@ -1,19 +1,26 @@ # inherit qcom init import init.qcom.rc -on early-boot - exec /sbin/chargerlogo +#on early-boot +# exec /sbin/chargerlogo + +on early-init + mkdir /storage 0755 system sdcard_r + mkdir /storage/sdcard0 0000 system system + symlink /storage/sdcard0 /mnt/sdcard + symlink /storage/sdcard0 /sdcard + export EXTERNAL_STORAGE /storage/sdcard0 + +service dhcp-service /system/bin/netcfg wlan0 dhcp + class main + oneshot + +on property:dev.bootcomplete=1 + stop dhcp-service + start dhcp-service -on init - # Add permissions for camera access - chmod 0666 /dev/msm_camera/config0 - chmod 0666 /dev/msm_camera/control0 - chmod 0666 /dev/msm_camera/frame0 - chmod 0666 /dev/msm_camera/pic0 on boot - mkdir /data/radio 0770 radio radio - chmod 2770 /data/radio ## VIBRATOR chmod 0660 /sys/class/timed_output/vibrator/amp @@ -31,56 +38,35 @@ on boot chmod 0664 /sys/class/leds/lcd-backlight/alc chown system system /sys/devices/platform/mddi_hitachi_hvga.10/lcd_onoff chmod 0664 /sys/devices/platform/mddi_hitachi_hvga.10/lcd_onoff + - # allow interfaces to get IPv6 address when tethering is enabled - write /proc/sys/net/ipv6/conf/rmnet0/accept_ra 2 - write /proc/sys/net/ipv6/conf/rmnet1/accept_ra 2 - write /proc/sys/net/ipv6/conf/rmnet2/accept_ra 2 - -on fs - # framebuffer permission for copybit - chmod 0666 /dev/graphics/fb0 -on post-fs - - # nv - mkdir /data/nv - chown system system /data/nv - chmod 0711 /data/nv - chmod 0771 /cache +#on post-fs +# chmod 0771 /cache - # wifi - chmod 0777 /data/misc/wifi/config_mac - mkdir /data/audioprop 0777 system system - mkdir /data/misc/wifi/sockets 0770 wifi wifi - setprop wifi.supplicant_scan_interval 20 - setprop wifi.interface wlan0 - mkdir /data/misc/dhcp 0777 system system +#service chargerlogo /charger +# class charger +# user root -service chargerlogo /charger - class charger - user root - -on property:init.svc.chargerlogo=running - setprop sys.usb.config adb - write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor powersave +#on property:init.svc.chargerlogo=running +# setprop sys.usb.config adb +# write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor powersave service ami304d /system/bin/ami304d class main user compass group system -service qcom-sh /system/bin/sh /init.qcom.sh - class core +## CHARGER ## +service charger /sbin/checkbootreason + class charger user root + group root oneshot -service qcom-post-boot /system/bin/sh /system/etc/init.qcom.post_boot.sh - class main - user root - disabled - oneshot +on property:init.svc.charger=running + setprop sys.usb.config adb + + -on property:init.svc.bootanim=stopped - start qcom-post-boot diff --git a/kernels/test10/librasdioif.ko b/kernels/test10/librasdioif.ko deleted file mode 100644 index 6bdd507..0000000 Binary files a/kernels/test10/librasdioif.ko and /dev/null differ diff --git a/kernels/test10/tun.ko b/kernels/test10/tun.ko deleted file mode 100644 index c300f1e..0000000 Binary files a/kernels/test10/tun.ko and /dev/null differ diff --git a/kernels/test10/wireless.ko b/kernels/test10/wireless.ko deleted file mode 100644 index e7f10e7..0000000 Binary files a/kernels/test10/wireless.ko and /dev/null differ diff --git a/kernels/test10/zImage b/kernels/test10/zImage deleted file mode 100644 index 943d054..0000000 Binary files a/kernels/test10/zImage and /dev/null differ diff --git a/kernels/test12/librasdioif.ko b/kernels/test12/librasdioif.ko deleted file mode 100644 index 7c1fec9..0000000 Binary files a/kernels/test12/librasdioif.ko and /dev/null differ diff --git a/kernels/test12/tun.ko b/kernels/test12/tun.ko deleted file mode 100644 index c61c328..0000000 Binary files a/kernels/test12/tun.ko and /dev/null differ diff --git a/kernels/test12/wireless.ko b/kernels/test12/wireless.ko deleted file mode 100644 index e6b0cab..0000000 Binary files a/kernels/test12/wireless.ko and /dev/null differ diff --git a/kernels/test12/zImage b/kernels/test12/zImage deleted file mode 100644 index 7a8ea4b..0000000 Binary files a/kernels/test12/zImage and /dev/null differ diff --git a/kernels/test13/librasdioif.ko b/kernels/test13/librasdioif.ko deleted file mode 100644 index 9a0ea3f..0000000 Binary files a/kernels/test13/librasdioif.ko and /dev/null differ diff --git a/kernels/test13/tun.ko b/kernels/test13/tun.ko deleted file mode 100644 index 0d1e6a4..0000000 Binary files a/kernels/test13/tun.ko and /dev/null differ diff --git a/kernels/test13/wireless.ko b/kernels/test13/wireless.ko deleted file mode 100644 index 3c95451..0000000 Binary files a/kernels/test13/wireless.ko and /dev/null differ diff --git a/kernels/test13/zImage b/kernels/test13/zImage deleted file mode 100644 index 6201731..0000000 Binary files a/kernels/test13/zImage and /dev/null differ diff --git a/kernels/test13usb/librasdioif.ko b/kernels/test13usb/librasdioif.ko deleted file mode 100644 index 220f90c..0000000 Binary files a/kernels/test13usb/librasdioif.ko and /dev/null differ diff --git a/kernels/test13usb/tun.ko b/kernels/test13usb/tun.ko deleted file mode 100644 index bed0d3c..0000000 Binary files a/kernels/test13usb/tun.ko and /dev/null differ diff --git a/kernels/test13usb/wireless.ko b/kernels/test13usb/wireless.ko deleted file mode 100644 index fa45c5a..0000000 Binary files a/kernels/test13usb/wireless.ko and /dev/null differ diff --git a/kernels/test13usb/zImage b/kernels/test13usb/zImage deleted file mode 100644 index 1f2e56e..0000000 Binary files a/kernels/test13usb/zImage and /dev/null differ diff --git a/kernels/test15/librasdioif.ko b/kernels/test15/librasdioif.ko deleted file mode 100644 index 13cf286..0000000 Binary files a/kernels/test15/librasdioif.ko and /dev/null differ diff --git a/kernels/test15/tun.ko b/kernels/test15/tun.ko deleted file mode 100644 index 22cabc7..0000000 Binary files a/kernels/test15/tun.ko and /dev/null differ diff --git a/kernels/test15/wireless.ko b/kernels/test15/wireless.ko deleted file mode 100644 index d6ff641..0000000 Binary files a/kernels/test15/wireless.ko and /dev/null differ diff --git a/kernels/test15/zImage b/kernels/test15/zImage deleted file mode 100644 index 981bfad..0000000 Binary files a/kernels/test15/zImage and /dev/null differ diff --git a/kernels/test16/wireless.ko b/kernels/test16/wireless.ko deleted file mode 100644 index 26aeb68..0000000 Binary files a/kernels/test16/wireless.ko and /dev/null differ diff --git a/kernels/test16/zImage b/kernels/test16/zImage deleted file mode 100644 index bb67cb5..0000000 Binary files a/kernels/test16/zImage and /dev/null differ diff --git a/kernels/test17/librasdioif.ko b/kernels/test17/librasdioif.ko deleted file mode 100644 index cc119a3..0000000 Binary files a/kernels/test17/librasdioif.ko and /dev/null differ diff --git a/kernels/test17/tun.ko b/kernels/test17/tun.ko deleted file mode 100644 index 723fa03..0000000 Binary files a/kernels/test17/tun.ko and /dev/null differ diff --git a/kernels/test17/zImage b/kernels/test17/zImage deleted file mode 100644 index 03bc416..0000000 Binary files a/kernels/test17/zImage and /dev/null differ diff --git a/kernels/test18/librasdioif.ko b/kernels/test18/librasdioif.ko deleted file mode 100644 index ab3a81e..0000000 Binary files a/kernels/test18/librasdioif.ko and /dev/null differ diff --git a/kernels/test18/tun.ko b/kernels/test18/tun.ko deleted file mode 100644 index 745c9e4..0000000 Binary files a/kernels/test18/tun.ko and /dev/null differ diff --git a/kernels/test18/wireless.ko b/kernels/test18/wireless.ko deleted file mode 100644 index 35cb2e1..0000000 Binary files a/kernels/test18/wireless.ko and /dev/null differ diff --git a/kernels/test18/zImage b/kernels/test18/zImage deleted file mode 100644 index 6baadf4..0000000 Binary files a/kernels/test18/zImage and /dev/null differ diff --git a/kernels/test19/librasdioif.ko b/kernels/test19/librasdioif.ko deleted file mode 100644 index 9fb14af..0000000 Binary files a/kernels/test19/librasdioif.ko and /dev/null differ diff --git a/kernels/test19/tun.ko b/kernels/test19/tun.ko deleted file mode 100644 index 9fd5dfd..0000000 Binary files a/kernels/test19/tun.ko and /dev/null differ diff --git a/kernels/test19/wireless.ko b/kernels/test19/wireless.ko deleted file mode 100644 index f570f63..0000000 Binary files a/kernels/test19/wireless.ko and /dev/null differ diff --git a/kernels/test19/zImage b/kernels/test19/zImage deleted file mode 100644 index d50f20e..0000000 Binary files a/kernels/test19/zImage and /dev/null differ diff --git a/kernels/test19old/librasdioif.ko b/kernels/test19old/librasdioif.ko deleted file mode 100644 index 9fb14af..0000000 Binary files a/kernels/test19old/librasdioif.ko and /dev/null differ diff --git a/kernels/test19old/tun.ko b/kernels/test19old/tun.ko deleted file mode 100644 index 9fd5dfd..0000000 Binary files a/kernels/test19old/tun.ko and /dev/null differ diff --git a/kernels/test19old/wireless.ko b/kernels/test19old/wireless.ko deleted file mode 100644 index f570f63..0000000 Binary files a/kernels/test19old/wireless.ko and /dev/null differ diff --git a/kernels/test19old/zImage b/kernels/test19old/zImage deleted file mode 100644 index 11604a3..0000000 Binary files a/kernels/test19old/zImage and /dev/null differ diff --git a/kernels/test21/librasdioif.ko b/kernels/test21/librasdioif.ko new file mode 100644 index 0000000..e211ce9 Binary files /dev/null and b/kernels/test21/librasdioif.ko differ diff --git a/kernels/test16/librasdioif.ko b/kernels/test21/librasdioif23.ko similarity index 98% rename from kernels/test16/librasdioif.ko rename to kernels/test21/librasdioif23.ko index a26d43c..d6c6b72 100644 Binary files a/kernels/test16/librasdioif.ko and b/kernels/test21/librasdioif23.ko differ diff --git a/kernels/test16/tun.ko b/kernels/test21/tun23.ko similarity index 50% rename from kernels/test16/tun.ko rename to kernels/test21/tun23.ko index bcac00b..7efedf1 100644 Binary files a/kernels/test16/tun.ko and b/kernels/test21/tun23.ko differ diff --git a/kernels/test21/wireless.ko b/kernels/test21/wireless.ko new file mode 100644 index 0000000..c23333c Binary files /dev/null and b/kernels/test21/wireless.ko differ diff --git a/kernels/test17/wireless.ko b/kernels/test21/wireless23.ko similarity index 96% rename from kernels/test17/wireless.ko rename to kernels/test21/wireless23.ko index 0183246..93fb480 100644 Binary files a/kernels/test17/wireless.ko and b/kernels/test21/wireless23.ko differ diff --git a/kernels/test21/zImage b/kernels/test21/zImage index d34bf96..cf5ef13 100644 Binary files a/kernels/test21/zImage and b/kernels/test21/zImage differ diff --git a/kernels/test21/zImage23 b/kernels/test21/zImage23 new file mode 100644 index 0000000..d34bf96 Binary files /dev/null and b/kernels/test21/zImage23 differ diff --git a/kernels/test21/zImage23b b/kernels/test21/zImage23b new file mode 100644 index 0000000..d34bf96 Binary files /dev/null and b/kernels/test21/zImage23b differ diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml index d9f6aaf..71d189c 100644 --- a/overlay/frameworks/base/core/res/res/values/config.xml +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -9,10 +9,10 @@ 8 - Search 16 - App switch For example, a device with Home, Back and Menu keys would set this - config to 7. - 15 --> - + config to 7. --> + 15 + + + diff --git a/prebuilt/recovery_ui.c b/prebuilt/recovery_ui.c new file mode 100644 index 0000000..7c4249a --- /dev/null +++ b/prebuilt/recovery_ui.c @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "recovery_ui.h" +#include "common.h" +#include "extendedcommands.h" + +char* MENU_HEADERS[] = { NULL }; + +char* MENU_ITEMS[] = { "reboot system now", + "apply update from sdcard", + "wipe data/factory reset", + "wipe cache partition", + "install zip from sdcard", + "backup and restore", + "mounts and storage", + "advanced", + "power off", + NULL }; + +int device_recovery_start() { + return 0; +} + +int device_toggle_display(volatile char* key_pressed, int key_code) { + int alt = key_pressed[KEY_LEFTALT] || key_pressed[KEY_RIGHTALT]; + if (alt && key_code == KEY_L) + return 1; + // allow toggling of the display if the correct key is pressed, and the display toggle is allowed or the display is currently off + if (ui_get_showing_back_button()) { + return 0; + //return get_allow_toggle_display() && (key_code == KEY_HOME || key_code == KEY_MENU || key_code == KEY_END); + } + return get_allow_toggle_display() && (key_code == KEY_HOME || key_code == KEY_POWER || key_code == KEY_END); +} + +int device_reboot_now(volatile char* key_pressed, int key_code) { + return 0; +} + +int device_handle_key(int key_code, int visible) { + if (visible) { + switch (key_code) { + case KEY_CAPSLOCK: + case KEY_DOWN: + case KEY_VOLUMEDOWN: + return HIGHLIGHT_DOWN; + + case KEY_LEFTSHIFT: + case KEY_UP: + case KEY_VOLUMEUP: + case KEY_HOME: + return HIGHLIGHT_UP; + + case KEY_POWER: + if (ui_get_showing_back_button()) { + return SELECT_ITEM; + } + if (!get_allow_toggle_display()) + return GO_BACK; + break; + case KEY_LEFTBRACE: + case KEY_ENTER: + case BTN_MOUSE: + //case KEY_CENTER: + case KEY_CAMERA: + case KEY_F21: + case KEY_SEND: + case KEY_MENU: + return SELECT_ITEM; + + case KEY_END: + case KEY_BACKSPACE: + case KEY_SEARCH: + if (ui_get_showing_back_button()) { + return SELECT_ITEM; + } + if (!get_allow_toggle_display()) + return GO_BACK; + case KEY_BACK: + return GO_BACK; + } + } + + return NO_ACTION; +} + +int device_perform_action(int which) { + return which; +} + +int device_wipe_data() { + return 0; +} diff --git a/prebuilt/recovery_ui.h b/prebuilt/recovery_ui.h new file mode 100644 index 0000000..ec5f4fa --- /dev/null +++ b/prebuilt/recovery_ui.h @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _RECOVERY_UI_H +#define _RECOVERY_UI_H + +#include "common.h" + +// Called before UI library is initialized. Can change things like +// how many frames are included in various animations, etc. +extern void device_ui_init(UIParameters* ui_parameters); + +// Called when recovery starts up. Returns 0. +extern int device_recovery_start(); + +// Called in the input thread when a new key (key_code) is pressed. +// *key_pressed is an array of KEY_MAX+1 bytes indicating which other +// keys are already pressed. Return true if the text display should +// be toggled. +extern int device_toggle_display(volatile char* key_pressed, int key_code); + +// Called in the input thread when a new key (key_code) is pressed. +// *key_pressed is an array of KEY_MAX+1 bytes indicating which other +// keys are already pressed. Return true if the device should reboot +// immediately. +extern int device_reboot_now(volatile char* key_pressed, int key_code); + +// Called from the main thread when recovery is waiting for input and +// a key is pressed. key is the code of the key pressed; visible is +// true if the recovery menu is being shown. Implementations can call +// ui_key_pressed() to discover if other keys are being held down. +// Return one of the defined constants below in order to: +// +// - move the menu highlight (HIGHLIGHT_*) +// - invoke the highlighted item (SELECT_ITEM) +// - do nothing (NO_ACTION) +// - invoke a specific action (a menu position: any non-negative number) +extern int device_handle_key(int key, int visible); + +// Perform a recovery action selected from the menu. 'which' will be +// the item number of the selected menu item, or a non-negative number +// returned from device_handle_key(). The menu will be hidden when +// this is called; implementations can call ui_print() to print +// information to the screen. +extern int device_perform_action(int which); + +// Called when we do a wipe data/factory reset operation (either via a +// reboot from the main system with the --wipe_data flag, or when the +// user boots into recovery manually and selects the option from the +// menu.) Can perform whatever device-specific wiping actions are +// needed. Return 0 on success. The userdata and cache partitions +// are erased after this returns (whether it returns success or not). +int device_wipe_data(); + +#define NO_ACTION -1 + +#define HIGHLIGHT_UP -2 +#define HIGHLIGHT_DOWN -3 +#define SELECT_ITEM -4 +#define GO_BACK -5 + +#define ITEM_REBOOT 0 +#define ITEM_APPLY_EXT 1 +#define ITEM_APPLY_SDCARD 1 // historical synonym for ITEM_APPLY_EXT +#define ITEM_WIPE_DATA 2 +#define ITEM_WIPE_CACHE 3 +// unused in cwr +#define ITEM_APPLY_CACHE 4 +#define ITEM_NANDROID 4 +#define ITEM_PARTITION 5 +#define ITEM_ADVANCED 6 +#define ITEM_POWEROFF 7 + +// Header text to display above the main menu. +extern char* MENU_HEADERS[]; + +// Text of menu items. +extern char* MENU_ITEMS[]; + +int +get_menu_selection(char** headers, char** items, int menu_only, int initial_selection); + +void +set_sdcard_update_bootloader_message(); + +#endif diff --git a/recovery.fstab b/recovery.fstab index 41fb92e..b5441ea 100644 --- a/recovery.fstab +++ b/recovery.fstab @@ -7,4 +7,4 @@ /recovery mtd recovery /sdcard vfat /dev/block/mmcblk0p1 /dev/block/mmcblk0 /system yaffs2 system -/sd-ext ext4 /dev/block/mmcblk0p2 +/sd-ext ext4 /dev/block/mmcblk0p2 \ No newline at end of file diff --git a/ril/LGEQualcommRIL.java b/ril/LGEQualcommRIL.java index f8bcc32..7e9f0cf 100644 --- a/ril/LGEQualcommRIL.java +++ b/ril/LGEQualcommRIL.java @@ -20,12 +20,22 @@ import android.content.Context; import android.os.AsyncResult; +import android.os.Handler; +import android.os.HandlerThread; +import android.os.Looper; import android.os.Message; import android.os.Parcel; +import android.telephony.SmsMessage; import android.os.SystemProperties; import android.text.TextUtils; import android.util.Log; +import com.android.internal.telephony.RILConstants; +import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo; +import com.android.internal.telephony.cdma.CdmaInformationRecords; + +import java.util.ArrayList; + /** * Qualcomm RIL class for basebands that do not send the SIM status * piggybacked in RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED. Instead, @@ -36,15 +46,736 @@ * {@hide} */ -public class LGEQualcommRIL extends QualcommSharedRIL implements CommandsInterface { +public class LGEQualcommRIL extends RIL implements CommandsInterface { + protected HandlerThread mIccThread; + protected IccHandler mIccHandler; + protected String mAid; protected int mPinState; boolean RILJ_LOGV = true; boolean RILJ_LOGD = true; + private final int RIL_INT_RADIO_OFF = 0; + private final int RIL_INT_RADIO_UNAVALIABLE = 1; + private final int RIL_INT_RADIO_ON = 2; + private final int RIL_INT_RADIO_ON_NG = 10; + + public LGEQualcommRIL(Context context, int networkMode, int cdmaSubscription) { super(context, networkMode, cdmaSubscription); } + @Override + protected void + processSolicited (Parcel p) { + int serial, error; + boolean found = false; + + serial = p.readInt(); + error = p.readInt(); + + RILRequest rr; + + rr = findAndRemoveRequestFromList(serial); + + if (rr == null) { + Log.w(LOG_TAG, "Unexpected solicited response! sn: " + + serial + " error: " + error); + return; + } + + Object ret = null; + + if (error == 0 || p.dataAvail() > 0) { + + /* Convert RIL_REQUEST_GET_MODEM_VERSION back */ + if (SystemProperties.get("ro.cm.device").indexOf("e73") == 0 && + rr.mRequest == 220) { + rr.mRequest = RIL_REQUEST_BASEBAND_VERSION; + } + + // either command succeeds or command fails but with data payload + try {switch (rr.mRequest) { + /* + cat libs/telephony/ril_commands.h \ + | egrep "^ *{RIL_" \ + | sed -re 's/\{([^,]+),[^,]+,([^}]+).+/case \1: ret = \2(p); break;/' + */ + case RIL_REQUEST_GET_SIM_STATUS: ret = responseIccCardStatus(p); break; + case RIL_REQUEST_ENTER_SIM_PIN: ret = responseInts(p); break; + case RIL_REQUEST_ENTER_SIM_PUK: ret = responseInts(p); break; + case RIL_REQUEST_ENTER_SIM_PIN2: ret = responseInts(p); break; + case RIL_REQUEST_ENTER_SIM_PUK2: ret = responseInts(p); break; + case RIL_REQUEST_CHANGE_SIM_PIN: ret = responseInts(p); break; + case RIL_REQUEST_CHANGE_SIM_PIN2: ret = responseInts(p); break; + case RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION: ret = responseInts(p); break; + case RIL_REQUEST_GET_CURRENT_CALLS: ret = responseCallList(p); break; + case RIL_REQUEST_DIAL: ret = responseVoid(p); break; + case RIL_REQUEST_GET_IMSI: ret = responseString(p); break; + case RIL_REQUEST_HANGUP: ret = responseVoid(p); break; + case RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND: ret = responseVoid(p); break; + case RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND: ret = responseVoid(p); break; + case RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE: ret = responseVoid(p); break; + case RIL_REQUEST_CONFERENCE: ret = responseVoid(p); break; + case RIL_REQUEST_UDUB: ret = responseVoid(p); break; + case RIL_REQUEST_LAST_CALL_FAIL_CAUSE: ret = responseInts(p); break; + case RIL_REQUEST_SIGNAL_STRENGTH: ret = responseSignalStrength(p); break; + case RIL_REQUEST_VOICE_REGISTRATION_STATE: ret = responseStrings(p); break; + case RIL_REQUEST_DATA_REGISTRATION_STATE: ret = responseStrings(p); break; + case RIL_REQUEST_OPERATOR: ret = responseStrings(p); break; + case RIL_REQUEST_RADIO_POWER: ret = responseVoid(p); break; + case RIL_REQUEST_DTMF: ret = responseVoid(p); break; + case RIL_REQUEST_SEND_SMS: ret = responseSMS(p); break; + case RIL_REQUEST_SEND_SMS_EXPECT_MORE: ret = responseSMS(p); break; + case RIL_REQUEST_SETUP_DATA_CALL: ret = responseSetupDataCall(p); break; + case RIL_REQUEST_SIM_IO: ret = responseICC_IO(p); break; + case RIL_REQUEST_SEND_USSD: ret = responseVoid(p); break; + case RIL_REQUEST_CANCEL_USSD: ret = responseVoid(p); break; + case RIL_REQUEST_GET_CLIR: ret = responseInts(p); break; + case RIL_REQUEST_SET_CLIR: ret = responseVoid(p); break; + case RIL_REQUEST_QUERY_CALL_FORWARD_STATUS: ret = responseCallForward(p); break; + case RIL_REQUEST_SET_CALL_FORWARD: ret = responseVoid(p); break; + case RIL_REQUEST_QUERY_CALL_WAITING: ret = responseInts(p); break; + case RIL_REQUEST_SET_CALL_WAITING: ret = responseVoid(p); break; + case RIL_REQUEST_SMS_ACKNOWLEDGE: ret = responseVoid(p); break; + case RIL_REQUEST_GET_IMEI: ret = responseString(p); break; + case RIL_REQUEST_GET_IMEISV: ret = responseString(p); break; + case RIL_REQUEST_ANSWER: ret = responseVoid(p); break; + case RIL_REQUEST_DEACTIVATE_DATA_CALL: ret = responseVoid(p); break; + case RIL_REQUEST_QUERY_FACILITY_LOCK: ret = responseInts(p); break; + case RIL_REQUEST_SET_FACILITY_LOCK: ret = responseInts(p); break; + case RIL_REQUEST_CHANGE_BARRING_PASSWORD: ret = responseVoid(p); break; + case RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE: ret = responseInts(p); break; + case RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC: ret = responseVoid(p); break; + case RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL: ret = responseVoid(p); break; + case RIL_REQUEST_QUERY_AVAILABLE_NETWORKS : ret = responseOperatorInfos(p); break; + case RIL_REQUEST_DTMF_START: ret = responseVoid(p); break; + case RIL_REQUEST_DTMF_STOP: ret = responseVoid(p); break; + case RIL_REQUEST_BASEBAND_VERSION: ret = responseString(p); break; + case RIL_REQUEST_SEPARATE_CONNECTION: ret = responseVoid(p); break; + case RIL_REQUEST_SET_MUTE: ret = responseVoid(p); break; + case RIL_REQUEST_GET_MUTE: ret = responseInts(p); break; + case RIL_REQUEST_QUERY_CLIP: ret = responseInts(p); break; + case RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE: ret = responseInts(p); break; + case RIL_REQUEST_DATA_CALL_LIST: ret = responseDataCallList(p); break; + case RIL_REQUEST_RESET_RADIO: ret = responseVoid(p); break; + case RIL_REQUEST_OEM_HOOK_RAW: ret = responseRaw(p); break; + case RIL_REQUEST_OEM_HOOK_STRINGS: ret = responseStrings(p); break; + case RIL_REQUEST_SCREEN_STATE: ret = responseVoid(p); break; + case RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION: ret = responseVoid(p); break; + case RIL_REQUEST_WRITE_SMS_TO_SIM: ret = responseInts(p); break; + case RIL_REQUEST_DELETE_SMS_ON_SIM: ret = responseVoid(p); break; + case RIL_REQUEST_SET_BAND_MODE: ret = responseVoid(p); break; + case RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE: ret = responseInts(p); break; + case RIL_REQUEST_STK_GET_PROFILE: ret = responseString(p); break; + case RIL_REQUEST_STK_SET_PROFILE: ret = responseVoid(p); break; + case RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND: ret = responseString(p); break; + case RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE: ret = responseVoid(p); break; + case RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM: ret = responseInts(p); break; + case RIL_REQUEST_EXPLICIT_CALL_TRANSFER: ret = responseVoid(p); break; + case RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE: ret = responseVoid(p); break; + case RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE: ret = responseGetPreferredNetworkType(p); break; + case RIL_REQUEST_GET_NEIGHBORING_CELL_IDS: ret = responseCellList(p); break; + case RIL_REQUEST_SET_LOCATION_UPDATES: ret = responseVoid(p); break; + case RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE: ret = responseVoid(p); break; + case RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE: ret = responseVoid(p); break; + case RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE: ret = responseInts(p); break; + case RIL_REQUEST_SET_TTY_MODE: ret = responseVoid(p); break; + case RIL_REQUEST_QUERY_TTY_MODE: ret = responseInts(p); break; + case RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE: ret = responseVoid(p); break; + case RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE: ret = responseInts(p); break; + case RIL_REQUEST_CDMA_FLASH: ret = responseVoid(p); break; + case RIL_REQUEST_CDMA_BURST_DTMF: ret = responseVoid(p); break; + case RIL_REQUEST_CDMA_SEND_SMS: ret = responseSMS(p); break; + case RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE: ret = responseVoid(p); break; + case RIL_REQUEST_GSM_GET_BROADCAST_CONFIG: ret = responseGmsBroadcastConfig(p); break; + case RIL_REQUEST_GSM_SET_BROADCAST_CONFIG: ret = responseVoid(p); break; + case RIL_REQUEST_GSM_BROADCAST_ACTIVATION: ret = responseVoid(p); break; + case RIL_REQUEST_CDMA_GET_BROADCAST_CONFIG: ret = responseCdmaBroadcastConfig(p); break; + case RIL_REQUEST_CDMA_SET_BROADCAST_CONFIG: ret = responseVoid(p); break; + case RIL_REQUEST_CDMA_BROADCAST_ACTIVATION: ret = responseVoid(p); break; + case RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY: ret = responseVoid(p); break; + case RIL_REQUEST_CDMA_SUBSCRIPTION: ret = responseStrings(p); break; + case RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM: ret = responseInts(p); break; + case RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM: ret = responseVoid(p); break; + case RIL_REQUEST_DEVICE_IDENTITY: ret = responseStrings(p); break; + case RIL_REQUEST_GET_SMSC_ADDRESS: ret = responseString(p); break; + case RIL_REQUEST_SET_SMSC_ADDRESS: ret = responseVoid(p); break; + case RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE: ret = responseVoid(p); break; + case RIL_REQUEST_REPORT_SMS_MEMORY_STATUS: ret = responseVoid(p); break; + case RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING: ret = responseVoid(p); break; + case 104: ret = responseInts(p); break; // RIL_REQUEST_VOICE_RADIO_TECH + case 105: ret = responseInts(p); break; // RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE + case 106: ret = responseStrings(p); break; // RIL_REQUEST_CDMA_PRL_VERSION + case 107: ret = responseInts(p); break; // RIL_REQUEST_IMS_REGISTRATION_STATE + case 108: ret = responseSMS(p); break; // RIL_REQUEST_IMS_SEND_SMS + + default: + throw new RuntimeException("Unrecognized solicited response: " + rr.mRequest); + //break; + }} catch (Throwable tr) { + // Exceptions here usually mean invalid RIL responses + + Log.w(LOG_TAG, rr.serialString() + "< " + + requestToString(rr.mRequest) + + " exception, possible invalid RIL response", tr); + + if (rr.mResult != null) { + AsyncResult.forMessage(rr.mResult, null, tr); + rr.mResult.sendToTarget(); + } + rr.release(); + return; + } + } + + if (error != 0) { + rr.onError(error, ret); + rr.release(); + return; + } + + if (RILJ_LOGD) riljLog(rr.serialString() + "< " + requestToString(rr.mRequest) + + " " + retToString(rr.mRequest, ret)); + + if (rr.mResult != null) { + AsyncResult.forMessage(rr.mResult, ret, null); + rr.mResult.sendToTarget(); + } + + rr.release(); + } + + @Override + protected void + processUnsolicited (Parcel p) { + int response; + Object ret; + + response = p.readInt(); + + try {switch(response) { +/* + cat libs/telephony/ril_unsol_commands.h \ + | egrep "^ *{RIL_" \ + | sed -re 's/\{([^,]+),[^,]+,([^}]+).+/case \1: \2(rr, p); break;/' +*/ + + case RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED: ret = responseVoid(p); break; + case RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED: ret = responseVoid(p); break; + case RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED: ret = responseVoid(p); break; + case RIL_UNSOL_RESPONSE_NEW_SMS: ret = responseString(p); break; + case RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT: ret = responseString(p); break; + case RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM: ret = responseInts(p); break; + case RIL_UNSOL_ON_USSD: ret = responseStrings(p); break; + case RIL_UNSOL_NITZ_TIME_RECEIVED: ret = responseString(p); break; + case RIL_UNSOL_SIGNAL_STRENGTH: ret = responseSignalStrength(p); break; + case RIL_UNSOL_DATA_CALL_LIST_CHANGED: ret = responseDataCallList(p);break; + case RIL_UNSOL_SUPP_SVC_NOTIFICATION: ret = responseSuppServiceNotification(p); break; + case RIL_UNSOL_STK_SESSION_END: ret = responseVoid(p); break; + case RIL_UNSOL_STK_PROACTIVE_COMMAND: ret = responseString(p); break; + case RIL_UNSOL_STK_EVENT_NOTIFY: ret = responseString(p); break; + case RIL_UNSOL_STK_CALL_SETUP: ret = responseInts(p); break; + case RIL_UNSOL_SIM_SMS_STORAGE_FULL: ret = responseVoid(p); break; + case RIL_UNSOL_SIM_REFRESH: ret = responseInts(p); break; + case RIL_UNSOL_CALL_RING: ret = responseCallRing(p); break; + case RIL_UNSOL_RESTRICTED_STATE_CHANGED: ret = responseInts(p); break; + case RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED: ret = responseVoid(p); break; + case RIL_UNSOL_RESPONSE_CDMA_NEW_SMS: ret = responseCdmaSms(p); break; + case RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS: ret = responseRaw(p); break; + case RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL: ret = responseVoid(p); break; + case RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE: ret = responseVoid(p); break; + case RIL_UNSOL_CDMA_CALL_WAITING: ret = responseCdmaCallWaiting(p); break; + case RIL_UNSOL_CDMA_OTA_PROVISION_STATUS: ret = responseInts(p); break; + case RIL_UNSOL_CDMA_INFO_REC: ret = responseCdmaInformationRecord(p); break; + case RIL_UNSOL_OEM_HOOK_RAW: ret = responseRaw(p); break; + case RIL_UNSOL_RINGBACK_TONE: ret = responseInts(p); break; + case RIL_UNSOL_RESEND_INCALL_MUTE: ret = responseVoid(p); break; + case 1031: ret = responseVoid(p); break; // RIL_UNSOL_VOICE_RADIO_TECH_CHANGED + case 1032: ret = responseInts(p); break; // RIL_UNSOL_TETHERED_MODE_STATE_CHANGED + case 1033: ret = responseVoid(p); break; // RIL_UNSOL_RESPONSE_DATA_NETWORK_STATE_CHANGED + case 1034: ret = responseVoid(p); break; // RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED + case 1035: ret = responseVoid(p); break; // RIL_UNSOL_CDMA_PRL_CHANGED + case 1036: ret = responseVoid(p); break; // RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED + case 1037: ret = responseVoid(p); break; // RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE + + default: + throw new RuntimeException("Unrecognized unsol response: " + response); + //break; (implied) + }} catch (Throwable tr) { + Log.e(LOG_TAG, "Exception processing unsol response: " + response + + "Exception:" + tr.toString()); + return; + } + + switch(response) { + case RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED: + int state = p.readInt(); + setRadioStateFromRILInt(state); + break; + case RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED: + if (RILJ_LOGD) unsljLog(response); + + mCallStateRegistrants + .notifyRegistrants(new AsyncResult(null, null, null)); + break; + case RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED: + if (RILJ_LOGD) unsljLog(response); + + mVoiceNetworkStateRegistrants + .notifyRegistrants(new AsyncResult(null, null, null)); + break; + case RIL_UNSOL_RESPONSE_NEW_SMS: { + if (RILJ_LOGD) unsljLog(response); + + // FIXME this should move up a layer + String a[] = new String[2]; + + a[1] = (String)ret; + + SmsMessage sms; + + sms = SmsMessage.newFromCMT(a); + if (mGsmSmsRegistrant != null) { + mGsmSmsRegistrant + .notifyRegistrant(new AsyncResult(null, sms, null)); + } + break; + } + case RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT: + if (RILJ_LOGD) unsljLogRet(response, ret); + + if (mSmsStatusRegistrant != null) { + mSmsStatusRegistrant.notifyRegistrant( + new AsyncResult(null, ret, null)); + } + break; + case RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM: + if (RILJ_LOGD) unsljLogRet(response, ret); + + int[] smsIndex = (int[])ret; + + if(smsIndex.length == 1) { + if (mSmsOnSimRegistrant != null) { + mSmsOnSimRegistrant. + notifyRegistrant(new AsyncResult(null, smsIndex, null)); + } + } else { + if (RILJ_LOGD) riljLog(" NEW_SMS_ON_SIM ERROR with wrong length " + + smsIndex.length); + } + break; + case RIL_UNSOL_ON_USSD: + String[] resp = (String[])ret; + + if (resp.length < 2) { + resp = new String[2]; + resp[0] = ((String[])ret)[0]; + resp[1] = null; + } + if (RILJ_LOGD) unsljLogMore(response, resp[0]); + if (mUSSDRegistrant != null) { + mUSSDRegistrant.notifyRegistrant( + new AsyncResult (null, resp, null)); + } + break; + case RIL_UNSOL_NITZ_TIME_RECEIVED: + if (RILJ_LOGD) unsljLogRet(response, ret); + + // has bonus long containing milliseconds since boot that the NITZ + // time was received + long nitzReceiveTime = p.readLong(); + + Object[] result = new Object[2]; + + result[0] = ret; + result[1] = Long.valueOf(nitzReceiveTime); + + if (mNITZTimeRegistrant != null) { + + mNITZTimeRegistrant + .notifyRegistrant(new AsyncResult (null, result, null)); + } else { + // in case NITZ time registrant isnt registered yet + mLastNITZTimeInfo = result; + } + break; + + case RIL_UNSOL_SIGNAL_STRENGTH: + // Note this is set to "verbose" because it happens + // frequently + if (RILJ_LOGV) unsljLogvRet(response, ret); + + if (mSignalStrengthRegistrant != null) { + mSignalStrengthRegistrant.notifyRegistrant( + new AsyncResult (null, ret, null)); + } + break; + case RIL_UNSOL_DATA_CALL_LIST_CHANGED: + if (RILJ_LOGD) unsljLogRet(response, ret); + + mDataNetworkStateRegistrants.notifyRegistrants(new AsyncResult(null, ret, null)); + break; + + case RIL_UNSOL_SUPP_SVC_NOTIFICATION: + if (RILJ_LOGD) unsljLogRet(response, ret); + + if (mSsnRegistrant != null) { + mSsnRegistrant.notifyRegistrant( + new AsyncResult (null, ret, null)); + } + break; + + case RIL_UNSOL_STK_SESSION_END: + if (RILJ_LOGD) unsljLog(response); + + if (mCatSessionEndRegistrant != null) { + mCatSessionEndRegistrant.notifyRegistrant( + new AsyncResult (null, ret, null)); + } + break; + + case RIL_UNSOL_STK_PROACTIVE_COMMAND: + if (RILJ_LOGD) unsljLogRet(response, ret); + + if (mCatProCmdRegistrant != null) { + mCatProCmdRegistrant.notifyRegistrant( + new AsyncResult (null, ret, null)); + } + break; + + case RIL_UNSOL_STK_EVENT_NOTIFY: + if (RILJ_LOGD) unsljLogRet(response, ret); + + if (mCatEventRegistrant != null) { + mCatEventRegistrant.notifyRegistrant( + new AsyncResult (null, ret, null)); + } + break; + + case RIL_UNSOL_STK_CALL_SETUP: + if (RILJ_LOGD) unsljLogRet(response, ret); + + if (mCatCallSetUpRegistrant != null) { + mCatCallSetUpRegistrant.notifyRegistrant( + new AsyncResult (null, ret, null)); + } + break; + + case RIL_UNSOL_SIM_SMS_STORAGE_FULL: + if (RILJ_LOGD) unsljLog(response); + + if (mIccSmsFullRegistrant != null) { + mIccSmsFullRegistrant.notifyRegistrant(); + } + break; + + case RIL_UNSOL_SIM_REFRESH: + if (RILJ_LOGD) unsljLogRet(response, ret); + + if (mIccRefreshRegistrants != null) { + mIccRefreshRegistrants.notifyRegistrants( + new AsyncResult (null, ret, null)); + } + break; + + case RIL_UNSOL_CALL_RING: + if (RILJ_LOGD) unsljLogRet(response, ret); + + if (mRingRegistrant != null) { + mRingRegistrant.notifyRegistrant( + new AsyncResult (null, ret, null)); + } + break; + + case RIL_UNSOL_RESTRICTED_STATE_CHANGED: + if (RILJ_LOGD) unsljLogvRet(response, ret); + if (mRestrictedStateRegistrant != null) { + mRestrictedStateRegistrant.notifyRegistrant( + new AsyncResult (null, ret, null)); + } + break; + + case RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED: + if (RILJ_LOGD) unsljLog(response); + + if (mIccStatusChangedRegistrants != null) { + mIccStatusChangedRegistrants.notifyRegistrants(); + } + break; + + case RIL_UNSOL_RESPONSE_CDMA_NEW_SMS: + if (RILJ_LOGD) unsljLog(response); + + SmsMessage sms = (SmsMessage) ret; + + if (mCdmaSmsRegistrant != null) { + mCdmaSmsRegistrant + .notifyRegistrant(new AsyncResult(null, sms, null)); + } + break; + + case RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS: + if (RILJ_LOGD) unsljLog(response); + + if (mGsmBroadcastSmsRegistrant != null) { + mGsmBroadcastSmsRegistrant + .notifyRegistrant(new AsyncResult(null, ret, null)); + } + break; + + case RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL: + if (RILJ_LOGD) unsljLog(response); + + if (mIccSmsFullRegistrant != null) { + mIccSmsFullRegistrant.notifyRegistrant(); + } + break; + + case RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE: + if (RILJ_LOGD) unsljLog(response); + + if (mEmergencyCallbackModeRegistrant != null) { + mEmergencyCallbackModeRegistrant.notifyRegistrant(); + } + break; + + case RIL_UNSOL_CDMA_CALL_WAITING: + if (RILJ_LOGD) unsljLogRet(response, ret); + + if (mCallWaitingInfoRegistrants != null) { + mCallWaitingInfoRegistrants.notifyRegistrants( + new AsyncResult (null, ret, null)); + } + break; + + case RIL_UNSOL_CDMA_OTA_PROVISION_STATUS: + if (RILJ_LOGD) unsljLogRet(response, ret); + + if (mOtaProvisionRegistrants != null) { + mOtaProvisionRegistrants.notifyRegistrants( + new AsyncResult (null, ret, null)); + } + break; + + case RIL_UNSOL_CDMA_INFO_REC: + ArrayList listInfoRecs; + + try { + listInfoRecs = (ArrayList)ret; + } catch (ClassCastException e) { + Log.e(LOG_TAG, "Unexpected exception casting to listInfoRecs", e); + break; + } + + for (CdmaInformationRecords rec : listInfoRecs) { + if (RILJ_LOGD) unsljLogRet(response, rec); + notifyRegistrantsCdmaInfoRec(rec); + } + break; + + case RIL_UNSOL_OEM_HOOK_RAW: + if (RILJ_LOGD) unsljLogvRet(response, IccUtils.bytesToHexString((byte[])ret)); + if (mUnsolOemHookRawRegistrant != null) { + mUnsolOemHookRawRegistrant.notifyRegistrant(new AsyncResult(null, ret, null)); + } + break; + + case RIL_UNSOL_RINGBACK_TONE: + if (RILJ_LOGD) unsljLogvRet(response, ret); + if (mRingbackToneRegistrants != null) { + boolean playtone = (((int[])ret)[0] == 1); + mRingbackToneRegistrants.notifyRegistrants( + new AsyncResult (null, playtone, null)); + } + break; + + case RIL_UNSOL_RESEND_INCALL_MUTE: + if (RILJ_LOGD) unsljLogRet(response, ret); + + if (mResendIncallMuteRegistrants != null) { + mResendIncallMuteRegistrants.notifyRegistrants( + new AsyncResult (null, ret, null)); + } + break; + + case 1031: + break; + case 1032: + break; + case 1033: + break; + case 1034: + break; + case 1035: + break; + case 1036: + break; + case 1037: // RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE + if (RILJ_LOGD) unsljLogRet(response, ret); + + if (mExitEmergencyCallbackModeRegistrants != null) { + mExitEmergencyCallbackModeRegistrants.notifyRegistrants( + new AsyncResult (null, null, null)); + } + break; + } + } + + private void setRadioStateFromRILInt (int stateCode) { + CommandsInterface.RadioState radioState; + HandlerThread handlerThread; + Looper looper; + IccHandler iccHandler; + + switch (stateCode) { + case RIL_INT_RADIO_OFF: + radioState = CommandsInterface.RadioState.RADIO_OFF; + if (mIccHandler != null) { + mIccThread = null; + mIccHandler = null; + } + break; + case RIL_INT_RADIO_UNAVALIABLE: + radioState = CommandsInterface.RadioState.RADIO_UNAVAILABLE; + break; + case RIL_INT_RADIO_ON: + case RIL_INT_RADIO_ON_NG: + if (mIccHandler == null) { + handlerThread = new HandlerThread("IccHandler"); + mIccThread = handlerThread; + + mIccThread.start(); + + looper = mIccThread.getLooper(); + mIccHandler = new IccHandler(this,looper); + mIccHandler.run(); + } + if (mPhoneType == RILConstants.CDMA_PHONE) { + radioState = CommandsInterface.RadioState.RUIM_NOT_READY; + } else { + radioState = CommandsInterface.RadioState.SIM_NOT_READY; + } + setRadioState(radioState); + break; + default: + throw new RuntimeException("Unrecognized RIL_RadioState: " + stateCode); + } + + setRadioState (radioState); + } + + class IccHandler extends Handler implements Runnable { + private static final int EVENT_RADIO_ON = 1; + private static final int EVENT_ICC_STATUS_CHANGED = 2; + private static final int EVENT_GET_ICC_STATUS_DONE = 3; + private static final int EVENT_RADIO_OFF_OR_UNAVAILABLE = 4; + + private RIL mRil; + private boolean mRadioOn = false; + + public IccHandler (RIL ril, Looper looper) { + super (looper); + mRil = ril; + } + + public void handleMessage (Message paramMessage) { + switch (paramMessage.what) { + case EVENT_RADIO_ON: + mRadioOn = true; + Log.d(LOG_TAG, "Radio on -> Forcing sim status update"); + sendMessage(obtainMessage(EVENT_ICC_STATUS_CHANGED)); + break; + case EVENT_GET_ICC_STATUS_DONE: + AsyncResult asyncResult = (AsyncResult) paramMessage.obj; + if (asyncResult.exception != null) { + Log.e (LOG_TAG, "IccCardStatusDone shouldn't return exceptions!", asyncResult.exception); + break; + } + IccCardStatus status = (IccCardStatus) asyncResult.result; + if (status.getNumApplications() == 0) { + if (!mRil.getRadioState().isOn()) { + break; + } + + if (mPhoneType == RILConstants.CDMA_PHONE) { + mRil.setRadioState(CommandsInterface.RadioState.RUIM_LOCKED_OR_ABSENT); + } else { + mRil.setRadioState(CommandsInterface.RadioState.SIM_LOCKED_OR_ABSENT); + } + } else { + int appIndex = -1; + if (mPhoneType == RILConstants.CDMA_PHONE) { + appIndex = status.getCdmaSubscriptionAppIndex(); + Log.d(LOG_TAG, "This is a CDMA PHONE " + appIndex); + } else { + appIndex = status.getGsmUmtsSubscriptionAppIndex(); + Log.d(LOG_TAG, "This is a GSM PHONE " + appIndex); + } + + IccCardApplication application = status.getApplication(appIndex); + IccCardApplication.AppState app_state = application.app_state; + IccCardApplication.AppType app_type = application.app_type; + + switch (app_state) { + case APPSTATE_PIN: + case APPSTATE_PUK: + switch (app_type) { + case APPTYPE_SIM: + case APPTYPE_USIM: + mRil.setRadioState(CommandsInterface.RadioState.SIM_LOCKED_OR_ABSENT); + break; + case APPTYPE_RUIM: + mRil.setRadioState(CommandsInterface.RadioState.RUIM_LOCKED_OR_ABSENT); + break; + default: + Log.e(LOG_TAG, "Currently we don't handle SIMs of type: " + app_type); + return; + } + break; + case APPSTATE_READY: + switch (app_type) { + case APPTYPE_SIM: + case APPTYPE_USIM: + mRil.setRadioState(CommandsInterface.RadioState.SIM_READY); + break; + case APPTYPE_RUIM: + mRil.setRadioState(CommandsInterface.RadioState.RUIM_READY); + break; + default: + Log.e(LOG_TAG, "Currently we don't handle SIMs of type: " + app_type); + return; + } + break; + default: + return; + } + } + break; + case EVENT_ICC_STATUS_CHANGED: + if (mRadioOn) { + Log.d(LOG_TAG, "Received EVENT_ICC_STATUS_CHANGED, calling getIccCardStatus"); + mRil.getIccCardStatus(obtainMessage(EVENT_GET_ICC_STATUS_DONE, paramMessage.obj)); + } else { + Log.d(LOG_TAG, "Received EVENT_ICC_STATUS_CHANGED while radio is not ON. Ignoring"); + } + break; + case EVENT_RADIO_OFF_OR_UNAVAILABLE: + mRadioOn = false; + // disposeCards(); // to be verified; + default: + Log.e(LOG_TAG, " Unknown Event " + paramMessage.what); + break; + } + } + + public void run () { + mRil.registerForIccStatusChanged(this, EVENT_ICC_STATUS_CHANGED, null); + Message msg = obtainMessage(EVENT_RADIO_ON); + mRil.getIccCardStatus(msg); + } + } + + @Override public void supplyIccPin(String pin, Message result) { @@ -140,6 +871,19 @@ public LGEQualcommRIL(Context context, int networkMode, int cdmaSubscription) { send(rr); } + @Override + public void + supplyNetworkDepersonalization(String netpin, Message result) { + RILRequest rr = RILRequest.obtain(RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION, result); + + if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); + + rr.mp.writeInt(3); + rr.mp.writeString(netpin); + + send(rr); + } + @Override public void getIMSI(Message result) { @@ -212,6 +956,23 @@ public LGEQualcommRIL(Context context, int networkMode, int cdmaSubscription) { send(rr); } + @Override + public void + setNetworkSelectionModeManual(String operatorNumeric, Message response) { + RILRequest rr + = RILRequest.obtain(RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL, + response); + + if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + + " " + operatorNumeric); + + rr.mp.writeInt(2); + rr.mp.writeString(operatorNumeric); + rr.mp.writeString("NOCHANGE"); + + send(rr); + } + @Override public void queryFacilityLock (String facility, String password, int serviceClass, @@ -360,6 +1121,65 @@ protected DataCallState getDataCallState(Parcel p, int version) { return dataCall; } + @Override + protected Object + responseSetupDataCall(Parcel p) { + DataCallState dataCall; + + boolean oldRil = needsOldRilFeature("datacall"); + + if (!oldRil) + return super.responseSetupDataCall(p); + + dataCall = new DataCallState(); + dataCall.version = 3; + dataCall.cid = 0; // Integer.parseInt(p.readString()); + p.readString(); + dataCall.ifname = p.readString(); + if (TextUtils.isEmpty(dataCall.ifname)) { + throw new RuntimeException( + "RIL_REQUEST_SETUP_DATA_CALL response, no ifname"); + } + String addresses = p.readString(); + if (!TextUtils.isEmpty(addresses)) { + dataCall.addresses = addresses.split(" "); + } + + dataCall.dnses = new String[2]; + dataCall.dnses[0] = SystemProperties.get("net."+dataCall.ifname+".dns1"); + dataCall.dnses[1] = SystemProperties.get("net."+dataCall.ifname+".dns2"); + dataCall.active = 1; + dataCall.status = 0; + + return dataCall; + } + + @Override + protected Object + responseOperatorInfos(Parcel p) { + String strings[] = (String [])responseStrings(p); + ArrayList ret; + + if (strings.length % 5 != 0) { + throw new RuntimeException( + "RIL_REQUEST_QUERY_AVAILABLE_NETWORKS: invalid response. Got " + + strings.length + " strings, expected multiple of 5"); + } + + ret = new ArrayList(strings.length / 5); + + for (int i = 0 ; i < strings.length ; i += 5) { + ret.add ( + new OperatorInfo( + strings[i+0], + strings[i+1], + strings[i+2], + strings[i+3])); + } + + return ret; + } + @Override public void getBasebandVersion (Message response) { diff --git a/system.prop b/system.prop index 013f829..7a3829d 100644 --- a/system.prop +++ b/system.prop @@ -1,5 +1,5 @@ -persist.mvpdm.ProxyServerAddr=68.28.31.1 -persist.mvpdm.ProxyServerIp=80 +#persist.mvpdm.ProxyServerAddr=68.28.31.1 +#persist.mvpdm.ProxyServerIp=80 ro.lge.proximity.delay=100 ro.ril.def.preferred.network=4 ro.telephony.default_network=4 @@ -20,17 +20,17 @@ ro.telephony.call_ring.multiple=false ro.telephony.call_ring.delay=3000 -#ro.telephony.ril.v3=signalstrength,skipbrokendatacall,facilitylock,datacall,icccardstatus,1 -ro.telephony.ril.v3=skipCdmaSubcription +ro.telephony.ril.v3=signalstrength,skipbrokendatacall,facilitylock,datacall,icccardstatus,1 +#ro.telephony.ril.v3=skipCdmaSubcription mobiledata.interfaces=rmnet0,rmnet1,rmnet2 -ril.subscription.types=NV,RUIM -ro.telephony.ril_class=QualcommSharedRIL +#ril.subscription.types=NV,RUIM +#ro.telephony.ril_class=QualcommSharedRIL ro.bt.bdaddr_path=/data/misc/bd_addr # Wifi -interfacewifi.interface=wlan0 -wifi.supplicant_scan_interval=180 +#wifi.interface=wlan0 +#wifi.supplicant_scan_interval=180 #wifi.ap.interface=athap0 # See also: init.qcom.usb.rc and init.qcom.post_boot.sh persist.sys.usb.config=mass_storage,adb @@ -38,6 +38,14 @@ persist.sys.usb.config=mass_storage,adb # Enable dithering (always) persist.sys.use_dithering=2 +# System and Misc. +ro.tether.denied=false +sys.checkfs.fat=false + +# A-GPS +ro.ril.def.agps.mode=2 +ro.ril.def.agps.feature=1 + # Force use of GPU on 2D rendering # persist.sys.force_hw_ui=true @@ -45,17 +53,12 @@ ro.opengles.version=131072 ro.sf.lcd_density=160 -# Qualcomm -debug.qctwa.statusbar=1 -debug.qctwa.preservebuf=1 -com.qc.hardware=true -debug.enabletr=false # dalvik options dalvik.vm.checkjni=0 dalvik.vm.dexopt-data-only=1 -dalvik.vm.dexopt-flags=m=y -dalvik.vm.execution-mode=int:jit +#dalvik.vm.dexopt-flags=m=y +dalvik.vm.dexopt-flags=v=a,o=v,m=y,u=y dalvik.vm.heapstartsize=5m dalvik.vm.heapgrowthlimit=36m dalvik.vm.heapsize=64m @@ -63,13 +66,63 @@ dalvik.vm.heaptargetutilization=0.75 dalvik.vm.heapminfree=512k dalvik.vm.heapmaxfree=2m dalvik.vm.lockprof.threshold=500 -dalvik.vm.verify-bytecode=false -ro.com.google.networklocation=1 -ro.com.google.locationfeatures=1 +#dalvik.vm.verify-bytecode=false + ro.cdma.voicemail.number=mine ro.setupwizard.enable_bypass=1 gsm.sim.operator.iso-country=us gsm.operator.iso-country=us -qemu.sf.lcd_density=160 -ro.sf.hwrotation=0 -ro.sf.lcd_density=160 + +# V6 SuperCharger settings +ro.ril.hsxpa=3 +ro.ril.gprsclass=12 +ro.ril.hep=1 +ro.ril.enable.dtm=1 +ro.ril.hsdpa.category=28 +ro.ril.enable.a53=1 +ro.ril.enable.3g.prefix=1 +ro.ril.htcmaskw1.bitmask=4294967295 +ro.ril.htcmaskw1=14449 +ro.ril.hsupa.category=9 + + #From CAI +debug.performance.tuning=1 +video.accelerate.hw=1 +# Increase battery and longer standby time with deeper sleep +pm.sleep_mode=1 +ro.ril.disable.power.collapse=0 +# More accurate touch +movfilter=40 +move hyst=0 +# Faster transfer rate for net connections +net.tcp.buffersize.default=4096,87380,256960,4096, 16384,256960 +net.tcp.buffersize.wifi=4096,87380,256960,4096,163 84,256960 +# store launcher in memory - so that when you switch back to home it loads faster +ro.HOME_APP_ADJ=1 +#Improve Scrolling Build.prop Tweak +ro.max.fling_velocity=4000 +# Disable strict mode flash on display +persist.sys.strictmode.visual=false +#Disable_ADB_Notification_Icon +persist.adb.notify=0 +dalvik.vm.execution-mode=int:jit +windowsmgr.max_events_per_sec=150 +ro.config.vc_call_vol_steps=15 +# improve image and video quality (when taking pics and vids from cam and showing them in gallery) +ro.media.enc.jpeg.quality=100 +ro.media.dec.jpeg.memcap=8000000 +ro.media.enc.hprof.vid.bps=8000000 +ro.media.enc.file.format = 3gp,mp4 +ro.media.enc.vid.codec = m4v,h263 +ro.media.enc.vid.h263.width = 176,640 +ro.media.enc.vid.h263.height = 144,480 +ro.media.enc.vid.h263.bps = 64000,1600000 +ro.media.enc.vid.h263.fps = 1,30 +ro.media.enc.vid.m4v.width = 176,640 +ro.media.enc.vid.m4v.height = 144,480 +ro.media.enc.vid.m4v.bps = 64000,1600000 +ro.media.enc.vid.m4v.fps = 1,30 +ro.media.dec.aud.wma.enabled=1 +ro.media.dec.vid.wmv.enabled=1 + + diff --git a/thunderc.mk b/thunderc.mk index 5b0cd25..d44dc9e 100644 --- a/thunderc.mk +++ b/thunderc.mk @@ -1,21 +1,31 @@ -PRODUCT_AAPT_CONFIG := normal mdpi -PRODUCT_AAPT_PREF_CONFIG := mdpi +# Most specific first. +$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) -$(call inherit-product, device/lge/msm7x27-common/device.mk) -$(call inherit-product, vendor/lge/thunderc/thunderc-vendor.mk) -$(call inherit-product, vendor/lge/msm7x27-common/msm7x27-common-vendor-blobs.mk) +#LOCAL_KERNEL_DIR := device/lge/thunderc/kernels/test21 +#LOCAL_KERNEL_MODULES := librasdioif.ko wireless.ko +#LOCAL_KERNEL_MODULES := librasdioif.ko tun.ko wireless.ko -DEVICE_PACKAGE_OVERLAYS += device/lge/thunderc/overlay +#PRODUCT_COPY_FILES += \ +# $(LOCAL_KERNEL_DIR)/zImage:kernel + +#PRODUCT_COPY_FILES += \ +# $(foreach f,$(LOCAL_KERNEL_MODULES),$(LOCAL_KERNEL_DIR)/$(f):system/lib/modules/$(f)) \ # thunderc configs PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/configs/thunder_keypad.kl:system/usr/keylayout/thunder_keypad.kl \ $(LOCAL_PATH)/configs/thunder_keypad.kcm.bin:system/usr/keychars/thunder_keypad.kcm.bin \ - $(LOCAL_PATH)/configs/wireless.ko:system/lib/modules/wireless.ko \ - $(LOCAL_PATH)/configs/librasdioif.ko:system/lib/modules/librasdioif.ko \ $(LOCAL_PATH)/configs/touch_mcs6000.idc:system/usr/idc/touch_mcs6000.idc \ + $(LOCAL_PATH)/configs/999youtube:system/etc/init.d/999youtube \ $(LOCAL_PATH)/configs/synaptics-rmi-touchscreen.idc:system/usr/idc/synaptics-rmi-touchscreen.idc - +# $(LOCAL_PATH)/configs/40a2sd:system/etc/init.d/40a2sd \ +# $(LOCAL_PATH)/configs/05mountsd:system/etc/init.d/05mountsd \ +# $(LOCAL_PATH)/configs/12Seeder:system/etc/init.d/12Seeder \ +# $(LOCAL_PATH)/configs/rngd:system/xbin/rngd \ +# $(LOCAL_PATH)/configs/wireless.ko:system/lib/modules/wireless.ko \ +# $(LOCAL_PATH)/configs/tun.ko:system/lib/modules/tun.ko \ + # $(LOCAL_PATH)/configs/librasdioif.ko:system/lib/modules/librasdioif.ko \ + PRODUCT_COPY_FILES += device/lge/thunderc/configs/default.prop:root/default.prop PRODUCT_COPY_FILES += device/lge/thunderc/configs/thunderc_keypad.kl:system/usr/keylayout/thunderc_keypad.kl PRODUCT_COPY_FILES += device/lge/thunderc/configs/thunderc_keypad.kcm.bin:system/usr/keychars/thunderc_keypad.kcm.bin @@ -26,30 +36,63 @@ PRODUCT_COPY_FILES += device/lge/thunderc/configs/Generic.kl:system/usr/keylayou PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/init.thunderc.rc:root/init.thunderc.rc \ $(LOCAL_PATH)/ueventd.thunderc.rc:root/ueventd.thunderc.rc + +PRODUCT_COPY_FILES += $(LOCAL_PATH)/checkbootreason:root/sbin/checkbootreason +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/chargemode/chargerimages/battery_ani_01.rle:root/chargerimages/battery_ani_01.rle \ + $(LOCAL_PATH)/chargemode/chargerimages/battery_ani_02.rle:root/chargerimages/battery_ani_02.rle \ + $(LOCAL_PATH)/chargemode/chargerimages/battery_ani_03.rle:root/chargerimages/battery_ani_03.rle \ + $(LOCAL_PATH)/chargemode/chargerimages/battery_ani_04.rle:root/chargerimages/battery_ani_04.rle \ + $(LOCAL_PATH)/chargemode/chargerimages/battery_ani_05.rle:root/chargerimages/battery_ani_05.rle \ + $(LOCAL_PATH)/chargemode/chargerimages/battery_bg.rle:root/chargerimages/battery_bg.rle \ + $(LOCAL_PATH)/chargemode/chargerimages/battery_charging_01.rle:root/chargerimages/battery_charging_01.rle \ + $(LOCAL_PATH)/chargemode/chargerimages/battery_charging_02.rle:root/chargerimages/battery_charging_02.rle \ + $(LOCAL_PATH)/chargemode/chargerimages/battery_charging_03.rle:root/chargerimages/battery_charging_03.rle \ + $(LOCAL_PATH)/chargemode/chargerimages/battery_charging_04.rle:root/chargerimages/battery_charging_04.rle \ + $(LOCAL_PATH)/chargemode/chargerimages/battery_charging_05.rle:root/chargerimages/battery_charging_05.rle \ + $(LOCAL_PATH)/chargemode/chargerimages/battery_charging_06.rle:root/chargerimages/battery_charging_06.rle \ + $(LOCAL_PATH)/chargemode/chargerimages/battery_wait_ani_01.rle:root/chargerimages/battery_wait_ani_01.rle \ + $(LOCAL_PATH)/chargemode/chargerimages/battery_wait_ani_02.rle:root/chargerimages/battery_wait_ani_02.rle \ + $(LOCAL_PATH)/chargemode/chargerimages/black_bg.rle:root/chargerimages/black_bg.rle \ + $(LOCAL_PATH)/chargemode/chargerlogo:root/sbin/chargerlogo +# P500 bluetooth vendor configuration +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/bluetooth/bt_vendor.conf:system/etc/bluetooth/bt_vendor.conf + # thunderc Audio #PRODUCT_PACKAGES += \ - # audio_policy.thunderc \ - # audio.primary.thunderc +# audio_policy.thunderc \ +# audio.primary.thunderc + +#P500_SPEAKER_IN_CALL_FIX +PRODUCT_COPY_FILES += $(LOCAL_PATH)/configs/audio_policy.conf:system/etc/audio_policy.conf # Live wallpapers PRODUCT_COPY_FILES += packages/wallpapers/LivePicker/android.software.live_wallpaper.xml:/system/etc/permissions/android.software.live_wallpaper.xml PRODUCT_PACKAGES += \ LiveWallpapers \ - Trebuchet \ LiveWallpapersPicker \ VisualizationWallpapers \ librs_jni # Full-featured build of the Open-Source -$(call inherit-product, build/target/product/full.mk) +#$(call inherit-product, build/target/product/full.mk) +$(call inherit-product, vendor/lge/thunderc/thunderc-vendor.mk) +$(call inherit-product, device/lge/msm7x27-common/device.mk) +$(call inherit-product, vendor/lge/msm7x27-common/msm7x27-common-vendor-blobs.mk) # Inherit languages -$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_small.mk) - +$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_small.mk) PRODUCT_NAME := thunderc PRODUCT_DEVICE := thunderc PRODUCT_MODEL := LG-LS670 +PRODUCT_MANUFACTURER := LGE + +PRODUCT_AAPT_PREF_CONFIG := mdpi +$(call inherit-product, device/mdpi-common/mdpi.mk) + +DEVICE_PACKAGE_OVERLAYS += device/lge/thunderc/overlay CDMA_GOOGLE_BASE := android-sprint-us CDMA_CARRIER_ALPHA := Sprint @@ -57,9 +100,8 @@ CDMA_CARRIER_NUMERIC := 310120 PRODUCT_PROPERTY_OVERRIDES += \ - ro.com.google.clientidbase=android-sprint-us \ - ro.com.google.locationfeatures=1 \ ro.cdma.home.operator.numeric=310120 \ + ro.com.google.clientidbase=android-sprint-us \ ro.cdma.home.operator.alpha=Sprint \ gsm.sim.operator.alpha = sprint \ gsm.sim.operator.numeric = 310120 \ diff --git a/ueventd.thunderc.rc b/ueventd.thunderc.rc index d58d92b..8b0dd6f 100644 --- a/ueventd.thunderc.rc +++ b/ueventd.thunderc.rc @@ -1,5 +1,5 @@ # the DIAG device node is world writable/readable. -/dev/diag 0666 root root +/dev/diag 0660 system qcom_diag # allow wpa_supplicant access to rfkill dev /dev/rfkill 0660 wifi wifi @@ -12,7 +12,8 @@ /dev/genlock 0666 system graphics # these should not be world writable -/dev/ttyHS0 0600 bluetooth bluetooth +#/dev/ttyHS0 0600 bluetooth bluetooth +/dev/ttyHS0 0660 bluetooth net_bt_stack /dev/graphics/* 0660 system graphics /dev/msm_rotator 0660 system graphics /dev/input/* 0660 system input @@ -94,7 +95,7 @@ /dev/msm_preproc_ctl 0660 system audio /dev/msm_a2dp_in 0640 system audio /dev/msm_amrnb_in 0640 system audio -/sys/devices/virtual/usb_composite/* enable 0664 root system +#/sys/devices/virtual/usb_composite/* enable 0664 root system # Non-root permission qmuxd (QCT solution 00481665) /dev/smd7 0640 radio radio