mondrian: Decommonize device tree

* From https://github.com/cupid-development/android_device_xiaomi_mondrian

Signed-off-by: flakeforever <113103193+flakeforever@users.noreply.github.com>
This commit is contained in:
flakeforever
2024-02-24 13:50:55 +08:00
parent 830a0d733d
commit 915e29b0bf
35 changed files with 3398 additions and 79 deletions

View File

@@ -6,7 +6,7 @@
LOCAL_PATH := $(call my-dir)
ifneq ($(filter cupid marble mondrian zeus,$(TARGET_DEVICE)),)
ifeq ($(TARGET_DEVICE),mondrian)
include $(call all-makefiles-under,$(LOCAL_PATH))

13
AndroidProducts.mk Normal file
View File

@@ -0,0 +1,13 @@
#
# Copyright (C) 2022-2023 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/lineage_mondrian.mk
COMMON_LUNCH_CHOICES := \
lineage_mondrian-user \
lineage_mondrian-userdebug \
lineage_mondrian-eng

View File

@@ -5,9 +5,9 @@
#
# Inherit from the proprietary version
include vendor/xiaomi/sm8450-common/BoardConfigVendor.mk
include vendor/xiaomi/mondrian/BoardConfigVendor.mk
COMMON_PATH := device/xiaomi/sm8450-common
DEVICE_PATH := device/xiaomi/mondrian
BUILD_BROKEN_DUP_RULES := true
BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true
@@ -90,22 +90,22 @@ MAX_VIRTUAL_DISPLAY_DIMENSION := 4096
NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3
# Filesystem
TARGET_FS_CONFIG_GEN := $(COMMON_PATH)/configs/config.fs
TARGET_FS_CONFIG_GEN := $(DEVICE_PATH)/configs/config.fs
# HIDL
DEVICE_MATRIX_FILE := $(COMMON_PATH)/hidl/compatibility_matrix.xml
DEVICE_MATRIX_FILE := $(DEVICE_PATH)/hidl/compatibility_matrix.xml
DEVICE_MANIFEST_SKUS := \
cape \
taro
DEVICE_MANIFEST_CAPE_FILES := \
$(COMMON_PATH)/hidl/manifest_taro.xml \
$(COMMON_PATH)/hidl/manifest_xiaomi.xml
$(DEVICE_PATH)/hidl/manifest_taro.xml \
$(DEVICE_PATH)/hidl/manifest_xiaomi.xml
DEVICE_MANIFEST_TARO_FILES := $(DEVICE_MANIFEST_CAPE_FILES)
DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := \
$(COMMON_PATH)/hidl/vendor_framework_compatibility_matrix.xml \
$(COMMON_PATH)/hidl/xiaomi_framework_compatibility_matrix.xml \
$(DEVICE_PATH)/hidl/vendor_framework_compatibility_matrix.xml \
$(DEVICE_PATH)/hidl/xiaomi_framework_compatibility_matrix.xml \
vendor/lineage/config/device_framework_matrix.xml
# Kernel
@@ -144,11 +144,11 @@ BOARD_BOOTCONFIG := \
androidboot.usbcontroller=a600000.dwc3
# Kernel modules
BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE := $(COMMON_PATH)/modules.blocklist
BOARD_VENDOR_KERNEL_MODULES_LOAD := $(strip $(shell cat $(COMMON_PATH)/modules.load))
BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE := $(DEVICE_PATH)/modules.blocklist
BOARD_VENDOR_KERNEL_MODULES_LOAD := $(strip $(shell cat $(DEVICE_PATH)/modules.load))
BOARD_VENDOR_RAMDISK_KERNEL_MODULES_BLOCKLIST_FILE := $(BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE)
BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD := $(strip $(shell cat $(COMMON_PATH)/modules.load.vendor_boot))
BOARD_VENDOR_RAMDISK_RECOVERY_KERNEL_MODULES_LOAD := $(strip $(shell cat $(COMMON_PATH)/modules.load.recovery))
BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD := $(strip $(shell cat $(DEVICE_PATH)/modules.load.vendor_boot))
BOARD_VENDOR_RAMDISK_RECOVERY_KERNEL_MODULES_LOAD := $(strip $(shell cat $(DEVICE_PATH)/modules.load.recovery))
BOOT_KERNEL_MODULES := $(BOARD_VENDOR_RAMDISK_RECOVERY_KERNEL_MODULES_LOAD)
TARGET_KERNEL_EXT_MODULE_ROOT := kernel/xiaomi/sm8450-modules
@@ -206,7 +206,7 @@ TARGET_COPY_OUT_VENDOR_DLKM := vendor_dlkm
BOARD_USES_QCOM_HARDWARE := true
# Power
TARGET_POWERHAL_MODE_EXT := $(COMMON_PATH)/power/power-mode.cpp
TARGET_POWERHAL_MODE_EXT := $(DEVICE_PATH)/power/power-mode.cpp
# PowerShare
SOONG_CONFIG_NAMESPACES += XIAOMI_POWERSHARE
@@ -214,11 +214,11 @@ SOONG_CONFIG_XIAOMI_POWERSHARE := WIRELESS_TX_ENABLE_PATH
SOONG_CONFIG_XIAOMI_POWERSHARE_WIRELESS_TX_ENABLE_PATH := /sys/class/qcom-battery/reverse_chg_mode
# Properties
TARGET_ODM_PROP += $(COMMON_PATH)/properties/odm.prop
TARGET_PRODUCT_PROP += $(COMMON_PATH)/properties/product.prop
TARGET_SYSTEM_PROP += $(COMMON_PATH)/properties/system.prop
TARGET_SYSTEM_EXT_PROP += $(COMMON_PATH)/properties/system_ext.prop
TARGET_VENDOR_PROP += $(COMMON_PATH)/properties/vendor.prop
TARGET_ODM_PROP += $(DEVICE_PATH)/properties/odm.prop
TARGET_PRODUCT_PROP += $(DEVICE_PATH)/properties/product.prop
TARGET_SYSTEM_PROP += $(DEVICE_PATH)/properties/system.prop
TARGET_SYSTEM_EXT_PROP += $(DEVICE_PATH)/properties/system_ext.prop
TARGET_VENDOR_PROP += $(DEVICE_PATH)/properties/vendor.prop
# Recovery
#namespace definition for librecovery_updater
@@ -227,7 +227,7 @@ SOONG_CONFIG_NAMESPACES += ufsbsg
SOONG_CONFIG_ufsbsg += ufsframework
SOONG_CONFIG_ufsbsg_ufsframework := bsg
TARGET_RECOVERY_FSTAB := $(COMMON_PATH)/rootdir/etc/recovery.fstab
TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/rootdir/etc/recovery.fstab
TARGET_RECOVERY_PIXEL_FORMAT := RGBX_8888
TARGET_USERIMAGES_USE_EXT4 := true
TARGET_USERIMAGES_USE_F2FS := true
@@ -242,9 +242,16 @@ VENDOR_SECURITY_PATCH := 2023-07-01
# Sepolicy
include device/qcom/sepolicy_vndr/SEPolicy.mk
SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += $(COMMON_PATH)/sepolicy/private
SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += $(COMMON_PATH)/sepolicy/public
BOARD_VENDOR_SEPOLICY_DIRS += $(COMMON_PATH)/sepolicy/vendor
SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/private
SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/public
BOARD_VENDOR_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/vendor
# Screen density
TARGET_SCREEN_DENSITY := 560
# Vibrator
TARGET_QTI_VIBRATOR_EFFECT_LIB := libqtivibratoreffect.xiaomi
TARGET_QTI_VIBRATOR_USE_EFFECT_STREAM := true
# WiFi
BOARD_HAS_QCOM_WLAN := true

