Compare commits
76 Commits
vic
...
bka-backup
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10586a9d4a | ||
|
|
213053b2e3 | ||
|
|
ce5d0c333f | ||
|
|
e8da85fd96 | ||
|
|
34d8554510 | ||
|
|
b277f8c03e | ||
|
|
7b575ce1eb | ||
|
|
37a7dd6cfb | ||
|
|
f03e83d1e1 | ||
|
|
c1b0ecc377 | ||
|
|
7aa4220185 | ||
|
|
7c63bfebaa | ||
|
|
c4e96fd547 | ||
|
|
129fdb00e4 | ||
|
|
b44aed089a | ||
|
|
afef2a1d6f | ||
|
|
d70d2d17d3 | ||
|
|
b6efc02294 | ||
|
|
5d82c74ffb | ||
| 890393a955 | |||
|
|
e4e29defad | ||
|
|
b0a455e0b8 | ||
|
|
3967a9b37f | ||
|
|
b9551ec7b2 | ||
|
|
9839b86f36 | ||
|
|
3728b1aea2 | ||
|
|
5e170e74b3 | ||
|
|
d7b1c2071f | ||
|
|
d1362347cd | ||
|
|
e86c2261b6 | ||
|
|
740b46504e | ||
|
|
3fcf8d108e | ||
|
|
bccfa62cd8 | ||
|
|
9cbeaf7f9a | ||
|
|
a8876fd7e7 | ||
|
|
bfa2e40a46 | ||
|
|
c997706fe1 | ||
|
|
7bca1e3cbd | ||
|
|
eae47e3ba2 | ||
|
|
3b12dc0491 | ||
|
|
b9141a9f34 | ||
|
|
d5b0780c14 | ||
|
|
51e6b220d3 | ||
|
|
1990a776fb | ||
|
|
3b20b70f4d | ||
|
|
3e49ec97fe | ||
|
|
028c7ee1bd | ||
|
|
631486dfff | ||
|
|
f8d7219744 | ||
|
|
d852fdcb29 | ||
|
|
1e298d14a6 | ||
|
|
cfba3aaf95 | ||
|
|
8f96a9bf71 | ||
|
|
a54e5c546c | ||
|
|
35b87f7c6d | ||
|
|
0684cf355a | ||
|
|
ffd1ddfbf9 | ||
|
|
e005ad2aa1 | ||
|
|
a8c5e9bdd5 | ||
|
|
5a2b337dbc | ||
|
|
8e19cbb0a5 | ||
|
|
c5ea61e49f | ||
|
|
be8403dea6 | ||
|
|
bccca041aa | ||
|
|
4f22c6fe43 | ||
|
|
025b4df531 | ||
|
|
195e21ae45 | ||
|
|
57f7fb9151 | ||
|
|
e5405be694 | ||
|
|
e455368c95 | ||
|
|
0a8fe4c93c | ||
|
|
0b3cef643a | ||
|
|
a31601d296 | ||
|
|
0de72b411d | ||
|
|
d94aacfeb1 | ||
|
|
98dd114623 |
@@ -2,6 +2,7 @@ soong_namespace {
|
||||
imports: [
|
||||
"hardware/google/interfaces",
|
||||
"hardware/google/pixel",
|
||||
"bootable/deprecated-ota",
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
@@ -32,19 +32,24 @@ BUILD_BROKEN_INCORRECT_PARTITION_IMAGES := true
|
||||
|
||||
# Architecture
|
||||
TARGET_ARCH := arm64
|
||||
TARGET_ARCH_VARIANT := armv8-a
|
||||
TARGET_ARCH_VARIANT := armv8-2a-dotprod
|
||||
TARGET_CPU_ABI := arm64-v8a
|
||||
TARGET_CPU_ABI2 :=
|
||||
TARGET_CPU_VARIANT := generic
|
||||
TARGET_CPU_VARIANT := cortex-a76
|
||||
TARGET_CPU_VARIANT_RUNTIME := cortex-a76
|
||||
|
||||
TARGET_2ND_ARCH := arm
|
||||
TARGET_2ND_ARCH_VARIANT := armv8-a
|
||||
TARGET_2ND_ARCH_VARIANT := armv8-2a
|
||||
TARGET_2ND_CPU_ABI := armeabi-v7a
|
||||
TARGET_2ND_CPU_ABI2 := armeabi
|
||||
TARGET_2ND_CPU_VARIANT := generic
|
||||
TARGET_2ND_CPU_VARIANT := cortex-a76
|
||||
TARGET_2ND_CPU_VARIANT_RUNTIME := cortex-a76
|
||||
|
||||
# ART
|
||||
WITH_DEXPREOPT := true
|
||||
DEX_PREOPT_DEFAULT := generate-vdex-and-image
|
||||
WITH_DEXPREOPT_DEBUG_INFO := false
|
||||
|
||||
# Audio
|
||||
AUDIO_FEATURE_ENABLED_EXTN_FORMATS := true
|
||||
AUDIO_FEATURE_ENABLED_HDMI_SPK := true
|
||||
@@ -96,7 +101,6 @@ BOARD_HAVE_QCOM_FM := true
|
||||
DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := \
|
||||
hardware/qcom-caf/common/vendor_framework_compatibility_matrix.xml \
|
||||
hardware/qcom-caf/common/vendor_framework_compatibility_matrix_legacy.xml \
|
||||
vendor/lineage/config/device_framework_matrix.xml \
|
||||
$(COMMON_PATH)/framework_compatibility_matrix.xml
|
||||
|
||||
DEVICE_MANIFEST_FILE := \
|
||||
@@ -108,6 +112,9 @@ DEVICE_MATRIX_FILE := \
|
||||
ODM_MANIFEST_SKUS := nfc
|
||||
ODM_MANIFEST_NFC_FILES := $(COMMON_PATH)/manifest_nfc.xml
|
||||
|
||||
# HWUI
|
||||
HWUI_COMPILE_FOR_PERF := true
|
||||
|
||||
# Kernel
|
||||
BOARD_KERNEL_BASE := 0x00000000
|
||||
BOARD_KERNEL_IMAGE_NAME := Image.gz
|
||||
|
||||
6
audio/vendor/audio_effects.xml
vendored
6
audio/vendor/audio_effects.xml
vendored
@@ -52,6 +52,9 @@
|
||||
<!--DOLBY VQE-->
|
||||
<library name="vqe" path="libswvqe.so"/>
|
||||
<!--DOLBY END-->
|
||||
<!--Spatial Audio-->
|
||||
<library name="spatializer" path="libspatialaudio.so"/>
|
||||
<!--Spatial Audio-->
|
||||
</libraries>
|
||||
<effects>
|
||||
<effectProxy name="bassboost" library="proxy" uuid="14804144-a5ee-4d24-aa88-0002a5d5c51b">
|
||||
@@ -116,6 +119,9 @@
|
||||
<!--DOLBY VQE-->
|
||||
<effect name="vqe" library="vqe" uuid="64a0f614-7fa4-48b8-b081-d59dc954616f"/>
|
||||
<!--DOLBY END-->
|
||||
<!--Spatial Audio-->
|
||||
<effect name="spatializer" library="spatializer" uuid="cc4677de-ff72-11eb-9a03-0242ac130003"/>
|
||||
<!--Spatial Audio-->
|
||||
</effects>
|
||||
<postprocess>
|
||||
<stream type="music">
|
||||
|
||||
22
audio/vendor/audio_policy_configuration.xml
vendored
22
audio/vendor/audio_policy_configuration.xml
vendored
@@ -81,6 +81,12 @@
|
||||
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</mixPort>
|
||||
<mixPort name="hifi_playback" role="source" />
|
||||
<!--Spatial Audio-->
|
||||
<mixPort name="immersive_out" role="source" flags="AUDIO_OUTPUT_FLAG_SPATIALIZER">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
|
||||
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
<!--Spatial Audio-->
|
||||
</mixPort>
|
||||
<mixPort name="compress_passthrough" role="source"
|
||||
flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING">
|
||||
<profile name="" format="dynamic"
|
||||
@@ -322,11 +328,11 @@
|
||||
<route type="mix" sink="Earpiece"
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out"/>
|
||||
<route type="mix" sink="Speaker"
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out"/>
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,immersive_out"/>
|
||||
<route type="mix" sink="Wired Headset"
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,dsd_compress_passthrough,voip_rx,mmap_no_irq_out"/>
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,dsd_compress_passthrough,voip_rx,mmap_no_irq_out,immersive_out"/>
|
||||
<route type="mix" sink="Wired Headphones"
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,dsd_compress_passthrough,voip_rx,mmap_no_irq_out"/>
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,dsd_compress_passthrough,voip_rx,mmap_no_irq_out,immersive_out"/>
|
||||
<route type="mix" sink="Line"
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,dsd_compress_passthrough,voip_rx,mmap_no_irq_out"/>
|
||||
<route type="mix" sink="HDMI"
|
||||
@@ -336,15 +342,15 @@
|
||||
<route type="mix" sink="FM"
|
||||
sources="primary output"/>
|
||||
<route type="mix" sink="BT SCO"
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx"/>
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,immersive_out"/>
|
||||
<route type="mix" sink="BT SCO Headset"
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx"/>
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,immersive_out"/>
|
||||
<route type="mix" sink="BT SCO Car Kit"
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx"/>
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,immersive_out"/>
|
||||
<route type="mix" sink="USB Device Out"
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,hifi_playback"/>
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,hifi_playback,immersive_out"/>
|
||||
<route type="mix" sink="USB Headset Out"
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,hifi_playback"/>
|
||||
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,hifi_playback,immersive_out"/>
|
||||
#else VENDOR_EDIT -->
|
||||
<route type="mix" sink="Earpiece"
|
||||
sources="primary output,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out"/>
|
||||
|
||||
60
common.mk
60
common.mk
@@ -22,6 +22,9 @@ $(call inherit-product, hardware/qcom-caf/common/common.mk)
|
||||
# UDFPS
|
||||
$(call soong_config_set,surfaceflinger,udfps_lib,//$(LOCAL_PATH):libudfps_extension.realme_sm7125)
|
||||
|
||||
# speaker layout channel mask
|
||||
$(call soong_config_set,android_hardware_audio,skip_speaker_layout_channel_mask_field,true)
|
||||
|
||||
# Partitions
|
||||
PRODUCT_USE_DYNAMIC_PARTITIONS := true
|
||||
PRODUCT_BOARD_PLATFORM := atoll
|
||||
@@ -66,12 +69,6 @@ PRODUCT_COPY_FILES += \
|
||||
$(call find-copy-subdir-files,*,$(LOCAL_PATH)/audio/odm/,$(TARGET_COPY_OUT_ODM)/etc) \
|
||||
$(call find-copy-subdir-files,*,$(LOCAL_PATH)/audio/vendor/,$(TARGET_COPY_OUT_VENDOR)/etc)
|
||||
|
||||
# AVB
|
||||
#PRODUCT_PACKAGES += \
|
||||
# q-gsi.avbpubkey \
|
||||
# r-gsi.avbpubkey \
|
||||
# s-gsi.avbpubkey
|
||||
|
||||
# Bluetooth
|
||||
PRODUCT_PACKAGES += \
|
||||
audio.bluetooth.default
|
||||
@@ -90,10 +87,6 @@ PRODUCT_COPY_FILES += \
|
||||
TARGET_SCREEN_HEIGHT := 2400
|
||||
TARGET_SCREEN_WIDTH := 1080
|
||||
|
||||
# Call recording
|
||||
#PRODUCT_PACKAGES += \
|
||||
# com.google.android.apps.dialer.call_recording_audio.features.xml
|
||||
|
||||
# Camera
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.camera.provider@2.4-impl \
|
||||
@@ -109,9 +102,14 @@ PRODUCT_COPY_FILES += \
|
||||
#CertifiedProps
|
||||
$(call inherit-product-if-exists, vendor/certprops/Android.mk)
|
||||
|
||||
# Display
|
||||
# Config Store
|
||||
PRODUCT_PACKAGES += \
|
||||
disable_configstore \
|
||||
vendor.qti.hardware.capabilityconfigstore@1.0 \
|
||||
vendor.qti.hardware.capabilityconfigstore@1.0.vendor
|
||||
|
||||
# Display
|
||||
PRODUCT_PACKAGES += \
|
||||
gralloc.qcom \
|
||||
hwcomposer.qcom \
|
||||
libdisplayconfig.qti \
|
||||
@@ -189,8 +187,8 @@ PRODUCT_COPY_FILES += \
|
||||
|
||||
# Health
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.health@2.1-impl-qti \
|
||||
android.hardware.health@2.1-service
|
||||
android.hardware.health-service.qti \
|
||||
android.hardware.health-service.qti_recovery
|
||||
|
||||
# HIDL
|
||||
PRODUCT_PACKAGES += \
|
||||
@@ -232,9 +230,11 @@ PRODUCT_PACKAGES += \
|
||||
init.qcom.usb.rc \
|
||||
init.sm7125.rc
|
||||
|
||||
# Recovery init script
|
||||
# Recovery
|
||||
PRODUCT_PACKAGES += \
|
||||
init.recovery.qcom.sh
|
||||
init.recovery.qcom.sh \
|
||||
init.recovery.qcom.rc \
|
||||
init.recovery.usb.rc
|
||||
|
||||
# Vendor shell scripts
|
||||
PRODUCT_PACKAGES += \
|
||||
@@ -271,9 +271,11 @@ PRODUCT_PACKAGES += \
|
||||
#Lawnchair
|
||||
$(call inherit-product-if-exists, vendor/lawnchair/lawnchair.mk)
|
||||
|
||||
# LiveDisplay
|
||||
# PRODUCT_PACKAGES += \
|
||||
# vendor.lineage.livedisplay@2.0-service-sdm
|
||||
#LiveDisplay
|
||||
PRODUCT_PACKAGES += \
|
||||
vendor.lineage.livedisplay-service.sdm
|
||||
|
||||
$(call soong_config_set,livedisplay_sdm,enable_dm,false)
|
||||
|
||||
# Media
|
||||
PRODUCT_PACKAGES += \
|
||||
@@ -329,7 +331,8 @@ PRODUCT_PACKAGES += \
|
||||
# Overlays
|
||||
DEVICE_PACKAGE_OVERLAYS += \
|
||||
$(LOCAL_PATH)/overlay \
|
||||
$(LOCAL_PATH)/overlay-lineage
|
||||
$(LOCAL_PATH)/overlay-lineage \
|
||||
$(LOCAL_PATH)/overlay-evolution
|
||||
|
||||
# Perf
|
||||
PRODUCT_PACKAGES += \
|
||||
@@ -345,7 +348,6 @@ PRODUCT_PROPERTY_OVERRIDES += \
|
||||
# Power
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.power-service.lineage-libperfmgr \
|
||||
android.hardware.power@1.2.vendor \
|
||||
libqti-perfd-client
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
@@ -383,8 +385,8 @@ PRODUCT_PACKAGES += \
|
||||
|
||||
# Sensors
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.sensors@2.0-service.multihal_realme_sm7125
|
||||
|
||||
android.hardware.sensors-service.multihal
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
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 \
|
||||
@@ -402,12 +404,16 @@ PRODUCT_PACKAGES += \
|
||||
vendor.qti.hardware.servicetracker@1.1.vendor \
|
||||
vendor.qti.hardware.servicetracker@1.2.vendor
|
||||
|
||||
# Disable Scudo to save RAM.
|
||||
PRODUCT_DISABLE_SCUDO := true
|
||||
|
||||
# Soong namespaces
|
||||
PRODUCT_SOONG_NAMESPACES += \
|
||||
$(LOCAL_PATH) \
|
||||
kernel/realme/sm7125 \
|
||||
hardware/google/interfaces \
|
||||
hardware/google/pixel \
|
||||
bootable/deprecated-ota \
|
||||
hardware/lineage/interfaces/power-libperfmgr \
|
||||
hardware/oplus \
|
||||
hardware/qcom-caf/common/libqti-perfd-client
|
||||
@@ -454,10 +460,6 @@ PRODUCT_PACKAGES += \
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.thermal-service.qti
|
||||
|
||||
# TextClassifier
|
||||
#PRODUCT_PACKAGES += \
|
||||
# textclassifier.bundle1
|
||||
|
||||
# Touchscreen
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml
|
||||
@@ -477,6 +479,9 @@ PRODUCT_COPY_FILES += \
|
||||
PRODUCT_PACKAGES += \
|
||||
vendor.qti.hardware.vibrator.service
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
vendor/qcom/opensource/vibrator/excluded-input-devices.xml:$(TARGET_COPY_OUT_VENDOR)/etc/excluded-input-devices.xml
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
prebuilts/vndk/v30/arm64/arch-arm64-armv8-a/shared/vndk-core/libgui.so:$(TARGET_COPY_OUT_SYSTEM)/lib64/libxxx.so \
|
||||
prebuilts/vndk/v30/arm64/arch-arm-armv8-a/shared/vndk-core/libgui.so:$(TARGET_COPY_OUT_SYSTEM)/lib/libxxx.so \
|
||||
@@ -525,9 +530,6 @@ PRODUCT_PACKAGES += \
|
||||
firmware_wlan_mac.bin_symlink \
|
||||
firmware_WCNSS_qcom_cfg.ini_symlink
|
||||
|
||||
#PRODUCT_BOOT_JARS += \
|
||||
WfdCommon
|
||||
|
||||
# Build Specific VNDK 30 Libs for Android 12+
|
||||
PRODUCT_PACKAGES += \
|
||||
android.frameworks.automotive.display@1.0.vendor \
|
||||
|
||||
2
configs/media/vendor/media_codecs_c2.xml
vendored
2
configs/media/vendor/media_codecs_c2.xml
vendored
@@ -64,7 +64,7 @@
|
||||
<Limit name="size" min="96x96" max="4096x2160" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" range="24-979200" />
|
||||
<Limit name="blocks-per-second" range="36-979200" />
|
||||
<Limit name="bitrate" range="1-100000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
[
|
||||
{
|
||||
"repository": "crdroidandroid/android_hardware_dolby",
|
||||
"target_path": "hardware/dolby",
|
||||
"branch": "15.0"
|
||||
}
|
||||
]
|
||||
@@ -2,7 +2,10 @@ service vendor.fps_hal.realme_sm7125 /vendor/bin/hw/android.hardware.biometrics.
|
||||
# "class hal" causes a race condition on some devices due to files created
|
||||
# in /data. As a workaround, postpone startup until later in boot once
|
||||
# /data is mounted.
|
||||
class late_start
|
||||
class hal
|
||||
user system
|
||||
group system input uhid
|
||||
writepid /dev/cpuset/system-background/tasks
|
||||
|
||||
on post-fs-data
|
||||
start vendor.fps_hal.realme_sm7125
|
||||
|
||||
@@ -659,15 +659,6 @@
|
||||
<instance>oplus_slot2</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<!-- <hal format="hidl">
|
||||
<name>vendor.lineage.livedisplay</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>IPictureAdjustment</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal> -->
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.data.iwlan</name>
|
||||
<transport>hwbinder</transport>
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2019-2025 The Evolution X Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
|
||||
<!-- Android version screen, build maintainer -->
|
||||
<string name="build_maintainer_summary" translatable="false">SHAHID_SHAMIM</string>
|
||||
<string name="build_maintainer_donate_url" translatable="false">https://paypal.me/shaenix</string>
|
||||
</resources>
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2020 The LineageOS Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<!-- Defines the location of the fingerprint sensor on the device
|
||||
0 = back
|
||||
1 = front
|
||||
2 = left side
|
||||
3 = right side
|
||||
-->
|
||||
<integer name="config_fingerprintSensorLocation">3</integer>
|
||||
</resources>
|
||||
@@ -1,17 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2020 The LineageOS 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.
|
||||
Copyright (C) 2022-2024 The LineageOS Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<!-- Whether a software navigation bar should be shown. NOTE: in the future this may be
|
||||
autodetected from the Configuration. -->
|
||||
@@ -21,9 +13,6 @@
|
||||
<!-- The restoring is handled by modem if it is true-->
|
||||
<bool 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>
|
||||
|
||||
<!-- M user agent string -->
|
||||
<string name="config_mms_user_agent">Android-Mms/2.0</string>
|
||||
|
||||
@@ -161,6 +150,9 @@
|
||||
Doze dreams will run whenever the power manager is in a dozing state. -->
|
||||
<string name="config_dozeComponent">com.android.systemui/com.android.systemui.doze.DozeService</string>
|
||||
|
||||
<!-- Doze: should the TYPE_PICK_UP_GESTURE sensor be used as a pulse signal. -->
|
||||
<bool name="config_dozePulsePickup">true</bool>
|
||||
|
||||
<!-- 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_dozeAfterScreenOffByDefault">true</bool>
|
||||
@@ -218,10 +210,6 @@
|
||||
on the headphone/microphone jack. When false use the older uevent framework. -->
|
||||
<bool name="config_useDevInputEventForAudioJack">true</bool>
|
||||
|
||||
<!-- Boolean indicating whether the HWC setColorTransform function can be performed efficiently
|
||||
in hardware. -->
|
||||
<bool name="config_setColorTransformAccelerated">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>
|
||||
@@ -366,11 +354,6 @@
|
||||
Equivalent to 67/255 (default for this device) -->
|
||||
<integer name="config_screenBrightnessSettingDefault">45</integer>
|
||||
|
||||
<!-- Vibrator pattern for a very short but reliable vibration for soft keyboard tap -->
|
||||
<integer-array name="config_keyboardTapVibePattern">
|
||||
<item>40</item>
|
||||
</integer-array>
|
||||
|
||||
<!-- Vibrator pattern for feedback about a long screen/key press -->
|
||||
<integer-array name="config_longPressVibePattern">
|
||||
<item>0</item>
|
||||
@@ -434,22 +417,58 @@
|
||||
|
||||
<!-- Default list of files pinned by the Pinner Service -->
|
||||
<string-array translatable="false" name="config_defaultPinnerServiceFiles">
|
||||
<item>"/apex/com.android.art/javalib/core-libart.jar"</item>
|
||||
<item>"/apex/com.android.art/javalib/core-oj.jar"</item>
|
||||
<item>"/apex/com.android.art/javalib/core-libart.jar"</item>
|
||||
<item>"/system_ext/priv-app/SystemUI/SystemUI.apk"</item>
|
||||
<item>"/system/bin/surfaceflinger"</item>
|
||||
<item>"/system/framework/boot-framework.vdex"</item>
|
||||
<item>"/system/framework/ext.jar"</item>
|
||||
<item>"/system/framework/framework-res.apk"</item>
|
||||
<item>"/system/framework/framework.jar"</item>
|
||||
<item>"/system/framework/services.jar"</item>
|
||||
<item>"/system/framework/ext.jar"</item>
|
||||
<item>"/system/framework/telephony-common.jar"</item>
|
||||
<item>"/system/lib/libEGL.so"</item>
|
||||
<item>"/system/lib/libGLESv1_CM.so"</item>
|
||||
<item>"/system/lib/libGLESv2.so"</item>
|
||||
<item>"/system/lib/libGLESv3.so"</item>
|
||||
<item>"/system/lib/libgui.so"</item>
|
||||
<item>"/system/lib/libhwui.so"</item>
|
||||
<item>"/system/lib/libui.so"</item>
|
||||
<item>"/system/lib/libvulkan.so"</item>
|
||||
<item>"/system/lib64/libEGL.so"</item>
|
||||
<item>"/system/lib64/libGLESv1_CM.so"</item>
|
||||
<item>"/system/lib64/libGLESv2.so"</item>
|
||||
<item>"/system/lib64/libGLESv3.so"</item>
|
||||
<item>"/system/lib64/libgui.so"</item>
|
||||
<item>"/system/lib64/libhwui.so"</item>
|
||||
<item>"/system_ext/priv-app/SystemUI/SystemUI.apk"</item>
|
||||
<item>"/system/lib64/libui.so"</item>
|
||||
<item>"/system/lib64/libvulkan.so"</item>
|
||||
<item>"/vendor/lib/egl/eglSubDriverAndroid.so"</item>
|
||||
<item>"/vendor/lib/egl/libEGL_adreno.so"</item>
|
||||
<item>"/vendor/lib/egl/libGLESv1_CM_adreno.so"</item>
|
||||
<item>"/vendor/lib/egl/libGLESv2_adreno.so"</item>
|
||||
<item>"/vendor/lib/hw/vulkan.adreno.so"</item>
|
||||
<item>"/vendor/lib/libCB.so"</item>
|
||||
<item>"/vendor/lib/libOpenCL.so"</item>
|
||||
<item>"/vendor/lib/libadreno_utils.so"</item>
|
||||
<item>"/vendor/lib/libgsl.so"</item>
|
||||
<item>"/vendor/lib/libllvm-glnext.so"</item>
|
||||
<item>"/vendor/lib/libllvm-qcom.so"</item>
|
||||
<item>"/vendor/lib64/egl/eglSubDriverAndroid.so"</item>
|
||||
<item>"/vendor/lib64/egl/libEGL_adreno.so"</item>
|
||||
<item>"/vendor/lib64/egl/libGLESv1_CM_adreno.so"</item>
|
||||
<item>"/vendor/lib64/egl/libGLESv2_adreno.so"</item>
|
||||
<item>"/vendor/lib64/hw/vulkan.adreno.so"</item>
|
||||
<item>"/vendor/lib64/libCB.so"</item>
|
||||
<item>"/vendor/lib64/libOpenCL.so"</item>
|
||||
<item>"/vendor/lib64/libadreno_utils.so"</item>
|
||||
<item>"/vendor/lib64/libgsl.so"</item>
|
||||
<item>"/vendor/lib64/libllvm-qgl.so"</item>
|
||||
<item>"/vendor/lib64/libllvm-glnext.so"</item>
|
||||
<item>"/vendor/lib64/libllvm-qcom.so"</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Should the pinner service pin the Home application? -->
|
||||
<bool name="config_pinnerHomeApp">true</bool>
|
||||
<!-- Bytes that the PinnerService will pin for Home app -->
|
||||
<integer name="config_pinnerHomePinBytes">6291456</integer>
|
||||
|
||||
<!-- List of files pinned by the Pinner Service with the JIT Zygote boot image b/119800099 -->
|
||||
<string-array translatable="false" name="config_jitzygoteBootImagePinnerServiceFiles">
|
||||
@@ -502,9 +521,6 @@
|
||||
available on some devices. -->
|
||||
<bool name="config_enableHapticTextHandle">true</bool>
|
||||
|
||||
<!-- Enable Zram writeback feature to allow unused pages in zram be written to flash. -->
|
||||
<bool name="config_zramWriteback">true</bool>
|
||||
|
||||
<!-- Whether to post reset runnable for all clients. Needed for some older
|
||||
vendor fingerprint HAL implementations. -->
|
||||
<bool name="config_fingerprintPostResetRunnableForAllClients">true</bool>
|
||||
@@ -550,9 +566,6 @@
|
||||
<!-- Whether to show min/max refresh rate in display settings -->
|
||||
<bool name="config_show_refresh_rate_controls">true</bool>
|
||||
|
||||
<!-- Indicates whether device has a power button fingerprint sensor. -->
|
||||
<bool name="config_is_powerbutton_fps" translatable="false" >true</bool>
|
||||
|
||||
<!-- Control the behavior when the user long presses the power button.
|
||||
0 - Nothing
|
||||
1 - Global actions menu
|
||||
@@ -568,6 +581,8 @@
|
||||
manager will disable alpha trasformation in animations where not
|
||||
strictly needed. -->
|
||||
<bool name="config_sf_limitedAlpha">true</bool>
|
||||
<!-- Whether the new Auto Selection Network UI should be shown -->
|
||||
<bool name="config_enableNewAutoSelectNetworkUI">true</bool>
|
||||
|
||||
<!-- Package name of a telephony-related system app, such as an IMS service.
|
||||
Exempted from privacy indicators. -->
|
||||
@@ -592,4 +607,23 @@
|
||||
|
||||
<!-- Whether we use large screen shade header which takes only one row compared to QS header -->
|
||||
<bool name="config_use_large_screen_shade_header">true</bool>
|
||||
|
||||
|
||||
<!-- Whether WiFi display is supported by this device.
|
||||
There are many prerequisites for this feature to work correctly.
|
||||
Here are a few of them:
|
||||
* The WiFi radio must support WiFi P2P.
|
||||
* The WiFi radio must support concurrent connections to the WiFi display and
|
||||
to an access point.
|
||||
* The Audio Server audio_policy_configuration.xml file must specify a rule for
|
||||
the "r_submix" remote submix module. This module is used to record and stream system
|
||||
audio output to the WiFi display encoder in the media server.
|
||||
* The remote submix module "audio.r_submix.default" must be installed on the device.
|
||||
* The device must be provisioned with HDCP keys (for protected content).
|
||||
-->
|
||||
<bool name="config_enableWifiDisplay">true</bool>
|
||||
|
||||
<!-- Whether WM DisplayContent supports high performance transitions
|
||||
(lower-end devices may want to disable) -->
|
||||
<bool name="config_deviceSupportsHighPerfTransitions">false</bool>
|
||||
</resources>
|
||||
@@ -15,10 +15,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<!-- Height of the status bar. Do not read this dimen directly. Use {@link SystemBarUtils#getStatusBarHeight} instead.-->
|
||||
|
||||
<dimen name="status_bar_height">100px</dimen>
|
||||
|
||||
<!-- Height of the status bar in portrait -->
|
||||
<dimen name="status_bar_height_portrait">110px</dimen>
|
||||
<dimen name="status_bar_height_portrait">100px</dimen>
|
||||
|
||||
<!-- Height of the status bar in landscape -->
|
||||
<dimen name="status_bar_height_landscape">82px</dimen>
|
||||
|
||||
@@ -39,5 +39,7 @@
|
||||
|
||||
<!-- Enable vibrate for calls by default -->
|
||||
<bool name="def_vibrate_when_ringing">true</bool>
|
||||
|
||||
|
||||
<!-- Speed up the animations -->
|
||||
<fraction name="def_window_transition_scale">50%</fraction>
|
||||
</resources>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<dimen name="status_bar_padding_end">16px</dimen>
|
||||
|
||||
<!-- the padding on the top of the statusbar -->
|
||||
<dimen name="status_bar_padding_top">8dp</dimen>
|
||||
<dimen name="status_bar_padding_top">4dp</dimen>
|
||||
|
||||
<!-- Starting padding for a left-aligned status bar clock -->
|
||||
<dimen name="status_bar_left_clock_starting_padding">6px</dimen>
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Enable auxiliary cameras selector. -->
|
||||
<bool name="config_enableAuxCameras">true</bool>
|
||||
|
||||
<!-- List of ID of auxiliary cameras that must be ignored by the app. -->
|
||||
|
||||
<string-array name="config_ignoredAuxCameraIds">
|
||||
<item>6</item>
|
||||
<item>7</item>
|
||||
</string-array>
|
||||
|
||||
<!-- List of ID of camera devices that doesn't advertise
|
||||
REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE yet are
|
||||
able to produce a JPEG or a YUV stream. The camera IDs specified
|
||||
here won't be excluded by CameraX. Please be sure to test all
|
||||
modes exposed by the app with those cameras. -->
|
||||
<!-- <string-array name="config_backwardCompatibleCameraIds">
|
||||
<item>30</item>
|
||||
</string-array> -->
|
||||
|
||||
<!-- New flag to allow aperture in aux package allowlist -->
|
||||
<bool name="config_cameraAuxPackageAllowlist">true</bool>
|
||||
</resources>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -24,14 +24,6 @@
|
||||
devices will be able to vary their amplitude but do not possess enough dynamic range to
|
||||
have distinct intensity levels -->
|
||||
<bool name="config_vibration_supports_multiple_intensities">true</bool>
|
||||
|
||||
<!-- Defines the location of the fingerprint sensor on the device
|
||||
0 = back
|
||||
1 = front
|
||||
2 = left side
|
||||
3 = right side
|
||||
-->
|
||||
<integer name="config_fingerprintSensorLocation">3</integer>
|
||||
|
||||
<!-- Whether this device is supporting the microphone toggle -->
|
||||
<bool name="config_supportsMicToggle">true</bool>
|
||||
|
||||
19
product.prop
19
product.prop
@@ -1,6 +1,3 @@
|
||||
# Charger
|
||||
ro.charger.enable_suspend=true
|
||||
|
||||
# Display
|
||||
debug.sf.hw=0
|
||||
debug.egl.hw=0
|
||||
@@ -22,6 +19,22 @@ vendor.display.disable_metadata_dynamic_fps=1
|
||||
|
||||
# LMKD
|
||||
ro.config.low_ram=false
|
||||
ro.lmk.log_stats=false
|
||||
ro.lmk.kill_heaviest_task=true
|
||||
ro.lmk.swap_free_low_percentage=100
|
||||
|
||||
# LMK tuning
|
||||
ro.lmk.filecache_min_kb=153600
|
||||
ro.lmk.stall_limit_critical=40
|
||||
ro.lmk.use_new_strategy=true
|
||||
ro.lmk.enable_watermark_check=true
|
||||
ro.lmk.enable_userspace_lmk=true
|
||||
ro.lmk.enhance_batch_kill=false
|
||||
ro.lmk.super_critical=701
|
||||
ro.lmk.kill_timeout_ms=50
|
||||
ro.lmk.psi_scrit_complete_stall_ms=150
|
||||
ro.lmk.direct_reclaim_pressure=45
|
||||
ro.lmk.reclaim_scan_threshold=0
|
||||
|
||||
# Incremental FS
|
||||
ro.incremental.enable=1
|
||||
|
||||
20
recovery/root/Android.bp
Normal file
20
recovery/root/Android.bp
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// Copyright (C) 2026 The LineageOS Project
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
prebuilt_etc {
|
||||
name: "init.recovery.qcom.rc",
|
||||
src: "init.recovery.qcom.rc",
|
||||
sub_dir: "recovery/root",
|
||||
filename: "init.recovery.qcom.rc",
|
||||
installable: true,
|
||||
}
|
||||
|
||||
prebuilt_etc {
|
||||
name: "init.recovery.usb.rc",
|
||||
src: "init.recovery.usb.rc",
|
||||
sub_dir: "recovery/root",
|
||||
filename: "init.recovery.usb.rc",
|
||||
installable: true,
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
8
rootdir/etc/vendor/init.qcom.rc
vendored
8
rootdir/etc/vendor/init.qcom.rc
vendored
@@ -122,6 +122,14 @@ on early-boot
|
||||
exec u:r:vendor_qti_init_shell:s0 -- /vendor/bin/init.qti.can.sh
|
||||
setprop ro.sf.lcd_density ${vendor.display.lcd_density}
|
||||
|
||||
# SSR
|
||||
write /sys/bus/msm_subsys/devices/subsys0/restart_level RELATED
|
||||
write /sys/bus/msm_subsys/devices/subsys1/restart_level RELATED
|
||||
write /sys/bus/msm_subsys/devices/subsys2/restart_level RELATED
|
||||
write /sys/bus/msm_subsys/devices/subsys3/restart_level RELATED
|
||||
write /sys/bus/msm_subsys/devices/subsys4/restart_level RELATED
|
||||
write /sys/bus/msm_subsys/devices/subsys5/restart_level RELATED
|
||||
|
||||
chown system system /mnt/vendor/persist/data/pfm/licenses
|
||||
chmod 0775 /mnt/vendor/persist/data/pfm/licenses
|
||||
|
||||
|
||||
116
rootdir/etc/vendor/init.target.rc
vendored
116
rootdir/etc/vendor/init.target.rc
vendored
@@ -87,122 +87,6 @@ on init
|
||||
chown cameraserver cameraserver /dev/cpuset/camera-daemon/tasks
|
||||
chmod 0660 /dev/cpuset/camera-daemon/tasks
|
||||
|
||||
on late-fs
|
||||
# Start services for bootanim
|
||||
start servicemanager
|
||||
start surfaceflinger
|
||||
start bootanim
|
||||
|
||||
on property:sys.boot_completed=1
|
||||
# Runtime fs tuning
|
||||
write /sys/block/sda/queue/nr_requests 128
|
||||
write /sys/block/sda/queue/iostats 0
|
||||
|
||||
# Block layer tuning: discard chunk size up to 128MB
|
||||
# Otherwise, contiguous discards can be merged
|
||||
write /sys/block/sda/queue/discard_max_bytes 134217728
|
||||
|
||||
# Back to default VM settings
|
||||
write /proc/sys/vm/dirty_expire_centisecs 3000
|
||||
write /proc/sys/vm/dirty_background_ratio 10
|
||||
|
||||
# Setup runtime cpusets
|
||||
write /dev/cpuset/top-app/cpus 0-7
|
||||
write /dev/cpuset/foreground/cpus 0-2,5-7
|
||||
write /dev/cpuset/background/cpus 0-3
|
||||
write /dev/cpuset/system-background/cpus 0-3
|
||||
write /dev/cpuset/restricted/cpus 0-3
|
||||
|
||||
# Setup runtime schedTune
|
||||
write /dev/stune/foreground/schedtune.prefer_idle 1
|
||||
write /dev/stune/foreground/schedtune.prefer_high_cap 0
|
||||
write /dev/stune/foreground/schedtune.boost 0
|
||||
write /dev/stune/schedtune.prefer_idle 0
|
||||
write /dev/stune/schedtune.prefer_high_cap 0
|
||||
write /dev/stune/schedtune.boost 0
|
||||
write /dev/stune/top-app/schedtune.prefer_idle 1
|
||||
write /dev/stune/top-app/schedtune.prefer_high_cap 0
|
||||
write /dev/stune/top-app/schedtune.boost 10
|
||||
|
||||
# Setup runtime blkio
|
||||
# value for group_idle is us
|
||||
write /dev/blkio/blkio.weight 1000
|
||||
write /dev/blkio/background/blkio.weight 200
|
||||
write /dev/blkio/blkio.group_idle 2000
|
||||
write /dev/blkio/background/blkio.group_idle 0
|
||||
|
||||
on early-init
|
||||
# configure governor settings
|
||||
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor schedutil
|
||||
write /sys/devices/system/cpu/cpu0/cpufreq/schedutil/up_rate_limit_us 500
|
||||
write /sys/devices/system/cpu/cpu0/cpufreq/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/cpu4/cpufreq/schedutil/up_rate_limit_us 500
|
||||
write /sys/devices/system/cpu/cpu4/cpufreq/schedutil/down_rate_limit_us 20000
|
||||
|
||||
# Disable UFS clock scaling
|
||||
write /sys/bus/platform/devices/${ro.boot.bootdevice}/clkscale_enable 0
|
||||
|
||||
on init
|
||||
# Boot time cpuset and stune
|
||||
write /dev/cpuset/top-app/cpus 0-7
|
||||
write /dev/cpuset/foreground/cpus 0-7
|
||||
write /dev/cpuset/background/cpus 0-5
|
||||
write /dev/cpuset/system-background/cpus 0-5
|
||||
write /dev/cpuset/restricted/cpus 2-5
|
||||
write /dev/stune/foreground/schedtune.prefer_idle 1
|
||||
write /dev/stune/foreground/schedtune.prefer_high_cap 1
|
||||
write /dev/stune/foreground/schedtune.boost 100
|
||||
write /dev/stune/schedtune.prefer_idle 1
|
||||
write /dev/stune/schedtune.prefer_high_cap 1
|
||||
write /dev/stune/schedtune.boost 100
|
||||
write /dev/stune/top-app/schedtune.prefer_idle 1
|
||||
write /dev/stune/top-app/schedtune.prefer_high_cap 1
|
||||
write /dev/stune/top-app/schedtune.boost 100
|
||||
|
||||
# Boot time fs tuning
|
||||
write /sys/block/sda/queue/iostats 0
|
||||
write /sys/block/sda/queue/scheduler cfq
|
||||
write /sys/block/sda/queue/iosched/slice_idle 0
|
||||
write /sys/block/sda/queue/nr_requests 256
|
||||
|
||||
# Disable UFS powersaving
|
||||
write /sys/devices/platform/soc/${ro.boot.bootdevice}/clkgate_enable 0
|
||||
|
||||
# Disable powersaving
|
||||
write /sys/module/lpm_levels/parameters/sleep_disabled 1
|
||||
|
||||
# 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
|
||||
|
||||
mkdir /dev/cpuset/camera-daemon-dedicated
|
||||
write /dev/cpuset/camera-daemon-dedicated/cpus 0-7
|
||||
write /dev/cpuset/camera-daemon-dedicated/mems 0
|
||||
chown system system /dev/cpuset/camera-daemon-dedicated
|
||||
chown system system /dev/cpuset/camera-daemon-dedicated/tasks
|
||||
chmod 0664 /dev/cpuset/camera-daemon-dedicated/tasks
|
||||
|
||||
# create an stune group for camera-specific processes
|
||||
mkdir /dev/stune/camera-daemon
|
||||
write /dev/stune/camera-daemon/schedtune.prefer_idle 1
|
||||
write /dev/stune/camera-daemon/schedtune.boost 0
|
||||
chown system system /dev/stune/camera-daemon
|
||||
chown system system /dev/stune/camera-daemon/tasks
|
||||
chmod 0664 /dev/stune/camera-daemon/tasks
|
||||
|
||||
# set default schedTune value for camera-daemon
|
||||
write /dev/stune/camera-daemon/schedtune.prefer_idle 1
|
||||
write /dev/stune/camera-daemon/schedtune.boost 0
|
||||
|
||||
on early-fs
|
||||
start vold
|
||||
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
//
|
||||
// Copyright (C) 2019 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.
|
||||
|
||||
cc_binary {
|
||||
name: "android.hardware.sensors@2.0-service.multihal_realme_sm7125",
|
||||
stem: "android.hardware.sensors@2.0-service.multihal",
|
||||
defaults: [
|
||||
"hidl_defaults",
|
||||
],
|
||||
vendor: true,
|
||||
relative_install_path: "hw",
|
||||
srcs: [
|
||||
"HalProxy.cpp",
|
||||
"HalProxyCallback.cpp",
|
||||
"service.cpp",
|
||||
],
|
||||
init_rc: ["android.hardware.sensors@2.0-service-multihal.rc"],
|
||||
vintf_fragments: ["android.hardware.sensors@2.0-multihal.xml"],
|
||||
header_libs: [
|
||||
"android.hardware.sensors@2.X-multihal.header",
|
||||
"android.hardware.sensors@2.X-shared-utils",
|
||||
],
|
||||
shared_libs: [
|
||||
"android.hardware.sensors@2.0",
|
||||
"android.hardware.sensors@2.0-ScopedWakelock",
|
||||
"android.hardware.sensors@2.1",
|
||||
"libbase",
|
||||
"libcutils",
|
||||
"libfmq",
|
||||
"libhidlbase",
|
||||
"liblog",
|
||||
"libpower",
|
||||
"libutils",
|
||||
],
|
||||
static_libs: [
|
||||
"android.hardware.sensors@1.0-convert",
|
||||
],
|
||||
}
|
||||
@@ -1,769 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019 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 "HalProxy.h"
|
||||
|
||||
#include <android/hardware/sensors/2.0/types.h>
|
||||
|
||||
#include <android-base/file.h>
|
||||
#include "hardware_legacy/power.h"
|
||||
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include <cinttypes>
|
||||
#include <cmath>
|
||||
#include <fstream>
|
||||
#include <functional>
|
||||
#include <thread>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace sensors {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::sensors::V1_0::Result;
|
||||
using ::android::hardware::sensors::V2_0::EventQueueFlagBits;
|
||||
using ::android::hardware::sensors::V2_0::WakeLockQueueFlagBits;
|
||||
using ::android::hardware::sensors::V2_0::implementation::getTimeNow;
|
||||
using ::android::hardware::sensors::V2_0::implementation::kWakelockTimeoutNs;
|
||||
|
||||
typedef V2_0::implementation::ISensorsSubHal*(SensorsHalGetSubHalFunc)(uint32_t*);
|
||||
typedef V2_1::implementation::ISensorsSubHal*(SensorsHalGetSubHalV2_1Func)(uint32_t*);
|
||||
|
||||
static constexpr int32_t kBitsAfterSubHalIndex = 24;
|
||||
|
||||
/**
|
||||
* Set the subhal index as first byte of sensor handle and return this modified version.
|
||||
*
|
||||
* @param sensorHandle The sensor handle to modify.
|
||||
* @param subHalIndex The index in the hal proxy of the sub hal this sensor belongs to.
|
||||
*
|
||||
* @return The modified sensor handle.
|
||||
*/
|
||||
int32_t setSubHalIndex(int32_t sensorHandle, size_t subHalIndex) {
|
||||
return sensorHandle | (static_cast<int32_t>(subHalIndex) << kBitsAfterSubHalIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract the subHalIndex from sensorHandle.
|
||||
*
|
||||
* @param sensorHandle The sensorHandle to extract from.
|
||||
*
|
||||
* @return The subhal index.
|
||||
*/
|
||||
size_t extractSubHalIndex(int32_t sensorHandle) {
|
||||
return static_cast<size_t>(sensorHandle >> kBitsAfterSubHalIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert nanoseconds to milliseconds.
|
||||
*
|
||||
* @param nanos The nanoseconds input.
|
||||
*
|
||||
* @return The milliseconds count.
|
||||
*/
|
||||
int64_t msFromNs(int64_t nanos) {
|
||||
constexpr int64_t nanosecondsInAMillsecond = 1000000;
|
||||
return nanos / nanosecondsInAMillsecond;
|
||||
}
|
||||
|
||||
HalProxy::HalProxy() {
|
||||
const char* kMultiHalConfigFile = "/vendor/etc/sensors/hals.conf";
|
||||
initializeSubHalListFromConfigFile(kMultiHalConfigFile);
|
||||
init();
|
||||
}
|
||||
|
||||
HalProxy::HalProxy(std::vector<ISensorsSubHalV2_0*>& subHalList) {
|
||||
for (ISensorsSubHalV2_0* subHal : subHalList) {
|
||||
mSubHalList.push_back(std::make_unique<SubHalWrapperV2_0>(subHal));
|
||||
}
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
HalProxy::HalProxy(std::vector<ISensorsSubHalV2_0*>& subHalList,
|
||||
std::vector<ISensorsSubHalV2_1*>& subHalListV2_1) {
|
||||
for (ISensorsSubHalV2_0* subHal : subHalList) {
|
||||
mSubHalList.push_back(std::make_unique<SubHalWrapperV2_0>(subHal));
|
||||
}
|
||||
|
||||
for (ISensorsSubHalV2_1* subHal : subHalListV2_1) {
|
||||
mSubHalList.push_back(std::make_unique<SubHalWrapperV2_1>(subHal));
|
||||
}
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
HalProxy::~HalProxy() {
|
||||
stopThreads();
|
||||
}
|
||||
|
||||
Return<void> HalProxy::getSensorsList_2_1(ISensorsV2_1::getSensorsList_2_1_cb _hidl_cb) {
|
||||
std::vector<V2_1::SensorInfo> sensors;
|
||||
for (const auto& iter : mSensors) {
|
||||
sensors.push_back(iter.second);
|
||||
}
|
||||
_hidl_cb(sensors);
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> HalProxy::getSensorsList(ISensorsV2_0::getSensorsList_cb _hidl_cb) {
|
||||
std::vector<V1_0::SensorInfo> sensors;
|
||||
for (const auto& iter : mSensors) {
|
||||
sensors.push_back(convertToOldSensorInfo(iter.second));
|
||||
}
|
||||
_hidl_cb(sensors);
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<Result> HalProxy::setOperationMode(OperationMode mode) {
|
||||
Result result = Result::OK;
|
||||
size_t subHalIndex;
|
||||
for (subHalIndex = 0; subHalIndex < mSubHalList.size(); subHalIndex++) {
|
||||
result = mSubHalList[subHalIndex]->setOperationMode(mode);
|
||||
if (result != Result::OK) {
|
||||
ALOGE("setOperationMode failed for SubHal: %s",
|
||||
mSubHalList[subHalIndex]->getName().c_str());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (result != Result::OK) {
|
||||
// Reset the subhal operation modes that have been flipped
|
||||
for (size_t i = 0; i < subHalIndex; i++) {
|
||||
mSubHalList[i]->setOperationMode(mCurrentOperationMode);
|
||||
}
|
||||
} else {
|
||||
mCurrentOperationMode = mode;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Return<Result> HalProxy::activate(int32_t sensorHandle, bool enabled) {
|
||||
if (!isSubHalIndexValid(sensorHandle)) {
|
||||
return Result::BAD_VALUE;
|
||||
}
|
||||
return getSubHalForSensorHandle(sensorHandle)
|
||||
->activate(clearSubHalIndex(sensorHandle), enabled);
|
||||
}
|
||||
|
||||
Return<Result> HalProxy::initialize_2_1(
|
||||
const ::android::hardware::MQDescriptorSync<V2_1::Event>& eventQueueDescriptor,
|
||||
const ::android::hardware::MQDescriptorSync<uint32_t>& wakeLockDescriptor,
|
||||
const sp<V2_1::ISensorsCallback>& sensorsCallback) {
|
||||
sp<ISensorsCallbackWrapperBase> dynamicCallback =
|
||||
new ISensorsCallbackWrapperV2_1(sensorsCallback);
|
||||
|
||||
// Create the Event FMQ from the eventQueueDescriptor. Reset the read/write positions.
|
||||
auto eventQueue =
|
||||
std::make_unique<EventMessageQueueV2_1>(eventQueueDescriptor, true /* resetPointers */);
|
||||
std::unique_ptr<EventMessageQueueWrapperBase> queue =
|
||||
std::make_unique<EventMessageQueueWrapperV2_1>(eventQueue);
|
||||
|
||||
// Create the Wake Lock FMQ from the wakeLockDescriptor. Reset the read/write positions.
|
||||
auto hidlWakeLockQueue =
|
||||
std::make_unique<WakeLockMessageQueue>(wakeLockDescriptor, true /* resetPointers */);
|
||||
std::unique_ptr<WakeLockMessageQueueWrapperBase> wakeLockQueue =
|
||||
std::make_unique<WakeLockMessageQueueWrapperHidl>(hidlWakeLockQueue);
|
||||
|
||||
return initializeCommon(queue, wakeLockQueue, dynamicCallback);
|
||||
}
|
||||
|
||||
Return<Result> HalProxy::initialize(
|
||||
const ::android::hardware::MQDescriptorSync<V1_0::Event>& eventQueueDescriptor,
|
||||
const ::android::hardware::MQDescriptorSync<uint32_t>& wakeLockDescriptor,
|
||||
const sp<V2_0::ISensorsCallback>& sensorsCallback) {
|
||||
sp<ISensorsCallbackWrapperBase> dynamicCallback =
|
||||
new ISensorsCallbackWrapperV2_0(sensorsCallback);
|
||||
|
||||
// Create the Event FMQ from the eventQueueDescriptor. Reset the read/write positions.
|
||||
auto eventQueue =
|
||||
std::make_unique<EventMessageQueueV2_0>(eventQueueDescriptor, true /* resetPointers */);
|
||||
std::unique_ptr<EventMessageQueueWrapperBase> queue =
|
||||
std::make_unique<EventMessageQueueWrapperV1_0>(eventQueue);
|
||||
|
||||
// Create the Wake Lock FMQ from the wakeLockDescriptor. Reset the read/write positions.
|
||||
auto hidlWakeLockQueue =
|
||||
std::make_unique<WakeLockMessageQueue>(wakeLockDescriptor, true /* resetPointers */);
|
||||
std::unique_ptr<WakeLockMessageQueueWrapperBase> wakeLockQueue =
|
||||
std::make_unique<WakeLockMessageQueueWrapperHidl>(hidlWakeLockQueue);
|
||||
|
||||
return initializeCommon(queue, wakeLockQueue, dynamicCallback);
|
||||
}
|
||||
|
||||
Return<Result> HalProxy::initializeCommon(
|
||||
std::unique_ptr<EventMessageQueueWrapperBase>& eventQueue,
|
||||
std::unique_ptr<WakeLockMessageQueueWrapperBase>& wakeLockQueue,
|
||||
const sp<ISensorsCallbackWrapperBase>& sensorsCallback) {
|
||||
Result result = Result::OK;
|
||||
|
||||
stopThreads();
|
||||
resetSharedWakelock();
|
||||
|
||||
// So that the pending write events queue can be cleared safely and when we start threads
|
||||
// again we do not get new events until after initialize resets the subhals.
|
||||
disableAllSensors();
|
||||
|
||||
// Clears the queue if any events were pending write before.
|
||||
mPendingWriteEventsQueue = std::queue<std::pair<std::vector<V2_1::Event>, size_t>>();
|
||||
mSizePendingWriteEventsQueue = 0;
|
||||
|
||||
// Clears previously connected dynamic sensors
|
||||
mDynamicSensors.clear();
|
||||
|
||||
mDynamicSensorsCallback = sensorsCallback;
|
||||
|
||||
// Create the Event FMQ from the eventQueueDescriptor. Reset the read/write positions.
|
||||
mEventQueue = std::move(eventQueue);
|
||||
|
||||
// Create the Wake Lock FMQ that is used by the framework to communicate whenever WAKE_UP
|
||||
// events have been successfully read and handled by the framework.
|
||||
mWakeLockQueue = std::move(wakeLockQueue);
|
||||
|
||||
if (mEventQueueFlag != nullptr) {
|
||||
EventFlag::deleteEventFlag(&mEventQueueFlag);
|
||||
}
|
||||
if (mWakelockQueueFlag != nullptr) {
|
||||
EventFlag::deleteEventFlag(&mWakelockQueueFlag);
|
||||
}
|
||||
if (EventFlag::createEventFlag(mEventQueue->getEventFlagWord(), &mEventQueueFlag) != OK) {
|
||||
result = Result::BAD_VALUE;
|
||||
}
|
||||
if (EventFlag::createEventFlag(mWakeLockQueue->getEventFlagWord(), &mWakelockQueueFlag) != OK) {
|
||||
result = Result::BAD_VALUE;
|
||||
}
|
||||
if (!mDynamicSensorsCallback || !mEventQueue || !mWakeLockQueue || mEventQueueFlag == nullptr) {
|
||||
result = Result::BAD_VALUE;
|
||||
}
|
||||
|
||||
mThreadsRun.store(true);
|
||||
|
||||
mPendingWritesThread = std::thread(startPendingWritesThread, this);
|
||||
mWakelockThread = std::thread(startWakelockThread, this);
|
||||
|
||||
for (size_t i = 0; i < mSubHalList.size(); i++) {
|
||||
Result currRes = mSubHalList[i]->initialize(this, this, i);
|
||||
if (currRes != Result::OK) {
|
||||
result = currRes;
|
||||
ALOGE("Subhal '%s' failed to initialize.", mSubHalList[i]->getName().c_str());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
mCurrentOperationMode = OperationMode::NORMAL;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Return<Result> HalProxy::batch(int32_t sensorHandle, int64_t samplingPeriodNs,
|
||||
int64_t maxReportLatencyNs) {
|
||||
if (!isSubHalIndexValid(sensorHandle)) {
|
||||
return Result::BAD_VALUE;
|
||||
}
|
||||
return getSubHalForSensorHandle(sensorHandle)
|
||||
->batch(clearSubHalIndex(sensorHandle), samplingPeriodNs, maxReportLatencyNs);
|
||||
}
|
||||
|
||||
Return<Result> HalProxy::flush(int32_t sensorHandle) {
|
||||
if (!isSubHalIndexValid(sensorHandle)) {
|
||||
return Result::BAD_VALUE;
|
||||
}
|
||||
return getSubHalForSensorHandle(sensorHandle)->flush(clearSubHalIndex(sensorHandle));
|
||||
}
|
||||
|
||||
Return<Result> HalProxy::injectSensorData_2_1(const V2_1::Event& event) {
|
||||
return injectSensorData(convertToOldEvent(event));
|
||||
}
|
||||
|
||||
Return<Result> HalProxy::injectSensorData(const V1_0::Event& event) {
|
||||
Result result = Result::OK;
|
||||
if (mCurrentOperationMode == OperationMode::NORMAL &&
|
||||
event.sensorType != V1_0::SensorType::ADDITIONAL_INFO) {
|
||||
ALOGE("An event with type != ADDITIONAL_INFO passed to injectSensorData while operation"
|
||||
" mode was NORMAL.");
|
||||
result = Result::BAD_VALUE;
|
||||
}
|
||||
if (result == Result::OK) {
|
||||
V1_0::Event subHalEvent = event;
|
||||
if (!isSubHalIndexValid(event.sensorHandle)) {
|
||||
return Result::BAD_VALUE;
|
||||
}
|
||||
subHalEvent.sensorHandle = clearSubHalIndex(event.sensorHandle);
|
||||
result = getSubHalForSensorHandle(event.sensorHandle)
|
||||
->injectSensorData(convertToNewEvent(subHalEvent));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Return<void> HalProxy::registerDirectChannel(const SharedMemInfo& mem,
|
||||
ISensorsV2_0::registerDirectChannel_cb _hidl_cb) {
|
||||
if (mDirectChannelSubHal == nullptr) {
|
||||
_hidl_cb(Result::INVALID_OPERATION, -1 /* channelHandle */);
|
||||
} else {
|
||||
mDirectChannelSubHal->registerDirectChannel(mem, _hidl_cb);
|
||||
}
|
||||
return Return<void>();
|
||||
}
|
||||
|
||||
Return<Result> HalProxy::unregisterDirectChannel(int32_t channelHandle) {
|
||||
Result result;
|
||||
if (mDirectChannelSubHal == nullptr) {
|
||||
result = Result::INVALID_OPERATION;
|
||||
} else {
|
||||
result = mDirectChannelSubHal->unregisterDirectChannel(channelHandle);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Return<void> HalProxy::configDirectReport(int32_t sensorHandle, int32_t channelHandle,
|
||||
RateLevel rate,
|
||||
ISensorsV2_0::configDirectReport_cb _hidl_cb) {
|
||||
if (mDirectChannelSubHal == nullptr) {
|
||||
_hidl_cb(Result::INVALID_OPERATION, -1 /* reportToken */);
|
||||
} else if (sensorHandle == -1 && rate != RateLevel::STOP) {
|
||||
_hidl_cb(Result::BAD_VALUE, -1 /* reportToken */);
|
||||
} else {
|
||||
// -1 denotes all sensors should be disabled
|
||||
if (sensorHandle != -1) {
|
||||
sensorHandle = clearSubHalIndex(sensorHandle);
|
||||
}
|
||||
mDirectChannelSubHal->configDirectReport(sensorHandle, channelHandle, rate, _hidl_cb);
|
||||
}
|
||||
return Return<void>();
|
||||
}
|
||||
|
||||
Return<void> HalProxy::debug(const hidl_handle& fd, const hidl_vec<hidl_string>& /*args*/) {
|
||||
if (fd.getNativeHandle() == nullptr || fd->numFds < 1) {
|
||||
ALOGE("%s: missing fd for writing", __FUNCTION__);
|
||||
return Void();
|
||||
}
|
||||
|
||||
android::base::borrowed_fd writeFd = dup(fd->data[0]);
|
||||
|
||||
std::ostringstream stream;
|
||||
stream << "===HalProxy===" << std::endl;
|
||||
stream << "Internal values:" << std::endl;
|
||||
stream << " Threads are running: " << (mThreadsRun.load() ? "true" : "false") << std::endl;
|
||||
int64_t now = getTimeNow();
|
||||
stream << " Wakelock timeout start time: " << msFromNs(now - mWakelockTimeoutStartTime)
|
||||
<< " ms ago" << std::endl;
|
||||
stream << " Wakelock timeout reset time: " << msFromNs(now - mWakelockTimeoutResetTime)
|
||||
<< " ms ago" << std::endl;
|
||||
// TODO(b/142969448): Add logging for history of wakelock acquisition per subhal.
|
||||
stream << " Wakelock ref count: " << mWakelockRefCount << std::endl;
|
||||
stream << " # of events on pending write writes queue: " << mSizePendingWriteEventsQueue
|
||||
<< std::endl;
|
||||
stream << " Most events seen on pending write events queue: "
|
||||
<< mMostEventsObservedPendingWriteEventsQueue << std::endl;
|
||||
if (!mPendingWriteEventsQueue.empty()) {
|
||||
stream << " Size of events list on front of pending writes queue: "
|
||||
<< mPendingWriteEventsQueue.front().first.size() << std::endl;
|
||||
}
|
||||
stream << " # of non-dynamic sensors across all subhals: " << mSensors.size() << std::endl;
|
||||
stream << " # of dynamic sensors across all subhals: " << mDynamicSensors.size() << std::endl;
|
||||
stream << "SubHals (" << mSubHalList.size() << "):" << std::endl;
|
||||
for (auto& subHal : mSubHalList) {
|
||||
stream << " Name: " << subHal->getName() << std::endl;
|
||||
stream << " Debug dump: " << std::endl;
|
||||
android::base::WriteStringToFd(stream.str(), writeFd);
|
||||
subHal->debug(fd, {});
|
||||
stream.str("");
|
||||
stream << std::endl;
|
||||
}
|
||||
android::base::WriteStringToFd(stream.str(), writeFd);
|
||||
return Return<void>();
|
||||
}
|
||||
|
||||
Return<void> HalProxy::onDynamicSensorsConnected(const hidl_vec<SensorInfo>& dynamicSensorsAdded,
|
||||
int32_t subHalIndex) {
|
||||
std::vector<SensorInfo> sensors;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mDynamicSensorsMutex);
|
||||
for (SensorInfo sensor : dynamicSensorsAdded) {
|
||||
if (!subHalIndexIsClear(sensor.sensorHandle)) {
|
||||
ALOGE("Dynamic sensor added %s had sensorHandle with first byte not 0.",
|
||||
sensor.name.c_str());
|
||||
} else {
|
||||
sensor.sensorHandle = setSubHalIndex(sensor.sensorHandle, subHalIndex);
|
||||
mDynamicSensors[sensor.sensorHandle] = sensor;
|
||||
sensors.push_back(sensor);
|
||||
}
|
||||
}
|
||||
}
|
||||
mDynamicSensorsCallback->onDynamicSensorsConnected(sensors);
|
||||
return Return<void>();
|
||||
}
|
||||
|
||||
Return<void> HalProxy::onDynamicSensorsDisconnected(
|
||||
const hidl_vec<int32_t>& dynamicSensorHandlesRemoved, int32_t subHalIndex) {
|
||||
// TODO(b/143302327): Block this call until all pending events are flushed from queue
|
||||
std::vector<int32_t> sensorHandles;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mDynamicSensorsMutex);
|
||||
for (int32_t sensorHandle : dynamicSensorHandlesRemoved) {
|
||||
if (!subHalIndexIsClear(sensorHandle)) {
|
||||
ALOGE("Dynamic sensorHandle removed had first byte not 0.");
|
||||
} else {
|
||||
sensorHandle = setSubHalIndex(sensorHandle, subHalIndex);
|
||||
if (mDynamicSensors.find(sensorHandle) != mDynamicSensors.end()) {
|
||||
mDynamicSensors.erase(sensorHandle);
|
||||
sensorHandles.push_back(sensorHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mDynamicSensorsCallback->onDynamicSensorsDisconnected(sensorHandles);
|
||||
return Return<void>();
|
||||
}
|
||||
|
||||
void HalProxy::initializeSubHalListFromConfigFile(const char* configFileName) {
|
||||
std::ifstream subHalConfigStream(configFileName);
|
||||
if (!subHalConfigStream) {
|
||||
ALOGE("Failed to load subHal config file: %s", configFileName);
|
||||
} else {
|
||||
std::string subHalLibraryFile;
|
||||
while (subHalConfigStream >> subHalLibraryFile) {
|
||||
void* handle = getHandleForSubHalSharedObject(subHalLibraryFile);
|
||||
if (handle == nullptr) {
|
||||
ALOGE("dlopen failed for library: %s", subHalLibraryFile.c_str());
|
||||
} else {
|
||||
SensorsHalGetSubHalFunc* sensorsHalGetSubHalPtr =
|
||||
(SensorsHalGetSubHalFunc*)dlsym(handle, "sensorsHalGetSubHal");
|
||||
if (sensorsHalGetSubHalPtr != nullptr) {
|
||||
std::function<SensorsHalGetSubHalFunc> sensorsHalGetSubHal =
|
||||
*sensorsHalGetSubHalPtr;
|
||||
uint32_t version;
|
||||
ISensorsSubHalV2_0* subHal = sensorsHalGetSubHal(&version);
|
||||
if (version != SUB_HAL_2_0_VERSION) {
|
||||
ALOGE("SubHal version was not 2.0 for library: %s",
|
||||
subHalLibraryFile.c_str());
|
||||
} else {
|
||||
ALOGV("Loaded SubHal from library: %s", subHalLibraryFile.c_str());
|
||||
mSubHalList.push_back(std::make_unique<SubHalWrapperV2_0>(subHal));
|
||||
}
|
||||
} else {
|
||||
SensorsHalGetSubHalV2_1Func* getSubHalV2_1Ptr =
|
||||
(SensorsHalGetSubHalV2_1Func*)dlsym(handle, "sensorsHalGetSubHal_2_1");
|
||||
|
||||
if (getSubHalV2_1Ptr == nullptr) {
|
||||
ALOGE("Failed to locate sensorsHalGetSubHal function for library: %s",
|
||||
subHalLibraryFile.c_str());
|
||||
} else {
|
||||
std::function<SensorsHalGetSubHalV2_1Func> sensorsHalGetSubHal_2_1 =
|
||||
*getSubHalV2_1Ptr;
|
||||
uint32_t version;
|
||||
ISensorsSubHalV2_1* subHal = sensorsHalGetSubHal_2_1(&version);
|
||||
if (version != SUB_HAL_2_1_VERSION) {
|
||||
ALOGE("SubHal version was not 2.1 for library: %s",
|
||||
subHalLibraryFile.c_str());
|
||||
} else {
|
||||
ALOGV("Loaded SubHal from library: %s", subHalLibraryFile.c_str());
|
||||
mSubHalList.push_back(std::make_unique<SubHalWrapperV2_1>(subHal));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HalProxy::initializeSensorList() {
|
||||
for (size_t subHalIndex = 0; subHalIndex < mSubHalList.size(); subHalIndex++) {
|
||||
auto result = mSubHalList[subHalIndex]->getSensorsList([&](const auto& list) {
|
||||
for (SensorInfo sensor : list) {
|
||||
if (!subHalIndexIsClear(sensor.sensorHandle)) {
|
||||
ALOGE("SubHal sensorHandle's first byte was not 0");
|
||||
} else {
|
||||
ALOGV("Loaded sensor: %s", sensor.name.c_str());
|
||||
sensor.sensorHandle = setSubHalIndex(sensor.sensorHandle, subHalIndex);
|
||||
setDirectChannelFlags(&sensor, mSubHalList[subHalIndex]);
|
||||
if (sensor.typeAsString == "qti.sensor.wise_light") {
|
||||
sensor.type = SensorType::LIGHT;
|
||||
sensor.typeAsString = "";
|
||||
}
|
||||
mSensors[sensor.sensorHandle] = sensor;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (!result.isOk()) {
|
||||
ALOGE("getSensorsList call failed for SubHal: %s",
|
||||
mSubHalList[subHalIndex]->getName().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void* HalProxy::getHandleForSubHalSharedObject(const std::string& filename) {
|
||||
static const std::string kSubHalShareObjectLocations[] = {
|
||||
"", // Default locations will be searched
|
||||
#ifdef __LP64__
|
||||
"/vendor/lib64/hw/", "/odm/lib64/hw/"
|
||||
#else
|
||||
"/vendor/lib/hw/", "/odm/lib/hw/"
|
||||
#endif
|
||||
};
|
||||
|
||||
for (const std::string& dir : kSubHalShareObjectLocations) {
|
||||
void* handle = dlopen((dir + filename).c_str(), RTLD_NOW);
|
||||
if (handle != nullptr) {
|
||||
return handle;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void HalProxy::init() {
|
||||
initializeSensorList();
|
||||
}
|
||||
|
||||
void HalProxy::stopThreads() {
|
||||
mThreadsRun.store(false);
|
||||
if (mEventQueueFlag != nullptr && mEventQueue != nullptr) {
|
||||
size_t numToRead = mEventQueue->availableToRead();
|
||||
std::vector<Event> events(numToRead);
|
||||
mEventQueue->read(events.data(), numToRead);
|
||||
mEventQueueFlag->wake(static_cast<uint32_t>(EventQueueFlagBits::EVENTS_READ));
|
||||
}
|
||||
if (mWakelockQueueFlag != nullptr && mWakeLockQueue != nullptr) {
|
||||
uint32_t kZero = 0;
|
||||
mWakeLockQueue->write(&kZero);
|
||||
mWakelockQueueFlag->wake(static_cast<uint32_t>(WakeLockQueueFlagBits::DATA_WRITTEN));
|
||||
}
|
||||
mWakelockCV.notify_one();
|
||||
mEventQueueWriteCV.notify_one();
|
||||
if (mPendingWritesThread.joinable()) {
|
||||
mPendingWritesThread.join();
|
||||
}
|
||||
if (mWakelockThread.joinable()) {
|
||||
mWakelockThread.join();
|
||||
}
|
||||
}
|
||||
|
||||
void HalProxy::disableAllSensors() {
|
||||
for (const auto& sensorEntry : mSensors) {
|
||||
int32_t sensorHandle = sensorEntry.first;
|
||||
activate(sensorHandle, false /* enabled */);
|
||||
}
|
||||
std::lock_guard<std::mutex> dynamicSensorsLock(mDynamicSensorsMutex);
|
||||
for (const auto& sensorEntry : mDynamicSensors) {
|
||||
int32_t sensorHandle = sensorEntry.first;
|
||||
activate(sensorHandle, false /* enabled */);
|
||||
}
|
||||
}
|
||||
|
||||
void HalProxy::startPendingWritesThread(HalProxy* halProxy) {
|
||||
halProxy->handlePendingWrites();
|
||||
}
|
||||
|
||||
void HalProxy::handlePendingWrites() {
|
||||
// TODO(b/143302327): Find a way to optimize locking strategy maybe using two mutexes instead of
|
||||
// one.
|
||||
std::unique_lock<std::mutex> lock(mEventQueueWriteMutex);
|
||||
while (mThreadsRun.load()) {
|
||||
mEventQueueWriteCV.wait(
|
||||
lock, [&] { return !mPendingWriteEventsQueue.empty() || !mThreadsRun.load(); });
|
||||
if (mThreadsRun.load()) {
|
||||
std::vector<Event>& pendingWriteEvents = mPendingWriteEventsQueue.front().first;
|
||||
size_t numWakeupEvents = mPendingWriteEventsQueue.front().second;
|
||||
size_t eventQueueSize = mEventQueue->getQuantumCount();
|
||||
size_t numToWrite = std::min(pendingWriteEvents.size(), eventQueueSize);
|
||||
lock.unlock();
|
||||
if (!mEventQueue->writeBlocking(
|
||||
pendingWriteEvents.data(), numToWrite,
|
||||
static_cast<uint32_t>(EventQueueFlagBits::EVENTS_READ),
|
||||
static_cast<uint32_t>(EventQueueFlagBits::READ_AND_PROCESS),
|
||||
kPendingWriteTimeoutNs, mEventQueueFlag)) {
|
||||
ALOGE("Dropping %zu events after blockingWrite failed.", numToWrite);
|
||||
if (numWakeupEvents > 0) {
|
||||
if (pendingWriteEvents.size() > eventQueueSize) {
|
||||
decrementRefCountAndMaybeReleaseWakelock(
|
||||
countNumWakeupEvents(pendingWriteEvents, eventQueueSize));
|
||||
} else {
|
||||
decrementRefCountAndMaybeReleaseWakelock(numWakeupEvents);
|
||||
}
|
||||
}
|
||||
}
|
||||
lock.lock();
|
||||
mSizePendingWriteEventsQueue -= numToWrite;
|
||||
if (pendingWriteEvents.size() > eventQueueSize) {
|
||||
// TODO(b/143302327): Check if this erase operation is too inefficient. It will copy
|
||||
// all the events ahead of it down to fill gap off array at front after the erase.
|
||||
pendingWriteEvents.erase(pendingWriteEvents.begin(),
|
||||
pendingWriteEvents.begin() + eventQueueSize);
|
||||
} else {
|
||||
mPendingWriteEventsQueue.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HalProxy::startWakelockThread(HalProxy* halProxy) {
|
||||
halProxy->handleWakelocks();
|
||||
}
|
||||
|
||||
void HalProxy::handleWakelocks() {
|
||||
std::unique_lock<std::recursive_mutex> lock(mWakelockMutex);
|
||||
while (mThreadsRun.load()) {
|
||||
mWakelockCV.wait(lock, [&] { return mWakelockRefCount > 0 || !mThreadsRun.load(); });
|
||||
if (mThreadsRun.load()) {
|
||||
int64_t timeLeft;
|
||||
if (sharedWakelockDidTimeout(&timeLeft)) {
|
||||
resetSharedWakelock();
|
||||
} else {
|
||||
uint32_t numWakeLocksProcessed;
|
||||
lock.unlock();
|
||||
bool success = mWakeLockQueue->readBlocking(
|
||||
&numWakeLocksProcessed, 1, 0,
|
||||
static_cast<uint32_t>(WakeLockQueueFlagBits::DATA_WRITTEN), timeLeft);
|
||||
lock.lock();
|
||||
if (success) {
|
||||
decrementRefCountAndMaybeReleaseWakelock(
|
||||
static_cast<size_t>(numWakeLocksProcessed));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
resetSharedWakelock();
|
||||
}
|
||||
|
||||
bool HalProxy::sharedWakelockDidTimeout(int64_t* timeLeft) {
|
||||
bool didTimeout;
|
||||
int64_t duration = getTimeNow() - mWakelockTimeoutStartTime;
|
||||
if (duration > kWakelockTimeoutNs) {
|
||||
didTimeout = true;
|
||||
} else {
|
||||
didTimeout = false;
|
||||
*timeLeft = kWakelockTimeoutNs - duration;
|
||||
}
|
||||
return didTimeout;
|
||||
}
|
||||
|
||||
void HalProxy::resetSharedWakelock() {
|
||||
std::lock_guard<std::recursive_mutex> lockGuard(mWakelockMutex);
|
||||
decrementRefCountAndMaybeReleaseWakelock(mWakelockRefCount);
|
||||
mWakelockTimeoutResetTime = getTimeNow();
|
||||
}
|
||||
|
||||
void HalProxy::postEventsToMessageQueue(const std::vector<Event>& events, size_t numWakeupEvents,
|
||||
V2_0::implementation::ScopedWakelock wakelock) {
|
||||
size_t numToWrite = 0;
|
||||
std::lock_guard<std::mutex> lock(mEventQueueWriteMutex);
|
||||
if (wakelock.isLocked()) {
|
||||
incrementRefCountAndMaybeAcquireWakelock(numWakeupEvents);
|
||||
}
|
||||
if (mPendingWriteEventsQueue.empty()) {
|
||||
numToWrite = std::min(events.size(), mEventQueue->availableToWrite());
|
||||
if (numToWrite > 0) {
|
||||
if (mEventQueue->write(events.data(), numToWrite)) {
|
||||
// TODO(b/143302327): While loop if mEventQueue->avaiableToWrite > 0 to possibly fit
|
||||
// in more writes immediately
|
||||
mEventQueueFlag->wake(static_cast<uint32_t>(EventQueueFlagBits::READ_AND_PROCESS));
|
||||
} else {
|
||||
numToWrite = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
size_t numLeft = events.size() - numToWrite;
|
||||
if (numToWrite < events.size() &&
|
||||
mSizePendingWriteEventsQueue + numLeft <= kMaxSizePendingWriteEventsQueue) {
|
||||
std::vector<Event> eventsLeft(events.begin() + numToWrite, events.end());
|
||||
mPendingWriteEventsQueue.push({eventsLeft, numWakeupEvents});
|
||||
mSizePendingWriteEventsQueue += numLeft;
|
||||
mMostEventsObservedPendingWriteEventsQueue =
|
||||
std::max(mMostEventsObservedPendingWriteEventsQueue, mSizePendingWriteEventsQueue);
|
||||
mEventQueueWriteCV.notify_one();
|
||||
}
|
||||
}
|
||||
|
||||
bool HalProxy::incrementRefCountAndMaybeAcquireWakelock(size_t delta,
|
||||
int64_t* timeoutStart /* = nullptr */) {
|
||||
if (!mThreadsRun.load()) return false;
|
||||
std::lock_guard<std::recursive_mutex> lockGuard(mWakelockMutex);
|
||||
if (mWakelockRefCount == 0) {
|
||||
acquire_wake_lock(PARTIAL_WAKE_LOCK, kWakelockName);
|
||||
mWakelockCV.notify_one();
|
||||
}
|
||||
mWakelockTimeoutStartTime = getTimeNow();
|
||||
mWakelockRefCount += delta;
|
||||
if (timeoutStart != nullptr) {
|
||||
*timeoutStart = mWakelockTimeoutStartTime;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void HalProxy::decrementRefCountAndMaybeReleaseWakelock(size_t delta,
|
||||
int64_t timeoutStart /* = -1 */) {
|
||||
if (!mThreadsRun.load()) return;
|
||||
std::lock_guard<std::recursive_mutex> lockGuard(mWakelockMutex);
|
||||
if (delta > mWakelockRefCount) {
|
||||
ALOGE("Decrementing wakelock ref count by %zu when count is %zu",
|
||||
delta, mWakelockRefCount);
|
||||
}
|
||||
if (timeoutStart == -1) timeoutStart = mWakelockTimeoutResetTime;
|
||||
if (mWakelockRefCount == 0 || timeoutStart < mWakelockTimeoutResetTime) return;
|
||||
mWakelockRefCount -= std::min(mWakelockRefCount, delta);
|
||||
if (mWakelockRefCount == 0) {
|
||||
release_wake_lock(kWakelockName);
|
||||
}
|
||||
}
|
||||
|
||||
void HalProxy::setDirectChannelFlags(SensorInfo* sensorInfo,
|
||||
std::shared_ptr<ISubHalWrapperBase> subHal) {
|
||||
bool sensorSupportsDirectChannel =
|
||||
(sensorInfo->flags & (V1_0::SensorFlagBits::MASK_DIRECT_REPORT |
|
||||
V1_0::SensorFlagBits::MASK_DIRECT_CHANNEL)) != 0;
|
||||
if (mDirectChannelSubHal == nullptr && sensorSupportsDirectChannel) {
|
||||
mDirectChannelSubHal = subHal;
|
||||
} else if (mDirectChannelSubHal != nullptr && subHal != mDirectChannelSubHal) {
|
||||
// disable direct channel capability for sensors in subHals that are not
|
||||
// the only one we will enable
|
||||
sensorInfo->flags &= ~(V1_0::SensorFlagBits::MASK_DIRECT_REPORT |
|
||||
V1_0::SensorFlagBits::MASK_DIRECT_CHANNEL);
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<ISubHalWrapperBase> HalProxy::getSubHalForSensorHandle(int32_t sensorHandle) {
|
||||
return mSubHalList[extractSubHalIndex(sensorHandle)];
|
||||
}
|
||||
|
||||
bool HalProxy::isSubHalIndexValid(int32_t sensorHandle) {
|
||||
return extractSubHalIndex(sensorHandle) < mSubHalList.size();
|
||||
}
|
||||
|
||||
size_t HalProxy::countNumWakeupEvents(const std::vector<Event>& events, size_t n) {
|
||||
size_t numWakeupEvents = 0;
|
||||
for (size_t i = 0; i < n; i++) {
|
||||
int32_t sensorHandle = events[i].sensorHandle;
|
||||
if (mSensors[sensorHandle].flags & static_cast<uint32_t>(V1_0::SensorFlagBits::WAKE_UP)) {
|
||||
numWakeupEvents++;
|
||||
}
|
||||
}
|
||||
return numWakeupEvents;
|
||||
}
|
||||
|
||||
int32_t HalProxy::clearSubHalIndex(int32_t sensorHandle) {
|
||||
return sensorHandle & (~kSensorHandleSubHalIndexMask);
|
||||
}
|
||||
|
||||
bool HalProxy::subHalIndexIsClear(int32_t sensorHandle) {
|
||||
return (sensorHandle & kSensorHandleSubHalIndexMask) == 0;
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace sensors
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
@@ -1,84 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019 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 "HalProxyCallback.h"
|
||||
|
||||
#include <cinttypes>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace sensors {
|
||||
namespace V2_0 {
|
||||
namespace implementation {
|
||||
|
||||
static constexpr int32_t kBitsAfterSubHalIndex = 24;
|
||||
|
||||
/**
|
||||
* Set the subhal index as first byte of sensor handle and return this modified version.
|
||||
*
|
||||
* @param sensorHandle The sensor handle to modify.
|
||||
* @param subHalIndex The index in the hal proxy of the sub hal this sensor belongs to.
|
||||
*
|
||||
* @return The modified sensor handle.
|
||||
*/
|
||||
int32_t setSubHalIndex(int32_t sensorHandle, size_t subHalIndex) {
|
||||
return sensorHandle | (static_cast<int32_t>(subHalIndex) << kBitsAfterSubHalIndex);
|
||||
}
|
||||
|
||||
void HalProxyCallbackBase::postEvents(const std::vector<V2_1::Event>& events,
|
||||
ScopedWakelock wakelock) {
|
||||
if (events.empty() || !mCallback->areThreadsRunning()) return;
|
||||
size_t numWakeupEvents;
|
||||
std::vector<V2_1::Event> processedEvents = processEvents(events, &numWakeupEvents);
|
||||
if (numWakeupEvents > 0) {
|
||||
ALOG_ASSERT(wakelock.isLocked(),
|
||||
"Wakeup events posted while wakelock unlocked for subhal"
|
||||
" w/ index %" PRId32 ".",
|
||||
mSubHalIndex);
|
||||
} else {
|
||||
ALOG_ASSERT(!wakelock.isLocked(),
|
||||
"No Wakeup events posted but wakelock locked for subhal"
|
||||
" w/ index %" PRId32 ".",
|
||||
mSubHalIndex);
|
||||
}
|
||||
mCallback->postEventsToMessageQueue(processedEvents, numWakeupEvents, std::move(wakelock));
|
||||
}
|
||||
|
||||
ScopedWakelock HalProxyCallbackBase::createScopedWakelock(bool lock) {
|
||||
ScopedWakelock wakelock(mRefCounter, lock);
|
||||
return wakelock;
|
||||
}
|
||||
|
||||
std::vector<V2_1::Event> HalProxyCallbackBase::processEvents(const std::vector<V2_1::Event>& events,
|
||||
size_t* numWakeupEvents) const {
|
||||
*numWakeupEvents = 0;
|
||||
std::vector<V2_1::Event> eventsOut;
|
||||
for (V2_1::Event event : events) {
|
||||
event.sensorHandle = setSubHalIndex(event.sensorHandle, mSubHalIndex);
|
||||
eventsOut.push_back(event);
|
||||
const V2_1::SensorInfo& sensor = mCallback->getSensorInfo(event.sensorHandle);
|
||||
if ((sensor.flags & V1_0::SensorFlagBits::WAKE_UP) != 0) {
|
||||
(*numWakeupEvents)++;
|
||||
}
|
||||
}
|
||||
return eventsOut;
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_0
|
||||
} // namespace sensors
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
@@ -1,11 +0,0 @@
|
||||
<manifest version="1.0" type="device">
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.sensors</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>ISensors</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
</manifest>
|
||||
@@ -1,7 +0,0 @@
|
||||
service vendor.sensors-hal-2-0-multihal /vendor/bin/hw/android.hardware.sensors@2.0-service.multihal
|
||||
class hal
|
||||
user system
|
||||
group system wakelock context_hub input
|
||||
writepid /dev/cpuset/system-background/tasks
|
||||
capabilities BLOCK_SUSPEND
|
||||
rlimit rtprio 10 10
|
||||
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019 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 <android/hardware/sensors/2.0/ISensors.h>
|
||||
#include <hidl/HidlTransportSupport.h>
|
||||
#include <log/log.h>
|
||||
#include <utils/StrongPointer.h>
|
||||
#include "HalProxy.h"
|
||||
|
||||
using android::hardware::configureRpcThreadpool;
|
||||
using android::hardware::joinRpcThreadpool;
|
||||
using android::hardware::sensors::V2_0::ISensors;
|
||||
using android::hardware::sensors::V2_1::implementation::HalProxyV2_0;
|
||||
|
||||
int main(int /* argc */, char** /* argv */) {
|
||||
configureRpcThreadpool(1, true);
|
||||
|
||||
android::sp<ISensors> halProxy = new HalProxyV2_0();
|
||||
if (halProxy->registerAsService() != ::android::OK) {
|
||||
ALOGE("Failed to register Sensors HAL instance");
|
||||
return -1;
|
||||
}
|
||||
|
||||
joinRpcThreadpool();
|
||||
return 1; // joinRpcThreadpool shouldn't exit
|
||||
}
|
||||
3
sepolicy/vendor/file_contexts
vendored
3
sepolicy/vendor/file_contexts
vendored
@@ -16,6 +16,9 @@
|
||||
# Camera
|
||||
/mnt/vendor/persist/camera(/.*)? u:object_r:vendor_persist_camera_file:s0
|
||||
|
||||
# Cust
|
||||
/dev/block/platform/soc/4744000.sdhci/by-name/cust u:object_r:vendor_custom_block_device:s0
|
||||
|
||||
# Oppo Partitions
|
||||
/dev/block/platform/soc/1d84000.ufshc/by-name/oppodycnvbk u:object_r:vendor_modem_efs_partition_device:s0
|
||||
/dev/block/platform/soc/1d84000.ufshc/by-name/oppostanvbk u:object_r:vendor_modem_efs_partition_device:s0
|
||||
|
||||
1
sepolicy/vendor/system_app.te
vendored
1
sepolicy/vendor/system_app.te
vendored
@@ -6,5 +6,6 @@ r_dir_file(system_app, proc_touchpanel);
|
||||
|
||||
r_dir_file(system_app, vendor_sysfs_usb_supply);
|
||||
allow system_app vendor_sysfs_usb_supply:file rw_file_perms;
|
||||
allow system_app vendor_sysfs_battery_supply:dir search;
|
||||
|
||||
|
||||
|
||||
4
sepolicy/vendor/system_server.te
vendored
Normal file
4
sepolicy/vendor/system_server.te
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
allow system_server proc_devinfo:dir search;
|
||||
allow system_server proc_oppo_rf:dir search;
|
||||
allow system_server proc_oppoversion:dir search;
|
||||
allow system_server proc_touchpanel:dir search;
|
||||
4
sepolicy/vendor/vendor_qti_init_shell.te
vendored
4
sepolicy/vendor/vendor_qti_init_shell.te
vendored
@@ -6,3 +6,7 @@ get_prop(vendor_qti_init_shell, oppo_debug_prop)
|
||||
allow vendor_qti_init_shell sysfs:file write;
|
||||
|
||||
allow vendor_qti_init_shell proc_page_cluster:file { open };
|
||||
|
||||
|
||||
# To set powerhal init property
|
||||
set_prop(vendor_qti_init_shell, vendor_power_prop)
|
||||
13
system.prop
13
system.prop
@@ -21,11 +21,14 @@ ro.camera.attr.detect.enable=1
|
||||
ro.camera.notify_nfc=1
|
||||
ro.camera.temperature.limit=470
|
||||
persist.vendor.camera.light_ae.enable=1
|
||||
persist.camera.eis.enable=1
|
||||
persist.camera.is_mode=4
|
||||
persist.vendor.camera.oissr.debug=1
|
||||
vendor.debug.camera.eisv2enable=1
|
||||
vendor.debug.camera.eisv3enable=1
|
||||
# Allow privileged camera apps
|
||||
persist.vendor.camera.privapp.list=org.lineageos.aperture,org.codeaurora.snapcam,com.android.camera,com.google.camera
|
||||
# Allow aux cameras
|
||||
vendor.camera.aux.packagelist=org.lineageos.aperture,org.codeaurora.snapcam,com.android.camera,com.google.camera
|
||||
persist.vendor.camera.expose.aux=1
|
||||
|
||||
# CNE
|
||||
persist.vendor.cne.feature=1
|
||||
@@ -108,7 +111,6 @@ persist.sys.radio.force_lte_ca=true
|
||||
persist.vendor.data.iwlan.enable=true
|
||||
persist.vendor.data.mode=concurrent
|
||||
ril.subscription.types=NV,RUIM
|
||||
ro.telephony.default_network=22,22
|
||||
ro.vendor.use_data_netmgrd=true
|
||||
telephony.lteOnCdmaDevice=1
|
||||
persist.sys.fflag.override.settings_network_and_internet_v2=true
|
||||
@@ -121,11 +123,6 @@ persist.vendor.ssr.restart_level=ALL_ENABLE
|
||||
persist.debug.wfd.enable=1
|
||||
persist.sys.wfd.virtual=0
|
||||
|
||||
# ZRAM
|
||||
ro.zram.mark_idle_delay_mins=60
|
||||
ro.zram.first_wb_delay_mins=180
|
||||
ro.zram.periodic_wb_delay_hours=24
|
||||
|
||||
#SkiaGL
|
||||
debug.renderengine.backend=skiaglthreaded
|
||||
renderthread.skia.reduceopstasksplitting=true
|
||||
|
||||
30
vendor.prop
30
vendor.prop
@@ -97,6 +97,8 @@ vendor.qcom.bluetooth.soc=cherokee
|
||||
|
||||
# Camera
|
||||
camera.disable_zsl_mode=1
|
||||
persist.vendor.camera.eis.enable=1
|
||||
persist.vendor.camera.is_type=2
|
||||
|
||||
# Crypto
|
||||
ro.crypto.allow_encrypt_override=true
|
||||
@@ -149,19 +151,22 @@ ro.qcom.adreno.qgl.ShaderStorageImageExtendedFormats=0
|
||||
# FM
|
||||
vendor.hw.fm.init=0
|
||||
|
||||
# FRP
|
||||
ro.frp.pst=/dev/block/bootdevice/by-name/frp
|
||||
|
||||
#Graphics
|
||||
debug.hwui.use_hint_manager=true
|
||||
debug.hwui.target_cpu_time_percent=30
|
||||
debug.sf.disable_client_composition_cache=0
|
||||
debug.sf.enable_adpf_cpu_hint=true
|
||||
|
||||
# Keyguard
|
||||
keyguard.no_require_sim=true
|
||||
debug.sf.enable_gl_backpressure=0
|
||||
|
||||
# Keystore
|
||||
ro.hardware.keystore_desede=true
|
||||
|
||||
# Game FrameRate
|
||||
debug.graphics.game_default_frame_rate.disabled=true
|
||||
|
||||
# Media
|
||||
debug.media.codec2=2
|
||||
debug.stagefright.c2inputsurface=-1
|
||||
@@ -192,6 +197,21 @@ persist.vendor.radio.rat_on=combine
|
||||
ro.telephony.default_network=22,20
|
||||
ro.vendor.use_data_netmgrd=true
|
||||
telephony.lteOnCdmaDevice=1
|
||||
persist.vendor.radio.add_power_save=1
|
||||
persist.vendor.radio.force_on_dc=1
|
||||
persist.vendor.radio.lte_vrte_ltd=1
|
||||
persist.vendor.radio.snrt_max_layer=3
|
||||
persist.vendor.radio.data_con_rprt=1
|
||||
persist.vendor.radio.ignore_dom_time=10
|
||||
persist.vendor.radio.oppo.signal.adapt=1
|
||||
ro.vendor.radio.oppo.signal.adapt=true
|
||||
persist.vendor.radio.enable_temp_dds=true
|
||||
persist.vendor.radio.custom_ecc=1
|
||||
persist.vendor.radio.data_ltd_sys_ind=1
|
||||
|
||||
# ScrollOptimizer
|
||||
persist.sys.perf.scroll_opt=true
|
||||
persist.sys.perf.scroll_opt.heavy_app=1
|
||||
|
||||
# Sensors
|
||||
persist.vendor.sensors.odl.adsp=true
|
||||
@@ -222,3 +242,7 @@ sys.fflag.override.settings_seamless_transfer=true
|
||||
|
||||
# default refresh rate threshold
|
||||
debug.sf.frame_rate_multiple_threshold=0
|
||||
|
||||
# Fingerprint
|
||||
ro.vendor.fingerprint.type=side
|
||||
ro.vendor.fingerprint.supports_gestures=true
|
||||
|
||||
Reference in New Issue
Block a user