├── board-info.txt ├── sepolicy ├── vendor │ ├── attributes │ ├── hwservice.te │ ├── rild.te │ ├── mtk_hal_pq.te │ ├── hal_graphics_composer_default.te │ ├── hal_mlipay.te │ ├── fuelgauged_nvram.te │ ├── charger.te │ ├── hal_light_default.te │ ├── hal_wifi_default.te │ ├── system_app.te │ ├── dontaudit.te │ ├── property.te │ ├── hal_secure_element_default.te │ ├── hal_mlipay_default.te │ ├── vendor_init.te │ ├── file.te │ ├── hwservice_contexts │ ├── mtk_hal_camera.te │ ├── mi_thermald.te │ ├── property_contexts │ ├── hal_fingerprint_default.te │ ├── hal_audio_default.te │ ├── hal_power_default.te │ ├── file_contexts │ └── genfs_contexts └── private │ └── property_contexts ├── configs ├── seccomp │ ├── mediaswcodec.policy │ ├── mediaextractor.policy │ ├── mediacodec.policy │ ├── android.hardware.media.c2@1.2-extended-seccomp-policy │ ├── configstore@1.1.policy │ └── android.hardware.media.c2@1.2-mediatek-seccomp-policy ├── thermal │ ├── thermal-map.conf │ ├── thermal-camera.conf │ ├── thermal-class0.conf │ ├── thermal-normal.conf │ ├── thermal-phone.conf │ ├── thermal-tgame.conf │ ├── thermal-nolimits.conf │ ├── thermal-youtube.conf │ ├── thermald-devices.conf │ └── thermal-chg-only.conf ├── wifi │ ├── wpa_supplicant_overlay.conf │ ├── p2p_supplicant_overlay.conf │ └── wpa_supplicant.conf ├── idc │ ├── uinput-fpc.idc │ └── uinput-goodix.idc ├── keylayouts │ ├── uinput-goodix.kl │ └── uinput-fpc.kl ├── vintf │ ├── manifest_nfc.xml │ ├── compatibility_matrix.xml │ └── manifest.xml ├── permissions │ ├── privapp-permissions-hotword.xml │ └── privapp-permissions-mediatek.xml ├── public.libraries.txt ├── audio │ ├── usb_audio_accessory_only_policy_configuration.xml │ ├── bluetooth_offload_audio_policy_configuration.xml │ ├── audio_em.xml │ ├── default_volume_tables.xml │ ├── audio_effects.xml │ └── audio_policy.conf ├── nfc │ ├── libese-nxp.conf │ └── libnfc-nci.conf ├── media │ ├── media_codecs.xml │ └── media_codecs_mediatek_audio.xml └── powerhint.json ├── sensors ├── hals.conf ├── android.hardware.sensors@2.1-service.cannon-multihal.rc ├── android.hardware.sensors@2.1-cannon-multihal.xml ├── service.cpp ├── Android.bp └── HalProxyCallback.cpp ├── prebuilts ├── dtb.img └── dtbo.img ├── Android.bp ├── rro_overlays ├── CannonCNSettingsProviderOverlay │ ├── Android.bp │ ├── res │ │ └── values │ │ │ └── defaults.xml │ └── AndroidManifest.xml ├── CannonGLSettingsProviderOverlay │ ├── Android.bp │ ├── res │ │ └── values │ │ │ └── defaults.xml │ └── AndroidManifest.xml ├── WifiResOverlay │ ├── Android.bp │ ├── res │ │ └── values │ │ │ ├── integers.xml │ │ │ ├── strings.xml │ │ │ └── bools.xml │ └── AndroidManifest.xml └── TetheringResOverlay │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ └── values │ └── arrays.xml ├── app └── InCallService │ ├── res │ └── values │ │ └── strings.xml │ ├── src │ └── org │ │ └── lineageos │ │ └── mediatek │ │ └── incallservice │ │ ├── OnLockedBootCompleteReceiver.java │ │ ├── CallStateListener.java │ │ ├── GainUtils.java │ │ ├── VolumeChangeReceiver.java │ │ └── VolumeChangeService.java │ ├── Android.bp │ └── AndroidManifest.xml ├── lights ├── android.hardware.light-service.cannon.xml ├── android.hardware.light-service.cannon.rc ├── Android.bp ├── main.cpp ├── Light.h └── Light.cpp ├── rootdir ├── etc │ ├── init.recovery.mt6853.rc │ ├── init.sensor_2_0.rc │ ├── init.modem.rc │ ├── init.connectivity.rc │ ├── init.cannon.rc │ ├── init.project.rc │ └── ueventd.mtk.rc └── Android.bp ├── AndroidProducts.mk ├── libinit ├── include │ ├── libinit_utils.h │ ├── libinit_dalvik_heap.h │ └── libinit_variant.h ├── Android.bp ├── init_cannon.cpp ├── libinit_dalvik_heap.cpp ├── libinit_variant.cpp └── libinit_utils.cpp ├── lineage.dependencies ├── system.prop ├── setup-makefiles.sh ├── Android.mk ├── overlay-lineage ├── packages │ └── apps │ │ ├── Dialer │ │ └── java │ │ │ └── com │ │ │ └── android │ │ │ └── dialer │ │ │ └── callrecord │ │ │ └── res │ │ │ └── values │ │ │ └── config.xml │ │ └── Aperture │ │ └── app │ │ └── src │ │ └── main │ │ └── res │ │ └── values │ │ └── config.xml └── lineage-sdk │ └── lineage │ └── res │ └── res │ └── values │ └── config.xml ├── lineage_cannon.mk ├── overlay ├── frameworks │ └── base │ │ ├── packages │ │ ├── SettingsProvider │ │ │ └── res │ │ │ │ └── values │ │ │ │ └── defaults.xml │ │ └── SystemUI │ │ │ └── res │ │ │ └── values │ │ │ ├── config.xml │ │ │ └── dimens.xml │ │ └── core │ │ └── res │ │ └── res │ │ ├── values │ │ └── dimens.xml │ │ └── xml │ │ └── power_profile.xml ├── hardware │ └── mediatek │ │ └── PowerOffAlarm │ │ └── res │ │ └── values │ │ └── config.xml └── packages │ └── services │ └── Telephony │ └── res │ └── values │ └── config.xml ├── releasetools.py ├── update-sha1sums.py ├── reorder-libs.py ├── extract-files.sh ├── README.md └── BoardConfig.mk /board-info.txt: -------------------------------------------------------------------------------- 1 | require board=cannon|cannong 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/attributes: -------------------------------------------------------------------------------- 1 | hal_attribute_lineage(mlipay) 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hwservice.te: -------------------------------------------------------------------------------- 1 | type hal_mlipay_hwservice, hwservice_manager_type; 2 | -------------------------------------------------------------------------------- /configs/seccomp/mediaswcodec.policy: -------------------------------------------------------------------------------- 1 | #Mediatek used system call 2 | clock_nanosleep: 1 3 | -------------------------------------------------------------------------------- /sensors/hals.conf: -------------------------------------------------------------------------------- 1 | android.hardware.sensors@2.X-subhal-mediatek.so 2 | sensors.touch.detect.so 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/rild.te: -------------------------------------------------------------------------------- 1 | # Allow rild to set vendor_deviceid_prop 2 | set_prop(rild, vendor_deviceid_prop) 3 | -------------------------------------------------------------------------------- /prebuilts/dtb.img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaomi-mt6853-devs/android_device_xiaomi_cannon/HEAD/prebuilts/dtb.img -------------------------------------------------------------------------------- /prebuilts/dtbo.img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaomi-mt6853-devs/android_device_xiaomi_cannon/HEAD/prebuilts/dtbo.img -------------------------------------------------------------------------------- /sepolicy/vendor/mtk_hal_pq.te: -------------------------------------------------------------------------------- 1 | # Allow PQ HAL to read panel nodes 2 | allow mtk_hal_pq vendor_sysfs_panel:file { read open getattr }; 3 | -------------------------------------------------------------------------------- /configs/thermal/thermal-map.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaomi-mt6853-devs/android_device_xiaomi_cannon/HEAD/configs/thermal/thermal-map.conf -------------------------------------------------------------------------------- /configs/thermal/thermal-camera.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaomi-mt6853-devs/android_device_xiaomi_cannon/HEAD/configs/thermal/thermal-camera.conf -------------------------------------------------------------------------------- /configs/thermal/thermal-class0.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaomi-mt6853-devs/android_device_xiaomi_cannon/HEAD/configs/thermal/thermal-class0.conf -------------------------------------------------------------------------------- /configs/thermal/thermal-normal.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaomi-mt6853-devs/android_device_xiaomi_cannon/HEAD/configs/thermal/thermal-normal.conf -------------------------------------------------------------------------------- /configs/thermal/thermal-phone.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaomi-mt6853-devs/android_device_xiaomi_cannon/HEAD/configs/thermal/thermal-phone.conf -------------------------------------------------------------------------------- /configs/thermal/thermal-tgame.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaomi-mt6853-devs/android_device_xiaomi_cannon/HEAD/configs/thermal/thermal-tgame.conf -------------------------------------------------------------------------------- /Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | soong_namespace { 8 | } 9 | -------------------------------------------------------------------------------- /configs/thermal/thermal-nolimits.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaomi-mt6853-devs/android_device_xiaomi_cannon/HEAD/configs/thermal/thermal-nolimits.conf -------------------------------------------------------------------------------- /configs/thermal/thermal-youtube.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaomi-mt6853-devs/android_device_xiaomi_cannon/HEAD/configs/thermal/thermal-youtube.conf -------------------------------------------------------------------------------- /rro_overlays/CannonCNSettingsProviderOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | runtime_resource_overlay { 2 | name: "CannonCNSettingsProviderOverlay", 3 | vendor: true 4 | } 5 | -------------------------------------------------------------------------------- /rro_overlays/CannonGLSettingsProviderOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | runtime_resource_overlay { 2 | name: "CannonGLSettingsProviderOverlay", 3 | vendor: true 4 | } 5 | -------------------------------------------------------------------------------- /app/InCallService/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Mediatek In-Call Service 4 | 5 | -------------------------------------------------------------------------------- /configs/wifi/wpa_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | p2p_no_group_iface=1 2 | driver_param=use_p2p_group_interface=1 3 | wowlan_triggers=disconnect 4 | p2p_disabled=1 5 | bss_no_flush_when_down=1 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_graphics_composer_default.te: -------------------------------------------------------------------------------- 1 | # Allow graphics composer hal to read panel nodes 2 | allow hal_graphics_composer_default vendor_sysfs_panel:file { read open getattr }; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_mlipay.te: -------------------------------------------------------------------------------- 1 | # HwBinder IPC from client to server 2 | binder_call(hal_mlipay_client, hal_mlipay_server) 3 | 4 | hal_attribute_hwservice(hal_mlipay, hal_mlipay_hwservice) 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/fuelgauged_nvram.te: -------------------------------------------------------------------------------- 1 | allow fuelgauged_nvram sysfs_dt_firmware_android:dir { open read search }; 2 | allow fuelgauged_nvram sysfs_dt_firmware_android:file { getattr open read }; 3 | -------------------------------------------------------------------------------- /rro_overlays/WifiResOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | runtime_resource_overlay { 2 | name: "WifiResOverlay", 3 | theme: "WifiResOverlay", 4 | sdk_version: "current", 5 | vendor: true 6 | } 7 | -------------------------------------------------------------------------------- /sepolicy/vendor/charger.te: -------------------------------------------------------------------------------- 1 | # DRM / DRI GPU driver required 2 | allow charger gpu_device:dir search; 3 | 4 | # Add permission for DRM in animation 5 | allow charger dri_device:chr_file rw_file_perms; 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_light_default.te: -------------------------------------------------------------------------------- 1 | # Grant read perms to hal_light_default for sysfs_leds 2 | allow hal_light_default sysfs_leds:file rw_file_perms; 3 | r_dir_file(hal_light_default, sysfs_leds) 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_wifi_default.te: -------------------------------------------------------------------------------- 1 | # Set fw prop 2 | set_prop(hal_wifi_default, vendor_mtk_wifi_hal_prop) 3 | 4 | # Get hotspot prop 5 | get_prop(hal_wifi_default, vendor_mtk_wifi_hotspot_prop) 6 | -------------------------------------------------------------------------------- /rro_overlays/TetheringResOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | runtime_resource_overlay { 2 | name: "TetheringResOverlay", 3 | theme: "TetheringResOverlay", 4 | sdk_version: "current", 5 | vendor: true 6 | } 7 | -------------------------------------------------------------------------------- /configs/wifi/p2p_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | p2p_no_group_iface=1 2 | driver_param=use_p2p_group_interface=1 3 | bss_expiration_scan_count=1 4 | wowlan_triggers=disconnect 5 | p2p_search_delay=50 6 | p2p_go_he=1 7 | -------------------------------------------------------------------------------- /configs/seccomp/mediaextractor.policy: -------------------------------------------------------------------------------- 1 | # MediaTek used system call 2 | gettimeofday: 1 3 | # for audio TableOfContent thread 4 | ioprio_set: 1 5 | unlinkat: 1 6 | setsockopt: 1 7 | clock_gettime: 1 8 | setrlimit: 1 9 | -------------------------------------------------------------------------------- /sepolicy/vendor/system_app.te: -------------------------------------------------------------------------------- 1 | allow system_app proc_pagetypeinfo:file r_file_perms; 2 | allow system_app sysfs_zram:dir search; 3 | allow system_app sysfs_zram:file r_file_perms; 4 | 5 | hal_client_domain(system_app, hal_mlipay) 6 | -------------------------------------------------------------------------------- /lights/android.hardware.light-service.cannon.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.hardware.light 4 | ILights/default 5 | 6 | 7 | -------------------------------------------------------------------------------- /sepolicy/vendor/dontaudit.te: -------------------------------------------------------------------------------- 1 | # Apps are no longer allowed open access to /dev/ashmem, unless they 2 | # target API level < Q. 3 | dontaudit untrusted_app ashmem_device:chr_file open; 4 | dontaudit untrusted_app vendor_mtk_gpu_prop:file read; 5 | -------------------------------------------------------------------------------- /lights/android.hardware.light-service.cannon.rc: -------------------------------------------------------------------------------- 1 | service vendor.light-default /vendor/bin/hw/android.hardware.light-service.cannon 2 | class hal 3 | user system 4 | group system 5 | # shutting off lights while powering-off 6 | shutdown critical 7 | -------------------------------------------------------------------------------- /sepolicy/vendor/property.te: -------------------------------------------------------------------------------- 1 | vendor_restricted_prop(vendor_fingerprint_prop); 2 | 3 | vendor_internal_prop(vendor_camera_prop); 4 | 5 | vendor_internal_prop(vendor_deviceid_prop); 6 | 7 | vendor_internal_prop(vendor_thermal_prop); 8 | 9 | vendor_public_prop(vendor_payment_security_prop) 10 | -------------------------------------------------------------------------------- /rro_overlays/WifiResOverlay/res/values/integers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1000 5 | 6 | -------------------------------------------------------------------------------- /rootdir/etc/init.recovery.mt6853.rc: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2023 The LineageOS Project 3 | # SPDX-License-Identifier: GPL-2.0-only 4 | # 5 | 6 | on init 7 | setprop sys.usb.configfs 1 8 | 9 | on fs 10 | wait /dev/block/platform/bootdevice/ 11 | symlink /dev/block/platform/bootdevice/ /dev/block/bootdevice 12 | -------------------------------------------------------------------------------- /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_cannon.mk 9 | 10 | COMMON_LUNCH_CHOICES := \ 11 | lineage_cannon-user \ 12 | lineage_cannon-userdebug \ 13 | lineage_cannon-eng 14 | -------------------------------------------------------------------------------- /rootdir/etc/init.sensor_2_0.rc: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2023 The LineageOS Project 3 | # SPDX-License-Identifier: GPL-2.0-only 4 | # 5 | 6 | on post-fs-data 7 | # calibration 8 | mkdir /data/vendor/sensor 0774 system system 9 | # Sensor 10 | chmod 0660 /dev/hf_manager 11 | chown system system /dev/hf_manager 12 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_secure_element_default.te: -------------------------------------------------------------------------------- 1 | # Allow SE HAL to rw nfc_device 2 | allow hal_secure_element_default nfc_device:file rw_file_perms; 3 | allow hal_secure_element_default nfc_device:chr_file rw_file_perms; 4 | 5 | # Allow SE HAL to rw teei_client_device 6 | allow hal_secure_element_default teei_client_device:chr_file rw_file_perms; 7 | -------------------------------------------------------------------------------- /sensors/android.hardware.sensors@2.1-service.cannon-multihal.rc: -------------------------------------------------------------------------------- 1 | service vendor.sensors-hal-2-1-multihal /vendor/bin/hw/android.hardware.sensors@2.1-service.cannon-multihal 2 | class hal 3 | user system 4 | group system wakelock context_hub 5 | writepid /dev/cpuset/system-background/tasks 6 | capabilities BLOCK_SUSPEND 7 | rlimit rtprio 10 10 8 | -------------------------------------------------------------------------------- /rro_overlays/CannonCNSettingsProviderOverlay/res/values/defaults.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | Redmi Note 9 5G 9 | 10 | -------------------------------------------------------------------------------- /rro_overlays/CannonGLSettingsProviderOverlay/res/values/defaults.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | Redmi Note 9T 9 | 10 | -------------------------------------------------------------------------------- /sepolicy/private/property_contexts: -------------------------------------------------------------------------------- 1 | # Camera 2 | demo.hole u:object_r:exported_system_prop:s0 3 | demo.near u:object_r:exported_system_prop:s0 4 | demo.far u:object_r:exported_system_prop:s0 5 | demo.fb u:object_r:exported_system_prop:s0 6 | -------------------------------------------------------------------------------- /sensors/android.hardware.sensors@2.1-cannon-multihal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.hardware.sensors 4 | hwbinder 5 | 2.1 6 | 7 | ISensors 8 | default 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /configs/seccomp/mediacodec.policy: -------------------------------------------------------------------------------- 1 | #Mediatek used system call 2 | getpid: 1 3 | gettid: 1 4 | sendto: 1 5 | pselect6: 1 6 | sched_getparam: 1 7 | sched_getscheduler: 1 8 | mlock: 1 9 | munlock: 1 10 | recvfrom: 1 11 | sched_getaffinity: 1 12 | sched_setaffinity: 1 13 | sched_getaffinity: 1 14 | flock: 1 15 | fchownat: 1 16 | fchmodat: 1 17 | fsync: 1 18 | sysinfo: 1 19 | setsockopt: 1 20 | setrlimit: 1 21 | eventfd2: 1 22 | unlinkat: 1 23 | -------------------------------------------------------------------------------- /configs/wifi/wpa_supplicant.conf: -------------------------------------------------------------------------------- 1 | ctrl_interface=wlan0 2 | update_config=1 3 | manufacturer=MediaTek Inc. 4 | device_name=Wireless Client 5 | model_name=MTK Wireless Model 6 | model_number=1.0 7 | serial_number=2.0 8 | device_type=10-0050F204-5 9 | os_version=01020300 10 | config_methods=display push_button keypad 11 | p2p_no_group_iface=1 12 | driver_param=use_p2p_group_interface=1 13 | hs20=1 14 | pmf=1 15 | wowlan_disconnect_on_deinit=1 16 | sae_pwe=2 17 | -------------------------------------------------------------------------------- /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 | 17 | -------------------------------------------------------------------------------- /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-goodix 14 | keyboard.builtIn = 1 15 | keyboard.orientationAware = 1 16 | 17 | -------------------------------------------------------------------------------- /configs/keylayouts/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 | # HOME --> DPAD_CENTER 12 | #key 353 DPAD_CENTER VIRTUAL 13 | #key 105 DPAD_LEFT VIRTUAL 14 | #key 106 DPAD_RIGHT VIRTUAL 15 | 16 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_mlipay_default.te: -------------------------------------------------------------------------------- 1 | type hal_mlipay_default, domain; 2 | hal_server_domain(hal_mlipay_default, hal_mlipay) 3 | 4 | type hal_mlipay_default_exec, exec_type, vendor_file_type, file_type; 5 | 6 | init_daemon_domain(hal_mlipay_default) 7 | 8 | allow hal_mlipay_default { 9 | ion_device 10 | tee_device 11 | teei_client_device 12 | }:chr_file rw_file_perms; 13 | 14 | 15 | get_prop(hal_mlipay_default, vendor_fingerprint_prop) 16 | set_prop(hal_mlipay_default, vendor_payment_security_prop) 17 | -------------------------------------------------------------------------------- /configs/keylayouts/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 | 16 | -------------------------------------------------------------------------------- /rro_overlays/WifiResOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /libinit/include/libinit_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 The LineageOS Project 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #ifndef LIBINIT_UTILS_H 8 | #define LIBINIT_UTILS_H 9 | 10 | #include 11 | 12 | void property_override(std::string prop, std::string value, bool add = true); 13 | 14 | void set_ro_build_prop(const std::string &prop, const std::string &value, bool product = false); 15 | 16 | std::string fingerprint_to_description(std::string fingerprint); 17 | 18 | #endif // LIBINIT_UTILS_H 19 | -------------------------------------------------------------------------------- /lineage.dependencies: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "remote": "github", 4 | "repository": "xiaomi-mt6853-devs/android_kernel_xiaomi_cannon", 5 | "target_path": "kernel/xiaomi/cannon" 6 | }, 7 | { 8 | "repository": "android_device_mediatek_sepolicy_vndr", 9 | "target_path": "device/mediatek/sepolicy_vndr" 10 | }, 11 | { 12 | "repository": "android_hardware_mediatek", 13 | "target_path": "hardware/mediatek" 14 | }, 15 | { 16 | "repository": "android_hardware_xiaomi", 17 | "target_path": "hardware/xiaomi" 18 | } 19 | ] 20 | -------------------------------------------------------------------------------- /configs/thermal/thermald-devices.conf: -------------------------------------------------------------------------------- 1 | #Device discribe config 2 | 3 | 4 | #GPU 5 | [ 6 | name:gpu 7 | cooling_name:mtk-cl-gpu 8 | def_target:0 9 | select_higher:1 10 | ] 11 | 12 | #battery 13 | [ 14 | name:battery 15 | cooling_name:battery 16 | def_target:0 17 | select_higher:1 18 | ] 19 | 20 | #modem 21 | [ 22 | name:mtk-cl-md 23 | cooling_name:mtk-cl-md 24 | def_target:0 25 | select_higher:1 26 | ] 27 | 28 | #temp_state 29 | [ 30 | name:temp_state 31 | path:/sys/class/thermal/thermal_message/temp_state 32 | def_target:0 33 | select_higher:1 34 | ] 35 | 36 | -------------------------------------------------------------------------------- /libinit/include/libinit_dalvik_heap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 The LineageOS Project 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #ifndef LIBINIT_DALVIK_HEAP_H 8 | #define LIBINIT_DALVIK_HEAP_H 9 | 10 | #include 11 | 12 | typedef struct dalvik_heap_info { 13 | std::string heapstartsize; 14 | std::string heapgrowthlimit; 15 | std::string heapsize; 16 | std::string heapminfree; 17 | std::string heapmaxfree; 18 | std::string heaptargetutilization; 19 | } dalvik_heap_info_t; 20 | 21 | void set_dalvik_heap(void); 22 | 23 | #endif // LIBINIT_DALVIK_HEAP_H 24 | -------------------------------------------------------------------------------- /rro_overlays/TetheringResOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /rro_overlays/CannonCNSettingsProviderOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 8 | 9 | 15 | 16 | -------------------------------------------------------------------------------- /rro_overlays/CannonGLSettingsProviderOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 8 | 9 | 15 | 16 | -------------------------------------------------------------------------------- /libinit/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2021 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | cc_library_static { 8 | name: "libinit_cannon", 9 | srcs: [ 10 | "libinit_dalvik_heap.cpp", 11 | "libinit_variant.cpp", 12 | "libinit_utils.cpp", 13 | ], 14 | whole_static_libs: ["libbase"], 15 | export_include_dirs: ["include"], 16 | recovery_available: true, 17 | } 18 | 19 | cc_library_static { 20 | name: "init_cannon", 21 | srcs: ["init_cannon.cpp"], 22 | whole_static_libs: ["libinit_cannon"], 23 | include_dirs: ["system/core/init"], 24 | recovery_available: true, 25 | } 26 | -------------------------------------------------------------------------------- /system.prop: -------------------------------------------------------------------------------- 1 | # Audio 2 | persist.audio.button_jack.profile=volume 3 | persist.audio.button_jack.switch=0 4 | ro.audio.silent=0 5 | vendor.audio.spkcal.copy.inhal=true 6 | 7 | # Charger 8 | ro.charger.enable_suspend=true 9 | 10 | # Dex 11 | persist.bg.dexopt.enable=true 12 | 13 | # Radio 14 | persist.radio.apm_sim_not_pwdn=1 15 | 16 | # Watchdog 17 | persist.sys.oom_crash_on_watchdog=true 18 | persist.sys.watchdog_enhanced=true 19 | 20 | # Performance 21 | ro.mtk_perf_fast_start_win=1 22 | ro.mtk_perf_response_time=1 23 | ro.mtk_perf_simple_start_win=1 24 | 25 | # Netflix 26 | ro.netflix.bsp_rev=MTK6853-32100-1 27 | ro.netflix.channel=497730f0-ad4b-11e7-95a4-c7ad113ce187 28 | ro.netflix.signup=1 29 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_init.te: -------------------------------------------------------------------------------- 1 | typeattribute vendor_init data_between_core_and_vendor_violators; 2 | 3 | # Allow vendor_init to read vts_status_prop 4 | get_prop(vendor_init, vts_status_prop) 5 | 6 | # Allow vendor_init to create fingerprint dirs 7 | allow vendor_init fingerprint_data_file:dir { rw_dir_perms relabelto setattr }; 8 | allow vendor_init vendor_fingerprint_data_file:dir { rw_dir_perms relabelto setattr }; 9 | 10 | # Allow vendor_init to create NFC dirs 11 | allow vendor_init nfc_data_vendor_file:dir { r_dir_perms create_dir_perms }; 12 | 13 | allow vendor_init proc_sched_stune:file w_file_perms; 14 | allow vendor_init proc_vm_dirty:file w_file_perms; 15 | 16 | rw_dir_file(vendor_init, sysfs_leds) 17 | -------------------------------------------------------------------------------- /app/InCallService/src/org/lineageos/mediatek/incallservice/OnLockedBootCompleteReceiver.java: -------------------------------------------------------------------------------- 1 | package org.lineageos.mediatek.incallservice; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Intent; 5 | import android.content.Context; 6 | 7 | import android.util.Log; 8 | 9 | public class OnLockedBootCompleteReceiver extends BroadcastReceiver { 10 | private static final String LOG_TAG = "MediatekInCallService"; 11 | 12 | @Override 13 | public void onReceive(final Context context, Intent intent) { 14 | Log.i(LOG_TAG, "onBoot"); 15 | 16 | Intent sIntent = new Intent(context, VolumeChangeService.class); 17 | context.startService(sIntent); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /configs/vintf/manifest_nfc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.hardware.nfc 4 | hwbinder 5 | @1.2::INfc/default 6 | 7 | 8 | vendor.nxp.hardware.nfc 9 | hwbinder 10 | @1.1::INqNfc/default 11 | 12 | 13 | android.hardware.secure_element 14 | hwbinder 15 | @1.0::ISecureElement/SIM1 16 | @1.0::ISecureElement/eSE1 17 | 18 | 19 | -------------------------------------------------------------------------------- /libinit/include/libinit_variant.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 The LineageOS Project 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #ifndef LIBINIT_VARIANT_H 8 | #define LIBINIT_VARIANT_H 9 | 10 | #include 11 | #include 12 | 13 | typedef struct variant_info { 14 | std::string hwc_value; 15 | std::string sku_value; 16 | 17 | std::string brand; 18 | std::string device; 19 | std::string model; 20 | std::string build_fingerprint; 21 | 22 | bool multisim; 23 | bool nfc; 24 | } variant_info_t; 25 | 26 | void search_variant(const std::vector variants); 27 | 28 | void set_variant_props(const variant_info_t variant); 29 | 30 | #endif // LIBINIT_VARIANT_H 31 | -------------------------------------------------------------------------------- /configs/thermal/thermal-chg-only.conf: -------------------------------------------------------------------------------- 1 | [VIRTUAL-SENSOR] 2 | algo_type virtual 3 | sensors mtktsAP mtktsbattery xm_charger mtktscpu mtktsbtsnrpa 4 | weight 424 402 31 -3 50 5 | polling 1000 6 | weight_sum 1000 7 | compensation 2566 8 | 9 | [SS-CPU4] 10 | algo_type ss 11 | sensor VIRTUAL-SENSOR 12 | device cpu6 13 | polling 500 14 | trig 38000 43000 46000 51000 15 | clr 37000 42000 45000 48000 16 | target 1800000 1548000 1175000 841000 17 | 18 | [MONITOR-BAT] 19 | algo_type monitor 20 | sensor VIRTUAL-SENSOR 21 | device battery 22 | polling 1000 23 | trig 37000 39000 41000 42000 43000 45000 48000 60000 24 | clr 36000 38000 40000 41000 42000 43000 46000 48000 25 | target 502 703 704 804 906 1210 1313 1515 26 | -------------------------------------------------------------------------------- /sepolicy/vendor/file.te: -------------------------------------------------------------------------------- 1 | # Camera 2 | type camera_persist_file, file_type; 3 | type camera_vendor_data_file, data_file_type, file_type; 4 | 5 | # Fingerprint 6 | type fingerprint_data_file, core_data_file_type, data_file_type, file_type; 7 | type vendor_fingerprint_data_file, data_file_type, file_type; 8 | type vendor_fingerprint_device, fs_type, sysfs_type; 9 | 10 | # Latency 11 | type latency_device, dev_type; 12 | 13 | # Panel 14 | type vendor_sysfs_panel, fs_type, sysfs_type; 15 | 16 | # Performance 17 | type proc_vm_dirty, fs_type, proc_type; 18 | type proc_sched_stune, fs_type, proc_type; 19 | type sysfs_mtk_gpufreq, fs_type, sysfs_type; 20 | 21 | # Touchpanel 22 | type sysfs_touchpanel, sysfs_type, fs_type; 23 | 24 | # PPS 25 | type pps_socket, file_type; 26 | -------------------------------------------------------------------------------- /sepolicy/vendor/hwservice_contexts: -------------------------------------------------------------------------------- 1 | # Fingerprint 2 | vendor.goodix.hardware.cap.biometrics.fingerprint::IGoodixFingerprintDaemon u:object_r:hal_fingerprint_hwservice:s0 3 | vendor.goodix.hardware.cap.biometrics.fingerprint::IGoodixFingerprintDaemonExt u:object_r:hal_fingerprint_hwservice:s0 4 | 5 | # Mlipay 6 | vendor.xiaomi.hardware.mlipay::IMlipayService u:object_r:hal_mlipay_hwservice:s0 7 | 8 | # NFC 9 | vendor.nxp.hardware.nfc::INqNfc u:object_r:hal_nfc_hwservice:s0 10 | vendor.nxp.nxpnfc::INxpNfc u:object_r:hal_nfc_hwservice:s0 11 | vendor.nxp.nxpese::INxpEse u:object_r:hal_nfc_hwservice:s0 12 | -------------------------------------------------------------------------------- /configs/permissions/privapp-permissions-hotword.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sepolicy/vendor/mtk_hal_camera.te: -------------------------------------------------------------------------------- 1 | # Allow mtk_camera_hal to set and get vendor_camera_prop 2 | set_prop(mtk_hal_camera, vendor_camera_prop) 3 | get_prop(mtk_hal_camera, vendor_camera_prop) 4 | 5 | # Allow mtk_hal_camera to rw camera device 6 | allow mtk_hal_camera camera_device:chr_file rw_file_perms; 7 | 8 | binder_call(mtk_hal_camera, mtk_hal_neuralnetworks) 9 | 10 | # Allow mtk_hal_camera to read camera persist files 11 | allow mtk_hal_camera camera_persist_file:dir rw_dir_perms; 12 | allow mtk_hal_camera camera_persist_file:file create_file_perms; 13 | 14 | # Allow mtk_hal_camera to access camera data files 15 | allow mtk_hal_camera camera_vendor_data_file:dir create_dir_perms; 16 | allow mtk_hal_camera camera_vendor_data_file:file create_file_perms; 17 | 18 | get_prop(mtk_hal_camera, vendor_mtk_pq_prop) 19 | get_prop(mtk_hal_camera, vendor_mtk_pq_ro_prop) 20 | -------------------------------------------------------------------------------- /configs/seccomp/android.hardware.media.c2@1.2-extended-seccomp-policy: -------------------------------------------------------------------------------- 1 | connect: 1 2 | fcntl64: 1 3 | socket: 1 4 | writev: 1 5 | clock_nanosleep: 1 6 | eventfd2: 1 7 | sched_getparam: 1 8 | sched_getscheduler :1 9 | setsockopt: 1 10 | bind: 1 11 | listen: 1 12 | 13 | # Add more for 32bits process, from android.hardware.media.c2@1.1-default-arm.policy 14 | mmap2: arg2 in ~PROT_EXEC || arg2 in ~PROT_WRITE 15 | ftruncate64: 1 16 | getuid32: 1 17 | open: 1 18 | fstat64: 1 19 | readlink: 1 20 | fstatfs64: 1 21 | _llseek: 1 22 | fstatat64: 1 23 | ugetrlimit: 1 24 | # crash dump policy additions 25 | sigreturn: 1 26 | futex: 1 27 | #mmap2: arg2 in 0x1|0x2 28 | geteuid32: 1 29 | getgid32: 1 30 | getegid32: 1 31 | getgroups32: 1 32 | getpriority: 1 33 | mlock: 1 34 | munlock: 1 35 | fchmod: 1 36 | getuid: 1 37 | mmap: 1 38 | getrlimit: 1 39 | newfstatat: 1 40 | fstat: 1 41 | fstatfs: 1 42 | -------------------------------------------------------------------------------- /configs/public.libraries.txt: -------------------------------------------------------------------------------- 1 | libOpenCL.so 2 | libneuron_platform.so 64 3 | libion_mtk.so 64 4 | libvpu.so 64 5 | libapusys.so 64 6 | libmpbase.so 64 7 | libmialgoengine.so 64 8 | libarcsoft_beautyshot.so 64 9 | libarcsoft_dualcam_refocus.so 64 10 | libarcsoft_portrait_lighting.so 64 11 | libarcsoft_portrait_lighting_c.so 64 12 | libarcsoft_high_dynamic_range.so 64 13 | libarcsoft_low_light_hdr.so 64 14 | libarcsoft_hdr_detection.so 64 15 | libarcsoft_supernight.so 64 16 | libalCFR.so 64 17 | libmibokeh_mt6873.so 64 18 | libalhLDC.so 64 19 | android.hidl.allocator@1.0.so 64 20 | vendor.mediatek.hardware.apuware.apusys@1.0.so 64 21 | vendor.mediatek.hardware.apuware.utils@1.0.so 64 22 | vendor.mediatek.hardware.apuware.xrp@1.0.so 64 23 | libSuperSensor.so 64 24 | libSuperSensorCPU.so 64 25 | libSuperSensorProcessor.so 64 26 | vendor.mediatek.hardware.camera.isphal@1.0.so 64 27 | libmtkisp_metadata.so 64 28 | -------------------------------------------------------------------------------- /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=cannon 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 | -------------------------------------------------------------------------------- /Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2023 The LineageOS Project 3 | # 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | 7 | LOCAL_PATH := $(call my-dir) 8 | 9 | ifeq ($(TARGET_DEVICE),cannon) 10 | include $(call all-subdir-makefiles,$(LOCAL_PATH)) 11 | 12 | VENDOR_SYMLINKS := \ 13 | $(TARGET_OUT_VENDOR)/lib/hw \ 14 | $(TARGET_OUT_VENDOR)/lib64/hw 15 | 16 | $(VENDOR_SYMLINKS): $(LOCAL_INSTALLED_MODULE) 17 | $(hide) echo "Making vendor symlinks" 18 | @mkdir -p $(TARGET_OUT_VENDOR)/lib/hw 19 | @mkdir -p $(TARGET_OUT_VENDOR)/lib64/hw 20 | @ln -sf libSoftGatekeeper.so $(TARGET_OUT_VENDOR)/lib64/hw/gatekeeper.default.so 21 | @ln -sf /vendor/lib/egl/libGLES_mali.so $(TARGET_OUT_VENDOR)/lib/hw/vulkan.mt6853.so 22 | @ln -sf /vendor/lib64/egl/libGLES_mali.so $(TARGET_OUT_VENDOR)/lib64/hw/vulkan.mt6853.so 23 | $(hide) touch $@ 24 | 25 | ALL_DEFAULT_INSTALLED_MODULES += $(VENDOR_SYMLINKS) 26 | 27 | endif 28 | -------------------------------------------------------------------------------- /overlay-lineage/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | true 19 | 4 20 | 21 | -------------------------------------------------------------------------------- /app/InCallService/Android.bp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 bengris32 3 | * Copyright (C) 2022 LineageOS 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | android_app { 19 | name: "MtkInCallService", 20 | 21 | srcs: ["src/**/*.java"], 22 | resource_dirs: ["res"], 23 | 24 | certificate: "platform", 25 | platform_apis: true, 26 | privileged: true, 27 | 28 | optimize: { 29 | enabled: false, 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lineage_cannon.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 some common Lineage stuff. 12 | $(call inherit-product, vendor/lineage/config/common_full_phone.mk) 13 | 14 | # Inherit from cannon device 15 | $(call inherit-product, device/xiaomi/cannon/device.mk) 16 | 17 | PRODUCT_DEVICE := cannon 18 | PRODUCT_NAME := lineage_cannon 19 | PRODUCT_BRAND := Redmi 20 | PRODUCT_MODEL := M2007J22C 21 | PRODUCT_MANUFACTURER := Xiaomi 22 | 23 | PRODUCT_GMS_CLIENTID_BASE := android-xiaomi 24 | 25 | PRODUCT_BUILD_PROP_OVERRIDES += \ 26 | PRIVATE_BUILD_DESC="cannong-user 12 SP1A.210812.016 V13.0.3.0.SJEMIXM release-keys" 27 | 28 | BUILD_FINGERPRINT := Redmi/cannong_global/cannong:12/SP1A.210812.016/V13.0.3.0.SJEMIXM:user/release-keys 29 | -------------------------------------------------------------------------------- /overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | false 22 | 23 | 24 | false 25 | 26 | -------------------------------------------------------------------------------- /app/InCallService/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 15 | 16 | 17 | 18 | 19 | 20 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /configs/vintf/compatibility_matrix.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.frameworks.schedulerservice 4 | 1.0 5 | 6 | 7 | android.frameworks.sensorservice 8 | 1.0 9 | 10 | 11 | android.hidl.allocator 12 | 1.0 13 | 14 | 15 | android.hidl.manager 16 | 1.0 17 | 18 | 19 | android.hidl.memory 20 | 1.0 21 | 22 | 23 | android.hidl.token 24 | 1.0 25 | 26 | 27 | android.system.wifi.keystore 28 | 1.0 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/InCallService/src/org/lineageos/mediatek/incallservice/CallStateListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 The LineageOS Project 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | package org.lineageos.mediatek.incallservice; 8 | 9 | import android.media.AudioManager; 10 | 11 | import android.telephony.TelephonyManager; 12 | import android.telephony.TelephonyCallback; 13 | 14 | import android.util.Log; 15 | 16 | public class CallStateListener extends TelephonyCallback implements TelephonyCallback.CallStateListener { 17 | private static final String LOG_TAG = "MtkInCallService"; 18 | private AudioManager mAudioManager; 19 | 20 | public CallStateListener(AudioManager audioManager) { 21 | mAudioManager = audioManager; 22 | } 23 | 24 | @Override 25 | public void onCallStateChanged(int state) { 26 | if (state == TelephonyManager.CALL_STATE_OFFHOOK || state == TelephonyManager.CALL_STATE_RINGING) { 27 | Log.d(LOG_TAG, "CallStateListener: CALL_STATE_OFFHOOK, setting gain."); 28 | GainUtils.setGainLevel(mAudioManager.getStreamVolume(AudioManager.STREAM_VOICE_CALL)); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lights/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 The LineageOS Project 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | cc_binary { 17 | name: "android.hardware.light-service.cannon", 18 | init_rc: ["android.hardware.light-service.cannon.rc"], 19 | vintf_fragments: ["android.hardware.light-service.cannon.xml"], 20 | relative_install_path: "hw", 21 | srcs: [ 22 | "main.cpp", 23 | "Light.cpp", 24 | ], 25 | shared_libs: [ 26 | "libbase", 27 | "libhardware", 28 | "libbinder_ndk", 29 | "android.hardware.light-V1-ndk", 30 | ], 31 | vendor: true, 32 | } 33 | -------------------------------------------------------------------------------- /sepolicy/vendor/mi_thermald.te: -------------------------------------------------------------------------------- 1 | type mi_thermald, domain; 2 | type mi_thermald_exec, exec_type, vendor_file_type, file_type; 3 | 4 | init_daemon_domain(mi_thermald) 5 | 6 | allow mi_thermald self:capability { fsetid sys_boot }; 7 | allow mi_thermald mi_thermald:capability { chown fowner }; 8 | allow mi_thermald mi_thermald:capability2 { wake_alarm block_suspend }; 9 | 10 | # Allow mi_thermald to read thermal_core_data_file 11 | allow mi_thermald thermal_core_data_file:dir rw_dir_perms; 12 | allow mi_thermald thermal_core_data_file:file create_file_perms; 13 | 14 | allow mi_thermald sysfs_batteryinfo:dir { search }; 15 | allow mi_thermald sysfs_batteryinfo:file r_file_perms; 16 | 17 | r_dir_file(mi_thermald, sysfs) 18 | r_dir_file(mi_thermald, sysfs_leds) 19 | r_dir_file(mi_thermald, sysfs_therm) 20 | r_dir_file(mi_thermald, sysfs_thermal) 21 | r_dir_file(mi_thermald, sysfs_power_supply) 22 | 23 | # Allow mi_thermald to read and write to sysfs_* 24 | allow mi_thermald { 25 | sysfs 26 | sysfs_leds 27 | sysfs_therm 28 | sysfs_thermal 29 | sysfs_power_supply 30 | sysfs_devices_system_cpu 31 | }:{ 32 | file 33 | lnk_file 34 | } rw_file_perms; 35 | 36 | set_prop(mi_thermald, vendor_thermal_prop) 37 | -------------------------------------------------------------------------------- /app/InCallService/src/org/lineageos/mediatek/incallservice/GainUtils.java: -------------------------------------------------------------------------------- 1 | package org.lineageos.mediatek.incallservice; 2 | 3 | import android.media.AudioDeviceInfo; 4 | import android.media.AudioSystem; 5 | 6 | import android.util.Log; 7 | 8 | public class GainUtils { 9 | public static final String LOG_TAG = "MediatekInCallService"; 10 | 11 | public static void setGainLevel(int audioDevice, int gainIndex, int streamType) { 12 | String parameters = String.format("volumeDevice=%d;volumeIndex=%d;volumeStreamType=%d", 13 | audioDevice, Math.min(7, gainIndex), streamType); 14 | Log.d(LOG_TAG, "Setting audio parameters to: " + parameters); 15 | AudioSystem.setParameters(parameters); 16 | } 17 | 18 | /** 19 | * Sets the gain level for built-in earpiece and bluetooth SCO devices. 20 | * @param gainIndex The gain level to set. 21 | */ 22 | public static void setGainLevel(int gainIndex) { 23 | GainUtils.setGainLevel(AudioDeviceInfo.TYPE_BUILTIN_EARPIECE, gainIndex, AudioSystem.STREAM_VOICE_CALL); 24 | GainUtils.setGainLevel(AudioDeviceInfo.TYPE_BLUETOOTH_SCO, gainIndex, AudioSystem.STREAM_VOICE_CALL); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sepolicy/vendor/property_contexts: -------------------------------------------------------------------------------- 1 | # Camera 2 | vendor.camera.sensor. u:object_r:vendor_camera_prop:s0 3 | persist.vendor.camera. u:object_r:vendor_camera_prop:s0 4 | 5 | # Fingerprint 6 | persist.vendor.sys.fp. u:object_r:vendor_fingerprint_prop:s0 7 | ro.hardware.fp u:object_r:vendor_fingerprint_prop:s0 8 | vendor.fps_hal. u:object_r:vendor_fingerprint_prop:s0 9 | 10 | # IMEI 11 | ro.vendor.oem.sno u:object_r:vendor_deviceid_prop:s0 12 | ro.vendor.oem.psno u:object_r:vendor_deviceid_prop:s0 13 | ro.vendor.oem.imei u:object_r:vendor_deviceid_prop:s0 14 | ro.vendor.oem.imei1 u:object_r:vendor_deviceid_prop:s0 15 | ro.vendor.oem.imei2 u:object_r:vendor_deviceid_prop:s0 16 | 17 | # Thermal 18 | vendor.sys.thermal. u:object_r:vendor_thermal_prop:s0 19 | 20 | # Mlipay 21 | persist.vendor.sys.pay u:object_r:vendor_payment_security_prop:s0 22 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_fingerprint_default.te: -------------------------------------------------------------------------------- 1 | typeattribute hal_fingerprint_default data_between_core_and_vendor_violators; 2 | 3 | # Allow fingerprint HAL to read and write fingerprint node 4 | allow hal_fingerprint_default vendor_fingerprint_device:dir r_dir_perms; 5 | allow hal_fingerprint_default vendor_fingerprint_device:file rw_file_perms; 6 | 7 | # Allow fingerprint HAL to setup fingerprint database files 8 | allow hal_fingerprint_default fingerprint_data_file:dir rw_dir_perms; 9 | allow hal_fingerprint_default fingerprint_data_file:file create_file_perms; 10 | allow hal_fingerprint_default vendor_fingerprint_data_file:dir rw_dir_perms; 11 | allow hal_fingerprint_default vendor_fingerprint_data_file:file create_file_perms; 12 | 13 | # Create fingerprint HAL entrypoint 14 | allow hal_fingerprint_default hal_fingerprint_default_exec:file entrypoint; 15 | 16 | # Allow fingerprint HAL to get and set its props 17 | get_prop(hal_fingerprint_default, vendor_fingerprint_prop) 18 | set_prop(hal_fingerprint_default, vendor_fingerprint_prop) 19 | 20 | # Allow fingerprint HAL to create netlink_socket 21 | allow hal_fingerprint_default self:netlink_socket create_socket_perms_no_ioctl; 22 | 23 | # Allow fingerprint HAL to write sysfs wakeup nodes 24 | allow hal_fingerprint_default sysfs_wakeup:file w_file_perms; 25 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_audio_default.te: -------------------------------------------------------------------------------- 1 | allow hal_audio_default hal_audio_default:netlink_kobject_uevent_socket { create bind read setopt }; 2 | allow hal_audio_default property_socket:sock_file write; 3 | allow hal_audio_default init:unix_stream_socket connectto; 4 | 5 | allow hal_audio_default adsp_device:chr_file rw_file_perms; 6 | allow hal_audio_default audio_ipi_device:chr_file rw_file_perms; 7 | allow hal_audio_default ccci_device:chr_file rw_file_perms; 8 | allow hal_audio_default ccci_aud_device:chr_file rw_file_perms; 9 | allow hal_audio_default ebc_device:chr_file rw_file_perms; 10 | allow hal_audio_default vow_device:chr_file rw_file_perms; 11 | 12 | allow hal_audio_default persist_data_file:dir search; 13 | allow hal_audio_default mnt_vendor_file:dir search; 14 | allow hal_audio_default mtk_audiohal_data_file:dir create_dir_perms; 15 | allow hal_audio_default mtk_audiohal_data_file:file create_file_perms; 16 | 17 | allow hal_audio_default sysfs_boot_mode:file r_file_perms; 18 | 19 | set_prop(hal_audio_default, vendor_mtk_audiohal_prop) 20 | get_prop(hal_audio_default, vendor_mtk_audiohal_prop) 21 | get_prop(hal_audio_default, vendor_mtk_default_prop) 22 | get_prop(hal_audio_default, vendor_mtk_audio_prop) 23 | set_prop(hal_audio_default, vendor_mtk_audio_prop) 24 | get_prop(hal_audio_default, vendor_mtk_wmt_prop) 25 | -------------------------------------------------------------------------------- /lights/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 The LineageOS Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | 20 | #include "Light.h" 21 | 22 | using ::aidl::android::hardware::light::Lights; 23 | 24 | int main() { 25 | ABinderProcess_setThreadPoolMaxThreadCount(0); 26 | std::shared_ptr lights = ndk::SharedRefBase::make(); 27 | 28 | const std::string instance = std::string() + Lights::descriptor + "/default"; 29 | binder_status_t status = AServiceManager_addService(lights->asBinder().get(), instance.c_str()); 30 | CHECK(status == STATUS_OK); 31 | 32 | ABinderProcess_joinThreadPool(); 33 | return EXIT_FAILURE; // should not reached 34 | } 35 | -------------------------------------------------------------------------------- /rootdir/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | // Init configuration files 8 | prebuilt_etc { 9 | name: "init.connectivity.rc", 10 | src: "etc/init.connectivity.rc", 11 | sub_dir: "init/hw", 12 | vendor: true, 13 | } 14 | 15 | prebuilt_etc { 16 | name: "init.modem.rc", 17 | src: "etc/init.modem.rc", 18 | sub_dir: "init/hw", 19 | vendor: true, 20 | } 21 | 22 | prebuilt_etc { 23 | name: "init.mt6853.rc", 24 | src: "etc/init.mt6853.rc", 25 | sub_dir: "init/hw", 26 | vendor: true, 27 | } 28 | 29 | prebuilt_etc { 30 | name: "init.mt6853.usb.rc", 31 | src: "etc/init.mt6853.usb.rc", 32 | sub_dir: "init/hw", 33 | vendor: true, 34 | } 35 | 36 | prebuilt_etc { 37 | name: "init.project.rc", 38 | src: "etc/init.project.rc", 39 | sub_dir: "init/hw", 40 | vendor: true, 41 | } 42 | 43 | prebuilt_etc { 44 | name: "init.sensor_2_0.rc", 45 | src: "etc/init.sensor_2_0.rc", 46 | sub_dir: "init/hw", 47 | vendor: true, 48 | } 49 | 50 | prebuilt_etc { 51 | name: "init.cannon.rc", 52 | src: "etc/init.cannon.rc", 53 | sub_dir: "init/hw", 54 | vendor: true, 55 | } 56 | 57 | prebuilt_etc { 58 | name: "ueventd.mtk.rc", 59 | filename: "ueventd.rc", 60 | src: "etc/ueventd.mtk.rc", 61 | vendor: true, 62 | } 63 | 64 | // fstab 65 | prebuilt_etc { 66 | name: "fstab.mt6853", 67 | src: "etc/fstab.mt6853", 68 | vendor: true, 69 | } 70 | -------------------------------------------------------------------------------- /sensors/service.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020 The Android Open Source 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 | #include "HalProxy.h" 22 | 23 | using android::hardware::configureRpcThreadpool; 24 | using android::hardware::joinRpcThreadpool; 25 | using android::hardware::sensors::V2_1::ISensors; 26 | using android::hardware::sensors::V2_1::implementation::HalProxyV2_1; 27 | 28 | int main(int /* argc */, char** /* argv */) { 29 | configureRpcThreadpool(1, true); 30 | 31 | android::sp halProxy = new HalProxyV2_1(); 32 | if (halProxy->registerAsService() != ::android::OK) { 33 | ALOGE("Failed to register Sensors HAL instance"); 34 | return -1; 35 | } 36 | 37 | joinRpcThreadpool(); 38 | return 1; // joinRpcThreadpool shouldn't exit 39 | } 40 | -------------------------------------------------------------------------------- /overlay/hardware/mediatek/PowerOffAlarm/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 20 | rtc,alarm,timerfd 21 | 22 | 27 | 60000 28 | 29 | 30 | -------------------------------------------------------------------------------- /rro_overlays/WifiResOverlay/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 1-13 7 | 8 | 11 | 36,38,40,42,44,46,48,149,153,157,161,165 12 | 13 | 16 | 5,21,37,53,69,85,101,117,133,149,165,181,197,213,229 17 | 18 | 19 | 00-0C-E7 20 | 21 | 23 | 1730560,3461120,6922240,524288,1048576,4525824 24 | 25 | -------------------------------------------------------------------------------- /app/InCallService/src/org/lineageos/mediatek/incallservice/VolumeChangeReceiver.java: -------------------------------------------------------------------------------- 1 | package org.lineageos.mediatek.incallservice; 2 | 3 | import android.content.Intent; 4 | import android.content.Context; 5 | import android.content.BroadcastReceiver; 6 | 7 | import android.media.AudioManager; 8 | import android.media.AudioSystem; 9 | import android.media.AudioDeviceInfo; 10 | 11 | import android.util.Log; 12 | 13 | public class VolumeChangeReceiver extends BroadcastReceiver { 14 | public static final String LOG_TAG = "MediatekInCallService"; 15 | 16 | private AudioManager mAudioManager; 17 | 18 | public VolumeChangeReceiver(AudioManager audioManager) { 19 | mAudioManager = audioManager; 20 | } 21 | 22 | private void handleVolumeStateChange(Intent intent) { 23 | if (intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, -1) == AudioManager.STREAM_VOICE_CALL) { 24 | AudioDeviceInfo callDevice = mAudioManager.getCommunicationDevice(); 25 | 26 | // Try to get volumeIndex 27 | int volumeIndex = intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_VALUE, -1); 28 | if (volumeIndex < 0) { 29 | Log.w(LOG_TAG, "Could not get volumeIndex!"); 30 | return; 31 | } 32 | 33 | GainUtils.setGainLevel(callDevice.getPort().type(), volumeIndex, AudioSystem.STREAM_VOICE_CALL); 34 | } 35 | } 36 | 37 | @Override 38 | public void onReceive(Context context, Intent intent) { 39 | handleVolumeStateChange(intent); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /libinit/init_cannon.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 The LineageOS Project 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | #include "vendor_init.h" 11 | 12 | static const variant_info_t cannon_info = { 13 | .hwc_value = "CN", 14 | .sku_value = "", 15 | 16 | .brand = "Xiaomi", 17 | .device = "cannon", 18 | .model = "M2007J22C", 19 | .build_fingerprint = "Redmi/cannon/cannon:12/SP1A.210812.016/V13.0.3.0.SJECNXM:user/release-keys", 20 | 21 | .multisim = true, 22 | .nfc = false, 23 | }; 24 | 25 | static const variant_info_t cannong_info = { 26 | .hwc_value = "GL", 27 | .sku_value = "", 28 | 29 | .brand = "Xiaomi", 30 | .device = "cannong", 31 | .model = "M2007J22G", 32 | .build_fingerprint = "Redmi/cannong_global/cannong:12/SP1A.210812.016/V13.0.3.0.SJEMIXM:user/release-keys", 33 | 34 | .multisim = true, 35 | .nfc = true, 36 | }; 37 | 38 | static const variant_info_t cannong_jp_info = { 39 | .hwc_value = "JP", 40 | .sku_value = "", 41 | 42 | .brand = "Xiaomi", 43 | .device = "cannong", 44 | .model = "A001XM", 45 | .build_fingerprint = "Redmi/A001XM/cannong:12/SP1A.210812.016/V13.0.2.0.SJEJPSB:user/release-keys", 46 | 47 | .multisim = false, 48 | .nfc = true, 49 | }; 50 | 51 | static const std::vector variants = { 52 | cannon_info, 53 | cannong_info, 54 | cannong_jp_info, 55 | }; 56 | 57 | void vendor_load_properties() { 58 | search_variant(variants); 59 | set_dalvik_heap(); 60 | } 61 | -------------------------------------------------------------------------------- /rro_overlays/TetheringResOverlay/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 17 | 18 | usb\\d 19 | rndis\\d 20 | 21 | 22 | 25 | 26 | softap\\d 27 | ap\\d 28 | ap_br_ap\\d 29 | 30 | 31 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 40dp 24 | 37dp 25 | 111px 26 | 37dp 27 | 28 | 30 | 106.0px 31 | 32 | 34 | 104.0px 35 | 36 | 37 | -------------------------------------------------------------------------------- /configs/audio/usb_audio_accessory_only_policy_configuration.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | 29 | 30 | 31 | 32 | 34 | 35 | -------------------------------------------------------------------------------- /rootdir/etc/init.modem.rc: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 The Android Open Source Project 2 | # 3 | # IMPORTANT: Do not create world writable files or directories. 4 | # This is a common source of Android security bugs. 5 | # 6 | 7 | on early-init 8 | write /sys/class/net/ccmni0/queues/rx-0/rps_cpus "0D" 9 | write /sys/class/net/ccmni1/queues/rx-0/rps_cpus "0D" 10 | write /sys/class/net/ccmni2/queues/rx-0/rps_cpus "0D" 11 | write /sys/class/net/ccmni3/queues/rx-0/rps_cpus "0D" 12 | write /sys/class/net/ccmni4/queues/rx-0/rps_cpus "0D" 13 | write /sys/class/net/ccmni5/queues/rx-0/rps_cpus "0D" 14 | write /sys/class/net/ccmni6/queues/rx-0/rps_cpus "0D" 15 | write /sys/class/net/ccmni7/queues/rx-0/rps_cpus "0D" 16 | write /sys/class/net/ccmni9/queues/rx-0/rps_cpus "0D" 17 | write /sys/class/net/ccmni10/queues/rx-0/rps_cpus "0D" 18 | write /sys/class/net/ccmni11/queues/rx-0/rps_cpus "0D" 19 | write /sys/class/net/ccmni12/queues/rx-0/rps_cpus "0D" 20 | write /sys/class/net/ccmni13/queues/rx-0/rps_cpus "0D" 21 | write /sys/class/net/ccmni14/queues/rx-0/rps_cpus "0D" 22 | write /sys/class/net/ccmni15/queues/rx-0/rps_cpus "0D" 23 | write /sys/class/net/ccmni16/queues/rx-0/rps_cpus "0D" 24 | write /sys/class/net/ccmni17/queues/rx-0/rps_cpus "0D" 25 | write /sys/class/net/ccmni18/queues/rx-0/rps_cpus "0D" 26 | write /sys/class/net/ccmni19/queues/rx-0/rps_cpus "0D" 27 | write /sys/class/net/ccmni20/queues/rx-0/rps_cpus "0D" 28 | 29 | write /proc/sys/net/core/netdev_max_backlog 50000 30 | write /proc/sys/net/ipv4/ipfrag_high_thresh 20971520 31 | 32 | # Encrypt phone function 33 | setprop vold.post_fs_data_done 1 34 | -------------------------------------------------------------------------------- /configs/seccomp/configstore@1.1.policy: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2017 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | futex: 1 16 | # ioctl: arg1 == BINDER_WRITE_READ 17 | ioctl: arg1 == 0xc0306201 18 | # prctl: arg0 == PR_SET_NAME || arg0 == PR_SET_VMA || arg0 == PR_SET_TIMERSLACK 19 | # || arg0 == PR_GET_NO_NEW_PRIVS # used by crash_dump 20 | # prctl: arg0 == 15 || arg0 == 0x53564d41 || arg0 == 29 || arg0 == 39 21 | # TODO(b/68162846) reduce scope of prctl() based on arguments 22 | prctl: 1 23 | openat: 1 24 | mmap: 1 25 | mprotect: 1 26 | close: 1 27 | getuid: 1 28 | read: 1 29 | faccessat: 1 30 | write: 1 31 | fstat: 1 32 | clone: 1 33 | sched_setscheduler: 1 34 | munmap: 1 35 | lseek: 1 36 | sigaltstack: 1 37 | writev: 1 38 | setpriority: 1 39 | restart_syscall: 1 40 | exit: 1 41 | exit_group: 1 42 | rt_sigreturn: 1 43 | getrlimit: 1 44 | madvise: 1 45 | getdents64: 1 46 | clock_gettime: 1 47 | getpid: 1 48 | gettid: 1 49 | 50 | # used during process crash by crash_dump to dump process info 51 | rt_sigprocmask: 1 52 | rt_sigaction: 1 53 | # socket: arg0 == AF_LOCAL 54 | socket: arg0 == 1 55 | connect: 1 56 | recvmsg: 1 57 | rt_tgsigqueueinfo: 1 58 | -------------------------------------------------------------------------------- /rootdir/etc/init.connectivity.rc: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2023 The LineageOS Project 3 | # SPDX-License-Identifier: GPL-2.0-only 4 | # 5 | 6 | # 7 | # Connectivity related device nodes & configuration (begin) 8 | # 9 | 10 | on post-fs-data 11 | 12 | #/dev/ttyMT2 for Connectivity BT/FM/GPS usage 13 | chmod 0660 /dev/ttyMT2 14 | chown system system /dev/ttyMT2 15 | 16 | #/dev/ttyMT1 for GPS 3337 usage 17 | chmod 0660 /dev/ttyMT1 18 | chown system system /dev/ttyMT1 19 | 20 | # GPS 21 | mkdir /data/vendor/gps 0770 gps system 22 | mkdir /data/vendor/log 0770 gps system 23 | mkdir /data/vendor/log/gps 0770 gps system 24 | 25 | # GPS EMI 26 | chmod 0660 /dev/gps_emi 27 | 28 | # WiFi 29 | mkdir /data/vendor/wifi 0770 wifi wifi 30 | mkdir /data/vendor/wifi/wpa 0770 wifi wifi 31 | mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi 32 | 33 | # BT relayer mode used VCOM 34 | chown bluetooth bluetooth /dev/ttyGS2 35 | chmod 0660 /dev/ttyGS2 36 | 37 | # 38 | # Connectivity related device nodes & configuration (end) 39 | # 40 | 41 | # 42 | # Connectivity related services (Begin) 43 | # 44 | 45 | # GPS 46 | service mnld /vendor/bin/mnld 47 | class main 48 | user gps 49 | capabilities WAKE_ALARM 50 | group gps inet misc sdcard_rw sdcard_r media_rw system radio wakelock 51 | socket mnld stream 660 gps system 52 | 53 | # WMT 54 | service wmt_loader /vendor/bin/wmt_loader 55 | class early_hal 56 | user system 57 | group system 58 | oneshot 59 | 60 | service wmt_launcher /vendor/bin/wmt_launcher -p /vendor/firmware/ -o 1 61 | class early_hal 62 | user system 63 | group system 64 | 65 | # 66 | # Connectivity related services (End) 67 | # 68 | -------------------------------------------------------------------------------- /overlay-lineage/packages/apps/Aperture/app/src/main/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | true 9 | 10 | 11 | 12 | 2 13 | 14 | 15 | 38 | 39 | 0 sd|hd|fhd 60 40 | 41 | 42 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_power_default.te: -------------------------------------------------------------------------------- 1 | typeattribute hal_power_default mlstrustedsubject; 2 | 3 | allow hal_power_default sysfs_devices_system_cpu:file rw_file_perms; 4 | allow hal_power_default cgroup:file r_file_perms; 5 | 6 | # To get/set powerhal state property 7 | set_prop(hal_power_default, vendor_power_prop) 8 | 9 | # Rule for hal_power_default to access graphics composer process 10 | unix_socket_connect(hal_power_default, pps, hal_graphics_composer_default); 11 | 12 | # Set scheduling info for apps (for adpf) 13 | allow hal_power_default appdomain:process { getsched setsched }; 14 | allow hal_power_default self:capability sys_nice; 15 | 16 | # Set scheduling info for system_server (for adpf) 17 | allow hal_power_default system_server:process setsched; 18 | 19 | # Set GPU frequency 20 | allow hal_power_default sysfs_mtk_gpufreq:file rw_file_perms; 21 | allow hal_power_default sysfs_gpu:dir r_dir_perms; 22 | allow hal_power_default sysfs_gpu:file rw_file_perms; 23 | 24 | # Set perfmgr nodes 25 | allow hal_power_default proc_perfmgr:dir r_dir_perms; 26 | allow hal_power_default sysfs_fpsgo:file w_file_perms; 27 | allow hal_power_default proc_ppm:dir r_dir_perms; 28 | allow hal_power_default proc_ppm:file rw_file_perms; 29 | allow hal_power_default proc_cpufreq:dir r_dir_perms; 30 | allow hal_power_default proc_cpufreq:file rw_file_perms; 31 | allow hal_power_default proc_hps:dir r_dir_perms; 32 | allow hal_power_default proc_hps:file rw_file_perms; 33 | allow hal_power_default proc_cm_mgr:dir r_dir_perms; 34 | allow hal_power_default proc_cm_mgr:file rw_file_perms; 35 | allow hal_power_default proc_fliperfs:dir r_dir_perms; 36 | allow hal_power_default proc_fliperfs:file rw_file_perms; 37 | 38 | # Set touchpanel nodes 39 | allow hal_power_default sysfs_touchpanel:dir r_dir_perms; 40 | allow hal_power_default sysfs_touchpanel:file rw_file_perms; 41 | -------------------------------------------------------------------------------- /sensors/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2020 The Android Open Source 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 | cc_binary { 17 | name: "android.hardware.sensors@2.1-service.cannon-multihal", 18 | defaults: [ 19 | "hidl_defaults", 20 | ], 21 | required: ["hals.conf"], 22 | vendor: true, 23 | relative_install_path: "hw", 24 | srcs: [ 25 | "service.cpp", 26 | "HalProxy.cpp", 27 | "HalProxyCallback.cpp", 28 | ], 29 | init_rc: ["android.hardware.sensors@2.1-service.cannon-multihal.rc"], 30 | vintf_fragments: ["android.hardware.sensors@2.1-cannon-multihal.xml"], 31 | header_libs: [ 32 | "android.hardware.sensors@2.X-shared-utils", 33 | ], 34 | shared_libs: [ 35 | "android.hardware.sensors@2.0", 36 | "android.hardware.sensors@2.0-ScopedWakelock", 37 | "android.hardware.sensors@2.1", 38 | "libbase", 39 | "libcutils", 40 | "libfmq", 41 | "libhidlbase", 42 | "liblog", 43 | "libpower", 44 | "libutils", 45 | ], 46 | static_libs: [ 47 | "android.hardware.sensors@1.0-convert", 48 | "android.hardware.sensors@2.X-multihal", 49 | ], 50 | } 51 | 52 | prebuilt_etc { 53 | name: "hals.conf", 54 | src: "hals.conf", 55 | sub_dir: "sensors", 56 | vendor: true, 57 | } 58 | -------------------------------------------------------------------------------- /releasetools.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2023 The LineageOS Project 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | import common 15 | import re 16 | 17 | def FullOTA_InstallEnd(info): 18 | OTA_InstallEnd(info) 19 | return 20 | 21 | def FullOTA_Assertions(info): 22 | CheckRecovery(info) 23 | return 24 | 25 | def IncrementalOTA_InstallEnd(info): 26 | OTA_InstallEnd(info) 27 | return 28 | 29 | def IncrementalOTA_Assertions(info): 30 | CheckRecovery(info) 31 | return 32 | 33 | def CheckRecovery(info): 34 | info.script.AppendExtra('assert(getprop("ro.orangefox.version") == "" || abort("ERROR: OrangeFox is not supported! "););') 35 | info.script.AppendExtra('assert(getprop("ro.twrp.boot") == "" || abort("ERROR: TWRP is not supported! "););') 36 | return 37 | 38 | def AddImage(info, basename, dest): 39 | name = basename 40 | data = info.input_zip.read("IMAGES/" + basename) 41 | common.ZipWriteStr(info.output_zip, name, data) 42 | info.script.AppendExtra('package_extract_file("%s", "%s");' % (name, dest)) 43 | 44 | def OTA_InstallEnd(info): 45 | info.script.Print("Patching firmware images...") 46 | AddImage(info, "vbmeta.img", "/dev/block/platform/bootdevice/by-name/vbmeta") 47 | AddImage(info, "vbmeta_system.img", "/dev/block/platform/bootdevice/by-name/vbmeta_system") 48 | AddImage(info, "vbmeta_vendor.img", "/dev/block/platform/bootdevice/by-name/vbmeta_vendor") 49 | return 50 | -------------------------------------------------------------------------------- /update-sha1sums.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (C) 2016 The CyanogenMod Project 4 | # Copyright (C) 2017 The LineageOS Project 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | from hashlib import sha1 20 | 21 | device='cannon' 22 | vendor='xiaomi' 23 | 24 | lines = [ line for line in open('proprietary-files.txt', 'r') ] 25 | vendorPath = '../../../vendor/' + vendor + '/' + device + '/proprietary' 26 | needSHA1 = False 27 | 28 | for index, line in enumerate(lines): 29 | # Remove '\n' character 30 | line = line[:-1] 31 | 32 | # Skip empty lines 33 | if len(line) == 0: 34 | continue 35 | 36 | # Check if we need to set SHA1 hash for the next files 37 | if line[0] == '#': 38 | needSHA1 = (' - from' in line) 39 | continue 40 | 41 | if needSHA1: 42 | # Remove existing SHA1 hash 43 | line = line.split('|')[0] 44 | filePath = line.split(':')[1] if len(line.split(':')) == 2 else line 45 | 46 | if filePath[0] == '-': 47 | file = open('%s/%s' % (vendorPath, filePath[1:]), 'rb').read() 48 | else: 49 | file = open('%s/%s' % (vendorPath, filePath), 'rb').read() 50 | 51 | hash = sha1(file).hexdigest() 52 | lines[index] = '%s|%s\n' % (line, hash) 53 | 54 | with open('proprietary-files.txt', 'w') as file: 55 | for line in lines: 56 | file.write(line) 57 | 58 | file.close() 59 | -------------------------------------------------------------------------------- /app/InCallService/src/org/lineageos/mediatek/incallservice/VolumeChangeService.java: -------------------------------------------------------------------------------- 1 | package org.lineageos.mediatek.incallservice; 2 | 3 | import android.media.AudioManager; 4 | 5 | import android.telephony.TelephonyManager; 6 | import android.telephony.TelephonyCallback; 7 | 8 | import android.content.Intent; 9 | import android.content.IntentFilter; 10 | import android.content.Context; 11 | import android.app.Service; 12 | import android.os.IBinder; 13 | 14 | import android.util.Log; 15 | 16 | public class VolumeChangeService extends Service { 17 | public static final String LOG_TAG = "MediatekInCallService"; 18 | 19 | private Context mContext; 20 | private VolumeChangeReceiver mVolumeChangeReceiver; 21 | private CallStateListener mCallStateListener; 22 | 23 | @Override 24 | public IBinder onBind(Intent intent) { 25 | return null; 26 | } 27 | 28 | @Override 29 | public void onDestroy() { 30 | super.onDestroy(); 31 | } 32 | 33 | @Override 34 | public int onStartCommand(Intent intent, int flags, int startid) { 35 | mContext = this; 36 | 37 | AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); 38 | TelephonyManager telephonyManager = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); 39 | mVolumeChangeReceiver = new VolumeChangeReceiver(audioManager); 40 | mCallStateListener = new CallStateListener(audioManager); 41 | 42 | Log.i(LOG_TAG, "Service is starting..."); 43 | 44 | this.registerReceiver(mVolumeChangeReceiver, 45 | new IntentFilter(AudioManager.VOLUME_CHANGED_ACTION)); 46 | 47 | telephonyManager.registerTelephonyCallback(getMainExecutor(), mCallStateListener); 48 | 49 | // Restore gain levels on service start. 50 | GainUtils.setGainLevel(audioManager.getStreamVolume(AudioManager.STREAM_VOICE_CALL)); 51 | 52 | return START_STICKY; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /rootdir/etc/init.cannon.rc: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2023 The LineageOS Project 3 | # SPDX-License-Identifier: GPL-2.0-only 4 | # 5 | 6 | on init 7 | chmod 0666 /dev/goodix_fp 8 | chown system system /dev/goodix_fp 9 | 10 | on boot 11 | chown system system /sys/bus/platform/devices/fingerprint/clk_enable 12 | chmod 0660 /sys/bus/platform/devices/fingerprint/clk_enable 13 | chown system system /sys/bus/platform/devices/fingerprint/wakeup_enable 14 | chmod 0660 /sys/bus/platform/devices/fingerprint/wakeup_enable 15 | chown system system /sys/bus/platform/devices/fingerprint/irq 16 | chmod 0660 /sys/bus/platform/devices/fingerprint/irq 17 | chown system system /sys/bus/spi/devices/spi5.0/authen_fd/performance 18 | chmod 0660 /sys/bus/spi/devices/spi5.0/authen_fd/performance 19 | chown system system /sys/bus/platform/devices/fingerprint/fingerdown_wait 20 | 21 | on post-fs-data 22 | mkdir /data/vendor/fpc 0770 system system 23 | mkdir /data/vendor/goodix 0770 system system 24 | mkdir /mnt/vendor/persist/goodix 0770 system system 25 | 26 | service vendor.nfc_hal_service /vendor/bin/hw/android.hardware.nfc@1.2-service 27 | override 28 | class hal 29 | user nfc 30 | group nfc 31 | disabled 32 | 33 | service nqnfc_1_2_hal_service /vendor/bin/hw/vendor.nxp.hardware.nfc@1.2-service 34 | class hal 35 | user nfc 36 | group nfc 37 | disabled 38 | 39 | service vendor.secure_element /vendor/bin/hw/vendor.microtrust.hardware.se@1.0-service 40 | class late_start 41 | user system 42 | group nfc 43 | disabled 44 | 45 | service mtk_secure_element_hal_service /vendor/bin/hw/android.hardware.secure_element@1.0-service-mediatek 46 | class hal 47 | user secure_element 48 | group secure_element 49 | disabled 50 | 51 | on boot && property:ro.boot.product.hardware.sku=nfc 52 | enable vendor.secure_element 53 | enable mtk_secure_element_hal_service 54 | enable vendor.nfc_hal_service 55 | enable nqnfc_1_2_hal_service 56 | -------------------------------------------------------------------------------- /sepolicy/vendor/file_contexts: -------------------------------------------------------------------------------- 1 | # Camera devices 2 | /dev/camera_eeprom0 u:object_r:camera_device:s0 3 | /dev/camera_eeprom1 u:object_r:camera_device:s0 4 | /dev/camera_eeprom2 u:object_r:camera_device:s0 5 | /dev/camera_eeprom3 u:object_r:camera_device:s0 6 | 7 | /mnt/vendor/persist/camera(/.*)? u:object_r:camera_persist_file:s0 8 | /data/vendor/camera(/.*)? u:object_r:camera_vendor_data_file:s0 9 | 10 | # Fingerprint 11 | /mnt/vendor/persist/goodix(/.*)? u:object_r:vendor_fingerprint_data_file:s0 12 | /data/vendor/fpc(/.*)? u:object_r:vendor_fingerprint_data_file:s0 13 | /data/vendor/goodix(/.*)? u:object_r:vendor_fingerprint_data_file:s0 14 | /data/gf_data(/.*)? u:object_r:fingerprint_data_file:s0 15 | 16 | /vendor/bin/hw/android\.hardware\.biometrics\.fingerprint@2\.3-service\.xiaomi u:object_r:hal_fingerprint_default_exec:s0 17 | 18 | # Latency 19 | /dev/cpu_dma_latency u:object_r:latency_device:s0 20 | 21 | # NFC 22 | /dev/nq-nci u:object_r:nfc_device:s0 23 | /dev/p73 u:object_r:nfc_device:s0 24 | /vendor/bin/hw/vendor\.nxp\.hardware\.nfc@1\.2-service u:object_r:hal_nfc_default_exec:s0 25 | 26 | # Lights 27 | /(vendor|system/vendor)/bin/hw/android\.hardware\.light-service\.cannon u:object_r:hal_light_default_exec:s0 28 | 29 | # Sensors 30 | /vendor/bin/hw/android\.hardware\.sensors@2.1-service\.cannon-multihal u:object_r:mtk_hal_sensors_exec:s0 31 | 32 | # Thermals 33 | /vendor/bin/mi_thermald u:object_r:mi_thermald_exec:s0 34 | 35 | # Mlipay 36 | /vendor/bin/mlipayd@1\.1 u:object_r:hal_mlipay_default_exec:s0 37 | -------------------------------------------------------------------------------- /reorder-libs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (C) 2021 The LineageOS Project 4 | # 5 | # SPDX-License-Identifier: Apache-2.0 6 | # 7 | 8 | from functools import cmp_to_key 9 | from locale import LC_ALL, setlocale, strcoll 10 | from pathlib import Path 11 | 12 | FILES = [Path(file) for file in [ 13 | "proprietary-files.txt", 14 | ]] 15 | 16 | setlocale(LC_ALL, "C") 17 | 18 | def strcoll_extract_utils(string1: str, string2: str) -> int: 19 | # Skip logic if one of the string if empty 20 | if not string1 or not string2: 21 | return strcoll(string1, string2) 22 | 23 | # Remove '-' from strings if there, 24 | # it is used to indicate a build target 25 | string1 = string1.removeprefix('-') 26 | string2 = string2.removeprefix('-') 27 | 28 | # If no directories, compare normally 29 | if not "/" in string1 and not "/" in string2: 30 | return strcoll(string1, string2) 31 | 32 | string1_dir = string1.rsplit("/", 1)[0] + "/" 33 | string2_dir = string2.rsplit("/", 1)[0] + "/" 34 | if string1_dir == string2_dir: 35 | # Same directory, compare normally 36 | return strcoll(string1, string2) 37 | 38 | if string1_dir.startswith(string2_dir): 39 | # First string dir is a subdirectory of the second one, 40 | # return string1 > string2 41 | return -1 42 | 43 | if string2_dir.startswith(string1_dir): 44 | # Second string dir is a subdirectory of the first one, 45 | # return string2 > string1 46 | return 1 47 | 48 | # Compare normally 49 | return strcoll(string1, string2) 50 | 51 | for file in FILES: 52 | if not file.is_file(): 53 | print(f"File {str(file)} not found") 54 | continue 55 | 56 | with open(file, 'r') as f: 57 | sections = f.read().split("\n\n") 58 | 59 | ordered_sections = [] 60 | for section in sections: 61 | section_list = [line.strip() for line in section.splitlines()] 62 | section_list.sort(key=cmp_to_key(strcoll_extract_utils)) 63 | ordered_sections.append("\n".join(section_list)) 64 | 65 | with open(file, 'w') as f: 66 | f.write("\n\n".join(ordered_sections).strip() + "\n") 67 | -------------------------------------------------------------------------------- /libinit/libinit_dalvik_heap.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 The LineageOS Project 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | #define HEAPSTARTSIZE_PROP "dalvik.vm.heapstartsize" 13 | #define HEAPGROWTHLIMIT_PROP "dalvik.vm.heapgrowthlimit" 14 | #define HEAPSIZE_PROP "dalvik.vm.heapsize" 15 | #define HEAPMINFREE_PROP "dalvik.vm.heapminfree" 16 | #define HEAPMAXFREE_PROP "dalvik.vm.heapmaxfree" 17 | #define HEAPTARGETUTILIZATION_PROP "dalvik.vm.heaptargetutilization" 18 | 19 | #define GB(b) (b * 1024ull * 1024 * 1024) 20 | 21 | static const dalvik_heap_info_t dalvik_heap_info_6144 = { 22 | .heapstartsize = "16m", 23 | .heapgrowthlimit = "256m", 24 | .heapsize = "512m", 25 | .heapminfree = "8m", 26 | .heapmaxfree = "32m", 27 | .heaptargetutilization = "0.5", 28 | }; 29 | 30 | static const dalvik_heap_info_t dalvik_heap_info_4096 = { 31 | .heapstartsize = "8m", 32 | .heapgrowthlimit = "256m", 33 | .heapsize = "512m", 34 | .heapminfree = "8m", 35 | .heapmaxfree = "16m", 36 | .heaptargetutilization = "0.6", 37 | }; 38 | 39 | static const dalvik_heap_info_t dalvik_heap_info_2048 = { 40 | .heapstartsize = "8m", 41 | .heapgrowthlimit = "192m", 42 | .heapsize = "512m", 43 | .heapminfree = "512k", 44 | .heapmaxfree = "8m", 45 | .heaptargetutilization = "0.75", 46 | }; 47 | 48 | void set_dalvik_heap() { 49 | struct sysinfo sys; 50 | const dalvik_heap_info_t *dhi; 51 | 52 | sysinfo(&sys); 53 | 54 | if (sys.totalram > GB(5)) 55 | dhi = &dalvik_heap_info_6144; 56 | else if (sys.totalram > GB(3)) 57 | dhi = &dalvik_heap_info_4096; 58 | else 59 | dhi = &dalvik_heap_info_2048; 60 | 61 | property_override(HEAPSTARTSIZE_PROP, dhi->heapstartsize); 62 | property_override(HEAPGROWTHLIMIT_PROP, dhi->heapgrowthlimit); 63 | property_override(HEAPSIZE_PROP, dhi->heapsize); 64 | property_override(HEAPTARGETUTILIZATION_PROP, dhi->heaptargetutilization); 65 | property_override(HEAPMINFREE_PROP, dhi->heapminfree); 66 | property_override(HEAPMAXFREE_PROP, dhi->heapmaxfree); 67 | } 68 | -------------------------------------------------------------------------------- /configs/nfc/libese-nxp.conf: -------------------------------------------------------------------------------- 1 | ##This file needs to be pushed into /vendor/etc/libese-nxp.conf 2 | 3 | ############################################################################### 4 | # Application options 5 | SE_DEBUG_ENABLED=1 6 | 7 | 8 | #Timeout in secs 9 | NXP_SWP_RD_TAG_OP_TIMEOUT=0xFF 10 | 11 | #WTX Count in secs 12 | NXP_WTX_COUNT_VALUE=30 13 | 14 | #Delay(us) to recover if invalid data received 15 | RNACK_RETRY_DELAY=7000 16 | 17 | # PN67T_PWR_SCHEME 0x01 18 | # PN80T_LEGACY_PWR_SCHEME 0x02 19 | # PN80T_EXT_PMU_SCHEME 0x03 20 | NXP_POWER_SCHEME=0x02 21 | 22 | # For SOF = 0x5A 0x01 23 | # For SOF = 0x00 0x02 24 | NXP_SOF_WRITE=0x01 25 | 26 | #SPI Thorughput measurement log enabled(1)/disabled(0) in kernel 27 | NXP_TP_MEASUREMENT=0x00 28 | 29 | #Enable/Disable interface reset as part of SPI open 30 | NXP_SPI_INTF_RST_ENABLE=0x01 31 | 32 | ############################################################################### 33 | # SPI WRITE TIMEOUT for RF event synchronization 34 | NXP_SPI_WRITE_TIMEOUT=0x14 35 | 36 | ############################################################################### 37 | # SPI Device Node name 38 | NXP_ESE_DEV_NODE="/dev/p73" 39 | 40 | #MAX NO OF R_NACK RETRY ALLOWED IN CASE OF CRC FAILURE 41 | NXP_MAX_RNACK_RETRY=0x03 42 | NXP_VISO_DPD_ENABLED=0x01 43 | NXP_NAD_POLL_RETRY_TIME=0x02 44 | 45 | ############################################################################### 46 | # eSE interface options for JCOP Download 47 | # NFC 0x01 48 | # SPI 0x02 49 | NXP_P61_JCOP_DEFAULT_INTERFACE=0x02 50 | 51 | ############################################################################### 52 | # IFS adjustment configuration value of IFSD for eSE 53 | # Any value set which is greater than IFSC value will be R-NACKed from JCOP 54 | # Default IFSC: 0x02F7 = (0x02FD - 0x6(header))(As agreed with JCOP) 55 | # 56 | NXP_ESE_IFSD_VALUE=0x02FD 57 | 58 | ############################################################################### 59 | # IFS adjustment configuration value of IFSD for eUICC 60 | # Any value set which is greater than IFSC value will be R-NACKed from JCOP 61 | # Default IFSC: 0x02F7 = (0x02FD - 0x6(header))(As agreed with JCOP) 62 | # 63 | NXP_EUICC_IFSD_VALUE=0x02FD 64 | -------------------------------------------------------------------------------- /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=cannon 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 | function blob_fixup() { 57 | case "${1}" in 58 | vendor/bin/hw/android.hardware.thermal@2.0-service.mtk) 59 | "${PATCHELF}" --replace-needed "libutils.so" "libutils-v32.so" "${2}" 60 | ;; 61 | vendor/bin/hw/camerahalserver) 62 | "${PATCHELF}" --replace-needed "libutils.so" "libutils-v32.so" "${2}" 63 | ;; 64 | vendor/bin/mtk_agpsd) 65 | "$PATCHELF" --replace-needed "libcrypto.so" "libcrypto-v32.so" "$2" 66 | ;; 67 | vendor/lib*/hw/vendor.mediatek.hardware.pq@2.13-impl.so) 68 | "${PATCHELF}" --replace-needed "libutils.so" "libutils-v32.so" "${2}" 69 | ;; 70 | vendor/lib64/libmtkcam_featurepolicy.so) 71 | sed -i "s|\xE8\x87\x40\xB9|\x28\x02\x80\x52|g" "${2}" 72 | ;; 73 | esac 74 | } 75 | 76 | # Initialize the helper 77 | setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}" 78 | 79 | extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}" 80 | 81 | "${MY_DIR}/setup-makefiles.sh" 82 | -------------------------------------------------------------------------------- /libinit/libinit_variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 The LineageOS Project 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | using android::base::GetProperty; 14 | 15 | #define HWC_PROP "ro.boot.hwc" 16 | #define SKU_PROP "ro.boot.product.hardware.sku" 17 | 18 | void search_variant(const std::vector variants) { 19 | std::string hwc_value = GetProperty(HWC_PROP, ""); 20 | std::string sku_value = GetProperty(SKU_PROP, ""); 21 | 22 | for (const auto& variant : variants) { 23 | if ((variant.hwc_value == "" || variant.hwc_value == hwc_value) && 24 | (variant.sku_value == "" || variant.sku_value == sku_value)) { 25 | set_variant_props(variant); 26 | break; 27 | } 28 | } 29 | } 30 | 31 | void set_variant_props(const variant_info_t variant) { 32 | set_ro_build_prop("brand", variant.brand, true); 33 | set_ro_build_prop("device", variant.device, true); 34 | set_ro_build_prop("model", variant.model, true); 35 | 36 | if (access("/system/bin/recovery", F_OK) != 0) { 37 | set_ro_build_prop("fingerprint", variant.build_fingerprint); 38 | property_override("ro.bootimage.build.fingerprint", variant.build_fingerprint); 39 | 40 | property_override("ro.build.description", fingerprint_to_description(variant.build_fingerprint)); 41 | } 42 | 43 | property_override("ro.boot.hardware.sku", variant.device); 44 | 45 | if (variant.nfc) 46 | property_override(SKU_PROP, "nfc"); 47 | 48 | if (variant.multisim) { 49 | property_override("persist.vendor.mims_support", "2"); 50 | property_override("persist.radio.multisim.config", "dsds"); 51 | property_override("persist.vendor.radio.msimmode", "dsds"); 52 | property_override("persist.vendor.radio.smart.data.switch", "1"); 53 | property_override("ro.vendor.mtk_data_config", "1"); 54 | } else { 55 | property_override("persist.vendor.mims_support", "1"); 56 | property_override("persist.radio.multisim.config", "ss"); 57 | property_override("persist.vendor.radio.msimmode", "ss"); 58 | property_override("persist.vendor.radio.smart.data.switch", "0"); 59 | property_override("ro.vendor.mtk_data_config", "0"); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /overlay-lineage/lineage-sdk/lineage/res/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 28 | 64 29 | 30 | 42 | 64 43 | 44 | 45 | true 46 | 47 | 48 | 49 | restart 50 | restart_recovery 51 | restart_bootloader 52 | restart_fastboot 53 | 54 | 55 | -------------------------------------------------------------------------------- /configs/audio/bluetooth_offload_audio_policy_configuration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 20 | 21 | 22 | 25 | 26 | 27 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 39 | 41 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /configs/seccomp/android.hardware.media.c2@1.2-mediatek-seccomp-policy: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2019 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | futex: 1 16 | # ioctl calls are filtered via the selinux policy. 17 | ioctl: 1 18 | sched_yield: 1 19 | close: 1 20 | dup: 1 21 | ppoll: 1 22 | mprotect: arg2 in ~PROT_EXEC || arg2 in ~PROT_WRITE 23 | #mmap2: arg2 in ~PROT_EXEC || arg2 in ~PROT_WRITE 24 | memfd_create: 1 25 | ftruncate: 1 26 | ftruncate64: 1 27 | 28 | # mremap: Ensure |flags| are (MREMAP_MAYMOVE | MREMAP_FIXED) TODO: Once minijail 29 | # parser support for '<' is in this needs to be modified to also prevent 30 | # |old_address| and |new_address| from touching the exception vector page, which 31 | # on ARM is statically loaded at 0xffff 0000. See 32 | # http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0211h/Babfeega.html 33 | # for more details. 34 | mremap: arg3 == 3 || arg3 == MREMAP_MAYMOVE 35 | munmap: 1 36 | prctl: 1 37 | getuid32: 1 38 | writev: 1 39 | sigaltstack: 1 40 | clone: 1 41 | exit: 1 42 | lseek: 1 43 | rt_sigprocmask: 1 44 | openat: 1 45 | open: 1 46 | fstat64: 1 47 | write: 1 48 | nanosleep: 1 49 | setpriority: 1 50 | set_tid_address: 1 51 | getdents64: 1 52 | readlinkat: 1 53 | readlink: 1 54 | read: 1 55 | pread64: 1 56 | fstatfs64: 1 57 | gettimeofday: 1 58 | faccessat: 1 59 | _llseek: 1 60 | fstatat64: 1 61 | ugetrlimit: 1 62 | exit_group: 1 63 | restart_syscall: 1 64 | rt_sigreturn: 1 65 | getrandom: 1 66 | madvise: 1 67 | sched_setaffinity: 1 68 | sched_getaffinity: 1 69 | sched_getparam: 1 70 | sched_getscheduler: 1 71 | recvfrom: 1 72 | 73 | # crash dump policy additions 74 | sigreturn: 1 75 | clock_gettime: 1 76 | futex: 1 77 | getpid: 1 78 | gettid: 1 79 | pipe2: 1 80 | recvmsg: 1 81 | process_vm_readv: 1 82 | tgkill: 1 83 | rt_sigaction: 1 84 | rt_tgsigqueueinfo: 1 85 | #prctl: arg0 == PR_GET_NO_NEW_PRIVS || arg0 == 0x53564d41 86 | #mprotect: arg2 in 0x1|0x2 87 | #mmap2: arg2 in 0x1|0x2 88 | geteuid32: 1 89 | getgid32: 1 90 | getegid32: 1 91 | getgroups32: 1 92 | -------------------------------------------------------------------------------- /overlay/frameworks/base/packages/SystemUI/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 22 | 23 | 31 | 32 | M 50,60 33 | a 40,40 0 1 0 80,0 34 | a 40,40 0 1 0 -80,0 35 | Z 36 | 37 | 38 | 39 | 1 40 | 41 | 42 | true 43 | 44 | 45 | @*android:dimen/status_bar_height_portrait 46 | 47 | 48 | true 49 | 50 | 51 | true 52 | 53 | 54 | true 55 | 56 | -------------------------------------------------------------------------------- /overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 2.15dp 22 | 23 | 24 | 8dp 25 | 26 | 27 | 8dp 28 | 29 | 30 | 7.0dip 31 | 32 | 37 | 1080px 38 | 39 | 43 | @dimen/physical_power_button_center_screen_location_y 44 | 45 | 47 | 1000px 48 | 49 | -------------------------------------------------------------------------------- /configs/audio/audio_em.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Device Tree for Redmi Note 9 5G and Redmi Note 9T 2 | 3 | The Redmi Note 9 5G (codenamed _"cannon"_) and Redmi Note 9T (codenamed _"cannong"_) are mid-range smartphones from Xiaomi. 4 | 5 | Copyright (C) 2023 LineageOS 6 | 7 | Copyright (C) 2022 StatiX 8 | 9 | ## Specsheets 10 | 11 | | Device | Redmi Note 9 5G | Redmi Note 9T | 12 | | ----------------------- | ---------------------------------------------------------| ---------------------------------------------------------| 13 | | SoC | MediaTek Dimensity 800U 5G (7 nm) | MediaTek Dimensity 800U 5G (7 nm) | 14 | | CPU | Octa-core (2x2.4 GHz Cortex-A76 & 6x2.0 GHz Cortex-A55) | Octa-core (2x2.4 GHz Cortex-A76 & 6x2.0 GHz Cortex-A55) | 15 | | GPU | Mali-G57 MC3 | Mali-G57 MC3 | 16 | | Memory | 6/8 GB RAM | 4 GB RAM | 17 | | Shipped Android version | Android 10 | Android 10 | 18 | | Storage | 128/256 GB | 64/128 GB | 19 | | Battery | Li-Po 5000 mAh, Non-removable | Li-Po 5000 mAh, Non-removable | 20 | | Dimensions | 162 x 77.3 x 9.2 mm (6.38 x 3.04 x 0.36 in) | 161.2 x 77.3 x 9.1 mm (6.35 x 3.04 x 0.36 in) | 21 | | Display | 1080 x 2340 pixels, 19.5:9 ratio (about 395 ppi density) | 1080 x 2340 pixels, 19.5:9 ratio (about 395 ppi density) | 22 | | Rear camera 1 | 48 MP, f/1.8, 26mm (wide), 1/2.0", 0.8µm, PDAF | 48 MP, f/1.8, 26mm (wide), 1/2.0", 0.8µm, PDAF | 23 | | Rear camera 2 | 8 MP, f/2.2, 118˚ (ultrawide), 1/4.0", 1.12µm | 2 MP, f/2.4, (macro) | 24 | | Rear camera 3 | 2 MP, f/2.4, (macro) | 2 MP, f/2.4, (depth) | 25 | | Front camera | 13 MP, f/2.3, 29mm (standard), 1/3.1", 1.12µm | 13 MP, f/2.3, 29mm (standard), 1/3.1", 1.12µm | 26 | | Image | ![Redmi Note 9 5G](https://fdn2.gsmarena.com/vv/pics/xiaomi/xiaomi-redmi-note-9-5g-1.jpg) | ![Redmi Note 9T 5G](https://fdn2.gsmarena.com/vv/pics/xiaomi/xiaomi-redmi-note-9t-5g-1.jpg) | 27 | -------------------------------------------------------------------------------- /libinit/libinit_utils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 The LineageOS Project 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | void property_override(std::string prop, std::string value, bool add) { 14 | auto pi = (prop_info *) __system_property_find(prop.c_str()); 15 | if (pi != nullptr) { 16 | __system_property_update(pi, value.c_str(), value.length()); 17 | } else if (add) { 18 | __system_property_add(prop.c_str(), prop.length(), value.c_str(), value.length()); 19 | } 20 | } 21 | 22 | std::vector ro_props_default_source_order = { 23 | "odm.", 24 | "odm_dlkm.", 25 | "product.", 26 | "system.", 27 | "system_ext.", 28 | "vendor.", 29 | "vendor_dlkm.", 30 | "", 31 | }; 32 | 33 | void set_ro_build_prop(const std::string &prop, const std::string &value, bool product) { 34 | std::string prop_name; 35 | 36 | for (const auto &source : ro_props_default_source_order) { 37 | if (product) 38 | prop_name = "ro.product." + source + prop; 39 | else 40 | prop_name = "ro." + source + "build." + prop; 41 | 42 | property_override(prop_name, value, true); 43 | } 44 | } 45 | 46 | #define FIND_AND_REMOVE(s, delimiter, variable_name) \ 47 | std::string variable_name = s.substr(0, s.find(delimiter)); \ 48 | s.erase(0, s.find(delimiter) + delimiter.length()); 49 | 50 | #define APPEND_STRING(s, to_append) \ 51 | s.append(" "); \ 52 | s.append(to_append); 53 | 54 | std::string fingerprint_to_description(std::string fingerprint) { 55 | std::string delimiter = "/"; 56 | std::string delimiter2 = ":"; 57 | std::string build_fingerprint_copy = fingerprint; 58 | 59 | FIND_AND_REMOVE(build_fingerprint_copy, delimiter, brand) 60 | FIND_AND_REMOVE(build_fingerprint_copy, delimiter, product) 61 | FIND_AND_REMOVE(build_fingerprint_copy, delimiter2, device) 62 | FIND_AND_REMOVE(build_fingerprint_copy, delimiter, platform_version) 63 | FIND_AND_REMOVE(build_fingerprint_copy, delimiter, build_id) 64 | FIND_AND_REMOVE(build_fingerprint_copy, delimiter2, build_number) 65 | FIND_AND_REMOVE(build_fingerprint_copy, delimiter, build_variant) 66 | std::string build_version_tags = build_fingerprint_copy; 67 | 68 | std::string description = product + "-" + build_variant; 69 | APPEND_STRING(description, platform_version) 70 | APPEND_STRING(description, build_id) 71 | APPEND_STRING(description, build_number) 72 | APPEND_STRING(description, build_version_tags) 73 | 74 | return description; 75 | } 76 | -------------------------------------------------------------------------------- /rro_overlays/WifiResOverlay/res/values/bools.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | true 8 | 9 | 11 | false 12 | 13 | 15 | false 16 | 17 | 19 | false 20 | 21 | 22 | true 23 | 24 | 28 | true 29 | 30 | 31 | true 32 | 33 | 34 | true 35 | 36 | 37 | true 38 | 39 | 40 | true 41 | 42 | 43 | true 44 | 45 | 46 | true 47 | 48 | -------------------------------------------------------------------------------- /overlay/packages/services/Telephony/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 18 | 19 | 21 | 22 | 23 | true 24 | 25 | 26 | true 27 | 28 | 29 | true 30 | 31 | 32 | com.mediatek.ims 33 | 34 | 35 | com.android.service.ims 36 | 37 | 38 | false 39 | 40 | 44 | true 45 | 46 | 48 | true 49 | -------------------------------------------------------------------------------- /rootdir/etc/init.project.rc: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2023 The LineageOS Project 3 | # SPDX-License-Identifier: GPL-2.0-only 4 | # 5 | 6 | import /vendor/etc/init/init.mi_thermald.rc 7 | 8 | on init 9 | mkdir /mnt/media_rw/usbotg 0700 media_rw media_rw 10 | mkdir /storage/usbotg 0700 root root 11 | write /sys/module/musb_hdrc/parameters/mu3d_force_on 1 12 | 13 | on post-fs-data 14 | mkdir /data/vendor/thermal 0771 root system 15 | mkdir /data/vendor/thermal/config 0771 root system 16 | 17 | #Turbo sched 18 | chmod 0666 /sys/module/migt/parameters/mi_viptask 19 | restorecon /sys/module/migt/parameters/mi_viptask 20 | 21 | #thermal 22 | chown system system /sys/class/thermal/thermal_message/sconfig 23 | 24 | #Camera 25 | chmod 0660 /dev/MAINAF 26 | chown system camera /dev/MAINAF 27 | 28 | chmod 0660 /dev/MAINAF2 29 | chown system camera /dev/MAINAF2 30 | 31 | chmod 0660 /dev/SUBAF 32 | chown system camera /dev/SUBAF 33 | 34 | chmod 0660 /dev/GAF001AF 35 | chown system camera /dev/GAF001AF 36 | 37 | chmod 0660 /dev/DW9714AF 38 | chown system camera /dev/DW9714AF 39 | 40 | chmod 0660 /dev/LC898212AF 41 | chown system camera /dev/LC898212AF 42 | 43 | chmod 0660 /dev/BU64745GWZAF 44 | chown system camera /dev/BU64745GWZAF 45 | 46 | #cit led 47 | chown system system /sys/class/leds/torch-light0/brightness 48 | chown system system /sys/class/leds/torch-light1/brightness 49 | 50 | #XIAOMI_DUAL_CAM_BIN 51 | mkdir /mnt/vendor/persist/camera/ 0777 system camera 52 | mkdir /data/vendor/camera/ 0777 system camera 53 | # for intsense bokeh use 54 | mkdir /data/vendor/camera/model 0777 system camera 55 | mkdir /data/vendor/camera/model/dof_model 0777 system camera 56 | mkdir /data/vendor/camera/model/rt_model 0777 system camera 57 | copy /vendor/etc/camera/model/dof_model/cache_data /data/vendor/camera/model/dof_model/cache_data 58 | copy /vendor/etc/camera/model/dof_model/model_mdl_cache /data/vendor/camera/model/dof_model/model_mdl_cache 59 | copy /vendor/etc/camera/model/dof_model/segment_model /data/vendor/camera/model/dof_model/segment_model 60 | chmod 0777 /data/vendor/camera/model/dof_model/cache_data 61 | chmod 0777 /data/vendor/camera/model/dof_model/model_mdl_cache 62 | chmod 0777 /data/vendor/camera/model/dof_model/segment_model 63 | chown system camera /data/vendor/camera/model/dof_model/cache_data 64 | chown system camera /data/vendor/camera/model/dof_model/model_mdl_cache 65 | chown system camera /data/vendor/camera/model/dof_model/segment_model 66 | # for mibokeh use 67 | mkdir /data/vendor/camera/mibokeh 0777 system camera 68 | #SMB 69 | chown system system /proc/smb/ScreenComm 70 | chmod 0660 /proc/smb/ScreenComm 71 | 72 | chmod 0660 /dev/spm 73 | chown system system /dev/spm 74 | 75 | #NFC 76 | chmod 0660 /dev/nq-nci 77 | chown nfc nfc /dev/nq-nci 78 | chmod 0660 /dev/p73 79 | chown nfc nfc /dev/p73 80 | -------------------------------------------------------------------------------- /sepolicy/vendor/genfs_contexts: -------------------------------------------------------------------------------- 1 | # Panel 2 | genfscon sysfs /devices/platform/14000000.dispsys_config/drm/card0/card0-DSI-1/panel_event u:object_r:vendor_sysfs_panel:s0 3 | genfscon sysfs /devices/platform/14000000.dispsys_config/drm/card0/card0-DSI-1/panel_info u:object_r:vendor_sysfs_panel:s0 4 | 5 | # Fingerprint 6 | genfscon sysfs /devices/platform/fingerprint u:object_r:vendor_fingerprint_device:s0 7 | 8 | # Graphics 9 | genfscon sysfs /devices/platform/13000000.mali u:object_r:sysfs_gpu:s0 10 | 11 | # LED 12 | genfscon sysfs /devices/platform/disp_leds/leds/lcd-backlight/brightness u:object_r:sysfs_leds:s0 13 | genfscon sysfs /devices/platform/disp_leds/leds/lcd-backlight/max_brightness u:object_r:sysfs_leds:s0 14 | 15 | # Vibrator 16 | genfscon sysfs /devices/platform/haptic_pwm/activate u:object_r:sysfs_vibrator:s0 17 | genfscon sysfs /devices/platform/haptic_pwm/duration u:object_r:sysfs_vibrator:s0 18 | 19 | # Performance 20 | genfscon proc /sys/vm/dirty_writeback_centisecs u:object_r:proc_vm_dirty:s0 21 | genfscon proc /sys/kernel/sched_stune_task_threshold u:object_r:proc_sched_stune:s0 22 | genfscon sysfs /kernel/gpu/gpu_(min|max)_clock u:object_r:sysfs_mtk_gpufreq:s0 23 | 24 | # Touchpanel 25 | genfscon sysfs /touchpanel u:object_r:sysfs_touchpanel:s0 26 | 27 | # Wakeup (https://lkml.org/lkml/2019/8/6/1275) 28 | genfscon sysfs /devices/platform/11cb0000.i2c3/i2c-3/3-0028/wakeup u:object_r:sysfs_wakeup:s0 29 | genfscon sysfs /devices/platform/11d00000.i2c5/i2c-5/5-004e/tcpc/type_c_port0/wakeup u:object_r:sysfs_wakeup:s0 30 | genfscon sysfs /devices/platform/11d00000.i2c5/i2c-5/5-004e/tcpc/type_c_port0/wakeup23 u:object_r:sysfs_wakeup:s0 31 | genfscon sysfs /devices/platform/11d00000.i2c5/i2c-5/5-004e/tcpc/type_c_port0/wakeup24 u:object_r:sysfs_wakeup:s0 32 | genfscon sysfs /devices/platform/11d00000.i2c5/i2c-5/5-004e/tcpc/type_c_port0/wakeup25 u:object_r:sysfs_wakeup:s0 33 | genfscon sysfs /devices/platform/11d00000.i2c5/i2c-5/5-004e/tcpc/type_c_port0/wakeup26 u:object_r:sysfs_wakeup:s0 34 | genfscon sysfs /devices/platform/11d00000.i2c5/i2c-5/5-004e/wakeup u:object_r:sysfs_wakeup:s0 35 | genfscon sysfs /devices/platform/battery/power_supply/bms/wakeup u:object_r:sysfs_wakeup:s0 36 | genfscon sysfs /devices/platform/battery/power_supply/bms/wakeup28 u:object_r:sysfs_wakeup:s0 37 | genfscon sysfs /devices/platform/fingerprint/wakeup u:object_r:sysfs_wakeup:s0 38 | genfscon sysfs /devices/platform/odm/odm:testing-mode/wakeup u:object_r:sysfs_wakeup:s0 39 | genfscon sysfs /devices/virtual/input/input2/wakeup32 u:object_r:sysfs_wakeup:s0 40 | -------------------------------------------------------------------------------- /configs/permissions/privapp-permissions-mediatek.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /lights/Light.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 The LineageOS Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | static unsigned int brightness_table_0x7ff[256] = { 26 | 0, 130, 234, 314, 394, 458, 498, 553, 593, 641, 681, 697, 27 | 737, 777, 801, 841, 865, 881, 921, 945, 961, 1001, 1025, 1048, 28 | 1064, 1088, 1104, 1128, 1144, 1168, 1168, 1168, 1168, 1232, 1232, 1248, 29 | 1272, 1272, 1288, 1288, 1312, 1312, 1328, 1328, 1352, 1352, 1368, 1368, 30 | 1392, 1392, 1408, 1408, 1432, 1432, 1432, 1456, 1456, 1456, 1472, 1472, 31 | 1472, 1496, 1496, 1496, 1512, 1512, 1512, 1536, 1536, 1536, 1536, 1551, 32 | 1551, 1551, 1551, 1575, 1575, 1591, 1591, 1591, 1591, 1591, 1615, 1615, 33 | 1615, 1639, 1639, 1639, 1639, 1639, 1655, 1655, 1655, 1655, 1655, 1679, 34 | 1679, 1679, 1679, 1679, 1695, 1695, 1695, 1695, 1695, 1719, 1719, 1719, 35 | 1719, 1719, 1735, 1735, 1735, 1735, 1735, 1735, 1735, 1735, 1759, 1759, 36 | 1759, 1759, 1775, 1775, 1775, 1775, 1775, 1775, 1799, 1799, 1799, 1799, 37 | 1799, 1799, 1799, 1799, 1799, 1799, 1815, 1815, 1815, 1815, 1815, 1815, 38 | 1815, 1839, 1839, 1839, 1839, 1839, 1839, 1839, 1863, 1863, 1863, 1863, 39 | 1863, 1863, 1863, 1863, 1863, 1863, 1879, 1879, 1879, 1879, 1879, 1879, 40 | 1879, 1879, 1879, 1903, 1903, 1903, 1903, 1903, 1903, 1903, 1903, 1903, 41 | 1919, 1919, 1919, 1919, 1919, 1919, 1919, 1919, 1919, 1919, 1943, 1943, 42 | 1943, 1943, 1943, 1943, 1943, 1943, 1943, 1943, 1959, 1959, 1959, 1959, 43 | 1959, 1959, 1959, 1959, 1959, 1959, 1959, 1959, 1983, 1983, 1983, 1983, 44 | 1983, 1983, 1983, 1983, 1983, 1983, 1983, 1999, 1999, 1999, 1999, 1999, 45 | 1999, 1999, 1999, 1999, 1999, 1999, 1999, 2023, 2023, 2023, 2023, 2023, 46 | 2023, 2023, 2023, 2023, 2023, 2023, 2023, 2023, 2047, 2047, 2047, 2047, 47 | 2047, 2047, 2047, 2047 48 | }; 49 | 50 | using ::aidl::android::hardware::light::HwLightState; 51 | using ::aidl::android::hardware::light::HwLight; 52 | using ::aidl::android::hardware::light::LightType; 53 | using ::aidl::android::hardware::light::BnLights; 54 | 55 | namespace aidl { 56 | namespace android { 57 | namespace hardware { 58 | namespace light { 59 | 60 | class Lights : public BnLights { 61 | ndk::ScopedAStatus setLightState(int id, const HwLightState& state) override; 62 | ndk::ScopedAStatus getLights(std::vector* types) override; 63 | }; 64 | 65 | } // namespace light 66 | } // namespace hardware 67 | } // namespace android 68 | } // namespace aidl 69 | -------------------------------------------------------------------------------- /sensors/HalProxyCallback.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 The Android Open Source 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 "HalProxyCallback.h" 18 | 19 | #include 20 | 21 | namespace android { 22 | namespace hardware { 23 | namespace sensors { 24 | namespace V2_0 { 25 | namespace implementation { 26 | 27 | static constexpr int32_t kBitsAfterSubHalIndex = 24; 28 | 29 | /** 30 | * Set the subhal index as first byte of sensor handle and return this modified version. 31 | * 32 | * @param sensorHandle The sensor handle to modify. 33 | * @param subHalIndex The index in the hal proxy of the sub hal this sensor belongs to. 34 | * 35 | * @return The modified sensor handle. 36 | */ 37 | int32_t setSubHalIndex(int32_t sensorHandle, size_t subHalIndex) { 38 | return sensorHandle | (static_cast(subHalIndex) << kBitsAfterSubHalIndex); 39 | } 40 | 41 | void HalProxyCallbackBase::postEvents(const std::vector& events, 42 | ScopedWakelock wakelock) { 43 | if (events.empty() || !mCallback->areThreadsRunning()) return; 44 | size_t numWakeupEvents; 45 | std::vector processedEvents = processEvents(events, &numWakeupEvents); 46 | if (numWakeupEvents > 0) { 47 | ALOG_ASSERT(wakelock.isLocked(), 48 | "Wakeup events posted while wakelock unlocked for subhal" 49 | " w/ index %" PRId32 ".", 50 | mSubHalIndex); 51 | } else { 52 | ALOG_ASSERT(!wakelock.isLocked(), 53 | "No Wakeup events posted but wakelock locked for subhal" 54 | " w/ index %" PRId32 ".", 55 | mSubHalIndex); 56 | } 57 | mCallback->postEventsToMessageQueue(processedEvents, numWakeupEvents, std::move(wakelock)); 58 | } 59 | 60 | ScopedWakelock HalProxyCallbackBase::createScopedWakelock(bool lock) { 61 | ScopedWakelock wakelock(mRefCounter, lock); 62 | return wakelock; 63 | } 64 | 65 | std::vector HalProxyCallbackBase::processEvents(const std::vector& events, 66 | size_t* numWakeupEvents) const { 67 | *numWakeupEvents = 0; 68 | std::vector eventsOut; 69 | for (V2_1::Event event : events) { 70 | event.sensorHandle = setSubHalIndex(event.sensorHandle, mSubHalIndex); 71 | const V2_1::SensorInfo& sensor = mCallback->getSensorInfo(event.sensorHandle); 72 | 73 | if (sensor.type == V2_1::SensorType::PICK_UP_GESTURE 74 | && event.u.scalar != 1) { 75 | continue; 76 | } 77 | 78 | if ((sensor.flags & V1_0::SensorFlagBits::WAKE_UP) != 0) { 79 | (*numWakeupEvents)++; 80 | } 81 | eventsOut.push_back(event); 82 | } 83 | return eventsOut; 84 | } 85 | 86 | } // namespace implementation 87 | } // namespace V2_0 88 | } // namespace sensors 89 | } // namespace hardware 90 | } // namespace android 91 | -------------------------------------------------------------------------------- /configs/media/media_codecs.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /lights/Light.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018-2023 The LineageOS Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "Light.h" 18 | 19 | #include 20 | 21 | #define LCD_LED "/sys/class/leds/lcd-backlight/" 22 | 23 | #define BRIGHTNESS "brightness" 24 | #define MAX_BRIGHTNESS "max_brightness" 25 | 26 | namespace { 27 | /* 28 | * Write value to path and close file. 29 | */ 30 | static void set(std::string path, std::string value) { 31 | std::ofstream file(path); 32 | 33 | if (!file.is_open()) { 34 | LOG(WARNING) << "failed to write " << value.c_str() << " to " << path.c_str(); 35 | return; 36 | } 37 | 38 | file << value; 39 | } 40 | 41 | static void set(std::string path, int value) { 42 | set(path, std::to_string(value)); 43 | } 44 | 45 | /* 46 | * Read max brightness from path and close file. 47 | */ 48 | static int getMaxBrightness(std::string path) { 49 | std::ifstream file(path); 50 | int value; 51 | 52 | if (!file.is_open()) { 53 | LOG(WARNING) << "failed to read from " << path.c_str(); 54 | return 0; 55 | } 56 | 57 | file >> value; 58 | return value; 59 | } 60 | 61 | static uint32_t getBrightness(const HwLightState& state) { 62 | uint32_t alpha, red, green, blue; 63 | 64 | /* 65 | * Extract brightness from AARRGGBB. 66 | */ 67 | alpha = (state.color >> 24) & 0xFF; 68 | red = (state.color >> 16) & 0xFF; 69 | green = (state.color >> 8) & 0xFF; 70 | blue = state.color & 0xFF; 71 | 72 | /* 73 | * Scale RGB brightness using Alpha brightness. 74 | */ 75 | red = red * alpha / 0xFF; 76 | green = green * alpha / 0xFF; 77 | blue = blue * alpha / 0xFF; 78 | 79 | return (77 * red + 150 * green + 29 * blue) >> 8; 80 | } 81 | 82 | static inline uint32_t scaleBrightness(uint32_t brightness, uint32_t maxBrightness) { 83 | LOG(DEBUG) << "Received brightness: " << brightness; 84 | 85 | if (maxBrightness == 2047) 86 | return brightness_table_0x7ff[brightness]; 87 | 88 | return brightness; 89 | } 90 | 91 | static inline uint32_t getScaledBrightness(const HwLightState& state, uint32_t maxBrightness) { 92 | return scaleBrightness(getBrightness(state), maxBrightness); 93 | } 94 | 95 | static void handleBacklight(const HwLightState& state) { 96 | uint32_t brightness = getScaledBrightness(state, getMaxBrightness(LCD_LED MAX_BRIGHTNESS)); 97 | LOG(DEBUG) << "Setting brightness: " << brightness; 98 | set(LCD_LED BRIGHTNESS, brightness); 99 | } 100 | 101 | /* Keep sorted in the order of importance. */ 102 | static std::vector backends = { 103 | LightType::BACKLIGHT, 104 | }; 105 | 106 | } // anonymous namespace 107 | 108 | namespace aidl { 109 | namespace android{ 110 | namespace hardware { 111 | namespace light { 112 | 113 | ndk::ScopedAStatus Lights::setLightState(int id, const HwLightState& state) { 114 | switch(id) { 115 | case (int) LightType::BACKLIGHT: 116 | handleBacklight(state); 117 | return ndk::ScopedAStatus::ok(); 118 | default: 119 | return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); 120 | } 121 | } 122 | 123 | ndk::ScopedAStatus Lights::getLights(std::vector* lights) { 124 | int i = 0; 125 | 126 | for (const LightType& backend : backends) { 127 | HwLight hwLight; 128 | hwLight.id = (int) backend; 129 | hwLight.type = backend; 130 | hwLight.ordinal = i; 131 | lights->push_back(hwLight); 132 | i++; 133 | } 134 | 135 | return ndk::ScopedAStatus::ok(); 136 | } 137 | 138 | } // namespace light 139 | } // namespace hardware 140 | } // namespace android 141 | } // namespace aidl 142 | -------------------------------------------------------------------------------- /configs/media/media_codecs_mediatek_audio.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/xml/power_profile.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 0.1 21 | 70.84 22 | 293.13 23 | 32.66 24 | 1.63 25 | 0.3 26 | 128.82 27 | 17.95 28 | 14.9 29 | 41.63 30 | 121.03 31 | 410.09 32 | 27.68 33 | 229.03 34 | 70.78 35 | 36 | 1.61 37 | 1.61 38 | 39 | 40 | 6 41 | 2 42 | 43 | 44 | 500000 45 | 650000 46 | 703000 47 | 756000 48 | 862000 49 | 968000 50 | 1048000 51 | 1128000 52 | 1287000 53 | 1393000 54 | 1500000 55 | 1645000 56 | 1750000 57 | 1812000 58 | 1916000 59 | 2000000 60 | 61 | 62 | 725000 63 | 840000 64 | 898000 65 | 985000 66 | 1042000 67 | 1129000 68 | 1274000 69 | 1418000 70 | 1534000 71 | 1650000 72 | 1837000 73 | 1993000 74 | 2118000 75 | 2210000 76 | 2306000 77 | 2400000 78 | 79 | 80 | 31.36 81 | 32.5 82 | 33.63 83 | 34.71 84 | 35.62 85 | 37.68 86 | 38.83 87 | 40.76 88 | 43.94 89 | 46.45 90 | 49.43 91 | 57.44 92 | 63.06 93 | 64.41 94 | 71.79 95 | 74.45 96 | 97 | 98 | 56.51 99 | 62.61 100 | 65.88 101 | 70.45 102 | 74.86 103 | 79.92 104 | 89.89 105 | 101.45 106 | 111.93 107 | 122.69 108 | 149.72 109 | 173.14 110 | 196.16 111 | 212.36 112 | 241.33 113 | 254.48 114 | 115 | 8.07 116 | 5 117 | 2.11 118 | 2.22 119 | 120 | 22.7 121 | 122 | 5000 123 | 0 124 | 0 125 | 0 126 | 127 | 0 128 | 129 | .0002 130 | .002 131 | .02 132 | .2 133 | 2 134 | 135 | 0 136 | 0 137 | 0 138 | 139 | 0 140 | 0 141 | 0 142 | 0 143 | 0 144 | 145 | 0 146 | 147 | 0 148 | 0 149 | 150 | 0 151 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /configs/nfc/libnfc-nci.conf: -------------------------------------------------------------------------------- 1 | ########################## Start of libnfc-nci.conf ########################### 2 | # Sep.19, 2019 Reviewed by Jian 3 | ############################################################################### 4 | # Application options 5 | NFC_DEBUG_ENABLED=1 6 | ############################################################################### 7 | # performance measurement 8 | # Change this setting to control how often USERIAL log the performance (throughput) 9 | # data on read/write/poll 10 | # defailt is to log performance dara for every 100 read or write 11 | #REPORT_PERFORMANCE_MEASURE=100 12 | ############################################################################### 13 | # File used for NFA storage 14 | NFA_STORAGE="/data/nfc" 15 | ############################################################################### 16 | # Configure the default NfcA/IsoDep techology and protocol route. Can be 17 | # either a secure element (e.g. 0xF4) or the host (0x00) 18 | #DEFAULT_ISODEP_ROUTE=0x00 19 | 20 | ############################################################################### 21 | ## Default poll duration (in ms) 22 | ## The defualt is 500ms if not set 23 | NFA_DM_DISC_DURATION_POLL=500 24 | 25 | ############################################################################### 26 | # Force UICC to only listen to the following technology(s). 27 | # The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h. 28 | # Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B | NFA_TECHNOLOGY_MASK_F 29 | UICC_LISTEN_TECH_MASK=0x07 30 | 31 | ############################################################################### 32 | # Force HOST listen feature enable or disable. 33 | # 0: Disable 34 | # 1: Enable 35 | HOST_LISTEN_ENABLE=0x01 36 | ############################################################################### 37 | # When screen is turned off, specify the desired power state of the controller. 38 | # 0: power-off-sleep state; DEFAULT 39 | # 1: full-power state 40 | # 2: screen-off card-emulation (CE4/CE3/CE1 modes are used) 41 | SCREEN_OFF_POWER_STATE=1 42 | ############################################################################### 43 | # Force tag polling for the following technology(s). 44 | # The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h. 45 | # Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B | 46 | # NFA_TECHNOLOGY_MASK_F | NFA_TECHNOLOGY_MASK_ISO15693 | 47 | # NFA_TECHNOLOGY_MASK_B_PRIME | 48 | # NFA_TECHNOLOGY_MASK_A_ACTIVE | NFA_TECHNOLOGY_MASK_F_ACTIVE. 49 | # 50 | # Notable bits: 51 | # NFA_TECHNOLOGY_MASK_A 0x01 /* NFC Technology A */ 52 | # NFA_TECHNOLOGY_MASK_B 0x02 /* NFC Technology B */ 53 | # NFA_TECHNOLOGY_MASK_F 0x04 /* NFC Technology F */ 54 | # NFA_TECHNOLOGY_MASK_ISO15693 0x08 /* Proprietary Technology */ 55 | # NFA_TECHNOLOGY_MASK_A_ACTIVE 0x40 /* NFC Technology A active mode */ 56 | # NFA_TECHNOLOGY_MASK_F_ACTIVE 0x80 /* NFC Technology F active mode */ 57 | POLLING_TECH_MASK=0x4F 58 | ############################################################################### 59 | # Force P2P to only listen for the following technology(s). 60 | # The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h. 61 | # Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_F | 62 | # NFA_TECHNOLOGY_MASK_A_ACTIVE | NFA_TECHNOLOGY_MASK_F_ACTIVE 63 | # 64 | # Notable bits: 65 | # NFA_TECHNOLOGY_MASK_A 0x01 /* NFC Technology A */ 66 | # NFA_TECHNOLOGY_MASK_F 0x04 /* NFC Technology F */ 67 | # NFA_TECHNOLOGY_MASK_A_ACTIVE 0x40 /* NFC Technology A active mode */ 68 | # NFA_TECHNOLOGY_MASK_F_ACTIVE 0x80 /* NFC Technology F active mode */ 69 | P2P_LISTEN_TECH_MASK=0x45 70 | ############################################################################### 71 | PRESERVE_STORAGE=0x01 72 | ############################################################################### 73 | # Override the stack default for NFA_EE_MAX_EE_SUPPORTED set in nfc_target.h. 74 | # The value is set to 3 by default as it assumes we will discover 0xF2, 75 | # 0xF3, and 0xF4. If a platform will exclude and SE, this value can be reduced 76 | # so that the stack will not wait any longer than necessary. 77 | 78 | # Maximum EE supported number 79 | # NXP PN547C2 0x02 80 | # NXP PN65T 0x03 81 | # NXP PN548C2 0x02 82 | # NXP PN66T 0x03 83 | NFA_MAX_EE_SUPPORTED=0x03 84 | ############################################################################## 85 | # Deactivate notification wait time out in seconds used in ETSI Reader mode 86 | # 0 - Infinite wait 87 | NFA_DM_DISC_NTF_TIMEOUT=0 88 | 89 | ############################################################################### 90 | # AID_MATCHING constants 91 | # AID_MATCHING_EXACT_ONLY 0x00 92 | # AID_MATCHING_EXACT_OR_PREFIX 0x01 93 | # AID_MATCHING_PREFIX_ONLY 0x02 94 | #AID_MATCHING_EXACT_OR_SUBSET_OR_PREFIX 0x03 95 | AID_MATCHING_MODE=0x03 96 | ############################################################################### 97 | # Preferred Secure Element for Technology based routing 98 | # eSE 0x01 99 | # UICC 0x02 100 | 101 | NXP_PRFD_TECH_SE=0x01 102 | 103 | ################################################################################ 104 | #Set bit to 1 , black list is enabled 105 | #Set bit to 0, to disable balcklist 106 | NFA_AID_BLOCK_ROUTE=0x01 107 | 108 | ################################################################################ 109 | # Maximum WTX requests entertained by MW 110 | NXP_WM_MAX_WTX_COUNT=30 111 | ################################################################################ 112 | #Set the default Felica T3T System Code : 113 | #This settings will be used when application does not set this parameter 114 | DEFAULT_SYS_CODE={FE:FE} 115 | ######################################################################### 116 | #Set NCI credit notification timeout value 117 | NXP_NCI_CREDIT_NTF_TIMEOUT=2 118 | ######################################################################### 119 | -------------------------------------------------------------------------------- /BoardConfig.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2023 The LineageOS Project 3 | # 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | 7 | DEVICE_PATH := device/xiaomi/cannon 8 | 9 | # Architecture 10 | TARGET_ARCH := arm64 11 | TARGET_ARCH_VARIANT := armv8-2a-dotprod 12 | TARGET_CPU_ABI := arm64-v8a 13 | TARGET_CPU_ABI2 := 14 | TARGET_CPU_VARIANT := generic 15 | TARGET_CPU_VARIANT_RUNTIME := cortex-a76 16 | 17 | TARGET_2ND_ARCH := arm 18 | TARGET_2ND_ARCH_VARIANT := armv8-2a 19 | TARGET_2ND_CPU_ABI := armeabi-v7a 20 | TARGET_2ND_CPU_ABI2 := armeabi 21 | TARGET_2ND_CPU_VARIANT := generic 22 | TARGET_2ND_CPU_VARIANT_RUNTIME := cortex-a55 23 | 24 | # Build system 25 | BUILD_BROKEN_DUP_RULES := true 26 | BUILD_BROKEN_ENFORCE_SYSPROP_OWNER := true 27 | BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true 28 | 29 | # APEX 30 | DEXPREOPT_GENERATE_APEX_IMAGE := true 31 | 32 | # Assert 33 | TARGET_OTA_ASSERT_DEVICE := cannon,cannong 34 | 35 | # Bootloader 36 | TARGET_BOOTLOADER_BOARD_NAME := cannon 37 | TARGET_NO_BOOTLOADER := true 38 | 39 | # Display 40 | TARGET_SCREEN_DENSITY := 440 41 | 42 | # Kernel 43 | BOARD_BOOTIMG_HEADER_VERSION := 2 44 | BOARD_KERNEL_BASE := 0x40078000 45 | BOARD_KERNEL_CMDLINE := bootopt=64S3,32N2,64N2 androidboot.usbconfigfs=true androidboot.init_fatal_reboot_target=recovery 46 | BOARD_PREBUILT_DTBOIMAGE := $(DEVICE_PATH)/prebuilts/dtbo.img 47 | BOARD_PREBUILT_DTBIMAGE := $(DEVICE_PATH)/prebuilts/dtb.img 48 | BOARD_KERNEL_PAGESIZE := 2048 49 | BOARD_RAMDISK_OFFSET := 0x07c08000 50 | BOARD_KERNEL_TAGS_OFFSET := 0x0bc08000 51 | BOARD_KERNEL_IMAGE_NAME := Image.gz 52 | KERNEL_LD := LD=ld.lld 53 | BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOTIMG_HEADER_VERSION) 54 | BOARD_MKBOOTIMG_ARGS += --ramdisk_offset $(BOARD_RAMDISK_OFFSET) 55 | BOARD_MKBOOTIMG_ARGS += --tags_offset $(BOARD_KERNEL_TAGS_OFFSET) 56 | BOARD_MKBOOTIMG_ARGS += --dtb $(BOARD_PREBUILT_DTBIMAGE) 57 | TARGET_KERNEL_CONFIG := cannon_defconfig 58 | TARGET_KERNEL_SOURCE := kernel/xiaomi/cannon 59 | 60 | # Partitions 61 | BOARD_FLASH_BLOCK_SIZE := 131072 # (BOARD_KERNEL_PAGESIZE * 64) 62 | BOARD_HAS_LARGE_FILESYSTEM := true 63 | BOARD_CACHEIMAGE_PARTITION_SIZE := 452984832 64 | BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 65 | BOARD_BOOTIMAGE_PARTITION_SIZE := 67108864 66 | BOARD_DTBOIMG_PARTITION_SIZE := 33554432 67 | BOARD_RECOVERYIMAGE_PARTITION_SIZE := 134217728 68 | BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4 69 | BOARD_SYSTEMIMAGE_PARTITION_TYPE := ext4 70 | BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 71 | BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4 72 | BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs 73 | BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4 74 | BOARD_SUPER_PARTITION_SIZE := 9126805504 # TODO: Fix hardcoded value 75 | BOARD_SUPER_PARTITION_GROUPS := xiaomi_dynamic_partitions 76 | BOARD_XIAOMI_DYNAMIC_PARTITIONS_PARTITION_LIST := system vendor product system_ext 77 | BOARD_XIAOMI_DYNAMIC_PARTITIONS_SIZE := 9122611200 # TODO: Fix hardcoded value 78 | 79 | BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE := 1258291200 80 | BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE := 30720000 81 | BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE := 1258291200 82 | BOARD_SYSTEM_EXTIMAGE_PARTITION_RESERVED_SIZE := 1258291200 83 | 84 | BOARD_SYSTEMIMAGE_EXTFS_INODE_COUNT := -1 85 | BOARD_PRODUCTIMAGE_EXTFS_INODE_COUNT := -1 86 | BOARD_SYSTEM_EXTIMAGE_EXTFS_INODE_COUNT := -1 87 | 88 | BOARD_ROOT_EXTRA_FOLDERS += metadata 89 | BOARD_USES_METADATA_PARTITION := true 90 | 91 | TARGET_USES_MKE2FS := true 92 | TARGET_USERIMAGES_USE_EXT4 := true 93 | TARGET_USERIMAGES_USE_F2FS := true 94 | TARGET_COPY_OUT_PRODUCT := product 95 | TARGET_COPY_OUT_SYSTEM_EXT := system_ext 96 | TARGET_COPY_OUT_VENDOR := vendor 97 | 98 | # Platform 99 | TARGET_BOARD_PLATFORM := mt6853 100 | BOARD_HAS_MTK_HARDWARE := true 101 | BOARD_HAVE_MTK_FM := true 102 | 103 | # Power 104 | TARGET_TAP_TO_WAKE_NODE := "/sys/touchpanel/double_tap" 105 | 106 | # Init 107 | TARGET_INIT_VENDOR_LIB := //$(DEVICE_PATH):init_cannon 108 | TARGET_RECOVERY_DEVICE_MODULES := init_cannon 109 | 110 | # Properties 111 | TARGET_SYSTEM_PROP += $(DEVICE_PATH)/system.prop 112 | TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop 113 | 114 | # Recovery 115 | TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/rootdir/etc/fstab.mt6853 116 | BOARD_INCLUDE_RECOVERY_DTBO := true 117 | TARGET_RECOVERY_PIXEL_FORMAT := RGBX_8888 118 | TARGET_RECOVERY_UI_BLANK_UNBLANK_ON_INIT := true 119 | TARGET_RECOVERY_UI_MARGIN_HEIGHT := 60 120 | 121 | # Sepolicy 122 | include device/mediatek/sepolicy_vndr/SEPolicy.mk 123 | BOARD_VENDOR_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/vendor 124 | SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/private 125 | 126 | # RIL 127 | ENABLE_VENDOR_RIL_SERVICE := true 128 | 129 | # Security patch level 130 | VENDOR_SECURITY_PATCH := 2021-11-05 131 | 132 | # AVB 133 | BOARD_AVB_ENABLE := true 134 | BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 3 135 | BOARD_AVB_VBMETA_SYSTEM := system 136 | BOARD_AVB_VBMETA_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem 137 | BOARD_AVB_VBMETA_SYSTEM_ALGORITHM := SHA256_RSA2048 138 | BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP) 139 | BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION := 1 140 | BOARD_AVB_RECOVERY_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem 141 | BOARD_AVB_RECOVERY_ALGORITHM := SHA256_RSA2048 142 | BOARD_AVB_RECOVERY_ROLLBACK_INDEX := 1 143 | BOARD_AVB_RECOVERY_ROLLBACK_INDEX_LOCATION := 1 144 | BOARD_AVB_VBMETA_VENDOR := vendor 145 | BOARD_AVB_VBMETA_VENDOR_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem 146 | BOARD_AVB_VBMETA_VENDOR_ALGORITHM := SHA256_RSA2048 147 | BOARD_AVB_VBMETA_VENDOR_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP) 148 | BOARD_AVB_VBMETA_VENDOR_ROLLBACK_INDEX_LOCATION := 2 149 | 150 | # VINTF 151 | DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := $(DEVICE_PATH)/configs/vintf/framework_compatibility_matrix.xml 152 | DEVICE_MATRIX_FILE += $(DEVICE_PATH)/configs/vintf/compatibility_matrix.xml 153 | DEVICE_MANIFEST_FILE += $(DEVICE_PATH)/configs/vintf/manifest.xml 154 | ODM_MANIFEST_SKUS += nfc 155 | ODM_MANIFEST_NFC_FILES := $(DEVICE_PATH)/configs/vintf/manifest_nfc.xml 156 | 157 | # Releasetools 158 | TARGET_RELEASETOOLS_EXTENSIONS := $(DEVICE_PATH) 159 | 160 | # WiFi 161 | WIFI_HIDL_FEATURE_DUAL_INTERFACE := true 162 | 163 | # Inherit the proprietary files 164 | include vendor/xiaomi/cannon/BoardConfigVendor.mk 165 | -------------------------------------------------------------------------------- /configs/audio/audio_effects.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /configs/audio/audio_policy.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Audio policy configuration for generic device builds (goldfish audio HAL - emulator) 3 | # 4 | 5 | # Global configuration section: lists input and output devices always present on the device 6 | # as well as the output device selected by default. 7 | # Devices are designated by a string that corresponds to the enum in audio.h 8 | 9 | #global_configuration { 10 | # attached_output_devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE 11 | # default_output_device AUDIO_DEVICE_OUT_SPEAKER 12 | # attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_REMOTE_SUBMIX|AUDIO_DEVICE_IN_FM_TUNER 13 | #} 14 | 15 | # audio hardware module section: contains descriptors for all audio hw modules present on the 16 | # device. Each hw module node is named after the corresponding hw module library base name. 17 | # For instance, "primary" corresponds to audio.primary..so. 18 | # The "primary" module is mandatory and must include at least one output with 19 | # AUDIO_OUTPUT_FLAG_PRIMARY flag. 20 | # Each module descriptor contains one or more output profile descriptors and zero or more 21 | # input profile descriptors. Each profile lists all the parameters supported by a given output 22 | # or input stream category. 23 | # The "channel_masks", "formats", "devices" and "flags" are specified using strings corresponding 24 | # to enums in audio.h and audio_policy.h. They are concatenated by use of "|" without space or "\n". 25 | 26 | audio_hw_modules { 27 | primary { 28 | global_configuration { 29 | attached_output_devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE 30 | default_output_device AUDIO_DEVICE_OUT_SPEAKER 31 | attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_FM_TUNER|AUDIO_DEVICE_IN_VOICE_CALL 32 | audio_hal_version 3.0 33 | } 34 | devices { 35 | headset { 36 | type AUDIO_DEVICE_OUT_WIRED_HEADSET 37 | gains { 38 | gain_1 { 39 | mode AUDIO_GAIN_MODE_JOINT 40 | channel_mask AUDIO_CHANNEL_OUT_STEREO 41 | min_value_mB -6400 42 | max_value_mB 0 43 | default_value_mB 0 44 | step_value_mB 100 45 | min_ramp_ms 0 46 | max_ramp_ms 0 47 | } 48 | } 49 | } 50 | headphone { 51 | type AUDIO_DEVICE_OUT_WIRED_HEADPHONE 52 | gains { 53 | gain_1 { 54 | mode AUDIO_GAIN_MODE_JOINT 55 | channel_mask AUDIO_CHANNEL_OUT_STEREO 56 | min_value_mB -6400 57 | max_value_mB 0 58 | default_value_mB 0 59 | step_value_mB 100 60 | min_ramp_ms 0 61 | max_ramp_ms 0 62 | } 63 | } 64 | } 65 | } 66 | outputs { 67 | primary { 68 | sampling_rates 44100|48000|96000|192000 69 | channel_masks AUDIO_CHANNEL_OUT_STEREO 70 | formats AUDIO_FORMAT_PCM_32_BIT|AUDIO_FORMAT_PCM_16_BIT 71 | devices AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET|AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_FM|AUDIO_DEVICE_OUT_DEFAULT 72 | flags AUDIO_OUTPUT_FLAG_PRIMARY 73 | gains { 74 | gain_1 { 75 | mode AUDIO_GAIN_MODE_JOINT 76 | channel_mask AUDIO_CHANNEL_OUT_STEREO 77 | min_value_mB -6400 78 | max_value_mB 0 79 | default_value_mB 0 80 | step_value_mB 100 81 | min_ramp_ms 0 82 | max_ramp_ms 0 83 | } 84 | } 85 | } 86 | hdmi_stereo { 87 | sampling_rates 44100 88 | channel_masks AUDIO_CHANNEL_OUT_STEREO 89 | formats AUDIO_FORMAT_PCM_32_BIT|AUDIO_FORMAT_PCM_16_BIT 90 | devices AUDIO_DEVICE_OUT_AUX_DIGITAL 91 | } 92 | hdmi_multi_channel { 93 | sampling_rates 32000|44100|48000 94 | channel_masks AUDIO_CHANNEL_OUT_5POINT1|AUDIO_CHANNEL_OUT_7POINT1 95 | formats AUDIO_FORMAT_PCM_32_BIT|AUDIO_FORMAT_PCM_8_24_BIT|AUDIO_FORMAT_PCM_16_BIT 96 | devices AUDIO_DEVICE_OUT_AUX_DIGITAL 97 | flags AUDIO_OUTPUT_FLAG_DIRECT 98 | } 99 | fast { 100 | sampling_rates 44100|48000|96000|192000 101 | channel_masks AUDIO_CHANNEL_OUT_STEREO 102 | formats AUDIO_FORMAT_PCM_32_BIT|AUDIO_FORMAT_PCM_16_BIT 103 | devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_EARPIECE 104 | flags AUDIO_OUTPUT_FLAG_FAST 105 | } 106 | } 107 | inputs { 108 | primary { 109 | sampling_rates 8000|16000|32000|44100|48000 110 | channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO|AUDIO_CHANNEL_IN_VOICE_UPLINK|AUDIO_CHANNEL_IN_VOICE_DNLINK 111 | formats AUDIO_FORMAT_PCM_16_BIT 112 | devices AUDIO_DEVICE_IN_COMMUNICATION|AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_AMBIENT|AUDIO_DEVICE_IN_WIRED_HEADSET|AUDIO_DEVICE_IN_AUX_DIGITAL|AUDIO_DEVICE_IN_MATV|AUDIO_DEVICE_IN_VOICE_CALL|AUDIO_DEVICE_IN_BACK_MIC|AUDIO_DEVICE_IN_ALL_SCO|AUDIO_DEVICE_IN_FM_TUNER|AUDIO_DEVICE_IN_DEFAULT 113 | } 114 | } 115 | } 116 | a2dp { 117 | global_configuration { 118 | audio_hal_version 2.0 119 | } 120 | outputs { 121 | a2dp { 122 | sampling_rates 44100 123 | channel_masks AUDIO_CHANNEL_OUT_STEREO 124 | formats AUDIO_FORMAT_PCM_16_BIT 125 | devices AUDIO_DEVICE_OUT_ALL_A2DP 126 | } 127 | } 128 | inputs { 129 | a2dp { 130 | sampling_rates 44100 131 | channel_masks AUDIO_CHANNEL_IN_STEREO 132 | formats AUDIO_FORMAT_PCM_16_BIT 133 | devices AUDIO_DEVICE_IN_BLUETOOTH_A2DP 134 | } 135 | } 136 | } 137 | usb { 138 | global_configuration { 139 | audio_hal_version 2.0 140 | } 141 | outputs { 142 | usb_accessory { 143 | sampling_rates 44100 144 | channel_masks AUDIO_CHANNEL_OUT_STEREO 145 | formats AUDIO_FORMAT_PCM_16_BIT 146 | devices AUDIO_DEVICE_OUT_USB_ACCESSORY 147 | } 148 | usb_device { 149 | sampling_rates dynamic 150 | channel_masks dynamic 151 | formats dynamic 152 | devices AUDIO_DEVICE_OUT_USB_DEVICE 153 | } 154 | } 155 | inputs { 156 | usb_device { 157 | sampling_rates dynamic 158 | channel_masks AUDIO_CHANNEL_IN_STEREO 159 | formats AUDIO_FORMAT_PCM_16_BIT 160 | devices AUDIO_DEVICE_IN_USB_DEVICE 161 | } 162 | } 163 | } 164 | r_submix { 165 | global_configuration { 166 | attached_input_devices AUDIO_DEVICE_IN_REMOTE_SUBMIX 167 | audio_hal_version 2.0 168 | } 169 | outputs { 170 | r_submix { 171 | sampling_rates 48000 172 | channel_masks AUDIO_CHANNEL_OUT_STEREO 173 | formats AUDIO_FORMAT_PCM_16_BIT 174 | devices AUDIO_DEVICE_OUT_REMOTE_SUBMIX 175 | } 176 | } 177 | inputs { 178 | r_submix { 179 | sampling_rates 48000 180 | channel_masks AUDIO_CHANNEL_IN_STEREO 181 | formats AUDIO_FORMAT_PCM_16_BIT 182 | devices AUDIO_DEVICE_IN_REMOTE_SUBMIX 183 | } 184 | } 185 | } 186 | } 187 | -------------------------------------------------------------------------------- /rootdir/etc/ueventd.mtk.rc: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2023 The LineageOS Project 3 | # SPDX-License-Identifier: GPL-2.0-only 4 | # 5 | 6 | #change partition permission 7 | # eMMC only 8 | /dev/block/mmcblk0 0660 root system 9 | /dev/block/mmcblk0boot0 0660 root system 10 | /dev/block/mmcblk0boot1 0660 root system 11 | /dev/misc-sd 0660 root system 12 | 13 | # UFS only 14 | /dev/block/sda 0660 root system 15 | /dev/block/sdb 0660 root system 16 | /dev/block/sdc 0660 root system 17 | 18 | # eMMC/UFS common 19 | /dev/block/by-name/misc2 0660 root system 20 | /dev/block/by-name/boot 0640 root system 21 | /dev/block/by-name/recovery 0640 root system 22 | /dev/block/by-name/secro 0640 root system 23 | /dev/block/by-name/seccfg 0660 root system 24 | /dev/block/by-name/proinfo 0660 root system 25 | /dev/block/by-name/nvram 0660 root system 26 | /dev/block/by-name/para 0660 root system 27 | /dev/block/by-name/logo 0660 root system 28 | /dev/block/by-name/frp 0660 root system 29 | /dev/block/by-name/md1img 0640 root system 30 | /dev/block/by-name/md1img_a 0640 root system 31 | /dev/block/by-name/md1img_b 0640 root system 32 | /dev/block/by-name/md1dsp 0660 root system 33 | /dev/block/by-name/boot_para 0640 root system 34 | 35 | # OTP 36 | /dev/otp 0660 system system 37 | /dev/block/by-name/otp 0660 root system 38 | 39 | # Connectivity 40 | /dev/stpwmt 0660 system system 41 | /dev/wmtdetect 0660 system system 42 | /dev/fw_log_wmt 0660 system system 43 | /dev/conninfra_dev 0660 system system 44 | 45 | # BT 46 | /dev/stpbt 0660 bluetooth bluetooth 47 | /dev/fw_log_bt 0660 bluetooth bluetooth 48 | 49 | # GPS 50 | /dev/gpsdl0 0660 gps gps 51 | /dev/gpsdl1 0660 gps gps 52 | /dev/stpgps 0660 gps gps 53 | /dev/gps 0660 gps system 54 | /dev/fw_log_gps 0660 gps gps 55 | /dev/gps_emi 0660 gps gps 56 | 57 | # ANT 58 | /dev/stpant 0660 system system 59 | 60 | # WIFI 61 | /dev/wmtWifi 0660 wifi wifi 62 | /dev/fw_log_wifi 0660 wifi wifi 63 | 64 | # FMRadio 65 | /dev/fm 0666 media media 66 | 67 | # NFC 68 | /dev/msr3110 0666 root root 69 | /dev/mt6605 0660 nfc radio 70 | /dev/st21nfc 0660 nfc radio 71 | /dev/st54spi 0660 secure_element secure_element 72 | 73 | # MTK BTIF driver 74 | /dev/btif 0600 system system 75 | 76 | # Trusty driver 77 | /dev/trusty-ipc-dev0 0660 system system 78 | /dev/nebula-ipc-dev0 0660 system system 79 | 80 | # RPMB (for Trusty) 81 | /dev/block/mmcblk0rpmb 0660 root system 82 | 83 | # TrustonicTEE driver 84 | /dev/mobicore 0600 system system 85 | /dev/mobicore-user 0666 system system 86 | /dev/t-base-tui 0666 system system 87 | 88 | #v4l2 device 89 | /dev/video* 0660 camera system 90 | /dev/media* 0660 camera system 91 | /dev/v4l-subdev* 0660 camera system 92 | 93 | #v4l2 codec 94 | /dev/vcu 0660 camera system 95 | 96 | #v4l2 camera 97 | /dev/mtk_hcp 0660 camera system 98 | 99 | # DRM node 100 | /dev/dri/card0 0660 system system 101 | 102 | # add the read write right of ttyUSB* 103 | /dev/bus/usb/* 0660 root usb 104 | /dev/ttyUSB0 0660 radio radio 105 | /dev/ttyUSB1 0660 radio radio 106 | /dev/ttyUSB2 0660 radio radio 107 | /dev/ttyUSB3 0660 radio radio 108 | /dev/ttyUSB4 0660 radio radio 109 | 110 | # Anyone can read the logs, but if they're not in the "logs" 111 | # group, then they'll only see log entries for their UID. 112 | /dev/log/ksystem 0600 root log 113 | 114 | /dev/ccci* 0660 radio radio 115 | /dev/ttyC* 0660 radio radio 116 | /sys/kernel/ccci modem_info 0644 radio radio 117 | /sys/kernel/ccci md1_postfix 0644 radio radio 118 | /sys/kernel/ccci md2_postfix 0644 radio radio 119 | /dev/eemcs* 0660 radio radio 120 | /dev/emd* 0660 radio radio 121 | /dev/ccci_pcm_rx 0660 audio audio 122 | /dev/ccci_pcm_tx 0660 audio audio 123 | /dev/ccci_aud 0660 audio audio 124 | /dev/ccci2_aud 0660 audio audio 125 | /dev/ccci3_aud 0660 audio audio 126 | /dev/ccci_raw_audio 0660 audio audio 127 | /dev/ccci3_raw_audio 0660 audio audio 128 | /dev/eemcs_aud 0660 audio audio 129 | /dev/irtx 0660 system system 130 | /dev/lirc* 0660 root system 131 | /dev/ir-learning 0660 system system 132 | # SGX device node 133 | /dev/pvrsrvkm 0666 root root 134 | /dev/pvr_sync 0666 root root 135 | 136 | 137 | /sys/devices/platform/leds-mt65xx/leds/green delay_on 0664 system system 138 | /sys/devices/platform/leds-mt65xx/leds/green delay_off 0664 system system 139 | /sys/devices/platform/leds-mt65xx/leds/red delay_on 0664 system system 140 | /sys/devices/platform/leds-mt65xx/leds/red delay_off 0664 system system 141 | /sys/devices/platform/leds-mt65xx/leds/blue delay_on 0664 system system 142 | /sys/devices/platform/leds-mt65xx/leds/blue delay_off 0664 system system 143 | 144 | #GPIO 145 | /dev/mtgpio 0600 radio root 146 | 147 | # Camera 148 | /dev/camera_eeprom* 0660 system camera 149 | 150 | #FOR VIA MODEM 151 | /dev/ttySDIO* 0660 radio sdcard_rw 152 | /dev/ttyRB* 0660 radio radio 153 | 154 | # Mali node 155 | /dev/mali 0666 system graphics 156 | 157 | # Change ION driver permission 158 | /dev/ion 0666 system graphics 159 | 160 | # Change DMA_HEAP deice permission 161 | # refs: /system/core/rootdir/uevent.rc 162 | # /dev/dma_heap/system 0444 system system 163 | /dev/dma_heap/mtk_mm 0444 system system 164 | /dev/dma_heap/mtk_mm-uncached 0444 system system 165 | /dev/dma_heap/mtk_prot_region 0444 system system 166 | /dev/dma_heap/mtk_svp_region 0444 system system 167 | 168 | #touch 169 | /dev/touch 0660 root system 170 | /dev/hotknot 0660 root system 171 | /dev/tll 0660 root system 172 | 173 | #hang_detect 174 | /dev/RT_Monitor 0600 system system 175 | /dev/kick_powerkey 0600 system system 176 | 177 | #MTK In-House TEE 178 | /dev/ttyACM0 0660 radio radio 179 | 180 | /dev/xlog 0660 system audio 181 | -------------------------------------------------------------------------------- /configs/powerhint.json: -------------------------------------------------------------------------------- 1 | { 2 | "Nodes": [ 3 | { 4 | "Name": "CPULittleClusterMaxFreq", 5 | "Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq", 6 | "Values": [ 7 | "9999999", 8 | "2000000", 9 | "1916000", 10 | "1812000", 11 | "1750000", 12 | "1645000", 13 | "1500000", 14 | "1393000", 15 | "1287000", 16 | "1128000", 17 | "1048000", 18 | "968000", 19 | "862000", 20 | "756000", 21 | "703000", 22 | "650000", 23 | "500000" 24 | ], 25 | "DefaultIndex": 0, 26 | "ResetOnInit": true 27 | }, 28 | { 29 | "Name": "CPULittleClusterMinFreq", 30 | "Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq", 31 | "Values": [ 32 | "9999999", 33 | "2000000", 34 | "1916000", 35 | "1812000", 36 | "1750000", 37 | "1645000", 38 | "1500000", 39 | "1393000", 40 | "1287000", 41 | "1128000", 42 | "1048000", 43 | "968000", 44 | "862000", 45 | "756000", 46 | "703000", 47 | "650000", 48 | "500000" 49 | ], 50 | "ResetOnInit": true 51 | }, 52 | { 53 | "Name": "CPUBigClusterMaxFreq", 54 | "Path": "/sys/devices/system/cpu/cpu6/cpufreq/scaling_max_freq", 55 | "Values": [ 56 | "9999999", 57 | "2400000", 58 | "2306000", 59 | "2210000", 60 | "2118000", 61 | "1993000", 62 | "1837000", 63 | "1650000", 64 | "1534000", 65 | "1418000", 66 | "1274000", 67 | "1129000", 68 | "1042000", 69 | "985000", 70 | "898000", 71 | "840000", 72 | "725000" 73 | ], 74 | "DefaultIndex": 0, 75 | "ResetOnInit": true 76 | }, 77 | { 78 | "Name": "CPUBigClusterMinFreq", 79 | "Path": "/sys/devices/system/cpu/cpu6/cpufreq/scaling_min_freq", 80 | "Values": [ 81 | "9999999", 82 | "2400000", 83 | "2306000", 84 | "2210000", 85 | "2118000", 86 | "1993000", 87 | "1837000", 88 | "1650000", 89 | "1534000", 90 | "1418000", 91 | "1274000", 92 | "1129000", 93 | "1042000", 94 | "985000", 95 | "898000", 96 | "840000", 97 | "725000" 98 | ], 99 | "ResetOnInit": true 100 | }, 101 | { 102 | "Name": "GPUSchedMode", 103 | "Path": "/sys/devices/platform/13000000.mali/js_ctx_scheduling_mode", 104 | "Values": [ 105 | "0", 106 | "1" 107 | ], 108 | "DefaultIndex": 0, 109 | "ResetOnInit": true 110 | }, 111 | { 112 | "Name": "GPUSchedPeriod", 113 | "Path": "/sys/devices/platform/13000000.mali/js_scheduling_period", 114 | "Values": [ 115 | "100", 116 | "75", 117 | "50", 118 | "0" 119 | ], 120 | "ResetOnInit": true, 121 | "DefaultIndex": 0 122 | }, 123 | { 124 | "Name": "GPUDVFSInterval", 125 | "Path": "/sys/devices/platform/13000000.mali/dvfs_period", 126 | "Values": [ 127 | "100", 128 | "75", 129 | "50" 130 | ], 131 | "ResetOnInit": true, 132 | "DefaultIndex": 0 133 | }, 134 | { 135 | "Name": "TASchedtuneBoost", 136 | "Path": "/dev/stune/top-app/schedtune.boost", 137 | "Values": [ 138 | "40", 139 | "10" 140 | ], 141 | "ResetOnInit": true 142 | }, 143 | { 144 | "Name": "CDSchedtuneBoost", 145 | "Path": "/dev/stune/camera-daemon/schedtune.boost", 146 | "Values": [ 147 | "1", 148 | "0" 149 | ], 150 | "ResetOnInit": true 151 | }, 152 | 153 | { 154 | "Name": "CCIFreqMode", 155 | "Path": "/proc/cpufreq/cpufreq_cci_mode", 156 | "Values": [ 157 | "0", 158 | "1" 159 | ], 160 | "ResetOnInit": true, 161 | "DefaultIndex": 0 162 | }, 163 | { 164 | "Name": "PowerHALMainState", 165 | "Path": "vendor.mediatek.powerhal.state", 166 | "Values": [ 167 | "SUSTAINED_PERFORMANCE", 168 | "" 169 | ], 170 | "Type": "Property" 171 | }, 172 | { 173 | "Name": "PowerHALAudioState", 174 | "Path": "vendor.mediatek.powerhal.audio", 175 | "Values": [ 176 | "AUDIO_STREAMING_LOW_LATENCY", 177 | "" 178 | ], 179 | "Type": "Property" 180 | }, 181 | { 182 | "Name": "PowerHALRenderingState", 183 | "Path": "vendor.mediatek.powerhal.rendering", 184 | "Values": [ 185 | "EXPENSIVE_RENDERING", 186 | "" 187 | ], 188 | "Type": "Property" 189 | } 190 | ], 191 | "Actions": [ 192 | { 193 | "PowerHint": "SUSTAINED_PERFORMANCE", 194 | "Node": "PowerHALMainState", 195 | "Duration": 0, 196 | "Value": "SUSTAINED_PERFORMANCE" 197 | }, 198 | { 199 | "PowerHint": "SUSTAINED_PERFORMANCE", 200 | "Node": "CPUBigClusterMaxFreq", 201 | "Duration": 0, 202 | "Value": "2400000" 203 | }, 204 | { 205 | "PowerHint": "SUSTAINED_PERFORMANCE", 206 | "Node": "CPULittleClusterMaxFreq", 207 | "Duration": 0, 208 | "Value": "2000000" 209 | }, 210 | { 211 | "PowerHint": "SUSTAINED_PERFORMANCE", 212 | "Node": "GPUSchedMode", 213 | "Duration": 0, 214 | "Value": "1" 215 | }, 216 | { 217 | "PowerHint": "INTERACTION", 218 | "Node": "CPULittleClusterMinFreq", 219 | "Duration": 0, 220 | "Value": "1500000" 221 | }, 222 | { 223 | "PowerHint": "INTERACTION", 224 | "Node": "CPUBigClusterMinFreq", 225 | "Duration": 0, 226 | "Value": "1042000" 227 | }, 228 | { 229 | "PowerHint": "INTERACTION", 230 | "Node": "CPULittleClusterMaxFreq", 231 | "Duration": 0, 232 | "Value": "2000000" 233 | }, 234 | { 235 | "PowerHint": "INTERACTION", 236 | "Node": "CPUBigClusterMaxFreq", 237 | "Duration": 0, 238 | "Value": "2400000" 239 | }, 240 | { 241 | "PowerHint": "INTERACTION", 242 | "Node": "TASchedtuneBoost", 243 | "Duration": 0, 244 | "Value": "40" 245 | }, 246 | { 247 | "PowerHint": "INTERACTION", 248 | "Node": "CCIFreqMode", 249 | "Duration": 0, 250 | "Value": "1" 251 | }, 252 | { 253 | "PowerHint": "LAUNCH", 254 | "Node": "CPUBigClusterMaxFreq", 255 | "Duration": 3000, 256 | "Value": "2400000" 257 | }, 258 | { 259 | "PowerHint": "LAUNCH", 260 | "Node": "CPUBigClusterMinFreq", 261 | "Duration": 3000, 262 | "Value": "1274000" 263 | }, 264 | { 265 | "PowerHint": "LAUNCH", 266 | "Node": "CPULittleClusterMaxFreq", 267 | "Duration": 3000, 268 | "Value": "2000000" 269 | }, 270 | { 271 | "PowerHint": "LAUNCH", 272 | "Node": "CPULittleClusterMinFreq", 273 | "Duration": 3000, 274 | "Value": "1750000" 275 | }, 276 | { 277 | "PowerHint": "AUDIO_STREAMING_LOW_LATENCY", 278 | "Node": "PowerHALAudioState", 279 | "Duration": 0, 280 | "Value": "AUDIO_STREAMING_LOW_LATENCY" 281 | }, 282 | { 283 | "PowerHint": "EXPENSIVE_RENDERING", 284 | "Node": "PowerHALRenderingState", 285 | "Duration": 0, 286 | "Value": "EXPENSIVE_RENDERING" 287 | }, 288 | { 289 | "PowerHint": "EXPENSIVE_RENDERING", 290 | "Node": "GPUDVFSInterval", 291 | "Duration": 0, 292 | "Value": "75" 293 | }, 294 | { 295 | "PowerHint": "EXPENSIVE_RENDERING", 296 | "Node": "GPUSchedMode", 297 | "Duration": 0, 298 | "Value": "1" 299 | } 300 | ] 301 | } 302 | -------------------------------------------------------------------------------- /configs/vintf/manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.hardware.audio 4 | hwbinder 5 | @7.0::IDevicesFactory/default 6 | 7 | 8 | android.hardware.audio.effect 9 | hwbinder 10 | @7.0::IEffectsFactory/default 11 | 12 | 13 | android.hardware.bluetooth 14 | hwbinder 15 | @1.1::IBluetoothHci/default 16 | 17 | 18 | android.hardware.camera.provider 19 | hwbinder 20 | @2.6::ICameraProvider/internal/0 21 | 22 | 23 | android.hardware.gatekeeper 24 | hwbinder 25 | @1.0::IGatekeeper/default 26 | 27 | 28 | android.hardware.graphics.allocator 29 | hwbinder 30 | @4.0::IAllocator/default 31 | 32 | 33 | android.hardware.graphics.composer 34 | hwbinder 35 | @2.3::IComposer/default 36 | 37 | 38 | android.hardware.graphics.mapper 39 | passthrough 40 | @4.0::IMapper/default 41 | 42 | 43 | android.hardware.ir 44 | hwbinder 45 | @1.0::IConsumerIr/default 46 | 47 | 48 | android.hardware.keymaster 49 | hwbinder 50 | @4.1::IKeymasterDevice/default 51 | 52 | 53 | android.hardware.media.omx 54 | hwbinder 55 | @1.0::IOmx/default 56 | @1.0::IOmxStore/default 57 | 58 | 59 | android.hardware.radio 60 | hwbinder 61 | @1.2::IRadio/em1 62 | @1.2::IRadio/em2 63 | @1.2::IRadio/imsAospSlot1 64 | @1.2::IRadio/imsAospSlot2 65 | @1.2::IRadio/se1 66 | @1.2::IRadio/se2 67 | @1.2::IRadio/slot1 68 | @1.2::IRadio/slot2 69 | @1.2::ISap/slot1 70 | @1.2::ISap/slot2 71 | @1.6::IRadio/em1 72 | @1.6::IRadio/em2 73 | @1.6::IRadio/imsAospSlot1 74 | @1.6::IRadio/imsAospSlot2 75 | @1.6::IRadio/se1 76 | @1.6::IRadio/se2 77 | @1.6::IRadio/slot1 78 | @1.6::IRadio/slot2 79 | 80 | 81 | android.hardware.radio.config 82 | hwbinder 83 | @1.3::IRadioConfig/default 84 | 85 | 86 | android.hardware.soundtrigger 87 | hwbinder 88 | @2.3::ISoundTriggerHw/default 89 | 90 | 91 | android.hardware.tetheroffload.config 92 | hwbinder 93 | @1.0::IOffloadConfig/default 94 | 95 | 96 | android.hardware.tetheroffload.control 97 | hwbinder 98 | @1.1::IOffloadControl/default 99 | 100 | 101 | android.hardware.thermal 102 | hwbinder 103 | @1.0::IThermal/default 104 | @2.0::IThermal/default 105 | 106 | 107 | android.hardware.vibrator 108 | hwbinder 109 | @1.0::IVibrator/default 110 | 111 | 112 | vendor.mediatek.hardware.apmonitor 113 | hwbinder 114 | @2.0::IApmService/apm_hidl_service 115 | 116 | 117 | vendor.mediatek.hardware.apuware.apusys 118 | hwbinder 119 | @2.0::INeuronApusys/default 120 | 121 | 122 | vendor.mediatek.hardware.apuware.utils 123 | hwbinder 124 | @2.0::IApuwareUtils/default 125 | 126 | 127 | vendor.mediatek.hardware.apuware.xrp 128 | hwbinder 129 | @2.0::INeuronXrp/default 130 | 131 | 132 | vendor.mediatek.hardware.atci 133 | hwbinder 134 | @1.0::IAtcid/default 135 | 136 | 137 | vendor.mediatek.hardware.bluetooth.audio 138 | hwbinder 139 | @2.2::IBluetoothAudioProvidersFactory/default 140 | 141 | 142 | vendor.mediatek.hardware.camera.atms 143 | hwbinder 144 | @1.0::IATMs/default 145 | 146 | 147 | vendor.mediatek.hardware.camera.bgservice 148 | hwbinder 149 | @1.1::IBGService/internal/0 150 | 151 | 152 | vendor.mediatek.hardware.camera.isphal 153 | hwbinder 154 | @1.0::IISPModule/internal/0 155 | 156 | 157 | vendor.mediatek.hardware.composer_ext 158 | hwbinder 159 | @1.0::IComposerExt/default 160 | 161 | 162 | vendor.mediatek.hardware.dmc 163 | hwbinder 164 | @1.2::IDmcService/dmc_hidl_service 165 | 166 | 167 | vendor.mediatek.hardware.engineermode 168 | hwbinder 169 | @1.3::IEmd/EmHidlServer 170 | 171 | 172 | vendor.mediatek.hardware.keymaster_attestation 173 | hwbinder 174 | @1.1::IKeymasterDevice/default 175 | 176 | 177 | vendor.mediatek.hardware.log 178 | hwbinder 179 | @1.0::ILog/ATMWiFiHidlServer 180 | @1.0::ILog/ConnsysFWHidlServer 181 | @1.0::ILog/LoggerHidlServer 182 | @1.0::ILog/MobileLogHidlServer 183 | @1.0::ILog/ModemLogHidlServer 184 | 185 | 186 | vendor.mediatek.hardware.mdmonitor 187 | hwbinder 188 | @1.0::IMDMonitorService/default 189 | 190 | 191 | vendor.mediatek.hardware.mmagent 192 | hwbinder 193 | @1.1::IMMAgent/default 194 | 195 | 196 | vendor.mediatek.hardware.mms 197 | hwbinder 198 | @1.6::IMms/default 199 | 200 | 201 | vendor.mediatek.hardware.mtkpower 202 | hwbinder 203 | @1.2::IMtkPerf/default 204 | @1.2::IMtkPower/default 205 | 206 | 207 | vendor.mediatek.hardware.mtkradioex 208 | hwbinder 209 | @3.0::IMtkRadioEx/imsSlot1 210 | @3.0::IMtkRadioEx/imsSlot2 211 | @3.0::IMtkRadioEx/mtkAssist1 212 | @3.0::IMtkRadioEx/mtkAssist2 213 | @3.0::IMtkRadioEx/mtkCap1 214 | @3.0::IMtkRadioEx/mtkCap2 215 | @3.0::IMtkRadioEx/mtkEm1 216 | @3.0::IMtkRadioEx/mtkEm2 217 | @3.0::IMtkRadioEx/mtkRcs1 218 | @3.0::IMtkRadioEx/mtkRcs2 219 | @3.0::IMtkRadioEx/mtkRsu1 220 | @3.0::IMtkRadioEx/mtkRsu2 221 | @3.0::IMtkRadioEx/mtkSe1 222 | @3.0::IMtkRadioEx/mtkSe2 223 | @3.0::IMtkRadioEx/mtkSlot1 224 | @3.0::IMtkRadioEx/mtkSlot2 225 | @3.0::IMtkRadioEx/mtkSmartRatSwitch1 226 | @3.0::IMtkRadioEx/mtkSmartRatSwitch2 227 | 228 | 229 | vendor.mediatek.hardware.netdagent 230 | hwbinder 231 | @1.0::INetdagent/default 232 | 233 | 234 | vendor.mediatek.hardware.nvram 235 | hwbinder 236 | @1.1::INvram/default 237 | 238 | 239 | vendor.mediatek.hardware.pq 240 | hwbinder 241 | @2.13::IPictureQuality/default 242 | 243 | 244 | vendor.mediatek.hardware.videotelephony 245 | hwbinder 246 | @1.0::IVideoTelephony/default 247 | 248 | 249 | vendor.microtrust.hardware.soter 250 | hwbinder 251 | @1.0::ISoter/default 252 | 253 | 254 | vendor.microtrust.hardware.thh 255 | hwbinder 256 | @2.0::IThhDevice/default 257 | 258 | 259 | --------------------------------------------------------------------------------