22
README.md Normal file
View File

@@ -0,0 +1,22 @@
Device configuration for POCO F5 Pro / Xiaomi Redmi K60
=========================================
The POCO F5 Pro / Xiaomi Redmi K60 (codenamed _"mondrian"_) is a high-end smartphone from Xiaomi.
It was released in China in January 2023 and globally in May 2023.
## Device specifications
Basic | Spec Sheet
-------:|:-------------------------
Platform | Snapdragon® 8+ Gen 1 (SM8475)
RAM & Storage | 8GB/128GB, 8GB/256GB, 12GB/256GB, 12GB/512GB, 12GB/512GB, 16GB/512GB, 16GB/1024GB (LPDDR5 RAM, UFS 3.1 storage)
Shipped Android Version | 13
Battery | Non-removable, 5500 mAh
Display | 6.67″, 120Hz, 3200x1440 (526 ppi)
Rear camera | 64MP wide angle, 8MP ultra wide-angle, 2MP macro
Front camera | 16MP in-display
## Device picture
![POCO F5 Pro](https://i02.appmifile.com/638_operator_sg/21/04/2023/96bd043ea8810ff590a07ef10ff3508f.png "POCO F5 Pro in black and white")

View File

@@ -0,0 +1,210 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Be careful to write the static overlay xml -->
<!-- 1. do not create the new path name here, the new path name should -->
<!-- be created in common mixer path xml -->
<!-- 2. the new path name should not contain the nested path, and should be -->
<!-- defined follow after default ctrl -->
<!-- 3. the default ctl here will override that in common mixer path xml -->
<!-- 4. the first level path will replace the path in common mixer path xml -->
<!-- 5. the max nested path can't exceed 10 -->
<mixer>
<ctl name="HPHL Volume" value="18" />
<ctl name="HPHR Volume" value="18" />
<ctl name="TX_DEC0 Volume" value="84" />
<ctl name="TX_DEC1 Volume" value="84" />
<ctl name="TX_DEC2 Volume" value="84" />
<ctl name="TX_DEC3 Volume" value="84" />
<ctl name="TX_DEC4 Volume" value="84" />
<ctl name="ADC1 Volume" value="6" />
<ctl name="ADC2 Volume" value="6" />
<ctl name="ADC3 Volume" value="6" />
<ctl name="ADC4 Volume" value="6" />
<!-- add new awinic aw88261 controls -->
<ctl name="aw_dev_0_switch" value="Disable" />
<ctl name="aw_dev_0_prof" value="Music" />
<ctl name="aw_dev_1_switch" value="Disable" />
<ctl name="aw_dev_1_prof" value="Music" />
<ctl name="aw882xx_spk_sw_gpio_switch" value="0"/>
<!-- awinic controls end -->
<!-- swr haptic controls begin -->
<ctl name="SWR DAC_Port Switch" value="1" />
<!-- swr haptic controls end -->
<path name="speaker">
<ctl name="aw_dev_0_switch" value="Enable" />
<ctl name="aw_dev_1_switch" value="Enable" />
</path>
<path name="speaker-mono">
<ctl name="aw_dev_0_switch" value="Enable" />
</path>
<path name="speaker-mono-2">
<ctl name="aw_dev_0_prof" value="Voice" />
<ctl name="aw_dev_0_switch" value="Enable" />
<ctl name="aw_dev_1_prof" value="Voice" />
<ctl name="aw_dev_1_switch" value="Enable" />
</path>
<path name="speaker-mono-vbat">
<path name="speaker-mono" />
</path>
<path name="speaker-mono-2-vbat">
<path name="speaker-mono-2" />
</path>
<path name="speaker-vbat">
<path name="speaker" />
</path>
<path name="speaker-top">
<ctl name="aw_dev_0_prof" value="Music" />
<ctl name="aw_dev_0_switch" value="Enable" />
</path>
<path name="speaker-bot">
<ctl name="aw_dev_1_prof" value="Music" />
<ctl name="aw_dev_1_switch" value="Enable" />
</path>
<path name="speaker-mic">
<path name="amic5" />
</path>
<path name="speaker-mic-liquid">
<path name="amic5" />
</path>
<path name="speaker-protected">
<path name="speaker" />
</path>
<path name="voice-speaker-protected">
<path name="speaker-mono" />
</path>
<path name="voice-speaker-2-protected">
<path name="speaker-mono-2" />
</path>
<path name="speaker-protected-vbat">
<path name="speaker-protected" />
</path>
<path name="voice-speaker-protected-vbat">
<path name="voice-speaker-protected" />
</path>
<path name="voice-speaker-2-protected-vbat">
<path name="voice-speaker-2-protected" />
</path>
<path name="handset">
<ctl name="aw_dev_0_prof" value="Receiver" />
<ctl name="aw_dev_0_switch" value="Enable" />
<ctl name="aw882xx_spk_sw_gpio_switch" value="1" />
</path>
<path name="handset-mic">
<path name="amic1" />
</path>
<path name="handset-dmic-endfire">
<ctl name="TX DEC1 MUX" value="SWR_MIC" />
<ctl name="TX SMIC MUX1" value="SWR_MIC4" />
<ctl name="TX_AIF1_CAP Mixer DEC1" value="1" />
<ctl name="ADC1 ChMap" value="SWRM_TX2_CH1" />
<ctl name="TX0 MODE" value="ADC_LP" />
<ctl name="ADC1_MIXER Switch" value="1" />
<ctl name="AMIC1_MIXER Switch" value="1" />
<ctl name="TX DEC3 MUX" value="SWR_MIC" />
<ctl name="TX SMIC MUX3" value="SWR_MIC9" />
<ctl name="TX_AIF1_CAP Mixer DEC3" value="1" />
<ctl name="ADC4 MUX" value="INP5" />
<ctl name="ADC4 ChMap" value="SWRM_TX3_CH2" />
<ctl name="TX3 MODE" value="ADC_LP" />
<ctl name="ADC4_MIXER Switch" value="1" />
<ctl name="AMIC5_MIXER Switch" value="1" />
<ctl name="ADC1 Volume" value="8" />
<ctl name="ADC4 Volume" value="8" />
</path>
<path name="speaker-dmic-endfire">
<ctl name="TX DEC1 MUX" value="SWR_MIC" />
<ctl name="TX SMIC MUX1" value="SWR_MIC4" />
<ctl name="TX_AIF1_CAP Mixer DEC1" value="1" />
<ctl name="ADC1 ChMap" value="SWRM_TX2_CH1" />
<ctl name="TX0 MODE" value="ADC_LP" />
<ctl name="ADC1_MIXER Switch" value="1" />
<ctl name="AMIC1_MIXER Switch" value="1" />
<ctl name="TX DEC3 MUX" value="SWR_MIC" />
<ctl name="TX SMIC MUX3" value="SWR_MIC9" />
<ctl name="TX_AIF1_CAP Mixer DEC3" value="1" />
<ctl name="ADC4 MUX" value="INP5" />
<ctl name="ADC4 ChMap" value="SWRM_TX3_CH2" />
<ctl name="TX3 MODE" value="ADC_LP" />
<ctl name="ADC4_MIXER Switch" value="1" />
<ctl name="AMIC5_MIXER Switch" value="1" />
<ctl name="ADC1 Volume" value="8" />
<ctl name="ADC4 Volume" value="8" />
</path>
<path name="handset-stereo-dmic-ef">
<path name="handset-dmic-dual-adc" />
</path>
<path name="voice-headphones">
<ctl name="RX_MACRO RX0 MUX" value="AIF1_PB" />
<ctl name="RX_MACRO RX1 MUX" value="AIF1_PB" />
<ctl name="RX INT0_1 MIX1 INP0" value="RX0" />
<ctl name="RX INT1_1 MIX1 INP0" value="RX1" />
<ctl name="RX INT0 DEM MUX" value="CLSH_DSM_OUT" />
<ctl name="RX INT1 DEM MUX" value="CLSH_DSM_OUT" />
<ctl name="RX_COMP1 Switch" value="0" />
<ctl name="RX_COMP2 Switch" value="0" />
<ctl name="HPHL_COMP Switch" value="0" />
<ctl name="HPHR_COMP Switch" value="0" />
<ctl name="HPHL_RDAC Switch" value="1" />
<ctl name="HPHR_RDAC Switch" value="1" />
</path>
<!--ultrasound begin-->
<path name="ultrasound-handset">
<ctl name="T Enable RCV Pin Control" value="1" />
<ctl name="T PCM Source" value="ASP" />
<ctl name="T ASPTX Ref" value="Ref" />
<ctl name="T AMP Enable Switch" value="1" />
<ctl name="T AMP PCM Gain" value="5" />
</path>
<path name="ultrasound-mic">
<ctl name="TX DEC4 MUX" value="SWR_MIC" />
<ctl name="TX_DEC4 Volume" value="84" />
<ctl name="TX SMIC MUX4" value="SWR_MIC8" />
<ctl name="TX_AIF2_CAP Mixer DEC4" value="1" />
<ctl name="ADC3 Volume" value="12" />
<ctl name="ADC3 ChMap" value="SWRM_TX3_CH1" />
<ctl name="TX2 MODE" value="ADC_LP" />
<ctl name="HDR34 MUX" value="HDR34" />
<ctl name="ADC3_MIXER Switch" value="1" />
<ctl name="AMIC5_MIXER Switch" value="1" />
</path>
<!--ultrasound end-->
<path name="va-mic-enroll">
<ctl name="TX_AIF1_CAP Mixer DEC0" value="1" />
<ctl name="TX DEC0 MUX" value="SWR_MIC" />
<ctl name="TX0 MODE" value="ADC_LP" />
<ctl name="TX SMIC MUX0" value="SWR_MIC4" />
<ctl name="ADC1 ChMap" value="SWRM_TX2_CH1" />
<ctl name="AMIC1_MIXER Switch" value="1" />
<ctl name="ADC1_MIXER Switch" value="1" />
<ctl name="ADC1 Volume" value="8" />
<ctl name="TX_DEC0 Volume" value="86" />
</path>
</mixer>

File diff suppressed because it is too large Load Diff

1
board-info.txt Normal file
View File

@@ -0,0 +1 @@
require board=taro|mondrian

View File

@@ -24,7 +24,7 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota/launch_with_ven
$(call inherit-product, frameworks/native/build/phone-xhdpi-6144-dalvik-heap.mk)
# Inherit from the proprietary version
$(call inherit-product, vendor/xiaomi/sm8450-common/sm8450-common-vendor.mk)
$(call inherit-product, vendor/xiaomi/mondrian/mondrian-vendor.mk)
# Platform
TARGET_BOARD_PLATFORM := taro
@@ -113,6 +113,10 @@ PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/audio/microphone_characteristics.xml:$(TARGET_COPY_OUT_VENDOR)/etc/microphone_characteristics.xml \
$(LOCAL_PATH)/audio/usecaseKvManager.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usecaseKvManager.xml
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/audio/mixer_paths_overlay_static.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/sku_cape/mixer_paths_overlay_static.xml \
$(LOCAL_PATH)/audio/resourcemanager_waipio_mtp.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/sku_cape/resourcemanager_waipio_mtp.xml
PRODUCT_COPY_FILES += \
frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml \
frameworks/av/services/audiopolicy/config/bluetooth_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_audio_policy_configuration.xml \
@@ -344,6 +348,14 @@ PRODUCT_PACKAGES += \
WifiResTarget \
WifiResTarget_spf
PRODUCT_PACKAGES += \
ApertureResMondrian \
FrameworksResMondrian \
SettingsProviderResMondrian \
SettingsResMondrian \
SystemUIResMondrian \
WifiResMondrian
DEVICE_PACKAGE_OVERLAYS += \
$(LOCAL_PATH)/overlay-lineage \
@@ -397,9 +409,13 @@ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.se.omapi.uicc.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.se.omapi.uicc.xml
# Sensors
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/sensors/hals.conf:$(TARGET_COPY_OUT_VENDOR)/etc/sensors/hals.conf
PRODUCT_PACKAGES += \
android.hardware.sensors@2.1-service.xiaomi-multihal \
libsensorndkbridge
libsensorndkbridge \
sensors.xiaomi
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/sku_cape/android.hardware.sensor.accelerometer.xml \

View File

@@ -8,6 +8,9 @@
set -e
DEVICE=mondrian
VENDOR=xiaomi
# Load extract_utils and do some sanity checks
MY_DIR="${BASH_SOURCE%/*}"
if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
@@ -24,32 +27,25 @@ source "${HELPER}"
# Default to sanitizing the vendor folder before extraction
CLEAN_VENDOR=true
ONLY_COMMON=
ONLY_TARGET=
KANG=
SECTION=
while [ "${#}" -gt 0 ]; do
case "${1}" in
--only-common )
ONLY_COMMON=true
;;
--only-target )
ONLY_TARGET=true
;;
-n | --no-cleanup )
CLEAN_VENDOR=false
;;
-k | --kang )
KANG="--kang"
;;
-s | --section )
SECTION="${2}"; shift
CLEAN_VENDOR=false
;;
* )
SRC="${1}"
;;
-n | --no-cleanup)
CLEAN_VENDOR=false
;;
-k | --kang)
KANG="--kang"
;;
-s | --section)
SECTION="${2}"
shift
CLEAN_VENDOR=false
;;
*)
SRC="${1}"
;;
esac
shift
done
@@ -66,22 +62,19 @@ function blob_fixup() {
vendor/etc/vintf/manifest/c2_manifest_vendor.xml)
sed -ni '/dolby/!p' "${2}"
;;
vendor/etc/camera/mondrian_enhance_motiontuning.xml|vendor/etc/camera/mondrian_motiontuning.xml)
sed -i 's/xml=version/xml version/g' "${2}"
;;
vendor/etc/camera/pureView_parameter.xml)
sed -i 's/=\([0-9]\+\)>/="\1">/g' "${2}"
;;
esac
}
if [ -z "${ONLY_TARGET}" ]; then
# Initialize the helper for common device
setup_vendor "${DEVICE_COMMON}" "${VENDOR}" "${ANDROID_ROOT}" true "${CLEAN_VENDOR}"
# Initialize the helper
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" true "${CLEAN_VENDOR}"
extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}"
fi
extract "${MY_DIR}/proprietary-files.txt" "${SRC}" \
"${KANG}" --section "${SECTION}"
if [ -z "${ONLY_COMMON}" ] && [ -s "${MY_DIR}/../${DEVICE}/proprietary-files.txt" ]; then
# Reinitialize the helper for device
source "${MY_DIR}/../${DEVICE}/extract-files.sh"
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}"
extract "${MY_DIR}/../${DEVICE}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}"
fi
"${MY_DIR}/setup-makefiles.sh"
"${MY_DIR}/setup-makefiles.sh"

