├── sepolicy ├── vendor │ ├── vdc.te │ ├── toolbox.te │ ├── vndservicemanager.te │ ├── agmservice_qti.te │ ├── hal_ir_default.te │ ├── vendor_qcc_trd.te │ ├── hal_health_default.te │ ├── hal_vibrator_default.te │ ├── hal_bootctl_default.te │ ├── attributes │ ├── vendor_subsystem_ramdump.te │ ├── fsck.te │ ├── hal_display_config.te │ ├── app.te │ ├── init.te │ ├── bootanim.te │ ├── hal_bluetooth_default.te │ ├── device.te │ ├── audioadsprpcd.te │ ├── rild.te │ ├── hal_light_default.te │ ├── hal_secure_element_default.te │ ├── surfaceflinger.te │ ├── hal_nfc_default.te │ ├── vendor_modprobe.te │ ├── vndservice_contexts │ ├── system_server.te │ ├── audioserver.te │ ├── stflashtool.te │ ├── hal_sensors_default.te │ ├── system_app.te │ ├── tee.te │ ├── hal_power_default.te │ ├── vendor_qti_init_shell.te │ ├── hal_camera_default.te │ ├── vendor_goodix_events.te │ ├── property.te │ ├── vendor_hal_perf_default.te │ ├── hal_graphics_composer_default.te │ ├── file.te │ ├── hal_audio_default.te │ ├── vendor_init.te │ ├── hal_perf_default.te │ ├── vendor_wcnss_service.te │ ├── hwservice_contexts │ ├── hal_mlipay_default.te │ ├── mi_thermald.te │ ├── batterysecret.te │ ├── hal_micharge_default.te │ ├── hal_mtdservice.te │ ├── genfs_contexts │ ├── file_contexts │ ├── property_contexts │ ├── hal_fingerprint_default.te │ └── hal_displayfeature_xiaomi.te └── private │ ├── system_server.te │ ├── system_suspend.te │ └── property_contexts ├── configs ├── properties │ ├── odm.prop │ ├── system_ext.prop │ ├── product.prop │ └── system.prop ├── wifi │ ├── p2p_supplicant_overlay.conf │ └── wpa_supplicant_overlay.conf ├── idc │ ├── uinput-fpc.idc │ └── uinput-goodix.idc ├── perf │ └── msm_irqbalance.conf ├── keylayout │ ├── uinput-goodix.kl │ ├── uinput-fpc.kl │ └── gpio-keys.kl ├── permissions │ └── privapp-permissions-hotword.xml ├── media │ └── media_codecs_vendor_audio.xml ├── vintf │ ├── compatibility_matrix.xml │ └── network_manifest.xml ├── config.fs └── audio │ └── default_volume_tables.xml ├── ril ├── ims.apk ├── QtiTelephony.apk └── Android.bp ├── Android.bp ├── overlay ├── SettingsOverlayM7G │ ├── Android.bp │ ├── res │ │ └── drawable │ │ │ └── regulatory_info.png │ └── AndroidManifest.xml ├── SettingsOverlayM7L │ ├── Android.bp │ ├── res │ │ └── drawable │ │ │ └── regulatory_info.png │ └── AndroidManifest.xml ├── SettingsOverlayM7N │ ├── Android.bp │ ├── res │ │ └── drawable │ │ │ └── regulatory_info.png │ └── AndroidManifest.xml ├── SettingsOverlayM7IN │ ├── Android.bp │ ├── res │ │ └── drawable │ │ │ └── regulatory_info.png │ └── AndroidManifest.xml ├── WifiResTarget │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ │ └── values │ │ └── config.xml ├── FrameworksResTarget │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ │ └── values │ │ └── config.xml ├── SettingsResTopaz │ ├── Android.bp │ ├── res │ │ └── values │ │ │ ├── dimens.xml │ │ │ └── config.xml │ └── AndroidManifest.xml ├── WifiResCommon │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ │ └── values │ │ └── config.xml ├── SystemUIResCommon │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ │ └── values │ │ └── config.xml ├── SystemUIResTopaz │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ │ └── values │ │ ├── config.xml │ │ └── dimens.xml ├── TelecommResCommon │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ │ └── values │ │ └── config.xml ├── FrameworksResCommon │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ │ ├── values-mcc310-mnc120 │ │ └── config.xml │ │ ├── values-mcc310-mnc260 │ │ └── config.xml │ │ ├── values-mcc310-mnc4 │ │ └── config.xml │ │ ├── values-mcc310-mnc410 │ │ └── config.xml │ │ ├── values-mcc311-mnc480 │ │ └── config.xml │ │ ├── values-mcc234-mnc15 │ │ └── config.xml │ │ ├── values-mcc262-mnc2 │ │ └── config.xml │ │ ├── values-mcc262-mnc4 │ │ └── config.xml │ │ └── values-mcc262-mnc9 │ │ └── config.xml ├── FrameworksResTopaz │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ │ ├── values │ │ └── dimens.xml │ │ └── xml │ │ └── power_profile.xml ├── TelephonyResCommon │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ │ └── values │ │ └── config.xml └── CarrierConfigResCommon │ ├── Android.bp │ └── AndroidManifest.xml ├── rootdir ├── bin │ ├── init.goodix.events.sh │ ├── init.qti.write.sh │ ├── system_dlkm_modprobe.sh │ ├── init.qti.dcvs.sh │ ├── vendor_modprobe.sh │ ├── init.kernel.post_boot.sh │ ├── init.qti.kernel.sh │ ├── init.qti.early_init.sh │ ├── init.class_main.sh │ ├── init.qcom.early_boot.sh │ └── init.qcom.class_core.sh ├── etc │ ├── init.recovery.qcom.rc │ └── init.xiaomi.rc └── Android.bp ├── health ├── android.hardware.health-service.xiaomi_recovery.rc ├── android.hardware.health-service.xiaomi.xml ├── android.hardware.health-service.xiaomi.rc ├── Android.bp └── main.cpp ├── AndroidProducts.mk ├── init ├── Android.bp └── init_topaz.cpp ├── bootctrl └── Android.bp ├── overlay-lineage ├── packages │ └── apps │ │ └── Dialer │ │ └── java │ │ └── com │ │ └── android │ │ └── dialer │ │ └── callrecord │ │ └── res │ │ └── values │ │ └── config.xml └── lineage-sdk │ ├── packages │ └── LineageSettingsProvider │ │ └── res │ │ └── values │ │ └── defaults.xml │ └── lineage │ └── res │ └── res │ └── values │ └── config.xml ├── lineage_topaz.mk ├── setup-makefiles.sh ├── gpt-utils ├── Android.bp └── recovery-ufs-bsg.h ├── extract-files.sh ├── README.md └── power └── power-mode.cpp /sepolicy/vendor/vdc.te: -------------------------------------------------------------------------------- 1 | allow vdc self:capability kill; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/toolbox.te: -------------------------------------------------------------------------------- 1 | allow toolbox unlabeled:dir { getattr }; 2 | -------------------------------------------------------------------------------- /configs/properties/odm.prop: -------------------------------------------------------------------------------- 1 | # ODM Fwk-Detect 2 | ro.vendor.qti.va_odm.support=1 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/vndservicemanager.te: -------------------------------------------------------------------------------- 1 | binder_call(vndservicemanager vendor_cnd) 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/agmservice_qti.te: -------------------------------------------------------------------------------- 1 | allow vendor_agmservice_qti debugfs:dir r_dir_perms; 2 | -------------------------------------------------------------------------------- /ril/ims.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xiaomi-SD685-Devs/device_xiaomi_topaz/HEAD/ril/ims.apk -------------------------------------------------------------------------------- /sepolicy/private/system_server.te: -------------------------------------------------------------------------------- 1 | allow system_server system_file:file { open read getattr }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_ir_default.te: -------------------------------------------------------------------------------- 1 | allow hal_ir_default lirc_device:chr_file rw_file_perms; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_qcc_trd.te: -------------------------------------------------------------------------------- 1 | allow vendor_qcc_trd vendor_sysfs_microdump:dir { search }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_health_default.te: -------------------------------------------------------------------------------- 1 | allow hal_health_default sysfs:file { getattr open read }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_vibrator_default.te: -------------------------------------------------------------------------------- 1 | allow hal_vibrator_default sysfs:file { open read write }; 2 | -------------------------------------------------------------------------------- /ril/QtiTelephony.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xiaomi-SD685-Devs/device_xiaomi_topaz/HEAD/ril/QtiTelephony.apk -------------------------------------------------------------------------------- /sepolicy/vendor/hal_bootctl_default.te: -------------------------------------------------------------------------------- 1 | allow hal_bootctl_default vendor_uefi_block_device:blk_file getattr; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/attributes: -------------------------------------------------------------------------------- 1 | # Mlipay 2 | attribute hal_mlipay; 3 | attribute hal_mlipay_client; 4 | attribute hal_mlipay_server; 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_subsystem_ramdump.te: -------------------------------------------------------------------------------- 1 | allow vendor_subsystem_ramdump vendor_subsystem_ramdump:capability { net_admin }; 2 | -------------------------------------------------------------------------------- /Android.bp: -------------------------------------------------------------------------------- 1 | soong_namespace { 2 | imports: [ 3 | "hardware/qcom-caf/bootctrl", 4 | "hardware/xiaomi", 5 | ], 6 | } 7 | -------------------------------------------------------------------------------- /overlay/SettingsOverlayM7G/Android.bp: -------------------------------------------------------------------------------- 1 | runtime_resource_overlay { 2 | name: "SettingsOverlayM7G", 3 | product_specific: true, 4 | } 5 | -------------------------------------------------------------------------------- /overlay/SettingsOverlayM7L/Android.bp: -------------------------------------------------------------------------------- 1 | runtime_resource_overlay { 2 | name: "SettingsOverlayM7L", 3 | product_specific: true, 4 | } 5 | -------------------------------------------------------------------------------- /overlay/SettingsOverlayM7N/Android.bp: -------------------------------------------------------------------------------- 1 | runtime_resource_overlay { 2 | name: "SettingsOverlayM7N", 3 | product_specific: true, 4 | } 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/fsck.te: -------------------------------------------------------------------------------- 1 | allow fsck fsck:capability kill; 2 | allow fsck vendor_custom_ab_block_device:blk_file { read write open ioctl }; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_display_config.te: -------------------------------------------------------------------------------- 1 | allow vendor_hal_display_config_hwservice vendor_hal_displayfeature_xiaomi_default:binder transfer; 2 | -------------------------------------------------------------------------------- /overlay/SettingsOverlayM7IN/Android.bp: -------------------------------------------------------------------------------- 1 | runtime_resource_overlay { 2 | name: "SettingsOverlayM7IN", 3 | product_specific: true, 4 | } 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/app.te: -------------------------------------------------------------------------------- 1 | get_prop({ appdomain -isolated_app }, vendor_fp_prop) 2 | get_prop({ appdomain -isolated_app }, vendor_tee_listener_prop) 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/init.te: -------------------------------------------------------------------------------- 1 | allow init debugfs_tracing_debug:dir mounton; 2 | allow init proc:file { setattr }; 3 | allow init hal_fingerprint_default:process ptrace; 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/bootanim.te: -------------------------------------------------------------------------------- 1 | allow bootanim vendor_audio_prop:file read; 2 | allow bootanim vendor_proc_audiod:file read; 3 | 4 | binder_call(bootanim, vendor_hal_qspmhal_default) 5 | -------------------------------------------------------------------------------- /overlay/SettingsOverlayM7G/res/drawable/regulatory_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xiaomi-SD685-Devs/device_xiaomi_topaz/HEAD/overlay/SettingsOverlayM7G/res/drawable/regulatory_info.png -------------------------------------------------------------------------------- /overlay/SettingsOverlayM7IN/res/drawable/regulatory_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xiaomi-SD685-Devs/device_xiaomi_topaz/HEAD/overlay/SettingsOverlayM7IN/res/drawable/regulatory_info.png -------------------------------------------------------------------------------- /overlay/SettingsOverlayM7L/res/drawable/regulatory_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xiaomi-SD685-Devs/device_xiaomi_topaz/HEAD/overlay/SettingsOverlayM7L/res/drawable/regulatory_info.png -------------------------------------------------------------------------------- /overlay/SettingsOverlayM7N/res/drawable/regulatory_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xiaomi-SD685-Devs/device_xiaomi_topaz/HEAD/overlay/SettingsOverlayM7N/res/drawable/regulatory_info.png -------------------------------------------------------------------------------- /sepolicy/vendor/hal_bluetooth_default.te: -------------------------------------------------------------------------------- 1 | allow hal_bluetooth_default vendor_mac_vendor_data_file:dir search; 2 | allow hal_bluetooth_default vendor_mac_vendor_data_file:file { open read }; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/device.te: -------------------------------------------------------------------------------- 1 | type vendor_displayfeature_device, dev_type; 2 | type sound_device, dev_type, mlstrustedobject; 3 | type fingerprint_device, dev_type; 4 | type lirc_device, dev_type; 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/audioadsprpcd.te: -------------------------------------------------------------------------------- 1 | allow vendor_audioadsprpcd vendor_audio_data_file:dir search; 2 | allow vendor_audioadsprpcd vendor_audio_data_file:file { append create getattr open read setattr write }; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/rild.te: -------------------------------------------------------------------------------- 1 | set_prop(rild, vendor_deviceid_prop) 2 | set_prop(rild, vendor_sno_prop) 3 | allow rild vendor_data_file:dir create_dir_perms; 4 | allow rild vendor_data_file:file create_file_perms; 5 | -------------------------------------------------------------------------------- /overlay/WifiResTarget/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | runtime_resource_overlay { 8 | name: "WifiResTarget", 9 | vendor: true, 10 | } 11 | -------------------------------------------------------------------------------- /overlay/FrameworksResTarget/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | runtime_resource_overlay { 8 | name: "FrameworksResTarget", 9 | vendor: true, 10 | } 11 | -------------------------------------------------------------------------------- /overlay/SettingsResTopaz/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | runtime_resource_overlay { 8 | name: "SettingsResTopaz", 9 | product_specific: true, 10 | } -------------------------------------------------------------------------------- /overlay/WifiResCommon/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | runtime_resource_overlay { 8 | name: "WifiResCommon", 9 | product_specific: true, 10 | } 11 | -------------------------------------------------------------------------------- /overlay/SystemUIResCommon/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | runtime_resource_overlay { 8 | name: "SystemUIResCommon", 9 | product_specific: true, 10 | } 11 | -------------------------------------------------------------------------------- /overlay/SystemUIResTopaz/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | runtime_resource_overlay { 8 | name: "SystemUIResTopaz", 9 | device_specific: true, 10 | } 11 | -------------------------------------------------------------------------------- /overlay/TelecommResCommon/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | runtime_resource_overlay { 8 | name: "TelecommResCommon", 9 | product_specific: true, 10 | } 11 | -------------------------------------------------------------------------------- /configs/wifi/p2p_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | disable_scan_offload=1 2 | p2p_no_group_iface=1 3 | persistent_reconnect=1 4 | bss_max_count=400 5 | p2p_chan_list_dfs_disable=0 6 | p2p_chan_list_only_sta_dfs_enable=0 7 | p2p_pref_list_dfs_disable=0 8 | p2p_go_dfs_disable=0 9 | -------------------------------------------------------------------------------- /overlay/FrameworksResCommon/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | runtime_resource_overlay { 8 | name: "FrameworksResCommon", 9 | product_specific: true, 10 | } 11 | -------------------------------------------------------------------------------- /overlay/FrameworksResTopaz/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | runtime_resource_overlay { 8 | name: "FrameworksResTopaz", 9 | device_specific: true, 10 | } 11 | -------------------------------------------------------------------------------- /overlay/TelephonyResCommon/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | runtime_resource_overlay { 8 | name: "TelephonyResCommon", 9 | product_specific: true, 10 | } 11 | -------------------------------------------------------------------------------- /rootdir/bin/init.goodix.events.sh: -------------------------------------------------------------------------------- 1 | #! /vendor/bin/sh 2 | EVENT_NAME=$(tr "\n" " " < /proc/bus/input/devices | \ 3 | grep -o "uinput-goodix.*" | \ 4 | grep -Eo "event[0-9]+" | \ 5 | head -1) 6 | 7 | [ -z "$EVENT_NAME" ] && exit 8 | rm /dev/input/$EVENT_NAME 9 | 10 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_light_default.te: -------------------------------------------------------------------------------- 1 | allow hal_light_default vendor_displayfeature_device:chr_file { ioctl open read write }; 2 | allow hal_light_default vendor_sysfs_displayfeature:dir r_dir_perms; 3 | allow hal_light_default vendor_sysfs_displayfeature:file rw_file_perms; 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_secure_element_default.te: -------------------------------------------------------------------------------- 1 | allow hal_secure_element_default hal_mtdservice_hwservice:hwservice_manager find; 2 | allow hal_secure_element_default hal_mtdservice_default:binder { call transfer }; 3 | allow hal_secure_element_default hal_mtdservice_default:fd *; 4 | -------------------------------------------------------------------------------- /sepolicy/private/system_suspend.te: -------------------------------------------------------------------------------- 1 | allow system_suspend sysfs:dir { open read }; 2 | allow system_suspend sysfs:file { getattr }; 3 | allow system_suspend sysfs_net:dir { open read }; 4 | allow system_suspend sysfs_net:file { open read }; 5 | dontaudit system_suspend sysfs:file { open read }; 6 | -------------------------------------------------------------------------------- /overlay/CarrierConfigResCommon/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | runtime_resource_overlay { 8 | name: "CarrierConfigResCommon", 9 | aaptflags: ["--keep-raw-values"], 10 | product_specific: true, 11 | } 12 | -------------------------------------------------------------------------------- /health/android.hardware.health-service.xiaomi_recovery.rc: -------------------------------------------------------------------------------- 1 | service vendor.health-recovery /system/bin/hw/android.hardware.health-service.xiaomi_recovery 2 | class hal 3 | seclabel u:r:hal_health_default:s0 4 | user system 5 | group system 6 | capabilities WAKE_ALARM BLOCK_SUSPEND 7 | file /dev/kmsg w 8 | -------------------------------------------------------------------------------- /AndroidProducts.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2023 The LineageOS Project 3 | # 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | 7 | PRODUCT_MAKEFILES := \ 8 | $(LOCAL_DIR)/lineage_topaz.mk 9 | 10 | COMMON_LUNCH_CHOICES := \ 11 | lineage_topaz-user \ 12 | lineage_topaz-userdebug \ 13 | lineage_topaz-eng 14 | -------------------------------------------------------------------------------- /sepolicy/vendor/surfaceflinger.te: -------------------------------------------------------------------------------- 1 | allow surfaceflinger vendor_sysfs_displayfeature:dir r_dir_perms; 2 | allow surfaceflinger vendor_sysfs_displayfeature:file rw_file_perms; 3 | allow surfaceflinger vendor_displayfeature_device:chr_file { ioctl open read write }; 4 | allow surfaceflinger vendor_sysfs_graphics:dir { open read search }; 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_nfc_default.te: -------------------------------------------------------------------------------- 1 | allow hal_nfc_default vendor_nfc_vendor_data_file:dir create_dir_perms; 2 | allow hal_nfc_default vendor_data_file:dir rw_dir_perms; 3 | allow hal_nfc_default vendor_data_file:file { create rw_file_perms }; 4 | 5 | get_prop(hal_nfc_default, vendor_nfc_prop) 6 | set_prop(hal_nfc_default, vendor_nfc_prop) 7 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_modprobe.te: -------------------------------------------------------------------------------- 1 | allow vendor_modprobe block_device:dir search; 2 | allow vendor_modprobe self:capability sys_module; 3 | allow vendor_modprobe self:cap_userns sys_module; 4 | allow vendor_modprobe vendor_file:system module_load; 5 | allow vendor_modprobe vendor_modprobe:key { write }; 6 | 7 | r_dir_file(vendor_modprobe, vendor_file) 8 | -------------------------------------------------------------------------------- /sepolicy/vendor/vndservice_contexts: -------------------------------------------------------------------------------- 1 | display.mistcservice u:object_r:vendor_mistcdisplay_service:s0 2 | DisplayFeatureControl u:object_r:vendor_DisplayFeatureControl_service:s0 3 | 4 | # Fingerprint 5 | FocalFingerprintService u:object_r:fingerprint_vndservice:s0 6 | -------------------------------------------------------------------------------- /overlay/SettingsResTopaz/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 100% 9 | -------------------------------------------------------------------------------- /init/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 The LineageOS Project 3 | // SPDX-License-Identifier: Apache-2.0 4 | // 5 | 6 | cc_library_static { 7 | name: "init_topaz", 8 | recovery_available: true, 9 | shared_libs: ["libbase"], 10 | srcs: ["init_topaz.cpp"], 11 | include_dirs: [ 12 | "system/core/init", 13 | "system/libbase/include" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /bootctrl/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2022 The Android Open Source Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | cc_library_shared { 8 | name: "android.hardware.boot@1.2-impl-qti", 9 | stem: "android.hardware.boot@1.0-impl-1.2-qti", 10 | defaults: ["android.hardware.boot@1.2-impl-qti_defaults"], 11 | static_libs: ["libgptutils.bengal"], 12 | } 13 | -------------------------------------------------------------------------------- /overlay-lineage/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | true 8 | 4 9 | 10 | -------------------------------------------------------------------------------- /sepolicy/vendor/system_server.te: -------------------------------------------------------------------------------- 1 | # Displayfeature 2 | allow system_server vendor_hal_displayfeature_xiaomi_default:binder { call transfer }; 3 | 4 | # Micharge 5 | allow system_server vendor_hal_micharge_xiaomi_default:binder { call transfer }; 6 | 7 | # OEM Fastcharge 8 | allow system_server sysfs_wakeup:file r_file_perms; 9 | allow system_server vendor_sysfs_battery_supply:file r_file_perms; 10 | -------------------------------------------------------------------------------- /configs/wifi/wpa_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | disable_scan_offload=1 2 | p2p_disabled=1 3 | tdls_external_control=1 4 | wowlan_triggers=magic_pkt 5 | bss_max_count=400 6 | interworking=1 7 | config_methods=virtual_display virtual_push_button keypad 8 | driver_param="no_rrm=1" 9 | p2p_chan_list_dfs_disable=0 10 | p2p_chan_list_only_sta_dfs_enable=0 11 | p2p_pref_list_dfs_disable=0 12 | p2p_go_dfs_disable=0 13 | -------------------------------------------------------------------------------- /sepolicy/vendor/audioserver.te: -------------------------------------------------------------------------------- 1 | allow audioserver system_server:dir search; 2 | allow audioserver mediaserver:dir search; 3 | allow audioserver mediaserver:file { open read }; 4 | allow audioserver system_app:dir search; 5 | allow audioserver hal_audio_default:process signal; 6 | allow audioserver sound_device:chr_file rw_file_perms; 7 | get_prop(audioserver, bootanim_system_prop) 8 | set_prop(audioserver, audio_prop) 9 | -------------------------------------------------------------------------------- /sepolicy/vendor/stflashtool.te: -------------------------------------------------------------------------------- 1 | type stflashtool, domain; 2 | type stflashtool_exec, exec_type, vendor_file_type, file_type; 3 | 4 | init_daemon_domain(stflashtool) 5 | 6 | allow stflashtool nfc_device:chr_file {ioctl read write getattr lock append map open watch watch_reads}; 7 | 8 | get_prop(stflashtool, vendor_radio_prop) 9 | get_prop(stflashtool, vendor_nfc_prop) 10 | set_prop(stflashtool, vendor_nfc_prop) 11 | -------------------------------------------------------------------------------- /health/android.hardware.health-service.xiaomi.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | android.hardware.health 9 | 1 10 | IHealth/default 11 | 12 | 13 | -------------------------------------------------------------------------------- /overlay/FrameworksResCommon/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 7 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /overlay/FrameworksResTarget/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 7 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /overlay/FrameworksResTopaz/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 7 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /overlay/SettingsResTopaz/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 7 | 10 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_sensors_default.te: -------------------------------------------------------------------------------- 1 | allow hal_sensors_default audio_socket:sock_file rw_file_perms; 2 | allow hal_sensors_default hal_audio_default:unix_stream_socket connectto; 3 | allow hal_sensors_default sound_device:chr_file rw_file_perms; 4 | allow hal_sensors_default sysfs:file { read open write }; 5 | allow hal_sensors_default vendor_sysfs_graphics:dir r_dir_perms; 6 | allow hal_sensors_default vendor_sysfs_graphics:file r_file_perms; 7 | -------------------------------------------------------------------------------- /sepolicy/vendor/system_app.te: -------------------------------------------------------------------------------- 1 | allow system_app proc_pagetypeinfo:file { read open getattr }; 2 | allow system_app sysfs_zram:dir r_dir_perms; 3 | allow system_app sysfs_zram:file r_file_perms; 4 | 5 | binder_call(system_app, hal_audio_default) 6 | binder_call(system_app, hal_health_default) 7 | binder_call(system_app, hal_ir_default) 8 | binder_call(system_app, hal_memtrack_default) 9 | binder_call(system_app, vendor_hal_gnss_qti) 10 | -------------------------------------------------------------------------------- /overlay/TelephonyResCommon/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 7 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /overlay/SystemUIResCommon/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 7 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /configs/properties/system_ext.prop: -------------------------------------------------------------------------------- 1 | # Dalvik 2 | dalvik.vm.dex2oat64.enabled=true 3 | 4 | # DPM 5 | persist.vendor.dpm.feature=11 6 | 7 | # GPS 8 | persist.sys.gps.fence=true 9 | 10 | # Graphics 11 | persist.wm.enable_remote_keyguard_animation=0 12 | ro.surface_flinger.supports_background_blur=1 13 | 14 | # Media 15 | vendor.media.target_variant=_khaje_v0 16 | 17 | # Radio 18 | ro.telephony.sim_slots.count=1 19 | telephony.active_modems.max_count=2 20 | -------------------------------------------------------------------------------- /overlay/SystemUIResTopaz/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 7 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /overlay/SystemUIResTopaz/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 10 | true 11 | 12 | -------------------------------------------------------------------------------- /overlay/TelecommResCommon/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 7 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /overlay-lineage/lineage-sdk/packages/LineageSettingsProvider/res/values/defaults.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | true 11 | 12 | 13 | -------------------------------------------------------------------------------- /configs/idc/uinput-fpc.idc: -------------------------------------------------------------------------------- 1 | # 2 | # FPC1020 Touch sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | device.internal = 1 12 | 13 | keyboard.layout = uinput-fpc 14 | keyboard.builtIn = 1 15 | keyboard.orientationAware = 1 16 | -------------------------------------------------------------------------------- /configs/idc/uinput-goodix.idc: -------------------------------------------------------------------------------- 1 | # 2 | # FPC1020 Touch sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | device.internal = 1 12 | 13 | keyboard.layout = uinput-gf 14 | keyboard.builtIn = 1 15 | keyboard.orientationAware = 1 16 | -------------------------------------------------------------------------------- /sepolicy/vendor/tee.te: -------------------------------------------------------------------------------- 1 | allow tee mnt_vendor_file:file create_file_perms; 2 | allow tee mnt_vendor_file:dir rw_dir_perms; 3 | allow tee vendor_fingerprint_data_file:dir rw_dir_perms; 4 | allow tee vendor_fingerprint_data_file:file rw_file_perms; 5 | allow tee vendor_fingerprint_data_file:file create_file_perms; 6 | allow tee vendor_gpt_block_device:blk_file { read }; 7 | allow tee vendor_xbl_block_device:blk_file { read }; 8 | 9 | typeattribute tee data_between_core_and_vendor_violators; 10 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_power_default.te: -------------------------------------------------------------------------------- 1 | # Allow hal_power_default to write to dt2w nodes 2 | allow hal_power_default input_device:dir r_dir_perms; 3 | allow hal_power_default input_device:chr_file rw_file_perms; 4 | allow hal_power_default proc_tp_gesture:dir search; 5 | allow hal_power_default proc_tp_gesture:file rw_file_perms; 6 | 7 | r_dir_file(hal_power_default, input_device) 8 | 9 | allow hal_power_default { 10 | cgroup 11 | proc 12 | }:{ 13 | file 14 | lnk_file 15 | } rw_file_perms; 16 | -------------------------------------------------------------------------------- /overlay/CarrierConfigResCommon/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /overlay/WifiResTarget/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 7 | 8 | 13 | 14 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_qti_init_shell.te: -------------------------------------------------------------------------------- 1 | allow vendor_qti_init_shell configfs:dir { add_name create write }; 2 | # NECESSARY? 3 | allow vendor_qti_init_shell configfs:dir setattr; 4 | # END 5 | allow vendor_qti_init_shell device:dir r_dir_perms; 6 | allow vendor_qti_init_shell sysfs_dm:file rw_file_perms; 7 | allow vendor_qti_init_shell sysfs_dm:dir r_dir_perms; 8 | allow vendor_qti_init_shell vendor_sysfs_msm_perf:file w_file_perms; 9 | allow vendor_qti_init_shell vendor_sysfs_qdss_dev:file { setattr write }; 10 | -------------------------------------------------------------------------------- /overlay/SettingsOverlayM7G/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /overlay/SettingsOverlayM7L/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /overlay/SettingsOverlayM7N/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /overlay/SettingsOverlayM7IN/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /configs/perf/msm_irqbalance.conf: -------------------------------------------------------------------------------- 1 | ################################################################################################################################ 2 | # Copyright (c) 2019 Qualcomm Technologies, Inc. 3 | # All Rights Reserved. 4 | # Confidential and Proprietary - Qualcomm Technologies, Inc. 5 | ################################################################################################################################ 6 | 7 | PRIO=1,1,1,1,0,0,0,0 8 | #arch_timer, arm-pmu, arch_mem_timer 9 | IGNORED_IRQ=19,22,39 10 | -------------------------------------------------------------------------------- /overlay/WifiResCommon/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 8 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_camera_default.te: -------------------------------------------------------------------------------- 1 | allow hal_camera_default mnt_vendor_file:dir search; 2 | allow hal_camera_default camera_persist_file:dir search; 3 | allow hal_camera_default vendor_persist_sensors_file:dir search; 4 | dontaudit hal_camera graphics_device:dir search; 5 | dontaudit hal_camera_default default_prop:file read; 6 | r_dir_file(hal_camera_default, mnt_vendor_file) 7 | r_dir_file(hal_camera_default, camera_persist_file) 8 | r_dir_file(hal_camera_default, vendor_persist_sensors_file) 9 | set_prop(hal_camera_default, vendor_camera_sensor_prop) 10 | -------------------------------------------------------------------------------- /health/android.hardware.health-service.xiaomi.rc: -------------------------------------------------------------------------------- 1 | service vendor.health-default /vendor/bin/hw/android.hardware.health-service.xiaomi 2 | class hal 3 | user system 4 | group system 5 | capabilities WAKE_ALARM BLOCK_SUSPEND 6 | file /dev/kmsg w 7 | 8 | service vendor.charger /vendor/bin/hw/android.hardware.health-service.xiaomi --charger 9 | class charger 10 | seclabel u:r:charger_vendor:s0 11 | user system 12 | group system wakelock input graphics 13 | capabilities SYS_BOOT WAKE_ALARM BLOCK_SUSPEND 14 | file /dev/kmsg w 15 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_goodix_events.te: -------------------------------------------------------------------------------- 1 | type vendor_goodix_events, domain; 2 | type vendor_goodix_events_exec, exec_type, vendor_file_type, file_type; 3 | 4 | init_daemon_domain(vendor_goodix_events) 5 | 6 | allow vendor_goodix_events vendor_file:file rx_file_perms; 7 | allow vendor_goodix_events proc:file r_file_perms; 8 | allow vendor_goodix_events input_device:chr_file { rw_file_perms unlink }; 9 | allow vendor_goodix_events input_device:dir create_dir_perms; 10 | allow vendor_goodix_events vendor_toolbox_exec:file rx_file_perms; 11 | 12 | vndbinder_use(vendor_goodix_events) 13 | -------------------------------------------------------------------------------- /overlay/TelecommResCommon/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | com.android.incallui.InCallServiceImpl 10 | 11 | 12 | true 13 | 14 | 15 | -------------------------------------------------------------------------------- /configs/keylayout/uinput-goodix.kl: -------------------------------------------------------------------------------- 1 | # 2 | # FPC1020 Touch sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | #single click 12 | #key 353 DPAD_CENTER VIRTUAL 13 | #double click 14 | #key 306 BUTTON_C VIRTUAL 15 | # HOME --> DPAD_CENTER 16 | #key 102 DPAD_CENTER VIRTUAL 17 | #key 105 DPAD_LEFT VIRTUAL 18 | #key 106 DPAD_RIGHT VIRTUAL -------------------------------------------------------------------------------- /ril/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | android_app_import { 8 | name: "ims", 9 | owner: "xiaomi", 10 | apk: "ims.apk", 11 | certificate: "platform", 12 | dex_preopt: { 13 | enabled: false, 14 | }, 15 | privileged: true, 16 | system_ext_specific: true, 17 | } 18 | 19 | android_app_import { 20 | name: "QtiTelephony", 21 | owner: "xiaomi", 22 | apk: "QtiTelephony.apk", 23 | certificate: "platform", 24 | dex_preopt: { 25 | enabled: false, 26 | }, 27 | system_ext_specific: true, 28 | } 29 | -------------------------------------------------------------------------------- /rootdir/bin/init.qti.write.sh: -------------------------------------------------------------------------------- 1 | #!/vendor/bin/sh 2 | #============================================================================= 3 | # Copyright (c) 2021 Qualcomm Technologies, Inc. 4 | # All Rights Reserved. 5 | # Confidential and Proprietary - Qualcomm Technologies, Inc. 6 | #============================================================================= 7 | 8 | write_with_check() { 9 | local i=60 10 | while [ $i -gt 0 ] 11 | do 12 | if [ -f "$1" ]; then 13 | break 14 | fi 15 | 16 | sleep 1 17 | i=$(($i-1)) 18 | done 19 | 20 | if [ ! -f "$1" ]; then 21 | exit 1 22 | fi 23 | 24 | echo $2 > $1 25 | } 26 | 27 | write_with_check "$1" "$2" 28 | -------------------------------------------------------------------------------- /configs/permissions/privapp-permissions-hotword.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /sepolicy/vendor/property.te: -------------------------------------------------------------------------------- 1 | # Camera 2 | vendor_public_prop(vendor_camera_sensor_prop) 3 | 4 | # Device ID 5 | vendor_public_prop(vendor_deviceid_prop) 6 | vendor_public_prop(vendor_sno_prop) 7 | vendor_public_prop(vendor_cpuid_prop) 8 | 9 | # Display 10 | vendor_public_prop(vendor_displayfeature_prop) 11 | vendor_internal_prop(vendor_ctl_vendor_display_prop) 12 | 13 | # Fingerprint 14 | vendor_restricted_prop(vendor_fp_info_prop) 15 | vendor_public_prop(vendor_fp_prop) 16 | 17 | # Mlipay 18 | vendor_public_prop(vendor_payment_security_prop) 19 | 20 | # Thermal 21 | vendor_public_prop(vendor_thermal_normal_prop) 22 | 23 | # WiFi 24 | vendor_public_prop(vendor_wifimac_prop) 25 | -------------------------------------------------------------------------------- /overlay/SettingsResTopaz/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | true 10 | 11 | 12 | true 13 | 14 | 15 | 0dp 16 | 0dp 17 | -------------------------------------------------------------------------------- /overlay/FrameworksResCommon/res/values-mcc310-mnc120/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 13 | 6 14 | 15 | 16 | -------------------------------------------------------------------------------- /overlay/FrameworksResCommon/res/values-mcc310-mnc260/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 13 | 3 14 | 15 | 16 | -------------------------------------------------------------------------------- /overlay/FrameworksResCommon/res/values-mcc310-mnc4/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 13 | 6 14 | 15 | 16 | -------------------------------------------------------------------------------- /overlay/FrameworksResCommon/res/values-mcc310-mnc410/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 13 | 3 14 | 15 | 16 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_hal_perf_default.te: -------------------------------------------------------------------------------- 1 | allow vendor_hal_perf_default hal_audio_default:dir r_dir_perms; 2 | allow vendor_hal_perf_default hal_audio_default:file r_file_perms; 3 | allow vendor_hal_perf_default hal_fingerprint_default:dir r_dir_perms; 4 | allow vendor_hal_perf_default hal_fingerprint_default:file r_file_perms; 5 | allow vendor_hal_perf_default hal_camera_default:dir r_dir_perms; 6 | allow vendor_hal_perf_default hal_camera_default:file { read open }; 7 | allow vendor_hal_perf_default hal_graphics_composer_default:dir r_dir_perms; 8 | allow vendor_hal_perf_default hal_graphics_composer_default:file r_file_perms; 9 | allow vendor_hal_perf_default sysfs:file r_file_perms; 10 | 11 | r_dir_file(vendor_hal_perf_default, system_server) 12 | -------------------------------------------------------------------------------- /lineage_topaz.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2023 The LineageOS Project 3 | # 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | 7 | # Inherit from those products. Most specific first. 8 | $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) 9 | $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) 10 | 11 | # Inherit from topaz device 12 | $(call inherit-product, device/xiaomi/topaz/device.mk) 13 | 14 | # Inherit some common Lineage stuff. 15 | $(call inherit-product, vendor/lineage/config/common_full_phone.mk) 16 | 17 | PRODUCT_NAME := lineage_topaz 18 | PRODUCT_DEVICE := topaz 19 | PRODUCT_MANUFACTURER := Xiaomi 20 | PRODUCT_BRAND := Redmi 21 | PRODUCT_MODEL := Redmi Note 12 4G 22 | 23 | PRODUCT_GMS_CLIENTID_BASE := android-xiaomi 24 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_graphics_composer_default.te: -------------------------------------------------------------------------------- 1 | allow hal_graphics_composer vendor_hal_displayfeature_xiaomi:binder transfer; 2 | allow hal_graphics_composer_default vendor_displayfeature_device:chr_file { ioctl open read }; 3 | allow hal_graphics_composer_default vendor_sysfs_displayfeature:dir { open read search }; 4 | allow hal_graphics_composer_default vendor_sysfs_displayfeature:file { open read write }; 5 | get_prop(hal_graphics_composer, vendor_displayfeature_prop) 6 | set_prop(hal_graphics_composer_default, vendor_ctl_vendor_display_prop) 7 | set_prop(hal_graphics_composer_default, vendor_display_prop) 8 | hal_client_domain(hal_graphics_composer_default, vendor_hal_displayfeature_xiaomi) 9 | allow hal_graphics_composer_default vendor_mistcdisplay_service:service_manager find; 10 | add_service(hal_graphics_composer_default, vendor_mistcdisplay_service) 11 | -------------------------------------------------------------------------------- /configs/keylayout/uinput-fpc.kl: -------------------------------------------------------------------------------- 1 | # 2 | # FPC1020 Touch sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | #key 304 DPAD_CENTER VIRTUAL 12 | #key 102 HOME VIRTUAL 13 | #key 108 SYSTEM_NAVIGATION_DOWN 14 | #key 103 SYSTEM_NAVIGATION_DOWN 15 | # Swipe Up 16 | #key 103 DPAD_UP VIRTUAL 17 | 18 | # Swipe Down 19 | #key 108 DPAD_DOWN VIRTUAL 20 | 21 | # Single Tap 22 | #key 105 DPAD_CENTER VIRTUAL 23 | 24 | # Double Tap 25 | #key 106 BUTTON_C VIRTUAL 26 | 27 | # Keymap between kernel and framework. 28 | # Refer to input-event-codes.h(kernel) and KeyEvent.java(framework) for more details. -------------------------------------------------------------------------------- /sepolicy/vendor/file.te: -------------------------------------------------------------------------------- 1 | # Audio 2 | type audio_socket, file_type; 3 | 4 | # Battery 5 | type vendor_sysfs_qcom_battery, fs_type, sysfs_type; 6 | 7 | # Camera 8 | type camera_persist_file, file_type, mlstrustedobject, vendor_persist_type; 9 | 10 | # Display 11 | type vendor_sysfs_displayfeature, fs_type, sysfs_type; 12 | 13 | # DT2W 14 | type proc_tp_gesture, fs_type, proc_type; 15 | 16 | # Fingerprint 17 | type goodix_fingerprint_data_file, data_file_type, file_type, core_data_file_type; 18 | type vendor_fingerprint_data_file, data_file_type, file_type, vendor_persist_type; 19 | type sysfs_msm_subsys, fs_type, sysfs_type; 20 | 21 | # Mac Address 22 | type vendor_mac_vendor_data_file, data_file_type, file_type, mlstrustedobject; 23 | 24 | # Mlipay 25 | type ta_data_file, data_file_type, file_type;; 26 | 27 | # Thermal 28 | type thermal_data_file, data_file_type, file_type; 29 | -------------------------------------------------------------------------------- /setup-makefiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2016 The CyanogenMod Project 4 | # Copyright (C) 2017-2020 The LineageOS Project 5 | # 6 | # SPDX-License-Identifier: Apache-2.0 7 | # 8 | 9 | set -e 10 | 11 | DEVICE=topaz 12 | VENDOR=xiaomi 13 | 14 | # Load extract_utils and do some sanity checks 15 | MY_DIR="${BASH_SOURCE%/*}" 16 | if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi 17 | 18 | ANDROID_ROOT="${MY_DIR}/../../.." 19 | 20 | HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" 21 | if [ ! -f "${HELPER}" ]; then 22 | echo "Unable to find helper script at ${HELPER}" 23 | exit 1 24 | fi 25 | source "${HELPER}" 26 | 27 | # Initialize the helper 28 | setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" 29 | 30 | # Warning headers and guards 31 | write_headers 32 | 33 | write_makefiles "${MY_DIR}/proprietary-files.txt" true 34 | 35 | # Finish 36 | write_footers 37 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_audio_default.te: -------------------------------------------------------------------------------- 1 | allow hal_audio_default vendor_persist_audio_file:file rw_file_perms; 2 | allow hal_audio_default mnt_vendor_file:dir r_dir_perms; 3 | allow hal_audio_default vendor_audio_prop:property_service set; 4 | allow hal_audio_default audio_socket:sock_file rw_file_perms; 5 | allow hal_audio_default sound_device:chr_file rw_file_perms; 6 | allow hal_audio_default sysfs:file rw_file_perms; 7 | allow hal_audio_default dmabuf_system_heap_device:chr_file { read open ioctl }; 8 | allow hal_audio_default debugfs:dir { open read }; 9 | allow hal_audio_default vendor_agm_device:chr_file { read write open ioctl }; 10 | allow hal_audio_default vendor_pd_locater_dbg_prop:file { map }; 11 | get_prop(hal_audio_default, vendor_pd_locater_dbg_prop) 12 | unix_socket_connect(hal_audio_default, property, init) 13 | unix_socket_connect(hal_audio_default, property, hal_sensors_default) 14 | set_prop(hal_audio_default, vendor_audio_prop) 15 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_init.te: -------------------------------------------------------------------------------- 1 | allow vendor_init block_device:lnk_file { setattr }; 2 | allow vendor_init cgroup:file getattr; 3 | allow vendor_init hwservicemanager:binder { transfer }; 4 | allow vendor_init tee_device:chr_file { ioctl }; 5 | allow vendor_init tee_device:chr_file rw_file_perms; 6 | 7 | allow vendor_init vendor_dmabuf_qseecom_heap_device:chr_file ioctl; 8 | allow vendor_init vendor_dmabuf_qseecom_heap_device:chr_file rw_file_perms; 9 | allow vendor_init vendor_dmabuf_qseecom_ta_heap_device:chr_file ioctl; 10 | allow vendor_init vendor_dmabuf_qseecom_ta_heap_device:chr_file rw_file_perms; 11 | allow vendor_init vendor_qce_device:chr_file ioctl; 12 | allow vendor_init vendor_qce_device:chr_file rw_file_perms; 13 | 14 | set_prop(vendor_init, vendor_fp_prop) 15 | set_prop(vendor_init, vendor_fp_info_prop) 16 | set_prop(vendor_init, vendor_nfc_prop) 17 | set_prop(vendor_init, vendor_thermal_normal_prop) 18 | set_prop(vendor_init, vendor_displayfeature_prop) 19 | -------------------------------------------------------------------------------- /overlay/FrameworksResCommon/res/values-mcc311-mnc480/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 13 | 6 14 | 15 | 18 | true 19 | 20 | 21 | -------------------------------------------------------------------------------- /configs/media/media_codecs_vendor_audio.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /overlay/FrameworksResTopaz/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 102.0px 9 | 102.0px 10 | 102.0px 11 | 12 | 13 | 49.0px 14 | 15 | 17 | 94.0px 18 | 19 | 22 | 94.0px 23 | 24 | -------------------------------------------------------------------------------- /sepolicy/private/property_contexts: -------------------------------------------------------------------------------- 1 | # Camera 2 | ro.camera. u:object_r:exported_default_prop:s0 3 | 4 | # Fingerprint 5 | gf.debug. u:object_r:vendor_fp_prop:s0 6 | 7 | # GLobal 8 | ro.boot.hwc u:object_r:exported_default_prop:s0 9 | ro.boot.hwname u:object_r:exported_default_prop:s0 10 | ro.boot.hwversion u:object_r:exported_default_prop:s0 11 | ro.build.flavor u:object_r:build_prop:s0 12 | 13 | # Hardware 14 | ro.hardware.chipname u:object_r:exported_default_prop:s0 15 | 16 | # MIUI 17 | ro.cust.test u:object_r:exported_system_prop:s0 18 | ro.miui. u:object_r:exported_system_prop:s0 19 | ro.fota.oem u:object_r:exported_system_prop:s0 20 | ro.product.mod_device u:object_r:build_prop:s0 21 | ro.product.marketname u:object_r:build_prop:s0 22 | 23 | # WiFi 24 | ro.wlan.bdf u:object_r:vendor_public_vendor_default_prop:s0 25 | ro.wlan.chip u:object_r:vendor_public_vendor_default_prop:s0 26 | ro.ril.oem.wifimac u:object_r:vendor_wifimac_prop:s0 27 | -------------------------------------------------------------------------------- /gpt-utils/Android.bp: -------------------------------------------------------------------------------- 1 | soong_config_module_type { 2 | name: "ufsbsg_cc_defaults", 3 | module_type: "cc_defaults", 4 | config_namespace: "ufsbsg", 5 | variables: ["ufsframework"], 6 | properties: ["cflags"], 7 | } 8 | 9 | soong_config_string_variable { 10 | name: "ufsframework", 11 | values: ["sg", "bsg"], 12 | } 13 | 14 | ufsbsg_cc_defaults { 15 | name: "ufsbsg_defaults", 16 | soong_config_variables: { 17 | ufsframework: { 18 | bsg : { 19 | cflags : ["-D_BSG_FRAMEWORK_KERNEL_HEADERS"], 20 | }, 21 | }, 22 | }, 23 | } 24 | 25 | cc_library { 26 | name: "libgptutils.bengal", 27 | vendor: true, 28 | recovery_available: true, 29 | defaults: ["ufsbsg_defaults"], 30 | srcs: [ 31 | "gpt-utils.cpp", 32 | "recovery-ufs-bsg.cpp", 33 | ], 34 | shared_libs: [ 35 | "libcutils", 36 | "liblog", 37 | "libz", 38 | ], 39 | cflags: [ 40 | "-Wall", 41 | "-Wno-unused-parameter", 42 | ], 43 | sanitize: { 44 | cfi: false, 45 | }, 46 | owner: "qti", 47 | export_include_dirs: ["."], 48 | header_libs: [ 49 | "generated_kernel_headers", 50 | ], 51 | } 52 | -------------------------------------------------------------------------------- /health/Android.bp: -------------------------------------------------------------------------------- 1 | cc_defaults { 2 | name: "android.hardware.health-service.xiaomi-defaults", 3 | relative_install_path: "hw", 4 | vintf_fragments: ["android.hardware.health-service.xiaomi.xml"], 5 | vendor: true, 6 | recovery_available: true, 7 | 8 | defaults: [ 9 | "libhealth_aidl_impl_user", 10 | ], 11 | 12 | include_dirs: [ 13 | "system/core/healthd", 14 | "system/core/healthd/include", 15 | "system/core/healthd/include_charger" 16 | ], 17 | 18 | static_libs: [ 19 | "libhealth_aidl_impl", 20 | ], 21 | 22 | srcs: [ 23 | "main.cpp", 24 | ], 25 | 26 | cflags: [ 27 | "-Wall", 28 | "-Werror", 29 | ], 30 | } 31 | 32 | cc_binary { 33 | name: "android.hardware.health-service.xiaomi", 34 | recovery: false, 35 | vendor: true, 36 | defaults: ["android.hardware.health-service.xiaomi-defaults"], 37 | init_rc: ["android.hardware.health-service.xiaomi.rc"], 38 | overrides: ["charger","android.hardware.health-service.qti"], 39 | } 40 | 41 | cc_binary { 42 | name: "android.hardware.health-service.xiaomi_recovery", 43 | vendor: false, 44 | recovery: true, 45 | defaults: ["android.hardware.health-service.xiaomi-defaults"], 46 | init_rc: ["android.hardware.health-service.xiaomi_recovery.rc"], 47 | overrides: ["charger.recovery", "android.hardware.health-service.qti_recovery"], 48 | } 49 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_perf_default.te: -------------------------------------------------------------------------------- 1 | allow vendor_hal_perf_default hal_graphics_composer_default:process getpgid; 2 | allow vendor_hal_perf_default hal_graphics_composer_default:dir r_dir_perms; 3 | allow vendor_hal_perf_default hal_graphics_composer_default:file r_file_perms; 4 | allow vendor_hal_perf_default hal_graphics_composer_default:file append; 5 | allow vendor_hal_perf_default hal_graphics_composer:dir search; 6 | allow vendor_hal_perf_default hal_camera_default:dir r_dir_perms; 7 | allow vendor_hal_perf_default hal_camera_default:file r_file_perms; 8 | allow vendor_hal_perf_default hal_fingerprint_default:dir r_dir_perms; 9 | allow vendor_hal_perf_default hal_fingerprint_default:file r_file_perms; 10 | allow vendor_hal_perf_default sysfs_thermal:file rw_file_perms; 11 | allow vendor_hal_perf_default hal_audio_default:dir search; 12 | allow vendor_hal_perf_default hal_audio_default:file { open read }; 13 | allow vendor_hal_perf_default thermal_data_file:dir { read search watch }; 14 | allow vendor_hal_perf_default thermal_data_file:file { getattr open read setattr unlink }; 15 | allow vendor_hal_perf_default vendor_hal_displayfeature_xiaomi_default:dir search; 16 | allow vendor_hal_perf_default vendor_hal_displayfeature_xiaomi_default:file read; 17 | allow vendor_hal_perf_default mi_thermald:dir r_dir_perms; 18 | allow vendor_hal_perf_default mi_thermald:file r_file_perms; 19 | 20 | set_prop(vendor_hal_perf_default, vendor_wlc_public_prop) -------------------------------------------------------------------------------- /sepolicy/vendor/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_wifi_vendor_log_data_file:dir { add_name getattr open read remove_name search setattr write }; 12 | allow vendor_wcnss_service vendor_wifi_vendor_log_data_file:file { append create getattr open read rename setattr unlink write }; 13 | allow vendor_wcnss_service vendor_proc_wifi_dbg:file { create getattr open read setattr write }; 14 | 15 | get_prop(vendor_wcnss_service, vendor_bluetooth_prop) 16 | set_prop(vendor_wcnss_service, vendor_radio_prop) 17 | set_prop(vendor_wcnss_service, vendor_wifimac_prop) 18 | set_prop(vendor_wcnss_service, vendor_public_vendor_default_prop) 19 | 20 | unix_socket_connect(vendor_wcnss_service, property, init) 21 | -------------------------------------------------------------------------------- /overlay/SystemUIResTopaz/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 14 | 1080px 15 | 16 | 20 | 1030px 21 | 22 | 24 | 25 | @dimen/physical_fingerprint_sensor_center_screen_location_y 26 | 27 | -------------------------------------------------------------------------------- /sepolicy/vendor/hwservice_contexts: -------------------------------------------------------------------------------- 1 | # Displayfeature 2 | vendor.xiaomi.hardware.displayfeature::IDisplayFeature u:object_r:vendor_hal_displayfeature_xiaomi_hwservice:s0 3 | 4 | # Fingerprint 5 | com.fingerprints.extension::IFingerprintNavigation u:object_r:hal_fingerprint_hwservice:s0 6 | com.fingerprints.extension::IFingerprintSensorTest u:object_r:hal_fingerprint_hwservice:s0 7 | com.fingerprints.extension::IFingerprintEngineering u:object_r:hal_fingerprint_hwservice:s0 8 | com.fingerprints.extension::IFingerprintCalibration u:object_r:hal_fingerprint_hwservice:s0 9 | com.fingerprints.extension::IFingerprintSenseTouch u:object_r:hal_fingerprint_hwservice:s0 10 | vendor.goodix.hardware.biometrics.fingerprint::IGoodixFingerprintDaemon u:object_r:hal_fingerprint_hwservice:s0 11 | vendor.goodix.hardware.biometrics.fingerprint::IGoodixFingerprintDaemonExt u:object_r:hal_fingerprint_hwservice:s0 12 | vendor.xiaomi.hardware.fingerprintextension::IXiaomiFingerprint u:object_r:hal_fingerprint_hwservice:s0 13 | 14 | # Micharge 15 | vendor.xiaomi.hardware.micharge::IMiCharge u:object_r:vendor_hal_micharge_xiaomi_hwservice:s0 16 | 17 | # Mlipay 18 | vendor.xiaomi.hardware.mlipay::IMlipayService u:object_r:hal_mlipay_hwservice:s0 19 | vendor.xiaomi.hardware.mtdservice::IMTService u:object_r:hal_mtdservice_hwservice:s0 20 | -------------------------------------------------------------------------------- /extract-files.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2016 The CyanogenMod Project 4 | # Copyright (C) 2017-2020 The LineageOS Project 5 | # 6 | # SPDX-License-Identifier: Apache-2.0 7 | # 8 | 9 | set -e 10 | 11 | DEVICE=topaz 12 | VENDOR=xiaomi 13 | 14 | # Load extract_utils and do some sanity checks 15 | MY_DIR="${BASH_SOURCE%/*}" 16 | if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi 17 | 18 | ANDROID_ROOT="${MY_DIR}/../../.." 19 | 20 | HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" 21 | if [ ! -f "${HELPER}" ]; then 22 | echo "Unable to find helper script at ${HELPER}" 23 | exit 1 24 | fi 25 | source "${HELPER}" 26 | 27 | # Default to sanitizing the vendor folder before extraction 28 | CLEAN_VENDOR=true 29 | 30 | KANG= 31 | SECTION= 32 | 33 | while [ "${#}" -gt 0 ]; do 34 | case "${1}" in 35 | -n | --no-cleanup ) 36 | CLEAN_VENDOR=false 37 | ;; 38 | -k | --kang ) 39 | KANG="--kang" 40 | ;; 41 | -s | --section ) 42 | SECTION="${2}"; shift 43 | CLEAN_VENDOR=false 44 | ;; 45 | * ) 46 | SRC="${1}" 47 | ;; 48 | esac 49 | shift 50 | done 51 | 52 | if [ -z "${SRC}" ]; then 53 | SRC="adb" 54 | fi 55 | 56 | # Initialize the helper 57 | setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}" 58 | 59 | extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}" 60 | 61 | "${MY_DIR}/setup-makefiles.sh" 62 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_mlipay_default.te: -------------------------------------------------------------------------------- 1 | type hal_mlipay_default, domain; 2 | type hal_mlipay_default_exec, exec_type, file_type, vendor_file_type; 3 | type hal_mlipay_hwservice, hwservice_manager_type; 4 | allow hal_mlipay_client hal_mlipay_server:binder { call transfer }; 5 | allow hal_mlipay_client hal_mlipay_server:binder transfer; 6 | allow hal_mlipay_client hal_mlipay_server:fd *; 7 | allow hal_mlipay_client hal_mlipay_hwservice:hwservice_manager { add find }; 8 | allow hal_mlipay_server hal_mlipay_client:binder transfer; 9 | allow hal_mlipay_server hal_mlipay_client:binder { call transfer }; 10 | allow hal_mlipay_server hal_mlipay_client:fd *; 11 | allow hal_mlipay_default hal_mlipay_hwservice:hwservice_manager { add find }; 12 | allow hal_mlipay_default tee_device:chr_file rw_file_perms; 13 | allow hal_mlipay_default firmware_file:dir r_dir_perms; 14 | allow hal_mlipay_default firmware_file:file r_file_perms; 15 | allow hal_mlipay_default ion_device:chr_file rw_file_perms; 16 | allow hal_mlipay_default rootfs:lnk_file r_file_perms; 17 | allow hal_mlipay_default vendor_dmabuf_qseecom_heap_device:chr_file { ioctl open read }; 18 | allow hal_mlipay_default vendor_dmabuf_qseecom_ta_heap_device:chr_file { ioctl open read }; 19 | allow hal_mlipay_default hal_mtdservice_default:binder transfer; 20 | init_daemon_domain(hal_mlipay_default) 21 | get_prop(hal_mlipay_default, vendor_fp_prop) 22 | get_prop(hal_mlipay_default, vendor_system_prop) 23 | set_prop(hal_mlipay_default, vendor_payment_security_prop) 24 | hwbinder_use(hal_mlipay_default) 25 | hal_server_domain(hal_mlipay_default, hal_mlipay) 26 | add_hwservice(hal_mlipay_server, hal_mlipay_hwservice) 27 | -------------------------------------------------------------------------------- /configs/properties/product.prop: -------------------------------------------------------------------------------- 1 | # Audio 2 | aaudio.hw_burst_min_usec=2000 3 | aaudio.mmap_exclusive_policy=2 4 | af.fast_track_multiplier=1 5 | audio.deep_buffer.media=true 6 | audio.offload.min.duration.secs=30 7 | audio.offload.video=true 8 | audio.sys.mute.latency.factor=2 9 | audio.sys.noisy.broadcast.delay=500 10 | audio.sys.offload.pstimeout.secs=3 11 | audio.sys.routing.latency=0 12 | media.stagefright.audio.deep=false 13 | ro.af.client_heap_size_kbyte=7168 14 | vendor.audio.flac.sw.decoder.24bit=true 15 | vendor.audio.hw.aac.encoder=true 16 | vendor.audio.offload.buffer.size.kb=32 17 | vendor.audio.offload.multiaac.enable=true 18 | vendor.audio.parser.ip.buffer.size=262144 19 | vendor.audio.tunnel.encode=false 20 | vendor.audio.use.sw.alac.decoder=true 21 | vendor.audio.use.sw.ape.decoder=true 22 | vendor.audio_hal.period_size=192 23 | vendor.voice.path.for.pcm.voip=true 24 | 25 | # Bluetooth 26 | bluetooth.profile.a2dp.source.enabled=true 27 | bluetooth.profile.asha.central.enabled=true 28 | bluetooth.profile.avrcp.controller.enabled=false 29 | bluetooth.profile.avrcp.target.enabled=true 30 | bluetooth.profile.gatt.enabled=true 31 | bluetooth.profile.hfp.ag.enabled=true 32 | bluetooth.profile.hid.device.enabled=true 33 | bluetooth.profile.hid.host.enabled=true 34 | bluetooth.profile.map.server.enabled=true 35 | bluetooth.profile.opp.enabled=true 36 | bluetooth.profile.pan.nap.enabled=true 37 | bluetooth.profile.pan.panu.enabled=true 38 | bluetooth.profile.pbap.server.enabled=true 39 | bluetooth.profile.sap.server.enabled=false 40 | 41 | # Radio 42 | persist.vendor.radio.enable_temp_dds=true 43 | ro.vendor.radio.fastdormancy=true 44 | ro.vendor.radio.features_common=3 45 | -------------------------------------------------------------------------------- /rootdir/bin/system_dlkm_modprobe.sh: -------------------------------------------------------------------------------- 1 | #! /vendor/bin/sh 2 | #============================================================================= 3 | # Copyright (c) 2022 Qualcomm Technologies, Inc. 4 | # All Rights Reserved. 5 | # Confidential and Proprietary - Qualcomm Technologies, Inc. 6 | #============================================================================= 7 | 8 | SYSTEM_DLKM_DIR="/system_dlkm/lib/modules" 9 | VENDOR_DLKM_DIR="/vendor_dlkm/lib/modules" 10 | 11 | MODPROBE="/vendor/bin/modprobe" 12 | 13 | for dir in ${SYSTEM_DLKM_DIR} ; 14 | do 15 | if [ ! -e ${dir}/*/modules.load ]; then 16 | continue 17 | fi 18 | if [ -e ${VENDOR_DLKM_DIR}/system_dlkm.modules.blocklist ] && grep -q blocklist ${VENDOR_DLKM_DIR}/system_dlkm.modules.blocklist; then 19 | blocklist_expr="$(sed -n -e 's/blocklist \(.*\)/\1/p' ${VENDOR_DLKM_DIR}/system_dlkm.modules.blocklist | sed -e 's/-/_/g' -e 's/^/-e /')" 20 | else 21 | # Use pattern that won't be found in modules list so that all modules pass through grep below 22 | blocklist_expr="-e %" 23 | fi 24 | # Filter out modules in blocklist - we would see unnecessary errors otherwise 25 | load_modules=$(cat ${dir}/*/modules.load | grep -w -v ${blocklist_expr}) 26 | first_module=$(echo ${load_modules} | cut -d " " -f1) 27 | other_modules=$(echo ${load_modules} | cut -d " " -f2-) 28 | if ! ${MODPROBE} -b -s -d ${dir}/*/ -a ${first_module} > /dev/null ; then 29 | continue 30 | fi 31 | # load modules individually in case one of them fails to init 32 | for module in ${other_modules}; do 33 | ( ${MODPROBE} -b -s -d ${dir}/*/ -a ${module} > /dev/null ) & 34 | done 35 | 36 | wait 37 | 38 | exit 0 39 | done 40 | 41 | exit 1 42 | -------------------------------------------------------------------------------- /sepolicy/vendor/mi_thermald.te: -------------------------------------------------------------------------------- 1 | type mi_thermald, domain, mlstrustedsubject; 2 | type mi_thermald_exec, exec_type, vendor_file_type, file_type; 3 | allow mi_thermald sysfs_devices_system_cpu:file rw_file_perms; 4 | allow mi_thermald self:capability { fsetid sys_boot }; 5 | allow mi_thermald sysfs_thermal:file w_file_perms; 6 | allow mi_thermald sysfs:file w_file_perms; 7 | allow mi_thermald vendor_sysfs_kgsl:dir r_dir_perms; 8 | allow mi_thermald vendor_sysfs_kgsl:file rw_file_perms; 9 | allow mi_thermald vendor_sysfs_kgsl:lnk_file r_file_perms; 10 | allow mi_thermald vendor_sysfs_battery_supply:dir r_dir_perms; 11 | allow mi_thermald vendor_sysfs_battery_supply:file rw_file_perms; 12 | allow mi_thermald vendor_sysfs_battery_supply:lnk_file r_file_perms; 13 | allow mi_thermald vendor_sysfs_qcom_battery:file rw_file_perms; 14 | allow mi_thermald vendor_sysfs_graphics:dir r_dir_perms; 15 | allow mi_thermald vendor_sysfs_graphics:file rw_file_perms; 16 | allow mi_thermald vendor_sysfs_graphics:lnk_file r_file_perms; 17 | allow mi_thermald thermal_data_file:dir { add_name read remove_name search watch write }; 18 | allow mi_thermald thermal_data_file:file { create getattr open read rename setattr unlink write }; 19 | allow mi_thermald mi_thermald:capability { chown fowner }; 20 | allow mi_thermald mi_thermald:capability2 { block_suspend wake_alarm }; 21 | allow mi_thermald vendor_data_file:dir { add_name read remove_name watch write }; 22 | allow mi_thermald vendor_data_file:file { create getattr open read rename setattr unlink write }; 23 | init_daemon_domain(mi_thermald) 24 | r_dir_file(mi_thermald, sysfs_thermal) 25 | r_dir_file(mi_thermald, sysfs) 26 | r_dir_file(mi_thermald, sysfs_leds) 27 | r_dir_file(mi_thermald, vendor_sysfs_qcom_battery) 28 | set_prop(mi_thermald, vendor_thermal_normal_prop) 29 | -------------------------------------------------------------------------------- /configs/keylayout/gpio-keys.kl: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are 5 | # met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above 9 | # copyright notice, this list of conditions and the following 10 | # disclaimer in the documentation and/or other materials provided 11 | # with the distribution. 12 | # * Neither the name of The Linux Foundation nor the names of its 13 | # contributors may be used to endorse or promote products derived 14 | # from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | key 115 VOLUME_UP 29 | key 114 VOLUME_DOWN 30 | key 102 HOME 31 | key 528 FOCUS 32 | key 766 CAMERA 33 | key 158 BACK 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Copyright (C) 2023 The LineageOS Project 2 | 3 | Device configuration for Xiaomi Redmi Note 12 4G/12 4G NFC 4 | ========================================= 5 | 6 | The Xiaomi Redmi Note 12 4G/12 4G NFC (codenamed _"tapas/topaz"_) is a mid-range smartphone from Xiaomi. 7 | 8 | Redmi Note 12 4G was announced and released in March 2023. 9 | 10 | ## Device specifications 11 | 12 | | Device | Xiaomi Redmi Note 12 4G | 13 | | -----------: | :-------------------------------------------------- | 14 | | SoC | Qualcomm SM6225 Snapdragon 685 (6 nm) | 15 | | CPU | 4x2.8 GHz Cortex-A73 & 4x1.9 GHz Cortex-A53 | 16 | | GPU | Adreno 610 | 17 | | Memory | 4GB/6GB/8GB RAM (LPDDR4X) | 18 | | Storage | 64GB/128GB/256GB UFS 2.2 flash storage | 19 | | Shipped Android version | 13.0 with MIUI 14 | 20 | | Battery | Non-removable Li-Po 5000 mAh | 21 | | Dimensions | 165.7 x 76 x 7.9 mm | 22 | | Display | 1080 x 2400 pixels, 20:9 ratio 6.67" inch | 23 | | Type | AMOLED, 120Hz, 450 nits (typ), 700 nits (HBM), 1200 nits (peak) | 24 | | NFC | Yes ( Redmi Note 12 4G NFC ) | 25 | | Rear camera 1 | 50 MP, f/1.8, (wide), 1/2.76", 0.64µm, PDAF | 26 | | Rear camera 2 | 8 MP, f/2.2, 120˚ (ultrawide), 1/4", 1.12µm | 27 | | Rear camera 3 | 2 MP, f/2.4, (macro) | 28 | | Front camera | 13 MP, f/2.5, (wide), 1/3.0" | 29 | 30 | ## Device picture 31 | 32 | ![Xiaomi Redmi Note 12 4G](https://fdn2.gsmarena.com/vv/pics/xiaomi/redmi-note-12-4g-2.jpg "Xiaomi Redmi Note 12 4G") 33 | -------------------------------------------------------------------------------- /configs/properties/system.prop: -------------------------------------------------------------------------------- 1 | # CNE 2 | persist.vendor.cne.feature=1 3 | 4 | # Charger 5 | ro.charger.enable_suspend=1 6 | 7 | # Ftrace 8 | persist.debug.ftrace_events_disable=Yes 9 | 10 | # Fwk-Detect 11 | ro.vendor.qti.va_aosp.support=1 12 | 13 | # Graphics 14 | debug.sf.disable_backpressure=1 15 | 16 | # Hint Manager 17 | debug.hwui.use_hint_manager=true 18 | debug.hwui.target_cpu_time_percent=30 19 | 20 | # HWUI 21 | debug.hwui.skia_atrace_enabled=false 22 | 23 | # IMS 24 | persist.vendor.ims.no_stapa=1 25 | 26 | # IOrap 27 | persist.device_config.runtime_native_boot.iorap_perfetto_enable=true 28 | ro.iorapd.enable=false 29 | 30 | # Media 31 | media.settings.xml=/vendor/etc/media_profiles_khaje_v0.xml 32 | media.aac_51_output_enabled=true 33 | media.stagefright.enable-aac=true 34 | media.stagefright.enable-fma2dp=true 35 | media.stagefright.enable-http=true 36 | media.stagefright.enable-player=true 37 | media.stagefright.enable-qcp=true 38 | media.stagefright.enable-scan=true 39 | media.stagefright.thumbnail.prefer_hw_codecs=true 40 | 41 | # NFC 42 | ro.nfc.port=I2C 43 | 44 | # NTP 45 | persist.backup.ntpServer="0.pool.ntp.org" 46 | 47 | # Radio 48 | DEVICE_PROVISIONED=1 49 | persist.vendor.radio.atfwd.start=true 50 | ril.subscription.types=NV,RUIM 51 | rild.libpath=/vendor/lib64/libril-qc-hal-qmi.so 52 | ro.telephony.default_network=33,33 53 | telephony.lteOnCdmaDevice=1 54 | 55 | # SdCardFS 56 | persist.sys.fuse.passthrough.enable=true 57 | 58 | # Soc 59 | ro.soc.manufacturer=QTI 60 | 61 | # Sensors 62 | persist.vendor.sensors.enable.mag_filter=true 63 | 64 | # SSR 65 | persist.vendor.ssr.enable_ramdumps=1 66 | persist.vendor.ssr.restart_level=ALL_ENABLE 67 | 68 | # Wi-Fi Display 69 | persist.debug.wfd.enable=1 70 | persist.sys.wfd.virtual=0 71 | 72 | # WLAN 73 | ro.hardware.wlan.chip=wcn3950 74 | ro.hardware.wlan.dbs=0 75 | ro.hardware.wlan.mimo=0 76 | ro.hardware.wlan.vendor=qcom 77 | -------------------------------------------------------------------------------- /overlay-lineage/lineage-sdk/lineage/res/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 21 | 64 22 | 23 | 35 | 64 36 | 37 | 38 | true 39 | 40 | 41 | 42 | restart 43 | restart_recovery 44 | restart_bootloader 45 | restart_fastboot 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /sepolicy/vendor/batterysecret.te: -------------------------------------------------------------------------------- 1 | allow batterysecret rootfs:dir write; 2 | allow batterysecret self:capability sys_tty_config; 3 | allow batterysecret self:capability sys_boot; 4 | allow batterysecret self:capability { chown fsetid }; 5 | allow batterysecret self:netlink_kobject_uevent_socket { bind create read setopt }; 6 | allow batterysecret self:capability2 block_suspend; 7 | allow batterysecret self:cap2_userns block_suspend; 8 | allow batterysecret sysfs_wake_lock:file rw_file_perms; 9 | allow batterysecret vendor_sysfs_battery_supply:file rw_file_perms; 10 | allow batterysecret vendor_sysfs_battery_supply:dir r_dir_perms; 11 | allow batterysecret vendor_sysfs_qcom_battery:file rw_file_perms; 12 | allow batterysecret vendor_sysfs_qcom_battery:file write; 13 | allow batterysecret vendor_sysfs_qcom_battery:file { open read write }; 14 | allow batterysecret vendor_sysfs_qcom_battery:dir r_dir_perms; 15 | allow batterysecret system_suspend_server:binder { call transfer }; 16 | allow batterysecret system_suspend_server:fd *; 17 | allow batterysecret system_suspend_hwservice:hwservice_manager find; 18 | allow batterysecret hidl_manager_hwservice:hwservice_manager find; 19 | allow batterysecret sysfs:file write; 20 | allow batterysecret sysfs_usb:file w_file_perms; 21 | allow batterysecret vendor_sysfs_usb_supply:file write; 22 | allow batterysecret sysfs_batteryinfo:file r_file_perms; 23 | allow batterysecret kmsg_device:chr_file rw_file_perms; 24 | allow batterysecret mnt_vendor_file:dir rw_dir_perms; 25 | init_daemon_domain(batterysecret) 26 | r_dir_file(batterysecret, sysfs_type) 27 | r_dir_file(batterysecret, rootfs) 28 | r_dir_file(batterysecret, cgroup) 29 | r_dir_file(batterysecret, vendor_sysfs_usb_supply) 30 | get_prop(batterysecret, hwservicemanager_prop) 31 | get_prop(batterysecret, vendor_default_prop) 32 | set_prop(batterysecret, vendor_system_prop) 33 | hwbinder_use(batterysecret) 34 | type batterysecret, domain; 35 | type batterysecret_exec, exec_type, vendor_file_type, file_type; 36 | -------------------------------------------------------------------------------- /overlay/TelephonyResCommon/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 10 | 1 11 | 12 | 13 | true 14 | 15 | 16 | true 17 | 18 | 21 | true 22 | 23 | 24 | true 25 | 26 | 27 | true 28 | 29 | 30 | org.codeaurora.ims 31 | 32 | 33 | vendor.qti.imsrcs 34 | 35 | 36 | com.google.android.gms 37 | 38 | 39 | com.qualcomm.qti.uimGbaApp 40 | 41 | 42 | -------------------------------------------------------------------------------- /rootdir/etc/init.recovery.qcom.rc: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-2018,2020 The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are met: 5 | # * Redistributions of source code must retain the above copyright 6 | # notice, this list of conditions and the following disclaimer. 7 | # * Redistributions in binary form must reproduce the above copyright 8 | # notice, this list of conditions and the following disclaimer in the 9 | # documentation and/or other materials provided with the distribution. 10 | # * Neither the name of The Linux Foundation nor 11 | # the names of its contributors may be used to endorse or promote 12 | # products derived from this software without specific prior written 13 | # permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 22 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 23 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 24 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 25 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | # 27 | 28 | on init 29 | write /sys/class/backlight/panel0-backlight/brightness 200 30 | setprop sys.usb.configfs 1 31 | 32 | on property:ro.boot.usbcontroller=* 33 | setprop sys.usb.controller ${ro.boot.usbcontroller} 34 | write /sys/class/udc/${ro.boot.usbcontroller}/device/../mode peripheral 35 | 36 | on fs 37 | wait /dev/block/platform/soc/${ro.boot.bootdevice} 38 | symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice 39 | -------------------------------------------------------------------------------- /rootdir/bin/init.qti.dcvs.sh: -------------------------------------------------------------------------------- 1 | #! /vendor/bin/sh 2 | # 3 | # Copyright (c) 2020, The Linux Foundation. All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are 7 | # met: 8 | # * Redistributions of source code must retain the above copyright 9 | # notice, this list of conditions and the following disclaimer. 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 | # * Neither the name of The Linux Foundation nor the names of its 15 | # contributors may be used to endorse or promote products derived 16 | # from this software without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 19 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 22 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 25 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 26 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 27 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 28 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | for device in /sys/devices/platform/soc 31 | do 32 | for memlat in $device/*cpu*-lat/devfreq/*cpu*-lat 33 | do 34 | echo "mem_latency" > $memlat/governor 35 | echo 10 > $memlat/polling_interval 36 | echo 400 > $memlat/mem_latency/ratio_ceil 37 | done 38 | 39 | for latfloor in $device/*cpu*-ddr-latfloor*/devfreq/*cpu-ddr-latfloor* 40 | do 41 | echo "compute" > $latfloor/governor 42 | echo 10 > $latfloor/polling_interval 43 | done 44 | done; 45 | -------------------------------------------------------------------------------- /rootdir/etc/init.xiaomi.rc: -------------------------------------------------------------------------------- 1 | on init 2 | chown system system /dev/goodix_fp 3 | chmod 0644 /dev/goodix_fp 4 | 5 | on post-fs-data 6 | mkdir /data/vendor/fpc 0777 system system 7 | mkdir /data/vendor/goodix 0777 system system 8 | mkdir /data/vendor/fpdump 0770 system system 9 | mkdir /mnt/vendor/persist/fpc 0770 system system 10 | mkdir /mnt/vendor/persist/goodix 0770 system system 11 | mkdir /data/vendor/nfc 0770 nfc nfc 12 | 13 | on post-fs 14 | start stflashtool 15 | 16 | on boot 17 | chown system system /sys/bus/platform/devices/soc:fpc1020/irq 18 | chown system system /sys/bus/platform/devices/soc:fpc1020/wakeup_enable 19 | chown system system /sys/bus/platform/devices/soc:fpc1020/modalias 20 | chown system system /sys/bus/platform/devices/soc:fpc1020/compatible_all 21 | chmod 0660 /sys/bus/platform/devices/soc:fpc1020/irq 22 | chmod 0660 /sys/bus/platform/devices/soc:fpc1020/wakeup_enable 23 | chmod 0660 /sys/bus/platform/devices/soc:fpc1020/modalias 24 | chmod 0660 /sys/bus/platform/devices/soc:fpc1020/compatible_all 25 | 26 | chmod 0777 /dev/goodix_fp 27 | 28 | chmod 0664 /sys/bus/platform/devices/soc:xiaomi_fingerprint/fingerdown 29 | chown system graphics /sys/bus/platform/devices/soc:xiaomi_fingerprint/fingerdown 30 | 31 | start nfc_hal_service 32 | 33 | service vendor.fps_hal_lc /vendor/bin/hw/android.hardware.biometrics.fingerprint@2.1-service_lc 34 | # "class hal" causes a race condition on some devices due to files created 35 | # in /data. As a workaround, postpone startup until later in boot once 36 | # /data is mounted. 37 | class late_start 38 | user system 39 | group system input uhid 40 | 41 | on property:vendor.fps_hal.restartimes=max 42 | stop vendor.fps_hal_lc 43 | 44 | service stflashtool /vendor/bin/STFlashTool 45 | class late_start 46 | group nfc 47 | user nfc 48 | oneshot 49 | 50 | service vendor.goodix-events /vendor/bin/init.goodix.events.sh 51 | class late_start 52 | user root 53 | group root system input 54 | disabled 55 | oneshot 56 | 57 | on property:sys.boot_completed=1 58 | start vendor.goodix-events 59 | 60 | on property:ro.boot.hwname=* 61 | setprop ro.boot.product.hardware.sku ${ro.boot.hwname} 62 | -------------------------------------------------------------------------------- /rootdir/bin/vendor_modprobe.sh: -------------------------------------------------------------------------------- 1 | #! /vendor/bin/sh 2 | #============================================================================= 3 | # Copyright (c) 2019-2022 Qualcomm Technologies, Inc. 4 | # All Rights Reserved. 5 | # Confidential and Proprietary - Qualcomm Technologies, Inc. 6 | #============================================================================= 7 | 8 | VENDOR_DIR="/vendor/lib/modules" 9 | VENDOR_DLKM_DIR="/vendor_dlkm/lib/modules" 10 | 11 | MODPROBE="/vendor/bin/modprobe" 12 | 13 | # vendor modules partition could be /vendor/lib/modules or /vendor_dlkm/lib/modules 14 | POSSIBLE_DIRS="${VENDOR_DLKM_DIR} ${VENDOR_DIR}" 15 | audio_arch=`getprop ro.boot.audio` 16 | 17 | for dir in ${POSSIBLE_DIRS} ; 18 | do 19 | if [ ! -e ${dir}/modules.load ]; then 20 | continue 21 | fi 22 | 23 | if [ "$audio_arch" == "audioreach" ]; then 24 | if [ -e ${dir}/modules.audio.ar.blocklist ]; then 25 | audio_blocklist_expr="$(sed -n -e 's/blocklist \(.*\)/\1/p' ${dir}/modules.audio.ar.blocklist | sed -e 's/-/_/g' -e 's/^/-e /')" 26 | else 27 | audio_blocklist_expr="-e %" 28 | fi 29 | else 30 | if [ -e ${dir}/modules.audio.legacy.blocklist ]; then 31 | audio_blocklist_expr="$(sed -n -e 's/blocklist \(.*\)/\1/p' ${dir}/modules.audio.legacy.blocklist | sed -e 's/-/_/g' -e 's/^/-e /')" 32 | else 33 | audio_blocklist_expr="-e %" 34 | fi 35 | fi 36 | 37 | if [ -e ${dir}/modules.blocklist ]; then 38 | blocklist_expr="$(sed -n -e 's/blocklist \(.*\)/\1/p' ${dir}/modules.blocklist | sed -e 's/-/_/g' -e 's/^/-e /')" 39 | else 40 | # Use pattern that won't be found in modules list so that all modules pass through grep below 41 | blocklist_expr="-e %" 42 | fi 43 | # Filter out modules in blocklist - we would see unnecessary errors otherwise 44 | load_modules=$(cat ${dir}/modules.load | grep -w -v ${blocklist_expr} | grep -w -v ${audio_blocklist_expr}) 45 | first_module=$(echo ${load_modules} | cut -d " " -f1) 46 | other_modules=$(echo ${load_modules} | cut -d " " -f2-) 47 | if ! ${MODPROBE} -b -s -d ${dir} -a ${first_module} > /dev/null ; then 48 | continue 49 | fi 50 | # load modules individually in case one of them fails to init 51 | for module in ${other_modules}; do 52 | ( ${MODPROBE} -b -d ${dir} -a ${module} > /dev/null ) & 53 | done 54 | 55 | wait 56 | 57 | setprop vendor.all.modules.ready 1 58 | exit 0 59 | done 60 | 61 | exit 1 62 | -------------------------------------------------------------------------------- /configs/vintf/compatibility_matrix.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.frameworks.sensorservice 4 | 1.0 5 | 6 | ISensorManager 7 | default 8 | 9 | 10 | 11 | android.hidl.allocator 12 | 1.0 13 | 14 | IAllocator 15 | ashmem 16 | 17 | 18 | 19 | android.hidl.manager 20 | 1.0 21 | 22 | IServiceManager 23 | default 24 | 25 | 26 | 27 | android.hidl.memory 28 | 1.0 29 | 30 | IMapper 31 | ashmem 32 | 33 | 34 | 35 | android.hidl.token 36 | 1.0 37 | 38 | ITokenManager 39 | default 40 | 41 | 42 | 43 | android.system.wifi.keystore 44 | 1.0 45 | 46 | IKeystore 47 | default 48 | 49 | 50 | 51 | vendor.qti.hardware.qccsyshal 52 | 1.0-2 53 | 54 | IQccsyshal 55 | qccsyshal 56 | 57 | 58 | 59 | vendor.qti.hardware.sigma_miracast 60 | 1.0 61 | 62 | Isigma_miracast 63 | sigmahal 64 | sigmahal64 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /rootdir/bin/init.kernel.post_boot.sh: -------------------------------------------------------------------------------- 1 | #============================================================================= 2 | # Copyright (c) 2020-2022 Qualcomm Technologies, Inc. 3 | # All Rights Reserved. 4 | # Confidential and Proprietary - Qualcomm Technologies, Inc. 5 | # 6 | # Copyright (c) 2009-2012, 2014-2019, The Linux Foundation. All rights reserved. 7 | # 8 | # Redistribution and use in source and binary forms, with or without 9 | # modification, are permitted provided that the following conditions are met: 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above copyright 13 | # notice, this list of conditions and the following disclaimer in the 14 | # documentation and/or other materials provided with the distribution. 15 | # * Neither the name of The Linux Foundation nor 16 | # the names of its contributors may be used to endorse or promote 17 | # products derived from this software without specific prior written 18 | # permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 29 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 30 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | #============================================================================= 32 | 33 | if [ -f /sys/devices/soc0/soc_id ]; then 34 | platformid=`cat /sys/devices/soc0/soc_id` 35 | fi 36 | 37 | case "$platformid" in 38 | "518" | "561" | "585") 39 | /vendor/bin/sh /vendor/bin/init.kernel.post_boot-bengal.sh 40 | ;; 41 | "586") 42 | /vendor/bin/sh /vendor/bin/init.kernel.post_boot-bengal-iot.sh 43 | ;; 44 | *) 45 | echo "***WARNING***: Invalid SoC ID\n\t No postboot settings applied!!\n" 46 | ;; 47 | esac 48 | 49 | -------------------------------------------------------------------------------- /overlay/SystemUIResCommon/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 11 | 12 | accessibility_display_inversion_enabled:inversion 13 | wind_down_first_time_setup:custom(com.google.android.apps.wellbeing/.screen.ui.GrayscaleTileService) 14 | focus_mode_first_time_setup:custom(com.google.android.apps.wellbeing/.focusmode.quicksettings.FocusModeTileService) 15 | 16 | 17 | 18 | true 19 | 20 | 21 | 60 22 | 23 | 26 | xiaomi.sensor.aod 27 | 28 | 30 | 31 | -1 32 | -1 33 | -1 34 | 1 35 | 255 36 | 1 37 | 38 | 39 | 43 | 44 | -1 45 | 0 46 | 0 47 | 0 48 | 0 49 | 0 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /rootdir/bin/init.qti.kernel.sh: -------------------------------------------------------------------------------- 1 | #! /vendor/bin/sh 2 | #============================================================================= 3 | # Copyright (c) 2019-2020 Qualcomm Technologies, Inc. 4 | # All Rights Reserved. 5 | # Confidential and Proprietary - Qualcomm Technologies, Inc. 6 | # 7 | # Copyright (c) 2009-2012, 2014-2019, The Linux Foundation. All rights reserved. 8 | # 9 | # Redistribution and use in source and binary forms, with or without 10 | # modification, are permitted provided that the following conditions are met: 11 | # * Redistributions of source code must retain the above copyright 12 | # notice, this list of conditions and the following disclaimer. 13 | # * Redistributions in binary form must reproduce the above copyright 14 | # notice, this list of conditions and the following disclaimer in the 15 | # documentation and/or other materials provided with the distribution. 16 | # * Neither the name of The Linux Foundation nor 17 | # the names of its contributors may be used to endorse or promote 18 | # products derived from this software without specific prior written 19 | # permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 24 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 25 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 27 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 28 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 30 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 31 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | #============================================================================= 33 | 34 | verify_pasr_support() 35 | { 36 | ddr_type=`od -An -tx /proc/device-tree/memory/ddr_device_type` 37 | ddr_type5="08" 38 | 39 | if [ -d /sys/kernel/mem-offline ]; then 40 | #only LPDDR5 supports PAAR 41 | if [ ${ddr_type:4:2} != $ddr_type5 ]; then 42 | setprop vendor.pasr.activemode.enabled false 43 | fi 44 | 45 | setprop vendor.pasr.enabled true 46 | fi 47 | } 48 | 49 | start_msm_irqbalance() 50 | { 51 | if [ -f /vendor/bin/msm_irqbalance ]; then 52 | start vendor.msm_irqbalance 53 | fi 54 | } 55 | start_msm_irqbalance 56 | verify_pasr_support 57 | -------------------------------------------------------------------------------- /overlay/FrameworksResCommon/res/values-mcc234-mnc15/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 16 | 17 | 1 18 | 2 19 | 3 20 | 4 21 | 5 22 | 6 23 | 7 24 | 8 25 | 9 26 | 10 27 | 11 28 | 12 29 | 13 30 | 31 | 32 | 42 | 43 | 1 44 | 2 45 | 3 46 | 4 47 | 5 48 | 6 49 | 7 50 | 8 51 | 9 52 | 10 53 | 11 54 | 12 55 | 13 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /overlay/FrameworksResCommon/res/values-mcc262-mnc2/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 16 | 17 | 1 18 | 2 19 | 3 20 | 4 21 | 5 22 | 6 23 | 7 24 | 8 25 | 9 26 | 10 27 | 11 28 | 12 29 | 13 30 | 31 | 32 | 42 | 43 | 1 44 | 2 45 | 3 46 | 4 47 | 5 48 | 6 49 | 7 50 | 8 51 | 9 52 | 10 53 | 11 54 | 12 55 | 13 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /overlay/FrameworksResCommon/res/values-mcc262-mnc4/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 16 | 17 | 1 18 | 2 19 | 3 20 | 4 21 | 5 22 | 6 23 | 7 24 | 8 25 | 9 26 | 10 27 | 11 28 | 12 29 | 13 30 | 31 | 32 | 42 | 43 | 1 44 | 2 45 | 3 46 | 4 47 | 5 48 | 6 49 | 7 50 | 8 51 | 9 52 | 10 53 | 11 54 | 12 55 | 13 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /overlay/FrameworksResCommon/res/values-mcc262-mnc9/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 16 | 17 | 1 18 | 2 19 | 3 20 | 4 21 | 5 22 | 6 23 | 7 24 | 8 25 | 9 26 | 10 27 | 11 28 | 12 29 | 13 30 | 31 | 32 | 42 | 43 | 1 44 | 2 45 | 3 46 | 4 47 | 5 48 | 6 49 | 7 50 | 8 51 | 9 52 | 10 53 | 11 54 | 12 55 | 13 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /rootdir/bin/init.qti.early_init.sh: -------------------------------------------------------------------------------- 1 | #! /vendor/bin/sh 2 | # 3 | # Copyright (c) 2021 The Linux Foundation. All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are 7 | # met: 8 | # * Redistributions of source code must retain the above copyright 9 | # notice, this list of conditions and the following disclaimer. 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 | # * Neither the name of The Linux Foundation nor the names of its 15 | # contributors may be used to endorse or promote products derived 16 | # from this software without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 19 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 22 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 25 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 26 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 27 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 28 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | # Changes from Qualcomm Innovation Center are provided under the following license: 31 | # Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. 32 | # SPDX-License-Identifier: BSD-3-Clause-Clear 33 | 34 | soc_id=`cat /sys/devices/soc0/soc_id` 2> /dev/null 35 | 36 | # Store soc_id in ro.vendor.qti.soc_id 37 | setprop ro.vendor.qti.soc_id $soc_id 38 | 39 | if [ "$soc_id" -eq 444 ]; then 40 | setprop ro.vendor.qti.soc_model SM6115 41 | elif [ "$soc_id" -eq 417 ]; then 42 | setprop ro.vendor.qti.soc_model SM4250 43 | elif [ "$soc_id" -eq 441 ]; then 44 | setprop ro.vendor.qti.soc_model SM4125 45 | elif [ "$soc_id" -eq 518 ]; then 46 | setprop ro.vendor.qti.soc_model SM6225 47 | elif [ "$soc_id" -eq 469 ]; then 48 | setprop ro.vendor.qti.soc_model QCM4290 49 | elif [ "$soc_id" -eq 470 ]; then 50 | setprop ro.vendor.qti.soc_model QCS4290 51 | elif [ "$soc_id" -eq 473 ]; then 52 | setprop ro.vendor.qti.soc_model QCM2290 53 | elif [ "$soc_id" -eq 474 ]; then 54 | setprop ro.vendor.qti.soc_model QCS2290 55 | elif [ "$soc_id" -eq 497 ]; then 56 | setprop ro.vendor.qti.soc_model QCM6490 57 | elif [ "$soc_id" -eq 498 ]; then 58 | setprop ro.vendor.qti.soc_model QCS6490 59 | elif [ "$soc_id" -eq 585 ]; then 60 | setprop ro.vendor.qti.soc_model SG4150P 61 | setprop vendor.audio.gaming.enabled true 62 | fi 63 | -------------------------------------------------------------------------------- /rootdir/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 The LineageOS Project 3 | // SPDX-License-Identifier: Apache-2.0 4 | // 5 | 6 | // fstab 7 | prebuilt_etc { 8 | name: "fstab.qcom", 9 | src: "etc/fstab.qcom", 10 | vendor: true, 11 | vendor_ramdisk_available: true, 12 | } 13 | 14 | // Init configuration files 15 | prebuilt_etc { 16 | name: "init.qcom.rc", 17 | src: "etc/init.qcom.rc", 18 | sub_dir: "init/hw", 19 | vendor: true, 20 | } 21 | 22 | prebuilt_etc { 23 | name: "init.qti.kernel.rc", 24 | src: "etc/init.qti.kernel.rc", 25 | sub_dir: "init/hw", 26 | vendor: true, 27 | } 28 | 29 | prebuilt_etc { 30 | name: "init.recovery.qcom.rc", 31 | src: "etc/init.recovery.qcom.rc", 32 | sub_dir: "init", 33 | recovery: true, 34 | } 35 | 36 | prebuilt_etc { 37 | name: "init.target.rc", 38 | src: "etc/init.target.rc", 39 | sub_dir: "init/hw", 40 | vendor: true, 41 | } 42 | 43 | prebuilt_etc { 44 | name: "init.xiaomi.rc", 45 | src: "etc/init.xiaomi.rc", 46 | sub_dir: "init/hw", 47 | vendor: true, 48 | } 49 | 50 | prebuilt_etc { 51 | name: "ueventd.qcom.rc", 52 | filename: "ueventd.rc", 53 | src: "etc/ueventd.qcom.rc", 54 | vendor: true, 55 | } 56 | 57 | // Init scripts 58 | sh_binary { 59 | name: "init.class_main.sh", 60 | src: "bin/init.class_main.sh", 61 | vendor: true, 62 | } 63 | 64 | sh_binary { 65 | name: "init.goodix.events.sh", 66 | src: "bin/init.goodix.events.sh", 67 | vendor: true, 68 | } 69 | 70 | sh_binary { 71 | name: "init.kernel.post_boot-bengal.sh", 72 | src: "bin/init.kernel.post_boot-bengal.sh", 73 | vendor: true, 74 | } 75 | 76 | sh_binary { 77 | name: "init.kernel.post_boot-bengal-iot.sh", 78 | src: "bin/init.kernel.post_boot-bengal-iot.sh", 79 | vendor: true, 80 | } 81 | 82 | sh_binary { 83 | name: "init.kernel.post_boot.sh", 84 | src: "bin/init.kernel.post_boot.sh", 85 | vendor: true, 86 | } 87 | 88 | sh_binary { 89 | name: "init.qcom.class_core.sh", 90 | src: "bin/init.qcom.class_core.sh", 91 | vendor: true, 92 | } 93 | 94 | sh_binary { 95 | name: "init.qcom.early_boot.sh", 96 | src: "bin/init.qcom.early_boot.sh", 97 | vendor: true, 98 | } 99 | 100 | sh_binary { 101 | name: "init.qcom.sh", 102 | src: "bin/init.qcom.sh", 103 | vendor: true, 104 | } 105 | 106 | sh_binary { 107 | name: "init.qti.dcvs.sh", 108 | src: "bin/init.qti.dcvs.sh", 109 | vendor: true, 110 | } 111 | 112 | sh_binary { 113 | name: "init.qti.early_init.sh", 114 | src: "bin/init.qti.early_init.sh", 115 | vendor: true, 116 | } 117 | 118 | sh_binary { 119 | name: "init.qti.kernel.sh", 120 | src: "bin/init.qti.kernel.sh", 121 | vendor: true, 122 | } 123 | 124 | sh_binary { 125 | name: "init.qti.write.sh", 126 | src: "bin/init.qti.write.sh", 127 | vendor: true, 128 | } 129 | 130 | sh_binary { 131 | name: "system_dlkm_modprobe.sh", 132 | src: "bin/system_dlkm_modprobe.sh", 133 | vendor: true, 134 | } 135 | 136 | sh_binary { 137 | name: "vendor_modprobe.sh", 138 | src: "bin/vendor_modprobe.sh", 139 | vendor: true, 140 | } 141 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_micharge_default.te: -------------------------------------------------------------------------------- 1 | attribute vendor_hal_micharge_xiaomi; 2 | attribute vendor_hal_micharge_xiaomi_client; 3 | attribute vendor_hal_micharge_xiaomi_server; 4 | 5 | type vendor_hal_micharge_xiaomi_default, domain; 6 | type vendor_hal_micharge_xiaomi_default_exec, exec_type, file_type, vendor_file_type; 7 | type vendor_hal_micharge_xiaomi_hwservice, hwservice_manager_type; 8 | 9 | init_daemon_domain(vendor_hal_micharge_xiaomi_default) 10 | 11 | hal_server_domain(vendor_hal_micharge_xiaomi_default, vendor_hal_micharge_xiaomi) 12 | vndbinder_use(vendor_hal_micharge_xiaomi) 13 | 14 | add_hwservice(vendor_hal_micharge_xiaomi_server, vendor_hal_micharge_xiaomi_hwservice) 15 | 16 | allow vendor_hal_micharge_xiaomi_default hidl_base_hwservice:hwservice_manager add; 17 | allow vendor_hal_micharge_xiaomi_default hidl_manager_hwservice:hwservice_manager find; 18 | allow vendor_hal_micharge_xiaomi_default system_server:binder { call transfer }; 19 | allow vendor_hal_micharge_xiaomi_default system_app:binder { call transfer }; 20 | allow vendor_hal_micharge_xiaomi_default system_app:fd *; 21 | allow vendor_hal_micharge_xiaomi_default system_suspend_hwservice:hwservice_manager find; 22 | allow vendor_hal_micharge_xiaomi_client vendor_hal_micharge_xiaomi_server:binder { call transfer }; 23 | allow vendor_hal_micharge_xiaomi_client vendor_hal_micharge_xiaomi_server:fd *; 24 | allow vendor_hal_micharge_xiaomi_client vendor_hal_micharge_xiaomi_hwservice:hwservice_manager find; 25 | allow vendor_hal_micharge_xiaomi_server vendor_hal_micharge_xiaomi_client:binder transfer; 26 | 27 | allow vendor_hal_micharge_xiaomi_default rootfs:dir write; 28 | allow vendor_hal_micharge_xiaomi_default self:capability sys_tty_config; 29 | allow vendor_hal_micharge_xiaomi_default self:capability sys_boot; 30 | allow vendor_hal_micharge_xiaomi_default self:capability { chown fsetid }; 31 | allow vendor_hal_micharge_xiaomi_default self:netlink_kobject_uevent_socket { bind create read setopt }; 32 | allow vendor_hal_micharge_xiaomi_default self:capability2 block_suspend; 33 | allow vendor_hal_micharge_xiaomi_default self:cap2_userns block_suspend; 34 | allow vendor_hal_micharge_xiaomi_default sysfs_wake_lock:file rw_file_perms; 35 | 36 | allow vendor_hal_micharge_xiaomi_default mnt_vendor_file:dir search; 37 | allow vendor_hal_micharge_xiaomi_default mnt_vendor_file:dir rw_dir_perms; 38 | allow vendor_hal_micharge_xiaomi_default cgroup:dir r_dir_perms; 39 | allow vendor_hal_micharge_xiaomi_default cgroup:file rw_file_perms; 40 | allow vendor_hal_micharge_xiaomi_default sysfs:dir r_dir_perms; 41 | allow vendor_hal_micharge_xiaomi_default sysfs:file rw_file_perms; 42 | allow vendor_hal_micharge_xiaomi_default sysfs_batteryinfo:dir r_dir_perms; 43 | allow vendor_hal_micharge_xiaomi_default sysfs_batteryinfo:file rw_file_perms; 44 | allow vendor_hal_micharge_xiaomi_default vendor_sysfs_battery_supply:{file lnk_file} r_file_perms; 45 | allow vendor_hal_micharge_xiaomi_default vendor_sysfs_battery_supply:dir r_dir_perms; 46 | allow vendor_hal_micharge_xiaomi_default vendor_sysfs_usb_supply:{file lnk_file} r_file_perms; 47 | allow vendor_hal_micharge_xiaomi_default vendor_sysfs_usb_supply:dir r_dir_perms; 48 | allow vendor_hal_micharge_xiaomi_default vendor_sysfs_usbpd_device:{file lnk_file} r_file_perms; 49 | allow vendor_hal_micharge_xiaomi_default vendor_sysfs_usbpd_device:dir r_dir_perms; 50 | 51 | wakelock_use(vendor_hal_micharge_xiaomi_default) 52 | -------------------------------------------------------------------------------- /overlay/FrameworksResTopaz/res/xml/power_profile.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0 4 | 0.45 5 | 92.95 6 | 7 | 4 8 | 4 9 | 10 | 11 | 300000 12 | 691200 13 | 940800 14 | 1190400 15 | 1516800 16 | 1804800 17 | 1900800 18 | 19 | 20 | 3.98 21 | 6.44 22 | 10.53 23 | 14.19 24 | 26.28 25 | 33.3 26 | 37.15 27 | 28 | 29 | 300000 30 | 806400 31 | 1056000 32 | 1344000 33 | 1766400 34 | 2208000 35 | 2400000 36 | 2592000 37 | 2803200 38 | 39 | 40 | 18.11 41 | 41.28 42 | 53.54 43 | 66.03 44 | 89.63 45 | 113.12 46 | 132.51 47 | 155.62 48 | 180.32 49 | 50 | 18.3 51 | 4.51 52 | 0 53 | 42.86 54 | 5000 55 | 6.76 56 | 148 57 | 38.43 58 | 10.51 59 | 134.94 60 | 530 61 | 320 62 | 6.8 63 | 172 64 | 4.4 65 | 66 | 85 67 | 8.5 68 | 69 | 4.4 70 | 168 71 | 163 72 | 3700 73 | 74 | 13.5 75 | 76 | 1.22 77 | 121 78 | 156 79 | 1 80 | 3700 81 | 82 | .0001 83 | .001 84 | .01 85 | .1 86 | 1 87 | 88 | 44.37 89 | 0.51 90 | 3700 91 | 92 | -------------------------------------------------------------------------------- /power/power-mode.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020 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 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | namespace { 23 | int open_ts_input() { 24 | int fd = -1; 25 | DIR *dir = opendir("/dev/input"); 26 | 27 | if (dir != NULL) { 28 | struct dirent *ent; 29 | 30 | while ((ent = readdir(dir)) != NULL) { 31 | if (ent->d_type == DT_CHR) { 32 | char absolute_path[PATH_MAX] = {0}; 33 | char name[80] = {0}; 34 | 35 | strcpy(absolute_path, "/dev/input/"); 36 | strcat(absolute_path, ent->d_name); 37 | 38 | fd = open(absolute_path, O_RDWR); 39 | if (ioctl(fd, EVIOCGNAME(sizeof(name) - 1), &name) > 0) { 40 | if (strcmp(name, "fts") == 0 || strcmp(name, "goodix_ts") == 0 || 41 | strcmp(name, "NVTCapacitiveTouchScreen") == 0) 42 | break; 43 | } 44 | 45 | close(fd); 46 | fd = -1; 47 | } 48 | } 49 | 50 | closedir(dir); 51 | } 52 | 53 | return fd; 54 | } 55 | } // anonymous namespace 56 | 57 | namespace aidl { 58 | namespace android { 59 | namespace hardware { 60 | namespace power { 61 | namespace impl { 62 | 63 | static constexpr int kInputEventWakeupModeOff = 4; 64 | static constexpr int kInputEventWakeupModeOn = 5; 65 | 66 | using ::aidl::android::hardware::power::Mode; 67 | 68 | bool isDeviceSpecificModeSupported(Mode type, bool* _aidl_return) { 69 | switch (type) { 70 | case Mode::DOUBLE_TAP_TO_WAKE: 71 | *_aidl_return = true; 72 | return true; 73 | default: 74 | return false; 75 | } 76 | } 77 | 78 | bool setDeviceSpecificMode(Mode type, bool enabled) { 79 | switch (type) { 80 | case Mode::DOUBLE_TAP_TO_WAKE: { 81 | int fd = open_ts_input(); 82 | if (fd == -1) { 83 | LOG(WARNING) 84 | << "DT2W won't work because no supported touchscreen input devices were found"; 85 | return false; 86 | } 87 | struct input_event ev; 88 | ev.type = EV_SYN; 89 | ev.code = SYN_CONFIG; 90 | ev.value = enabled ? kInputEventWakeupModeOn : kInputEventWakeupModeOff; 91 | write(fd, &ev, sizeof(ev)); 92 | close(fd); 93 | return true; 94 | } 95 | default: 96 | return false; 97 | } 98 | } 99 | 100 | } // namespace impl 101 | } // namespace power 102 | } // namespace hardware 103 | } // namespace android 104 | } // namespace aidl 105 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_mtdservice.te: -------------------------------------------------------------------------------- 1 | type hal_mtdservice_default, domain; 2 | type hal_mtdservice_default_exec, exec_type, file_type, vendor_file_type; 3 | type hal_mtdservice_hwservice, hwservice_manager_type; 4 | hal_attribute(mtdservice) 5 | allow hal_mtdservice_client hal_mtdservice_server:binder { call transfer }; 6 | allow hal_mtdservice_client hal_mtdservice_server:binder transfer; 7 | allow hal_mtdservice_client hal_mtdservice_server:fd *; 8 | allow hal_mtdservice_server hal_mtdservice_client:binder transfer; 9 | allow hal_mtdservice_server hal_mtdservice_client:binder { call transfer }; 10 | allow hal_mtdservice_server hal_mtdservice_client:fd *; 11 | allow hal_mtdservice_default hal_mlipay_default:binder { call transfer }; 12 | allow hal_mtdservice_default hal_mlipay_default:fd *; 13 | allow hal_mtdservice_default hal_mtdservice_hwservice:hwservice_manager add; 14 | allow hal_mtdservice_default firmware_file:dir r_dir_perms; 15 | allow hal_mtdservice_default firmware_file:file r_file_perms; 16 | allow hal_mtdservice_default ion_device:chr_file rw_file_perms; 17 | allow hal_mtdservice_default vendor_persist_drm_file:dir { create_dir_perms relabelto }; 18 | allow hal_mtdservice_default vendor_persist_drm_file:file { create_file_perms relabelto }; 19 | allow hal_mtdservice_default vendor_persist_file:dir r_dir_perms; 20 | allow hal_mtdservice_default mnt_vendor_file:dir { create_dir_perms relabelfrom }; 21 | allow hal_mtdservice_default proc:file r_file_perms; 22 | allow hal_mtdservice_default tee_device:chr_file rw_file_perms; 23 | allow hal_mtdservice_default system_data_file:dir getattr; 24 | allow hal_mtdservice_default hal_mlipay_hwservice:hwservice_manager find; 25 | allow hal_mtdservice_default platform_app:binder transfer; 26 | allow hal_mtdservice_default system_app:binder transfer; 27 | allow hal_mtdservice_default ta_data_file:file create_file_perms; 28 | allow hal_mtdservice_default ta_data_file:dir rw_dir_perms; 29 | allow hal_mtdservice_default vendor_hal_tui_comm_hwservice:hwservice_manager find; 30 | allow hal_mtdservice_default vendor_hal_tui_comm_hwservice:binder { call transfer }; 31 | allow hal_mtdservice_default vendor_hal_tui_comm_qti:binder { call transfer }; 32 | allow hal_mtdservice_default sysfs:dir { open read }; 33 | allow hal_mtdservice_default sysfs:file { open read write }; 34 | allow hal_mtdservice_default vendor_qce_device:chr_file rw_file_perms; 35 | allow hal_mtdservice_default vendor_sg_device:chr_file { open read }; 36 | allow hal_mtdservice_default vendor_sg_device:chr_file { ioctl write }; 37 | allow hal_mtdservice_default vendor_persist_data_file:dir getattr; 38 | allow hal_mtdservice_default vendor_smcinvoke_device:chr_file { ioctl open read write }; 39 | allow hal_mtdservice_default system_server:binder transfer; 40 | allow hal_mtdservice_default block_device:dir r_dir_perms; 41 | allow hal_mtdservice_default vendor_dmabuf_qseecom_heap_device:chr_file { ioctl open read }; 42 | allow hal_mtdservice_default vendor_dmabuf_qseecom_ta_heap_device:chr_file { ioctl open read }; 43 | allow hal_mtdservice_default hal_secure_element_default:binder transfer; 44 | type_transition hal_mtdservice mnt_vendor_file:dir vendor_persist_drm_file "fdsd"; 45 | init_daemon_domain(hal_mtdservice_default) 46 | get_prop(hal_mtdservice_default, vendor_system_prop) 47 | get_prop(hal_mtdservice_default, vendor_cpuid_prop) 48 | set_prop(hal_mtdservice_default, vendor_payment_security_prop) 49 | hwbinder_use(hal_mtdservice_default) 50 | hal_server_domain(hal_mtdservice_default, hal_mtdservice) 51 | add_hwservice(hal_mtdservice_server, hal_mtdservice_hwservice) 52 | -------------------------------------------------------------------------------- /sepolicy/vendor/genfs_contexts: -------------------------------------------------------------------------------- 1 | # Battery 2 | genfscon sysfs /class/qcom-battery/quick_charge_type u:object_r:vendor_sysfs_battery_supply:s0 3 | genfscon sysfs /devices/platform/soc/soc:qcom,nopmi-chg/power_supply/usb(/.*)? u:object_r:vendor_sysfs_usb_supply:s0 4 | genfscon sysfs /devices/platform/soc/soc:qcom,nopmi-chg/power_supply/battery(/.*)? u:object_r:vendor_sysfs_battery_supply:s0 5 | genfscon sysfs /devices/platform/soc/soc:qcom,nopmi-chg/qcom-battery/odm_battery(/.*)? u:object_r:vendor_sysfs_battery_supply:s0 6 | 7 | # Battery wakeup nodes 8 | genfscon sysfs /devices/platform/soc/soc:qcom,nopmi-chg/power_supply/battery/wakeup u:object_r:sysfs_wakeup:s0 9 | genfscon sysfs /devices/platform/soc/soc:qcom,nopmi-chg/power_supply/usb/wakeup u:object_r:sysfs_wakeup:s0 10 | 11 | # DT2W 12 | genfscon proc /tp_gesture u:object_r:proc_tp_gesture:s0 13 | 14 | # Extcon 15 | genfscon sysfs /devices/platform/soc/1610000.qcom,msm-eud/extcon u:object_r:sysfs_extcon:s0 16 | genfscon sysfs /devices/platform/soc/soc:qcom,msm-ext-disp/extcon u:object_r:sysfs_extcon:s0 17 | genfscon sysfs /devices/platform/soc/soc:spf_core_platform/soc:spf_core_platform:bolero-codec/va-macro/extcon u:object_r:sysfs_extcon:s0 18 | genfscon sysfs /devices/platform/soc/soc:spf_core_platform/soc:spf_core_platform:bolero-codec/wcd937x-codec/extcon u:object_r:sysfs_extcon:s0 19 | genfscon sysfs /devices/platform/soc/soc:rt-pd-manager/extcon u:object_r:sysfs_extcon:s0 20 | 21 | # Fingerprint 22 | genfscon sysfs /devices/platform/soc/soc:fpc1020/device_prepare u:object_r:vendor_sysfs_fingerprint:s0 23 | genfscon sysfs /devices/platform/soc/soc:fpc1020/fingerdown_wait u:object_r:vendor_sysfs_fingerprint:s0 24 | genfscon sysfs /devices/platform/soc/soc:fpc1020/irq u:object_r:vendor_sysfs_fingerprint:s0 25 | genfscon sysfs /devices/platform/soc/soc:fpc1020/power_cfg u:object_r:vendor_sysfs_fingerprint:s0 26 | genfscon sysfs /devices/platform/soc/soc:fpc1020/request_vreg u:object_r:vendor_sysfs_fingerprint:s0 27 | genfscon sysfs /devices/platform/soc/soc:fpc1020/wakeup_enable u:object_r:vendor_sysfs_fingerprint:s0 28 | genfscon sysfs /devices/platform/soc/soc:fpc1020/vendor u:object_r:vendor_sysfs_fingerprint:s0 29 | genfscon sysfs /devices/soc/soc:fpc1020 u:object_r:vendor_sysfs_fingerprint:s0 30 | genfscon sysfs /devices/platform/soc/soc:fpc1020/wakeup u:object_r:sysfs_wakeup:s0 31 | genfscon sysfs /devices/platform/soc/soc:fpc1020/wakeup/wakeup26 u:object_r:sysfs_wakeup:s0 32 | genfscon sysfs /devices/platform/goodix_ts.0/wakeup u:object_r:sysfs_wakeup:s0 33 | genfscon sysfs /devices/platform/soc/soc:fingerprint_fpc/wakeup u:object_r:sysfs_wakeup:s0 34 | genfscon sysfs /devices/platform/soc/soc:fingerprint_goodix/wakeup u:object_r:sysfs_wakeup:s0 35 | genfscon sysfs /devices/platform/soc/soc:goodix_fp/wakeup u:object_r:sysfs_wakeup:s0 36 | genfscon sysfs /devices/platform/soc/4ac0000.qcom,qupv3_0_geni_se/4a84000.i2c/i2c-0/0-006a/power_supply/bbc/wakeup18 u:object_r:sysfs_wakeup:s0 37 | 38 | # Vibrator 39 | genfscon sysfs /devices/platform/soc/[a-f0-9]+.qcom,spmi/spmi-0/spmi0-0[0-9]/[a-f0-9]+.qcom,spmi:qcom,[a-z0-9]+@[0-9]:qcom,haptics@c000/leds/vibrator(/.*)? u:object_r:sysfs_leds:s0 40 | genfscon sysfs /devices/platform/soc/soc:vibrator_gpio/leds/vibrator u:object_r:sysfs_leds:s0 41 | -------------------------------------------------------------------------------- /overlay/FrameworksResTarget/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 11 | true 12 | 13 | 15 | false 16 | 17 | 35 | true 36 | 37 | 42 | true 43 | 44 | 46 | true 47 | 48 | 49 | 50 | "/apex/com.android.art/javalib/core-oj.jar" 51 | "/apex/com.android.art/javalib/core-libart.jar" 52 | "/system/bin/surfaceflinger" 53 | "/system/framework/framework.jar" 54 | "/system/framework/services.jar" 55 | "/system_ext/priv-app/SystemUI/SystemUI.apk" 56 | "/vendor/lib64/libcamxexternalformatutils.so" 57 | "/vendor/lib64/libipebpsstriping.so" 58 | "/vendor/lib64/libCB.so" 59 | "/vendor/lib64/libgsl.so" 60 | 61 | 62 | 63 | true 64 | 65 | 66 | true 67 | 68 | 69 | true 70 | 71 | 72 | -------------------------------------------------------------------------------- /sepolicy/vendor/file_contexts: -------------------------------------------------------------------------------- 1 | # Audio 2 | /dev/socket/audio_hw_socket u:object_r:audio_socket:s0 3 | 4 | # Battery 5 | /(vendor|system/vendor)/bin/batterysecret u:object_r:batterysecret_exec:s0 6 | 7 | # Camera 8 | /mnt/vendor/persist/camera(/.*)? u:object_r:camera_persist_file:s0 9 | /(vendor|system/vendor)/lib(64)?/libipebpsstriping\.so u:object_r:same_process_hal_file:s0 10 | 11 | # Display 12 | /(vendor|system/vendor)/bin/displayfeature u:object_r:vendor_displayfeature_exec:s0 13 | /(vendor|system/vendor)/bin/hw/vendor\.xiaomi\.hardware\.displayfeature@1\.0-service u:object_r:vendor_hal_displayfeature_xiaomi_default_exec:s0 14 | /dev/mi_display/disp_feature u:object_r:vendor_displayfeature_device:s0 15 | /sys/devices/virtual/mi_display/disp_feature/disp-DSI-+[0-1](/.*)? u:object_r:vendor_sysfs_displayfeature:s0 16 | 17 | # Fingerprint data 18 | /data/gf_data(/.*)? u:object_r:goodix_fingerprint_data_file:s0 19 | /data/vendor/goodix/gf_data(/.*)? u:object_r:vendor_fingerprint_data_file:s0 20 | /data/vendor/goodix(/.*)? u:object_r:vendor_fingerprint_data_file:s0 21 | /data/vendor/fpc(/.*)? u:object_r:vendor_fingerprint_data_file:s0 22 | /data/vendor/fpdump(/.*)? u:object_r:vendor_fingerprint_data_file:s0 23 | /mnt/vendor/persist/fpc(/.*)? u:object_r:vendor_fingerprint_data_file:s0 24 | /mnt/vendor/persist/goodix(/.*)? u:object_r:vendor_fingerprint_data_file:s0 25 | /sys/devices/platform/soc/soc:fpc1020(/.*?) u:object_r:vendor_sysfs_fps_attr:s0 26 | 27 | # Fingerprint devices 28 | /dev/goodix_fp u:object_r:fingerprint_device:s0 29 | 30 | # Fingerprint HAL 31 | /vendor/bin/hw/android\.hardware\.biometrics\.fingerprint@2\.1-service_lc u:object_r:hal_fingerprint_default_exec:s0 32 | 33 | # Fix Goodix events 34 | /vendor/bin/init.goodix.events.sh u:object_r:vendor_goodix_events_exec:s0 35 | 36 | # Health 37 | /vendor/bin/hw/android\.hardware\.health-service\.xiaomi u:object_r:hal_health_default_exec:s0 38 | 39 | # IR 40 | /dev/spidev0.1 u:object_r:lirc_device:s0 41 | 42 | # Mac Address 43 | /data/vendor/mac_addr(/.*)? u:object_r:vendor_mac_vendor_data_file:s0 44 | /vendor/bin/nv_mac u:object_r:vendor_wcnss_service_exec:s0 45 | 46 | # Micharge 47 | /(vendor|system/vendor)/bin/hw/vendor\.xiaomi\.hardware\.micharge@1\.0-service u:object_r:vendor_hal_micharge_xiaomi_default_exec:s0 48 | 49 | # Mlipay 50 | /(odm|vendor/odm|system/vendor)/bin/mlipayd u:object_r:hal_mlipay_default_exec:s0 51 | /(odm|vendor/odm|system/vendor)/bin/mlipayd@1.1 u:object_r:hal_mlipay_default_exec:s0 52 | /(odm|vendor/odm|system/vendor)/bin/mtd u:object_r:hal_mtdservice_default_exec:s0 53 | /(odm|vendor/odm|system/vendor)/bin/mtd@1.1 u:object_r:hal_mtdservice_default_exec:s0 54 | /(odm|vendor/odm|system/vendor)/bin/mtd@1.2 u:object_r:hal_mtdservice_default_exec:s0 55 | /(odm|vendor/odm|system/vendor)/bin/mtd@1.3 u:object_r:hal_mtdservice_default_exec:s0 56 | 57 | # NFC 58 | /vendor/bin/STFlashTool u:object_r:stflashtool_exec:s0 59 | /vendor/bin/hw/android\.hardware\.nfc@1\.2-service\.st u:object_r:hal_nfc_default_exec:s0 60 | /vendor/bin/hw/android\.hardware\.secure_element@1\.2-service u:object_r:hal_secure_element_default_exec:s0 61 | 62 | # Power 63 | /vendor/bin/hw/android\.hardware\.power-service-qti u:object_r:hal_power_default_exec:s0 64 | 65 | # Thermal 66 | /(vendor|system/vendor)/bin/mi_thermald u:object_r:mi_thermald_exec:s0 67 | /data/vendor/thermal(/.*)? u:object_r:thermal_data_file:s0 68 | -------------------------------------------------------------------------------- /rootdir/bin/init.class_main.sh: -------------------------------------------------------------------------------- 1 | #! /vendor/bin/sh 2 | 3 | # Copyright (c) 2013-2014, 2019 The Linux Foundation. All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of The Linux Foundation nor 13 | # the names of its contributors may be used to endorse or promote 14 | # products derived from this software without specific prior written 15 | # permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 26 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 27 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # 29 | 30 | # 31 | # start ril-daemon only for targets on which radio is present 32 | # 33 | baseband=`getprop ro.baseband` 34 | sgltecsfb=`getprop persist.vendor.radio.sglte_csfb` 35 | datamode=`getprop persist.vendor.data.mode` 36 | low_ram=`getprop ro.config.low_ram` 37 | 38 | case "$baseband" in 39 | "apq" | "sda" | "qcs" ) 40 | setprop ro.vendor.radio.noril yes 41 | stop vendor.ril-daemon 42 | stop vendor.qcrild 43 | stop vendor.qcrild2 44 | stop vendor.qcrild3 45 | esac 46 | 47 | case "$baseband" in 48 | "msm" | "csfb" | "svlte2a" | "mdm" | "mdm2" | "sglte" | "sglte2" | "dsda2" | "unknown" | "dsda3" | "sdm" | "sdx" | "sm6") 49 | 50 | start vendor.qcrild 51 | 52 | case "$baseband" in 53 | "svlte2a" | "csfb") 54 | start qmiproxy 55 | ;; 56 | "sglte" | "sglte2" ) 57 | if [ "x$sgltecsfb" != "xtrue" ]; then 58 | start qmiproxy 59 | else 60 | setprop persist.vendor.radio.voice.modem.index 0 61 | fi 62 | ;; 63 | esac 64 | 65 | multisim=`getprop persist.radio.multisim.config` 66 | 67 | if [ "$multisim" = "dsds" ] || [ "$multisim" = "dsda" ]; then 68 | start vendor.qcrild2 69 | elif [ "$multisim" = "tsts" ]; then 70 | start vendor.qcrild2 71 | start vendor.qcrild3 72 | fi 73 | 74 | case "$datamode" in 75 | "tethered") 76 | start vendor.dataqti 77 | if [ "$low_ram" != "true" ]; then 78 | start vendor.dataadpl 79 | fi 80 | ;; 81 | "concurrent") 82 | start vendor.dataqti 83 | if [ "$low_ram" != "true" ]; then 84 | start vendor.dataadpl 85 | fi 86 | ;; 87 | *) 88 | ;; 89 | esac 90 | esac 91 | 92 | # 93 | # Allow persistent faking of bms 94 | # User needs to set fake bms charge in persist.vendor.bms.fake_batt_capacity 95 | # 96 | fake_batt_capacity=`getprop persist.vendor.bms.fake_batt_capacity` 97 | case "$fake_batt_capacity" in 98 | "") ;; #Do nothing here 99 | * ) 100 | echo "$fake_batt_capacity" > /sys/class/power_supply/battery/capacity 101 | ;; 102 | esac 103 | -------------------------------------------------------------------------------- /sepolicy/vendor/property_contexts: -------------------------------------------------------------------------------- 1 | # Camera 2 | vendor.camera.sensor. u:object_r:vendor_camera_sensor_prop:s0 3 | 4 | # Device ID 5 | persist.vendor.radio.imei u:object_r:vendor_deviceid_prop:s0 6 | persist.vendor.radio.meid u:object_r:vendor_deviceid_prop:s0 7 | ro.vendor.oem.imei u:object_r:vendor_deviceid_prop:s0 8 | ro.vendor.oem.meid u:object_r:vendor_deviceid_prop:s0 9 | ro.vendor.oem.psno u:object_r:vendor_sno_prop:s0 10 | ro.vendor.oem.sno u:object_r:vendor_sno_prop:s0 11 | 12 | # Display 13 | ro.vendor.eyecare.threshold u:object_r:vendor_displayfeature_prop:s0 14 | ro.vendor.eyecare.level u:object_r:vendor_displayfeature_prop:s0 15 | ro.vendor.hist.threshold u:object_r:vendor_displayfeature_prop:s0 16 | ro.vendor.histogram.enable u:object_r:vendor_displayfeature_prop:s0 17 | ro.vendor.whitepoint_calibration_enable u:object_r:vendor_displayfeature_prop:s0 18 | ro.vendor.df.effect.conflict u:object_r:vendor_displayfeature_prop:s0 19 | persist.vendor.df.extcolor.proc u:object_r:vendor_displayfeature_prop:s0 20 | vendor.displayfeature.entry.enable u:object_r:vendor_displayfeature_prop:s0 21 | persist.vendor.df.color.temp u:object_r:vendor_displayfeature_prop:s0 22 | ro.vendor.colorpick_adjust u:object_r:vendor_displayfeature_prop:s0 23 | ro.vendor.all_modes.colorpick_adjust u:object_r:vendor_displayfeature_prop:s0 24 | ro.vendor.display.type u:object_r:vendor_displayfeature_prop:s0 25 | ro.vendor.xiaomi.bl.poll u:object_r:vendor_displayfeature_prop:s0 26 | persist.vendor.dc_backlight.threshold u:object_r:vendor_displayfeature_prop:s0 27 | persist.vendor.dc_backlight.enable u:object_r:vendor_displayfeature_prop:s0 28 | persist.vendor.dfps.level u:object_r:vendor_displayfeature_prop:s0 29 | persist.vendor.power.dfps.level u:object_r:vendor_displayfeature_prop:s0 30 | ro.vendor.cabc.enable u:object_r:vendor_displayfeature_prop:s0 31 | ro.vendor.bcbc.enable u:object_r:vendor_displayfeature_prop:s0 32 | ro.vendor.dfps.enable u:object_r:vendor_displayfeature_prop:s0 33 | ro.vendor.smart_dfps.enable u:object_r:vendor_displayfeature_prop:s0 34 | ro.vendor.display.default_fps u:object_r:vendor_displayfeature_prop:s0 35 | vendor.hbm.enable u:object_r:vendor_displayfeature_prop:s0 36 | persist.vendor.max.brightness u:object_r:vendor_displayfeature_prop:s0 37 | 38 | # Fingerprint 39 | persist.vendor.fpc. u:object_r:vendor_fp_prop:s0 40 | persist.vendor.goodix. u:object_r:vendor_fp_prop:s0 41 | persist.vendor.sys.fp. u:object_r:vendor_fp_prop:s0 42 | persist.vendor.sys.fp.info u:object_r:vendor_fp_info_prop:s0 43 | persist.vendor.sys.fp.uid u:object_r:vendor_fp_info_prop:s0 44 | ro.hardware.fp. u:object_r:vendor_fp_prop:s0 45 | vendor.fps_hal. u:object_r:vendor_fp_prop:s0 46 | vendor.fps_hal_lc u:object_r:vendor_fp_prop:s0 47 | vendor.panel.display. u:object_r:vendor_fp_prop:s0 48 | vendor.sys.fp. u:object_r:vendor_fp_prop:s0 49 | 50 | # Mlipay 51 | persist.vendor.sys.pay. u:object_r:vendor_payment_security_prop:s0 52 | persist.vendor.sys.provision.status u:object_r:vendor_payment_security_prop:s0 53 | vendor.sys.feature_state u:object_r:vendor_payment_security_prop:s0 54 | vendor.sys.rpmb_state u:object_r:vendor_payment_security_prop:s0 55 | 56 | # NFC 57 | persist.vendor.nfc. u:object_r:vendor_nfc_prop:s0 58 | 59 | # Radio 60 | ro.vendor.ril.svlte1x u:object_r:vendor_radio_prop:s0 61 | ro.vendor.ril.svdo u:object_r:vendor_radio_prop:s0 62 | 63 | # Thermal 64 | vendor.sys.thermal.data.path u:object_r:vendor_thermal_normal_prop:s0 65 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_fingerprint_default.te: -------------------------------------------------------------------------------- 1 | type vendor_hal_fingerprint_hwservice_xiaomi, hwservice_manager_type; 2 | typeattribute hal_fingerprint_default data_between_core_and_vendor_violators; 3 | 4 | allow hal_fingerprint_default goodix_fingerprint_data_file:dir create_dir_perms; 5 | allow hal_fingerprint_default goodix_fingerprint_data_file:file create_file_perms; 6 | allow hal_fingerprint_default fingerprint_device:chr_file rwx_file_perms; 7 | allow hal_fingerprint_default fingerprint_device:chr_file ioctl; 8 | allow hal_fingerprint_default firmware_file:dir r_dir_perms; 9 | allow hal_fingerprint_default input_device:dir r_dir_perms; 10 | allow hal_fingerprint_default input_device:chr_file rwx_file_perms; 11 | allow hal_fingerprint_default mnt_vendor_file:dir search; 12 | allow hal_fingerprint_default rootfs:dir r_dir_perms; 13 | allow hal_fingerprint_default sysfs:file rw_file_perms; 14 | allow hal_fingerprint_default sysfs:dir r_dir_perms; 15 | allow hal_fingerprint_default sysfs_leds:dir { search open }; 16 | allow hal_fingerprint_default sysfs_msm_subsys:dir r_dir_perms; 17 | allow hal_fingerprint_default sysfs_msm_subsys:file rw_file_perms; 18 | allow hal_fingerprint_default sysfs_rtc:file rw_file_perms; 19 | allow hal_fingerprint_default sysfs_rtc:dir r_dir_perms; 20 | allow hal_fingerprint_default sysfs_rtc:dir { search open }; 21 | allow hal_fingerprint_default system_data_root_file:dir r_dir_perms; 22 | allow hal_fingerprint_default sysfs_devices_system_cpu:file rw_file_perms; 23 | allow hal_fingerprint_default self:netlink_socket create_socket_perms_no_ioctl; 24 | allow hal_fingerprint_default self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl; 25 | allow hal_fingerprint_default sysfs_wakeup:dir r_dir_perms; 26 | allow hal_fingerprint_default sysfs_wakeup:file rw_file_perms; 27 | allow hal_fingerprint_default tee_device:chr_file rw_file_perms; 28 | allow hal_fingerprint_default tee_device:chr_file ioctl; 29 | allow hal_fingerprint_default uhid_device:chr_file rw_file_perms; 30 | allow hal_fingerprint_default vendor_dmabuf_qseecom_ta_heap_device:chr_file r_file_perms; 31 | allow hal_fingerprint_default vendor_dmabuf_qseecom_heap_device:chr_file r_file_perms; 32 | allow hal_fingerprint_default vendor_dmabuf_secure_cdsp_heap_device:chr_file { ioctl open read }; 33 | allow hal_fingerprint_default vendor_fingerprint_data_file:dir create_dir_perms; 34 | allow hal_fingerprint_default vendor_fingerprint_data_file:dir rw_dir_perms; 35 | allow hal_fingerprint_default vendor_fingerprint_data_file:file create_file_perms; 36 | allow hal_fingerprint_default vendor_hal_fingerprint_hwservice_xiaomi:hwservice_manager { add find }; 37 | allow hal_fingerprint_default vendor_hal_perf_hwservice:hwservice_manager find; 38 | allow hal_fingerprint_default vendor_hal_perf_default:binder call; 39 | allow hal_fingerprint_default vendor_sysfs_fingerprint:file rw_file_perms; 40 | allow hal_fingerprint_default vendor_sysfs_fingerprint:dir r_dir_perms; 41 | allow hal_fingerprint_default vendor_sysfs_fps_attr:dir r_dir_perms; 42 | allow hal_fingerprint_default vendor_sysfs_fps_attr:file rw_file_perms; 43 | allow hal_fingerprint_default vendor_sysfs_graphics:dir r_dir_perms; 44 | allow hal_fingerprint_default vendor_sysfs_graphics:file rw_file_perms; 45 | allow hal_fingerprint_default vendor_sysfs_spss:dir r_dir_perms; 46 | allow hal_fingerprint_default vendor_sysfs_spss:file rw_file_perms; 47 | allow hal_fingerprint_default vendor_qdsp_device:chr_file r_file_perms; 48 | allow hal_fingerprint_default vendor_qdsp_device:file r_file_perms; 49 | allow hal_fingerprint_default vendor_xdsp_device:chr_file r_file_perms; 50 | allow hal_fingerprint_default vendor_xdsp_device:file r_file_perms; 51 | allow hal_fingerprint_default vendor_hal_fingerprint_hwservice_xiaomi:hwservice_manager { add find }; 52 | 53 | set_prop(hal_fingerprint_default, vendor_fp_prop) 54 | set_prop(hal_fingerprint_default, vendor_fp_info_prop) 55 | set_prop(hal_fingerprint_default, vendor_system_prop) 56 | get_prop(hal_fingerprint_default, vendor_adsprpc_prop) 57 | get_prop(hal_fingerprint_default, vendor_system_prop) 58 | get_prop(system_server, vendor_fp_prop) 59 | -------------------------------------------------------------------------------- /gpt-utils/recovery-ufs-bsg.h: -------------------------------------------------------------------------------- 1 | #ifndef __RECOVERY_UFS_BSG_H__ 2 | #define __RECOVERY_UFS_BSG_H__ 3 | 4 | /* 5 | * Copyright (c) 2020 The Linux Foundation. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are 9 | * met: 10 | * * Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above 13 | * copyright notice, this list of conditions and the following 14 | * disclaimer in the documentation and/or other materials provided 15 | * with the distribution. 16 | * * Neither the name of The Linux Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 21 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 23 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 24 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 27 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 29 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 30 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | 49 | #ifdef ANDROID 50 | #include "cutils/log.h" 51 | #endif 52 | 53 | #ifdef OE 54 | #include 55 | #define LOGI(...) syslog(LOG_NOTICE, "INFO:" __VA_ARGS__) 56 | #define LOGV(...) syslog(LOG_NOTICE,"VERB:" __VA_ARGS__) 57 | #define LOGD(...) syslog(LOG_DEBUG,"DBG:" __VA_ARGS__) 58 | #define LOGE(...) syslog(LOG_ERR,"ERR:" __VA_ARGS__) 59 | #define LOGW(...) syslog(LOG_WARNING,"WRN:" __VA_ARGS__) 60 | #define strlcat(d,s,l) snprintf(d+strlen(d),l,"%s",s) 61 | #endif 62 | 63 | 64 | 65 | #define FNAME_SZ 64 66 | 67 | #define SG_IO 0x2285 68 | 69 | #define DWORD(b3, b2, b1, b0) htobe32((b3 << 24) | (b2 << 16) |\ 70 | (b1 << 8) | b0) 71 | 72 | /* UFS BSG device nodes */ 73 | char ufs_bsg_dev[FNAME_SZ] = "/dev/ufs-bsg"; 74 | 75 | int fd_ufs_bsg; 76 | 77 | int32_t set_ufs_lun(uint8_t lun_id); 78 | 79 | #ifdef _BSG_FRAMEWORK_KERNEL_HEADERS 80 | /* UPIU Transaction Codes */ 81 | enum { 82 | UTP_UPIU_NOP_OUT = 0x00, 83 | UTP_UPIU_COMMAND = 0x01, 84 | UTP_UPIU_DATA_OUT = 0x02, 85 | UTP_UPIU_TASK_REQ = 0x04, 86 | UTP_UPIU_QUERY_REQ = 0x16, 87 | }; 88 | 89 | /* UPIU Query Function field */ 90 | enum { 91 | QUERY_REQ_FUNC_STD_READ = 0x01, 92 | QUERY_REQ_FUNC_STD_WRITE = 0x81, 93 | }; 94 | 95 | enum query_req_opcode { 96 | QUERY_REQ_OP_READ_DESC = 0x1, 97 | QUERY_REQ_OP_WRITE_DESC = 0x2, 98 | QUERY_REQ_OP_READ_ATTR = 0x3, 99 | QUERY_REQ_OP_WRITE_ATTR = 0x4, 100 | QUERY_REQ_OP_READ_FLAG = 0x5, 101 | QUERY_REQ_OP_SET_FLAG = 0x6, 102 | QUERY_REQ_OP_CLEAR_FLAG = 0x7, 103 | QUERY_REQ_OP_TOGGLE_FLAG = 0x8, 104 | }; 105 | 106 | enum query_desc_idn { 107 | QUERY_DESC_IDN_DEVICE = 0x0, 108 | QUERY_DESC_IDN_UNIT = 0x2, 109 | QUERY_DESC_IDN_GEOMETRY = 0x7, 110 | }; 111 | 112 | enum query_desc_size { 113 | QUERY_DESC_SIZE_DEVICE = 0x40, 114 | QUERY_DESC_SIZE_GEOMETRY = 0x48, 115 | QUERY_DESC_SIZE_UNIT = 0x23, 116 | }; 117 | 118 | enum bsg_ioctl_dir { 119 | BSG_IOCTL_DIR_TO_DEV, 120 | BSG_IOCTL_DIR_FROM_DEV, 121 | }; 122 | 123 | enum query_attr_idn { 124 | QUERY_ATTR_IDN_BOOT_LU_EN = 0x00, 125 | QUERY_ATTR_IDN_RESERVED = 0x01, 126 | QUERY_ATTR_IDN_POWER_MODE = 0x02, 127 | QUERY_ATTR_IDN_ACTIVE_ICC_LVL = 0x03, 128 | }; 129 | #endif /* _BSG_FRAMEWORK_KERNEL_HEADERS */ 130 | 131 | #endif /* __RECOVERY_UFS_BSG_H__ */ 132 | -------------------------------------------------------------------------------- /health/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. 3 | * SPDX-License-Identifier: BSD-3-Clause-Clear 4 | */ 5 | 6 | #define LOG_TAG "android.hardware.health-service.xiaomi" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | using aidl::android::hardware::health::HalHealthLoop; 16 | using aidl::android::hardware::health::Health; 17 | 18 | #if !CHARGER_FORCE_NO_UI 19 | using aidl::android::hardware::health::charger::ChargerCallback; 20 | using aidl::android::hardware::health::charger::ChargerModeMain; 21 | namespace aidl::android::hardware::health { 22 | class ChargerCallbackImpl : public ChargerCallback { 23 | public: 24 | ChargerCallbackImpl(const std::shared_ptr& service) : ChargerCallback(service) {} 25 | bool ChargerEnableSuspend() override { return true; } 26 | }; 27 | } //namespace aidl::android::hardware::health 28 | #endif 29 | 30 | namespace aidl::android::hardware::health { 31 | static constexpr int kChargeCounterMultiplier = 1000; // mAh to uAh 32 | static constexpr int kChargeTimeToFullMultiplier = 60; // mins to secs 33 | class HealthImpl : public Health { 34 | public: 35 | using Health::Health; 36 | virtual ~HealthImpl() {} 37 | ndk::ScopedAStatus getChargeCounterUah(int32_t* out) override; 38 | protected: 39 | void UpdateHealthInfo(HealthInfo* health_info) override; 40 | }; 41 | void HealthImpl::UpdateHealthInfo(HealthInfo* health_info) { 42 | if (health_info->batteryChargeTimeToFullNowSeconds == 65535) { 43 | health_info->batteryChargeTimeToFullNowSeconds = -1; 44 | } else { 45 | health_info->batteryChargeTimeToFullNowSeconds *= kChargeTimeToFullMultiplier; 46 | } 47 | health_info->batteryChargeCounterUah *= kChargeCounterMultiplier; 48 | } 49 | ndk::ScopedAStatus HealthImpl::getChargeCounterUah(int32_t* out) { 50 | *out *= kChargeCounterMultiplier; 51 | return ndk::ScopedAStatus::ok(); 52 | } 53 | } // namespace aidl::android::hardware::health 54 | 55 | static constexpr const char* gInstanceName = "default"; 56 | static constexpr std::string_view gChargerArg{"--charger"}; 57 | 58 | constexpr char ucsiPSYName[]{"ucsi-source-psy-soc:qcom,pmic_glink:qcom,ucsi1"}; 59 | 60 | #define RETRY_COUNT 100 61 | 62 | void qti_healthd_board_init(struct healthd_config *hc) 63 | { 64 | int fd; 65 | unsigned char retries = RETRY_COUNT; 66 | int ret = 0; 67 | unsigned char buf; 68 | 69 | hc->ignorePowerSupplyNames.push_back(android::String8(ucsiPSYName)); 70 | retry: 71 | if (!retries) { 72 | KLOG_ERROR(LOG_TAG, "Cannot open battery/capacity, fd=%d\n", fd); 73 | return; 74 | } 75 | 76 | fd = open("/sys/class/power_supply/battery/capacity", 0440); 77 | if (fd >= 0) { 78 | KLOG_INFO(LOG_TAG, "opened battery/capacity after %d retries\n", RETRY_COUNT - retries); 79 | while (retries) { 80 | ret = read(fd, &buf, 1); 81 | if(ret >= 0) { 82 | KLOG_INFO(LOG_TAG, "Read Batt Capacity after %d retries ret : %d\n", RETRY_COUNT - retries, ret); 83 | close(fd); 84 | return; 85 | } 86 | 87 | retries--; 88 | usleep(100000); 89 | } 90 | 91 | KLOG_ERROR(LOG_TAG, "Failed to read Battery Capacity ret=%d\n", ret); 92 | close(fd); 93 | return; 94 | } 95 | 96 | retries--; 97 | usleep(100000); 98 | goto retry; 99 | } 100 | 101 | int main(int argc, char** argv) { 102 | #ifdef __ANDROID_RECOVERY__ 103 | android::base::InitLogging(argv, android::base::KernelLogger); 104 | #endif 105 | auto config = std::make_unique(); 106 | qti_healthd_board_init(config.get()); 107 | ::android::hardware::health::InitHealthdConfig(config.get()); 108 | auto binder = ndk::SharedRefBase::make(gInstanceName, std::move(config)); 109 | 110 | if (argc >= 2 && argv[1] == gChargerArg) { 111 | #if !CHARGER_FORCE_NO_UI 112 | KLOG_INFO(LOG_TAG, "Starting charger mode with UI."); 113 | auto charger_callback = std::make_shared(binder); 114 | return ChargerModeMain(binder, charger_callback); 115 | #endif 116 | KLOG_INFO(LOG_TAG, "Starting charger mode without UI."); 117 | } else { 118 | KLOG_INFO(LOG_TAG, "Starting health HAL."); 119 | } 120 | 121 | auto hal_health_loop = std::make_shared(binder, binder); 122 | return hal_health_loop->StartLoop(); 123 | } 124 | -------------------------------------------------------------------------------- /configs/config.fs: -------------------------------------------------------------------------------- 1 | [AID_VENDOR_QTI_DIAG] 2 | value:2901 3 | 4 | [AID_VENDOR_QDSS] 5 | value:2902 6 | 7 | [AID_VENDOR_RFS] 8 | value:2903 9 | 10 | [AID_VENDOR_RFS_SHARED] 11 | value:2904 12 | 13 | [AID_VENDOR_ADPL_ODL] 14 | value:2905 15 | 16 | [AID_VENDOR_QRTR] 17 | value:2906 18 | 19 | [AID_VENDOR_THERMAL] 20 | value:2907 21 | 22 | [AID_VENDOR_FASTRPC] 23 | value:2908 24 | 25 | [AID_VENDOR_QTR] 26 | value:2909 27 | 28 | [vendor/bin/wcnss_filter] 29 | mode: 0755 30 | user: AID_BLUETOOTH 31 | group: AID_BLUETOOTH 32 | caps: BLOCK_SUSPEND 33 | 34 | [system/vendor/bin/wcnss_filter] 35 | mode: 0755 36 | user: AID_BLUETOOTH 37 | group: AID_BLUETOOTH 38 | caps: BLOCK_SUSPEND 39 | 40 | [vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti] 41 | mode: 0755 42 | user: AID_BLUETOOTH 43 | group: AID_BLUETOOTH 44 | caps: BLOCK_SUSPEND NET_ADMIN 45 | 46 | [system/vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti] 47 | mode: 0755 48 | user: AID_SYSTEM 49 | group: AID_SYSTEM 50 | caps: BLOCK_SUSPEND NET_ADMIN 51 | 52 | [vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti-lazy] 53 | mode: 0755 54 | user: AID_BLUETOOTH 55 | group: AID_BLUETOOTH 56 | caps: BLOCK_SUSPEND NET_ADMIN 57 | 58 | [system/vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti-lazy] 59 | mode: 0755 60 | user: AID_SYSTEM 61 | group: AID_SYSTEM 62 | caps: BLOCK_SUSPEND NET_ADMIN 63 | 64 | [system/bin/cnss-daemon] 65 | mode: 0755 66 | user: AID_BLUETOOTH 67 | group: AID_BLUETOOTH 68 | caps: NET_BIND_SERVICE 69 | 70 | [vendor/bin/pm-service] 71 | mode: 0755 72 | user: AID_SYSTEM 73 | group: AID_SYSTEM 74 | caps: NET_BIND_SERVICE 75 | 76 | [system/vendor/bin/pm-service] 77 | mode: 0755 78 | user: AID_SYSTEM 79 | group: AID_SYSTEM 80 | caps: NET_BIND_SERVICE 81 | 82 | [system/bin/pm-service] 83 | mode: 0755 84 | user: AID_SYSTEM 85 | group: AID_SYSTEM 86 | caps: NET_BIND_SERVICE 87 | 88 | [vendor/bin/pd-mapper] 89 | mode: 0755 90 | user: AID_SYSTEM 91 | group: AID_SYSTEM 92 | caps: NET_BIND_SERVICE 93 | 94 | [system/vendor/bin/pd-mapper] 95 | mode: 0755 96 | user: AID_SYSTEM 97 | group: AID_SYSTEM 98 | caps: NET_BIND_SERVICE 99 | 100 | [system/bin/pd-mapper] 101 | mode: 0755 102 | user: AID_SYSTEM 103 | group: AID_SYSTEM 104 | caps: NET_BIND_SERVICE 105 | 106 | [vendor/bin/imsdatadaemon] 107 | mode: 0755 108 | user: AID_RADIO 109 | group: AID_RADIO 110 | caps: NET_BIND_SERVICE 111 | 112 | [system/vendor/bin/imsdatadaemon] 113 | mode: 0755 114 | user: AID_RADIO 115 | group: AID_RADIO 116 | caps: NET_BIND_SERVICE 117 | 118 | [vendor/bin/ims_rtp_daemon] 119 | mode: 0755 120 | user: AID_RADIO 121 | group: AID_RADIO 122 | caps: NET_BIND_SERVICE 123 | 124 | [system/vendor/bin/ims_rtp_daemon] 125 | mode: 0755 126 | user: AID_RADIO 127 | group: AID_RADIO 128 | caps: NET_BIND_SERVICE 129 | 130 | [vendor/bin/imsrcsd] 131 | mode: 0755 132 | user: AID_RADIO 133 | group: AID_RADIO 134 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM 135 | 136 | [system/vendor/bin/imsrcsd] 137 | mode: 0755 138 | user: AID_RADIO 139 | group: AID_RADIO 140 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM 141 | 142 | [vendor/bin/imsdaemon] 143 | mode: 0755 144 | user: AID_RADIO 145 | group: AID_RADIO 146 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM 147 | 148 | [vendor/bin/cnd] 149 | mode: 0755 150 | user: AID_SYSTEM 151 | group: AID_SYSTEM 152 | caps: NET_BIND_SERVICE BLOCK_SUSPEND NET_ADMIN 153 | 154 | [system/vendor/bin/cnd] 155 | mode: 0755 156 | user: AID_SYSTEM 157 | group: AID_SYSTEM 158 | caps: NET_BIND_SERVICE BLOCK_SUSPEND NET_ADMIN 159 | 160 | [vendor/bin/slim_daemon] 161 | mode: 0755 162 | user: AID_GPS 163 | group: AID_GPS 164 | caps: NET_BIND_SERVICE 165 | 166 | [system/vendor/bin/slim_daemon] 167 | mode: 0755 168 | user: AID_GPS 169 | group: AID_GPS 170 | caps: NET_BIND_SERVICE 171 | 172 | [vendor/bin/loc_launcher] 173 | mode: 0755 174 | user: AID_GPS 175 | group: AID_GPS 176 | caps: SETUID SETGID 177 | 178 | [system/vendor/bin/loc_launcher] 179 | mode: 0755 180 | user: AID_GPS 181 | group: AID_GPS 182 | caps: SETUID SETGID 183 | 184 | [vendor/bin/xtwifi-client] 185 | mode: 0755 186 | user: AID_GPS 187 | group: AID_GPS 188 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM 189 | 190 | [vendor/bin/sensors.qti] 191 | mode: 0755 192 | user: AID_SYSTEM 193 | group: AID_SYSTEM 194 | caps: NET_BIND_SERVICE 195 | 196 | [firmware/] 197 | mode: 0771 198 | user: AID_SYSTEM 199 | group: AID_SYSTEM 200 | caps: 0 201 | 202 | [firmware/image/*] 203 | mode: 0771 204 | user: AID_SYSTEM 205 | group: AID_SYSTEM 206 | caps: 0 207 | 208 | [vendor/firmware_mnt/image/*] 209 | mode: 0771 210 | user: AID_SYSTEM 211 | group: AID_SYSTEM 212 | caps: 0 213 | 214 | [bt_firmware/] 215 | mode: 0771 216 | user: AID_SYSTEM 217 | group: AID_SYSTEM 218 | caps: 0 219 | 220 | [persist/] 221 | mode: 0771 222 | user: AID_SYSTEM 223 | group: AID_SYSTEM 224 | caps: 0 225 | 226 | [dsp/] 227 | mode: 0771 228 | user: AID_MEDIA 229 | group: AID_MEDIA 230 | caps: 0 231 | -------------------------------------------------------------------------------- /rootdir/bin/init.qcom.early_boot.sh: -------------------------------------------------------------------------------- 1 | #! /vendor/bin/sh 2 | 3 | # Copyright (c) 2012-2013,2016,2018-2020 The Linux Foundation. All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of The Linux Foundation nor 13 | # the names of its contributors may be used to endorse or promote 14 | # products derived from this software without specific prior written 15 | # permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 26 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 27 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # 29 | 30 | export PATH=/vendor/bin 31 | 32 | # Set platform variables 33 | if [ -f /sys/devices/soc0/hw_platform ]; then 34 | soc_hwplatform=`cat /sys/devices/soc0/hw_platform` 2> /dev/null 35 | else 36 | soc_hwplatform=`cat /sys/devices/system/soc/soc0/hw_platform` 2> /dev/null 37 | fi 38 | if [ -f /sys/devices/soc0/soc_id ]; then 39 | soc_hwid=`cat /sys/devices/soc0/soc_id` 2> /dev/null 40 | else 41 | soc_hwid=`cat /sys/devices/system/soc/soc0/id` 2> /dev/null 42 | fi 43 | if [ -f /sys/devices/soc0/platform_version ]; then 44 | soc_hwver=`cat /sys/devices/soc0/platform_version` 2> /dev/null 45 | else 46 | soc_hwver=`cat /sys/devices/system/soc/soc0/platform_version` 2> /dev/null 47 | fi 48 | 49 | # Update permissions 50 | chown system.system /sys/devices/platform/soc/18800000.qcom,icnss/net/wlan*/queues/rx-*/rps_cpus 51 | chmod 0660 /sys/devices/platform/soc/17a10040.qcom,wcn6750/net/wlan*/queues/rx-*/rps_cpus 52 | chown system.graphics /sys/devices/platform/soc/ae00000.qcom,mdss_mdp/drm/card*/sde-crtc-* lineptr_value 53 | chmod 0664 /sys/devices/platform/soc/ae00000.qcom,mdss_mdp/drm/card*/sde-crtc-* lineptr_value 54 | chmod system.system /dev/hgsl 55 | chmod 0666 /dev/hgsl 56 | chmod system.audio /dev/spidev22.0 57 | chmod 0660 /dev/spidev22.0 58 | chmod system.audio /dev/spidev10.0 59 | chmod 0660 /dev/spidev10.0 60 | chown root.usb /dev/bus/usb/* 61 | chmod 0660 /dev/bus/usb/* 62 | chown root.usb /dev/hidraw* 63 | chmod 0660 /dev/hidraw* 64 | chown system.audio /dev/virt_sndcard_ctl 65 | chmod 0660 system.audio /dev/virt_sndcard_ctl 66 | chown system.audio /dev/virt-eavb 67 | chmod 0660 system.audio /dev/virt-eavb 68 | 69 | 70 | target=`getprop ro.board.platform` 71 | case "$target" in 72 | "bengal") 73 | case "$soc_hwid" in 74 | 441|473) 75 | # 441 is for scuba and 473 for scuba iot qcm 76 | setprop vendor.fastrpc.disable.cdsprpcd.daemon 1 77 | setprop vendor.media.target.version 2 78 | setprop vendor.gralloc.disable_ubwc 1 79 | setprop vendor.display.enhance_idle_time 1 80 | setprop vendor.netflix.bsp_rev "" 81 | # 196609 is decimal for 0x30001 to report version 3.1 82 | setprop vendor.opengles.version 196609 83 | sku_ver=`cat /sys/devices/platform/soc/5a00000.qcom,vidc1/sku_version` 2> /dev/null 84 | if [ $sku_ver -eq 1 ]; then 85 | setprop vendor.media.target.version 3 86 | fi 87 | ;; 88 | 471|474) 89 | # 471 is for scuba APQ and 474 for scuba iot qcs 90 | setprop vendor.fastrpc.disable.cdsprpcd.daemon 1 91 | setprop vendor.gralloc.disable_ubwc 1 92 | setprop vendor.display.enhance_idle_time 1 93 | setprop vendor.netflix.bsp_rev "" 94 | ;; 95 | 518|561|586) 96 | setprop vendor.media.target.version 3 97 | ;; 98 | 585) 99 | setprop vendor.media.target.version 4 100 | ;; 101 | esac 102 | ;; 103 | esac 104 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_displayfeature_xiaomi.te: -------------------------------------------------------------------------------- 1 | type vendor_hal_displayfeature_xiaomi_default, domain; 2 | type vendor_hal_displayfeature_xiaomi_default_exec, exec_type, file_type, vendor_file_type; 3 | type vendor_hal_displayfeature_xiaomi_hwservice, hwservice_manager_type; 4 | type vendor_mistcdisplay_service, vndservice_manager_type; 5 | 6 | type vendor_displayfeature, domain; 7 | type vendor_displayfeature_exec, exec_type, file_type, vendor_file_type; 8 | type vendor_DisplayFeatureControl_service, vndservice_manager_type; 9 | 10 | allow vendor_hal_displayfeature_xiaomi vendor_sysfs_graphics:file rw_file_perms; 11 | allow vendor_hal_displayfeature_xiaomi vendor_qdisplay_service:service_manager find; 12 | allow vendor_hal_displayfeature_xiaomi hal_graphics_composer:binder { call transfer }; 13 | allow vendor_hal_displayfeature_xiaomi hal_graphics_composer:fd *; 14 | allow vendor_hal_displayfeature_xiaomi graphics_device:chr_file rw_file_perms; 15 | allow vendor_hal_displayfeature_xiaomi graphics_device:dir r_dir_perms; 16 | allow vendor_hal_displayfeature_xiaomi_default sysfs:file { getattr open read write }; 17 | allow vendor_hal_displayfeature_xiaomi_default sensors_device:chr_file r_file_perms; 18 | allow vendor_hal_displayfeature_xiaomi_default fwk_sensor_hwservice:hwservice_manager find; 19 | allow vendor_hal_displayfeature_xiaomi_default system_server:binder { call transfer }; 20 | allow vendor_hal_displayfeature_xiaomi_default vendor_hal_display_config_hwservice:hwservice_manager find; 21 | allow vendor_hal_displayfeature_xiaomi_default vendor_hal_display_config_hwservice:binder { call transfer }; 22 | allow vendor_hal_displayfeature_xiaomi_default vendor_hal_display_config_hwservice:fd *; 23 | allow vendor_hal_displayfeature_xiaomi_default vendor_display_vendor_data_file:dir create_dir_perms; 24 | allow vendor_hal_displayfeature_xiaomi_default vendor_display_vendor_data_file:file create_file_perms; 25 | allow vendor_hal_displayfeature_xiaomi_default vendor_displayfeature_device:chr_file { ioctl open read write }; 26 | allow vendor_hal_displayfeature_xiaomi_default vendor_sysfs_displayfeature:dir r_dir_perms; 27 | allow vendor_hal_displayfeature_xiaomi_default vendor_sysfs_displayfeature:file rw_file_perms; 28 | allow vendor_hal_displayfeature_xiaomi_default vendor_mistcdisplay_service:service_manager find; 29 | allow vendor_hal_displayfeature_xiaomi_default system_app:binder { call transfer }; 30 | allow vendor_hal_displayfeature_xiaomi_default system_app:fd *; 31 | allow vendor_hal_displayfeature_xiaomi_default surfaceflinger:binder call; 32 | allow vendor_hal_displayfeature_xiaomi_client vendor_hal_displayfeature_xiaomi_server:binder { call transfer }; 33 | allow vendor_hal_displayfeature_xiaomi_client vendor_hal_displayfeature_xiaomi_server:fd *; 34 | allow vendor_hal_displayfeature_xiaomi_client vendor_hal_displayfeature_xiaomi_hwservice:hwservice_manager find; 35 | allow vendor_hal_displayfeature_xiaomi_server vendor_hal_displayfeature_xiaomi_client:binder transfer; 36 | attribute vendor_hal_displayfeature_xiaomi; 37 | attribute vendor_hal_displayfeature_xiaomi_client; 38 | attribute vendor_hal_displayfeature_xiaomi_server; 39 | init_daemon_domain(vendor_hal_displayfeature_xiaomi_default) 40 | r_dir_file(vendor_hal_displayfeature_xiaomi, vendor_sysfs_graphics) 41 | unix_socket_connect(vendor_hal_displayfeature_xiaomi_default, property, vendor_sensors) 42 | get_prop(vendor_hal_displayfeature_xiaomi_default, vendor_mpctl_prop) 43 | set_prop(vendor_hal_displayfeature_xiaomi_default, vendor_displayfeature_prop) 44 | vndbinder_use(vendor_hal_displayfeature_xiaomi) 45 | hal_server_domain(vendor_hal_displayfeature_xiaomi_default, vendor_hal_displayfeature_xiaomi) 46 | hal_client_domain(vendor_hal_displayfeature_xiaomi_default, vendor_hal_display_color) 47 | hal_client_domain(vendor_hal_displayfeature_xiaomi_default, vendor_hal_display_postproc) 48 | add_hwservice(vendor_hal_displayfeature_xiaomi_server, vendor_hal_displayfeature_xiaomi_hwservice) 49 | 50 | allow vendor_displayfeature system_server:binder transfer; 51 | allow vendor_displayfeature system_server:binder { call transfer }; 52 | allow vendor_displayfeature system_server:fd *; 53 | allow vendor_displayfeature appdomain:binder { call transfer }; 54 | allow vendor_displayfeature appdomain:fd *; 55 | allow vendor_displayfeature sysfs:file { getattr open read write }; 56 | allow vendor_displayfeature vendor_file:file r_file_perms; 57 | allow vendor_displayfeature graphics_device:dir r_dir_perms; 58 | allow vendor_displayfeature graphics_device:chr_file rw_file_perms; 59 | init_daemon_domain(vendor_displayfeature) 60 | get_prop(vendor_displayfeature, hwservicemanager_prop) 61 | get_prop(vendor_displayfeature, vendor_displayfeature_prop) 62 | hwbinder_use(vendor_displayfeature) 63 | vndbinder_use(vendor_displayfeature) 64 | hal_client_domain(vendor_displayfeature, hal_graphics_composer) 65 | hal_client_domain(vendor_displayfeature, hal_light) 66 | hal_client_domain(vendor_displayfeature, vendor_hal_display_color) 67 | hal_client_domain(vendor_displayfeature, vendor_hal_display_postproc) 68 | hal_client_domain(vendor_displayfeature, vendor_hal_displayfeature_xiaomi) 69 | add_service(vendor_displayfeature, vendor_DisplayFeatureControl_service) 70 | -------------------------------------------------------------------------------- /init/init_topaz.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Paranoid Android 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 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #include 24 | #define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ 25 | #include 26 | #include 27 | 28 | #include "property_service.h" 29 | #include "vendor_init.h" 30 | 31 | using android::base::GetProperty; 32 | using std::string; 33 | 34 | std::vector ro_props_default_source_order = { 35 | "", 36 | "odm.", 37 | "product.", 38 | "system.", 39 | "system_dlkm.", 40 | "system_ext.", 41 | "vendor.", 42 | "vendor_dlkm.", 43 | }; 44 | 45 | bool IsRecoveryMode() { 46 | return access("/system/bin/recovery", F_OK) == 0; 47 | } 48 | 49 | void property_override(string prop, string value) 50 | { 51 | auto pi = (prop_info*) __system_property_find(prop.c_str()); 52 | 53 | if (pi != nullptr) 54 | __system_property_update(pi, value.c_str(), value.size()); 55 | else 56 | __system_property_add(prop.c_str(), prop.size(), value.c_str(), value.size()); 57 | } 58 | 59 | void load_redmi_topaz() { 60 | property_override("bluetooth.device.default_name", "Redmi Note 12"); 61 | property_override("ro.product.brand", "Redmi"); 62 | property_override("ro.product.device", "topaz"); 63 | property_override("ro.product.manufacturer", "Xiaomi"); 64 | property_override("ro.product.marketname", "Redmi Note 12"); 65 | property_override("ro.product.model", "23021RAA2Y"); 66 | property_override("ro.product.mod_device", "topaz_global"); 67 | property_override("ro.product.name", "topaz_global"); 68 | property_override("vendor.usb.product_string", "Redmi Note 12"); 69 | } 70 | 71 | void load_redmi_tapas() { 72 | property_override("bluetooth.device.default_name", "Redmi Note 12"); 73 | property_override("ro.product.brand", "Redmi"); 74 | property_override("ro.product.device", "tapas"); 75 | property_override("ro.product.manufacturer", "Xiaomi"); 76 | property_override("ro.product.marketname", "Redmi Note 12"); 77 | property_override("ro.product.model", "23021RAAEG"); 78 | property_override("ro.product.mod_device", "tapas_global"); 79 | property_override("ro.product.name", "tapas_global"); 80 | property_override("vendor.usb.product_string", "Redmi Note 12"); 81 | } 82 | 83 | void vendor_load_properties() { 84 | std::string hwname = GetProperty("ro.boot.hwname", ""); 85 | if (access("/system/bin/recovery", F_OK) != 0) { 86 | if (hwname == "topaz") { 87 | load_redmi_topaz(); 88 | } else if (hwname == "tapas") { 89 | load_redmi_tapas(); 90 | } 91 | } 92 | 93 | // Override first api level for safetynet 94 | if (!IsRecoveryMode()) { 95 | property_override("ro.product.first_api_level", "32"); 96 | } 97 | 98 | // Set hardware revision 99 | property_override("ro.boot.hardware.revision", GetProperty("ro.boot.hwversion", "").c_str()); 100 | 101 | // Set dalvik heap configuration 102 | std::string heapstartsize, heapgrowthlimit, heapsize, heapminfree, 103 | heapmaxfree, heaptargetutilization; 104 | 105 | struct sysinfo sys; 106 | sysinfo(&sys); 107 | 108 | if (sys.totalram > 5072ull * 1024 * 1024) { 109 | // from - phone-xhdpi-6144-dalvik-heap.mk 110 | heapstartsize = "16m"; 111 | heapgrowthlimit = "256m"; 112 | heapsize = "512m"; 113 | heaptargetutilization = "0.5"; 114 | heapminfree = "8m"; 115 | heapmaxfree = "32m"; 116 | } else if (sys.totalram > 3072ull * 1024 * 1024) { 117 | // from - phone-xhdpi-4096-dalvik-heap.mk 118 | heapstartsize = "8m"; 119 | heapgrowthlimit = "192m"; 120 | heapsize = "512m"; 121 | heaptargetutilization = "0.6"; 122 | heapminfree = "8m"; 123 | heapmaxfree = "16m"; 124 | } else { 125 | // from - phone-xhdpi-2048-dalvik-heap.mk 126 | heapstartsize = "8m"; 127 | heapgrowthlimit = "192m"; 128 | heapsize = "512m"; 129 | heaptargetutilization = "0.75"; 130 | heapminfree = "512k"; 131 | heapmaxfree = "8m"; 132 | } 133 | 134 | property_override("dalvik.vm.heapstartsize", heapstartsize); 135 | property_override("dalvik.vm.heapgrowthlimit", heapgrowthlimit); 136 | property_override("dalvik.vm.heapsize", heapsize); 137 | property_override("dalvik.vm.heaptargetutilization", heaptargetutilization); 138 | property_override("dalvik.vm.heapminfree", heapminfree); 139 | property_override("dalvik.vm.heapmaxfree", heapmaxfree); 140 | } 141 | -------------------------------------------------------------------------------- /overlay/WifiResCommon/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | true 10 | 11 | 12 | true 13 | 14 | 15 | true 16 | 17 | 18 | true 19 | 20 | 24 | true 25 | 26 | 27 | false 28 | 29 | 33 | true 34 | 35 | 36 | 32 37 | 38 | 41 | 42 | 43 | 46 | 47 | 48 | 51 | 52 | 53 | 54 | false 55 | 56 | 57 | true 58 | 59 | 60 | true 61 | 62 | 63 | true 64 | 65 | 66 | true 67 | 68 | 69 | true 70 | 71 | 72 | true 73 | 74 | 75 | false 76 | 77 | 78 | true 79 | 80 | 81 | 1000 82 | 83 | 87 | true 88 | 89 | 90 | -------------------------------------------------------------------------------- /configs/vintf/network_manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.hardware.radio 4 | hwbinder 5 | @1.2::ISap/slot1 6 | @1.2::ISap/slot2 7 | 8 | 9 | android.hardware.radio.data 10 | IRadioData/slot1 11 | IRadioData/slot2 12 | 13 | 14 | android.hardware.radio.messaging 15 | IRadioMessaging/slot1 16 | IRadioMessaging/slot2 17 | 18 | 19 | android.hardware.radio.modem 20 | IRadioModem/slot1 21 | IRadioModem/slot2 22 | 23 | 24 | android.hardware.radio.network 25 | IRadioNetwork/slot1 26 | IRadioNetwork/slot2 27 | 28 | 29 | android.hardware.radio.sim 30 | IRadioSim/slot1 31 | IRadioSim/slot2 32 | 33 | 34 | android.hardware.radio.voice 35 | IRadioVoice/slot1 36 | IRadioVoice/slot2 37 | 38 | 39 | vendor.qti.hardware.data.connection 40 | hwbinder 41 | 1.1 42 | 43 | IDataConnection 44 | slot1 45 | slot2 46 | 47 | @1.1::IDataConnection/slot1 48 | @1.1::IDataConnection/slot2 49 | 50 | 51 | vendor.qti.hardware.data.connectionfactory 52 | IFactory/slot0 53 | IFactory/slot1 54 | 55 | 56 | vendor.qti.hardware.data.iwlan 57 | hwbinder 58 | 1.1 59 | 60 | IIWlan 61 | slot1 62 | slot2 63 | 64 | @1.1::IIWlan/slot1 65 | @1.1::IIWlan/slot2 66 | 67 | 68 | vendor.qti.hardware.radio.am 69 | IQcRilAudio/slot1 70 | IQcRilAudio/slot2 71 | 72 | 73 | vendor.qti.hardware.radio.ims 74 | 9 75 | IImsRadio/imsradio0 76 | IImsRadio/imsradio1 77 | 78 | 79 | vendor.qti.hardware.radio.lpa 80 | hwbinder 81 | 1.3 82 | 83 | IUimLpa 84 | UimLpa0 85 | UimLpa1 86 | 87 | @1.3::IUimLpa/UimLpa0 88 | @1.3::IUimLpa/UimLpa1 89 | 90 | 91 | vendor.qti.hardware.radio.qcrilhook 92 | IQtiOemHook/oemhook0 93 | IQtiOemHook/oemhook1 94 | 95 | 96 | vendor.qti.hardware.radio.qtiradio 97 | 8 98 | IQtiRadioStable/slot1 99 | IQtiRadioStable/slot2 100 | 101 | 102 | vendor.qti.hardware.radio.uim 103 | hwbinder 104 | 1.2 105 | 106 | IUim 107 | Uim0 108 | Uim1 109 | 110 | @1.2::IUim/Uim0 111 | @1.2::IUim/Uim1 112 | 113 | 114 | vendor.qti.hardware.radio.uim_remote_client 115 | hwbinder 116 | 1.2 117 | 118 | IUimRemoteServiceClient 119 | uimRemoteClient0 120 | uimRemoteClient1 121 | 122 | @1.2::IUimRemoteServiceClient/uimRemoteClient0 123 | @1.2::IUimRemoteServiceClient/uimRemoteClient1 124 | 125 | 126 | vendor.qti.hardware.radio.uim_remote_server 127 | hwbinder 128 | 1.0 129 | 130 | IUimRemoteServiceServer 131 | uimRemoteServer0 132 | uimRemoteServer1 133 | 134 | @1.0::IUimRemoteServiceServer/uimRemoteServer0 135 | @1.0::IUimRemoteServiceServer/uimRemoteServer1 136 | 137 | 138 | -------------------------------------------------------------------------------- /overlay/WifiResTarget/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 12 | true 13 | 14 | 15 | true 16 | 17 | 21 | true 22 | 23 | 24 | true 25 | 26 | 27 | true 28 | 29 | 30 | true 31 | 32 | 33 | true 34 | 35 | 36 | true 37 | 38 | 39 | true 40 | 41 | 42 | true 43 | 44 | 45 | true 46 | 47 | 48 | true 49 | 50 | 51 | false 52 | 53 | 55 | 524288,1048576,2097152,524288,1048576,4194304 56 | 57 | 59 | false 60 | 61 | 63 | false 64 | 65 | 67 | false 68 | 69 | 71 | true 72 | 73 | 74 | true 75 | 76 | 83 | true 84 | 85 | 86 | false 87 | 88 | 89 | true 90 | 91 | 92 | -------------------------------------------------------------------------------- /configs/audio/default_volume_tables.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 0,0 22 | 100,0 23 | 24 | 25 | 0,-9600 26 | 100,-9600 27 | 28 | 29 | 30 | 1,-2400 31 | 33,-1800 32 | 66,-1200 33 | 100,-600 34 | 35 | 36 | 37 | 1,-5800 38 | 20,-4000 39 | 60,-1700 40 | 100,0 41 | 42 | 43 | 44 | 1,-4950 45 | 33,-3350 46 | 66,-1700 47 | 100,0 48 | 49 | 50 | 51 | 1,-5800 52 | 20,-4000 53 | 60,-1700 54 | 100,0 55 | 56 | 57 | 58 | 1,-4950 59 | 33,-3350 60 | 66,-1700 61 | 100,0 62 | 63 | 64 | 65 | 1,-5800 66 | 20,-4000 67 | 60,-2100 68 | 100,-1000 69 | 70 | 71 | 72 | 1,-12700 73 | 20,-8000 74 | 60,-4000 75 | 100,0 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 0,-5800 85 | 20,-4000 86 | 60,-1700 87 | 100,0 88 | 89 | 90 | 91 | 92 | 0,-4950 93 | 33,-3350 94 | 66,-1700 95 | 100,0 96 | 97 | 98 | 99 | 100 | 0,-5800 101 | 20,-4000 102 | 60,-1700 103 | 100,0 104 | 105 | 106 | 107 | 108 | 0,-4950 109 | 33,-3350 110 | 66,-1700 111 | 100,0 112 | 113 | 114 | 115 | 116 | 0,-5800 117 | 20,-4000 118 | 60,-2100 119 | 100,-1000 120 | 121 | 122 | 123 | 124 | 0,-12700 125 | 20,-8000 126 | 60,-4000 127 | 100,0 128 | 129 | 130 | -------------------------------------------------------------------------------- /rootdir/bin/init.qcom.class_core.sh: -------------------------------------------------------------------------------- 1 | #!/vendor/bin/sh 2 | 3 | # Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of The Linux Foundation nor 13 | # the names of its contributors may be used to endorse or promote 14 | # products derived from this software without specific prior written 15 | # permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 26 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 27 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # 29 | 30 | # Set platform variables 31 | target=`getprop ro.board.platform` 32 | if [ -f /sys/devices/soc0/hw_platform ]; then 33 | soc_hwplatform=`cat /sys/devices/soc0/hw_platform` 2> /dev/null 34 | else 35 | soc_hwplatform=`cat /sys/devices/system/soc/soc0/hw_platform` 2> /dev/null 36 | fi 37 | if [ -f /sys/devices/soc0/soc_id ]; then 38 | soc_hwid=`cat /sys/devices/soc0/soc_id` 2> /dev/null 39 | else 40 | soc_hwid=`cat /sys/devices/system/soc/soc0/id` 2> /dev/null 41 | fi 42 | if [ -f /sys/devices/soc0/platform_version ]; then 43 | soc_hwver=`cat /sys/devices/soc0/platform_version` 2> /dev/null 44 | else 45 | soc_hwver=`cat /sys/devices/system/soc/soc0/platform_version` 2> /dev/null 46 | fi 47 | 48 | 49 | # Dynamic Memory Managment (DMM) provides a sys file system to the userspace 50 | # that can be used to plug in/out memory that has been configured as unstable. 51 | # This unstable memory can be in Active or In-Active State. 52 | # Each of which the userspace can request by writing to a sys file. 53 | # 54 | # ro.dev.dmm = 1; Indicates that DMM is enabled in the Android User Space. This 55 | # property is set in the Android system properties file. 56 | # 57 | # If ro.dev.dmm.dpd.start_address is set here then the target has a memory 58 | # configuration that supports DynamicMemoryManagement. 59 | init_DMM() 60 | { 61 | block=-1 62 | 63 | case "$target" in 64 | "msm7630_surf" | "msm7630_1x" | "msm7630_fusion" | "msm8960") 65 | ;; 66 | *) 67 | return 68 | ;; 69 | esac 70 | 71 | mem="/sys/devices/system/memory" 72 | op=`cat $mem/movable_start_bytes` 73 | case "$op" in 74 | "0") 75 | log -p i -t DMM DMM Disabled. movable_start_bytes not set: $op 76 | ;; 77 | 78 | "$mem/movable_start_bytes: No such file or directory ") 79 | log -p i -t DMM DMM Disabled. movable_start_bytes does not exist: $op 80 | ;; 81 | 82 | *) 83 | log -p i -t DMM DMM available. movable_start_bytes at $op 84 | movable_start_bytes=0x`cat $mem/movable_start_bytes` 85 | block_size_bytes=0x`cat $mem/block_size_bytes` 86 | block=$((#${movable_start_bytes}/${block_size_bytes})) 87 | 88 | chown -h system.system $mem/memory$block/state 89 | chown -h system.system $mem/probe 90 | chown -h system.system $mem/active 91 | chown -h system.system $mem/remove 92 | 93 | case "$target" in 94 | "msm7630_surf" | "msm7630_1x" | "msm7630_fusion") 95 | echo $movable_start_bytes > $mem/probe 96 | case "$?" in 97 | "0") 98 | log -p i -t DMM $movable_start_bytes to physical hotplug succeeded. 99 | ;; 100 | *) 101 | log -p e -t DMM $movable_start_bytes to physical hotplug failed. 102 | return 103 | ;; 104 | esac 105 | 106 | echo online > $mem/memory$block/state 107 | case "$?" in 108 | "0") 109 | log -p i -t DMM \'echo online\' to logical hotplug succeeded. 110 | ;; 111 | *) 112 | log -p e -t DMM \'echo online\' to logical hotplug failed. 113 | return 114 | ;; 115 | esac 116 | ;; 117 | esac 118 | 119 | setprop ro.dev.dmm.dpd.start_address $movable_start_bytes 120 | setprop ro.dev.dmm.dpd.block $block 121 | ;; 122 | esac 123 | 124 | case "$target" in 125 | "msm8960") 126 | return 127 | ;; 128 | esac 129 | 130 | # For 7X30 targets: 131 | # ro.dev.dmm.dpd.start_address is set when the target has a 2x256Mb memory 132 | # configuration. This is also used to indicate that the target is capable of 133 | # setting EBI-1 to Deep Power Down or Self Refresh. 134 | op=`cat $mem/low_power_memory_start_bytes` 135 | case "$op" in 136 | "0") 137 | log -p i -t DMM Self-Refresh-Only Disabled. low_power_memory_start_bytes not set:$op 138 | ;; 139 | "$mem/low_power_memory_start_bytes No such file or directory ") 140 | log -p i -t DMM Self-Refresh-Only Disabled. low_power_memory_start_bytes does not exist:$op 141 | ;; 142 | *) 143 | log -p i -t DMM Self-Refresh-Only available. low_power_memory_start_bytes at $op 144 | ;; 145 | esac 146 | } 147 | 148 | case "$target" in 149 | "msm7630_surf" | "msm7630_1x" | "msm7630_fusion") 150 | insmod /system/lib/modules/ss_mfcinit.ko 151 | insmod /system/lib/modules/ss_vencoder.ko 152 | insmod /system/lib/modules/ss_vdecoder.ko 153 | chmod -h 0666 /dev/ss_mfc_reg 154 | chmod -h 0666 /dev/ss_vdec 155 | chmod -h 0666 /dev/ss_venc 156 | 157 | init_DMM 158 | ;; 159 | 160 | "msm8960") 161 | init_DMM 162 | ;; 163 | esac 164 | --------------------------------------------------------------------------------