37 Commits
udc ... vic

Author SHA1 Message Date
flakeforever
42ec5f6a97 mondrian: Switch powershare HAL to lineage default 2025-06-08 21:24:33 -07:00
flakeforever
a002e86d9e mondrian: Update to OS2.0.9.0.VMNMIXM 2025-06-05 00:58:06 -07:00
flakeforever
2654aa9aa2 mondrian: Update to OS2.0.7.0.VMNMIXM 2025-04-14 20:17:52 -07:00
Cosmin Tanislav
8691679d0e mondrian: move vibrator effect stream config to select 2025-04-14 20:15:59 -07:00
flakeforever
032a6e1391 mondrian: Update to OS2.0.5.0.VMNMIXM 2025-04-12 01:00:49 -07:00
flakeforever
2a272f2341 mondrian: Update dependencies 2025-04-12 00:57:20 -07:00
flakeforever
7384e0043a mondrian: Remove NfcNci 2025-04-12 00:56:10 -07:00
flakeforever
d5e42e448a mondrian: bluetooth: Add LHDC support
Patch required:
https://github.com/flakeforever/device_xiaomi_mondrian-lhdc-patch.git

Include files required:
https://github.com/flakeforever/android_external_liblhdc.git

 * Import LHDC libraries from OS2.0.3.0.VMNMIXM
Please extract LHDC libraries from your device in stock ROM.
2025-03-09 14:15:34 +08:00
flakeforever
ced90487c7 mondrian: Build XiaomiDolby 2025-03-03 12:19:53 +08:00
flakeforever
26b4e4ccf3 mondrian: parts: Remove Dolby Atmos 2025-03-03 12:19:53 +08:00
flakeforever
3757e1eaa8 mondrian: Switch to python extract-utils 2025-03-03 12:19:53 +08:00
flakeforever
254329edc3 mondrian: sepolicy: Allow bluetooth to access data files 2025-03-03 12:19:53 +08:00
flakeforever
a912eb4cd4 mondrian: sepolicy: Label NFC HAL service 2025-02-16 12:13:01 +08:00
flakeforever
ebfa2aecaf mondrian: Update to OS2.0.3.0.VMNMIXM 2025-02-16 12:11:50 +08:00
flakeforever
11b8c2227c mondrian: overlay: Add FPS info support 2025-02-06 16:21:19 +08:00
flakeforever
bc91ffb7f9 mondrian: Update WiFi HAL configuration from HyperOS V816.0.14.0.UMNMIXM 2025-02-06 16:21:19 +08:00
codeworkx
77c0e85245 mondrian: wifi-display: Add WfdCommon to boot jars 2025-02-06 16:21:19 +08:00
Arian
571bb3c5ad mondrian: Update display, GPS and QCC blobs from ingot UKQ1.240227.165 2025-02-06 16:21:19 +08:00
Arian
6387640b4f mondrian: Update WiFi display configuration 2025-02-06 16:21:19 +08:00
flakeforever
cb0018be73 mondrian: Remove libqti_vndfwk_detect 2025-02-06 16:21:19 +08:00
flakeforever
223eebe95c mondrian: Include reserved size configuration 2025-01-28 23:07:41 +08:00
flakeforever
e82f3c95b8 mondrian: overlay: Enable PowerOffAlarmService 2025-01-17 12:58:43 +08:00
flakeforever
840fedd7d6 mondrian: overlay: Remove stable device display size 2025-01-17 12:57:32 +08:00
flakeforever
49b83792df mondrian: init: Add support for Indian device 2025-01-15 16:45:06 +08:00
flakeforever
129d20896e mondrian: sepolicy: Remove /sys/class/qcom-battery 2025-01-14 11:36:34 +08:00
flakeforever
54c24e2d93 mondrian: Remove unused bootinfo fingerprint 2025-01-13 08:53:37 +08:00
flakeforever
29d04bb52f mondrian: Update build fingerprint 2025-01-13 08:53:28 +08:00
flakeforever
6678a1528a mondrian: overlay: Change battery divider 2025-01-01 16:04:44 +08:00
flakeforever
97650b3e86 mondrian: Enable volume steps settings 2025-01-01 16:04:44 +08:00
flakeforever
8b1a81f6e0 mondrian: Update build fingerprint and vendor security patch 2025-01-01 16:04:44 +08:00
flakeforever
52f13577b7 mondrian: parts: Add FEAS 2.2 2024-12-08 21:25:39 +08:00
Beverly
b6f6c72e34 mondrian: overlay: Update pixel pitch
Bug: 319894241
Flag: ACONFIG com.android.systemui.device_entry_udfps_refactor DEVELOPMENT
Test: manual

Change-Id: Iaa9576cb95ebe73043b7030b2b176f67bc90e3a1
2024-12-08 21:25:39 +08:00
flakeforever
f34a05aeb5 mondrian: Update overlays for Android 15 2024-12-08 21:25:39 +08:00
flakeforever
846bde06df mondrian: Update media scripts from Android 15 2024-12-08 21:25:39 +08:00
HeCheng Yu
4713544557 mondrian: Update blob_fixup items for Android 15 2024-12-08 21:25:39 +08:00
flakeforever
a01025892e mondrian: Update USB HAL service for Android 15 2024-12-08 21:25:25 +08:00
flakeforever
46accba2d4 mondrian: Evolution-X 10.0 bringup 2024-11-24 01:37:28 +08:00
73 changed files with 1352 additions and 1924 deletions

View File

@@ -74,6 +74,9 @@ BOARD_AVB_VBMETA_SYSTEM_ALGORITHM := SHA256_RSA2048
BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION := 2
# Bluetooth
$(call soong_config_set, btservices, use_lhdc, true)
# Bootloader
TARGET_BOOTLOADER_BOARD_NAME := taro
TARGET_NO_BOOTLOADER := true
@@ -83,10 +86,10 @@ TARGET_CAMERA_OVERRIDE_FORMAT_FROM_RESERVED := true
TARGET_CAMERA_PACKAGE_NAME := com.android.camera
# DTB
TARGET_PREBUILT_DTB := $(KERNEL_PATH)/dtb
# TARGET_PREBUILT_DTB := $(KERNEL_PATH)/dtb
BOARD_PREBUILT_DTBIMAGE_DIR := $(KERNEL_PATH)/dtbs
PRODUCT_COPY_FILES += $(KERNEL_PATH)/dtb:dtb.img
PRODUCT_COPY_FILES += $(KERNEL_PATH)/dtb.img:dtb.img
TARGET_NEEDS_DTBOIMAGE := false
BOARD_PREBUILT_DTBOIMAGE := $(KERNEL_PATH)/dtbo.img
@@ -142,7 +145,6 @@ BOARD_VENDOR_RAMDISK_FRAGMENT.dlkm.KERNEL_MODULE_DIRS := top
BOARD_KERNEL_CMDLINE := \
video=vfb:640x400,bpp=32,memsize=3072000 \
disable_dma32=on \
bootinfo.fingerprint=$(LINEAGE_VERSION) \
mtdoops.fingerprint=$(LINEAGE_VERSION)
BOARD_BOOTCONFIG := \
@@ -174,8 +176,7 @@ BOARD_FLASH_BLOCK_SIZE := 0x020000 # (BOARD_KERNEL_PAGESIZE * 64)
BOARD_BOOTIMAGE_PARTITION_SIZE := 0x0C000000
BOARD_DTBOIMG_PARTITION_SIZE := 0x01800000
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x06400000
BOARD_SUPER_PARTITION_SIZE := 0x220000000
BOARD_USERDATAIMAGE_PARTITION_SIZE := 239033364480 # 0x37A77FB000
BOARD_SUPER_PARTITION_SIZE := 9126805504 # 0x220000000
BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 0x06000000
BOARD_SUPER_PARTITION_GROUPS := qti_dynamic_partitions
@@ -195,6 +196,8 @@ TARGET_COPY_OUT_SYSTEM_EXT := system_ext
TARGET_COPY_OUT_VENDOR := vendor
TARGET_COPY_OUT_VENDOR_DLKM := vendor_dlkm
-include vendor/lineage/config/BoardConfigReservedSize.mk
# Platform
BOARD_USES_QCOM_HARDWARE := true
@@ -230,7 +233,7 @@ BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE := true
ENABLE_VENDOR_RIL_SERVICE := true
# Security patch level
VENDOR_SECURITY_PATCH := 2024-10-01
VENDOR_SECURITY_PATCH := 2025-05-06
# Sensor
SOONG_CONFIG_NAMESPACES += SENSORS_XIAOMI
@@ -249,16 +252,16 @@ BOARD_VENDOR_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/vendor
TARGET_SCREEN_DENSITY := 560
# Vibrator
TARGET_QTI_VIBRATOR_EFFECT_LIB := libqtivibratoreffect.xiaomi
TARGET_QTI_VIBRATOR_USE_EFFECT_STREAM := true
$(call soong_config_set,qti_vibrator,effect_lib,libqtivibratoreffect.xiaomi)
$(call soong_config_set,qti_vibrator,use_effect_stream,true)
# WiFi
BOARD_HAS_QCOM_WLAN := true
BOARD_WLAN_DEVICE := qcwcn
BOARD_HOSTAPD_DRIVER := NL80211
BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
CONFIG_IEEE80211AX := true
QC_WIFI_HIDL_FEATURE_DUAL_AP := true
QC_WIFI_HIDL_FEATURE_DUAL_STA := true
WIFI_DRIVER_BUILT := qca_cld3
@@ -270,8 +273,3 @@ WIFI_HIDL_FEATURE_AWARE := true
WIFI_HIDL_FEATURE_DUAL_INTERFACE := true
WIFI_HIDL_UNIFIED_SUPPLICANT_SERVICE_RC_ENTRY := true
WPA_SUPPLICANT_VERSION := VER_0_8_X
PRODUCT_VENDOR_MOVE_ENABLED := true
BOARD_WPA_SUPPLICANT_PRIVATE_LIB_EVENT := "ON"
BOARD_HOSTAPD_PRIVATE_LIB_EVENT := "ON"

View File

@@ -7,6 +7,9 @@ ro.charger.enable_suspend=1
# CNE
persist.vendor.cne.feature=1
# FEAS
ro.feas.enable=true
# Graphics
debug.sf.disable_backpressure=1

View File

@@ -33,7 +33,7 @@ ro.audio.monitorRotation=true
#ro.config.media_vol_default=100
#ro.config.media_vol_steps=150
#ro.config.system_vol_steps=15
#ro.config.vc_call_vol_steps=11
ro.config.vc_call_vol_steps=11
ro.qc.sdk.audio.fluencetype=none
ro.qc.sdk.audio.ssr=false
ro.vendor.audio.aiasst.support=true
@@ -447,7 +447,6 @@ persist.vendor.rcs.singlereg.feature=1
persist.vendor.ssr.restart_level=ALL_ENABLE
# USB
persist.sys.usb.config=none
sys.usb.mtp.batchcancel=1
vendor.usb.diag.func.name=ffs
vendor.usb.dpl.inst.name=dpl
@@ -456,7 +455,7 @@ vendor.usb.rmnet.func.name=gsi
vendor.usb.rmnet.inst.name=rmnet
vendor.usb.rndis.func.name=gsi
vendor.usb.use_ffs_mtp=1
vendor.usb.use_gadget_hal=0
vendor.usb.use_gadget_hal=1
# VCB
persist.vendor.vcb.ability=true

0
configs/wifi/WCNSS_qcom_cfg_qca6490.ini Normal file → Executable file
View File

View File

@@ -0,0 +1,114 @@
# This file allows user to override the factory
# defaults for the WLAN Driver
gDot11Mode=0
InfraUapsdVoSrvIntv=0
InfraUapsdViSrvIntv=0
InfraUapsdBeSrvIntv=0
InfraUapsdBkSrvIntv=0
gAddTSWhenACMIsOff=1
gEnableApOBSSProt=1
RTSThreshold=1048576
g11dSupportEnabled=0
gEnableDFSMasterCap=1
gNeighborScanTimerPeriod=200
gNeighborLookupThreshold=76
FastRoamEnabled=1
RoamRssiDiff=5
gChannelBondingMode5GHz=1
gAllowDFSChannelRoam=1
gSetTxChainmask1x1=1
gSetRxChainmask1x1=1
gWlanMccToSccSwitchMode = 3
gEnableTXSTBC=1
gEnableTxBFeeSAP=1
gEnableTxBFin20MHz=1
gEnableTxSUBeamformer=1
gRrmEnable=1
gVhtAmpduLenExponent=7
gVhtMpduLen=2
isP2pDeviceAddrAdministrated=0
gEnableVhtFor24GHzBand=1
gEnableLpassSupport=1
gCountryCodePriority=1
gEnableMuBformee=1
gTDLSExternalControl=1
gEnableTDLSOffChannel=1
gThermalMitigationEnable=0
################ Datapath feature set Begin ################
gVhtRxMCS=2
gVhtTxMCS=2
gEnable2x2=1
gVhtRxMCS2x2=2
gVhtTxMCS2x2=2
dp_tx_ring_size=3072
rx_mode=20
gEnableFastPath=1
TSOEnable=1
GROEnable=1
ght_mpdu_density=5
gEnableFlowSteering=1
maxMSDUsPerRxInd=8
dp_rx_fisa_enable=1
dp_rx_flow_search_table_size=128
rpsRxQueueCpuMapList=07
legacy_mode_csum_disable=0
################ Datapath feature set End ################
adaptive_dwell_mode_enabled=1
hostscan_adaptive_dwell_mode=1
enable_rtt_mac_randomization=1
gEnableSNRMonitoring=1
gWmiCreditCount=1
AutoChannelSelectWeight=0x00fafafa
bcast_twt=1
gRuntimePM=2
gRuntimePMDelay=500
oem_6g_support_disable=0
gEnableSWLM=1
g_enable_pci_gen=1
ssdp=0
gRArateLimitInterval=600
gEnableSifsBurst=1
gIbssTxSpEndInactivityTime=10
RX_THREAD_UL_CPU_AFFINITY_MASK=0xc0
dp_rx_buff_prealloc_pool=1
dp_rx_refill_buff_pool=1
dp_rx_fst_in_cmem=1
################ XIAOMI ADD ######################
gActiveMaxChannelTime=40
gIPAConfig=0
gIPADescSize=800
active_max_channel_time_2g=80
wlm_latency_flags_ultralow=0x180003
gActiveMcBcBpfMode=1
assoc_failure_timeout=5000
gEnableNUDTracking=3
etsi13_srd_chan_in_master_mode=7
gSelect5GHzMargin=5
candidate_min_rssi_for_beacon_miss=-83
gtraffic_threshold=50
enable_ftopen=0
twt_congestion_timeout=0
gEnableSARV1toSARV2=1
g_prefer_5g_scc_to_dbs=8
gEnableModulatedDTIM=3
gMaxLIModulatedDTIM=3
enable_mod_dtim_on_system_suspend=1
avoid_list_expiry_time=3
black_list_expiry_time=5
bad_bssid_counter_thresh=7
gindoor_channel_support=1
gReportMaxLinkSpeed=2
icmp_req_to_fw_mark_interval=200
twt_responder=0
END
# Note: Configuration parser would not read anything past the END marker