30
lineage_mondrian.mk Normal file
View File

@@ -0,0 +1,30 @@
#
# Copyright (C) 2022-2023 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
# Inherit from mondrian device
$(call inherit-product, device/xiaomi/mondrian/device.mk)
# Inherit from common lineage configuration
TARGET_DISABLE_EPPE := true
$(call inherit-product, vendor/lineage/config/common_full_phone.mk)
PRODUCT_NAME := lineage_mondrian
PRODUCT_DEVICE := mondrian
PRODUCT_MANUFACTURER := Xiaomi
PRODUCT_BRAND := POCO
PRODUCT_MODEL := 23013PC75G
PRODUCT_SYSTEM_NAME := mondrian_global
PRODUCT_SYSTEM_DEVICE := mondrian
PRODUCT_BUILD_PROP_OVERRIDES += \
PRIVATE_BUILD_DESC="mondrian_global-user 13 TKQ1.220905.001 V14.0.5.0.TMNMIXM release-keys" \
TARGET_DEVICE=$(PRODUCT_SYSTEM_DEVICE) \
TARGET_PRODUCT=$(PRODUCT_SYSTEM_NAME)
BUILD_FINGERPRINT := POCO/mondrian_global/mondrian:13/TKQ1.220905.001/V14.0.5.0.TMNMIXM:user/release-keys
PRODUCT_GMS_CLIENTID_BASE := android-xiaomi

