mirror of
https://github.com/Evolution-X-Devices/device_google_wahoo
synced 2026-02-01 07:50:47 +00:00
Merge remote-tracking branch 'goog/stage-aosp-master' into HEAD
This commit is contained in:
6
Android.bp
Normal file
6
Android.bp
Normal file
@@ -0,0 +1,6 @@
|
||||
subdirs = [
|
||||
"vr",
|
||||
"vibrator",
|
||||
"wifi_offload",
|
||||
"usb",
|
||||
]
|
||||
22
Android.mk
Normal file
22
Android.mk
Normal file
@@ -0,0 +1,22 @@
|
||||
#
|
||||
# Copyright 2017 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
ifeq ($(USES_DEVICE_GOOGLE_WAHOO),true)
|
||||
subdir_makefiles=$(call first-makefiles-under,$(LOCAL_PATH))
|
||||
$(foreach mk,$(subdir_makefiles),$(info including $(mk) ...)$(eval include $(mk)))
|
||||
endif
|
||||
168
BoardConfig.mk
Normal file
168
BoardConfig.mk
Normal file
@@ -0,0 +1,168 @@
|
||||
#
|
||||
# Copyright (C) 2016 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.
|
||||
#
|
||||
|
||||
TARGET_BOARD_PLATFORM := msm8998
|
||||
|
||||
TARGET_ARCH := arm64
|
||||
TARGET_ARCH_VARIANT := armv8-a
|
||||
TARGET_CPU_ABI := arm64-v8a
|
||||
TARGET_CPU_ABI2 :=
|
||||
TARGET_CPU_VARIANT := cortex-a73
|
||||
|
||||
TARGET_2ND_ARCH := arm
|
||||
TARGET_2ND_ARCH_VARIANT := armv7-a-neon
|
||||
TARGET_2ND_CPU_ABI := armeabi-v7a
|
||||
TARGET_2ND_CPU_ABI2 := armeabi
|
||||
TARGET_2ND_CPU_VARIANT := cortex-a73
|
||||
|
||||
BOARD_KERNEL_CMDLINE += androidboot.hardware=$(TARGET_BOOTLOADER_BOARD_NAME) androidboot.console=ttyMSM0 lpm_levels.sleep_disabled=1
|
||||
BOARD_KERNEL_CMDLINE += user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3
|
||||
BOARD_KERNEL_CMDLINE += service_locator.enable=1
|
||||
BOARD_KERNEL_CMDLINE += swiotlb=2048
|
||||
BOARD_KERNEL_CMDLINE += firmware_class.path=/vendor/firmware
|
||||
BOARD_KERNEL_CMDLINE += loop.max_part=7
|
||||
|
||||
BOARD_KERNEL_BASE := 0x00000000
|
||||
BOARD_KERNEL_PAGESIZE := 4096
|
||||
ifeq ($(filter-out walleye_kasan, muskie_kasan, $(TARGET_PRODUCT)),)
|
||||
BOARD_KERNEL_OFFSET := 0x80000
|
||||
BOARD_KERNEL_TAGS_OFFSET := 0x02500000
|
||||
BOARD_RAMDISK_OFFSET := 0x02700000
|
||||
BOARD_MKBOOTIMG_ARGS := --kernel_offset $(BOARD_KERNEL_OFFSET) --ramdisk_offset $(BOARD_RAMDISK_OFFSET) --tags_offset $(BOARD_KERNEL_TAGS_OFFSET)
|
||||
else
|
||||
BOARD_KERNEL_TAGS_OFFSET := 0x01E00000
|
||||
BOARD_RAMDISK_OFFSET := 0x02000000
|
||||
endif
|
||||
|
||||
TARGET_NO_BOOTLOADER ?= true
|
||||
TARGET_NO_KERNEL := false
|
||||
TARGET_NO_RECOVERY := true
|
||||
BOARD_USES_RECOVERY_AS_BOOT := true
|
||||
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
|
||||
|
||||
# Partitions (listed in the file) to be wiped under recovery.
|
||||
TARGET_RECOVERY_WIPE := device/google/wahoo/recovery.wipe
|
||||
TARGET_RECOVERY_FSTAB := device/google/wahoo/fstab.hardware
|
||||
|
||||
BOARD_AVB_ENABLE := true
|
||||
|
||||
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2684354560
|
||||
BOARD_SYSTEMIMAGE_JOURNAL_SIZE := 0
|
||||
BOARD_SYSTEMIMAGE_EXTFS_INODE_COUNT := 4096
|
||||
TARGET_USERIMAGES_USE_EXT4 := true
|
||||
BOARD_USERDATAIMAGE_PARTITION_SIZE := 26503790080
|
||||
BOARD_PERSISTIMAGE_PARTITION_SIZE := 33554432
|
||||
BOARD_PERSISTIMAGE_FILE_SYSTEM_TYPE := ext4
|
||||
BOARD_FLASH_BLOCK_SIZE := 131072
|
||||
|
||||
# DTBO partition definitions
|
||||
BOARD_PREBUILT_DTBOIMAGE := device/google/wahoo-kernel/dtbo.img
|
||||
BOARD_DTBOIMG_PARTITION_SIZE := 8388608
|
||||
|
||||
ENABLE_CPUSETS := true
|
||||
|
||||
TARGET_COPY_OUT_VENDOR := vendor
|
||||
|
||||
# Install odex files into the other system image
|
||||
BOARD_USES_SYSTEM_OTHER_ODEX := true
|
||||
|
||||
BOARD_ROOT_EXTRA_FOLDERS := persist firmware metadata
|
||||
|
||||
BOARD_SEPOLICY_DIRS += device/google/wahoo/sepolicy/vendor
|
||||
BOARD_PLAT_PUBLIC_SEPOLICY_DIR := device/google/wahoo/sepolicy/public
|
||||
BOARD_PLAT_PRIVATE_SEPOLICY_DIR := device/google/wahoo/sepolicy/private
|
||||
BOARD_SEPOLICY_DIRS += device/google/wahoo/sepolicy/verizon
|
||||
|
||||
TARGET_ANDROID_FILESYSTEM_CONFIG_H := device/google/wahoo/android_filesystem_config.h
|
||||
|
||||
QCOM_BOARD_PLATFORMS += msm8998
|
||||
BOARD_HAVE_BLUETOOTH_QCOM := true
|
||||
BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/google/wahoo/bluetooth
|
||||
|
||||
# Enable dex pre-opt to speed up initial boot
|
||||
ifeq ($(HOST_OS),linux)
|
||||
ifeq ($(WITH_DEXPREOPT),)
|
||||
WITH_DEXPREOPT := true
|
||||
WITH_DEXPREOPT_PIC := true
|
||||
ifneq ($(TARGET_BUILD_VARIANT),user)
|
||||
# Retain classes.dex in APK's for non-user builds
|
||||
DEX_PREOPT_DEFAULT := nostripping
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Camera
|
||||
TARGET_USES_AOSP := true
|
||||
BOARD_QTI_CAMERA_32BIT_ONLY := true
|
||||
CAMERA_DAEMON_NOT_PRESENT := true
|
||||
TARGET_USES_ION := true
|
||||
TARGET_USES_EASEL := true
|
||||
|
||||
# GPS
|
||||
TARGET_NO_RPC := true
|
||||
BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default
|
||||
BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET := true
|
||||
|
||||
# RenderScript
|
||||
OVERRIDE_RS_DRIVER := libRSDriver_adreno.so
|
||||
|
||||
# wlan
|
||||
BOARD_WLAN_DEVICE := qcwcn
|
||||
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
|
||||
BOARD_HOSTAPD_DRIVER := NL80211
|
||||
WIFI_DRIVER_DEFAULT := qca_cld3
|
||||
WPA_SUPPLICANT_VERSION := VER_0_8_X
|
||||
WIFI_DRIVER_FW_PATH_STA := "sta"
|
||||
WIFI_DRIVER_FW_PATH_AP := "ap"
|
||||
WIFI_DRIVER_FW_PATH_P2P := "p2p"
|
||||
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
|
||||
BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
|
||||
WIFI_HIDL_FEATURE_AWARE := true
|
||||
|
||||
# Audio
|
||||
BOARD_USES_ALSA_AUDIO := true
|
||||
USE_XML_AUDIO_POLICY_CONF := 1
|
||||
AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true
|
||||
AUDIO_FEATURE_ENABLED_SND_MONITOR := true
|
||||
AUDIO_FEATURE_ENABLED_USB_TUNNEL := true
|
||||
BOARD_ROOT_EXTRA_SYMLINKS := /vendor/lib/dsp:/dsp
|
||||
|
||||
# Include whaoo modules
|
||||
USES_DEVICE_GOOGLE_WAHOO := true
|
||||
|
||||
# Graphics
|
||||
TARGET_USES_GRALLOC1 := true
|
||||
TARGET_USES_HWC2 := true
|
||||
|
||||
VSYNC_EVENT_PHASE_OFFSET_NS := 2000000
|
||||
SF_VSYNC_EVENT_PHASE_OFFSET_NS := 6000000
|
||||
|
||||
# Display
|
||||
TARGET_HAS_WIDE_COLOR_DISPLAY := true
|
||||
TARGET_HAS_HDR_DISPLAY := false
|
||||
TARGET_USES_COLOR_METADATA := true
|
||||
|
||||
# Charger Mode
|
||||
BOARD_CHARGER_ENABLE_SUSPEND := true
|
||||
|
||||
# Vendor Interface Manifest
|
||||
DEVICE_MANIFEST_FILE := device/google/wahoo/manifest.xml
|
||||
DEVICE_MATRIX_FILE := device/google/wahoo/compatibility_matrix.xml
|
||||
|
||||
BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
|
||||
|
||||
# Use mke2fs to create ext4 images
|
||||
TARGET_USES_MKE2FS := true
|
||||
145
CleanSpec.mk
Normal file
145
CleanSpec.mk
Normal file
@@ -0,0 +1,145 @@
|
||||
# Copyright 2017 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
# If you don't need to do a full clean build but would like to touch
|
||||
# a file or delete some intermediate files, add a clean step to the end
|
||||
# of the list. These steps will only be run once, if they haven't been
|
||||
# run before.
|
||||
#
|
||||
# E.g.:
|
||||
# $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
|
||||
# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
|
||||
#
|
||||
# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
|
||||
# files that are missing or have been moved.
|
||||
#
|
||||
# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
|
||||
# Use $(OUT_DIR) to refer to the "out" directory.
|
||||
#
|
||||
# If you need to re-do something that's already mentioned, just copy
|
||||
# the command and add it to the bottom of the list. E.g., if a change
|
||||
# that you made last week required touching a file and a change you
|
||||
# made today requires touching the same file, just copy the old
|
||||
# touch step and add it to the end of the list.
|
||||
#
|
||||
# ************************************************
|
||||
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
|
||||
# ************************************************
|
||||
|
||||
# For example:
|
||||
#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
|
||||
#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
|
||||
#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
|
||||
#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
|
||||
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/bin/init.power.sh)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/bin/init.radio.sh)
|
||||
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/root/init.$(PRODUCT_HARDWARE).rc)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/root/init.wahoo.usb.rc)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/root/init.$(PRODUCT_HARDWARE).diag.rc)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/root/ueventd.$(PRODUCT_HARDWARE).rc)
|
||||
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.camera.flash-autofocus.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.camera.front.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.camera.full.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.camera.raw.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.bluetooth.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.bluetooth_le.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.sensor.accelerometer.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.sensor.compass.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.sensor.gyroscope.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.sensor.light.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.sensor.proximity.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.sensor.barometer.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.sensor.stepcounter.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.sensor.stepdetector.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.sensor.hifi_sensors.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.location.gps.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.telephony.gsm.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.telephony.cdma.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.wifi.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.wifi.direct.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.wifi.passpoint.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.software.sip.voip.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.usb.accessory.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.usb.host.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.opengles.aep.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.nfc.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.nfc.hce.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.nfc.hcef.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.vr.headtracking.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.vr.high_performance.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.vulkan.level.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.vulkan.version.xml)
|
||||
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/wifi/wpa_supplicant_overlay.conf)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/wifi/p2p_supplicant_overlay.conf)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/wifi/wifi_concurrency_cfg.txt)
|
||||
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib/hw/lights.$(PRODUCT_HARDWARE).so)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib64/hw/lights.$(PRODUCT_HARDWARE).so)
|
||||
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/sec_config)
|
||||
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/audio_policy_configuration.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/a2dp_audio_policy_configuration.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/usb_audio_policy_configuration.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/r_submix_audio_policy_configuration.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/audio_policy_volumes.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/default_volume_tables.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/mixer_paths.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/mixer_paths_tasha.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/mixer_paths_tavil.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/audio_platform_info.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/audio_platform_info_tavil.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/sound_trigger_platform_info.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/sound_trigger_mixer_paths_wcd9340.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/graphite_ipc_platform_info.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/media_codecs.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/media_codecs_performance.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/media_codecs_google_audio.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/media_codecs_google_telephony.xml)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/media_codecs_google_video.xml)
|
||||
|
||||
# Move /system/lib/vndk-sp to /system/lib/vndk-sp-26.1.0
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib/vndk-sp)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib64/vndk-sp)
|
||||
|
||||
# Revert: Move /system/lib/vndk-sp to /system/lib/vndk-sp-26.1.0
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib/vndk-sp-*)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib64/vndk-sp-*)
|
||||
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/lowi.conf)
|
||||
|
||||
# Vibrator HAL 1.0
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/init/android.hardware.vibrator@1.0-service.wahoo.rc)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/bin/hw/android.hardware.vibrator@1.0-service.wahoo)
|
||||
|
||||
# Broadcast Radio HAL impl 1.0
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/lib/hw/android.hardware.broadcastradio@1.0-impl.so)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/lib64/hw/android.hardware.broadcastradio@1.0-impl.so)
|
||||
|
||||
# Revert /system/lib[64]/vndk-sp/libz.so
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libz.vndk-sp_*)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/symbols/system/lib/vndk-sp/libz.so)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/symbols/system/lib64/vndk-sp/libz.so)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib/vndk-sp/libz.so)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib64/vndk-sp/libz.so)
|
||||
|
||||
# Remove eSIM OTA image
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/priv-app/EuiccGoogle/esim.img)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/priv-app/EuiccGoogle/esim2.img)
|
||||
45
android_filesystem_config.h
Normal file
45
android_filesystem_config.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* This file is used to define the properties of the filesystem
|
||||
** images generated by build tools (mkbootfs and mkyaffs2image) and
|
||||
** by the device side of adb.
|
||||
*/
|
||||
|
||||
#include <private/android_filesystem_config.h>
|
||||
|
||||
static const struct fs_path_config android_device_dirs[] = {
|
||||
{ 00771, AID_SYSTEM, AID_SYSTEM, 0, "bt_firmware"},
|
||||
};
|
||||
|
||||
/* Rules for files.
|
||||
** These rules are applied based on "first match", so they
|
||||
** should start with the most specific path and work their
|
||||
** way up to the root. Prefixes ending in * denotes wildcard
|
||||
** and will allow partial matches.
|
||||
*/
|
||||
static const struct fs_path_config android_device_files[] = {
|
||||
{ 00755, AID_SYSTEM, AID_SYSTEM, (1ULL << CAP_NET_BIND_SERVICE), "vendor/bin/pm-service" },
|
||||
{ 00755, AID_SYSTEM, AID_SYSTEM, (1ULL << CAP_NET_BIND_SERVICE), "vendor/bin/cnss-daemon"},
|
||||
{ 00755, AID_SYSTEM, AID_SYSTEM, (1ULL << CAP_NET_BIND_SERVICE), "vendor/bin/imsdatadaemon" },
|
||||
{ 00755, AID_SYSTEM, AID_SYSTEM, (1ULL << CAP_NET_BIND_SERVICE)
|
||||
| (1ULL << CAP_BLOCK_SUSPEND), "vendor/bin/cnd" },
|
||||
{ 00755, AID_SYSTEM, AID_RADIO, (1ULL << CAP_NET_BIND_SERVICE), "vendor/bin/ims_rtp_daemon" },
|
||||
{ 00755, AID_SYSTEM, AID_SYSTEM, (1ULL << CAP_SYS_NICE) | (1ULL << CAP_BLOCK_SUSPEND), "vendor/bin/wcnss_filter" },
|
||||
#ifdef NO_ANDROID_FILESYSTEM_CONFIG_DEVICE_DIRS
|
||||
{ 00000, AID_ROOT, AID_ROOT, 0, "system/etc/fs_config_dirs" },
|
||||
#endif
|
||||
};
|
||||
32855
apns-full-conf.xml
Normal file
32855
apns-full-conf.xml
Normal file
File diff suppressed because it is too large
Load Diff
201
audio_policy_configuration.xml
Normal file
201
audio_policy_configuration.xml
Normal file
@@ -0,0 +1,201 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!-- Copyright (C) 2016 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.
|
||||
-->
|
||||
|
||||
<audioPolicyConfiguration version="1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<globalConfiguration speaker_drc_enabled="true"/>
|
||||
|
||||
<modules>
|
||||
<module name="primary" halVersion="2.0">
|
||||
<attachedDevices>
|
||||
<item>Speaker</item>
|
||||
<item>Speaker Safe</item>
|
||||
<item>Earpiece</item>
|
||||
<item>Telephony Tx</item>
|
||||
<item>Built-In Mic</item>
|
||||
<item>Built-In Back Mic</item>
|
||||
<item>Telephony Rx</item>
|
||||
</attachedDevices>
|
||||
<defaultOutputDevice>Speaker</defaultOutputDevice>
|
||||
<mixPorts>
|
||||
<mixPort name="primary output" role="source" flags="AUDIO_OUTPUT_FLAG_PRIMARY|AUDIO_OUTPUT_FLAG_FAST">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</mixPort>
|
||||
<mixPort name="raw" role="source" flags="AUDIO_OUTPUT_FLAG_RAW|AUDIO_OUTPUT_FLAG_FAST">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</mixPort>
|
||||
<mixPort name="hifi_playback" role="source" />
|
||||
<mixPort name="deep_buffer" role="source"
|
||||
flags="AUDIO_OUTPUT_FLAG_DEEP_BUFFER">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_24_BIT_PACKED"
|
||||
samplingRates="44100,48000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</mixPort>
|
||||
<mixPort name="compressed_offload" role="source"
|
||||
flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING">
|
||||
<profile name="" format="AUDIO_FORMAT_MP3"
|
||||
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
|
||||
<profile name="" format="AUDIO_FORMAT_AAC_LC"
|
||||
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
|
||||
<profile name="" format="AUDIO_FORMAT_AAC_HE_V1"
|
||||
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
|
||||
<profile name="" format="AUDIO_FORMAT_AAC_HE_V2"
|
||||
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
|
||||
channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
|
||||
</mixPort>
|
||||
<mixPort name="voice_tx" role="source">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000,16000,48000" channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</mixPort>
|
||||
<mixPort name="mmap_no_irq_out" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_MMAP_NOIRQ">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</mixPort>
|
||||
<mixPort name="voip_rx" role="source"
|
||||
flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_VOIP_RX">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000,16000,32000,48000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
|
||||
</mixPort>
|
||||
<mixPort name="primary input" role="sink">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_8_24_BIT"
|
||||
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
|
||||
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_INDEX_MASK_3"/>
|
||||
</mixPort>
|
||||
<mixPort name="fast input" role="sink" flags="AUDIO_INPUT_FLAG_FAST">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_8_24_BIT"
|
||||
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
|
||||
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_INDEX_MASK_3"/>
|
||||
</mixPort>
|
||||
<mixPort name="hifi_input" role="sink" />
|
||||
<mixPort name="voice_rx" role="sink">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000,16000,48000" channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
|
||||
</mixPort>
|
||||
<mixPort name="mmap_no_irq_in" role="sink" flags="AUDIO_INPUT_FLAG_MMAP_NOIRQ">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
|
||||
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_INDEX_MASK_3"/>
|
||||
</mixPort>
|
||||
<mixPort name="voip_tx" role="sink"
|
||||
flags="AUDIO_INPUT_FLAG_VOIP_TX">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="8000,16000,32000,48000" channelMasks="AUDIO_CHANNEL_IN_MONO"/>
|
||||
</mixPort>
|
||||
</mixPorts>
|
||||
<devicePorts>
|
||||
<devicePort tagName="Earpiece" type="AUDIO_DEVICE_OUT_EARPIECE" role="sink">
|
||||
</devicePort>
|
||||
<devicePort tagName="Speaker" type="AUDIO_DEVICE_OUT_SPEAKER" role="sink">
|
||||
</devicePort>
|
||||
<devicePort tagName="Speaker Safe" type="AUDIO_DEVICE_OUT_SPEAKER_SAFE" role="sink">
|
||||
</devicePort>
|
||||
<devicePort tagName="BT SCO" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO" role="sink">
|
||||
</devicePort>
|
||||
<devicePort tagName="BT SCO Headset" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET" role="sink">
|
||||
</devicePort>
|
||||
<devicePort tagName="BT SCO Car Kit" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT" role="sink">
|
||||
</devicePort>
|
||||
<devicePort tagName="Telephony Tx" type="AUDIO_DEVICE_OUT_TELEPHONY_TX" role="sink">
|
||||
</devicePort>
|
||||
<devicePort tagName="USB Device Out" type="AUDIO_DEVICE_OUT_USB_DEVICE" role="sink">
|
||||
</devicePort>
|
||||
<devicePort tagName="USB Headset Out" type="AUDIO_DEVICE_OUT_USB_HEADSET" role="sink">
|
||||
</devicePort>
|
||||
<devicePort tagName="Built-In Mic" type="AUDIO_DEVICE_IN_BUILTIN_MIC" role="source">
|
||||
</devicePort>
|
||||
<devicePort tagName="Built-In Back Mic" type="AUDIO_DEVICE_IN_BACK_MIC" role="source">
|
||||
</devicePort>
|
||||
<devicePort tagName="BT SCO Headset Mic" type="AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET" role="source">
|
||||
</devicePort>
|
||||
<devicePort tagName="Telephony Rx" type="AUDIO_DEVICE_IN_TELEPHONY_RX" role="source">
|
||||
</devicePort>
|
||||
<!-- TODO: Enable multi-channel recording -->
|
||||
<devicePort tagName="USB Device In" type="AUDIO_DEVICE_IN_USB_DEVICE" role="source">
|
||||
</devicePort>
|
||||
<devicePort tagName="USB Headset In" type="AUDIO_DEVICE_IN_USB_HEADSET" role="source">
|
||||
</devicePort>
|
||||
</devicePorts>
|
||||
<routes>
|
||||
<route type="mix" sink="Earpiece"
|
||||
sources="primary output,raw,deep_buffer,mmap_no_irq_out,voip_rx"/>
|
||||
<route type="mix" sink="Speaker"
|
||||
sources="primary output,raw,deep_buffer,compressed_offload,mmap_no_irq_out,voip_rx"/>
|
||||
<route type="mix" sink="Speaker Safe"
|
||||
sources="primary output,raw,deep_buffer,compressed_offload,mmap_no_irq_out,voip_rx"/>
|
||||
<route type="mix" sink="BT SCO"
|
||||
sources="primary output,raw,deep_buffer,voip_rx"/>
|
||||
<route type="mix" sink="BT SCO Headset"
|
||||
sources="primary output,raw,deep_buffer,voip_rx"/>
|
||||
<route type="mix" sink="BT SCO Car Kit"
|
||||
sources="primary output,raw,deep_buffer,voip_rx"/>
|
||||
<route type="mix" sink="USB Device Out"
|
||||
sources="primary output,raw,deep_buffer,compressed_offload,hifi_playback,mmap_no_irq_out,voip_rx"/>
|
||||
<route type="mix" sink="USB Headset Out"
|
||||
sources="primary output,raw,deep_buffer,compressed_offload,hifi_playback,mmap_no_irq_out,voip_rx"/>
|
||||
<route type="mix" sink="Telephony Tx"
|
||||
sources="voice_tx"/>
|
||||
<route type="mix" sink="primary input"
|
||||
sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In"/>
|
||||
<route type="mix" sink="fast input"
|
||||
sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In"/>
|
||||
<route type="mix" sink="voice_rx"
|
||||
sources="Telephony Rx"/>
|
||||
<route type="mix" sink="hifi_input" sources="USB Device In,USB Headset In" />
|
||||
<route type="mix" sink="mmap_no_irq_in"
|
||||
sources="Built-In Mic,Built-In Back Mic,USB Device In,USB Headset In"/>
|
||||
<route type="mix" sink="voip_tx"
|
||||
sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In"/>
|
||||
</routes>
|
||||
</module>
|
||||
|
||||
<!-- A2dp Audio HAL -->
|
||||
<xi:include href="a2dp_audio_policy_configuration.xml"/>
|
||||
|
||||
<!-- Usb Audio HAL -->
|
||||
<module name="usb" halVersion="2.0">
|
||||
<mixPorts>
|
||||
<mixPort name="usb_accessory output" role="source">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</mixPort>
|
||||
</mixPorts>
|
||||
<devicePorts>
|
||||
<devicePort tagName="USB Host Out" type="AUDIO_DEVICE_OUT_USB_ACCESSORY" role="sink">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</devicePort>
|
||||
</devicePorts>
|
||||
<routes>
|
||||
<route type="mix" sink="USB Host Out"
|
||||
sources="usb_accessory output"/>
|
||||
</routes>
|
||||
</module>
|
||||
|
||||
<!-- Remote Submix Audio HAL -->
|
||||
<xi:include href="r_submix_audio_policy_configuration.xml"/>
|
||||
|
||||
</modules>
|
||||
|
||||
<!-- Volume section -->
|
||||
|
||||
<xi:include href="audio_policy_volumes.xml"/>
|
||||
<xi:include href="default_volume_tables.xml"/>
|
||||
|
||||
</audioPolicyConfiguration>
|
||||
35
bluetooth/bdroid_buildcfg.h
Normal file
35
bluetooth/bdroid_buildcfg.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2013, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution, Apache license notifications and license are retained
|
||||
* for attribution purposes only.
|
||||
*
|
||||
* 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
|
||||
|
||||
// Wide-band speech support
|
||||
#define BTM_WBS_INCLUDED TRUE
|
||||
#define BTIF_HF_WBS_PREFERRED TRUE
|
||||
|
||||
// Google VSC spec support
|
||||
#define BLE_VND_INCLUDED TRUE
|
||||
|
||||
// QCOM power management workaround
|
||||
#define BT_CLEAN_TURN_ON_DISABLED TRUE
|
||||
|
||||
#endif
|
||||
59
compatibility_matrix.xml
Normal file
59
compatibility_matrix.xml
Normal file
@@ -0,0 +1,59 @@
|
||||
<compatibility-matrix version="1.0" type="device">
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.frameworks.schedulerservice</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ISchedulingPolicyService</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.frameworks.sensorservice</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ISensorManager</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.hidl.allocator</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IAllocator</name>
|
||||
<instance>ashmem</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.hidl.manager</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IServiceManager</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.hidl.memory</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IMapper</name>
|
||||
<instance>ashmem</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.hidl.token</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ITokenManager</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.system.wifi.keystore</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IKeystore</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
|
||||
</compatibility-matrix>
|
||||
84
default-permissions.xml
Normal file
84
default-permissions.xml
Normal file
@@ -0,0 +1,84 @@
|
||||
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
|
||||
|
||||
<!-- Copyright (C) 2017 Google Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!--
|
||||
This file contains permissions to be granted by default. Default
|
||||
permissions are granted to special platform components and to apps
|
||||
that are approved to get default grants. The special components
|
||||
are apps that are expected tto work out-of-the-box as they provide
|
||||
core use cases such as default dialer, default email, etc. These
|
||||
grants are managed by the platform. The apps that are additionally
|
||||
approved for default grants are ones that provide carrier specific
|
||||
functionality, ones legally required at some location, ones providing
|
||||
alternative disclosure and opt-out UI, ones providing highlight features
|
||||
of a dedicated device, etc. This file contains only the latter exceptions.
|
||||
Fixed permissions cannot be controlled by the user and need a special
|
||||
approval. Typically these are to ensure either legally mandated functions
|
||||
or the app is considered a part of the OS.
|
||||
-->
|
||||
|
||||
<exceptions>
|
||||
|
||||
<!-- This is an example of an exception:
|
||||
<exception
|
||||
package="foo.bar.permission"
|
||||
<permission name="android.permission.READ_CONTACTS" fixed="true"/>
|
||||
<permission name="android.permission.READ_CALENDAR" fixed="false"/>
|
||||
</exception>
|
||||
-->
|
||||
|
||||
<exception
|
||||
package="com.google.android.apps.pixelmigrate">
|
||||
<!-- External storage -->
|
||||
<permission name="android.permission.READ_EXTERNAL_STORAGE" fixed="false"/>
|
||||
<permission name="android.permission.WRITE_EXTERNAL_STORAGE" fixed="false"/>
|
||||
<!-- Contacts -->
|
||||
<permission name="android.permission.READ_CONTACTS" fixed="false"/>
|
||||
<permission name="android.permission.WRITE_CONTACTS" fixed="false"/>
|
||||
</exception>
|
||||
|
||||
<exception
|
||||
package="com.verizon.mips.services">
|
||||
<!-- Phone -->
|
||||
<permission name="android.permission.READ_PHONE_STATE" fixed="false"/>
|
||||
</exception>
|
||||
|
||||
<exception
|
||||
package="com.google.intelligence.sense">
|
||||
<!-- Record Audio -->
|
||||
<permission name="android.permission.RECORD_AUDIO" fixed="false"/>
|
||||
</exception>
|
||||
|
||||
<exception
|
||||
package="com.qualcomm.ltebc_vzw">
|
||||
<!-- Phone -->
|
||||
<permission name="android.permission.READ_PHONE_STATE" fixed="false"/>
|
||||
</exception>
|
||||
|
||||
<exception
|
||||
package="com.google.vr.apps.ornament"
|
||||
sha256-cert-digest="4A:9E:3F:3B:C8:D6:0C:E4:D3:CB:E5:A9:C6:6E:EC:11:EF:D0:1C:5F:E9:C7:8D:8C:92:3B:9D:42:48:23:00:13">
|
||||
<!-- Camera -->
|
||||
<permission name="android.permission.CAMERA" fixed="false"/>
|
||||
<!-- Microphone -->
|
||||
<permission name="android.permission.RECORD_AUDIO" fixed="false"/>
|
||||
<!-- Storage -->
|
||||
<permission name="android.permission.READ_EXTERNAL_STORAGE" fixed="false"/>
|
||||
<permission name="android.permission.WRITE_EXTERNAL_STORAGE" fixed="false"/>
|
||||
</exception>
|
||||
|
||||
</exceptions>
|
||||
608
device.mk
Executable file
608
device.mk
Executable file
@@ -0,0 +1,608 @@
|
||||
#
|
||||
# Copyright (C) 2016 The Android Open-Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
keyguard.no_require_sim=true
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
device/google/wahoo/default-permissions.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default-permissions/default-permissions.xml \
|
||||
frameworks/native/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml
|
||||
|
||||
# Enforce privapp-permissions whitelist
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
ro.control_privapp_permissions=enforce
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
messaging
|
||||
|
||||
LOCAL_PATH := device/google/wahoo
|
||||
|
||||
SRC_MEDIA_HAL_DIR := hardware/qcom/media/msm8998
|
||||
SRC_DISPLAY_HAL_DIR := hardware/qcom/display/msm8998
|
||||
SRC_CAMERA_HAL_DIR := hardware/qcom/camera/msm8998
|
||||
|
||||
TARGET_SYSTEM_PROP := $(LOCAL_PATH)/system.prop
|
||||
|
||||
# Get kernel-headers
|
||||
$(call inherit-product, hardware/qcom/msm8998/msm8998.mk)
|
||||
|
||||
$(call inherit-product, device/google/wahoo/utils.mk)
|
||||
|
||||
ifeq ($(TARGET_PREBUILT_KERNEL),)
|
||||
LOCAL_KERNEL := device/google/wahoo-kernel/Image.lz4-dtb
|
||||
else
|
||||
LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL)
|
||||
endif
|
||||
|
||||
PRODUCT_CHARACTERISTICS := nosdcard
|
||||
PRODUCT_SHIPPING_API_LEVEL := 26
|
||||
PRODUCT_COMPATIBILITY_MATRIX_LEVEL_OVERRIDE := 27
|
||||
|
||||
DEVICE_PACKAGE_OVERLAYS += $(LOCAL_PATH)/overlay
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_KERNEL):kernel \
|
||||
$(LOCAL_PATH)/init.recovery.hardware.rc:root/init.recovery.$(PRODUCT_HARDWARE).rc \
|
||||
$(LOCAL_PATH)/init.hardware.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.$(PRODUCT_HARDWARE).rc \
|
||||
$(LOCAL_PATH)/init.hardware.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.wahoo.usb.rc \
|
||||
$(LOCAL_PATH)/ueventd.hardware.rc:$(TARGET_COPY_OUT_VENDOR)/ueventd.rc \
|
||||
$(LOCAL_PATH)/init.elabel.sh:$(TARGET_COPY_OUT_SYSTEM)/bin/init.elabel.sh \
|
||||
$(LOCAL_PATH)/init.power.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.power.sh \
|
||||
$(LOCAL_PATH)/init.radio.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.radio.sh \
|
||||
$(LOCAL_PATH)/uinput-fpc.kl:system/usr/keylayout/uinput-fpc.kl \
|
||||
$(LOCAL_PATH)/uinput-fpc.idc:system/usr/idc/uinput-fpc.idc \
|
||||
$(LOCAL_PATH)/init.qcom.devstart.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qcom.devstart.sh \
|
||||
$(LOCAL_PATH)/init.qcom.ipastart.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qcom.ipastart.sh \
|
||||
$(LOCAL_PATH)/init.insmod.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.insmod.sh \
|
||||
$(LOCAL_PATH)/init.ramoops.sh:$(TARGET_COPY_OUT_SYSTEM)/bin/init.ramoops.sh
|
||||
|
||||
ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/init.hardware.diag.rc.userdebug:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.$(PRODUCT_HARDWARE).diag.rc
|
||||
else
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/init.hardware.diag.rc.user:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.$(PRODUCT_HARDWARE).diag.rc
|
||||
endif
|
||||
|
||||
MSM_VIDC_TARGET_LIST := msm8998 # Get the color format from kernel headers
|
||||
MASTER_SIDE_CP_TARGET_LIST := msm8998 # ION specific settings
|
||||
|
||||
# A/B support
|
||||
PRODUCT_PACKAGES += \
|
||||
otapreopt_script \
|
||||
cppreopts.sh \
|
||||
update_engine \
|
||||
update_verifier
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
bootctrl.msm8998
|
||||
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
ro.cp_system_other_odex=1
|
||||
|
||||
AB_OTA_UPDATER := true
|
||||
|
||||
AB_OTA_PARTITIONS += \
|
||||
boot \
|
||||
system \
|
||||
vbmeta \
|
||||
dtbo
|
||||
|
||||
AB_OTA_POSTINSTALL_CONFIG += \
|
||||
RUN_POSTINSTALL_system=true \
|
||||
POSTINSTALL_PATH_system=system/bin/otapreopt_script \
|
||||
FILESYSTEM_TYPE_system=ext4 \
|
||||
POSTINSTALL_OPTIONAL_system=true
|
||||
|
||||
# Enable update engine sideloading by including the static version of the
|
||||
# boot_control HAL and its dependencies.
|
||||
PRODUCT_STATIC_BOOT_CONTROL_HAL := \
|
||||
bootctrl.msm8998 \
|
||||
libgptutils \
|
||||
libz \
|
||||
libcutils
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
update_engine_sideload
|
||||
|
||||
# The following modules are included in debuggable builds only.
|
||||
PRODUCT_PACKAGES_DEBUG += \
|
||||
bootctl \
|
||||
update_engine_client
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \
|
||||
frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \
|
||||
frameworks/native/data/etc/android.hardware.camera.full.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.full.xml\
|
||||
frameworks/native/data/etc/android.hardware.camera.raw.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.raw.xml\
|
||||
frameworks/native/data/etc/android.hardware.bluetooth.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth.xml \
|
||||
frameworks/native/data/etc/android.hardware.bluetooth_le.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth_le.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.compass.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.compass.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.light.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.light.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.proximity.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.proximity.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.barometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.barometer.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepcounter.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepdetector.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.hifi_sensors.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.hifi_sensors.xml \
|
||||
frameworks/native/data/etc/android.hardware.location.gps.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.location.gps.xml \
|
||||
frameworks/native/data/etc/android.hardware.telephony.gsm.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.gsm.xml \
|
||||
frameworks/native/data/etc/android.hardware.telephony.cdma.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.cdma.xml \
|
||||
frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \
|
||||
frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml \
|
||||
frameworks/native/data/etc/android.hardware.wifi.direct.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.direct.xml \
|
||||
frameworks/native/data/etc/android.hardware.wifi.aware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.aware.xml \
|
||||
frameworks/native/data/etc/android.hardware.wifi.passpoint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.passpoint.xml \
|
||||
frameworks/native/data/etc/android.software.sip.voip.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.sip.voip.xml \
|
||||
frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml \
|
||||
frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml \
|
||||
frameworks/native/data/etc/android.hardware.opengles.aep.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.opengles.aep.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.hce.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.hce.xml \
|
||||
frameworks/native/data/etc/android.hardware.nfc.hcef.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.hcef.xml \
|
||||
frameworks/native/data/etc/android.hardware.vr.headtracking-0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vr.headtracking.xml \
|
||||
frameworks/native/data/etc/android.hardware.vr.high_performance.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vr.high_performance.xml \
|
||||
frameworks/native/data/etc/android.hardware.vulkan.level-0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.level.xml \
|
||||
frameworks/native/data/etc/android.hardware.vulkan.version-1_0_3.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.version.xml \
|
||||
frameworks/native/data/etc/android.hardware.telephony.carrierlock.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.carrierlock.xml \
|
||||
|
||||
# power HAL
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.power@1.1-service.wahoo
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/powerhint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint.xml
|
||||
|
||||
# Audio fluence, ns, aec property, voice and media volume steps
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
ro.qc.sdk.audio.fluencetype=fluencepro \
|
||||
persist.audio.fluence.voicecall=true \
|
||||
persist.audio.fluence.speaker=true \
|
||||
persist.audio.fluence.voicecomm=true \
|
||||
persist.audio.fluence.voicerec=false \
|
||||
ro.config.vc_call_vol_steps=7 \
|
||||
ro.config.media_vol_steps=25
|
||||
|
||||
# graphics
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
ro.opengles.version=196610
|
||||
|
||||
# Enable camera EIS3.0
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
persist.camera.is_type=5 \
|
||||
persist.camera.gzoom.at=0 \
|
||||
persist.camera.llv.fuse=2
|
||||
|
||||
# OEM Unlock reporting
|
||||
PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
|
||||
ro.oem_unlock_supported=1
|
||||
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
persist.cne.feature=1 \
|
||||
persist.data.iwlan.enable=true \
|
||||
persist.radio.RATE_ADAPT_ENABLE=1 \
|
||||
persist.radio.ROTATION_ENABLE=1 \
|
||||
persist.radio.VT_ENABLE=1 \
|
||||
persist.radio.VT_HYBRID_ENABLE=1 \
|
||||
persist.radio.apm_sim_not_pwdn=1 \
|
||||
persist.radio.custom_ecc=1 \
|
||||
persist.radio.data_ltd_sys_ind=1 \
|
||||
persist.radio.is_wps_enabled=true \
|
||||
persist.radio.videopause.mode=1 \
|
||||
persist.radio.sib16_support=1 \
|
||||
persist.radio.data_con_rprt=true \
|
||||
persist.radio.always_send_plmn=true \
|
||||
persist.rcs.supported=1 \
|
||||
rild.libpath=/vendor/lib64/libril-qc-qmi-1.so
|
||||
|
||||
# Disable snapshot timer
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
persist.radio.snapshot_enabled=0 \
|
||||
persist.radio.snapshot_timer=0
|
||||
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
ro.vendor.extension_library=libqti-perfd-client.so
|
||||
|
||||
# camera gyro and laser sensor
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
persist.camera.gyro.android=20 \
|
||||
persist.camera.tof.direct=1 \
|
||||
persist.camera.max.previewfps=60 \
|
||||
persist.camera.sensor.hdr=2
|
||||
|
||||
# camera TNR controls
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
persist.camera.tnr.video=1 \
|
||||
|
||||
# WLAN driver configuration files
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/wpa_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/wpa_supplicant_overlay.conf \
|
||||
$(LOCAL_PATH)/p2p_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/p2p_supplicant_overlay.conf \
|
||||
$(LOCAL_PATH)/wifi_concurrency_cfg.txt:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/wifi_concurrency_cfg.txt
|
||||
|
||||
#ipacm configuration files
|
||||
PRODUCT_COPY_FILES += \
|
||||
hardware/qcom/data/ipacfg-mgr/msm8998/ipacm/src/IPACM_cfg.xml:$(TARGET_COPY_OUT_VENDOR)/etc/IPACM_cfg.xml
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
hwcomposer.msm8998 \
|
||||
android.hardware.graphics.composer@2.1-impl \
|
||||
android.hardware.graphics.composer@2.1-service \
|
||||
gralloc.msm8998 \
|
||||
android.hardware.graphics.allocator@2.0-impl \
|
||||
android.hardware.graphics.allocator@2.0-service \
|
||||
android.hardware.graphics.mapper@2.0-impl \
|
||||
libbt-vendor
|
||||
|
||||
# RenderScript HAL
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.renderscript@1.0-impl
|
||||
|
||||
# Light HAL
|
||||
PRODUCT_PACKAGES += \
|
||||
lights.$(PRODUCT_HARDWARE) \
|
||||
android.hardware.light@2.0-impl \
|
||||
android.hardware.light@2.0-service
|
||||
|
||||
# eSE applet HALs
|
||||
PRODUCT_PACKAGES += \
|
||||
esed
|
||||
|
||||
# Memtrack HAL
|
||||
PRODUCT_PACKAGES += \
|
||||
memtrack.msm8998 \
|
||||
android.hardware.memtrack@1.0-impl \
|
||||
android.hardware.memtrack@1.0-service
|
||||
|
||||
# Bluetooth HAL
|
||||
PRODUCT_PACKAGES += \
|
||||
libbt-vendor \
|
||||
android.hardware.bluetooth@1.0-impl \
|
||||
android.hardware.bluetooth@1.0-service
|
||||
|
||||
# DRM HAL
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.drm@1.0-impl \
|
||||
android.hardware.drm@1.0-service \
|
||||
android.hardware.drm@1.0-service.widevine
|
||||
|
||||
# NFC packages
|
||||
PRODUCT_PACKAGES += \
|
||||
nfc_nci.$(PRODUCT_HARDWARE) \
|
||||
NfcNci \
|
||||
Tag \
|
||||
android.hardware.nfc@1.0-impl \
|
||||
android.hardware.nfc@1.0-service
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
device/google/wahoo/nfc/libnfc-brcm.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libnfc-brcm.conf \
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.usb@1.1-service.wahoo
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
libmm-omxcore \
|
||||
libOmxCore \
|
||||
libstagefrighthw \
|
||||
libOmxVdec \
|
||||
libOmxVdecHevc \
|
||||
libOmxVenc \
|
||||
libc2dcolorconvert
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.camera.provider@2.4-impl \
|
||||
android.hardware.camera.provider@2.4-service \
|
||||
camera.device@3.2-impl \
|
||||
camera.msm8998 \
|
||||
libqomx_core \
|
||||
libmmjpeg_interface \
|
||||
libmmcamera_interface
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
sensors.$(PRODUCT_HARDWARE) \
|
||||
android.hardware.sensors@1.0-impl \
|
||||
android.hardware.sensors@1.0-service
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/sensors/hals.conf:vendor/etc/sensors/hals.conf
|
||||
|
||||
# Default permission grant exceptions
|
||||
PRODUCT_COPY_FILES += \
|
||||
device/google/wahoo/default-permissions.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default-permissions/default-permissions.xml
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
fs_config_dirs \
|
||||
fs_config_files
|
||||
|
||||
# Context hub HAL
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.contexthub@1.0-impl.generic \
|
||||
android.hardware.contexthub@1.0-service
|
||||
|
||||
# Boot control HAL
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.boot@1.0-impl \
|
||||
android.hardware.boot@1.0-service \
|
||||
|
||||
# Vibrator HAL
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.vibrator@1.1-service.wahoo
|
||||
|
||||
# Thermal packages
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.thermal@1.0-service.wahoo
|
||||
|
||||
#GNSS HAL
|
||||
PRODUCT_PACKAGES += \
|
||||
gps.conf \
|
||||
libgps.utils \
|
||||
libgnss \
|
||||
liblocation_api \
|
||||
android.hardware.gnss@1.0-impl-qti \
|
||||
android.hardware.gnss@1.0-service-qti
|
||||
|
||||
# VR HAL
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.vr@1.0-service.wahoo \
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/sec_config:$(TARGET_COPY_OUT_VENDOR)/etc/sec_config
|
||||
|
||||
|
||||
HOSTAPD := hostapd
|
||||
HOSTAPD += hostapd_cli
|
||||
PRODUCT_PACKAGES += $(HOSTAPD)
|
||||
|
||||
WPA := wpa_supplicant.conf
|
||||
WPA += wpa_supplicant_wcn.conf
|
||||
WPA += wpa_supplicant
|
||||
PRODUCT_PACKAGES += $(WPA)
|
||||
|
||||
# Wifi
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.wifi@1.0-service \
|
||||
android.hardware.wifi.offload@1.0-service \
|
||||
wificond \
|
||||
wifilogd \
|
||||
libwpa_client
|
||||
|
||||
LIB_NL := libnl_2
|
||||
PRODUCT_PACKAGES += $(LIB_NL)
|
||||
|
||||
# Audio effects
|
||||
PRODUCT_PACKAGES += \
|
||||
libvolumelistener \
|
||||
libqcomvisualizer \
|
||||
libqcomvoiceprocessing \
|
||||
libqcomvoiceprocessingdescriptors \
|
||||
libqcompostprocbundle
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
audio.primary.msm8998 \
|
||||
audio.a2dp.default \
|
||||
audio.usb.default \
|
||||
audio.r_submix.default \
|
||||
libaudio-resampler
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.audio@2.0-impl \
|
||||
android.hardware.audio.effect@2.0-impl \
|
||||
android.hardware.soundtrigger@2.0-impl \
|
||||
android.hardware.audio@2.0-service
|
||||
|
||||
# stereo speakers: orientation changes swap L/R channels
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
ro.audio.monitorRotation=true
|
||||
|
||||
# Bug 62375603
|
||||
# PRODUCT_PROPERTY_OVERRIDES += audio.adm.buffering.ms=4
|
||||
|
||||
# MIDI feature
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.software.midi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.midi.xml
|
||||
|
||||
# Audio low latency feature
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.audio.low_latency.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.low_latency.xml
|
||||
|
||||
# Pro audio feature
|
||||
# PRODUCT_COPY_FILES += \
|
||||
# frameworks/native/data/etc/android.hardware.audio.pro.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.pro.xml
|
||||
|
||||
# Thermal packages
|
||||
PRODUCT_PACKAGES += \
|
||||
thermal.default
|
||||
|
||||
ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
|
||||
PRODUCT_PACKAGES += \
|
||||
tinyplay \
|
||||
tinycap \
|
||||
tinymix \
|
||||
tinypcminfo \
|
||||
cplay
|
||||
endif
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \
|
||||
frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_audio_policy_configuration.xml \
|
||||
frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usb_audio_policy_configuration.xml \
|
||||
frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/r_submix_audio_policy_configuration.xml \
|
||||
frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml \
|
||||
frameworks/av/services/audiopolicy/config/default_volume_tables.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default_volume_tables.xml \
|
||||
|
||||
# audio hal tables
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/sound_trigger_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sound_trigger_platform_info.xml \
|
||||
$(LOCAL_PATH)/sound_trigger_mixer_paths_wcd9340.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sound_trigger_mixer_paths_wcd9340.xml \
|
||||
$(LOCAL_PATH)/graphite_ipc_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/graphite_ipc_platform_info.xml \
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \
|
||||
$(LOCAL_PATH)/media_codecs_performance.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance.xml \
|
||||
frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_audio.xml \
|
||||
frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_telephony.xml \
|
||||
frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_video.xml \
|
||||
$(LOCAL_PATH)/media_profiles_V1_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles_V1_0.xml \
|
||||
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
audio.snd_card.open.retries=50
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/lowi.conf:$(TARGET_COPY_OUT_VENDOR)/etc/lowi.conf
|
||||
|
||||
# Fingerprint HIDL implementation
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.biometrics.fingerprint@2.1-service.wahoo
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.fingerprint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.fingerprint.xml
|
||||
|
||||
# GPS configuration file
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/gps.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gps.conf
|
||||
|
||||
# GPS debug file
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/gps_debug.conf:system/etc/gps_debug.conf
|
||||
|
||||
# Vendor seccomp policy files for media components:
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/seccomp_policy/mediacodec.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediacodec.policy
|
||||
|
||||
ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
|
||||
# Subsystem ramdump
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
persist.sys.ssr.enable_ramdumps=1
|
||||
endif
|
||||
|
||||
# Subsystem silent restart
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
persist.sys.ssr.restart_level=modem,slpi,adsp
|
||||
|
||||
# setup dalvik vm configs
|
||||
$(call inherit-product, frameworks/native/build/phone-xhdpi-2048-dalvik-heap.mk)
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
device/google/wahoo/fstab.hardware:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.$(PRODUCT_HARDWARE)
|
||||
|
||||
# For SPN display
|
||||
PRODUCT_COPY_FILES += \
|
||||
device/google/wahoo/spn-conf.xml:system/etc/spn-conf.xml
|
||||
|
||||
# Provide meaningful APN configuration
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/apns-full-conf.xml:system/etc/apns-conf.xml
|
||||
|
||||
# Use the default charger mode images
|
||||
PRODUCT_PACKAGES += \
|
||||
charger_res_images
|
||||
|
||||
# b/36703476
|
||||
# Set default log size on userdebug/eng build to 1M
|
||||
ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
|
||||
PRODUCT_PROPERTY_OVERRIDES += ro.logd.size=1M
|
||||
endif
|
||||
|
||||
# Dumpstate HAL
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.dumpstate@1.0-service.wahoo
|
||||
|
||||
# Use daemon to detect folio open/close
|
||||
PRODUCT_PACKAGES += \
|
||||
folio_daemon
|
||||
|
||||
# Storage: for factory reset protection feature
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
ro.frp.pst=/dev/block/platform/soc/1da4000.ufshc/by-name/frp
|
||||
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
ro.vendor.vndk.version=26.1.0 \
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.renderscript@1.0.vndk-sp\
|
||||
android.hardware.graphics.allocator@2.0.vndk-sp\
|
||||
android.hardware.graphics.mapper@2.0.vndk-sp\
|
||||
android.hardware.graphics.common@1.0.vndk-sp\
|
||||
libhwbinder.vndk-sp\
|
||||
libbase.vndk-sp\
|
||||
libcutils.vndk-sp\
|
||||
libhardware.vndk-sp\
|
||||
libhidlbase.vndk-sp\
|
||||
libhidltransport.vndk-sp\
|
||||
libutils.vndk-sp\
|
||||
libc++.vndk-sp\
|
||||
libRS_internal.vndk-sp\
|
||||
libRSDriver.vndk-sp\
|
||||
libRSCpuRef.vndk-sp\
|
||||
libbcinfo.vndk-sp\
|
||||
libblas.vndk-sp\
|
||||
libft2.vndk-sp\
|
||||
libpng.vndk-sp\
|
||||
libcompiler_rt.vndk-sp\
|
||||
libbacktrace.vndk-sp\
|
||||
libunwind.vndk-sp\
|
||||
liblzma.vndk-sp\
|
||||
libz.vndk-sp\
|
||||
|
||||
PRODUCT_ENFORCE_RRO_TARGETS := framework-res
|
||||
|
||||
# Override heap growth limit due to high display density on device
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
dalvik.vm.heapgrowthlimit=256m
|
||||
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
qcom.bluetooth.soc=cherokee
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
device/google/wahoo/tango_permissions.xml:system/etc/permissions/tango_permissions.xml \
|
||||
device/google/wahoo/libtango_device2.jar:system/framework/libtango_device2.jar
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
ipacm
|
||||
|
||||
#Set default CDMA subscription to RUIM
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
ro.telephony.default_cdma_sub=0
|
||||
|
||||
# Add an extra 10% saturation to display colors
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
persist.sys.sf.color_saturation=1.1
|
||||
|
||||
# Add minidebug info to the system server to support diagnosing native crashes.
|
||||
ifneq (,$(filter user userdebug, $(TARGET_BUILD_VARIANT)))
|
||||
# System server and some of its services.
|
||||
# Note: we cannot use PRODUCT_SYSTEM_SERVER_JARS, as it has not been expanded at this point.
|
||||
$(call add-product-dex-preopt-module-config,services,--generate-mini-debug-info)
|
||||
$(call add-product-dex-preopt-module-config,wifi-service,--generate-mini-debug-info)
|
||||
endif
|
||||
|
||||
# QC time-daemon to use persist
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
persist.delta_time.enable=true
|
||||
|
||||
# Do not drop packets based upon enqueue sequence
|
||||
# to avoid freeze
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
persist.vendor.ims.dropset_feature=0
|
||||
|
||||
# Enable CameraHAL perfd usage
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
persist.camera.perfd.enable=true
|
||||
|
||||
# Preopt SystemUI
|
||||
PRODUCT_DEXPREOPT_SPEED_APPS += \
|
||||
SystemUIGoogle
|
||||
43
dumpstate/Android.mk
Normal file
43
dumpstate/Android.mk
Normal file
@@ -0,0 +1,43 @@
|
||||
#
|
||||
# Copyright 2016 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
LOCAL_PATH:= $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := android.hardware.dumpstate@1.0-service.wahoo
|
||||
LOCAL_INIT_RC := android.hardware.dumpstate@1.0-service.wahoo.rc
|
||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
DumpstateDevice.cpp \
|
||||
service.cpp
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
android.hardware.dumpstate@1.0 \
|
||||
libbase \
|
||||
libcutils \
|
||||
libdumpstateutil \
|
||||
libhidlbase \
|
||||
libhidltransport \
|
||||
libhwbinder \
|
||||
liblog \
|
||||
libutils
|
||||
|
||||
LOCAL_CFLAGS := -Werror -Wall
|
||||
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
LOCAL_PROPRIETARY_MODULE := true
|
||||
|
||||
include $(BUILD_EXECUTABLE)
|
||||
220
dumpstate/DumpstateDevice.cpp
Executable file
220
dumpstate/DumpstateDevice.cpp
Executable file
@@ -0,0 +1,220 @@
|
||||
/*
|
||||
* Copyright 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "dumpstate"
|
||||
|
||||
#include "DumpstateDevice.h"
|
||||
|
||||
#include <android-base/properties.h>
|
||||
#include <android-base/unique_fd.h>
|
||||
#include <cutils/properties.h>
|
||||
#include <libgen.h>
|
||||
#include <log/log.h>
|
||||
#include <stdlib.h>
|
||||
#include <string>
|
||||
|
||||
#include "DumpstateUtil.h"
|
||||
|
||||
#define MODEM_LOG_PREFIX_PROPERTY "ro.radio.log_prefix"
|
||||
#define MODEM_LOG_LOC_PROPERTY "ro.radio.log_loc"
|
||||
#define MODEM_LOGGING_SWITCH "persist.radio.smlog_switch"
|
||||
|
||||
#define DIAG_MDLOG_PROPERTY "sys.modem.diag.mdlog"
|
||||
#define DIAG_MDLOG_STATUS_PROPERTY "sys.modem.diag.mdlog_on"
|
||||
|
||||
using android::os::dumpstate::CommandOptions;
|
||||
using android::os::dumpstate::DumpFileToFd;
|
||||
using android::os::dumpstate::PropertiesHelper;
|
||||
using android::os::dumpstate::RunCommandToFd;
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace dumpstate {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
void DumpstateDevice::dumpModem(int fd, int fdModem)
|
||||
{
|
||||
std::string modemLogDir = android::base::GetProperty(MODEM_LOG_LOC_PROPERTY, "");
|
||||
if (modemLogDir.empty()) {
|
||||
ALOGD("No modem log place is set\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!PropertiesHelper::IsUserBuild()) {
|
||||
bool smlogEnabled = android::base::GetBoolProperty(MODEM_LOGGING_SWITCH, false) &&
|
||||
!access("/vendor/bin/smlog_dump", X_OK);
|
||||
|
||||
bool diagLogEnabled = android::base::GetBoolProperty(DIAG_MDLOG_PROPERTY, false);
|
||||
|
||||
CommandOptions options = CommandOptions::WithTimeout(120).Build();
|
||||
std::string modemLogAllDir = modemLogDir + "/modem_log";
|
||||
std::string diagLogDir = "/data/vendor/radio/diag_logs/logs";
|
||||
std::vector<std::string> rilAndNetmgrLogs
|
||||
{
|
||||
"/data/vendor/radio/ril_log",
|
||||
"/data/vendor/radio/ril_log_old",
|
||||
"/data/vendor/netmgr/netmgr_log",
|
||||
"/data/vendor/netmgr/netmgr_log_old"
|
||||
};
|
||||
|
||||
std::string modemLogMkDirCmd= "/vendor/bin/mkdir -p " + modemLogAllDir;
|
||||
RunCommandToFd(fd, "MKDIR MODEM LOG", { "/vendor/bin/sh", "-c", modemLogMkDirCmd.c_str()}, options);
|
||||
|
||||
if (smlogEnabled) {
|
||||
RunCommandToFd(fd, "SMLOG DUMP", { "smlog_dump", "-d", "-o", modemLogAllDir.c_str() }, options);
|
||||
} else if (diagLogEnabled) {
|
||||
std::string copyCmd= "/vendor/bin/cp -rf " + diagLogDir + " " + modemLogAllDir;
|
||||
|
||||
android::base::SetProperty(DIAG_MDLOG_PROPERTY, "false");
|
||||
|
||||
ALOGD("Waiting for diag log to exit\n");
|
||||
for (int i = 0; i < 30; i++) {
|
||||
if (!android::base::GetBoolProperty(DIAG_MDLOG_STATUS_PROPERTY, false)) {
|
||||
ALOGD("diag log exited\n");
|
||||
sleep(1);
|
||||
break;
|
||||
}
|
||||
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
RunCommandToFd(fd, "CP DIAG LOGS", { "/vendor/bin/sh", "-c", copyCmd.c_str()}, options);
|
||||
|
||||
android::base::SetProperty(DIAG_MDLOG_PROPERTY, "true");
|
||||
}
|
||||
|
||||
for (const auto& logFile : rilAndNetmgrLogs)
|
||||
{
|
||||
std::string copyCmd= "/vendor/bin/cp " + logFile + " " + modemLogAllDir;
|
||||
RunCommandToFd(fd, "CP MODEM LOG", { "/vendor/bin/sh", "-c", copyCmd.c_str()}, options);
|
||||
}
|
||||
|
||||
std::string filePrefix = android::base::GetProperty(MODEM_LOG_PREFIX_PROPERTY, "");
|
||||
|
||||
if (!filePrefix.empty()) {
|
||||
std::string modemLogCombined = modemLogDir + "/" + filePrefix + "all.tar";
|
||||
std::string modemLogTarCmd= "/vendor/bin/tar cvf " + modemLogCombined + " -C " + modemLogAllDir + " .";
|
||||
RunCommandToFd(fd, "TAR LOG", { "/vendor/bin/sh", "-c", modemLogTarCmd.c_str()}, options);
|
||||
|
||||
std::string modemLogPermCmd= "/vendor/bin/chmod a+rw " + modemLogCombined;
|
||||
RunCommandToFd(fd, "CHG PERM", { "/vendor/bin/sh", "-c", modemLogPermCmd.c_str()}, options);
|
||||
|
||||
std::vector<uint8_t> buffer(65536);
|
||||
android::base::unique_fd fdLog(TEMP_FAILURE_RETRY(open(modemLogCombined.c_str(), O_RDONLY | O_CLOEXEC | O_NONBLOCK)));
|
||||
|
||||
if (fdLog >= 0) {
|
||||
while (1) {
|
||||
ssize_t bytes_read = TEMP_FAILURE_RETRY(read(fdLog, buffer.data(), buffer.size()));
|
||||
|
||||
if (bytes_read == 0) {
|
||||
break;
|
||||
} else if (bytes_read < 0) {
|
||||
ALOGD("read(%s): %s\n", modemLogCombined.c_str(), strerror(errno));
|
||||
break;
|
||||
}
|
||||
|
||||
ssize_t result = TEMP_FAILURE_RETRY(write(fdModem, buffer.data(), bytes_read));
|
||||
|
||||
if (result != bytes_read) {
|
||||
ALOGD("Failed to write %ld bytes, actually written: %ld", bytes_read, result);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string modemLogClearCmd= "/vendor/bin/rm -r " + modemLogAllDir;
|
||||
RunCommandToFd(fd, "RM MODEM DIR", { "/vendor/bin/sh", "-c", modemLogClearCmd.c_str()}, options);
|
||||
RunCommandToFd(fd, "RM LOG", { "/vendor/bin/rm", modemLogCombined.c_str()}, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void DumpTouch(int fd) {
|
||||
if (!access("/sys/android_touch", R_OK)) {
|
||||
DumpFileToFd(fd, "Synaptics touch firmware version",
|
||||
"/sys/android_touch/vendor");
|
||||
DumpFileToFd(fd, "Synaptics touch firmware config",
|
||||
"/sys/android_touch/config");
|
||||
}
|
||||
if (!access("/sys/class/input/ftm4_touch", R_OK)) {
|
||||
DumpFileToFd(fd, "STM touch firmware config",
|
||||
"/sys/class/input/ftm4_touch/version");
|
||||
DumpFileToFd(fd, "STM touch VR Mode",
|
||||
"/sys/class/input/ftm4_touch/vrmode");
|
||||
}
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::dumpstate::V1_0::IDumpstateDevice follow.
|
||||
Return<void> DumpstateDevice::dumpstateBoard(const hidl_handle& handle) {
|
||||
if (handle == nullptr || handle->numFds < 1) {
|
||||
ALOGE("no FDs\n");
|
||||
return Void();
|
||||
}
|
||||
|
||||
int fd = handle->data[0];
|
||||
if (fd < 0) {
|
||||
ALOGE("invalid FD: %d\n", handle->data[0]);
|
||||
return Void();
|
||||
}
|
||||
|
||||
if (handle->numFds < 2) {
|
||||
ALOGE("no FD for modem\n");
|
||||
}
|
||||
else {
|
||||
int fdModem = handle->data[1];
|
||||
dumpModem(fd, fdModem);
|
||||
}
|
||||
|
||||
DumpFileToFd(fd, "SoC serial number", "/sys/devices/soc0/serial_number");
|
||||
DumpFileToFd(fd, "CPU present", "/sys/devices/system/cpu/present");
|
||||
DumpFileToFd(fd, "CPU online", "/sys/devices/system/cpu/online");
|
||||
DumpFileToFd(fd, "INTERRUPTS", "/proc/interrupts");
|
||||
DumpFileToFd(fd, "RPM Stats", "/d/rpm_stats");
|
||||
DumpFileToFd(fd, "Power Management Stats", "/d/rpm_master_stats");
|
||||
DumpFileToFd(fd, "WLAN Power Stats", "/d/wlan0/power_stats");
|
||||
DumpFileToFd(fd, "LL-Stats", "/d/wlan0/ll_stats");
|
||||
DumpFileToFd(fd, "ICNSS Stats", "/d/icnss/stats");
|
||||
DumpFileToFd(fd, "SMD Log", "/d/ipc_logging/smd/log");
|
||||
RunCommandToFd(fd, "ION HEAPS", {"/vendor/bin/sh", "-c", "for d in $(ls -d /d/ion/*); do for f in $(ls $d); do echo --- $d/$f; cat $d/$f; done; done"});
|
||||
DumpFileToFd(fd, "dmabuf info", "/d/dma_buf/bufinfo");
|
||||
RunCommandToFd(fd, "Temperatures", {"/vendor/bin/sh", "-c", "for f in `ls /sys/class/thermal` ; do type=`cat /sys/class/thermal/$f/type` ; temp=`cat /sys/class/thermal/$f/temp` ; echo \"$type: $temp\" ; done"});
|
||||
DumpFileToFd(fd, "cpu0-1 time-in-state", "/sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state");
|
||||
RunCommandToFd(fd, "cpu0-1 cpuidle", {"/vendor/bin/sh", "-c", "for d in $(ls -d /sys/devices/system/cpu/cpu0/cpuidle/state*); do echo \"$d: `cat $d/name` `cat $d/desc` `cat $d/time` `cat $d/usage`\"; done"});
|
||||
DumpFileToFd(fd, "cpu2-3 time-in-state", "/sys/devices/system/cpu/cpu2/cpufreq/stats/time_in_state");
|
||||
RunCommandToFd(fd, "cpu2-3 cpuidle", {"/vendor/bin/sh", "-c", "for d in $(ls -d /sys/devices/system/cpu/cpu2/cpuidle/state*); do echo \"$d: `cat $d/name` `cat $d/desc` `cat $d/time` `cat $d/usage`\"; done"});
|
||||
DumpFileToFd(fd, "MDP xlogs", "/data/vendor/display/mdp_xlog");
|
||||
DumpFileToFd(fd, "TCPM logs", "/d/tcpm/usbpd0");
|
||||
DumpFileToFd(fd, "PD Engine", "/d/pd_engine/usbpd0");
|
||||
DumpFileToFd(fd, "smblib-usb logs", "/d/ipc_logging/smblib/log");
|
||||
DumpFileToFd(fd, "ipc-local-ports", "/d/msm_ipc_router/dump_local_ports");
|
||||
DumpTouch(fd);
|
||||
RunCommandToFd(fd, "USB Device Descriptors", {"/vendor/bin/sh", "-c", "cd /sys/bus/usb/devices/1-1 && cat product && cat bcdDevice; cat descriptors | od -t x1 -w16 -N96"});
|
||||
|
||||
/* Check if qsee_logger tool exists */
|
||||
if (!access("/vendor/bin/qsee_logger", X_OK)) {
|
||||
RunCommandToFd(fd, "FP LOGS", {"qsee_logger", "-d"});
|
||||
}
|
||||
|
||||
RunCommandToFd(fd, "Battery cycle count", {"/vendor/bin/sh", "-c", "for f in 1 2 3 4 5 6 7 8 ; do echo $f > /sys/class/power_supply/bms/cycle_count_id; count=`cat /sys/class/power_supply/bms/cycle_count`; echo \"$f: $count\"; done"});
|
||||
return Void();
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace dumpstate
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
51
dumpstate/DumpstateDevice.h
Normal file
51
dumpstate/DumpstateDevice.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (C) 2016 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_HARDWARE_DUMPSTATE_V1_0_DUMPSTATEDEVICE_H
|
||||
#define ANDROID_HARDWARE_DUMPSTATE_V1_0_DUMPSTATEDEVICE_H
|
||||
|
||||
#include <android/hardware/dumpstate/1.0/IDumpstateDevice.h>
|
||||
#include <hidl/MQDescriptor.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace dumpstate {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::dumpstate::V1_0::IDumpstateDevice;
|
||||
using ::android::hardware::hidl_array;
|
||||
using ::android::hardware::hidl_handle;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::sp;
|
||||
|
||||
struct DumpstateDevice : public IDumpstateDevice {
|
||||
// Methods from ::android::hardware::dumpstate::V1_0::IDumpstateDevice follow.
|
||||
Return<void> dumpstateBoard(const hidl_handle& h) override;
|
||||
|
||||
void dumpModem(int fd, int fdModem);
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace dumpstate
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_DUMPSTATE_V1_0_DUMPSTATEDEVICE_H
|
||||
@@ -0,0 +1,4 @@
|
||||
service dumpstate-1-0 /vendor/bin/hw/android.hardware.dumpstate@1.0-service.wahoo
|
||||
class hal
|
||||
user system
|
||||
group system
|
||||
43
dumpstate/service.cpp
Normal file
43
dumpstate/service.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#define LOG_TAG "android.hardware.dumpstate@1.0-service.wahoo"
|
||||
|
||||
#include <hidl/HidlSupport.h>
|
||||
#include <hidl/HidlTransportSupport.h>
|
||||
|
||||
#include "DumpstateDevice.h"
|
||||
|
||||
using ::android::hardware::configureRpcThreadpool;
|
||||
using ::android::hardware::dumpstate::V1_0::IDumpstateDevice;
|
||||
using ::android::hardware::dumpstate::V1_0::implementation::DumpstateDevice;
|
||||
using ::android::hardware::joinRpcThreadpool;
|
||||
using ::android::sp;
|
||||
|
||||
|
||||
int main(int /* argc */, char* /* argv */ []) {
|
||||
sp<IDumpstateDevice> dumpstate = new DumpstateDevice;
|
||||
configureRpcThreadpool(1, true);
|
||||
|
||||
android::status_t status = dumpstate->registerAsService();
|
||||
|
||||
if (status != android::OK)
|
||||
{
|
||||
ALOGE("Could not register DumpstateDevice service (%d).", status);
|
||||
return -1;
|
||||
}
|
||||
|
||||
joinRpcThreadpool();
|
||||
}
|
||||
21
folio_daemon/Android.mk
Executable file
21
folio_daemon/Android.mk
Executable file
@@ -0,0 +1,21 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libandroid \
|
||||
libcutils \
|
||||
liblog
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
main.cpp
|
||||
|
||||
LOCAL_C_INCLUDES :=
|
||||
|
||||
LOCAL_CFLAGS := $(common_flags) -DLOG_TAG=\"folio_daemon\" -DLOG_NDEBUG=0
|
||||
|
||||
LOCAL_CLANG := true
|
||||
LOCAL_MODULE := folio_daemon
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
LOCAL_MODULE_OWNER := google
|
||||
|
||||
include $(BUILD_EXECUTABLE)
|
||||
182
folio_daemon/main.cpp
Normal file
182
folio_daemon/main.cpp
Normal file
@@ -0,0 +1,182 @@
|
||||
/*
|
||||
* Copyright 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/uinput.h>
|
||||
#include <android/looper.h>
|
||||
#include <android/sensor.h>
|
||||
#include <cutils/log.h>
|
||||
|
||||
// Hall-effect sensor type
|
||||
#define SENSOR_TYPE 33171016
|
||||
|
||||
#define RETRY_LIMIT 120
|
||||
#define RETRY_PERIOD 30 // 30 seconds
|
||||
#define WARN_PERIOD (time_t)300 // 5 minutes
|
||||
|
||||
/*
|
||||
* This simple daemon listens for events from the Hall-effect sensor and writes
|
||||
* the appropriate SW_LID event to a uinput node. This allows the screen to be
|
||||
* locked with a magnetic folio case.
|
||||
*/
|
||||
int main(void) {
|
||||
int uinputFd;
|
||||
int err;
|
||||
struct uinput_user_dev uidev;
|
||||
ASensorManager *sensorManager = nullptr;
|
||||
ASensorRef hallSensor;
|
||||
ALooper *looper;
|
||||
ASensorEventQueue *eventQueue = nullptr;
|
||||
time_t lastWarn = 0;
|
||||
int attemptCount = 0;
|
||||
|
||||
ALOGI("Started");
|
||||
|
||||
uinputFd = TEMP_FAILURE_RETRY(open("/dev/uinput", O_WRONLY | O_NONBLOCK));
|
||||
if (uinputFd < 0) {
|
||||
ALOGE("Unable to open uinput node: %s", strerror(errno));
|
||||
goto out;
|
||||
}
|
||||
|
||||
err = TEMP_FAILURE_RETRY(ioctl(uinputFd, UI_SET_EVBIT, EV_SW))
|
||||
| TEMP_FAILURE_RETRY(ioctl(uinputFd, UI_SET_EVBIT, EV_SYN))
|
||||
| TEMP_FAILURE_RETRY(ioctl(uinputFd, UI_SET_SWBIT, SW_LID));
|
||||
if (err != 0) {
|
||||
ALOGE("Unable to enable SW_LID events: %s", strerror(errno));
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset(&uidev, 0, sizeof (uidev));
|
||||
snprintf(uidev.name, UINPUT_MAX_NAME_SIZE, "uinput-folio");
|
||||
uidev.id.bustype = BUS_VIRTUAL;
|
||||
uidev.id.vendor = 0;
|
||||
uidev.id.product = 0;
|
||||
uidev.id.version = 0;
|
||||
|
||||
err = TEMP_FAILURE_RETRY(write(uinputFd, &uidev, sizeof (uidev)));
|
||||
if (err < 0) {
|
||||
ALOGE("Write user device to uinput node failed: %s", strerror(errno));
|
||||
goto out;
|
||||
}
|
||||
|
||||
err = TEMP_FAILURE_RETRY(ioctl(uinputFd, UI_DEV_CREATE));
|
||||
if (err < 0) {
|
||||
ALOGE("Unable to create uinput device: %s", strerror(errno));
|
||||
goto out;
|
||||
}
|
||||
|
||||
ALOGI("Successfully registered uinput-folio for SW_LID events");
|
||||
|
||||
// Get Hall-effect sensor events from the NDK
|
||||
sensorManager = ASensorManager_getInstanceForPackage(nullptr);
|
||||
/*
|
||||
* As long as we are unable to get the sensor handle, periodically retry
|
||||
* and emit an error message at a low frequency to prevent high CPU usage
|
||||
* and log spam. If we simply exited with an error here, we would be
|
||||
* immediately restarted and fail in the same way indefinitely.
|
||||
*/
|
||||
while (true) {
|
||||
time_t now = time(NULL);
|
||||
hallSensor = ASensorManager_getDefaultSensor(sensorManager,
|
||||
SENSOR_TYPE);
|
||||
if (hallSensor != nullptr) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (++attemptCount >= RETRY_LIMIT) {
|
||||
ALOGE("Retries exhausted; exiting");
|
||||
goto out;
|
||||
} else if (now > lastWarn + WARN_PERIOD) {
|
||||
ALOGE("Unable to get Hall-effect sensor");
|
||||
lastWarn = now;
|
||||
}
|
||||
|
||||
sleep(RETRY_PERIOD);
|
||||
}
|
||||
|
||||
looper = ALooper_forThread();
|
||||
if (looper == nullptr) {
|
||||
looper = ALooper_prepare(ALOOPER_PREPARE_ALLOW_NON_CALLBACKS);
|
||||
}
|
||||
|
||||
eventQueue = ASensorManager_createEventQueue(sensorManager, looper, 0, NULL,
|
||||
NULL);
|
||||
err = ASensorEventQueue_registerSensor(eventQueue, hallSensor,
|
||||
ASensor_getMinDelay(hallSensor),
|
||||
10000);
|
||||
if (err < 0) {
|
||||
ALOGE("Unable to register for Hall-effect sensor events");
|
||||
goto out;
|
||||
}
|
||||
|
||||
ALOGI("Starting polling loop");
|
||||
|
||||
// Polling loop
|
||||
while (ALooper_pollAll(-1, NULL, NULL, NULL) == 0) {
|
||||
int eventCount = 0;
|
||||
ASensorEvent sensorEvent;
|
||||
while (ASensorEventQueue_getEvents(eventQueue, &sensorEvent, 1) > 0) {
|
||||
// 1 means closed; 0 means open
|
||||
int isClosed = sensorEvent.data[0] > 0.0f ? 1 : 0;
|
||||
struct input_event event;
|
||||
event.type = EV_SW;
|
||||
event.code = SW_LID;
|
||||
event.value = isClosed;
|
||||
err = TEMP_FAILURE_RETRY(write(uinputFd, &event, sizeof (event)));
|
||||
if (err < 0) {
|
||||
ALOGE("Write EV_SW to uinput node failed: %s", strerror(errno));
|
||||
goto out;
|
||||
}
|
||||
|
||||
// Force a flush with an EV_SYN
|
||||
event.type = EV_SYN;
|
||||
event.code = SYN_REPORT;
|
||||
event.value = 0;
|
||||
err = TEMP_FAILURE_RETRY(write(uinputFd, &event, sizeof (event)));
|
||||
if (err < 0) {
|
||||
ALOGE("Write EV_SYN to uinput node failed: %s",
|
||||
strerror(errno));
|
||||
goto out;
|
||||
}
|
||||
|
||||
ALOGI("Sent lid %s event", isClosed ? "closed" : "open");
|
||||
eventCount++;
|
||||
}
|
||||
|
||||
if (eventCount == 0) {
|
||||
ALOGE("Poll returned with zero events: %s", strerror(errno));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
// Clean up
|
||||
if (sensorManager != nullptr && eventQueue != nullptr) {
|
||||
ASensorManager_destroyEventQueue(sensorManager, eventQueue);
|
||||
}
|
||||
|
||||
if (uinputFd >= 0) {
|
||||
close(uinputFd);
|
||||
}
|
||||
|
||||
// The loop can only be exited via failure or signal
|
||||
return 1;
|
||||
}
|
||||
9
fstab.hardware
Normal file
9
fstab.hardware
Normal file
@@ -0,0 +1,9 @@
|
||||
# Android fstab file.
|
||||
|
||||
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
|
||||
/dev/block/platform/soc/1da4000.ufshc/by-name/system / ext4 ro,barrier=1 wait,slotselect,avb
|
||||
/dev/block/platform/soc/1da4000.ufshc/by-name/userdata /data ext4 errors=panic,noatime,nosuid,nodev,barrier=1,noauto_da_alloc latemount,wait,check,formattable,fileencryption=ice:aes-256-heh,eraseblk=16777216,logicalblk=4096,quota
|
||||
/dev/block/platform/soc/1da4000.ufshc/by-name/misc /misc emmc defaults defaults
|
||||
/dev/block/platform/soc/1da4000.ufshc/by-name/modem /firmware vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait,slotselect
|
||||
/devices/soc/a800000.ssusb/a800000.dwc3* auto vfat defaults voldmanaged=usb:auto
|
||||
/dev/block/zram0 none swap defaults zramsize=536870912,max_comp_streams=8
|
||||
128
gps.conf
Normal file
128
gps.conf
Normal file
@@ -0,0 +1,128 @@
|
||||
#Version check for XTRA
|
||||
#DISABLE = 0
|
||||
#AUTO = 1
|
||||
#XTRA2 = 2
|
||||
#XTRA3 = 3
|
||||
XTRA_VERSION_CHECK=1
|
||||
|
||||
# Error Estimate
|
||||
# _SET = 1
|
||||
# _CLEAR = 0
|
||||
ERR_ESTIMATE=0
|
||||
|
||||
# NTP Server
|
||||
# NTP_SERVER=time.gpsonextra.net
|
||||
# Asia
|
||||
# NTP_SERVER=asia.pool.ntp.org
|
||||
# Europe
|
||||
# NTP_SERVER=europe.pool.ntp.org
|
||||
# North America
|
||||
NTP_SERVER=north-america.pool.ntp.org
|
||||
# If NTP_SERVER is commented NTP_SERVER=time.izatcloud.net is used
|
||||
|
||||
# DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info
|
||||
# 4 - Debug, 5 - Verbose
|
||||
# If DEBUG_LEVEL is commented, Android's logging levels will be used
|
||||
DEBUG_LEVEL = 2
|
||||
|
||||
# Intermediate position report, 1=enable, 0=disable
|
||||
INTERMEDIATE_POS=0
|
||||
|
||||
# GPS Capabilities bit mask
|
||||
# SCHEDULING = 0x01
|
||||
# MSB = 0x02
|
||||
# MSA = 0x04
|
||||
# ON_DEMAND_TIME = 0x10
|
||||
# GEOFENCE = 0x20
|
||||
# default = ON_DEMAND_TIME | MSA | MSB | SCHEDULING | GEOFENCE
|
||||
CAPABILITIES=0x37
|
||||
|
||||
# Accuracy threshold for intermediate positions
|
||||
# less accurate positions are ignored, 0 for passing all positions
|
||||
# ACCURACY_THRES=5000
|
||||
|
||||
################################
|
||||
##### AGPS server settings #####
|
||||
################################
|
||||
# Bitmask of slots that are available
|
||||
# for write/install to, where 1s indicate writable,
|
||||
# and the default value is 0 where no slots
|
||||
# are writable. For example, AGPS_CERT_WRITABLE_MASK
|
||||
# of b1000001010 makes 3 slots available
|
||||
# and the remaining 7 slots unwritable.
|
||||
# AGPS_CERT_WRITABLE_MASK=0
|
||||
|
||||
################################
|
||||
# EXTRA SETTINGS
|
||||
################################
|
||||
# NMEA provider (1=Modem Processor, 0=Application Processor)
|
||||
NMEA_PROVIDER=0
|
||||
|
||||
# Mark if it is a SGLTE target (1=SGLTE, 0=nonSGLTE)
|
||||
SGLTE_TARGET=0
|
||||
|
||||
##################################################
|
||||
# Select technology for LPPe Control Plane
|
||||
##################################################
|
||||
# 0x1: DBH for LPPe CP
|
||||
# 0x2: WLAN AP Measurements for LPPe CP
|
||||
LPPE_CP_TECHNOLOGY = 0
|
||||
|
||||
##################################################
|
||||
# Select technology for LPPe User Plane
|
||||
##################################################
|
||||
# 0x1: DBH for LPPe UP
|
||||
# 0x2: WLAN AP Measurements for LPPe UP
|
||||
LPPE_UP_TECHNOLOGY = 0
|
||||
|
||||
##################################################
|
||||
# AGPS_CONFIG_INJECT
|
||||
##################################################
|
||||
# enable/disable injection of AGPS configurations:
|
||||
# SUPL_VER
|
||||
# SUPL_HOST
|
||||
# SUPL_PORT
|
||||
# SUPL_MODE
|
||||
# SUPL_ES
|
||||
# C2K_HOST
|
||||
# C2K_PORT
|
||||
# LPP_PROFILE
|
||||
# A_GLONASS_POS_PROTOCOL_SELECT
|
||||
# USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL
|
||||
# GPS_LOCK
|
||||
# 0: disable
|
||||
# 1: enable
|
||||
AGPS_CONFIG_INJECT = 1
|
||||
|
||||
# AP Coarse Timestamp Uncertainty
|
||||
##################################################
|
||||
# default : 10
|
||||
# or as per clock uncertainty of product
|
||||
AP_TIMESTAMP_UNCERTAINTY = 10
|
||||
|
||||
#####################################
|
||||
#DR_SYNC Pulse Availability
|
||||
#####################################
|
||||
# 0 : DR_SYNC pulse not available (default)
|
||||
# 1 : DR_SYNC pulse available
|
||||
DR_SYNC_ENABLED = 0
|
||||
|
||||
#####################################
|
||||
#PPS Device name
|
||||
#####################################
|
||||
PPS_DEVICENAME = /dev/pps0
|
||||
|
||||
#####################################
|
||||
#AP Clock Accuracy
|
||||
#####################################
|
||||
AP_CLOCK_PPM = 100
|
||||
|
||||
#####################################
|
||||
#MAX ms difference to detect missing pulse
|
||||
#####################################
|
||||
MISSING_PULSE_TIME_DELTA = 900
|
||||
|
||||
#####################################
|
||||
#Propagation time uncertainty
|
||||
#####################################
|
||||
PROPAGATION_TIME_UNCERTAINTY = 1
|
||||
52
gps_debug.conf
Normal file
52
gps_debug.conf
Normal file
@@ -0,0 +1,52 @@
|
||||
# Sample file for use for on device debug override only
|
||||
# Prefer frameworks/base/core/res/res/values/config.xml and
|
||||
# frameworks/base/core/res/res/values-mcc*-mnc*/config.xml
|
||||
|
||||
################################
|
||||
##### AGPS server settings #####
|
||||
################################
|
||||
# FOR SUPL SUPPORT, set the following
|
||||
# SUPL_HOST=supl.google.com or IP
|
||||
# SUPL_PORT=7275
|
||||
|
||||
# supl version 2.0
|
||||
# SUPL_VER=0x20000
|
||||
|
||||
#SUPL_MODE is a bit mask set in config.xml per carrier by default.
|
||||
#If it is uncommented here, this value will overwrite the value from
|
||||
#config.xml.
|
||||
#MSA=0X2
|
||||
#MSB=0X1
|
||||
#SUPL_MODE=1
|
||||
|
||||
# Emergency SUPL, 1=enable, 0=disable
|
||||
#SUPL_ES=0
|
||||
|
||||
#Choose PDN for Emergency SUPL
|
||||
#1 - Use emergency PDN
|
||||
#0 - Use regular SUPL PDN for Emergency SUPL
|
||||
#USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=0
|
||||
|
||||
####################################
|
||||
# LTE Positioning Profile Settings
|
||||
####################################
|
||||
# 0: Enable RRLP on LTE(Default)
|
||||
# 1: Enable LPP_User_Plane on LTE
|
||||
# 2: Enable LPP_Control_Plane
|
||||
# 3: Enable both LPP_User_Plane and LPP_Control_Plane
|
||||
#LPP_PROFILE = 2
|
||||
|
||||
##################################################
|
||||
# Select Positioning Protocol on A-GLONASS system
|
||||
##################################################
|
||||
# 0x1: RRC CPlane
|
||||
# 0x2: RRLP UPlane
|
||||
# 0x4: LLP Uplane
|
||||
#A_GLONASS_POS_PROTOCOL_SELECT = 0
|
||||
|
||||
# Below bit mask configures how GPS functionalities
|
||||
# should be locked when user turns off GPS on Settings
|
||||
# Set bit 0x1 if MO GPS functionalities are to be locked
|
||||
# Set bit 0x2 if NI GPS functionalities are to be locked
|
||||
# default - non is locked for backward compatibility
|
||||
#GPS_LOCK = 0
|
||||
47
graphite_ipc_platform_info.xml
Normal file
47
graphite_ipc_platform_info.xml
Normal file
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--- Copyright (c) 2016, The Linux Foundation. All rights reserved. -->
|
||||
<!--- -->
|
||||
<!--- Redistribution and use in source and binary forms, with or without -->
|
||||
<!--- modification, are permitted provided that the following conditions are -->
|
||||
<!--- met: -->
|
||||
<!--- * Redistributions of source code must retain the above copyright -->
|
||||
<!--- notice, this list of conditions and the following disclaimer. -->
|
||||
<!--- * Redistributions in binary form must reproduce the above -->
|
||||
<!--- copyright notice, this list of conditions and the following -->
|
||||
<!--- disclaimer in the documentation and/or other materials provided -->
|
||||
<!--- with the distribution. -->
|
||||
<!--- * Neither the name of The Linux Foundation nor the names of its -->
|
||||
<!--- contributors may be used to endorse or promote products derived -->
|
||||
<!--- from this software without specific prior written permission. -->
|
||||
<!--- -->
|
||||
<!--- THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED -->
|
||||
<!--- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -->
|
||||
<!--- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT -->
|
||||
<!--- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS -->
|
||||
<!--- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -->
|
||||
<!--- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -->
|
||||
<!--- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -->
|
||||
<!--- BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -->
|
||||
<!--- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -->
|
||||
<!--- OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -->
|
||||
<!--- IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -->
|
||||
<graphite_ipc_platform_info>
|
||||
<no_of_glink_channels value="4">
|
||||
</no_of_glink_channels>
|
||||
<!-- channel 1 configuration -->
|
||||
<glink_channel name="g_glink_ctrl" latency_in_us="5000"
|
||||
no_of_intents="1" intents_size="1024">
|
||||
</glink_channel>
|
||||
<!-- channel 2 configuration -->
|
||||
<glink_channel name="g_glink_persistent_data_ild" latency_in_us="30000"
|
||||
no_of_intents="0">
|
||||
</glink_channel>
|
||||
<!-- channel 3 configuration -->
|
||||
<glink_channel name="g_glink_persistent_data_nild" latency_in_us="30000"
|
||||
no_of_intents="0">
|
||||
</glink_channel>
|
||||
<!-- channel 4 configuration -->
|
||||
<glink_channel name="g_glink_audio_data" latency_in_us="10000"
|
||||
no_of_intents="2" intents_size="4096, 4096">
|
||||
</glink_channel>
|
||||
</graphite_ipc_platform_info>
|
||||
10
init.elabel.sh
Normal file
10
init.elabel.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#! /system/bin/sh
|
||||
|
||||
if [ -d /persist/elabel ]; then
|
||||
if [ ! -f /data/misc/elabel/elabels_copied ]; then
|
||||
cp /persist/elabel/* /data/misc/elabel/
|
||||
echo 1 > /data/misc/elabel/elabels_copied
|
||||
chown system.system /data/misc/elabel/*
|
||||
chmod 400 /data/misc/elabel/*
|
||||
fi
|
||||
fi
|
||||
18
init.hardware.diag.rc.user
Normal file
18
init.hardware.diag.rc.user
Normal file
@@ -0,0 +1,18 @@
|
||||
#
|
||||
# Copyright (C) 2016 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.
|
||||
#
|
||||
|
||||
on property:ro.boot.mode=normal
|
||||
rm /dev/diag
|
||||
386
init.hardware.diag.rc.userdebug
Normal file
386
init.hardware.diag.rc.userdebug
Normal file
@@ -0,0 +1,386 @@
|
||||
#
|
||||
# Copyright (C) 2016 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.
|
||||
#
|
||||
|
||||
on init
|
||||
chmod 666 /dev/diag
|
||||
|
||||
on post-fs-data
|
||||
# Modem logging collection
|
||||
mkdir /data/vendor/radio 0777 radio radio
|
||||
mkdir /data/vendor/radio/diag_logs 0777 system system
|
||||
# WLAN logging collection
|
||||
mkdir /data/vendor/wifi 0777 system system
|
||||
mkdir /data/vendor/wifi/cnss_diag 0777 system system
|
||||
|
||||
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
rm /config/usb_gadget/g1/configs/b.1/f4
|
||||
rm /config/usb_gadget/g1/configs/b.1/f5
|
||||
write /config/usb_gadget/g1/idVendor 0x05C6
|
||||
write /config/usb_gadget/g1/idProduct 0x900E
|
||||
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=diag,adb && property:sys.usb.configfs=1
|
||||
start adbd
|
||||
|
||||
|
||||
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,adb && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_adb"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
rm /config/usb_gadget/g1/configs/b.1/f4
|
||||
rm /config/usb_gadget/g1/configs/b.1/f5
|
||||
write /config/usb_gadget/g1/idVendor 0x05C6
|
||||
write /config/usb_gadget/g1/idProduct 0x901D
|
||||
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=diag,serial_cdev,rmnet_gsi,adb && property:sys.usb.configfs=1
|
||||
start adbd
|
||||
start port-bridge
|
||||
|
||||
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,serial_cdev,rmnet_gsi,adb && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "Default composition"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
rm /config/usb_gadget/g1/configs/b.1/f4
|
||||
rm /config/usb_gadget/g1/configs/b.1/f5
|
||||
write /config/usb_gadget/g1/idVendor 0x05C6
|
||||
write /config/usb_gadget/g1/idProduct 0x9091
|
||||
write /config/usb_gadget/g1/os_desc/use 1
|
||||
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2
|
||||
symlink /config/usb_gadget/g1/functions/gsi.rmnet /config/usb_gadget/g1/configs/b.1/f3
|
||||
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f4
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=diag,serial_cdev,rmnet_gsi && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "Default comp without ADB"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
rm /config/usb_gadget/g1/configs/b.1/f4
|
||||
rm /config/usb_gadget/g1/configs/b.1/f5
|
||||
write /config/usb_gadget/g1/idVendor 0x05C6
|
||||
write /config/usb_gadget/g1/idProduct 0x9092
|
||||
write /config/usb_gadget/g1/os_desc/use 1
|
||||
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2
|
||||
symlink /config/usb_gadget/g1/functions/gsi.rmnet /config/usb_gadget/g1/configs/b.1/f3
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
start port-bridge
|
||||
|
||||
on property:sys.usb.config=rndis,diag && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_diag"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
rm /config/usb_gadget/g1/configs/b.1/f4
|
||||
rm /config/usb_gadget/g1/configs/b.1/f5
|
||||
write /config/usb_gadget/g1/idVendor 0x05C6
|
||||
write /config/usb_gadget/g1/idProduct 0x902C
|
||||
symlink /config/usb_gadget/g1/functions/gsi.rndis /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=rndis,diag,adb && property:sys.usb.configfs=1
|
||||
start adbd
|
||||
|
||||
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,diag,adb && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_diag_adb"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
rm /config/usb_gadget/g1/configs/b.1/f4
|
||||
rm /config/usb_gadget/g1/configs/b.1/f5
|
||||
write /config/usb_gadget/g1/idVendor 0x05C6
|
||||
write /config/usb_gadget/g1/idProduct 0x902D
|
||||
symlink /config/usb_gadget/g1/functions/gsi.rndis /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2
|
||||
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=rndis,serial_cdev,diag && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_dun_diag"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
rm /config/usb_gadget/g1/configs/b.1/f4
|
||||
rm /config/usb_gadget/g1/configs/b.1/f5
|
||||
write /config/usb_gadget/g1/idVendor 0x05C6
|
||||
write /config/usb_gadget/g1/idProduct 0x90B5
|
||||
symlink /config/usb_gadget/g1/functions/gsi.rndis /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2
|
||||
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f3
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
start port-bridge
|
||||
|
||||
on property:sys.usb.config=rndis,serial_cdev,diag,adb && property:sys.usb.configfs=1
|
||||
start adbd
|
||||
start port-bridge
|
||||
|
||||
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,serial_cdev,diag,adb && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_dun_diag"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
rm /config/usb_gadget/g1/configs/b.1/f4
|
||||
rm /config/usb_gadget/g1/configs/b.1/f5
|
||||
write /config/usb_gadget/g1/idVendor 0x05C6
|
||||
write /config/usb_gadget/g1/idProduct 0x90B6
|
||||
symlink /config/usb_gadget/g1/functions/gsi.rndis /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2
|
||||
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f3
|
||||
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f4
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=mtp,diag && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_diag"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
rm /config/usb_gadget/g1/configs/b.1/f4
|
||||
rm /config/usb_gadget/g1/configs/b.1/f5
|
||||
write /config/usb_gadget/g1/idVendor 0x05C6
|
||||
write /config/usb_gadget/g1/idProduct 0x901B
|
||||
symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=mtp,diag,adb && property:sys.usb.configfs=1
|
||||
start adbd
|
||||
|
||||
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,diag,adb && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_diag_adb"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
rm /config/usb_gadget/g1/configs/b.1/f4
|
||||
rm /config/usb_gadget/g1/configs/b.1/f5
|
||||
write /config/usb_gadget/g1/idVendor 0x05C6
|
||||
write /config/usb_gadget/g1/idProduct 0x903A
|
||||
symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2
|
||||
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=diag,qdss && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_qdss"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
rm /config/usb_gadget/g1/configs/b.1/f4
|
||||
rm /config/usb_gadget/g1/configs/b.1/f5
|
||||
write /config/usb_gadget/g1/idVendor 0x05C6
|
||||
write /config/usb_gadget/g1/idProduct 0x904A
|
||||
write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1
|
||||
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f2
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=diag,qdss,adb && property:sys.usb.configfs=1
|
||||
start adbd
|
||||
|
||||
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,qdss,adb && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_qdss_adb"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
rm /config/usb_gadget/g1/configs/b.1/f4
|
||||
rm /config/usb_gadget/g1/configs/b.1/f5
|
||||
write /config/usb_gadget/g1/idVendor 0x05C6
|
||||
write /config/usb_gadget/g1/idProduct 0x9060
|
||||
write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1
|
||||
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f2
|
||||
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=diag,qdss,rmnet_gsi && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_qdss_rmnet"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
rm /config/usb_gadget/g1/configs/b.1/f4
|
||||
rm /config/usb_gadget/g1/configs/b.1/f5
|
||||
write /config/usb_gadget/g1/idVendor 0x05C6
|
||||
write /config/usb_gadget/g1/idProduct 0x9083
|
||||
write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1
|
||||
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f2
|
||||
symlink /config/usb_gadget/g1/functions/gsi.rmnet /config/usb_gadget/g1/configs/b.1/f3
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=diag,qdss,rmnet_gsi,adb && property:sys.usb.configfs=1
|
||||
start adbd
|
||||
|
||||
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,qdss,rmnet_gsi,adb && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_qdss_rmnet_adb"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
rm /config/usb_gadget/g1/configs/b.1/f4
|
||||
rm /config/usb_gadget/g1/configs/b.1/f5
|
||||
write /config/usb_gadget/g1/idVendor 0x05C6
|
||||
write /config/usb_gadget/g1/idProduct 0x9084
|
||||
write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1
|
||||
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f2
|
||||
symlink /config/usb_gadget/g1/functions/gsi.rmnet /config/usb_gadget/g1/configs/b.1/f3
|
||||
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f4
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=rndis,diag,qdss && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_diag_qdss"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
rm /config/usb_gadget/g1/configs/b.1/f4
|
||||
rm /config/usb_gadget/g1/configs/b.1/f5
|
||||
write /config/usb_gadget/g1/idVendor 0x05C6
|
||||
write /config/usb_gadget/g1/idProduct 0x9081
|
||||
write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1
|
||||
symlink /config/usb_gadget/g1/functions/gsi.rndis /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2
|
||||
symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f3
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=rndis,diag,qdss,adb && property:sys.usb.configfs=1
|
||||
start adbd
|
||||
|
||||
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,diag,qdss,adb && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_diag_qdss_adb"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
rm /config/usb_gadget/g1/configs/b.1/f4
|
||||
rm /config/usb_gadget/g1/configs/b.1/f5
|
||||
write /config/usb_gadget/g1/idVendor 0x05C6
|
||||
write /config/usb_gadget/g1/idProduct 0x9082
|
||||
write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1
|
||||
symlink /config/usb_gadget/g1/functions/gsi.rndis /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2
|
||||
symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f3
|
||||
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f4
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
on property:sys.usb.config=diag,serial_cdev && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_dun"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
rm /config/usb_gadget/g1/configs/b.1/f4
|
||||
rm /config/usb_gadget/g1/configs/b.1/f5
|
||||
write /config/usb_gadget/g1/idVendor 0x05C6
|
||||
write /config/usb_gadget/g1/idProduct 0x9004
|
||||
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
start port-bridge
|
||||
|
||||
on property:sys.usb.config=diag,adb,serial_cdev && property:sys.usb.configfs=1
|
||||
start adbd
|
||||
start port-bridge
|
||||
|
||||
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,adb,serial_cdev && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_adb_dun"
|
||||
rm /config/usb_gadget/g1/configs/b.1/f1
|
||||
rm /config/usb_gadget/g1/configs/b.1/f2
|
||||
rm /config/usb_gadget/g1/configs/b.1/f3
|
||||
rm /config/usb_gadget/g1/configs/b.1/f4
|
||||
rm /config/usb_gadget/g1/configs/b.1/f5
|
||||
write /config/usb_gadget/g1/idVendor 0x05C6
|
||||
write /config/usb_gadget/g1/idProduct 0x901f
|
||||
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
|
||||
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
|
||||
symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f3
|
||||
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
|
||||
setprop sys.usb.state ${sys.usb.config}
|
||||
|
||||
service diag_mdlog_start /vendor/bin/diag_mdlog
|
||||
class late_start
|
||||
user shell
|
||||
group system diag media_rw
|
||||
disabled
|
||||
oneshot
|
||||
|
||||
service diag_mdlog_stop /vendor/bin/diag_mdlog -k
|
||||
class late_start
|
||||
user shell
|
||||
group system diag media_rw
|
||||
disabled
|
||||
oneshot
|
||||
|
||||
on boot && property:persist.sys.modem.diag.mdlog=*
|
||||
setprop sys.modem.diag.mdlog ${persist.sys.modem.diag.mdlog}
|
||||
|
||||
on property:sys.modem.diag.mdlog=true
|
||||
start diag_mdlog_start
|
||||
|
||||
on property:sys.modem.diag.mdlog=false
|
||||
start diag_mdlog_stop
|
||||
|
||||
on property:persist.sys.cnss.diag_qxdm=true
|
||||
start cnss_diag
|
||||
|
||||
on property:persist.sys.cnss.diag_qxdm=false
|
||||
stop cnss_diag
|
||||
|
||||
on property:persist.sys.cnss.diag_txt=true
|
||||
start cnss_diag_txt
|
||||
|
||||
on property:persist.sys.cnss.diag_txt=false
|
||||
stop cnss_diag_txt
|
||||
|
||||
service cnss_diag /vendor/bin/cnss_diag -q -u -w
|
||||
class late_start
|
||||
user system
|
||||
group system
|
||||
oneshot
|
||||
|
||||
service cnss_diag_txt /vendor/bin/cnss_diag -s -f -m /data/vendor/wifi/cnss_diag/cnss_diag.conf
|
||||
class late_start
|
||||
user system
|
||||
group system
|
||||
disabled
|
||||
oneshot
|
||||
|
||||
on property:debug.htc.ramdump.crash=true
|
||||
write /proc/sysrq-trigger "c"
|
||||
814
init.hardware.rc
Normal file
814
init.hardware.rc
Normal file
@@ -0,0 +1,814 @@
|
||||
#
|
||||
# Copyright (C) 2016 The Android Open-Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
import /vendor/etc/init/hw/init.${ro.hardware}.usb.rc
|
||||
|
||||
on charger
|
||||
write /sys/devices/system/cpu/cpu2/online 0
|
||||
write /sys/devices/system/cpu/cpu3/online 0
|
||||
write /sys/devices/system/cpu/cpu4/online 0
|
||||
write /sys/devices/system/cpu/cpu5/online 0
|
||||
write /sys/devices/system/cpu/cpu6/online 0
|
||||
write /sys/devices/system/cpu/cpu7/online 0
|
||||
wait /dev/block/platform/soc/${ro.boot.bootdevice}
|
||||
# Enable UFS powersaving
|
||||
write /sys/devices/soc/${ro.boot.bootdevice}/clkscale_enable 1
|
||||
write /sys/devices/soc/${ro.boot.bootdevice}/clkgate_enable 1
|
||||
write /sys/devices/soc/${ro.boot.bootdevice}/hibern8_on_idle_enable 1
|
||||
write /sys/class/typec/port0/port_type sink
|
||||
write /sys/module/lpm_levels/parameters/sleep_disabled N
|
||||
|
||||
service charger /charger
|
||||
class charger
|
||||
seclabel u:r:charger:s0
|
||||
|
||||
on early-init
|
||||
mount debugfs debugfs /sys/kernel/debug
|
||||
chmod 0755 /sys/kernel/debug
|
||||
|
||||
on init
|
||||
# Disable UFS powersaving
|
||||
write /sys/devices/soc/${ro.boot.bootdevice}/clkscale_enable 0
|
||||
write /sys/devices/soc/${ro.boot.bootdevice}/clkgate_enable 0
|
||||
write /sys/devices/soc/${ro.boot.bootdevice}/hibern8_on_idle_enable 0
|
||||
write /sys/module/lpm_levels/parameters/sleep_disabled Y
|
||||
|
||||
# Loading kernel modules in background
|
||||
start insmod_sh
|
||||
|
||||
# Support legacy paths
|
||||
symlink /sdcard /mnt/sdcard
|
||||
symlink /sdcard /storage/sdcard0
|
||||
|
||||
# disable thermal hotplug for thermal
|
||||
write /sys/module/msm_thermal/core_control/enabled 0
|
||||
|
||||
# bring back all cores
|
||||
write /sys/devices/system/cpu/cpu0/online 1
|
||||
write /sys/devices/system/cpu/cpu1/online 1
|
||||
write /sys/devices/system/cpu/cpu2/online 1
|
||||
write /sys/devices/system/cpu/cpu3/online 1
|
||||
write /sys/devices/system/cpu/cpu4/online 1
|
||||
write /sys/devices/system/cpu/cpu5/online 1
|
||||
write /sys/devices/system/cpu/cpu6/online 1
|
||||
write /sys/devices/system/cpu/cpu7/online 1
|
||||
# configure governor settings for little cluster
|
||||
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "schedutil"
|
||||
write /sys/devices/system/cpu/cpufreq/policy0/schedutil/up_rate_limit_us 500
|
||||
write /sys/devices/system/cpu/cpufreq/policy0/schedutil/down_rate_limit_us 20000
|
||||
|
||||
# configure governor settings for big cluster
|
||||
write /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor "schedutil"
|
||||
write /sys/devices/system/cpu/cpufreq/policy4/schedutil/up_rate_limit_us 500
|
||||
write /sys/devices/system/cpu/cpufreq/policy4/schedutil/down_rate_limit_us 20000
|
||||
|
||||
# set default schedTune value for foreground/top-app
|
||||
write /dev/stune/foreground/schedtune.prefer_idle 1
|
||||
write /dev/stune/top-app/schedtune.boost 10
|
||||
write /dev/stune/top-app/schedtune.prefer_idle 1
|
||||
|
||||
# Setup cpusets used by the VR services.
|
||||
mkdir /dev/cpuset/kernel 0750 root system
|
||||
write /dev/cpuset/kernel/cpus 0
|
||||
write /dev/cpuset/kernel/mems 0
|
||||
chown system system /dev/cpuset/kernel/tasks
|
||||
chmod 0660 /dev/cpuset/kernel/tasks
|
||||
|
||||
mkdir /dev/cpuset/system 0750 root system
|
||||
write /dev/cpuset/system/cpus 0
|
||||
write /dev/cpuset/system/mems 0
|
||||
chown system system /dev/cpuset/system/tasks
|
||||
chmod 0660 /dev/cpuset/system/tasks
|
||||
|
||||
mkdir /dev/cpuset/system/performance 0750 root system
|
||||
write /dev/cpuset/system/performance/cpus 0
|
||||
write /dev/cpuset/system/performance/mems 0
|
||||
chown system system /dev/cpuset/system/performance/tasks
|
||||
chmod 0660 /dev/cpuset/system/performance/tasks
|
||||
|
||||
mkdir /dev/cpuset/system/background 0750 root system
|
||||
write /dev/cpuset/system/background/cpus 0
|
||||
write /dev/cpuset/system/background/mems 0
|
||||
chown system system /dev/cpuset/system/background/tasks
|
||||
chmod 0660 /dev/cpuset/system/background/tasks
|
||||
|
||||
mkdir /dev/cpuset/application 0750 root system
|
||||
write /dev/cpuset/application/cpus 0
|
||||
write /dev/cpuset/application/mems 0
|
||||
chown system system /dev/cpuset/application/tasks
|
||||
chmod 0660 /dev/cpuset/application/tasks
|
||||
|
||||
mkdir /dev/cpuset/application/performance 0750 root system
|
||||
write /dev/cpuset/application/performance/cpus 0
|
||||
write /dev/cpuset/application/performance/mems 0
|
||||
chown system system /dev/cpuset/application/performance/tasks
|
||||
chmod 0660 /dev/cpuset/application/performance/tasks
|
||||
|
||||
mkdir /dev/cpuset/application/background 0750 root system
|
||||
write /dev/cpuset/application/background/cpus 0
|
||||
write /dev/cpuset/application/background/mems 0
|
||||
chown system system /dev/cpuset/application/background/tasks
|
||||
chmod 0660 /dev/cpuset/application/background/tasks
|
||||
|
||||
# Create UDS structure for base VR services.
|
||||
mkdir /dev/socket/pdx 0775 system system
|
||||
mkdir /dev/socket/pdx/system 0775 system system
|
||||
mkdir /dev/socket/pdx/system/buffer_hub 0775 system system
|
||||
mkdir /dev/socket/pdx/system/performance 0775 system system
|
||||
mkdir /dev/socket/pdx/system/vr 0775 system system
|
||||
mkdir /dev/socket/pdx/system/vr/display 0775 system system
|
||||
mkdir /dev/socket/pdx/system/vr/pose 0775 system system
|
||||
mkdir /dev/socket/pdx/system/vr/sensors 0775 system system
|
||||
|
||||
# Disable retention
|
||||
write /sys/module/lpm_levels/system/pwr/cpu0/ret/idle_enabled N
|
||||
write /sys/module/lpm_levels/system/pwr/cpu1/ret/idle_enabled N
|
||||
write /sys/module/lpm_levels/system/pwr/cpu2/ret/idle_enabled N
|
||||
write /sys/module/lpm_levels/system/pwr/cpu3/ret/idle_enabled N
|
||||
write /sys/module/lpm_levels/system/perf/cpu4/ret/idle_enabled N
|
||||
write /sys/module/lpm_levels/system/perf/cpu5/ret/idle_enabled N
|
||||
write /sys/module/lpm_levels/system/perf/cpu6/ret/idle_enabled N
|
||||
write /sys/module/lpm_levels/system/perf/cpu7/ret/idle_enabled N
|
||||
write /sys/module/lpm_levels/system/pwr/pwr-l2-dynret/idle_enabled N
|
||||
write /sys/module/lpm_levels/system/pwr/pwr-l2-ret/idle_enabled N
|
||||
write /sys/module/lpm_levels/system/perf/perf-l2-dynret/idle_enabled N
|
||||
write /sys/module/lpm_levels/system/perf/perf-l2-ret/idle_enabled N
|
||||
|
||||
# b/37682684 Enable suspend clock reporting
|
||||
write /sys/kernel/debug/clk/debug_suspend 1
|
||||
|
||||
# ZRAM setup
|
||||
write /sys/block/zram0/comp_algorithm lz4
|
||||
write /proc/sys/vm/page-cluster 0
|
||||
|
||||
on fs
|
||||
wait /dev/block/platform/soc/${ro.boot.bootdevice}
|
||||
symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
|
||||
|
||||
mount_all /vendor/etc/fstab.${ro.hardware} --early
|
||||
|
||||
mkdir /persist/data 0700 system system
|
||||
mkdir /persist/display 0770 system graphics
|
||||
mkdir /persist/rfs 0770 root system
|
||||
mkdir /persist/hlos_rfs 0770 root system
|
||||
mkdir /persist/elabel 0700 system system
|
||||
chmod 0770 /persist/rfs
|
||||
chmod 0770 /persist/rfs/shared
|
||||
chmod 0770 /persist/rfs/msm
|
||||
chmod 0770 /persist/rfs/msm/adsp
|
||||
chown system system /persist/rfs/msm/adsp
|
||||
chmod 0770 /persist/rfs/msm/mpss
|
||||
chown system system /persist/rfs/msm/mpss
|
||||
mkdir /persist/rfs/msm/slpi 0770 system system
|
||||
chmod 0770 /persist/rfs/mdm
|
||||
chmod 0770 /persist/rfs/mdm/adsp
|
||||
chown system system /persist/rfs/mdm/adsp
|
||||
chmod 0770 /persist/rfs/mdm/mpss
|
||||
chown system system /persist/rfs/mdm/mpss
|
||||
mkdir /persist/rfs/mdm/slpi 0770 system system
|
||||
chmod 0770 /persist/rfs/mdm/sparrow
|
||||
chown system system /persist/rfs/mdm/sparrow
|
||||
mkdir /persist/rfs/mdm/tn 0770 system system
|
||||
chmod 0770 /persist/rfs/apq
|
||||
chmod 0770 /persist/rfs/apq/gnss
|
||||
chmod 0770 /persist/hlos_rfs
|
||||
restorecon_recursive /persist
|
||||
|
||||
# Start HW service manager early
|
||||
start hwservicemanager
|
||||
|
||||
# qseecomd needs /dev/block/bootdevice
|
||||
# vold needs keymaster that needs qseecomd
|
||||
start qseecomd
|
||||
|
||||
on late-fs
|
||||
# Start devices by sysfs trigger
|
||||
start devstart_sh
|
||||
# Start services for bootanim
|
||||
start surfaceflinger
|
||||
start bootanim
|
||||
start hwcomposer-2-1
|
||||
start configstore-hal
|
||||
start gralloc-2-0
|
||||
|
||||
# Mount RW partitions which need run fsck
|
||||
mount_all /vendor/etc/fstab.${ro.hardware} --late
|
||||
|
||||
# Required for time_daemon
|
||||
mkdir /persist/time 0770 system system
|
||||
|
||||
# Start time daemon early so that the system time can be set early
|
||||
start time_daemon
|
||||
|
||||
on post-fs
|
||||
# set RLIMIT_MEMLOCK to 64MB
|
||||
setrlimit 8 67108864 67108864
|
||||
|
||||
chmod 0664 /sys/devices/virtual/graphics/fb0/idle_time
|
||||
chown system graphics /sys/devices/virtual/graphics/fb0/idle_time
|
||||
write /sys/devices/virtual/graphics/fb0/idle_time 100
|
||||
|
||||
# Wait qseecomd started
|
||||
wait_for_prop sys.listeners.registered true
|
||||
|
||||
on property:sys.user.0.ce_available=true
|
||||
mkdir /data/misc_ce/0/ramoops
|
||||
start ramoops_sh
|
||||
|
||||
on property:sys.ramoops.decrypted=true
|
||||
mount pstore pstore /sys/fs/pstore
|
||||
chown system log /sys/fs/pstore/console-ramoops
|
||||
chmod 0440 /sys/fs/pstore/console-ramoops
|
||||
chown system log /sys/fs/pstore/console-ramoops-0
|
||||
chmod 0440 /sys/fs/pstore/console-ramoops-0
|
||||
chown system log /sys/fs/pstore/pmsg-ramoops-0
|
||||
chmod 0440 /sys/fs/pstore/pmsg-ramoops-0
|
||||
|
||||
on property:sys.listeners.registered=true
|
||||
# load IPA FWs
|
||||
start ipastart_sh
|
||||
|
||||
on post-fs-data
|
||||
# We can start netd here before in is launched in common init.rc on zygote-start
|
||||
start netd
|
||||
|
||||
# b/38048356 Setup debug folders for camera
|
||||
mkdir /data/vendor/camera 0770 camera camera
|
||||
|
||||
# b/38496103 Setup debug folders for display
|
||||
mkdir /data/vendor/display 0770 system graphics
|
||||
|
||||
# keep that at the end of on post-fs-data
|
||||
# Set indication (checked by vold) that we have finished this action
|
||||
setprop vold.post_fs_data_done 1
|
||||
|
||||
# Wait until the system time is set
|
||||
wait_for_prop sys.time.set true
|
||||
|
||||
# zygote need to be started after otapreopt which will be done on post-fs-data
|
||||
on zygote-start
|
||||
# zygote is started in common init.rc
|
||||
# and now we can continue to initialize /data/
|
||||
mkdir /data/tombstones 0771 system system
|
||||
mkdir /tombstones/modem 0771 system system
|
||||
mkdir /tombstones/lpass 0771 system system
|
||||
mkdir /tombstones/wcnss 0771 system system
|
||||
mkdir /tombstones/dsps 0771 system system
|
||||
mkdir /data/misc/qvop 0660 system system
|
||||
mkdir /data/misc/hbtp 0750 system system
|
||||
mkdir /data/misc/seemp 0700 system system
|
||||
|
||||
# Create directory for TZ Apps
|
||||
mkdir /data/misc/qsee 0770 system system
|
||||
|
||||
mkdir /data/media 0770 media_rw media_rw
|
||||
chown media_rw media_rw /data/media
|
||||
|
||||
mkdir /data/vendor/ipa 0770 radio radio
|
||||
chown radio radio /data/vendor/ipa
|
||||
|
||||
# Create the directories used by the Wireless subsystem
|
||||
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/dhcp 0770 dhcp dhcp
|
||||
chown dhcp dhcp /data/misc/dhcp
|
||||
|
||||
# Mounting of persist is moved to 'on emmc-fs' and 'on fs' sections
|
||||
# We chown/chmod /persist again so because mount is run as root + defaults
|
||||
chown root system /persist
|
||||
chmod 0771 /persist
|
||||
chown system system /persist/WCNSS_qcom_wlan_nv.bin
|
||||
|
||||
# Create directory for hostapd
|
||||
mkdir /data/hostapd 0770 system wifi
|
||||
|
||||
# Trigger WLAN driver load
|
||||
write /sys/kernel/boot_wlan/boot_wlan 1
|
||||
|
||||
#create port-bridge log dir
|
||||
mkdir /data/misc/port_bridge 0770 radio radio
|
||||
chmod 0770 /data/misc/port_bridge
|
||||
|
||||
#create netmgr log dir
|
||||
mkdir /data/vendor/netmgr 0771 radio radio
|
||||
chmod 0771 /data/vendor/netmgr
|
||||
|
||||
# Create the directories used by CnE subsystem
|
||||
mkdir /data/connectivity 0771 system system
|
||||
chown system system /data/connectivity
|
||||
|
||||
# Create the directories used by DPM subsystem
|
||||
mkdir /data/dpm 0771 system system
|
||||
chown system system /data/dpm
|
||||
|
||||
mkdir /data/dpm/nsrm 0771 system system
|
||||
chown system system /data/dpm/nsrm
|
||||
|
||||
# Create directory used by audio subsystem
|
||||
mkdir /data/misc/audio 0770 audio audio
|
||||
|
||||
# Create directory for audio delta files
|
||||
mkdir /data/misc/audio/acdbdata 0770 media audio
|
||||
mkdir /data/misc/audio/acdbdata/delta 0770 media audio
|
||||
|
||||
# Create directory used by the DASH client
|
||||
mkdir /data/misc/dash 0770 media audio
|
||||
|
||||
# Create directory for radio
|
||||
mkdir /data/vendor/radio 0771 system radio
|
||||
|
||||
# Create directory used by display clients
|
||||
mkdir /data/misc/display 0770 system graphics
|
||||
|
||||
# Create perfd related dirs
|
||||
mkdir /data/system/perfd 0770 root system
|
||||
chmod 2770 /data/system/perfd
|
||||
|
||||
# Setup sensors-related directories and permissions
|
||||
mkdir /persist/sensors 0775
|
||||
chown root system /persist/sensors
|
||||
write /persist/sensors/sensors_settings 1
|
||||
chown root system /persist/sensors/sensors_settings
|
||||
chmod 664 /persist/sensors/sensors_settings
|
||||
chown root system /persist/sensors/sns.reg
|
||||
chmod 664 /persist/sensors/sns.reg
|
||||
|
||||
mkdir /data/vendor/sensors 0770
|
||||
chown system system /data/vendor/sensors
|
||||
|
||||
# These files might have been created by root from a prior build - make sure
|
||||
# they are accessible to the sensors daemon
|
||||
chown system system /data/vendor/sensors/cal.bin
|
||||
chown system system /data/vendor/sensors/cal.txt
|
||||
|
||||
# /dev/sensors only supports an ioctl to get the current SLPI timestamp;
|
||||
# allow the sensors daemon to perform this as non-root
|
||||
chown root system /dev/sensors
|
||||
chmod 660 /dev/sensors
|
||||
|
||||
# Mark the copy complete flag to not completed
|
||||
write /data/vendor/radio/copy_complete 0
|
||||
chown radio radio /data/vendor/radio/copy_complete
|
||||
chmod 0660 /data/vendor/radio/copy_complete
|
||||
|
||||
# File flags for prebuilt ril db file
|
||||
write /data/vendor/radio/prebuilt_db_support 1
|
||||
chown radio radio /data/vendor/radio/prebuilt_db_support
|
||||
chmod 0400 /data/vendor/radio/prebuilt_db_support
|
||||
write /data/vendor/radio/db_check_done 0
|
||||
chown radio radio /data/vendor/radio/db_check_done
|
||||
chmod 0660 /data/vendor/radio/db_check_done
|
||||
|
||||
# Create directories for Location services
|
||||
mkdir /data/vendor/location 0770 gps gps
|
||||
mkdir /data/vendor/location/mq 0770 gps gps
|
||||
mkdir /data/vendor/location/xtwifi 0770 gps gps
|
||||
|
||||
# NFC local data and nfcee xml storage
|
||||
mkdir /data/nfc 0770 nfc nfc
|
||||
mkdir /data/nfc/param 0770 nfc nfc
|
||||
mkdir /data/vendor/nfc 0770 nfc nfc
|
||||
|
||||
# b/62837579 elabel directory
|
||||
mkdir /data/misc/elabel 0700 system system
|
||||
|
||||
|
||||
on early-boot
|
||||
# wait for devices
|
||||
wait_for_prop sys.qcom.devup 1
|
||||
# wait for insmod_sh to finish all modules
|
||||
wait_for_prop sys.all.modules.ready 1
|
||||
# Update dm-verity state and set partition.*.verified properties
|
||||
verity_update_state
|
||||
|
||||
# Permission for laser sensor driver
|
||||
chown camera camera /sys/class/wahoo_laser/laser/enable_ps_sensor
|
||||
|
||||
# Permission for Vibrator
|
||||
chown system system /sys/class/leds/vibrator/device/mode
|
||||
chown system system /sys/class/leds/vibrator/device/od_clamp
|
||||
chown system system /sys/class/leds/vibrator/device/rtp_input
|
||||
chown system system /sys/class/leds/vibrator/device/scale
|
||||
chown system system /sys/class/leds/vibrator/device/set_sequencer
|
||||
chown system system /sys/class/leds/vibrator/device/autocal_result
|
||||
chown system system /sys/class/leds/vibrator/device/ctrl_loop
|
||||
chown system system /sys/class/leds/vibrator/device/ol_lra_period
|
||||
chown system system /sys/class/leds/vibrator/device/autocal
|
||||
chown system system /sys/class/leds/vibrator/device/lp_trigger_effect
|
||||
|
||||
# Permission for LED driver
|
||||
chown system system /sys/class/leds/red/on_off_ms
|
||||
chown system system /sys/class/leds/green/on_off_ms
|
||||
chown system system /sys/class/leds/blue/on_off_ms
|
||||
chown system system /sys/class/leds/red/rgb_start
|
||||
chown system system /sys/class/leds/green/rgb_start
|
||||
chown system system /sys/class/leds/blue/rgb_start
|
||||
chown system system /sys/class/graphics/fb0/msm_fb_persist_mode
|
||||
|
||||
on boot
|
||||
mkdir /dev/socket/qmux_radio 0770 radio radio
|
||||
chmod 2770 /dev/socket/qmux_radio
|
||||
mkdir /dev/socket/qmux_audio 0770 media audio
|
||||
chmod 2770 /dev/socket/qmux_audio
|
||||
mkdir /dev/socket/qmux_bluetooth 0770 bluetooth bluetooth
|
||||
chmod 2770 /dev/socket/qmux_bluetooth
|
||||
mkdir /dev/socket/qmux_gps 0770 gps gps
|
||||
chmod 2770 /dev/socket/qmux_gps
|
||||
|
||||
# Create NETMGR daemon socket area
|
||||
mkdir /dev/socket/netmgr 0750 radio radio
|
||||
|
||||
setprop wifi.interface wlan0
|
||||
|
||||
# Define TCP buffer sizes for various networks
|
||||
# ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
|
||||
setprop net.tcp.buffersize.wifi 524288,2097152,4194304,262144,524288,1048576
|
||||
|
||||
# Assign TCP buffer thresholds to be ceiling value of technology maximums
|
||||
# Increased technology maximums should be reflected here.
|
||||
write /proc/sys/net/core/rmem_max 8388608
|
||||
write /proc/sys/net/core/wmem_max 8388608
|
||||
|
||||
# Update DVR cpusets to boot-time values.
|
||||
write /dev/cpuset/kernel/cpus 0-7
|
||||
write /dev/cpuset/system/cpus 0-7
|
||||
write /dev/cpuset/system/performance/cpus 0-7
|
||||
write /dev/cpuset/system/background/cpus 0-7
|
||||
write /dev/cpuset/system/cpus 0-7
|
||||
write /dev/cpuset/application/cpus 0-7
|
||||
write /dev/cpuset/application/performance/cpus 0-7
|
||||
write /dev/cpuset/application/background/cpus 0-7
|
||||
write /dev/cpuset/application/cpus 0-7
|
||||
|
||||
# Bluetooth
|
||||
chown bluetooth net_bt /sys/class/rfkill/rfkill0/type
|
||||
chown bluetooth net_bt /sys/class/rfkill/rfkill0/state
|
||||
chmod 0660 /sys/class/rfkill/rfkill0/state
|
||||
chown bluetooth net_bt /sys/class/rfkill/rfkill0/device/extldo
|
||||
chmod 0660 /sys/class/rfkill/rfkill0/device/extldo
|
||||
|
||||
# Wifi firmware reload path
|
||||
chown wifi wifi /sys/module/wlan/parameters/fwpath
|
||||
|
||||
# Allow system to write to cycle_count_id to iterate and get stats
|
||||
chown system system /sys/class/power_supply/bms/cycle_count_id
|
||||
chmod 0666 /sys/class/power_supply/bms/cycle_count_id
|
||||
|
||||
# default country code
|
||||
setprop ro.boot.wificountrycode 00
|
||||
|
||||
# Encrypted ramoops
|
||||
umount /sys/fs/pstore
|
||||
chmod 770 /dev/access-ramoops
|
||||
chown system system /dev/access-ramoops
|
||||
chmod 770 /dev/access-metadata
|
||||
chown system system /dev/access-metadata
|
||||
|
||||
# Make the ftm4 command node writeable from dumpstate
|
||||
chown system system /sys/devices/virtual/input/ftm4_touch/cmd
|
||||
|
||||
# ftm4 VR mode
|
||||
chown system system /sys/devices/virtual/input/ftm4_touch/vrmode
|
||||
|
||||
service init-elabel-sh /system/bin/init.elabel.sh
|
||||
class late_start
|
||||
user system
|
||||
group system
|
||||
oneshot
|
||||
|
||||
service init-radio-sh /vendor/bin/init.radio.sh
|
||||
class late_start
|
||||
user radio
|
||||
group root radio
|
||||
oneshot
|
||||
|
||||
service folio_daemon /system/bin/folio_daemon
|
||||
class late_start
|
||||
user system
|
||||
group system
|
||||
|
||||
service perfd /vendor/bin/perfd
|
||||
class main
|
||||
user root
|
||||
group root readproc system
|
||||
socket perfd seqpacket 0666 root system
|
||||
disabled
|
||||
|
||||
service thermal-engine /vendor/bin/thermal-engine -c ${sys.qcom.thermalcfg:-/vendor/etc/thermal-engine.conf}
|
||||
class main
|
||||
user root
|
||||
group root system
|
||||
socket thermal-send-client stream 0666 system system
|
||||
socket thermal-recv-client stream 0660 system system
|
||||
socket thermal-recv-passive-client stream 0666 system system
|
||||
|
||||
service msm_irqbalance /vendor/bin/msm_irqbalance -f /vendor/etc/msm_irqbalance.conf
|
||||
socket msm_irqbalance seqpacket 660 root system
|
||||
class core
|
||||
user root
|
||||
group root
|
||||
writepid /dev/cpuset/system-background/tasks
|
||||
|
||||
on property:persist.sys.ssr.restart_level=*
|
||||
start ssr_setup
|
||||
|
||||
service ssr_setup /vendor/bin/ssr_setup
|
||||
oneshot
|
||||
disabled
|
||||
|
||||
service ssr_diag /vendor/bin/ssr_diag
|
||||
class late_start
|
||||
user system
|
||||
group system
|
||||
disabled
|
||||
|
||||
service per_mgr /vendor/bin/pm-service
|
||||
class core
|
||||
user system
|
||||
group system
|
||||
ioprio rt 4
|
||||
shutdown critical
|
||||
|
||||
service per_proxy /vendor/bin/pm-proxy
|
||||
class core
|
||||
user system
|
||||
group system
|
||||
disabled
|
||||
|
||||
on property:sys.post_boot.parsed=1
|
||||
start perfd
|
||||
|
||||
on property:sys.boot_completed=1
|
||||
# Enable power setting and set sys.post_boot.parsed to 1
|
||||
# to start perfd
|
||||
start power_sh
|
||||
|
||||
# Enable UFS powersaving
|
||||
write /sys/devices/soc/${ro.boot.bootdevice}/clkscale_enable 1
|
||||
write /sys/devices/soc/${ro.boot.bootdevice}/clkgate_enable 1
|
||||
write /sys/devices/soc/${ro.boot.bootdevice}/hibern8_on_idle_enable 1
|
||||
write /sys/module/lpm_levels/parameters/sleep_disabled N
|
||||
|
||||
# Enable ZRAM on boot_complete
|
||||
swapon_all /vendor/etc/fstab.${ro.hardware}
|
||||
|
||||
# Setup final cpuset
|
||||
write /dev/cpuset/top-app/cpus 0-7
|
||||
write /dev/cpuset/foreground/boost/cpus 0-3,6-7
|
||||
write /dev/cpuset/foreground/cpus 0-3,6-7
|
||||
write /dev/cpuset/background/cpus 0-1
|
||||
write /dev/cpuset/system-background/cpus 0-3
|
||||
|
||||
# Update DVR cpusets to runtime values.
|
||||
write /dev/cpuset/kernel/cpus 2,3
|
||||
write /dev/cpuset/system/performance/cpus 6-7
|
||||
write /dev/cpuset/system/background/cpus 0-1
|
||||
write /dev/cpuset/system/cpus 0-1,6-7
|
||||
write /dev/cpuset/application/performance/cpus 4-5
|
||||
write /dev/cpuset/application/background/cpus 0-1
|
||||
write /dev/cpuset/application/cpus 0-1,4-5
|
||||
|
||||
on property:init.svc.per_mgr=running
|
||||
start per_proxy
|
||||
|
||||
on shutdown
|
||||
stop per_proxy
|
||||
# Disable subsystem restart
|
||||
write /sys/module/subsystem_restart/parameters/disable_restart_work 0x9889deed
|
||||
|
||||
service qseecomd /vendor/bin/qseecomd
|
||||
class core
|
||||
user root
|
||||
group root
|
||||
shutdown critical
|
||||
|
||||
service time_daemon /vendor/bin/time_daemon
|
||||
class core
|
||||
user root
|
||||
group root
|
||||
|
||||
service ss_ramdump /vendor/bin/subsystem_ramdump
|
||||
class main
|
||||
user root
|
||||
group root system
|
||||
disabled
|
||||
|
||||
on property:persist.sys.ssr.enable_ramdumps=1
|
||||
write /sys/module/subsystem_restart/parameters/enable_ramdumps 1
|
||||
mkdir /data/vendor/ssrdump 761 root system
|
||||
mkdir /data/vendor/ramdump 771 root system
|
||||
mkdir /data/vendor/ramdump/bluetooth 771 root system
|
||||
start ss_ramdump
|
||||
|
||||
on property:persist.sys.ssr.enable_ramdumps=0
|
||||
write /sys/module/subsystem_restart/parameters/enable_ramdumps 0
|
||||
|
||||
service sensors /vendor/bin/sensors.qcom
|
||||
class core
|
||||
user system
|
||||
group system
|
||||
# Grants the ability for this daemon to bind IPC router ports so it can
|
||||
# register QMI services
|
||||
capabilities NET_BIND_SERVICE
|
||||
|
||||
service adsprpcd /vendor/bin/adsprpcd
|
||||
class main
|
||||
user media
|
||||
group media
|
||||
|
||||
service irsc_util /vendor/bin/irsc_util "/vendor/etc/sec_config"
|
||||
class core
|
||||
user root
|
||||
oneshot
|
||||
|
||||
service rmt_storage /vendor/bin/rmt_storage
|
||||
class core
|
||||
user root
|
||||
ioprio rt 0
|
||||
shutdown critical
|
||||
|
||||
service tftp_server /vendor/bin/tftp_server
|
||||
class core
|
||||
user root
|
||||
group root system
|
||||
|
||||
service wpa_supplicant /vendor/bin/hw/wpa_supplicant \
|
||||
-ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \
|
||||
-I/vendor/etc/wifi/p2p_supplicant_overlay.conf -N \
|
||||
-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
|
||||
-I/vendor/etc/wifi/wpa_supplicant_overlay.conf \
|
||||
-O/data/misc/wifi/sockets -puse_p2p_group_interface=1 -dd \
|
||||
-e/data/misc/wifi/entropy.bin -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 cnss-daemon /vendor/bin/cnss-daemon -n -l
|
||||
class late_start
|
||||
user system
|
||||
group system inet wifi
|
||||
|
||||
service imsqmidaemon /vendor/bin/imsqmidaemon
|
||||
class main
|
||||
user system
|
||||
socket ims_qmid stream 0660 system radio
|
||||
group radio log diag
|
||||
|
||||
service imsdatadaemon /vendor/bin/imsdatadaemon
|
||||
class main
|
||||
user system
|
||||
socket ims_datad stream 0660 system radio
|
||||
group system wifi radio inet log
|
||||
disabled
|
||||
|
||||
on property:vendor.ims.QMI_DAEMON_STATUS=1
|
||||
start imsdatadaemon
|
||||
|
||||
service ims_rtp_daemon /vendor/bin/ims_rtp_daemon
|
||||
class main
|
||||
user system
|
||||
group radio diag inet log
|
||||
disabled
|
||||
|
||||
service imsrcsservice /vendor/bin/imsrcsd
|
||||
class hal
|
||||
user system
|
||||
group radio diag inet log
|
||||
disabled
|
||||
|
||||
on property:vendor.ims.DATA_DAEMON_STATUS=1
|
||||
start ims_rtp_daemon
|
||||
start imsrcsservice
|
||||
|
||||
service qmuxd /vendor/bin/qmuxd
|
||||
class main
|
||||
user root
|
||||
group radio audio bluetooth gps nfc qcom_diag
|
||||
|
||||
#TODO evaluate group system once b/62571088 is resolved
|
||||
service cnd /vendor/bin/cnd
|
||||
class main
|
||||
user system
|
||||
group inet system wifi radio wakelock
|
||||
|
||||
service netmgrd /vendor/bin/netmgrd
|
||||
class main
|
||||
user root
|
||||
group root wifi wakelock radio inet
|
||||
|
||||
service port-bridge /vendor/bin/port-bridge
|
||||
class main
|
||||
user radio
|
||||
group radio system inet
|
||||
oneshot
|
||||
|
||||
service ipacm /vendor/bin/ipacm
|
||||
class main
|
||||
user radio
|
||||
group radio inet
|
||||
|
||||
service qti /vendor/bin/qti
|
||||
class main
|
||||
user radio
|
||||
group radio net_raw diag usb net_admin
|
||||
|
||||
on property:wc_transport.start_hci=true
|
||||
start hci_filter
|
||||
|
||||
on property:wc_transport.start_hci=false
|
||||
stop hci_filter
|
||||
|
||||
service hci_filter /vendor/bin/wcnss_filter
|
||||
class late_start
|
||||
user bluetooth
|
||||
group bluetooth diag system wakelock
|
||||
disabled
|
||||
|
||||
service loc_launcher /vendor/bin/loc_launcher
|
||||
class late_start
|
||||
group gps inet diag wifi
|
||||
|
||||
service pd_mapper /vendor/bin/pd-mapper
|
||||
class core
|
||||
|
||||
service atfwd /vendor/bin/ATFWD-daemon
|
||||
class late_start
|
||||
user system
|
||||
group system radio
|
||||
disabled
|
||||
|
||||
on property:persist.radio.atfwd.start=true
|
||||
start atfwd
|
||||
|
||||
on property:persist.radio.atfwd.start=false
|
||||
stop atfwd
|
||||
|
||||
# bugreport is triggered by holding down volume down, volume up and power
|
||||
service bugreport /system/bin/dumpstate -d -p -B -z \
|
||||
-o /data/user_de/0/com.android.shell/files/bugreports/bugreport
|
||||
class main
|
||||
disabled
|
||||
oneshot
|
||||
keycodes 114 115 116
|
||||
|
||||
service chre /vendor/bin/chre
|
||||
class late_start
|
||||
user system
|
||||
group system
|
||||
socket chre seqpacket 0660 root system
|
||||
shutdown critical
|
||||
|
||||
service power_sh /vendor/bin/init.power.sh
|
||||
class main
|
||||
user root
|
||||
group root system
|
||||
disabled
|
||||
oneshot
|
||||
|
||||
service devstart_sh /vendor/bin/init.qcom.devstart.sh
|
||||
class main
|
||||
user root
|
||||
group root system
|
||||
disabled
|
||||
oneshot
|
||||
|
||||
service ipastart_sh /vendor/bin/init.qcom.ipastart.sh
|
||||
class main
|
||||
user system
|
||||
group net_admin
|
||||
disabled
|
||||
oneshot
|
||||
|
||||
service insmod_sh /vendor/bin/init.insmod.sh
|
||||
class main
|
||||
user root
|
||||
group root system
|
||||
disabled
|
||||
oneshot
|
||||
|
||||
service ramoops_sh /system/bin/init.ramoops.sh
|
||||
class main
|
||||
user root
|
||||
group root system
|
||||
disabled
|
||||
oneshot
|
||||
|
||||
118
init.hardware.usb.rc
Normal file
118
init.hardware.usb.rc
Normal file
@@ -0,0 +1,118 @@
|
||||
#
|
||||
# Copyright (C) 2016 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.
|
||||
#
|
||||
|
||||
on boot
|
||||
mount configfs none /config
|
||||
mkdir /config/usb_gadget/g1 0770 shell shell
|
||||
mkdir /config/usb_gadget/g1/strings/0x409 0770 shell shell
|
||||
write /config/usb_gadget/g1/bcdUSB 0x0200
|
||||
write /config/usb_gadget/g1/idVendor 0x18d1
|
||||
write /config/usb_gadget/g1/bcdDevice 0x0440
|
||||
write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno}
|
||||
write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer}
|
||||
write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model}
|
||||
mkdir /config/usb_gadget/g1/functions/mass_storage.0
|
||||
mkdir /config/usb_gadget/g1/functions/accessory.gs2
|
||||
mkdir /config/usb_gadget/g1/functions/audio_source.gs3
|
||||
mkdir /config/usb_gadget/g1/functions/midi.gs5
|
||||
mkdir /config/usb_gadget/g1/functions/ffs.adb
|
||||
mkdir /config/usb_gadget/g1/functions/ffs.mtp
|
||||
mkdir /config/usb_gadget/g1/functions/diag.diag
|
||||
mkdir /config/usb_gadget/g1/functions/cser.dun.0
|
||||
mkdir /config/usb_gadget/g1/functions/cser.nmea.1
|
||||
mkdir /config/usb_gadget/g1/functions/gsi.rmnet
|
||||
mkdir /config/usb_gadget/g1/functions/gsi.rndis
|
||||
mkdir /config/usb_gadget/g1/functions/qdss.qdss
|
||||
mkdir /config/usb_gadget/g1/configs/b.1 0770 shell shell
|
||||
mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell
|
||||
write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1
|
||||
mkdir /dev/usb-ffs 0775 shell shell
|
||||
mkdir /dev/usb-ffs/adb 0770 shell shell
|
||||
mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
|
||||
mkdir /dev/usb-ffs/mtp 0770 mtp mtp
|
||||
mount functionfs mtp /dev/usb-ffs/mtp rmode=0770,fmode=0660,uid=1024,gid=1024,no_disconnect=1
|
||||
setprop sys.usb.ffs.max_write 524288
|
||||
setprop sys.usb.ffs.max_read 524288
|
||||
setprop sys.usb.mtp.device_type 3
|
||||
setprop sys.usb.configfs 1
|
||||
setprop sys.usb.controller "a800000.dwc3"
|
||||
write /sys/module/libcomposite/parameters/disable_l1_for_hs "y"
|
||||
|
||||
on property:sys.usb.ffs.mtp.ready=1 && property:sys.usb.config=mtp && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/idVendor 0x18d1
|
||||
write /config/usb_gadget/g1/idProduct 0x4ee1
|
||||
symlink /config/usb_gadget/g1/functions/ffs.mtp /config/usb_gadget/g1/configs/b.1/f1
|
||||
|
||||
on property:sys.usb.ffs.ready=1 && property:sys.usb.ffs.mtp.ready=1 && property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/idVendor 0x18d1
|
||||
write /config/usb_gadget/g1/idProduct 0x4ee2
|
||||
symlink /config/usb_gadget/g1/functions/ffs.mtp /config/usb_gadget/g1/configs/b.1/f1
|
||||
|
||||
on property:sys.usb.config=rndis && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/idVendor 0x18d1
|
||||
write /config/usb_gadget/g1/idProduct 0x4ee3
|
||||
symlink /config/usb_gadget/g1/functions/gsi.rndis /config/usb_gadget/g1/configs/b.1/f1
|
||||
|
||||
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,adb && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/idVendor 0x18d1
|
||||
write /config/usb_gadget/g1/idProduct 0x4ee4
|
||||
symlink /config/usb_gadget/g1/functions/gsi.rndis /config/usb_gadget/g1/configs/b.1/f1
|
||||
|
||||
on property:sys.usb.ffs.mtp.ready=1 && property:sys.usb.config=ptp && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/idVendor 0x18d1
|
||||
write /config/usb_gadget/g1/idProduct 0x4ee5
|
||||
symlink /config/usb_gadget/g1/functions/ffs.mtp /config/usb_gadget/g1/configs/b.1/f1
|
||||
|
||||
on property:sys.usb.ffs.ready=1 && property:sys.usb.ffs.mtp.ready=1 && property:sys.usb.config=ptp,adb && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/idVendor 0x18d1
|
||||
write /config/usb_gadget/g1/idProduct 0x4ee6
|
||||
symlink /config/usb_gadget/g1/functions/ffs.mtp /config/usb_gadget/g1/configs/b.1/f1
|
||||
|
||||
on property:sys.usb.config=adb && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/idVendor 0x18d1
|
||||
write /config/usb_gadget/g1/idProduct 0x4ee7
|
||||
|
||||
on property:sys.usb.config=midi && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/idVendor 0x18d1
|
||||
write /config/usb_gadget/g1/idProduct 0x4ee8
|
||||
|
||||
on property:sys.usb.config=midi,adb && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/idVendor 0x18d1
|
||||
write /config/usb_gadget/g1/idProduct 0x4ee9
|
||||
|
||||
on property:sys.usb.config=accessory && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/idVendor 0x18d1
|
||||
write /config/usb_gadget/g1/idProduct 0x2d00
|
||||
|
||||
on property:sys.usb.config=accessory,adb && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/idVendor 0x18d1
|
||||
write /config/usb_gadget/g1/idProduct 0x2d01
|
||||
|
||||
on property:sys.usb.config=audio_source && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/idVendor 0x18d1
|
||||
write /config/usb_gadget/g1/idProduct 0x2d02
|
||||
|
||||
on property:sys.usb.config=audio_source,adb && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/idVendor 0x18d1
|
||||
write /config/usb_gadget/g1/idProduct 0x2d03
|
||||
|
||||
on property:sys.usb.config=accessory,audio_source && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/idVendor 0x18d1
|
||||
write /config/usb_gadget/g1/idProduct 0x2d04
|
||||
|
||||
on property:sys.usb.config=accessory,audio_source,adb && property:sys.usb.configfs=1
|
||||
write /config/usb_gadget/g1/idVendor 0x18d1
|
||||
write /config/usb_gadget/g1/idProduct 0x2d05
|
||||
24
init.insmod.sh
Executable file
24
init.insmod.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#! /vendor/bin/sh
|
||||
|
||||
#########################################
|
||||
### init.insmod.cfg format: ###
|
||||
### --------------------------------- ###
|
||||
### [insmod|setprop] [path|prop name] ###
|
||||
### ... ###
|
||||
#########################################
|
||||
|
||||
cfg_file="/vendor/etc/init.insmod.cfg"
|
||||
|
||||
if [ -f $cfg_file ]; then
|
||||
while IFS=" " read -r action name
|
||||
do
|
||||
case $action in
|
||||
"insmod") insmod $name ;;
|
||||
"setprop") setprop $name 1 ;;
|
||||
esac
|
||||
done < $cfg_file
|
||||
fi
|
||||
|
||||
# set property even if there is no insmod config
|
||||
# as property value "1" is expected in early-boot trigger
|
||||
setprop sys.all.modules.ready 1
|
||||
53
init.power.sh
Executable file
53
init.power.sh
Executable file
@@ -0,0 +1,53 @@
|
||||
#! /vendor/bin/sh
|
||||
|
||||
################################################################################
|
||||
# helper functions to allow Android init like script
|
||||
|
||||
function write() {
|
||||
echo -n $2 > $1
|
||||
}
|
||||
|
||||
function copy() {
|
||||
cat $1 > $2
|
||||
}
|
||||
|
||||
################################################################################
|
||||
|
||||
# Enable bus-dcvs
|
||||
for cpubw in /sys/class/devfreq/*qcom,cpubw*
|
||||
do
|
||||
write $cpubw/governor "bw_hwmon"
|
||||
write $cpubw/polling_interval 50
|
||||
write $cpubw/min_freq 1525
|
||||
write $cpubw/bw_hwmon/mbps_zones "3143 5859 11863 13763"
|
||||
write $cpubw/bw_hwmon/sample_ms 4
|
||||
write $cpubw/bw_hwmon/io_percent 34
|
||||
write $cpubw/bw_hwmon/hist_memory 20
|
||||
write $cpubw/bw_hwmon/hyst_length 10
|
||||
write $cpubw/bw_hwmon/low_power_ceil_mbps 0
|
||||
write $cpubw/bw_hwmon/low_power_io_percent 34
|
||||
write $cpubw/bw_hwmon/low_power_delay 20
|
||||
write $cpubw/bw_hwmon/guard_band_mbps 0
|
||||
write $cpubw/bw_hwmon/up_scale 250
|
||||
write $cpubw/bw_hwmon/idle_mbps 1600
|
||||
done
|
||||
|
||||
write /sys/class/devfreq/soc:qcom,mincpubw/governor "cpufreq"
|
||||
|
||||
# Enable memlat governor
|
||||
for memlat in /sys/class/devfreq/*qcom,memlat-cpu*
|
||||
do
|
||||
write $memlat/governor "mem_latency"
|
||||
write $memlat/polling_interval 10
|
||||
write $memlat/mem_latency/ratio_ceil 400
|
||||
done
|
||||
|
||||
# Signal perfd that boot has completed
|
||||
setprop sys.post_boot.parsed 1
|
||||
|
||||
# On debuggable builds, enable console_suspend if uart is enabled to save power
|
||||
# Otherwise, disable console_suspend to get better logging for kernel crashes
|
||||
if [[ $(getprop ro.debuggable) == "1" && ! -e /sys/class/tty/ttyMSM0 ]]
|
||||
then
|
||||
write /sys/module/printk/parameters/console_suspend N
|
||||
fi
|
||||
10
init.qcom.devstart.sh
Normal file
10
init.qcom.devstart.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#! /vendor/bin/sh
|
||||
|
||||
echo 1 > /sys/kernel/boot_adsp/boot
|
||||
echo 1 > /sys/kernel/boot_slpi/boot
|
||||
setprop sys.qcom.devup 1
|
||||
|
||||
version=`grep -ao "OEM_IMAGE_VERSION_STRING[ -~]*" \
|
||||
/vendor/firmware/slpi_v2.b04 | \
|
||||
sed -e s/OEM_IMAGE_VERSION_STRING=SLPI.version.// -e s/\(.*\).//`
|
||||
setprop sys.slpi.firmware.version "$version"
|
||||
3
init.qcom.ipastart.sh
Normal file
3
init.qcom.ipastart.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#! /vendor/bin/sh
|
||||
|
||||
echo 1 > /dev/ipa
|
||||
33
init.radio.sh
Normal file
33
init.radio.sh
Normal file
@@ -0,0 +1,33 @@
|
||||
#! /vendor/bin/sh
|
||||
|
||||
#
|
||||
# Copy qcril.db if needed for RIL
|
||||
#
|
||||
if [ -f /vendor/radio/qcril_database/qcril.db -a ! -f /data/vendor/radio/qcril.db ]; then
|
||||
cp /vendor/radio/qcril_database/qcril.db /data/vendor/radio/qcril.db
|
||||
chown -h radio.radio /data/vendor/radio/qcril.db
|
||||
fi
|
||||
echo 1 > /data/vendor/radio/db_check_done
|
||||
|
||||
#
|
||||
# Make modem config folder and copy firmware config to that folder for RIL
|
||||
#
|
||||
if [ -f /data/vendor/radio/ver_info.txt ]; then
|
||||
prev_version_info=`cat /data/vendor/radio/ver_info.txt`
|
||||
else
|
||||
prev_version_info=""
|
||||
fi
|
||||
|
||||
cur_version_info=`cat /firmware/verinfo/ver_info.txt`
|
||||
if [ ! -f /firmware/verinfo/ver_info.txt -o "$prev_version_info" != "$cur_version_info" ]; then
|
||||
rm -rf /data/vendor/radio/modem_config
|
||||
mkdir /data/vendor/radio/modem_config
|
||||
chmod 770 /data/vendor/radio/modem_config
|
||||
cp -r /firmware/image/modem_pr/mcfg/configs/* /data/vendor/radio/modem_config
|
||||
chown -hR radio.radio /data/vendor/radio/modem_config
|
||||
cp /firmware/verinfo/ver_info.txt /data/vendor/radio/ver_info.txt
|
||||
chown radio.radio /data/vendor/radio/ver_info.txt
|
||||
fi
|
||||
cp /firmware/image/modem_pr/mbn_ota.txt /data/vendor/radio/modem_config
|
||||
chown radio.radio /data/vendor/radio/modem_config/mbn_ota.txt
|
||||
echo 1 > /data/vendor/radio/copy_complete
|
||||
22
init.ramoops.sh
Normal file
22
init.ramoops.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/system/bin/sh
|
||||
|
||||
# Decrypt the keys and write them to the kernel
|
||||
ramoops -D
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
# Pivot (and decrypt)
|
||||
echo 1 > /sys/devices/virtual/ramoops/pstore/use_alt
|
||||
else
|
||||
setprop sys.ramoops.decryption.error $?
|
||||
fi
|
||||
|
||||
# Trigger remount of pstore regardless of decryption state
|
||||
setprop sys.ramoops.decrypted true
|
||||
|
||||
# Generate keys (if none exist), and load the keys to carveout
|
||||
if [[ $(getprop ro.hardware) == "walleye" ]]; then
|
||||
ramoops -g -l -c
|
||||
else
|
||||
ramoops -g -l
|
||||
fi
|
||||
|
||||
24
init.recovery.hardware.rc
Normal file
24
init.recovery.hardware.rc
Normal file
@@ -0,0 +1,24 @@
|
||||
on fs
|
||||
wait /dev/block/platform/soc/${ro.boot.bootdevice}
|
||||
symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
|
||||
|
||||
on init
|
||||
mount configfs none /config
|
||||
mkdir /config/usb_gadget/g1 0770 shell shell
|
||||
write /config/usb_gadget/g1/idVendor 0x18d1
|
||||
write /config/usb_gadget/g1/idProduct 0xd001
|
||||
mkdir /config/usb_gadget/g1/strings/0x409 0770
|
||||
write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno}
|
||||
write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer}
|
||||
write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model}
|
||||
mkdir /config/usb_gadget/g1/functions/ffs.adb
|
||||
write /config/usb_gadget/g1/os_desc/use 1
|
||||
setprop sys.usb.configfs 1
|
||||
|
||||
on property:sys.usb.ffs.ready=1
|
||||
mkdir /config/usb_gadget/g1/configs/b.1 0777 shell shell
|
||||
symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1
|
||||
mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell
|
||||
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb"
|
||||
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1
|
||||
write /config/usb_gadget/g1/UDC "a800000.dwc3"
|
||||
30
liblight/Android.mk
Normal file
30
liblight/Android.mk
Normal file
@@ -0,0 +1,30 @@
|
||||
# Copyright (C) 2016 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
LOCAL_PATH:= $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := lights.c
|
||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||
LOCAL_PROPRIETARY_MODULE := true
|
||||
LOCAL_SHARED_LIBRARIES := libc libcutils liblog
|
||||
LOCAL_CFLAGS := $(common_flags) \
|
||||
-DLOG_TAG=\"qdlights\" \
|
||||
-DDEFAULT_LOW_PERSISTENCE_MODE_BRIGHTNESS=$(DEFAULT_LOW_PERSISTENCE_MODE_BRIGHTNESS)
|
||||
LOCAL_CLANG := true
|
||||
LOCAL_MODULE := lights.$(TARGET_DEVICE)
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
190
liblight/NOTICE
Normal file
190
liblight/NOTICE
Normal file
@@ -0,0 +1,190 @@
|
||||
|
||||
Copyright (c) 2008, The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
388
liblight/lights.c
Normal file
388
liblight/lights.c
Normal file
@@ -0,0 +1,388 @@
|
||||
/*
|
||||
* Copyright (C) 2008 The Android Open Source Project
|
||||
* Copyright (C) 2014 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* 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 <cutils/log.h>
|
||||
#include <cutils/properties.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <linux/msm_mdp.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <hardware/lights.h>
|
||||
|
||||
/*
|
||||
* Change this to 1 to support battery notifications via BatteryService
|
||||
*/
|
||||
#define LIGHTS_SUPPORT_BATTERY 0
|
||||
#define CG_COLOR_ID_PROPERTY "ro.boot.hardware.color"
|
||||
|
||||
#define LP_MODE_BRIGHTNESS_PROPERTY "sys.display.low_persistence_mode_brightness"
|
||||
|
||||
static pthread_once_t g_init = PTHREAD_ONCE_INIT;
|
||||
static pthread_mutex_t g_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
static struct light_state_t g_notification;
|
||||
static struct light_state_t g_battery;
|
||||
static int g_last_backlight_mode = BRIGHTNESS_MODE_USER;
|
||||
static int g_attention = 0;
|
||||
static int rgb_brightness_ratio = 255;
|
||||
|
||||
char const*const RED_LED_FILE
|
||||
= "/sys/class/leds/red/brightness";
|
||||
|
||||
char const*const GREEN_LED_FILE
|
||||
= "/sys/class/leds/green/brightness";
|
||||
|
||||
char const*const BLUE_LED_FILE
|
||||
= "/sys/class/leds/blue/brightness";
|
||||
|
||||
char const*const LCD_FILE
|
||||
= "/sys/class/leds/lcd-backlight/brightness";
|
||||
|
||||
char const*const PERSISTENCE_FILE
|
||||
= "/sys/class/graphics/fb0/msm_fb_persist_mode";
|
||||
|
||||
char const*const RED_BLINK_FILE
|
||||
= "/sys/class/leds/red/blink";
|
||||
|
||||
char const*const GREEN_BLINK_FILE
|
||||
= "/sys/class/leds/green/blink";
|
||||
|
||||
char const*const BLUE_BLINK_FILE
|
||||
= "/sys/class/leds/blue/blink";
|
||||
|
||||
char const*const RED_ON_OFF_MS_FILE
|
||||
= "/sys/class/leds/red/on_off_ms";
|
||||
|
||||
char const*const GREEN_ON_OFF_MS_FILE
|
||||
= "/sys/class/leds/green/on_off_ms";
|
||||
|
||||
char const*const BLUE_ON_OFF_MS_FILE
|
||||
= "/sys/class/leds/blue/on_off_ms";
|
||||
|
||||
char const*const RED_RGB_START_FILE
|
||||
= "/sys/class/leds/red/rgb_start";
|
||||
|
||||
char const*const GREEN_RGB_START_FILE
|
||||
= "/sys/class/leds/green/rgb_start";
|
||||
|
||||
char const*const BLUE_RGB_START_FILE
|
||||
= "/sys/class/leds/blue/rgb_start";
|
||||
|
||||
/**
|
||||
* device methods
|
||||
*/
|
||||
|
||||
void init_globals(void)
|
||||
{
|
||||
char color_id_prop[PROPERTY_VALUE_MAX] = {""};
|
||||
|
||||
// init the mutex
|
||||
pthread_mutex_init(&g_lock, NULL);
|
||||
|
||||
// check CG color
|
||||
property_get(CG_COLOR_ID_PROPERTY, color_id_prop, "DEF00");
|
||||
if (strcmp(color_id_prop, "GRA00") == 0) {
|
||||
rgb_brightness_ratio = 25;
|
||||
} else if (strcmp(color_id_prop, "SLV00") == 0) {
|
||||
rgb_brightness_ratio = 15;
|
||||
} else if (strcmp(color_id_prop, "BLU00") == 0) {
|
||||
rgb_brightness_ratio = 15;
|
||||
} else {
|
||||
rgb_brightness_ratio = 20;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
write_int(char const* path, int value)
|
||||
{
|
||||
int fd;
|
||||
static int already_warned = 0;
|
||||
|
||||
fd = open(path, O_WRONLY);
|
||||
if (fd >= 0) {
|
||||
char buffer[20];
|
||||
size_t bytes = snprintf(buffer, sizeof(buffer), "%d\n", value);
|
||||
if(bytes >= sizeof(buffer)) return -EINVAL;
|
||||
ssize_t amt = write(fd, buffer, bytes);
|
||||
close(fd);
|
||||
return amt == -1 ? -errno : 0;
|
||||
} else {
|
||||
if (already_warned == 0) {
|
||||
ALOGE("write_int failed to open %s\n", path);
|
||||
already_warned = 1;
|
||||
}
|
||||
return -errno;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
write_double_int(char const* path, int value1, int value2)
|
||||
{
|
||||
int fd;
|
||||
static int already_warned = 0;
|
||||
|
||||
fd = open(path, O_WRONLY);
|
||||
if (fd >= 0) {
|
||||
char buffer[20];
|
||||
size_t bytes = snprintf(buffer, sizeof(buffer), "%d %d\n", value1, value2);
|
||||
if(bytes >= sizeof(buffer)) return -EINVAL;
|
||||
ssize_t amt = write(fd, buffer, bytes);
|
||||
close(fd);
|
||||
return amt == -1 ? -errno : 0;
|
||||
} else {
|
||||
if (already_warned == 0) {
|
||||
ALOGE("write_int failed to open %s\n", path);
|
||||
already_warned = 1;
|
||||
}
|
||||
return -errno;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
is_lit(struct light_state_t const* state)
|
||||
{
|
||||
return state->color & 0x00ffffff;
|
||||
}
|
||||
|
||||
static int
|
||||
rgb_to_brightness(struct light_state_t const* state)
|
||||
{
|
||||
int color = state->color & 0x00ffffff;
|
||||
return ((77*((color>>16)&0x00ff))
|
||||
+ (150*((color>>8)&0x00ff)) + (29*(color&0x00ff))) >> 8;
|
||||
}
|
||||
|
||||
static int
|
||||
set_light_backlight(struct light_device_t* dev,
|
||||
struct light_state_t const* state)
|
||||
{
|
||||
int err = 0;
|
||||
int brightness = rgb_to_brightness(state);
|
||||
unsigned int lpEnabled = state->brightnessMode == BRIGHTNESS_MODE_LOW_PERSISTENCE;
|
||||
if(!dev) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&g_lock);
|
||||
|
||||
// If we're not in lp mode and it has been enabled or if we are in lp mode
|
||||
// and it has been disabled send an ioctl to the display with the update
|
||||
if ((g_last_backlight_mode != state->brightnessMode && lpEnabled) ||
|
||||
(!lpEnabled && g_last_backlight_mode == BRIGHTNESS_MODE_LOW_PERSISTENCE)) {
|
||||
if ((err = write_int(PERSISTENCE_FILE, lpEnabled)) != 0) {
|
||||
ALOGE("%s: Failed to write to %s: %s\n", __FUNCTION__, PERSISTENCE_FILE,
|
||||
strerror(errno));
|
||||
}
|
||||
if (lpEnabled != 0) {
|
||||
// Try to get the brigntess though property, otherwise it will
|
||||
// set the default brightness, which is defined in BoardConfig.mk.
|
||||
brightness = property_get_int32(LP_MODE_BRIGHTNESS_PROPERTY,
|
||||
DEFAULT_LOW_PERSISTENCE_MODE_BRIGHTNESS);
|
||||
}
|
||||
}
|
||||
|
||||
g_last_backlight_mode = state->brightnessMode;
|
||||
|
||||
if (!err) {
|
||||
err = write_int(LCD_FILE, brightness);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&g_lock);
|
||||
return err;
|
||||
}
|
||||
|
||||
static int
|
||||
set_speaker_light_locked(struct light_device_t* dev,
|
||||
struct light_state_t const* state)
|
||||
{
|
||||
int red, green, blue;
|
||||
int blink;
|
||||
int onMS, offMS;
|
||||
unsigned int colorRGB;
|
||||
|
||||
if(!dev) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch (state->flashMode) {
|
||||
case LIGHT_FLASH_TIMED:
|
||||
onMS = state->flashOnMS;
|
||||
offMS = state->flashOffMS;
|
||||
break;
|
||||
case LIGHT_FLASH_NONE:
|
||||
default:
|
||||
onMS = 0;
|
||||
offMS = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
colorRGB = state->color;
|
||||
|
||||
#if 0
|
||||
ALOGD("set_speaker_light_locked mode %d, colorRGB=%08X, onMS=%d, offMS=%d\n",
|
||||
state->flashMode, colorRGB, onMS, offMS);
|
||||
#endif
|
||||
|
||||
red = ((colorRGB >> 16) & 0xFF) * rgb_brightness_ratio / 255;
|
||||
green = ((colorRGB >> 8) & 0xFF) * rgb_brightness_ratio / 255;
|
||||
blue = (colorRGB & 0xFF) * rgb_brightness_ratio / 255;
|
||||
|
||||
write_double_int(RED_ON_OFF_MS_FILE, onMS, offMS);
|
||||
write_int(RED_LED_FILE, red);
|
||||
write_double_int(GREEN_ON_OFF_MS_FILE, onMS, offMS);
|
||||
write_int(GREEN_LED_FILE, green);
|
||||
write_double_int(BLUE_ON_OFF_MS_FILE, onMS, offMS);
|
||||
write_int(BLUE_LED_FILE, blue);
|
||||
|
||||
if(!write_int(RED_RGB_START_FILE, 1))
|
||||
if(!write_int(GREEN_RGB_START_FILE, 1))
|
||||
if(!write_int(BLUE_RGB_START_FILE, 1))
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
handle_speaker_battery_locked(struct light_device_t* dev)
|
||||
{
|
||||
if (is_lit(&g_battery)) {
|
||||
set_speaker_light_locked(dev, &g_battery);
|
||||
} else {
|
||||
set_speaker_light_locked(dev, &g_notification);
|
||||
}
|
||||
}
|
||||
|
||||
#if LIGHTS_SUPPORT_BATTERY
|
||||
static int
|
||||
set_light_battery(struct light_device_t* dev,
|
||||
struct light_state_t const* state)
|
||||
{
|
||||
pthread_mutex_lock(&g_lock);
|
||||
g_battery = *state;
|
||||
handle_speaker_battery_locked(dev);
|
||||
pthread_mutex_unlock(&g_lock);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
set_light_notifications(struct light_device_t* dev,
|
||||
struct light_state_t const* state)
|
||||
{
|
||||
pthread_mutex_lock(&g_lock);
|
||||
g_notification = *state;
|
||||
handle_speaker_battery_locked(dev);
|
||||
pthread_mutex_unlock(&g_lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
set_light_attention(struct light_device_t* dev,
|
||||
struct light_state_t const* state)
|
||||
{
|
||||
pthread_mutex_lock(&g_lock);
|
||||
if (state->flashMode == LIGHT_FLASH_HARDWARE) {
|
||||
g_attention = state->flashOnMS;
|
||||
} else if (state->flashMode == LIGHT_FLASH_NONE) {
|
||||
g_attention = 0;
|
||||
}
|
||||
handle_speaker_battery_locked(dev);
|
||||
pthread_mutex_unlock(&g_lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** Close the lights device */
|
||||
static int
|
||||
close_lights(struct light_device_t *dev)
|
||||
{
|
||||
if (dev) {
|
||||
free(dev);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
/**
|
||||
* module methods
|
||||
*/
|
||||
|
||||
/** Open a new instance of a lights device using name */
|
||||
static int open_lights(const struct hw_module_t* module, char const* name,
|
||||
struct hw_device_t** device)
|
||||
{
|
||||
int (*set_light)(struct light_device_t* dev,
|
||||
struct light_state_t const* state);
|
||||
|
||||
if (0 == strcmp(LIGHT_ID_BACKLIGHT, name))
|
||||
set_light = set_light_backlight;
|
||||
#if LIGHTS_SUPPORT_BATTERY
|
||||
else if (0 == strcmp(LIGHT_ID_BATTERY, name))
|
||||
set_light = set_light_battery;
|
||||
#endif
|
||||
else if (0 == strcmp(LIGHT_ID_NOTIFICATIONS, name))
|
||||
set_light = set_light_notifications;
|
||||
else if (0 == strcmp(LIGHT_ID_ATTENTION, name))
|
||||
set_light = set_light_attention;
|
||||
else
|
||||
return -EINVAL;
|
||||
|
||||
pthread_once(&g_init, init_globals);
|
||||
|
||||
struct light_device_t *dev = malloc(sizeof(struct light_device_t));
|
||||
|
||||
if(!dev)
|
||||
return -ENOMEM;
|
||||
|
||||
memset(dev, 0, sizeof(*dev));
|
||||
|
||||
dev->common.tag = HARDWARE_DEVICE_TAG;
|
||||
dev->common.version = LIGHTS_DEVICE_API_VERSION_2_0;
|
||||
dev->common.module = (struct hw_module_t*)module;
|
||||
dev->common.close = (int (*)(struct hw_device_t*))close_lights;
|
||||
dev->set_light = set_light;
|
||||
|
||||
*device = (struct hw_device_t*)dev;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct hw_module_methods_t lights_module_methods = {
|
||||
.open = open_lights,
|
||||
};
|
||||
|
||||
/*
|
||||
* The lights Module
|
||||
*/
|
||||
struct hw_module_t HAL_MODULE_INFO_SYM = {
|
||||
.tag = HARDWARE_MODULE_TAG,
|
||||
.version_major = 1,
|
||||
.version_minor = 0,
|
||||
.id = LIGHTS_HARDWARE_MODULE_ID,
|
||||
.name = "lights Module",
|
||||
.author = "Google, Inc.",
|
||||
.methods = &lights_module_methods,
|
||||
};
|
||||
BIN
libtango_device2.jar
Normal file
BIN
libtango_device2.jar
Normal file
Binary file not shown.
2
lisa/targetdev/__init__.py
Normal file
2
lisa/targetdev/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
print 'Welcome to wahoo LISA environment'
|
||||
83
lisa/targetdev/powerhint.py
Normal file
83
lisa/targetdev/powerhint.py
Normal file
@@ -0,0 +1,83 @@
|
||||
import xml.etree.ElementTree as ET
|
||||
import tempfile
|
||||
|
||||
DEVICE_PATH = '/vendor/etc/powerhint.xml'
|
||||
|
||||
|
||||
def restart_power_hal(target):
|
||||
"""Kill power HAL service so it can pick up new values in powerhint.xml."""
|
||||
target.execute('pkill -f android\.hardware\.power')
|
||||
|
||||
|
||||
def set_touch_param(target, opcode, new_val):
|
||||
"""Set a new value for the touch hint parameter with the specified opcode."""
|
||||
hinttype = '0x1A00'
|
||||
|
||||
# Get current powerhint.xml file
|
||||
with tempfile.NamedTemporaryFile() as tmp:
|
||||
target.pull(DEVICE_PATH, tmp.name)
|
||||
|
||||
# Replace current parameter value
|
||||
tree = ET.parse(tmp.name)
|
||||
xpath = './Hint[@type="{}"]/Resource[@opcode="{}"]'.format(hinttype, opcode)
|
||||
tree.findall(xpath)[0].set('value', '{:#x}'.format(new_val))
|
||||
|
||||
# Write new powerhint.xml file to device
|
||||
tree.write(tmp.name)
|
||||
target.push(tmp.name, DEVICE_PATH)
|
||||
|
||||
# Restart power HAL to pick up new value
|
||||
restart_power_hal(target)
|
||||
|
||||
|
||||
def set_touch_boost(target, boost=50):
|
||||
"""Change the top-app schedtune.boost value to use after touch events."""
|
||||
opcode = '0x42C18000'
|
||||
if boost < 0:
|
||||
boost = 100-boost
|
||||
set_touch_param(target, opcode, boost)
|
||||
|
||||
|
||||
def set_touch_min_freq(target, cluster, freq=1100):
|
||||
"""Change the CPU cluster min frequency (in Mhz) to use after touch events."""
|
||||
opcode = '0x40800000' if cluster == 'big' else '0x40800100'
|
||||
set_touch_param(target, opcode, freq)
|
||||
|
||||
|
||||
def set_touch_cpubw_hysteresis(target, enable=False):
|
||||
"""Set whether to leave CPUBW hysteresis enabled after touch events."""
|
||||
opcode = '0x4180C000'
|
||||
enable_num = 1 if enable else 0
|
||||
set_touch_param(target, opcode, enable_num)
|
||||
|
||||
|
||||
def set_touch_cpubw_min_freq(target, freq=51):
|
||||
"""Set CPUBW min freq used after touch events. See mapping in msm8998.dtsi."""
|
||||
opcode = '0x41800000'
|
||||
set_touch_param(target, opcode, freq)
|
||||
|
||||
|
||||
def restore_defaults(target, powerhint_host_path):
|
||||
"""Restore default power hint settings using a powerhint.xml file from the host."""
|
||||
target.push(powerhint_host_path, DEVICE_PATH)
|
||||
|
||||
restart_power_hal(target)
|
||||
|
||||
|
||||
def disable_launch_hint(target):
|
||||
"""Turn off all launch hint tweaks."""
|
||||
hinttype = '0x1B00'
|
||||
|
||||
with tempfile.NamedTemporaryFile() as tmp:
|
||||
target.pull(DEVICE_PATH, tmp.name)
|
||||
|
||||
tree = ET.parse(tmp.name)
|
||||
xpath = './Hint[@type="{}"]'.format(hinttype)
|
||||
launch_hints = tree.findall(xpath)[0]
|
||||
for child in launch_hints.findall('./Resource'):
|
||||
launch_hints.remove(child)
|
||||
|
||||
tree.write(tmp.name)
|
||||
target.push(tmp.name, DEVICE_PATH)
|
||||
|
||||
restart_power_hal(target)
|
||||
51
lowi.conf
Normal file
51
lowi.conf
Normal file
@@ -0,0 +1,51 @@
|
||||
#*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*
|
||||
#
|
||||
# LOWI Config file
|
||||
#
|
||||
# GENERAL DESCRIPTION
|
||||
# This file contains the config params for LOWI
|
||||
#
|
||||
# Copyright (c) 2012-2013 Qualcomm Atheros, Inc.
|
||||
# All Rights Reserved.
|
||||
# Qualcomm Atheros Confidential and Proprietary.
|
||||
#
|
||||
# Export of this technology or software is regulated by the U.S. Government.
|
||||
# Diversion contrary to U.S. law prohibited.
|
||||
#=============================================================================*/
|
||||
|
||||
# X86 ONLY - UBUNTU:
|
||||
# Copy this file in the same directory where the executable is
|
||||
|
||||
# The RSSI threshold used in the RTT outlier detection in half decibels. Default value recommended by the
|
||||
# system team currently is -140 (corresponding to -70 dB).
|
||||
LOWI_RSSI_THRESHOLD_FOR_RTT = -140
|
||||
|
||||
# Number of measurment per AP for RTS/CTS
|
||||
LOWI_RTS_CTS_NUM_MEAS = 5
|
||||
|
||||
# Maximum Number of Outstanding Requests supported
|
||||
LOWI_MAX_OUTSTANDING_REQUEST = 255
|
||||
|
||||
# Maximum number of records in Cache
|
||||
LOWI_MAX_NUM_CACHE_RECORDS = 200
|
||||
|
||||
# Default threshold before issuing another fresh scan (ms)
|
||||
LOWI_FRESH_SCAN_THRESHOLD = 500
|
||||
|
||||
# Timeout in case no result is reported by the driver (seconds)
|
||||
LOWI_NO_RESULT_WAIT_TOLERANCE = 10
|
||||
|
||||
# Use Fake Wifi driver. Only valid for engineering builds
|
||||
LOWI_USE_FAKE_WIFI_DRIVER = 0
|
||||
|
||||
# Use ROME Wifi driver. Only valid for engineering builds
|
||||
# Will be removed later only for development support
|
||||
LOWI_USE_ROME_WIFI_DRIVER = 0
|
||||
|
||||
# Use LOWI LP.
|
||||
# When enabled the Discovery Request will be routed to LOWI-LP
|
||||
LOWI_USE_LOWI_LP = 1
|
||||
|
||||
# Log level
|
||||
# EL_LOG_OFF = 0, EL_ERROR = 1, EL_WARNING = 2, EL_INFO = 3, EL_DEBUG = 4, EL_VERBOSE = 5, EL_LOG_ALL = 100
|
||||
LOWI_LOG_LEVEL = 2
|
||||
424
manifest.xml
Normal file
424
manifest.xml
Normal file
@@ -0,0 +1,424 @@
|
||||
<manifest version="1.0" type="device">
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.audio</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>IDevicesFactory</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.audio.effect</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>IEffectsFactory</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.biometrics.fingerprint</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.1</version>
|
||||
<interface>
|
||||
<name>IBiometricsFingerprint</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.bluetooth</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IBluetoothHci</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.boot</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IBootControl</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.camera.provider</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.4</version>
|
||||
<interface>
|
||||
<name>ICameraProvider</name>
|
||||
<instance>legacy/0</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.configstore</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.1</version>
|
||||
<interface>
|
||||
<name>ISurfaceFlingerConfigs</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.contexthub</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IContexthub</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.drm</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ICryptoFactory</name>
|
||||
<instance>default</instance>
|
||||
<instance>widevine</instance>
|
||||
</interface>
|
||||
<interface>
|
||||
<name>IDrmFactory</name>
|
||||
<instance>default</instance>
|
||||
<instance>widevine</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.dumpstate</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IDumpstateDevice</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.gatekeeper</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IGatekeeper</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.gnss</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IGnss</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.graphics.allocator</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>IAllocator</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.graphics.composer</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.1</version>
|
||||
<interface>
|
||||
<name>IComposer</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.graphics.mapper</name>
|
||||
<transport arch="32+64">passthrough</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>IMapper</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.keymaster</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>3.0</version>
|
||||
<interface>
|
||||
<name>IKeymasterDevice</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.light</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>ILight</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.media.omx</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IOmx</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<interface>
|
||||
<name>IOmxStore</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.memtrack</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IMemtrack</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.nfc</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>INfc</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.oemlock</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IOemLock</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.power</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.1</version>
|
||||
<interface>
|
||||
<name>IPower</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.radio.deprecated</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IOemHook</name>
|
||||
<instance>slot1</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.radio</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.1</version>
|
||||
<interface>
|
||||
<name>IRadio</name>
|
||||
<instance>slot1</instance>
|
||||
</interface>
|
||||
<interface>
|
||||
<name>ISap</name>
|
||||
<instance>slot1</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.renderscript</name>
|
||||
<transport arch="32+64">passthrough</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IDevice</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.sensors</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ISensors</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.soundtrigger</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>ISoundTriggerHw</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.tetheroffload.config</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IOffloadConfig</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.tetheroffload.control</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IOffloadControl</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.thermal</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IThermal</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.usb</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.1</version>
|
||||
<interface>
|
||||
<name>IUsb</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.vibrator</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.1</version>
|
||||
<interface>
|
||||
<name>IVibrator</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.vr</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IVr</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.weaver</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IWeaver</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.wifi</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.1</version>
|
||||
<interface>
|
||||
<name>IWifi</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.wifi.supplicant</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ISupplicant</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.wifi.offload</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IOffload</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>com.qualcomm.qti.ims.radio</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IImsRadio</name>
|
||||
<instance>imsradio0</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>com.qualcomm.qti.qcril.qcrilhook</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IQtiOemHook</name>
|
||||
<instance>oemhook0</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>com.qualcomm.qti.imsrtpservice</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IRTPService</name>
|
||||
<instance>imsrtpservice</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>com.qualcomm.qti.uceservice</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IUceService</name>
|
||||
<instance>com.qualcomm.qti.uceservice</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.qcril.am</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IQcRilAudio</name>
|
||||
<instance>slot1</instance>
|
||||
<instance>slot2</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>com.quicinc.cne.server</name>
|
||||
<transport>hwbinder</transport>
|
||||
<impl level="generic"></impl>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IServer</name>
|
||||
<instance>cnd</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>com.quicinc.cne.api</name>
|
||||
<transport>hwbinder</transport>
|
||||
<impl level="generic"></impl>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IApiService</name>
|
||||
<instance>cnd</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.atcmdfwd</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IAtCmdFwd</name>
|
||||
<instance>AtCmdFwdService</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
</manifest>
|
||||
294
media_codecs.xml
Normal file
294
media_codecs.xml
Normal file
@@ -0,0 +1,294 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- Copyright 2016 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!--
|
||||
<!DOCTYPE MediaCodecs [
|
||||
<!ELEMENT Include EMPTY>
|
||||
<!ATTLIST Include href CDATA #REQUIRED>
|
||||
<!ELEMENT MediaCodecs (Decoders|Encoders|Include)*>
|
||||
<!ELEMENT Decoders (MediaCodec|Include)*>
|
||||
<!ELEMENT Encoders (MediaCodec|Include)*>
|
||||
<!ELEMENT MediaCodec (Type|Quirk|Include)*>
|
||||
<!ATTLIST MediaCodec name CDATA #REQUIRED>
|
||||
<!ATTLIST MediaCodec type CDATA>
|
||||
<!ELEMENT Type EMPTY>
|
||||
<!ATTLIST Type name CDATA #REQUIRED>
|
||||
<!ELEMENT Quirk EMPTY>
|
||||
<!ATTLIST Quirk name CDATA #REQUIRED>
|
||||
]>
|
||||
|
||||
There's a simple and a complex syntax to declare the availability of a
|
||||
media codec:
|
||||
|
||||
A codec that properly follows the OpenMax spec and therefore doesn't have any
|
||||
quirks and that only supports a single content type can be declared like so:
|
||||
|
||||
<MediaCodec name="OMX.foo.bar" type="something/interesting" />
|
||||
|
||||
If a codec has quirks OR supports multiple content types, the following syntax
|
||||
can be used:
|
||||
|
||||
<MediaCodec name="OMX.foo.bar" >
|
||||
<Type name="something/interesting" />
|
||||
<Type name="something/else" />
|
||||
...
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Quirk name="output-buffers-are-unreadable" />
|
||||
</MediaCodec>
|
||||
|
||||
Only the three quirks included above are recognized at this point:
|
||||
|
||||
"requires-allocate-on-input-ports"
|
||||
must be advertised if the component does not properly support specification
|
||||
of input buffers using the OMX_UseBuffer(...) API but instead requires
|
||||
OMX_AllocateBuffer to be used.
|
||||
|
||||
"requires-allocate-on-output-ports"
|
||||
must be advertised if the component does not properly support specification
|
||||
of output buffers using the OMX_UseBuffer(...) API but instead requires
|
||||
OMX_AllocateBuffer to be used.
|
||||
|
||||
"output-buffers-are-unreadable"
|
||||
must be advertised if the emitted output buffers of a decoder component
|
||||
are not readable, i.e. use a custom format even though abusing one of
|
||||
the official OMX colorspace constants.
|
||||
Clients of such decoders will not be able to access the decoded data,
|
||||
naturally making the component much less useful. The only use for
|
||||
a component with this quirk is to render the output to the screen.
|
||||
Audio decoders MUST NOT advertise this quirk.
|
||||
Video decoders that advertise this quirk must be accompanied by a
|
||||
corresponding color space converter for thumbnail extraction,
|
||||
matching surfaceflinger support that can render the custom format to
|
||||
a texture and possibly other code, so just DON'T USE THIS QUIRK.
|
||||
|
||||
|
||||
-->
|
||||
|
||||
<!--
|
||||
8996 Decoder capabilities
|
||||
__________________________________________________________________
|
||||
| Codec | W H fps Mbps MB/s | Secure-dec |
|
||||
|__________|_________________________________________|____________|
|
||||
| h264 | 3840 2160 60 100 1958400 | Y |
|
||||
| | (4096) (2160) (56) (100) | |
|
||||
| hevc | 3840 2160 60 100 1958400 | Y |
|
||||
| | (4096) (2160) (56) (100) | |
|
||||
| mpeg4 | 1920 1088 60 60 489600 | N |
|
||||
| vp8 | 3840 2160 30 20 979200 | N |
|
||||
| vp9 | 3840 2160 30 20 979200 | Y |
|
||||
| h263 | 864 480 30 2 48600 | N |
|
||||
|__________|_________________________________________|____________|
|
||||
|
||||
|
||||
8996 Encoder capabilities
|
||||
______________________________________________________
|
||||
| Codec | W H fps Mbps MB/s |
|
||||
|__________|_________________________________________|
|
||||
| h264 | 3840 2160 30 100 979200 |
|
||||
| hevc | 3840 2160 30 100 979200 |
|
||||
| mpeg4 | 1920 1088 60 60 489600 |
|
||||
| vp8 | 3840 2160 30 20 979200 |
|
||||
| h263 | 864 480 30 2 48600 |
|
||||
|__________|_________________________________________|
|
||||
-->
|
||||
|
||||
<MediaCodecs>
|
||||
<Include href="media_codecs_google_audio.xml" />
|
||||
<Include href="media_codecs_google_telephony.xml" />
|
||||
<Settings>
|
||||
<Setting name="max-video-encoder-input-buffers" value="11" />
|
||||
</Settings>
|
||||
<Encoders>
|
||||
<!-- Audio Hardware -->
|
||||
<!-- Audio Software -->
|
||||
<!-- Video Hardware -->
|
||||
<MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Quirk name="requires-loaded-to-idle-after-allocation" />
|
||||
<Limit name="size" min="96x64" max="4096x2160" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="979200" />
|
||||
<Limit name="bitrate" range="1-100000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.encoder.mpeg4" type="video/mp4v-es" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Quirk name="requires-loaded-to-idle-after-allocation"/>
|
||||
<Limit name="size" min="96x64" max="1920x1088" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="489600" />
|
||||
<Limit name="bitrate" range="1-60000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.encoder.h263" type="video/3gpp" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Quirk name="requires-loaded-to-idle-after-allocation" />
|
||||
<Limit name="size" min="96x64" max="864x480" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="48600" />
|
||||
<Limit name="bitrate" range="1-2000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Quirk name="requires-loaded-to-idle-after-allocation" />
|
||||
<Limit name="size" min="96x64" max="3840x2160" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="979200" />
|
||||
<Limit name="bitrate" range="1-20000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Quirk name="requires-loaded-to-idle-after-allocation" />
|
||||
<Limit name="size" min="162x64" max="4096x2160" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="979200" />
|
||||
<Limit name="bitrate" range="1-100000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
</MediaCodec>
|
||||
</Encoders>
|
||||
<Decoders>
|
||||
<!-- Video Hardware -->
|
||||
<MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Limit name="size" min="64x64" max="4096x2160" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="1958400" />
|
||||
<Limit name="bitrate" range="1-100000000" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Limit name="size" min="64x64" max="4096x2160" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="1958400" />
|
||||
<Limit name="bitrate" range="1-100000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Feature name="secure-playback" required="true" />
|
||||
<Limit name="concurrent-instances" max="6" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.mpeg4" type="video/mp4v-es" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports"/>
|
||||
<Limit name="size" min="64x64" max="1920x1088" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="489600" />
|
||||
<Limit name="bitrate" range="1-60000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.h263" type="video/3gpp" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Limit name="size" min="64x64" max="864x480" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="489600" />
|
||||
<Limit name="bitrate" range="1-2000000" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Limit name="size" min="64x64" max="3840x2160" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="979200" />
|
||||
<Limit name="bitrate" range="1-20000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Limit name="size" min="64x64" max="3840x2160" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="979200" />
|
||||
<Limit name="bitrate" range="1-20000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.vp9.secure" type="video/x-vnd.on2.vp9" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Limit name="size" min="64x64" max="3840x2160" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="979200" />
|
||||
<Limit name="bitrate" range="1-20000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Feature name="secure-playback" required="true" />
|
||||
<Limit name="concurrent-instances" max="6" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Limit name="size" min="64x64" max="4096x2160" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="1958400" />
|
||||
<Limit name="bitrate" range="1-100000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.hevc.secure" type="video/hevc" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Limit name="size" min="64x64" max="4096x2160" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="1958400" />
|
||||
<Limit name="bitrate" range="1-100000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Feature name="secure-playback" required="true" />
|
||||
<Limit name="concurrent-instances" max="6" />
|
||||
</MediaCodec>
|
||||
<!-- Audio Software -->
|
||||
</Decoders>
|
||||
<Include href="media_codecs_google_video.xml" />
|
||||
</MediaCodecs>
|
||||
196
media_codecs_performance.xml
Normal file
196
media_codecs_performance.xml
Normal file
@@ -0,0 +1,196 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- Copyright 2017 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.
|
||||
-->
|
||||
|
||||
<!-- Generated file for wahoo using measurements between OPD1.170523.002 and OPD1.170724.002 -->
|
||||
<MediaCodecs>
|
||||
<Encoders>
|
||||
<MediaCodec name="OMX.qcom.video.encoder.h263" type="video/3gpp" update="true">
|
||||
<Limit name="measured-frame-rate-176x144" range="402-402" /> <!-- N=524 v98%=1.6 -->
|
||||
<!-- measured 96%:261-505 med:397/398 FLAKY(mn=98.0 < 199 - 796) -->
|
||||
<Limit name="measured-frame-rate-352x288" range="398-398" /> <!-- N=528 v96%=1.4 -->
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" update="true">
|
||||
<!-- measured 96%:276-523 med:421/420 FLAKY(mn=111.0 < 210 - 840) -->
|
||||
<Limit name="measured-frame-rate-320x240" range="420-420" /> <!-- N=530 v96%=1.4 -->
|
||||
<!-- measured 96%:113-195 med:166/165 FLAKY(mn=37.0 < 83 - 330) -->
|
||||
<Limit name="measured-frame-rate-720x480" range="165-165" /> <!-- N=500 v96%=1.3 -->
|
||||
<!-- measured 96%:74-92 med:88/89 FLAKY(mn=29.6 < 45 - 178) -->
|
||||
<Limit name="measured-frame-rate-1280x720" range="89-89" /> <!-- N=528 v96%=1.1 -->
|
||||
<Limit name="measured-frame-rate-1920x1080" range="32-32" /> <!-- N=206 v98%=1.6 -->
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" update="true">
|
||||
<!-- measured 97%:249-536 med:433/434 FLAKY(mn=111.8 < 217 - 868) -->
|
||||
<Limit name="measured-frame-rate-320x240" range="434-434" /> <!-- N=526 v97%=1.5 -->
|
||||
<!-- measured 96%:101-199 med:176/176 FLAKY(mn=35.7 < 88 - 352) -->
|
||||
<Limit name="measured-frame-rate-720x480" range="176-176" /> <!-- N=498 v96%=1.4 -->
|
||||
<!-- measured 96%:94-132 med:125/125 FLAKY(mn=27.3 < 63 - 250) -->
|
||||
<Limit name="measured-frame-rate-1280x720" range="125-125" /> <!-- N=530 v96%=1.2 -->
|
||||
<!-- measured 93%:31-62 med:53/53 FLAKY(mn=16.3 < 27 - 106) -->
|
||||
<Limit name="measured-frame-rate-1920x1080" range="53-53" /> <!-- N=256 v93%=1.4 -->
|
||||
<!-- measured 90%:6-25 med:18/19 FLAKY(mn=3.8 < 6 - 40) -->
|
||||
<Limit name="measured-frame-rate-3840x2160" range="12-20" /> <!-- N=214 v90%=2.0 -->
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.encoder.mpeg4" type="video/mp4v-es" update="true">
|
||||
<Limit name="measured-frame-rate-176x144" range="397-397" /> <!-- N=526 v98%=1.5 -->
|
||||
<!-- measured 96%:250-459 med:375/377 FLAKY(mn=112.6 < 189 - 754) -->
|
||||
<Limit name="measured-frame-rate-352x288" range="377-377" /> <!-- N=528 v96%=1.4 -->
|
||||
<!-- measured 98%:73-258 med:219/215 FLAKY(mn=69.7 < 73 - 430) -->
|
||||
<Limit name="measured-frame-rate-640x480" range="145-215" /> <!-- N=450 v98%=1.9 -->
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" update="true">
|
||||
<!-- measured 98%:159-498 med:340/340 FLAKY(mn=124.8 < 159 - 680) -->
|
||||
<Limit name="measured-frame-rate-320x180" range="318-340" /> <!-- N=528 v98%=1.8 -->
|
||||
<!-- measured 96%:194-319 med:275/278 FLAKY(mn=83.4 < 139 - 556) -->
|
||||
<Limit name="measured-frame-rate-640x360" range="278-278" /> <!-- N=530 v96%=1.3 -->
|
||||
<!-- measured 97%:62-92 med:87/87 FLAKY(mn=30.4 < 44 - 174) -->
|
||||
<Limit name="measured-frame-rate-1280x720" range="87-87" /> <!-- N=530 v97%=1.2 -->
|
||||
<!-- measured 98%:17-47 med:33/33 FLAKY(mn=15.4 < 17 - 66) -->
|
||||
<Limit name="measured-frame-rate-1920x1080" range="33-33" /> <!-- N=206 v98%=1.7 -->
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.google.h263.encoder" type="video/3gpp" update="true">
|
||||
<!-- measured 98%:104-832 med:361/361 FLAKY(mn=90.6 < 104 - 832 < mx=981.7) RG.VARIANCE:2.0 -->
|
||||
<Limit name="measured-frame-rate-176x144" range="207-416" /> <!-- N=424 v98%=2.8 -->
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.google.h264.encoder" type="video/avc" update="true">
|
||||
<!-- measured 98%:84-343 med:245/231 FLAKY(mn=80.7 < 84 - 476) variance:2.0 -->
|
||||
<Limit name="measured-frame-rate-320x240" range="168-238" /> <!-- N=216 -->
|
||||
<!-- measured 98%:22-119 med:105/105 FLAKY(mn=20.0 < 24 - 210) variance:2.3 -->
|
||||
<Limit name="measured-frame-rate-720x480" range="48-105" /> <!-- N=214 -->
|
||||
<!-- measured 98%:11-73 med:61/61 FLAKY(mn=10.6 < 14 - 122) variance:2.6 -->
|
||||
<Limit name="measured-frame-rate-1280x720" range="28-61" /> <!-- N=214 -->
|
||||
<!-- measured 98%:6-38 med:29/29 FLAKY(mn=5.9 < 7 - 58) variance:2.5 -->
|
||||
<Limit name="measured-frame-rate-1920x1080" range="14-29" /> <!-- N=216 -->
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.google.mpeg4.encoder" type="video/mp4v-es" update="true">
|
||||
<!-- measured 97%:109-879 med:375/372 FLAKY(mn=91.9 < 109 - 880 < mx=1052.6) RG.VARIANCE:2.0 -->
|
||||
<Limit name="measured-frame-rate-176x144" range="217-440" /> <!-- N=436 v97%=2.8 -->
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.google.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
|
||||
<!-- measured 98%:25-145 med:65/65 FLAKY(mn=24.4 < 25 - 146 < mx=146.7) variance:2.4 -->
|
||||
<Limit name="measured-frame-rate-320x180" range="49-73" /> <!-- N=216 -->
|
||||
<!-- measured 98%:13-64 med:41/41 variance:2.2 -->
|
||||
<Limit name="measured-frame-rate-640x360" range="26-41" /> <!-- N=214 -->
|
||||
<!-- measured 98%:6-38 med:36/36 FLAKY(mn=5.7 < 9 - 72) variance:2.5 -->
|
||||
<Limit name="measured-frame-rate-1280x720" range="17-36" /> <!-- N=216 -->
|
||||
<!-- measured 98%:3-25 med:22/22 FLAKY(mn=3.5 < 5 - 44) variance:2.7 -->
|
||||
<Limit name="measured-frame-rate-1920x1080" range="10-22" /> <!-- N=216 -->
|
||||
</MediaCodec>
|
||||
</Encoders>
|
||||
<Decoders>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.h263" type="video/3gpp" update="true">
|
||||
<!-- measured 98%:153-856 med:652/649 FLAKY(mn=0.5 < 153 - 1298) variance:2.4 -->
|
||||
<Limit name="measured-frame-rate-176x144" range="306-649" /> <!-- N=284 -->
|
||||
<!-- measured 98%:271-837 med:582/585 FLAKY(mn=141.4 < 271 - 1170) -->
|
||||
<Limit name="measured-frame-rate-352x288" range="541-585" /> <!-- N=286 v98%=1.8 -->
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" update="true">
|
||||
<!-- measured 98%:111-586 med:341/341 FLAKY(mn=83.0 < 111 - 682) variance:2.3 -->
|
||||
<Limit name="measured-frame-rate-320x240" range="222-341" /> <!-- N=126 -->
|
||||
<!-- measured 98%:102-448 med:306/306 variance:2.1 -->
|
||||
<Limit name="measured-frame-rate-720x480" range="203-306" /> <!-- N=138 -->
|
||||
<!-- measured 98%:96-346 med:252/253 FLAKY(mn=33.1 < 96 - 506) -->
|
||||
<Limit name="measured-frame-rate-1280x720" range="192-253" /> <!-- N=134 v98%=1.9 -->
|
||||
<Limit name="measured-frame-rate-1920x1080" range="153-153" /> <!-- N=122 v98%=1.5 -->
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" update="true">
|
||||
<!-- measured 98%:101-589 med:338/337 FLAKY(mn=90.5 < 101 - 674) variance:2.4 -->
|
||||
<Limit name="measured-frame-rate-352x288" range="202-337" /> <!-- N=136 -->
|
||||
<!-- measured 98%:106-526 med:327/326 FLAKY(mn=95.5 < 106 - 652) variance:2.2 -->
|
||||
<Limit name="measured-frame-rate-640x360" range="211-326" /> <!-- N=134 -->
|
||||
<!-- measured 98%:109-463 med:316/316 FLAKY(mn=68.4 < 109 - 632) variance:2.1 -->
|
||||
<Limit name="measured-frame-rate-720x480" range="217-316" /> <!-- N=144 -->
|
||||
<!-- measured 98%:115-394 med:270/270 FLAKY(mn=100.2 < 115 - 540) -->
|
||||
<Limit name="measured-frame-rate-1280x720" range="229-270" /> <!-- N=276 v98%=1.9 -->
|
||||
<!-- measured 98%:101-270 med:259/259 FLAKY(mn=99.8 < 101 - 518) -->
|
||||
<Limit name="measured-frame-rate-1920x1080" range="202-259" /> <!-- N=126 v98%=1.6 -->
|
||||
<!-- measured 98%:33-71 med:71/71 FLAKY(mn=31.3 < 33 - 142) -->
|
||||
<Limit name="measured-frame-rate-3840x2160" range="66-71" /> <!-- N=122 v98%=1.5 -->
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.mpeg4" type="video/mp4v-es" update="true">
|
||||
<!-- measured 98%:246-913 med:573/571 FLAKY(mn=145.5 < 246 - 1142) -->
|
||||
<Limit name="measured-frame-rate-176x144" range="491-571" /> <!-- N=288 v98%=1.9 -->
|
||||
<!-- measured 97%:181-504 med:313/313 FLAKY(mn=105.3 < 157 - 626) -->
|
||||
<Limit name="measured-frame-rate-480x360" range="313-313" /> <!-- N=184 v97%=1.7 -->
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" update="true">
|
||||
<!-- measured 98%:109-802 med:417/416 variance:2.7 -->
|
||||
<Limit name="measured-frame-rate-320x180" range="217-416" /> <!-- N=140 -->
|
||||
<!-- measured 98%:108-700 med:423/424 FLAKY(mn=107.2 < 108 - 848) variance:2.5 -->
|
||||
<Limit name="measured-frame-rate-640x360" range="215-424" /> <!-- N=142 -->
|
||||
<!-- measured 98%:105-457 med:313/313 FLAKY(mn=37.4 < 105 - 626) variance:2.1 -->
|
||||
<Limit name="measured-frame-rate-1280x720" range="210-313" /> <!-- N=130 -->
|
||||
<Limit name="measured-frame-rate-1920x1080" range="146-151" /> <!-- N=126 v98%=1.5 -->
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" update="true">
|
||||
<!-- measured 96%:79-635 med:115/205 FLAKY(mn=55.3 < 71 - 620 < mx=647.7) RG.VARIANCE:2.0 -->
|
||||
<Limit name="measured-frame-rate-320x180" range="141-310" /> <!-- N=204 v96%=2.8 -->
|
||||
<!-- measured 95%:69-508 med:351/351 FLAKY(mn=54.5 < 80 - 702) variance:2.7 -->
|
||||
<Limit name="measured-frame-rate-640x360" range="160-351" /> <!-- N=150 -->
|
||||
<!-- measured 93%:82-408 med:114/162 FLAKY(mn=47.6 < 69 - 454) variance:2.2 -->
|
||||
<Limit name="measured-frame-rate-1280x720" range="138-227" /> <!-- N=202 -->
|
||||
<!-- measured 93%:72-245 med:109/123 FLAKY(mn=0.5 < 62 - 298) -->
|
||||
<Limit name="measured-frame-rate-1920x1080" range="123-149" /> <!-- N=200 v93%=1.8 -->
|
||||
<Limit name="measured-frame-rate-3840x2160" range="45-48" /> <!-- N=122 v98%=1.3 -->
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.google.h263.decoder" type="video/3gpp" update="true">
|
||||
<!-- measured 95%:141-1135 med:164/169 FLAKY(85 - 742 < mx=1244.4) RG.VARIANCE:2.0 -->
|
||||
<Limit name="measured-frame-rate-176x144" range="169-371" /> <!-- N=138 v95%=2.8 -->
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.google.h264.decoder" type="video/avc" update="true">
|
||||
<!-- measured 98%:96-619 med:166/166 FLAKY(83 - 620 < mx=634.1) variance:2.5 -->
|
||||
<Limit name="measured-frame-rate-320x240" range="166-310" /> <!-- N=122 -->
|
||||
<!-- measured 98%:44-185 med:59/59 variance:2.0 -->
|
||||
<Limit name="measured-frame-rate-720x480" range="59-93" /> <!-- N=124 -->
|
||||
<!-- measured 98%:15-68 med:29/28 FLAKY(14 - 68 < mx=68.4) variance:2.1 -->
|
||||
<Limit name="measured-frame-rate-1280x720" range="28-34" /> <!-- N=144 -->
|
||||
<Limit name="measured-frame-rate-1920x1080" range="12-16" /> <!-- N=142 v98%=2.0 -->
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.google.hevc.decoder" type="video/hevc" update="true">
|
||||
<!-- measured 98%:141-766 med:624/626 FLAKY(mn=128.0 < 143 - 1252) variance:2.3 -->
|
||||
<Limit name="measured-frame-rate-352x288" range="285-626" /> <!-- N=131 -->
|
||||
<!-- measured 98%:62-353 med:243/243 FLAKY(mn=0.3 < 56 - 486) variance:2.4 -->
|
||||
<Limit name="measured-frame-rate-640x360" range="111-243" /> <!-- N=150 -->
|
||||
<!-- measured 98%:56-306 med:211/209 variance:2.3 -->
|
||||
<Limit name="measured-frame-rate-720x480" range="95-209" /> <!-- N=144 -->
|
||||
<!-- measured 90%:20-112 med:89/88 FLAKY(mn=0.4 < 20 - 176) variance:2.4 -->
|
||||
<Limit name="measured-frame-rate-1280x720" range="40-88" /> <!-- N=154 -->
|
||||
<!-- measured 98%:1-65 med:51/51 FLAKY(mn=0.4 < 12 - 102) RG.VARIANCE:4.5 -->
|
||||
<Limit name="measured-frame-rate-1920x1080" range="24-51" /> <!-- N=152 v98%=9.6 -->
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.google.mpeg4.decoder" type="video/mp4v-es" update="true">
|
||||
<!-- measured 98%:165-1003 med:195/200 FLAKY(100 - 880 < mx=1438.8) variance:2.5 -->
|
||||
<Limit name="measured-frame-rate-176x144" range="200-440" /> <!-- N=140 -->
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.google.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
|
||||
<!-- measured 90%:332-1316 med:577/573 FLAKY(mn=146.5 < 287 - 1474) -->
|
||||
<Limit name="measured-frame-rate-320x180" range="573-737" /> <!-- N=132 v90%=2.0 -->
|
||||
<Limit name="measured-frame-rate-640x360" range="238-409" /> <!-- N=126 v98%=1.8 -->
|
||||
<!-- measured 98%:32-95 med:94/94 FLAKY(mn=31.4 < 32 - 188) -->
|
||||
<Limit name="measured-frame-rate-1280x720" range="64-94" /> <!-- N=122 v98%=1.7 -->
|
||||
<Limit name="measured-frame-rate-1920x1080" range="22-37" /> <!-- N=132 v98%=1.6 -->
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.google.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
|
||||
<!-- measured 98%:232-1000 med:668/653 FLAKY(mn=144.8 < 224 - 1330) variance:2.1 -->
|
||||
<Limit name="measured-frame-rate-320x180" range="448-665" /> <!-- N=122 -->
|
||||
<!-- measured 98%:78-425 med:395/395 FLAKY(mn=74.4 < 90 - 790) variance:2.3 -->
|
||||
<Limit name="measured-frame-rate-640x360" range="180-395" /> <!-- N=254 -->
|
||||
<!-- measured 98%:22-120 med:112/111 FLAKY(mn=22.3 < 26 - 222) variance:2.3 -->
|
||||
<Limit name="measured-frame-rate-1280x720" range="51-111" /> <!-- N=136 -->
|
||||
<!-- measured 98%:14-71 med:67/67 FLAKY(mn=13.9 < 16 - 134) variance:2.2 -->
|
||||
<Limit name="measured-frame-rate-1920x1080" range="31-67" /> <!-- N=132 -->
|
||||
</MediaCodec>
|
||||
</Decoders>
|
||||
</MediaCodecs>
|
||||
497
media_profiles_V1_0.xml
Normal file
497
media_profiles_V1_0.xml
Normal file
@@ -0,0 +1,497 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2016 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<!DOCTYPE MediaSettings SYSTEM "/system/etc/media_profiles_V1_0.dtd">
|
||||
<!--
|
||||
This file is used to declare the multimedia profiles and capabilities
|
||||
on an android-powered device.
|
||||
-->
|
||||
<MediaSettings>
|
||||
<!-- Each camcorder profile defines a set of predefined configuration parameters -->
|
||||
<CamcorderProfiles cameraId="0">
|
||||
|
||||
<EncoderProfile quality="low" fileFormat="3gp" duration="60">
|
||||
<Video codec="h264"
|
||||
bitRate="128000"
|
||||
width="176"
|
||||
height="144"
|
||||
frameRate="30" />
|
||||
|
||||
<Audio codec="amrnb"
|
||||
bitRate="12200"
|
||||
sampleRate="8000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="high" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="42000000"
|
||||
width="3840"
|
||||
height="2160"
|
||||
frameRate="30" />
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="qcif" fileFormat="3gp" duration="60">
|
||||
<Video codec="h264"
|
||||
bitRate="128000"
|
||||
width="176"
|
||||
height="144"
|
||||
frameRate="30" />
|
||||
<Audio codec="amrnb"
|
||||
bitRate="12200"
|
||||
sampleRate="8000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="qvga" fileFormat="mp4" duration="60">
|
||||
<Video codec="h264"
|
||||
bitRate="512000"
|
||||
width="320"
|
||||
height="240"
|
||||
frameRate="30" />
|
||||
<Audio codec="aac"
|
||||
bitRate="156000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="cif" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="1200000"
|
||||
width="352"
|
||||
height="288"
|
||||
frameRate="30" />
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="480p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="6000000"
|
||||
width="720"
|
||||
height="480"
|
||||
frameRate="30" />
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="720p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="18000000"
|
||||
width="1280"
|
||||
height="720"
|
||||
frameRate="60" />
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="1080p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="33000000"
|
||||
width="1920"
|
||||
height="1080"
|
||||
frameRate="60" />
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="2160p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="42000000"
|
||||
width="3840"
|
||||
height="2160"
|
||||
frameRate="30" />
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapseqcif" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="192000"
|
||||
width="176"
|
||||
height="144"
|
||||
frameRate="30" />
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="amrnb"
|
||||
bitRate="12200"
|
||||
sampleRate="8000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapsecif" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="1200000"
|
||||
width="352"
|
||||
height="288"
|
||||
frameRate="30" />
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="6000000"
|
||||
width="720"
|
||||
height="480"
|
||||
frameRate="30" />
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="12000000"
|
||||
width="1280"
|
||||
height="720"
|
||||
frameRate="30" />
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapse1080p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="17000000"
|
||||
width="1920"
|
||||
height="1080"
|
||||
frameRate="30" />
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapse2160p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="42000000"
|
||||
width="3840"
|
||||
height="2160"
|
||||
frameRate="30" />
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<!-- CAMCORDER_QUALITY_HIGH_SPEED_LOW/720P : 720p@240fps; 42.0 Mbps -->
|
||||
<EncoderProfile quality="highspeedlow" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="42000000"
|
||||
width="1280"
|
||||
height="720"
|
||||
frameRate="240" />
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<!-- CAMCORDER_QUALITY_HIGH_SPEED_HIGH/1080P : 1080p@120fps; 42.0 Mbps -->
|
||||
<EncoderProfile quality="highspeedhigh" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="42000000"
|
||||
width="1920"
|
||||
height="1080"
|
||||
frameRate="120" />
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="highspeed720p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="42000000"
|
||||
width="1280"
|
||||
height="720"
|
||||
frameRate="240" />
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="highspeed1080p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="42000000"
|
||||
width="1920"
|
||||
height="1080"
|
||||
frameRate="120" />
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<ImageEncoding quality="95" />
|
||||
<ImageEncoding quality="80" />
|
||||
<ImageEncoding quality="70" />
|
||||
<ImageDecoding memCap="20000000" />
|
||||
|
||||
</CamcorderProfiles>
|
||||
|
||||
<CamcorderProfiles cameraId="1">
|
||||
|
||||
<EncoderProfile quality="low" fileFormat="3gp" duration="60">
|
||||
<Video codec="h264"
|
||||
bitRate="128000"
|
||||
width="176"
|
||||
height="144"
|
||||
frameRate="30" />
|
||||
|
||||
<Audio codec="amrnb"
|
||||
bitRate="12200"
|
||||
sampleRate="8000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="high" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="17000000"
|
||||
width="1920"
|
||||
height="1080"
|
||||
frameRate="30" />
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="qcif" fileFormat="3gp" duration="60">
|
||||
<Video codec="h264"
|
||||
bitRate="128000"
|
||||
width="176"
|
||||
height="144"
|
||||
frameRate="30" />
|
||||
<Audio codec="amrnb"
|
||||
bitRate="12200"
|
||||
sampleRate="8000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="qvga" fileFormat="mp4" duration="60">
|
||||
<Video codec="h264"
|
||||
bitRate="512000"
|
||||
width="320"
|
||||
height="240"
|
||||
frameRate="30" />
|
||||
<Audio codec="aac"
|
||||
bitRate="156000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="cif" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="1200000"
|
||||
width="352"
|
||||
height="288"
|
||||
frameRate="30" />
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="480p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="6000000"
|
||||
width="720"
|
||||
height="480"
|
||||
frameRate="30" />
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="720p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="12000000"
|
||||
width="1280"
|
||||
height="720"
|
||||
frameRate="30" />
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="1080p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="17000000"
|
||||
width="1920"
|
||||
height="1080"
|
||||
frameRate="30" />
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapseqcif" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="192000"
|
||||
width="176"
|
||||
height="144"
|
||||
frameRate="30" />
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="amrnb"
|
||||
bitRate="12200"
|
||||
sampleRate="8000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapsecif" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="1200000"
|
||||
width="352"
|
||||
height="288"
|
||||
frameRate="30" />
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="6000000"
|
||||
width="720"
|
||||
height="480"
|
||||
frameRate="30" />
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="12000000"
|
||||
width="1280"
|
||||
height="720"
|
||||
frameRate="30" />
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<ImageEncoding quality="95" />
|
||||
<ImageEncoding quality="80" />
|
||||
<ImageEncoding quality="70" />
|
||||
<ImageDecoding memCap="20000000" />
|
||||
|
||||
</CamcorderProfiles>
|
||||
|
||||
<EncoderOutputFileFormat name="3gp" />
|
||||
<EncoderOutputFileFormat name="mp4" />
|
||||
|
||||
<!--
|
||||
If a codec is not enabled, it is invisible to the applications
|
||||
In other words, the applications won't be able to use the codec
|
||||
or query the capabilities of the codec at all if it is disabled
|
||||
-->
|
||||
<VideoEncoderCap name="hevc" enabled="true"
|
||||
minBitRate="64000" maxBitRate="100000000"
|
||||
minFrameWidth="176" maxFrameWidth="3840"
|
||||
minFrameHeight="144" maxFrameHeight="2160"
|
||||
minFrameRate="15" maxFrameRate="30" />
|
||||
|
||||
<VideoEncoderCap name="h264" enabled="true"
|
||||
minBitRate="64000" maxBitRate="100000000"
|
||||
minFrameWidth="176" maxFrameWidth="3840"
|
||||
minFrameHeight="144" maxFrameHeight="2160"
|
||||
minFrameRate="15" maxFrameRate="30" />
|
||||
|
||||
<VideoEncoderCap name="h263" enabled="true"
|
||||
minBitRate="64000" maxBitRate="2000000"
|
||||
minFrameWidth="176" maxFrameWidth="800"
|
||||
minFrameHeight="144" maxFrameHeight="480"
|
||||
minFrameRate="15" maxFrameRate="30" />
|
||||
|
||||
<VideoEncoderCap name="m4v" enabled="true"
|
||||
minBitRate="64000" maxBitRate="40000000"
|
||||
minFrameWidth="176" maxFrameWidth="1920"
|
||||
minFrameHeight="144" maxFrameHeight="1080"
|
||||
minFrameRate="15" maxFrameRate="30" />
|
||||
|
||||
<AudioEncoderCap name="aac" enabled="true"
|
||||
minBitRate="758" maxBitRate="288000"
|
||||
minSampleRate="8000" maxSampleRate="48000"
|
||||
minChannels="1" maxChannels="1" />
|
||||
|
||||
<AudioEncoderCap name="heaac" enabled="true"
|
||||
minBitRate="8000" maxBitRate="64000"
|
||||
minSampleRate="16000" maxSampleRate="48000"
|
||||
minChannels="1" maxChannels="1" />
|
||||
|
||||
<AudioEncoderCap name="aaceld" enabled="true"
|
||||
minBitRate="16000" maxBitRate="192000"
|
||||
minSampleRate="16000" maxSampleRate="48000"
|
||||
minChannels="1" maxChannels="1" />
|
||||
|
||||
<AudioEncoderCap name="amrwb" enabled="true"
|
||||
minBitRate="6600" maxBitRate="23050"
|
||||
minSampleRate="16000" maxSampleRate="16000"
|
||||
minChannels="1" maxChannels="1" />
|
||||
|
||||
<AudioEncoderCap name="amrnb" enabled="true"
|
||||
minBitRate="5525" maxBitRate="12200"
|
||||
minSampleRate="8000" maxSampleRate="8000"
|
||||
minChannels="1" maxChannels="1" />
|
||||
|
||||
<!--
|
||||
FIXME:
|
||||
We do not check decoder capabilities at present
|
||||
At present, we only check whether windows media is visible
|
||||
for TEST applications. For other applications, we do
|
||||
not perform any checks at all.
|
||||
-->
|
||||
<VideoDecoderCap name="wmv" enabled="false"/>
|
||||
<AudioDecoderCap name="wma" enabled="false"/>
|
||||
</MediaSettings>
|
||||
407
nfc/libnfc-brcm.conf
Normal file
407
nfc/libnfc-brcm.conf
Normal file
@@ -0,0 +1,407 @@
|
||||
###################### Start of libnfc-brcm.conf #######################
|
||||
|
||||
###############################################################################
|
||||
# Application options
|
||||
APPL_TRACE_LEVEL=0x01
|
||||
PROTOCOL_TRACE_LEVEL=0x00000000
|
||||
|
||||
###############################################################################
|
||||
# performance measurement
|
||||
# Change this setting to control how often USERIAL log the performance (throughput)
|
||||
# data on read/write/poll
|
||||
# defailt is to log performance dara for every 100 read or write
|
||||
#REPORT_PERFORMANCE_MEASURE=100
|
||||
|
||||
###############################################################################
|
||||
# File used for NFA storage
|
||||
NFA_STORAGE="/data/nfc"
|
||||
|
||||
###############################################################################
|
||||
# Snooze Mode Settings
|
||||
#
|
||||
# By default snooze mode is enabled. Set SNOOZE_MODE_CFG byte[0] to 0
|
||||
# to disable.
|
||||
#
|
||||
# If SNOOZE_MODE_CFG is not provided, the default settings are used:
|
||||
# They are as follows:
|
||||
# 8 Sleep Mode (0=Disabled 1=UART 8=SPI/I2C)
|
||||
# 0 Idle Threshold Host
|
||||
# 0 Idle Threshold HC
|
||||
# 0 NFC Wake active mode (0=ActiveLow 1=ActiveHigh)
|
||||
# 1 Host Wake active mode (0=ActiveLow 1=ActiveHigh)
|
||||
#
|
||||
#SNOOZE_MODE_CFG={08:00:00:00:01}
|
||||
|
||||
###############################################################################
|
||||
# Insert a delay in milliseconds after NFC_WAKE and before write to NFCC
|
||||
#NFC_WAKE_DELAY=20
|
||||
|
||||
###############################################################################
|
||||
# Various Delay settings (in ms) used in USERIAL
|
||||
# POWER_ON_DELAY
|
||||
# Delay after turning on chip, before writing to transport (default 300)
|
||||
# PRE_POWER_OFF_DELAY
|
||||
# Delay after deasserting NFC-Wake before turn off chip (default 0)
|
||||
# POST_POWER_OFF_DELAY
|
||||
# Delay after turning off chip, before USERIAL_close returns (default 0)
|
||||
#
|
||||
#POWER_ON_DELAY=300
|
||||
#PRE_POWER_OFF_DELAY=0
|
||||
#POST_POWER_OFF_DELAY=0
|
||||
|
||||
###############################################################################
|
||||
# Maximum time (ms) to wait for RESET NTF after setting REG_PU to high
|
||||
# The default is 1000.
|
||||
#NFCC_ENABLE_TIMEOUT=0
|
||||
|
||||
###############################################################################
|
||||
# LPTD mode configuration
|
||||
# byte[0] is the length of the remaining bytes in this value
|
||||
# if set to 0, LPTD params will NOT be sent to NFCC (i.e. disabled).
|
||||
# byte[1] is the param id it should be set to B9.
|
||||
# byte[2] is the length of the LPTD parameters
|
||||
# byte[3] indicates if LPTD is enabled
|
||||
# if set to 0, LPTD will be disabled (parameters will still be sent).
|
||||
# byte[4-n] are the LPTD parameters.
|
||||
# By default, LPTD is enabled and default settings are used.
|
||||
# See nfc_hal_dm_cfg.c for defaults
|
||||
#LPTD_CFG={23:B9:21:01:02:FF:FF:04:A0:0F:40:00:80:02:02:10:00:00:00:31:0C:30:00:00:00:00:00:00:00:00:00:00:00:00:00:00}
|
||||
|
||||
###############################################################################
|
||||
# Startup Configuration (100 bytes maximum)
|
||||
#
|
||||
# For the 0xCA parameter, byte[9] (marked by 'AA') is for UICC0, and byte[10] (marked by BB) is
|
||||
# for UICC1. The values are defined as:
|
||||
# 0 : UICCx only supports ISO_DEP in low power mode.
|
||||
# 2 : UICCx only supports Mifare in low power mode.
|
||||
# 3 : UICCx supports both ISO_DEP and Mifare in low power mode.
|
||||
#
|
||||
# AA BB
|
||||
#NFA_DM_START_UP_CFG={1F:CB:01:01:A5:01:01:CA:14:00:00:00:00:06:E8:03:00:00:00:00:00:00:00:00:00:00:00:00:00:80:01:01}
|
||||
|
||||
###############################################################################
|
||||
# Startup Vendor Specific Configuration (100 bytes maximum);
|
||||
# byte[0] TLV total len = 0x5
|
||||
# byte[1] NCI_MTS_CMD|NCI_GID_PROP = 0x2f
|
||||
# byte[2] NCI_MSG_FRAME_LOG = 0x9
|
||||
# byte[3] 2
|
||||
# byte[4] 0=turn off RF frame logging; 1=turn on
|
||||
# byte[5] 0=turn off SWP frame logging; 1=turn on
|
||||
# NFA_DM_START_UP_VSC_CFG={05:2F:09:02:01:01}
|
||||
|
||||
###############################################################################
|
||||
# Antenna Configuration - This data is used when setting 0xC8 config item
|
||||
# at startup (before discovery is started). If not used, no value is sent.
|
||||
#
|
||||
# The settings for this value are documented here:
|
||||
# http://wcgbu.broadcom.com/wpan/PM/Project%20Document%20Library/bcm20791B0/
|
||||
# Design/Doc/PHY%20register%20settings/BCM20791-B2-1027-02_PHY_Recommended_Reg_Settings.xlsx
|
||||
# This document is maintained by Paul Forshaw.
|
||||
#
|
||||
# The values marked as ?? should be tweaked per antenna or customer/app:
|
||||
# {20:C8:1E:06:??:00:??:??:??:00:??:24:00:1C:00:75:00:77:00:76:00:1C:00:03:00:0A:00:??:01:00:00:40:04}
|
||||
# array[0] = 0x20 is length of the payload from array[1] to the end
|
||||
# array[1] = 0xC8 is PREINIT_DSP_CFG
|
||||
#PREINIT_DSP_CFG={20:C8:1E:06:1F:00:0F:03:3C:00:04:24:00:1C:00:75:00:77:00:76:00:1C:00:03:00:0A:00:48:01:00:00:40:04}
|
||||
|
||||
###############################################################################
|
||||
# Configure crystal frequency when internal LPO can't detect the frequency.
|
||||
#XTAL_FREQUENCY=0
|
||||
###############################################################################
|
||||
# Configure the default Destination Gate used by HCI (the default is 4, which
|
||||
# is the ETSI loopback gate.
|
||||
NFA_HCI_DEFAULT_DEST_GATE=0xF0
|
||||
|
||||
###############################################################################
|
||||
# Configure the single default SE to use. The default is to use the first
|
||||
# SE that is detected by the stack. This value might be used when the phone
|
||||
# supports multiple SE (e.g. 0xF3 and 0xF4) but you want to force it to use
|
||||
# one of them (e.g. 0xF4).
|
||||
#ACTIVE_SE=0xF3
|
||||
|
||||
###############################################################################
|
||||
# Configure the default NfcA/IsoDep techology and protocol route. Can be
|
||||
# either a secure element (e.g. 0xF4) or the host (0x00)
|
||||
#DEFAULT_ISODEP_ROUTE=0x00
|
||||
|
||||
###############################################################################
|
||||
# Configure the NFC Extras to open and use a static pipe. If the value is
|
||||
# not set or set to 0, then the default is use a dynamic pipe based on a
|
||||
# destination gate (see NFA_HCI_DEFAULT_DEST_GATE). Note there is a value
|
||||
# for each UICC (where F3="UICC0" and F4="UICC1")
|
||||
#NFA_HCI_STATIC_PIPE_ID_F3=0x70
|
||||
#NFA_HCI_STATIC_PIPE_ID_01=0x19
|
||||
NFA_HCI_STATIC_PIPE_ID_C0=0x19
|
||||
###############################################################################
|
||||
# When disconnecting from Oberthur secure element, perform a warm-reset of
|
||||
# the secure element to deselect the applet.
|
||||
# The default hex value of the command is 0x3. If this variable is undefined,
|
||||
# then this feature is not used.
|
||||
#OBERTHUR_WARM_RESET_COMMAND=0x03
|
||||
|
||||
###############################################################################
|
||||
# Force UICC to only listen to the following technology(s).
|
||||
# The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h.
|
||||
# Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B | NFA_TECHNOLOGY_MASK_F
|
||||
UICC_LISTEN_TECH_MASK=0x07
|
||||
|
||||
###############################################################################
|
||||
# Force HOST listen feature enable or disable.
|
||||
# 0: Disable
|
||||
# 1: Enable
|
||||
HOST_LISTEN_ENABLE=0x01
|
||||
|
||||
###############################################################################
|
||||
# Enabling/Disabling Forward functionality
|
||||
# Disable 0x00
|
||||
# Enable 0x01
|
||||
NXP_FWD_FUNCTIONALITY_ENABLE=0x01
|
||||
|
||||
###############################################################################
|
||||
# Allow UICC to be powered off if there is no traffic.
|
||||
# Timeout is in ms. If set to 0, then UICC will not be powered off.
|
||||
#UICC_IDLE_TIMEOUT=30000
|
||||
UICC_IDLE_TIMEOUT=0
|
||||
|
||||
###############################################################################
|
||||
# AID for Empty Select command
|
||||
# If specified, this AID will be substituted when an Empty SELECT command is
|
||||
# detected. The first byte is the length of the AID. Maximum length is 16.
|
||||
AID_FOR_EMPTY_SELECT={08:A0:00:00:01:51:00:00:00}
|
||||
###############################################################################
|
||||
# Maximum Number of Credits to be allowed by the NFCC
|
||||
# This value overrides what the NFCC specifices allowing the host to have
|
||||
# the control to work-around transport limitations. If this value does
|
||||
# not exist or is set to 0, the NFCC will provide the number of credits.
|
||||
MAX_RF_DATA_CREDITS=1
|
||||
|
||||
###############################################################################
|
||||
# This setting allows you to disable registering the T4t Virtual SE that causes
|
||||
# the NFCC to send PPSE requests to the DH.
|
||||
# The default setting is enabled (i.e. T4t Virtual SE is registered).
|
||||
#REGISTER_VIRTUAL_SE=1
|
||||
|
||||
###############################################################################
|
||||
# When screen is turned off, specify the desired power state of the controller.
|
||||
# 0: power-off-sleep state; DEFAULT
|
||||
# 1: full-power state
|
||||
# 2: screen-off card-emulation (CE4/CE3/CE1 modes are used)
|
||||
SCREEN_OFF_POWER_STATE=1
|
||||
|
||||
###############################################################################
|
||||
# Firmware patch file
|
||||
# If the value is not set then patch download is disabled.
|
||||
#FW_PATCH="/vendor/firmware/bcm2079x_firmware.ncd"
|
||||
|
||||
###############################################################################
|
||||
# Firmware pre-patch file (sent before the above patch file)
|
||||
# If the value is not set then pre-patch is not used.
|
||||
#FW_PRE_PATCH="/vendor/firmware/bcm2079x_pre_firmware.ncd"
|
||||
|
||||
###############################################################################
|
||||
# Firmware patch format
|
||||
# 1 = HCD
|
||||
# 2 = NCD (default)
|
||||
#NFA_CONFIG_FORMAT=2
|
||||
|
||||
###############################################################################
|
||||
# SPD Debug mode
|
||||
# If set to 1, any failure of downloading a patch will trigger a hard-stop
|
||||
#SPD_DEBUG=0
|
||||
|
||||
###############################################################################
|
||||
# SPD Max Retry Count
|
||||
# The number of attempts to download a patch before giving up (defualt is 3).
|
||||
# Note, this resets after a power-cycle.
|
||||
#SPD_MAX_RETRY_COUNT=3
|
||||
|
||||
###############################################################################
|
||||
# transport driver
|
||||
#
|
||||
# TRANSPORT_DRIVER=<driver>
|
||||
#
|
||||
# where <driver> can be, for example:
|
||||
# "/dev/ttyS" (UART)
|
||||
# "/dev/bcmi2cnfc" (I2C)
|
||||
# "hwtun" (HW Tunnel)
|
||||
# "/dev/bcmspinfc" (SPI)
|
||||
# "/dev/btusb0" (BT USB)
|
||||
#TRANSPORT_DRIVER="/dev/bcm2079x-i2c"
|
||||
|
||||
###############################################################################
|
||||
# power control driver
|
||||
# Specify a kernel driver that support ioctl commands to control NFC_EN and
|
||||
# NFC_WAKE gpio signals.
|
||||
#
|
||||
# POWER_CONTRL_DRIVER=<driver>
|
||||
# where <driver> can be, for example:
|
||||
# "/dev/nfcpower"
|
||||
# "/dev/bcmi2cnfc" (I2C)
|
||||
# "/dev/bcmspinfc" (SPI)
|
||||
# i2c and spi driver may be used to control NFC_EN and NFC_WAKE signal
|
||||
#POWER_CONTROL_DRIVER="/dev/bcm2079x-i2c"
|
||||
|
||||
###############################################################################
|
||||
# I2C transport driver options
|
||||
# Mako does not support 10-bit I2C addresses
|
||||
# Revert to 7-bit address
|
||||
#BCMI2CNFC_ADDRESS=0x77
|
||||
|
||||
###############################################################################
|
||||
# I2C transport driver try to read multiple packets in read() if data is available
|
||||
# remove the comment below to enable this feature
|
||||
#READ_MULTIPLE_PACKETS=1
|
||||
|
||||
###############################################################################
|
||||
# SPI transport driver options
|
||||
#SPI_NEGOTIATION={0A:F0:00:01:00:00:00:FF:FF:00:00}
|
||||
|
||||
###############################################################################
|
||||
# UART transport driver options
|
||||
#
|
||||
# PORT=1,2,3,...
|
||||
# BAUD=115200, 19200, 9600, 4800,
|
||||
# DATABITS=8, 7, 6, 5
|
||||
# PARITY="even" | "odd" | "none"
|
||||
# STOPBITS="0" | "1" | "1.5" | "2"
|
||||
|
||||
#UART_PORT=2
|
||||
#UART_BAUD=115200
|
||||
#UART_DATABITS=8
|
||||
#UART_PARITY="none"
|
||||
#UART_STOPBITS="1"
|
||||
|
||||
###############################################################################
|
||||
# Insert a delay in microseconds per byte after a write to NFCC.
|
||||
# after writing a block of data to the NFCC, delay this an amopunt of time before
|
||||
# writing next block of data. the delay is calculated as below
|
||||
# NFC_WRITE_DELAY * (number of byte written) / 1000 milliseconds
|
||||
# e.g. after 259 bytes is written, delay (259 * 20 / 1000) 5 ms before next write
|
||||
#NFC_WRITE_DELAY=20
|
||||
|
||||
###############################################################################
|
||||
# Maximum Number of Credits to be allowed by the NFCC
|
||||
# This value overrides what the NFCC specifices allowing the host to have
|
||||
# the control to work-around transport limitations. If this value does
|
||||
# not exist or is set to 0, the NFCC will provide the number of credits.
|
||||
MAX_RF_DATA_CREDITS=1
|
||||
|
||||
###############################################################################
|
||||
# Default poll duration (in ms)
|
||||
# The defualt is 500ms if not set (see nfc_target.h)
|
||||
#NFA_DM_DISC_DURATION_POLL=333
|
||||
###############################################################################
|
||||
# Antenna Configuration - This data is used when setting 0xC8 config item
|
||||
# at startup (before discovery is started). If not used, no value is sent.
|
||||
#
|
||||
# The settings for this value are documented here:
|
||||
# http://wcgbu.broadcom.com/wpan/PM/Project%20Document%20Library/bcm20791B0/
|
||||
# Design/Doc/PHY%20register%20settings/BCM20791-B2-1027-02_PHY_Recommended_Reg_Settings.xlsx
|
||||
# This document is maintained by Paul Forshaw.
|
||||
#
|
||||
# The values marked as ?? should be tweaked per antenna or customer/app:
|
||||
# {20:C8:1E:06:??:00:??:??:??:00:??:24:00:1C:00:75:00:77:00:76:00:1C:00:03:00:0A:00:??:01:00:00:40:04}
|
||||
# array[0] = 0x20 is length of the payload from array[1] to the end
|
||||
# array[1] = 0xC8 is PREINIT_DSP_CFG
|
||||
#PREINIT_DSP_CFG={20:C8:1E:06:1F:00:0F:03:3C:00:04:24:00:1C:00:75:00:77:00:76:00:1C:00:03:00:0A:00:48:01:00:00:40:04}
|
||||
|
||||
###############################################################################
|
||||
# Choose the presence-check algorithm for type-4 tag. If not defined, the default value is 1.
|
||||
# 0 NFA_RW_PRES_CHK_DEFAULT; Let stack selects an algorithm
|
||||
# 1 NFA_RW_PRES_CHK_I_BLOCK; ISO-DEP protocol's empty I-block
|
||||
# 2 NFA_RW_PRES_CHK_RESET; Deactivate to Sleep, then re-activate
|
||||
# 3 NFA_RW_PRES_CHK_RB_CH0; Type-4 tag protocol's ReadBinary command on channel 0
|
||||
# 4 NFA_RW_PRES_CHK_RB_CH3; Type-4 tag protocol's ReadBinary command on channel 3
|
||||
# 5 NFA_RW_PRES_CHK_ISO_DEP_NAK; Type - 4 tag protocol iso-dep nak presence check
|
||||
# command is sent waiting for rsp and ntf.
|
||||
PRESENCE_CHECK_ALGORITHM=5
|
||||
|
||||
###############################################################################
|
||||
# Force tag polling for the following technology(s).
|
||||
# The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h.
|
||||
# Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B |
|
||||
# NFA_TECHNOLOGY_MASK_F | NFA_TECHNOLOGY_MASK_ISO15693 |
|
||||
# NFA_TECHNOLOGY_MASK_B_PRIME | NFA_TECHNOLOGY_MASK_KOVIO |
|
||||
# NFA_TECHNOLOGY_MASK_ACTIVE
|
||||
#
|
||||
# Notable bits:
|
||||
# NFA_TECHNOLOGY_MASK_A 0x01 /* NFC Technology A */
|
||||
# NFA_TECHNOLOGY_MASK_B 0x02 /* NFC Technology B */
|
||||
# NFA_TECHNOLOGY_MASK_F 0x04 /* NFC Technology F */
|
||||
# NFA_TECHNOLOGY_MASK_ISO15693 0x08 /* Proprietary Technology */
|
||||
# NFA_TECHNOLOGY_MASK_KOVIO 0x20 /* Proprietary Technology */
|
||||
# NFA_TECHNOLOGY_MASK_ACTIVE 0x40 /* NFC Technology Active */
|
||||
POLLING_TECH_MASK=0x6F
|
||||
|
||||
###############################################################################
|
||||
# Force P2P to only listen for the following technology(s).
|
||||
# The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h.
|
||||
# Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_F |
|
||||
# NFA_TECHNOLOGY_MASK_ACTIVE
|
||||
#
|
||||
# Notable bits:
|
||||
# NFA_TECHNOLOGY_MASK_A 0x01 /* NFC Technology A */
|
||||
# NFA_TECHNOLOGY_MASK_F 0x04 /* NFC Technology F */
|
||||
# NFA_TECHNOLOGY_MASK_ACTIVE 0x40 /* NFC Technology Active */
|
||||
P2P_LISTEN_TECH_MASK=0x45
|
||||
|
||||
PRESERVE_STORAGE=0x01
|
||||
|
||||
###############################################################################
|
||||
# Override the stack default for NFA_EE_MAX_EE_SUPPORTED set in nfc_target.h.
|
||||
# The value is set to 3 by default as it assumes we will discover 0xF2,
|
||||
# 0xF3, and 0xF4. If a platform will exclude and SE, this value can be reduced
|
||||
# so that the stack will not wait any longer than necessary.
|
||||
|
||||
# Maximum EE supported number
|
||||
# NXP PN547C2 0x02
|
||||
# NXP PN65T 0x03
|
||||
# NXP PN548C2 0x02
|
||||
# NXP PN66T 0x03
|
||||
NFA_MAX_EE_SUPPORTED=0x02
|
||||
|
||||
###############################################################################
|
||||
# NCI Hal Module name
|
||||
NCI_HAL_MODULE="nfc_nci"
|
||||
|
||||
##############################################################################
|
||||
# Deactivate notification wait time out in seconds used in ETSI Reader mode
|
||||
# 0 - Infinite wait
|
||||
#NFA_DM_DISC_NTF_TIMEOUT=0
|
||||
|
||||
###############################################################################
|
||||
# AID_MATCHING constants
|
||||
# AID_MATCHING_EXACT_ONLY 0x00
|
||||
# AID_MATCHING_EXACT_OR_PREFIX 0x01
|
||||
# AID_MATCHING_PREFIX_ONLY 0x02
|
||||
# AID_MATCHING_EXACT_OR_SUBSET_OR_PREFIX 0x03
|
||||
AID_MATCHING_MODE=0x03
|
||||
|
||||
###############################################################################
|
||||
# Default Secure Element route id
|
||||
DEFAULT_OFFHOST_ROUTE=0x02
|
||||
|
||||
###############################################################################
|
||||
# Vendor Specific Proprietary Protocol & Discovery Configuration
|
||||
# Set to 0xFF if unsupported
|
||||
# byte[0] NCI_PROTOCOL_18092_ACTIVE
|
||||
# byte[1] NCI_PROTOCOL_B_PRIME
|
||||
# byte[2] NCI_PROTOCOL_DUAL
|
||||
# byte[3] NCI_PROTOCOL_15693
|
||||
# byte[4] NCI_PROTOCOL_KOVIO
|
||||
# byte[5] NCI_PROTOCOL_MIFARE
|
||||
# byte[6] NCI_DISCOVERY_TYPE_POLL_KOVIO
|
||||
# byte[7] NCI_DISCOVERY_TYPE_POLL_B_PRIME
|
||||
# byte[8] NCI_DISCOVERY_TYPE_LISTEN_B_PRIME
|
||||
NFA_PROPRIETARY_CFG={05:FF:FF:06:81:80:70:FF:FF}
|
||||
|
||||
###############################################################################
|
||||
# Bail out mode
|
||||
# If set to 1, NFCC is using bail out mode for either Type A or Type B poll.
|
||||
NFA_POLL_BAIL_OUT_MODE=0x01
|
||||
###############################################################################
|
||||
# Enable/Disable Block Route feature.
|
||||
# Block Route will restrict routing to first matched rule
|
||||
# Block Route enable 0x01
|
||||
# Block Route disable 0x00
|
||||
NFA_BLOCK_ROUTE=0x00
|
||||
349
overlay/frameworks/base/core/res/res/values/config.xml
Executable file
349
overlay/frameworks/base/core/res/res/values/config.xml
Executable file
@@ -0,0 +1,349 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright 2016, The Android Open Source Project
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
*/
|
||||
-->
|
||||
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
|
||||
<!-- If this is true, the screen will fade off. -->
|
||||
<bool name="config_animateScreenLights">false</bool>
|
||||
|
||||
<!-- Whether a software navigation bar should be shown. NOTE: in the future this may be
|
||||
autodetected from the Configuration. -->
|
||||
<bool name="config_showNavigationBar">true</bool>
|
||||
|
||||
<!-- When true use the linux /dev/input/event subsystem to detect the switch changes
|
||||
on the headphone/microphone jack. When false use the older uevent framework. -->
|
||||
<bool name="config_useDevInputEventForAudioJack">true</bool>
|
||||
|
||||
<!-- Indicate whether closing the lid causes the device to go to sleep and opening
|
||||
it causes the device to wake up.
|
||||
The default is false. -->
|
||||
<bool name="config_lidControlsSleep">true</bool>
|
||||
|
||||
<!-- Indicate whether to allow the device to suspend when the screen is off
|
||||
due to the proximity sensor. This resource should only be set to true
|
||||
if the sensor HAL correctly handles the proximity sensor as a wake-up source.
|
||||
Otherwise, the device may fail to wake out of suspend reliably.
|
||||
The default is false. -->
|
||||
<bool name="config_suspendWhenScreenOffDueToProximity">true</bool>
|
||||
|
||||
<!-- Flag indicating whether the we should enable the automatic brightness in Settings.
|
||||
Software implementation will be used if config_hardware_auto_brightness_available is not set -->
|
||||
<bool name="config_automatic_brightness_available">true</bool>
|
||||
|
||||
<!-- Stability requirements in milliseconds for accepting a new brightness level. This is used
|
||||
for debouncing the light sensor. Different constants are used to debounce the light sensor
|
||||
when adapting to brighter or darker environments. This parameter controls how quickly
|
||||
brightness changes occur in response to an observed change in light level that exceeds the
|
||||
hysteresis threshold. -->
|
||||
<integer name="config_autoBrightnessBrighteningLightDebounce">2000</integer>
|
||||
<integer name="config_autoBrightnessDarkeningLightDebounce">4000</integer>
|
||||
|
||||
<!-- Fast brightness animation ramp rate in brightness units per second-->
|
||||
<integer translatable="false" name="config_brightness_ramp_rate_fast">180</integer>
|
||||
|
||||
<!-- Slow brightness animation ramp rate in brightness units per second-->
|
||||
<integer translatable="false" name="config_brightness_ramp_rate_slow">60</integer>
|
||||
|
||||
<!-- If this is true, the screen will come on when you unplug usb/power/whatever. -->
|
||||
<bool name="config_unplugTurnsOnScreen">true</bool>
|
||||
|
||||
<!-- Enable Night display, which requires HWC 2.0. -->
|
||||
<bool name="config_nightDisplayAvailable">true</bool>
|
||||
|
||||
<!-- Boolean indicating whether the HWC setColorTransform function can be performed efficiently
|
||||
in hardware. -->
|
||||
<bool name="config_setColorTransformAccelerated">true</bool>
|
||||
|
||||
<!-- Boolean indicating if restoring network selection should be skipped -->
|
||||
<!-- The restoring is handled by modem if it is true -->
|
||||
<bool translatable="false" name="skip_restoring_network_selection">true</bool>
|
||||
|
||||
<!-- Set to true to add links to Cell Broadcast app from Settings and MMS app. -->
|
||||
<bool name="config_cellBroadcastAppLinks">true</bool>
|
||||
|
||||
<!-- Is the notification LED intrusive? Used to decide if there should be a disable option -->
|
||||
<bool name="config_intrusiveNotificationLed">true</bool>
|
||||
|
||||
<!-- Default color for notification LED is white. -->
|
||||
<color name="config_defaultNotificationColor">#ffffffff</color>
|
||||
|
||||
<!-- Default LED on time for notification LED in milliseconds. -->
|
||||
<integer name="config_defaultNotificationLedOn">1000</integer>
|
||||
|
||||
<!-- Default LED off time for notification LED in milliseconds. -->
|
||||
<integer name="config_defaultNotificationLedOff">9000</integer>
|
||||
|
||||
<!-- reference volume index for music stream to limit headphone volume and display warning -->
|
||||
<integer name="config_safe_media_volume_index">4</integer>
|
||||
|
||||
<!-- Whether Multiuser UI should be shown -->
|
||||
<bool name="config_enableMultiUserUI">true</bool>
|
||||
|
||||
<!-- Maximum number of supported users -->
|
||||
<integer name="config_multiuserMaximumUsers">4</integer>
|
||||
|
||||
<!-- List of regexpressions describing the interface (if any) that represent tetherable
|
||||
USB interfaces. If the device doesn't want to support tething over USB this should
|
||||
be empty. An example would be "usb.*" -->
|
||||
<string-array translatable="false" name="config_tether_usb_regexs">
|
||||
<item>"usb\\d"</item>
|
||||
<item>"rndis\\d"</item>
|
||||
</string-array>
|
||||
|
||||
<!-- List of regexpressions describing the interface (if any) that represent tetherable
|
||||
Wifi interfaces. If the device doesn't want to support tethering over Wifi this
|
||||
should be empty. An example would be "softap.*" -->
|
||||
<string-array translatable="false" name="config_tether_wifi_regexs">
|
||||
<item>"wlan0"</item>
|
||||
<item>"softap.*"</item>
|
||||
</string-array>
|
||||
|
||||
<!-- List of regexpressions describing the interface (if any) that represent tetherable
|
||||
bluetooth interfaces. If the device doesn't want to support tethering over bluetooth this
|
||||
should be empty. -->
|
||||
<string-array translatable="false" name="config_tether_bluetooth_regexs">
|
||||
<item>"bt-pan"</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Max number of scan filters supported by blutooth controller. 0 if the
|
||||
device does not support hardware scan filters-->
|
||||
<integer translatable="false" name="config_bluetooth_max_scan_filters">1</integer>
|
||||
|
||||
<!-- Max number of advertisers supported by bluetooth controller. 0 if the
|
||||
device does not support multiple advertisement-->
|
||||
<integer translatable="false" name="config_bluetooth_max_advertisers">4</integer>
|
||||
|
||||
<!-- Operating voltage for bluetooth controller. 0 by default-->
|
||||
<integer translatable="false" name="config_bluetooth_operating_voltage_mv">3300</integer>
|
||||
|
||||
<!-- Boolean indicating if current platform supports HFP inband ringing -->
|
||||
<bool name="config_bluetooth_hfp_inband_ringing_support">true</bool>
|
||||
|
||||
<!-- Array of allowable ConnectivityManager network types for tethering -->
|
||||
<!-- Common options are [1, 4] for TYPE_WIFI and TYPE_MOBILE_DUN or
|
||||
[0,1,5,7] for TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI and TYPE_BLUETOOTH -->
|
||||
<integer-array translatable="false" name="config_tether_upstream_types">
|
||||
<item>1</item>
|
||||
<item>7</item>
|
||||
<item>0</item>
|
||||
<item>5</item>
|
||||
</integer-array>
|
||||
|
||||
<!-- This string array should be overridden by the device to present a list of network
|
||||
attributes. This is used by the connectivity manager to decide which networks can coexist
|
||||
based on the hardware -->
|
||||
<!-- An Array of "[Connection name],[ConnectivityManager.TYPE_xxxx],
|
||||
[associated radio-type],[priority],[restoral-timer(ms)],[dependencyMet] -->
|
||||
<!-- the 5th element "resore-time" indicates the number of milliseconds to delay
|
||||
before automatically restore the default connection. Set -1 if the connection
|
||||
does not require auto-restore. -->
|
||||
<!-- the 6th element indicates boot-time dependency-met value. -->
|
||||
<string-array translatable="false" name="networkAttributes">
|
||||
<item>"wifi,1,1,1,-1,true"</item>
|
||||
<item>"mobile,0,0,0,-1,true"</item>
|
||||
<item>"mobile_mms,2,0,2,60000,true"</item>
|
||||
<item>"mobile_supl,3,0,2,60000,true"</item>
|
||||
<item>"mobile_dun,4,0,2,60000,true"</item>
|
||||
<item>"mobile_hipri,5,0,3,60000,true"</item>
|
||||
<item>"mobile_fota,10,0,2,60000,true"</item>
|
||||
<item>"mobile_ims,11,0,2,60000,true"</item>
|
||||
<item>"mobile_cbs,12,0,2,60000,true"</item>
|
||||
<item>"mobile_ia,14,0,2,-1,true"</item>
|
||||
<item>"bluetooth,7,7,2,-1,true"</item>
|
||||
<item>"ethernet,9,9,9,-1,true"</item>
|
||||
<item>"mobile_emergency,15,0,2,-1,true</item>
|
||||
</string-array>
|
||||
|
||||
<!-- This string array should be overridden by the device to present a list of radio
|
||||
attributes. This is used by the connectivity manager to decide which networks can coexist
|
||||
based on the hardware -->
|
||||
<!-- An Array of "[ConnectivityManager connectionType],
|
||||
[# simultaneous connection types]" -->
|
||||
<string-array translatable="false" name="radioAttributes">
|
||||
<item>"1,1"</item>
|
||||
<item>"0,1"</item>
|
||||
<item>"7,1"</item>
|
||||
<item>"9,1"</item>
|
||||
</string-array>
|
||||
|
||||
<!-- If the hardware supports specially marking packets that caused a wakeup of the
|
||||
main CPU, set this value to the mark used. -->
|
||||
<integer name="config_networkWakeupPacketMark">0x80000000</integer>
|
||||
|
||||
<!-- Mask to use when checking skb mark defined in config_networkWakeupPacketMark above. -->
|
||||
<integer name="config_networkWakeupPacketMask">0x80000000</integer>
|
||||
|
||||
<!-- Boolean indicating whether the wifi chipset has dual frequency band support -->
|
||||
<bool translatable="false" name="config_wifi_dual_band_support">true</bool>
|
||||
|
||||
<!-- Boolean indicating whether 802.11r Fast BSS Transition is enabled on this platform -->
|
||||
<bool translatable="false" name="config_wifi_fast_bss_transition_enabled">true</bool>
|
||||
|
||||
<!-- Boolean indicating whether the wifi chipset has background scan support -->
|
||||
<bool translatable="false" name="config_wifi_background_scan_support">true</bool>
|
||||
|
||||
<!-- Integer thresholds, do not connect to APs with RSSI lower than these values -->
|
||||
<integer translatable="false" name="config_wifi_framework_wifi_score_bad_rssi_threshold_5GHz">-77</integer>
|
||||
<integer translatable="false" name="config_wifi_framework_wifi_score_bad_rssi_threshold_24GHz">-80</integer>
|
||||
|
||||
|
||||
<!-- Vibrator pattern for feedback about a long screen/key press -->
|
||||
<integer-array name="config_longPressVibePattern">
|
||||
<item>8</item>
|
||||
</integer-array>
|
||||
|
||||
<!-- Make things go fast -->
|
||||
<bool name="config_ui_enableFadingMarquee">false</bool>
|
||||
|
||||
<!-- Wifi driver supports batched scan -->
|
||||
<bool translatable="false" name="config_wifi_batched_scan_supported">true</bool>
|
||||
|
||||
<!-- Boolean indicating whether or not to revert to default country code when cellular
|
||||
radio is unable to find any MCC information to infer wifi country code from -->
|
||||
<bool translatable="false" name="config_wifi_revert_country_code_on_cellular_loss">true</bool>
|
||||
|
||||
<!-- Boolean indicating whether or not wifi should turn off when emergency call is made -->
|
||||
<bool translatable="false" name="config_wifi_turn_off_during_emergency_call">true</bool>
|
||||
|
||||
<!-- Enable doze mode
|
||||
ComponentName of a dream to show whenever the system would otherwise have gone to sleep. -->
|
||||
<string name="config_dozeComponent">com.android.systemui/com.android.systemui.doze.DozeService</string>
|
||||
|
||||
<!-- If true, the doze component is not started until after the screen has been turned off
|
||||
and the screen off animation has been performed. -->
|
||||
<bool name="config_dozeAfterScreenOff">true</bool>
|
||||
|
||||
<!-- Doze: should the TYPE_PICK_UP_GESTURE sensor be used as a pulse signal. -->
|
||||
<bool name="config_dozePulsePickup">true</bool>
|
||||
|
||||
<!-- Type of the double tap sensor. Empty if double tap is not supported. -->
|
||||
<string name="config_dozeDoubleTapSensorType" translatable="false">com.google.sensor.double_touch</string>
|
||||
|
||||
<!-- Type of the long press sensor. Empty if long press is not supported. -->
|
||||
<string name="config_dozeLongPressSensorType" translatable="false">com.google.sensor.long_press</string>
|
||||
|
||||
<!-- Whether the always on display mode is available. -->
|
||||
<bool name="config_dozeAlwaysOnDisplayAvailable">true</bool>
|
||||
|
||||
<!-- Whether the display blanks itself when transition from a doze to a non-doze state -->
|
||||
<bool name="config_displayBlanksAfterDoze">true</bool>
|
||||
|
||||
<!-- True if the display hardware only has brightness buckets rather than a full range of
|
||||
backlight values -->
|
||||
<bool name="config_displayBrightnessBucketsInDoze">true</bool>
|
||||
|
||||
<!-- ImsService package name to bind to by default, if config_dynamic_bind_ims is true -->
|
||||
<string name="config_ims_package">org.codeaurora.ims</string>
|
||||
|
||||
<!-- Flag specifying whether or not IMS will use the ImsResolver dynamically -->
|
||||
<bool name="config_dynamic_bind_ims">true</bool>
|
||||
|
||||
<!-- Specifies whether to decouple the auto-suspend state of the device from the display on/off state. -->
|
||||
<bool name="config_powerDecoupleAutoSuspendModeFromDisplay">true</bool>
|
||||
|
||||
<!-- Specifies whether to decouple the interactive state of the device from the display on/off state. -->
|
||||
<bool name="config_powerDecoupleInteractiveModeFromDisplay">true</bool>
|
||||
|
||||
<!-- Is the device capable of hot swapping an UICC Card -->
|
||||
<bool name="config_hotswapCapable">true</bool>
|
||||
|
||||
<!-- Flag specifying whether VoLTE is availasble on device -->
|
||||
<bool name="config_device_volte_available">true</bool>
|
||||
|
||||
<!-- Flag specifying whether VoLTE is available on device -->
|
||||
<bool name="config_device_vt_available">true</bool>
|
||||
|
||||
<!-- Enable video pause workaround when enabling/disabling the camera. -->
|
||||
<bool name="config_useVideoPauseWorkaround">true</bool>
|
||||
|
||||
<!-- Flag specifying whether WFC over IMS is availasble on device -->
|
||||
<bool name="config_device_wfc_ims_available">true</bool>
|
||||
|
||||
<!-- Configure mobile tcp buffer sizes in the form:
|
||||
rat-name:rmem_min,rmem_def,rmem_max,wmem_min,wmem_def,wmem_max
|
||||
If no value is found for the rat-name in use, the system default will be applied.
|
||||
-->
|
||||
<string-array name="config_mobile_tcp_buffers">
|
||||
<item>umts:131072,262144,1452032,4096,16384,399360</item>
|
||||
<item>hspa:131072,262144,2441216,4096,16384,399360</item>
|
||||
<item>hsupa:131072,262144,2441216,4096,16384,399360</item>
|
||||
<item>hsdpa:131072,262144,2441216,4096,16384,399360</item>
|
||||
<item>hspap:131072,262144,2441216,4096,16384,399360</item>
|
||||
<item>edge:16384,32768,131072,4096,16384,65536</item>
|
||||
<item>gprs:4096,8192,24576,4096,8192,24576</item>
|
||||
<item>1xrtt:16384,32768,131070,4096,16384,102400</item>
|
||||
<item>evdo:131072,262144,1048576,4096,16384,524288</item>
|
||||
<item>lte:524288,1048576,8388608,262144,524288,4194304</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Configure wifi tcp buffersizes in the form:
|
||||
rmem_min,rmem_def,rmem_max,wmem_min,wmem_def,wmem_max -->
|
||||
<string name="config_wifi_tcp_buffers" translatable="false">524288,2097152,8388608,262144,524288,4194304</string>
|
||||
|
||||
<!-- Idle Receive current for wifi radio. 0 by default-->
|
||||
<integer translatable="false" name="config_wifi_idle_receive_cur_ma">1</integer>
|
||||
|
||||
<!-- Rx current for wifi radio. 0 by default-->
|
||||
<integer translatable="false" name="config_wifi_active_rx_cur_ma">100</integer>
|
||||
|
||||
<!-- Tx current for wifi radio. 0 by default-->
|
||||
<integer translatable="false" name="config_wifi_tx_cur_ma">250</integer>
|
||||
|
||||
<!-- Operating volatage for wifi radio. 0 by default-->
|
||||
<integer translatable="false" name="config_wifi_operating_voltage_mv">3800</integer>
|
||||
|
||||
<!-- Config SoftAP 2G channel list -->
|
||||
<string translatable="false" name="config_wifi_framework_sap_2G_channel_list">6</string>
|
||||
|
||||
<!-- Config determines whether to update phone object when voice registration
|
||||
state changes. Voice radio tech change will always trigger an update of
|
||||
phone object irrespective of this config -->
|
||||
<bool name="config_switch_phone_on_voice_reg_state_change">false</bool>
|
||||
|
||||
|
||||
<!-- Use ERI text for network name on CDMA LTE -->
|
||||
<bool name="config_LTE_eri_for_network_name">false</bool>
|
||||
|
||||
<!-- Default list of files pinned by the Pinner Service -->
|
||||
<string-array translatable="false" name="config_defaultPinnerServiceFiles">
|
||||
<item>"/system/framework/arm64/boot-framework.oat"</item>
|
||||
<item>"/system/framework/arm64/boot-framework.vdex"</item>
|
||||
<item>"/system/framework/oat/arm64/services.odex"</item>
|
||||
<item>"/system/framework/oat/arm64/services.vdex"</item>
|
||||
<item>"/system/framework/arm64/boot.oat"</item>
|
||||
<item>"/system/framework/arm64/boot.vdex"</item>
|
||||
<item>"/system/framework/arm64/boot-core-libart.oat"</item>
|
||||
<item>"/system/framework/arm64/boot-core-libart.vdex"</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Should the pinner service pin the Camera application? -->
|
||||
<bool name="config_pinnerCameraApp">true</bool>
|
||||
|
||||
<!-- Enable system navigation keys. -->
|
||||
<bool name="config_supportSystemNavigationKeys">true</bool>
|
||||
|
||||
<!-- If this is true, device supports Sustained Performance Mode. -->
|
||||
<bool name="config_sustainedPerformanceModeSupported">true</bool>
|
||||
|
||||
<!-- True if Unprocessed audio source supports the required frequency range and level -->
|
||||
<bool name="config_supportAudioSourceUnprocessed">true</bool>
|
||||
|
||||
<!-- Colon separated list of package names that should be granted DND access -->
|
||||
<string name="config_defaultDndAccessPackages" translatable="false">com.google.android.GoogleCamera:com.google.intelligence.sense:com.google.android.apps.location.context.activity.zen</string>
|
||||
</resources>
|
||||
25
overlay/frameworks/base/core/res/res/values/strings.xml
Normal file
25
overlay/frameworks/base/core/res/res/values/strings.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright 2017, The Android Open Source Project
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
*/
|
||||
-->
|
||||
|
||||
<!-- These resources are around just to allow their values to be customized
|
||||
for different hardware and product builds. Do not translate. -->
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<!-- Do not translate. Default access point SSID used for tethering -->
|
||||
<string name="wifi_tether_configure_ssid_default" translatable="false">Pixel</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright 2017, The Android Open Source Project
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
*/
|
||||
-->
|
||||
|
||||
<!-- These resources are around just to allow their values to be customized
|
||||
for different hardware and product builds. -->
|
||||
<resources>
|
||||
<!-- Doze: does this device support STATE_DOZE? -->
|
||||
<bool name="doze_display_state_supported">true</bool>
|
||||
|
||||
<!-- Doze: does this device support STATE_DOZE_SUSPEND? -->
|
||||
<bool name="doze_suspend_display_state_supported">false</bool>
|
||||
|
||||
<!-- Type of a sensor that provides a low-power estimate of the desired display
|
||||
brightness, suitable to listen to while the device is asleep (e.g. during
|
||||
always-on display) -->
|
||||
<string name="doze_brightness_sensor_type" translatable="false">com.google.sensor.binned_brightness</string>
|
||||
|
||||
<!-- Doze: can we assume the pickup sensor includes a proximity check? -->
|
||||
<bool name="doze_pickup_performs_proximity_check">true</bool>
|
||||
|
||||
<!-- Doze: whether the double tap sensor reports 2D touch coordinates -->
|
||||
<bool name="doze_double_tap_reports_touch_coordinates">true</bool>
|
||||
</resources>
|
||||
32
overlay/packages/apps/Bluetooth/res/values/config.xml
Normal file
32
overlay/packages/apps/Bluetooth/res/values/config.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of The Linux Foundation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
<resources>
|
||||
<bool name="profile_supported_sap">true</bool>
|
||||
</resources>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright 2017, The Android Open Source Project
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
*/
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<string name="wifi_calling_settings_title">WLAN Call</string>
|
||||
</resources>
|
||||
20
overlay/packages/apps/Settings/res/values/bools.xml
Executable file
20
overlay/packages/apps/Settings/res/values/bools.xml
Executable file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2017 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<!-- Whether to show a preference item for mobile plan -->
|
||||
<bool name="config_show_mobile_plan">false</bool>
|
||||
</resources>
|
||||
22
overlay/packages/services/Telephony/res/values/config.xml
Normal file
22
overlay/packages/services/Telephony/res/values/config.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2017 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.
|
||||
-->
|
||||
|
||||
<!-- Phone app resources that may need to be customized
|
||||
for different hardware or product builds. -->
|
||||
<resources>
|
||||
<!-- Allow handover from telephony calls to another ConnectionService. -->
|
||||
<bool name="config_support_handover_from">true</bool>
|
||||
</resources>
|
||||
1
p2p_supplicant_overlay.conf
Normal file
1
p2p_supplicant_overlay.conf
Normal file
@@ -0,0 +1 @@
|
||||
disable_scan_offload=1
|
||||
58
power/Android.mk
Normal file
58
power/Android.mk
Normal file
@@ -0,0 +1,58 @@
|
||||
# Copyright (C) 2017 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||
LOCAL_PROPRIETARY_MODULE := true
|
||||
LOCAL_MODULE_OWNER := qcom
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
|
||||
LOCAL_MODULE := android.hardware.power@1.1-service.wahoo
|
||||
LOCAL_INIT_RC := android.hardware.power@1.1-service.wahoo.rc
|
||||
LOCAL_SRC_FILES := service.cpp \
|
||||
Power.cpp \
|
||||
InteractionHandler.cpp \
|
||||
power-helper.c \
|
||||
metadata-parser.c \
|
||||
utils.c \
|
||||
list.c \
|
||||
hint-data.c \
|
||||
powerhintparser.c
|
||||
|
||||
LOCAL_C_INCLUDES := external/libxml2/include \
|
||||
external/icu/icu4c/source/common
|
||||
|
||||
# Include target-specific files.
|
||||
LOCAL_SRC_FILES += power-8998.c
|
||||
|
||||
|
||||
# Enable interaction boost all the time
|
||||
LOCAL_CFLAGS += -DINTERACTION_BOOST -Werror
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libbase \
|
||||
liblog \
|
||||
libcutils \
|
||||
libdl \
|
||||
libxml2 \
|
||||
libhidlbase \
|
||||
libhidltransport \
|
||||
libhardware \
|
||||
libutils \
|
||||
android.hardware.power@1.1 \
|
||||
|
||||
include $(BUILD_EXECUTABLE)
|
||||
258
power/InteractionHandler.cpp
Normal file
258
power/InteractionHandler.cpp
Normal file
@@ -0,0 +1,258 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
//#define LOG_NDEBUG 0
|
||||
|
||||
#define LOG_TAG "PowerInteractionHandler"
|
||||
#define ATRACE_TAG (ATRACE_TAG_POWER | ATRACE_TAG_HAL)
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <poll.h>
|
||||
#include <sys/eventfd.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <utils/Log.h>
|
||||
#include <utils/Trace.h>
|
||||
|
||||
#include "InteractionHandler.h"
|
||||
#include "power-common.h"
|
||||
#include "power-helper.h"
|
||||
#include "powerhintparser.h"
|
||||
#include "hint-data.h"
|
||||
#include "utils.h"
|
||||
|
||||
#define FB_IDLE_PATH "/sys/class/graphics/fb0/idle_state"
|
||||
#define MAX_LENGTH 64
|
||||
|
||||
#define MSINSEC 1000L
|
||||
#define USINMS 1000000L
|
||||
|
||||
InteractionHandler::InteractionHandler()
|
||||
: mState(INTERACTION_STATE_UNINITIALIZED),
|
||||
mWaitMs(100),
|
||||
mMinDurationMs(1400),
|
||||
mMaxDurationMs(5650),
|
||||
mDurationMs(0) {
|
||||
}
|
||||
|
||||
InteractionHandler::~InteractionHandler() {
|
||||
Exit();
|
||||
}
|
||||
|
||||
bool InteractionHandler::Init() {
|
||||
std::lock_guard<std::mutex> lk(mLock);
|
||||
|
||||
if (mState != INTERACTION_STATE_UNINITIALIZED)
|
||||
return true;
|
||||
|
||||
mIdleFd = open(FB_IDLE_PATH, O_RDONLY);
|
||||
if (mIdleFd < 0) {
|
||||
ALOGE("Unable to open idle state path (%d)", errno);
|
||||
return false;
|
||||
}
|
||||
|
||||
mEventFd = eventfd(0, EFD_NONBLOCK);
|
||||
if (mEventFd < 0) {
|
||||
ALOGE("Unable to create event fd (%d)", errno);
|
||||
close(mIdleFd);
|
||||
return false;
|
||||
}
|
||||
|
||||
mState = INTERACTION_STATE_IDLE;
|
||||
mThread = std::unique_ptr<std::thread>(
|
||||
new std::thread(&InteractionHandler::Routine, this));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void InteractionHandler::Exit() {
|
||||
std::unique_lock<std::mutex> lk(mLock);
|
||||
if (mState == INTERACTION_STATE_UNINITIALIZED)
|
||||
return;
|
||||
|
||||
AbortWaitLocked();
|
||||
mState = INTERACTION_STATE_UNINITIALIZED;
|
||||
lk.unlock();
|
||||
|
||||
mCond.notify_all();
|
||||
mThread->join();
|
||||
|
||||
close(mEventFd);
|
||||
close(mIdleFd);
|
||||
}
|
||||
|
||||
void InteractionHandler::PerfLock() {
|
||||
int *resource_values;
|
||||
int num_resources;
|
||||
|
||||
resource_values = getPowerhint(INTERACTION_HINT_ID, &num_resources);
|
||||
if (resource_values != NULL) {
|
||||
ALOGV("%s: acquiring perf lock", __func__);
|
||||
perform_hint_action(INTERACTION_HINT_ID,
|
||||
resource_values, num_resources);
|
||||
|
||||
ATRACE_INT("interaction_lock", 1);
|
||||
}
|
||||
}
|
||||
|
||||
void InteractionHandler::PerfRel() {
|
||||
ALOGV("%s: releasing perf lock", __func__);
|
||||
undo_hint_action(INTERACTION_HINT_ID);
|
||||
ATRACE_INT("interaction_lock", 0);
|
||||
}
|
||||
|
||||
long long InteractionHandler::CalcTimespecDiffMs(struct timespec start,
|
||||
struct timespec end) {
|
||||
long long diff_in_us = 0;
|
||||
diff_in_us += (end.tv_sec - start.tv_sec) * MSINSEC;
|
||||
diff_in_us += (end.tv_nsec - start.tv_nsec) / USINMS;
|
||||
return diff_in_us;
|
||||
}
|
||||
|
||||
void InteractionHandler::Acquire(int32_t duration) {
|
||||
if (is_perf_hint_active(SUSTAINED_PERF_HINT_ID) ||
|
||||
is_perf_hint_active(VR_MODE_HINT_ID)) {
|
||||
ALOGV("%s: ignoring due to other active perf hints", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
ATRACE_CALL();
|
||||
|
||||
std::lock_guard<std::mutex> lk(mLock);
|
||||
if (mState == INTERACTION_STATE_UNINITIALIZED) {
|
||||
ALOGW("%s: called while uninitialized", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
int inputDuration = duration + 650;
|
||||
int finalDuration;
|
||||
if (inputDuration > mMaxDurationMs)
|
||||
finalDuration = mMaxDurationMs;
|
||||
else if (inputDuration > mMinDurationMs)
|
||||
finalDuration = inputDuration;
|
||||
else
|
||||
finalDuration = mMinDurationMs;
|
||||
|
||||
struct timespec cur_timespec;
|
||||
clock_gettime(CLOCK_MONOTONIC, &cur_timespec);
|
||||
if (mState != INTERACTION_STATE_IDLE && finalDuration <= mDurationMs) {
|
||||
long long elapsed_time = CalcTimespecDiffMs(mLastTimespec, cur_timespec);
|
||||
// don't hint if previous hint's duration covers this hint's duration
|
||||
if (elapsed_time <= (mDurationMs - finalDuration)) {
|
||||
ALOGV("%s: Previous duration (%d) cover this (%d) elapsed: %lld",
|
||||
__func__, mDurationMs, finalDuration, elapsed_time);
|
||||
return;
|
||||
}
|
||||
}
|
||||
mLastTimespec = cur_timespec;
|
||||
mDurationMs = finalDuration;
|
||||
|
||||
ALOGV("%s: input: %d final duration: %d", __func__,
|
||||
duration, finalDuration);
|
||||
|
||||
if (mState == INTERACTION_STATE_WAITING)
|
||||
AbortWaitLocked();
|
||||
else if (mState == INTERACTION_STATE_IDLE)
|
||||
PerfLock();
|
||||
|
||||
mState = INTERACTION_STATE_INTERACTION;
|
||||
mCond.notify_one();
|
||||
}
|
||||
|
||||
void InteractionHandler::Release() {
|
||||
std::lock_guard<std::mutex> lk(mLock);
|
||||
if (mState == INTERACTION_STATE_WAITING) {
|
||||
ATRACE_CALL();
|
||||
PerfRel();
|
||||
mState = INTERACTION_STATE_IDLE;
|
||||
} else {
|
||||
// clear any wait aborts pending in event fd
|
||||
uint64_t val;
|
||||
ssize_t ret = read(mEventFd, &val, sizeof(val));
|
||||
|
||||
ALOGW_IF(ret < 0, "%s: failed to clear eventfd (%zd, %d)",
|
||||
__func__, ret, errno);
|
||||
}
|
||||
}
|
||||
|
||||
// should be called while locked
|
||||
void InteractionHandler::AbortWaitLocked() {
|
||||
uint64_t val = 1;
|
||||
ssize_t ret = write(mEventFd, &val, sizeof(val));
|
||||
if (ret != sizeof(val))
|
||||
ALOGW("Unable to write to event fd (%zd)", ret);
|
||||
}
|
||||
|
||||
void InteractionHandler::WaitForIdle(int32_t wait_ms, int32_t timeout_ms) {
|
||||
char data[MAX_LENGTH];
|
||||
ssize_t ret;
|
||||
struct pollfd pfd[2];
|
||||
|
||||
ATRACE_CALL();
|
||||
|
||||
ALOGV("%s: wait:%d timeout:%d", __func__, wait_ms, timeout_ms);
|
||||
|
||||
pfd[0].fd = mEventFd;
|
||||
pfd[0].events = POLLIN;
|
||||
pfd[1].fd = mIdleFd;
|
||||
pfd[1].events = POLLPRI | POLLERR;
|
||||
|
||||
ret = poll(pfd, 1, wait_ms);
|
||||
if (ret > 0) {
|
||||
ALOGV("%s: wait aborted", __func__);
|
||||
return;
|
||||
} else if (ret < 0) {
|
||||
ALOGE("%s: error in poll while waiting", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
ret = pread(mIdleFd, data, sizeof(data), 0);
|
||||
if (!ret) {
|
||||
ALOGE("%s: Unexpected EOF!", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strncmp(data, "idle", 4)) {
|
||||
ALOGV("%s: already idle", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
ret = poll(pfd, 2, timeout_ms);
|
||||
if (ret < 0)
|
||||
ALOGE("%s: Error on waiting for idle (%zd)", __func__, ret);
|
||||
else if (ret == 0)
|
||||
ALOGV("%s: timed out waiting for idle", __func__);
|
||||
else if (pfd[0].revents)
|
||||
ALOGV("%s: wait for idle aborted", __func__);
|
||||
else if (pfd[1].revents)
|
||||
ALOGV("%s: idle detected", __func__);
|
||||
}
|
||||
|
||||
void InteractionHandler::Routine() {
|
||||
std::unique_lock<std::mutex> lk(mLock, std::defer_lock);
|
||||
|
||||
while (true) {
|
||||
lk.lock();
|
||||
mCond.wait(lk, [&] { return mState != INTERACTION_STATE_IDLE; });
|
||||
if (mState == INTERACTION_STATE_UNINITIALIZED)
|
||||
return;
|
||||
mState = INTERACTION_STATE_WAITING;
|
||||
lk.unlock();
|
||||
|
||||
WaitForIdle(mWaitMs, mDurationMs);
|
||||
Release();
|
||||
}
|
||||
}
|
||||
67
power/InteractionHandler.h
Normal file
67
power/InteractionHandler.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright (C) 2017 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 INTERACTIONHANDLER_H
|
||||
#define INTERACTIONHANDLER_H
|
||||
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
|
||||
enum interaction_state {
|
||||
INTERACTION_STATE_UNINITIALIZED,
|
||||
INTERACTION_STATE_IDLE,
|
||||
INTERACTION_STATE_INTERACTION,
|
||||
INTERACTION_STATE_WAITING,
|
||||
};
|
||||
|
||||
struct InteractionHandler {
|
||||
InteractionHandler();
|
||||
~InteractionHandler();
|
||||
bool Init();
|
||||
void Exit();
|
||||
void Acquire(int32_t duration);
|
||||
|
||||
private:
|
||||
void Release();
|
||||
void WaitForIdle(int32_t wait_ms, int32_t timeout_ms);
|
||||
void AbortWaitLocked();
|
||||
void Routine();
|
||||
|
||||
void PerfLock();
|
||||
void PerfRel();
|
||||
|
||||
long long CalcTimespecDiffMs(struct timespec start, struct timespec end);
|
||||
|
||||
enum interaction_state mState;
|
||||
|
||||
int mIdleFd;
|
||||
int mEventFd;
|
||||
|
||||
int32_t mWaitMs;
|
||||
int32_t mMinDurationMs;
|
||||
int32_t mMaxDurationMs;
|
||||
int32_t mDurationMs;
|
||||
|
||||
struct timespec mLastTimespec;
|
||||
|
||||
std::unique_ptr<std::thread> mThread;
|
||||
std::mutex mLock;
|
||||
std::condition_variable mCond;
|
||||
};
|
||||
|
||||
#endif //INTERACTIONHANDLER_H
|
||||
|
||||
209
power/Power.cpp
Normal file
209
power/Power.cpp
Normal file
@@ -0,0 +1,209 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "android.hardware.power@1.1-service.wahoo"
|
||||
|
||||
#include <android/log.h>
|
||||
#include <android-base/file.h>
|
||||
#include <android-base/properties.h>
|
||||
#include <android-base/strings.h>
|
||||
#include <utils/Log.h>
|
||||
#include "Power.h"
|
||||
#include "power-common.h"
|
||||
#include "power-helper.h"
|
||||
|
||||
/* RPM runs at 19.2Mhz. Divide by 19200 for msec */
|
||||
#define RPM_CLK 19200
|
||||
|
||||
extern struct stat_pair rpm_stat_map[];
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace power {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::power::V1_0::Feature;
|
||||
using ::android::hardware::power::V1_0::PowerHint;
|
||||
using ::android::hardware::power::V1_0::PowerStatePlatformSleepState;
|
||||
using ::android::hardware::power::V1_0::Status;
|
||||
using ::android::hardware::power::V1_1::PowerStateSubsystem;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
|
||||
Power::Power() {
|
||||
power_init();
|
||||
mInteractionHandler.Init();
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::power::V1_0::IPower follow.
|
||||
Return<void> Power::setInteractive(bool interactive) {
|
||||
if (!isSupportedGovernor()) {
|
||||
return Void();
|
||||
}
|
||||
power_set_interactive(interactive ? 1 : 0);
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> Power::powerHint(PowerHint hint, int32_t data) {
|
||||
if (android::base::GetProperty("init.svc.perfd", "") != "running") {
|
||||
ALOGW("perfd is not started");
|
||||
return Void();
|
||||
}
|
||||
|
||||
power_hint_t h = static_cast<power_hint_t>(hint);
|
||||
if (!isSupportedGovernor()) {
|
||||
return Void();
|
||||
}
|
||||
if (h == POWER_HINT_INTERACTION) {
|
||||
mInteractionHandler.Acquire(data);
|
||||
return Void();
|
||||
}
|
||||
power_hint(h, data ? &data : NULL);
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> Power::setFeature(Feature /*feature*/, bool /*activate*/) {
|
||||
//Nothing to do
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> Power::getPlatformLowPowerStats(getPlatformLowPowerStats_cb _hidl_cb) {
|
||||
|
||||
hidl_vec<PowerStatePlatformSleepState> states;
|
||||
uint64_t stats[MAX_PLATFORM_STATS * MAX_RPM_PARAMS] = {0};
|
||||
uint64_t *values;
|
||||
struct PowerStatePlatformSleepState *state;
|
||||
int ret;
|
||||
|
||||
states.resize(PLATFORM_SLEEP_MODES_COUNT);
|
||||
|
||||
ret = extract_platform_stats(stats);
|
||||
if (ret != 0) {
|
||||
states.resize(0);
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Update statistics for XO_shutdown */
|
||||
state = &states[RPM_MODE_XO];
|
||||
state->name = "XO_shutdown";
|
||||
values = stats + (RPM_MODE_XO * MAX_RPM_PARAMS);
|
||||
|
||||
state->residencyInMsecSinceBoot = values[1];
|
||||
state->totalTransitions = values[0];
|
||||
state->supportedOnlyInSuspend = false;
|
||||
state->voters.resize(XO_VOTERS);
|
||||
for(size_t i = 0; i < XO_VOTERS; i++) {
|
||||
int voter = static_cast<int>(i + XO_VOTERS_START);
|
||||
state->voters[i].name = rpm_stat_map[voter].label;
|
||||
values = stats + (voter * MAX_RPM_PARAMS);
|
||||
state->voters[i].totalTimeInMsecVotedForSinceBoot = values[0] / RPM_CLK;
|
||||
state->voters[i].totalNumberOfTimesVotedSinceBoot = values[1];
|
||||
}
|
||||
|
||||
/* Update statistics for VMIN state */
|
||||
state = &states[RPM_MODE_VMIN];
|
||||
state->name = "VMIN";
|
||||
values = stats + (RPM_MODE_VMIN * MAX_RPM_PARAMS);
|
||||
|
||||
state->residencyInMsecSinceBoot = values[1];
|
||||
state->totalTransitions = values[0];
|
||||
state->supportedOnlyInSuspend = false;
|
||||
state->voters.resize(VMIN_VOTERS);
|
||||
//Note: No filling of state voters since VMIN_VOTERS = 0
|
||||
|
||||
done:
|
||||
_hidl_cb(states, Status::SUCCESS);
|
||||
return Void();
|
||||
}
|
||||
|
||||
static int get_wlan_low_power_stats(struct PowerStateSubsystem &subsystem) {
|
||||
|
||||
uint64_t stats[WLAN_POWER_PARAMS_COUNT] = {0};
|
||||
struct PowerStateSubsystemSleepState *state;
|
||||
int ret;
|
||||
|
||||
ret = extract_wlan_stats(stats);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
subsystem.name = "wlan";
|
||||
subsystem.states.resize(WLAN_STATES_COUNT);
|
||||
|
||||
/* Update statistics for Active State */
|
||||
state = &subsystem.states[WLAN_STATE_ACTIVE];
|
||||
state->name = "Active";
|
||||
state->residencyInMsecSinceBoot = stats[CUMULATIVE_TOTAL_ON_TIME_MS];
|
||||
state->totalTransitions = stats[DEEP_SLEEP_ENTER_COUNTER];
|
||||
state->lastEntryTimestampMs = 0; //FIXME need a new value from Qcom
|
||||
state->supportedOnlyInSuspend = false;
|
||||
|
||||
/* Update statistics for Deep-Sleep state */
|
||||
state = &subsystem.states[WLAN_STATE_DEEP_SLEEP];
|
||||
state->name = "Deep-Sleep";
|
||||
state->residencyInMsecSinceBoot = stats[CUMULATIVE_SLEEP_TIME_MS];
|
||||
state->totalTransitions = stats[DEEP_SLEEP_ENTER_COUNTER];
|
||||
state->lastEntryTimestampMs = stats[LAST_DEEP_SLEEP_ENTER_TSTAMP_MS];
|
||||
state->supportedOnlyInSuspend = false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::power::V1_1::IPower follow.
|
||||
Return<void> Power::getSubsystemLowPowerStats(getSubsystemLowPowerStats_cb _hidl_cb) {
|
||||
|
||||
hidl_vec<PowerStateSubsystem> subsystems;
|
||||
int ret;
|
||||
|
||||
subsystems.resize(SUBSYSTEM_COUNT);
|
||||
|
||||
//We currently have only one Subsystem for WLAN
|
||||
ret = get_wlan_low_power_stats(subsystems[SUBSYSTEM_WLAN]);
|
||||
if (ret != 0)
|
||||
goto done;
|
||||
|
||||
//Add query for other subsystems here
|
||||
|
||||
done:
|
||||
_hidl_cb(subsystems, Status::SUCCESS);
|
||||
return Void();
|
||||
}
|
||||
|
||||
bool Power::isSupportedGovernor() {
|
||||
std::string buf;
|
||||
if (android::base::ReadFileToString(SCALING_GOVERNOR_PATH, &buf)) {
|
||||
buf = android::base::Trim(buf);
|
||||
}
|
||||
// Only support EAS 1.2, legacy EAS and HMP
|
||||
if (buf == SCHEDUTIL_GOVERNOR || buf == SCHED_GOVERNOR || buf == INTERACTIVE_GOVERNOR) {
|
||||
return true;
|
||||
} else {
|
||||
ALOGE("Governor not supported by powerHAL, skipping");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Return<void> Power::powerHintAsync(PowerHint hint, int32_t data) {
|
||||
// just call the normal power hint in this oneway function
|
||||
return powerHint(hint, data);
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace power
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
67
power/Power.h
Normal file
67
power/Power.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright (C) 2017 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_HARDWARE_POWER_V1_1_POWER_H
|
||||
#define ANDROID_HARDWARE_POWER_V1_1_POWER_H
|
||||
|
||||
#include <android/hardware/power/1.1/IPower.h>
|
||||
#include <hidl/MQDescriptor.h>
|
||||
#include <hidl/Status.h>
|
||||
#include <hardware/power.h>
|
||||
|
||||
#include "InteractionHandler.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace power {
|
||||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::power::V1_0::Feature;
|
||||
using ::android::hardware::power::V1_0::PowerHint;
|
||||
using ::android::hardware::power::V1_1::IPower;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::InteractionHandler;
|
||||
|
||||
struct Power : public IPower {
|
||||
// Methods from ::android::hardware::power::V1_0::IPower follow.
|
||||
|
||||
Power();
|
||||
|
||||
Return<void> setInteractive(bool interactive) override;
|
||||
Return<void> powerHint(PowerHint hint, int32_t data) override;
|
||||
Return<void> setFeature(Feature feature, bool activate) override;
|
||||
Return<void> getPlatformLowPowerStats(getPlatformLowPowerStats_cb _hidl_cb) override;
|
||||
|
||||
// Methods from ::android::hardware::power::V1_1::IPower follow.
|
||||
Return<void> getSubsystemLowPowerStats(getSubsystemLowPowerStats_cb _hidl_cb) override;
|
||||
Return<void> powerHintAsync(PowerHint hint, int32_t data) override;
|
||||
|
||||
// Methods from ::android::hidl::base::V1_0::IBase follow.
|
||||
|
||||
private:
|
||||
InteractionHandler mInteractionHandler;
|
||||
static bool isSupportedGovernor();
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_1
|
||||
} // namespace power
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_POWER_V1_1_POWER_H
|
||||
4
power/android.hardware.power@1.1-service.wahoo.rc
Normal file
4
power/android.hardware.power@1.1-service.wahoo.rc
Normal file
@@ -0,0 +1,4 @@
|
||||
service power-hal-1-1 /vendor/bin/hw/android.hardware.power@1.1-service.wahoo
|
||||
class hal
|
||||
user system
|
||||
group system
|
||||
49
power/hint-data.c
Normal file
49
power/hint-data.c
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) 2012, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <utils/Log.h>
|
||||
|
||||
#include "hint-data.h"
|
||||
|
||||
int hint_compare(struct hint_data *first_hint,
|
||||
struct hint_data *other_hint) {
|
||||
if (first_hint == other_hint) {
|
||||
return 0;
|
||||
} else if ((first_hint && other_hint) &&
|
||||
(first_hint->hint_id == other_hint->hint_id)) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
void hint_dump(struct hint_data *hint)
|
||||
{
|
||||
ALOGV("hint_id: %lu", hint->hint_id);
|
||||
}
|
||||
49
power/hint-data.h
Normal file
49
power/hint-data.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) 2012, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* Default use-case hint IDs */
|
||||
#define DEFAULT_VIDEO_ENCODE_HINT_ID (0x0A00)
|
||||
#define DEFAULT_VIDEO_DECODE_HINT_ID (0x0B00)
|
||||
#define DISPLAY_STATE_HINT_ID (0x0C00)
|
||||
#define DISPLAY_STATE_HINT_ID_2 (0x0D00)
|
||||
#define CAM_PREVIEW_HINT_ID (0x0E00)
|
||||
#define SUSTAINED_PERF_HINT_ID (0x0F00)
|
||||
#define VR_MODE_HINT_ID (0x1000)
|
||||
#define VR_MODE_SUSTAINED_PERF_HINT_ID (0x1001)
|
||||
#define INTERACTION_HINT_ID (0x1A00)
|
||||
#define BOOST_HINT_ID (0x1B00)
|
||||
|
||||
struct hint_data {
|
||||
unsigned long hint_id; /* This is our key. */
|
||||
unsigned long perflock_handle;
|
||||
};
|
||||
|
||||
int hint_compare(struct hint_data *first_hint,
|
||||
struct hint_data *other_hint);
|
||||
void hint_dump(struct hint_data *hint);
|
||||
145
power/list.c
Normal file
145
power/list.c
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
* Copyright (c) 2012, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "list.h"
|
||||
#include <utils/Log.h>
|
||||
|
||||
int init_list_head(struct list_node *head)
|
||||
{
|
||||
if (head == NULL)
|
||||
return -1;
|
||||
|
||||
memset(head, 0, sizeof(*head));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct list_node *add_list_node(struct list_node *head, void *data)
|
||||
{
|
||||
/* Create a new list_node. And put 'data' into it. */
|
||||
struct list_node *new_node;
|
||||
|
||||
if (head == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!(new_node = malloc(sizeof(struct list_node)))) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
new_node->data = data;
|
||||
new_node->next = head->next;
|
||||
new_node->compare = head->compare;
|
||||
new_node->dump = head->dump;
|
||||
head->next = new_node;
|
||||
|
||||
return new_node;
|
||||
}
|
||||
|
||||
int is_list_empty(struct list_node *head)
|
||||
{
|
||||
return (head == NULL || head->next == NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Delink and de-allocate 'node'.
|
||||
*/
|
||||
int remove_list_node(struct list_node *head, struct list_node *del_node)
|
||||
{
|
||||
struct list_node *current_node;
|
||||
struct list_node *saved_node;
|
||||
|
||||
if (head == NULL || head->next == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
current_node = head->next;
|
||||
saved_node = head;
|
||||
|
||||
while (current_node && current_node != del_node) {
|
||||
saved_node = current_node;
|
||||
current_node = current_node->next;
|
||||
}
|
||||
|
||||
if (saved_node) {
|
||||
if (current_node) {
|
||||
saved_node->next = current_node->next;
|
||||
} else {
|
||||
/* Node not found. */
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (del_node) {
|
||||
free(del_node);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void dump_list(struct list_node *head)
|
||||
{
|
||||
struct list_node *current_node = head;
|
||||
|
||||
if (head == NULL)
|
||||
return;
|
||||
|
||||
ALOGV("List:\n");
|
||||
|
||||
while ((current_node = current_node->next)) {
|
||||
if (current_node->dump) {
|
||||
current_node->dump(current_node->data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct list_node *find_node(struct list_node *head, void *comparison_data)
|
||||
{
|
||||
struct list_node *current_node = head;
|
||||
|
||||
if (head == NULL)
|
||||
return NULL;
|
||||
|
||||
while ((current_node = current_node->next)) {
|
||||
if (current_node->compare) {
|
||||
if (current_node->compare(current_node->data,
|
||||
comparison_data) == 0) {
|
||||
/* Match found. Return current_node. */
|
||||
return current_node;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* No match found. */
|
||||
return NULL;
|
||||
}
|
||||
41
power/list.h
Normal file
41
power/list.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (c) 2012, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
struct list_node {
|
||||
struct list_node *next;
|
||||
void *data;
|
||||
int (*compare)(void *data1, void *data2);
|
||||
void (*dump)(void *data);
|
||||
};
|
||||
|
||||
int init_list_head(struct list_node *head);
|
||||
struct list_node * add_list_node(struct list_node *head, void *data);
|
||||
int remove_list_node(struct list_node *head, struct list_node *del_node);
|
||||
void dump_list(struct list_node *head);
|
||||
struct list_node *find_node(struct list_node *head, void *comparison_data);
|
||||
54
power/metadata-defs.h
Normal file
54
power/metadata-defs.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#define ATTRIBUTE_VALUE_DELIM ('=')
|
||||
#define ATTRIBUTE_STRING_DELIM (";")
|
||||
|
||||
#define METADATA_PARSING_ERR (-1)
|
||||
#define METADATA_PARSING_CONTINUE (0)
|
||||
#define METADATA_PARSING_DONE (1)
|
||||
|
||||
#define MIN(x,y) (((x)>(y))?(y):(x))
|
||||
|
||||
struct video_encode_metadata_t {
|
||||
int hint_id;
|
||||
int state;
|
||||
};
|
||||
|
||||
struct video_decode_metadata_t {
|
||||
int hint_id;
|
||||
int state;
|
||||
};
|
||||
|
||||
int parse_metadata(char *metadata, char **metadata_saveptr,
|
||||
char *attribute, unsigned int attribute_size, char *value, unsigned int value_size);
|
||||
int parse_video_encode_metadata(char *metadata,
|
||||
struct video_encode_metadata_t *video_encode_metadata);
|
||||
int parse_video_decode_metadata(char *metadata,
|
||||
struct video_decode_metadata_t *video_decode_metadata);
|
||||
126
power/metadata-parser.c
Normal file
126
power/metadata-parser.c
Normal file
@@ -0,0 +1,126 @@
|
||||
/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "metadata-defs.h"
|
||||
|
||||
int parse_metadata(char *metadata, char **metadata_saveptr,
|
||||
char *attribute, unsigned int attribute_size, char *value, unsigned int value_size)
|
||||
{
|
||||
char *attribute_string;
|
||||
char *attribute_value_delim;
|
||||
unsigned int bytes_to_copy;
|
||||
|
||||
attribute_string = strtok_r(metadata, ATTRIBUTE_STRING_DELIM,
|
||||
metadata_saveptr);
|
||||
|
||||
if (attribute_string == NULL)
|
||||
return METADATA_PARSING_DONE;
|
||||
|
||||
attribute[0] = value[0] = '\0';
|
||||
|
||||
if ((attribute_value_delim = strchr(attribute_string,
|
||||
ATTRIBUTE_VALUE_DELIM)) != NULL) {
|
||||
unsigned int attribute_len = (unsigned int) (attribute_value_delim - attribute_string);
|
||||
/* copy only attribute len + NUL character, or as much as can be fit */
|
||||
bytes_to_copy = MIN(attribute_len + 1, attribute_size);
|
||||
|
||||
strlcpy(attribute, attribute_string, bytes_to_copy);
|
||||
strlcpy(value, attribute_value_delim + 1, value_size);
|
||||
}
|
||||
|
||||
return METADATA_PARSING_CONTINUE;
|
||||
}
|
||||
|
||||
int parse_video_encode_metadata(char *metadata,
|
||||
struct video_encode_metadata_t *video_encode_metadata)
|
||||
{
|
||||
char attribute[1024], value[1024], *saveptr;
|
||||
char *temp_metadata = metadata;
|
||||
int parsing_status;
|
||||
|
||||
while ((parsing_status = parse_metadata(temp_metadata, &saveptr,
|
||||
attribute, sizeof(attribute), value, sizeof(value))) == METADATA_PARSING_CONTINUE) {
|
||||
if (strlen(attribute) == strlen("hint_id") &&
|
||||
(strncmp(attribute, "hint_id", strlen("hint_id")) == 0)) {
|
||||
if (strlen(value) > 0) {
|
||||
video_encode_metadata->hint_id = atoi(value);
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen(attribute) == strlen("state") &&
|
||||
(strncmp(attribute, "state", strlen("state")) == 0)) {
|
||||
if (strlen(value) > 0) {
|
||||
video_encode_metadata->state = atoi(value);
|
||||
}
|
||||
}
|
||||
|
||||
temp_metadata = NULL;
|
||||
}
|
||||
|
||||
if (parsing_status == METADATA_PARSING_ERR)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int parse_video_decode_metadata(char *metadata,
|
||||
struct video_decode_metadata_t *video_decode_metadata)
|
||||
{
|
||||
char attribute[1024], value[1024], *saveptr;
|
||||
char *temp_metadata = metadata;
|
||||
int parsing_status;
|
||||
|
||||
while ((parsing_status = parse_metadata(temp_metadata, &saveptr,
|
||||
attribute, sizeof(attribute), value, sizeof(value))) == METADATA_PARSING_CONTINUE) {
|
||||
if (strlen(attribute) == strlen("hint_id") &&
|
||||
(strncmp(attribute, "hint_id", strlen("hint_id")) == 0)) {
|
||||
if (strlen(value) > 0) {
|
||||
video_decode_metadata->hint_id = atoi(value);
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen(attribute) == strlen("state") &&
|
||||
(strncmp(attribute, "state", strlen("state")) == 0)) {
|
||||
if (strlen(value) > 0) {
|
||||
video_decode_metadata->state = atoi(value);
|
||||
}
|
||||
}
|
||||
|
||||
temp_metadata = NULL;
|
||||
}
|
||||
|
||||
if (parsing_status == METADATA_PARSING_ERR)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
264
power/performance.h
Executable file
264
power/performance.h
Executable file
@@ -0,0 +1,264 @@
|
||||
/* Copyright (c) 2012, 2014, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define FAILED -1
|
||||
#define SUCCESS 0
|
||||
#define INDEFINITE_DURATION 0
|
||||
|
||||
enum SCREEN_DISPLAY_TYPE {
|
||||
DISPLAY_OFF = 0x00FF,
|
||||
};
|
||||
|
||||
enum PWR_CLSP_TYPE {
|
||||
ALL_CPUS_PWR_CLPS_DIS = 0x101,
|
||||
};
|
||||
|
||||
/* For CPUx min freq, the leftmost byte
|
||||
* represents the CPU and the
|
||||
* rightmost byte represents the frequency
|
||||
* All intermediate frequencies on the
|
||||
* device are supported. The hex value
|
||||
* passed into PerfLock will be multiplied
|
||||
* by 10^5. This frequency or the next
|
||||
* highest frequency available will be set
|
||||
*
|
||||
* For example, if 1.4 Ghz is required on
|
||||
* CPU0, use 0x20E
|
||||
*
|
||||
* If the highest available frequency
|
||||
* on the device is required, use
|
||||
* CPUx_MIN_FREQ_TURBO_MAX
|
||||
* where x represents the CPU
|
||||
*/
|
||||
enum CPU0_MIN_FREQ_LVL {
|
||||
CPU0_MIN_FREQ_NONTURBO_MAX = 0x20A,
|
||||
CPU0_MIN_FREQ_TURBO_MAX = 0x2FE,
|
||||
};
|
||||
|
||||
enum CPU1_MIN_FREQ_LVL {
|
||||
CPU1_MIN_FREQ_NONTURBO_MAX = 0x30A,
|
||||
CPU1_MIN_FREQ_TURBO_MAX = 0x3FE,
|
||||
};
|
||||
|
||||
enum CPU2_MIN_FREQ_LVL {
|
||||
CPU2_MIN_FREQ_NONTURBO_MAX = 0x40A,
|
||||
CPU2_MIN_FREQ_TURBO_MAX = 0x4FE,
|
||||
};
|
||||
|
||||
enum CPU3_MIN_FREQ_LVL {
|
||||
CPU3_MIN_FREQ_NONTURBO_MAX = 0x50A,
|
||||
CPU3_MIN_FREQ_TURBO_MAX = 0x5FE,
|
||||
};
|
||||
|
||||
enum CPU0_MAX_FREQ_LVL {
|
||||
CPU0_MAX_FREQ_NONTURBO_MAX = 0x150A,
|
||||
};
|
||||
|
||||
enum CPU1_MAX_FREQ_LVL {
|
||||
CPU1_MAX_FREQ_NONTURBO_MAX = 0x160A,
|
||||
};
|
||||
|
||||
enum CPU2_MAX_FREQ_LVL {
|
||||
CPU2_MAX_FREQ_NONTURBO_MAX = 0x170A,
|
||||
};
|
||||
|
||||
enum CPU3_MAX_FREQ_LVL {
|
||||
CPU3_MAX_FREQ_NONTURBO_MAX = 0x180A,
|
||||
};
|
||||
|
||||
enum MIN_CPUS_ONLINE_LVL {
|
||||
CPUS_ONLINE_MIN_2 = 0x702,
|
||||
CPUS_ONLINE_MIN_3 = 0x703,
|
||||
CPUS_ONLINE_MIN_4 = 0x704,
|
||||
CPUS_ONLINE_MPD_OVERRIDE = 0x777,
|
||||
CPUS_ONLINE_MAX = 0x7FF,
|
||||
};
|
||||
|
||||
enum MAX_CPUS_ONLINE_LVL {
|
||||
CPUS_ONLINE_MAX_LIMIT_1 = 0x8FE,
|
||||
CPUS_ONLINE_MAX_LIMIT_2 = 0x8FD,
|
||||
CPUS_ONLINE_MAX_LIMIT_3 = 0x8FC,
|
||||
CPUS_ONLINE_MAX_LIMIT_4 = 0x8FB,
|
||||
CPUS_ONLINE_MAX_LIMIT_MAX = 0x8FB,
|
||||
};
|
||||
|
||||
enum SAMPLING_RATE_LVL {
|
||||
MS_500 = 0xBCD,
|
||||
MS_50 = 0xBFA,
|
||||
MS_20 = 0xBFD,
|
||||
};
|
||||
|
||||
enum ONDEMAND_IO_BUSY_LVL {
|
||||
IO_BUSY_OFF = 0xC00,
|
||||
IO_BUSY_ON = 0xC01,
|
||||
};
|
||||
|
||||
enum ONDEMAND_SAMPLING_DOWN_FACTOR_LVL {
|
||||
SAMPLING_DOWN_FACTOR_1 = 0xD01,
|
||||
SAMPLING_DOWN_FACTOR_4 = 0xD04,
|
||||
};
|
||||
|
||||
enum INTERACTIVE_TIMER_RATE_LVL {
|
||||
TR_MS_500 = 0xECD,
|
||||
TR_MS_100 = 0xEF5,
|
||||
TR_MS_50 = 0xEFA,
|
||||
TR_MS_30 = 0xEFC,
|
||||
TR_MS_20 = 0xEFD,
|
||||
};
|
||||
|
||||
/* This timer rate applicable to cpu0
|
||||
across 8939 series chipset */
|
||||
enum INTERACTIVE_TIMER_RATE_LVL_CPU0_8939 {
|
||||
TR_MS_CPU0_500 = 0x30CD,
|
||||
TR_MS_CPU0_100 = 0x30F5,
|
||||
TR_MS_CPU0_50 = 0x30FA,
|
||||
TR_MS_CPU0_30 = 0x30FC,
|
||||
TR_MS_CPU0_20 = 0x30FD,
|
||||
};
|
||||
|
||||
/* This timer rate applicable to cpu4
|
||||
across 8939 series chipset */
|
||||
enum INTERACTIVE_TIMER_RATE_LVL_CPU4_8939 {
|
||||
TR_MS_CPU4_500 = 0x3BCD,
|
||||
TR_MS_CPU4_100 = 0x3BF5,
|
||||
TR_MS_CPU4_50 = 0x3BFA,
|
||||
TR_MS_CPU4_30 = 0x3BFC,
|
||||
TR_MS_CPU4_20 = 0x3BFD,
|
||||
};
|
||||
|
||||
/* This timer rate applicable to big.little arch */
|
||||
enum INTERACTIVE_TIMER_RATE_LVL_BIG_LITTLE {
|
||||
BIG_LITTLE_TR_MS_100 = 0x64,
|
||||
BIG_LITTLE_TR_MS_50 = 0x32,
|
||||
BIG_LITTLE_TR_MS_40 = 0x28,
|
||||
BIG_LITTLE_TR_MS_30 = 0x1E,
|
||||
BIG_LITTLE_TR_MS_20 = 0x14,
|
||||
};
|
||||
|
||||
/* INTERACTIVE opcodes */
|
||||
enum INTERACTIVE_OPCODES {
|
||||
INT_OP_CLUSTER0_TIMER_RATE = 0x41424000,
|
||||
INT_OP_CLUSTER1_TIMER_RATE = 0x41424100,
|
||||
INT_OP_CLUSTER0_USE_SCHED_LOAD = 0x41430000,
|
||||
INT_OP_CLUSTER1_USE_SCHED_LOAD = 0x41430100,
|
||||
INT_OP_CLUSTER0_USE_MIGRATION_NOTIF = 0x41434000,
|
||||
INT_OP_CLUSTER1_USE_MIGRATION_NOTIF = 0x41434100,
|
||||
INT_OP_NOTIFY_ON_MIGRATE = 0x4241C000
|
||||
};
|
||||
|
||||
enum INTERACTIVE_HISPEED_FREQ_LVL {
|
||||
HS_FREQ_1026 = 0xF0A,
|
||||
};
|
||||
|
||||
enum INTERACTIVE_HISPEED_LOAD_LVL {
|
||||
HISPEED_LOAD_90 = 0x105A,
|
||||
};
|
||||
|
||||
enum SYNC_FREQ_LVL {
|
||||
SYNC_FREQ_300 = 0x1103,
|
||||
SYNC_FREQ_600 = 0X1106,
|
||||
SYNC_FREQ_384 = 0x1103,
|
||||
SYNC_FREQ_NONTURBO_MAX = 0x110A,
|
||||
SYNC_FREQ_TURBO = 0x110F,
|
||||
};
|
||||
|
||||
enum OPTIMAL_FREQ_LVL {
|
||||
OPTIMAL_FREQ_300 = 0x1203,
|
||||
OPTIMAL_FREQ_600 = 0x1206,
|
||||
OPTIMAL_FREQ_384 = 0x1203,
|
||||
OPTIMAL_FREQ_NONTURBO_MAX = 0x120A,
|
||||
OPTIMAL_FREQ_TURBO = 0x120F,
|
||||
};
|
||||
|
||||
enum SCREEN_PWR_CLPS_LVL {
|
||||
PWR_CLPS_DIS = 0x1300,
|
||||
PWR_CLPS_ENA = 0x1301,
|
||||
};
|
||||
|
||||
enum THREAD_MIGRATION_LVL {
|
||||
THREAD_MIGRATION_SYNC_OFF = 0x1400,
|
||||
};
|
||||
|
||||
enum SCHED_GUIDED_LVL {
|
||||
INTERACTIVE_USE_SCHED_LOAD_OFF = 0x5201,
|
||||
INTERACTIVE_USE_MIGRATION_NOTIF_OFF = 0x5301
|
||||
};
|
||||
|
||||
enum INTERACTIVE_IO_BUSY_LVL {
|
||||
INTERACTIVE_IO_BUSY_OFF = 0x1B00,
|
||||
INTERACTIVE_IO_BUSY_ON = 0x1B01,
|
||||
};
|
||||
|
||||
enum SCHED_BOOST_LVL {
|
||||
SCHED_BOOST_ON = 0x1E01,
|
||||
};
|
||||
|
||||
enum CPU4_MIN_FREQ_LVL {
|
||||
CPU4_MIN_FREQ_NONTURBO_MAX = 0x1F0A,
|
||||
CPU4_MIN_FREQ_TURBO_MAX = 0x1FFE,
|
||||
};
|
||||
|
||||
enum CPU5_MIN_FREQ_LVL {
|
||||
CPU5_MIN_FREQ_NONTURBO_MAX = 0x200A,
|
||||
CPU5_MIN_FREQ_TURBO_MAX = 0x20FE,
|
||||
};
|
||||
|
||||
enum CPU6_MIN_FREQ_LVL {
|
||||
CPU6_MIN_FREQ_NONTURBO_MAX = 0x210A,
|
||||
CPU6_MIN_FREQ_TURBO_MAX = 0x21FE,
|
||||
};
|
||||
|
||||
enum CPU7_MIN_FREQ_LVL {
|
||||
CPU7_MIN_FREQ_NONTURBO_MAX = 0x220A,
|
||||
CPU7_MIN_FREQ_TURBO_MAX = 0x22FE,
|
||||
};
|
||||
|
||||
enum CPU4_MAX_FREQ_LVL {
|
||||
CPU4_MAX_FREQ_NONTURBO_MAX = 0x230A,
|
||||
};
|
||||
|
||||
enum CPU5_MAX_FREQ_LVL {
|
||||
CPU5_MAX_FREQ_NONTURBO_MAX = 0x240A,
|
||||
};
|
||||
|
||||
enum CPU6_MAX_FREQ_LVL {
|
||||
CPU6_MAX_FREQ_NONTURBO_MAX = 0x250A,
|
||||
};
|
||||
|
||||
enum CPU7_MAX_FREQ_LVL {
|
||||
CPU7_MAX_FREQ_NONTURBO_MAX = 0x260A,
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
288
power/power-8998.c
Normal file
288
power/power-8998.c
Normal file
@@ -0,0 +1,288 @@
|
||||
/*
|
||||
* Copyright (c) 2016, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#define LOG_NIDEBUG 0
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <dlfcn.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define ATRACE_TAG (ATRACE_TAG_POWER | ATRACE_TAG_HAL)
|
||||
#define LOG_TAG "QCOM PowerHAL"
|
||||
#include <utils/Log.h>
|
||||
#include <cutils/trace.h>
|
||||
#include <hardware/hardware.h>
|
||||
#include <hardware/power.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "metadata-defs.h"
|
||||
#include "hint-data.h"
|
||||
#include "performance.h"
|
||||
#include "power-common.h"
|
||||
#include "powerhintparser.h"
|
||||
|
||||
static int sustained_mode_handle = 0;
|
||||
static int vr_mode_handle = 0;
|
||||
static int launch_handle = 0;
|
||||
static int sustained_performance_mode = 0;
|
||||
static int vr_mode = 0;
|
||||
static int launch_mode = 0;
|
||||
#define CHECK_HANDLE(x) (((x)>0) && ((x)!=-1))
|
||||
|
||||
int is_perf_hint_active(int hint)
|
||||
{
|
||||
switch (hint) {
|
||||
case SUSTAINED_PERF_HINT_ID:
|
||||
return sustained_performance_mode != 0;
|
||||
case VR_MODE_HINT_ID:
|
||||
return vr_mode != 0;
|
||||
case VR_MODE_SUSTAINED_PERF_HINT_ID:
|
||||
return vr_mode != 0 && sustained_performance_mode != 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int process_sustained_perf_hint(void *data)
|
||||
{
|
||||
int duration = 0;
|
||||
int *resource_values = NULL;
|
||||
int resources = 0;
|
||||
|
||||
if (data && sustained_performance_mode == 0) {
|
||||
if (vr_mode == 0) { // Sustained mode only.
|
||||
resource_values = getPowerhint(SUSTAINED_PERF_HINT_ID, &resources);
|
||||
if (!resource_values) {
|
||||
ALOGE("Can't get sustained perf hints from xml ");
|
||||
return HINT_NONE;
|
||||
}
|
||||
sustained_mode_handle = interaction_with_handle(
|
||||
sustained_mode_handle, duration, resources, resource_values);
|
||||
if (!CHECK_HANDLE(sustained_mode_handle)) {
|
||||
ALOGE("Failed interaction_with_handle for sustained_mode_handle");
|
||||
return HINT_NONE;
|
||||
}
|
||||
} else if (vr_mode == 1) { // Sustained + VR mode.
|
||||
release_request(vr_mode_handle);
|
||||
resource_values = getPowerhint(VR_MODE_SUSTAINED_PERF_HINT_ID, &resources);
|
||||
if (!resource_values) {
|
||||
ALOGE("Can't get VR mode sustained perf hints from xml ");
|
||||
return HINT_NONE;
|
||||
}
|
||||
sustained_mode_handle = interaction_with_handle(
|
||||
sustained_mode_handle, duration, resources, resource_values);
|
||||
if (!CHECK_HANDLE(sustained_mode_handle)) {
|
||||
ALOGE("Failed interaction_with_handle for sustained_mode_handle");
|
||||
return HINT_NONE;
|
||||
}
|
||||
}
|
||||
sustained_performance_mode = 1;
|
||||
} else if (sustained_performance_mode == 1) {
|
||||
release_request(sustained_mode_handle);
|
||||
if (vr_mode == 1) { // Switch back to VR Mode.
|
||||
resource_values = getPowerhint(VR_MODE_HINT_ID, &resources);
|
||||
if (!resource_values) {
|
||||
ALOGE("Can't get VR mode perf hints from xml ");
|
||||
return HINT_NONE;
|
||||
}
|
||||
vr_mode_handle = interaction_with_handle(
|
||||
vr_mode_handle, duration, resources, resource_values);
|
||||
if (!CHECK_HANDLE(vr_mode_handle)) {
|
||||
ALOGE("Failed interaction_with_handle for vr_mode_handle");
|
||||
return HINT_NONE;
|
||||
}
|
||||
}
|
||||
sustained_performance_mode = 0;
|
||||
}
|
||||
return HINT_HANDLED;
|
||||
}
|
||||
|
||||
static int process_vr_mode_hint(void *data)
|
||||
{
|
||||
int duration = 0;
|
||||
int *resource_values = NULL;
|
||||
int resources = 0;
|
||||
|
||||
if (data && vr_mode == 0) {
|
||||
if (sustained_performance_mode == 0) { // VR mode only.
|
||||
resource_values = getPowerhint(VR_MODE_HINT_ID, &resources);
|
||||
if (!resource_values) {
|
||||
ALOGE("Can't get VR mode perf hints from xml ");
|
||||
return HINT_NONE;
|
||||
}
|
||||
vr_mode_handle = interaction_with_handle(
|
||||
vr_mode_handle, duration, resources, resource_values);
|
||||
if (!CHECK_HANDLE(vr_mode_handle)) {
|
||||
ALOGE("Failed interaction_with_handle for vr_mode_handle");
|
||||
return HINT_NONE;
|
||||
}
|
||||
} else if (sustained_performance_mode == 1) { // Sustained + VR mode.
|
||||
release_request(sustained_mode_handle);
|
||||
resource_values = getPowerhint(VR_MODE_SUSTAINED_PERF_HINT_ID, &resources);
|
||||
if (!resource_values) {
|
||||
ALOGE("Can't get VR mode sustained perf hints from xml ");
|
||||
return HINT_NONE;
|
||||
}
|
||||
vr_mode_handle = interaction_with_handle(
|
||||
vr_mode_handle, duration, resources, resource_values);
|
||||
if (!CHECK_HANDLE(vr_mode_handle)) {
|
||||
ALOGE("Failed interaction_with_handle for vr_mode_handle");
|
||||
return HINT_NONE;
|
||||
}
|
||||
}
|
||||
vr_mode = 1;
|
||||
} else if (vr_mode == 1) {
|
||||
release_request(vr_mode_handle);
|
||||
if (sustained_performance_mode == 1) { // Switch back to sustained Mode.
|
||||
resource_values = getPowerhint(SUSTAINED_PERF_HINT_ID, &resources);
|
||||
if (!resource_values) {
|
||||
ALOGE("Can't get sustained perf hints from xml ");
|
||||
return HINT_NONE;
|
||||
}
|
||||
sustained_mode_handle = interaction_with_handle(
|
||||
sustained_mode_handle, duration, resources, resource_values);
|
||||
if (!CHECK_HANDLE(sustained_mode_handle)) {
|
||||
ALOGE("Failed interaction_with_handle for sustained_mode_handle");
|
||||
return HINT_NONE;
|
||||
}
|
||||
}
|
||||
vr_mode = 0;
|
||||
}
|
||||
|
||||
return HINT_HANDLED;
|
||||
}
|
||||
|
||||
static int process_boost(int boost_handle, int duration)
|
||||
{
|
||||
int *resource_values;
|
||||
int resources;
|
||||
|
||||
resource_values = getPowerhint(BOOST_HINT_ID, &resources);
|
||||
|
||||
if (resource_values != NULL) {
|
||||
boost_handle = interaction_with_handle(
|
||||
boost_handle, duration, resources, resource_values);
|
||||
if (!CHECK_HANDLE(boost_handle)) {
|
||||
ALOGE("Failed interaction_with_handle for boost_handle");
|
||||
}
|
||||
}
|
||||
|
||||
return boost_handle;
|
||||
}
|
||||
|
||||
static int process_video_encode_hint(void *data)
|
||||
{
|
||||
static int boost_handle = -1;
|
||||
|
||||
if (data) {
|
||||
// TODO: remove the launch boost based on camera launch time
|
||||
int duration = 2000; // boosts 2s for starting encoding
|
||||
boost_handle = process_boost(boost_handle, duration);
|
||||
ALOGD("LAUNCH ENCODER-ON: %d MS", duration);
|
||||
int *resource_values = NULL;
|
||||
int resources = 0;
|
||||
resource_values = getPowerhint(DEFAULT_VIDEO_ENCODE_HINT_ID, &resources);
|
||||
if (resource_values != NULL)
|
||||
perform_hint_action(DEFAULT_VIDEO_ENCODE_HINT_ID, resource_values, resources);
|
||||
ALOGD("Video Encode hint start");
|
||||
return HINT_HANDLED;
|
||||
} else {
|
||||
undo_hint_action(DEFAULT_VIDEO_ENCODE_HINT_ID);
|
||||
ALOGD("Video Encode hint stop");
|
||||
return HINT_HANDLED;
|
||||
}
|
||||
return HINT_NONE;
|
||||
}
|
||||
|
||||
static int process_activity_launch_hint(void *data)
|
||||
{
|
||||
// boost will timeout in 1.25s
|
||||
int duration = 1250;
|
||||
ATRACE_BEGIN("launch");
|
||||
if (sustained_performance_mode || vr_mode) {
|
||||
ATRACE_END();
|
||||
return HINT_HANDLED;
|
||||
}
|
||||
|
||||
ALOGD("LAUNCH HINT: %s", data ? "ON" : "OFF");
|
||||
// restart the launch hint if the framework has not yet released
|
||||
// this shouldn't happen, but we've seen bugs where it could
|
||||
if (data) {
|
||||
launch_handle = process_boost(launch_handle, duration);
|
||||
if (launch_handle > 0) {
|
||||
launch_mode = 1;
|
||||
ALOGD("Activity launch hint handled");
|
||||
ATRACE_INT("launch_lock", 1);
|
||||
ATRACE_END();
|
||||
return HINT_HANDLED;
|
||||
} else {
|
||||
ATRACE_END();
|
||||
return HINT_NONE;
|
||||
}
|
||||
} else if (data == NULL && launch_mode == 1) {
|
||||
// framework release hints aren't necessarily reliable
|
||||
// always wait the full duration
|
||||
// release_request(launch_handle);
|
||||
ATRACE_INT("launch_lock", 0);
|
||||
launch_mode = 0;
|
||||
ATRACE_END();
|
||||
return HINT_HANDLED;
|
||||
}
|
||||
ATRACE_END();
|
||||
return HINT_NONE;
|
||||
}
|
||||
|
||||
int power_hint_override(power_hint_t hint, void *data)
|
||||
{
|
||||
int ret_val = HINT_NONE;
|
||||
switch(hint) {
|
||||
case POWER_HINT_VIDEO_ENCODE:
|
||||
ret_val = process_video_encode_hint(data);
|
||||
break;
|
||||
case POWER_HINT_SUSTAINED_PERFORMANCE:
|
||||
ret_val = process_sustained_perf_hint(data);
|
||||
break;
|
||||
case POWER_HINT_VR_MODE:
|
||||
ret_val = process_vr_mode_hint(data);
|
||||
break;
|
||||
case POWER_HINT_LAUNCH:
|
||||
ret_val = process_activity_launch_hint(data);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
int set_interactive_override(int UNUSED(on))
|
||||
{
|
||||
return HINT_HANDLED; /* Don't excecute this code path, not in use */
|
||||
}
|
||||
55
power/power-common.h
Normal file
55
power/power-common.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright (c) 2013, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#define NODE_MAX (64)
|
||||
|
||||
#define SCALING_GOVERNOR_PATH "/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"
|
||||
#define DCVS_CPU0_SLACK_MAX_NODE "/sys/module/msm_dcvs/cores/cpu0/slack_time_max_us"
|
||||
#define DCVS_CPU0_SLACK_MIN_NODE "/sys/module/msm_dcvs/cores/cpu0/slack_time_min_us"
|
||||
#define MPDECISION_SLACK_MAX_NODE "/sys/module/msm_mpdecision/slack_time_max_us"
|
||||
#define MPDECISION_SLACK_MIN_NODE "/sys/module/msm_mpdecision/slack_time_min_us"
|
||||
#define SCALING_MIN_FREQ "/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq"
|
||||
#define ONDEMAND_GOVERNOR "ondemand"
|
||||
#define INTERACTIVE_GOVERNOR "interactive"
|
||||
#define SCHEDUTIL_GOVERNOR "schedutil"
|
||||
#define SCHED_GOVERNOR "sched"
|
||||
|
||||
#define MSMDCVS_GOVERNOR "msm-dcvs"
|
||||
#define SCHED_GOVERNOR "sched"
|
||||
|
||||
#define HINT_HANDLED (0)
|
||||
#define HINT_NONE (-1)
|
||||
|
||||
enum CPU_GOV_CHECK {
|
||||
CPU0 = 0,
|
||||
CPU1 = 1,
|
||||
CPU2 = 2,
|
||||
CPU3 = 3
|
||||
};
|
||||
|
||||
#define UNUSED(x) UNUSED_ ## x __attribute__((__unused__))
|
||||
450
power/power-helper.c
Normal file
450
power/power-helper.c
Normal file
@@ -0,0 +1,450 @@
|
||||
/*
|
||||
* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#define LOG_NIDEBUG 0
|
||||
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <dlfcn.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define LOG_TAG "QCOM PowerHAL"
|
||||
#include <utils/Log.h>
|
||||
#include <hardware/power.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "metadata-defs.h"
|
||||
#include "hint-data.h"
|
||||
#include "performance.h"
|
||||
#include "power-common.h"
|
||||
#include "power-helper.h"
|
||||
|
||||
#ifndef RPM_SYSTEM_STAT
|
||||
#define RPM_SYSTEM_STAT "/d/system_stats"
|
||||
#endif
|
||||
|
||||
#ifndef WLAN_POWER_STAT
|
||||
#define WLAN_POWER_STAT "/d/wlan0/power_stats"
|
||||
#endif
|
||||
|
||||
#define ARRAY_SIZE(x) (sizeof((x))/sizeof((x)[0]))
|
||||
#define LINE_SIZE 128
|
||||
|
||||
const char *rpm_stat_params[MAX_RPM_PARAMS] = {
|
||||
"count",
|
||||
"actual last sleep(msec)",
|
||||
};
|
||||
|
||||
const char *master_stat_params[MAX_RPM_PARAMS] = {
|
||||
"Accumulated XO duration",
|
||||
"XO Count",
|
||||
};
|
||||
|
||||
struct stat_pair rpm_stat_map[] = {
|
||||
{ RPM_MODE_XO, "RPM Mode:vlow", rpm_stat_params, ARRAY_SIZE(rpm_stat_params) },
|
||||
{ RPM_MODE_VMIN, "RPM Mode:vmin", rpm_stat_params, ARRAY_SIZE(rpm_stat_params) },
|
||||
{ VOTER_APSS, "APSS", master_stat_params, ARRAY_SIZE(master_stat_params) },
|
||||
{ VOTER_MPSS, "MPSS", master_stat_params, ARRAY_SIZE(master_stat_params) },
|
||||
{ VOTER_ADSP, "ADSP", master_stat_params, ARRAY_SIZE(master_stat_params) },
|
||||
{ VOTER_SLPI, "SLPI", master_stat_params, ARRAY_SIZE(master_stat_params) },
|
||||
};
|
||||
|
||||
|
||||
const char *wlan_power_stat_params[] = {
|
||||
"cumulative_sleep_time_ms",
|
||||
"cumulative_total_on_time_ms",
|
||||
"deep_sleep_enter_counter",
|
||||
"last_deep_sleep_enter_tstamp_ms"
|
||||
};
|
||||
|
||||
struct stat_pair wlan_stat_map[] = {
|
||||
{ WLAN_POWER_DEBUG_STATS, "POWER DEBUG STATS", wlan_power_stat_params, ARRAY_SIZE(wlan_power_stat_params) },
|
||||
};
|
||||
|
||||
static int saved_dcvs_cpu0_slack_max = -1;
|
||||
static int saved_dcvs_cpu0_slack_min = -1;
|
||||
static int saved_mpdecision_slack_max = -1;
|
||||
static int saved_mpdecision_slack_min = -1;
|
||||
static int saved_interactive_mode = -1;
|
||||
static int slack_node_rw_failed = 0;
|
||||
static int display_hint_sent;
|
||||
|
||||
void power_init(void)
|
||||
{
|
||||
ALOGI("QCOM power HAL initing.");
|
||||
}
|
||||
|
||||
int __attribute__ ((weak)) power_hint_override(power_hint_t UNUSED(hint),
|
||||
void *UNUSED(data))
|
||||
{
|
||||
return HINT_NONE;
|
||||
}
|
||||
|
||||
/* Declare function before use */
|
||||
void interaction(int duration, int num_args, int opt_list[]);
|
||||
|
||||
void power_hint(power_hint_t hint, void *data)
|
||||
{
|
||||
/* Check if this hint has been overridden. */
|
||||
if (power_hint_override(hint, data) == HINT_HANDLED) {
|
||||
/* The power_hint has been handled. We can skip the rest. */
|
||||
return;
|
||||
}
|
||||
|
||||
switch(hint) {
|
||||
case POWER_HINT_VSYNC:
|
||||
break;
|
||||
case POWER_HINT_SUSTAINED_PERFORMANCE:
|
||||
ALOGD("Sustained perf power hint not handled in power_hint_override");
|
||||
break;
|
||||
case POWER_HINT_VR_MODE:
|
||||
ALOGD("VR mode power hint not handled in power_hint_override");
|
||||
break;
|
||||
case POWER_HINT_INTERACTION:
|
||||
{
|
||||
int resources[] = {0x702, 0x20F, 0x30F};
|
||||
int duration = 3000;
|
||||
|
||||
interaction(duration, sizeof(resources)/sizeof(resources[0]), resources);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int __attribute__ ((weak)) is_perf_hint_active(int UNUSED(hint))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int __attribute__ ((weak)) set_interactive_override(int UNUSED(on))
|
||||
{
|
||||
return HINT_NONE;
|
||||
}
|
||||
|
||||
void power_set_interactive(int on)
|
||||
{
|
||||
char governor[80];
|
||||
char tmp_str[NODE_MAX];
|
||||
struct video_encode_metadata_t video_encode_metadata;
|
||||
int rc = 0;
|
||||
|
||||
if (set_interactive_override(on) == HINT_HANDLED) {
|
||||
return;
|
||||
}
|
||||
|
||||
ALOGD("Got set_interactive hint");
|
||||
|
||||
if (get_scaling_governor(governor, sizeof(governor)) == -1) {
|
||||
ALOGE("Can't obtain scaling governor.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!on) {
|
||||
/* Display off. */
|
||||
if ((strncmp(governor, ONDEMAND_GOVERNOR, strlen(ONDEMAND_GOVERNOR)) == 0) &&
|
||||
(strlen(governor) == strlen(ONDEMAND_GOVERNOR))) {
|
||||
int resource_values[] = {DISPLAY_OFF, MS_500, THREAD_MIGRATION_SYNC_OFF};
|
||||
|
||||
if (!display_hint_sent) {
|
||||
perform_hint_action(DISPLAY_STATE_HINT_ID,
|
||||
resource_values, sizeof(resource_values)/sizeof(resource_values[0]));
|
||||
display_hint_sent = 1;
|
||||
}
|
||||
} else if ((strncmp(governor, INTERACTIVE_GOVERNOR, strlen(INTERACTIVE_GOVERNOR)) == 0) &&
|
||||
(strlen(governor) == strlen(INTERACTIVE_GOVERNOR))) {
|
||||
int resource_values[] = {TR_MS_50, THREAD_MIGRATION_SYNC_OFF};
|
||||
|
||||
if (!display_hint_sent) {
|
||||
perform_hint_action(DISPLAY_STATE_HINT_ID,
|
||||
resource_values, sizeof(resource_values)/sizeof(resource_values[0]));
|
||||
display_hint_sent = 1;
|
||||
}
|
||||
} else if ((strncmp(governor, MSMDCVS_GOVERNOR, strlen(MSMDCVS_GOVERNOR)) == 0) &&
|
||||
(strlen(governor) == strlen(MSMDCVS_GOVERNOR))) {
|
||||
if (saved_interactive_mode == 1){
|
||||
/* Display turned off. */
|
||||
if (sysfs_read(DCVS_CPU0_SLACK_MAX_NODE, tmp_str, NODE_MAX - 1)) {
|
||||
if (!slack_node_rw_failed) {
|
||||
ALOGE("Failed to read from %s", DCVS_CPU0_SLACK_MAX_NODE);
|
||||
}
|
||||
|
||||
rc = 1;
|
||||
} else {
|
||||
saved_dcvs_cpu0_slack_max = atoi(tmp_str);
|
||||
}
|
||||
|
||||
if (sysfs_read(DCVS_CPU0_SLACK_MIN_NODE, tmp_str, NODE_MAX - 1)) {
|
||||
if (!slack_node_rw_failed) {
|
||||
ALOGE("Failed to read from %s", DCVS_CPU0_SLACK_MIN_NODE);
|
||||
}
|
||||
|
||||
rc = 1;
|
||||
} else {
|
||||
saved_dcvs_cpu0_slack_min = atoi(tmp_str);
|
||||
}
|
||||
|
||||
if (sysfs_read(MPDECISION_SLACK_MAX_NODE, tmp_str, NODE_MAX - 1)) {
|
||||
if (!slack_node_rw_failed) {
|
||||
ALOGE("Failed to read from %s", MPDECISION_SLACK_MAX_NODE);
|
||||
}
|
||||
|
||||
rc = 1;
|
||||
} else {
|
||||
saved_mpdecision_slack_max = atoi(tmp_str);
|
||||
}
|
||||
|
||||
if (sysfs_read(MPDECISION_SLACK_MIN_NODE, tmp_str, NODE_MAX - 1)) {
|
||||
if(!slack_node_rw_failed) {
|
||||
ALOGE("Failed to read from %s", MPDECISION_SLACK_MIN_NODE);
|
||||
}
|
||||
|
||||
rc = 1;
|
||||
} else {
|
||||
saved_mpdecision_slack_min = atoi(tmp_str);
|
||||
}
|
||||
|
||||
/* Write new values. */
|
||||
if (saved_dcvs_cpu0_slack_max != -1) {
|
||||
snprintf(tmp_str, NODE_MAX, "%d", 10 * saved_dcvs_cpu0_slack_max);
|
||||
|
||||
if (sysfs_write(DCVS_CPU0_SLACK_MAX_NODE, tmp_str) != 0) {
|
||||
if (!slack_node_rw_failed) {
|
||||
ALOGE("Failed to write to %s", DCVS_CPU0_SLACK_MAX_NODE);
|
||||
}
|
||||
|
||||
rc = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (saved_dcvs_cpu0_slack_min != -1) {
|
||||
snprintf(tmp_str, NODE_MAX, "%d", 10 * saved_dcvs_cpu0_slack_min);
|
||||
|
||||
if (sysfs_write(DCVS_CPU0_SLACK_MIN_NODE, tmp_str) != 0) {
|
||||
if(!slack_node_rw_failed) {
|
||||
ALOGE("Failed to write to %s", DCVS_CPU0_SLACK_MIN_NODE);
|
||||
}
|
||||
|
||||
rc = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (saved_mpdecision_slack_max != -1) {
|
||||
snprintf(tmp_str, NODE_MAX, "%d", 10 * saved_mpdecision_slack_max);
|
||||
|
||||
if (sysfs_write(MPDECISION_SLACK_MAX_NODE, tmp_str) != 0) {
|
||||
if(!slack_node_rw_failed) {
|
||||
ALOGE("Failed to write to %s", MPDECISION_SLACK_MAX_NODE);
|
||||
}
|
||||
|
||||
rc = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (saved_mpdecision_slack_min != -1) {
|
||||
snprintf(tmp_str, NODE_MAX, "%d", 10 * saved_mpdecision_slack_min);
|
||||
|
||||
if (sysfs_write(MPDECISION_SLACK_MIN_NODE, tmp_str) != 0) {
|
||||
if(!slack_node_rw_failed) {
|
||||
ALOGE("Failed to write to %s", MPDECISION_SLACK_MIN_NODE);
|
||||
}
|
||||
|
||||
rc = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
slack_node_rw_failed = rc;
|
||||
}
|
||||
} else {
|
||||
/* Display on. */
|
||||
if ((strncmp(governor, ONDEMAND_GOVERNOR, strlen(ONDEMAND_GOVERNOR)) == 0) &&
|
||||
(strlen(governor) == strlen(ONDEMAND_GOVERNOR))) {
|
||||
undo_hint_action(DISPLAY_STATE_HINT_ID);
|
||||
display_hint_sent = 0;
|
||||
} else if ((strncmp(governor, INTERACTIVE_GOVERNOR, strlen(INTERACTIVE_GOVERNOR)) == 0) &&
|
||||
(strlen(governor) == strlen(INTERACTIVE_GOVERNOR))) {
|
||||
undo_hint_action(DISPLAY_STATE_HINT_ID);
|
||||
display_hint_sent = 0;
|
||||
} else if ((strncmp(governor, MSMDCVS_GOVERNOR, strlen(MSMDCVS_GOVERNOR)) == 0) &&
|
||||
(strlen(governor) == strlen(MSMDCVS_GOVERNOR))) {
|
||||
if (saved_interactive_mode == -1 || saved_interactive_mode == 0) {
|
||||
/* Display turned on. Restore if possible. */
|
||||
if (saved_dcvs_cpu0_slack_max != -1) {
|
||||
snprintf(tmp_str, NODE_MAX, "%d", saved_dcvs_cpu0_slack_max);
|
||||
|
||||
if (sysfs_write(DCVS_CPU0_SLACK_MAX_NODE, tmp_str) != 0) {
|
||||
if (!slack_node_rw_failed) {
|
||||
ALOGE("Failed to write to %s", DCVS_CPU0_SLACK_MAX_NODE);
|
||||
}
|
||||
|
||||
rc = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (saved_dcvs_cpu0_slack_min != -1) {
|
||||
snprintf(tmp_str, NODE_MAX, "%d", saved_dcvs_cpu0_slack_min);
|
||||
|
||||
if (sysfs_write(DCVS_CPU0_SLACK_MIN_NODE, tmp_str) != 0) {
|
||||
if (!slack_node_rw_failed) {
|
||||
ALOGE("Failed to write to %s", DCVS_CPU0_SLACK_MIN_NODE);
|
||||
}
|
||||
|
||||
rc = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (saved_mpdecision_slack_max != -1) {
|
||||
snprintf(tmp_str, NODE_MAX, "%d", saved_mpdecision_slack_max);
|
||||
|
||||
if (sysfs_write(MPDECISION_SLACK_MAX_NODE, tmp_str) != 0) {
|
||||
if (!slack_node_rw_failed) {
|
||||
ALOGE("Failed to write to %s", MPDECISION_SLACK_MAX_NODE);
|
||||
}
|
||||
|
||||
rc = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (saved_mpdecision_slack_min != -1) {
|
||||
snprintf(tmp_str, NODE_MAX, "%d", saved_mpdecision_slack_min);
|
||||
|
||||
if (sysfs_write(MPDECISION_SLACK_MIN_NODE, tmp_str) != 0) {
|
||||
if (!slack_node_rw_failed) {
|
||||
ALOGE("Failed to write to %s", MPDECISION_SLACK_MIN_NODE);
|
||||
}
|
||||
|
||||
rc = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
slack_node_rw_failed = rc;
|
||||
}
|
||||
}
|
||||
|
||||
saved_interactive_mode = !!on;
|
||||
}
|
||||
|
||||
|
||||
static int parse_stats(const char **params, size_t params_size,
|
||||
uint64_t *list, FILE *fp) {
|
||||
ssize_t nread;
|
||||
size_t len = LINE_SIZE;
|
||||
char *line;
|
||||
size_t params_read = 0;
|
||||
size_t i;
|
||||
|
||||
line = malloc(len);
|
||||
if (!line) {
|
||||
ALOGE("%s: no memory to hold line", __func__);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
while ((params_read < params_size) &&
|
||||
(nread = getline(&line, &len, fp) > 0)) {
|
||||
char *key = line + strspn(line, " \t");
|
||||
char *value = strchr(key, ':');
|
||||
if (!value || (value > (line + len)))
|
||||
continue;
|
||||
*value++ = '\0';
|
||||
|
||||
for (i = 0; i < params_size; i++) {
|
||||
if (!strcmp(key, params[i])) {
|
||||
list[i] = strtoull(value, NULL, 0);
|
||||
params_read++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
free(line);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int extract_stats(uint64_t *list, char *file,
|
||||
struct stat_pair *map, size_t map_size) {
|
||||
FILE *fp;
|
||||
ssize_t read;
|
||||
size_t len = LINE_SIZE;
|
||||
char *line;
|
||||
size_t i, stats_read = 0;
|
||||
int ret = 0;
|
||||
|
||||
fp = fopen(file, "re");
|
||||
if (fp == NULL) {
|
||||
ALOGE("%s: failed to open: %s Error = %s", __func__, file, strerror(errno));
|
||||
return -errno;
|
||||
}
|
||||
|
||||
line = malloc(len);
|
||||
if (!line) {
|
||||
ALOGE("%s: no memory to hold line", __func__);
|
||||
fclose(fp);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
while ((stats_read < map_size) && (read = getline(&line, &len, fp) != -1)) {
|
||||
size_t begin = strspn(line, " \t");
|
||||
|
||||
for (i = 0; i < map_size; i++) {
|
||||
if (!strncmp(line + begin, map[i].label, strlen(map[i].label))) {
|
||||
stats_read++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == map_size)
|
||||
continue;
|
||||
|
||||
ret = parse_stats(map[i].parameters, map[i].num_parameters,
|
||||
&list[map[i].stat * MAX_RPM_PARAMS], fp);
|
||||
if (ret < 0)
|
||||
break;
|
||||
}
|
||||
free(line);
|
||||
fclose(fp);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int extract_platform_stats(uint64_t *list) {
|
||||
return extract_stats(list, RPM_SYSTEM_STAT, rpm_stat_map, ARRAY_SIZE(rpm_stat_map));
|
||||
}
|
||||
|
||||
int extract_wlan_stats(uint64_t *list) {
|
||||
return extract_stats(list, WLAN_POWER_STAT, wlan_stat_map, ARRAY_SIZE(wlan_stat_map));
|
||||
}
|
||||
109
power/power-helper.h
Normal file
109
power/power-helper.h
Normal file
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __POWER_HELPER_H__
|
||||
#define __POWER_HELPER_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "hardware/power.h"
|
||||
|
||||
|
||||
enum stats_type {
|
||||
//Platform Stats
|
||||
RPM_MODE_XO = 0,
|
||||
RPM_MODE_VMIN,
|
||||
RPM_MODE_MAX,
|
||||
XO_VOTERS_START = RPM_MODE_MAX,
|
||||
VOTER_APSS = XO_VOTERS_START,
|
||||
VOTER_MPSS,
|
||||
VOTER_ADSP,
|
||||
VOTER_SLPI,
|
||||
MAX_PLATFORM_STATS,
|
||||
|
||||
//WLAN Stats
|
||||
WLAN_POWER_DEBUG_STATS = 0,
|
||||
MAX_WLAN_STATS,
|
||||
};
|
||||
|
||||
enum subsystem_type {
|
||||
SUBSYSTEM_WLAN = 0,
|
||||
|
||||
//Don't add any lines after this line
|
||||
SUBSYSTEM_COUNT
|
||||
};
|
||||
|
||||
enum wlan_sleep_states {
|
||||
WLAN_STATE_ACTIVE = 0,
|
||||
WLAN_STATE_DEEP_SLEEP,
|
||||
|
||||
//Don't add any lines after this line
|
||||
WLAN_STATES_COUNT
|
||||
};
|
||||
|
||||
enum wlan_power_params {
|
||||
CUMULATIVE_SLEEP_TIME_MS = 0,
|
||||
CUMULATIVE_TOTAL_ON_TIME_MS,
|
||||
DEEP_SLEEP_ENTER_COUNTER,
|
||||
LAST_DEEP_SLEEP_ENTER_TSTAMP_MS,
|
||||
|
||||
//Don't add any lines after this line
|
||||
WLAN_POWER_PARAMS_COUNT
|
||||
};
|
||||
|
||||
|
||||
#define PLATFORM_SLEEP_MODES_COUNT RPM_MODE_MAX
|
||||
|
||||
#define MAX_RPM_PARAMS 2
|
||||
#define XO_VOTERS (MAX_PLATFORM_STATS - XO_VOTERS_START)
|
||||
#define VMIN_VOTERS 0
|
||||
|
||||
struct stat_pair {
|
||||
enum stats_type stat;
|
||||
const char *label;
|
||||
const char **parameters;
|
||||
size_t num_parameters;
|
||||
};
|
||||
|
||||
|
||||
void power_init(void);
|
||||
void power_hint(power_hint_t hint, void *data);
|
||||
void power_set_interactive(int on);
|
||||
int extract_platform_stats(uint64_t *list);
|
||||
int extract_wlan_stats(uint64_t *list);
|
||||
|
||||
int is_perf_hint_active(int hint);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //__POWER_HELPER_H__
|
||||
173
power/powerhintparser.c
Normal file
173
power/powerhintparser.c
Normal file
@@ -0,0 +1,173 @@
|
||||
/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#define LOG_TAG "QCOM PowerHAL"
|
||||
|
||||
#include <cutils/log.h>
|
||||
#include <libxml/parser.h>
|
||||
#include "powerhintparser.h"
|
||||
|
||||
int parsePowerhintXML() {
|
||||
|
||||
xmlDocPtr doc;
|
||||
xmlNodePtr currNode;
|
||||
const char *opcode_str, *value_str, *type_str;
|
||||
int opcode = 0, value = 0, type = 0;
|
||||
int numParams = 0;
|
||||
static int hintCount;
|
||||
|
||||
if(access(POWERHINT_XML, F_OK) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
doc = xmlReadFile(POWERHINT_XML, "UTF-8", XML_PARSE_RECOVER);
|
||||
if(!doc) {
|
||||
ALOGE("Document not parsed successfully");
|
||||
return -1;
|
||||
}
|
||||
|
||||
currNode = xmlDocGetRootElement(doc);
|
||||
if(!currNode) {
|
||||
ALOGE("Empty document");
|
||||
xmlFreeDoc(doc);
|
||||
xmlCleanupParser();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Confirm the root-element of the tree
|
||||
if(xmlStrcmp(currNode->name, BAD_CAST "Powerhint")) {
|
||||
ALOGE("document of the wrong type, root node != root");
|
||||
xmlFreeDoc(doc);
|
||||
xmlCleanupParser();
|
||||
return -1;
|
||||
}
|
||||
|
||||
currNode = currNode->xmlChildrenNode;
|
||||
|
||||
for(; currNode != NULL; currNode=currNode->next) {
|
||||
|
||||
if(currNode->type != XML_ELEMENT_NODE)
|
||||
continue;
|
||||
|
||||
xmlNodePtr node = currNode;
|
||||
|
||||
if(hintCount == MAX_HINT) {
|
||||
ALOGE("Number of hints exceeded the max count of %d\n",MAX_HINT);
|
||||
break;
|
||||
}
|
||||
|
||||
if(!xmlStrcmp(node->name, BAD_CAST "Hint")) {
|
||||
if(xmlHasProp(node, BAD_CAST "type")) {
|
||||
type_str = (const char*)xmlGetProp(node, BAD_CAST "type");
|
||||
if (type_str == NULL)
|
||||
{
|
||||
ALOGE("xmlGetProp failed on type");
|
||||
xmlFreeDoc(doc);
|
||||
xmlCleanupParser();
|
||||
return -1;
|
||||
}
|
||||
type = strtol(type_str, NULL, 16);
|
||||
}
|
||||
|
||||
node = node->children;
|
||||
while(node != NULL) {
|
||||
if(!xmlStrcmp(node->name, BAD_CAST "Resource")) {
|
||||
|
||||
if(xmlHasProp(node, BAD_CAST "opcode")) {
|
||||
opcode_str = (const char*)xmlGetProp(node, BAD_CAST "opcode");
|
||||
if (opcode_str == NULL)
|
||||
{
|
||||
ALOGE("xmlGetProp failed on opcode");
|
||||
xmlFreeDoc(doc);
|
||||
xmlCleanupParser();
|
||||
return -1;
|
||||
}
|
||||
opcode = strtol(opcode_str, NULL, 16);
|
||||
}
|
||||
if(xmlHasProp(node, BAD_CAST "value")) {
|
||||
value_str = (const char*)xmlGetProp(node, BAD_CAST "value");
|
||||
if (value_str == NULL)
|
||||
{
|
||||
ALOGE("xmlGetProp failed on value");
|
||||
xmlFreeDoc(doc);
|
||||
xmlCleanupParser();
|
||||
return -1;
|
||||
}
|
||||
value = strtol(value_str, NULL, 16);
|
||||
}
|
||||
if(opcode > 0) {
|
||||
if(numParams < (MAX_PARAM-1)) {
|
||||
powerhint[hintCount].paramList[numParams++] = opcode;
|
||||
powerhint[hintCount].paramList[numParams++] = value;
|
||||
} else {
|
||||
ALOGE("Maximum parameters exceeded for Hint ID %x\n",type);
|
||||
opcode = value = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
opcode = value = 0;
|
||||
}
|
||||
node = node->next;
|
||||
}
|
||||
powerhint[hintCount].type = type;
|
||||
powerhint[hintCount].numParams = numParams;
|
||||
numParams = 0;
|
||||
}
|
||||
hintCount++;
|
||||
}
|
||||
|
||||
xmlFreeDoc(doc);
|
||||
xmlCleanupParser();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int* getPowerhint(int hint_id, int *params) {
|
||||
|
||||
int *result = NULL;
|
||||
|
||||
if(!hint_id)
|
||||
return result;
|
||||
|
||||
ALOGV("Powerhal hint received=%x\n",hint_id);
|
||||
|
||||
if(!powerhint[0].numParams) {
|
||||
parsePowerhintXML();
|
||||
}
|
||||
|
||||
for(int i = 0; i < MAX_HINT; i++) {
|
||||
if(hint_id == powerhint[i].type) {
|
||||
*params = powerhint[i].numParams;
|
||||
result = powerhint[i].paramList;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
57
power/powerhintparser.h
Normal file
57
power/powerhintparser.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __POWERHINTPARSER__
|
||||
#define __POWERHINTPARSER__
|
||||
|
||||
#define POWERHINT_XML "/vendor/etc/powerhint.xml"
|
||||
#define MAX_HINT 8
|
||||
#define MAX_PARAM 30
|
||||
|
||||
typedef struct perflock_param_t {
|
||||
int type;
|
||||
int numParams;
|
||||
int paramList[MAX_PARAM];//static limit on number of hints - 15
|
||||
}perflock_param_t;
|
||||
|
||||
static perflock_param_t powerhint[MAX_HINT];
|
||||
|
||||
int parsePowerhintXML();
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int *getPowerhint(int, int *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __POWERHINTPARSER__ */
|
||||
67
power/service.cpp
Normal file
67
power/service.cpp
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "android.hardware.power@1.1-service.wahoo"
|
||||
|
||||
#include <android/log.h>
|
||||
#include <hidl/HidlTransportSupport.h>
|
||||
#include <hardware/power.h>
|
||||
#include "Power.h"
|
||||
|
||||
using android::sp;
|
||||
using android::status_t;
|
||||
using android::OK;
|
||||
|
||||
// libhwbinder:
|
||||
using android::hardware::configureRpcThreadpool;
|
||||
using android::hardware::joinRpcThreadpool;
|
||||
|
||||
// Generated HIDL files
|
||||
using android::hardware::power::V1_1::IPower;
|
||||
using android::hardware::power::V1_1::implementation::Power;
|
||||
|
||||
int main() {
|
||||
|
||||
status_t status;
|
||||
android::sp<IPower> service = nullptr;
|
||||
|
||||
ALOGI("Power HAL Service 1.1 for Wahoo is starting.");
|
||||
|
||||
service = new Power();
|
||||
if (service == nullptr) {
|
||||
ALOGE("Can not create an instance of Power HAL Iface, exiting.");
|
||||
|
||||
goto shutdown;
|
||||
}
|
||||
|
||||
configureRpcThreadpool(1, true /*callerWillJoin*/);
|
||||
|
||||
status = service->registerAsService();
|
||||
if (status != OK) {
|
||||
ALOGE("Could not register service for Power HAL Iface (%d).", status);
|
||||
goto shutdown;
|
||||
}
|
||||
|
||||
ALOGI("Power Service is ready");
|
||||
joinRpcThreadpool();
|
||||
//Should not pass this line
|
||||
|
||||
shutdown:
|
||||
// In normal operation, we don't expect the thread pool to exit
|
||||
|
||||
ALOGE("Power Service is shutting down");
|
||||
return 1;
|
||||
}
|
||||
326
power/utils.c
Normal file
326
power/utils.c
Normal file
@@ -0,0 +1,326 @@
|
||||
/*
|
||||
* Copyright (c) 2012-2013,2015-2016, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#define LOG_NIDEBUG 0
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "list.h"
|
||||
#include "hint-data.h"
|
||||
#include "power-common.h"
|
||||
|
||||
#define LOG_TAG "QCOM PowerHAL"
|
||||
#include <utils/Log.h>
|
||||
|
||||
static void *qcopt_handle;
|
||||
static int (*perf_lock_acq)(unsigned long handle, int duration,
|
||||
int list[], int numArgs);
|
||||
static int (*perf_lock_rel)(unsigned long handle);
|
||||
static struct list_node active_hint_list_head;
|
||||
|
||||
static void *get_qcopt_handle()
|
||||
{
|
||||
char qcopt_lib_path[PATH_MAX] = {0};
|
||||
void *handle = NULL;
|
||||
|
||||
dlerror();
|
||||
|
||||
if (property_get("ro.vendor.extension_library", qcopt_lib_path,
|
||||
NULL)) {
|
||||
handle = dlopen(qcopt_lib_path, RTLD_NOW);
|
||||
if (!handle) {
|
||||
ALOGE("Unable to open %s: %s\n", qcopt_lib_path,
|
||||
dlerror());
|
||||
}
|
||||
}
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
static void __attribute__ ((constructor)) initialize(void)
|
||||
{
|
||||
qcopt_handle = get_qcopt_handle();
|
||||
|
||||
if (!qcopt_handle) {
|
||||
ALOGE("Failed to get qcopt handle.\n");
|
||||
} else {
|
||||
/*
|
||||
* qc-opt handle obtained. Get the perflock acquire/release
|
||||
* function pointers.
|
||||
*/
|
||||
perf_lock_acq = dlsym(qcopt_handle, "perf_lock_acq");
|
||||
|
||||
if (!perf_lock_acq) {
|
||||
ALOGE("Unable to get perf_lock_acq function handle.\n");
|
||||
}
|
||||
|
||||
perf_lock_rel = dlsym(qcopt_handle, "perf_lock_rel");
|
||||
|
||||
if (!perf_lock_rel) {
|
||||
ALOGE("Unable to get perf_lock_rel function handle.\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void __attribute__ ((destructor)) cleanup(void)
|
||||
{
|
||||
if (qcopt_handle) {
|
||||
if (dlclose(qcopt_handle))
|
||||
ALOGE("Error occurred while closing qc-opt library.");
|
||||
}
|
||||
}
|
||||
|
||||
int sysfs_read(char *path, char *s, int num_bytes)
|
||||
{
|
||||
char buf[80];
|
||||
int count;
|
||||
int ret = 0;
|
||||
int fd = open(path, O_RDONLY);
|
||||
|
||||
if (fd < 0) {
|
||||
strerror_r(errno, buf, sizeof(buf));
|
||||
ALOGE("Error opening %s: %s\n", path, buf);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((count = read(fd, s, num_bytes - 1)) < 0) {
|
||||
strerror_r(errno, buf, sizeof(buf));
|
||||
ALOGE("Error writing to %s: %s\n", path, buf);
|
||||
|
||||
ret = -1;
|
||||
} else {
|
||||
s[count] = '\0';
|
||||
}
|
||||
|
||||
close(fd);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int sysfs_write(char *path, char *s)
|
||||
{
|
||||
char buf[80];
|
||||
int len;
|
||||
int ret = 0;
|
||||
int fd = open(path, O_WRONLY);
|
||||
|
||||
if (fd < 0) {
|
||||
strerror_r(errno, buf, sizeof(buf));
|
||||
ALOGE("Error opening %s: %s\n", path, buf);
|
||||
return -1 ;
|
||||
}
|
||||
|
||||
len = write(fd, s, strlen(s));
|
||||
if (len < 0) {
|
||||
strerror_r(errno, buf, sizeof(buf));
|
||||
ALOGE("Error writing to %s: %s\n", path, buf);
|
||||
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
close(fd);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int get_scaling_governor(char governor[], int size)
|
||||
{
|
||||
if (sysfs_read(SCALING_GOVERNOR_PATH, governor,
|
||||
size) == -1) {
|
||||
// Can't obtain the scaling governor. Return.
|
||||
return -1;
|
||||
} else {
|
||||
// Strip newline at the end.
|
||||
int len = strlen(governor);
|
||||
|
||||
len--;
|
||||
|
||||
while (len >= 0 && (governor[len] == '\n' || governor[len] == '\r'))
|
||||
governor[len--] = '\0';
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int is_interactive_governor(char* governor) {
|
||||
if (strncmp(governor, INTERACTIVE_GOVERNOR, (strlen(INTERACTIVE_GOVERNOR)+1)) == 0)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void interaction(int duration, int num_args, int opt_list[])
|
||||
{
|
||||
#ifdef INTERACTION_BOOST
|
||||
static int lock_handle = 0;
|
||||
|
||||
if (duration < 0 || num_args < 1 || opt_list[0] == 0)
|
||||
return;
|
||||
|
||||
if (qcopt_handle) {
|
||||
if (perf_lock_acq) {
|
||||
lock_handle = perf_lock_acq(lock_handle, duration, opt_list, num_args);
|
||||
if (lock_handle == -1)
|
||||
ALOGE("Failed to acquire lock.");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int interaction_with_handle(int lock_handle, int duration, int num_args, int opt_list[])
|
||||
{
|
||||
#ifdef INTERACTION_BOOST
|
||||
if (duration < 0 || num_args < 1 || opt_list[0] == 0)
|
||||
return 0;
|
||||
|
||||
if (qcopt_handle) {
|
||||
if (perf_lock_acq) {
|
||||
lock_handle = perf_lock_acq(lock_handle, duration, opt_list, num_args);
|
||||
if (lock_handle == -1)
|
||||
ALOGE("Failed to acquire lock.");
|
||||
}
|
||||
}
|
||||
return lock_handle;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void release_request(int lock_handle) {
|
||||
if (qcopt_handle && perf_lock_rel)
|
||||
perf_lock_rel(lock_handle);
|
||||
}
|
||||
|
||||
void perform_hint_action(int hint_id, int resource_values[], int num_resources)
|
||||
{
|
||||
if (qcopt_handle) {
|
||||
struct hint_data temp_hint_data = {
|
||||
.hint_id = hint_id
|
||||
};
|
||||
struct list_node *found_node = find_node(&active_hint_list_head,
|
||||
&temp_hint_data);
|
||||
if (found_node) {
|
||||
ALOGE("hint ID %d already active", hint_id);
|
||||
return;
|
||||
}
|
||||
if (perf_lock_acq) {
|
||||
/* Acquire an indefinite lock for the requested resources. */
|
||||
int lock_handle = perf_lock_acq(0, 0, resource_values,
|
||||
num_resources);
|
||||
|
||||
if (lock_handle == -1) {
|
||||
ALOGE("%s: Failed to acquire lock.", __func__);
|
||||
} else {
|
||||
/* Add this handle to our internal hint-list. */
|
||||
struct hint_data *new_hint =
|
||||
(struct hint_data *)malloc(sizeof(struct hint_data));
|
||||
|
||||
if (new_hint) {
|
||||
if (!active_hint_list_head.compare) {
|
||||
active_hint_list_head.compare =
|
||||
(int (*)(void *, void *))hint_compare;
|
||||
active_hint_list_head.dump = (void (*)(void *))hint_dump;
|
||||
}
|
||||
|
||||
new_hint->hint_id = hint_id;
|
||||
new_hint->perflock_handle = lock_handle;
|
||||
|
||||
if (add_list_node(&active_hint_list_head, new_hint) == NULL) {
|
||||
free(new_hint);
|
||||
/* Can't keep track of this lock. Release it. */
|
||||
if (perf_lock_rel)
|
||||
perf_lock_rel(lock_handle);
|
||||
|
||||
ALOGE("Failed to process hint.");
|
||||
}
|
||||
} else {
|
||||
/* Can't keep track of this lock. Release it. */
|
||||
if (perf_lock_rel)
|
||||
perf_lock_rel(lock_handle);
|
||||
|
||||
ALOGE("Failed to process hint.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void undo_hint_action(int hint_id)
|
||||
{
|
||||
if (qcopt_handle) {
|
||||
if (perf_lock_rel) {
|
||||
/* Get hint-data associated with this hint-id */
|
||||
struct list_node *found_node;
|
||||
struct hint_data temp_hint_data = {
|
||||
.hint_id = hint_id
|
||||
};
|
||||
|
||||
found_node = find_node(&active_hint_list_head,
|
||||
&temp_hint_data);
|
||||
|
||||
if (found_node) {
|
||||
/* Release this lock. */
|
||||
struct hint_data *found_hint_data =
|
||||
(struct hint_data *)(found_node->data);
|
||||
|
||||
if (found_hint_data) {
|
||||
if (perf_lock_rel(found_hint_data->perflock_handle) == -1)
|
||||
ALOGE("Perflock release failed: %d", hint_id);
|
||||
}
|
||||
|
||||
if (found_node->data) {
|
||||
/* We can free the hint-data for this node. */
|
||||
free(found_node->data);
|
||||
}
|
||||
|
||||
remove_list_node(&active_hint_list_head, found_node);
|
||||
ALOGV("Undo of hint ID %d succeeded", hint_id);
|
||||
} else {
|
||||
ALOGE("Invalid hint ID: %d", hint_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Used to release initial lock holding
|
||||
* two cores online when the display is on
|
||||
*/
|
||||
void undo_initial_hint_action()
|
||||
{
|
||||
if (qcopt_handle) {
|
||||
if (perf_lock_rel) {
|
||||
perf_lock_rel(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
62
power/utils.h
Normal file
62
power/utils.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (c) 2012-2013,2015-2016, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef UTILS_H
|
||||
#define UTILS_H
|
||||
#include <cutils/properties.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int sysfs_read(char *path, char *s, int num_bytes);
|
||||
int sysfs_write(char *path, char *s);
|
||||
int get_scaling_governor(char governor[], int size);
|
||||
int get_scaling_governor_check_cores(char governor[], int size, int core_num);
|
||||
int is_interactive_governor(char *);
|
||||
|
||||
void vote_ondemand_io_busy_off();
|
||||
void unvote_ondemand_io_busy_off();
|
||||
void vote_ondemand_sdf_low();
|
||||
void unvote_ondemand_sdf_low();
|
||||
void perform_hint_action(int hint_id, int resource_values[],
|
||||
int num_resources);
|
||||
void undo_hint_action(int hint_id);
|
||||
void release_request(int lock_handle);
|
||||
int interaction_with_handle(int lock_handle,
|
||||
int duration,
|
||||
int num_args,
|
||||
int opt_list[]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //UTILS_H
|
||||
80
powerhint.xml
Executable file
80
powerhint.xml
Executable file
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
|
||||
<!--
|
||||
/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
|
||||
<Powerhint>
|
||||
<Hint type="0x0A00"> <!--video encode 30 fps-->
|
||||
<Resource opcode="0x40804000" value="0x7A6"/> <!-- B CPU - Cluster max freq ~1.958 Ghz -->
|
||||
</Hint>
|
||||
<Hint type="0x0F00"> <!--sustained performance-->
|
||||
<Resource opcode="0x40800000" value="0x0"/> <!-- B CPU - Cluster min freq uncapped -->
|
||||
<Resource opcode="0x40800100" value="0x0"/> <!-- L CPU - Cluster min freq uncapped -->
|
||||
<Resource opcode="0x40804000" value="0x4E0"/> <!-- B CPU - Cluster max freq ~1.2 GHz -->
|
||||
<Resource opcode="0x40804100" value="0x4E0"/> <!-- L CPU - Cluster max freq ~1.2 Ghz -->
|
||||
<Resource opcode="0x4280C000" value="0xB4"/> <!-- GPU - min freq 180 Mhz -->
|
||||
<Resource opcode="0x42810000" value="0x156"/> <!-- GPU - max freq 342 Mhz -->
|
||||
<Resource opcode="0x42814000" value="0x0"/> <!-- GPUBW freq uncapped -->
|
||||
</Hint>
|
||||
<Hint type="0x1000"> <!--vr mode-->
|
||||
<Resource opcode="0x40800000" value="0x626"/> <!-- B CPU - Cluster min freq ~1.4 Ghz -->
|
||||
<Resource opcode="0x40800100" value="0x613"/> <!-- L CPU - Cluster min freq ~1.4 Ghz -->
|
||||
<Resource opcode="0x40804000" value="0x626"/> <!-- B CPU - Cluster max freq ~1.4 Ghz -->
|
||||
<Resource opcode="0x40804100" value="0x613"/> <!-- L CPU - Cluster max freq ~1.4 Ghz -->
|
||||
<Resource opcode="0x4280C000" value="0x203"/> <!-- GPU - min freq 515 Mhz -->
|
||||
<Resource opcode="0x42810000" value="0x203"/> <!-- GPU - max freq 515 Mhz -->
|
||||
<Resource opcode="0x42814000" value="0x2E57"/> <!-- GPUBW freq 1555 Mhz-->
|
||||
</Hint>
|
||||
<Hint type="0x1001"> <!--vr mode sustained performance-->
|
||||
<Resource opcode="0x40800000" value="0x540"/> <!-- B CPU - Cluster min freq ~1.5 Ghz -->
|
||||
<Resource opcode="0x40800100" value="0x5c6"/> <!-- L CPU - Cluster min freq ~1.3 Ghz -->
|
||||
<Resource opcode="0x40804000" value="0x540"/> <!-- B CPU - Cluster max freq ~1.5 Ghz -->
|
||||
<Resource opcode="0x40804100" value="0x5c6"/> <!-- L CPU - Cluster max freq ~1.3 Ghz -->
|
||||
<Resource opcode="0x4280C000" value="0x19E"/> <!-- GPU - min freq 414 Mhz -->
|
||||
<Resource opcode="0x42810000" value="0x19E"/> <!-- GPU - max freq 414 Mhz -->
|
||||
<Resource opcode="0x42814000" value="0x1E4F"/> <!-- GPUBW freq 1017 Mhz -->
|
||||
</Hint>
|
||||
<Hint type="0x1A00"> <!--interaction-->
|
||||
<Resource opcode="0x40800000" value="0x44C"/> <!-- B CPU - Cluster min freq ~1.1 Ghz -->
|
||||
<Resource opcode="0x40800100" value="0x44C"/> <!-- L CPU - Cluster min freq ~1.1 Ghz -->
|
||||
<Resource opcode="0x42C18000" value="0x32"/> <!-- Top App schedtune boost to 50 -->
|
||||
<Resource opcode="0x4180C000" value="0x0"/> <!-- CPUBW disable hysteresis -->
|
||||
<Resource opcode="0x41800000" value="0x33"/> <!-- CPUBW min freq 681 MHz -->
|
||||
</Hint>
|
||||
<Hint type="0x1B00"> <!--boost-->
|
||||
<Resource opcode="0x40804000" value="0xFFF"/> <!-- B CPU - Cluster max freq ~ max -->
|
||||
<Resource opcode="0x40804100" value="0xFFF"/> <!-- L CPU - Cluster max freq ~ max -->
|
||||
<Resource opcode="0x40800000" value="0xFFF"/> <!-- B CPU - Cluster min freq ~ max -->
|
||||
<Resource opcode="0x40800100" value="0xFFF"/> <!-- L CPU - Cluster min freq ~ max -->
|
||||
<Resource opcode="0x4180C000" value="0x0"/> <!-- CPUBW disable hysteresis -->
|
||||
<Resource opcode="0x40400000" value="0x1"/> <!-- POWER_COLLAPSE -->
|
||||
<Resource opcode="0x41800000" value="0x8C"/> <!-- CPUBW min freq 1804 MHz -->
|
||||
</Hint>
|
||||
</Powerhint>
|
||||
10
recovery.wipe
Normal file
10
recovery.wipe
Normal file
@@ -0,0 +1,10 @@
|
||||
# All the partitions to be wiped (in order) under recovery.
|
||||
/dev/block/bootdevice/by-name/system_a
|
||||
/dev/block/bootdevice/by-name/system_b
|
||||
/dev/block/bootdevice/by-name/vendor_a
|
||||
/dev/block/bootdevice/by-name/vendor_b
|
||||
/dev/block/bootdevice/by-name/userdata
|
||||
# Wipe the boot partitions last so that all partitions will be wiped
|
||||
# correctly even if the wiping process gets interrupted by a force boot.
|
||||
/dev/block/bootdevice/by-name/boot_a
|
||||
/dev/block/bootdevice/by-name/boot_b
|
||||
323
sec_config
Normal file
323
sec_config
Normal file
@@ -0,0 +1,323 @@
|
||||
/* IPC Security Config */
|
||||
/* <GPS QMI Service ID - 16>:<GPS QMI Instance ID - all instances>:<Client Group ID> */
|
||||
16:4294967295:1000:1021
|
||||
/* <LOWI QMI Service ID - 38>:<LOWI QMI Instance ID - all instances>:<Client Group ID> */
|
||||
56:4294967295:1021
|
||||
/* Allow SS CTL service to be used by system and net_raw processes */
|
||||
43:4294967295:1000:3004
|
||||
/* <UIMHTTP QMI Service ID - 16>:<UIMHTTP QMI Instance ID - all instances>:<Client Group ID> */
|
||||
71:4294967295:1001
|
||||
/* <UIMRMT QMI Service ID - 16>:<UIMRMT QMI Instance ID - all instances>:<Client Group ID> */
|
||||
50:4294967295:1001
|
||||
/* QMI-SLIM service permitted to gps and net_raw */
|
||||
55:4294967295:1021
|
||||
/* Allow Sensor services to be used by sensor process */
|
||||
256:4294967295:1000:1006:1013:1021:1047:3011
|
||||
257:4294967295:1000:1006:1013:1021:1047:3011
|
||||
258:4294967295:1000:1006:1013:1021:1047:3011
|
||||
259:4294967295:1000:1006:1013:1021:1047:3011
|
||||
260:4294967295:1000:1006:1013:1021:1047:3011
|
||||
261:4294967295:1000:1006:1013:1021:1047:3011
|
||||
262:4294967295:1000:1006:1013:1021:1047:3011
|
||||
263:4294967295:1000:1006:1013:1021:1047:3011
|
||||
264:4294967295:1000:1006:1013:1021:1047:3011
|
||||
265:4294967295:1000:1006:1013:1021:1047:3011
|
||||
266:4294967295:1000:1006:1013:1021:1047:3011
|
||||
267:4294967295:1000:1006:1013:1021:1047:3011
|
||||
268:4294967295:1000:1006:1013:1021:1047:3011
|
||||
269:4294967295:1000:1006:1013:1021:1047:3011
|
||||
270:4294967295:1000:1006:1013:1021:1047:3011
|
||||
271:4294967295:1000:1006:1013:1021:1047:3011
|
||||
272:4294967295:1000:1006:1013:1021:1047:3011
|
||||
273:4294967295:1000:1006:1013:1021:1047:3011
|
||||
274:4294967295:1000:1006:1013:1021:1047:3011
|
||||
275:4294967295:1000:1006:1013:1021:1047:3011
|
||||
276:4294967295:1000:1006:1013:1021:1047:3011
|
||||
277:4294967295:1000:1006:1013:1021:1047:3011
|
||||
278:4294967295:1000:1006:1013:1021:1047:3011
|
||||
279:4294967295:1000:1006:1013:1021:1047:3011
|
||||
280:4294967295:1000:1006:1013:1021:1047:3011
|
||||
281:4294967295:1000:1006:1013:1021:1047:3011
|
||||
282:4294967295:1000:1006:1013:1021:1047:3011
|
||||
283:4294967295:1000:1006:1013:1021:1047:3011
|
||||
284:4294967295:1000:1006:1013:1021:1047:3011
|
||||
285:4294967295:1000:1006:1013:1021:1047:3011
|
||||
286:4294967295:1000:1006:1013:1021:1047:3011
|
||||
287:4294967295:1000:1006:1013:1021:1047:3011
|
||||
288:4294967295:1000:1006:1013:1021:1047:3011
|
||||
289:4294967295:1000:1006:1013:1021:1047:3011
|
||||
290:4294967295:1000:1006:1013:1021:1047:3011
|
||||
291:4294967295:1000:1006:1013:1021:1047:3011
|
||||
292:4294967295:1000:1006:1013:1021:1047:3011
|
||||
293:4294967295:1000:1006:1013:1021:1047:3011
|
||||
294:4294967295:1000:1006:1013:1021:1047:3011
|
||||
295:4294967295:1000:1006:1013:1021:1047:3011
|
||||
296:4294967295:1000:1006:1013:1021:1047:3011
|
||||
297:4294967295:1000:1006:1013:1021:1047:3011
|
||||
298:4294967295:1000:1006:1013:1021:1047:3011
|
||||
299:4294967295:1000:1006:1013:1021:1047:3011
|
||||
300:4294967295:1000:1006:1013:1021:1047:3011
|
||||
301:4294967295:1000:1006:1013:1021:1047:3011
|
||||
302:4294967295:1000:1006:1013:1021:1047:3011
|
||||
303:4294967295:1000:1006:1013:1021:1047:3011
|
||||
304:4294967295:1000:1006:1013:1021:1047:3011
|
||||
305:4294967295:1000:1006:1013:1021:1047:3011
|
||||
306:4294967295:1000:1006:1013:1021:1047:3011
|
||||
307:4294967295:1000:1006:1013:1021:1047:3011
|
||||
308:4294967295:1000:1006:1013:1021:1047:3011
|
||||
309:4294967295:1000:1006:1013:1021:1047:3011
|
||||
310:4294967295:1000:1006:1013:1021:1047:3011
|
||||
311:4294967295:1000:1006:1013:1021:1047:3011
|
||||
312:4294967295:1000:1006:1013:1021:1047:3011
|
||||
313:4294967295:1000:1006:1013:1021:1047:3011
|
||||
314:4294967295:1000:1006:1013:1021:1047:3011
|
||||
315:4294967295:1000:1006:1013:1021:1047:3011
|
||||
316:4294967295:1000:1006:1013:1021:1047:3011
|
||||
317:4294967295:1000:1006:1013:1021:1047:3011
|
||||
318:4294967295:1000:1006:1013:1021:1047:3011
|
||||
319:4294967295:1000:1006:1013:1021:1047:3011
|
||||
320:4294967295:1000:1006:1013:1021:1047:3011
|
||||
321:4294967295:1000:1006:1013:1021:1047:3011
|
||||
322:4294967295:1000:1006:1013:1021:1047:3011
|
||||
323:4294967295:1000:1006:1013:1021:1047:3011
|
||||
324:4294967295:1000:1006:1013:1021:1047:3011
|
||||
325:4294967295:1000:1006:1013:1021:1047:3011
|
||||
326:4294967295:1000:1006:1013:1021:1047:3011
|
||||
327:4294967295:1000:1006:1013:1021:1047:3011
|
||||
328:4294967295:1000:1006:1013:1021:1047:3011
|
||||
329:4294967295:1000:1006:1013:1021:1047:3011
|
||||
330:4294967295:1000:1006:1013:1021:1047:3011
|
||||
331:4294967295:1000:1006:1013:1021:1047:3011
|
||||
332:4294967295:1000:1006:1013:1021:1047:3011
|
||||
333:4294967295:1000:1006:1013:1021:1047:3011
|
||||
334:4294967295:1000:1006:1013:1021:1047:3011
|
||||
335:4294967295:1000:1006:1013:1021:1047:3011
|
||||
336:4294967295:1000:1006:1013:1021:1047:3011
|
||||
337:4294967295:1000:1006:1013:1021:1047:3011
|
||||
338:4294967295:1000:1006:1013:1021:1047:3011
|
||||
339:4294967295:1000:1006:1013:1021:1047:3011
|
||||
340:4294967295:1000:1006:1013:1021:1047:3011
|
||||
341:4294967295:1000:1006:1013:1021:1047:3011
|
||||
342:4294967295:1000:1006:1013:1021:1047:3011
|
||||
343:4294967295:1000:1006:1013:1021:1047:3011
|
||||
344:4294967295:1000:1006:1013:1021:1047:3011
|
||||
345:4294967295:1000:1006:1013:1021:1047:3011
|
||||
346:4294967295:1000:1006:1013:1021:1047:3011
|
||||
347:4294967295:1000:1006:1013:1021:1047:3011
|
||||
348:4294967295:1000:1006:1013:1021:1047:3011
|
||||
349:4294967295:1000:1006:1013:1021:1047:3011
|
||||
350:4294967295:1000:1006:1013:1021:1047:3011
|
||||
351:4294967295:1000:1006:1013:1021:1047:3011
|
||||
352:4294967295:1000:1006:1013:1021:1047:3011
|
||||
353:4294967295:1000:1006:1013:1021:1047:3011
|
||||
354:4294967295:1000:1006:1013:1021:1047:3011
|
||||
355:4294967295:1000:1006:1013:1021:1047:3011
|
||||
356:4294967295:1000:1006:1013:1021:1047:3011
|
||||
357:4294967295:1000:1006:1013:1021:1047:3011
|
||||
358:4294967295:1000:1006:1013:1021:1047:3011
|
||||
359:4294967295:1000:1006:1013:1021:1047:3011
|
||||
360:4294967295:1000:1006:1013:1021:1047:3011
|
||||
361:4294967295:1000:1006:1013:1021:1047:3011
|
||||
362:4294967295:1000:1006:1013:1021:1047:3011
|
||||
363:4294967295:1000:1006:1013:1021:1047:3011
|
||||
364:4294967295:1000:1006:1013:1021:1047:3011
|
||||
365:4294967295:1000:1006:1013:1021:1047:3011
|
||||
366:4294967295:1000:1006:1013:1021:1047:3011
|
||||
367:4294967295:1000:1006:1013:1021:1047:3011
|
||||
368:4294967295:1000:1006:1013:1021:1047:3011
|
||||
369:4294967295:1000:1006:1013:1021:1047:3011
|
||||
370:4294967295:1000:1006:1013:1021:1047:3011
|
||||
371:4294967295:1000:1006:1013:1021:1047:3011
|
||||
372:4294967295:1000:1006:1013:1021:1047:3011
|
||||
373:4294967295:1000:1006:1013:1021:1047:3011
|
||||
374:4294967295:1000:1006:1013:1021:1047:3011
|
||||
375:4294967295:1000:1006:1013:1021:1047:3011
|
||||
376:4294967295:1000:1006:1013:1021:1047:3011
|
||||
377:4294967295:1000:1006:1013:1021:1047:3011
|
||||
378:4294967295:1000:1006:1013:1021:1047:3011
|
||||
379:4294967295:1000:1006:1013:1021:1047:3011
|
||||
380:4294967295:1000:1006:1013:1021:1047:3011
|
||||
381:4294967295:1000:1006:1013:1021:1047:3011
|
||||
382:4294967295:1000:1006:1013:1021:1047:3011
|
||||
383:4294967295:1000:1006:1013:1021:1047:3011
|
||||
384:4294967295:1000:1006:1013:1021:1047:3011
|
||||
385:4294967295:1000:1006:1013:1021:1047:3011
|
||||
386:4294967295:1000:1006:1013:1021:1047:3011
|
||||
387:4294967295:1000:1006:1013:1021:1047:3011
|
||||
388:4294967295:1000:1006:1013:1021:1047:3011
|
||||
389:4294967295:1000:1006:1013:1021:1047:3011
|
||||
390:4294967295:1000:1006:1013:1021:1047:3011
|
||||
391:4294967295:1000:1006:1013:1021:1047:3011
|
||||
392:4294967295:1000:1006:1013:1021:1047:3011
|
||||
393:4294967295:1000:1006:1013:1021:1047:3011
|
||||
394:4294967295:1000:1006:1013:1021:1047:3011
|
||||
395:4294967295:1000:1006:1013:1021:1047:3011
|
||||
396:4294967295:1000:1006:1013:1021:1047:3011
|
||||
397:4294967295:1000:1006:1013:1021:1047:3011
|
||||
398:4294967295:1000:1006:1013:1021:1047:3011
|
||||
399:4294967295:1000:1006:1013:1021:1047:3011
|
||||
400:4294967295:1000:1006:1013:1021:1047:3011
|
||||
401:4294967295:1000:1006:1013:1021:1047:3011
|
||||
402:4294967295:1000:1006:1013:1021:1047:3011
|
||||
403:4294967295:1000:1006:1013:1021:1047:3011
|
||||
404:4294967295:1000:1006:1013:1021:1047:3011
|
||||
405:4294967295:1000:1006:1013:1021:1047:3011
|
||||
406:4294967295:1000:1006:1013:1021:1047:3011
|
||||
407:4294967295:1000:1006:1013:1021:1047:3011
|
||||
408:4294967295:1000:1006:1013:1021:1047:3011
|
||||
409:4294967295:1000:1006:1013:1021:1047:3011
|
||||
410:4294967295:1000:1006:1013:1021:1047:3011
|
||||
411:4294967295:1000:1006:1013:1021:1047:3011
|
||||
412:4294967295:1000:1006:1013:1021:1047:3011
|
||||
413:4294967295:1000:1006:1013:1021:1047:3011
|
||||
414:4294967295:1000:1006:1013:1021:1047:3011
|
||||
415:4294967295:1000:1006:1013:1021:1047:3011
|
||||
416:4294967295:1000:1006:1013:1021:1047:3011
|
||||
417:4294967295:1000:1006:1013:1021:1047:3011
|
||||
418:4294967295:1000:1006:1013:1021:1047:3011
|
||||
419:4294967295:1000:1006:1013:1021:1047:3011
|
||||
420:4294967295:1000:1006:1013:1021:1047:3011
|
||||
421:4294967295:1000:1006:1013:1021:1047:3011
|
||||
422:4294967295:1000:1006:1013:1021:1047:3011
|
||||
423:4294967295:1000:1006:1013:1021:1047:3011
|
||||
424:4294967295:1000:1006:1013:1021:1047:3011
|
||||
425:4294967295:1000:1006:1013:1021:1047:3011
|
||||
426:4294967295:1000:1006:1013:1021:1047:3011
|
||||
427:4294967295:1000:1006:1013:1021:1047:3011
|
||||
428:4294967295:1000:1006:1013:1021:1047:3011
|
||||
429:4294967295:1000:1006:1013:1021:1047:3011
|
||||
430:4294967295:1000:1006:1013:1021:1047:3011
|
||||
431:4294967295:1000:1006:1013:1021:1047:3011
|
||||
432:4294967295:1000:1006:1013:1021:1047:3011
|
||||
433:4294967295:1000:1006:1013:1021:1047:3011
|
||||
434:4294967295:1000:1006:1013:1021:1047:3011
|
||||
435:4294967295:1000:1006:1013:1021:1047:3011
|
||||
436:4294967295:1000:1006:1013:1021:1047:3011
|
||||
437:4294967295:1000:1006:1013:1021:1047:3011
|
||||
438:4294967295:1000:1006:1013:1021:1047:3011
|
||||
439:4294967295:1000:1006:1013:1021:1047:3011
|
||||
440:4294967295:1000:1006:1013:1021:1047:3011
|
||||
441:4294967295:1000:1006:1013:1021:1047:3011
|
||||
442:4294967295:1000:1006:1013:1021:1047:3011
|
||||
443:4294967295:1000:1006:1013:1021:1047:3011
|
||||
444:4294967295:1000:1006:1013:1021:1047:3011
|
||||
445:4294967295:1000:1006:1013:1021:1047:3011
|
||||
446:4294967295:1000:1006:1013:1021:1047:3011
|
||||
447:4294967295:1000:1006:1013:1021:1047:3011
|
||||
448:4294967295:1000:1006:1013:1021:1047:3011
|
||||
449:4294967295:1000:1006:1013:1021:1047:3011
|
||||
450:4294967295:1000:1006:1013:1021:1047:3011
|
||||
451:4294967295:1000:1006:1013:1021:1047:3011
|
||||
452:4294967295:1000:1006:1013:1021:1047:3011
|
||||
453:4294967295:1000:1006:1013:1021:1047:3011
|
||||
454:4294967295:1000:1006:1013:1021:1047:3011
|
||||
455:4294967295:1000:1006:1013:1021:1047:3011
|
||||
456:4294967295:1000:1006:1013:1021:1047:3011
|
||||
457:4294967295:1000:1006:1013:1021:1047:3011
|
||||
458:4294967295:1000:1006:1013:1021:1047:3011
|
||||
459:4294967295:1000:1006:1013:1021:1047:3011
|
||||
460:4294967295:1000:1006:1013:1021:1047:3011
|
||||
461:4294967295:1000:1006:1013:1021:1047:3011
|
||||
462:4294967295:1000:1006:1013:1021:1047:3011
|
||||
463:4294967295:1000:1006:1013:1021:1047:3011
|
||||
464:4294967295:1000:1006:1013:1021:1047:3011
|
||||
465:4294967295:1000:1006:1013:1021:1047:3011
|
||||
466:4294967295:1000:1006:1013:1021:1047:3011
|
||||
467:4294967295:1000:1006:1013:1021:1047:3011
|
||||
468:4294967295:1000:1006:1013:1021:1047:3011
|
||||
469:4294967295:1000:1006:1013:1021:1047:3011
|
||||
470:4294967295:1000:1006:1013:1021:1047:3011
|
||||
471:4294967295:1000:1006:1013:1021:1047:3011
|
||||
472:4294967295:1000:1006:1013:1021:1047:3011
|
||||
473:4294967295:1000:1006:1013:1021:1047:3011
|
||||
474:4294967295:1000:1006:1013:1021:1047:3011
|
||||
475:4294967295:1000:1006:1013:1021:1047:3011
|
||||
476:4294967295:1000:1006:1013:1021:1047:3011
|
||||
477:4294967295:1000:1006:1013:1021:1047:3011
|
||||
478:4294967295:1000:1006:1013:1021:1047:3011
|
||||
479:4294967295:1000:1006:1013:1021:1047:3011
|
||||
480:4294967295:1000:1006:1013:1021:1047:3011
|
||||
481:4294967295:1000:1006:1013:1021:1047:3011
|
||||
482:4294967295:1000:1006:1013:1021:1047:3011
|
||||
483:4294967295:1000:1006:1013:1021:1047:3011
|
||||
484:4294967295:1000:1006:1013:1021:1047:3011
|
||||
485:4294967295:1000:1006:1013:1021:1047:3011
|
||||
486:4294967295:1000:1006:1013:1021:1047:3011
|
||||
487:4294967295:1000:1006:1013:1021:1047:3011
|
||||
488:4294967295:1000:1006:1013:1021:1047:3011
|
||||
489:4294967295:1000:1006:1013:1021:1047:3011
|
||||
490:4294967295:1000:1006:1013:1021:1047:3011
|
||||
491:4294967295:1000:1006:1013:1021:1047:3011
|
||||
492:4294967295:1000:1006:1013:1021:1047:3011
|
||||
493:4294967295:1000:1006:1013:1021:1047:3011
|
||||
494:4294967295:1000:1006:1013:1021:1047:3011
|
||||
495:4294967295:1000:1006:1013:1021:1047:3011
|
||||
496:4294967295:1000:1006:1013:1021:1047:3011
|
||||
497:4294967295:1000:1006:1013:1021:1047:3011
|
||||
498:4294967295:1000:1006:1013:1021:1047:3011
|
||||
499:4294967295:1000:1006:1013:1021:1047:3011
|
||||
500:4294967295:1000:1006:1013:1021:1047:3011
|
||||
501:4294967295:1000:1006:1013:1021:1047:3011
|
||||
502:4294967295:1000:1006:1013:1021:1047:3011
|
||||
503:4294967295:1000:1006:1013:1021:1047:3011
|
||||
504:4294967295:1000:1006:1013:1021:1047:3011
|
||||
505:4294967295:1000:1006:1013:1021:1047:3011
|
||||
506:4294967295:1000:1006:1013:1021:1047:3011
|
||||
507:4294967295:1000:1006:1013:1021:1047:3011
|
||||
508:4294967295:1000:1006:1013:1021:1047:3011
|
||||
509:4294967295:1000:1006:1013:1021:1047:3011
|
||||
510:4294967295:1000:1006:1013:1021:1047:3011
|
||||
511:4294967295:1000:1006:1013:1021:1047:3011
|
||||
/* Allow RCS service to aquire net_raw permission */
|
||||
18:4294967295:1001:3004
|
||||
/* Allow QMID service to aquire net_raw permission */
|
||||
3:4294967295:1001:3004
|
||||
2:4294967295:1001:3004
|
||||
42:4294967295:1001:3004
|
||||
18:4294967295:1001:3004
|
||||
9:4294967295:1001:3004
|
||||
1:4294967295:1001:3004:1000
|
||||
4:4294967295:1001:3004
|
||||
7:4294967295:1001:3004
|
||||
8:4294967295:1001:3004:1000
|
||||
68:4294967295:1001:3004
|
||||
/* DPM */
|
||||
47:4294967295:1001:3004
|
||||
/* Allow communication to some QMI services with radio privilages */
|
||||
/* Format is <Service id>:<all instances>:<radio> */
|
||||
/* PBM */
|
||||
12:4294967295:1001
|
||||
/* WMS */
|
||||
5:4294967295:1001
|
||||
/* IMS VT */
|
||||
32:4294967295:1001
|
||||
/* IMSP */
|
||||
31:4294967295:1001
|
||||
/* PDC */
|
||||
36:4294967295:1001
|
||||
/* SAR */
|
||||
17:4294967295:1001
|
||||
/* RFRPE */
|
||||
41:4294967295:1001
|
||||
/*UIM*/
|
||||
11:4294967295:1001
|
||||
/*CAT*/
|
||||
10:4294967295:1001
|
||||
/*IMSA*/
|
||||
33:4294967295:1001
|
||||
/* CSVT */
|
||||
29:4294967295:1001
|
||||
/*LTE*/
|
||||
70:4294967295:1001
|
||||
/* Allow Data dpmd to access QMI DFS */
|
||||
48:4294967295:1000:3004
|
||||
/* hTC Extended QMI service from modem team. more protocol related */
|
||||
229:4294967295:1001
|
||||
/* hTC Extended QMI service from modem BSP team */
|
||||
230:4294967295:1001
|
||||
/* DIAG */
|
||||
4097:4294967295:2002:2950:3009
|
||||
/* <WLFW QMI Service ID - 0x45>:<WLFW QMI Instance ID - all instances>:<Client Group ID> */
|
||||
69:4294967295:1000
|
||||
/* <WLPS QMI Service ID - 0x39>:<WLFW QMI Instance ID - all instances>:<Client Group ID> */
|
||||
57:4294967295:1000
|
||||
9
seccomp_policy/mediacodec.policy
Normal file
9
seccomp_policy/mediacodec.policy
Normal file
@@ -0,0 +1,9 @@
|
||||
# device specific syscalls
|
||||
pselect6: 1
|
||||
eventfd2: 1
|
||||
sendto: 1
|
||||
recvfrom: 1
|
||||
_llseek: 1
|
||||
sysinfo: 1
|
||||
getcwd: 1
|
||||
getdents64: 1
|
||||
1
sensors/hals.conf
Normal file
1
sensors/hals.conf
Normal file
@@ -0,0 +1 @@
|
||||
sensors.msm8998.so
|
||||
21
sepolicy/private/dataservice_app.te
Normal file
21
sepolicy/private/dataservice_app.te
Normal file
@@ -0,0 +1,21 @@
|
||||
typeattribute dataservice_app coredomain;
|
||||
app_domain(dataservice_app)
|
||||
net_domain(dataservice_app)
|
||||
|
||||
add_service(dataservice_app, cne_service)
|
||||
add_service(dataservice_app, uce_service)
|
||||
allow dataservice_app {
|
||||
app_api_service
|
||||
system_api_service
|
||||
audioserver_service
|
||||
radio_service
|
||||
}:service_manager find;
|
||||
|
||||
allow dataservice_app hal_imsrcsd_hwservice:hwservice_manager find;
|
||||
allow dataservice_app hal_cne_hwservice:hwservice_manager find;
|
||||
|
||||
allow dataservice_app system_app_data_file:dir create_dir_perms;
|
||||
allow dataservice_app system_app_data_file:{ file lnk_file } create_file_perms;
|
||||
|
||||
hwbinder_use(dataservice_app)
|
||||
|
||||
1
sepolicy/private/device.te
Normal file
1
sepolicy/private/device.te
Normal file
@@ -0,0 +1 @@
|
||||
type ramoops_device, dev_type;
|
||||
8
sepolicy/private/file_contexts
Normal file
8
sepolicy/private/file_contexts
Normal file
@@ -0,0 +1,8 @@
|
||||
/system/bin/folio_daemon u:object_r:folio_daemon_exec:s0
|
||||
/data/misc/elabel(/.*)? u:object_r:elabel_data_file:s0
|
||||
/system/bin/init\.elabel\.sh u:object_r:init_elabel_exec:s0
|
||||
/system/bin/ramoops u:object_r:ramoops_exec:s0
|
||||
/system/bin/init\.ramoops\.sh u:object_r:ramoops_exec:s0
|
||||
/dev/access-metadata u:object_r:ramoops_device:s0
|
||||
/dev/access-ramoops u:object_r:ramoops_device:s0
|
||||
/data/misc_ce/[0-9]+/ramoops(/.*)? u:object_r:ramoops_data_file:s0
|
||||
15
sepolicy/private/folio_daemon.te
Normal file
15
sepolicy/private/folio_daemon.te
Normal file
@@ -0,0 +1,15 @@
|
||||
type folio_daemon, domain, coredomain;
|
||||
type folio_daemon_exec, exec_type, file_type;
|
||||
|
||||
init_daemon_domain(folio_daemon)
|
||||
|
||||
allow folio_daemon binder_device:chr_file rw_file_perms;
|
||||
allow folio_daemon uhid_device:chr_file rw_file_perms;
|
||||
|
||||
allow folio_daemon system_server:unix_stream_socket rw_socket_perms_no_ioctl;
|
||||
|
||||
binder_use(folio_daemon)
|
||||
binder_call(folio_daemon, system_server)
|
||||
|
||||
allow folio_daemon sensorservice_service:service_manager find;
|
||||
allow folio_daemon permission_service:service_manager find;
|
||||
4
sepolicy/private/genfs_contexts
Normal file
4
sepolicy/private/genfs_contexts
Normal file
@@ -0,0 +1,4 @@
|
||||
genfscon sysfs /devices/virtual/ramoops/pstore/aes_key u:object_r:sysfs_pstore:s0
|
||||
genfscon sysfs /devices/virtual/ramoops/pstore/aes_key_iv u:object_r:sysfs_pstore:s0
|
||||
genfscon sysfs /devices/virtual/ramoops/pstore/aes_key_tag u:object_r:sysfs_pstore:s0
|
||||
genfscon sysfs /devices/virtual/ramoops/pstore/use_alt u:object_r:sysfs_pstore:s0
|
||||
12
sepolicy/private/init_elabel.te
Normal file
12
sepolicy/private/init_elabel.te
Normal file
@@ -0,0 +1,12 @@
|
||||
# /system/bin/init.elabel.sh
|
||||
#
|
||||
# write data from /persist/elabel to /data/misc/elabel for use by
|
||||
# settings app
|
||||
#
|
||||
init_daemon_domain(init_elabel)
|
||||
|
||||
allow init_elabel shell_exec:file rx_file_perms;
|
||||
allow init_elabel toolbox_exec:file rx_file_perms;
|
||||
|
||||
allow init_elabel elabel_data_file:dir rw_dir_perms;
|
||||
allow init_elabel elabel_data_file:file create_file_perms;
|
||||
3
sepolicy/private/priv_app.te
Normal file
3
sepolicy/private/priv_app.te
Normal file
@@ -0,0 +1,3 @@
|
||||
dontaudit priv_app device:dir read;
|
||||
dontaudit priv_app proc_interrupts:file read;
|
||||
dontaudit priv_app proc_modules:file read;
|
||||
1
sepolicy/private/property.te
Normal file
1
sepolicy/private/property.te
Normal file
@@ -0,0 +1 @@
|
||||
type ramoops_prop, property_type;
|
||||
1
sepolicy/private/property_contexts
Normal file
1
sepolicy/private/property_contexts
Normal file
@@ -0,0 +1 @@
|
||||
sys.ramoops. u:object_r:ramoops_prop:s0
|
||||
1
sepolicy/private/radio.te
Normal file
1
sepolicy/private/radio.te
Normal file
@@ -0,0 +1 @@
|
||||
allow radio uce_service:service_manager find;
|
||||
20
sepolicy/private/ramoops.te
Normal file
20
sepolicy/private/ramoops.te
Normal file
@@ -0,0 +1,20 @@
|
||||
type ramoops, domain, coredomain;
|
||||
type ramoops_data_file, file_type, data_file_type;
|
||||
type ramoops_exec, exec_type, file_type;
|
||||
|
||||
init_daemon_domain(ramoops);
|
||||
|
||||
# kmod=crypto-gcm(aes)
|
||||
dontaudit ramoops kernel:system module_request;
|
||||
|
||||
allow ramoops ramoops_exec:file rx_file_perms;
|
||||
allow ramoops shell_exec:file rx_file_perms;
|
||||
allow ramoops toolbox_exec:file rx_file_perms;
|
||||
|
||||
# Set the sys.ramoops.decrypted property
|
||||
set_prop(ramoops, ramoops_prop);
|
||||
|
||||
allow ramoops sysfs_pstore:file rw_file_perms;
|
||||
allow ramoops ramoops_device:chr_file rw_file_perms;
|
||||
allow ramoops ramoops_data_file:file create_file_perms;
|
||||
allow ramoops ramoops_data_file:dir rw_dir_perms;
|
||||
2
sepolicy/private/service.te
Normal file
2
sepolicy/private/service.te
Normal file
@@ -0,0 +1,2 @@
|
||||
type cne_service, service_manager_type;
|
||||
type uce_service, service_manager_type;
|
||||
4
sepolicy/private/service_contexts
Normal file
4
sepolicy/private/service_contexts
Normal file
@@ -0,0 +1,4 @@
|
||||
qti.ims.ext u:object_r:radio_service:s0
|
||||
cneservice u:object_r:cne_service:s0
|
||||
uce u:object_r:uce_service:s0
|
||||
rcs u:object_r:radio_service:s0
|
||||
1
sepolicy/private/system_server.te
Normal file
1
sepolicy/private/system_server.te
Normal file
@@ -0,0 +1 @@
|
||||
binder_call(system_server, folio_daemon)
|
||||
2
sepolicy/private/untrusted_app_all.te
Normal file
2
sepolicy/private/untrusted_app_all.te
Normal file
@@ -0,0 +1,2 @@
|
||||
# suppress spurious denials
|
||||
dontaudit untrusted_app_all sysfs_zram:dir search;
|
||||
1
sepolicy/public/dataservice_app.te
Normal file
1
sepolicy/public/dataservice_app.te
Normal file
@@ -0,0 +1 @@
|
||||
type dataservice_app, domain;
|
||||
2
sepolicy/public/file.te
Normal file
2
sepolicy/public/file.te
Normal file
@@ -0,0 +1,2 @@
|
||||
type elabel_data_file, file_type, data_file_type;
|
||||
type sysfs_pstore, sysfs_type, fs_type;
|
||||
2
sepolicy/public/hwservice.te
Normal file
2
sepolicy/public/hwservice.te
Normal file
@@ -0,0 +1,2 @@
|
||||
type hal_cne_hwservice, hwservice_manager_type;
|
||||
type hal_imsrcsd_hwservice, hwservice_manager_type;
|
||||
7
sepolicy/public/init_elabel.te
Normal file
7
sepolicy/public/init_elabel.te
Normal file
@@ -0,0 +1,7 @@
|
||||
# /system/bin/init.elabel.sh
|
||||
#
|
||||
# write data from /persist/elabel to /data/misc/elabel for use by
|
||||
# settings app
|
||||
#
|
||||
type init_elabel, domain, coredomain;
|
||||
type init_elabel_exec, exec_type, file_type;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user