0
configs/wifi/p2p_supplicant_overlay.conf Normal file → Executable file
View File

0
configs/wifi/vendor_cmd.xml Normal file → Executable file
View File

0
configs/wifi/wpa_supplicant_overlay.conf Normal file → Executable file
View File

198
device.mk
View File

@@ -46,27 +46,6 @@ PRODUCT_PACKAGES += \
checkpoint_gc \
otapreopt_script
# AIDL NDK backend
PRODUCT_PACKAGES += \
android.hardware.common-V2-ndk_platform.vendor \
android.hardware.gnss-V1-ndk_platform.vendor \
android.hardware.graphics.common-V3-ndk \
android.hardware.identity-V3-ndk_platform.vendor \
android.hardware.keymaster-V3-ndk_platform.vendor \
android.hardware.light-V1-ndk_platform.vendor \
android.hardware.memtrack-V1-ndk_platform.vendor \
android.hardware.security.keymint-V1-ndk_platform.vendor \
android.hardware.security.secureclock-V1-ndk_platform.vendor \
android.hardware.security.sharedsecret-V1-ndk_platform.vendor \
android.hardware.security.keymint-V2-ndk.vendor \
android.hardware.security.rkp-V3-ndk.vendor \
android.frameworks.sensorservice-V1-ndk.vendor \
android.system.keystore2-V1-ndk_platform.vendor
# ANT+
PRODUCT_PACKAGES += \
com.dsi.ant@1.0.vendor
# API
PRODUCT_SHIPPING_API_LEVEL := 31
BOARD_SHIPPING_API_LEVEL := 31
@@ -139,12 +118,7 @@ PRODUCT_PACKAGES += \
# Bluetooth
PRODUCT_PACKAGES += \
android.hardware.bluetooth@1.0.vendor \
android.hardware.bluetooth.audio-impl \
com.qualcomm.qti.bluetooth_audio@1.0.vendor \
vendor.qti.hardware.bluetooth_audio@2.1.vendor \
vendor.qti.hardware.btconfigstore@1.0.vendor \
vendor.qti.hardware.btconfigstore@2.0.vendor
android.hardware.bluetooth.audio-impl
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.bluetooth.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth.xml \
@@ -165,18 +139,11 @@ PRODUCT_PACKAGES_DEBUG += \
$(call inherit-product-if-exists, vendor/xiaomi/miuicamera/config.mk)
PRODUCT_PACKAGES += \
android.frameworks.cameraservice.common@2.0.vendor \
android.frameworks.cameraservice.service@2.2.vendor \
android.hardware.camera.provider@2.7.vendor \
camera.device@1.0-impl \
libcamera2ndk_vendor \
vendor.qti.hardware.camera.aon@1.0.vendor \
vendor.qti.hardware.camera.postproc@1.0.vendor
camera.device@1.0-impl
PRODUCT_PACKAGES += \
libMegviiFacepp-0.5.2 \
libmegface \
libexif.vendor
libmegface
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \
@@ -184,35 +151,10 @@ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.camera.full.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.full.xml \
frameworks/native/data/etc/android.hardware.camera.raw.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.raw.xml
# Capabilityconfigstore
PRODUCT_PACKAGES += \
vendor.qti.hardware.capabilityconfigstore@1.0.vendor
# Display
PRODUCT_PACKAGES += \
vendor.display.config@1.11.vendor \
vendor.qti.hardware.display.config-V1-ndk_platform.vendor \
vendor.qti.hardware.display.config-V2-ndk_platform.vendor \
vendor.qti.hardware.display.config-V3-ndk_platform.vendor \
vendor.qti.hardware.display.config-V4-ndk_platform.vendor \
vendor.qti.hardware.display.config-V5-ndk_platform.vendor \
vendor.qti.hardware.display.config-V6-ndk_platform.vendor \
vendor.qti.hardware.display.allocator@1.0.vendor \
vendor.qti.hardware.display.composer@1.0.vendor \
vendor.qti.hardware.display.composer@2.0.vendor \
vendor.qti.hardware.display.mapper@1.0.vendor \
vendor.qti.hardware.display.mapper@1.1.vendor \
vendor.qti.hardware.display.mapper@2.0.vendor
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/display/snapdragon_color_libs_config.xml:$(TARGET_COPY_OUT_VENDOR)/etc/snapdragon_color_libs_config.xml
# DRM
PRODUCT_PACKAGES += \
android.hardware.drm@1.4.vendor \
android.hardware.drm@1.4-service.clearkey.vendor \
libdrm.vendor
# Dumpstate
PRODUCT_PACKAGES += \
android.hardware.dumpstate@1.1.vendor
@@ -225,20 +167,16 @@ PRODUCT_PACKAGES += \
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.fingerprint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.fingerprint.xml
# Gatekeeper
PRODUCT_PACKAGES += \
android.hardware.gatekeeper@1.0.vendor
# GPS
PRODUCT_PACKAGES += \
android.hardware.gnss@2.1-impl-qti:64 \
android.hardware.gnss-aidl-impl-qti:64 \
android.hardware.gnss@2.1-impl-qti \
android.hardware.gnss-aidl-impl-qti \
android.hardware.gnss-aidl-service-qti
PRODUCT_PACKAGES += \
libbatching:64 \
libgeofencing:64 \
libgnss:64
libbatching \
libgeofencing \
libgnss
PRODUCT_PACKAGES += \
apdr.conf \
@@ -257,9 +195,6 @@ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.location.gps.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.location.gps.xml
# Graphics
PRODUCT_PACKAGES += \
libgui_vendor
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.opengles.aep.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.opengles.aep.xml \
frameworks/native/data/etc/android.hardware.vulkan.compute-0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.compute-0.xml \
@@ -273,13 +208,6 @@ PRODUCT_PACKAGES += \
android.hardware.health-service.qti \
android.hardware.health-service.qti_recovery
# HIDL
PRODUCT_PACKAGES += \
android.hidl.allocator@1.0.vendor \
android.hidl.memory.block@1.0.vendor \
libhidltransport.vendor \
libhwbinder.vendor
# Hotword Enrollement
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/permissions/privapp-permissions-hotword.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/privapp-permissions-hotword.xml
@@ -300,14 +228,9 @@ PRODUCT_COPY_FILES += \
# JSON
PRODUCT_PACKAGES += \
libjson \
libjsoncpp.vendor
libjson
# Keymaster
PRODUCT_PACKAGES += \
android.hardware.keymaster@4.1.vendor \
libkeymaster_messages.vendor
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.keystore.app_attest_key.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.keystore.app_attest_key.xml
@@ -317,13 +240,9 @@ PRODUCT_PACKAGES += \
# Media
PRODUCT_PACKAGES += \
android.hardware.media.c2@1.2.vendor \
libcodec2_hidl@1.2.vendor \
libcodec2_hidl@1.0.vendor \
libcodec2_soft_common.vendor \
libsfplugin_ccodec_utils.vendor \
libcodec2_hidl_shim.vendor \
libavservices_minijail.vendor
libstagefrighthw.vendor \
libstagefright_softomx.vendor \
libstagefright_softomx_plugin.vendor
PRODUCT_PACKAGES += \
init.qti.media.rc \
@@ -340,25 +259,13 @@ PRODUCT_COPY_FILES += \
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/audio/media_codecs_dolby_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_dolby_audio.xml
# Misc
PRODUCT_PACKAGES += \
libcurl.vendor \
libsqlite.vendor \
liblz4.vendor
# Network
PRODUCT_PACKAGES += \
android.system.net.netd@1.1.vendor
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.software.ipsec_tunnels.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.ipsec_tunnels.xml
# NFC
PRODUCT_PACKAGES += \
android.hardware.nfc@1.2.vendor \
libchrome.vendor \
NfcNci \
Tag \
SecureElement \
com.android.nfc_extras
@@ -394,6 +301,7 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \
FrameworksResMondrian \
SettingsProviderResMondrian \
SettingsProviderResMondrianCN \
SettingsResMondrian \
SystemUIResMondrian \
WifiResMondrian
@@ -405,10 +313,6 @@ DEVICE_PACKAGE_OVERLAYS += \
PRODUCT_BUILD_SUPER_PARTITION := false
PRODUCT_USE_DYNAMIC_PARTITIONS := true
# Perf
PRODUCT_PACKAGES += \
vendor.qti.hardware.perf@2.3.vendor
# Power
PRODUCT_PACKAGES += \
android.hardware.power-service-qti
@@ -416,9 +320,8 @@ PRODUCT_PACKAGES += \
PRODUCT_COPY_FILES += \
vendor/qcom/opensource/power/config/taro/powerhint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint.xml
# PowerShare
PRODUCT_PACKAGES += \
vendor.lineage.powershare@1.0-service.xiaomi_mondrian
# Powershare
$(call soong_config_set,lineage_powershare,powershare_path,/sys/class/qcom-battery/reverse_chg_mode)
# Protobuf
PRODUCT_PACKAGES += \
@@ -430,9 +333,7 @@ PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/permissions/privapp-permissions-qti.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/privapp-permissions-qti.xml \
PRODUCT_PACKAGES += \
libqti_vndfwk_detect.vendor \
libvndfwk_detect_jni.qti_vendor \
vendor.qti.hardware.systemhelper@1.0.vendor
libvndfwk_detect_jni.qti_vendor
# Recovery
PRODUCT_PACKAGES += \
@@ -445,15 +346,7 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \
android.hardware.renderscript@1.0-impl
# RIL
PRODUCT_PACKAGES += \
android.hardware.radio.config@1.3.vendor \
android.hardware.radio.deprecated@1.0.vendor \
# Secure element
PRODUCT_PACKAGES += \
android.hardware.secure_element@1.2.vendor
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.se.omapi.ese.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.se.omapi.ese.xml \
frameworks/native/data/etc/android.hardware.se.omapi.uicc.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.se.omapi.uicc.xml
@@ -463,7 +356,6 @@ PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/sensors/hals.conf:$(TARGET_COPY_OUT_VENDOR)/etc/sensors/hals.conf
PRODUCT_PACKAGES += \
android.frameworks.sensorservice@1.0.vendor \
android.hardware.sensors@2.1-service.xiaomi-multihal \
libsensorndkbridge \
sensors.xiaomi
@@ -488,10 +380,6 @@ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/sku_taro/android.hardware.sensor.stepcounter.xml \
frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/sku_taro/android.hardware.sensor.stepdetector.xml
# Servicetracker
PRODUCT_PACKAGES += \
vendor.qti.hardware.servicetracker@1.2.vendor
# Soong
PRODUCT_SOONG_NAMESPACES += \
$(LOCAL_PATH) \
@@ -526,9 +414,7 @@ PRODUCT_COPY_FILES += \
# Thermal
PRODUCT_PACKAGES += \
android.hardware.thermal@2.0 \
android.hardware.thermal@2.0-service.qti-v2 \
android.hardware.thermal@2.0.vendor
android.hardware.thermal@2.0-service.qti-v2
# Touch
PRODUCT_PACKAGES += \
@@ -549,8 +435,15 @@ PRODUCT_PACKAGES_DEBUG += \
# USB
PRODUCT_PACKAGES += \
android.hardware.usb@1.3-service-qti \
libusbhost.vendor
android.hardware.usb-service.qti \
android.hardware.usb.gadget-service.qti
PRODUCT_PACKAGES += \
init.qcom.usb.rc \
init.qcom.usb.sh \
usb_compositions.conf
PRODUCT_SOONG_NAMESPACES += vendor/qcom/opensource/usb/etc
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml \
@@ -570,6 +463,7 @@ PRODUCT_PACKAGES += \
init.target.rc \
init.qti.display_boot.mondrian.rc \
init.touch_report.rc \
init.sm8475.rc \
ueventd-odm.rc \
ueventd.qcom.rc
@@ -591,31 +485,22 @@ PRODUCT_PACKAGES += \
PRODUCT_COPY_FILES += \
vendor/qcom/opensource/vibrator/excluded-input-devices.xml:$(TARGET_COPY_OUT_VENDOR)/etc/excluded-input-devices.xml
# Vndk
PRODUCT_COPY_FILES += \
prebuilts/vndk/v33/arm/arch-arm-armv7-a-neon/shared/vndk-sp/libutils.so:$(TARGET_COPY_OUT_VENDOR)/lib/libutils-v33.so \
prebuilts/vndk/v33/arm64/arch-arm64-armv8-a/shared/vndk-sp/libutils.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libutils-v33.so \
prebuilts/vndk/v33/arm/arch-arm-armv7-a-neon/shared/vndk-core/libstagefright_foundation.so:$(TARGET_COPY_OUT_VENDOR)/lib/libstagefright_foundation-v33.so \
prebuilts/vndk/v33/arm64/arch-arm64-armv8-a/shared/vndk-core/libstagefright_foundation.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libstagefright_foundation-v33.so
# WiFi
PRODUCT_PACKAGES += \
android.hardware.wifi@1.6.vendor \
android.hardware.wifi@1.0-service \
android.hardware.wifi.hostapd@1.0.vendor \
android.hardware.wifi-service \
hostapd \
hostapd_cli \
libwifi-hal-qcom \
libwpa_client \
wpa_cli \
wpa_supplicant \
wpa_supplicant.conf \
libwifi-system-iface.vendor
wpa_supplicant.conf
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/wifi/p2p_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/p2p_supplicant_overlay.conf \
$(LOCAL_PATH)/configs/wifi/vendor_cmd.xml:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/vendor_cmd.xml \
$(LOCAL_PATH)/configs/wifi/WCNSS_qcom_cfg_qca6490.ini:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/qca6490/WCNSS_qcom_cfg.ini \
$(LOCAL_PATH)/configs/wifi/WCNSS_qcom_cfg_qca6750.ini:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/qca6750/WCNSS_qcom_cfg.ini \
$(LOCAL_PATH)/configs/wifi/wpa_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/wpa_supplicant_overlay.conf
PRODUCT_COPY_FILES += \
@@ -625,28 +510,11 @@ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.wifi.rtt.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.rtt.xml \
frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml
TARGET_WLAN_CHIP := qca6490 qca6750
WLAN_CHIPSET := qca_cld3
# Force chip-specific DLKM name
TARGET_MULTI_WLAN := true
#WPA
WPA := wpa_cli
# Package chip specific ko files if TARGET_WLAN_CHIP is defined.
ifneq ($(TARGET_WLAN_CHIP),)
PRODUCT_PACKAGES += $(foreach chip, $(TARGET_WLAN_CHIP), $(WLAN_CHIPSET)_$(chip).ko)
else
PRODUCT_PACKAGES += $(WLAN_CHIPSET)_wlan.ko
endif
# WiFi Display
PRODUCT_PACKAGES += \
libnl \
libwfdaac_vendor
PRODUCT_BOOT_JARS += \
WfdCommon
# XiaomiParts
PRODUCT_PACKAGES += \
XiaomiDolby \
XiaomiParts