View File

@@ -45,3 +45,6 @@ ro.hardware.wlan.chip=qca6490
ro.hardware.wlan.dbs=2
ro.hardware.wlan.mimo=1
ro.hardware.wlan.vendor=qcom
# Xiaomi
ro.product.mod_device=mondrian_global

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,10 @@
//
// Copyright (C) 2023 The LineageOS Project
//
// SPDX-License-Identifier: Apache-2.0
//
runtime_resource_overlay {
name: "ApertureResMondrian",
device_specific: true,
}

View File

@@ -0,0 +1,10 @@
<!--
Copyright (C) 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.lineageos.aperture.overlay.mondrian">
<overlay android:targetPackage="org.lineageos.aperture"
android:isStatic="true"
android:priority="700"/>
</manifest>

View File

@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2022-2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<!-- Enable auxiliary cameras selector. -->
<bool name="config_enableAuxCameras">true</bool>
<!-- The logical camera is ID4 -->
<string-array name="config_ignoredAuxCameraIds">
<item>0</item>
<item>2</item>
<item>3</item>
<item>5</item>
<item>6</item>
</string-array>
<!-- Decide whether to ignore auxiliary cameras that
are logical (made of multiple physical sensors).
Set this to false if your camera HAL doesn't expose
one or more aux cameras as a standalone camera device.
Note that you will probably need to add
more camera IDs to ignoreCameraIds. -->
<bool name="config_ignoreLogicalAuxCameras">false</bool>
<!-- The ultra-wide camera doesn't do 60 fps, but only
the logical ID4 is able to provide stable 60 fps from the main camera.
Even if ID0 gets fixed, it's better this way until physical and logical IDs
can coexist in Aperture (e.g. at 60 fps, logical ID would be replaced with physical).
When both things happen, ID4 can be removed from this list while ID0 and ID2
should no longer be ignored.
-->
<string-array name="config_additionalVideoConfigurations">
<item>0</item> <item>sd|hd|fhd|uhd</item> <item>60</item>
<item>1</item> <item>sd|hd|fhd</item> <item>60</item>
<item>4</item> <item>sd|hd|fhd|uhd</item> <item>60</item>
</string-array>
<!-- 2x in-sensor zoom seemingly requires
org.codeaurora.qcamera3.sessionParameters.EnableInsensorZoom
and so is omitted. -->
<string-array name="config_logicalZoomRatios">
<item>4</item> <item>0.6</item> <item>0.64999998</item>
</string-array>
</resources>

