├── board-info.txt ├── sepolicy ├── public │ ├── parts_app.te │ └── file.te ├── vendor │ ├── vendor_init.te │ ├── device.te │ ├── hal_power_default.te │ ├── hal_camera_aon.te │ ├── hal_fingerprint_hwservice_xiaomi.te │ ├── property.te │ ├── parts_app.te │ ├── hal_camera_default.te │ ├── hal_usb.te │ ├── system_server.te │ ├── hal_bluetooth.te │ ├── hal_lineage_health.te │ ├── qti_init_shell.te │ ├── file.te │ ├── genfs_contexts │ ├── tee.te │ ├── property_contexts │ ├── file_contexts │ ├── wcnss_service.te │ └── hal_fingerprint.te └── private │ ├── seapp_contexts │ └── parts_app.te ├── setup-makefiles.py ├── configs ├── idc │ ├── Vendor_1915_Product_4d81.idc │ └── Vendor_1915_Product_eaea.idc ├── properties │ ├── product.prop │ ├── odm.prop │ └── vendor.prop ├── vintf │ ├── manifest_xiaomi.xml │ └── manifest_cape.xml ├── displayconfig │ ├── display_id_4630947141052476290.xml │ └── display_id_4630947200012256898.xml ├── audio │ ├── media_codecs_dolby_audio.xml │ ├── audio_effects.xml │ └── audio_policy_configuration.xml └── wifi │ └── WCNSS_qcom_cfg.ini ├── overlay ├── SetupWizardAOSPA │ ├── res │ │ └── values │ │ │ └── config.xml │ ├── Android.bp │ └── AndroidManifest.xml ├── Launcher3 │ ├── Android.bp │ ├── res │ │ └── values │ │ │ └── config.xml │ └── AndroidManifest.xml ├── Settings │ ├── Android.bp │ ├── res │ │ └── values │ │ │ └── config.xml │ └── AndroidManifest.xml ├── SystemUI │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ │ └── values │ │ └── dimens.xml ├── Frameworks │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ │ ├── values │ │ ├── dimens.xml │ │ └── config.xml │ │ └── xml │ │ └── power_profile.xml ├── SystemUIAOSPA │ ├── Android.bp │ ├── res │ │ └── values │ │ │ └── config.xml │ └── AndroidManifest.xml ├── FrameworksAOSPA │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ │ └── values │ │ └── config.xml └── SettingsProvider │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ └── values │ └── defaults.xml ├── init ├── init.mi_perf.rc ├── init.mi_service.rc ├── Android.bp ├── ueventd.xiaomi.rc └── fstab.qcom ├── Android.mk ├── power ├── Android.bp └── power-feature.cpp ├── parts ├── Android.bp ├── res │ ├── values │ │ └── strings.xml │ ├── xml │ │ └── stylus_settings.xml │ └── drawable │ │ └── ic_settings_stylus.xml ├── src │ └── com │ │ └── xiaomi │ │ └── settings │ │ ├── peripheral │ │ ├── StylusSettingsActivity.java │ │ ├── KeyboardUtilsService.java │ │ ├── StylusSettingsFragment.java │ │ └── PenUtilsService.java │ │ ├── utils │ │ └── FileUtils.java │ │ ├── BootCompletedReceiver.java │ │ └── touch │ │ └── TfWrapper.java └── AndroidManifest.xml ├── telephony └── Android.mk ├── Android.bp ├── README.md ├── reorder-libs.py ├── update-sha1sums.py ├── extract-files.py ├── BoardConfig.mk └── device.mk /board-info.txt: -------------------------------------------------------------------------------- 1 | require board=liuqin 2 | -------------------------------------------------------------------------------- /sepolicy/public/parts_app.te: -------------------------------------------------------------------------------- 1 | type parts_app, domain; 2 | -------------------------------------------------------------------------------- /setup-makefiles.py: -------------------------------------------------------------------------------- 1 | #!./extract-files.py --regenerate_makefiles 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_init.te: -------------------------------------------------------------------------------- 1 | set_prop(vendor_init, vendor_fp_prop) 2 | -------------------------------------------------------------------------------- /configs/idc/Vendor_1915_Product_4d81.idc: -------------------------------------------------------------------------------- 1 | keyboard.doNotWakeByDefault = 1 2 | -------------------------------------------------------------------------------- /configs/idc/Vendor_1915_Product_eaea.idc: -------------------------------------------------------------------------------- 1 | keyboard.doNotWakeByDefault = 1 2 | -------------------------------------------------------------------------------- /sepolicy/public/file.te: -------------------------------------------------------------------------------- 1 | # Touch 2 | type sysfs_tp_touchfeature, fs_type, sysfs_type; 3 | -------------------------------------------------------------------------------- /configs/properties/product.prop: -------------------------------------------------------------------------------- 1 | # Settings 2 | persist.settings.large_screen_opt.enabled=true -------------------------------------------------------------------------------- /sepolicy/vendor/device.te: -------------------------------------------------------------------------------- 1 | # Fingerprint 2 | type vendor_fingerprint_device, dev_type; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_power_default.te: -------------------------------------------------------------------------------- 1 | allow hal_power_default touchfeature_device:chr_file rw_file_perms; -------------------------------------------------------------------------------- /sepolicy/vendor/hal_camera_aon.te: -------------------------------------------------------------------------------- 1 | type hal_camera_aon_service, hal_service_type, protected_service, service_manager_type; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_fingerprint_hwservice_xiaomi.te: -------------------------------------------------------------------------------- 1 | type vendor_hal_fingerprint_hwservice_xiaomi, hwservice_manager_type; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/property.te: -------------------------------------------------------------------------------- 1 | # Fingerprint 2 | vendor_public_prop(vendor_fp_prop) 3 | vendor_restricted_prop(vendor_fp_info_prop) 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/parts_app.te: -------------------------------------------------------------------------------- 1 | allow parts_app vendor_sysfs_qcom_battery:dir r_dir_perms; 2 | allow parts_app vendor_sysfs_qcom_battery:file r_file_perms; -------------------------------------------------------------------------------- /sepolicy/private/seapp_contexts: -------------------------------------------------------------------------------- 1 | # Parts 2 | user=system seinfo=platform isPrivApp=true name=com.xiaomi.settings domain=parts_app type=system_app_data_file levelFrom=all 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_camera_default.te: -------------------------------------------------------------------------------- 1 | allow hal_camera_client hal_camera_aon_service:service_manager find; 2 | add_service(hal_camera_server, hal_camera_aon_service) 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_usb.te: -------------------------------------------------------------------------------- 1 | allow vendor_hal_usb_qti vendor_sysfs_qcom_battery:dir r_dir_perms; 2 | allow vendor_hal_usb_qti vendor_sysfs_qcom_battery:file r_file_perms; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/system_server.te: -------------------------------------------------------------------------------- 1 | allow system_server vendor_hal_fingerprint_hwservice_xiaomi:hwservice_manager { add find }; 2 | get_prop(system_server, vendor_fp_prop) 3 | -------------------------------------------------------------------------------- /overlay/SetupWizardAOSPA/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | false 4 | 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_bluetooth.te: -------------------------------------------------------------------------------- 1 | allow hal_bluetooth_default vendor_mac_vendor_data_file:dir r_dir_perms; 2 | allow hal_bluetooth_default vendor_mac_vendor_data_file:file r_file_perms; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_lineage_health.te: -------------------------------------------------------------------------------- 1 | allow hal_lineage_health_default vendor_sysfs_qcom_battery:dir r_dir_perms; 2 | allow hal_lineage_health_default vendor_sysfs_qcom_battery:file rw_file_perms; 3 | -------------------------------------------------------------------------------- /overlay/Launcher3/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 Paranoid Android 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | runtime_resource_overlay { 8 | name: "LiuqinLauncher3", 9 | device_specific: true, 10 | } 11 | -------------------------------------------------------------------------------- /overlay/Settings/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 Paranoid Android 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | runtime_resource_overlay { 8 | name: "LiuqinSettings", 9 | device_specific: true, 10 | } 11 | -------------------------------------------------------------------------------- /overlay/SystemUI/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 Paranoid Android 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | runtime_resource_overlay { 8 | name: "LiuqinSystemUI", 9 | device_specific: true, 10 | } 11 | -------------------------------------------------------------------------------- /init/init.mi_perf.rc: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2024 Paranoid Android 2 | # 3 | # SPDX-License-Identifier: Apache-2.0 4 | 5 | on property:vendor.post_boot.parsed=1 6 | # Set default thermal profile 7 | write /sys/class/thermal/thermal_message/sconfig 0 8 | -------------------------------------------------------------------------------- /overlay/Frameworks/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 Paranoid Android 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | runtime_resource_overlay { 8 | name: "LiuqinFrameworks", 9 | device_specific: true, 10 | } 11 | -------------------------------------------------------------------------------- /overlay/SystemUIAOSPA/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 Paranoid Android 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | runtime_resource_overlay { 8 | name: "LiuqinSystemUIAOSPA", 9 | device_specific: true, 10 | } 11 | -------------------------------------------------------------------------------- /overlay/FrameworksAOSPA/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 Paranoid Android 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | runtime_resource_overlay { 8 | name: "LiuqinFrameworksAOSPA", 9 | device_specific: true, 10 | } 11 | -------------------------------------------------------------------------------- /overlay/SettingsProvider/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 Paranoid Android 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | runtime_resource_overlay { 8 | name: "LiuqinSettingsProvider", 9 | device_specific: true, 10 | } 11 | -------------------------------------------------------------------------------- /overlay/SetupWizardAOSPA/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 Paranoid Android 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | runtime_resource_overlay { 8 | name: "LiuqinSetupWizardAOSPA", 9 | device_specific: true, 10 | } 11 | -------------------------------------------------------------------------------- /sepolicy/vendor/qti_init_shell.te: -------------------------------------------------------------------------------- 1 | allow vendor_qti_init_shell vendor_sysfs_qcom_battery:file { setattr }; 2 | 3 | allow vendor_qti_init_shell vendor_panel_info_prop:property_service set; 4 | allow vendor_qti_init_shell vendor_camera_prop:property_service set; 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/file.te: -------------------------------------------------------------------------------- 1 | # Fingerprint 2 | type vendor_fingerprint_data_file, data_file_type, file_type; 3 | type vendor_fingerprint_data_file_fpdump, data_file_type, file_type; 4 | 5 | # Wifi 6 | type vendor_mac_vendor_data_file, data_file_type, file_type, mlstrustedobject; 7 | -------------------------------------------------------------------------------- /Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2023 Paranoid Android 3 | # 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | 7 | LOCAL_PATH := $(call my-dir) 8 | 9 | ifneq ($(filter liuqin yudi,$(TARGET_DEVICE)),) 10 | 11 | include $(call all-makefiles-under,$(LOCAL_PATH)) 12 | 13 | endif 14 | -------------------------------------------------------------------------------- /overlay/Frameworks/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /overlay/Launcher3/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | 5 | 7 | false 8 | 9 | -------------------------------------------------------------------------------- /power/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 Paranoid Android 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | cc_library_static { 8 | name: "libpowerfeature_ext_liuqin", 9 | srcs: ["power-feature.cpp"], 10 | shared_libs: [ 11 | "libbase", 12 | "vendor.aospa.power-V1-ndk", 13 | ], 14 | vendor: true, 15 | } -------------------------------------------------------------------------------- /sepolicy/vendor/genfs_contexts: -------------------------------------------------------------------------------- 1 | # Battery 2 | genfscon sysfs "/class/qcom-battery" u:object_r:vendor_sysfs_qcom_battery:s0 3 | 4 | # Fingerprint 5 | genfscon sysfs /devices/platform/soc/soc:fingerprint_fpc u:object_r:vendor_sysfs_fingerprint:s0 6 | 7 | # Wakeup nodes 8 | genfscon sysfs /devices/platform/soc/soc:fingerprint_fpc/wakeup/wakeup u:object_r:sysfs_wakeup:s0 -------------------------------------------------------------------------------- /overlay/FrameworksAOSPA/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /overlay/Settings/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | 6 | 7 | false 8 | 9 | -------------------------------------------------------------------------------- /overlay/SystemUIAOSPA/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | 6 | 7 | false 8 | 9 | -------------------------------------------------------------------------------- /overlay/Launcher3/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /overlay/Settings/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /overlay/SystemUI/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /overlay/SystemUIAOSPA/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /overlay/SettingsProvider/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /overlay/SetupWizardAOSPA/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /sepolicy/vendor/tee.te: -------------------------------------------------------------------------------- 1 | allow tee vendor_fingerprint_data_file:dir rw_dir_perms; 2 | allow tee vendor_fingerprint_data_file:file rw_file_perms; 3 | allow tee vendor_fingerprint_data_file:file create_file_perms; 4 | allow tee vendor_fingerprint_data_file_fpdump:dir rw_dir_perms; 5 | allow tee vendor_fingerprint_data_file_fpdump:file rw_file_perms; 6 | allow tee vendor_fingerprint_data_file_fpdump:file create_file_perms; 7 | -------------------------------------------------------------------------------- /parts/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 Paranoid Android 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | android_app { 8 | name: "XiaomiParts", 9 | certificate: "platform", 10 | srcs: ["src/**/*.java"], 11 | platform_apis: true, 12 | privileged: true, 13 | system_ext_specific: true, 14 | static_libs: [ 15 | "androidx.core_core", 16 | "SettingsLib", 17 | "vendor.xiaomi.hw.touchfeature-V1.0-java", 18 | ], 19 | } -------------------------------------------------------------------------------- /sepolicy/vendor/property_contexts: -------------------------------------------------------------------------------- 1 | # Fingerprint 2 | persist.vendor.fingerprint. u:object_r:vendor_fp_prop:s0 3 | persist.vendor.fpc. u:object_r:vendor_fp_prop:s0 4 | persist.vendor.sys.fp. u:object_r:vendor_fp_prop:s0 5 | persist.vendor.sys.fp.info u:object_r:vendor_fp_info_prop:s0 6 | persist.vendor.sys.fp.uid u:object_r:vendor_fp_info_prop:s0 7 | 8 | # Panel 9 | vendor.panel.display. u:object_r:vendor_panel_info_prop:s0 10 | -------------------------------------------------------------------------------- /overlay/SettingsProvider/res/values/defaults.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Xiaomi Pad 6 Pro 5 | 6 | 7 | true 8 | 9 | 10 | 1 11 | 12 | -------------------------------------------------------------------------------- /init/init.mi_service.rc: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 Paranoid Android 2 | # 3 | # SPDX-License-Identifier: Apache-2.0 4 | 5 | # Charging 6 | on boot 7 | chown system system /sys/class/power_supply/battery/input_suspend 8 | chown system system /sys/class/qcom-battery/input_suspend 9 | chmod 0660 /sys/class/power_supply/battery/input_suspend 10 | chmod 0660 /sys/class/qcom-battery/input_suspend 11 | 12 | # Fingerprint 13 | on post-fs-data 14 | mkdir /data/vendor/fpc 0770 system system 15 | mkdir /data/vendor/goodix 0770 system system 16 | 17 | # Wifi 18 | on post-fs-data 19 | mkdir /data/vendor/mac_addr 0770 system wifi 20 | -------------------------------------------------------------------------------- /parts/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | Xiaomi Parts 10 | 11 | 12 | Stylus 13 | Force recognize stylus 14 | Enable this settings to allow using third party styluses 15 | Pen charging: %1$s%% 16 | 17 | -------------------------------------------------------------------------------- /telephony/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2023 Paranoid Android 3 | # 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | 7 | LOCAL_PATH := $(call my-dir) 8 | 9 | include $(CLEAR_VARS) 10 | LOCAL_MODULE := RemoveTelephonyPackages 11 | LOCAL_MODULE_CLASS := APPS 12 | LOCAL_MODULE_TAGS := optional 13 | LOCAL_OVERRIDES_PACKAGES := \ 14 | CarrierServices \ 15 | com.google.android.dialer.support \ 16 | EmergencyInfoGms \ 17 | Dialer \ 18 | GoogleDialer \ 19 | Messages \ 20 | messaging \ 21 | Mms 22 | LOCAL_UNINSTALLABLE_MODULE := true 23 | LOCAL_CERTIFICATE := PRESIGNED 24 | LOCAL_SRC_FILES := /dev/null 25 | include $(BUILD_PREBUILT) 26 | -------------------------------------------------------------------------------- /Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 Paranoid Android 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | soong_namespace { 8 | imports: [ 9 | "hardware/xiaomi", 10 | ], 11 | } 12 | 13 | install_symlink { 14 | name: "firmware_wlan_mac.bin_symlink", 15 | vendor: true, 16 | installed_location: "firmware/wlan/qca_cld/qca6490/wlan_mac.bin", 17 | symlink_target: "/mnt/vendor/persist/qca6490/wlan_mac.bin", 18 | } 19 | install_symlink { 20 | name: "firmware_WCNSS_qcom_cfg.ini_symlink", 21 | vendor: true, 22 | installed_location: "firmware/wlan/qca_cld/qca6490/WCNSS_qcom_cfg.ini", 23 | symlink_target: "/vendor/etc/wifi/qca6490/WCNSS_qcom_cfg.ini", 24 | } 25 | -------------------------------------------------------------------------------- /sepolicy/vendor/file_contexts: -------------------------------------------------------------------------------- 1 | # Fingerprint 2 | /data/vendor/fpc(/.*)? u:object_r:vendor_fingerprint_data_file:s0 3 | /data/vendor/fpdump(/.*)? u:object_r:vendor_fingerprint_data_file_fpdump:s0 4 | /(vendor|system/vendor)/bin/hw/android\.hardware\.biometrics\.fingerprint-service\.xiaomi u:object_r:hal_fingerprint_default_exec:s0 5 | 6 | # Wakeup Nodes 7 | /sys/devices/platform/soc/soc:qcom,msm-audio-apr/soc:qcom,msm-audio-apr:qcom,q6core-audio/soc:qcom,msm-audio-apr:qcom,q6core-audio:sound/Listen\s[0-9]+\sAudio\sService/wakeup/wakeup[0-9]+(/.*)? u:object_r:sysfs_wakeup:s0 8 | 9 | # Wifi 10 | /data/vendor/mac_addr(/.*)? u:object_r:vendor_mac_vendor_data_file:s0 11 | /vendor/bin/nv_mac u:object_r:vendor_wcnss_service_exec:s0 12 | -------------------------------------------------------------------------------- /init/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 Paranoid Android 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | prebuilt_etc { 8 | name: "fstab.qcom", 9 | src: "fstab.qcom", 10 | vendor: true, 11 | } 12 | 13 | prebuilt_etc { 14 | name: "init.target.rc", 15 | src: "init.target.rc", 16 | sub_dir: "init/hw", 17 | vendor: true, 18 | } 19 | 20 | prebuilt_etc { 21 | name: "init.mi_perf.rc", 22 | src: "init.mi_perf.rc", 23 | sub_dir: "init/hw", 24 | vendor: true, 25 | } 26 | 27 | prebuilt_etc { 28 | name: "init.mi_service.rc", 29 | src: "init.mi_service.rc", 30 | sub_dir: "init/hw", 31 | vendor: true, 32 | } 33 | 34 | prebuilt_etc { 35 | name: "ueventd.xiaomi.rc", 36 | filename: "ueventd.rc", 37 | src: "ueventd.xiaomi.rc", 38 | device_specific: true, 39 | } 40 | -------------------------------------------------------------------------------- /sepolicy/private/parts_app.te: -------------------------------------------------------------------------------- 1 | typeattribute parts_app mlstrustedsubject; 2 | 3 | app_domain(parts_app) 4 | 5 | binder_use(parts_app) 6 | 7 | hal_client_domain(parts_app, hal_touchfeature_xiaomi) 8 | 9 | binder_call(parts_app, hal_touchfeature_xiaomi) 10 | 11 | allow parts_app { 12 | activity_service 13 | activity_task_service 14 | content_capture_service 15 | netstats_service 16 | vendor_perf_service 17 | }:service_manager find; 18 | 19 | allow parts_app { 20 | hal_touchfeature_xiaomi_hwservice 21 | }:hwservice_manager find; 22 | 23 | allow parts_app system_app_data_file:dir create_dir_perms; 24 | allow parts_app system_app_data_file:{ 25 | file 26 | lnk_file 27 | } create_file_perms; 28 | 29 | allow parts_app sysfs_tp_touchfeature:file rw_file_perms; 30 | 31 | allow parts_app self:netlink_kobject_uevent_socket {create setopt bind read }; 32 | -------------------------------------------------------------------------------- /configs/properties/odm.prop: -------------------------------------------------------------------------------- 1 | # Audio 2 | vendor.audio.hdr.record.enable=false 3 | 4 | # Bluetooth 5 | bluetooth.device.default_name=Xiaomi Pad 6 Pro 6 | 7 | # Display 8 | persist.sys.sf.color_mode=0 9 | ro.surface_flinger.set_idle_timer_ms=1500 10 | ro.surface_flinger.set_touch_timer_ms=1500 11 | ro.surface_flinger.set_display_power_timer_ms=1000 12 | ro.surface_flinger.use_content_detection_for_refresh_rate=true 13 | 14 | # Display Orientation 15 | ro.surface_flinger.primary_display_orientation=ORIENTATION_0 16 | debug.sf.ignore_hwc_physical_display_orientation=true 17 | ro.bootanim.set_orientation_4630947141052476290=ORIENTATION_90 18 | ro.bootanim.set_orientation_4630947200012256898=ORIENTATION_90 19 | 20 | # Sensors 21 | persist.vendor.sensors.enable.mag_filter=true 22 | 23 | # SPU 24 | vendor.gatekeeper.disable_spu=true 25 | 26 | # USB 27 | vendor.usb.product_string=Xiaomi Pad 6 Pro 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Device configuration for Xiaomi Pad 6 Pro (liuqin) 2 | ========================================= 3 | 4 | The Xiaomi Pad 6 Pro is a flagship tablet from Xiaomi. 5 | 6 | It was released in April 2023. 7 | 8 | ## Device specifications 9 | 10 | Basic | Spec Sheet 11 | -------:|:------------------------- 12 | SoC | Qualcomm SM8475 Snapdragon 8+ Gen 1 (4 nm) 13 | CPU | Octa-core (1x3.00 GHz Cortex-X2 & 3x2.50 GHz Cortex-A710 & 4x1.80 GHz Cortex-A510) 14 | GPU | Adreno 730 15 | Memory | 128GB 8GB RAM, 256GB 8GB RAM, 256GB 12GB RAM, 512GB 12GB RAM 16 | Shipped Android Version | Android 13 17 | Battery | Li-Po 8600 mAh, non-removable 18 | Display | IPS TFT LCD, 1B colors, 144Hz, HDR10, 550 nits (CSOT) 19 | 20 | ## Device picture 21 | 22 | ![liuqin](https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1681708013.08067335.png "liuqin") 23 | 24 | ## Copyright 25 | 26 | ``` 27 | # 28 | # Copyright (C) 2023 Paranoid Android 29 | # 30 | # SPDX-License-Identifier: Apache-2.0 31 | # 32 | ``` 33 | -------------------------------------------------------------------------------- /parts/res/xml/stylus_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 20 | 21 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /overlay/Frameworks/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 60.0px 7 | 8 | 10 | 60.0px 11 | 60.0px 12 | 13 | 14 | 106.0dip 15 | 16 | 17 | 46.0px 18 | 46.0px 19 | 46.0px 20 | 21 | 22 | 60.0px 23 | -------------------------------------------------------------------------------- /power/power-feature.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Paranoid Android 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #define SET_CUR_VALUE 0 13 | #define TOUCH_DOUBLETAP_MODE 14 14 | #define TOUCH_MAGIC 't' 15 | #define TOUCH_IOC_SETMODE _IO(TOUCH_MAGIC, SET_CUR_VALUE) 16 | #define TOUCH_DEV_PATH "/dev/xiaomi-touch" 17 | #define TOUCH_ID 0 18 | 19 | namespace aidl { 20 | namespace vendor { 21 | namespace aospa { 22 | namespace power { 23 | 24 | bool setDeviceSpecificFeature(Feature feature, bool enabled) { 25 | switch (feature) { 26 | case Feature::DOUBLE_TAP: { 27 | int fd = open(TOUCH_DEV_PATH, O_RDWR); 28 | int arg[3] = {TOUCH_ID, TOUCH_DOUBLETAP_MODE, enabled ? 1 : 0}; 29 | ioctl(fd, TOUCH_IOC_SETMODE, &arg); 30 | close(fd); 31 | return true; 32 | } 33 | default: 34 | return false; 35 | } 36 | } 37 | 38 | } // namespace power 39 | } // namespace aospa 40 | } // namespace vendor 41 | } // namespace aidl -------------------------------------------------------------------------------- /configs/vintf/manifest_xiaomi.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | vendor.xiaomi.hardware.bgservice 8 | hwbinder 9 | 1.0 10 | 11 | IBGService 12 | default 13 | 14 | 15 | 16 | vendor.xiaomi.hardware.campostproc 17 | hwbinder 18 | 1.0 19 | 20 | IMiPostProcService 21 | default 22 | 23 | 24 | 25 | android.hardware.media.c2 26 | hwbinder 27 | 1.0 28 | 29 | IComponentStore 30 | dolby 31 | 32 | @1.0::IComponentStore/default1 33 | 34 | 35 | -------------------------------------------------------------------------------- /parts/res/drawable/ic_settings_stylus.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 24 | 26 | -------------------------------------------------------------------------------- /configs/properties/vendor.prop: -------------------------------------------------------------------------------- 1 | # Audio 2 | ro.vendor.audio.dolby.dax.support=true 3 | ro.audio.monitorRotation=true 4 | 5 | # Bluetooth 6 | persist.sys.fflag.override.settings_bluetooth_hearing_aid=true 7 | persist.vendor.qcom.bluetooth.a2dp_offload_cap=sbc-aptx-aptxtws-aptxhd-aac-ldac-aptxadaptiver2 8 | persist.vendor.qcom.bluetooth.aac_frm_ctl.enabled=true 9 | persist.vendor.qcom.bluetooth.aac_vbr_ctl.enabled=true 10 | persist.vendor.qcom.bluetooth.aptxadaptiver2_1_support=true 11 | ro.vendor.bluetooth.csip_qti=true 12 | 13 | # Camera 14 | camera.disable_zsl_mode=true 15 | ro.camera.enableCamera1MaxZsl=1 16 | 17 | # DPM 18 | persist.vendor.dpm.vndr.feature=1 19 | persist.vendor.dpm.vndr.halservice.enable=1 20 | persist.vendor.dpm.vndr.idletimer.mode=default 21 | 22 | # DRM 23 | drm.service.enabled=true 24 | 25 | # Fingerprint 26 | persist.vendor.fingerprint.sensor_location=1700|0|0|local:4630947141052476290,1700|0|0|local:4630947200012256898 27 | persist.vendor.fingerprint.type=side 28 | 29 | # FRP 30 | ro.frp.pst=/dev/block/bootdevice/by-name/frp 31 | 32 | # FUSE passthrough 33 | persist.sys.fuse.passthrough.enable=true 34 | 35 | # Incremental FS 36 | ro.incremental.enable=yes 37 | 38 | # Media 39 | debug.stagefright.c2inputsurface=-1 40 | ro.mediaserver.64b.enable=true 41 | vendor.media.omx=0 42 | 43 | # SoC 44 | ro.soc.manufacturer=QTI 45 | 46 | # Touch 47 | ro.vendor.touchfeature.type=43 48 | -------------------------------------------------------------------------------- /parts/src/com/xiaomi/settings/peripheral/StylusSettingsActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 The LineageOS Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.xiaomi.settings.peripheral; 18 | 19 | import android.os.Bundle; 20 | 21 | import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity; 22 | import com.android.settingslib.collapsingtoolbar.R; 23 | 24 | public class StylusSettingsActivity extends CollapsingToolbarBaseActivity { 25 | 26 | private static final String TAG_STYLUS = "stylus"; 27 | 28 | @Override 29 | protected void onCreate(Bundle savedInstanceState) { 30 | super.onCreate(savedInstanceState); 31 | 32 | getFragmentManager().beginTransaction().replace(R.id.content_frame, 33 | new StylusSettingsFragment(), TAG_STYLUS).commit(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /parts/src/com/xiaomi/settings/utils/FileUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Paranoid Android 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | package com.xiaomi.settings.utils; 8 | 9 | import android.util.Log; 10 | 11 | import java.io.BufferedReader; 12 | import java.io.FileNotFoundException; 13 | import java.io.FileReader; 14 | import java.io.IOException; 15 | 16 | public final class FileUtils { 17 | 18 | private static final String TAG = "XiaomiPartsFileUtils"; 19 | private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); 20 | 21 | public static String readLine(String fileName) { 22 | String line = null; 23 | BufferedReader reader = null; 24 | try { 25 | reader = new BufferedReader(new FileReader(fileName), 512); 26 | line = reader.readLine(); 27 | } catch (FileNotFoundException e) { 28 | Log.w(TAG, "No such file " + fileName + " for reading", e); 29 | } catch (IOException e) { 30 | Log.e(TAG, "Could not read from file " + fileName, e); 31 | } finally { 32 | try { 33 | if (reader != null) { 34 | reader.close(); 35 | } 36 | } catch (IOException e) { } 37 | } 38 | return line; 39 | } 40 | 41 | public static int readLineInt(String fileName) { 42 | try { 43 | return Integer.parseInt(readLine(fileName).replace("0x", "")); 44 | } 45 | catch (NumberFormatException e) { 46 | Log.e(TAG, "Could not convert string to int from file " + fileName, e); 47 | } 48 | return 0; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /parts/src/com/xiaomi/settings/BootCompletedReceiver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Paranoid Android 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | package com.xiaomi.settings; 8 | 9 | import android.content.BroadcastReceiver; 10 | import android.content.Context; 11 | import android.content.Intent; 12 | import android.os.UserHandle; 13 | import android.util.Log; 14 | 15 | import com.xiaomi.settings.peripheral.KeyboardUtilsService; 16 | import com.xiaomi.settings.peripheral.PenUtilsService; 17 | 18 | public class BootCompletedReceiver extends BroadcastReceiver { 19 | 20 | private static final String TAG = "XiaomiParts"; 21 | private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); 22 | 23 | @Override 24 | public void onReceive(final Context context, Intent intent) { 25 | if (DEBUG) Log.d(TAG, "Received boot completed intent: " + intent.getAction()); 26 | switch (intent.getAction()) { 27 | case Intent.ACTION_LOCKED_BOOT_COMPLETED: 28 | onLockedBootCompleted(context); 29 | break; 30 | case Intent.ACTION_BOOT_COMPLETED: 31 | onBootCompleted(context); 32 | break; 33 | } 34 | } 35 | 36 | private static void onLockedBootCompleted(Context context) { 37 | // Peripherals 38 | context.startServiceAsUser(new Intent(context, KeyboardUtilsService.class), 39 | UserHandle.CURRENT); 40 | context.startServiceAsUser(new Intent(context, PenUtilsService.class), 41 | UserHandle.CURRENT); 42 | } 43 | 44 | private static void onBootCompleted(Context context) { 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /overlay/SystemUI/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22dp 5 | 6 | 7 | 9dp 8 | 9 | 10 | @*android:dimen/status_bar_height 11 | 12 | 17 | 1560px 18 | 19 | 23 | 0px 24 | 25 | 26 | @dimen/physical_fingerprint_sensor_center_screen_location_y 27 | 28 | -------------------------------------------------------------------------------- /sepolicy/vendor/wcnss_service.te: -------------------------------------------------------------------------------- 1 | allow vendor_wcnss_service self:capability { net_raw setgid setuid }; 2 | allow vendor_wcnss_service self:packet_socket write; 3 | allow vendor_wcnss_service sysfs_net:file read; 4 | allow vendor_wcnss_service vendor_mac_vendor_data_file:dir { add_name open read search setattr write }; 5 | allow vendor_wcnss_service vendor_mac_vendor_data_file:dir rw_dir_perms; 6 | allow vendor_wcnss_service vendor_mac_vendor_data_file:file { create getattr open read setattr write }; 7 | allow vendor_wcnss_service mnt_vendor_file:dir { add_name create read search write }; 8 | allow vendor_wcnss_service mnt_vendor_file:file { create open read setattr write }; 9 | allow vendor_wcnss_service vendor_sysfs_diag:dir search; 10 | allow vendor_wcnss_service vendor_sysfs_diag:file { open read }; 11 | allow vendor_wcnss_service vendor_persist_bluetooth_file:dir { search read open }; 12 | allow vendor_wcnss_service vendor_persist_bluetooth_file:file { read open getattr }; 13 | allow vendor_wcnss_service vendor_wifi_vendor_log_data_file:dir { add_name getattr open read remove_name search setattr write }; 14 | allow vendor_wcnss_service vendor_wifi_vendor_log_data_file:file { append create getattr open read rename setattr unlink write }; 15 | allow vendor_wcnss_service vendor_proc_wifi_dbg:file { create getattr open read setattr write }; 16 | allow vendor_wcnss_service vendor_data_file:dir { add_name getattr open read remove_name search setattr write }; 17 | allow vendor_wcnss_service vendor_data_file:file { append create getattr open read rename setattr unlink write }; 18 | allow vendor_wcnss_service vendor_modem_data_file:dir { add_name getattr open read remove_name search setattr write }; 19 | allow vendor_wcnss_service vendor_modem_data_file:file { append create getattr open read rename setattr unlink write }; 20 | allow vendor_wcnss_service fuse:dir { add_name getattr open read remove_name search setattr write }; 21 | allow vendor_wcnss_service fuse:file { append create getattr open read rename setattr unlink write }; 22 | -------------------------------------------------------------------------------- /overlay/FrameworksAOSPA/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | 6 | 7 | 143 8 | 9 | 20 | 1 21 | 22 | 23 | /sys/class/qcom-battery/fastchg_mode 24 | 25 | 26 | Xiaomi/liuqin/missi:13/TKQ1.221114.001/V14.0.6.0.TMYCNXM:user/release-keys 27 | 28 | 29 | 23043RP34G 30 | 31 | 32 | com.google.assistant.hubui/com.google.assistant.hubui.dream.CuratedPhotoDreamService 33 | 34 | 35 | 36 | com.google.android.deskclock/com.android.deskclock.Screensaver 37 | com.android.dreams.basic/.Colors 38 | com.google.android.apps.photos/.daydream.PhotosDreamService 39 | com.android.systemui/com.google.android.systemui.lowlightclock.LowLightClockDreamService 40 | 41 | 42 | -------------------------------------------------------------------------------- /configs/displayconfig/display_id_4630947141052476290.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 0.001709819 8 | 1.0 9 | 10 | 11 | 0.49975574 12 | 450.0 13 | 14 | 15 | 1.0 16 | 550.0 17 | 18 | 19 | 20 | 21 | 22 | 0.49975574 23 | 24 | 6001 25 | 26 | 27 | 0 28 | 0 29 | 0 30 | 31 | 32 | 36 | 37 | critical 38 | 39 | true 40 | 0 41 | 42 | 43 | 1.0 44 | 2.25 45 | 46 | 47 | 550.0 48 | 2.25 49 | 50 | 51 | 52 | 3000 53 | 1000 54 | 55 | -------------------------------------------------------------------------------- /configs/displayconfig/display_id_4630947200012256898.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 0.001709819 8 | 1.0 9 | 10 | 11 | 0.49975574 12 | 450.0 13 | 14 | 15 | 1.0 16 | 550.0 17 | 18 | 19 | 20 | 21 | 22 | 0.49975574 23 | 24 | 6001 25 | 26 | 27 | 0 28 | 0 29 | 0 30 | 31 | 32 | 36 | 37 | critical 38 | 39 | true 40 | 0 41 | 42 | 43 | 1.0 44 | 2.25 45 | 46 | 47 | 550.0 48 | 2.25 49 | 50 | 51 | 52 | 3000 53 | 1000 54 | 55 | -------------------------------------------------------------------------------- /reorder-libs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (C) 2021 The LineageOS Project 4 | # Copyright (C) 2023 Paranoid Android 5 | # 6 | # SPDX-License-Identifier: Apache-2.0 7 | # 8 | 9 | from functools import cmp_to_key 10 | from locale import LC_ALL, setlocale, strcoll 11 | from pathlib import Path 12 | 13 | FILES = [Path(file) for file in [ 14 | "proprietary-files.txt", 15 | ]] 16 | 17 | setlocale(LC_ALL, "C") 18 | 19 | def strcoll_extract_utils(string1: str, string2: str) -> int: 20 | # Skip logic if one of the string if empty 21 | if not string1 or not string2: 22 | return strcoll(string1, string2) 23 | 24 | # Remove '-' from strings if there, 25 | # it is used to indicate a build target 26 | string1 = string1.removeprefix('-') 27 | string2 = string2.removeprefix('-') 28 | 29 | # If no directories, compare normally 30 | if not "/" in string1 and not "/" in string2: 31 | return strcoll(string1, string2) 32 | 33 | string1_dir = string1.rsplit("/", 1)[0] + "/" 34 | string2_dir = string2.rsplit("/", 1)[0] + "/" 35 | if string1_dir == string2_dir: 36 | # Same directory, compare normally 37 | return strcoll(string1, string2) 38 | 39 | if string1_dir.startswith(string2_dir): 40 | # First string dir is a subdirectory of the second one, 41 | # return string1 > string2 42 | return -1 43 | 44 | if string2_dir.startswith(string1_dir): 45 | # Second string dir is a subdirectory of the first one, 46 | # return string2 > string1 47 | return 1 48 | 49 | # Compare normally 50 | return strcoll(string1, string2) 51 | 52 | for file in FILES: 53 | if not file.is_file(): 54 | print(f"File {str(file)} not found") 55 | continue 56 | 57 | with open(file, 'r') as f: 58 | sections = f.read().split("\n\n") 59 | 60 | ordered_sections = [] 61 | for section in sections: 62 | section_list = [line.strip() for line in section.splitlines()] 63 | section_list.sort(key=cmp_to_key(strcoll_extract_utils)) 64 | ordered_sections.append("\n".join(section_list)) 65 | 66 | with open(file, 'w') as f: 67 | f.write("\n\n".join(ordered_sections).strip() + "\n") 68 | -------------------------------------------------------------------------------- /parts/src/com/xiaomi/settings/touch/TfWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Paranoid Android 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | package com.xiaomi.settings.touch; 8 | 9 | import android.os.IHwBinder.DeathRecipient; 10 | import android.util.Log; 11 | 12 | import vendor.xiaomi.hw.touchfeature.V1_0.ITouchFeature; 13 | 14 | public class TfWrapper { 15 | 16 | private static final String TAG = "XiaomiPartsTouchFeatureWrapper"; 17 | private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); 18 | 19 | private static ITouchFeature mTouchFeature; 20 | 21 | private static DeathRecipient mDeathRecipient = (cookie) -> { 22 | if (DEBUG) Log.d(TAG, "serviceDied"); 23 | mTouchFeature = null; 24 | }; 25 | 26 | public static ITouchFeature getTouchFeature() { 27 | if (mTouchFeature == null) { 28 | if (DEBUG) Log.d(TAG, "getTouchFeature: mTouchFeature=null"); 29 | try { 30 | mTouchFeature = ITouchFeature.getService(); 31 | mTouchFeature.asBinder().linkToDeath(mDeathRecipient, 0); 32 | } catch (Exception e) { 33 | Log.e(TAG, "getTouchFeature failed!", e); 34 | } 35 | } 36 | return mTouchFeature; 37 | } 38 | 39 | public static void setTouchFeature(TfParams params) { 40 | final ITouchFeature touchfeature = getTouchFeature(); 41 | if (touchfeature == null) { 42 | Log.e(TAG, "setTouchFeatureParams: touchfeature is null!"); 43 | return; 44 | } 45 | if (DEBUG) Log.d(TAG, "setTouchFeatureParams: " + params); 46 | try { 47 | touchfeature.setModeValue(0, params.mode, params.value); 48 | } catch (Exception e) { 49 | Log.e(TAG, "setTouchFeatureParams failed!", e); 50 | } 51 | } 52 | 53 | public static class TfParams { 54 | /* touchfeature parameters */ 55 | final int mode, value; 56 | 57 | public TfParams(int mode, int value) { 58 | this.mode = mode; 59 | this.value = value; 60 | } 61 | 62 | public String toString() { 63 | return "TouchFeatureParams(" + mode + ", " + value + ")"; 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /configs/audio/media_codecs_dolby_audio.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /update-sha1sums.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (C) 2016 The CyanogenMod Project 4 | # Copyright (C) 2017-2020 The LineageOS Project 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | import os 20 | import sys 21 | from hashlib import sha1 22 | 23 | device = 'liuqin' 24 | vendor = 'xiaomi' 25 | 26 | with open('proprietary-files.txt', 'r') as f: 27 | lines = f.read().splitlines() 28 | vendorPath = '../../../vendor/' + vendor + '/' + device + '/proprietary' 29 | needSHA1 = False 30 | 31 | 32 | def cleanup(): 33 | for index, line in enumerate(lines): 34 | # Skip empty or commented lines 35 | if len(line) == 0 or line[0] == '#' or '|' not in line: 36 | continue 37 | 38 | # Drop SHA1 hash, if existing 39 | lines[index] = line.split('|')[0] 40 | 41 | 42 | def update(): 43 | for index, line in enumerate(lines): 44 | # Skip empty lines 45 | if len(line) == 0: 46 | continue 47 | 48 | # Check if we need to set SHA1 hash for the next files 49 | if line[0] == '#': 50 | needSHA1 = (' - from' in line) 51 | continue 52 | 53 | if needSHA1: 54 | # Remove existing SHA1 hash 55 | line = line.split('|')[0] 56 | 57 | filePath = line.split(';')[0].split(':')[-1] 58 | if filePath[0] == '-': 59 | filePath = filePath[1:] 60 | 61 | with open(os.path.join(vendorPath, filePath), 'rb') as f: 62 | hash = sha1(f.read()).hexdigest() 63 | 64 | lines[index] = '%s|%s' % (line, hash) 65 | 66 | 67 | if len(sys.argv) == 2 and sys.argv[1] == '-c': 68 | cleanup() 69 | else: 70 | update() 71 | 72 | with open('proprietary-files.txt', 'w') as file: 73 | file.write('\n'.join(lines) + '\n') 74 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_fingerprint.te: -------------------------------------------------------------------------------- 1 | allow hal_fingerprint_default vendor_fingerprint_data_file:dir create_dir_perms; 2 | allow hal_fingerprint_default vendor_fingerprint_data_file:file create_file_perms; 3 | allow hal_fingerprint_default vendor_fingerprint_data_file_fpdump:dir create_dir_perms; 4 | allow hal_fingerprint_default vendor_fingerprint_data_file_fpdump:file create_file_perms; 5 | allow hal_fingerprint_default vendor_hal_fingerprint_hwservice_xiaomi:hwservice_manager { add find }; 6 | allow hal_fingerprint_default vendor_hal_perf_hwservice:hwservice_manager find; 7 | allow hal_fingerprint_default vendor_hal_perf_default:binder call; 8 | allow hal_fingerprint_default platform_app:binder { call transfer }; 9 | allow hal_fingerprint_default platform_app:binder transfer; 10 | allow hal_fingerprint_default platform_app:fd *; 11 | allow hal_fingerprint_default system_app:binder { call transfer }; 12 | allow hal_fingerprint_default system_app:binder transfer; 13 | allow hal_fingerprint_default system_app:fd *; 14 | allow hal_fingerprint_default sysfs:file write; 15 | allow hal_fingerprint_default vendor_sysfs_spss:dir search; 16 | allow hal_fingerprint_default vendor_sysfs_spss:file { open read }; 17 | allow hal_fingerprint_default uhid_device:chr_file rw_file_perms; 18 | allow hal_fingerprint_default vendor_sysfs_fingerprint:dir r_dir_perms; 19 | allow hal_fingerprint_default vendor_sysfs_fingerprint:file rw_file_perms; 20 | allow hal_fingerprint_default vendor_sysfs_graphics:dir r_dir_perms; 21 | allow hal_fingerprint_default vendor_sysfs_graphics:file rw_file_perms; 22 | allow hal_fingerprint_default input_device:dir r_dir_perms; 23 | allow hal_fingerprint_default input_device:chr_file rwx_file_perms; 24 | allow hal_fingerprint_default mnt_vendor_file:dir search; 25 | allow hal_fingerprint_default vendor_fingerprint_device:chr_file rwx_file_perms; 26 | allow hal_fingerprint_default tee_device:chr_file rw_file_perms; 27 | allow hal_fingerprint_default vendor_dmabuf_qseecom_heap_device:chr_file r_file_perms; 28 | allow hal_fingerprint_default vendor_dmabuf_qseecom_ta_heap_device:chr_file r_file_perms; 29 | allow hal_fingerprint_default self:netlink_socket create_socket_perms_no_ioctl; 30 | allow hal_fingerprint_default surfaceflinger:binder transfer; 31 | get_prop(hal_fingerprint_default, vendor_panel_info_prop) 32 | set_prop(hal_fingerprint_default, vendor_fp_prop) 33 | set_prop(hal_fingerprint_default, vendor_fp_info_prop) 34 | -------------------------------------------------------------------------------- /parts/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 13 | 16 | 17 | 22 | 23 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 38 | 39 | 40 | 41 | 44 | 47 | 50 | 51 | 52 | 55 | 56 | 57 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /parts/src/com/xiaomi/settings/peripheral/KeyboardUtilsService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Paranoid Android 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | package com.xiaomi.settings.peripheral; 8 | 9 | import android.app.Service; 10 | import android.content.Context; 11 | import android.content.Intent; 12 | import android.hardware.input.InputManager; 13 | import android.os.IBinder; 14 | import android.util.Log; 15 | import android.view.InputDevice; 16 | 17 | public class KeyboardUtilsService extends Service { 18 | 19 | private static final String TAG = "XiaomiPartsKeyboardUtilsService"; 20 | private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); 21 | 22 | private static InputManager mInputManager; 23 | 24 | @Override 25 | public void onCreate() { 26 | super.onCreate(); 27 | if (DEBUG) Log.d(TAG, "Creating service"); 28 | if (mInputManager == null) { 29 | mInputManager = (InputManager) getSystemService(Context.INPUT_SERVICE); 30 | } 31 | setKeyboardEnabled(false); 32 | } 33 | 34 | @Override 35 | public int onStartCommand(Intent intent, int flags, int startId) { 36 | if (DEBUG) Log.d(TAG, "onStartCommand"); 37 | return START_STICKY; 38 | } 39 | 40 | @Override 41 | public void onDestroy() { 42 | if (DEBUG) Log.d(TAG, "onDestroy"); 43 | super.onDestroy(); 44 | } 45 | 46 | @Override 47 | public IBinder onBind(Intent intent) { 48 | return null; 49 | } 50 | 51 | public static void setKeyboardEnabled(boolean enabled) { 52 | if (DEBUG) Log.d(TAG, "setKeyboardEnabled: " + enabled); 53 | for (int id : mInputManager.getInputDeviceIds()) { 54 | if (isDeviceXiaomiKeyboard(id)) { 55 | if (DEBUG) Log.d(TAG, "setKeyboardEnabled: Found Xiaomi Keyboard with id: " + id); 56 | if (enabled) { 57 | if (DEBUG) Log.d(TAG, "setKeyboardEnabled: Enabling Xiaomi Keyboard"); 58 | mInputManager.enableInputDevice(id); 59 | } else { 60 | if (DEBUG) Log.d(TAG, "setKeyboardEnabled: Disabling Xiaomi Keyboard"); 61 | mInputManager.disableInputDevice(id); 62 | } 63 | } 64 | } 65 | } 66 | 67 | private static boolean isDeviceXiaomiKeyboard(int id) { 68 | InputDevice inputDevice = mInputManager.getInputDevice(id); 69 | return inputDevice.getVendorId() == 5593 && inputDevice.getProductId() == 163; 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /parts/src/com/xiaomi/settings/peripheral/StylusSettingsFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 The LineageOS Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.xiaomi.settings.peripheral; 18 | 19 | import android.content.Context; 20 | import android.content.SharedPreferences; 21 | import android.os.Bundle; 22 | import android.widget.Switch; 23 | import android.util.Log; 24 | 25 | import android.preference.PreferenceManager; 26 | import androidx.preference.ListPreference; 27 | import androidx.preference.Preference; 28 | import androidx.preference.Preference.OnPreferenceChangeListener; 29 | import androidx.preference.PreferenceFragment; 30 | import androidx.preference.SwitchPreference; 31 | import com.android.settingslib.widget.MainSwitchPreference; 32 | 33 | import com.xiaomi.settings.R; 34 | 35 | public class StylusSettingsFragment extends PreferenceFragment implements 36 | SharedPreferences.OnSharedPreferenceChangeListener { 37 | 38 | private static final String TAG = "XiaomiPeripheralManagerPenUtils"; 39 | private static final String STYLUS_KEY = "stylus_switch_key"; 40 | 41 | private SharedPreferences mStylusPreference; 42 | 43 | @Override 44 | public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { 45 | addPreferencesFromResource(R.xml.stylus_settings); 46 | 47 | mStylusPreference = PreferenceManager.getDefaultSharedPreferences(getContext()); 48 | SwitchPreference switchPreference = (SwitchPreference) findPreference(STYLUS_KEY); 49 | 50 | switchPreference.setChecked(mStylusPreference.getBoolean(STYLUS_KEY, false)); 51 | switchPreference.setEnabled(true); 52 | } 53 | 54 | @Override 55 | public void onResume() { 56 | super.onResume(); 57 | mStylusPreference.registerOnSharedPreferenceChangeListener(this); 58 | } 59 | 60 | @Override 61 | public void onPause() { 62 | super.onPause(); 63 | mStylusPreference.unregisterOnSharedPreferenceChangeListener(this); 64 | } 65 | 66 | @Override 67 | public void onSharedPreferenceChanged(SharedPreferences sharedPreference, String key) { 68 | if (STYLUS_KEY.equals(key)) { 69 | // kjgkjhgj 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /init/ueventd.xiaomi.rc: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted (subject to the limitations in the 5 | # disclaimer below) provided that the following conditions are met: 6 | # 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # 10 | # * Redistributions in binary form must reproduce the above 11 | # copyright notice, this list of conditions and the following 12 | # disclaimer in the documentation and/or other materials provided 13 | # with the distribution. 14 | # 15 | # * Neither the name of The Linux Foundation nor the names of its 16 | # contributors may be used to endorse or promote products derived 17 | # from this software without specific prior written permission. 18 | # 19 | # NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE 20 | # GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT 21 | # HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 22 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 24 | # IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 25 | # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 27 | # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 29 | # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 30 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 31 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | 33 | # Base path for all VM's 34 | firmware_directories /vendor/vm-system/ 35 | 36 | # TrustedUI VM 37 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@e0b00000/firmware/trustedvm.mdt system "/vendor/bin/vmmgr -r" 38 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@e0b00000/firmware/trustedvm.b00 system "/vendor/bin/vmmgr -r" 39 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@e0b00000/firmware/trustedvm.b01 system "/vendor/bin/vmmgr -r" 40 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@e0b00000/firmware/trustedvm.b02 system "/vendor/bin/vmmgr -r" 41 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@e0b00000/firmware/trustedvm.b03 system "/vendor/bin/vmmgr -r" 42 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@e0b00000/firmware/trustedvm.b04 system "/vendor/bin/vmmgr -r" 43 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@e0b00000/firmware/trustedvm.b05 system "/vendor/bin/vmmgr -r" 44 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@e0b00000/firmware/trustedvm.b06 system "/vendor/bin/vmmgr -r" 45 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@e0b00000/firmware/trustedvm.b07 system "/vendor/bin/vmmgr -r" 46 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@e0b00000/firmware/trustedvm.b08 system "/vendor/bin/vmmgr -r" 47 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@e0b00000/firmware/trustedvm.b09 system "/vendor/bin/vmmgr -r" 48 | 49 | # Xiaomi display feature 50 | subsystem mi_display 51 | devname uevent_devpath 52 | dirname /dev/mi_display 53 | 54 | # Xiaomi display feature 55 | /dev/mi_display/* 0666 root graphics 56 | 57 | # Xiaomi ntag 58 | /dev/ntag5-nci 0660 nfc nfc 59 | 60 | # Fingerprint 61 | /dev/goodix_fp 0666 system system 62 | /sys/bus/platform/devices/soc:fingerprint_fpc* irq 0700 system system 63 | /sys/bus/platform/devices/soc:fingerprint_fpc* irq_enable 0700 system system 64 | /sys/bus/platform/devices/soc:fingerprint_fpc* wakeup_enable 0700 system system 65 | /sys/bus/platform/devices/soc:fingerprint_fpc* hw_reset 0700 system system 66 | /sys/bus/platform/devices/soc:fingerprint_fpc* device_prepare 0700 system system 67 | /sys/bus/platform/devices/soc:fingerprint_fpc* fingerdown_wait 0700 system system 68 | /sys/bus/platform/devices/soc:fingerprint_fpc* vendor 0700 system system 69 | /sys/bus/platform/devices/soc:fingerprint_fpc* request_vreg 0700 system system 70 | /sys/bus/platform/devices/soc:fingerprint_fpc* power_cfg 0700 system system 71 | -------------------------------------------------------------------------------- /extract-files.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S PYTHONPATH=../../../tools/extract-utils python3 2 | # 3 | # SPDX-FileCopyrightText: 2024 The LineageOS Project 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | 7 | from extract_utils.fixups_blob import ( 8 | blob_fixup, 9 | blob_fixups_user_type, 10 | ) 11 | from extract_utils.fixups_lib import ( 12 | lib_fixups, 13 | lib_fixups_user_type, 14 | ) 15 | from extract_utils.main import ( 16 | ExtractUtils, 17 | ExtractUtilsModule, 18 | ) 19 | 20 | namespace_imports = [ 21 | 'vendor/qcom/common/system/telephony', 22 | 'vendor/qcom/common/vendor/adreno-s', 23 | 'vendor/qcom/common/vendor/display/5.10', 24 | 'vendor/qcom/common/vendor/media/5.10', 25 | ] 26 | 27 | 28 | def lib_fixup_liuqin_suffix(lib: str, partition: str, *args, **kwargs): 29 | return f'{lib}_liuqin' if partition == 'vendor' else None 30 | 31 | def lib_fixup_vendor_suffix(lib: str, partition: str, *args, **kwargs): 32 | return f'{lib}_vendor' if partition == 'vendor' else None 33 | 34 | 35 | lib_fixups: lib_fixups_user_type = { 36 | **lib_fixups, 37 | ( 38 | 'audio.primary.taro', 39 | 'libsdmextension', 40 | 'libqcodec2_base', 41 | 'libqcodec2_basecodec', 42 | 'libqcodec2_core', 43 | 'libqcodec2_filterbase', 44 | 'libqcodec2_hooks', 45 | 'libqcodec2_mockfilter', 46 | 'libqcodec2_mockqc2filter', 47 | 'libqcodec2_platform', 48 | 'libqcodec2_utils', 49 | 'libqcodec2_v4l2codec', 50 | ): lib_fixup_liuqin_suffix, 51 | ( 52 | 'vendor.qti.hardware.limits@1.0', 53 | 'vendor.qti.hardware.limits@1.1', 54 | 'vendor.qti.hardware.ListenSoundModel@1.0', 55 | 'vendor.qti.hardware.wifidisplaysession@1.0', 56 | 'vendor.xiaomi.hardware.mlipay@1.0', 57 | 'vendor.xiaomi.hardware.mlipay@1.1', 58 | 'vendor.xiaomi.hardware.mtdservice@1.0', 59 | 'vendor.xiaomi.hw.touchfeature@1.0', 60 | ): lib_fixup_vendor_suffix, 61 | } 62 | 63 | 64 | blob_fixups: blob_fixups_user_type = { 65 | ( 66 | 'vendor/bin/hw/android.hardware.security.keymint-service-qti', 67 | 'vendor/lib64/libqtikeymint.so', 68 | ): blob_fixup() 69 | .add_needed('android.hardware.security.rkp-V1-ndk_platform.so'), 70 | ( 71 | 'vendor/bin/hw/dolbycodec2', 72 | 'vendor/bin/hw/vendor.dolby.hardware.dms@2.0-service', 73 | 'vendor/bin/hw/vendor.dolby.media.c2@1.0-service', 74 | ): blob_fixup() 75 | .add_needed('libstagefright_foundation-v33.so'), 76 | ( 77 | 'vendor/etc/audio/sku_cape/mixer_paths_overlay_static.xml', 78 | ): blob_fixup() 79 | .regex_replace('.+TL-handset.txt.+\n', ''), 80 | ( 81 | 'vendor/etc/media_codecs.xml', 82 | 'vendor/etc/media_codecs_cape.xml', 83 | 'vendor/etc/media_codecs_cape_vendor.xml', 84 | ): blob_fixup() 85 | .regex_replace('.+media_codecs_(google_audio|google_c2|google_telephony|vendor_audio).+\n', ''), 86 | ( 87 | 'vendor/etc/camera/liuqin_enhance_motiontuning.xml', 88 | 'vendor/etc/camera/liuqin_motiontuning.xml', 89 | ): blob_fixup() 90 | .regex_replace('xml=version', 'xml version'), 91 | ( 92 | 'vendor/etc/camera/pureShot_parameter.xml', 93 | 'vendor/etc/camera/pureView_parameter.xml', 94 | ): blob_fixup() 95 | .regex_replace(r'=([0-9]+)>', r'="\1">'), 96 | ( 97 | 'vendor/lib64/c2.dolby.client.so', 98 | ): blob_fixup() 99 | .add_needed('libcodec2_hidl_shim.so'), 100 | ( 101 | 'vendor/lib64/libqcodec2_core.so', 102 | ): blob_fixup() 103 | .add_needed('libcodec2_shim.so'), 104 | ( 105 | 'vendor/lib64/libQnnGpu.so', 106 | ): blob_fixup() 107 | .strip_debug_sections(), 108 | ( 109 | 'vendor/lib64/vendor.libdpmframework.so', 110 | ): blob_fixup() 111 | .add_needed('libhidlbase_shim.so'), 112 | ( 113 | 'vendor/lib64/hw/audio.primary.taro.so', 114 | ): blob_fixup() 115 | .replace_needed( 116 | 'libstagefright_foundation.so', 117 | 'libstagefright_foundation-v33.so' 118 | ), 119 | ( 120 | 'vendor/lib64/hw/vendor.xiaomi.sensor.citsensorservice@2.0-impl.so', 121 | ): blob_fixup() 122 | .binary_regex_replace( 123 | b'_ZN13DisplayConfig10ClientImpl13ClientImplGetENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPNS_14ConfigCallbackE', 124 | b'_ZN13DisplayConfig10ClientImpl4InitENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPNS_14ConfigCallbackE\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 125 | ), 126 | } 127 | 128 | module = ExtractUtilsModule( 129 | 'liuqin', 130 | 'xiaomi', 131 | blob_fixups=blob_fixups, 132 | lib_fixups=lib_fixups, 133 | namespace_imports=namespace_imports, 134 | ) 135 | 136 | if __name__ == '__main__': 137 | utils = ExtractUtils.device(module) 138 | utils.run() 139 | -------------------------------------------------------------------------------- /BoardConfig.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2023 Paranoid Android 3 | # 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | 7 | DEVICE_PATH := device/xiaomi/liuqin 8 | HARDWARE_PATH := hardware/xiaomi 9 | 10 | # A/B 11 | AB_OTA_UPDATER := true 12 | 13 | AB_OTA_PARTITIONS += \ 14 | boot \ 15 | dtbo \ 16 | odm \ 17 | product \ 18 | recovery \ 19 | system \ 20 | system_ext \ 21 | vbmeta \ 22 | vbmeta_system \ 23 | vendor \ 24 | vendor_boot \ 25 | vendor_dlkm 26 | 27 | # Architecture 28 | TARGET_ARCH := arm64 29 | TARGET_ARCH_VARIANT := armv8-2a-dotprod 30 | TARGET_CPU_ABI := arm64-v8a 31 | TARGET_CPU_VARIANT := kryo785 32 | 33 | # Boot 34 | BOARD_BOOT_HEADER_VERSION := 4 35 | BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION) 36 | BOARD_RAMDISK_USE_LZ4 := true 37 | 38 | # Boot control 39 | SOONG_CONFIG_NAMESPACES += ufsbsg 40 | SOONG_CONFIG_ufsbsg += ufsframework 41 | SOONG_CONFIG_ufsbsg_ufsframework := bsg 42 | 43 | # Bootloader 44 | TARGET_BOOTLOADER_BOARD_NAME := taro 45 | 46 | # Build 47 | BUILD_BROKEN_DUP_RULES := true 48 | BUILD_BROKEN_DUP_SYSPROP := true 49 | BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true 50 | 51 | # Display 52 | TARGET_SCREEN_DENSITY := 340 53 | 54 | SOONG_CONFIG_NAMESPACES += dolby_vision 55 | SOONG_CONFIG_dolby_vision += enabled 56 | SOONG_CONFIG_dolby_vision_enabled := true 57 | 58 | # DTB 59 | BOARD_INCLUDE_DTB_IN_BOOTIMG := true 60 | 61 | # HIDL 62 | DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE += \ 63 | $(HARDWARE_PATH)/vintf/xiaomi_framework_compatibility_matrix.xml 64 | 65 | DEVICE_MANIFEST_FILE += \ 66 | $(DEVICE_PATH)/configs/vintf/manifest_cape.xml \ 67 | $(DEVICE_PATH)/configs/vintf/manifest_xiaomi.xml 68 | 69 | # Kernel 70 | BOARD_BOOTCONFIG := \ 71 | androidboot.hardware=qcom \ 72 | androidboot.memcg=1 \ 73 | androidboot.usbcontroller=a600000.dwc3 74 | 75 | BOARD_KERNEL_CMDLINE := \ 76 | disable_dma32=on \ 77 | mtdoops.fingerprint=$(AOSPA_VERSION) \ 78 | video=vfb:640x400,bpp=32,memsize=3072000 79 | 80 | BOARD_KERNEL_PAGESIZE := 4096 81 | BOARD_USES_GENERIC_KERNEL_IMAGE := true 82 | TARGET_HAS_GENERIC_KERNEL_HEADERS := true 83 | 84 | # Lineage Health 85 | TARGET_HEALTH_CHARGING_CONTROL_SUPPORTS_BYPASS := false 86 | 87 | # Metadata 88 | BOARD_USES_METADATA_PARTITION := true 89 | 90 | # Partitions 91 | BOARD_BOOTIMAGE_PARTITION_SIZE := 201326592 92 | BOARD_DTBOIMG_PARTITION_SIZE := 25165824 93 | BOARD_RECOVERYIMAGE_PARTITION_SIZE := 104857600 94 | BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 100663296 95 | 96 | BOARD_SUPER_PARTITION_SIZE := 9126805504 97 | BOARD_SUPER_PARTITION_GROUPS := qti_dynamic_partitions 98 | BOARD_QTI_DYNAMIC_PARTITIONS_PARTITION_LIST := odm product system system_ext vendor vendor_dlkm 99 | BOARD_QTI_DYNAMIC_PARTITIONS_SIZE := 9122611200 100 | 101 | BOARD_FLASH_BLOCK_SIZE := 262144 102 | 103 | BOARD_ODMIMAGE_FILE_SYSTEM_TYPE := erofs 104 | BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := erofs 105 | BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE := erofs 106 | BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := erofs 107 | BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := erofs 108 | BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_TYPE := erofs 109 | 110 | TARGET_COPY_OUT_ODM := odm 111 | TARGET_COPY_OUT_PRODUCT := product 112 | TARGET_COPY_OUT_SYSTEM_EXT := system_ext 113 | TARGET_COPY_OUT_VENDOR := vendor 114 | TARGET_COPY_OUT_VENDOR_DLKM := vendor_dlkm 115 | 116 | # Power 117 | TARGET_POWER_FEATURE_EXT_LIB := //$(DEVICE_PATH):libpowerfeature_ext_liuqin 118 | 119 | # Properties 120 | TARGET_ODM_PROP += $(DEVICE_PATH)/configs/properties/odm.prop 121 | TARGET_PRODUCT_PROP += $(DEVICE_PATH)/configs/properties/product.prop 122 | TARGET_VENDOR_PROP += $(DEVICE_PATH)/configs/properties/vendor.prop 123 | 124 | # Recovery 125 | BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE := true 126 | TARGET_RECOVERY_DEFAULT_ROTATION := ROTATION_RIGHT 127 | TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/init/fstab.qcom 128 | TARGET_RECOVERY_OVERSCAN_PERCENT := 1 129 | TARGET_RECOVERY_PIXEL_FORMAT := RGBX_8888 130 | TARGET_USERIMAGES_USE_F2FS := true 131 | 132 | # SELinux 133 | include device/xiaomi/sepolicy/SEPolicy.mk 134 | BOARD_VENDOR_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/vendor 135 | SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/private 136 | SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/public 137 | 138 | # Verified Boot 139 | BOARD_AVB_ENABLE := true 140 | BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 3 141 | 142 | BOARD_AVB_RECOVERY_ALGORITHM := SHA256_RSA4096 143 | BOARD_AVB_RECOVERY_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem 144 | BOARD_AVB_RECOVERY_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP) 145 | BOARD_AVB_RECOVERY_ROLLBACK_INDEX_LOCATION := 1 146 | 147 | BOARD_AVB_VBMETA_SYSTEM := product system system_ext 148 | BOARD_AVB_VBMETA_SYSTEM_ALGORITHM := SHA256_RSA4096 149 | BOARD_AVB_VBMETA_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem 150 | BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP) 151 | BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION := 2 152 | 153 | # WiFi 154 | BOARD_WLAN_DEVICE := qcwcn 155 | BOARD_HOSTAPD_DRIVER := NL80211 156 | BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE) 157 | BOARD_WPA_SUPPLICANT_DRIVER := NL80211 158 | BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE) 159 | QC_WIFI_HIDL_FEATURE_DUAL_AP := true 160 | QC_WIFI_HIDL_FEATURE_DUAL_STA := true 161 | WIFI_DRIVER_BUILT := qca_cld3 162 | WIFI_DRIVER_DEFAULT := qca_cld3 163 | WIFI_DRIVER_STATE_CTRL_PARAM := "/dev/wlan" 164 | WIFI_DRIVER_STATE_OFF := "OFF" 165 | WIFI_DRIVER_STATE_ON := "ON" 166 | WIFI_HIDL_FEATURE_AWARE := true 167 | WIFI_HIDL_FEATURE_DUAL_INTERFACE := true 168 | WPA_SUPPLICANT_VERSION := VER_0_8_X 169 | -------------------------------------------------------------------------------- /overlay/Frameworks/res/xml/power_profile.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0 4 | 122.95 5 | 1129.85 6 | 7 | 4 8 | 3 9 | 1 10 | 11 | 12 | 300000 13 | 441600 14 | 556800 15 | 691200 16 | 806400 17 | 940800 18 | 1056000 19 | 1132800 20 | 1228800 21 | 1324800 22 | 1440000 23 | 1555200 24 | 1670400 25 | 1804800 26 | 27 | 28 | 72.56 29 | 75.76 30 | 77.04 31 | 79.84 32 | 81.26 33 | 84.57 34 | 88.54 35 | 89.23 36 | 91.85 37 | 96.93 38 | 101.86 39 | 106.59 40 | 112.01 41 | 122.78 42 | 43 | 44 | 633600 45 | 768000 46 | 883200 47 | 998400 48 | 1113600 49 | 1209600 50 | 1324800 51 | 1440000 52 | 1555200 53 | 1651200 54 | 1766400 55 | 1881600 56 | 1996800 57 | 2112000 58 | 2227200 59 | 2342400 60 | 2457600 61 | 2572800 62 | 2649600 63 | 2745600 64 | 65 | 66 | 69.10 67 | 72.94 68 | 80.27 69 | 87.84 70 | 96.16 71 | 104.09 72 | 114.37 73 | 125.33 74 | 138.97 75 | 149.54 76 | 165.53 77 | 182.59 78 | 214.55 79 | 234.89 80 | 255.36 81 | 276.49 82 | 301.69 83 | 328.88 84 | 349.32 85 | 360.52 86 | 87 | 88 | 787200 89 | 921600 90 | 1036800 91 | 1171200 92 | 1286400 93 | 1401600 94 | 1536000 95 | 1651200 96 | 1766400 97 | 1881600 98 | 1996800 99 | 2131200 100 | 2246400 101 | 2361600 102 | 2476800 103 | 2592000 104 | 2707200 105 | 2822400 106 | 2918400 107 | 2995200 108 | 109 | 110 | 143.66 111 | 144.33 112 | 159.57 113 | 180.58 114 | 200.68 115 | 233.30 116 | 258.61 117 | 285.44 118 | 321.19 119 | 355.63 120 | 434.62 121 | 506.18 122 | 528.53 123 | 606.39 124 | 624.44 125 | 721.84 126 | 758.73 127 | 881.95 128 | 991.49 129 | 1012.24 130 | 131 | 18.65 132 | 5.81 133 | 0 134 | 8600 135 | 0.82 136 | 84.56 137 | 59.54 138 | 41.63 139 | 7.47 140 | 10.6 141 | 421.86 142 | 6.16 143 | 313.295 144 | 27.08 145 | 146 | 22.17 147 | 8 148 | 149 | 6 150 | 180 151 | 186 152 | 3700 153 | 154 | 17 155 | 156 | 1 157 | 176 158 | 200 159 | 160 | 1 161 | 162 | 3700 163 | 164 | .0001 165 | .001 166 | .01 167 | .1 168 | 1 169 | 170 | 7.68 171 | 0.67 172 | 3700 173 | -------------------------------------------------------------------------------- /init/fstab.qcom: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted (subject to the limitations in the 5 | # disclaimer below) provided that the following conditions are met: 6 | # 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # 10 | # * Redistributions in binary form must reproduce the above 11 | # copyright notice, this list of conditions and the following 12 | # disclaimer in the documentation and/or other materials provided 13 | # with the distribution. 14 | # 15 | # * Neither the name of The Linux Foundation nor the names of its 16 | # contributors may be used to endorse or promote products derived 17 | # from this software without specific prior written permission. 18 | # 19 | # NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE 20 | # GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT 21 | # HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 22 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 24 | # IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 25 | # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 27 | # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 29 | # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 30 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 31 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | 33 | # Android fstab file. 34 | # The filesystem that contains the filesystem checker binary (typically /system) cannot 35 | # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK 36 | 37 | # 38 | system /system ext4 ro,barrier=1,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount,avb_keys=/avb/q-gsi.avbpubkey:/avb/r-gsi.avbpubkey:/avb/s-gsi.avbpubkey 39 | system /system erofs ro wait,slotselect,avb=vbmeta_system,logical,first_stage_mount,avb_keys=/avb/q-gsi.avbpubkey:/avb/r-gsi.avbpubkey:/avb/s-gsi.avbpubkey 40 | system_ext /system_ext ext4 ro,barrier=1,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount 41 | system_ext /system_ext erofs ro wait,slotselect,avb=vbmeta_system,logical,first_stage_mount 42 | product /product ext4 ro,barrier=1,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount 43 | product /product erofs ro wait,slotselect,avb=vbmeta_system,logical,first_stage_mount 44 | vendor /vendor ext4 ro,barrier=1,discard wait,slotselect,avb,logical,first_stage_mount 45 | vendor /vendor erofs ro wait,slotselect,avb,logical,first_stage_mount 46 | vendor_dlkm /vendor_dlkm ext4 ro,barrier=1,discard wait,slotselect,avb,logical,first_stage_mount 47 | vendor_dlkm /vendor_dlkm erofs ro wait,slotselect,avb,logical,first_stage_mount 48 | odm /odm ext4 ro,barrier=1,discard wait,slotselect,avb,logical,first_stage_mount 49 | odm /odm erofs ro wait,slotselect,avb,logical,first_stage_mount 50 | /dev/block/by-name/metadata /metadata ext4 noatime,nosuid,nodev,discard wait,check,formattable,first_stage_mount 51 | /dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 noatime,nosuid,nodev,barrier=1 wait,check 52 | /dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,reserve_root=32768,resgid=1065,fsync_mode=nobarrier,inlinecrypt,gc_merge latemount,wait,check,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized+wrappedkey_v0,keydirectory=/metadata/vold/metadata_encryption,metadata_encryption=aes-256-xts:wrappedkey_v0,quota,reservedsize=128M,sysfs_path=/sys/devices/platform/soc/1d84000.ufshc,checkpoint=fs 53 | /dev/block/bootdevice/by-name/misc /misc emmc defaults defaults 54 | /devices/platform/soc/8804000.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,encryptable=footer 55 | /devices/platform/soc/*.ssusb/*.dwc3/xhci-hcd.*.auto* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto 56 | /dev/block/bootdevice/by-name/modem /vendor/firmware_mnt vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait,slotselect 57 | /dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 ro,nosuid,nodev,barrier=1 wait,slotselect 58 | /dev/block/bootdevice/by-name/vm-bootsys /vendor/vm-system ext4 ro,nosuid,nodev,barrier=1 wait,slotselect 59 | /dev/block/bootdevice/by-name/bluetooth /vendor/bt_firmware vfat ro,shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0 wait,slotselect 60 | /dev/block/bootdevice/by-name/qmcs /mnt/vendor/qmcs vfat noatime,nosuid,nodev,context=u:object_r:vendor_qmcs_file:s0 wait,check,formattable 61 | -------------------------------------------------------------------------------- /configs/wifi/WCNSS_qcom_cfg.ini: -------------------------------------------------------------------------------- 1 | # This file allows user to override the factory 2 | # defaults for the WLAN Driver 3 | 4 | gDot11Mode=0 5 | InfraUapsdVoSrvIntv=0 6 | InfraUapsdViSrvIntv=0 7 | InfraUapsdBeSrvIntv=0 8 | InfraUapsdBkSrvIntv=0 9 | gAddTSWhenACMIsOff=1 10 | gEnableApOBSSProt=1 11 | RTSThreshold=1048576 12 | g11dSupportEnabled=0 13 | gEnableDFSMasterCap=1 14 | gNeighborScanTimerPeriod=200 15 | gNeighborLookupThreshold=76 16 | FastRoamEnabled=1 17 | RoamRssiDiff=5 18 | gChannelBondingMode5GHz=1 19 | gAllowDFSChannelRoam=1 20 | gSetTxChainmask1x1=1 21 | gSetRxChainmask1x1=1 22 | gActiveMaxChannelTime=40 23 | gWlanMccToSccSwitchMode = 3 24 | gEnableTXSTBC=1 25 | gEnableTxBFeeSAP=1 26 | gEnableTxBFin20MHz=1 27 | gEnableTxSUBeamformer=1 28 | gRrmEnable=1 29 | gVhtAmpduLenExponent=7 30 | gVhtMpduLen=2 31 | isP2pDeviceAddrAdministrated=0 32 | gEnableVhtFor24GHzBand=1 33 | gEnableLpassSupport=1 34 | gCountryCodePriority=1 35 | gEnableMuBformee=1 36 | gTDLSExternalControl=1 37 | gEnableTDLSOffChannel=1 38 | 39 | ################ Datapath feature set Begin ################ 40 | gVhtRxMCS=2 41 | gVhtTxMCS=2 42 | gEnable2x2=1 43 | gVhtRxMCS2x2=2 44 | gVhtTxMCS2x2=2 45 | gIPAConfig=0 46 | gIPADescSize=800 47 | dp_tx_ring_size=5120 48 | dp_tx_compl_ring_size=8192 49 | dp_tx_desc=6144 50 | dp_tx_ext_desc=6144 51 | rx_mode=20 52 | gEnableFastPath=1 53 | TSOEnable=1 54 | GROEnable=3 55 | ght_mpdu_density=5 56 | gEnableFlowSteering=1 57 | maxMSDUsPerRxInd=8 58 | #gEnableNUDTracking=1 59 | dp_rx_fisa_enable=1 60 | dp_rx_flow_search_table_size=128 61 | rpsRxQueueCpuMapList=f3 62 | legacy_mode_csum_disable=1 63 | icmp_req_to_fw_mark_interval=200 64 | gBusBandwidthVeryHighThreshold=10000 65 | 66 | ################ Datapath feature set End ################ 67 | 68 | adaptive_dwell_mode_enabled=1 69 | hostscan_adaptive_dwell_mode=1 70 | enable_rtt_mac_randomization=1 71 | gEnableSNRMonitoring=1 72 | gWmiCreditCount=1 73 | acs_with_more_param=1 74 | AutoChannelSelectWeight=0x00fafafa 75 | bcast_twt=1 76 | gRuntimePM=2 77 | gRuntimePMDelay=500 78 | gEnablePacketLog=0 79 | oem_6g_support_disable=0 80 | 81 | #active_max_channel_time_2g=80 82 | #gActiveMaxChannelTime=60 83 | active_max_channel_time_6g=60 84 | passive_max_channel_time_6g=60 85 | 86 | #####################################Xiaomi ADD: START 87 | 88 | # Channel Rrequency Response 89 | # Bitmap denoting the PDEVs for which CFR needs to be disabled 90 | cfr_disable=7 91 | 92 | # configure MAC address from the cfg file wlan_mac.bin 93 | read_mac_addr_from_mac_file=1 94 | 95 | # Set 2.4g channel scan time to 40 96 | active_max_channel_time_2g=80 97 | gActiveMaxChannelTime=40 98 | 99 | # WLM flags setting for ultralow level, bit9 for BMPS disabled 100 | # bit 0: Avoid scan request from HLOS if setting 101 | # bit 1: Skip DFS channel SCAN if setting 102 | # bit 19/20: 1 to set PCIE in L1SS state(low power mode), 0 to set PCIE in L0 state(active mode) 103 | wlm_latency_flags_ultralow=0x180003 104 | 105 | #APF: Android Packet Filter 106 | gActiveMcBcBpfMode=1 107 | 108 | # Assoc failure timeout value 109 | # Code default is 2000 110 | assoc_failure_timeout=5000 111 | 112 | # Enable NUD tracking feature 113 | # 0 - disable(default),1 - trigger disconnect, 2 - trigger roaming, 114 | # 3 - trigger roaming, but if roam fails, disconnection 115 | gEnableNUDTracking=3 116 | 117 | # Enable ETSI SRD channels by Xiaomi. Qualcom default value is disable 118 | # * BIT 0:- Enable/Disable SRD channels for SAP. 119 | # * BIT 1:- Enable/Disable SRD channels for P2P-GO. 120 | # * BIT 2:- Enable/Disable SRD channels for NAN. 121 | # Code default value is 6. 122 | etsi13_srd_chan_in_master_mode=7 123 | 124 | #####Roaming 125 | # Sets RSSI preference for 5GHz over 2.4GHz AP 126 | gSelect5GHzMargin=5 127 | 128 | # Candidate AP minimum RSSI for beacon miss roam trigger 129 | # Code default is -70 130 | candidate_min_rssi_for_beacon_miss=-83 131 | 132 | # Dense traffic threshold in kBps 133 | # Code default is 400 134 | gtraffic_threshold=50 135 | 136 | #enable/disable FT open feature 137 | # Code default is 1 138 | enable_ftopen=0 139 | 140 | # Stop auto-creating twt session 141 | twt_congestion_timeout=0 142 | 143 | #VTS SAR test fail as sar version is not match 144 | gEnableSARV1toSARV2=1 145 | 146 | # This ini is used to give higher priority for 5g scc than dbs. 147 | # It is bitmap per enum policy_mgr_con_mode. 148 | # For example in GO+STA(5G) mode, when TPUT is onfigured as wlan system 149 | # preference option, If 5G SCC needs higher priority than dbs, set it as 8. 150 | g_prefer_5g_scc_to_dbs=8 151 | 152 | # set modulated DTIM interval 153 | gEnableModulatedDTIM=3 154 | gMaxLIModulatedDTIM=3 155 | 156 | # Enable modulated DTIM only for System suspend wow. 157 | # For RTPM wow, the device will stay in DTIM 1 (non-modulated DTIM). 158 | enable_mod_dtim_on_system_suspend=1 159 | 160 | # Reduce the expiry time for avoid list and black list in drv. 161 | avoid_list_expiry_time=3 162 | black_list_expiry_time=5 163 | # Improve threshold to move the Ap from avoid to blacklist 164 | bad_bssid_counter_thresh=7 165 | 166 | # Enable SoftAP on indoor channel, but Xiaomi's patch in driver only 167 | # allow this when STA was connected on the same indoor channel. 168 | gindoor_channel_support=1 169 | 170 | #Enable max link speed 171 | gReportMaxLinkSpeed=2 172 | 173 | #perform RX pending check before entering WoW mode 174 | wow_check_rx_pending_enable=1 175 | 176 | #Disable vht mcs 10, 11 support 177 | enable_vhtmcs_10_11_support=0 178 | 179 | #Enable bus suspend in SAP mode 180 | enable_bus_suspend_in_sap_mode=1 181 | 182 | #Enable bus suspend in P2PGO mode 183 | enable_bus_suspend_in_go_mode=1 184 | 185 | # Set Max peers connected for SAP to 20 186 | gSoftApMaxPeers=20 187 | 188 | # Override 11n/11ac to 11ac 80M for P2P GO 189 | gGO11ACOverride=1 190 | 191 | # diable bssid hint priority 192 | is_bssid_hint_priority=0 193 | 194 | # Disable triggers of data rssi threshold for roam. 195 | # Sometimes have big gap between data rssi and beacon rssi, 196 | # this triggers will Interfere and delay the normal roam. 197 | roam_data_rssi_threshold_triggers=0 198 | 199 | # disable twt responder 200 | twt_responder=0 201 | 202 | # enable Self Recovery 203 | gEnableSelfRecovery=1 204 | 205 | #####################################Xiaomi ADD: END 206 | 207 | # Disable RX wakelock 208 | rx_wakelock_timeout=0 209 | 210 | # MIUI:ADD: 211 | # Add for optimize download performance in noisy env. 212 | 213 | # used to specify AP OUIs. The station's EDCA should follow 214 | # the APs' when connecting to those AP, even if the 215 | # gEnableEdcaParams is set. 216 | # Huawei OUI:ac:85:3d 217 | gActionOUIDisableAggressiveEDCA=ac853d 00 01 0017f2 07 06010103010000 fe 01 218 | # Enable edca parameter 219 | gEnableEdcaParams=1 220 | gEdcaVoCwmin=2 221 | gEdcaViCwmin=2 222 | gEdcaBkCwmin=2 223 | gEdcaBeCwmin=2 224 | 225 | gEdcaVoCwmax=3 226 | gEdcaViCwmax=3 227 | gEdcaBkCwmax=3 228 | gEdcaBeCwmax=3 229 | 230 | gEdcaVoAifs=2 231 | gEdcaViAifs=2 232 | gEdcaBkAifs=2 233 | gEdcaBeAifs=2 234 | 235 | END 236 | 237 | # Note: Configuration parser would not read anything past the END marker 238 | 239 | -------------------------------------------------------------------------------- /parts/src/com/xiaomi/settings/peripheral/PenUtilsService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023-2024 Paranoid Android 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | package com.xiaomi.settings.peripheral; 8 | 9 | import android.app.Service; 10 | import android.content.BroadcastReceiver; 11 | import android.content.Context; 12 | import android.content.Intent; 13 | import android.content.IntentFilter; 14 | import android.content.SharedPreferences; 15 | import android.content.SharedPreferences.OnSharedPreferenceChangeListener; 16 | import android.hardware.input.InputManager; 17 | import android.hardware.input.InputManager.InputDeviceListener; 18 | import android.os.IBinder; 19 | import android.os.Handler; 20 | import android.os.Looper; 21 | import android.os.Parcel; 22 | import android.os.RemoteException; 23 | import android.os.ServiceManager; 24 | import android.os.UEventObserver; 25 | import android.provider.Settings; 26 | import android.util.Log; 27 | import android.view.InputDevice; 28 | import android.widget.Toast; 29 | 30 | import androidx.preference.PreferenceManager; 31 | 32 | import com.xiaomi.settings.R; 33 | import com.xiaomi.settings.touch.TfWrapper; 34 | import com.xiaomi.settings.utils.FileUtils; 35 | 36 | public class PenUtilsService extends Service { 37 | 38 | private static final String TAG = "XiaomiPartsPenUtilsService"; 39 | private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); 40 | 41 | private static final String STYLUS_KEY = "stylus_switch_key"; 42 | private static final String STYLUS_CHARING_PATH = "/sys/class/qcom-battery/reverse_chg_mode"; 43 | private static final String STYLUS_CHARING_DEVPATH = "DEVPATH=/devices/platform/soc/soc:qcom,pmic_glink/soc:qcom,pmic_glink:qcom,battery_charger"; 44 | 45 | private static final String KEY_PEAK_REFRESH_RATE = "peak_refresh_rate"; 46 | private static final String KEY_MIN_REFRESH_RATE = "min_refresh_rate"; 47 | 48 | private static final String SURFACE_FLINGER_SERVICE_KEY = "SurfaceFlinger"; 49 | private static final String SURFACE_COMPOSER_INTERFACE_KEY = "android.ui.ISurfaceComposer"; 50 | private static final int SURFACE_FLINGER_DISABLE_OVERLAYS_CODE = 1008; 51 | 52 | private static boolean mIsPenCharging; 53 | private static boolean mIsPenModeEnabled; 54 | private static boolean mIsPenModeForced; 55 | 56 | private static float mDefaultMinRate; 57 | private static float mDefaultPeakRate; 58 | 59 | private static InputManager mInputManager; 60 | private static SharedPreferences mSharedPrefs; 61 | private static IBinder mSurfaceFlinger; 62 | 63 | @Override 64 | public void onCreate() { 65 | super.onCreate(); 66 | if (DEBUG) Log.d(TAG, "Creating service"); 67 | mInputManager = (InputManager) getSystemService(Context.INPUT_SERVICE); 68 | mInputManager.registerInputDeviceListener(mInputDeviceListener, null); 69 | mSharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); 70 | mSharedPrefs.registerOnSharedPreferenceChangeListener(mSharedPrefsListener); 71 | mUEventObserver.startObserving(STYLUS_CHARING_DEVPATH); 72 | mIsPenCharging = FileUtils.readLineInt(STYLUS_CHARING_PATH) == 1; 73 | mIsPenModeForced = mSharedPrefs.getBoolean(STYLUS_KEY, false); 74 | mSurfaceFlinger = ServiceManager.getService(SURFACE_FLINGER_SERVICE_KEY); 75 | mDefaultMinRate = Settings.System.getFloat(getContentResolver(), KEY_MIN_REFRESH_RATE, 30f); 76 | mDefaultPeakRate = Settings.System.getFloat(getContentResolver(), KEY_PEAK_REFRESH_RATE, 144f); 77 | } 78 | 79 | @Override 80 | public int onStartCommand(Intent intent, int flags, int startId) { 81 | if (DEBUG) Log.d(TAG, "onStartCommand"); 82 | refreshPenMode(); 83 | return START_STICKY; 84 | } 85 | 86 | @Override 87 | public void onDestroy() { 88 | if (DEBUG) Log.d(TAG, "onDestroy"); 89 | Settings.System.putFloat(getContentResolver(), KEY_MIN_REFRESH_RATE, mDefaultMinRate); 90 | Settings.System.putFloat(getContentResolver(), KEY_PEAK_REFRESH_RATE, mDefaultPeakRate); 91 | super.onDestroy(); 92 | } 93 | 94 | @Override 95 | public IBinder onBind(Intent intent) { 96 | return null; 97 | } 98 | 99 | private void updatePenMode() { 100 | Log.d(TAG, "refreshPenMode: " + mIsPenModeEnabled); 101 | TfWrapper.setTouchFeature(new TfWrapper.TfParams(20, mIsPenModeEnabled ? 18 : 2)); 102 | } 103 | 104 | private void updateHardwareOverlaysSetting() { 105 | if (mSurfaceFlinger == null) return; 106 | try { 107 | final Parcel data = Parcel.obtain(); 108 | data.writeInterfaceToken(SURFACE_COMPOSER_INTERFACE_KEY); 109 | data.writeInt(mIsPenModeEnabled ? 1 : 0); 110 | mSurfaceFlinger.transact(SURFACE_FLINGER_DISABLE_OVERLAYS_CODE, data, null, 0); 111 | data.recycle(); 112 | } catch (RemoteException ex) { } 113 | } 114 | 115 | private void updateRefreshRateSetting() { 116 | if (mIsPenModeEnabled) { 117 | mDefaultMinRate = Settings.System.getFloat(getContentResolver(), KEY_MIN_REFRESH_RATE, 30f); 118 | mDefaultPeakRate = Settings.System.getFloat(getContentResolver(), KEY_PEAK_REFRESH_RATE, 144f); 119 | Settings.System.putFloat(getContentResolver(), KEY_MIN_REFRESH_RATE, 120f); 120 | Settings.System.putFloat(getContentResolver(), KEY_PEAK_REFRESH_RATE, 120f); 121 | } else { 122 | Settings.System.putFloat(getContentResolver(), KEY_MIN_REFRESH_RATE, mDefaultMinRate); 123 | Settings.System.putFloat(getContentResolver(), KEY_PEAK_REFRESH_RATE, mDefaultPeakRate); 124 | } 125 | 126 | } 127 | 128 | private void refreshPenMode() { 129 | if (mIsPenModeForced) { 130 | if (DEBUG) Log.d(TAG, "refreshPenMode: Pen Mode forced"); 131 | if (!mIsPenModeEnabled) { 132 | mIsPenModeEnabled = true; 133 | updatePenMode(); 134 | updateHardwareOverlaysSetting(); 135 | updateRefreshRateSetting(); 136 | } 137 | return; 138 | } 139 | for (int id : mInputManager.getInputDeviceIds()) { 140 | if (isDeviceXiaomiPen(id)) { 141 | if (DEBUG) Log.d(TAG, "refreshPenMode: Found Xiaomi Pen"); 142 | if (!mIsPenModeEnabled && !mIsPenCharging) { 143 | mIsPenModeEnabled = true; 144 | updatePenMode(); 145 | updateHardwareOverlaysSetting(); 146 | updateRefreshRateSetting(); 147 | } 148 | if (!mIsPenCharging) return; 149 | } 150 | } 151 | if (DEBUG && !mIsPenCharging) Log.d(TAG, "refreshPenMode: No Xiaomi Pen found"); 152 | if (DEBUG && mIsPenCharging) Log.d(TAG, "refreshPenMode: Xiaomi Pen is charging, dont enable pen mode"); 153 | if (mIsPenModeEnabled) { 154 | mIsPenModeEnabled = false; 155 | updatePenMode(); 156 | updateHardwareOverlaysSetting(); 157 | updateRefreshRateSetting(); 158 | } 159 | } 160 | 161 | private boolean isDeviceXiaomiPen(int id) { 162 | InputDevice inputDevice = mInputManager.getInputDevice(id); 163 | return inputDevice.getVendorId() == 6421 && inputDevice.getProductId() == 19841; 164 | } 165 | 166 | private InputDeviceListener mInputDeviceListener = new InputDeviceListener() { 167 | @Override 168 | public void onInputDeviceAdded(int id) { 169 | refreshPenMode(); 170 | } 171 | @Override 172 | public void onInputDeviceRemoved(int id) { 173 | refreshPenMode(); 174 | } 175 | @Override 176 | public void onInputDeviceChanged(int id) { 177 | refreshPenMode(); 178 | } 179 | }; 180 | 181 | private OnSharedPreferenceChangeListener mSharedPrefsListener = new OnSharedPreferenceChangeListener() { 182 | public void onSharedPreferenceChanged(SharedPreferences prefs, String key) { 183 | if (DEBUG) Log.d(TAG, "onSharedPreferenceChanged: " + key); 184 | if (key.equals(STYLUS_KEY)) { 185 | mIsPenModeForced = prefs.getBoolean(STYLUS_KEY, false); 186 | refreshPenMode(); 187 | } 188 | } 189 | }; 190 | 191 | private final UEventObserver mUEventObserver = new UEventObserver() { 192 | @Override 193 | public void onUEvent(UEventObserver.UEvent event) { 194 | Log.d(TAG, "UEvent received: " + event.toString()); 195 | String chgModeString = event.get("POWER_SUPPLY_REVERSE_CHG_MODE"); 196 | if (chgModeString == null) return; 197 | boolean chgModeBoolean = Integer.parseInt(chgModeString) == 1; 198 | if (mIsPenCharging == chgModeBoolean) return; 199 | mIsPenCharging = chgModeBoolean; 200 | if (mIsPenCharging) { 201 | new Handler(Looper.getMainLooper()).post(new Runnable() { 202 | public void run() { 203 | Toast.makeText(getApplicationContext(), 204 | getApplicationContext().getString(R.string.stylus_charging_toast, 205 | event.get("POWER_SUPPLY_REVERSE_PEN_SOC")), 206 | Toast.LENGTH_SHORT).show(); 207 | } 208 | }); 209 | } 210 | refreshPenMode(); 211 | } 212 | }; 213 | } 214 | -------------------------------------------------------------------------------- /device.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2023 Paranoid Android 3 | # 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | 7 | # Enforce generic ramdisk allow list 8 | $(call inherit-product, $(SRC_TARGET_DIR)/product/generic_ramdisk.mk) 9 | 10 | # Enable project quotas and casefolding for emulated storage without sdcardfs 11 | $(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk) 12 | 13 | # Enable updating of APEXes 14 | $(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk) 15 | 16 | # Setup dalvik vm configs 17 | $(call inherit-product, frameworks/native/build/phone-xhdpi-6144-dalvik-heap.mk) 18 | 19 | # Get non-open-source specific aspects 20 | $(call inherit-product, vendor/xiaomi/liuqin/liuqin-vendor.mk) 21 | 22 | # Soong namespaces 23 | PRODUCT_SOONG_NAMESPACES += \ 24 | $(LOCAL_PATH) \ 25 | hardware/xiaomi 26 | 27 | # AAPT 28 | # Device uses high-density artwork where available 29 | PRODUCT_AAPT_CONFIG := normal 30 | PRODUCT_AAPT_PREF_CONFIG := xxxhdpi 31 | PRODUCT_AAPT_PREBUILT_DPI := xxxhdpi xxhdpi xhdpi hdpi 32 | 33 | # A/B 34 | $(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota/launch_with_vendor_ramdisk.mk) 35 | 36 | AB_OTA_POSTINSTALL_CONFIG += \ 37 | RUN_POSTINSTALL_system=true \ 38 | POSTINSTALL_PATH_system=system/bin/otapreopt_script \ 39 | FILESYSTEM_TYPE_system=erofs \ 40 | POSTINSTALL_OPTIONAL_system=true 41 | 42 | AB_OTA_POSTINSTALL_CONFIG += \ 43 | RUN_POSTINSTALL_vendor=true \ 44 | POSTINSTALL_PATH_vendor=bin/checkpoint_gc \ 45 | FILESYSTEM_TYPE_vendor=erofs \ 46 | POSTINSTALL_OPTIONAL_vendor=true 47 | 48 | PRODUCT_PACKAGES += \ 49 | checkpoint_gc \ 50 | otapreopt_script 51 | 52 | # Board 53 | TARGET_BOARD_PLATFORM := taro 54 | 55 | # NDK 56 | NEED_AIDL_NDK_PLATFORM_BACKEND := true 57 | 58 | # Partitions 59 | PRODUCT_USE_DYNAMIC_PARTITIONS := true 60 | 61 | # QTI components 62 | TARGET_COMMON_QTI_COMPONENTS := \ 63 | adreno \ 64 | audio \ 65 | av \ 66 | bt \ 67 | charging \ 68 | display \ 69 | init \ 70 | media \ 71 | overlay \ 72 | perf \ 73 | usb \ 74 | wfd \ 75 | wlan 76 | 77 | TARGET_USE_AIDL_QTI_HEALTH := true 78 | 79 | # Shipping API level 80 | BOARD_SHIPPING_API_LEVEL := 31 81 | PRODUCT_SHIPPING_API_LEVEL := 31 82 | 83 | # Atrace 84 | PRODUCT_PACKAGES += \ 85 | android.hardware.atrace@1.0-service 86 | 87 | # Audio 88 | PRODUCT_COPY_FILES += \ 89 | $(LOCAL_PATH)/configs/audio/audio_effects.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/sku_cape/audio_effects.xml \ 90 | $(LOCAL_PATH)/configs/audio/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/sku_cape/audio_policy_configuration.xml \ 91 | $(LOCAL_PATH)/configs/audio/media_codecs_dolby_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_dolby_audio.xml 92 | 93 | # Boot control 94 | PRODUCT_PACKAGES += \ 95 | android.hardware.boot-service.qti \ 96 | android.hardware.boot-service.qti.recovery \ 97 | 98 | # Camera 99 | PRODUCT_COPY_FILES += \ 100 | frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \ 101 | frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \ 102 | frameworks/native/data/etc/android.hardware.camera.full.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.full.xml \ 103 | frameworks/native/data/etc/android.hardware.camera.raw.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.raw.xml 104 | 105 | # Characteristics 106 | PRODUCT_CHARACTERISTICS := tablet,nosdcard 107 | 108 | # Display 109 | TARGET_PANEL_DIMENSION_HAS_EXTRA_PRECISION := true 110 | TARGET_SDMCORE_HAS_IS_DISPLAY_HW_AVAILABLE_FUNC := false 111 | 112 | # Display Config 113 | PRODUCT_COPY_FILES += \ 114 | $(LOCAL_PATH)/configs/displayconfig/display_id_4630947141052476290.xml:$(TARGET_COPY_OUT_VENDOR)/etc/displayconfig/display_id_4630947141052476290.xml \ 115 | $(LOCAL_PATH)/configs/displayconfig/display_id_4630947200012256898.xml:$(TARGET_COPY_OUT_VENDOR)/etc/displayconfig/display_id_4630947200012256898.xml 116 | 117 | # Dolby 118 | PRODUCT_PACKAGES += \ 119 | XiaomiDolby 120 | 121 | # DRM 122 | PRODUCT_PACKAGES += \ 123 | android.hardware.drm-service.clearkey 124 | 125 | # Fastbootd 126 | PRODUCT_PACKAGES += \ 127 | android.hardware.fastboot-service.example_recovery \ 128 | fastbootd 129 | 130 | # Fingerprint 131 | PRODUCT_COPY_FILES += \ 132 | frameworks/native/data/etc/android.hardware.fingerprint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.fingerprint.xml 133 | 134 | PRODUCT_PACKAGES += \ 135 | android.hardware.biometrics.fingerprint-service.xiaomi 136 | 137 | # Health 138 | PRODUCT_PACKAGES += \ 139 | android.hardware.health-service.xiaomi \ 140 | android.hardware.health-service.xiaomi_recovery 141 | 142 | # Init 143 | PRODUCT_COPY_FILES += \ 144 | $(LOCAL_PATH)/init/fstab.qcom:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/first_stage_ramdisk/fstab.qcom 145 | 146 | PRODUCT_PACKAGES += \ 147 | fstab.qcom \ 148 | init.target.rc \ 149 | init.mi_perf.rc \ 150 | init.mi_service.rc \ 151 | ueventd.xiaomi.rc 152 | 153 | # Input Device Configuration 154 | PRODUCT_COPY_FILES += \ 155 | $(LOCAL_PATH)/configs/idc/Vendor_1915_Product_4d81.idc:$(TARGET_COPY_OUT_VENDOR)/usr/idc/Vendor_1915_Product_4d81.idc \ 156 | $(LOCAL_PATH)/configs/idc/Vendor_1915_Product_eaea.idc:$(TARGET_COPY_OUT_VENDOR)/usr/idc/Vendor_1915_Product_eaea.idc 157 | 158 | # Kernel Binary 159 | KERNEL_PREBUILT_DIR := device/xiaomi/liuqin-kernel 160 | 161 | # Keymaster 162 | PRODUCT_COPY_FILES += \ 163 | frameworks/native/data/etc/android.hardware.keystore.app_attest_key.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.keystore.app_attest_key.xml 164 | 165 | # Lineage Health 166 | PRODUCT_PACKAGES += \ 167 | vendor.lineage.health-service.default 168 | 169 | # Logging 170 | SPAMMY_LOG_TAGS := \ 171 | MiStcImpl \ 172 | SDM \ 173 | SDM-histogram \ 174 | SRE \ 175 | WifiHAL \ 176 | cnss-daemon \ 177 | libcitsensorservice@2.0-impl \ 178 | libsensor-displayalgo \ 179 | libsensor-parseRGB \ 180 | libsensor-ssccalapi \ 181 | sensors \ 182 | vendor.qti.hardware.display.composer-service \ 183 | vendor.xiaomi.sensor.citsensorservice@2.0-service 184 | 185 | ifneq ($(TARGET_BUILD_VARIANT),eng) 186 | PRODUCT_VENDOR_PROPERTIES += \ 187 | $(foreach tag,$(SPAMMY_LOG_TAGS),log.tag.$(tag)=E) 188 | endif 189 | 190 | # Mlipay 191 | PRODUCT_PACKAGES += \ 192 | IFAAService 193 | 194 | # Overlays 195 | PRODUCT_PACKAGES += \ 196 | LiuqinFrameworks \ 197 | LiuqinFrameworksAOSPA \ 198 | LiuqinLauncher3 \ 199 | LiuqinSettings \ 200 | LiuqinSettingsProvider \ 201 | LiuqinSetupWizardAOSPA \ 202 | LiuqinSystemUI \ 203 | LiuqinSystemUIAOSPA 204 | 205 | # Parts 206 | PRODUCT_PACKAGES += \ 207 | XiaomiParts 208 | 209 | # Sensors 210 | PRODUCT_COPY_FILES += \ 211 | frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \ 212 | frameworks/native/data/etc/android.hardware.sensor.compass.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.compass.xml \ 213 | frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope.xml \ 214 | frameworks/native/data/etc/android.hardware.sensor.light.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.light.xml \ 215 | frameworks/native/data/etc/android.hardware.sensor.proximity.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.proximity.xml \ 216 | frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepcounter.xml \ 217 | frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepdetector.xml 218 | 219 | PRODUCT_PACKAGES += \ 220 | android.hardware.sensors-service.xiaomi-multihal \ 221 | libsensorndkbridge 222 | 223 | # Setup Wizard 224 | PRODUCT_PRODUCT_PROPERTIES += \ 225 | ro.setupwizard.rotation_locked=false 226 | 227 | # Tablet 228 | PRODUCT_COPY_FILES += \ 229 | frameworks/native/data/etc/android.software.freeform_window_management.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.freeform_window_management.xml \ 230 | frameworks/native/data/etc/tablet_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/tablet_core_hardware.xml 231 | 232 | PRODUCT_PACKAGES += \ 233 | RemoveTelephonyPackages 234 | 235 | $(call inherit-product, $(SRC_TARGET_DIR)/product/window_extensions.mk) 236 | 237 | # Thermal 238 | PRODUCT_PACKAGES += \ 239 | android.hardware.thermal-service.qti 240 | 241 | # Update Engine 242 | PRODUCT_PACKAGES += \ 243 | update_engine \ 244 | update_engine_sideload \ 245 | update_verifier 246 | 247 | # Verified Boot 248 | PRODUCT_COPY_FILES += \ 249 | frameworks/native/data/etc/android.software.verified_boot.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.verified_boot.xml 250 | 251 | # VNDK 252 | PRODUCT_COPY_FILES += \ 253 | prebuilts/vndk/v33/arm64/arch-arm64-armv8-a/shared/vndk-core/libstagefright_foundation.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libstagefright_foundation-v33.so 254 | 255 | # WiFi 256 | PRODUCT_PACKAGES += \ 257 | firmware_WCNSS_qcom_cfg.ini_symlink \ 258 | firmware_wlan_mac.bin_symlink 259 | 260 | PRODUCT_COPY_FILES += \ 261 | $(LOCAL_PATH)/configs/wifi/WCNSS_qcom_cfg.ini:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/qca6490/WCNSS_qcom_cfg.ini \ 262 | frameworks/native/data/etc/android.hardware.wifi.passpoint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.passpoint.xml 263 | -------------------------------------------------------------------------------- /configs/audio/audio_effects.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /overlay/Frameworks/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | 6 | 8 | true 9 | 10 | 11 | true 12 | 13 | 16 | true 17 | 18 | 19 | true 20 | 21 | 23 | false 24 | 25 | 27 | 100.0% 28 | 29 | 32 | 0.074743524 33 | 34 | 38 | 0.001709819 39 | 40 | 44 | 1.0 45 | 46 | 58 | 59 | 5 60 | 5 61 | 5 62 | 5 63 | 15 64 | 24 65 | 37 66 | 47 67 | 61 68 | 76 69 | 83 70 | 83 71 | 83 72 | 87 73 | 93 74 | 107 75 | 117 76 | 124 77 | 133 78 | 166 79 | 182 80 | 270 81 | 315 82 | 373 83 | 442 84 | 455 85 | 500 86 | 87 | 88 | 93 | 94 | 3 95 | 3 96 | 3 97 | 3 98 | 8 99 | 13 100 | 20 101 | 25 102 | 33 103 | 41 104 | 45 105 | 45 106 | 45 107 | 47 108 | 50 109 | 58 110 | 63 111 | 67 112 | 72 113 | 90 114 | 99 115 | 150 116 | 175 117 | 208 118 | 248 119 | 255 120 | 121 | 122 | 142 | 143 | 1 144 | 2 145 | 4 146 | 5 147 | 8 148 | 13 149 | 17 150 | 21 151 | 26 152 | 30 153 | 34 154 | 39 155 | 60 156 | 140 157 | 310 158 | 400 159 | 500 160 | 600 161 | 1000 162 | 1200 163 | 1500 164 | 2100 165 | 3000 166 | 3500 167 | 4000 168 | 169 | 170 | 174 | 175 | @null 176 | 1 177 | 10 178 | 15 179 | 30 180 | 45 181 | 60 182 | 75 183 | 90 184 | 105 185 | 120 186 | 135 187 | 150 188 | 165 189 | 180 190 | 195 191 | 210 192 | 225 193 | 240 194 | 255 195 | 196 | 197 | 204 | 205 | @null 206 | 4 207 | 22 208 | 30 209 | 68 210 | 95 211 | 133 212 | 165 213 | 192 214 | 218 215 | 255 216 | 290 217 | 326 218 | 352 219 | 384 220 | 399 221 | 422 222 | 432 223 | 442 224 | 455 225 | 500 226 | 227 | 228 | 239 | 240 | 2 241 | 10 242 | 30 243 | 100 244 | 800 245 | 2000 246 | 4000 247 | 248 | 249 | 255 | 256 | 2 257 | 5 258 | 10 259 | 30 260 | 100 261 | 400 262 | 600 263 | 1000 264 | 265 | 266 | 272 | 273 | 800 274 | 800 275 | 800 276 | 800 277 | 800 278 | 500 279 | 500 280 | 500 281 | 282 | 283 | 289 | 290 | 0 291 | 292 | 293 | 299 | 300 | 0 301 | 302 | 303 | 314 | 315 | 316 | 317 | 322 | 2000 323 | 4000 324 | 325 | 328 | false 329 | 330 | 334 | 144 335 | 336 | 344 | 0 345 | 346 | 347 | 348 | 0 349 | 1 350 | 3 351 | 352 | 353 | 356 | 2 357 | 358 | 369 | 370 | 0 371 | 1 372 | 2 373 | 3 374 | 375 | 376 | 0 377 | 0 378 | 0 379 | 9 380 | 381 | 382 | 400 | true 401 | 402 | 419 | true 420 | 421 | 429 | 7 430 | 431 | 439 | false 440 | 441 | 452 | false 453 | 454 | 458 | false 459 | 460 | 461 | false 462 | 463 | 466 | true 467 | 468 | 473 | 0 474 | 475 | 476 | false 477 | 478 | 480 | false 481 | 482 | 486 | false 487 | 488 | -------------------------------------------------------------------------------- /configs/vintf/manifest_cape.xml: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | 31 | 32 | vendor.qti.hardware.capabilityconfigstore 33 | hwbinder 34 | 1.0 35 | 36 | ICapabilityConfigStore 37 | default 38 | 39 | 40 | 41 | android.hardware.audio 42 | hwbinder 43 | 7.0 44 | 45 | IDevicesFactory 46 | default 47 | 48 | 49 | 50 | android.hardware.audio.effect 51 | hwbinder 52 | 7.0 53 | 54 | IEffectsFactory 55 | default 56 | 57 | 58 | 74 | 75 | 76 | vendor.qti.hardware.dsp 77 | hwbinder 78 | 1.0 79 | 80 | IDspService 81 | dspservice 82 | 83 | 84 | 85 | 86 | vendor.qti.hardware.wifidisplaysession 87 | hwbinder 88 | 1.0 89 | 90 | IWifiDisplaySession 91 | wifidisplaysession 92 | 93 | 94 | IWifiDisplaySessionVideoTrack 95 | wifidisplaysessionvideotrack 96 | 97 | 98 | IWifiDisplaySessionAudioTrack 99 | wifidisplaysessionaudiotrack 100 | 101 | 102 | IWifiDisplaySessionImageTrack 103 | wifidisplaysessionimagetrack 104 | 105 | 106 | 107 | 118 | 119 | android.hardware.keymaster 120 | hwbinder 121 | @4.1::IKeymasterDevice/default 122 | 123 | 124 | 125 | android.hardware.gatekeeper 126 | hwbinder 127 | 128 | 1.0 129 | 130 | IGatekeeper 131 | default 132 | 133 | 134 | 135 | 146 | 157 | 158 | 171 | 172 | 183 | 184 | 185 | vendor.qti.hardware.qseecom 186 | hwbinder 187 | 1.0 188 | 189 | IQSEECom 190 | default 191 | 192 | 193 | 194 | 195 | vendor.qti.hardware.qteeconnector 196 | hwbinder 197 | 1.0 198 | 199 | IAppConnector 200 | default 201 | 202 | 203 | IGPAppConnector 204 | default 205 | 206 | 207 | 208 | android.hardware.drm 209 | hwbinder 210 | @1.3::ICryptoFactory/wfdhdcp 211 | @1.3::IDrmFactory/wfdhdcp 212 | 213 | 214 | 215 | vendor.qti.hardware.sensorscalibrate 216 | hwbinder 217 | 1.0 218 | 219 | ISensorsCalibrate 220 | default 221 | 222 | 223 | 224 | 234 | 235 | 246 | 247 | 248 | 260 | 261 | 262 | 263 | com.qualcomm.qti.dpm.api 264 | hwbinder 265 | 1.0 266 | 267 | IdpmQmi 268 | dpmQmiService 269 | 270 | 271 | 272 | 273 | 285 | 286 | 287 | 299 | 300 | 301 | 313 | 314 | 315 | 327 | 328 | 329 | 341 | 342 | 354 | 355 | 356 | 367 | 368 | 369 | 380 | 381 | 393 | 394 | 405 | 406 | 417 | 418 | 429 | 441 | 452 | 453 | 454 | android.hardware.tetheroffload.config 455 | hwbinder 456 | 1.0 457 | 458 | IOffloadConfig 459 | default 460 | 461 | 462 | 463 | 464 | android.hardware.tetheroffload.control 465 | hwbinder 466 | 1.1 467 | 468 | IOffloadControl 469 | default 470 | 471 | 472 | 484 | 485 | 486 | vendor.qti.hardware.data.latency 487 | hwbinder 488 | 1.0 489 | 490 | ILinkLatency 491 | default 492 | 493 | 494 | 506 | 507 | vendor.qti.hardware.cacert 508 | hwbinder 509 | 1.0 510 | 511 | IService 512 | default 513 | 514 | 515 | 516 | 517 | vendor.qti.hardware.factory 518 | hwbinder 519 | 1.1 520 | 521 | IFactory 522 | default 523 | 524 | 525 | 526 | 537 | 538 | 549 | 550 | 551 | android.hardware.bluetooth 552 | hwbinder 553 | 1.0 554 | 555 | IBluetoothHci 556 | default 557 | 558 | 559 | 560 | android.hardware.bluetooth.audio 561 | hwbinder 562 | 2.1 563 | 564 | IBluetoothAudioProvidersFactory 565 | default 566 | 567 | 568 | 569 | vendor.qti.hardware.bluetooth_audio 570 | hwbinder 571 | 2.1 572 | 573 | IBluetoothAudioProvidersFactory 574 | default 575 | 576 | 577 | 578 | vendor.qti.hardware.btconfigstore 579 | hwbinder 580 | 2.0 581 | 582 | IBTConfigStore 583 | default 584 | 585 | 586 | 587 | 588 | vendor.qti.hardware.fm 589 | hwbinder 590 | 1.0 591 | 592 | IFmHci 593 | default 594 | 595 | 596 | 597 | 598 | com.dsi.ant 599 | hwbinder 600 | 1.0 601 | 602 | IAnt 603 | default 604 | 605 | 606 | 607 | 608 | 609 | vendor.qti.hardware.tui_comm 610 | hwbinder 611 | 1.0 612 | 613 | ITuiComm 614 | default 615 | 616 | 617 | 618 | 619 | 620 | vendor.qti.hardware.soter 621 | hwbinder 622 | 1.0 623 | 624 | ISoter 625 | default 626 | 627 | 628 | 629 | 640 | 641 | 652 | 653 | 654 | 655 | vendor.qti.hardware.camera.postproc 656 | hwbinder 657 | 1.0 658 | 659 | IPostProcService 660 | camerapostprocservice 661 | 662 | 663 | 664 | 665 | 666 | vendor.qti.hardware.camera.aon 667 | hwbinder 668 | 1.0 669 | 670 | IAONService 671 | aoncameraservice 672 | 673 | 674 | 675 | 676 | android.hardware.camera.provider 677 | hwbinder 678 | 2.7 679 | 680 | ICameraProvider 681 | legacy/1 682 | 683 | 684 | 685 | 686 | 687 | vendor.qti.hardware.wifi.wifilearner 688 | hwbinder 689 | 1.0 690 | 691 | IWifiStats 692 | wifiStats 693 | 694 | 695 | 696 | 707 | 708 | 709 | vendor.qti.hardware.trustedui 710 | hwbinder 711 | @1.2::ITrustedUI/default 712 | @1.2::ITrustedUI/qtee-vm 713 | @1.1::ITrustedInput/default 714 | @1.1::ITrustedInput/qtee-vm 715 | 716 | 717 | 718 | vendor.qti.hardware.bluetooth_sar 719 | hwbinder 720 | 1.1 721 | 722 | IBluetoothSar 723 | default 724 | 725 | 726 | 727 | 728 | vendor.qti.hardware.AGMIPC 729 | hwbinder 730 | 1.0 731 | 732 | IAGM 733 | default 734 | 735 | 736 | 737 | 738 | vendor.qti.hardware.pal 739 | hwbinder 740 | 1.0 741 | 742 | IPAL 743 | default 744 | 745 | @1.0::IPAL/default 746 | 747 | 748 | 759 | 770 | 771 | 772 | vendor.qti.hardware.qccvndhal 773 | hwbinder 774 | 1.0 775 | 776 | IQccvndhal 777 | qccvndhal 778 | 779 | 780 | 781 | 782 | vendor.qti.hardware.embmssl 783 | hwbinder 784 | 1.1 785 | 786 | IEmbms 787 | embmsslServer0 788 | 789 | 790 | 791 | 792 | vendor.qti.hardware.dpmservice 793 | hwbinder 794 | 1.1 795 | 796 | IDpmService 797 | DpmService 798 | 799 | 800 | 801 | 802 | vendor.qti.qesdhal 803 | hwbinder 804 | 1.1 805 | 806 | IQesdhal 807 | default 808 | 809 | 810 | 811 | 812 | vendor.qti.hardware.mwqemadapter 813 | hwbinder 814 | 1.0 815 | 816 | IMwqemAdapter 817 | MwqemAdapter 818 | 819 | 820 | 821 | -------------------------------------------------------------------------------- /configs/audio/audio_policy_configuration.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 48 | 49 | 50 | 51 | 52 | Earpiece 53 | Speaker 54 | Telephony Tx 55 | Built-In Mic 56 | Built-In Back Mic 57 | FM Tuner 58 | Telephony Rx 59 | 60 | Speaker 61 | 62 | 63 | 65 | 66 | 67 | 69 | 70 | 71 | 73 | 74 | 76 | 78 | 79 | 80 | 82 | 83 | 84 | 86 | 87 | 89 | 92 | 95 | 98 | 101 | 102 | 104 | 107 | 110 | 113 | 116 | 119 | 122 | 125 | 128 | 131 | 134 | 137 | 140 | 143 | 146 | 147 | 148 | 150 | 151 | 153 | 155 | 156 | 158 | 161 | 162 | 163 | 164 | 167 | 168 | 170 | 173 | 174 | 175 | 178 | 179 | 181 | 183 | 184 | 185 | 188 | 191 | 192 | 193 | 196 | 199 | 200 | 201 | 203 | 204 | 205 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 217 | 218 | 219 | 221 | 222 | 223 | 225 | 226 | 227 | 229 | 230 | 231 | 233 | 234 | 235 | 237 | 238 | 239 | 241 | 242 | 243 | 245 | 246 | 247 | 249 | 250 | 251 | 253 | 254 | 255 | 257 | 258 | 259 | 261 | 262 | 264 | 266 | 267 | 269 | 271 | 272 | 274 | 276 | 277 | 278 | 280 | 281 | 282 | 284 | 285 | 286 | 287 | 288 | 291 | 292 | 293 | 296 | 297 | 298 | 301 | 302 | 303 | 306 | 307 | 308 | 310 | 311 | 312 | 314 | 315 | 316 | 317 | 318 | 319 | 321 | 323 | 324 | 325 | 326 | 327 | 329 | 331 | 333 | 335 | 337 | 339 | 341 | 343 | 345 | 347 | 349 | 351 | 353 | 355 | 357 | 359 | 361 | 363 | 365 | 367 | 369 | 371 | 373 | 375 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 390 | 391 | 392 | 393 | 394 | 396 | 397 | 398 | 399 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | --------------------------------------------------------------------------------