View File

@@ -3,13 +3,13 @@
"remote" : "github",
"repository" : "Evolution-X-Devices/device_xiaomi_mondrian",
"target_path" : "device/xiaomi/mondrian",
"branch" : "udc"
"branch" : "vic"
},
{
"remote" : "github",
"repository" : "Evolution-X-Devices/device_xiaomi_mondrian-kernel",
"target_path" : "device/xiaomi/mondrian-kernel",
"branch" : "udc"
"branch" : "vic"
},
{
"remote" : "github",
@@ -21,7 +21,7 @@
"remote" : "github",
"repository" : "Evolution-X-Devices/vendor_xiaomi_mondrian",
"target_path" : "vendor/xiaomi/mondrian",
"branch" : "udc"
"branch" : "vic"
},
{
"remote" : "github",
@@ -39,6 +39,6 @@
"remote" : "github",
"repository" : "flakeforever/hardware_xiaomi",
"target_path" : "hardware/xiaomi",
"branch" : "udc"
"branch" : "vic"
}
]

222
extract-files.py Executable file
View File

@@ -0,0 +1,222 @@
#!/usr/bin/env -S PYTHONPATH=../../../tools/extract-utils python3
#
# SPDX-FileCopyrightText: 2024 The LineageOS Project
# SPDX-License-Identifier: Apache-2.0
#
import extract_utils.tools
extract_utils.tools.DEFAULT_PATCHELF_VERSION = '0_18'
from extract_utils.fixups_blob import (
blob_fixup,
blob_fixups_user_type,
)
from extract_utils.fixups_lib import (
lib_fixup_remove,
lib_fixups,
lib_fixups_user_type,
)
from extract_utils.main import (
ExtractUtils,
ExtractUtilsModule,
)
namespace_imports = [
'device/xiaomi/mondrian',
'hardware/qcom-caf/sm8450',
'hardware/qcom-caf/wlan',
'hardware/xiaomi',
'vendor/qcom/opensource/commonsys/display',
'vendor/qcom/opensource/commonsys-intf/display',
'vendor/qcom/opensource/dataservices',
]
def lib_fixup_vendor_suffix(lib: str, partition: str, *args, **kwargs):
return f'{lib}_{partition}' if partition == 'vendor' else None
lib_fixups: lib_fixups_user_type = {
**lib_fixups,
(
# agm
'libagm',
'libagm_compress_plugin',
'libagm_mixer_plugin',
'libagm_pcm_plugin',
'libagmclient',
'libagmmixer',
'libmisight',
'libsndcardparser',
'vendor.qti.hardware.AGMIPC@1.0-impl',
'vendor.qti.hardware.AGMIPC@1.0',
# dpm
'com.qualcomm.qti.dpm.api@1.0',
# graphservices
'libar-acdb',
'libar-gpr',
'libar-gsl',
'libar-pal',
'libats',
'liblx-ar_util',
'liblx-osal',
# omx
'libplatformconfig',
# pal
'libpalclient',
'vendor.qti.hardware.pal@1.0-impl',
'vendor.qti.hardware.pal@1.0',
# psi
'libpsi',
# primary-hal
'audio.primary.taro',
'libfmpal',
'libmcs',
'libqtigefar',
# qcc
'vendor.qti.diaghal@1.0',
'vendor.qti.hardware.dpmservice@1.0',
'vendor.qti.hardware.dpmservice@1.1',
'vendor.qti.hardware.qccsyshal@1.0',
'vendor.qti.hardware.qccsyshal@1.1',
'vendor.qti.hardware.qccvndhal@1.0',
'vendor.qti.hardware.wifidisplaysession@1.0',
'vendor.qti.imsrtpservice@3.0',
# xiaomi
'vendor.xiaomi.hardware.displayfeature@1.0',
'vendor.xiaomi.hardware.fx.tunnel@1.0',
'vendor.xiaomi.hardware.mlipay@1.0',
'vendor.xiaomi.hardware.mlipay@1.1',
'vendor.xiaomi.hardware.mtdservice@1.0',
'vendor.xiaomi.hardware.mtdservice@1.1',
'vendor.xiaomi.hardware.mtdservice@1.2',
): lib_fixup_vendor_suffix,
(
'libvibrator',
'libwpa_client',
): lib_fixup_remove,
}
blob_fixups: blob_fixups_user_type = {
'vendor/lib64/libcamximageformatutils.so': blob_fixup()
.replace_needed(
'vendor.qti.hardware.display.config-V2-ndk_platform.so',
'vendor.qti.hardware.display.config-V2-ndk.so',
),
(
'vendor/lib64/libTrueSight.so',
'vendor/lib64/libalAILDC.so',
'vendor/lib64/libalLDC.so',
'vendor/lib64/libalhLDC.so',
): blob_fixup()
.clear_symbol_version('AHardwareBuffer_allocate')
.clear_symbol_version('AHardwareBuffer_describe')
.clear_symbol_version('AHardwareBuffer_lock')
.clear_symbol_version('AHardwareBuffer_lockPlanes')
.clear_symbol_version('AHardwareBuffer_release')
.clear_symbol_version('AHardwareBuffer_unlock'),
'system_ext/lib64/libwfdmmsrc_system.so': blob_fixup()
.add_needed('libgui_shim.so'),
'system_ext/lib64/libwfdnative.so': blob_fixup()
.add_needed('libbinder_shim.so')
.add_needed('libinput_shim.so'),
(
'system_ext/lib/libwfdservice.so',
'system_ext/lib64/libwfdservice.so',
): blob_fixup()
.replace_needed(
'android.media.audio.common.types-V2-cpp.so',
'android.media.audio.common.types-V4-cpp.so',
),
(
'vendor/lib/libcamxcommonutils.so',
'vendor/lib64/libcamxcommonutils.so',
'vendor/lib64/hw/com.qti.chi.override.so',
'vendor/lib64/libmialgoengine.so',
): blob_fixup()
.add_needed('libprocessgroup_shim.so'),
(
'vendor/lib/nfc_nci.nqx.default.hw.v1.so',
'vendor/lib64/nfc_nci.nqx.default.hw.v1.so',
): blob_fixup()
.add_needed('libbase_shim.so'),
(
'vendor/lib/libsdmcore.so',
'vendor/lib64/libsdmcore.so',
): blob_fixup()
.replace_needed(
'libutils.so',
'libutils-v33.so',
),
(
'vendor/lib/soundfx/libmisoundfx.so',
'vendor/lib64/soundfx/libmisoundfx.so',
'vendor/lib/hw/displayfeature.default.so',
'vendor/lib64/hw/displayfeature.default.so',
): blob_fixup()
.replace_needed(
'libstagefright_foundation.so',
'libstagefright_foundation-v33.so',
),
(
'vendor/bin/hw/dolbycodec2',
'vendor/bin/hw/vendor.dolby.hardware.dms@2.0-service',
): blob_fixup()
.add_needed('libstagefright_foundation-v33.so'),
(
'vendor/lib/c2.dolby.client.so',
'vendor/lib64/c2.dolby.client.so',
): blob_fixup()
.add_needed('libcodec2_hidl_shim.so'),
'vendor/lib/libstagefright_softomx.so': blob_fixup()
.add_needed('libui_shim.so'),
(
'vendor/lib/vendor.libdpmframework.so',
'vendor/lib64/vendor.libdpmframework.so',
): blob_fixup()
.add_needed('libhidlbase_shim.so'),
(
'vendor/bin/hw/android.hardware.security.keymint-service-qti',
'vendor/lib64/libqtikeymint.so',
): blob_fixup()
.replace_needed(
'android.hardware.security.keymint-V1-ndk_platform.so',
'android.hardware.security.keymint-V1-ndk.so',
)
.replace_needed(
'android.hardware.security.secureclock-V1-ndk_platform.so',
'android.hardware.security.secureclock-V1-ndk.so',
)
.replace_needed(
'android.hardware.security.sharedsecret-V1-ndk_platform.so',
'android.hardware.security.sharedsecret-V1-ndk.so',
)
.add_needed('android.hardware.security.rkp-V1-ndk.so'),
'vendor/bin/qcc-trd': blob_fixup()
.replace_needed(
'libgrpc++_unsecure.so',
'libgrpc++_unsecure_prebuilt.so'
),
'vendor/etc/init/init.embmssl_server.rc': blob_fixup()
.regex_replace('.+interface.+\n', ''),
'vendor/etc/qcril_database/upgrade/config/6.0_config.sql': blob_fixup()
.regex_replace('"persist.vendor.radio.redir_party_num", "true"', '"persist.vendor.radio.redir_party_num", "false"'),
(
'vendor/etc/camera/mondrian_enhance_motiontuning.xml',
'vendor/etc/camera/mondrian_motiontuning.xml',
): blob_fixup().regex_replace('xml=version', 'xml version'),
'vendor/etc/camera/pureView_parameter.xml': blob_fixup()
.regex_replace(r'=([0-9]+)>', r'="\1">'),
} # fmt: skip
module = ExtractUtilsModule(
'mondrian',
'xiaomi',
blob_fixups=blob_fixups,
lib_fixups=lib_fixups,
namespace_imports=namespace_imports,
check_elf=True,
)
if __name__ == '__main__':
utils = ExtractUtils.device(module)
utils.run()

View File

@@ -1,108 +0,0 @@
#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2020 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
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
ANDROID_ROOT="${MY_DIR}/../../.."
HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
if [ ! -f "${HELPER}" ]; then
echo "Unable to find helper script at ${HELPER}"
exit 1
fi
source "${HELPER}"
# Default to sanitizing the vendor folder before extraction
CLEAN_VENDOR=true
KANG=
SECTION=
while [ "${#}" -gt 0 ]; do
case "${1}" in
-n | --no-cleanup)
CLEAN_VENDOR=false
;;
-k | --kang)
KANG="--kang"
;;
-s | --section)
SECTION="${2}"
shift
CLEAN_VENDOR=false
;;
*)
SRC="${1}"
;;
esac
shift
done
if [ -z "${SRC}" ]; then
SRC="adb"
fi
function blob_fixup() {
case "${1}" in
vendor/etc/init/init.embmssl_server.rc)
sed -i -n '/interface/!p' "${2}"
;;
vendor/lib64/libsdmcore.so)
"${PATCHELF}" --replace-needed "libutils.so" "libutils-v33.so" "${2}"
;;
vendor/lib/libsdmcore.so)
"${PATCHELF}" --replace-needed "libutils.so" "libutils-v33.so" "${2}"
;;
vendor/lib64/soundfx/libmisoundfx.so)
"${PATCHELF}" --replace-needed "libstagefright_foundation.so" "libstagefright_foundation-v33.so" "${2}"
;;
vendor/lib/soundfx/libmisoundfx.so)
"${PATCHELF}" --replace-needed "libstagefright_foundation.so" "libstagefright_foundation-v33.so" "${2}"
;;
vendor/lib64/hw/displayfeature.default.so)
"${PATCHELF}" --replace-needed "libstagefright_foundation.so" "libstagefright_foundation-v33.so" "${2}"
;;
vendor/lib/hw/displayfeature.default.so)
"${PATCHELF}" --replace-needed "libstagefright_foundation.so" "libstagefright_foundation-v33.so" "${2}"
;;
vendor/bin/hw/android.hardware.security.keymint-service-qti | vendor/lib64/libqtikeymint.so)
"${PATCHELF}" --add-needed "android.hardware.security.rkp-V1-ndk.so" "${2}"
;;
vendor/lib/c2.dolby.client.so)
"${PATCHELF}" --add-needed "libcodec2_hidl_shim.so" "${2}"
;;
vendor/bin/hw/dolbycodec2 | vendor/bin/hw/vendor.dolby.hardware.dms@2.0-service | vendor/bin/hw/vendor.qti.media.c2@1.0-service)
"${PATCHELF}" --add-needed "libstagefright_foundation-v33.so" "${2}"
;;
vendor/etc/qcril_database/upgrade/config/6.0_config.sql)
[ "$2" = "" ] && return 0
sed -i '/persist.vendor.radio.redir_party_num/ s/true/false/g' "${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
}
# Initialize the helper
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" true "${CLEAN_VENDOR}"
extract "${MY_DIR}/proprietary-files.txt" "${SRC}" \
"${KANG}" --section "${SECTION}"
"${MY_DIR}/setup-makefiles.sh"