View File

@@ -0,0 +1,10 @@
//
// Copyright (C) 2022 The LineageOS Project
//
// SPDX-License-Identifier: Apache-2.0
//
runtime_resource_overlay {
name: "FrameworksResMondrian",
device_specific: true,
}

View File

@@ -0,0 +1,10 @@
<!--
Copyright (C) 2022 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.overlay.mondrian">
<overlay android:targetPackage="android"
android:isStatic="true"
android:priority="700"/>
</manifest>

View File

@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<integer name="config_udfps_illumination_transition_ms">0</integer>
<!-- Type of the udfps long press sensor. Empty if long press is not supported. -->
<string name="config_dozeUdfpsLongPressSensorType" translatable="false">org.lineageos.sensor.udfps</string>
<!-- The bounding path of the cutout region of the main built-in display.
Must either be empty if there is no cutout region, or a string that is parsable by
{@link android.util.PathParser}.
The path is assumed to be specified in display coordinates with pixel units and in
the display's native orientation, with the origin of the coordinate system at the
center top of the display. Optionally, you can append either `@left` or `@right` to the
end of the path string, in order to change the path origin to either the top left,
or top right of the display.
To facilitate writing device-independent emulation overlays, the marker `@dp` can be
appended after the path string to interpret coordinates in dp instead of px units.
Note that a physical cutout should be configured in pixels for the best results.
If the display supports multiple resolutions, please define the path config based on the
highest resolution so that it can be scaled correctly in each resolution.
Example for a 10px x 10px square top-center cutout:
<string ...>M -5,0 L -5,10 L 5,10 L 5,0 Z</string>
Example for a 10dp x 10dp square top-center cutout:
<string ...>M -5,0 L -5,10 L 5,10 L 5,0 Z @dp</string>
@see https://www.w3.org/TR/SVG/paths.html#PathData
-->
<string name="config_mainBuiltInDisplayCutout" translatable="false">M 0,0 H -34 V 120 H 34 V 0 H 0 Z</string>
<!-- The default refresh rate for a given device. Change this value to set a higher default
refresh rate. If the hardware composer on the device supports display modes with a higher
refresh rate than the default value specified here, the framework may use those higher
refresh rate modes if an app chooses one by setting preferredDisplayModeId or calling
setFrameRate().
If a non-zero value is set for config_defaultPeakRefreshRate, then
config_defaultRefreshRate may be set to 0, in which case the value set for
config_defaultPeakRefreshRate will act as the default frame rate. -->
<integer name="config_defaultRefreshRate">0</integer>
<!-- The default peak refresh rate for a given device. Change this value if you want to prevent
the framework from using higher refresh rates, even if display modes with higher refresh
rates are available from hardware composer. Only has an effect if the value is
non-zero. -->
<integer name="config_defaultPeakRefreshRate">120</integer>
<!-- List of biometric sensors on the device, in decreasing strength. Consumed by AuthService
when registering authenticators with BiometricService. Format must be ID:Modality:Strength,
where: IDs are unique per device, Modality as defined in BiometricAuthenticator.java,
and Strength as defined in Authenticators.java -->
<string-array name="config_biometric_sensors" translatable="false">
<item>0:2:15</item>
</string-array>
<!-- The properties of a UDFPS sensor in pixels, in the order listed below: -->
<integer-array name="config_udfps_sensor_props" translatable="false">
<item>720</item>
<item>2882</item>
<item>124</item>
</integer-array>
</resources>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Radius of the software rounded corners at the top of the display in its natural
orientation. If zero, the value of rounded_corner_radius is used. -->
<dimen name="rounded_corner_radius_top">120.0px</dimen>
<!-- Radius of the software rounded corners at the bottom of the display in its natural
orientation. If zero, the value of rounded_corner_radius is used. -->
<dimen name="rounded_corner_radius_bottom">120.0px</dimen>
</resources>

