diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..110dd35 --- /dev/null +++ b/Android.mk @@ -0,0 +1,3 @@ +ifeq ($(TARGET_DEVICE),kyleprods) + include $(all-subdir-makefiles) +endif diff --git a/AndroidBoard.mk b/AndroidBoard.mk new file mode 100644 index 0000000..8c10f65 --- /dev/null +++ b/AndroidBoard.mk @@ -0,0 +1,8 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +ALL_PREBUILT += $(INSTALLED_KERNEL_TARGET) + +# include the non-open-source counterpart to this file +-include vendor/samsung/kylepro/AndroidBoardVendor.mk diff --git a/BoardConfig.mk b/BoardConfig.mk new file mode 100644 index 0000000..db63c63 --- /dev/null +++ b/BoardConfig.mk @@ -0,0 +1,200 @@ +USE_CAMERA_STUB := true + +# inherit from the proprietary version +-include vendor/samsung/kylepro/BoardConfigVendor.mk + +# Platform +TARGET_ARCH := arm +TARGET_NO_BOOTLOADER := true +TARGET_BOARD_PLATFORM := hawaii +TARGET_CPU_ABI := armeabi-v7a +TARGET_CPU_ABI2 := armeabi +TARGET_ARCH_VARIANT := armv7-a-neon +TARGET_CPU_VARIANT := cortex-a9 +TARGET_CPU_SMP := true +ARCH_ARM_HAVE_ARMV7A := true +ARCH_ARM_HAVE_VFP := true +ARCH_ARM_HAVE_TLS_REGISTER := true +ARCH_ARM_HAVE_NEON := true +TARGET_BOOTLOADER_BOARD_NAME := hawaii +TARGET_GLOBAL_CFLAGS += -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp +TARGET_GLOBAL_CPPFLAGS += -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp + +# Assert +TARGET_OTA_ASSERT_DEVICE := kylepro,S7580,GT-S7580,hawaii,kylexx + +# Kernel +BOARD_MKBOOTIMG_ARGS := --ramdisk_offset 0x01000000 --tags_offset 00000100 +BOARD_KERNEL_CMDLINE := +BOARD_KERNEL_BASE := 0x82000000 +BOARD_KERNEL_PAGESIZE := 4096 +BOARD_KERNEL_OFFSET := 0x00008000 +#TARGET_GCC_VERSION_EXP := 4.8 +TARGET_KERNEL_CONFIG := bcm21664_hawaii_ss_kylepro_rev00_cyanogenmod_defconfig +TARGET_KERNEL_SOURCE := kernel/samsung/kyleproxx +TARGET_KERNEL_CUSTOM_TOOLCHAIN := arm-eabi-4.6 + +# PARTITION SIZE +BOARD_BOOTIMAGE_PARTITION_SIZE := 8388608 +BOARD_RECOVERYIMAGE_PARTITION_SIZE := 9191424 #8388608 +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1210769408 +BOARD_USERDATAIMAGE_PARTITION_SIZE := 2373976064 +BOARD_CACHEIMAGE_PARTITION_SIZE := 209715200 +BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 +BOARD_FLASH_BLOCK_SIZE := 262144 # BOARD_KERNEL_PAGESIZE * 64 + +# Bluetooth +BOARD_HAVE_BLUETOOTH := true +BOARD_HAVE_BLUETOOTH_BCM := true +BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/samsung/kylepro/bluetooth +BOARD_BLUEDROID_VENDOR_CONF := device/samsung/kylepro/bluetooth/libbt_vndcfg_s7580.txt + +# Connectivity - Wi-Fi +BOARD_HAVE_SAMSUNG_WIFI := true +WPA_BUILD_SUPPLICANT := true +BOARD_WPA_SUPPLICANT_DRIVER := NL80211 +WPA_SUPPLICANT_VERSION := VER_0_8_X +BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_bcmdhd +BOARD_HOSTAPD_DRIVER := NL80211 +BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_bcmdhd +BOARD_WLAN_DEVICE := bcmdhd +BOARD_WLAN_DEVICE_REV := bcm4330_b1 +WIFI_DRIVER_FW_PATH_PARAM := "/sys/module/dhd/parameters/firmware_path" +WIFI_DRIVER_FW_PATH_STA := "/system/etc/wifi/bcmdhd_sta.bin" +WIFI_DRIVER_FW_PATH_AP := "/system/etc/wifi/bcmdhd_apsta.bin" +WIFI_DRIVER_MODULE_PATH := "/system/lib/modules/dhd.ko" +WIFI_DRIVER_MODULE_NAME := "dhd" +WIFI_DRIVER_MODULE_ARG := "firmware_path=/system/etc/wifi/bcmdhd_sta.bin nvram_path=/system/etc/wifi/nvram_net.txt" +WIFI_DRIVER_MODULE_AP_ARG := "firmware_path=/system/etc/wifi/bcmdhd_apsta.bin nvram_path=/system/etc/wifi/nvram_net.txt" +WIFI_BAND := 802_11_ABG + +# Resolution +TARGET_SCREEN_HEIGHT := 800 +TARGET_SCREEN_WIDTH := 480 + +# Hardware rendering +BOARD_EGL_CFG := device/samsung/kylepro/configs/egl.cfg +USE_OPENGL_RENDERER := true +BOARD_USE_MHEAP_SCREENSHOT := true +BOARD_EGL_WORKAROUND_BUG_10194508 := true +TARGET_USES_ION := true +HWUI_COMPILE_FOR_PERF := true +COMMON_GLOBAL_CFLAGS += -DNEEDS_VECTORIMPL_SYMBOLS -DHAWAII_HWC +#TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK := true + +# Camera +#BOARD_USE_METADATABUFFERTYPE := true +#BOARD_USE_STOREMETADATA := true + +# Include an expanded selection of fonts +EXTENDED_FONT_FOOTPRINT := true + +# Opengl +BOARD_USES_HWCOMPOSER := true +BOARD_USE_BGRA_8888 := true + +# Audio +BOARD_USES_ALSA_AUDIO := true + +# Enable dex-preoptimization to speed up the first boot sequence +# of an SDK AVD. Note that this operation only works on Linux for now +#ifeq ($(HOST_OS),linux) +# ifeq ($(WITH_DEXPREOPT),) +# WITH_DEXPREOPT := true +# endif +#endif + +# Bootanimation +TARGET_BOOTANIMATION_PRELOAD := true +TARGET_BOOTANIMATION_TEXTURE_CACHE := true + +# Charger +BOARD_BATTERY_DEVICE_NAME := battery +#BOARD_CHARGER_ENABLE_SUSPEND := true +BOARD_CHARGING_MODE_BOOTING_LPM := /sys/class/power_supply/battery/batt_lp_charging +CHARGING_ENABLED_PATH := "/sys/class/power_supply/battery/batt_lp_charging" +BACKLIGHT_PATH := "/sys/class/backlight/panel/brightness" + +# healthd +BOARD_HAL_STATIC_LIBRARIES := libhealthd-kylepro.hawaii + +# RIL +BOARD_RIL_CLASS := ../../../device/samsung/kylepro/ril/ + +# Recovery +#TARGET_RECOVERY_INITRC := +TARGET_RECOVERY_FSTAB := device/samsung/kylepro/ramdisk/fstab.hawaii_ss_kylepro +TARGET_USE_CUSTOM_LUN_FILE_PATH := "/sys/class/android_usb/android0/f_mass_storage/lun%d/file" +BOARD_HAS_NO_SELECT_BUTTON := true +BOARD_HAS_LARGE_FILESYSTEM := true +TARGET_USERIMAGES_USE_EXT4 := true +TARGET_RECOVERY_PIXEL_FORMAT := BGRA_8888 +BOARD_HAS_NO_MISC_PARTITION := true +BOARD_RECOVERY_HANDLES_MOUNT := true +BOARD_USES_MMCUTILS := true +BOARD_HAS_DOWNLOAD_MODE := true +BOARD_USE_USB_MASS_STORAGE_SWITCH := true +BOARD_SUPPRESS_EMMC_WIPE := true +TARGET_RECOVERY_DENSITY := hdpi + +# TWRP +#TARGET_RECOVERY_FSTAB := device/samsung/kylepro/ramdisk/twrp.fstab.hawaii_ss_kylepro +DEVICE_RESOLUTION := 480x800 +TW_MAX_BRIGHTNESS := 255 +TW_CUSTOM_BATTERY_PATH := /sys/class/power_supply/battery +TW_BRIGHTNESS_PATH := /sys/class/backlight/panel/brightness +RECOVERY_SDCARD_ON_DATA := true +TW_NO_REBOOT_BOOTLOADER := true +RECOVERY_GRAPHICS_USE_LINELENGTH := true +TW_INTERNAL_STORAGE_PATH := /data/media +TW_INTERNAL_STORAGE_MOUNT_POINT := data +TW_EXTERNAL_STORAGE_PATH := /external_sd +TW_EXTERNAL_STORAGE_MOUNT_POINT := external_sd +TW_DEFAULT_EXTERNAL_STORAGE := true +TW_EXCLUDE_SUPERSU := true +BOARD_HAS_NO_REAL_SDCARD := true +HAVE_SELINUX := true + +# Vold +BOARD_UMS_LUNFILE := /sys/class/android_usb/f_mass_storage/lun0/file +TARGET_USE_CUSTOM_LUN_FILE_PATH := /sys/class/android_usb/android0/f_mass_storage/lun/file +BOARD_VOLD_EMMC_SHARES_DEV_MAJOR := true +BOARD_VOLD_MAX_PARTITIONS := 19 + +# MTP +BOARD_MTP_DEVICE := /dev/mtp_usb + +# CMHW +BOARD_HARDWARE_CLASS := hardware/samsung/cmhw/ device/samsung/kylepro/cmhw/ + +# GPS +TARGET_SPECIFIC_HEADER_PATH := device/samsung/kylepro/include + +# Compat +TARGET_USES_LOGD := false + +# jemalloc causes a lot of random crash on free() +MALLOC_IMPL := dlmalloc + +BOARD_SEPOLICY_DIRS += \ + device/samsung/kylepro/sepolicy + +BOARD_SEPOLICY_UNION += \ + file_contexts \ + property_contexts \ + service_contexts \ + bkmgrd.te \ + device.te \ + surfaceflinger.te \ + bluetooth.te \ + geomagneticd.te \ + gpsd.te \ + init.te \ + immvibed.te \ + kernel.te \ + macloader.te \ + rild.te \ + shell.te \ + system_server.te \ + tvserver.te \ + vclmk.te \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..1f38517 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# This is device tree for GT-S7580 (Kylepro), build based on GT-S7270 device tree by Zim555 + +### Other source: +* Kernel: https://github.com/SandPox/android_kernel_samsung_kyleproxx +* Vendor: https://github.com/SandPox/android_vendor_samsung_kyleproxx + +Thanks to Zim555 for all his helps :) + +# [UNDERDEVELOPMENT] \ No newline at end of file diff --git a/bluetooth/bdroid_buildcfg.h b/bluetooth/bdroid_buildcfg.h new file mode 100644 index 0000000..f5e3ccc --- /dev/null +++ b/bluetooth/bdroid_buildcfg.h @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _BDROID_BUILDCFG_H +#define _BDROID_BUILDCFG_H + +#define BTM_DEF_LOCAL_NAME "GT-S7580" + +#endif diff --git a/bluetooth/libbt_vndcfg_s7580.txt b/bluetooth/libbt_vndcfg_s7580.txt new file mode 100644 index 0000000..cf01eb7 --- /dev/null +++ b/bluetooth/libbt_vndcfg_s7580.txt @@ -0,0 +1,14 @@ +BLUETOOTH_UART_DEVICE_PORT = "/dev/ttyS0" +FW_PATCHFILE_LOCATION = "/system/bin/" +BT_WAKE_VIA_USERIAL_IOCTL = TRUE +LPM_BT_WAKE_POLARITY = 0 +LPM_HOST_WAKE_POLARITY = 0 +LPM_IDLE_TIMEOUT_MULTIPLE = 5 +BTVND_DBG = FALSE +BTHW_DBG = TRUE +VNDUSERIAL_DBG = FALSE +UPIO_DBG = FALSE +FW_PATCH_SETTLEMENT_DELAY_MS = 50 +SCO_PCM_IF_CLOCK_RATE = 0 +PCM_DATA_FMT_FILL_METHOD = 0 +PCM_DATA_FMT_FILL_NUM = 0 diff --git a/cm.dependencies b/cm.dependencies new file mode 100644 index 0000000..920bdb8 --- /dev/null +++ b/cm.dependencies @@ -0,0 +1,10 @@ +[ + { + "repository": "android_packages_apps_SamsungServiceMode", + "target_path": "packages/apps/SamsungServiceMode" + }, + { + "repository": "android_hardware_samsung", + "target_path": "hardware/samsung" + } +] \ No newline at end of file diff --git a/cm.mk b/cm.mk new file mode 100644 index 0000000..a9dc9db --- /dev/null +++ b/cm.mk @@ -0,0 +1,16 @@ +# Release name +PRODUCT_RELEASE_NAME := GT-S7580 + +# Inherit some common CM stuff. +$(call inherit-product, vendor/cm/config/common_full_phone.mk) + +# Inherit device configuration +$(call inherit-product, device/samsung/kylepro/device_kylepro.mk) + +## Device identifier. This must come after all inclusions +PRODUCT_DEVICE := kylepro +PRODUCT_NAME := cm_kylepro +PRODUCT_BRAND := samsung +PRODUCT_MANUFACTURER := samsung +PRODUCT_MODEL := GT-S7580 +PRODUCT_CHARACTERISTICS := phone diff --git a/cmhw/org/cyanogenmod/hardware/SerialNumber.java b/cmhw/org/cyanogenmod/hardware/SerialNumber.java new file mode 100644 index 0000000..9a769ab --- /dev/null +++ b/cmhw/org/cyanogenmod/hardware/SerialNumber.java @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2014 The CyanogenMod Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.cyanogenmod.hardware; + +import android.os.SystemProperties; + +/** + * Support for displaying a different serial number in Settings -> About Phone + * than ro.serialno, which may be different than the actual serial number + * sticker on the hardware. + */ +public class SerialNumber { + + /** + * Whether device requires an alternative serial number. + * + * @return boolean Supported devices must return always true + */ + public static boolean isSupported() { return true; } + + /** + * Returns the alternative serial number to be displayed. + */ + public static String getSerialNumber() { + return SystemProperties.get("ril.serialnumber"); + } + +} diff --git a/configs/audio_policy.conf b/configs/audio_policy.conf new file mode 100644 index 0000000..7296dd5 --- /dev/null +++ b/configs/audio_policy.conf @@ -0,0 +1,95 @@ +# +# Audio policy configuration for generic device builds (goldfish audio HAL - emulator) +# + +# 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_DEVICE_IN_BACK_MIC|AUDIO_DEVICE_IN_VOICE_CALL +} + +# 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". + +# IMPORTATANT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# If your output device support 16000hz sample rate, please do NOT list 16000 first, because I use +# first_supported_sample_rate==16000 as VoIP out +# I also use input device that support AUDIO_DEVICE_IN_VOICE_CALL as VoIP input indicator, otherwise I +# need to modify AudioPolicyManagerBase to add enum strings or rewrite Audio Policy Configuration +# loading function to add more enum strings. +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +audio_hw_modules { + primary { + outputs { + primary { + sampling_rates 48000 + 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_ANLG_DOCK_HEADSET + flags AUDIO_OUTPUT_FLAG_PRIMARY + } + voip { + sampling_rates 16000|48000 + 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 + } + } + inputs { + primary { + sampling_rates 8000|11025|16000|22050|24000|32000|44100|48000 + 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|AUDIO_DEVICE_IN_BACK_MIC|AUDIO_DEVICE_IN_FM|AUDIO_DEVICE_IN_VOICE_CALL + } + voip { + sampling_rates 8000|11025|16000|22050|24000|32000|44100|48000 + 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|AUDIO_DEVICE_IN_VOICE_CALL + } + } + } + a2dp { + outputs { + a2dp { + sampling_rates 44100 + channel_masks AUDIO_CHANNEL_OUT_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_OUT_ALL_A2DP + } + } + } + r_submix { + outputs { + submix { + sampling_rates 44100|48000 + channel_masks AUDIO_CHANNEL_OUT_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_OUT_REMOTE_SUBMIX + } + } + inputs { + submix { + sampling_rates 44100|48000 + channel_masks AUDIO_CHANNEL_IN_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_IN_REMOTE_SUBMIX + } + } + } + } +} diff --git a/configs/egl.cfg b/configs/egl.cfg new file mode 100644 index 0000000..7e9da07 --- /dev/null +++ b/configs/egl.cfg @@ -0,0 +1,2 @@ +0 0 android +0 1 hawaii diff --git a/configs/media_codecs.xml b/configs/media_codecs.xml new file mode 100644 index 0000000..ed39048 --- /dev/null +++ b/configs/media_codecs.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/configs/media_profiles.xml b/configs/media_profiles.xml new file mode 100644 index 0000000..5f5c7ac --- /dev/null +++ b/configs/media_profiles.xml @@ -0,0 +1,529 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/device_kylepro.mk b/device_kylepro.mk new file mode 100644 index 0000000..b45438d --- /dev/null +++ b/device_kylepro.mk @@ -0,0 +1,157 @@ +$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk) + +$(call inherit-product-if-exists, vendor/samsung/kylepro/kylepro-common-vendor.mk) + +# Use high-density artwork where available +PRODUCT_LOCALES += hdpi +PRODUCT_AAPT_CONFIG := normal +PRODUCT_AAPT_PREF_CONFIG := hdpi + +DEVICE_PACKAGE_OVERLAYS += device/samsung/kylepro/overlay + +# Init files +PRODUCT_COPY_FILES += \ + device/samsung/kylepro/ramdisk/fstab.hawaii_ss_kylepro:root/fstab.hawaii_ss_kylepro \ + device/samsung/kylepro/ramdisk/init.rc:root/init.rc \ + device/samsung/kylepro/ramdisk/init.hawaii_ss_kylepro.rc:root/init.hawaii_ss_kylepro.rc \ + device/samsung/kylepro/ramdisk/init.bcm2166x.usb.rc:root/init.bcm2166x.usb.rc \ + device/samsung/kylepro/ramdisk/init.log.rc:root/init.log.rc \ + device/samsung/kylepro/ramdisk/charger:root/charger \ + device/samsung/kylepro/ramdisk/ueventd.hawaii_ss_kylepro.rc:root/ueventd.hawaii_ss_kylepro.rc + +PRODUCT_COPY_FILES += \ + device/samsung/kylepro/configs/media_profiles.xml:system/etc/media_profiles.xml \ + device/samsung/kylepro/configs/audio_policy.conf:system/etc/audio_policy.conf \ + frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:system/etc/media_codecs_google_audio.xml \ + frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:system/etc/media_codecs_google_telephony.xml \ + frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:system/etc/media_codecs_google_video.xml \ + device/samsung/kylepro/configs/media_codecs.xml:system/etc/media_codecs.xml + +# Prebuilt kl keymaps +PRODUCT_COPY_FILES += \ + device/samsung/kylepro/keylayouts/bcm_headset.kl:system/usr/keylayout/bcm_headset.kl \ + device/samsung/kylepro/keylayouts/bcm_keypad_v2.kl:system/usr/keylayout/bcm_keypad_v2.kl \ + device/samsung/kylepro/keylayouts/gpio-keys.kl:system/usr/keylayout/gpio-keys.kl \ + device/samsung/kylepro/keylayouts/samsung-keypad.kl:system/usr/keylayout/samsung-keypad.kl + +# Copy Apps +#PRODUCT_COPY_FILES += \ +# device/samsung/kylepro/apk/Effem.apk:system/app/Effem.apk + +# Charger +PRODUCT_PACKAGES += \ + charger_res_images + +# Insecure ADBD +ADDITIONAL_DEFAULT_PROPERTIES += \ + ro.adb.secure=0 \ + persist.service.adb.enable=0 + +# Filesystem management tools +PRODUCT_PACKAGES += \ + make_ext4fs \ + e2fsck \ + setup_fs + +# Usb accessory +PRODUCT_PACKAGES += \ + com.android.future.usb.accessory + +# Misc other modules +PRODUCT_PACKAGES += \ + audio.a2dp.default \ + audio.usb.default \ + audio.r_submix.default \ + audio.primary.default \ + +# Device-specific packages +PRODUCT_PACKAGES += \ + SamsungServiceMode + +# KSM +PRODUCT_PROPERTY_OVERRIDES += \ + ro.ksm.default=1 + +# Wi-Fi +PRODUCT_PACKAGES += \ + dhcpcd.conf \ + hostapd \ + wpa_supplicant \ + wpa_supplicant.conf + +# These are the hardware-specific features +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/handheld_core_hardware.xml:system/etc/permissions/handheld_core_hardware.xml \ + frameworks/native/data/etc/android.hardware.bluetooth_le.xml:system/etc/permissions/android.hardware.bluetooth_le.xml \ + frameworks/native/data/etc/android.hardware.camera.front.xml:system/etc/permissions/android.hardware.camera.front.xml \ + frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:system/etc/permissions/android.hardware.camera.flash-autofocus.xml \ + frameworks/native/data/etc/android.hardware.telephony.gsm.xml:system/etc/permissions/android.hardware.telephony.gsm.xml \ + frameworks/native/data/etc/android.hardware.location.xml:system/etc/permissions/android.hardware.location.xml \ + frameworks/native/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml \ + frameworks/native/data/etc/android.hardware.ethernet.xml:system/etc/permissions/android.hardware.ethernet.xml \ + frameworks/native/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml \ + frameworks/native/data/etc/android.hardware.wifi.direct.xml:system/etc/permissions/android.hardware.wifi.direct.xml \ + frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:system/etc/permissions/android.hardware.sensor.accelerometer.xml \ + frameworks/native/data/etc/android.hardware.sensor.compass.xml:system/etc/permissions/android.hardware.sensor.compass.xml \ + frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:system/etc/permissions/android.hardware.sensor.gyroscope.xml \ + frameworks/native/data/etc/android.hardware.sensor.light.xml:system/etc/permissions/android.hardware.sensor.light.xml \ + frameworks/native/data/etc/android.hardware.sensor.proximity.xml:system/etc/permissions/android.hardware.sensor.proximity.xml \ + frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \ + frameworks/native/data/etc/android.software.sip.voip.xml:system/etc/permissions/android.software.sip.voip.xml \ + frameworks/native/data/etc/android.hardware.usb.accessory.xml:system/etc/permissions/android.hardware.usb.accessory.xml \ + frameworks/native/data/etc/android.hardware.usb.host.xml:system/etc/permissions/android.hardware.usb.host.xml + +# These are the hardware-specific settings that are stored in system properties. +# Note that the only such settings should be the ones that are too low-level to +# be reachable from resources or other mechanisms. +PRODUCT_PROPERTY_OVERRIDES += \ + wifi.interface=wlan0 \ + mobiledata.interfaces=rmnet0 \ + ro.telephony.ril_class=SamsungBCMRIL \ + persist.radio.multisim.config=none \ + cm.updater.uri=http://get.ace3.tk \ + ro.telephony.call_ring.multiple=0 \ + camera2.portability.force_api=1 \ + ro.telephony.call_ring=0 + +# enable Google-specific location features, +# like NetworkLocationProvider and LocationCollector +#PRODUCT_PROPERTY_OVERRIDES += \ +# ro.com.google.locationfeatures=1 \ +# ro.com.google.networklocation=1 + +# Extended JNI checks +# The extended JNI checks will cause the system to run more slowly, but they can spot a variety of nasty bugs +# before they have a chance to cause problems. +# Default=true for development builds, set by android buildsystem. +#PRODUCT_PROPERTY_OVERRIDES += \ +# ro.kernel.android.checkjni=0 \ +# dalvik.vm.checkjni=false + +# MTP +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ + persist.sys.usb.config=mtp + +# Override phone-hdpi-512-dalvik-heap to match value on stock +# - helps pass CTS com.squareup.okhttp.internal.spdy.Spdy3Test#tooLargeDataFrame) +# (property override must come before included property) +#PRODUCT_PROPERTY_OVERRIDES += \ +# dalvik.vm.heapgrowthlimit=56m + +# Dalvik heap config +include frameworks/native/build/phone-hdpi-512-dalvik-heap.mk + +# we have enough storage space to hold precise GC data +#PRODUCT_TAGS += dalvik.gc.type-precise + +$(call inherit-product, hardware/broadcom/wlan/bcmdhd/config/config-bcm.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) + +ifeq ($(TARGET_BUILD_VARIANT),user) +else +endif + +PRODUCT_BUILD_PROP_OVERRIDES += BUILD_UTC_DATE=0 +PRODUCT_NAME := full_kylepro +PRODUCT_DEVICE := kylepro +PRODUCT_MODEL := GT-S7580 diff --git a/health/Android.mk b/health/Android.mk new file mode 100644 index 0000000..134841f --- /dev/null +++ b/health/Android.mk @@ -0,0 +1,22 @@ +# Copyright (C) 2013 The Android Open Source Project +# Copyright (C) 2013 The CyanogenMod Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_SRC_FILES := healthd-hawaii.cpp +LOCAL_MODULE := libhealthd-kylepro.hawaii +LOCAL_C_INCLUDES := system/core/healthd +include $(BUILD_STATIC_LIBRARY) diff --git a/health/healthd-hawaii.cpp b/health/healthd-hawaii.cpp new file mode 100644 index 0000000..c66ec2c --- /dev/null +++ b/health/healthd-hawaii.cpp @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * Copyright (C) 2013 The CyanogenMod Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +void +healthd_board_init(struct healthd_config *config) +{ + // battery needs to be used instead of bcm59056_charger + config->batteryStatusPath = "/sys/class/power_supply/battery/status"; + config->batteryHealthPath = "/sys/class/power_supply/battery/health"; + config->batteryPresentPath = "/sys/class/power_supply/battery/present"; + config->batteryCapacityPath = "/sys/class/power_supply/battery/capacity"; + config->batteryVoltagePath = "/sys/class/power_supply/battery/voltage_now"; + config->batteryTemperaturePath = "/sys/class/power_supply/battery/temp"; + config->batteryTechnologyPath = "/sys/class/power_supply/battery/technology"; +} + +int +healthd_board_battery_update(struct android::BatteryProperties *props) +{ + // don't log to kernel + return 1; +} \ No newline at end of file diff --git a/include/hardware/gps.h b/include/hardware/gps.h new file mode 100644 index 0000000..edf7c7b --- /dev/null +++ b/include/hardware/gps.h @@ -0,0 +1,1826 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_INCLUDE_HARDWARE_GPS_H +#define ANDROID_INCLUDE_HARDWARE_GPS_H + +#include +#include +#include +#include +#include +#include + +#include + +__BEGIN_DECLS + +/** + * The id of this module + */ +#define GPS_HARDWARE_MODULE_ID "gps" + + +/** Milliseconds since January 1, 1970 */ +typedef int64_t GpsUtcTime; + +/** Maximum number of SVs for gps_sv_status_callback(). */ +#define GPS_MAX_SVS 32 + +/** Maximum number of Measurements in gps_measurement_callback(). */ +#define GPS_MAX_MEASUREMENT 32 + +/** Requested operational mode for GPS operation. */ +typedef uint32_t GpsPositionMode; +// IMPORTANT: Note that the following values must match +// constants in GpsLocationProvider.java. +/** Mode for running GPS standalone (no assistance). */ +#define GPS_POSITION_MODE_STANDALONE 0 +/** AGPS MS-Based mode. */ +#define GPS_POSITION_MODE_MS_BASED 1 +/** AGPS MS-Assisted mode. */ +#define GPS_POSITION_MODE_MS_ASSISTED 2 + +/** Requested recurrence mode for GPS operation. */ +typedef uint32_t GpsPositionRecurrence; +// IMPORTANT: Note that the following values must match +// constants in GpsLocationProvider.java. +/** Receive GPS fixes on a recurring basis at a specified period. */ +#define GPS_POSITION_RECURRENCE_PERIODIC 0 +/** Request a single shot GPS fix. */ +#define GPS_POSITION_RECURRENCE_SINGLE 1 + +/** GPS status event values. */ +typedef uint16_t GpsStatusValue; +// IMPORTANT: Note that the following values must match +// constants in GpsLocationProvider.java. +/** GPS status unknown. */ +#define GPS_STATUS_NONE 0 +/** GPS has begun navigating. */ +#define GPS_STATUS_SESSION_BEGIN 1 +/** GPS has stopped navigating. */ +#define GPS_STATUS_SESSION_END 2 +/** GPS has powered on but is not navigating. */ +#define GPS_STATUS_ENGINE_ON 3 +/** GPS is powered off. */ +#define GPS_STATUS_ENGINE_OFF 4 + +/** Flags to indicate which values are valid in a GpsLocation. */ +typedef uint16_t GpsLocationFlags; +// IMPORTANT: Note that the following values must match +// constants in GpsLocationProvider.java. +/** GpsLocation has valid latitude and longitude. */ +#define GPS_LOCATION_HAS_LAT_LONG 0x0001 +/** GpsLocation has valid altitude. */ +#define GPS_LOCATION_HAS_ALTITUDE 0x0002 +/** GpsLocation has valid speed. */ +#define GPS_LOCATION_HAS_SPEED 0x0004 +/** GpsLocation has valid bearing. */ +#define GPS_LOCATION_HAS_BEARING 0x0008 +/** GpsLocation has valid accuracy. */ +#define GPS_LOCATION_HAS_ACCURACY 0x0010 + +/** Flags for the gps_set_capabilities callback. */ + +/** GPS HAL schedules fixes for GPS_POSITION_RECURRENCE_PERIODIC mode. + If this is not set, then the framework will use 1000ms for min_interval + and will start and call start() and stop() to schedule the GPS. + */ +#define GPS_CAPABILITY_SCHEDULING 0x0000001 +/** GPS supports MS-Based AGPS mode */ +#define GPS_CAPABILITY_MSB 0x0000002 +/** GPS supports MS-Assisted AGPS mode */ +#define GPS_CAPABILITY_MSA 0x0000004 +/** GPS supports single-shot fixes */ +#define GPS_CAPABILITY_SINGLE_SHOT 0x0000008 +/** GPS supports on demand time injection */ +#define GPS_CAPABILITY_ON_DEMAND_TIME 0x0000010 +/** GPS supports Geofencing */ +#define GPS_CAPABILITY_GEOFENCING 0x0000020 +/** GPS supports Measurements */ +#define GPS_CAPABILITY_MEASUREMENTS 0x0000040 +/** GPS supports Navigation Messages */ +#define GPS_CAPABILITY_NAV_MESSAGES 0x0000080 + +/** Flags used to specify which aiding data to delete + when calling delete_aiding_data(). */ +typedef uint16_t GpsAidingData; +// IMPORTANT: Note that the following values must match +// constants in GpsLocationProvider.java. +#define GPS_DELETE_EPHEMERIS 0x0001 +#define GPS_DELETE_ALMANAC 0x0002 +#define GPS_DELETE_POSITION 0x0004 +#define GPS_DELETE_TIME 0x0008 +#define GPS_DELETE_IONO 0x0010 +#define GPS_DELETE_UTC 0x0020 +#define GPS_DELETE_HEALTH 0x0040 +#define GPS_DELETE_SVDIR 0x0080 +#define GPS_DELETE_SVSTEER 0x0100 +#define GPS_DELETE_SADATA 0x0200 +#define GPS_DELETE_RTI 0x0400 +#define GPS_DELETE_CELLDB_INFO 0x8000 +#define GPS_DELETE_ALL 0xFFFF + +/** AGPS type */ +typedef uint16_t AGpsType; +#define AGPS_TYPE_SUPL 1 +#define AGPS_TYPE_C2K 2 + +typedef uint16_t AGpsSetIDType; +#define AGPS_SETID_TYPE_NONE 0 +#define AGPS_SETID_TYPE_IMSI 1 +#define AGPS_SETID_TYPE_MSISDN 2 + +typedef uint16_t ApnIpType; +#define APN_IP_INVALID 0 +#define APN_IP_IPV4 1 +#define APN_IP_IPV6 2 +#define APN_IP_IPV4V6 3 + +/** + * String length constants + */ +#define GPS_NI_SHORT_STRING_MAXLEN 256 +#define GPS_NI_LONG_STRING_MAXLEN 2048 + +/** + * GpsNiType constants + */ +typedef uint32_t GpsNiType; +#define GPS_NI_TYPE_VOICE 1 +#define GPS_NI_TYPE_UMTS_SUPL 2 +#define GPS_NI_TYPE_UMTS_CTRL_PLANE 3 + +/** + * GpsNiNotifyFlags constants + */ +typedef uint32_t GpsNiNotifyFlags; +/** NI requires notification */ +#define GPS_NI_NEED_NOTIFY 0x0001 +/** NI requires verification */ +#define GPS_NI_NEED_VERIFY 0x0002 +/** NI requires privacy override, no notification/minimal trace */ +#define GPS_NI_PRIVACY_OVERRIDE 0x0004 + +/** + * GPS NI responses, used to define the response in + * NI structures + */ +typedef int GpsUserResponseType; +#define GPS_NI_RESPONSE_ACCEPT 1 +#define GPS_NI_RESPONSE_DENY 2 +#define GPS_NI_RESPONSE_NORESP 3 + +/** + * NI data encoding scheme + */ +typedef int GpsNiEncodingType; +#define GPS_ENC_NONE 0 +#define GPS_ENC_SUPL_GSM_DEFAULT 1 +#define GPS_ENC_SUPL_UTF8 2 +#define GPS_ENC_SUPL_UCS2 3 +#define GPS_ENC_UNKNOWN -1 + +/** AGPS status event values. */ +typedef uint16_t AGpsStatusValue; +/** GPS requests data connection for AGPS. */ +#define GPS_REQUEST_AGPS_DATA_CONN 1 +/** GPS releases the AGPS data connection. */ +#define GPS_RELEASE_AGPS_DATA_CONN 2 +/** AGPS data connection initiated */ +#define GPS_AGPS_DATA_CONNECTED 3 +/** AGPS data connection completed */ +#define GPS_AGPS_DATA_CONN_DONE 4 +/** AGPS data connection failed */ +#define GPS_AGPS_DATA_CONN_FAILED 5 + +#define AGPS_REF_LOCATION_TYPE_GSM_CELLID 1 +#define AGPS_REF_LOCATION_TYPE_UMTS_CELLID 2 +#define AGPS_REG_LOCATION_TYPE_MAC 3 + +/** Network types for update_network_state "type" parameter */ +#define AGPS_RIL_NETWORK_TYPE_MOBILE 0 +#define AGPS_RIL_NETWORK_TYPE_WIFI 1 +#define AGPS_RIL_NETWORK_TYPE_MOBILE_MMS 2 +#define AGPS_RIL_NETWORK_TYPE_MOBILE_SUPL 3 +#define AGPS_RIL_NETWORK_TTYPE_MOBILE_DUN 4 +#define AGPS_RIL_NETWORK_TTYPE_MOBILE_HIPRI 5 +#define AGPS_RIL_NETWORK_TTYPE_WIMAX 6 + +/** + * Flags to indicate what fields in GpsClock are valid. + */ +typedef uint16_t GpsClockFlags; +/** A valid 'leap second' is stored in the data structure. */ +#define GPS_CLOCK_HAS_LEAP_SECOND (1<<0) +/** A valid 'time uncertainty' is stored in the data structure. */ +#define GPS_CLOCK_HAS_TIME_UNCERTAINTY (1<<1) +/** A valid 'full bias' is stored in the data structure. */ +#define GPS_CLOCK_HAS_FULL_BIAS (1<<2) +/** A valid 'bias' is stored in the data structure. */ +#define GPS_CLOCK_HAS_BIAS (1<<3) +/** A valid 'bias uncertainty' is stored in the data structure. */ +#define GPS_CLOCK_HAS_BIAS_UNCERTAINTY (1<<4) +/** A valid 'drift' is stored in the data structure. */ +#define GPS_CLOCK_HAS_DRIFT (1<<5) +/** A valid 'drift uncertainty' is stored in the data structure. */ +#define GPS_CLOCK_HAS_DRIFT_UNCERTAINTY (1<<6) + +/** + * Enumeration of the available values for the GPS Clock type. + */ +typedef uint8_t GpsClockType; +/** The type is not available ot it is unknown. */ +#define GPS_CLOCK_TYPE_UNKNOWN 0 +/** The source of the time value reported by GPS clock is the local hardware clock. */ +#define GPS_CLOCK_TYPE_LOCAL_HW_TIME 1 +/** + * The source of the time value reported by GPS clock is the GPS time derived from satellites + * (epoch = Jan 6, 1980) + */ +#define GPS_CLOCK_TYPE_GPS_TIME 2 + +/** + * Flags to indicate what fields in GpsMeasurement are valid. + */ +typedef uint32_t GpsMeasurementFlags; +/** A valid 'snr' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_SNR (1<<0) +/** A valid 'elevation' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_ELEVATION (1<<1) +/** A valid 'elevation uncertainty' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_ELEVATION_UNCERTAINTY (1<<2) +/** A valid 'azimuth' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_AZIMUTH (1<<3) +/** A valid 'azimuth uncertainty' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_AZIMUTH_UNCERTAINTY (1<<4) +/** A valid 'pseudorange' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_PSEUDORANGE (1<<5) +/** A valid 'pseudorange uncertainty' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_PSEUDORANGE_UNCERTAINTY (1<<6) +/** A valid 'code phase' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_CODE_PHASE (1<<7) +/** A valid 'code phase uncertainty' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_CODE_PHASE_UNCERTAINTY (1<<8) +/** A valid 'carrier frequency' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_CARRIER_FREQUENCY (1<<9) +/** A valid 'carrier cycles' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_CARRIER_CYCLES (1<<10) +/** A valid 'carrier phase' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_CARRIER_PHASE (1<<11) +/** A valid 'carrier phase uncertainty' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY (1<<12) +/** A valid 'bit number' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_BIT_NUMBER (1<<13) +/** A valid 'time from last bit' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_TIME_FROM_LAST_BIT (1<<14) +/** A valid 'doppler shift' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_DOPPLER_SHIFT (1<<15) +/** A valid 'doppler shift uncertainty' is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_DOPPLER_SHIFT_UNCERTAINTY (1<<16) +/** A valid 'used in fix' flag is stored in the data structure. */ +#define GPS_MEASUREMENT_HAS_USED_IN_FIX (1<<17) + +/** + * Enumeration of the available values for the GPS Measurement's loss of lock. + */ +typedef uint8_t GpsLossOfLock; +/** The indicator is not available or it is unknown. */ +#define GPS_LOSS_OF_LOCK_UNKNOWN 0 +/** The measurement does not present any indication of loss of lock. */ +#define GPS_LOSS_OF_LOCK_OK 1 +/** Loss of lock between previous and current observation: cycle slip possible. */ +#define GPS_LOSS_OF_LOCK_CYCLE_SLIP 2 + +/** + * Enumeration of available values for the GPS Measurement's multipath indicator. + */ +typedef uint8_t GpsMultipathIndicator; +/** The indicator is not available or unknown. */ +#define GPS_MULTIPATH_INDICATOR_UNKNOWN 0 +/** The measurement has been indicated to use multipath. */ +#define GPS_MULTIPATH_INDICATOR_DETECTED 1 +/** The measurement has been indicated Not to use multipath. */ +#define GPS_MULTIPATH_INDICATOR_NOT_USED 2 + +/** + * Flags indicating the GPS measurement state. + * The expected behavior here is for GPS HAL to set all the flags that applies. For + * example, if the state for a satellite is only C/A code locked and bit synchronized, + * and there is still millisecond ambiguity, the state should be set as: + * GPS_MEASUREMENT_STATE_CODE_LOCK|GPS_MEASUREMENT_STATE_BIT_SYNC|GPS_MEASUREMENT_STATE_MSEC_AMBIGUOUS + * If GPS is still searching for a satellite, the corresponding state should be set to + * GPS_MEASUREMENT_STATE_UNKNOWN(0). + */ +typedef uint16_t GpsMeasurementState; +#define GPS_MEASUREMENT_STATE_UNKNOWN 0 +#define GPS_MEASUREMENT_STATE_CODE_LOCK (1<<0) +#define GPS_MEASUREMENT_STATE_BIT_SYNC (1<<1) +#define GPS_MEASUREMENT_STATE_SUBFRAME_SYNC (1<<2) +#define GPS_MEASUREMENT_STATE_TOW_DECODED (1<<3) +#define GPS_MEASUREMENT_STATE_MSEC_AMBIGUOUS (1<<4) + +/** + * Flags indicating the Accumulated Delta Range's states. + */ +typedef uint16_t GpsAccumulatedDeltaRangeState; +#define GPS_ADR_STATE_UNKNOWN 0 +#define GPS_ADR_STATE_VALID (1<<0) +#define GPS_ADR_STATE_RESET (1<<1) +#define GPS_ADR_STATE_CYCLE_SLIP (1<<2) + +/** + * Enumeration of available values to indicate the available GPS Navigation message types. + */ +typedef uint8_t GpsNavigationMessageType; +/** The message type is unknown. */ +#define GPS_NAVIGATION_MESSAGE_TYPE_UNKNOWN 0 +/** L1 C/A message contained in the structure. */ +#define GPS_NAVIGATION_MESSAGE_TYPE_L1CA 1 +/** L2-CNAV message contained in the structure. */ +#define GPS_NAVIGATION_MESSAGE_TYPE_L2CNAV 2 +/** L5-CNAV message contained in the structure. */ +#define GPS_NAVIGATION_MESSAGE_TYPE_L5CNAV 3 +/** CNAV-2 message contained in the structure. */ +#define GPS_NAVIGATION_MESSAGE_TYPE_CNAV2 4 + +/** + * Status of Navigation Message + * When a message is received properly without any parity error in its navigation words, the + * status should be set to NAV_MESSAGE_STATUS_PARITY_PASSED. But if a message is received + * with words that failed parity check, but GPS is able to correct those words, the status + * should be set to NAV_MESSAGE_STATUS_PARITY_REBUILT. + * No need to send any navigation message that contains words with parity error and cannot be + * corrected. + */ +typedef uint16_t NavigationMessageStatus; +#define NAV_MESSAGE_STATUS_UNKONW 0 +#define NAV_MESSAGE_STATUS_PARITY_PASSED (1<<0) +#define NAV_MESSAGE_STATUS_PARITY_REBUILT (1<<1) + +/** + * Name for the GPS XTRA interface. + */ +#define GPS_XTRA_INTERFACE "gps-xtra" + +/** + * Name for the GPS DEBUG interface. + */ +#define GPS_DEBUG_INTERFACE "gps-debug" + +/** + * Name for the AGPS interface. + */ +#define AGPS_INTERFACE "agps" + +/** + * Name of the Supl Certificate interface. + */ +#define SUPL_CERTIFICATE_INTERFACE "supl-certificate" + +/** + * Name for NI interface + */ +#define GPS_NI_INTERFACE "gps-ni" + +/** + * Name for the AGPS-RIL interface. + */ +#define AGPS_RIL_INTERFACE "agps_ril" + +/** + * Name for the GPS_Geofencing interface. + */ +#define GPS_GEOFENCING_INTERFACE "gps_geofencing" + +/** + * Name of the GPS Measurements interface. + */ +#define GPS_MEASUREMENT_INTERFACE "gps_measurement" + +/** + * Name of the GPS navigation message interface. + */ +#define GPS_NAVIGATION_MESSAGE_INTERFACE "gps_navigation_message" + +/** + * Name of the GNSS/GPS configuration interface. + */ +#define GNSS_CONFIGURATION_INTERFACE "gnss_configuration" + + +/** Represents a location. */ +typedef struct { + /** set to sizeof(GpsLocation) */ + size_t size; + /** Contains GpsLocationFlags bits. */ + uint16_t flags; + /** Represents latitude in degrees. */ + double latitude; + /** Represents longitude in degrees. */ + double longitude; + /** Represents altitude in meters above the WGS 84 reference + * ellipsoid. */ + double altitude; + /** Represents speed in meters per second. */ + float speed; + /** Represents heading in degrees. */ + float bearing; + /** Represents expected accuracy in meters. */ + float accuracy; + /** Timestamp for the location fix. */ + GpsUtcTime timestamp; +} GpsLocation; + +/** Represents the status. */ +typedef struct { + /** set to sizeof(GpsStatus) */ + size_t size; + GpsStatusValue status; +} GpsStatus; + +/** Represents SV information. */ +typedef struct { + /** set to sizeof(GpsSvInfo) */ + size_t size; + /** Pseudo-random number for the SV. */ + int prn; + /** Signal to noise ratio. */ + float snr; + /** Elevation of SV in degrees. */ + float elevation; + /** Azimuth of SV in degrees. */ + float azimuth; + /** Unknown Samsung element. */ + int padding; +} GpsSvInfo; + +/** Represents SV status. */ +typedef struct { + /** set to sizeof(GpsSvStatus) */ + size_t size; + + /** Number of SVs currently visible. */ + int num_svs; + + /** Contains an array of SV information. */ + GpsSvInfo sv_list[GPS_MAX_SVS]; + + /** Represents a bit mask indicating which SVs + * have ephemeris data. + */ + uint32_t ephemeris_mask; + + /** Represents a bit mask indicating which SVs + * have almanac data. + */ + uint32_t almanac_mask; + + /** + * Represents a bit mask indicating which SVs + * were used for computing the most recent position fix. + */ + uint32_t used_in_fix_mask; +} GpsSvStatus; + + +/* 2G and 3G */ +/* In 3G lac is discarded */ +typedef struct { + uint16_t type; + uint16_t mcc; + uint16_t mnc; + uint16_t lac; + uint32_t cid; +} AGpsRefLocationCellID; + +typedef struct { + uint8_t mac[6]; +} AGpsRefLocationMac; + +/** Represents ref locations */ +typedef struct { + uint16_t type; + union { + AGpsRefLocationCellID cellID; + AGpsRefLocationMac mac; + } u; +} AGpsRefLocation; + +/** Callback with location information. + * Can only be called from a thread created by create_thread_cb. + */ +typedef void (* gps_location_callback)(GpsLocation* location); + +/** Callback with status information. + * Can only be called from a thread created by create_thread_cb. + */ +typedef void (* gps_status_callback)(GpsStatus* status); + +/** + * Callback with SV status information. + * Can only be called from a thread created by create_thread_cb. + */ +typedef void (* gps_sv_status_callback)(GpsSvStatus* sv_info); + +/** Callback for reporting NMEA sentences. + * Can only be called from a thread created by create_thread_cb. + */ +typedef void (* gps_nmea_callback)(GpsUtcTime timestamp, const char* nmea, int length); + +/** Callback to inform framework of the GPS engine's capabilities. + * Capability parameter is a bit field of GPS_CAPABILITY_* flags. + */ +typedef void (* gps_set_capabilities)(uint32_t capabilities); + +/** Callback utility for acquiring the GPS wakelock. + * This can be used to prevent the CPU from suspending while handling GPS events. + */ +typedef void (* gps_acquire_wakelock)(); + +/** Callback utility for releasing the GPS wakelock. */ +typedef void (* gps_release_wakelock)(); + +/** Callback for requesting NTP time */ +typedef void (* gps_request_utc_time)(); + +/** Callback for creating a thread that can call into the Java framework code. + * This must be used to create any threads that report events up to the framework. + */ +typedef pthread_t (* gps_create_thread)(const char* name, void (*start)(void *), void* arg); + +/** GPS callback structure. */ +typedef struct { + /** set to sizeof(GpsCallbacks) */ + size_t size; + gps_location_callback location_cb; + gps_status_callback status_cb; + gps_sv_status_callback sv_status_cb; + gps_nmea_callback nmea_cb; + gps_set_capabilities set_capabilities_cb; + gps_acquire_wakelock acquire_wakelock_cb; + gps_release_wakelock release_wakelock_cb; + gps_create_thread create_thread_cb; + gps_request_utc_time request_utc_time_cb; +} GpsCallbacks; + + +/** Represents the standard GPS interface. */ +typedef struct { + /** set to sizeof(GpsInterface) */ + size_t size; + /** + * Opens the interface and provides the callback routines + * to the implementation of this interface. + */ + int (*init)( GpsCallbacks* callbacks ); + + /** Starts navigating. */ + int (*start)( void ); + + /** Stops navigating. */ + int (*stop)( void ); + + /** Closes the interface. */ + void (*cleanup)( void ); + + /** Injects the current time. */ + int (*inject_time)(GpsUtcTime time, int64_t timeReference, + int uncertainty); + + /** Injects current location from another location provider + * (typically cell ID). + * latitude and longitude are measured in degrees + * expected accuracy is measured in meters + */ + int (*inject_location)(double latitude, double longitude, float accuracy); + + /** + * Specifies that the next call to start will not use the + * information defined in the flags. GPS_DELETE_ALL is passed for + * a cold start. + */ + void (*delete_aiding_data)(GpsAidingData flags); + + /** + * min_interval represents the time between fixes in milliseconds. + * preferred_accuracy represents the requested fix accuracy in meters. + * preferred_time represents the requested time to first fix in milliseconds. + */ + int (*set_position_mode)(GpsPositionMode mode, GpsPositionRecurrence recurrence, + uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time); + + /** Get a pointer to extension information. */ + const void* (*get_extension)(const char* name); +} GpsInterface; + +/** Callback to request the client to download XTRA data. + * The client should download XTRA data and inject it by calling inject_xtra_data(). + * Can only be called from a thread created by create_thread_cb. + */ +typedef void (* gps_xtra_download_request)(); + +/** Callback structure for the XTRA interface. */ +typedef struct { + gps_xtra_download_request download_request_cb; + gps_create_thread create_thread_cb; +} GpsXtraCallbacks; + +/** Extended interface for XTRA support. */ +typedef struct { + /** set to sizeof(GpsXtraInterface) */ + size_t size; + /** + * Opens the XTRA interface and provides the callback routines + * to the implementation of this interface. + */ + int (*init)( GpsXtraCallbacks* callbacks ); + /** Injects XTRA data into the GPS. */ + int (*inject_xtra_data)( char* data, int length ); +} GpsXtraInterface; + +/** Extended interface for DEBUG support. */ +typedef struct { + /** set to sizeof(GpsDebugInterface) */ + size_t size; + + /** + * This function should return any information that the native + * implementation wishes to include in a bugreport. + */ + size_t (*get_internal_state)(char* buffer, size_t bufferSize); +} GpsDebugInterface; + +/** Represents the status of AGPS. */ +typedef struct { + /** set to sizeof(AGpsStatus_v1) */ + size_t size; + + AGpsType type; + AGpsStatusValue status; +} AGpsStatus_v1; + +/** Represents the status of AGPS augmented with a IPv4 address field. */ +typedef struct { + /** set to sizeof(AGpsStatus_v2) */ + size_t size; + + AGpsType type; + AGpsStatusValue status; + uint32_t ipaddr; +} AGpsStatus_v2; + +/* Represents the status of AGPS augmented to support IPv4 and IPv6. */ +typedef struct { + /** set to sizeof(AGpsStatus_v3) */ + size_t size; + + AGpsType type; + AGpsStatusValue status; + + /** + * Must be set to a valid IPv4 address if the field 'addr' contains an IPv4 + * address, or set to INADDR_NONE otherwise. + */ + uint32_t ipaddr; + + /** + * Must contain the IPv4 (AF_INET) or IPv6 (AF_INET6) address to report. + * Any other value of addr.ss_family will be rejected. + * */ + struct sockaddr_storage addr; +} AGpsStatus_v3; + +typedef AGpsStatus_v3 AGpsStatus; + +/** Callback with AGPS status information. + * Can only be called from a thread created by create_thread_cb. + */ +typedef void (* agps_status_callback)(AGpsStatus* status); + +/** Callback structure for the AGPS interface. */ +typedef struct { + agps_status_callback status_cb; + gps_create_thread create_thread_cb; +} AGpsCallbacks; + + +/** Extended interface for AGPS support. */ +typedef struct { + /** set to sizeof(AGpsInterface_v1) */ + size_t size; + + /** + * Opens the AGPS interface and provides the callback routines + * to the implementation of this interface. + */ + void (*init)( AGpsCallbacks* callbacks ); + /** + * Notifies that a data connection is available and sets + * the name of the APN to be used for SUPL. + */ + int (*data_conn_open)( const char* apn ); + /** + * Notifies that the AGPS data connection has been closed. + */ + int (*data_conn_closed)(); + /** + * Notifies that a data connection is not available for AGPS. + */ + int (*data_conn_failed)(); + /** + * Sets the hostname and port for the AGPS server. + */ + int (*set_server)( AGpsType type, const char* hostname, int port ); +} AGpsInterface_v1; + +/** + * Extended interface for AGPS support, it is augmented to enable to pass + * extra APN data. + */ +typedef struct { + /** set to sizeof(AGpsInterface_v2) */ + size_t size; + + /** + * Opens the AGPS interface and provides the callback routines to the + * implementation of this interface. + */ + void (*init)(AGpsCallbacks* callbacks); + /** + * Deprecated. + * If the HAL supports AGpsInterface_v2 this API will not be used, see + * data_conn_open_with_apn_ip_type for more information. + */ + int (*data_conn_open)(const char* apn); + /** + * Notifies that the AGPS data connection has been closed. + */ + int (*data_conn_closed)(); + /** + * Notifies that a data connection is not available for AGPS. + */ + int (*data_conn_failed)(); + /** + * Sets the hostname and port for the AGPS server. + */ + int (*set_server)(AGpsType type, const char* hostname, int port); + + /** + * Notifies that a data connection is available and sets the name of the + * APN, and its IP type, to be used for SUPL connections. + */ + int (*data_conn_open_with_apn_ip_type)( + const char* apn, + ApnIpType apnIpType); +} AGpsInterface_v2; + +typedef AGpsInterface_v2 AGpsInterface; + +/** Error codes associated with certificate operations */ +#define AGPS_CERTIFICATE_OPERATION_SUCCESS 0 +#define AGPS_CERTIFICATE_ERROR_GENERIC -100 +#define AGPS_CERTIFICATE_ERROR_TOO_MANY_CERTIFICATES -101 + +/** A data structure that represents an X.509 certificate using DER encoding */ +typedef struct { + size_t length; + u_char* data; +} DerEncodedCertificate; + +/** + * A type definition for SHA1 Fingerprints used to identify X.509 Certificates + * The Fingerprint is a digest of the DER Certificate that uniquely identifies it. + */ +typedef struct { + u_char data[20]; +} Sha1CertificateFingerprint; + +/** AGPS Interface to handle SUPL certificate operations */ +typedef struct { + /** set to sizeof(SuplCertificateInterface) */ + size_t size; + + /** + * Installs a set of Certificates used for SUPL connections to the AGPS server. + * If needed the HAL should find out internally any certificates that need to be removed to + * accommodate the certificates to install. + * The certificates installed represent a full set of valid certificates needed to connect to + * AGPS SUPL servers. + * The list of certificates is required, and all must be available at the same time, when trying + * to establish a connection with the AGPS Server. + * + * Parameters: + * certificates - A pointer to an array of DER encoded certificates that are need to be + * installed in the HAL. + * length - The number of certificates to install. + * Returns: + * AGPS_CERTIFICATE_OPERATION_SUCCESS if the operation is completed successfully + * AGPS_CERTIFICATE_ERROR_TOO_MANY_CERTIFICATES if the HAL cannot store the number of + * certificates attempted to be installed, the state of the certificates stored should + * remain the same as before on this error case. + * + * IMPORTANT: + * If needed the HAL should find out internally the set of certificates that need to be + * removed to accommodate the certificates to install. + */ + int (*install_certificates) ( const DerEncodedCertificate* certificates, size_t length ); + + /** + * Notifies the HAL that a list of certificates used for SUPL connections are revoked. It is + * expected that the given set of certificates is removed from the internal store of the HAL. + * + * Parameters: + * fingerprints - A pointer to an array of SHA1 Fingerprints to identify the set of + * certificates to revoke. + * length - The number of fingerprints provided. + * Returns: + * AGPS_CERTIFICATE_OPERATION_SUCCESS if the operation is completed successfully. + * + * IMPORTANT: + * If any of the certificates provided (through its fingerprint) is not known by the HAL, + * it should be ignored and continue revoking/deleting the rest of them. + */ + int (*revoke_certificates) ( const Sha1CertificateFingerprint* fingerprints, size_t length ); +} SuplCertificateInterface; + +/** Represents an NI request */ +typedef struct { + /** set to sizeof(GpsNiNotification) */ + size_t size; + + /** + * An ID generated by HAL to associate NI notifications and UI + * responses + */ + int notification_id; + + /** + * An NI type used to distinguish different categories of NI + * events, such as GPS_NI_TYPE_VOICE, GPS_NI_TYPE_UMTS_SUPL, ... + */ + GpsNiType ni_type; + + /** + * Notification/verification options, combinations of GpsNiNotifyFlags constants + */ + GpsNiNotifyFlags notify_flags; + + /** + * Timeout period to wait for user response. + * Set to 0 for no time out limit. + */ + int timeout; + + /** + * Default response when time out. + */ + GpsUserResponseType default_response; + + /** + * Requestor ID + */ + char requestor_id[GPS_NI_SHORT_STRING_MAXLEN]; + + /** + * Notification message. It can also be used to store client_id in some cases + */ + char text[GPS_NI_LONG_STRING_MAXLEN]; + + /** + * Client name decoding scheme + */ + GpsNiEncodingType requestor_id_encoding; + + /** + * Client name decoding scheme + */ + GpsNiEncodingType text_encoding; + + /** + * A pointer to extra data. Format: + * key_1 = value_1 + * key_2 = value_2 + */ + char extras[GPS_NI_LONG_STRING_MAXLEN]; + +} GpsNiNotification; + +/** Callback with NI notification. + * Can only be called from a thread created by create_thread_cb. + */ +typedef void (*gps_ni_notify_callback)(GpsNiNotification *notification); + +/** GPS NI callback structure. */ +typedef struct +{ + /** + * Sends the notification request from HAL to GPSLocationProvider. + */ + gps_ni_notify_callback notify_cb; + gps_create_thread create_thread_cb; +} GpsNiCallbacks; + +/** + * Extended interface for Network-initiated (NI) support. + */ +typedef struct +{ + /** set to sizeof(GpsNiInterface) */ + size_t size; + + /** Registers the callbacks for HAL to use. */ + void (*init) (GpsNiCallbacks *callbacks); + + /** Sends a response to HAL. */ + void (*respond) (int notif_id, GpsUserResponseType user_response); +} GpsNiInterface; + +struct gps_device_t { + struct hw_device_t common; + + /** + * Set the provided lights to the provided values. + * + * Returns: 0 on succes, error code on failure. + */ + const GpsInterface* (*get_gps_interface)(struct gps_device_t* dev); +}; + +#define AGPS_RIL_REQUEST_SETID_IMSI (1<<0L) +#define AGPS_RIL_REQUEST_SETID_MSISDN (1<<1L) + +#define AGPS_RIL_REQUEST_REFLOC_CELLID (1<<0L) +#define AGPS_RIL_REQUEST_REFLOC_MAC (1<<1L) + +typedef void (*agps_ril_request_set_id)(uint32_t flags); +typedef void (*agps_ril_request_ref_loc)(uint32_t flags); + +typedef struct { + agps_ril_request_set_id request_setid; + agps_ril_request_ref_loc request_refloc; + gps_create_thread create_thread_cb; +} AGpsRilCallbacks; + +/** Extended interface for AGPS_RIL support. */ +typedef struct { + /** set to sizeof(AGpsRilInterface) */ + size_t size; + /** + * Opens the AGPS interface and provides the callback routines + * to the implementation of this interface. + */ + void (*init)( AGpsRilCallbacks* callbacks ); + + /** + * Sets the reference location. + */ + void (*set_ref_location) (const AGpsRefLocation *agps_reflocation, size_t sz_struct); + /** + * Sets the set ID. + */ + void (*set_set_id) (AGpsSetIDType type, const char* setid); + + /** + * Send network initiated message. + */ + void (*ni_message) (uint8_t *msg, size_t len); + + /** + * Notify GPS of network status changes. + * These parameters match values in the android.net.NetworkInfo class. + */ + void (*update_network_state) (int connected, int type, int roaming, const char* extra_info); + + /** + * Notify GPS of network status changes. + * These parameters match values in the android.net.NetworkInfo class. + */ + void (*update_network_availability) (int avaiable, const char* apn); +} AGpsRilInterface; + +/** + * GPS Geofence. + * There are 3 states associated with a Geofence: Inside, Outside, Unknown. + * There are 3 transitions: ENTERED, EXITED, UNCERTAIN. + * + * An example state diagram with confidence level: 95% and Unknown time limit + * set as 30 secs is shown below. (confidence level and Unknown time limit are + * explained latter) + * ____________________________ + * | Unknown (30 secs) | + * """""""""""""""""""""""""""" + * ^ | | ^ + * UNCERTAIN| |ENTERED EXITED| |UNCERTAIN + * | v v | + * ________ EXITED _________ + * | Inside | -----------> | Outside | + * | | <----------- | | + * """""""" ENTERED """"""""" + * + * Inside state: We are 95% confident that the user is inside the geofence. + * Outside state: We are 95% confident that the user is outside the geofence + * Unknown state: Rest of the time. + * + * The Unknown state is better explained with an example: + * + * __________ + * | c| + * | ___ | _______ + * | |a| | | b | + * | """ | """"""" + * | | + * """""""""" + * In the diagram above, "a" and "b" are 2 geofences and "c" is the accuracy + * circle reported by the GPS subsystem. Now with regard to "b", the system is + * confident that the user is outside. But with regard to "a" is not confident + * whether it is inside or outside the geofence. If the accuracy remains the + * same for a sufficient period of time, the UNCERTAIN transition would be + * triggered with the state set to Unknown. If the accuracy improves later, an + * appropriate transition should be triggered. This "sufficient period of time" + * is defined by the parameter in the add_geofence_area API. + * In other words, Unknown state can be interpreted as a state in which the + * GPS subsystem isn't confident enough that the user is either inside or + * outside the Geofence. It moves to Unknown state only after the expiry of the + * timeout. + * + * The geofence callback needs to be triggered for the ENTERED and EXITED + * transitions, when the GPS system is confident that the user has entered + * (Inside state) or exited (Outside state) the Geofence. An implementation + * which uses a value of 95% as the confidence is recommended. The callback + * should be triggered only for the transitions requested by the + * add_geofence_area call. + * + * Even though the diagram and explanation talks about states and transitions, + * the callee is only interested in the transistions. The states are mentioned + * here for illustrative purposes. + * + * Startup Scenario: When the device boots up, if an application adds geofences, + * and then we get an accurate GPS location fix, it needs to trigger the + * appropriate (ENTERED or EXITED) transition for every Geofence it knows about. + * By default, all the Geofences will be in the Unknown state. + * + * When the GPS system is unavailable, gps_geofence_status_callback should be + * called to inform the upper layers of the same. Similarly, when it becomes + * available the callback should be called. This is a global state while the + * UNKNOWN transition described above is per geofence. + * + * An important aspect to note is that users of this API (framework), will use + * other subsystems like wifi, sensors, cell to handle Unknown case and + * hopefully provide a definitive state transition to the third party + * application. GPS Geofence will just be a signal indicating what the GPS + * subsystem knows about the Geofence. + * + */ +#define GPS_GEOFENCE_ENTERED (1<<0L) +#define GPS_GEOFENCE_EXITED (1<<1L) +#define GPS_GEOFENCE_UNCERTAIN (1<<2L) + +#define GPS_GEOFENCE_UNAVAILABLE (1<<0L) +#define GPS_GEOFENCE_AVAILABLE (1<<1L) + +#define GPS_GEOFENCE_OPERATION_SUCCESS 0 +#define GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES -100 +#define GPS_GEOFENCE_ERROR_ID_EXISTS -101 +#define GPS_GEOFENCE_ERROR_ID_UNKNOWN -102 +#define GPS_GEOFENCE_ERROR_INVALID_TRANSITION -103 +#define GPS_GEOFENCE_ERROR_GENERIC -149 + +/** + * The callback associated with the geofence. + * Parameters: + * geofence_id - The id associated with the add_geofence_area. + * location - The current GPS location. + * transition - Can be one of GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED, + * GPS_GEOFENCE_UNCERTAIN. + * timestamp - Timestamp when the transition was detected. + * + * The callback should only be called when the caller is interested in that + * particular transition. For instance, if the caller is interested only in + * ENTERED transition, then the callback should NOT be called with the EXITED + * transition. + * + * IMPORTANT: If a transition is triggered resulting in this callback, the GPS + * subsystem will wake up the application processor, if its in suspend state. + */ +typedef void (*gps_geofence_transition_callback) (int32_t geofence_id, GpsLocation* location, + int32_t transition, GpsUtcTime timestamp); + +/** + * The callback associated with the availability of the GPS system for geofencing + * monitoring. If the GPS system determines that it cannot monitor geofences + * because of lack of reliability or unavailability of the GPS signals, it will + * call this callback with GPS_GEOFENCE_UNAVAILABLE parameter. + * + * Parameters: + * status - GPS_GEOFENCE_UNAVAILABLE or GPS_GEOFENCE_AVAILABLE. + * last_location - Last known location. + */ +typedef void (*gps_geofence_status_callback) (int32_t status, GpsLocation* last_location); + +/** + * The callback associated with the add_geofence call. + * + * Parameter: + * geofence_id - Id of the geofence. + * status - GPS_GEOFENCE_OPERATION_SUCCESS + * GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES - geofence limit has been reached. + * GPS_GEOFENCE_ERROR_ID_EXISTS - geofence with id already exists + * GPS_GEOFENCE_ERROR_INVALID_TRANSITION - the monitorTransition contains an + * invalid transition + * GPS_GEOFENCE_ERROR_GENERIC - for other errors. + */ +typedef void (*gps_geofence_add_callback) (int32_t geofence_id, int32_t status); + +/** + * The callback associated with the remove_geofence call. + * + * Parameter: + * geofence_id - Id of the geofence. + * status - GPS_GEOFENCE_OPERATION_SUCCESS + * GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id + * GPS_GEOFENCE_ERROR_GENERIC for others. + */ +typedef void (*gps_geofence_remove_callback) (int32_t geofence_id, int32_t status); + + +/** + * The callback associated with the pause_geofence call. + * + * Parameter: + * geofence_id - Id of the geofence. + * status - GPS_GEOFENCE_OPERATION_SUCCESS + * GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id + * GPS_GEOFENCE_ERROR_INVALID_TRANSITION - + * when monitor_transitions is invalid + * GPS_GEOFENCE_ERROR_GENERIC for others. + */ +typedef void (*gps_geofence_pause_callback) (int32_t geofence_id, int32_t status); + +/** + * The callback associated with the resume_geofence call. + * + * Parameter: + * geofence_id - Id of the geofence. + * status - GPS_GEOFENCE_OPERATION_SUCCESS + * GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id + * GPS_GEOFENCE_ERROR_GENERIC for others. + */ +typedef void (*gps_geofence_resume_callback) (int32_t geofence_id, int32_t status); + +typedef struct { + gps_geofence_transition_callback geofence_transition_callback; + gps_geofence_status_callback geofence_status_callback; + gps_geofence_add_callback geofence_add_callback; + gps_geofence_remove_callback geofence_remove_callback; + gps_geofence_pause_callback geofence_pause_callback; + gps_geofence_resume_callback geofence_resume_callback; + gps_create_thread create_thread_cb; +} GpsGeofenceCallbacks; + +/** Extended interface for GPS_Geofencing support */ +typedef struct { + /** set to sizeof(GpsGeofencingInterface) */ + size_t size; + + /** + * Opens the geofence interface and provides the callback routines + * to the implementation of this interface. + */ + void (*init)( GpsGeofenceCallbacks* callbacks ); + + /** + * Add a geofence area. This api currently supports circular geofences. + * Parameters: + * geofence_id - The id for the geofence. If a geofence with this id + * already exists, an error value (GPS_GEOFENCE_ERROR_ID_EXISTS) + * should be returned. + * latitude, longtitude, radius_meters - The lat, long and radius + * (in meters) for the geofence + * last_transition - The current state of the geofence. For example, if + * the system already knows that the user is inside the geofence, + * this will be set to GPS_GEOFENCE_ENTERED. In most cases, it + * will be GPS_GEOFENCE_UNCERTAIN. + * monitor_transition - Which transitions to monitor. Bitwise OR of + * GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED and + * GPS_GEOFENCE_UNCERTAIN. + * notification_responsiveness_ms - Defines the best-effort description + * of how soon should the callback be called when the transition + * associated with the Geofence is triggered. For instance, if set + * to 1000 millseconds with GPS_GEOFENCE_ENTERED, the callback + * should be called 1000 milliseconds within entering the geofence. + * This parameter is defined in milliseconds. + * NOTE: This is not to be confused with the rate that the GPS is + * polled at. It is acceptable to dynamically vary the rate of + * sampling the GPS for power-saving reasons; thus the rate of + * sampling may be faster or slower than this. + * unknown_timer_ms - The time limit after which the UNCERTAIN transition + * should be triggered. This parameter is defined in milliseconds. + * See above for a detailed explanation. + */ + void (*add_geofence_area) (int32_t geofence_id, double latitude, double longitude, + double radius_meters, int last_transition, int monitor_transitions, + int notification_responsiveness_ms, int unknown_timer_ms); + + /** + * Pause monitoring a particular geofence. + * Parameters: + * geofence_id - The id for the geofence. + */ + void (*pause_geofence) (int32_t geofence_id); + + /** + * Resume monitoring a particular geofence. + * Parameters: + * geofence_id - The id for the geofence. + * monitor_transitions - Which transitions to monitor. Bitwise OR of + * GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED and + * GPS_GEOFENCE_UNCERTAIN. + * This supersedes the value associated provided in the + * add_geofence_area call. + */ + void (*resume_geofence) (int32_t geofence_id, int monitor_transitions); + + /** + * Remove a geofence area. After the function returns, no notifications + * should be sent. + * Parameter: + * geofence_id - The id for the geofence. + */ + void (*remove_geofence_area) (int32_t geofence_id); +} GpsGeofencingInterface; + + +/** + * Represents an estimate of the GPS clock time. + */ +typedef struct { + /** set to sizeof(GpsClock) */ + size_t size; + + /** A set of flags indicating the validity of the fields in this data structure. */ + GpsClockFlags flags; + + /** + * Leap second data. + * The sign of the value is defined by the following equation: + * utc_time_ns = time_ns + (full_bias_ns + bias_ns) - leap_second * 1,000,000,000 + * + * If the data is available 'flags' must contain GPS_CLOCK_HAS_LEAP_SECOND. + */ + int16_t leap_second; + + /** + * Indicates the type of time reported by the 'time_ns' field. + * This is a Mandatory field. + */ + GpsClockType type; + + /** + * The GPS receiver internal clock value. This can be either the local hardware clock value + * (GPS_CLOCK_TYPE_LOCAL_HW_TIME), or the current GPS time derived inside GPS receiver + * (GPS_CLOCK_TYPE_GPS_TIME). The field 'type' defines the time reported. + * + * For local hardware clock, this value is expected to be monotonically increasing during + * the reporting session. The real GPS time can be derived by compensating the 'full bias' + * (when it is available) from this value. + * + * For GPS time, this value is expected to be the best estimation of current GPS time that GPS + * receiver can achieve. Set the 'time uncertainty' appropriately when GPS time is specified. + * + * Sub-nanosecond accuracy can be provided by means of the 'bias' field. + * The value contains the 'time uncertainty' in it. + * + * This is a Mandatory field. + */ + int64_t time_ns; + + /** + * 1-Sigma uncertainty associated with the clock's time in nanoseconds. + * The uncertainty is represented as an absolute (single sided) value. + * + * This value should be set if GPS_CLOCK_TYPE_GPS_TIME is set. + * If the data is available 'flags' must contain GPS_CLOCK_HAS_TIME_UNCERTAINTY. + */ + double time_uncertainty_ns; + + /** + * The difference between hardware clock ('time' field) inside GPS receiver and the true GPS + * time since 0000Z, January 6, 1980, in nanoseconds. + * This value is used if and only if GPS_CLOCK_TYPE_LOCAL_HW_TIME is set, and GPS receiver + * has solved the clock for GPS time. + * The caller is responsible for using the 'bias uncertainty' field for quality check. + * + * The sign of the value is defined by the following equation: + * true time (GPS time) = time_ns + (full_bias_ns + bias_ns) + * + * This value contains the 'bias uncertainty' in it. + * If the data is available 'flags' must contain GPS_CLOCK_HAS_FULL_BIAS. + + */ + int64_t full_bias_ns; + + /** + * Sub-nanosecond bias. + * The value contains the 'bias uncertainty' in it. + * + * If the data is available 'flags' must contain GPS_CLOCK_HAS_BIAS. + */ + double bias_ns; + + /** + * 1-Sigma uncertainty associated with the clock's bias in nanoseconds. + * The uncertainty is represented as an absolute (single sided) value. + * + * If the data is available 'flags' must contain GPS_CLOCK_HAS_BIAS_UNCERTAINTY. + */ + double bias_uncertainty_ns; + + /** + * The clock's drift in nanoseconds (per second). + * A positive value means that the frequency is higher than the nominal frequency. + * + * The value contains the 'drift uncertainty' in it. + * If the data is available 'flags' must contain GPS_CLOCK_HAS_DRIFT. + */ + double drift_nsps; + + /** + * 1-Sigma uncertainty associated with the clock's drift in nanoseconds (per second). + * The uncertainty is represented as an absolute (single sided) value. + * + * If the data is available 'flags' must contain GPS_CLOCK_HAS_DRIFT_UNCERTAINTY. + */ + double drift_uncertainty_nsps; +} GpsClock; + +/** + * Represents a GPS Measurement, it contains raw and computed information. + */ +typedef struct { + /** set to sizeof(GpsMeasurement) */ + size_t size; + + /** A set of flags indicating the validity of the fields in this data structure. */ + GpsMeasurementFlags flags; + + /** + * Pseudo-random number in the range of [1, 32] + * This is a Mandatory value. + */ + int8_t prn; + + /** + * Time offset at which the measurement was taken in nanoseconds. + * The reference receiver's time is specified by GpsData::clock::time_ns and should be + * interpreted in the same way as indicated by GpsClock::type. + * + * The sign of time_offset_ns is given by the following equation: + * measurement time = GpsClock::time_ns + time_offset_ns + * + * It provides an individual time-stamp for the measurement, and allows sub-nanosecond accuracy. + * This is a Mandatory value. + */ + double time_offset_ns; + + /** + * Per satellite sync state. It represents the current sync state for the associated satellite. + * Based on the sync state, the 'received GPS tow' field should be interpreted accordingly. + * + * This is a Mandatory value. + */ + GpsMeasurementState state; + + /** + * Received GPS Time-of-Week at the measurement time, in nanoseconds. + * The value is relative to the beginning of the current GPS week. + * + * Given the highest sync state that can be achieved, per each satellite, valid range for + * this field can be: + * Searching : [ 0 ] : GPS_MEASUREMENT_STATE_UNKNOWN + * C/A code lock : [ 0 1ms ] : GPS_MEASUREMENT_STATE_CODE_LOCK is set + * Bit sync : [ 0 20ms ] : GPS_MEASUREMENT_STATE_BIT_SYNC is set + * Subframe sync : [ 0 6s ] : GPS_MEASUREMENT_STATE_SUBFRAME_SYNC is set + * TOW decoded : [ 0 1week ] : GPS_MEASUREMENT_STATE_TOW_DECODED is set + * + * However, if there is any ambiguity in integer millisecond, + * GPS_MEASUREMENT_STATE_MSEC_AMBIGUOUS should be set accordingly, in the 'state' field. + */ + int64_t received_gps_tow_ns; + + /** + * 1-Sigma uncertainty of the Received GPS Time-of-Week in nanoseconds. + */ + int64_t received_gps_tow_uncertainty_ns; + + /** + * Carrier-to-noise density in dB-Hz, in the range [0, 63]. + * It contains the measured C/N0 value for the signal at the antenna input. + * + * This is a Mandatory value. + */ + double c_n0_dbhz; + + /** + * Pseudorange rate at the timestamp in m/s. + * The value also includes the effects of the receiver clock frequency and satellite clock + * frequency errors. + * + * The value includes the 'pseudorange rate uncertainty' in it. + * A positive value indicates that the pseudorange is getting larger. + * + * This is a Mandatory value. + */ + double pseudorange_rate_mps; + + /** + * 1-Sigma uncertainty of the pseudurange rate in m/s. + * The uncertainty is represented as an absolute (single sided) value. + * + * This is a Mandatory value. + */ + double pseudorange_rate_uncertainty_mps; + + /** + * Accumulated delta range's state. It indicates whether ADR is reset or there is a cycle slip + * (indicating loss of lock). + * + * This is a Mandatory value. + */ + GpsAccumulatedDeltaRangeState accumulated_delta_range_state; + + /** + * Accumulated delta range since the last channel reset in meters. + * The data is available if 'accumulated delta range state' != GPS_ADR_STATE_UNKNOWN. + */ + double accumulated_delta_range_m; + + /** + * 1-Sigma uncertainty of the accumulated delta range in meters. + * The data is available if 'accumulated delta range state' != GPS_ADR_STATE_UNKNOWN. + */ + double accumulated_delta_range_uncertainty_m; + + /** + * Best derived Pseudorange by the chip-set, in meters. + * The value contains the 'pseudorange uncertainty' in it. + * + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_PSEUDORANGE. + */ + double pseudorange_m; + + /** + * 1-Sigma uncertainty of the pseudorange in meters. + * The value contains the 'pseudorange' and 'clock' uncertainty in it. + * The uncertainty is represented as an absolute (single sided) value. + * + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_PSEUDORANGE_UNCERTAINTY. + */ + double pseudorange_uncertainty_m; + + /** + * A fraction of the current C/A code cycle, in the range [0.0, 1023.0] + * This value contains the time (in Chip units) since the last C/A code cycle (GPS Msec epoch). + * + * The reference frequency is given by the field 'carrier_frequency_hz'. + * The value contains the 'code-phase uncertainty' in it. + * + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CODE_PHASE. + */ + double code_phase_chips; + + /** + * 1-Sigma uncertainty of the code-phase, in a fraction of chips. + * The uncertainty is represented as an absolute (single sided) value. + * + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CODE_PHASE_UNCERTAINTY. + */ + double code_phase_uncertainty_chips; + + /** + * Carrier frequency at which codes and messages are modulated, it can be L1 or L2. + * If the field is not set, the carrier frequency is assumed to be L1. + * + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CARRIER_FREQUENCY. + */ + float carrier_frequency_hz; + + /** + * The number of full carrier cycles between the satellite and the receiver. + * The reference frequency is given by the field 'carrier_frequency_hz'. + * + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CARRIER_CYCLES. + */ + int64_t carrier_cycles; + + /** + * The RF phase detected by the receiver, in the range [0.0, 1.0]. + * This is usually the fractional part of the complete carrier phase measurement. + * + * The reference frequency is given by the field 'carrier_frequency_hz'. + * The value contains the 'carrier-phase uncertainty' in it. + * + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CARRIER_PHASE. + */ + double carrier_phase; + + /** + * 1-Sigma uncertainty of the carrier-phase. + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY. + */ + double carrier_phase_uncertainty; + + /** + * An enumeration that indicates the 'loss of lock' state of the event. + */ + GpsLossOfLock loss_of_lock; + + /** + * The number of GPS bits transmitted since Sat-Sun midnight (GPS week). + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_BIT_NUMBER. + */ + int32_t bit_number; + + /** + * The elapsed time since the last received bit in milliseconds, in the range [0, 20] + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_TIME_FROM_LAST_BIT. + */ + int16_t time_from_last_bit_ms; + + /** + * Doppler shift in Hz. + * A positive value indicates that the SV is moving toward the receiver. + * + * The reference frequency is given by the field 'carrier_frequency_hz'. + * The value contains the 'doppler shift uncertainty' in it. + * + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_DOPPLER_SHIFT. + */ + double doppler_shift_hz; + + /** + * 1-Sigma uncertainty of the doppler shift in Hz. + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_DOPPLER_SHIFT_UNCERTAINTY. + */ + double doppler_shift_uncertainty_hz; + + /** + * An enumeration that indicates the 'multipath' state of the event. + */ + GpsMultipathIndicator multipath_indicator; + + /** + * Signal-to-noise ratio in dB. + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_SNR. + */ + double snr_db; + + /** + * Elevation in degrees, the valid range is [-90, 90]. + * The value contains the 'elevation uncertainty' in it. + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_ELEVATION. + */ + double elevation_deg; + + /** + * 1-Sigma uncertainty of the elevation in degrees, the valid range is [0, 90]. + * The uncertainty is represented as the absolute (single sided) value. + * + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_ELEVATION_UNCERTAINTY. + */ + double elevation_uncertainty_deg; + + /** + * Azimuth in degrees, in the range [0, 360). + * The value contains the 'azimuth uncertainty' in it. + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_AZIMUTH. + * */ + double azimuth_deg; + + /** + * 1-Sigma uncertainty of the azimuth in degrees, the valid range is [0, 180]. + * The uncertainty is represented as an absolute (single sided) value. + * + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_AZIMUTH_UNCERTAINTY. + */ + double azimuth_uncertainty_deg; + + /** + * Whether the GPS represented by the measurement was used for computing the most recent fix. + * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_USED_IN_FIX. + */ + bool used_in_fix; +} GpsMeasurement; + +/** Represents a reading of GPS measurements. */ +typedef struct { + /** set to sizeof(GpsData) */ + size_t size; + + /** Number of measurements. */ + size_t measurement_count; + + /** The array of measurements. */ + GpsMeasurement measurements[GPS_MAX_MEASUREMENT]; + + /** The GPS clock time reading. */ + GpsClock clock; +} GpsData; + +/** + * The callback for to report measurements from the HAL. + * + * Parameters: + * data - A data structure containing the measurements. + */ +typedef void (*gps_measurement_callback) (GpsData* data); + +typedef struct { + /** set to sizeof(GpsMeasurementCallbacks) */ + size_t size; + gps_measurement_callback measurement_callback; +} GpsMeasurementCallbacks; + +#define GPS_MEASUREMENT_OPERATION_SUCCESS 0 +#define GPS_MEASUREMENT_ERROR_ALREADY_INIT -100 +#define GPS_MEASUREMENT_ERROR_GENERIC -101 + +/** + * Extended interface for GPS Measurements support. + */ +typedef struct { + /** Set to sizeof(GpsMeasurementInterface) */ + size_t size; + + /** + * Initializes the interface and registers the callback routines with the HAL. + * After a successful call to 'init' the HAL must begin to provide updates at its own phase. + * + * Status: + * GPS_MEASUREMENT_OPERATION_SUCCESS + * GPS_MEASUREMENT_ERROR_ALREADY_INIT - if a callback has already been registered without a + * corresponding call to 'close' + * GPS_MEASUREMENT_ERROR_GENERIC - if any other error occurred, it is expected that the HAL + * will not generate any updates upon returning this error code. + */ + int (*init) (GpsMeasurementCallbacks* callbacks); + + /** + * Stops updates from the HAL, and unregisters the callback routines. + * After a call to stop, the previously registered callbacks must be considered invalid by the + * HAL. + * If stop is invoked without a previous 'init', this function should perform no work. + */ + void (*close) (); + +} GpsMeasurementInterface; + + +/** Represents a GPS navigation message (or a fragment of it). */ +typedef struct { + /** set to sizeof(GpsNavigationMessage) */ + size_t size; + + /** + * Pseudo-random number in the range of [1, 32] + * This is a Mandatory value. + */ + int8_t prn; + + /** + * The type of message contained in the structure. + * This is a Mandatory value. + */ + GpsNavigationMessageType type; + + /** + * The status of the received navigation message. + * No need to send any navigation message that contains words with parity error and cannot be + * corrected. + */ + NavigationMessageStatus status; + + /** + * Message identifier. + * It provides an index so the complete Navigation Message can be assembled. i.e. fo L1 C/A + * subframe 4 and 5, this value corresponds to the 'frame id' of the navigation message. + * Subframe 1, 2, 3 does not contain a 'frame id' and this value can be set to -1. + */ + int16_t message_id; + + /** + * Sub-message identifier. + * If required by the message 'type', this value contains a sub-index within the current + * message (or frame) that is being transmitted. + * i.e. for L1 C/A the submessage id corresponds to the sub-frame id of the navigation message. + */ + int16_t submessage_id; + + /** + * The length of the data (in bytes) contained in the current message. + * If this value is different from zero, 'data' must point to an array of the same size. + * e.g. for L1 C/A the size of the sub-frame will be 40 bytes (10 words, 30 bits/word). + * + * This is a Mandatory value. + */ + size_t data_length; + + /** + * The data of the reported GPS message. + * The bytes (or words) specified using big endian format (MSB first). + * + * For L1 C/A, each subframe contains 10 30-bit GPS words. Each GPS word (30 bits) should be + * fitted into the last 30 bits in a 4-byte word (skip B31 and B32), with MSB first. + */ + uint8_t* data; + +} GpsNavigationMessage; + +/** + * The callback to report an available fragment of a GPS navigation messages from the HAL. + * + * Parameters: + * message - The GPS navigation submessage/subframe representation. + */ +typedef void (*gps_navigation_message_callback) (GpsNavigationMessage* message); + +typedef struct { + /** set to sizeof(GpsNavigationMessageCallbacks) */ + size_t size; + gps_navigation_message_callback navigation_message_callback; +} GpsNavigationMessageCallbacks; + +#define GPS_NAVIGATION_MESSAGE_OPERATION_SUCCESS 0 +#define GPS_NAVIGATION_MESSAGE_ERROR_ALREADY_INIT -100 +#define GPS_NAVIGATION_MESSAGE_ERROR_GENERIC -101 + +/** + * Extended interface for GPS navigation message reporting support. + */ +typedef struct { + /** Set to sizeof(GpsNavigationMessageInterface) */ + size_t size; + + /** + * Initializes the interface and registers the callback routines with the HAL. + * After a successful call to 'init' the HAL must begin to provide updates as they become + * available. + * + * Status: + * GPS_NAVIGATION_MESSAGE_OPERATION_SUCCESS + * GPS_NAVIGATION_MESSAGE_ERROR_ALREADY_INIT - if a callback has already been registered + * without a corresponding call to 'close'. + * GPS_NAVIGATION_MESSAGE_ERROR_GENERIC - if any other error occurred, it is expected that + * the HAL will not generate any updates upon returning this error code. + */ + int (*init) (GpsNavigationMessageCallbacks* callbacks); + + /** + * Stops updates from the HAL, and unregisters the callback routines. + * After a call to stop, the previously registered callbacks must be considered invalid by the + * HAL. + * If stop is invoked without a previous 'init', this function should perform no work. + */ + void (*close) (); + +} GpsNavigationMessageInterface; + +/** + * Interface for passing GNSS configuration contents from platform to HAL. + */ +typedef struct { + /** Set to sizeof(GnssConfigurationInterface) */ + size_t size; + + /** + * Deliver GNSS configuration contents to HAL. + * Parameters: + * config_data - a pointer to a char array which holds what usually is expected from + file(/etc/gps.conf), i.e., a sequence of UTF8 strings separated by '\n'. + * length - total number of UTF8 characters in configuraiton data. + * + * IMPORTANT: + * GPS HAL should expect this function can be called multiple times. And it may be + * called even when GpsLocationProvider is already constructed and enabled. GPS HAL + * should maintain the existing requests for various callback regardless the change + * in configuration data. + */ + void (*configuration_update) (const char* config_data, int32_t length); +} GnssConfigurationInterface; + +__END_DECLS + +#endif /* ANDROID_INCLUDE_HARDWARE_GPS_H */ diff --git a/keylayouts/bcm_headset.kl b/keylayouts/bcm_headset.kl new file mode 100644 index 0000000..e344086 --- /dev/null +++ b/keylayouts/bcm_headset.kl @@ -0,0 +1,3 @@ +key 226 HEADSETHOOK +key 115 VOLUME_UP +key 114 VOLUME_DOWN diff --git a/keylayouts/bcm_keypad_v2.kl b/keylayouts/bcm_keypad_v2.kl new file mode 100644 index 0000000..735077a --- /dev/null +++ b/keylayouts/bcm_keypad_v2.kl @@ -0,0 +1,85 @@ +key 399 GRAVE +key 2 1 +key 3 2 +key 4 3 +key 5 4 +key 6 5 +key 7 6 +key 8 7 +key 9 8 +key 10 9 +key 11 0 +key 158 BACK +key 139 MENU +key 127 SEARCH +key 217 RECENTAPPS +key 228 POUND +key 227 STAR +key 352 DPAD_CENTER +key 108 DPAD_DOWN +key 103 DPAD_UP +key 102 HOME +key 105 DPAD_LEFT +key 106 DPAD_RIGHT +key 115 VOLUME_UP +key 114 VOLUME_DOWN +key 116 POWER +key 212 CAMERA + +key 16 Q +key 17 W +key 18 E +key 19 R +key 20 T +key 21 Y +key 22 U +key 23 I +key 24 O +key 25 P +key 26 LEFT_BRACKET +key 27 RIGHT_BRACKET +key 43 BACKSLASH + +key 30 A +key 31 S +key 32 D +key 33 F +key 34 G +key 35 H +key 36 J +key 37 K +key 38 L +key 39 SEMICOLON +key 40 APOSTROPHE +key 14 DEL + +key 44 Z +key 45 X +key 46 C +key 47 V +key 48 B +key 49 N +key 50 M +key 51 COMMA +key 52 PERIOD +key 53 SLASH +key 28 ENTER + +key 56 ALT_LEFT +key 100 ALT_RIGHT +key 42 SHIFT_LEFT +key 54 SHIFT_RIGHT +key 15 TAB +key 57 SPACE +key 150 EXPLORER +key 155 CUST2 +key 442 CHATON +key 373 SYM +key 12 MINUS +key 13 EQUALS +key 215 AT +key 207 MUSIC + +# On an AT keyboard: ESC, F10 +key 1 BACK +key 68 MENU diff --git a/keylayouts/gpio-keys.kl b/keylayouts/gpio-keys.kl new file mode 100644 index 0000000..58da020 --- /dev/null +++ b/keylayouts/gpio-keys.kl @@ -0,0 +1,9 @@ +key 115 VOLUME_UP +key 114 VOLUME_DOWN +key 116 POWER +key 102 HOME +key 105 DPAD_LEFT +key 106 DPAD_RIGHT +key 103 DPAD_UP +key 108 DPAD_DOWN +key 232 DPAD_CENTER diff --git a/keylayouts/samsung-keypad.kl b/keylayouts/samsung-keypad.kl new file mode 100644 index 0000000..8428176 --- /dev/null +++ b/keylayouts/samsung-keypad.kl @@ -0,0 +1,91 @@ +key 399 GRAVE +key 2 1 +key 3 2 +key 4 3 +key 5 4 +key 6 5 +key 7 6 +key 8 7 +key 9 8 +key 10 9 +key 11 0 +key 158 BACK +key 230 SOFT_RIGHT +key 60 SOFT_RIGHT +key 107 ENDCALL +key 62 ENDCALL +key 229 MENU +key 139 MENU +key 59 MENU +key 127 SEARCH +key 217 SEARCH +key 228 POUND +key 227 STAR +key 231 CALL +key 61 CALL +key 232 DPAD_CENTER +key 108 DPAD_DOWN +key 103 DPAD_UP +key 102 HOME +key 105 DPAD_LEFT +key 106 DPAD_RIGHT +key 115 VOLUME_UP +key 114 VOLUME_DOWN +key 116 POWER +key 212 CAMERA + +key 16 Q +key 17 W +key 18 E +key 19 R +key 20 T +key 21 Y +key 22 U +key 23 I +key 24 O +key 25 P +key 26 LEFT_BRACKET +key 27 RIGHT_BRACKET +key 43 BACKSLASH + +key 30 A +key 31 S +key 32 D +key 33 F +key 34 G +key 35 H +key 36 J +key 37 K +key 38 L +key 39 SEMICOLON +key 40 APOSTROPHE +key 14 DEL + +key 44 Z +key 45 X +key 46 C +key 47 V +key 48 B +key 49 N +key 50 M +key 51 COMMA +key 52 PERIOD +key 53 SLASH +key 28 ENTER + +key 56 ALT_LEFT +key 100 ALT_RIGHT +key 42 SHIFT_LEFT +key 54 SHIFT_RIGHT +key 15 TAB +key 57 SPACE +key 150 EXPLORER +key 155 ENVELOPE + +key 12 MINUS +key 13 EQUALS +key 215 AT + +# On an AT keyboard: ESC, F10 +key 1 BACK +key 68 MENU diff --git a/overlay/frameworks/base/core/res/res/values/arrays.xml b/overlay/frameworks/base/core/res/res/values/arrays.xml new file mode 100644 index 0000000..e13493a --- /dev/null +++ b/overlay/frameworks/base/core/res/res/values/arrays.xml @@ -0,0 +1,37 @@ + + + + + + + @string/reboot_reboot + @string/reboot_soft + @string/reboot_recovery + + + + + + soft_reboot + recovery + + + diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml new file mode 100644 index 0000000..70971a3 --- /dev/null +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -0,0 +1,262 @@ + + + + + + + true + + + true + + + false + + + true + + + 10 + + + + 9 + 30 + 100 + 325 + 1250 + 3500 + 10000 + 20000 + + + + + 18 + 30 + 59 + 74 + 92 + 118 + 155 + 222 + 255 + + + + + 255 + 255 + 255 + 255 + 255 + 255 + 255 + 255 + 255 + + + + + 255 + 255 + 255 + 255 + 255 + 255 + 255 + 255 + 255 + + + 0 + 1 + + + #ffffffff + + + 9000 + + + + + + + + + "wifi,1,1,1,-1,true" + "mobile,0,0,0,-1,true" + "mobile_mms,2,0,2,60000,true" + "mobile_supl,3,0,2,60000,true" + "mobile_dun,4,0,4,60000,true" + "mobile_hipri,5,0,3,60000,true" + "mobile_bluetooth,7,7,1,-1,true" + + + + + "1,1" + "0,1" + "7,1" + + + + + "rndis0" + + + + + "wlan0" + + + + + "bt-pan" + + + + + + 0 + 1 + 5 + 7 + + + + 10 + + + + 30 + + + + + 1 + + + + true + + + rmnet0 + + + + true + + + false + + false + + + -12 + + + 1500 + + + true + + + 71 + + + 65 + + + true + + + 4 + + + true + + + true + diff --git a/overlay/frameworks/base/core/res/res/xml/power_profile.xml b/overlay/frameworks/base/core/res/res/xml/power_profile.xml new file mode 100644 index 0000000..a153c27 --- /dev/null +++ b/overlay/frameworks/base/core/res/res/xml/power_profile.xml @@ -0,0 +1,56 @@ + + + + + 0 + 49 + 142 + 0.3 + 35690 + 260 + 4 + 120 + 220 + 88 + 88 + 185 + 50 + 1500 + 88 + + 3.4 + 3.4 + + + 100000 + 200000 + 400000 + 800000 + 1000000 + + 1.4 + 44 + + 55.4 + 82.1 + 113.7 + 205.4 + 259.0 + + diff --git a/overlay/frameworks/base/core/res/res/xml/storage_list.xml b/overlay/frameworks/base/core/res/res/xml/storage_list.xml new file mode 100644 index 0000000..880434a --- /dev/null +++ b/overlay/frameworks/base/core/res/res/xml/storage_list.xml @@ -0,0 +1,46 @@ + + + + + + + + + + diff --git a/overlay/frameworks/base/packages/SystemUI/res/values/config.xml b/overlay/frameworks/base/packages/SystemUI/res/values/config.xml new file mode 100644 index 0000000..cff1f56 --- /dev/null +++ b/overlay/frameworks/base/packages/SystemUI/res/values/config.xml @@ -0,0 +1,30 @@ + + + + + + + true + + + true + + diff --git a/overlay/packages/apps/SamsungServiceMode/res/values/config.xml b/overlay/packages/apps/SamsungServiceMode/res/values/config.xml new file mode 100644 index 0000000..437a0c1 --- /dev/null +++ b/overlay/packages/apps/SamsungServiceMode/res/values/config.xml @@ -0,0 +1,18 @@ + + + + 2 + diff --git a/overlay/packages/apps/Settings/res/values/bools.xml b/overlay/packages/apps/Settings/res/values/bools.xml new file mode 100644 index 0000000..72d6cdf --- /dev/null +++ b/overlay/packages/apps/Settings/res/values/bools.xml @@ -0,0 +1,20 @@ + + + + + + false + diff --git a/overlay/packages/apps/Settings/res/values/config.xml b/overlay/packages/apps/Settings/res/values/config.xml new file mode 100644 index 0000000..b9fa984 --- /dev/null +++ b/overlay/packages/apps/Settings/res/values/config.xml @@ -0,0 +1,23 @@ + + + + + + + + + \ No newline at end of file diff --git a/overlay/packages/services/Telephony/res/values/config.xml b/overlay/packages/services/Telephony/res/values/config.xml new file mode 100644 index 0000000..e500ff9 --- /dev/null +++ b/overlay/packages/services/Telephony/res/values/config.xml @@ -0,0 +1,23 @@ + + + + + + true + \ No newline at end of file diff --git a/ramdisk/charger b/ramdisk/charger new file mode 100644 index 0000000..1d26480 Binary files /dev/null and b/ramdisk/charger differ diff --git a/ramdisk/fstab.hawaii_ss_kylepro b/ramdisk/fstab.hawaii_ss_kylepro new file mode 100644 index 0000000..8ad01bf --- /dev/null +++ b/ramdisk/fstab.hawaii_ss_kylepro @@ -0,0 +1,19 @@ +# Android fstab file. +# The filesystem that contains the filesystem checker binary (typically /system) cannot +# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK + +# +/dev/block/platform/sdhci.1/by-name/system /system ext4 ro,noatime wait +/dev/block/platform/sdhci.1/by-name/efs /efs ext4 noatime,nosuid,nodev,journal_async_commit,errors=panic wait,check +/dev/block/platform/sdhci.1/by-name/CSC /cache ext4 noatime,nosuid,nodev,journal_async_commit,errors=panic wait,check +/dev/block/platform/sdhci.1/by-name/userdata /data ext4 noatime,nosuid,nodev,discard,noauto_da_alloc,journal_async_commit,errors=panic wait,check,encryptable=footer,length=-16384 +/dev/block/platform/sdhci.1/by-name/KERNEL /boot emmc defaults defaults +/dev/block/platform/sdhci.1/by-name/RECOVERY /recovery emmc defaults defaults +/dev/block/platform/sdhci.1/by-name/modem /modem emmc defaults defaults + +# vold-managed volumes ("block device" is actually a sysfs devpath) +/devices/platform/sdhci.0/mmc_host/mmc2* auto auto defaults voldmanaged=sdcard1:auto,noemulatedsd +/devices/platform/sdhci.0/mmc_host/mmc2* auto auto defaults voldmanaged=sdcard2:auto,noemulatedsd + +# ZRam +#/dev/block/zram0 none swap defaults zramsize=52428800 \ No newline at end of file diff --git a/ramdisk/init.bcm2166x.usb.rc b/ramdisk/init.bcm2166x.usb.rc new file mode 100644 index 0000000..79ca6c9 --- /dev/null +++ b/ramdisk/init.bcm2166x.usb.rc @@ -0,0 +1,152 @@ +on init + write /sys/class/android_usb/android0/iSerial $ro.serialno + write /sys/class/android_usb/android0/f_rndis/manufacturer Samsung + write /sys/class/android_usb/android0/f_rndis/vendorID 04E8 + +on boot + write /sys/class/android_usb/android0/iManufacturer $ro.product.manufacturer + write /sys/class/android_usb/android0/iProduct ${ro.product.model} + write /sys/class/udc/dwc_otg/soft_connect connect + +on property:sys.usb.config=mass_storage + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 685B + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/f_mass_storage/lun0/file /dev/block/mmcblk1p1 + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mass_storage,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 685E + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/f_mass_storage/lun0/file /dev/block/mmcblk1p1 + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=acm + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 685D + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/f_acm/instances 2 + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=acm,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 685D + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/f_acm/instances 2 + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=ptp + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6865 + write /sys/class/android_usb/android0/bDeviceClass 0 + write /sys/class/android_usb/android0/bDeviceSubClass 0 + write /sys/class/android_usb/android0/bDeviceProtocol 0 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=ptp,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6866 + write /sys/class/android_usb/android0/bDeviceClass 0 + write /sys/class/android_usb/android0/bDeviceSubClass 0 + write /sys/class/android_usb/android0/bDeviceProtocol 0 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mtp + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6860 + write /sys/class/android_usb/android0/bDeviceClass EF + write /sys/class/android_usb/android0/bDeviceSubClass 02 + write /sys/class/android_usb/android0/bDeviceProtocol 01 + write /sys/class/android_usb/android0/functions mtp,acm + write /sys/class/android_usb/android0/f_acm/instances 2 + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mtp,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6860 + write /sys/class/android_usb/android0/bDeviceClass EF + write /sys/class/android_usb/android0/bDeviceSubClass 02 + write /sys/class/android_usb/android0/bDeviceProtocol 01 + write /sys/class/android_usb/android0/functions mtp,acm,adb + write /sys/class/android_usb/android0/f_acm/instances 2 + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mtp,acm + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6860 + write /sys/class/android_usb/android0/bDeviceClass EF + write /sys/class/android_usb/android0/bDeviceSubClass 02 + write /sys/class/android_usb/android0/bDeviceProtocol 01 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/f_acm/instances 2 + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mtp,acm,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6860 + write /sys/class/android_usb/android0/bDeviceClass EF + write /sys/class/android_usb/android0/bDeviceSubClass 02 + write /sys/class/android_usb/android0/bDeviceProtocol 01 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/f_acm/instances 2 + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rndis + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6863 + write /sys/class/android_usb/android0/bDeviceClass 02 + write /sys/class/android_usb/android0/bDeviceSubClass 00 + write /sys/class/android_usb/android0/bDeviceProtocol 00 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rndis,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6864 + write /sys/class/android_usb/android0/bDeviceClass 02 + write /sys/class/android_usb/android0/bDeviceSubClass 00 + write /sys/class/android_usb/android0/bDeviceProtocol 00 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct e680 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} \ No newline at end of file diff --git a/ramdisk/init.hawaii_ss_kylepro.rc b/ramdisk/init.hawaii_ss_kylepro.rc new file mode 100644 index 0000000..ec06805 --- /dev/null +++ b/ramdisk/init.hawaii_ss_kylepro.rc @@ -0,0 +1,890 @@ +import init.bcm2166x.usb.rc +import init.log.rc + +on early-init + mkdir /efs 0771 radio system + +on init + # See storage config details at http://source.android.com/tech/storage/ + mkdir /mnt/shell/emulated 0700 shell shell + mkdir /storage/emulated 0555 root root + export EXTERNAL_STORAGE /storage/emulated/legacy + export EMULATED_STORAGE_SOURCE /mnt/shell/emulated + export EMULATED_STORAGE_TARGET /storage/emulated + # Support legacy paths + symlink /storage/emulated/legacy /sdcard + symlink /storage/emulated/legacy /mnt/sdcard + symlink /storage/emulated/legacy /storage/sdcard0 + symlink /mnt/shell/emulated/0 /storage/emulated/legacy + + mkdir /storage/sdcard1 0775 system system + export SECONDARY_STORAGE /storage/sdcard1 + mkdir /mnt/media_rw/sdcard1 0700 media_rw media_rw + mkdir /storage/sdcard1 0700 root root + + #mkdir /storage/usbdisk 0775 system system + #export SECONDARY_STORAGE /storage/usbdisk0 + #mkdir /mnt/media_rw/usbdisk0 0700 media_rw media_rw + #mkdir /storage/usbdisk0 0700 root root + + # for backwards compatibility + #symlink /storage/sdcard1 /external_sd + #symlink /storage/sdcard1 /mnt/external_sd + #symlink /storage/usbdisk /usbdisk + #symlink /storage/usbdisk /mnt/usbdisk + +# To store widevine keybox + symlink /data/app /factory + + symlink /efs /factory + + symlink /dev/block/mmcblk0p11 /dev/block/param + +on post-fs-data +# we will remap this as /storage/sdcard with the sdcard fuse tool + mkdir /data/media 0770 media_rw media_rw + chown media_rw media_rw /data/media + +# SA, System SW, SAMSUNG create log directory + mkdir /data/log 0775 system log + chown system log /data/log + setprop vold.post_fs_data_done 1 + + chmod 0777 /data/log + chmod 0777 /data/anr + + #for wifi + mkdir /efs/wifi 0775 radio system + mkdir /efs/bluetooth 0775 radio system + mkdir /efs/imei 0775 radio system + mkdir /data/misc/wifi 0775 wifi system + mkdir /data/misc/wifi/sockets 0770 wifi wifi + mkdir /data/misc/dhcp 0775 dhcp dhcp + mkdir /system/etc/wifi 0775 wifi wifi + chown system system /efs/wifi/.mac.info + chmod 0664 /efs/wifi/.mac.info + chown system system /efs/imei/.nvmac.info + chmod 0664 /efs/imei/.nvmac.info + + # permissions for bluetooth. + setprop ro.bt.bdaddr_path "/efs/bluetooth/bt_addr" + chown bluetooth net_bt_stack ro.bt.bdaddr_path + chown bluetooth net_bt_stack /dev/ttyS0 + chmod 0600 /dev/ttyS0 + chmod 0660 /sys/class/rfkill/rfkill0/state + chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/state + chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/type + + # for TRP/TIS + write /data/.psm.info 1 + chown system root /data/.psm.info + chmod 0660 /data/.psm.info + +# for control LCD backlight +# chown system system /sys/class/backlight/hw-backlight/brightness +# chmod 0660 /sys/class/backlight/hw-backlight/brightness +# chown system system /sys/class/backlight/pwm-backlight/brightness +# chmod 0660 /sys/class/backlight/pwm-backlight/brightness + + chown system system /sys/class/backlight/panel/brightness + chmod 0660 /sys/class/backlight/panel/brightness + + chown system system /sys/class/backlight/keypad-led/brightness + chmod 0660 /sys/class/backlight/keypad-led/brightness + + chown system system /sys/class/backlight/touchkey-led/brightness + chmod 0660 /sys/class/backlight/touchkey-led/brightness + +## Permissions for mDNIe + chown system media_rw /sys/class/mdnie/mdnie/mode + chown system media_rw /sys/class/mdnie/mdnie/outdoor + chown system media_rw /sys/class/mdnie/mdnie/scenario + chown system system /sys/class/mdnie/mdnie/negative + chown system system /sys/class/mdnie/mdnie/cabc + +# permissions for sensors (accelerometer & magnetic & proximity) + chown system system /sys/class/input/input0/enable + chown system system /sys/class/input/input0/poll_delay + chmod 0660 /sys/class/input/input0/enable + chmod 0660 /sys/class/input/input0/poll_delay + + chown system system /sys/class/input/input1/raw_data + chown system system /sys/class/input/input1/value + chown system system /sys/class/input/input1/fast_calibration_x + chown system system /sys/class/input/input1/fast_calibration_y + chown system system /sys/class/input/input1/fast_calibration_z + chown system system /sys/class/input/input1/eeprom_writing + chown system system /sys/class/input/input1/mode + chown system system /sys/class/input/input1/enable + chown system system /sys/class/input/input1/offset_filt_x + chown system system /sys/class/input/input1/offset_filt_y + chown system system /sys/class/input/input1/offset_filt_z + chown system system /sys/class/input/input1/selftest + chown system system /sys/class/input/input1/delay + chown system system /sys/class/input/input1/update + chown system system /sys/class/input/input1/range + chown system system /sys/class/input/input1/bandwidth + + chmod 0660 /sys/class/input/input1/raw_data + chmod 0660 /sys/class/input/input1/value + chmod 0660 /sys/class/input/input1/fast_calibration_x + chmod 0660 /sys/class/input/input1/fast_calibration_y + chmod 0660 /sys/class/input/input1/fast_calibration_z + chmod 0660 /sys/class/input/input1/eeprom_writing + chmod 0660 /sys/class/input/input1/mode + chmod 0660 /sys/class/input/input1/enable + chmod 0660 /sys/class/input/input1/offset_filt_x + chmod 0660 /sys/class/input/input1/offset_filt_y + chmod 0660 /sys/class/input/input1/offset_filt_z + chmod 0660 /sys/class/input/input1/selftest + chmod 0660 /sys/class/input/input1/delay + chmod 0660 /sys/class/input/input1/update + chmod 0660 /sys/class/input/input1/range + chmod 0660 /sys/class/input/input1/bandwidth + + chown system system /sys/class/input/input2/chip_id + chown system system /sys/class/input/input2/raw_data + chown system system /sys/class/input/input2/op_mode + chown system system /sys/class/input/input2/selftest + chown system system /sys/class/input/input2/value + chown system system /sys/class/input/input2/enable + chown system system /sys/class/input/input2/delay + chown system system /sys/class/input/input2/rept_xy + chown system system /sys/class/input/input2/rept_z + chown system system /sys/class/input/input2/odr + + chmod 0660 /sys/class/input/input2/chip_id + chmod 0660 /sys/class/input/input2/raw_data + chmod 0660 /sys/class/input/input2/op_mode + chmod 0660 /sys/class/input/input2/selftest + chmod 0660 /sys/class/input/input2/value + chmod 0660 /sys/class/input/input2/enable + chmod 0660 /sys/class/input/input2/delay + chmod 0660 /sys/class/input/input2/rept_xy + chmod 0660 /sys/class/input/input2/rept_z + chmod 0660 /sys/class/input/input2/odr + +# for adb + chmod 0775 /system/etc/usbdev.sh + chmod 0775 /system/etc/startadb.sh + +on boot +# RTCC Interval + write /sys/module/lowmemorykiller/parameters/min_interval 500 + +# SISO-ANDR_PERF :: START Changing scheduler to noop during boot + write /sys/block/mmcblk0/queue/scheduler noop +# SISO-ANDR_PERF :: END + write /sys/fs/selinux/enforce 0 + + setprop ro.build.product hawaii + setprop ro.product.device hawaii + + chown system system /sys/devices/platform/panel/backlight/panel/brightness + mount debugfs /sys/kernel/debug /sys/kernel/debug + + +# WIFI + setprop wifi.interface wlan0 + + symlink /dev/block/mmcblk0p11 /dev/block/param + +# +# Accelerometer_sensor + chown system radio /dev/accelerometer + chown system radio /sys/class/sensors/accelerometer_sensor + chown system radio /sys/class/sensors/accelerometer_sensor/raw_data + chown system radio /sys/class/sensors/accelerometer_sensor/calibration + chown system radio /sys/class/sensors/accelerometer_sensor/reactive_alert + chown system radio /sys/class/sensors/accelerometer_sensor/vendor + chown system radio /sys/class/sensors/accelerometer_sensor/name + chown system radio /sys/class/sensors/accelerometer_sensor/selftest +# Proximity_sensor + chown system radio /sys/class/sensors/proximity_sensor/state + chown system radio /sys/class/sensors/proximity_sensor/prox_avg + chown system radio /sys/class/sensors/proximity_sensor/prox_cal + chown system radio /sys/class/sensors/proximity_sensor/prox_cal_open + chown system radio /sys/class/sensors/proximity_sensor/vendor + chown system radio /sys/class/sensors/proximity_sensor/name + chown system radio /sys/class/sensors/proximity_sensor/prox_thresh +# Magnetic_sensor + chown system radio /dev/akm8975 + chown system radio /sys/class/sensors/magnetic_sensor/raw_data + chown system radio /sys/class/sensors/magnetic_sensor/adc + chown system radio /sys/class/sensors/magnetic_sensor/dac + chown system radio /sys/class/sensors/magnetic_sensor/selftest + chown system radio /sys/class/sensors/magnetic_sensor/power_on + chown system radio /sys/class/sensors/magnetic_sensor/status + chown system radio /sys/class/sensors/magnetic_sensor/op_mode + chown system radio /sys/class/sensors/magnetic_sensor/chip_id + chmod 0660 /sys/class/sensors/magnetic_sensor/selftest + chmod 0660 /sys/class/sensors/magnetic_sensor/op_mode + +## Vibetonz +# chmod 0660 /dev/tspdrv +# chown root shell /dev/tspdrv + +# required so RIL can open kernel RPC drivers + chmod 0660 /dev/bcm_rpc + chmod 0660 /dev/bcm_irpc + chown radio radio /dev/bcm_rpc + chown radio radio /dev/bcm_irpc + + chmod 0660 /dev/bcm_atc + chown shell system /dev/bcm_atc + mkdir /data/atx + chown system system /data/atx + chmod 0771 /data/atx + chown system system /dev/bcm_log + chmod 0660 /dev/bcm_log + chown system system /dev/bcm_audio_log + chmod 0660 /dev/bcm_audio_log + chown system system /dev/ttyGS0 + chown system system /dev/ttyGS2 + chown system system /dev/ttyS2 + chmod 0666 /dev/ttyS2 + chmod 0644 /proc/cmdline + +# GPS UART + chown gps system /dev/ttyS1 + chmod 0770 /dev/ttyS1 + + chown system system /proc/bcm_fuse_net_config + +# Video Telephony + chmod 0666 /dev/bcm_vsp + + +# allow user space (atx) access to kernel pm debug + chown system system /sys/module/pm_dbg/parameters/debug + chmod 0660 /sys/module/pm_dbg/parameters/debug + chown system system /sys/module/bcmpmu59xxx_ponkey/parameters/simulate_ponkey + chmod 0660 /sys/module/bcmpmu59xxx_ponkey/parameters/simulate_ponkey + +# BEGIN BCM QUICK BOOT FEATURE + chown root system /sys/ponkey/ponkey_mode + chmod 0664 /sys/ponkey/ponkey_mode +# END BCM QUICK BOOT FEATURE + + +#security driver + chmod 0660 /dev/bcm_security + chown radio root /dev/bcm_security + mkdir /data/sec 0770 + chown radio root /data/sec + +# BCMPMU drivers + chown -R system system /sys/devices/platform/bcmpmu*/* + +# change owner of mtest system to allow atx/atxd to write this file: + chown system system /sys/kernel/sysrpc/mtest + +# GPIO DVS + chown radio system /sys/class/secgpio_check/secgpio_check_all/check_init_detail + chown radio system /sys/class/secgpio_check/secgpio_check_all/check_sleep_detail + chown radio system /sys/class/secgpio_check/secgpio_check_all/gpio_sleep_debug + chown radio system /sys/class/secgpio_check/secgpio_check_all/gpioinfo_check + chown radio system /sys/class/secgpio_check/secgpio_check_all/gpioinit_check + chown radio system /sys/class/secgpio_check/secgpio_check_all/gpiosleep_check + +# fake some battery state + setprop status.battery.state Slow + setprop status.battery.level 10 + setprop status.battery.level_raw 100 + setprop status.battery.level_scale 10 + + # Set permission for Widevine DRM temporarily + chmod 0777 /dev/s5p-smem + rm /data/app/tlcd_sock + +# phone + setprop ro.telephony.call_ring.multiple 0 + + +# Enable dithering algorithm + setprop fb.force.dithering 1 + +# permissions for gps. + mkdir /data/gps 0770 gps system + chown gps system /data/gps + chmod 0770 /data/gps + chown gps system /system/etc/gps/glconfig.xml + chmod 0660 /system/etc/gps/glconfig.xml + chown gps system /system/etc/gps + + chmod 0770 /system/etc/gps + chown gps system /system/bin/glgps + chmod 0770 /system/bin/glgps + + chown gps system /system/bin/gpslogd + chmod 0777 /system/bin/gpslogd + + write /sys/class/gpio/export 23 + chown gps system /sys/class/gpio/gpio23/value + chown gps system /sys/class/gpio/gpio23/direction + write /sys/class/gpio/gpio23/direction out + write /sys/class/gpio/gpio23/value 0 + + chmod 0660 /dev/bcm_gps + chown radio radio /dev/bcm_gps + +# SEC_PRODUCT_FEATURE_COMMON_USE_MULTISIM + setprop ro.multisim.simslotcount 1 + +# # for multi csc + chown radio radio /proc/LinuStoreIII/efs_info + chmod 0664 /proc/LinuStoreIII/efs_info +# # for protecting key string + chown radio radio /proc/LinuStoreIII/keystr + chmod 0664 /proc/LinuStoreIII/keystr +# # for ril_prop + chown radio radio /proc/LinuStoreIII/ril_prop + chmod 0664 /proc/LinuStoreIII/ril_prop +# # for fsbuild_check + chown radio radio /proc/LinuStoreIII/fsbuild_check + chmod 0664 /proc/LinuStoreIII/fsbuild_check +# # for recovery_opts + chown system radio /proc/LinuStoreIII/recovery_opts + chmod 0664 /proc/LinuStoreIII/recovery_opts + +# Audio (Earjack) + chown system radio /sys/class/audio/earjack/select_jack + chown system radio /sys/class/audio/earjack/key_state + chown system radio /sys/class/audio/earjack/state + chown media system /sys/class/audio/earjack/reselect_jack + +# Battery node + chown system radio /sys/class/power_supply/battery/batt_charging_source + chown system radio /sys/class/power_supply/battery/batt_error_test + chown system radio /sys/class/power_supply/battery/batt_lp_charging + chown system radio /sys/class/power_supply/battery/batt_read_adj_soc + chown system radio /sys/class/power_supply/battery/batt_read_raw_soc + chown system radio /sys/class/power_supply/battery/batt_reset_soc + chown system radio /sys/class/power_supply/battery/batt_slate_mode + chown system radio /sys/class/power_supply/battery/batt_temp_adc + chown system radio /sys/class/power_supply/battery/batt_temp_adc_aver + chown system radio /sys/class/power_supply/battery/batt_temp_adc_cal + chown system radio /sys/class/power_supply/battery/batt_temp_aver + chown system radio /sys/class/power_supply/battery/batt_type + chown system radio /sys/class/power_supply/battery/batt_vf_adc + chown system radio /sys/class/power_supply/battery/batt_vfocv + chown system radio /sys/class/power_supply/battery/batt_vol_adc + chown system radio /sys/class/power_supply/battery/batt_vol_adc_aver + chown system radio /sys/class/power_supply/battery/batt_vol_adc_cal + chown system radio /sys/class/power_supply/battery/batt_vol_aver + chown system radio /sys/class/power_supply/battery/factory_mode + chown system radio /sys/class/power_supply/battery/siop_activated + chown system radio /sys/class/power_supply/battery/siop_level + chown system radio /sys/class/power_supply/battery/update + chown system radio /sys/class/power_supply/battery/wc_status + chown system radio /sys/class/power_supply/battery/wpc_pin_state + chown system radio /sys/class/power_supply/fuelgauge/fg_curr_ua + +# CTIA event + chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/call + chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/video + chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/music + chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/browser + chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/hotspot + chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/camera + chown system radio /sys/class/power_supply/battery/talk_wcdma + chown system radio /sys/class/power_supply/battery/talk_gsm + chown system radio /sys/class/power_supply/battery/call + chown system radio /sys/class/power_supply/battery/data_call + chown gps radio /sys/class/power_supply/battery/gps + chown system radio /sys/class/power_supply/battery/wifi + chown system radio /sys/class/power_supply/battery/lte + +# Thermistor node + chown radio system /sys/devices/platform/sec-thermistor/temp_adc + chown radio system /sys/devices/platform/sec-thermistor/temperature + +# Permissions for touch + chown system radio /sys/class/sec/tsp/cmd + +# Permissions for Touchkey + chown system radio /sys/class/sec/sec_touchkey/enable_disable + chown system radio /sys/class/sec/sec_touchkey/touchkey_brightness + chown system radio /sys/class/sec/sec_touchkey/touchkey_menu + chown system radio /sys/class/sec/sec_touchkey/touchkey_back + chown system radio /sys/class/sec/sec_touchkey/touch_update + chown system radio /sys/class/sec/sec_touchkey/touch_version + chown system radio /sys/class/sec/sec_touchkey/touchkey_firm_version_panel + chown system radio /sys/class/sec/sec_touchkey/touchkey_firm_version_phone + chown system radio /sys/class/sec/sec_touchkey/touchkey_firm_update_status + chown system radio /sys/class/sec/sec_touchkey/touchkey_firm_update + chown system radio /sys/class/sec/sec_touchkey/touch_sensitivity + chown system radio /sys/class/sec/sec_touchkey/touchkey_threshold + chown system system /sys/devices/virtual/sec/sec_touchkey/brightness + +# Permissions for gpio_keys + chown radio system /sys/class/sec/sec_key/wakeup_keys + write /sys/class/sec/sec_key/wakeup_keys 116,172,544 + +# Accy + chown radio system /sys/devices/platform/bcmpmu_accy/jiglock + +# Permissions for Camera + chown system radio /sys/class/camera/rear/rear_camfw + chown system radio /sys/class/camera/rear/rear_camtype + chown system radio /sys/class/camera/rear/rear_flash + chown system radio /sys/class/camera/rear/isp_core + chown system radio /sys/class/camera/front/front_camfw + chown system radio /sys/class/camera/front/front_camtype + chown system radio /sys/class/flash/flash/flash_power + chown radio system /sys/devices/platform/samsung-pd.5/s3c-fimc.2/range_mode + chmod 0660 /sys/devices/platform/samsung-pd.5/s3c-fimc.2/range_mode + chmod 220 /sys/class/camera/rear/rear_camfw + chmod 220 /sys/class/camera/rear/rear_camtype + +# Switch Device + chown system system /sys/class/sec/switch/uart_sel + chown system system /sys/class/sec/switch/usb_sel + chown system system /sys/class/sec/switch/otg_test + chown system radio /sys/class/sec/switch/adc + +# Permissions for SVC LED + chown system system /sys/class/sec/led/led_pattern + chown system system /sys/class/sec/led/led_blink + chown system system /sys/class/sec/led/led_br_lev + chown system system /sys/class/sec/led/led_lowpower + +# Init Compcache taejin5.park + chmod 0664 /sys/class/lmk/lowmemorykiller/lmk_state + chown system system /sys/class/lmk/lowmemorykiller/lmk_state + chmod 0664 /sys/block/zram0/disksize + chown system system /sys/block/zram0/disksize + write /sys/block/zram0/disksize 104857600 + chmod 0664 /sys/block/zram0/initstate + chown system system /sys/block/zram0/initstate + write /sys/block/zram0/initstate 1 + +# serial_no permission change + chmod 0770 /efs/FactoryApp/serial_no + chown system system /efs/FactoryApp/serial_no + +# disable swap page clustering -- recommended in https://source.android.com/devices/low-ram.html + #write /proc/sys/vm/page-cluster 0 + +on charger + #mount ext4 /dev/block/mmcblk0p17 /system ro wait noatime + #exec sfsck /dev/block/mmcblk0p19 ext4 + #mount ext4 /dev/block/mmcblk0p19 /data wait nosuid nodev noatime discard,noauto_da_alloc,journal_async_commit + +# Set cpu governor to powersave while in charging mode + write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor powersave + write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor powersave + +# EHCI runtime enable for LPA + write /sys/devices/platform/s5p-ehci/power/control auto + +on fs + mount_all /fstab.hawaii_ss_kylepro + #swapon_all fstab.hawaii_ss_kylepro + + setprop ro.crypto.fuse_sdcard true + + # don't require sim + setprop keyguard.no_require_sim 1 + + #j4fs module +# insmod /system/lib/modules/j4fs.ko +# mount j4fs /dev/block/mmcblk0p11 /mnt/.lfs + + #SEC_PARAM +# insmod sec_param.ko + + +# For NV Read/Write + chown radio system /dev/block/mmcblk0p1 + chmod 0770 /dev/block/mmcblk0p1 + + chmod 6755 /system/xbin/su + +#for ASE application + mkdir /data/brcm + mkdir /data/brcm/ase + mkdir /data/brcm/ase/extras + mkdir /data/brcm/ase/scripts + chmod 0775 /data/brcm + chmod 0775 /data/brcm/ase + chmod 0775 /data/brcm/ase/extras + chmod 0775 /data/brcm/ase/scripts + copy /system/etc/adb.sh /data/brcm/ase/scripts/adb.sh + copy /system/etc/rndis.sh /data/brcm/ase/scripts/rndis.sh + copy /system/etc/logcfg.sh /data/brcm/ase/scripts/logcfg.sh + copy /system/etc/modem.sh /data/brcm/ase/scripts/modem.sh + copy /system/etc/atmode.sh /data/brcm/ase/scripts/atmode.sh + copy /system/etc/atmode.sh /data/brcm/ase/scripts/usbconfig.sh + chmod 0775 /data/brcm/ase/scripts/adb.sh + chmod 0775 /data/brcm/ase/scripts/rndis.sh + chmod 0775 /data/brcm/ase/scripts/logcfg.sh + chmod 0775 /data/brcm/ase/scripts/modem.sh + chmod 0775 /data/brcm/ase/scripts/atmode.sh + chmod 0775 /data/brcm/ase/scripts/usbconfig.sh +#runSysCmd + mkdir /data/brcm/utils + chmod 0775 /data/brcm/utils + +# Logging required to save file in /data/brcm for configuration + mkdir /data/brcm + chmod 0775 /data/brcm + +# Permissions for System Server and daemons. + chown system system /sys/devices/platform/panel/backlight/panel/brightness + + #for touch fw + chown system system /sys/class/sec/tsp/cmd + chmod 0660 /sys/class/sec/tsp/cmd + chown system system /sys/class/sec/tsp/cmd_status + chmod 0660 /sys/class/sec/tsp/cmd_status + chown system system /sys/class/sec/tsp/cmd_result + chmod 0660 /sys/class/sec/tsp/cmd_result + + chown system system /sys/class/sec/sec_touchscreen/tsp_firm_version_phone + chmod 0660 /sys/class/sec/sec_touchscreen/tsp_firm_version_phone + chown system system /sys/class/sec/sec_touchscreen/tsp_firm_version_panel + chmod 0660 /sys/class/sec/sec_touchscreen/tsp_firm_version_panel + chown system system /sys/class/sec/sec_touchscreen/tsp_firm_update + chmod 0660 /sys/class/sec/sec_touchscreen/tsp_firm_update + chown system system /sys/class/sec/sec_touchscreen/tsp_firm_update_status + chmod 0660 /sys/class/sec/sec_touchscreen/tsp_firm_update_status + chown system system /sys/class/sec/sec_touchscreen/tsp_threshold + chmod 0660 /sys/class/sec/sec_touchscreen/tsp_threshold + chown system system /sys/class/sec/sec_touchscreen/touchkey_menu + chmod 0660 /sys/class/sec/sec_touchscreen/touchkey_menu + chown system system /sys/class/sec/sec_touchscreen/touchkey_home + chmod 0660 /sys/class/sec/sec_touchscreen/touchkey_home + chown system system /sys/class/sec/sec_touchscreen/touchkey_back + chmod 0660 /sys/class/sec/sec_touchscreen/touchkey_back + +# cpu freq + chown media root /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor + chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor + +# make directory for storing sales code + mkdir /efs/imei 0775 radio system + +on post-fs + restorecon_recursive /efs + chown radio system /efs + chmod 0771 /efs + +# create filesystem if necessary +service setup_fs /system/bin/setup_fs \ + /dev/block/mmcblk0p15 \ + /dev/block/mmcblk0p11 + class core + user root + group root + oneshot + +#at_distributor for making file for factory. +service at_distributor /system/bin/at_distributor + class main + user root + group radio misc log + +#bosch sensor deamon +service sensord /system/bin/sensord + class main + user system + group system + +# RILD +service ril-daemon /system/bin/rild + class main + socket rild stream 660 root radio + socket rild1 stream 660 root radio + socket rild-debug stream 660 radio system + user root + group radio cache inet misc audio system sdcard_rw log sdcard_r +# onrestart restart cpboot-daemon + +# create virtual SD card at /mnt/sdcard, based on the /data/media directory +# daemon will drop to user/group system/media_rw after initializing +# underlying files in /data/media will be created with user and group media_rw (1023) +service sdcard /system/bin/sdcard -u 1023 -g 1023 -l /data/media /mnt/shell/emulated + class late_start + +# fusewrapped external sdcard daemon running as media_rw (1023) + service fuse_sdcard1 /system/bin/sdcard -u 1023 -g 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1 + class late_start + disabled + +# create filesystem if necessary + service setup_fs /system/bin/setup_fs \ + /dev/block/mmcblk0p15 \ + /dev/block/mmcblk0p11 + class core + user root + group root + oneshot + +#bosch sensor deamon + service sensord /system/bin/sensord + class main + user system + group system + +# RILD + service ril-daemon /system/bin/rild + class main + socket rild stream 660 root radio + socket rild1 stream 660 root radio + socket rild-debug stream 660 radio system + user root + group radio cache inet misc audio system sdcard_rw log sdcard_r + + service wpa_supplicant /system/bin/wpa_supplicant \ + -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \ + -I/system/etc/wifi/wpa_supplicant_overlay.conf \ + -e/data/misc/wifi/entropy.bin \ + -O/data/misc/wifi/sockets -g@android:wpa_wlan0 + # we will start as root and wpa_supplicant will switch to user wifi + # after setting up the capabilities required for WEXT + # user wifi + # group wifi inet keystore + class main + socket wpa_wlan0 dgram 660 wifi wifi + disabled + oneshot + + service p2p_supplicant /system/bin/wpa_supplicant \ + -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \ + -I/system/etc/wifi/wpa_supplicant_overlay.conf -N \ + -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \ + -I/system/etc/wifi/p2p_supplicant_overlay.conf \ + -e/data/misc/wifi/entropy.bin -puse_p2p_group_interface=1 \ + -O/data/misc/wifi/sockets -g@android:wpa_wlan0 + # we will start as root and wpa_supplicant will switch to user wifi + # after setting up the capabilities required for WEXT + # user wifi + # group wifi inet keystore + class main + socket wpa_wlan0 dgram 660 wifi wifi + disabled + oneshot + + service dhcpcd_wlan0 /system/bin/dhcpcd -ABKL + class main + disabled + oneshot + + service dhcpcd_p2p /system/bin/dhcpcd -aABKL + class main + disabled + oneshot + + service iprenew_wlan0 /system/bin/dhcpcd -n + class main + disabled + oneshot + + service iprenew_p2p /system/bin/dhcpcd -n + class main + disabled + oneshot + +# Bluetooth PAN + service dhcpcd_bt-pan /system/bin/dhcpcd -ABKL + class main + disabled + oneshot + + service iprenew_bt-pan /system/bin/dhcpcd -n + class main + disabled + oneshot + +#for WiFi MFG(TestMode) + service mfgloader /system/bin/mfgloader + class main + disabled + oneshot + + service wlandutservice /system/bin/wlandutservice + class main + user system + group wifi net_raw net_admin system inet + disabled + oneshot + + service macloader /system/bin/macloader + class main + oneshot + +on property:init.svc.macloader=stopped + chown system root /data/.cid.info + chmod 0664 /data/.cid.info + chown system root /data/.rev + chmod 0660 /data/.rev +# end of wifi + + service gpsd /system/bin/glgps -c /system/etc/gps/glconfig.xml + class late_start + user gps + group system root inet radio wifi sdcard_rw + +# Kexec enable + service kexec /system/kexec/kexec.sh + oneshot + +# Run bkmgrd automatically on startup + service bkmgrd /system/bin/bkmgrd + class main + oneshot + user root + #group radio system log + group radio system log root + +# Permissions for Camera + chmod 220 /sys/class/camera/rear/rear_camfw + chmod 220 /sys/class/camera/rear/rear_camtype +# When the default SIM for data connections is updated, +# also update the DUN AT channel with the default SIM. +on property:persist.sys.dataprefer.simid=0 + write /data/atx/setsim.txt at*msetsim=1 + chmod 0666 /data/atx/setsim.txt + start set_simid + +# When the default SIM for data connections is updated, +# also update the DUN AT channel with the default SIM. +on property:persist.sys.dataprefer.simid=1 + write /data/atx/setsim.txt at*msetsim=2 + chmod 0666 /data/atx/setsim.txt + start set_simid + +#btld is only used for FM +# Make sure we startup btld before hcid +#service btld /system/bin/logwrapper /system/bin/btld -hb 3000000 -hp /dev/ttyS1 -lpm 0 -nice -7 +#service btld /system/bin/logwrapper /system/bin/btld -lpm 0 ;; low power mode on(1), off(0) +#service btld /system/bin/logwrapper /system/bin/btld -lpm 1 +# user root +# group bluetooth net_bt_admin +# disabled +# oneshot + +#for WiFi MFG(TestMode) +service mfgloader /system/bin/mfgloader + class main + disabled + oneshot + +service wlandutservice /system/bin/wlandutservice + class main + user system + group wifi net_raw net_admin system inet + disabled + oneshot + +service macloader /system/bin/macloader + class main + oneshot + +on property:init.svc.macloader=stopped + chown system root /data/.cid.info + chmod 0664 /data/.cid.info + chown system root /data/.rev + chmod 0660 /data/.rev +# end of wifi + +service gpsd /system/bin/glgps -c /system/etc/gps/glconfig.xml + class late_start + user gps + group system root inet radio wifi sdcard_rw + +# Run ATX over UART +service console /system/bin/atx -l -d + class main + console +# oneshot + user system + group vpn net_admin net_raw radio system sdcard_rw log mount + +# Kexec enable +service kexec /system/kexec/kexec.sh + oneshot + +# Run bkmgrd automatically on startup +service bkmgrd /system/bin/bkmgrd + class main + oneshot + user root + group radio system log + +# Run usb_portd to automatically launch atx when USB configuration changes. +service usb_portd /system/bin/usb_portd + class main +# oneshot + user system + group input vpn net_admin net_raw radio system sdcard_rw log mount + + + +# When the default SIM for data connections is updated, +# also update the DUN AT channel with the default SIM. +service set_simid /system/bin/atx --fordev=ACM --runcmd=/data/atx/setsim.txt + disabled + oneshot + user system + group input vpn net_admin net_raw radio system sdcard_rw log mount + +#Indicate boot complete to PM to complete PM initialization +on property:dev.bootcomplete=1 + write /sys/module/pwr_mgr/parameters/pm_late_init 1 + write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive + chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq + chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load + chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay + chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time + chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate + chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse + chmod 660 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq + chmod 660 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load + chmod 660 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay + chmod 660 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time + chmod 660 /sys/devices/system/cpu/cpufreq/interactive/timer_rate + chmod 660 /sys/devices/system/cpu/cpufreq/interactive/boostpulse + write /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq 666666 + write /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load 70 + write /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay 6000 + write /sys/devices/system/cpu/cpufreq/interactive/min_sample_time 15000 + write /sys/devices/system/cpu/cpufreq/interactive/timer_rate 2000 + +# change dirty_bytes and dirty_background_bytes for 4GB TLC memory + write /proc/sys/vm/dirty_bytes 14680064 + write /proc/sys/vm/dirty_background_bytes 2097152 + +# adb +service startadb /system/etc/startadb.sh + oneshot + + service battery_charger /charger + class charger + critical + +# service playlpm /system/bin/playlpm +# user root +# critical +# service immvibed /system/bin/immvibed +# oneshot +# service lpmkey /system/bin/lpmkey +# user root +# critical +#on charger +# start playlpm +# start immvibed +# start lpmkey + +# Runtime Compcache +service rtccd /system/bin/rtccd2 -a 150M + class core + user root + oneshot + +on property:init.svc.rtccd=stopped + write /proc/sys/vm/page-cluster 0 + + +on property:ro.dumpstate.dmesg=1 diff --git a/ramdisk/init.log.rc b/ramdisk/init.log.rc new file mode 100644 index 0000000..d159a69 --- /dev/null +++ b/ramdisk/init.log.rc @@ -0,0 +1,109 @@ + +on boot + # setup permissions for logging + chown system system /sys/class/bcm_log/bcm_log/log + chown system system /sys/class/bcm_log/bcm_log/log_lock + chown system system /sys/class/bcm_log/bcm_log/cp_crash + chown system system /sys/class/bcm_log/bcm_log/cp_crash_lock + chown system system /sys/class/bcm_log/bcm_log/ap_crash + chown system system /sys/class/bcm_log/bcm_log/ap_crash_lock + chown system system /sys/class/bcm_log/bcm_log/file_max + chown system system /sys/class/bcm_log/bcm_log/file_base + + chmod 0664 /sys/class/bcm_log/bcm_log/log + chmod 0664 /sys/class/bcm_log/bcm_log/log_lock + chmod 0664 /sys/class/bcm_log/bcm_log/cp_crash + chmod 0664 /sys/class/bcm_log/bcm_log/cp_crash_lock + chmod 0664 /sys/class/bcm_log/bcm_log/ap_crash + chmod 0664 /sys/class/bcm_log/bcm_log/ap_crash_lock + chmod 0664 /sys/class/bcm_log/bcm_log/file_max + chmod 0664 /sys/class/bcm_log/bcm_log/file_base + +# Setup Logging persistent data +on property:persist.brcm.log=auto + write /sys/class/bcm_log/bcm_log/log_lock 0 +on property:persist.brcm.log=sdcard + write /sys/class/bcm_log/bcm_log/log_lock 0 + write /sys/class/bcm_log/bcm_log/log sdcard + write /sys/class/bcm_log/bcm_log/log_lock 1 +on property:persist.brcm.log=uart + write /sys/class/bcm_log/bcm_log/log_lock 0 + write /sys/class/bcm_log/bcm_log/log uart + write /sys/class/bcm_log/bcm_log/log_lock 1 +on property:persist.brcm.log=stm + write /sys/class/bcm_log/bcm_log/log_lock 0 + write /sys/class/bcm_log/bcm_log/log stm + write /sys/class/bcm_log/bcm_log/log_lock 1 +on property:persist.brcm.log=rndis + write /sys/class/bcm_log/bcm_log/log_lock 0 + write /sys/class/bcm_log/bcm_log/log rndis + write /sys/class/bcm_log/bcm_log/log_lock 1 +on property:persist.brcm.log=acm + write /sys/class/bcm_log/bcm_log/log_lock 0 + write /sys/class/bcm_log/bcm_log/log acm + write /sys/class/bcm_log/bcm_log/log_lock 1 + +on property:persist.brcm.cp_crash=auto + write /sys/class/bcm_log/bcm_log/cp_crash_lock 0 +on property:persist.brcm.cp_crash=sdcard + write /sys/class/bcm_log/bcm_log/cp_crash_lock 0 + write /sys/class/bcm_log/bcm_log/cp_crash sdcard + write /sys/class/bcm_log/bcm_log/cp_crash_lock 1 +on property:persist.brcm.cp_crash=uart + write /sys/class/bcm_log/bcm_log/cp_crash_lock 0 + write /sys/class/bcm_log/bcm_log/cp_crash uart + write /sys/class/bcm_log/bcm_log/cp_crash_lock 1 +on property:persist.brcm.cp_crash=stm + write /sys/class/bcm_log/bcm_log/cp_crash_lock 0 + write /sys/class/bcm_log/bcm_log/cp_crash stm + write /sys/class/bcm_log/bcm_log/cp_crash_lock 1 +on property:persist.brcm.cp_crash=rndis + write /sys/class/bcm_log/bcm_log/cp_crash_lock 0 + write /sys/class/bcm_log/bcm_log/cp_crash rndis + write /sys/class/bcm_log/bcm_log/cp_crash_lock 1 +on property:persist.brcm.cp_crash=acm + write /sys/class/bcm_log/bcm_log/cp_crash_lock 0 + write /sys/class/bcm_log/bcm_log/cp_crash acm + write /sys/class/bcm_log/bcm_log/cp_crash_lock 1 +on property:persist.brcm.cp_crash=panic + write /sys/class/bcm_log/bcm_log/cp_crash_lock 0 + write /sys/class/bcm_log/bcm_log/cp_crash panic + write /sys/class/bcm_log/bcm_log/cp_crash_lock 1 + +on property:persist.brcm.ap_crash=auto + write /sys/class/bcm_log/bcm_log/ap_crash_lock 0 +on property:persist.brcm.ap_crash=stm + write /sys/class/bcm_log/bcm_log/ap_crash_lock 0 + write /sys/class/bcm_log/bcm_log/ap_crash stm + write /sys/class/bcm_log/bcm_log/ap_crash_lock 1 +on property:persist.brcm.ap_crash=panic + write /sys/class/bcm_log/bcm_log/ap_crash_lock 0 + write /sys/class/bcm_log/bcm_log/ap_crash panic + write /sys/class/bcm_log/bcm_log/ap_crash_lock 1 +on property:persist.brcm.ap_crash=sdcard + write /sys/class/bcm_log/bcm_log/ap_crash_lock 0 + write /sys/class/bcm_log/bcm_log/ap_crash sdcard + write /sys/class/bcm_log/bcm_log/ap_crash_lock 1 + +#Setup Broadcom brcm.ase.xxx handling for ASE +on property:brcm.ase.log=* + write /sys/class/bcm_log/bcm_log/log $brcm.ase.log + +on property:brcm.ase.cp_crash=* + write /sys/class/bcm_log/bcm_log/cp_crash $brcm.ase.cp_crash + +on property:brcm.ase.ap_crash=* + write /sys/class/bcm_log/bcm_log/ap_crash $brcm.ase.ap_crash + +on property:brcm.ase.log_save=1 + setprop persist.brcm.log $brcm.ase.log + +on property:brcm.ase.file_max=* + write /sys/class/bcm_log/bcm_log/file_max $brcm.ase.file_max + +on property:brcm.ase.file_max_save=1 + setprop persist.brcm.log_file_max $brcm.ase.file_max + +on property:persist.brcm.log_file_max=* + write /sys/class/bcm_log/bcm_log/file_max $persist.brcm.log_file_max + diff --git a/ramdisk/init.rc b/ramdisk/init.rc new file mode 100644 index 0000000..aa68e1f --- /dev/null +++ b/ramdisk/init.rc @@ -0,0 +1,652 @@ +# Copyright (C) 2012 The Android Open Source Project +# +# IMPORTANT: Do not create world writable files or directories. +# This is a common source of Android security bugs. +# + +import /init.environ.rc +import /init.usb.rc +import /init.${ro.hardware}.rc +import /init.${ro.zygote}.rc +import /init.trace.rc +# Include CM's extra init file +import /init.cm.rc + + +on early-init + # Set init and its forked children's oom_adj. + write /proc/1/oom_score_adj -1000 + + # Apply strict SELinux checking of PROT_EXEC on mmap/mprotect calls. + write /sys/fs/selinux/checkreqprot 0 + + # Set the security context for the init process. + # This should occur before anything else (e.g. ueventd) is started. + setcon u:r:init:s0 + + # Set the security context of /adb_keys if present. + restorecon /adb_keys + + start ueventd + + # create mountpoints + mkdir /mnt 0775 root system + +on init + sysclktz 0 + + loglevel 3 + + # Backward compatibility + symlink /system/etc /etc + symlink /sys/kernel/debug /d + + # Right now vendor lives on the same filesystem as system, + # but someday that may change. + symlink /system/vendor /vendor + + # Create cgroup mount point for cpu accounting + mkdir /acct + mount cgroup none /acct cpuacct + mkdir /acct/uid + + # Create cgroup mount point for memory + mount tmpfs none /sys/fs/cgroup mode=0750,uid=0,gid=1000 + mkdir /sys/fs/cgroup/memory 0750 root system + mount cgroup none /sys/fs/cgroup/memory memory + write /sys/fs/cgroup/memory/memory.move_charge_at_immigrate 1 + chown root system /sys/fs/cgroup/memory/tasks + chmod 0660 /sys/fs/cgroup/memory/tasks + mkdir /sys/fs/cgroup/memory/sw 0750 root system + write /sys/fs/cgroup/memory/sw/memory.swappiness 100 + write /sys/fs/cgroup/memory/sw/memory.move_charge_at_immigrate 1 + chown root system /sys/fs/cgroup/memory/sw/tasks + chmod 0660 /sys/fs/cgroup/memory/sw/tasks + + mkdir /system + mkdir /data 0771 system system + mkdir /cache 0770 system cache + mkdir /config 0500 root root + + # See storage config details at http://source.android.com/tech/storage/ + mkdir /mnt/shell 0700 shell shell + mkdir /mnt/media_rw 0700 media_rw media_rw + mkdir /storage 0751 root sdcard_r + + # Directory for putting things only root should see. + mkdir /mnt/secure 0700 root root + + # Directory for staging bindmounts + mkdir /mnt/secure/staging 0700 root root + + # Directory-target for where the secure container + # imagefile directory will be bind-mounted + mkdir /mnt/secure/asec 0700 root root + + # Secure container public mount points. + mkdir /mnt/asec 0700 root system + mount tmpfs tmpfs /mnt/asec mode=0755,gid=1000 + + # Filesystem image public mount points. + mkdir /mnt/obb 0700 root system + mount tmpfs tmpfs /mnt/obb mode=0755,gid=1000 + + # memory control cgroup + mkdir /dev/memcg 0700 root system + mount cgroup none /dev/memcg memory + + write /proc/sys/kernel/panic_on_oops 1 + write /proc/sys/kernel/hung_task_timeout_secs 0 + write /proc/cpu/alignment 4 + write /proc/sys/kernel/sched_latency_ns 10000000 + write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000 + write /proc/sys/kernel/sched_compat_yield 1 + write /proc/sys/kernel/sched_child_runs_first 0 + write /proc/sys/kernel/randomize_va_space 2 + write /proc/sys/kernel/kptr_restrict 2 + write /proc/sys/vm/mmap_min_addr 32768 + write /proc/sys/net/ipv4/ping_group_range "0 2147483647" + write /proc/sys/net/unix/max_dgram_qlen 300 + write /proc/sys/kernel/sched_rt_runtime_us 950000 + write /proc/sys/kernel/sched_rt_period_us 1000000 + + # reflect fwmark from incoming packets onto generated replies + write /proc/sys/net/ipv4/fwmark_reflect 1 + write /proc/sys/net/ipv6/fwmark_reflect 1 + + # set fwmark on accepted sockets + write /proc/sys/net/ipv4/tcp_fwmark_accept 1 + + # Create cgroup mount points for process groups + mkdir /dev/cpuctl + mount cgroup none /dev/cpuctl cpu + chown system system /dev/cpuctl + chown system system /dev/cpuctl/tasks + chmod 0666 /dev/cpuctl/tasks + write /dev/cpuctl/cpu.shares 1024 + write /dev/cpuctl/cpu.rt_runtime_us 800000 + write /dev/cpuctl/cpu.rt_period_us 1000000 + + mkdir /dev/cpuctl/bg_non_interactive + chown system system /dev/cpuctl/bg_non_interactive/tasks + chmod 0666 /dev/cpuctl/bg_non_interactive/tasks + # 5.0 % + write /dev/cpuctl/bg_non_interactive/cpu.shares 52 + write /dev/cpuctl/bg_non_interactive/cpu.rt_runtime_us 700000 + write /dev/cpuctl/bg_non_interactive/cpu.rt_period_us 1000000 + + # qtaguid will limit access to specific data based on group memberships. + # net_bw_acct grants impersonation of socket owners. + # net_bw_stats grants access to other apps' detailed tagged-socket stats. + chown root net_bw_acct /proc/net/xt_qtaguid/ctrl + chown root net_bw_stats /proc/net/xt_qtaguid/stats + + # Allow everybody to read the xt_qtaguid resource tracking misc dev. + # This is needed by any process that uses socket tagging. + chmod 0644 /dev/xt_qtaguid + + # Create location for fs_mgr to store abbreviated output from filesystem + # checker programs. + mkdir /dev/fscklogs 0770 root system + + # pstore/ramoops previous console log + mount pstore pstore /sys/fs/pstore + chown system log /sys/fs/pstore/console-ramoops + chmod 0440 /sys/fs/pstore/console-ramoops + +# Healthd can trigger a full boot from charger mode by signaling this +# property when the power button is held. +on property:sys.boot_from_charger_mode=1 + class_stop charger + trigger late-init + +# Load properties from /system/ + /factory after fs mount. +on load_all_props_action + load_all_props + +# Indicate to fw loaders that the relevant mounts are up. +on firmware_mounts_complete + rm /dev/.booting + +# Mount filesystems and start core system services. +on late-init + trigger early-fs + trigger fs + trigger post-fs + trigger post-fs-data + + # Load properties from /system/ + /factory after fs mount. Place + # this in another action so that the load will be scheduled after the prior + # issued fs triggers have completed. + trigger load_all_props_action + + # Remove a file to wake up anything waiting for firmware. + trigger firmware_mounts_complete + + trigger early-boot + trigger boot + + +on post-fs + # once everything is setup, no need to modify / + mount rootfs rootfs / ro remount + # mount shared so changes propagate into child namespaces + mount rootfs rootfs / shared rec + + # We chown/chmod /cache again so because mount is run as root + defaults + chown system cache /cache + chmod 0770 /cache + # We restorecon /cache in case the cache partition has been reset. + restorecon_recursive /cache + + # This may have been created by the recovery system with odd permissions + chown system cache /cache/recovery + chmod 0770 /cache/recovery + + #change permissions on vmallocinfo so we can grab it from bugreports + chown root log /proc/vmallocinfo + chmod 0440 /proc/vmallocinfo + + chown root log /proc/slabinfo + chmod 0440 /proc/slabinfo + + #change permissions on kmsg & sysrq-trigger so bugreports can grab kthread stacks + chown root system /proc/kmsg + chmod 0440 /proc/kmsg + chown root system /proc/sysrq-trigger + chmod 0220 /proc/sysrq-trigger + chown system log /proc/last_kmsg + chmod 0440 /proc/last_kmsg + + # make the selinux kernel policy world-readable + chmod 0444 /sys/fs/selinux/policy + + # create the lost+found directories, so as to enforce our permissions + mkdir /cache/lost+found 0770 root root + +on post-fs-data + # We chown/chmod /data again so because mount is run as root + defaults + chown system system /data + chmod 0771 /data + # We restorecon /data in case the userdata partition has been reset. + restorecon /data + + # Avoid predictable entropy pool. Carry over entropy from previous boot. + copy /data/system/entropy.dat /dev/urandom + + # Create dump dir and collect dumps. + # Do this before we mount cache so eventually we can use cache for + # storing dumps on platforms which do not have a dedicated dump partition. + mkdir /data/dontpanic 0750 root log + + # Collect apanic data, free resources and re-arm trigger + copy /proc/apanic_console /data/dontpanic/apanic_console + chown root log /data/dontpanic/apanic_console + chmod 0640 /data/dontpanic/apanic_console + + copy /proc/apanic_threads /data/dontpanic/apanic_threads + chown root log /data/dontpanic/apanic_threads + chmod 0640 /data/dontpanic/apanic_threads + + write /proc/apanic_console 1 + + # create basic filesystem structure + mkdir /data/misc 01771 system misc + mkdir /data/misc/adb 02750 system shell + mkdir /data/misc/audit 02750 audit system + mkdir /data/misc/bluedroid 0770 bluetooth net_bt_stack + mkdir /data/misc/bluetooth 0770 system system + mkdir /data/misc/keystore 0700 keystore keystore + mkdir /data/misc/keychain 0771 system system + mkdir /data/misc/net 0750 root shell + mkdir /data/misc/radio 0770 system radio + mkdir /data/misc/sms 0770 system radio + mkdir /data/misc/zoneinfo 0775 system system + mkdir /data/misc/vpn 0770 system vpn + mkdir /data/misc/shared_relro 0771 shared_relro shared_relro + mkdir /data/misc/systemkeys 0700 system system + mkdir /data/misc/wifi 0770 wifi wifi + mkdir /data/misc/wifi/sockets 0770 wifi wifi + mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi + mkdir /data/misc/ethernet 0770 system system + mkdir /data/misc/dhcp 0770 dhcp dhcp + mkdir /data/misc/user 0771 root root + # give system access to wpa_supplicant.conf for backup and restore + chmod 0660 /data/misc/wifi/wpa_supplicant.conf + mkdir /data/local 0751 root root + mkdir /data/misc/media 0700 media media + + # For security reasons, /data/local/tmp should always be empty. + # Do not place files or directories in /data/local/tmp + mkdir /data/local/tmp 0771 shell shell + mkdir /data/data 0771 system system + mkdir /data/app-private 0771 system system + mkdir /data/app-asec 0700 root root + mkdir /data/app-lib 0771 system system + mkdir /data/app 0771 system system + mkdir /data/property 0700 root root + + # create dalvik-cache, so as to enforce our permissions + mkdir /data/dalvik-cache 0771 root root + mkdir /data/dalvik-cache/profiles 0711 system system + + # create resource-cache and double-check the perms + mkdir /data/resource-cache 0771 system system + chown system system /data/resource-cache + chmod 0771 /data/resource-cache + + # create the lost+found directories, so as to enforce our permissions + mkdir /data/lost+found 0770 root root + + # create directory for DRM plug-ins - give drm the read/write access to + # the following directory. + mkdir /data/drm 0770 drm drm + + # create directory for MediaDrm plug-ins - give drm the read/write access to + # the following directory. + mkdir /data/mediadrm 0770 mediadrm mediadrm + + mkdir /data/adb 0700 root root + + # symlink to bugreport storage location + symlink /data/data/com.android.shell/files/bugreports /data/bugreports + + # Separate location for storing security policy files on data + mkdir /data/security 0711 system system + + # Reload policy from /data/security if present. + setprop selinux.reload_policy 1 + + # Set SELinux security contexts on upgrade or policy update. + restorecon_recursive /data + restorecon /data/data + restorecon /data/user + restorecon /data/user/0 + + # If there is no fs-post-data action in the init..rc file, you + # must uncomment this line, otherwise encrypted filesystems + # won't work. + # Set indication (checked by vold) that we have finished this action + #setprop vold.post_fs_data_done 1 + +on boot + # basic network init + ifup lo + hostname localhost + domainname localdomain + + # set RLIMIT_NICE to allow priorities from 19 to -20 + setrlimit 13 40 40 + + # Memory management. Basic kernel parameters, and allow the high + # level system server to be able to adjust the kernel OOM driver + # parameters to match how it is managing things. + write /proc/sys/vm/overcommit_memory 1 + write /proc/sys/vm/min_free_order_shift 4 + chown root system /sys/module/lowmemorykiller/parameters/adj + chmod 0220 /sys/module/lowmemorykiller/parameters/adj + chown root system /sys/module/lowmemorykiller/parameters/minfree + chmod 0220 /sys/module/lowmemorykiller/parameters/minfree + + # Tweak background writeout + write /proc/sys/vm/dirty_expire_centisecs 200 + write /proc/sys/vm/dirty_background_ratio 5 + + # Permissions for System Server and daemons. + chown radio system /sys/android_power/state + chown radio system /sys/android_power/request_state + chown radio system /sys/android_power/acquire_full_wake_lock + chown radio system /sys/android_power/acquire_partial_wake_lock + chown radio system /sys/android_power/release_wake_lock + chown system system /sys/power/autosleep + chown system system /sys/power/state + chown system system /sys/power/wakeup_count + chown radio system /sys/power/wake_lock + chown radio system /sys/power/wake_unlock + chmod 0660 /sys/power/state + chmod 0660 /sys/power/wake_lock + chmod 0660 /sys/power/wake_unlock + + chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_rate + chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_slack + chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time + chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq + chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/target_loads + chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load + chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay + chown system system /sys/devices/system/cpu/cpufreq/interactive/boost + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boost + chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse + chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/input_boost + chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration + chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy + + # Assume SMP uses shared cpufreq policy for all CPUs + chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq + chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq + + chown system system /sys/class/timed_output/vibrator/enable + chown system system /sys/class/leds/keyboard-backlight/brightness + chown system system /sys/class/leds/lcd-backlight/brightness + chown system system /sys/class/leds/torch-light/brightness + chown system system /sys/class/leds/button-backlight/brightness + chown system system /sys/class/leds/jogball-backlight/brightness + chown system system /sys/class/leds/red/brightness + chown system system /sys/class/leds/green/brightness + chown system system /sys/class/leds/blue/brightness + chown system system /sys/class/leds/red/device/grpfreq + chown system system /sys/class/leds/red/device/grppwm + chown system system /sys/class/leds/red/device/blink + chown system system /sys/class/timed_output/vibrator/enable + chown system system /sys/module/sco/parameters/disable_esco + chown system system /sys/kernel/ipv4/tcp_wmem_min + chown system system /sys/kernel/ipv4/tcp_wmem_def + chown system system /sys/kernel/ipv4/tcp_wmem_max + chown system system /sys/kernel/ipv4/tcp_rmem_min + chown system system /sys/kernel/ipv4/tcp_rmem_def + chown system system /sys/kernel/ipv4/tcp_rmem_max + chown root radio /proc/cmdline + + # Define default initial receive window size in segments. + setprop net.tcp.default_init_rwnd 60 + + class_start core + +on nonencrypted + class_start main + class_start late_start + +on property:vold.decrypt=trigger_default_encryption + start defaultcrypto + +on property:vold.decrypt=trigger_encryption + start surfaceflinger + start encrypt + +on property:sys.init_log_level=* + loglevel ${sys.init_log_level} + +on charger + class_start charger + +on property:vold.decrypt=trigger_reset_main + class_reset main + +on property:vold.decrypt=trigger_load_persist_props + load_persist_props + +on property:vold.decrypt=trigger_post_fs_data + trigger post-fs-data + +on property:vold.decrypt=trigger_restart_min_framework + class_start main + +on property:vold.decrypt=trigger_restart_framework + class_start main + class_start late_start + +on property:vold.decrypt=trigger_shutdown_framework + class_reset late_start + class_reset main + +on property:sys.powerctl=* + powerctl ${sys.powerctl} + +# system server cannot write to /proc/sys files, +# and chown/chmod does not work for /proc/sys/ entries. +# So proxy writes through init. +on property:sys.sysctl.extra_free_kbytes=* + write /proc/sys/vm/extra_free_kbytes ${sys.sysctl.extra_free_kbytes} + +# "tcp_default_init_rwnd" Is too long! +on property:sys.sysctl.tcp_def_init_rwnd=* + write /proc/sys/net/ipv4/tcp_default_init_rwnd ${sys.sysctl.tcp_def_init_rwnd} + + +## Daemon processes to be run by init. +## +service ueventd /sbin/ueventd + class core + critical + seclabel u:r:ueventd:s0 + +service logd /system/bin/logd + class core + socket logd stream 0666 logd logd + socket logdr seqpacket 0666 logd logd + socket logdw dgram 0222 logd logd + seclabel u:r:logd:s0 + +service healthd /sbin/healthd + class core + critical + seclabel u:r:healthd:s0 + +service console /system/bin/sh + class core + console + disabled + user shell + group shell log + seclabel u:r:shell:s0 + +service auditd /system/bin/auditd -k + seclabel u:r:logd:s0 + class main + +on property:ro.debuggable=1 + start console + +# adbd is controlled via property triggers in init..usb.rc +service adbd /sbin/adbd --root_seclabel=u:r:su:s0 + class core + socket adbd stream 660 system system + disabled + seclabel u:r:adbd:s0 + +# adbd on at boot in emulator +on property:ro.kernel.qemu=1 + start adbd + +service lmkd /system/bin/lmkd + class core + critical + socket lmkd seqpacket 0660 system system + +service servicemanager /system/bin/servicemanager + class core + user system + group system + critical + onrestart restart healthd + onrestart restart zygote + onrestart restart media + onrestart restart surfaceflinger + onrestart restart drm + +service vold /system/bin/vold + class core + socket vold stream 0660 root mount + ioprio be 2 + +service netd /system/bin/netd + class main + socket netd stream 0660 root system + socket dnsproxyd stream 0660 root inet + socket mdns stream 0660 root system + socket fwmarkd stream 0660 root inet + +service debuggerd /system/bin/debuggerd + class main + +service debuggerd64 /system/bin/debuggerd64 + class main + +#service ril-daemon /system/bin/rild +# class main +# socket rild stream 660 root radio +# socket rild-debug stream 660 radio system +# user root +# group radio cache inet misc audio sdcard_rw qcom_diag log + +service surfaceflinger /system/bin/surfaceflinger + class core + user system + group graphics drmrpc + onrestart restart zygote + +service drm /system/bin/drmserver + class main + user drm + group drm system inet drmrpc + +service media /system/bin/mediaserver + class main + user media + group audio camera inet net_bt net_bt_admin net_bw_acct drmrpc mediadrm qcom_diag + ioprio rt 4 + +# One shot invocation to deal with encrypted volume. +service defaultcrypto /system/bin/vdc --wait cryptfs mountdefaultencrypted + disabled + oneshot + # vold will set vold.decrypt to trigger_restart_framework (default + # encryption) or trigger_restart_min_framework (other encryption) + +# One shot invocation to encrypt unencrypted volumes +service encrypt /system/bin/vdc --wait cryptfs enablecrypto inplace default + disabled + oneshot + # vold will set vold.decrypt to trigger_restart_framework (default + # encryption) + +service bootanim /system/bin/bootanimation + class core + user graphics + group graphics audio + disabled + oneshot + +service installd /system/bin/installd + class main + socket installd stream 600 system system + +service flash_recovery /system/bin/install-recovery.sh + class main + seclabel u:r:install_recovery:s0 + oneshot + disabled + +# update recovery if enabled +on property:persist.sys.recovery_update=true + start flash_recovery + +service racoon /system/bin/racoon + class main + socket racoon stream 600 system system + # IKE uses UDP port 500. Racoon will setuid to vpn after binding the port. + group vpn net_admin inet + disabled + oneshot + +service mtpd /system/bin/mtpd + class main + socket mtpd stream 600 system system + user vpn + group vpn net_admin inet net_raw + disabled + oneshot + +service keystore /system/bin/keystore /data/misc/keystore + class main + user keystore + group keystore drmrpc + +service dumpstate /system/bin/dumpstate -s + class main + socket dumpstate stream 0660 shell log + disabled + oneshot + +service mdnsd /system/bin/mdnsd + class main + user mdnsr + group inet net_raw + socket mdnsd stream 0660 mdnsr inet + disabled + oneshot + +service pre-recovery /system/bin/uncrypt + class main + disabled + oneshot \ No newline at end of file diff --git a/ramdisk/lpm.rc b/ramdisk/lpm.rc new file mode 100644 index 0000000..f6418c7 --- /dev/null +++ b/ramdisk/lpm.rc @@ -0,0 +1,82 @@ +on early-init + start ueventd + + export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin + export LD_LIBRARY_PATH /vendor/lib:/system/lib + export ANDROID_ROOT /system + export ANDROID_DATA /data + export EXTERNAL_STORAGE /sdcard + + symlink /system/etc /etc + + mkdir /sdcard + mkdir /preload + mkdir /system + mkdir /data + mkdir /cache + mkdir /efs + mkdir /tmp + mkdir /dbdata + mkdir /mnt 0775 root root + #mount /tmp /tmp tmpfs + + mount ext4 /dev/block/mmcblk0p17 /system ro wait noatime + exec sfsck /dev/block/mmcblk0p19 ext4 + mount ext4 /dev/block/mmcblk0p19 /data wait nosuid nodev noatime discard,noauto_da_alloc,journal_async_commit + + mkdir /data/log 0777 + + chmod 0666 /dev/log/radio + chmod 0666 /dev/log/main + chmod 0666 /dev/log/event + +# write /sys/class/sec/switch/usb_sel PDA + +# CPU Frequency Governor + write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive + +# EHCI runtime enable for LPA + write /sys/devices/platform/s5p-ehci/power/control auto + + ifup lo + hostname localhost + domainname localdomain + + class_start charger + class_start default + +service debuggerd /system/bin/debuggerd + + service ueventd /sbin/ueventd + critical + +#service console /bin/sh +service console /system/bin/sh + console + +service playlpm /system/bin/playlpm + user root + +service immvibed /system/bin/immvibed + oneshot + +service lpmkey /system/bin/lpmkey + user root + +service battery_charger /charger + class charger + seclabel u:r:healthd:s0 + +# adbd is controlled by the persist.service.adb.enable system property +service adbd /sbin/adbd + disabled + +# adbd on at boot in emulator +on property:ro.kernel.qemu=1 + start adbd + +on property:persist.service.adb.enable=1 + start adbd + +on property:persist.service.adb.enable=0 + stop adbd \ No newline at end of file diff --git a/ramdisk/twrp.fstab.hawaii_ss_kylepro b/ramdisk/twrp.fstab.hawaii_ss_kylepro new file mode 100644 index 0000000..f370274 --- /dev/null +++ b/ramdisk/twrp.fstab.hawaii_ss_kylepro @@ -0,0 +1,9 @@ +/boot emmc /dev/block/platform/sdhci.1/by-name/KERNEL +/system ext4 /dev/block/platform/sdhci.1/by-name/system +/data ext4 /dev/block/platform/sdhci.1/by-name/userdata length=-16384 +/cache ext4 /dev/block/platform/sdhci.1/by-name/CSC +/recovery emmc /dev/block/platform/sdhci.1/by-name/RECOVERY +/modem emmc /dev/block/platform/sdhci.1/by-name/modem flags=display="Baseband";backup=1 +/efs ext4 /dev/block/platform/sdhci.1/by-name/efs flags=display="EFS";backup=1 +/external_sd vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1 flags=display="Micro SDcard";storage;wipeingui;removable +/preload ext4 /dev/block/platform/sdhci.1/by-name/HIDDEN flags=display="Preload";wipeingui;backup=1 diff --git a/ramdisk/ueventd.hawaii_ss_kylepro.rc b/ramdisk/ueventd.hawaii_ss_kylepro.rc new file mode 100644 index 0000000..a8e27c2 --- /dev/null +++ b/ramdisk/ueventd.hawaii_ss_kylepro.rc @@ -0,0 +1,72 @@ + +/dev/pvrsrvkm 0666 system system +/dev/graphics/fb0 0666 system graphics +/dev/video0 0660 system camera +/dev/video1 0660 system camera +/dev/video2 0660 system camera +/dev/s3c-jpg 0660 system camera +/dev/s3c-mem 0660 system system +/dev/s3c-mfc 0660 system graphics + +/dev/modem_ctl 0660 radio radio +/dev/modem_fmt 0660 radio radio +/dev/modem_rfs 0660 radio radio +/dev/s3c2410_serial3 0660 radio radio +/dev/block/mtdblock5 0660 radio radio +/dev/mtd/mtd5ro 0660 radio radio + +# for GPS +/dev/s3c2410_serial1 0600 gps gps + +# for Camera +/dev/bcm_unicam 0660 system camera +/dev/bcm_isp 0660 system camera +/dev/i2c-0 0660 system camera +/dev/i2c-1 0660 system camera +/dev/i2c-2 0660 system camera + +# for MM memory +/dev/ion 0666 system graphics + +#for V3D +/dev/v3d 0666 system graphics +/dev/pmem 0660 system graphics + +#for VCE +/dev/vce 0660 system graphics + +# sensors +/dev/mpu 0666 system system +/dev/mpuirq 0666 system system +/dev/timerirq 0666 system system +/dev/ami_sensor 0666 system system + +# for Hawaii +/dev/mm_v3d 0666 system graphics +/dev/mm_isp 0660 system camera +/dev/bcm_isp2 0660 system camera +/dev/mm_isp2 0666 system camera +/dev/bcm_jpeg 0660 system camera +/dev/mm_interlock 0666 system graphics +/dev/mm_h264 0660 media media +/dev/h264_ol 0660 media media + +# for h/w codec +/dev/brcm_h264 0660 media media + +#Permission for NV partition +/dev/block/mmcblk0p1 0770 radio system + +# SYSTEM Status +/dev/block/mmcblk0p11 0660 system root + +# for RIL to be able to open Kernel RPC drivers +/dev/bcm_rpc 0660 radio radio +/dev/bcm_irpc 0660 radio radio +/dev/bcm_atc 0660 shell system + +# SEC User Dump +# /dev/sec_user_dump 0660 system shell +/dev/mem 0660 system root +/dev/ttyGS0 0660 system system +/dev/snd/controlC0 0660 system audio \ No newline at end of file diff --git a/ril/com/android/internal/telephony/SamsungBCMRIL.java b/ril/com/android/internal/telephony/SamsungBCMRIL.java new file mode 100644 index 0000000..d91be63 --- /dev/null +++ b/ril/com/android/internal/telephony/SamsungBCMRIL.java @@ -0,0 +1,410 @@ +/* + * Copyright (C) 2012 The CyanogenMod Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.internal.telephony; + +import static com.android.internal.telephony.RILConstants.*; + +import android.content.Context; +import android.os.AsyncResult; +import android.os.Message; +import android.os.Parcel; +import android.os.SystemProperties; +import android.telephony.Rlog; +import com.android.internal.telephony.RILConstants; +import java.util.Collections; +import android.telephony.PhoneNumberUtils; + +import java.util.ArrayList; + +/** + * Custom RIL to handle unique behavior of BCM RIL + * + * {@hide} + */ +public class SamsungBCMRIL extends RIL implements CommandsInterface { + + private static int sEnabledDataSimId = -1; + + public SamsungBCMRIL(Context context, int networkMode, int cdmaSubscription) { + this(context, networkMode, cdmaSubscription, null); + } + + public SamsungBCMRIL(Context context, int networkMode, + int cdmaSubscription, Integer instanceId) { + super(context, networkMode, cdmaSubscription, instanceId); + mQANElements = 6; + } + + public void + dial(String address, int clirMode, UUSInfo uusInfo, Message result) { + RILRequest rr = RILRequest.obtain(RIL_REQUEST_DIAL, result); + + rr.mParcel.writeString(address); + rr.mParcel.writeInt(clirMode); + rr.mParcel.writeInt(0); // UUS information is absent: Samsung BCM compat + + if (uusInfo == null) { + rr.mParcel.writeInt(0); // UUS information is absent + } else { + rr.mParcel.writeInt(1); // UUS information is present + rr.mParcel.writeInt(uusInfo.getType()); + rr.mParcel.writeInt(uusInfo.getDcs()); + rr.mParcel.writeByteArray(uusInfo.getUserData()); + } + + if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); + + send(rr); + } + + public void setUiccSubscription(int slotId, int appIndex, int subId, + int subStatus, Message result) { + if (RILJ_LOGD) riljLog("setUiccSubscription" + slotId + " " + appIndex + " " + subId + " " + subStatus); + + // Fake response (note: should be sent before mSubscriptionStatusRegistrants or + // SubscriptionManager might not set the readiness correctly) + AsyncResult.forMessage(result, 0, null); + result.sendToTarget(); + + // TODO: Actually turn off/on the radio (and don't fight with the ServiceStateTracker) + if (subStatus == 1 /* ACTIVATE */) { + // Subscription changed: enabled + if (mSubscriptionStatusRegistrants != null) { + mSubscriptionStatusRegistrants.notifyRegistrants( + new AsyncResult (null, new int[] {1}, null)); + } + } else if (subStatus == 0 /* DEACTIVATE */) { + // Subscription changed: disabled + if (mSubscriptionStatusRegistrants != null) { + mSubscriptionStatusRegistrants.notifyRegistrants( + new AsyncResult (null, new int[] {0}, null)); + } + } + } + + @Override + public void setDataAllowed(boolean allowed, Message result) { + int simId = mInstanceId == null ? 0 : mInstanceId; + if (!allowed) { + // Deactivate data call. This happens when switching data SIM + // and the framework will wait for data call to be deactivated. + // Emulate this by switching to the other SIM. + simId = 1 - simId; + } + + if (sEnabledDataSimId != simId) { + if (RILJ_LOGD) riljLog("Setting data subscription to " + simId); + invokeOemRilRequestBrcm((byte) 0, (byte)(0x30 + simId), result); + sEnabledDataSimId = simId; + } else { + if (RILJ_LOGD) riljLog("Data subscription is already set to " + simId); + if (result != null) { + AsyncResult.forMessage(result, 0, null); + result.sendToTarget(); + } + } + } + + @Override + protected void notifyRegistrantsRilConnectionChanged(int rilVer) { + super.notifyRegistrantsRilConnectionChanged(rilVer); + if (rilVer != -1) { + if (mInstanceId != null) { + // Enable simultaneous data/voice on Multi-SIM + invokeOemRilRequestBrcm((byte) 3, (byte) 1, null); + } else { + // Set data subscription to allow data in either SIM slot when using single SIM mode + setDataAllowed(true, null); + } + } + } + + private void invokeOemRilRequestBrcm(byte key, byte value, Message response) { + invokeOemRilRequestRaw(new byte[] { 'B', 'R', 'C', 'M', key, value }, response); + } + + protected RILRequest + processSolicited (Parcel p) { + int serial, error; + + serial = p.readInt(); + error = p.readInt(); + + RILRequest rr; + + rr = findAndRemoveRequestFromList(serial); + + if (rr == null) { + Rlog.w(RILJ_LOG_TAG, "Unexpected solicited response! sn: " + + serial + " error: " + error); + return null; + } + + Object ret = null; + + if (error == 0 || p.dataAvail() > 0) { + // 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_DEPERSONALIZATION_CODE: 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: { + if (mTestingEmergencyCall.getAndSet(false)) { + if (mEmergencyCallbackModeRegistrant != null) { + riljLog("testing emergency call, notify ECM Registrants"); + mEmergencyCallbackModeRegistrant.notifyRegistrant(); + } + } + 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 RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE: ret = responseInts(p); break; + case RIL_REQUEST_ISIM_AUTHENTICATION: ret = responseString(p); break; + case RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU: ret = responseVoid(p); break; + case RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS: ret = responseICC_IO(p); break; + case RIL_REQUEST_VOICE_RADIO_TECH: ret = responseInts(p); break; + default: + throw new RuntimeException("Unrecognized solicited response: " + rr.mRequest); + //break; + }} catch (Throwable tr) { + // Exceptions here usually mean invalid RIL responses + + Rlog.w(RILJ_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(); + } + return rr; + } + } + + // Here and below fake RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED, see b/7255789. + // This is needed otherwise we don't automatically transition to the main lock + // screen when the pin or puk is entered incorrectly. + // Note for the I9082: we're faking more than the standard RIL + switch (rr.mRequest) { + case RIL_REQUEST_ENTER_SIM_PUK: + case RIL_REQUEST_ENTER_SIM_PUK2: + case RIL_REQUEST_ENTER_SIM_PIN: + case RIL_REQUEST_ENTER_SIM_PIN2: + case RIL_REQUEST_CHANGE_SIM_PIN: + case RIL_REQUEST_CHANGE_SIM_PIN2: + case RIL_REQUEST_SET_FACILITY_LOCK: + if (mIccStatusChangedRegistrants != null) { + if (RILJ_LOGD) { + riljLog("ON enter sim puk fakeSimStatusChanged: reg count=" + + mIccStatusChangedRegistrants.size()); + } + mIccStatusChangedRegistrants.notifyRegistrants(); + } + break; + } + + if (error != 0) { + rr.onError(error, ret); + return rr; + } + + 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(); + } + + return rr; + } + + @Override + protected Object + responseCallList(Parcel p) { + int num; + int voiceSettings; + ArrayList response; + DriverCall dc; + + num = p.readInt(); + response = new ArrayList(num); + + for (int i = 0 ; i < num ; i++) { + dc = new DriverCall(); + + dc.state = DriverCall.stateFromCLCC(p.readInt()); + dc.index = p.readInt(); + dc.TOA = p.readInt(); + dc.isMpty = (0 != p.readInt()); + dc.isMT = (0 != p.readInt()); + dc.als = p.readInt(); + voiceSettings = p.readInt(); + dc.isVoice = (0 == voiceSettings) ? false : true; + //Some Samsung magic data for Videocalls + // hack taken from smdk4210ril class + voiceSettings = p.readInt(); + //printing it to cosole for later investigation + Rlog.d(RILJ_LOG_TAG, "Samsung magic = " + voiceSettings); + dc.isVoicePrivacy = (0 != p.readInt()); + dc.number = p.readString(); + int np = p.readInt(); + dc.numberPresentation = DriverCall.presentationFromCLIP(np); + dc.name = p.readString(); + dc.namePresentation = p.readInt(); + int uusInfoPresent = p.readInt(); + if (uusInfoPresent == 1) { + dc.uusInfo = new UUSInfo(); + dc.uusInfo.setType(p.readInt()); + dc.uusInfo.setDcs(p.readInt()); + byte[] userData = p.createByteArray(); + dc.uusInfo.setUserData(userData); + riljLogv(String.format("Incoming UUS : type=%d, dcs=%d, length=%d", + dc.uusInfo.getType(), dc.uusInfo.getDcs(), + dc.uusInfo.getUserData().length)); + riljLogv("Incoming UUS : data (string)=" + + new String(dc.uusInfo.getUserData())); + riljLogv("Incoming UUS : data (hex): " + + IccUtils.bytesToHexString(dc.uusInfo.getUserData())); + } else { + riljLogv("Incoming UUS : NOT present!"); + } + + // Make sure there's a leading + on addresses with a TOA of 145 + dc.number = PhoneNumberUtils.stringFromStringAndTOA(dc.number, dc.TOA); + + response.add(dc); + + if (dc.isVoicePrivacy) { + mVoicePrivacyOnRegistrants.notifyRegistrants(); + riljLog("InCall VoicePrivacy is enabled"); + } else { + mVoicePrivacyOffRegistrants.notifyRegistrants(); + riljLog("InCall VoicePrivacy is disabled"); + } + } + + Collections.sort(response); + + return response; + } + +} diff --git a/sepolicy/bkmgrd.te b/sepolicy/bkmgrd.te new file mode 100644 index 0000000..5bb3658 --- /dev/null +++ b/sepolicy/bkmgrd.te @@ -0,0 +1,9 @@ +type bkmgrd, domain; +type bkmgrd_exec, file_type, exec_type; + +init_daemon_domain(bkmgrd) + +allow bkmgrd radio_device:chr_file rw_file_perms; +allow bkmgrd self:capability setuid; +allow bkmgrd system_data_file:file create_file_perms; +allow bkmgrd system_data_file:dir rw_dir_perms; diff --git a/sepolicy/bluetooth.te b/sepolicy/bluetooth.te new file mode 100644 index 0000000..b83582b --- /dev/null +++ b/sepolicy/bluetooth.te @@ -0,0 +1,2 @@ +allow bluetooth sysfs:file rw_file_perms; +allow bluetooth serial_device:chr_file rw_file_perms; \ No newline at end of file diff --git a/sepolicy/device.te b/sepolicy/device.te new file mode 100644 index 0000000..c185d01 --- /dev/null +++ b/sepolicy/device.te @@ -0,0 +1 @@ +type cam_block_device, dev_type; diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts new file mode 100644 index 0000000..fb4d614 --- /dev/null +++ b/sepolicy/file_contexts @@ -0,0 +1,51 @@ +/dev/bcm_isp u:object_r:camera_device:s0 +/dev/mm_isp u:object_r:camera_device:s0 +/dev/vce u:object_r:gpu_device:s0 +/dev/mm_h264 u:object_r:video_device:s0 +/dev/h264_ol u:object_r:video_device:s0 +/dev/brcm_h264 u:object_r:video_device:s0 +/dev/mm_v3d u:object_r:gpu_device:s0 +/dev/mm_interlock u:object_r:gpu_device:s0 +/dev/bcm_voip_chrdev u:object_r:audio_device:s0 +/dev/bcm_security u:object_r:radio_device:s0 +/dev/v3d u:object_r:gpu_device:s0 +/dev/pmem u:object_r:gpu_device:s0 +/dev/bralloc_mem u:object_r:gpu_device:s0 +/dev/graphics/fb0 u:object_r:gpu_device:s0 +/dev/modem_ctl u:object_r:radio_device:s0 +/dev/modem_fmt u:object_r:radio_device:s0 +/dev/modem_rfs u:object_r:radio_device:s0 +/dev/s3c2410_serial3 u:object_r:radio_device:s0 +/dev/s3c2410_serial1 u:object_r:gps_device:s0 +/dev/bcm_unicam u:object_r:camera_device:s0 +/dev/i2c-[0-9] u:object_r:camera_device:s0 +/dev/bcm_isp2 u:object_r:camera_device:s0 +/dev/mm_isp2 u:object_r:camera_device:s0 +/dev/bcm_jpeg u:object_r:camera_device:s0 +/dev/bcm_rpc u:object_r:radio_device:s0 +/dev/bcm_irpc u:object_r:radio_device:s0 + +/efs/bluetooth/bt_addr u:object_r:bluetooth_efs_file:s0 +/sys/devices/platform/bcmbt-rfkill.1/rfkill/rfkill0/state -- u:object_r:sysfs_bluetooth_writable:s0 +/sys/devices/platform/bcmbt-rfkill.1/rfkill/rfkill0/type -- u:object_r:sysfs_bluetooth_writable:s0 + +/dev/ttyS0 u:object_r:hci_attach_dev:s0 +/dev/ttyS1 u:object_r:gps_device:s0 +#/dev/ttyS2 u:object_r:gps_device:s0 +/dev/bcm_gps u:object_r:gps_device:s0 + +/dev/bcm_log u:object_r:radio_device:s0 +/dev/block/mmcblk0p1 u:object_r:radio_device:s0 + +/dev/socket/rild1 u:object_r:rild_socket:s0 + +/sys/devices/platform/mdnie/mdnie/mdnie/cabc -- u:object_r:sysfs_writable:s0 + +# /system files +/system/bin/geomagneticd u:object_r:geomagneticd_exec:s0 +/system/bin/immvibed u:object_r:immvibed_exec:s0 +/system/bin/macloader u:object_r:macloader_exec:s0 +/system/bin/tvserver u:object_r:tvserver_exec:s0 +/system/bin/bkmgrd u:object_r:bkmgrd_exec:s0 +/system/bin/vclmk u:object_r:vclmk_exec:s0 +/system/bin/glgps u:object_r:gpsd_exec:s0 diff --git a/sepolicy/geomagneticd.te b/sepolicy/geomagneticd.te new file mode 100644 index 0000000..99ea452 --- /dev/null +++ b/sepolicy/geomagneticd.te @@ -0,0 +1,12 @@ +type geomagneticd, domain; +type geomagneticd_exec, file_type, exec_type; + +init_daemon_domain(geomagneticd) + +allow geomagneticd input_device:chr_file r_file_perms; +allow geomagneticd input_device:dir r_dir_perms; +allow geomagneticd sysfs:file rw_file_perms; + +# yas.cfg +allow geomagneticd system_data_file:file create_file_perms; +allow geomagneticd system_data_file:dir rw_dir_perms; diff --git a/sepolicy/gpsd.te b/sepolicy/gpsd.te new file mode 100644 index 0000000..c72a45b --- /dev/null +++ b/sepolicy/gpsd.te @@ -0,0 +1,5 @@ +allow gpsd system_data_file:dir rw_dir_perms; +allow gpsd system_data_file:file create_file_perms; +allow gpsd system_data_file:fifo_file { rw_file_perms create unlink setattr }; + +wakelock_use(gpsd) diff --git a/sepolicy/immvibed.te b/sepolicy/immvibed.te new file mode 100644 index 0000000..12ee332 --- /dev/null +++ b/sepolicy/immvibed.te @@ -0,0 +1,4 @@ +type immvibed, domain; +type immvibed_exec, file_type, exec_type; + +init_daemon_domain(immvibed) diff --git a/sepolicy/init.te b/sepolicy/init.te new file mode 100644 index 0000000..fdd83bc --- /dev/null +++ b/sepolicy/init.te @@ -0,0 +1,7 @@ +# chmod in init.capri_ss_baffin.rc (for bkmgrd) +allow init block_device:blk_file setattr; +allow init radio_device:blk_file setattr; + +# insmod +allow init self:capability sys_module; # TODO: want sys_ptrace too +allow init kernel:security setenforce; \ No newline at end of file diff --git a/sepolicy/kernel.te b/sepolicy/kernel.te new file mode 100644 index 0000000..97173fe --- /dev/null +++ b/sepolicy/kernel.te @@ -0,0 +1,6 @@ +# Create mmcblk1 +allow kernel device:blk_file { create setattr }; +allow kernel self:capability mknod; + +# kcamfwcheck drivers/char/broadcom/vc_cam/vc_cam.c +allow kernel cam_block_device:blk_file rw_file_perms; diff --git a/sepolicy/macloader.te b/sepolicy/macloader.te new file mode 100644 index 0000000..a1bc673 --- /dev/null +++ b/sepolicy/macloader.te @@ -0,0 +1,9 @@ +type macloader, domain; +type macloader_exec, file_type, exec_type; + +init_daemon_domain(macloader) + +# Read EFS +allow macloader efs_file:dir rw_dir_perms; +allow macloader efs_file:file rw_file_perms; +allow macloader self:capability dac_override; diff --git a/sepolicy/property_contexts b/sepolicy/property_contexts new file mode 100644 index 0000000..ac1dc55 --- /dev/null +++ b/sepolicy/property_contexts @@ -0,0 +1,2 @@ +service.brcm.bt.mac u:object_r:radio_prop:s0 +persist.sys.pdpcontext. u:object_r:radio_prop:s0 diff --git a/sepolicy/rild.te b/sepolicy/rild.te new file mode 100644 index 0000000..5fc863a --- /dev/null +++ b/sepolicy/rild.te @@ -0,0 +1,16 @@ +allow rild self:capability dac_override; + +allow rild gps_data_file:fifo_file { write read open setattr }; +allow rild gps_data_file:dir search; + +allow rild system_data_file:sock_file { create setattr unlink }; +allow rild system_data_file:dir rw_dir_perms; + +allow rild self:packet_socket { create ioctl }; + +allow rild block_device:dir search; + +# /proc/bcm_fuse_net_config +allow rild proc:file write; +allow rild gps_device:chr_file rw_file_perms; +allow rild block_device:chr_file rw_file_perms; \ No newline at end of file diff --git a/sepolicy/service_contexts b/sepolicy/service_contexts new file mode 100644 index 0000000..ddb8a10 --- /dev/null +++ b/sepolicy/service_contexts @@ -0,0 +1 @@ +broadcom.tvservice u:object_r:system_server_service:s0 diff --git a/sepolicy/shell.te b/sepolicy/shell.te new file mode 100644 index 0000000..8db3c16 --- /dev/null +++ b/sepolicy/shell.te @@ -0,0 +1,3 @@ +# Not sure why +allow shell serial_device:chr_file rw_file_perms; +allow shell block_device:chr_file rw_file_perms; \ No newline at end of file diff --git a/sepolicy/surfaceflinger.te b/sepolicy/surfaceflinger.te new file mode 100644 index 0000000..274cf1e --- /dev/null +++ b/sepolicy/surfaceflinger.te @@ -0,0 +1 @@ +allow surfaceflinger debug_prop:property_service set; \ No newline at end of file diff --git a/sepolicy/system_server.te b/sepolicy/system_server.te new file mode 100644 index 0000000..fda6c37 --- /dev/null +++ b/sepolicy/system_server.te @@ -0,0 +1,8 @@ +# Access /sys/devices/platform/mdnie/mdnie/mdnie/cabc +allow system_server sysfs_writable:file rw_file_perms; + +# Access /efs/wifi/.mac.info +allow system_server efs_file:file { read open }; + +# Not sure why +allow system_server efs_file:dir search; diff --git a/sepolicy/tvserver.te b/sepolicy/tvserver.te new file mode 100644 index 0000000..81b6c69 --- /dev/null +++ b/sepolicy/tvserver.te @@ -0,0 +1,8 @@ +type tvserver, domain; +type tvserver_exec, file_type, exec_type; + +init_daemon_domain(tvserver) +binder_use(tvserver) + +allow tvserver gpu_device:chr_file rw_file_perms; +allow tvserver system_server_service:service_manager add; diff --git a/sepolicy/vclmk.te b/sepolicy/vclmk.te new file mode 100644 index 0000000..8aa163d --- /dev/null +++ b/sepolicy/vclmk.te @@ -0,0 +1,14 @@ +type vclmk, domain; +type vclmk_exec, file_type, exec_type; + +init_daemon_domain(vclmk) + +allow vclmk gpu_device:chr_file rw_file_perms; +allow vclmk video_device:chr_file rw_file_perms; + +# Access app data in /proc/pid +allow vclmk domain:dir r_dir_perms; +allow vclmk domain:file r_file_perms; + +# Kill apps +allow vclmk appdomain:process { sigkill sigstop signal }; diff --git a/sepolicy/zygote.te b/sepolicy/zygote.te new file mode 100644 index 0000000..e1acfd2 --- /dev/null +++ b/sepolicy/zygote.te @@ -0,0 +1,2 @@ +# Not sure why +binder_use(zygote) diff --git a/system.prop b/system.prop new file mode 100644 index 0000000..2b84f9a --- /dev/null +++ b/system.prop @@ -0,0 +1,35 @@ +# +# KYLEPRO (GT-S7580) +# + +persist.brcm.log=none +persist.brcm.cp_crash=none +persist.brcm.ap_crash=none + +rild.libpath=/system/lib/libbrcm_ril.so +#rild.libargs=-d /dev/ttyS0 +ro.sf.lcd_density=240 +ro.lcd_brightness=160 +ro.lcd_min_brightness=18 + +# MultiTouch support +ro.product.multi_touch_enabled=true +ro.product.max_num_touch=2 + +net.streaming.rtsp.uaprof=http://wap.samsungmobile.com/uaprof/ + +ro.opengles.version=131072 +debug.hwui.render_dirty_regions=false +brcm.graphics.async_errors=false +brcm.hwc.no-hdmi-trans=1 + +#adative video encoding +video.enc.h264.adaptive_quality=1 +video.enc.h264.timing_window_sz=4 +video.enc.h264.timing_thr0=295 +video.enc.h264.timing_thr1=215 +video.enc.h264.timing_thr2=145 + +ro.ril.hsxpa=1 +ro.ril.gprsclass=10 +ro.com.google.gmsversion=4.1_r4 \ No newline at end of file diff --git a/vendorsetup.sh b/vendorsetup.sh new file mode 100644 index 0000000..405318e --- /dev/null +++ b/vendorsetup.sh @@ -0,0 +1,3 @@ +for i in eng userdebug user; do + add_lunch_combo cm_kylepro-${i} +done