View File

@@ -12,6 +12,7 @@
#define FINGERPRINT_GL "Redmi/mondrian/mondrian:13/SKQ1.220303.001/V14.0.26.0.TMNCNXM:user/release-keys"
#define FINGERPRINT_CN "Redmi/mondrian/mondrian:13/SKQ1.220303.001/V14.0.26.0.TMNCNXM:user/release-keys"
#define FINGERPRINT_IN "Redmi/mondrian/mondrian:13/SKQ1.220303.001/V14.0.26.0.TMNCNXM:user/release-keys"
static const variant_info_t mondrian_global_info = {
.hwc_value = "GL",
@@ -25,7 +26,7 @@ static const variant_info_t mondrian_global_info = {
.build_fingerprint = FINGERPRINT_GL,
};
static const variant_info_t mondrian_info = {
static const variant_info_t mondrian_cn_info = {
.hwc_value = "CN",
.sku_value = "",
@@ -37,9 +38,22 @@ static const variant_info_t mondrian_info = {
.build_fingerprint = FINGERPRINT_CN,
};
static const variant_info_t mondrian_in_info = {
.hwc_value = "IN",
.sku_value = "",
.brand = "Xiaomi",
.device = "mondrian",
.marketname = "Redmi K60",
.model = "23013RK75I",
.mod_device = "mondrian",
.build_fingerprint = FINGERPRINT_IN,
};
static const std::vector<variant_info_t> variants = {
mondrian_global_info,
mondrian_info,
mondrian_cn_info,
mondrian_in_info,
};
void vendor_load_properties() {

109
liblhdc/Android.bp Normal file
View File

@@ -0,0 +1,109 @@
cc_prebuilt_library_shared {
name: "liblhdc",
arch: {
arm: {
srcs: ["libs/armeabi-v7a/liblhdc.so",],
},
arm64: {
srcs: ["libs/arm64-v8a/liblhdc.so",],
},
},
apex_available: [
"//apex_available:platform",
"com.android.btservices",
],
strip: {
none:true,
},
shared_libs: [
"liblog",
"libstdc++",
],
}
cc_prebuilt_library_shared {
name: "liblhdcv5",
arch: {
arm: {
srcs: ["libs/armeabi-v7a/liblhdcv5.so",],
},
arm64: {
srcs: ["libs/arm64-v8a/liblhdcv5.so",],
},
},
apex_available: [
"//apex_available:platform",
"com.android.btservices",
],
strip: {
none:true,
},
shared_libs: [
"liblog",
"libstdc++",
],
}
cc_prebuilt_library_shared {
name: "liblhdcBT_enc",
// vendor_available: true,
// vndk: {
// enabled: true,
// },
arch: {
arm: {
srcs: ["libs/armeabi-v7a/liblhdcBT_enc.so",],
},
arm64: {
srcs: ["libs/arm64-v8a/liblhdcBT_enc.so",],
},
},
shared_libs: [
"libcutils",
"liblog",
"liblhdc",
],
apex_available: [
"//apex_available:platform",
"com.android.btservices",
],
}
cc_prebuilt_library_shared {
name: "liblhdcv5BT_enc",
// vendor_available: true,
// vndk: {
// enabled: true,
// },
arch: {
arm: {
srcs: ["libs/armeabi-v7a/liblhdcv5BT_enc.so",],
},
arm64: {
srcs: ["libs/arm64-v8a/liblhdcv5BT_enc.so",],
},
},
shared_libs: [
"libcutils",
"liblog",
"liblhdcv5",
],
apex_available: [
"//apex_available:platform",
"com.android.btservices",
],
}

BIN
liblhdc/libs/arm64-v8a/liblhdc.so Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,5 +1,5 @@
#
# Copyright (C) 2022-2023 The LineageOS Project
# Copyright (C) 2024 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
@@ -18,16 +18,14 @@ PRODUCT_MANUFACTURER := Xiaomi
PRODUCT_SYSTEM_NAME := mondrian_global
PRODUCT_SYSTEM_DEVICE := mondrian
PRODUCT_BUILD_PROP_OVERRIDES += \
PRIVATE_BUILD_DESC="mondrian_global-user 12 SKQ1.230401.001 V816.0.10.0.UMNMIXM release-keys" \
TARGET_DEVICE=$(PRODUCT_SYSTEM_DEVICE) \
TARGET_PRODUCT=$(PRODUCT_SYSTEM_NAME)
BUILD_FINGERPRINT := POCO/mondrian_global/mondrian:12/SKQ1.230401.001/V816.0.10.0.UMNMIXM:user/release-keys
PRODUCT_GMS_CLIENTID_BASE := android-xiaomi
PRODUCT_BUILD_PROP_OVERRIDES += \
BuildDesc="mondrian_global-user 12 SKQ1.230401.001 OS2.0.9.0.VMNMIXM release-keys" \
BuildFingerprint=POCO/mondrian_global/mondrian:12/SKQ1.230401.001/OS2.0.9.0.VMNMIXM:user/release-keys \
DeviceProduct=$(PRODUCT_DEVICE)
TARGET_BOOT_ANIMATION_RES := 1440
# Evolution-XYZ
WITH_GMS := true
TARGET_HAS_UDFPS := true

View File

@@ -34,7 +34,7 @@
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#===============================================================================
build_codename=`getprop vendor.media.system.build_codename`
build_codename=`getprop ro.vendor.build.version.release_or_codename`
if [ -f /sys/devices/soc0/soc_id ]; then
soc_hwid=`cat /sys/devices/soc0/soc_id` 2> /dev/null
@@ -93,25 +93,25 @@ case "$target" in
setprop vendor.media.target_variant "_diwali_v1"
fi
if [ $build_codename -le "14" ]; then
if [ $build_codename -le "15" ]; then
setprop vendor.netflix.bsp_rev "Q7450-35705-1"
fi
;;
591)
setprop vendor.media.target_variant "_ukee"
if [ $build_codename -le "14" ]; then
if [ $build_codename -le "15" ]; then
setprop vendor.netflix.bsp_rev "Q8450-34634-1"
fi
;;
530|531|540)
setprop vendor.media.target_variant "_cape"
if [ $build_codename -le "14" ]; then
if [ $build_codename -le "15" ]; then
setprop vendor.netflix.bsp_rev "Q8450-34634-1"
fi
;;
*)
setprop vendor.media.target_variant "_taro"
if [ $build_codename -le "14" ]; then
if [ $build_codename -le "15" ]; then
setprop vendor.netflix.bsp_rev "Q8450-34634-1"
fi
;;

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2019-2024 The Evolution X Project
SPDX-License-Identifier: Apache-2.0
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- PowerOffAlarmService -->
<bool name="config_powerOffAlarmEnabled">true</bool>
</resources>

View File

@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2024 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- The stable device width and height in pixels. If these aren't set to a positive number
then the device will use the width and height of the default display the first time it's
booted. -->
<integer name="config_stableDeviceDisplayWidth">1080</integer>
<integer name="config_stableDeviceDisplayHeight">2400</integer>
</resources>

View File

@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2023 The LineageOS Project
Copyright (C) 2024 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) 2023 The LineageOS Project
//
// SPDX-License-Identifier: Apache-2.0
//
runtime_resource_overlay {
name: "SettingsProviderResMondrianCN",
device_specific: true
}

View File

@@ -0,0 +1,12 @@
<!--
Copyright (C) 2024 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.mondriancn">
<overlay android:targetPackage="com.android.providers.settings"
android:isStatic="true"
android:priority="750"
android:requiredSystemPropertyName="ro.boot.hwc"
android:requiredSystemPropertyValue="CN"/>
</manifest>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2024 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">Redmi K60</string>
</resources>

View File

@@ -18,4 +18,10 @@
<!-- Whether to show custom screen resolution settings -->
<bool name="config_show_custom_screen_resolution_switch">true</bool>
<!-- Whether to show volume steps settings -->
<bool name="config_supports_volume_steps" translatable="false">true</bool>
<!-- Battery Info: mAh -->
<integer name="config_battery_divider" translatable="false">1</integer>
</resources>

View File

@@ -6,4 +6,7 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Preferred max refresh rate at AOD & Ambient Display, if supported by the display. -->
<integer name="config_aodMaxRefreshRate">60</integer>
<!-- The CPU temperature divider, if needed -->
<integer name="config_cpuTempDivider">1000</integer>
</resources>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2023 The LineageOS Project
Copyright (C) 2024 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
@@ -16,4 +16,8 @@
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>
<!-- Microns/ums (1000 um = 1mm) per pixel for the given device. If unspecified, UI that
relies on this value will not be sized correctly. -->
<item format="float" name="pixel_pitch" type="dimen">48.28</item>
</resources>

View File

@@ -76,42 +76,29 @@
android:value="1" />
</activity>
<activity
android:name=".feas.FEASActivity"
android:label="@string/feas_title"
android:exported="true" >
<intent-filter>
<action android:name="com.android.settings.action.IA_SETTINGS" />
</intent-filter>
<meta-data
android:name="com.android.settings.category"
android:value="com.android.settings.category.ia.battery" />
<meta-data
android:name="com.android.settings.summary"
android:resource="@string/feas_summary" />
<meta-data
android:name="com.android.settings.order"
android:value="2" />
</activity>
<provider
android:name=".SummaryProvider"
android:authorities="org.lineageos.settings.device.summary">
</provider>
<activity
android:name=".dolby.DolbyActivity"
android:exported="true"
android:label="@string/dolby_title"
android:theme="@style/Theme.SubSettingsBase">
<intent-filter>
<action android:name="com.android.settings.action.IA_SETTINGS" />
<action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES"/>
</intent-filter>
<intent-filter>
<action android:name="android.media.action.DISPLAY_AUDIO_EFFECT_CONTROL_PANEL" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.CATEGORY_CONTENT_MUSIC" />
</intent-filter>
<meta-data android:name="com.android.settings.category"
android:value="com.android.settings.category.ia.sound" />
<meta-data android:name="com.android.settings.summary_uri"
android:value="content://org.lineageos.settings.device.summary/dolby" />
</activity>
<service
android:name=".dolby.DolbyTileService"
android:exported="true"
android:icon="@drawable/ic_dolby_qs"
android:label="@string/dolby_title"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE"/>
</intent-filter>
</service>
<service
android:name=".doze.DozeService"
android:exported="true"

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:width="24dp" android:viewportWidth="24" android:viewportHeight="24" android:tint="?android:attr/colorControlNormal">
<path android:fillColor="#000000" android:pathData="M1,4.0214C2.2767,4.0743 3.5798,3.9866 4.8252,4.2063C8.8352,4.9133 11.4129,8.3489 11.0507,12.3402C10.7124,16.0695 7.3661,18.9511 3.3484,18.9651C2.5657,18.9678 1.7827,18.9441 1,18.9324L1,4.0214Z" android:strokeColor="#00000000" android:strokeWidth="1" android:fillType="evenOdd"/>
<group>
<clip-path android:pathData="M12.9332,4l10.0668,0l0,15l-10.0668,0z"/>
<path android:fillColor="#000000" android:pathData="M23,4.0924L23,18.8825C19.4973,19.298 16.399,18.6968 14.3366,15.6947C12.5148,13.043 12.4594,10.2265 14.2129,7.5241C16.244,4.394 19.3953,3.7204 23,4.0924" android:strokeColor="#00000000" android:strokeWidth="1" android:fillType="evenOdd"/>
</group>
</vector>

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:width="24dp" android:viewportWidth="24" android:viewportHeight="24">
<path android:fillColor="#191c1e" android:pathData="M1,4.0214C2.2767,4.0743 3.5798,3.9866 4.8252,4.2063C8.8352,4.9133 11.4129,8.3489 11.0507,12.3402C10.7124,16.0695 7.3661,18.9511 3.3484,18.9651C2.5657,18.9678 1.7827,18.9441 1,18.9324L1,4.0214Z" android:strokeColor="#00000000" android:strokeWidth="1" android:fillType="evenOdd"/>
<group>
<clip-path android:pathData="M12.9332,4l10.0668,0l0,15l-10.0668,0z"/>
<path android:fillColor="#191c1e" android:pathData="M23,4.0924L23,18.8825C19.4973,19.298 16.399,18.6968 14.3366,15.6947C12.5148,13.043 12.4594,10.2265 14.2129,7.5241C16.244,4.394 19.3953,3.7204 23,4.0924" android:strokeColor="#00000000" android:strokeWidth="1" android:fillType="evenOdd"/>
</group>
</vector>

View File

@@ -101,14 +101,4 @@
<string name="refresh_title">刷新率设置</string>
<string name="refresh_summary">设置特定应用的最大刷新率</string>
<string name="refresh_default">默认</string>
<!-- Dolby Atmos -->
<string name="dolby_title">杜比全景声</string>
<string name="dolby_enable">启用杜比全景声</string>
<string name="dolby_summary">环绕音</string>
<string name="dolby_profile_title">选择配置</string>
<string name="dolby_profile_dynamic">动态</string>
<string name="dolby_off">关闭</string>
<string name="dolby_on">开启</string>
<string name="dolby_on_with_profile">使用 (%1$s)</string>
</resources>

View File