View File

@@ -0,0 +1,208 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<device name="Android">
<item name="none">0</item>
<!-- Additional power used when screen is turned on at minimum brightness -->
<item name="screen.on">97.1</item>
<!-- Additional power used when screen is at maximum brightness, compared to
screen at minimum brightness -->
<item name="screen.full">424.86</item>
<array name="cpu.clusters.cores">
<value>4</value>
<value>3</value>
<value>1</value>
</array>
<!-- Different CPU speeds as reported in
/sys/devices/system/cpu/cpu0/cpufreq/stats/scaling_available_frequencies -->
<array name="cpu.core_speeds.cluster0">
<value>300000</value>
<value>441600</value>
<value>556800</value>
<value>691200</value>
<value>806400</value>
<value>940800</value>
<value>1056000</value>
<value>1132800</value>
<value>1228800</value>
<value>1324800</value>
<value>1440000</value>
<value>1555200</value>
<value>1670400</value>
<value>1804800</value>
</array>
<!-- Additional power used by a CPU from cluster 0 when running at different
speeds. Currently this measurement also includes cluster cost. -->
<array name="cpu.core_power.cluster0">
<value>36.95</value>
<value>39.85</value>
<value>41.36</value>
<value>44.01</value>
<value>45.93</value>
<value>49.09</value>
<value>51.5</value>
<value>54.12</value>
<value>56.37</value>
<value>59.99</value>
<value>65.83</value>
<value>71.21</value>
<value>77.48</value>
<value>85.57</value>
</array>
<!-- Different CPU speeds as reported in
/sys/devices/system/cpu/cpu4/cpufreq/stats/scaling_available_frequencies -->
<array name="cpu.core_speeds.cluster1">
<value>633600</value>
<value>768000</value>
<value>883200</value>
<value>998400</value>
<value>1113600</value>
<value>1209600</value>
<value>1324800</value>
<value>1440000</value>
<value>1555200</value>
<value>1651200</value>
<value>1766400</value>
<value>1881600</value>
<value>1996800</value>
<value>2112000</value>
<value>2227200</value>
<value>2342400</value>
<value>2496000</value>
</array>
<!-- Additional power used by a CPU from cluster 1 when running at different
speeds. Currently this measurement also includes cluster cost. -->
<array name="cpu.core_power.cluster1">
<value>55.02</value>
<value>62.61</value>
<value>69.6</value>
<value>78.48</value>
<value>85.31</value>
<value>92.39</value>
<value>102.48</value>
<value>114.48</value>
<value>128.66</value>
<value>140.69</value>
<value>159.06</value>
<value>174.59</value>
<value>194.01</value>
<value>213.56</value>
<value>234.26</value>
<value>254.32</value>
<value>291.15</value>
</array>
<array name="cpu.core_speeds.cluster2">
<value>787200</value>
<value>921600</value>
<value>1036800</value>
<value>1171200</value>
<value>1286400</value>
<value>1401600</value>
<value>1536000</value>
<value>1651200</value>
<value>1766400</value>
<value>1881600</value>
<value>1996800</value>
<value>2131200</value>
<value>2246400</value>
<value>2361600</value>
<value>2476800</value>
<value>2592000</value>
<value>2707200</value>
<value>2822400</value>
<value>2918400</value>
<value>2995200</value>
</array>
<array name="cpu.core_power.cluster2">
<value>99.31</value>
<value>112.68</value>
<value>125.12</value>
<value>140.83</value>
<value>153.37</value>
<value>168.06</value>
<value>192.12</value>
<value>212.9</value>
<value>235.13</value>
<value>260.82</value>
<value>297.13</value>
<value>345.86</value>
<value>377.35</value>
<value>411.59</value>
<value>451.3</value>
<value>498.24</value>
<value>543.21</value>
<value>603.79</value>
<value>671.7</value>
<value>733.8</value>
</array>
<!-- Additional power consumption by CPU excluding cluster and core when
running -->
<item name="cpu.active">17.47</item>
<!-- Current when CPU is idle -->
<item name="cpu.idle">5.86</item>
<!-- Power consumption when CPU is suspended -->
<item name="cpu.suspend">0</item>
<!-- This is the battery capacity in mAh (measured at nominal voltage) -->
<item name="battery.capacity">5500</item>
<item name="wifi.on">0.83</item>
<item name="wifi.active">174.8525</item>
<item name="wifi.scan">28.44</item>
<item name="dsp.audio">23.4</item>
<item name="dsp.video">56.68</item>
<item name="camera.flashlight">107.01</item>
<item name="camera.avg">883.04</item>
<item name="gps.on">54.4</item>
<item name="radio.active">163.015</item>
<item name="radio.scanning">73.24</item>
<array name="radio.on">
<value>1.98</value>
<value>1.98</value>
</array>
<item name="modem.controller.idle">6</item>
<item name="modem.controller.rx">180</item>
<item name="modem.controller.tx">186</item>
<item name="modem.controller.voltage">3700</item>
<!-- Memory bandwidth power values in mA at the rail. There must be one value
for each bucket defined in the device tree. -->
<array name="memory.bandwidths">
<value>17</value>
</array>
<!-- Idle Receive current for wifi radio in mA. 0 by default-->
<item name="wifi.controller.idle">1</item>
<!-- Rx current for wifi radio in mA. 0 by default-->
<item name="wifi.controller.rx">176</item>
<!-- Tx current for wifi radio in mA. 0 by default-->
<item name="wifi.controller.tx">200</item>
<array name="wifi.controller.tx_levels">
<value>1</value>
</array>
<!-- Operating volatage for wifi radio in mV. 0 by default-->
<item name="wifi.controller.voltage">3700</item>
<array name="wifi.batchedscan">
<value>.0001</value>
<value>.001</value>
<value>.01</value>
<value>.1</value>
<value>1</value>
</array>
<item name="bluetooth.active">6.62</item>
<item name="bluetooth.on">0.8</item>
<item name="bluetooth.controller.voltage">3700</item>
</device>