@@ -12,77 +12,6 @@
limitations under the License.
-->
<resources>
<!-- Dolby Atmos -->
<string-array name="dolby_profile_entries">
<item>@string/dolby_profile_dynamic</item>
<item>@string/dolby_profile_video</item>
<item>@string/dolby_profile_music</item>
<item>@string/dolby_profile_vocal</item>
</string-array>
<string-array name="dolby_profile_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>8</item>
</string-array>
<string-array name="dolby_preset_entries" translatable="false">
<item>@string/dolby_preset_default</item>
<item>@string/dolby_preset_rock</item>
<item>@string/dolby_preset_jazz</item>
<item>@string/dolby_preset_pop</item>
<item>@string/dolby_preset_classical</item>
<item>@string/dolby_preset_hiphop</item>
<item>@string/dolby_preset_blues</item>
<item>@string/dolby_preset_electronic</item>
<item>@string/dolby_preset_metal</item>
</string-array>
<string-array name="dolby_preset_values">
<item>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</item>
<item>60,36,12,-12,-36,-24,-12,-8,-4,-20,-36,-20,-4,-20,-36,-16,4,32,60,60</item>
<item>8,8,8,8,8,0,-8,-8,-8,-24,-40,-20,0,4,8,8,8,8,8,8</item>
<item>-13,-1,11,-25,-61,-29,3,11,19,19,19,15,11,-9,-29,-9,11,15,19,19</item>
<item>-32,-32,-32,-32,-32,-32,-32,-28,-24,-4,16,0,-16,24,64,32,0,32,64,64</item>
<item>52,28,4,-20,-44,-24,-4,-4,-4,-24,-44,-24,-4,0,4,4,4,20,36,36</item>
<item>28,28,28,-36,-100,-68,-36,4,44,28,12,4,-4,4,12,4,-4,12,28,28</item>
<item>50,34,18,2,-14,-6,2,-2,-6,-26,-46,-26,-6,-2,2,2,2,2,2,2</item>
<item>40,24,8,8,8,-4,-16,-12,-8,-32,-56,-24,8,8,8,8,8,8,8,8</item>
</string-array>
<string-array name="dolby_dialogue_entries">
<item>@string/dolby_off</item>
<item>@string/dolby_low</item>
<item>@string/dolby_standard</item>
<item>@string/dolby_medium</item>
<item>@string/dolby_high</item>
<item>@string/dolby_max</item>
</string-array>
<string-array name="dolby_dialogue_values">
<item>0</item>
<item>2</item>
<item>3</item>
<item>6</item>
<item>9</item>
<item>12</item>
</string-array>
<string-array name="dolby_stereo_entries">
<item>@string/dolby_low</item>
<item>@string/dolby_medium</item>
<item>@string/dolby_high</item>
<item>@string/dolby_max</item>
</string-array>
<string-array name="dolby_stereo_values">
<item>4</item>
<item>24</item>
<item>44</item>
<item>64</item>
</string-array>
<!-- Values for Dirac headset pref -->
<string-array name="dirac_headset_pref_entries" translatable="false">
<item>@string/dirac_headset_earbuds</item>
@@ -196,4 +125,89 @@
<item>2</item>
<item>3</item>
</string-array>
<string-array name="freq_limit_level_titles">
<item>CPU4:2573 - CPU7:2822</item>
<item>CPU4:2573 - CPU7:2822</item>
<item>CPU4:2573 - CPU7:2707</item>
<item>CPU4:2573 - CPU7:2707</item>
<item>CPU4:2458 - CPU7:2592</item>
<item>CPU4:2458 - CPU7:2592</item>
<item>CPU4:2342 - CPU7:2477</item>
<item>CPU4:2342 - CPU7:2477</item>
<item>CPU4:2342 - CPU7:2477</item>
<item>CPU4:2227 - CPU7:2362</item>
<item>CPU4:2227 - CPU7:2362</item>
<item>CPU4:2112 - CPU7:2246</item>
<item>CPU4:2112 - CPU7:2246</item>
<item>CPU4:2112 - CPU7:2246</item>
<item>CPU4:1997 - CPU7:2131</item>
<item>CPU4:1997 - CPU7:2131</item>
<item>CPU4:1882 - CPU7:1997</item>
<item>CPU4:1882 - CPU7:1997</item>
<item>CPU4:1766 - CPU7:1997</item>
<item>CPU4:1766 - CPU7:1882</item>
<item>CPU4:1651 - CPU7:1882</item>
<item>CPU4:1651 - CPU7:1766</item>
<item>CPU4:1555 - CPU7:1766</item>
<item>CPU4:1555 - CPU7:1651</item>
<item>CPU4:1440 - CPU7:1651</item>
<item>CPU4:1440 - CPU7:1536</item>
<item>CPU4:1325 - CPU7:1536</item>
<item>CPU4:1325 - CPU7:1402</item>
<item>CPU4:1210 - CPU7:1402</item>
<item>CPU4:1210 - CPU7:1286</item>
<item>CPU4:1114 - CPU7:1286</item>
<item>CPU4:1114 - CPU7:1171</item>
<item>CPU4:998 - CPU7:1171</item>
<item>CPU4:998 - CPU7:1037</item>
<item>CPU4:883 - CPU7:1037</item>
<item>CPU4:883 - CPU7:922</item>
<item>CPU4:768 - CPU7:922</item>
<item>CPU4:768 - CPU7:787</item>
<item>CPU4:634 - CPU7:787</item>
</string-array>
<string-array name="freq_limit_level_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
<item>10</item>
<item>11</item>
<item>12</item>
<item>13</item>
<item>14</item>
<item>15</item>
<item>16</item>
<item>17</item>
<item>18</item>
<item>19</item>
<item>20</item>
<item>21</item>
<item>22</item>
<item>23</item>
<item>24</item>
<item>25</item>
<item>26</item>
<item>27</item>
<item>28</item>
<item>29</item>
<item>30</item>
<item>31</item>
<item>32</item>
<item>33</item>
<item>34</item>
<item>35</item>
<item>36</item>
<item>37</item>
<item>38</item>
<item>39</item>
</string-array>
</resources>

View File

@@ -26,48 +26,12 @@
<string name="thermal_gaming">Gaming</string>
<string name="thermal_streaming">Streaming</string>
<!-- Dolby Atmos -->
<string name="dolby_title">Dolby Atmos</string>
<string name="dolby_enable">Use Dolby Atmos</string>
<string name="dolby_profile_title">Choose a profile</string>
<string name="dolby_off">Off</string>
<string name="dolby_on">On</string>
<string name="dolby_low">Low</string>
<string name="dolby_standard">Standard</string>
<string name="dolby_medium">Medium</string>
<string name="dolby_high">High</string>
<string name="dolby_max">Max</string>
<string name="dolby_unknown">Unknown</string>
<string name="dolby_on_with_profile">On (%1$s)</string>
<string name="dolby_summary">Surround sound</string>
<string name="dolby_preset_title">Choose a preset</string>
<string name="dolby_category_settings">Settings</string>
<string name="dolby_bass_enhancer">Bass enhancer</string>
<string name="dolby_dialogue_enhancer">Dialogue enhancer</string>
<string name="dolby_virtualizer">Surround virtualizer</string>
<string name="dolby_stereo_widening">Stereo widening</string>
<string name="dolby_volume_leveler">Volume leveler</string>
<string name="dolby_connect_headphones">Connect headphones</string>
<string name="dolby_reset_profile">Reset to defaults</string>
<string name="dolby_reset_profile_toast">Succesfully reset settings for %1$s profile</string>
<!-- Dolby Atmos: Sound Profiles -->
<string name="dolby_profile_dynamic">Dynamic</string>
<string name="dolby_preset">Equalizer preset</string>
<string name="dolby_profile_music">Music</string>
<string name="dolby_profile_video">Video</string>
<string name="dolby_profile_vocal">Voice</string>
<!-- Dolby Atmos: Equalizer presets -->
<string name="dolby_preset_default">Default</string>
<string name="dolby_preset_rock">Rock</string>
<string name="dolby_preset_jazz">Jazz</string>
<string name="dolby_preset_pop">Pop</string>
<string name="dolby_preset_classical">Classical</string>
<string name="dolby_preset_hiphop">Hip Hop</string>
<string name="dolby_preset_blues">Blues</string>
<string name="dolby_preset_electronic">Electronic</string>
<string name="dolby_preset_metal">Metal</string>
<!-- FEAS -->
<string name="feas_title">FEAS 2.2</string>
<string name="feas_enable_title">Enable FEAS</string>
<string name="feas_summary">Optimizes power consumption for each frame</string>
<string name="feas_min_freq_limit_level_title">Min freq limit level (MHz)</string>
<string name="feas_max_freq_limit_level_title">Max freq limit level (MHz)</string>
<!-- Per-app refresh rate -->
<string name="refresh_title">Per-app refresh rate</string>

View File

@@ -1,76 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 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.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/dolby_title">
<com.android.settingslib.widget.MainSwitchPreference
android:defaultValue="true"
android:key="dolby_enable"
android:title="@string/dolby_enable" />
<ListPreference
android:key="dolby_profile"
android:entries="@array/dolby_profile_entries"
android:entryValues="@array/dolby_profile_values"
android:defaultValue="0"
android:title="@string/dolby_profile_title"
android:summary="%s"
android:icon="@drawable/ic_dolby" />
<PreferenceCategory
android:title="@string/dolby_category_settings">
<ListPreference
android:key="dolby_preset"
android:entries="@array/dolby_preset_entries"
android:entryValues="@array/dolby_preset_values"
android:title="@string/dolby_preset" />
<SwitchPreference
android:key="dolby_virtualizer"
android:title="@string/dolby_virtualizer" />
<ListPreference
android:key="dolby_stereo"
android:entries="@array/dolby_stereo_entries"
android:entryValues="@array/dolby_stereo_values"
android:defaultValue="4"
android:title="@string/dolby_stereo_widening"
android:dependency="dolby_virtualizer" />
<ListPreference
android:key="dolby_dialogue"
android:entries="@array/dolby_dialogue_entries"
android:entryValues="@array/dolby_dialogue_values"
android:title="@string/dolby_dialogue_enhancer" />
<SwitchPreference
android:key="dolby_bass"
android:title="@string/dolby_bass_enhancer" />
<SwitchPreference
android:key="dolby_volume"
android:title="@string/dolby_volume_leveler" />
<Preference
android:key="dolby_reset"
android:title="@string/dolby_reset_profile" />
</PreferenceCategory>
</PreferenceScreen>

View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2024 The LineageOS Project
2024 Flakeforever
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.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/feas_title">
<com.android.settingslib.widget.MainSwitchPreference
android:defaultValue="false"
android:key="feas_enable"
android:title="@string/feas_enable_title" />
<ListPreference
android:key="min_freq_limit_level"
android:title="@string/feas_min_freq_limit_level_title"
android:entries="@array/freq_limit_level_titles"
android:entryValues="@array/freq_limit_level_values"
android:singleLine="false"
android:defaultValue="0"
android:summary="%s" />
<ListPreference
android:key="max_freq_limit_level"
android:title="@string/feas_max_freq_limit_level_title"
android:entries="@array/freq_limit_level_titles"
android:entryValues="@array/freq_limit_level_values"
android:defaultValue="0"
android:summary="%s" />
</PreferenceScreen>

View File

@@ -23,11 +23,11 @@ import android.view.Display.HdrCapabilities;
import org.lineageos.settings.display.ColorService;
import org.lineageos.settings.dirac.DiracUtils;
import org.lineageos.settings.dolby.DolbyUtils;
import org.lineageos.settings.doze.AodBrightnessService;
import org.lineageos.settings.doze.DozeUtils;
import org.lineageos.settings.doze.PocketService;
import org.lineageos.settings.display.ColorService;
import org.lineageos.settings.feas.FEASUtils;
import org.lineageos.settings.thermal.ThermalUtils;
import org.lineageos.settings.refreshrate.RefreshUtils;
@@ -47,9 +47,6 @@ public class BootCompletedReceiver extends BroadcastReceiver {
// Dirac
DiracUtils.initialize(context);
// Dolby Atmos
DolbyUtils.getInstance(context);
// Doze
DozeUtils.checkDozeService(context);
@@ -70,5 +67,9 @@ public class BootCompletedReceiver extends BroadcastReceiver {
displayManager.overrideHdrTypes(Display.DEFAULT_DISPLAY, new int[]{
HdrCapabilities.HDR_TYPE_DOLBY_VISION, HdrCapabilities.HDR_TYPE_HDR10,
HdrCapabilities.HDR_TYPE_HLG, HdrCapabilities.HDR_TYPE_HDR10_PLUS});
// FEAS
final FEASUtils mFEASUtils = new FEASUtils(context);
mFEASUtils.initialize();
}
}

View File

@@ -26,26 +26,16 @@ import android.net.Uri;
import android.os.Bundle;
import org.lineageos.settings.R;
import org.lineageos.settings.dolby.DolbyUtils;
/** Provide preference summary for injected items. */
public class SummaryProvider extends ContentProvider {
private static final String KEY_DOLBY = "dolby";
@Override
public Bundle call(String method, String uri, Bundle extras) {
final Bundle bundle = new Bundle();
String summary;
switch (method) {
case KEY_DOLBY:
summary = getDolbySummary();
break;
default:
throw new IllegalArgumentException("Unknown method: " + method);
}
bundle.putString(META_DATA_PREFERENCE_SUMMARY, summary);
return bundle;
}
@Override
@@ -78,18 +68,4 @@ public class SummaryProvider extends ContentProvider {
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
throw new UnsupportedOperationException();
}
private String getDolbySummary() {
final DolbyUtils dolbyUtils = DolbyUtils.getInstance(getContext());
final boolean dsOn = dolbyUtils.getDsOn();
if (!dsOn) {
return getContext().getString(R.string.dolby_off);
}
final String profileName = dolbyUtils.getProfileName();
if (profileName == null) {
return getContext().getString(R.string.dolby_on);
} else {
return getContext().getString(R.string.dolby_on_with_profile, profileName);
}
}
}

View File