View File

@@ -0,0 +1,10 @@
//
// Copyright (C) 2023 The LineageOS Project
//
// SPDX-License-Identifier: Apache-2.0
//
runtime_resource_overlay {
name: "SettingsProviderResMondrian",
device_specific: true
}

View File

@@ -0,0 +1,10 @@
<!--
Copyright (C) 2022 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.providers.settings.overlay.mondrian">
<overlay android:targetPackage="com.android.providers.settings"
android:isStatic="true"
android:priority="700"/>
</manifest>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Default for Settings.Global.DEVICE_NAME $1=MODEL-->
<string name="def_device_name_simple">POCO F5 Pro</string>
</resources>

View File

@@ -0,0 +1,10 @@
//
// Copyright (C) 2022 The LineageOS Project
//
// SPDX-License-Identifier: Apache-2.0
//
runtime_resource_overlay {
name: "SettingsResMondrian",
device_specific: true,
}

View File

@@ -0,0 +1,10 @@
<!--
Copyright (C) 2022 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.settings.overlay.mondrian">
<overlay android:targetPackage="com.android.settings"
android:isStatic="true"
android:priority="700"/>
</manifest>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Whether to show Smooth Display feature in Settings Options -->
<bool name="config_show_smooth_display">true</bool>
</resources>

View File

@@ -0,0 +1,10 @@
//
// Copyright (C) 2022 The LineageOS Project
//
// SPDX-License-Identifier: Apache-2.0
//
runtime_resource_overlay {
name: "SystemUIResMondrian",
device_specific: true,
}

View File

@@ -0,0 +1,10 @@
<!--
Copyright (C) 2022 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.systemui.overlay.mondrian">
<overlay android:targetPackage="com.android.systemui"
android:isStatic="true"
android:priority="700"/>
</manifest>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- The radius of the enrollment progress bar, in dp -->
<integer name="config_udfpsEnrollProgressBar" translatable="false">129</integer>
</resources>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<dimen name="rounded_corner_content_padding">49.0px</dimen>
<dimen name="keyguard_indication_margin_bottom">16dp</dimen>
<!-- Location on the screen of the center of the physical power button. This is a reasonable
default that should be overridden by device-specific overlays. -->
<dimen name="physical_power_button_center_screen_location_y">1385px</dimen>
<!-- Location on the screen of the center of the fingerprint sensor. For devices with under
display fingerprint sensors, this directly corresponds to the fingerprint sensor's location.
For devices with sensors on the back of the device, this corresponds to the location on the
screen directly in front of the sensor. -->
<dimen name="physical_fingerprint_sensor_center_screen_location_y">2882px</dimen>
</resources>

View File

@@ -0,0 +1,10 @@
//
// Copyright (C) 2023 The LineageOS Project
//
// SPDX-License-Identifier: Apache-2.0
//
runtime_resource_overlay {
name: "WifiResMondrian",
device_specific: true
}

View File

@@ -0,0 +1,11 @@
<!--
Copyright (C) 2022 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.wifi.resources.overlay.mondrian">
<overlay android:targetPackage="com.android.wifi.resources"
android:targetName="WifiCustomization"
android:isStatic="true"
android:priority="700"/>
</manifest>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<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">POCO F5 Pro</string>
</resources>

3
sensors/hals.conf Normal file
View File

@@ -0,0 +1,3 @@
sensors.ssc.so
sensors.touch.detect.so
sensors.xiaomi.so

View File

@@ -8,6 +8,9 @@
set -e
DEVICE=mondrian
VENDOR=xiaomi
# Load extract_utils and do some sanity checks
MY_DIR="${BASH_SOURCE%/*}"
if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
@@ -21,28 +24,13 @@ if [ ! -f "${HELPER}" ]; then
fi
source "${HELPER}"
# Initialize the helper for common
setup_vendor "${DEVICE_COMMON}" "${VENDOR}" "${ANDROID_ROOT}" true
# Initialize the helper
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}"
# Warning headers and guards
write_headers "cupid marble mondrian zeus"
write_headers
# The standard common blobs
write_makefiles "${MY_DIR}/proprietary-files.txt" true
# Finish
write_footers
if [ -s "${MY_DIR}/../${DEVICE}/proprietary-files.txt" ]; then
# Reinitialize the helper for device
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false
# Warning headers and guards
write_headers
# The standard device blobs
write_makefiles "${MY_DIR}/../${DEVICE}/proprietary-files.txt" true
# Finish
write_footers
fi
write_footers