@@ -1,160 +0,0 @@
/*
* Copyright (C) 2018 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.
*/
package org.lineageos.settings.dolby;
import android.media.audiofx.AudioEffect;
import android.util.Log;
import org.lineageos.settings.dolby.DolbyConstants.DsParam;
import java.util.UUID;
class DolbyAtmos extends AudioEffect {
private static final String TAG = "DolbyAtmos";
private static final UUID EFFECT_TYPE_DAP =
UUID.fromString("9d4921da-8225-4f29-aefa-39537a04bcaa");
private static final int
EFFECT_PARAM_CPDP_VALUES = 5,
EFFECT_PARAM_ENABLE = 0,
EFFECT_PARAM_PROFILE = 0xA000000,
EFFECT_PARAM_SET_PROFILE_PARAMETER = 0x1000000,
EFFECT_PARAM_GET_PROFILE_PARAMETER = 0x1000005,
EFFECT_PARAM_RESET_PROFILE_SETTINGS = 0xC000000;
DolbyAtmos(int priority, int audioSession) {
super(EFFECT_TYPE_NULL, EFFECT_TYPE_DAP, priority, audioSession);
}
private static int int32ToByteArray(int value, byte[] dst, int index) {
dst[index++] = (byte) (value & 0xff);
dst[index++] = (byte) ((value >>> 8) & 0xff);
dst[index++] = (byte) ((value >>> 16) & 0xff);
dst[index] = (byte) ((value >>> 24) & 0xff);
return 4;
}
private static int byteArrayToInt32(byte[] ba) {
return ((ba[3] & 0xff) << 24) | ((ba[2] & 0xff) << 16)
| ((ba[1] & 0xff) << 8) | (ba[0] & 0xff);
}
private static int int32ArrayToByteArray(int[] src, byte[] dst, int index) {
for (int x : src) {
dst[index++] = (byte) ((x >>> 0) & 0xff);
dst[index++] = (byte) ((x >>> 8) & 0xff);
dst[index++] = (byte) ((x >>> 16) & 0xff);
dst[index++] = (byte) ((x >>> 24) & 0xff);
}
return src.length << 2;
}
private static int[] byteArrayToInt32Array(byte[] ba, int dstLength) {
int srcLength = ba.length >> 2;
if (dstLength > srcLength) {
dstLength = srcLength;
}
int[] dst = new int[dstLength];
for (int i = 0; i < dstLength; i++) {
dst[i] = ((ba[i * 4 + 3] & 0xff) << 24) | ((ba[i * 4 + 2] & 0xff) << 16)
| ((ba[i * 4 + 1] & 0xff) << 8) | (ba[i * 4] & 0xff);
}
return dst;
}
private void setIntParam(int param, int value) {
byte[] buf = new byte[12];
int i = int32ToByteArray(param, buf, 0);
int32ToByteArray(value, buf, i + int32ToByteArray(1, buf, i));
checkStatus(setParameter(EFFECT_PARAM_CPDP_VALUES, buf));
}
private int getIntParam(int param) {
byte[] buf = new byte[12];
int32ToByteArray(param, buf, 0);
checkStatus(getParameter(EFFECT_PARAM_CPDP_VALUES + param, buf));
return byteArrayToInt32(buf);
}
void setDsOn(boolean on) {
setIntParam(EFFECT_PARAM_ENABLE, on ? 1 : 0);
super.setEnabled(on);
}
boolean getDsOn() {
return getIntParam(EFFECT_PARAM_ENABLE) == 1;
}
void setProfile(int index) {
setIntParam(EFFECT_PARAM_PROFILE, index);
}
int getProfile() {
return getIntParam(EFFECT_PARAM_PROFILE);
}
void resetProfileSpecificSettings() {
int profile = getProfile();
Log.d(TAG, "resetProfileSpecificSettings: profile=" + profile);
setIntParam(EFFECT_PARAM_RESET_PROFILE_SETTINGS, profile);
}
void setDapParameter(int profile, DsParam param, int values[]) {
Log.d(TAG, "setDapParameter: profile=" + profile + " param=" + param);
int length = values.length;
byte[] buf = new byte[(length + 4) * 4];
int i = int32ToByteArray(EFFECT_PARAM_SET_PROFILE_PARAMETER, buf, 0);
int i2 = i + int32ToByteArray(length + 1, buf, i);
int i3 = i2 + int32ToByteArray(profile, buf, i2);
int32ArrayToByteArray(values, buf, i3 + int32ToByteArray(param.id, buf, i3));
checkStatus(setParameter(EFFECT_PARAM_CPDP_VALUES, buf));
}
void setDapParameter(DsParam param, int values[]) {
setDapParameter(getProfile(), param, values);
}
void setDapParameterBool(DsParam param, boolean enable) {
setDapParameter(param, new int[]{enable ? 1 : 0});
}
void setDapParameterInt(DsParam param, int value) {
setDapParameter(param, new int[]{value});
}
int[] getDapParameter(int profile, DsParam param) {
Log.d(TAG, "getDapParameter: profile=" + profile + " param=" + param);
int length = param.length;
byte[] buf = new byte[(length + 2) * 4];
int i = (param.id << 16) + EFFECT_PARAM_GET_PROFILE_PARAMETER;
checkStatus(getParameter(i + (profile << 8), buf));
return byteArrayToInt32Array(buf, length);
}
int[] getDapParameter(DsParam param) {
return getDapParameter(getProfile(), param);
}
boolean getDapParameterBool(DsParam param) {
return getDapParameter(param)[0] == 1;
}
int getDapParameterInt(DsParam param) {
return getDapParameter(param)[0];
}
}

View File

@@ -1,48 +0,0 @@
/*
* Copyright (C) 2023 Paranoid Android
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.lineageos.settings.dolby;
class DolbyConstants {
enum DsParam {
HEADPHONE_VIRTUALIZER(101),
SPEAKER_VIRTUALIZER(102),
VOLUME_LEVELER_ENABLE(103),
DIALOGUE_ENHANCER_ENABLE(105),
DIALOGUE_ENHANCER_AMOUNT(108),
GEQ_BAND_GAINS(110, 20),
BASS_ENHANCER_ENABLE(111),
STEREO_WIDENING_AMOUNT(113),
VOLUME_LEVELER_AMOUNT(116);
public int id, length;
DsParam(int id, int length) {
this.id = id;
this.length = length;
}
DsParam(int id) {
this(id, 1);
}
public String toString() {
return String.format("%s(%s)", name(), id);
}
}
}

View File

@@ -1,264 +0,0 @@
/*
* Copyright (C) 2018,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.
*/
package org.lineageos.settings.dolby;
import android.media.AudioAttributes;
import android.media.AudioDeviceAttributes;
import android.media.AudioDeviceCallback;
import android.media.AudioDeviceInfo;
import android.media.AudioManager;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.Toast;
import androidx.preference.ListPreference;
import androidx.preference.Preference;
import androidx.preference.Preference.OnPreferenceChangeListener;
import androidx.preference.PreferenceFragment;
import androidx.preference.SwitchPreference;
import com.android.settingslib.widget.MainSwitchPreference;
import org.lineageos.settings.R;
import java.util.Arrays;
import java.util.List;
public class DolbySettingsFragment extends PreferenceFragment implements
OnPreferenceChangeListener, OnCheckedChangeListener {
private static final String TAG = "DolbySettingsFragment";
private static final AudioAttributes ATTRIBUTES_MEDIA = new AudioAttributes.Builder()
.setUsage(AudioAttributes.USAGE_MEDIA)
.build();
public static final String PREF_ENABLE = "dolby_enable";
public static final String PREF_PROFILE = "dolby_profile";
public static final String PREF_PRESET = "dolby_preset";
public static final String PREF_VIRTUALIZER = "dolby_virtualizer";
public static final String PREF_STEREO = "dolby_stereo";
public static final String PREF_DIALOGUE = "dolby_dialogue";
public static final String PREF_BASS = "dolby_bass";
public static final String PREF_VOLUME = "dolby_volume";
public static final String PREF_RESET = "dolby_reset";
private MainSwitchPreference mSwitchBar;
private ListPreference mProfilePref, mPresetPref, mStereoPref, mDialoguePref;
private SwitchPreference mBassPref, mVirtualizerPref, mVolumePref;
private Preference mResetPref;
private CharSequence[] mPresets, mDeValues, mSwValues;
private DolbyUtils mDolbyUtils;
private AudioManager mAudioManager;
private boolean mDsOn, mIsOnSpeaker;
private int mCurrentProfile = -1;
private final Handler mHandler = new Handler();
private final AudioDeviceCallback mAudioDeviceCallback = new AudioDeviceCallback() {
public void onAudioDevicesAdded(AudioDeviceInfo[] addedDevices) {
updateSpeakerState(false);
}
public void onAudioDevicesRemoved(AudioDeviceInfo[] removedDevices) {
updateSpeakerState(false);
}
};
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
addPreferencesFromResource(R.xml.dolby_settings);
mAudioManager = getActivity().getSystemService(AudioManager.class);
mDolbyUtils = DolbyUtils.getInstance(getActivity());
mDsOn = mDolbyUtils.getDsOn();
mSwitchBar = (MainSwitchPreference) findPreference(PREF_ENABLE);
mSwitchBar.addOnSwitchChangeListener(this);
mSwitchBar.setChecked(mDsOn);
mProfilePref = (ListPreference) findPreference(PREF_PROFILE);
mProfilePref.setOnPreferenceChangeListener(this);
mProfilePref.setEnabled(mDsOn);
final CharSequence[] profiles = mProfilePref.getEntryValues();
final int profile = mDolbyUtils.getProfile();
if (Arrays.asList(profiles).contains(Integer.toString(profile))) {
mCurrentProfile = profile;
mProfilePref.setSummary("%s");
mProfilePref.setValue(Integer.toString(profile));
} else {
mCurrentProfile = -1;
mProfilePref.setSummary(getActivity().getString(R.string.dolby_unknown));
}
mPresetPref = (ListPreference) findPreference(PREF_PRESET);
mPresetPref.setOnPreferenceChangeListener(this);
mPresets = mPresetPref.getEntryValues();
mVirtualizerPref = (SwitchPreference) findPreference(PREF_VIRTUALIZER);
mVirtualizerPref.setOnPreferenceChangeListener(this);
mStereoPref = (ListPreference) findPreference(PREF_STEREO);
mStereoPref.setOnPreferenceChangeListener(this);
mSwValues = mStereoPref.getEntryValues();
mDialoguePref = (ListPreference) findPreference(PREF_DIALOGUE);
mDialoguePref.setOnPreferenceChangeListener(this);
mDeValues = mDialoguePref.getEntryValues();
mBassPref = (SwitchPreference) findPreference(PREF_BASS);
mBassPref.setOnPreferenceChangeListener(this);
mVolumePref = (SwitchPreference) findPreference(PREF_VOLUME);
mVolumePref.setOnPreferenceChangeListener(this);
mResetPref = (Preference) findPreference(PREF_RESET);
mResetPref.setOnPreferenceClickListener(p -> {
mDolbyUtils.resetProfileSpecificSettings();
updateProfileSpecificPrefs();
Toast.makeText(getActivity(),
getActivity().getString(R.string.dolby_reset_profile_toast,
mProfilePref.getSummary()), Toast.LENGTH_SHORT).show();
return true;
});
mAudioManager.registerAudioDeviceCallback(mAudioDeviceCallback, mHandler);
updateSpeakerState(true);
}
@Override
public void onDestroyView() {
mAudioManager.unregisterAudioDeviceCallback(mAudioDeviceCallback);
super.onDestroyView();
}
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
switch (preference.getKey()) {
case PREF_PROFILE:
mCurrentProfile = Integer.parseInt((newValue.toString()));
mDolbyUtils.setProfile(mCurrentProfile);
updateProfileSpecificPrefs();
return true;
case PREF_PRESET:
mDolbyUtils.setPreset(newValue.toString());
return true;
case PREF_VIRTUALIZER:
if (mIsOnSpeaker)
mDolbyUtils.setSpeakerVirtualizerEnabled((Boolean) newValue);
else
mDolbyUtils.setHeadphoneVirtualizerEnabled((Boolean) newValue);
return true;
case PREF_STEREO:
mDolbyUtils.setStereoWideningAmount(Integer.parseInt((newValue.toString())));
return true;
case PREF_DIALOGUE:
mDolbyUtils.setDialogueEnhancerAmount(Integer.parseInt((newValue.toString())));
return true;
case PREF_BASS:
mDolbyUtils.setBassEnhancerEnabled((Boolean) newValue);
return true;
case PREF_VOLUME:
mDolbyUtils.setVolumeLevelerEnabled((Boolean) newValue);
return true;
default:
return false;
}
}
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mDsOn = isChecked;
mDolbyUtils.setDsOn(isChecked);
mProfilePref.setEnabled(isChecked);
mResetPref.setEnabled(isChecked);
updateProfileSpecificPrefs();
}
private void updateSpeakerState(boolean force) {
final AudioDeviceAttributes device =
mAudioManager.getDevicesForAttributes(ATTRIBUTES_MEDIA).get(0);
final boolean isOnSpeaker = (device.getType() == AudioDeviceInfo.TYPE_BUILTIN_SPEAKER);
if (mIsOnSpeaker != isOnSpeaker || force) {
Log.d(TAG, "updateSpeakerState: " + mIsOnSpeaker);
mIsOnSpeaker = isOnSpeaker;
updateProfileSpecificPrefs();
}
}
private void updateProfileSpecificPrefs() {
final String unknownRes = getActivity().getString(R.string.dolby_unknown);
final String headphoneRes = getActivity().getString(R.string.dolby_connect_headphones);
Log.d(TAG, "updateProfileSpecificPrefs: mDsOn=" + mDsOn
+ " mCurrentProfile=" + mCurrentProfile + " mIsOnSpeaker=" + mIsOnSpeaker);
final boolean enable = mDsOn && (mCurrentProfile != -1);
mPresetPref.setEnabled(enable);
mVirtualizerPref.setEnabled(enable);
mDialoguePref.setEnabled(enable);
mVolumePref.setEnabled(enable);
mResetPref.setEnabled(enable);
mStereoPref.setEnabled(enable && !mIsOnSpeaker);
mBassPref.setEnabled(enable && !mIsOnSpeaker);
if (!enable) return;
final String preset = mDolbyUtils.getPreset();
if (Arrays.asList(mPresets).contains(preset)) {
mPresetPref.setSummary("%s");
mPresetPref.setValue(preset);
} else {
mPresetPref.setSummary(unknownRes);
}
final String deValue = Integer.toString(mDolbyUtils.getDialogueEnhancerAmount());
if (Arrays.asList(mDeValues).contains(deValue)) {
mDialoguePref.setSummary("%s");
mDialoguePref.setValue(deValue);
} else {
mDialoguePref.setSummary(unknownRes);
}
mVirtualizerPref.setChecked(mIsOnSpeaker ? mDolbyUtils.getSpeakerVirtualizerEnabled()
: mDolbyUtils.getHeadphoneVirtualizerEnabled());
mVolumePref.setChecked(mDolbyUtils.getVolumeLevelerEnabled());
if (mIsOnSpeaker) {
mStereoPref.setSummary(headphoneRes);
mBassPref.setSummary(headphoneRes);
return;
}
final String swValue = Integer.toString(mDolbyUtils.getStereoWideningAmount());
if (Arrays.asList(mSwValues).contains(swValue)) {
mStereoPref.setSummary("%s");
mStereoPref.setValue(swValue);
} else {
mStereoPref.setSummary(unknownRes);
}
mBassPref.setChecked(mDolbyUtils.getBassEnhancerEnabled());
mBassPref.setSummary(null);
}
}

View File

@@ -1,36 +0,0 @@
package org.lineageos.settings.dolby;
import android.service.quicksettings.Tile;
import android.service.quicksettings.TileService;
public class DolbyTileService extends TileService {
@Override
public void onStartListening() {
Tile tile = getQsTile();
DolbyUtils dolbyUtils = DolbyUtils.getInstance(getApplicationContext());
if (dolbyUtils.getDsOn()) {
tile.setState(Tile.STATE_ACTIVE);
} else {
tile.setState(Tile.STATE_INACTIVE);
}
tile.setSubtitle(dolbyUtils.getProfileName());
tile.updateTile();
super.onStartListening();
}
@Override
public void onClick() {
Tile tile = getQsTile();
DolbyUtils dolbyUtils = DolbyUtils.getInstance(getApplicationContext());
if (dolbyUtils.getDsOn()) {
dolbyUtils.setDsOn(false);
tile.setState(Tile.STATE_INACTIVE);
} else {
dolbyUtils.setDsOn(true);
tile.setState(Tile.STATE_ACTIVE);
}
tile.updateTile();
super.onClick();
}
}

View File

@@ -1,190 +0,0 @@
/*
* Copyright (C) 2018,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.
*/
package org.lineageos.settings.dolby;
import android.content.Context;
import android.util.Log;
import org.lineageos.settings.R;
import org.lineageos.settings.dolby.DolbyConstants.DsParam;
import java.util.Arrays;
import java.util.List;
public final class DolbyUtils {
private static final String TAG = "DolbyUtils";
private static final int EFFECT_PRIORITY = 100;
private static final int VOLUME_LEVELER_AMOUNT = 2;
private static DolbyUtils mInstance;
private DolbyAtmos mDolbyAtmos;
private Context mContext;
private DolbyUtils(Context context) {
mContext = context;
mDolbyAtmos = new DolbyAtmos(EFFECT_PRIORITY, 0);
mDolbyAtmos.setEnabled(mDolbyAtmos.getDsOn());
}
public static synchronized DolbyUtils getInstance(Context context) {
if (mInstance == null) {
mInstance = new DolbyUtils(context);
}
return mInstance;
}
private void checkEffect() {
if (!mDolbyAtmos.hasControl()) {
Log.w(TAG, "lost control, recreating effect");
mDolbyAtmos.release();
mDolbyAtmos = new DolbyAtmos(EFFECT_PRIORITY, 0);
}
}
public void setDsOn(boolean on) {
checkEffect();
Log.d(TAG, "setDsOn: " + on);
mDolbyAtmos.setDsOn(on);
}
public boolean getDsOn() {
boolean on = mDolbyAtmos.getDsOn();
Log.d(TAG, "getDsOn: " + on);
return on;
}
public void setProfile(int index) {
checkEffect();
Log.d(TAG, "setProfile: " + index);
mDolbyAtmos.setProfile(index);
}
public int getProfile() {
int profile = mDolbyAtmos.getProfile();
Log.d(TAG, "getProfile: " + profile);
return profile;
}
public String getProfileName() {
String profile = Integer.toString(mDolbyAtmos.getProfile());
List<String> profiles = Arrays.asList(mContext.getResources().getStringArray(
R.array.dolby_profile_values));
int profileIndex = profiles.indexOf(profile);
Log.d(TAG, "getProfileName: profile=" + profile + " index=" + profileIndex);
return profileIndex == -1 ? null : mContext.getResources().getStringArray(
R.array.dolby_profile_entries)[profileIndex];
}
public void resetProfileSpecificSettings() {
checkEffect();
mDolbyAtmos.resetProfileSpecificSettings();
}
public void setPreset(String preset) {
checkEffect();
int[] gains = Arrays.stream(preset.split(",")).mapToInt(Integer::parseInt).toArray();
Log.d(TAG, "setPreset: " + Arrays.toString(gains));
mDolbyAtmos.setDapParameter(DsParam.GEQ_BAND_GAINS, gains);
}
public String getPreset() {
int[] gains = mDolbyAtmos.getDapParameter(DsParam.GEQ_BAND_GAINS);
Log.d(TAG, "getPreset: " + Arrays.toString(gains));
String[] preset = Arrays.stream(gains).mapToObj(String::valueOf).toArray(String[]::new);
return String.join(",", preset);
}
public void setHeadphoneVirtualizerEnabled(boolean enable) {
checkEffect();
Log.d(TAG, "setHeadphoneVirtualizerEnabled: " + enable);
mDolbyAtmos.setDapParameterBool(DsParam.HEADPHONE_VIRTUALIZER, enable);
}
public boolean getHeadphoneVirtualizerEnabled() {
boolean enabled = mDolbyAtmos.getDapParameterBool(DsParam.HEADPHONE_VIRTUALIZER);
Log.d(TAG, "getHeadphoneVirtualizerEnabled: " + enabled);
return enabled;
}
public void setSpeakerVirtualizerEnabled(boolean enable) {
checkEffect();
Log.d(TAG, "setSpeakerVirtualizerEnabled: " + enable);
mDolbyAtmos.setDapParameterBool(DsParam.SPEAKER_VIRTUALIZER, enable);
}
public boolean getSpeakerVirtualizerEnabled() {
boolean enabled = mDolbyAtmos.getDapParameterBool(DsParam.SPEAKER_VIRTUALIZER);
Log.d(TAG, "getSpeakerVirtualizerEnabled: " + enabled);
return enabled;
}
public void setStereoWideningAmount(int amount) {
checkEffect();
Log.d(TAG, "setStereoWideningAmount: " + amount);
mDolbyAtmos.setDapParameterInt(DsParam.STEREO_WIDENING_AMOUNT, amount);
}
public int getStereoWideningAmount() {
int amount = mDolbyAtmos.getDapParameterInt(DsParam.STEREO_WIDENING_AMOUNT);
Log.d(TAG, "getStereoWideningAmount: " + amount);
return amount;
}
public void setDialogueEnhancerAmount(int amount) {
checkEffect();
Log.d(TAG, "setDialogueEnhancerAmount: " + amount);
mDolbyAtmos.setDapParameterBool(DsParam.DIALOGUE_ENHANCER_ENABLE, amount > 0);
mDolbyAtmos.setDapParameterInt(DsParam.DIALOGUE_ENHANCER_AMOUNT, amount);
}
public int getDialogueEnhancerAmount() {
boolean enabled = mDolbyAtmos.getDapParameterBool(
DsParam.DIALOGUE_ENHANCER_ENABLE);
int amount = enabled ? mDolbyAtmos.getDapParameterInt(
DsParam.DIALOGUE_ENHANCER_AMOUNT) : 0;
Log.d(TAG, "getDialogueEnhancerAmount: " + enabled + " amount=" + amount);
return amount;
}
public void setBassEnhancerEnabled(boolean enable) {
checkEffect();
Log.d(TAG, "setBassEnhancerEnabled: " + enable);
mDolbyAtmos.setDapParameterBool(DsParam.BASS_ENHANCER_ENABLE, enable);
}
public boolean getBassEnhancerEnabled() {
boolean enabled = mDolbyAtmos.getDapParameterBool(DsParam.BASS_ENHANCER_ENABLE);
Log.d(TAG, "getBassEnhancerEnabled: " + enabled);
return enabled;
}
public void setVolumeLevelerEnabled(boolean enable) {
checkEffect();
Log.d(TAG, "setVolumeLevelerEnabled: " + enable);
mDolbyAtmos.setDapParameterBool(DsParam.VOLUME_LEVELER_ENABLE, enable);
mDolbyAtmos.setDapParameterInt(DsParam.VOLUME_LEVELER_AMOUNT,
enable ? VOLUME_LEVELER_AMOUNT : 0);
}
public boolean getVolumeLevelerEnabled() {
boolean enabled = mDolbyAtmos.getDapParameterBool(DsParam.VOLUME_LEVELER_ENABLE);
int amount = mDolbyAtmos.getDapParameterInt(DsParam.VOLUME_LEVELER_AMOUNT);
Log.d(TAG, "getVolumeLevelerEnabled: " + enabled + " amount=" + amount);
return enabled && (amount == VOLUME_LEVELER_AMOUNT);
}
}

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2018 The LineageOS Project
* Copyright (C) 2024 The LineageOS Project
* 2024 Flakeforever
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,21 +15,21 @@
* limitations under the License.
*/
package org.lineageos.settings.dolby;
package org.lineageos.settings.feas;
import android.os.Bundle;
import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity;
public class DolbyActivity extends CollapsingToolbarBaseActivity {
public class FEASActivity extends CollapsingToolbarBaseActivity {
private static final String TAG_DOLBY = "dolby";
private static final String TAG_FEAS = "FEAS";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getFragmentManager().beginTransaction().replace(com.android.settingslib.collapsingtoolbar.R.id.content_frame,
new DolbySettingsFragment(), TAG_DOLBY).commit();
new FEASFragment(), TAG_FEAS).commit();
}
}

View File

@@ -0,0 +1,117 @@
/*
* Copyright (C) 2024 The LineageOS Project
* 2024 Flakeforever
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.lineageos.settings.feas;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.text.InputType;
import android.text.InputFilter;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import androidx.preference.EditTextPreference;
import androidx.preference.ListPreference;
import androidx.preference.Preference;
import androidx.preference.Preference.OnPreferenceChangeListener;
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceFragment;
import androidx.preference.SwitchPreference;
import android.util.Log;
import com.android.settingslib.widget.MainSwitchPreference;
import org.lineageos.settings.R;
public class FEASFragment extends PreferenceFragment
implements OnPreferenceChangeListener, OnCheckedChangeListener {
private static final String TAG = "FEAS";
private MainSwitchPreference mSwitchBar;
private ListPreference mMinFreqLimitLevel;
private ListPreference mMaxFreqLimitLevel;
private FEASUtils mFEASUtils;
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
addPreferencesFromResource(R.xml.feas_settings);
mFEASUtils = new FEASUtils(getActivity());
mSwitchBar = (MainSwitchPreference) findPreference("feas_enable");
mSwitchBar.setOnPreferenceChangeListener(this);
mSwitchBar.setChecked(mFEASUtils.getValue(
mFEASUtils.PERFMGR_ENABLE_PATH, mFEASUtils.PERFMGR_ENABLE) == 1);
int minFreqLimitLevel = mFEASUtils.getValue(
mFEASUtils.MIN_FREQ_PATH, mFEASUtils.PERFMGR_MIN_FREQ);
int maxFreqLimitLevel = mFEASUtils.getValue(
mFEASUtils.MAX_FREQ_PATH, mFEASUtils.PERFMGR_MAX_FREQ);
mMinFreqLimitLevel = (ListPreference) findPreference("min_freq_limit_level");
mMinFreqLimitLevel.setValue(String.valueOf(minFreqLimitLevel));
mMaxFreqLimitLevel = (ListPreference) findPreference("max_freq_limit_level");
mMaxFreqLimitLevel.setValue(String.valueOf(maxFreqLimitLevel));
for (Preference preference : new Preference[]{
mMinFreqLimitLevel, mMaxFreqLimitLevel
}) {
preference.setOnPreferenceChangeListener(this);
}
updateDependencies();
}
private void updateDependencies() {
boolean enabled = mSwitchBar.isChecked();
mMinFreqLimitLevel.setEnabled(enabled);
mMaxFreqLimitLevel.setEnabled(enabled);
}
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
if (preference == mSwitchBar) {
boolean enabled = (Boolean) newValue;
updateDependencies();
return mFEASUtils.putValue(
mFEASUtils.PERFMGR_ENABLE_PATH, mFEASUtils.PERFMGR_ENABLE, enabled? "1" : "0");
}
if (preference == mMinFreqLimitLevel) {
String value = newValue.toString();
return mFEASUtils.putValue(
mFEASUtils.MIN_FREQ_PATH, mFEASUtils.PERFMGR_MIN_FREQ, value);
}
if (preference == mMaxFreqLimitLevel) {
String value = newValue.toString();
return mFEASUtils.putValue(
mFEASUtils.MAX_FREQ_PATH, mFEASUtils.PERFMGR_MAX_FREQ, value);
}
return true;
}
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
updateDependencies();
}
}

View File

@@ -0,0 +1,77 @@
/*
* Copyright (C) 2024 The LineageOS Project
* 2024 Flakeforever
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.lineageos.settings.feas;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import androidx.preference.PreferenceManager;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import org.lineageos.settings.utils.FileUtils;
public class FEASUtils {
public static final String PERFMGR_ENABLE = "perfmgr_enable";
public static final String PERFMGR_MIN_FREQ = "min_freq_limit_level";
public static final String PERFMGR_MAX_FREQ = "max_freq_limit_level";
public static final String PERFMGR_ENABLE_PATH = "/sys/module/perfmgr/parameters/perfmgr_enable";
public static final String MIN_FREQ_PATH = "/sys/module/perfmgr/parameters/min_freq_limit_level";
public static final String MAX_FREQ_PATH = "/sys/module/perfmgr/parameters/max_freq_limit_level";
private SharedPreferences mSharedPrefs;
private boolean mInitialized;
public FEASUtils(Context context) {
mSharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
}
public void initialize() {
if (!mInitialized) {
getValue(MIN_FREQ_PATH, PERFMGR_ENABLE);
getValue(MAX_FREQ_PATH, PERFMGR_MAX_FREQ);
getValue(PERFMGR_ENABLE_PATH, PERFMGR_ENABLE);
mInitialized = true;
}
}
public int getValue(String PATH, String KEY) {
String value = mSharedPrefs.getString(KEY, null);
String currentValue = FileUtils.readOneLine(PATH);
int ret = 0;
if (value == null || value.isEmpty()) {
mSharedPrefs.edit().putString(KEY, currentValue).apply();
return Integer.parseInt(currentValue.trim());
}
ret = Integer.parseInt(value.trim());
if (!value.equals(currentValue)) {
putValue(PATH, KEY, value);
}
return ret;
}
public boolean putValue(String PATH, String KEY, String value) {
mSharedPrefs.edit().putString(KEY, value).apply();
return FileUtils.writeLine(PATH, value);
}
}

View File

@@ -1,32 +0,0 @@
//
// 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.
cc_binary {
relative_install_path: "hw",
defaults: ["hidl_defaults"],
name: "vendor.lineage.powershare@1.0-service.xiaomi_mondrian",
init_rc: ["vendor.lineage.powershare@1.0-service.xiaomi_mondrian.rc"],
vintf_fragments: ["vendor.lineage.powershare@1.0-service.xiaomi_mondrian.xml"],
srcs: ["service.cpp", "PowerShare.cpp"],
shared_libs: [
"libbase",
"libhardware",
"libhidlbase",
"liblog",
"libutils",
"vendor.lineage.powershare@1.0",
],
proprietary: true,
}

View File

@@ -1,72 +0,0 @@
/*
* 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.
*/
#define LOG_TAG "PowerShareService"
#include "PowerShare.h"
#include <hidl/HidlTransportSupport.h>
#include <fstream>
namespace vendor {
namespace lineage {
namespace powershare {
namespace V1_0 {
namespace implementation {
#define WIRELESS_TX_ENABLE_PATH "/sys/class/qcom-battery/reverse_chg_mode"
/*
* Write value to path and close file.
*/
template <typename T>
static void set(const std::string& path, const T& value) {
std::ofstream file(path);
file << value;
}
template <typename T>
static T get(const std::string& path, const T& def) {
std::ifstream file(path);
T result;
file >> result;
return file.fail() ? def : result;
}
Return<bool> PowerShare::isEnabled() {
const auto value = get<std::string>(WIRELESS_TX_ENABLE_PATH, "");
return !(value == "disable" || value == "0");
}
Return<bool> PowerShare::setEnabled(bool enable) {
set(WIRELESS_TX_ENABLE_PATH, enable ? 1 : 0);
return isEnabled();
}
Return<uint32_t> PowerShare::getMinBattery() {
return 0;
}
Return<uint32_t> PowerShare::setMinBattery(uint32_t) {
return getMinBattery();
}
} // namespace implementation
} // namespace V1_0
} // namespace powershare
} // namespace lineage
} // namespace vendor

View File

@@ -1,45 +0,0 @@
/*
* 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.
*/
#ifndef VENDOR_LINEAGE_POWERSHARE_V1_0_POWERSHARE_H
#define VENDOR_LINEAGE_POWERSHARE_V1_0_POWERSHARE_H
#include <vendor/lineage/powershare/1.0/IPowerShare.h>
namespace vendor {
namespace lineage {
namespace powershare {
namespace V1_0 {
namespace implementation {
using ::android::sp;
using ::android::hardware::Return;
using ::android::hardware::Void;
class PowerShare : public IPowerShare {
public:
Return<bool> isEnabled() override;
Return<bool> setEnabled(bool enable) override;
Return<uint32_t> getMinBattery() override;
Return<uint32_t> setMinBattery(uint32_t minBattery) override;
};
} // namespace implementation
} // namespace V1_0
} // namespace powershare
} // namespace lineage
} // namespace vendor
#endif // VENDOR_LINEAGE_POWERSHARE_V1_0_POWERSHARE_H

View File

@@ -1,50 +0,0 @@
/*
* 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.
*/
#define LOG_TAG "vendor.lineage.powershare@1.0-service.xiaomi_mondrian"
#include <android-base/logging.h>
#include <hidl/HidlTransportSupport.h>
#include "PowerShare.h"
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
using vendor::lineage::powershare::V1_0::IPowerShare;
using vendor::lineage::powershare::V1_0::implementation::PowerShare;
using android::OK;
using android::status_t;
int main() {
android::sp<IPowerShare> service = new PowerShare();
configureRpcThreadpool(1, true);
status_t status = service->registerAsService();
if (status != OK) {
LOG(ERROR) << "Cannot register PowerShare HAL service.";
return 1;
}
LOG(INFO) << "PowerShare HAL service ready.";
joinRpcThreadpool();
LOG(ERROR) << "PowerShare HAL service failed to join thread pool.";
return 1;
}

View File

@@ -1,8 +0,0 @@
on boot
chown system system /sys/class/qcom-battery/reverse_chg_mode
chmod 0644 /sys/class/qcom-battery/reverse_chg_mode
service vendor.powershare-hal-1-0 /vendor/bin/hw/vendor.lineage.powershare@1.0-service.xiaomi_mondrian
class hal
user system
group system

View File

@@ -1,11 +0,0 @@
<manifest version="1.0" type="device">
<hal format="hidl">
<name>vendor.lineage.powershare</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IPowerShare</name>
<instance>default</instance>
</interface>
</hal>
</manifest>

File diff suppressed because it is too large Load Diff

View File

@@ -91,6 +91,10 @@ on early-boot
chown system system /mnt/vendor/persist/data/pfm/licenses/store_4
chmod 0664 /mnt/vendor/persist/data/pfm/licenses/store_4
# Allow system to read measured screen FPS
chown system graphics /sys/class/drm/card0/sde-crtc-0/measured_fps
chmod 0666 /sys/class/drm/card0/sde-crtc-0/measured_fps
on boot
chown bluetooth bluetooth /sys/module/bluetooth_power/parameters/power
chown bluetooth net_bt /sys/class/rfkill/rfkill0/type

View File

@@ -32,6 +32,12 @@ on boot
chmod 0700 /sys/bus/platform/devices/soc:fingerprint_fpc/finger_irq
chmod 0700 /sys/bus/platform/devices/soc:fingerprint_fpc/power_cfg
chmod 0666 /dev/input/event2
chmod 0666 /sys/module/perfmgr/parameters/perfmgr_enable
chmod 0666 /sys/module/perfmgr/parameters/min_freq_limit_level
chmod 0666 /sys/module/perfmgr/parameters/max_freq_limit_level
chown system system /sys/module/perfmgr/parameters/perfmgr_enable
chown system system /sys/module/perfmgr/parameters/min_freq_limit_level
chown system system /sys/module/perfmgr/parameters/max_freq_limit_level
on post-fs-data
mkdir /data/vendor/misc 01771 system system
@@ -45,5 +51,6 @@ on post-fs-data
mkdir /mnt/vendor/persist/goodix 0770 system system
mkdir /mnt/vendor/persist/fpc 0770 system system
on property:persist.sys.xtra-daemon.enabled=*
restart loc_launcher

View File

@@ -1,6 +1,10 @@
# Fastcharge
type sysfs_fastcharge, sysfs_type, fs_type;
# FEAS
type proc_perfmgr, fs_type, proc_type;
type sysfs_perfmgr, fs_type, sysfs_type;
# Fingerprint
type vendor_fingerprint_data_file, data_file_type, file_type;
type vendor_fingerprint_data_file_fpdump, data_file_type, file_type;

View File

@@ -33,6 +33,9 @@
/(vendor|system/vendor)/bin/hw/android\.hardware\.biometrics\.fingerprint@2\.3-service\.xiaomi u:object_r:hal_fingerprint_default_exec:s0
/(vendor|system/vendor)/bin/hw/android\.hardware\.biometrics\.fingerprint@2\.3-service\.sm8475 u:object_r:hal_fingerprint_default_exec:s0
# FPS info
/sys/class/drm/card0/sde-crtc-0/measured_fps u:object_r:vendor_sysfs_graphics:s0
# GNSS
/data/vendor/ins(/.*)? u:object_r:vendor_ins_vendor_data_file:s0
/data/vendor/qxwz(/.*)? u:object_r:qx_oss_vendor_data_file:s0
@@ -45,6 +48,10 @@
/data/vendor/mac_addr(/.*)? u:object_r:vendor_mac_vendor_data_file:s0
/vendor/bin/nv_mac u:object_r:vendor_wcnss_service_exec:s0
# NFC
/(vendor|system/vendor)/bin/hw/vendor\.nxp\.hardware\.nfc@1\.2-service u:object_r:hal_nfc_default_exec:s0
/(vendor|system/vendor)/bin/hw/vendor\.nxp\.hardware\.nfc@2\.0-service u:object_r:hal_nfc_default_exec:s0
# Powershare
/vendor/bin/hw/vendor\.lineage\.powershare@1\.0-service\.xiaomi u:object_r:hal_lineage_powershare_default_exec:s0

View File

@@ -1,9 +1,15 @@
# Battery
genfscon sysfs /class/qcom-battery u:object_r:vendor_sysfs_battery_supply:s0
# FEAS
genfscon proc /perfmgr u:object_r:proc_perfmgr:s0
genfscon sysfs "/module/perfmgr/parameters/perfmgr_enable" u:object_r:sysfs_perfmgr:s0
genfscon sysfs "/module/perfmgr/parameters/min_freq_limit_level" u:object_r:sysfs_perfmgr:s0
genfscon sysfs "/module/perfmgr/parameters/max_freq_limit_level" u:object_r:sysfs_perfmgr:s0
# Fingerprint
genfscon sysfs /devices/platform/soc/soc:fingerprint_fpc u:object_r:vendor_sysfs_fingerprint:s0
# FPS info
genfscon sysfs /class/drm/card0/sde-crtc-0/measured_fps u:object_r:vendor_sysfs_graphics:s0
# Suspend
genfscon sysfs /devices/platform/soc/3000000.remoteproc-adsp/remoteproc/remoteproc2/3000000.remoteproc-adsp:glink-edge/3000000.remoteproc-adsp:glink-edge.adsp_apps.-1.-1/wakeup u:object_r:sysfs_wakeup:s0
genfscon sysfs /devices/platform/soc/884000.i2c/i2c-3/3-005a/wakeup u:object_r:sysfs_wakeup:s0

View File

@@ -1,2 +1,5 @@
allow hal_bluetooth_default vendor_mac_vendor_data_file:dir search;
allow hal_bluetooth_default vendor_mac_vendor_data_file:file { open read };
allow hal_bluetooth_default vendor_bt_data_file:dir rw_dir_perms;
allow hal_bluetooth_default vendor_bt_data_file:file create_file_perms;
allow hal_bluetooth_default vendor_ramdump_vendor_data_file:dir { getattr map open read };

View File

@@ -5,3 +5,7 @@ set_prop(vendor_init, vendor_ssr_prop)
set_prop(vendor_init, vendor_edgnss_qxwz_downloadak_prop)
set_prop(vendor_init, vendor_qcc_prop)
set_prop(vendor_init, audio_prop)
# FPS info
allow init vendor_sysfs_graphics:dir search;
allow init vendor_sysfs_graphics:file rw_file_perms;

5
sepolicy/vendor/ioctl_defines vendored Normal file
View File

@@ -0,0 +1,5 @@
#####################################
# perf_ioctl.h : FEAS
#
define(`FEAS_QUEUE_BEG', `0x6701')
define(`FEAS_CONNECT', `0x670f')

3
sepolicy/vendor/platform_app.te vendored Normal file
View File

@@ -0,0 +1,3 @@
# FPS info
allow platform_app vendor_sysfs_graphics:dir search;
allow platform_app vendor_sysfs_graphics:file r_file_perms;

7
sepolicy/vendor/surfaceflinger.te vendored Normal file
View File

@@ -0,0 +1,7 @@
# FEAS
allow surfaceflinger proc_perfmgr:dir {read search};
allow surfaceflinger proc_perfmgr:file {open read ioctl};
allowxperm surfaceflinger proc_perfmgr:file ioctl {
FEAS_QUEUE_BEG
FEAS_CONNECT
};

9
sepolicy/vendor/system_app.te vendored Normal file
View File

@@ -0,0 +1,9 @@
# FEAS
allow system_app proc_perfmgr:dir {read search};
allow system_app proc_perfmgr:file {open read ioctl};
allowxperm system_app proc_perfmgr:file ioctl {
FEAS_QUEUE_BEG
FEAS_CONNECT
};
allow system_app sysfs_perfmgr:dir r_dir_perms;
allow system_app sysfs_perfmgr:file { getattr open read setattr write };

9
sepolicy/vendor/system_server.te vendored Normal file
View File

@@ -0,0 +1,9 @@
# FEAS
allow system_server proc_perfmgr:dir {read search};
allow system_server proc_perfmgr:file {open read ioctl};
allowxperm system_server proc_perfmgr:file ioctl {
FEAS_QUEUE_BEG
FEAS_CONNECT
};
allow system_server sysfs_perfmgr:dir r_dir_perms;
allow system_server sysfs_perfmgr:file rw_file_perms;

7
sepolicy/vendor/untrusted_app.te vendored Normal file
View File

@@ -0,0 +1,7 @@
# FEAS
allow untrusted_app proc_perfmgr:dir {read search};
allow untrusted_app proc_perfmgr:file {open read ioctl};
allowxperm untrusted_app proc_perfmgr:file ioctl {
FEAS_QUEUE_BEG
FEAS_CONNECT
};

1
setup-makefiles.py Normal file
View File

@@ -0,0 +1 @@
#!./extract-files.py --regenerate_makefiles

View File

@@ -1,36 +0,0 @@
#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2020 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
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
ANDROID_ROOT="${MY_DIR}/../../.."
HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
if [ ! -f "${HELPER}" ]; then
echo "Unable to find helper script at ${HELPER}"
exit 1
fi
source "${HELPER}"
# Initialize the helper
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}"
# Warning headers and guards
write_headers
write_makefiles "${MY_DIR}/proprietary-files.txt" true
# Finish
write_footers