├── .clang-format
├── Android.bp
├── AndroidProducts.mk
├── BoardConfig.mk
├── board-info.txt
├── camera
├── Android.bp
├── libwatermark_shim.c
└── megvii_shim.cpp
├── configs
├── audio
│ ├── audio_effects.xml
│ ├── audio_io_policy.conf
│ ├── audio_platform_info.xml
│ ├── audio_policy_configuration.xml
│ ├── audio_policy_configuration_a2dp_offload_disabled.xml
│ ├── dax-default.xml
│ ├── mixer_paths_overlay_static.xml
│ └── mixer_paths_tavil.xml
├── config.fs
├── gps
│ ├── apdr.conf
│ ├── flp.conf
│ ├── gps.conf
│ ├── izat.conf
│ ├── lowi.conf
│ ├── sap.conf
│ └── xtwifi.conf
├── media
│ ├── media_codecs.xml
│ ├── media_codecs_c2.xml
│ ├── media_codecs_performance_c2.xml
│ ├── media_profiles.xml
│ ├── media_profiles_vendor.xml
│ └── system_properties.xml
├── msm_irqbalance.conf
├── nfc
│ ├── libnfc-nci.conf
│ ├── libnfc-nxp.conf
│ └── libnfc-nxp_RF.conf
├── powerhint.json
├── public.libraries.txt
├── qdcm_calib_data_samsung_ea8076_fhd_cmd_dsi_panel.xml
├── qdcm_calib_data_visionox_r66456_fhd_cmd_dsi_panel.xml
├── qti_whitelist.xml
├── sec_config
├── sensors
│ └── hals.conf
└── wifi
│ ├── WCNSS_qcom_cfg.ini
│ ├── p2p_supplicant_overlay.conf
│ └── wpa_supplicant_overlay.conf
├── device.mk
├── extract-files.sh
├── keylayout
├── Android.bp
├── gpio-keys.kl
└── sm8150-tavil-snd-card_Button_Jack.kl
├── libinit
├── Android.bp
├── include
│ ├── libinit_dalvik_heap.h
│ ├── libinit_utils.h
│ └── libinit_variant.h
├── init_xiaomi_raphael.cpp
├── libinit_dalvik_heap.cpp
├── libinit_utils.cpp
└── libinit_variant.cpp
├── lineage_raphael.mk
├── livedisplay
├── Android.bp
├── AntiFlicker.cpp
├── AntiFlicker.h
├── SunlightEnhancement.cpp
├── SunlightEnhancement.h
├── service.cpp
├── vendor.lineage.livedisplay@2.1-service.raphael.rc
└── vendor.lineage.livedisplay@2.1-service.raphael.xml
├── odm.prop
├── overlay
├── hardware
│ └── xiaomi
│ │ └── dolby
│ │ └── res
│ │ └── values
│ │ ├── arrays.xml
│ │ └── strings.xml
└── packages
│ └── apps
│ └── CarrierConfig
│ └── res
│ └── xml
│ └── vendor.xml
├── parts
├── Android.bp
├── AndroidManifest.xml
├── proguard.flags
├── res
│ ├── drawable
│ │ ├── ic_hbm_tile.xml
│ │ └── ic_settings_popup.xml
│ ├── layout
│ │ ├── haptic.xml
│ │ └── preference_slider.xml
│ ├── values
│ │ ├── arrays.xml
│ │ ├── integers.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── xml
│ │ ├── haptic_settings.xml
│ │ └── popup_settings.xml
└── src
│ └── org
│ └── lineageos
│ └── settings
│ ├── BootCompletedReceiver.java
│ ├── display
│ └── HBMTileService.java
│ ├── haptic
│ ├── HapticLevelActivity.java
│ ├── HapticLevelFragment.java
│ └── HapticUtils.java
│ ├── popupcamera
│ ├── Constants.java
│ ├── PopupCameraPreferences.java
│ ├── PopupCameraService.java
│ ├── PopupCameraSettingsActivity.java
│ ├── PopupCameraSettingsFragment.java
│ └── PopupCameraUtils.java
│ ├── utils
│ └── FileUtils.java
│ └── widget
│ └── SeekBarPreference.java
├── permissions
├── hotword-hiddenapi-package-whitelist.xml
├── privapp-permissions-hotword.xml
└── product_privapp-permissions-qti.xml
├── product.prop
├── proprietary-files.txt
├── releasetools.py
├── rootdir
├── Android.mk
└── etc
│ ├── Android.bp
│ ├── fstab.qcom
│ ├── fstab.recovery
│ ├── init.qcom.post_boot.sh
│ ├── init.qcom.power.rc
│ ├── init.qcom.rc
│ ├── init.qcom.sh
│ ├── init.qcom.usb.rc
│ ├── init.qcom.usb.sh
│ ├── init.qti.dcvs.sh
│ ├── init.raphael.rc
│ ├── init.raphael.wlan.rc
│ ├── init.raphael_boolx.rc
│ ├── init.recovery.qcom.rc
│ ├── init.target.rc
│ └── ueventd.qcom.rc
├── rro_overlays
├── ApertureOverlay
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── app
│ │ └── src
│ │ └── main
│ │ └── res
│ │ └── values
│ │ └── config.xml
├── DialerResXiaomi
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ │ └── values
│ │ └── config.xml
├── FrameworksResRaphael
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ │ ├── values
│ │ ├── config.xml
│ │ └── dimens.xml
│ │ └── xml
│ │ └── power_profile.xml
├── LineageSDKOverlay
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ │ └── values
│ │ └── config.xml
├── NfcResOverlayRaphael
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ │ └── values
│ │ └── config.xml
├── SettingsLibRaphael
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ │ └── values
│ │ └── config.xml
├── SettingsProviderOverlayRaphael
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ │ └── values
│ │ └── defaults.xml
├── SettingsResRaphael
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ │ └── values
│ │ ├── arrays.xml
│ │ ├── config.xml
│ │ └── dimens.xml
├── SystemUIResRaphael
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ │ ├── drawable-nodpi
│ │ └── udfps_icon_pressed.webp
│ │ ├── drawable
│ │ └── rounded.xml
│ │ └── values
│ │ ├── config.xml
│ │ └── dimens.xml
├── TelephonyResCommon
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ │ ├── values
│ │ └── config.xml
│ │ └── xml
│ │ └── telephony_injection.xml
├── TetheringConfigOverlay
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ │ └── values
│ │ └── config.xml
└── WifiOverlay
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ └── values
│ └── config.xml
├── seccomp
├── codec2.vendor.base.policy
├── codec2.vendor.ext.policy
└── mediacodec.policy
├── sensors
├── .clang-format
├── double_tap
│ ├── Android.bp
│ └── double_tap_hal.cpp
├── single_tap
│ ├── Android.bp
│ └── single_tap_hal.cpp
└── udfps
│ ├── Android.bp
│ └── udfps_hal.cpp
├── sepolicy
├── private
│ ├── app.te
│ ├── cameraserver.te
│ ├── dontaudit.te
│ ├── file_contexts
│ ├── isolated_app.te
│ ├── platform_app.te
│ ├── property_contexts
│ └── system_suspend.te
├── public
│ ├── domain.te
│ └── property.te
├── sepolicy.mk
└── vendor
│ ├── adsprpcd.te
│ ├── app.te
│ ├── appdomain.te
│ ├── attributes
│ ├── batterysecret.te
│ ├── cdsprpcd.te
│ ├── cnd.te
│ ├── crash_dump.te
│ ├── device.te
│ ├── file.te
│ ├── file_contexts
│ ├── genfs_contexts
│ ├── hal_audio_default.te
│ ├── hal_bluetooth_default.te
│ ├── hal_camera.te
│ ├── hal_camera_default.te
│ ├── hal_dms.te
│ ├── hal_dms_default.te
│ ├── hal_fingerprint_default.te
│ ├── hal_health_default.te
│ ├── hal_lineage_health.te
│ ├── hal_lineage_health_default.te
│ ├── hal_lineage_livedisplay_qti.te
│ ├── hal_mlipay_default.te
│ ├── hal_motor_default.te
│ ├── hal_neuralnetworks_default.te
│ ├── hal_nfc_default.te
│ ├── hal_perf_default.te
│ ├── hal_power_default.te
│ ├── hal_sensors_default.te
│ ├── hal_thermal_default.te
│ ├── hal_tui_comm_qti.te
│ ├── hvdcp.te
│ ├── hwservice.te
│ ├── hwservice_contexts
│ ├── init.te
│ ├── kernel.te
│ ├── mediacodec.te
│ ├── mediaserver.te
│ ├── mi_thermald.te
│ ├── nfc.te
│ ├── platform_app.te
│ ├── priv_app.te
│ ├── property.te
│ ├── property_contexts
│ ├── qti_init_shell.te
│ ├── radio.te
│ ├── remosaic_daemon.te
│ ├── rild.te
│ ├── seapp_contexts
│ ├── secure_ui_service_app.te
│ ├── sensors.te
│ ├── service.te
│ ├── service_contexts
│ ├── system_app.te
│ ├── system_server.te
│ ├── tee.te
│ ├── ueventd.te
│ ├── uncrypt.te
│ ├── vendor_hal_perf_default.te
│ ├── vendor_init.te
│ ├── vendor_qti_init_shell.te
│ ├── vendor_ssgtzd.te
│ ├── vndservice.te
│ ├── vndservice_contexts
│ ├── vppservice.te
│ ├── wcnss_service.te
│ ├── xiaomiparts.te
│ └── zygote.te
├── setup-makefiles.sh
├── sort-proprietary-files.sh
├── system.prop
├── system_ext.prop
├── udfps
├── Android.bp
└── UdfpsHandler.cpp
├── update-sha1sums.py
├── vendor.prop
└── vintf
├── compatibility_matrix.xml
├── framework_compatibility_matrix.xml
├── framework_manifest.xml
├── manifest-qva.xml
├── manifest.xml
└── manifest_nfc.xml
/.clang-format:
--------------------------------------------------------------------------------
1 | ../../../build/soong/scripts/system-clang-format
--------------------------------------------------------------------------------
/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2021-2024 The LineageOS Project
3 | // SPDX-License-Identifier: Apache-2.0
4 | //
5 |
6 | install_symlink {
7 | name: "firmware_WCNSS_qcom_cfg.ini_symlink",
8 | vendor: true,
9 | installed_location: "firmware/wlan/qca_cld/WCNSS_qcom_cfg.ini",
10 | symlink_target: "/vendor/etc/wifi/WCNSS_qcom_cfg.ini",
11 | }
12 |
13 | install_symlink {
14 | name: "firmware_wlan_mac.bin_symlink",
15 | vendor: true,
16 | installed_location: "firmware/wlan/qca_cld/wlan_mac.bin",
17 | symlink_target: "/mnt/vendor/persist/wlan_mac.bin",
18 | }
19 |
--------------------------------------------------------------------------------
/AndroidProducts.mk:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2020 LineageOS
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 | PRODUCT_MAKEFILES := \
16 | $(LOCAL_DIR)/lineage_raphael.mk
17 |
18 | COMMON_LUNCH_CHOICES := \
19 | lineage_raphael-user \
20 | lineage_raphael-userdebug \
21 | lineage_raphael-eng
22 |
--------------------------------------------------------------------------------
/board-info.txt:
--------------------------------------------------------------------------------
1 | require board=davinci || davinciin
2 |
--------------------------------------------------------------------------------
/camera/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2020 The LineageOS Project
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 |
16 | cc_library_shared {
17 | name: "libshim_megvii",
18 |
19 | proprietary: true,
20 | srcs: ["megvii_shim.cpp"],
21 | }
22 |
23 | cc_library_shared {
24 | name: "libwatermark_shim",
25 | srcs: ["libwatermark_shim.c"],
26 | vendor: true,
27 | }
28 |
--------------------------------------------------------------------------------
/camera/libwatermark_shim.c:
--------------------------------------------------------------------------------
1 | void _ZN4piex19GetPreviewImageDataEPNS_15StreamInterfaceEPNS_16PreviewImageDataE() {}
2 |
--------------------------------------------------------------------------------
/camera/megvii_shim.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2020 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | namespace android {
18 | extern "C" void mg_facepp() {}
19 | } // namespace android
20 |
--------------------------------------------------------------------------------
/configs/config.fs:
--------------------------------------------------------------------------------
1 | [AID_VENDOR_QTI_DIAG]
2 | value:2901
3 |
4 | [AID_VENDOR_QDSS]
5 | value:2902
6 |
7 | [AID_VENDOR_RFS]
8 | value:2903
9 |
10 | [AID_VENDOR_RFS_SHARED]
11 | value:2904
12 |
13 | [AID_VENDOR_ADPL_ODL]
14 | value:2905
15 |
16 | [AID_VENDOR_QRTR]
17 | value:2906
18 |
19 | [AID_VENDOR_THERMAL]
20 | value:2907
21 |
22 | [AID_VENDOR_FASTRPC]
23 | value:2908
24 |
25 | [AID_VENDOR_QTR]
26 | value:2909
27 |
28 | [vendor/bin/wcnss_filter]
29 | mode: 0755
30 | user: AID_BLUETOOTH
31 | group: AID_BLUETOOTH
32 | caps: BLOCK_SUSPEND
33 |
34 | [vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti]
35 | mode: 0755
36 | user: AID_BLUETOOTH
37 | group: AID_BLUETOOTH
38 | caps: BLOCK_SUSPEND NET_ADMIN
39 |
40 | [vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti-lazy]
41 | mode: 0755
42 | user: AID_BLUETOOTH
43 | group: AID_BLUETOOTH
44 | caps: BLOCK_SUSPEND NET_ADMIN
45 |
46 | [system/vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti-lazy]
47 | mode: 0755
48 | user: AID_SYSTEM
49 | group: AID_SYSTEM
50 | caps: BLOCK_SUSPEND NET_ADMIN
51 |
52 | [system/bin/cnss-daemon]
53 | mode: 0755
54 | user: AID_BLUETOOTH
55 | group: AID_BLUETOOTH
56 | caps: NET_BIND_SERVICE
57 |
58 | [vendor/bin/pm-service]
59 | mode: 0755
60 | user: AID_SYSTEM
61 | group: AID_SYSTEM
62 | caps: NET_BIND_SERVICE SYS_BOOT
63 |
64 | [system/bin/pm-service]
65 | mode: 0755
66 | user: AID_SYSTEM
67 | group: AID_SYSTEM
68 | caps: NET_BIND_SERVICE SYS_BOOT
69 |
70 | [vendor/bin/pd-mapper]
71 | mode: 0755
72 | user: AID_SYSTEM
73 | group: AID_SYSTEM
74 | caps: NET_BIND_SERVICE
75 |
76 | [system/bin/pd-mapper]
77 | mode: 0755
78 | user: AID_SYSTEM
79 | group: AID_SYSTEM
80 | caps: NET_BIND_SERVICE
81 |
82 | [vendor/bin/imsdatadaemon]
83 | mode: 0755
84 | user: AID_SYSTEM
85 | group: AID_SYSTEM
86 | caps: NET_BIND_SERVICE
87 |
88 | [vendor/bin/ims_rtp_daemon]
89 | mode: 0755
90 | user: AID_SYSTEM
91 | group: AID_RADIO
92 | caps: NET_BIND_SERVICE
93 |
94 | [vendor/bin/imsrcsd]
95 | mode: 0755
96 | user: AID_RADIO
97 | group: AID_RADIO
98 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM
99 |
100 | [vendor/bin/imsdaemon]
101 | mode: 0755
102 | user: AID_RADIO
103 | group: AID_RADIO
104 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM
105 |
106 | [vendor/bin/cnd]
107 | mode: 0755
108 | user: AID_SYSTEM
109 | group: AID_SYSTEM
110 | caps: NET_BIND_SERVICE BLOCK_SUSPEND NET_ADMIN
111 |
112 | [vendor/bin/slim_daemon]
113 | mode: 0755
114 | user: AID_GPS
115 | group: AID_GPS
116 | caps: NET_BIND_SERVICE
117 |
118 | [vendor/bin/loc_launcher]
119 | mode: 0755
120 | user: AID_GPS
121 | group: AID_GPS
122 | caps: SETUID SETGID
123 |
124 | [vendor/bin/xtwifi-client]
125 | mode: 0755
126 | user: AID_GPS
127 | group: AID_GPS
128 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM
129 |
130 | [vendor/bin/sensors.qti]
131 | mode: 0755
132 | user: AID_SYSTEM
133 | group: AID_SYSTEM
134 | caps: NET_BIND_SERVICE
135 |
136 | [vendor/firmware_mnt/image/*]
137 | mode: 0771
138 | user: AID_SYSTEM
139 | group: AID_SYSTEM
140 | caps: 0
141 |
142 | [persist/]
143 | mode: 0771
144 | user: AID_SYSTEM
145 | group: AID_SYSTEM
146 | caps: 0
147 |
148 | [dsp/]
149 | mode: 0771
150 | user: AID_MEDIA
151 | group: AID_MEDIA
152 | caps: 0
153 |
--------------------------------------------------------------------------------
/configs/gps/flp.conf:
--------------------------------------------------------------------------------
1 | ###################################
2 | ##### FLP settings #####
3 | ###################################
4 |
5 | ###################################
6 | # FLP BATCH SIZE
7 | ###################################
8 | # The number of batched locations
9 | # requested to modem. The desired number
10 | # defined below may not be satisfied, as
11 | # the modem can only return the number
12 | # of batched locations that can be allocated,
13 | # which is limited by memory. The default
14 | # batch size defined as 20 as below.
15 | BATCH_SIZE=20
16 |
17 | ###################################
18 | # FLP OUTDOOR TRIP BATCH SIZE
19 | ###################################
20 | # The number of batched locations
21 | # requested to modem for outdoor
22 | # trip batching. The desired number
23 | # defined below may not be satisfied, as
24 | # the modem can only return the number
25 | # of batched locations that can be allocated,
26 | # which is limited by memory. The default
27 | # trip batch size defined as 600 as below.
28 | OUTDOOR_TRIP_BATCH_SIZE=600
29 |
30 | ###################################
31 | # FLP BATCHING SESSION TIMEOUT
32 | ###################################
33 | # Duration with which batch session timeout
34 | # happens in milliseconds. If not specified
35 | # or set to zero, batching session timeout
36 | # defaults to 20 seconds by the modem.
37 | # BATCH_SESSION_TIMEOUT=20000
38 |
39 | ###################################
40 | # FLP BATCHING ACCURACY
41 | ###################################
42 | # Set to one of the defined values below
43 | # to define the accuracy of batching.
44 | # If not specified, accuracy defaults
45 | # to LOW.
46 | # FLP BATCHING ACCURACY values:
47 | # Low accuracy = 0
48 | # Medium accuracy = 1
49 | # High accuracy = 2
50 | ACCURACY=1
51 |
52 | ####################################
53 | # By default if network fixes are not sensor assisted
54 | # these fixes must be dropped. This parameter adds an exception
55 | # for targets where there is no PDR and we still want to
56 | # report out network fixes
57 | # 0: MUST NOT ALLOW NETWORK FIXES
58 | # 1: ALLOW NETWORK FIXES
59 | ####################################
60 | ALLOW_NETWORK_FIXES = 0
61 |
--------------------------------------------------------------------------------
/configs/gps/lowi.conf:
--------------------------------------------------------------------------------
1 | #*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*
2 | #
3 | # LOWI Config file - default
4 | #
5 | # GENERAL DESCRIPTION
6 | # This file contains the config params for LOWI
7 | #
8 | # Copyright (c) 2019 Qualcomm Technologies, Inc.
9 | # All Rights Reserved.
10 | # Confidential and Proprietary - Qualcomm Technologies, Inc.
11 | #
12 | # 2012-2013 Qualcomm Atheros, Inc.
13 | # All Rights Reserved.
14 | # Qualcomm Atheros Confidential and Proprietary.
15 | #
16 | # Export of this technology or software is regulated by the U.S. Government.
17 | # Diversion contrary to U.S. law prohibited.
18 | #=============================================================================*/
19 |
20 | # X86 ONLY - UBUNTU:
21 | # Copy this file in the same directory where the executable is
22 |
23 | # Log level
24 | # EL_LOG_OFF = 0, EL_ERROR = 1, EL_WARNING = 2, EL_INFO = 3, EL_DEBUG = 4, EL_VERBOSE = 5, EL_LOG_ALL = 100
25 | LOWI_LOG_LEVEL = 3
26 | LOWI_USE_LOWI_LP = 0
27 |
28 |
--------------------------------------------------------------------------------
/configs/gps/xtwifi.conf:
--------------------------------------------------------------------------------
1 | #GTP AP Project client core config file
2 | #
3 | #GENERAL DESCRIPTION
4 | #This is used by client core
5 | #
6 | #Copyright (c) 2012-2014 Qualcomm Atheros, Inc.
7 | #All Rights Reserved.
8 | #Qualcomm Atheros Confidential and Proprietary.
9 | #
10 | #Copyright (c) 2017 Qualcomm Technologies, Inc.
11 | #All Rights Reserved.
12 | #Confidential and Proprietary - Qualcomm Technologies, Inc.
13 |
14 | ##############################################################################
15 | # non-IOT devices configuration items #
16 | # For non-IOT devices, configure below configuration items #
17 | # according to the app note: 80-NK218-1 and remove the configuration items #
18 | # in section of "IOT devices configuration items". #
19 | ##############################################################################
20 |
21 | # ASN URI v2 to be used by some GTP AP modules that
22 | # need to run with ASN URI v2 protocol.
23 | XT_SERVER_ROOT_URL = https://gtp1.izatcloud.net:443/uds/v2
24 |
25 | # ASN URI v3 to be used by GTP AP modules that
26 | # can support ASN URI v3 protocol.
27 | XT_SERVER_ROOT_URL_V3 = https://gtp1.izatcloud.net:443/uds/v3
28 |
29 | # size, in bytes, of the cache on device
30 | SIZE_BYTE_TOTAL_CACHE = 5000000
31 |
32 | ##############################################################################
33 | # IOT devices configuration items #
34 | # For IOT devices, configure below configuration items #
35 | # according to the app note and remove the configuration items in section of #
36 | # "non-IOT devices configuration items". #
37 | ##############################################################################
38 |
39 | # ASN URI v3 to be used by GTP AP modules that
40 | # can support ASN URI v3 protocol.
41 | # XT_SERVER_ROOT_URL_V3 = https://gtpma1.izatcloud.net:443/uds/v3
42 |
43 | # 3: Wi-Fi APDB injection via Izat SDK. GTP server is not accessed
44 | # for any GTP requests, instead notification is sent to Izat SDK.
45 | # WiFi crowdsourcing module is disabled.
46 | # 4: Wi-Fi APDB injection via Izat SDK. GTP server is not accessed
47 | # for any GTP requests, instead notification is sent to Izat SDK.
48 | # WiFi crowdsourcing module is active, also accessed via Izat SDK.
49 | # GTP_AP_MODE = 4
50 |
51 | # 1: MP cell features relies on GTP AP for either download or upload
52 | # 0: MP cell features does not rely on GTP AP
53 | # GTP_AP_NEEDED_BY_MP_CELL = 1
54 |
55 | ##############################################################################
56 | # Configuration items applicable to all devices #
57 | ##############################################################################
58 |
59 | # Log verbosity control for most of the GTP WiFi system, including native and
60 | # Java componenets
61 | # OFF = 0, ERROR = 1, WARNING = 2, INFO = 3, DEBUG = 4, VERBOSE = 5, ALL = 100
62 | DEBUG_GLOBAL_LOG_LEVEL = 2
63 |
64 | # this is used at the server side to distinguish uploads from different maker/model
65 | # default "Qualcomm"
66 | OEM_ID_IN_REQUEST_TO_SERVER = "Qualcomm"
67 |
68 | # this is used at the server side to distinguish uploads from different maker/model
69 | # default "UNKNOWN"
70 | MODEL_ID_IN_REQUEST_TO_SERVER = "UNKNOWN"
71 |
72 | ##############################################################################
73 | # Qualcomm Network Location Provider config #
74 | ##############################################################################
75 |
76 | # Accuracy Threshold for NLP position. Position exceeds thsi threshold will be filtered out.
77 | # Default is 25000 meters.
78 | LARGE_ACCURACY_THRESHOLD_TO_FILTER_NLP_POSITION = 25000
79 |
--------------------------------------------------------------------------------
/configs/media/media_codecs.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/configs/media/system_properties.xml:
--------------------------------------------------------------------------------
1 |
2 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/configs/msm_irqbalance.conf:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2017, The Linux Foundation. All rights reserved.
2 | #
3 | # Redistribution and use in source and binary forms, with or without
4 | # modification, are permitted provided that the following conditions are
5 | # met:
6 | # * Redistributions of source code must retain the above copyright
7 | # notice, this list of conditions and the following disclaimer.
8 | # * Redistributions in binary form must reproduce the above
9 | # copyright notice, this list of conditions and the following
10 | # disclaimer in the documentation and/or other materials provided
11 | # with the distribution.
12 | # * Neither the name of The Linux Foundation nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 | #
29 |
30 | PRIO=1,1,1,1,0,0,0,0
31 | #arch_timer, arm-pmu, arch_mem_timer, msm_drm, kgsl-3d0
32 | IGNORED_IRQ=19,21,38,115,332
33 |
--------------------------------------------------------------------------------
/configs/public.libraries.txt:
--------------------------------------------------------------------------------
1 | libadsprpc.so
2 | libcdsprpc.so
3 | libsdsprpc.so
4 | libfastcvopt.so
5 | liblistensoundmodel2.so
6 | libOpenCL.so
7 | libnpu.so
8 | libmpbase.so 64
9 | libmialgoengine.so 64
10 | libVDClearShot.so
11 | libHalSuperSensorServer.so
12 | libSuperSensor.so
13 | libSuperSensorCPU.so
14 | libarcsoft_beautyshot.so 64
15 | libarcsoft_dualcam_refocus.so 64
16 | libarcsoft_dualcam_refocus_rear_t.so 64
17 | libarcsoft_dualcam_refocus_rear_w.so 64
18 | libarcsoft_dualcam_refocus_front.so 64
19 | libarcsoft_portrait_lighting.so 64
20 | libarcsoft_portrait_lighting_c.so 64
21 | libarcsoft_high_dynamic_range.so 64
22 | libarcsoft_low_light_hdr.so 64
23 | libmibokeh_855.so 64
24 | libarcsoft_distortion_correction.so 64
25 | libarcsoft_bodyslim.so 64
26 | libalCFR.so
27 | libcvp.so
28 | libcvp_stub.so
29 | libcvp_common.so
30 | libhta_hexagon_runtime.so
31 | unnhal-acc-hta.so
32 | libalhLDC.so
33 | libalAILDC.so
34 |
--------------------------------------------------------------------------------
/configs/sensors/hals.conf:
--------------------------------------------------------------------------------
1 | sensors.ssc.so
2 | sensors.raphael_udfps.so
3 | sensors.raphael_double_tap.so
4 | sensors.raphael_single_tap.so
5 |
--------------------------------------------------------------------------------
/configs/wifi/p2p_supplicant_overlay.conf:
--------------------------------------------------------------------------------
1 | disable_scan_offload=1
2 | p2p_no_group_iface=1
3 | persistent_reconnect=1
4 | bss_max_count=400
5 |
--------------------------------------------------------------------------------
/configs/wifi/wpa_supplicant_overlay.conf:
--------------------------------------------------------------------------------
1 | disable_scan_offload=1
2 | p2p_disabled=1
3 | tdls_external_control=1
4 | wowlan_triggers=magic_pkt
5 | bss_max_count=400
6 | interworking=1
7 | config_methods=virtual_display virtual_push_button keypad
8 | driver_param="use_p2p_group_interface=1 no_rrm=1"
9 | hs20=1
10 | auto_interworking=0
11 |
--------------------------------------------------------------------------------
/extract-files.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # SPDX-FileCopyrightText: 2016 The CyanogenMod Project
4 | # SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
5 | # SPDX-License-Identifier: Apache-2.0
6 | #
7 |
8 | set -e
9 |
10 | DEVICE=raphael
11 | VENDOR=xiaomi
12 |
13 | # Load extract_utils and do some sanity checks
14 | MY_DIR="${BASH_SOURCE%/*}"
15 | if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
16 |
17 | ANDROID_ROOT="${MY_DIR}/../../.."
18 |
19 | export TARGET_ENABLE_CHECKELF=true
20 |
21 | HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
22 | if [ ! -f "${HELPER}" ]; then
23 | echo "Unable to find helper script at ${HELPER}"
24 | exit 1
25 | fi
26 | source "${HELPER}"
27 |
28 | # Default to sanitizing the vendor folder before extraction
29 | CLEAN_VENDOR=true
30 |
31 | KANG=
32 | SECTION=
33 |
34 | while [ "${#}" -gt 0 ]; do
35 | case "${1}" in
36 | -n | --no-cleanup )
37 | CLEAN_VENDOR=false
38 | ;;
39 | -k | --kang )
40 | KANG="--kang"
41 | ;;
42 | -s | --section )
43 | SECTION="${2}"; shift
44 | CLEAN_VENDOR=false
45 | ;;
46 | * )
47 | SRC="${1}"
48 | ;;
49 | esac
50 | shift
51 | done
52 |
53 | if [ -z "${SRC}" ]; then
54 | SRC="adb"
55 | fi
56 |
57 | function blob_fixup() {
58 | case "${1}" in
59 | vendor/lib64/camera/components/com.qti.node.watermark.so)
60 | [ "$2" = "" ] && return 0
61 | grep -q "libpiex_shim.so" "${2}" || "${PATCHELF}" --add-needed "libpiex_shim.so" "${2}"
62 | ;;
63 | vendor/lib64/libdlbdsservice.so | vendor/lib/libstagefright_soft_ac4dec.so | vendor/lib/libstagefright_soft_ddpdec.so)
64 | [ "$2" = "" ] && return 0
65 | "${PATCHELF}" --replace-needed "libstagefright_foundation.so" "libstagefright_foundation-v33.so" "${2}"
66 | ;;
67 | vendor/lib64/mediadrm/libwvdrmengine.so|vendor/lib64/libwvhidl.so)
68 | [ "$2" = "" ] && return 0
69 | grep -q "libcrypto-v33.so" "${2}" || "${PATCHELF}" --replace-needed "libcrypto.so" "libcrypto-v33.so" "$2"
70 | ;;
71 | *)
72 | return 1
73 | ;;
74 | esac
75 |
76 | return 0
77 | }
78 |
79 | function blob_fixup_dry() {
80 | blob_fixup "$1" ""
81 | }
82 |
83 | # Initialize the helper
84 | setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}"
85 |
86 | extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}"
87 |
88 | "${MY_DIR}/setup-makefiles.sh"
89 |
--------------------------------------------------------------------------------
/keylayout/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2024 The LineageOS Project
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 | //
6 |
7 | prebuilt_usr_keylayout {
8 | name: "sm8150-tavil-snd-card_Button_Jack.kl",
9 | src: "sm8150-tavil-snd-card_Button_Jack.kl",
10 | vendor: true,
11 | }
12 |
13 | prebuilt_usr_keylayout {
14 | name: "gpio-keys.kl",
15 | src: "gpio-keys.kl",
16 | vendor: true,
17 | }
18 |
--------------------------------------------------------------------------------
/keylayout/gpio-keys.kl:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2013, The Linux Foundation. All rights reserved.
2 | #
3 | # Redistribution and use in source and binary forms, with or without
4 | # modification, are permitted provided that the following conditions are
5 | # met:
6 | # * Redistributions of source code must retain the above copyright
7 | # notice, this list of conditions and the following disclaimer.
8 | # * Redistributions in binary form must reproduce the above
9 | # copyright notice, this list of conditions and the following
10 | # disclaimer in the documentation and/or other materials provided
11 | # with the distribution.
12 | # * Neither the name of The Linux Foundation nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 |
27 | key 115 VOLUME_UP
28 | key 114 VOLUME_DOWN
29 | key 102 HOME
30 | key 528 FOCUS
31 | key 766 CAMERA
32 | key 689 AI
33 |
--------------------------------------------------------------------------------
/keylayout/sm8150-tavil-snd-card_Button_Jack.kl:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2014, The Linux Foundation. All rights reserved.
2 | #
3 | # Redistribution and use in source and binary forms, with or without
4 | # modification, are permitted provided that the following conditions are
5 | # met:
6 | # * Redistributions of source code must retain the above copyright
7 | # notice, this list of conditions and the following disclaimer.
8 | # * Redistributions in binary form must reproduce the above
9 | # copyright notice, this list of conditions and the following
10 | # disclaimer in the documentation and/or other materials provided
11 | # with the distribution.
12 | # * Neither the name of The Linux Foundation nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 |
28 | key 226 HEADSETHOOK
29 | key 257 VOLUME_UP
30 | key 258 VOLUME_DOWN
31 | key 115 VOLUME_UP
32 | key 114 VOLUME_DOWN
33 |
--------------------------------------------------------------------------------
/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_xiaomi_raphael",
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_xiaomi_raphael",
21 | srcs: ["init_xiaomi_raphael.cpp"],
22 | whole_static_libs: ["libinit_xiaomi_raphael"],
23 | include_dirs: ["system/core/init"],
24 | recovery_available: true,
25 | }
26 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 | const std::string fingerprint_to_description(const std::string &fingerprint);
17 |
18 | #endif // LIBINIT_UTILS_H
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 marketname;
20 | std::string model;
21 | std::string build_fingerprint;
22 |
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 |
--------------------------------------------------------------------------------
/libinit/init_xiaomi_raphael.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021-2022 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 | #define FINGERPRINT "Xiaomi/raphael/raphael:11/RKQ1.200826.002/V12.5.2.0.RFKMIXM:user/release-keys"
13 |
14 | static const variant_info_t raphael_global_info = {
15 | .hwc_value = "GLOBAL",
16 | .sku_value = "",
17 |
18 | .brand = "Xiaomi",
19 | .device = "raphael",
20 | .marketname = "",
21 | .model = "Mi 9T Pro",
22 | .build_fingerprint = FINGERPRINT,
23 |
24 | .nfc = true,
25 | };
26 |
27 | static const variant_info_t raphaelin_info = {
28 | .hwc_value = "INDIA",
29 | .sku_value = "",
30 |
31 | .brand = "Xiaomi",
32 | .device = "raphaelin",
33 | .marketname = "",
34 | .model = "Redmi K20 Pro",
35 | .build_fingerprint = FINGERPRINT,
36 |
37 | .nfc = false,
38 | };
39 |
40 | static const variant_info_t raphael_info = {
41 | .hwc_value = "",
42 | .sku_value = "",
43 |
44 | .brand = "Xiaomi",
45 | .device = "raphael",
46 | .marketname = "",
47 | .model = "Redmi K20 Pro",
48 | .build_fingerprint = FINGERPRINT,
49 |
50 | .nfc = true,
51 | };
52 |
53 | static const std::vector variants = {
54 | raphael_global_info,
55 | raphaelin_info,
56 | raphael_info,
57 | };
58 |
59 | void vendor_load_properties() {
60 | set_dalvik_heap();
61 | search_variant(variants);
62 | }
63 |
--------------------------------------------------------------------------------
/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_12288 = {
22 | .heapstartsize = "24m",
23 | .heapgrowthlimit = "512m",
24 | .heapsize = "512m",
25 | .heapminfree = "1m",
26 | .heapmaxfree = "12m",
27 | .heaptargetutilization = "0.75",
28 | };
29 |
30 | static const dalvik_heap_info_t dalvik_heap_info_8192 = {
31 | .heapstartsize = "24m",
32 | .heapgrowthlimit = "512m",
33 | .heapsize = "512m",
34 | .heapminfree = "1m",
35 | .heapmaxfree = "12m",
36 | .heaptargetutilization = "0.75",
37 | };
38 |
39 | static const dalvik_heap_info_t dalvik_heap_info_6144 = {
40 | .heapstartsize = "16m",
41 | .heapgrowthlimit = "384m",
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(11))
55 | dhi = &dalvik_heap_info_12288;
56 | else if (sys.totalram > GB(7))
57 | dhi = &dalvik_heap_info_8192;
58 | else
59 | dhi = &dalvik_heap_info_6144;
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 |
--------------------------------------------------------------------------------
/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 | "product.",
25 | "system.",
26 | "system_ext.",
27 | "vendor.",
28 | "",
29 | };
30 |
31 | void set_ro_build_prop(const std::string &prop, const std::string &value, bool product) {
32 | std::string prop_name;
33 |
34 | for (const auto &source : ro_props_default_source_order) {
35 | if (product)
36 | prop_name = "ro.product." + source + prop;
37 | else
38 | prop_name = "ro." + source + "build." + prop;
39 |
40 | property_override(prop_name, value, true);
41 | }
42 | }
43 |
44 | #define FIND_AND_REMOVE(s, delimiter, variable_name) \
45 | std::string variable_name = s.substr(0, s.find(delimiter)); \
46 | s.erase(0, s.find(delimiter) + delimiter.length());
47 |
48 | const std::string fingerprint_to_description(const std::string &fingerprint) {
49 | const std::string delimiter = "/";
50 | const std::string delimiter2 = ":";
51 |
52 | std::string build_fingerprint_copy = fingerprint;
53 |
54 | FIND_AND_REMOVE(build_fingerprint_copy, delimiter, brand)
55 | FIND_AND_REMOVE(build_fingerprint_copy, delimiter, product)
56 | FIND_AND_REMOVE(build_fingerprint_copy, delimiter2, device)
57 | FIND_AND_REMOVE(build_fingerprint_copy, delimiter, platform_version)
58 | FIND_AND_REMOVE(build_fingerprint_copy, delimiter, build_id)
59 | FIND_AND_REMOVE(build_fingerprint_copy, delimiter2, build_number)
60 | FIND_AND_REMOVE(build_fingerprint_copy, delimiter, build_variant)
61 | std::string build_version_tags = build_fingerprint_copy;
62 |
63 | const std::string description = product + "-" + build_variant + " " + platform_version +
64 | " " + build_id + " " + build_number + " " + build_version_tags;
65 |
66 | return description;
67 | }
68 |
--------------------------------------------------------------------------------
/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("marketname", variant.marketname, true);
35 | set_ro_build_prop("model", variant.model, true);
36 |
37 | if (access("/system/bin/recovery", F_OK) != 0) {
38 | set_ro_build_prop("fingerprint", variant.build_fingerprint);
39 | property_override("ro.bootimage.build.fingerprint", variant.build_fingerprint);
40 |
41 | property_override("ro.build.description", fingerprint_to_description(variant.build_fingerprint));
42 | }
43 |
44 | if (variant.nfc)
45 | property_override(SKU_PROP, "nfc");
46 | property_override("ro.boot.hardware.sku", "nfc");
47 | }
48 |
--------------------------------------------------------------------------------
/lineage_raphael.mk:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2020 LineageOS
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 | # Inherit from those products. Most specific first.
16 | $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk)
17 | $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk)
18 | $(call inherit-product, $(SRC_TARGET_DIR)/product/product_launched_with_p.mk)
19 |
20 | # Inherit from raphael device
21 | $(call inherit-product, device/xiaomi/raphael/device.mk)
22 |
23 | # Inherit some common Lineage stuff.
24 | $(call inherit-product, vendor/lineage/config/common_full_phone.mk)
25 |
26 | # Boot animation
27 | TARGET_SCREEN_HEIGHT := 2340
28 | TARGET_SCREEN_WIDTH := 1080
29 |
30 | # Device identifier. This must come after all inclusions.
31 | PRODUCT_NAME := lineage_raphael
32 | PRODUCT_DEVICE := raphael
33 | PRODUCT_BRAND := Xiaomi
34 | PRODUCT_MODEL := MI 9T Pro
35 | PRODUCT_MANUFACTURER := Xiaomi
36 | PRODUCT_CHARACTERISTICS := nosdcard
37 |
38 | PRODUCT_GMS_CLIENTID_BASE := android-xiaomi
39 |
40 | PRODUCT_BUILD_PROP_OVERRIDES += \
41 | BuildDesc="raphael-user 11 RKQ1.200826.002 V12.5.2.0.RFKMIXM release-keys" \
42 | BuildFingerprint=Xiaomi/raphael/raphael:11/RKQ1.200826.002/V12.5.2.0.RFKMIXM:user/release-keys
43 |
--------------------------------------------------------------------------------
/livedisplay/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2019-2020 The LineageOS Project
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 |
16 | cc_binary {
17 | name: "vendor.lineage.livedisplay@2.1-service.raphael",
18 | defaults: ["hidl_defaults"],
19 | vintf_fragments: ["vendor.lineage.livedisplay@2.1-service.raphael.xml"],
20 | init_rc: ["vendor.lineage.livedisplay@2.1-service.raphael.rc"],
21 | relative_install_path: "hw",
22 | srcs: [
23 | ":vendor.lineage.livedisplay@2.0-sdm-utils",
24 | "AntiFlicker.cpp",
25 | "SunlightEnhancement.cpp",
26 | "service.cpp",
27 | ],
28 | vendor: true,
29 | shared_libs: [
30 | "libbase",
31 | "libbinder",
32 | "libhidlbase",
33 | "libutils",
34 | "vendor.lineage.livedisplay@2.0",
35 | "vendor.lineage.livedisplay@2.1",
36 | ],
37 | header_libs: [
38 | "vendor.lineage.livedisplay@2.0-sdm-headers",
39 | ],
40 | }
41 |
--------------------------------------------------------------------------------
/livedisplay/AntiFlicker.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 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 | #define LOG_TAG "AntiFlickerService"
18 |
19 | #include "AntiFlicker.h"
20 | #include
21 | #include
22 |
23 | namespace vendor {
24 | namespace lineage {
25 | namespace livedisplay {
26 | namespace V2_1 {
27 | namespace implementation {
28 |
29 | static constexpr const char* kDcDimmingPath =
30 | "/sys/devices/platform/soc/soc:qcom,dsi-display-primary/dc_dim";
31 |
32 | Return AntiFlicker::isEnabled() {
33 | std::ifstream file(kDcDimmingPath);
34 | int result = -1;
35 | file >> result;
36 | LOG(DEBUG) << "Got result " << result << " fail " << file.fail();
37 | return !file.fail() && result > 0;
38 | }
39 |
40 | Return AntiFlicker::setEnabled(bool enabled) {
41 | std::ofstream file(kDcDimmingPath);
42 | file << (enabled ? "1" : "0");
43 | LOG(DEBUG) << "setEnabled fail " << file.fail();
44 | return !file.fail();
45 | }
46 |
47 | } // namespace implementation
48 | } // namespace V2_1
49 | } // namespace livedisplay
50 | } // namespace lineage
51 | } // namespace vendor
52 |
--------------------------------------------------------------------------------
/livedisplay/AntiFlicker.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 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 | #ifndef VENDOR_LINEAGE_LIVEDISPLAY_V2_1_ANTIFLICKER_H
18 | #define VENDOR_LINEAGE_LIVEDISPLAY_V2_1_ANTIFLICKER_H
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | namespace vendor {
25 | namespace lineage {
26 | namespace livedisplay {
27 | namespace V2_1 {
28 | namespace implementation {
29 |
30 | using ::android::hardware::Return;
31 | using ::android::hardware::Void;
32 | using ::android::sp;
33 |
34 | class AntiFlicker : public IAntiFlicker {
35 | public:
36 | // Methods from ::vendor::lineage::livedisplay::V2_1::IAntiFlicker follow.
37 | Return isEnabled() override;
38 | Return setEnabled(bool enabled) override;
39 | };
40 |
41 | } // namespace implementation
42 | } // namespace V2_1
43 | } // namespace livedisplay
44 | } // namespace lineage
45 | } // namespace vendor
46 |
47 | #endif // VENDOR_LINEAGE_LIVEDISPLAY_V2_1_ANTIFLICKER_H
48 |
--------------------------------------------------------------------------------
/livedisplay/SunlightEnhancement.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019-2020 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #define LOG_TAG "SunlightEnhancementService"
18 |
19 | #include
20 | #include
21 | #include
22 |
23 | #include "SunlightEnhancement.h"
24 |
25 | namespace vendor {
26 | namespace lineage {
27 | namespace livedisplay {
28 | namespace V2_1 {
29 | namespace implementation {
30 |
31 | static constexpr const char* kHbmStatusPath =
32 | "/sys/devices/platform/soc/soc:qcom,dsi-display-primary/hbm";
33 |
34 | Return SunlightEnhancement::isEnabled() {
35 | std::string buf;
36 | if (!android::base::ReadFileToString(kHbmStatusPath, &buf)) {
37 | LOG(ERROR) << "Failed to read " << kHbmStatusPath;
38 | return false;
39 | }
40 | return std::stoi(android::base::Trim(buf)) == 1;
41 | }
42 |
43 | Return SunlightEnhancement::setEnabled(bool enabled) {
44 | if (!android::base::WriteStringToFile((enabled ? "1" : "0"), kHbmStatusPath)) {
45 | LOG(ERROR) << "Failed to write " << kHbmStatusPath;
46 | return false;
47 | }
48 | return true;
49 | }
50 |
51 | } // namespace implementation
52 | } // namespace V2_1
53 | } // namespace livedisplay
54 | } // namespace lineage
55 | } // namespace vendor
56 |
--------------------------------------------------------------------------------
/livedisplay/SunlightEnhancement.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019-2020 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef VENDOR_LINEAGE_LIVEDISPLAY_V2_1_SUNLIGHTENHANCEMENT_H
18 | #define VENDOR_LINEAGE_LIVEDISPLAY_V2_1_SUNLIGHTENHANCEMENT_H
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | namespace vendor {
25 | namespace lineage {
26 | namespace livedisplay {
27 | namespace V2_1 {
28 | namespace implementation {
29 |
30 | using ::android::sp;
31 | using ::android::hardware::Return;
32 | using ::android::hardware::Void;
33 |
34 | class SunlightEnhancement : public ISunlightEnhancement {
35 | public:
36 | // Methods from ::vendor::lineage::livedisplay::V2_1::ISunlightEnhancement follow.
37 | Return isEnabled() override;
38 | Return setEnabled(bool enabled) override;
39 | };
40 |
41 | } // namespace implementation
42 | } // namespace V2_1
43 | } // namespace livedisplay
44 | } // namespace lineage
45 | } // namespace vendor
46 |
47 | #endif // VENDOR_LINEAGE_LIVEDISPLAY_V2_1_SUNLIGHTENHANCEMENT_H
48 |
--------------------------------------------------------------------------------
/livedisplay/service.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019-2020 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #define LOG_TAG "vendor.lineage.livedisplay@2.1-service.raphael"
18 |
19 | #include
20 | #include
21 | #include
22 |
23 | #include "AntiFlicker.h"
24 | #include "SunlightEnhancement.h"
25 | #include "livedisplay/sdm/SDMController.h"
26 |
27 | using android::OK;
28 | using android::sp;
29 | using android::status_t;
30 |
31 | using ::vendor::lineage::livedisplay::V2_0::sdm::SDMController;
32 | using ::vendor::lineage::livedisplay::V2_1::IAntiFlicker;
33 | using ::vendor::lineage::livedisplay::V2_1::ISunlightEnhancement;
34 | using ::vendor::lineage::livedisplay::V2_1::implementation::AntiFlicker;
35 | using ::vendor::lineage::livedisplay::V2_1::implementation::SunlightEnhancement;
36 |
37 | int main() {
38 | status_t status = OK;
39 | std::shared_ptr controller = std::make_shared();
40 | sp af = new AntiFlicker();
41 | sp se = new SunlightEnhancement();
42 | android::hardware::configureRpcThreadpool(1, true /*callerWillJoin*/);
43 |
44 | // AntiFlicker service
45 | status = af->registerAsService();
46 | if (status != OK) {
47 | LOG(ERROR) << "Could not register service for LiveDisplay HAL AntiFlicker Iface ("
48 | << status << ")";
49 | return 1;
50 | }
51 |
52 | // SunlightEnhancement service
53 | status = se->registerAsService();
54 | if (status != OK) {
55 | LOG(ERROR) << "Could not register service for LiveDisplay HAL SunlightEnhancement Iface ("
56 | << status << ")";
57 | return 1;
58 | }
59 |
60 | LOG(INFO) << "LiveDisplay HAL service is ready.";
61 |
62 | android::hardware::joinRpcThreadpool();
63 |
64 | LOG(ERROR) << "LiveDisplay HAL service failed to join thread pool.";
65 | return 1;
66 | }
67 |
--------------------------------------------------------------------------------
/livedisplay/vendor.lineage.livedisplay@2.1-service.raphael.rc:
--------------------------------------------------------------------------------
1 | on boot
2 | chown system system /sys/devices/platform/soc/soc:qcom,dsi-display-primary/hbm
3 | chown system system /sys/devices/platform/soc/soc:qcom,dsi-display-primary/dc_dim
4 | chmod 0660 /sys/devices/platform/soc/soc:qcom,dsi-display-primary/hbm
5 | chmod 0660 /sys/devices/platform/soc/soc:qcom,dsi-display-primary/dc_dim
6 |
7 | service vendor.livedisplay-hal-2-1 /vendor/bin/hw/vendor.lineage.livedisplay@2.1-service.raphael
8 | class hal
9 | user system
10 | group system
11 |
--------------------------------------------------------------------------------
/livedisplay/vendor.lineage.livedisplay@2.1-service.raphael.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | vendor.lineage.livedisplay
4 | hwbinder
5 | @2.0::IPictureAdjustment/default
6 | @2.1::IAntiFlicker/default
7 | @2.1::ISunlightEnhancement/default
8 |
9 |
10 |
--------------------------------------------------------------------------------
/odm.prop:
--------------------------------------------------------------------------------
1 | # Audio
2 | ro.vendor.qti.va_odm.support=1
3 | vendor.audio.feature.a2dp_offload.enable=true
4 | vendor.audio.feature.afe_proxy.enable=true
5 | vendor.audio.feature.anc_headset.enable=true
6 | vendor.audio.feature.audiozoom.enable=false
7 | vendor.audio.feature.battery_listener.enable=true
8 | vendor.audio.feature.compr_cap.enable=false
9 | vendor.audio.feature.compr_voip.enable=false
10 | vendor.audio.feature.compress_in.enable=false
11 | vendor.audio.feature.compress_meta_data.enable=true
12 | vendor.audio.feature.concurrent_capture.enable=false
13 | vendor.audio.feature.custom_stereo.enable=true
14 | vendor.audio.feature.deepbuffer_as_primary.enable=false
15 | vendor.audio.feature.display_port.enable=true
16 | vendor.audio.feature.dsm_feedback.enable=false
17 | vendor.audio.feature.dynamic_ecns.enable=false
18 | vendor.audio.feature.ext_hw_plugin.enable=true
19 | vendor.audio.feature.external_dsp.enable=false
20 | vendor.audio.feature.external_speaker.enable=false
21 | vendor.audio.feature.external_speaker_tfa.enable=false
22 | vendor.audio.feature.fluence.enable=true
23 | vendor.audio.feature.fm.enable=true
24 | vendor.audio.feature.hdmi_edid.enable=true
25 | vendor.audio.feature.hdmi_passthrough.enable=true
26 | vendor.audio.feature.hfp.enable=true
27 | vendor.audio.feature.hifi_audio.enable=false
28 | vendor.audio.feature.hwdep_cal.enable=false
29 | vendor.audio.feature.incall_music.enable=true
30 | vendor.audio.feature.keep_alive.enable=true
31 | vendor.audio.feature.kpi_optimize.enable=true
32 | vendor.audio.feature.maxx_audio.enable=false
33 | vendor.audio.feature.multi_voice_session.enable=true
34 | vendor.audio.feature.ras.enable=true
35 | vendor.audio.feature.record_play_concurency.enable=false
36 | vendor.audio.feature.snd_mon.enable=true
37 | vendor.audio.feature.spkr_prot.enable=true
38 | vendor.audio.feature.src_trkn.enable=true
39 | vendor.audio.feature.ssrec.enable=true
40 | vendor.audio.feature.usb_offload.enable=true
41 | vendor.audio.feature.usb_offload_burst_mode.enable=true
42 | vendor.audio.feature.usb_offload_sidetone_volume.enable=false
43 | vendor.audio.feature.vbat.enable=true
44 | vendor.audio.feature.wsa.enable=false
45 |
--------------------------------------------------------------------------------
/overlay/hardware/xiaomi/dolby/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 | - @string/dolby_profile_dynamic
11 | - @string/dolby_profile_video
12 | - @string/dolby_profile_music
13 | - @string/dolby_profile_game
14 | - @string/dolby_profile_voice
15 |
16 |
17 |
18 | - 0
19 | - 1
20 | - 2
21 | - 8
22 | - 9
23 |
24 |
25 |
--------------------------------------------------------------------------------
/overlay/hardware/xiaomi/dolby/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 | Dynamic
10 | Movie/Video
11 | Music
12 | Game
13 | Voice
14 |
15 |
--------------------------------------------------------------------------------
/parts/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2017-2021 The LineageOS Project
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 | //
6 |
7 | android_app {
8 | name: "XiaomiParts",
9 | defaults: [
10 | "SettingsLibDefaults",
11 | ],
12 |
13 | srcs: ["src/**/*.java"],
14 |
15 | certificate: "platform",
16 | platform_apis: true,
17 | system_ext_specific: true,
18 | privileged: true,
19 |
20 | static_libs: [
21 | "androidx.core_core",
22 | "androidx.preference_preference",
23 | "org.lineageos.settings.resources",
24 | "vendor.xiaomi.hardware.motor-V1.0-java",
25 | ],
26 |
27 | optimize: {
28 | proguard_flags_files: [
29 | "proguard.flags",
30 | ],
31 | },
32 | }
33 |
--------------------------------------------------------------------------------
/parts/proguard.flags:
--------------------------------------------------------------------------------
1 | -keep class org.lineageos.settings.popupcamera.* {
2 | *;
3 | }
4 |
--------------------------------------------------------------------------------
/parts/res/drawable/ic_hbm_tile.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/parts/res/drawable/ic_settings_popup.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
11 |
12 |
--------------------------------------------------------------------------------
/parts/res/layout/haptic.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
24 |
--------------------------------------------------------------------------------
/parts/res/layout/preference_slider.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
25 |
26 |
31 |
32 |
38 |
39 |
40 |
41 |
51 |
52 |
63 |
64 |
65 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/parts/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 | - @string/disabled
21 | - @string/pick_up_gesture_summary
22 | - @string/pick_up_wake_gesture_summary
23 |
24 |
25 |
26 | - 0
27 | - 1
28 | - 2
29 |
30 |
31 |
32 |
33 | - popup_muqin_up.ogg
34 | - popup_muqin_down.ogg
35 | - popup_yingyan_up.ogg
36 | - popup_yingyan_down.ogg
37 | - popup_mofa_up.ogg
38 | - popup_mofa_down.ogg
39 | - popup_jijia_up.ogg
40 | - popup_jijia_down.ogg
41 | - popup_chilun_up.ogg
42 | - popup_chilun_down.ogg
43 | - popup_cangmen_up.ogg
44 | - popup_cangmen_down.ogg
45 |
46 |
47 |
48 | - @string/action_none
49 | - @string/popup_title_muqin
50 | - @string/popup_title_yingyan
51 | - @string/popup_title_mofa
52 | - @string/popup_title_jijia
53 | - @string/popup_title_chilun
54 | - @string/popup_title_cangmen
55 |
56 |
57 |
58 | - -1
59 | - 0
60 | - 2
61 | - 4
62 | - 6
63 | - 8
64 | - 10
65 |
66 |
67 |
--------------------------------------------------------------------------------
/parts/res/values/integers.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 | 80
22 | 100
23 |
24 |
--------------------------------------------------------------------------------
/parts/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | Popup camera
20 | Camera LED
21 | Show LED light when the front camera appears and retracts
22 | Popup camera sound effects
23 | Xylophone
24 | Condor
25 | Magic
26 | Mecha
27 | Gearwheel
28 | Cabin door
29 | Calibration
30 | Calibrate the popup camera motor
31 | Motor calibration
32 | Unnecessary use of calibration may cause permanent damage. It is recommended to calibrate the popup camera motor only in case of it not moving properly or it being in incorrect position!
33 |
34 |
35 | Warning
36 | Couldn\'t close front camera. Try calibrating the motor.
37 | Couldn\'t open front camera. Try calibrating the motor.
38 | Front camera cannot be used during calibration.
39 | Calibrate
40 | Couldn\'t calibrate
41 | Calibrated successfully. You can open the front camera now.
42 |
43 |
44 | Do you want to raise the front facing camera?
45 | No
46 | Yes
47 | Front camera raise dialog
48 | Always ask before opening
49 | Only ask when the screen is off
50 |
51 |
52 | Haptic feedback
53 | Setting-up haptic level too high may cause permanent hardware damage, use at your own risk
54 | Customize vibration intensity
55 | Level
56 | Amount of vibration intensity
57 | Feature not supported
58 |
59 |
60 | High Brightness Mode
61 |
62 |
--------------------------------------------------------------------------------
/parts/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/parts/res/xml/haptic_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
20 |
21 |
28 |
29 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/parts/res/xml/popup_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
10 |
11 |
17 |
18 |
25 |
26 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/parts/src/org/lineageos/settings/BootCompletedReceiver.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 The CyanogenMod Project
3 | * 2017-2019 The LineageOS Project
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 | package org.lineageos.settings;
19 |
20 | import android.content.BroadcastReceiver;
21 | import android.content.Context;
22 | import android.content.Intent;
23 | import android.content.SharedPreferences;
24 | import android.util.Log;
25 | import androidx.preference.PreferenceManager;
26 | import org.lineageos.settings.haptic.HapticUtils;
27 | import org.lineageos.settings.popupcamera.PopupCameraUtils;
28 | import org.lineageos.settings.utils.FileUtils;
29 |
30 | public class BootCompletedReceiver extends BroadcastReceiver {
31 | private static final boolean DEBUG = false;
32 | private static final String TAG = "XiaomiParts";
33 | private static final String HBM_ENABLE_KEY = "hbm_mode";
34 | private static final String HBM_NODE = "/sys/devices/platform/soc/soc:qcom,dsi-display-primary/hbm";
35 |
36 | @Override
37 | public void onReceive(final Context context, Intent intent) {
38 | if (DEBUG)
39 | Log.d(TAG, "Received boot completed intent");
40 | HapticUtils.restoreLevel(context);
41 | PopupCameraUtils.startService(context);
42 |
43 | SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
44 |
45 | boolean hbmEnabled = sharedPrefs.getBoolean(HBM_ENABLE_KEY, false);
46 | FileUtils.writeLine(HBM_NODE, hbmEnabled ? "1" : "0");
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/parts/src/org/lineageos/settings/display/HBMTileService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The OmniROM Project
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | */
18 | package org.lineageos.settings.display;
19 |
20 | import android.annotation.TargetApi;
21 | import android.content.Intent;
22 | import android.content.SharedPreferences;
23 | import android.service.quicksettings.Tile;
24 | import android.service.quicksettings.TileService;
25 | import androidx.preference.PreferenceManager;
26 |
27 | import org.lineageos.settings.utils.FileUtils;
28 |
29 | public class HBMTileService extends TileService {
30 |
31 | private static final String HBM_ENABLE_KEY = "hbm_mode";
32 | private static final String HBM_NODE = "/sys/devices/platform/soc/soc:qcom,dsi-display-primary/hbm";
33 |
34 | private void updateUI(boolean enabled) {
35 | final Tile tile = getQsTile();
36 | tile.setState(enabled ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE);
37 | tile.updateTile();
38 | }
39 |
40 | @Override
41 | public void onStartListening() {
42 | super.onStartListening();
43 | SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
44 | updateUI(sharedPrefs.getBoolean(HBM_ENABLE_KEY, false));
45 | }
46 |
47 | @Override
48 | public void onStopListening() {
49 | super.onStopListening();
50 | }
51 |
52 | @Override
53 | public void onClick() {
54 | super.onClick();
55 | SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
56 | final boolean enabled = !(sharedPrefs.getBoolean(HBM_ENABLE_KEY, false));
57 | FileUtils.writeLine(HBM_NODE, enabled ? "1" : "0");
58 | sharedPrefs.edit().putBoolean(HBM_ENABLE_KEY, enabled).commit();
59 | updateUI(enabled);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/parts/src/org/lineageos/settings/haptic/HapticLevelActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License
15 | */
16 |
17 | package org.lineageos.settings.haptic;
18 |
19 | import android.os.Bundle;
20 |
21 | import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity;
22 |
23 | public class HapticLevelActivity extends CollapsingToolbarBaseActivity {
24 |
25 | private final String TAG_HAPTIC = "haptic_level";
26 |
27 | @Override
28 | protected void onCreate(Bundle savedInstanceState) {
29 | super.onCreate(savedInstanceState);
30 |
31 | getFragmentManager().beginTransaction().replace(
32 | com.android.settingslib.collapsingtoolbar.R.id.content_frame,
33 | new HapticLevelFragment(), TAG_HAPTIC)
34 | .commit();
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/parts/src/org/lineageos/settings/haptic/HapticLevelFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License
15 | */
16 |
17 | package org.lineageos.settings.haptic;
18 |
19 | import android.content.Context;
20 | import android.os.Bundle;
21 | import android.os.VibrationEffect;
22 | import android.os.Vibrator;
23 | import android.view.LayoutInflater;
24 | import android.view.View;
25 | import android.view.ViewGroup;
26 |
27 | import androidx.preference.Preference;
28 | import androidx.preference.Preference.OnPreferenceChangeListener;
29 | import androidx.preference.PreferenceFragment;
30 |
31 | import org.lineageos.settings.R;
32 | import org.lineageos.settings.utils.FileUtils;
33 | import org.lineageos.settings.widget.SeekBarPreference;
34 |
35 | public class HapticLevelFragment extends PreferenceFragment implements OnPreferenceChangeListener {
36 |
37 | private Vibrator mVibrator;
38 |
39 | @Override
40 | public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
41 | addPreferencesFromResource(R.xml.haptic_settings);
42 |
43 | final SeekBarPreference mHapticLevel = (SeekBarPreference) findPreference(HapticUtils.PREF_LEVEL);
44 | if (FileUtils.fileExists(HapticUtils.PATH_LEVEL)) {
45 | mVibrator = (Vibrator) getContext().getSystemService(Context.VIBRATOR_SERVICE);
46 | if (mVibrator == null || !mVibrator.hasVibrator()) {
47 | mVibrator = null;
48 | }
49 | mHapticLevel.setEnabled(true);
50 | mHapticLevel.setOnPreferenceChangeListener(this);
51 | } else {
52 | mHapticLevel.setSummary(R.string.haptic_level_summary_incompatible);
53 | mHapticLevel.setEnabled(false);
54 | }
55 | }
56 |
57 | @Override
58 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
59 | Bundle savedInstanceState) {
60 | final View view = LayoutInflater.from(getContext()).inflate(R.layout.haptic, container, false);
61 | ((ViewGroup) view).addView(super.onCreateView(inflater, container, savedInstanceState));
62 | return view;
63 | }
64 |
65 | @Override
66 | public boolean onPreferenceChange(Preference preference, Object newValue) {
67 | if (HapticUtils.PREF_LEVEL.equals(preference.getKey())) {
68 | HapticUtils.applyLevel(getContext(), (int) newValue, true);
69 | doHapticFeedback();
70 | }
71 |
72 | return true;
73 | }
74 |
75 | private void doHapticFeedback() {
76 | if (mVibrator == null) {
77 | return;
78 | }
79 | mVibrator.vibrate(VibrationEffect.createOneShot(500,
80 | VibrationEffect.DEFAULT_AMPLITUDE));
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/parts/src/org/lineageos/settings/haptic/HapticUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License
15 | */
16 |
17 | package org.lineageos.settings.haptic;
18 |
19 | import android.content.Context;
20 | import android.os.VibrationEffect;
21 | import android.os.Vibrator;
22 | import android.provider.Settings;
23 |
24 | import java.lang.Math;
25 |
26 | import org.lineageos.settings.utils.FileUtils;
27 |
28 | public final class HapticUtils {
29 |
30 | final static String PREF_LEVEL = "haptic_level_pref";
31 | final static String PATH_LEVEL = "/sys/module/qti_haptics/parameters/vmax_mv_override";
32 |
33 | final static int MIN_LEVEL = 1;
34 | final static int MAX_LEVEL = 3700;
35 |
36 | public static void applyLevel(Context context, int value, boolean test) {
37 | if (FileUtils.fileExists(PATH_LEVEL)) {
38 | double level = value / 100.0 * (MAX_LEVEL - MIN_LEVEL) + MIN_LEVEL;
39 | int newValue = (int) Math.round(level);
40 | FileUtils.writeLine(PATH_LEVEL, String.valueOf(newValue));
41 |
42 | if (test) {
43 | Vibrator dev = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
44 | if (dev.hasVibrator()) {
45 | dev.vibrate(VibrationEffect.createOneShot(15, VibrationEffect.DEFAULT_AMPLITUDE));
46 | }
47 | }
48 | }
49 | }
50 |
51 | public static void restoreLevel(Context context) {
52 | applyLevel(context, Settings.Secure.getInt(
53 | context.getContentResolver(), PREF_LEVEL, 80), false);
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/parts/src/org/lineageos/settings/popupcamera/Constants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2020 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.lineageos.settings.popupcamera;
18 |
19 | public class Constants {
20 | public static final int FREE_FALL_SENSOR_ID = 33171042;
21 |
22 | public static final int CAMERA_EVENT_DELAY_TIME = 100; // ms
23 | public static final int MSG_CAMERA_CLOSED = 1001;
24 | public static final int MSG_CAMERA_OPEN = 1002;
25 |
26 | public static final int MOTOR_STATUS_POPUP_OK = 11;
27 | public static final int MOTOR_STATUS_POPUP_JAMMED = 12;
28 | public static final int MOTOR_STATUS_TAKEBACK_OK = 13;
29 | public static final int MOTOR_STATUS_TAKEBACK_JAMMED = 14;
30 | public static final int MOTOR_STATUS_PRESSED = 15;
31 | public static final int MOTOR_STATUS_CALIB_OK = 17;
32 | public static final int MOTOR_STATUS_CALIB_ERROR = 18;
33 | public static final int MOTOR_STATUS_REQUEST_CALIB = 19;
34 |
35 | public static final String CLOSE_CAMERA_STATE = "0";
36 | public static final String OPEN_CAMERA_STATE = "1";
37 |
38 | public static final String FRONT_CAMERA_ID = "1";
39 | public static final String LEFT_LED_BREATH_PATH = "/sys/class/leds/green/breath";
40 | public static final String LEFT_LED_BRIGHTNESS_PATH = "/sys/class/leds/green/brightness";
41 | public static final String LEFT_LED_PATH = "/sys/class/leds/green/";
42 | public static final String RIGHT_LED_PATH = "/sys/class/leds/blue/";
43 | public static final String POPUP_SOUND_PATH = "/system/media/audio/ui/";
44 | }
45 |
--------------------------------------------------------------------------------
/parts/src/org/lineageos/settings/popupcamera/PopupCameraPreferences.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.lineageos.settings.popupcamera;
18 |
19 | import android.content.Context;
20 | import android.content.SharedPreferences;
21 | import android.preference.PreferenceManager;
22 |
23 | public class PopupCameraPreferences {
24 | private static final String TAG = "PopupCameraUtils";
25 | private static final boolean DEBUG = false;
26 | private static final String LED_EFFECT_KEY = "popup_led_effect";
27 | private static final boolean LED_EFFECT_DEFAULT_VALUE = true;
28 | private static final String SOUND_EFFECT_KEY = "popup_sound_effect";
29 | private static final String SOUND_EFFECT_DEFAULT_VALUE = "-1";
30 | private SharedPreferences mSharedPrefs;
31 |
32 | public PopupCameraPreferences(Context context) {
33 | mSharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
34 | }
35 |
36 | public String getSoundEffect() {
37 | return mSharedPrefs.getString(SOUND_EFFECT_KEY, SOUND_EFFECT_DEFAULT_VALUE);
38 | }
39 |
40 | public boolean isLedAllowed() {
41 | return mSharedPrefs.getBoolean(LED_EFFECT_KEY, LED_EFFECT_DEFAULT_VALUE);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/parts/src/org/lineageos/settings/popupcamera/PopupCameraSettingsActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015-2016 The CyanogenMod Project
3 | * 2017 The LineageOS Project
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 | package org.lineageos.settings.popupcamera;
19 |
20 | import android.os.Bundle;
21 |
22 | import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity;
23 |
24 | public class PopupCameraSettingsActivity extends CollapsingToolbarBaseActivity {
25 | private static final String TAG_POPUPCAMERA = "popupcamera";
26 |
27 | @Override
28 | protected void onCreate(Bundle savedInstanceState) {
29 | super.onCreate(savedInstanceState);
30 |
31 | getFragmentManager().beginTransaction().replace(
32 | com.android.settingslib.collapsingtoolbar.R.id.content_frame,
33 | new PopupCameraSettingsFragment(), TAG_POPUPCAMERA).commit();
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/parts/src/org/lineageos/settings/popupcamera/PopupCameraUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.lineageos.settings.popupcamera;
18 |
19 | import android.content.Context;
20 | import android.content.Intent;
21 | import android.hardware.input.InputManager;
22 | import android.os.Handler;
23 | import android.os.Looper;
24 | import android.os.SystemClock;
25 | import android.os.UserHandle;
26 | import android.view.InputDevice;
27 | import android.view.KeyEvent;
28 | import android.view.KeyCharacterMap;
29 |
30 | public class PopupCameraUtils {
31 | private static final String TAG = "PopupCameraUtils";
32 | private static final boolean DEBUG = false;
33 |
34 | public static void startService(Context context) {
35 | context.startServiceAsUser(
36 | new Intent(context, PopupCameraService.class), UserHandle.CURRENT);
37 | }
38 |
39 | public static void triggerVirtualKeypress(Context context, final int keyCode) {
40 | final InputManager im = InputManager.getInstance();
41 | final long now = SystemClock.uptimeMillis();
42 | int downflags = 0;
43 |
44 | final KeyEvent downEvent = new KeyEvent(now, now, KeyEvent.ACTION_DOWN,
45 | keyCode, 0, 0, KeyCharacterMap.VIRTUAL_KEYBOARD, 0,
46 | KeyEvent.FLAG_FROM_SYSTEM, InputDevice.SOURCE_KEYBOARD);
47 | final KeyEvent upEvent = new KeyEvent(now, now, KeyEvent.ACTION_UP,
48 | keyCode, 0, 0, KeyCharacterMap.VIRTUAL_KEYBOARD, 0,
49 | KeyEvent.FLAG_FROM_SYSTEM, InputDevice.SOURCE_KEYBOARD);
50 |
51 | final Handler handler = new Handler(Looper.getMainLooper());
52 |
53 | final Runnable downRunnable = new Runnable() {
54 | @Override
55 | public void run() {
56 | im.injectInputEvent(downEvent, InputManager.INJECT_INPUT_EVENT_MODE_ASYNC);
57 | }
58 | };
59 |
60 | final Runnable upRunnable = new Runnable() {
61 | @Override
62 | public void run() {
63 | im.injectInputEvent(upEvent, InputManager.INJECT_INPUT_EVENT_MODE_ASYNC);
64 | }
65 | };
66 |
67 | handler.post(downRunnable);
68 | handler.postDelayed(upRunnable, 10);
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/permissions/hotword-hiddenapi-package-whitelist.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/permissions/privapp-permissions-hotword.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/product.prop:
--------------------------------------------------------------------------------
1 | # Display
2 | ro.surface_flinger.has_wide_color_display=true
3 |
--------------------------------------------------------------------------------
/releasetools.py:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2009 The Android Open Source Project
2 | # Copyright (c) 2011, The Linux Foundation. All rights reserved.
3 | # Copyright (C) 2017-2020 The LineageOS Project
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 | import hashlib
18 | import common
19 | import re
20 |
21 | def FullOTA_InstallEnd(info):
22 | OTA_InstallEnd(info)
23 | return
24 |
25 | def IncrementalOTA_InstallEnd(info):
26 | OTA_InstallEnd(info)
27 | return
28 |
29 | def FullOTA_Assertions(info):
30 | AddTrustZoneAssertion(info, info.input_zip)
31 | return
32 |
33 | def IncrementalOTA_Assertions(info):
34 | AddTrustZoneAssertion(info, info.target_zip)
35 | return
36 |
37 | def AddImage(info, basename, dest):
38 | path = "IMAGES/" + basename
39 | if path not in info.input_zip.namelist():
40 | return
41 |
42 | data = info.input_zip.read(path)
43 | common.ZipWriteStr(info.output_zip, basename, data)
44 | info.script.AppendExtra('package_extract_file("%s", "%s");' % (basename, dest))
45 |
46 | def OTA_InstallEnd(info):
47 | info.script.Print("Patching dtbo and vbmeta images...")
48 | AddImage(info, "dtbo.img", "/dev/block/bootdevice/by-name/dtbo")
49 | AddImage(info, "vbmeta.img", "/dev/block/bootdevice/by-name/vbmeta")
50 | return
51 |
52 | def AddTrustZoneAssertion(info, input_zip):
53 | android_info = info.input_zip.read("OTA/android-info.txt")
54 | m = re.search(r'require\s+version-trustzone\s*=\s*(\S+)'.encode('utf-8'), android_info)
55 | if m:
56 | versions = m.group(1).split('|')
57 | if len(versions) and '*' not in versions:
58 | cmd = 'assert(xiaomi.verify_trustzone(' + ','.join(['"%s"' % tz for tz in versions]) + ') == "1" || abort("ERROR: This package requires firmware from an Android 10 based MIUI build. Please upgrade firmware and retry!"););'
59 | info.script.AppendExtra(cmd)
60 | return
61 |
--------------------------------------------------------------------------------
/rootdir/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 | LOCAL_MODULE := fstab.qcom_ramdisk
5 | LOCAL_MODULE_STEM := fstab.qcom
6 | LOCAL_MODULE_TAGS := optional
7 | LOCAL_MODULE_CLASS := ETC
8 | LOCAL_SRC_FILES := etc/fstab.qcom
9 | LOCAL_MODULE_PATH := $(TARGET_RAMDISK_OUT)
10 | include $(BUILD_PREBUILT)
11 |
12 | include $(CLEAR_VARS)
13 | LOCAL_MODULE := fstab.qcom
14 | LOCAL_MODULE_TAGS := optional
15 | LOCAL_MODULE_CLASS := ETC
16 | LOCAL_SRC_FILES := etc/fstab.qcom
17 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)
18 | include $(BUILD_PREBUILT)
19 |
20 | include $(CLEAR_VARS)
21 | LOCAL_MODULE := init.qcom.power.rc
22 | LOCAL_MODULE_TAGS := optional
23 | LOCAL_MODULE_CLASS := ETC
24 | LOCAL_SRC_FILES := etc/init.qcom.power.rc
25 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw
26 | include $(BUILD_PREBUILT)
27 |
28 | include $(CLEAR_VARS)
29 | LOCAL_MODULE := init.qcom.rc
30 | LOCAL_MODULE_TAGS := optional
31 | LOCAL_MODULE_CLASS := ETC
32 | LOCAL_SRC_FILES := etc/init.qcom.rc
33 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw
34 | include $(BUILD_PREBUILT)
35 |
36 | include $(CLEAR_VARS)
37 | LOCAL_MODULE := init.recovery.qcom.rc
38 | LOCAL_MODULE_TAGS := optional
39 | LOCAL_MODULE_CLASS := ETC
40 | LOCAL_SRC_FILES := etc/init.recovery.qcom.rc
41 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)
42 | include $(BUILD_PREBUILT)
43 |
44 | include $(CLEAR_VARS)
45 | LOCAL_MODULE := init.target.rc
46 | LOCAL_MODULE_TAGS := optional
47 | LOCAL_MODULE_CLASS := ETC
48 | LOCAL_SRC_FILES := etc/init.target.rc
49 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw
50 | include $(BUILD_PREBUILT)
51 |
52 | include $(CLEAR_VARS)
53 | LOCAL_MODULE := init.qcom.post_boot.sh
54 | LOCAL_MODULE_TAGS := optional
55 | LOCAL_MODULE_CLASS := ETC
56 | LOCAL_SRC_FILES := etc/init.qcom.post_boot.sh
57 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
58 | include $(BUILD_PREBUILT)
59 |
60 | include $(CLEAR_VARS)
61 | LOCAL_MODULE := init.qcom.sh
62 | LOCAL_MODULE_TAGS := optional
63 | LOCAL_MODULE_CLASS := ETC
64 | LOCAL_SRC_FILES := etc/init.qcom.sh
65 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
66 | include $(BUILD_PREBUILT)
67 |
68 | include $(CLEAR_VARS)
69 | LOCAL_MODULE := init.qti.dcvs.sh
70 | LOCAL_MODULE_TAGS := optional
71 | LOCAL_MODULE_CLASS := ETC
72 | LOCAL_SRC_FILES := etc/init.qti.dcvs.sh
73 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
74 | include $(BUILD_PREBUILT)
75 |
76 | include $(CLEAR_VARS)
77 | LOCAL_MODULE := init.raphael_boolx.rc
78 | LOCAL_MODULE_TAGS := optional
79 | LOCAL_MODULE_CLASS := ETC
80 | LOCAL_SRC_FILES := etc/init.raphael_boolx.rc
81 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init
82 | include $(BUILD_PREBUILT)
83 |
84 | include $(CLEAR_VARS)
85 | LOCAL_MODULE := init.raphael.rc
86 | LOCAL_MODULE_TAGS := optional
87 | LOCAL_MODULE_CLASS := ETC
88 | LOCAL_SRC_FILES := etc/init.raphael.rc
89 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init
90 | include $(BUILD_PREBUILT)
91 |
92 | include $(CLEAR_VARS)
93 | LOCAL_MODULE := init.raphael.wlan.rc
94 | LOCAL_MODULE_TAGS := optional
95 | LOCAL_MODULE_CLASS := ETC
96 | LOCAL_SRC_FILES := etc/init.raphael.wlan.rc
97 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init
98 | include $(BUILD_PREBUILT)
99 |
100 | include $(CLEAR_VARS)
101 | LOCAL_MODULE := ueventd.qcom.rc
102 | LOCAL_MODULE_STEM := ueventd.rc
103 | LOCAL_MODULE_TAGS := optional
104 | LOCAL_MODULE_CLASS := ETC
105 | LOCAL_SRC_FILES := etc/ueventd.qcom.rc
106 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)
107 | include $(BUILD_PREBUILT)
108 |
--------------------------------------------------------------------------------
/rootdir/etc/Android.bp:
--------------------------------------------------------------------------------
1 | prebuilt_etc {
2 | name: "init.qcom.usb.rc",
3 | src: "init.qcom.usb.rc",
4 | vendor: true,
5 | relative_install_path: "init/hw",
6 | }
7 |
8 | sh_binary {
9 | name: "init.qcom.usb.sh",
10 | src: "init.qcom.usb.sh",
11 | vendor: true,
12 | }
13 |
--------------------------------------------------------------------------------
/rootdir/etc/init.qcom.sh:
--------------------------------------------------------------------------------
1 | #! /vendor/bin/sh
2 |
3 | # Copyright (c) 2009-2016, The Linux Foundation. All rights reserved.
4 | #
5 | # Redistribution and use in source and binary forms, with or without
6 | # modification, are permitted provided that the following conditions are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of The Linux Foundation nor
13 | # the names of its contributors may be used to endorse or promote
14 | # products derived from this software without specific prior written
15 | # permission.
16 | #
17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | #
29 |
30 | target=`getprop ro.board.platform`
31 |
32 | start_msm_irqbalance_msmnile()
33 | {
34 | if [ -f /vendor/bin/msm_irqbalance ]; then
35 | start vendor.msm_irqbalance
36 | fi
37 | }
38 |
39 | case "$target" in
40 | "msmnile")
41 | start_msm_irqbalance_msmnile
42 | ;;
43 | esac
44 |
45 | #
46 | # Make modem config folder and copy firmware config to that folder for RIL
47 | #
48 | if [ -f /data/vendor/modem_config/ver_info.txt ]; then
49 | prev_version_info=`cat /data/vendor/modem_config/ver_info.txt`
50 | else
51 | prev_version_info=""
52 | fi
53 |
54 | cur_version_info=`cat /vendor/firmware_mnt/verinfo/ver_info.txt`
55 | if [ ! -f /vendor/firmware_mnt/verinfo/ver_info.txt -o "$prev_version_info" != "$cur_version_info" ]; then
56 | # add W for group recursively before delete
57 | chmod g+w -R /data/vendor/modem_config/*
58 | rm -rf /data/vendor/modem_config/*
59 | # preserve the read only mode for all subdir and files
60 | cp --preserve=m -dr /vendor/firmware_mnt/image/modem_pr/mcfg/configs/* /data/vendor/modem_config
61 | cp --preserve=m -d /vendor/firmware_mnt/verinfo/ver_info.txt /data/vendor/modem_config/
62 | cp --preserve=m -d /vendor/firmware_mnt/image/modem_pr/mbn_ota.txt /data/vendor/modem_config/
63 | # the group must be root, otherwise this script could not add "W" for group recursively
64 | chown -hR radio.root /data/vendor/modem_config/*
65 | fi
66 | chmod g-w /data/vendor/modem_config
67 | setprop ro.vendor.ril.mbn_copy_completed 1
68 |
--------------------------------------------------------------------------------
/rootdir/etc/init.qti.dcvs.sh:
--------------------------------------------------------------------------------
1 | #! /vendor/bin/sh
2 | #
3 | # Copyright (c) 2020, The Linux Foundation. All rights reserved.
4 | #
5 | # Redistribution and use in source and binary forms, with or without
6 | # modification, are permitted provided that the following conditions are
7 | # met:
8 | # * Redistributions of source code must retain the above copyright
9 | # notice, this list of conditions and the following disclaimer.
10 | # * Redistributions in binary form must reproduce the above
11 | # copyright notice, this list of conditions and the following
12 | # disclaimer in the documentation and/or other materials provided
13 | # with the distribution.
14 | # * Neither the name of The Linux Foundation nor the names of its
15 | # contributors may be used to endorse or promote products derived
16 | # from this software without specific prior written permission.
17 | #
18 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
19 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
22 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
25 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
27 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
28 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 | #
30 | for device in /sys/devices/platform/soc
31 | do
32 | #Enable mem_latency governor for L3, LLCC, and DDR scaling
33 | for memlat in $device/*cpu*-lat/devfreq/*cpu*-lat
34 | do
35 | echo "mem_latency" > $memlat/governor
36 | echo 10 > $memlat/polling_interval
37 | echo 400 > $memlat/mem_latency/ratio_ceil
38 | done
39 |
40 | #Enable userspace governor for L3 cdsp nodes
41 | for l3cdsp in $device/*cdsp-cdsp-l3-lat/devfreq/*cdsp-cdsp-l3-lat
42 | do
43 | echo "cdspl3" > $l3cdsp/governor
44 | done
45 |
46 | #Enable compute governor for gold latfloor
47 | for latfloor in $device/*cpu-ddr-latfloor*/devfreq/*cpu-ddr-latfloor*
48 | do
49 | echo "compute" > $latfloor/governor
50 | echo 10 > $latfloor/polling_interval
51 | done
52 |
53 | #Gold L3 ratio ceil
54 | for l3gold in $device/*cpu4-cpu-l3-lat/devfreq/*cpu4-cpu-l3-lat
55 | do
56 | echo 4000 > $l3gold/mem_latency/ratio_ceil
57 | done
58 |
59 | #Prime L3 ratio ceil
60 | for l3prime in $device/*cpu7-cpu-l3-lat/devfreq/*cpu7-cpu-l3-lat
61 | do
62 | echo 20000 > $l3prime/mem_latency/ratio_ceil
63 | done
64 | done;
65 |
--------------------------------------------------------------------------------
/rootdir/etc/init.raphael.rc:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2016, 2018, The Linux Foundation. All rights reserved.
2 | #
3 | # Redistribution and use in source and binary forms, with or without
4 | # modification, are permitted provided that the following conditions are met:
5 | # * Redistributions of source code must retain the above copyright
6 | # notice, this list of conditions and the following disclaimer.
7 | # * Redistributions in binary form must reproduce the above copyright
8 | # notice, this list of conditions and the following disclaimer in the
9 | # documentation and/or other materials provided with the distribution.
10 | # * Neither the name of The Linux Foundation nor
11 | # the names of its contributors may be used to endorse or promote
12 | # products derived from this software without specific prior written
13 | # permission.
14 | #
15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | #
27 |
28 | # this will make sure you have /data ready and then you try to create the dir.
29 | on init
30 | chown system camera /dev/drv8846_dev
31 | chown system camera /dev/akm09970
32 | chmod 0660 /dev/drv8846_dev
33 | chmod 0660 /dev/akm09970
34 |
35 | on late-init
36 | # Start services for bootanimation
37 | start surfaceflinger
38 | start themed_bootanimation
39 | start bootanim
40 | start vendor.hwcomposer-2-3
41 | start vendor.configstore-hal
42 | start vendor.qti.hardware.display.allocator
43 |
44 | service vendor.motor /vendor/bin/hw/vendor.xiaomi.hardware.motor@1.0-service
45 | class hal
46 | user system
47 | group system
48 |
49 | # NFC
50 | service vendor.nfc_hal_service /vendor/bin/hw/android.hardware.nfc@1.2-service
51 | override
52 | class hal
53 | user nfc
54 | group nfc
55 | task_profiles ServiceCapacityLow
56 | disabled
57 |
58 | on boot && property:ro.boot.product.hardware.sku=nfc
59 | enable vendor.nfc_hal_service
60 |
--------------------------------------------------------------------------------
/rootdir/etc/init.raphael.wlan.rc:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2020 Paranoid Android
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 | on post-fs
16 | # Disable WiFi Aware feature.
17 | mount none /dev/null /vendor/etc/permissions/android.hardware.wifi.aware.xml bind
18 |
--------------------------------------------------------------------------------
/rootdir/etc/init.raphael_boolx.rc:
--------------------------------------------------------------------------------
1 | # custome tunables
2 |
3 | on post-fs-data
4 | # Disable zram readahead
5 | write /proc/sys/vm/page-cluster 0
6 |
7 | # Migrate tasks again in case kernel threads are created during boot
8 | on property:sys.boot_completed=1
9 | copy_per_line /dev/cpuctl/tasks /dev/cpuctl/system/tasks
10 |
11 | # IRQ Tuning
12 | # IRQ 8: msm_drm
13 | # IRQ 518: kgsl-3d0
14 | write /proc/irq/8/smp_affinity_list 2
15 | write /proc/irq/518/smp_affinity_list 1
16 |
--------------------------------------------------------------------------------
/rootdir/etc/init.recovery.qcom.rc:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
2 | #
3 | # Redistribution and use in source and binary forms, with or without
4 | # modification, are permitted provided that the following conditions are met:
5 | # * Redistributions of source code must retain the above copyright
6 | # notice, this list of conditions and the following disclaimer.
7 | # * Redistributions in binary form must reproduce the above copyright
8 | # notice, this list of conditions and the following disclaimer in the
9 | # documentation and/or other materials provided with the distribution.
10 | # * Neither the name of The Linux Foundation nor
11 | # the names of its contributors may be used to endorse or promote
12 | # products derived from this software without specific prior written
13 | # permission.
14 | #
15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | #
27 |
28 | on init
29 | # Mount binderfs
30 | mkdir /dev/binderfs
31 | mount binder binder /dev/binderfs stats=global
32 | chmod 0755 /dev/binderfs
33 |
34 | symlink /dev/binderfs/binder /dev/binder
35 | symlink /dev/binderfs/hwbinder /dev/hwbinder
36 | symlink /dev/binderfs/vndbinder /dev/vndbinder
37 |
38 | chmod 0666 /dev/binderfs/hwbinder
39 | chmod 0666 /dev/binderfs/binder
40 | chmod 0666 /dev/binderfs/vndbinder
41 |
42 | write /sys/class/backlight/panel0-backlight/brightness 200
43 |
44 | setprop sys.usb.configfs 1
45 |
46 | on property:ro.boot.usbconfigfs=false
47 | setprop sys.usb.configfs 0
48 |
49 | on property:ro.boot.usbcontroller=*
50 | setprop sys.usb.controller ${ro.boot.usbcontroller}
51 | write /sys/class/udc/${ro.boot.usbcontroller}/device/../mode peripheral
52 |
53 | on fs
54 | wait /dev/block/platform/soc/${ro.boot.bootdevice}
55 | symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
56 |
--------------------------------------------------------------------------------
/rro_overlays/ApertureOverlay/Android.bp:
--------------------------------------------------------------------------------
1 | runtime_resource_overlay {
2 | name: "ApertureOverlay",
3 | theme: "ApertureOverlay",
4 | product_specific: true,
5 | }
6 |
--------------------------------------------------------------------------------
/rro_overlays/ApertureOverlay/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/rro_overlays/ApertureOverlay/app/src/main/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 | true
9 |
10 |
11 |
12 | - 2
13 | - 4
14 | - 5
15 | - 6
16 | - 7
17 | - 8
18 | - 9
19 | - 10
20 |
21 |
22 |
43 |
44 |
45 | - 0
- sd|hd|fhd|uhd
- 60
46 | - 2
- sd|hd|fhd
- 60
47 |
48 |
49 |
--------------------------------------------------------------------------------
/rro_overlays/DialerResXiaomi/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2024 The LineageOS Project
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 | //
6 |
7 | runtime_resource_overlay {
8 | name: "DialerResXiaomi",
9 | vendor: true,
10 | }
11 |
--------------------------------------------------------------------------------
/rro_overlays/DialerResXiaomi/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/rro_overlays/DialerResXiaomi/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | true
8 |
9 |
11 | 4
12 |
13 |
--------------------------------------------------------------------------------
/rro_overlays/FrameworksResRaphael/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2021 The LineageOS Project
3 | // SPDX-License-Identifier: Apache-2.0
4 | //
5 |
6 | runtime_resource_overlay {
7 | name: "FrameworksResRaphael",
8 | theme: "FrameworksResRaphael",
9 | product_specific: true,
10 | }
11 |
--------------------------------------------------------------------------------
/rro_overlays/FrameworksResRaphael/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
8 |
9 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/rro_overlays/FrameworksResRaphael/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 | 28dp
20 | 80.0px
21 | 28dp
22 |
23 |
24 | 60.0px
25 |
26 |
--------------------------------------------------------------------------------
/rro_overlays/LineageSDKOverlay/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2022 The LineageOS Project
3 | // SPDX-License-Identifier: Apache-2.0
4 | //
5 |
6 | runtime_resource_overlay {
7 | name: "LineageSDKOverlay",
8 | theme: "LineageSDKOverlay",
9 | product_specific: true,
10 | }
--------------------------------------------------------------------------------
/rro_overlays/LineageSDKOverlay/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
8 |
9 |
10 |
14 |
--------------------------------------------------------------------------------
/rro_overlays/NfcResOverlayRaphael/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2024 The LineageOS Project
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 | //
6 |
7 | runtime_resource_overlay {
8 | name: "NfcResOverlayRaphael",
9 | product_specific: true,
10 | }
11 |
--------------------------------------------------------------------------------
/rro_overlays/NfcResOverlayRaphael/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/rro_overlays/NfcResOverlayRaphael/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 | - nfc
11 |
12 |
13 | true
14 |
15 |
--------------------------------------------------------------------------------
/rro_overlays/SettingsLibRaphael/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2021 The LineageOS Project
3 | // SPDX-License-Identifier: Apache-2.0
4 | //
5 |
6 | runtime_resource_overlay {
7 | name: "SettingsLibRaphael",
8 | theme: "SettingsLibRaphael",
9 | product_specific: true,
10 | }
11 |
--------------------------------------------------------------------------------
/rro_overlays/SettingsLibRaphael/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
8 |
9 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/rro_overlays/SettingsLibRaphael/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 | 10800000
21 |
--------------------------------------------------------------------------------
/rro_overlays/SettingsProviderOverlayRaphael/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2021 The LineageOS Project
3 | // SPDX-License-Identifier: Apache-2.0
4 | //
5 |
6 | runtime_resource_overlay {
7 | name: "SettingsProviderOverlayRaphael",
8 | theme: "SettingsProviderOverlayRaphael",
9 | product_specific: true,
10 | }
11 |
--------------------------------------------------------------------------------
/rro_overlays/SettingsProviderOverlayRaphael/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
7 |
8 |
--------------------------------------------------------------------------------
/rro_overlays/SettingsProviderOverlayRaphael/res/values/defaults.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 |
22 | false
23 |
24 |
25 | 30000
26 |
27 |
28 |
--------------------------------------------------------------------------------
/rro_overlays/SettingsResRaphael/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2021 The LineageOS Project
3 | // SPDX-License-Identifier: Apache-2.0
4 | //
5 |
6 | runtime_resource_overlay {
7 | name: "SettingsResRaphael",
8 | theme: "SettingsResRaphael",
9 | product_specific: true,
10 | }
11 |
--------------------------------------------------------------------------------
/rro_overlays/SettingsResRaphael/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
8 |
9 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/rro_overlays/SettingsResRaphael/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
23 |
24 | - 0
25 | - -1
26 | - -1
27 |
28 |
29 |
--------------------------------------------------------------------------------
/rro_overlays/SettingsResRaphael/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
16 | true
17 |
18 |
32 | 3
33 |
34 |
35 | 100
36 |
37 |
38 | true
39 |
40 |
--------------------------------------------------------------------------------
/rro_overlays/SettingsResRaphael/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 | - 78%
16 |
17 |
--------------------------------------------------------------------------------
/rro_overlays/SystemUIResRaphael/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2021 The LineageOS Project
3 | // SPDX-License-Identifier: Apache-2.0
4 | //
5 |
6 | runtime_resource_overlay {
7 | name: "SystemUIResRaphael",
8 | theme: "SystemUIResRaphael",
9 | product_specific: true,
10 | }
11 |
--------------------------------------------------------------------------------
/rro_overlays/SystemUIResRaphael/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
8 |
9 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/rro_overlays/SystemUIResRaphael/res/drawable-nodpi/udfps_icon_pressed.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/crdroidandroid/android_device_xiaomi_raphael/fdd6de318c4218fefb1f41935ecf1269767abd08/rro_overlays/SystemUIResRaphael/res/drawable-nodpi/udfps_icon_pressed.webp
--------------------------------------------------------------------------------
/rro_overlays/SystemUIResRaphael/res/drawable/rounded.xml:
--------------------------------------------------------------------------------
1 |
14 |
19 |
20 |
23 |
24 |
--------------------------------------------------------------------------------
/rro_overlays/SystemUIResRaphael/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 | 12.0px
20 |
21 |
22 | 80.0px
23 |
24 |
25 | 30.0px
26 |
27 |
28 | 25.0px
29 |
30 |
31 | 50.0px
32 |
33 |
34 | 55.0px
35 |
36 | 50.0px
37 |
38 |
39 | 13.5dp
40 |
41 |
42 | 35dp
43 |
44 |
45 | 2.5dp
46 | 1.2dp
47 |
48 |
49 | 133dp
50 |
51 |
52 | - 63.1
53 |
54 |
--------------------------------------------------------------------------------
/rro_overlays/TelephonyResCommon/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2021 The LineageOS Project
3 | // SPDX-License-Identifier: Apache-2.0
4 | //
5 |
6 | runtime_resource_overlay {
7 | name: "TelephonyResCommon",
8 | theme: "TelephonyResCommon",
9 | product_specific: true,
10 | }
11 |
--------------------------------------------------------------------------------
/rro_overlays/TelephonyResCommon/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
8 |
9 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/rro_overlays/TelephonyResCommon/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
21 |
22 |
24 | 1
25 |
26 |
27 | true
28 |
29 |
30 | true
31 |
32 |
35 | true
36 |
37 |
41 | true
42 |
43 |
44 | true
45 |
46 |
47 | com.google.android.gms
48 |
49 |
50 | org.codeaurora.ims
51 |
52 |
53 | vendor.qti.imsrcs
54 |
55 |
56 | false
57 |
58 |
--------------------------------------------------------------------------------
/rro_overlays/TelephonyResCommon/res/xml/telephony_injection.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
23 |
25 |
26 |
29 |
30 |
31 | com.android.internal.telephony.ServiceStateTracker
32 | com.android.internal.telephony.SubscriptionController
33 | com.android.internal.telephony.SubscriptionInfoUpdater
34 | com.android.internal.telephony.GsmCdmaPhone
35 | com.android.internal.telephony.PhoneSwitcher
36 | com.android.internal.telephony.IccPhoneBookInterfaceManager
37 | com.android.internal.telephony.dataconnection.DcTracker
38 | com.android.internal.telephony.RIL
39 | com.android.internal.telephony.TelephonyComponentFactory
40 | com.android.internal.telephony.MultiSimSettingController
41 |
42 |
43 |
--------------------------------------------------------------------------------
/rro_overlays/TetheringConfigOverlay/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 |
17 | runtime_resource_overlay {
18 | name: "TetheringConfigOverlay",
19 | theme: "TetheringConfigOverlay",
20 | sdk_version: "current",
21 | product_specific: true,
22 | }
23 |
--------------------------------------------------------------------------------
/rro_overlays/TetheringConfigOverlay/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
11 |
12 |
--------------------------------------------------------------------------------
/rro_overlays/TetheringConfigOverlay/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 |
24 |
25 | - "usb\\d"
26 | - "rndis\\d"
27 |
28 |
29 |
32 |
33 | - "softap0"
34 | - "wlan\\d"
35 |
36 |
37 |
40 |
41 | - "bnep\\d"
42 | - "bt-pan"
43 |
44 |
45 |
46 |
54 |
55 | - 192.168.42.2
56 | - 192.168.42.254
57 | - 192.168.43.2
58 | - 192.168.43.254
59 | - 192.168.44.2
60 | - 192.168.44.254
61 | - 192.168.45.2
62 | - 192.168.45.254
63 | - 192.168.46.2
64 | - 192.168.46.254
65 | - 192.168.47.2
66 | - 192.168.47.254
67 | - 192.168.48.2
68 | - 192.168.48.254
69 | - 192.168.49.2
70 |
71 |
72 |
--------------------------------------------------------------------------------
/rro_overlays/WifiOverlay/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2021 The LineageOS Project
3 | // SPDX-License-Identifier: Apache-2.0
4 | //
5 |
6 | runtime_resource_overlay {
7 | name: "WifiOverlay",
8 | theme: "WifiOverlay",
9 | sdk_version: "current",
10 | product_specific: true,
11 | }
12 |
--------------------------------------------------------------------------------
/rro_overlays/WifiOverlay/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
21 |
22 |
27 |
28 |
--------------------------------------------------------------------------------
/seccomp/codec2.vendor.base.policy:
--------------------------------------------------------------------------------
1 | ###################################################################################################
2 | # Copyright (c) 2020 Qualcomm Technologies, Inc.
3 | # All Rights Reserved.
4 | # Confidential and Proprietary - Qualcomm Technologies, Inc.
5 | ###################################################################################################
6 | #
7 | # Not a Contribution.
8 | #
9 |
10 | # Copyright (C) 2019 The Android Open Source Project
11 | #
12 | # Licensed under the Apache License, Version 2.0 (the "License");
13 | # you may not use this file except in compliance with the License.
14 | # You may obtain a copy of the License at
15 | #
16 | # http://www.apache.org/licenses/LICENSE-2.0
17 | #
18 | # Unless required by applicable law or agreed to in writing, software
19 | # distributed under the License is distributed on an "AS IS" BASIS,
20 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 | # See the License for the specific language governing permissions and
22 | # limitations under the License.
23 |
24 | futex: 1
25 | # ioctl calls are filtered via the selinux policy.
26 | ioctl: 1
27 | sched_yield: 1
28 | close: 1
29 | dup: 1
30 | ppoll: 1
31 | mprotect: arg2 in ~PROT_EXEC || arg2 in ~PROT_WRITE
32 | mmap2: arg2 in ~PROT_EXEC || arg2 in ~PROT_WRITE
33 | memfd_create: 1
34 | ftruncate: 1
35 | ftruncate64: 1
36 |
37 | mremap: arg3 == 3
38 | munmap: 1
39 | prctl: 1
40 | getuid32: 1
41 | writev: 1
42 | sigaltstack: 1
43 | clone: 1
44 | exit: 1
45 | lseek: 1
46 | rt_sigprocmask: 1
47 | openat: 1
48 | open: 1
49 | fstat64: 1
50 | write: 1
51 | nanosleep: 1
52 | setpriority: 1
53 | set_tid_address: 1
54 | getdents64: 1
55 | readlinkat: 1
56 | readlink: 1
57 | read: 1
58 | pread64: 1
59 | fstatfs64: 1
60 | gettimeofday: 1
61 | faccessat: 1
62 | _llseek: 1
63 | fstatat64: 1
64 | ugetrlimit: 1
65 | exit_group: 1
66 | restart_syscall: 1
67 | rt_sigreturn: 1
68 | getrandom: 1
69 | madvise: 1
70 |
71 | # crash dump policy additions
72 | sigreturn: 1
73 | clock_gettime: 1
74 | futex: 1
75 | getpid: 1
76 | gettid: 1
77 | pipe2: 1
78 | recvmsg: 1
79 | process_vm_readv: 1
80 | tgkill: 1
81 | rt_sigaction: 1
82 | rt_tgsigqueueinfo: 1
83 | #prctl: arg0 == PR_GET_NO_NEW_PRIVS || arg0 == 0x53564d41
84 | #mprotect: arg2 in 0x1|0x2
85 | #mmap2: arg2 in 0x1|0x2
86 | geteuid32: 1
87 | getgid32: 1
88 | getegid32: 1
89 | getgroups32: 1
90 |
--------------------------------------------------------------------------------
/seccomp/codec2.vendor.ext.policy:
--------------------------------------------------------------------------------
1 | # device specific syscalls
2 | pselect6: 1
3 | eventfd2: 1
4 | sendto: 1
5 | recvfrom: 1
6 | _llseek: 1
7 | sysinfo: 1
8 | getcwd: 1
9 | getdents64: 1
10 |
--------------------------------------------------------------------------------
/seccomp/mediacodec.policy:
--------------------------------------------------------------------------------
1 | # device specific syscalls
2 | # extension of services/mediacodec/minijail/seccomp_policy/mediacodec-seccomp-arm.policy
3 | pselect6: 1
4 | eventfd2: 1
5 | sendto: 1
6 | recvfrom: 1
7 | _llseek: 1
8 | sysinfo: 1
9 | getcwd: 1
10 | getdents64: 1
11 | ARM_cacheflush: 1
12 | inotify_init1: 1
13 | inotify_add_watch: 1
14 | inotify_rm_watch: 1
15 | uname: 1
16 | ueventd: 1
17 | timer_create: 1
18 | timer_settime: 1
19 | rt_sigtimedwait: 1
20 |
--------------------------------------------------------------------------------
/sensors/.clang-format:
--------------------------------------------------------------------------------
1 | ../../../build/soong/scripts/system-clang-format
--------------------------------------------------------------------------------
/sensors/double_tap/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2022 The LineageOS Project
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 | //
6 |
7 | cc_library_shared {
8 | name: "sensors.raphael_double_tap",
9 | defaults: ["hidl_defaults"],
10 | srcs: [
11 | "double_tap_hal.cpp",
12 | ],
13 | shared_libs: [
14 | "libcutils",
15 | "liblog",
16 | "libutils",
17 | ],
18 | header_libs: [
19 | "libhardware_headers",
20 | ],
21 | vendor: true,
22 | }
23 |
--------------------------------------------------------------------------------
/sensors/single_tap/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2022 The LineageOS Project
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 | //
6 | cc_library_shared {
7 | name: "sensors.raphael_single_tap",
8 | defaults: ["hidl_defaults"],
9 | srcs: [
10 | "single_tap_hal.cpp",
11 | ],
12 | shared_libs: [
13 | "libcutils",
14 | "liblog",
15 | "libutils",
16 | ],
17 | header_libs: [
18 | "libhardware_headers",
19 | ],
20 | vendor: true,
21 | }
22 |
--------------------------------------------------------------------------------
/sensors/udfps/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2022 The LineageOS Project
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 | //
6 |
7 | cc_library_shared {
8 | name: "sensors.raphael_udfps",
9 | defaults: ["hidl_defaults"],
10 | srcs: [
11 | "udfps_hal.cpp",
12 | ],
13 | shared_libs: [
14 | "libcutils",
15 | "liblog",
16 | "libutils",
17 | ],
18 | header_libs: [
19 | "libhardware_headers",
20 | ],
21 | vendor: true,
22 | }
23 |
--------------------------------------------------------------------------------
/sepolicy/private/app.te:
--------------------------------------------------------------------------------
1 | # Allow appdomain to get vendor_persist_camera_prop
2 | get_prop(appdomain, vendor_persist_camera_prop)
3 | # Lineage Health
4 | hal_client_domain(platform_app, hal_lineage_health)
5 |
--------------------------------------------------------------------------------
/sepolicy/private/cameraserver.te:
--------------------------------------------------------------------------------
1 | allow cameraserver property_socket:sock_file write;
2 | allow cameraserver init:unix_stream_socket connectto;
3 | set_prop(cameraserver, exported_system_prop);
4 |
--------------------------------------------------------------------------------
/sepolicy/private/dontaudit.te:
--------------------------------------------------------------------------------
1 | # b/148033913
2 | dontaudit fsck self:capability kill;
3 |
4 | # b/151195350
5 | dontaudit linkerconfig self:capability kill;
6 |
7 | # b/152468658
8 | dontaudit vdc self:capability kill;
9 |
10 | dontaudit untrusted_app_all hal_memtrack_hwservice:hwservice_manager { find };
11 |
--------------------------------------------------------------------------------
/sepolicy/private/file_contexts:
--------------------------------------------------------------------------------
1 | # Executables
2 | /system/bin/chargeonlymode u:object_r:charger_exec:s0
3 |
--------------------------------------------------------------------------------
/sepolicy/private/isolated_app.te:
--------------------------------------------------------------------------------
1 | allow isolated_app app_data_file:file setattr;
--------------------------------------------------------------------------------
/sepolicy/private/platform_app.te:
--------------------------------------------------------------------------------
1 | # Lineage Health
2 | hal_client_domain(platform_app, hal_lineage_health)
3 |
--------------------------------------------------------------------------------
/sepolicy/private/property_contexts:
--------------------------------------------------------------------------------
1 | # Fastbootd
2 | ro.fastbootd.available u:object_r:exported_default_prop:s0
3 |
4 | # Camera
5 | camera.debug.superlowlight u:object_r:vendor_camera_prop:s0
6 |
7 | # Global
8 | ro.build.flavor u:object_r:build_prop:s0
9 | ro.product.marketname u:object_r:exported_default_prop:s0
10 | ro.product.mod_device u:object_r:exported_default_prop:s0
11 |
12 | # Graphics
13 | ro.gfx.driver.1 u:object_r:graphics_config_prop:s0
14 |
15 | # MIUI
16 | ro.cust.test u:object_r:exported_system_prop:s0
17 | ro.miui. u:object_r:exported_system_prop:s0
18 | vendor.sys.camerainfo u:object_r:exported_system_prop:s0
19 |
20 | # IMEI
21 | persist.radio.imei u:object_r:deviceid_prop:s0
22 | persist.radio.meid u:object_r:deviceid_prop:s0
23 | ro.ril.miui.imei u:object_r:deviceid_prop:s0
24 | ro.ril.oem.imei u:object_r:deviceid_prop:s0
25 | ro.ril.oem.meid u:object_r:deviceid_prop:s0
26 |
--------------------------------------------------------------------------------
/sepolicy/private/system_suspend.te:
--------------------------------------------------------------------------------
1 | # allow system_suspend to read sysfs directory
2 | allow system_suspend sysfs:dir r_dir_perms;
3 |
4 | # To resolve arbitrary sysfs paths from /sys/class/wakeup/* symlinks.
5 | allow system_suspend sysfs_type:dir r_dir_perms;
6 | allow system_suspend sysfs:dir { open read };
7 | allow system_suspend sysfs_rtc:dir { open read };
8 | allow system_suspend sysfs_rtc:dir r_dir_perms;
9 | allow system_suspend sysfs_rtc:file rw_file_perms;
10 | dontaudit system_suspend sysfs:file { open read getattr };
11 |
--------------------------------------------------------------------------------
/sepolicy/public/domain.te:
--------------------------------------------------------------------------------
1 | # Allow apps to get aux camera prop
2 | get_prop(domain, vendor_persist_camera_prop)
3 |
--------------------------------------------------------------------------------
/sepolicy/public/property.te:
--------------------------------------------------------------------------------
1 | # IMEI
2 | type deviceid_prop, property_type, vendor_property_type;
3 |
--------------------------------------------------------------------------------
/sepolicy/sepolicy.mk:
--------------------------------------------------------------------------------
1 | SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += \
2 | device/xiaomi/raphael/sepolicy/public
3 |
4 | SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += \
5 | device/xiaomi/raphael/sepolicy/private
6 |
7 | BOARD_VENDOR_SEPOLICY_DIRS += \
8 | device/xiaomi/raphael/sepolicy/vendor
9 |
--------------------------------------------------------------------------------
/sepolicy/vendor/adsprpcd.te:
--------------------------------------------------------------------------------
1 | r_dir_file(vendor_adsprpcd, public_adsprpcd_file)
2 | r_dir_file(vendor_adsprpcd, vendor_sysfs_graphics)
3 |
--------------------------------------------------------------------------------
/sepolicy/vendor/app.te:
--------------------------------------------------------------------------------
1 | # Allow appdomain to get vendor_camera_prop
2 | get_prop(appdomain, vendor_camera_prop)
3 |
4 | allow { appdomain -isolated_app_all } adsprpcd_file:dir r_dir_perms;
5 | allow { appdomain -isolated_app_all } public_adsprpcd_file:file r_file_perms;
6 | allow { appdomain -isolated_app_all } vendor_xdsp_device:chr_file r_file_perms;
7 |
8 | # Mlipay
9 | get_prop({ appdomain -isolated_app_all }, vendor_payment_security_prop)
10 | get_prop({ appdomain -isolated_app_all }, vendor_fp_prop)
11 |
--------------------------------------------------------------------------------
/sepolicy/vendor/appdomain.te:
--------------------------------------------------------------------------------
1 | get_prop(appdomain, vendor_camera_prop)
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/attributes:
--------------------------------------------------------------------------------
1 | # Dolby
2 | attribute hal_dms;
3 | attribute hal_dms_client;
4 | attribute hal_dms_server;
5 |
6 | # Mlipay
7 | attribute hal_mlipay;
8 | attribute hal_mlipay_server;
9 | attribute hal_mlipay_client;
10 |
11 | # Motor
12 | attribute hal_motor;
13 | attribute hal_motor_client;
14 | attribute hal_motor_server;
15 |
--------------------------------------------------------------------------------
/sepolicy/vendor/batterysecret.te:
--------------------------------------------------------------------------------
1 | type batterysecret, domain;
2 | type batterysecret_exec, exec_type, vendor_file_type, file_type;
3 | init_daemon_domain(batterysecret)
4 |
5 | r_dir_file(batterysecret, cgroup)
6 | r_dir_file(batterysecret, mnt_vendor_file)
7 | r_dir_file(batterysecret, vendor_sysfs_battery_supply)
8 | r_dir_file(batterysecret, sysfs_batteryinfo)
9 | r_dir_file(batterysecret, sysfs_type)
10 | r_dir_file(batterysecret, vendor_sysfs_usb_supply)
11 | r_dir_file(batterysecret, vendor_sysfs_usbpd_device)
12 |
13 | allow batterysecret {
14 | mnt_vendor_file
15 | persist_subsys_file
16 | rootfs
17 | }:dir rw_dir_perms;
18 |
19 | allow batterysecret {
20 | persist_subsys_file
21 | sysfs
22 | vendor_sysfs_battery_supply
23 | sysfs_usb
24 | vendor_sysfs_usb_supply
25 | vendor_sysfs_usbpd_device
26 | }:file w_file_perms;
27 |
28 | allow batterysecret kmsg_device:chr_file rw_file_perms;
29 |
30 | allow batterysecret self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl;
31 |
32 | allow batterysecret self:global_capability_class_set {
33 | sys_tty_config
34 | sys_boot
35 | };
36 |
37 | allow batterysecret self:capability {
38 | chown
39 | fsetid
40 | };
41 |
42 | allow batterysecret {
43 | system_suspend_hwservice
44 | hidl_manager_hwservice
45 | }:hwservice_manager find;
46 |
47 | binder_call(batterysecret, system_suspend_server)
48 |
49 | wakelock_use(batterysecret)
50 | allow init sysfs_battery_supply:file { setattr };
51 |
--------------------------------------------------------------------------------
/sepolicy/vendor/cdsprpcd.te:
--------------------------------------------------------------------------------
1 | r_dir_file(vendor_cdsprpcd, public_adsprpcd_file)
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/cnd.te:
--------------------------------------------------------------------------------
1 | allow vendor_cnd wifi_hal_prop:file read;
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/crash_dump.te:
--------------------------------------------------------------------------------
1 | allow crash_dump app_data_file:file { getattr map };
2 | allow crash_dump resourcecache_data_file:file { getattr map open read };
3 |
--------------------------------------------------------------------------------
/sepolicy/vendor/device.te:
--------------------------------------------------------------------------------
1 | # audio
2 | type audio_socket, file_type;
3 |
4 | # Block device
5 | typeattribute system_block_device super_block_device_type;
6 |
7 | # Fingerprint
8 | type fingerprint_device, dev_type;
9 |
10 | # Motor
11 | type motor_device, dev_type;
12 | type hall_device, dev_type;
13 |
--------------------------------------------------------------------------------
/sepolicy/vendor/file.te:
--------------------------------------------------------------------------------
1 | # Adsprpcd
2 | type public_adsprpcd_file, file_type;
3 |
4 | # Camera Persist
5 | type camera_persist_file, file_type, vendor_persist_type;
6 |
7 | # Fingerprint
8 | type vendor_fingerprint_data_file, data_file_type, file_type, vendor_persist_type;
9 | type vendor_sysfs_fod, sysfs_type, fs_type;
10 |
11 | # KProfiles
12 | type sysfs_kprofiles, sysfs_type, fs_type;
13 |
14 | # Lineage powerhal
15 | type sysfs_msm_subsys, fs_type, sysfs_type;
16 | type sysfs_touchpanel, fs_type, sysfs_type;
17 |
18 | # Last_kmsg
19 | type proc_last_kmsg, fs_type, proc_type;
20 |
21 | # Livedisplay
22 | type vendor_sysfs_hbm, sysfs_type, fs_type;
23 |
24 | # Persist subsystem
25 | type persist_subsys_file, vendor_persist_type, file_type;
26 |
27 | # Thermal
28 | type vendor_thermal_data_file, file_type, data_file_type;
29 |
--------------------------------------------------------------------------------
/sepolicy/vendor/genfs_contexts:
--------------------------------------------------------------------------------
1 | # Display
2 | genfscon sysfs /devices/platform/soc/ae00000.qcom,mdss_mdp/idle_state u:object_r:vendor_sysfs_graphics:s0
3 | genfscon sysfs /devices/platform/soc/ae00000.qcom,mdss_mdp/drm/card0/sde-crtc-0/early_wakeup u:object_r:vendor_sysfs_graphics:s0
4 | genfscon sysfs /devices/platform/soc/soc:qcom,dsi-display-primary/dc_dim u:object_r:vendor_sysfs_graphics:s0
5 | genfscon sysfs /devices/platform/soc/soc:qcom,dsi-display-primary/hbm u:object_r:vendor_sysfs_graphics:s0
6 |
7 | # KProfiles
8 | genfscon sysfs /module/kprofiles/parameters/auto_kp u:object_r:sysfs_kprofiles:s0
9 | genfscon sysfs /kernel/kprofiles/kp_mode u:object_r:sysfs_kprofiles:s0
10 |
11 | # Last_kmsg
12 | genfscon proc /last_kmsg u:object_r:proc_last_kmsg:s0
13 |
14 | # Sensors
15 | genfscon sysfs /devices/platform/goodix_ts.0/udfps_pressed u:object_r:vendor_sysfs_sensors:s0
16 | genfscon sysfs /devices/platform/goodix_ts.0/udfps_enabled u:object_r:vendor_sysfs_sensors:s0
17 | genfscon sysfs /devices/platform/goodix_ts.0/double_tap_pressed u:object_r:vendor_sysfs_sensors:s0
18 | genfscon sysfs /devices/platform/goodix_ts.0/double_tap_enabled u:object_r:vendor_sysfs_sensors:s0
19 |
20 | # Wakeup source stats
21 | genfscon sysfs /devices/platform/goodix_ts.0/wakeup u:object_r:sysfs_wakeup:s0
22 | genfscon sysfs /devices/platform/soc/890000.i2c/i2c-0/0-0010/890000.i2c:qcom,smb1390@10:qcom,charge_pump/wakeup u:object_r:sysfs_wakeup:s0
23 | genfscon sysfs /devices/platform/soc/a84000.i2c/i2c-2/2-0028/wakeup u:object_r:sysfs_wakeup:s0
24 | genfscon sysfs /devices/platform/soc/171c0000.slim/tavil-slim-pgd/wakeup u:object_r:sysfs_wakeup:s0
25 | genfscon sysfs /devices/platform/vendor/vendor:extcon_usb1/wakeup u:object_r:sysfs_wakeup:s0
26 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_audio_default.te:
--------------------------------------------------------------------------------
1 | # Allow Audio HAL to access calibration files in /mnt/vendor/persist/audio
2 | r_dir_file(hal_audio_default, vendor_persist_audio_file)
3 |
4 | # Audio Socket
5 | allow hal_audio_default init:unix_stream_socket connectto;
6 | allow hal_audio_default audio_socket:sock_file rw_file_perms;
7 |
8 | # Allow hal_audio_default to read audio_device
9 | allow hal_audio_default audio_device:dir r_dir_perms;
10 |
11 | # Allow HAL to set audio properties
12 | set_prop(hal_audio_default, vendor_audio_prop)
13 |
14 | # Dolby
15 | allow hal_audio_default hal_dms_hwservice:hwservice_manager find;
16 | binder_call(hal_audio_default, hal_dms_default)
17 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_bluetooth_default.te:
--------------------------------------------------------------------------------
1 | # Allow hal_bluetooth_default to read BT MAC address
2 | r_dir_file(hal_bluetooth_default, vendor_wifi_vendor_data_file)
3 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_camera.te:
--------------------------------------------------------------------------------
1 | # Allow hal_camera to set vendor camera props
2 | get_prop(hal_camera, vendor_camera_sensor_prop)
3 | set_prop(hal_camera, vendor_camera_sensor_prop)
4 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_camera_default.te:
--------------------------------------------------------------------------------
1 | # Allow hal_camera_default to read and write to camera_persist_file
2 | allow hal_camera_default camera_persist_file:dir rw_dir_perms;
3 | allow hal_camera_default camera_persist_file:{
4 | file
5 | lnk_file
6 | } rw_file_perms;
7 |
8 | # Allow hal_camera_default to read and write to mnt/vendor/persist/camera
9 | allow hal_camera_default mnt_vendor_file:dir rw_dir_perms;
10 | allow hal_camera_default mnt_vendor_file:{
11 | file
12 | lnk_file
13 | } rw_file_perms;
14 |
15 | # For interfacing with PowerHAL
16 | hal_client_domain(hal_camera_default, hal_power)
17 |
18 | hal_client_domain(hal_camera_default, hal_configstore)
19 |
20 | # Allow hal_camera_default to read files in kgsl sysfs
21 | r_dir_file(hal_camera_default, vendor_sysfs_kgsl)
22 |
23 | # Allow hal_camera_default to read vendor camera properties
24 | set_prop(hal_camera_default, vendor_camera_prop)
25 |
26 | # Allow hal_camera_default to read vendor video properties
27 | get_prop(hal_camera_default, vendor_video_prop)
28 | set_prop(hal_camera_default, vendor_video_prop)
29 |
30 | # Get IRemosaicDaemon HIDL
31 | allow hal_camera_default remosaic_daemon_service:service_manager find;
32 |
33 | # Communicate with remosaic daemon via binder IPC
34 | binder_call(hal_camera_default, remosaic_daemon)
35 |
36 | binder_call(hal_camera_default, system_server)
37 |
38 | # Allow hal_camera_default to read fastrpc_shell_3
39 | allow hal_camera_default public_adsprpcd_file:file r_file_perms;
40 | allow hal_camera_default vendor_xdsp_device:chr_file r_file_perms;
41 | allow hal_camera_default system_data_file:dir { search };
42 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_dms.te:
--------------------------------------------------------------------------------
1 | # HwBinder IPC from client to server, and callbacks
2 | binder_call(hal_dms_client, hal_dms_server)
3 | binder_call(hal_dms_server, hal_dms_client)
4 |
5 | add_hwservice(hal_dms_server, hal_dms_hwservice)
6 | allow hal_dms_client hal_dms_hwservice:hwservice_manager find;
7 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_dms_default.te:
--------------------------------------------------------------------------------
1 | type hal_dms_default, domain;
2 | hal_server_domain(hal_dms_default, hal_dms)
3 | type hal_dms_default_exec, exec_type, vendor_file_type, file_type;
4 | init_daemon_domain(hal_dms_default)
5 |
6 | allow hal_dms_default vendor_data_file:file { rw_file_perms create unlink };
7 | allow hal_dms_default vendor_data_file:dir { rw_file_perms add_name remove_name };
8 | allow hal_dms_default mediacodec:binder call;
9 | binder_call(hal_dms_default, hal_audio_default)
10 | binder_call(hal_dms_default, platform_app)
11 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_fingerprint_default.te:
--------------------------------------------------------------------------------
1 | # Allow fingerprint HAL to create files in /data/vendor/fingerprint/
2 | allow hal_fingerprint_default vendor_fingerprint_data_file:dir rw_dir_perms;
3 | allow hal_fingerprint_default vendor_fingerprint_data_file:file create_file_perms;
4 |
5 | allow hal_fingerprint_default fingerprint_device:chr_file { ioctl open read write };
6 | allow hal_fingerprint_default input_device:chr_file { ioctl open read write };
7 | allow hal_fingerprint_default self:netlink_socket { bind create read write };
8 | allow hal_fingerprint_default tee_device:chr_file { ioctl open read write };
9 |
10 | r_dir_file(hal_fingerprint_default, firmware_file)
11 | r_dir_file(hal_fingerprint_default, input_device)
12 |
13 | # Allow hal_lineage_fod_default to access graphics sysfs
14 | r_dir_file(hal_fingerprint_default, vendor_sysfs_graphics)
15 | allow hal_fingerprint_default vendor_sysfs_graphics:dir r_dir_perms;
16 | allow hal_fingerprint_default vendor_sysfs_graphics:file r_file_perms;
17 |
18 | # Allow hal_fingerprint_default to get IDspService interface
19 | hal_client_domain(hal_fingerprint_default, vendor_hal_dspmanager)
20 |
21 | # Allow hal_fingerprint_default to get IPerf interface
22 | hal_client_domain(hal_fingerprint_default, vendor_hal_perf)
23 |
24 | # Allow hal_fingerprint_default to set fingerprint properties
25 | set_prop(hal_fingerprint_default, vendor_fp_prop)
26 | vendor_public_prop(vendor_fp_prop)
27 |
28 | # Allow hal_fingerprint_default to read adsprpc properties
29 | get_prop(hal_fingerprint_default, vendor_adsprpc_prop)
30 |
31 | # Allow hal_fingerprint_default to add hal_xiaomi_fingerprint_hwservice
32 | add_hwservice(hal_fingerprint_default, hal_xiaomi_fingerprint_hwservice)
33 |
34 | # Allow hal_fingerprint_default to read and write to fod sysfs
35 | allow hal_fingerprint_default vendor_sysfs_fod:file rw_file_perms;
36 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_health_default.te:
--------------------------------------------------------------------------------
1 | allow hal_health_default sysfs:file { getattr read open };
2 | r_dir_file(hal_health_default, vendor_sysfs_battery_supply)
3 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_lineage_health.te:
--------------------------------------------------------------------------------
1 | hal_attribute_service(hal_lineage_health, hal_lineage_health_service)
2 | binder_call(hal_lineage_health_server, servicemanager)
3 |
4 | # Allow binder communication with platform_app
5 | binder_call(hal_lineage_health, platform_app)
6 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_lineage_health_default.te:
--------------------------------------------------------------------------------
1 | # Allow LineageHealth HAL to write to battery and usb sysfs node
2 | allow hal_lineage_health_default sysfs_batteryinfo:file rw_file_perms;
3 | allow hal_lineage_health_default vendor_sysfs_battery_supply:dir search;
4 | allow hal_lineage_health_default vendor_sysfs_battery_supply:file rw_file_perms;
5 | allow hal_lineage_health_default vendor_sysfs_usb_supply:dir search;
6 | allow hal_lineage_health_default vendor_sysfs_usb_supply:file rw_file_perms;
7 |
8 | r_dir_file(hal_lineage_health_default, sysfs_batteryinfo)
9 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_lineage_livedisplay_qti.te:
--------------------------------------------------------------------------------
1 | allow hal_lineage_livedisplay_qti vendor_sysfs_hbm:file rw_file_perms;
2 | allow hal_lineage_livedisplay_qti vendor_sysfs_graphics:dir r_dir_perms;
3 | allow hal_lineage_livedisplay_qti vendor_sysfs_graphics:file rw_file_perms;
4 |
--------------------------------------------------------------------------------
/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 | init_daemon_domain(hal_mlipay_default)
6 |
7 | # Allow hwbinder call from hal client to server
8 | binder_call(hal_mlipay_client, hal_mlipay_server)
9 |
10 | # Add hwservice related rules
11 | add_hwservice(hal_mlipay_server, hal_mlipay_hwservice)
12 | allow hal_mlipay_client hal_mlipay_hwservice:hwservice_manager find;
13 |
14 | allow hal_mlipay_default {
15 | ion_device
16 | tee_device
17 | }:chr_file rw_file_perms;
18 |
19 | r_dir_file(hal_mlipay_default, firmware_file)
20 |
21 | set_prop(hal_mlipay_default, vendor_payment_security_prop);
22 | get_prop(hal_mlipay_default, vendor_fp_prop);
23 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_motor_default.te:
--------------------------------------------------------------------------------
1 | type hal_motor_default, domain;
2 | hal_server_domain(hal_motor_default, hal_motor)
3 |
4 | type hal_motor_default_exec, exec_type, vendor_file_type, file_type;
5 | init_daemon_domain(hal_motor_default)
6 |
7 | # HwBinder IPC from client to server
8 | binder_call(hal_motor_client, hal_motor_server)
9 |
10 | # Create HIDL interface for motor HAL
11 | add_hwservice(hal_motor_server, hal_motor_hwservice)
12 | allow hal_motor_client hal_motor_hwservice:hwservice_manager find;
13 |
14 | # Allow hal_motor_default to read and write to { motor_device hall_device }
15 | allow hal_motor_default {
16 | hall_device
17 | motor_device
18 | }:chr_file rw_file_perms;
19 |
20 | # Allow hal_motor_default to create files in mnt/vendor/
21 | allow hal_motor_default mnt_vendor_file:dir rw_dir_perms;
22 | allow hal_motor_default mnt_vendor_file:file create_file_perms;
23 |
24 | # Allow hal_motor_default to create files in /mnt/vendor/persist/sensors/
25 | allow hal_motor_default vendor_persist_sensors_file:dir rw_dir_perms;
26 | allow hal_motor_default vendor_persist_sensors_file:file create_file_perms;
27 |
28 | # Allow hal_motor_default to communicate with xiaomiparts
29 | binder_call(hal_motor_default, xiaomiparts)
30 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_neuralnetworks_default.te:
--------------------------------------------------------------------------------
1 | r_dir_file(vendor_hal_neuralnetworks_default, public_adsprpcd_file)
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_nfc_default.te:
--------------------------------------------------------------------------------
1 | # Allow NFC to read the firmware folder
2 | allow hal_nfc_default vendor_nfc_vendor_data_file:dir {
3 | rw_file_perms
4 | create_dir_perms
5 | };
6 | allow hal_nfc_default vendor_nfc_vendor_data_file:file create_file_perms;
7 | allow hal_nfc_default hal_nfc_hwservice:hwservice_manager find;
8 |
9 | add_hwservice(hal_nfc_default, nxpnfc_hwservice)
10 | add_hwservice(hal_nfc_default, nxpese_hwservice)
11 | add_hwservice(hal_nfc_default, hal_nfc_hwservice)
12 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_perf_default.te:
--------------------------------------------------------------------------------
1 | allow vendor_hal_perf_default hal_audio_default:dir r_dir_perms;
2 | allow vendor_hal_perf_default hal_audio_default:file r_file_perms;
3 | allow vendor_hal_perf_default hal_fingerprint_default:dir r_dir_perms;
4 | allow vendor_hal_perf_default hal_fingerprint_default:file r_file_perms;
5 | allow vendor_hal_perf_default hal_camera_default:dir r_dir_perms;
6 | allow vendor_hal_perf_default hal_camera_default:file r_file_perms;
7 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_power_default.te:
--------------------------------------------------------------------------------
1 | # Allow hal_power_default to write to dt2w nodes
2 | r_dir_file(hal_power_default, input_device)
3 | allow hal_power_default input_device:chr_file rw_file_perms;
4 |
5 | allow hal_power_default sysfs_msm_subsys:dir search;
6 | allow hal_power_default sysfs_msm_subsys:file rw_file_perms;
7 | allow hal_power_default sysfs_touchpanel:dir search;
8 | allow hal_power_default sysfs_touchpanel:file rw_file_perms;
9 | allow hal_power_default vendor_latency_device:chr_file rw_file_perms;
10 | allow hal_power_default proc:file { open };
11 | allow hal_power_default sysfs:file write;
12 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_sensors_default.te:
--------------------------------------------------------------------------------
1 | # For QCOM diag port access
2 | allow hal_sensors_default vendor_diag_device:chr_file rw_file_perms;
3 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_thermal_default.te:
--------------------------------------------------------------------------------
1 | allow hal_thermal_default sysfs_thermal:dir r_dir_perms;
2 | allow hal_thermal_default sysfs_thermal:file rw_file_perms;
3 | allow hal_thermal_default proc_stat:file r_file_perms;
4 |
5 | allow hal_thermal_default self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl;
6 |
7 | # read thermal_config
8 | get_prop(hal_thermal_default, vendor_thermal_prop)
9 |
10 | # Allow init to set attribute to sysfs_kprofiles
11 | allow init sysfs_kprofiles:file { setattr };
12 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_tui_comm_qti.te:
--------------------------------------------------------------------------------
1 | binder_call(vendor_hal_tui_comm_qti, secure_ui_service_app)
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hvdcp.te:
--------------------------------------------------------------------------------
1 | allow vendor_hvdcp kmsg_device:chr_file rw_file_perms;
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hwservice.te:
--------------------------------------------------------------------------------
1 | # Camera - Miui
2 | type hal_camerapostproc_xiaomi_hwservice, hwservice_manager_type;
3 |
4 | # Dolby
5 | type hal_dms_hwservice, hwservice_manager_type;
6 |
7 | # Fingerprint
8 | type hal_xiaomi_fingerprint_hwservice, hwservice_manager_type;
9 |
10 | # Mlipay
11 | type hal_mlipay_hwservice, hwservice_manager_type;
12 |
13 | # Motor
14 | type hal_motor_hwservice, hwservice_manager_type;
15 |
16 | # NFC
17 | type nxpnfc_hwservice, hwservice_manager_type;
18 | type nxpese_hwservice, hwservice_manager_type;
19 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hwservice_contexts:
--------------------------------------------------------------------------------
1 | # Cam postproc
2 | vendor.xiaomi.hardware.campostproc::IMiPostProcService u:object_r:hal_camerapostproc_xiaomi_hwservice:s0
3 |
4 | # Dolby
5 | vendor.dolby.hardware.dms::IDms u:object_r:hal_dms_hwservice:s0
6 |
7 | # Fingerprint
8 | vendor.goodix.hardware.biometrics.fingerprint::IGoodixFingerprintDaemon u:object_r:hal_xiaomi_fingerprint_hwservice:s0
9 | vendor.xiaomi.hardware.fingerprintextension::IXiaomiFingerprint u:object_r:hal_xiaomi_fingerprint_hwservice:s0
10 |
11 | # Mlipay
12 | vendor.xiaomi.hardware.mlipay::IMlipayService u:object_r:hal_mlipay_hwservice:s0
13 |
14 | # Motor
15 | vendor.xiaomi.hardware.motor::IMotor u:object_r:hal_motor_hwservice:s0
16 |
17 | # NFC
18 | vendor.nxp.nxpnfc::INxpNfc u:object_r:nxpnfc_hwservice:s0
19 | vendor.nxp.nxpese::INxpEse u:object_r:nxpese_hwservice:s0
20 |
--------------------------------------------------------------------------------
/sepolicy/vendor/init.te:
--------------------------------------------------------------------------------
1 | # Allow init to read and write to vendor_sysfs_graphics
2 | allow init vendor_sysfs_graphics:dir search;
3 | allow init vendor_sysfs_graphics:file rw_file_perms;
4 |
5 | # Allow init to read and write to sysfs_vibrator
6 | allow init sysfs_vibrator:dir search;
7 | allow init sysfs_vibrator:file rw_file_perms;
8 |
9 | # For mount tracefs tracefs /sys/kernel/tracing
10 | allow init debugfs_tracing_debug:dir mounton;
11 |
12 | allow init adsprpcd_file:file mounton;
13 |
14 | allow vendor_init vendor_camera_prop:property_service set;
15 |
16 | # Last_kmsg
17 | allow init proc_last_kmsg:file { r_file_perms setattr };
18 |
--------------------------------------------------------------------------------
/sepolicy/vendor/kernel.te:
--------------------------------------------------------------------------------
1 | # For diag over socket
2 | userdebug_or_eng(`
3 | allow kernel self:qipcrtr_socket create;
4 | ')
5 | # Ignore the socket if it fails to create
6 | dontaudit kernel self:qipcrtr_socket create;
7 |
--------------------------------------------------------------------------------
/sepolicy/vendor/mediacodec.te:
--------------------------------------------------------------------------------
1 | allow mediacodec hal_dms_hwservice:hwservice_manager find;
2 | binder_call(mediacodec, hal_dms_default)
3 |
4 | allow mediacodec hal_dms_default:binder { call transfer };
5 | allow mediacodec hal_dms_server:binder { call transfer };
6 |
--------------------------------------------------------------------------------
/sepolicy/vendor/mediaserver.te:
--------------------------------------------------------------------------------
1 | allow mediaserver package_native_service:service_manager find;
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/mi_thermald.te:
--------------------------------------------------------------------------------
1 | # Define mi_thermald domain
2 | type mi_thermald, domain;
3 | type mi_thermald_exec, exec_type, vendor_file_type, file_type;
4 | init_daemon_domain(mi_thermald)
5 |
6 | # Allow mi_thermald to create files in /data/vendor/thermal/
7 | allow mi_thermald vendor_thermal_data_file:dir rw_dir_perms;
8 | allow mi_thermald vendor_thermal_data_file:file create_file_perms;
9 |
10 | allow mi_thermald self:capability {
11 | chown
12 | fowner
13 | fsetid
14 | };
15 |
16 | # Allow mi_thermald to access leds sysfs
17 | r_dir_file(mi_thermald, sysfs_leds)
18 | allow mi_thermald sysfs_leds:{
19 | file
20 | lnk_file
21 | } rw_file_perms;
22 |
23 | # Allow mi_thermald to access thermal sysfs
24 | r_dir_file(mi_thermald, sysfs_thermal)
25 | allow mi_thermald sysfs_thermal:file rw_file_perms;
26 |
27 | # Allow mi_thermald to access system cpu sysfs
28 | r_dir_file(mi_thermald, sysfs_devices_system_cpu)
29 | allow mi_thermald sysfs_devices_system_cpu:file rw_file_perms;
30 |
31 | # Allow mi_thermald to access battery supply sysfs
32 | r_dir_file(mi_thermald, vendor_sysfs_battery_supply)
33 | allow mi_thermald vendor_sysfs_battery_supply:{
34 | file
35 | lnk_file
36 | } rw_file_perms;
37 |
38 | # Allow mi_thermald to access graphics sysfs
39 | r_dir_file(mi_thermald, vendor_sysfs_graphics)
40 | allow mi_thermald vendor_sysfs_graphics:{
41 | file
42 | lnk_file
43 | } rw_file_perms;
44 |
45 | # Allow mi_thermald to access kgsl sysfs
46 | r_dir_file(mi_thermald, vendor_sysfs_kgsl)
47 | allow mi_thermald vendor_sysfs_kgsl:{
48 | file
49 | lnk_file
50 | } rw_file_perms;
51 |
52 | # Allow mi_thermald to access sysfs
53 | r_dir_file(mi_thermald, sysfs)
54 | allow mi_thermald sysfs:{
55 | file
56 | lnk_file
57 | } rw_file_perms;
58 |
59 | # Allow mi_thermald to set thermal profile
60 | set_prop(mi_thermald, thermal_normal_prop)
61 |
--------------------------------------------------------------------------------
/sepolicy/vendor/nfc.te:
--------------------------------------------------------------------------------
1 | allow nfc vendor_nfc_vendor_data_file:dir { write search };
2 | allow nfc vendor_nfc_vendor_data_file:file { open read };
3 |
--------------------------------------------------------------------------------
/sepolicy/vendor/platform_app.te:
--------------------------------------------------------------------------------
1 | # Allow MIUI camera app to read no. of cpus
2 | allow platform_app cgroup:file r_file_perms;
3 | allow platform_app app_data_file:file execute;
4 | allow platform_app hal_camerapostproc_xiaomi_hwservice:hwservice_manager find;
5 |
6 | allow platform_app {
7 | DisplayFeatureControl
8 | miui_multi_display
9 | perfshielder
10 | ProcessManager
11 | }:service_manager find;
12 |
13 | # Allow systemui to read vendor_sysfs_graphics
14 | allow platform_app vendor_sysfs_graphics:dir search;
15 | allow platform_app vendor_sysfs_graphics:file r_file_perms;
16 | allow platform_app vendor_display_prop:file { getattr map open read };
17 |
18 | # Allow NFC service to be found
19 | allow platform_app nfc_service:service_manager find;
20 |
21 | allow platform_app rootfs:dir { open read };
22 |
--------------------------------------------------------------------------------
/sepolicy/vendor/priv_app.te:
--------------------------------------------------------------------------------
1 | allow priv_app DisplayFeatureControl:service_manager find;
2 | allow priv_app miui_multi_display:service_manager find;
3 | allow priv_app perfshielder:service_manager find;
4 |
--------------------------------------------------------------------------------
/sepolicy/vendor/property.te:
--------------------------------------------------------------------------------
1 | # Camera
2 | type vendor_camera_sensor_prop, property_type, vendor_property_type;
3 |
4 | # Mlipay
5 | vendor_public_prop(vendor_payment_security_prop)
6 |
7 | # Thermal
8 | type thermal_normal_prop, property_type, vendor_property_type;
9 | type vendor_thermal_prop, property_type, vendor_property_type;
10 |
--------------------------------------------------------------------------------
/sepolicy/vendor/property_contexts:
--------------------------------------------------------------------------------
1 | # Camera
2 | persist.camera. u:object_r:vendor_camera_prop:s0
3 | persist.vendor.camera u:object_r:vendor_camera_prop:s0
4 | persist.vendor.low.cutoff u:object_r:vendor_camera_prop:s0
5 | ro.vendor.audio.us.proximity u:object_r:vendor_camera_prop:s0
6 | ro.vendor.camera. u:object_r:vendor_camera_prop:s0
7 | ro.camera. u:object_r:vendor_camera_prop:s0
8 | vendor.camera. u:object_r:vendor_camera_prop:s0
9 | vendor.camera.aux. u:object_r:vendor_camera_prop:s0
10 | vendor.panel.display u:object_r:vendor_camera_prop:s0
11 |
12 | # Fingerprint
13 | persist.vendor.fingerprint. u:object_r:vendor_fp_prop:s0
14 | persist.vendor.sys.fp. u:object_r:vendor_fp_prop:s0
15 | ro.boot.fpsensor u:object_r:vendor_fp_prop:s0
16 | ro.hardware.fp u:object_r:vendor_fp_prop:s0
17 | vendor.fps_hal. u:object_r:vendor_fp_prop:s0
18 | sys.panel.display u:object_r:vendor_fp_prop:s0
19 |
20 | # Mlipay
21 | persist.vendor.sys.pay.ifaa u:object_r:vendor_payment_security_prop:s0
22 |
23 | # Radio
24 | ro.carrier.name u:object_r:vendor_public_vendor_default_prop:s0
25 |
26 | # Sensors
27 | persist.sensor.sardisable u:object_r:vendor_sensors_prop:s0
28 |
29 | # Thermal
30 | vendor.sys.thermal. u:object_r:thermal_normal_prop:s0
31 |
--------------------------------------------------------------------------------
/sepolicy/vendor/qti_init_shell.te:
--------------------------------------------------------------------------------
1 | get_prop(vendor_qti_init_shell, radio_control_prop)
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/radio.te:
--------------------------------------------------------------------------------
1 | # Allow radio to read vendor audio prop
2 | get_prop(radio, vendor_audio_prop)
3 |
--------------------------------------------------------------------------------
/sepolicy/vendor/remosaic_daemon.te:
--------------------------------------------------------------------------------
1 | # Define domain
2 | type remosaic_daemon, domain;
3 | type remosaic_daemon_exec, exec_type, vendor_file_type, file_type;
4 |
5 | # Allow remosaic_daemon to read ion device
6 | allow remosaic_daemon ion_device:chr_file r_file_perms;
7 |
8 | # Allow remosaic_daemon to create files in data/vendor/camera/
9 | allow remosaic_daemon vendor_camera_data_file:dir rw_dir_perms;
10 | allow remosaic_daemon vendor_camera_data_file:file create_file_perms;
11 |
12 | # Allow for transition from init domain to remosaic_daemon
13 | init_daemon_domain(remosaic_daemon)
14 |
15 | # Allow remosaic_daemon to use vendor Binder IPC
16 | vndbinder_use(remosaic_daemon)
17 |
18 | # Allow remosaic_daemon to be registered with service manager
19 | allow remosaic_daemon remosaic_daemon_service:service_manager add;
20 |
21 | allow remosaic_daemon hal_camera_default:fd use;
22 |
--------------------------------------------------------------------------------
/sepolicy/vendor/rild.te:
--------------------------------------------------------------------------------
1 | set_prop(rild, deviceid_prop)
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/seapp_contexts:
--------------------------------------------------------------------------------
1 | # Secureui
2 | user=_app seinfo=platform name=com.qualcomm.qti.services.secureui* domain=secure_ui_service_app levelFrom=all
3 |
4 | # Xiaomiparts
5 | user=system seinfo=platform name=org.lineageos.settings domain=xiaomiparts type=system_app_data_file
6 |
--------------------------------------------------------------------------------
/sepolicy/vendor/secure_ui_service_app.te:
--------------------------------------------------------------------------------
1 | type secure_ui_service_app, domain;
2 |
3 | app_domain(secure_ui_service_app);
4 |
5 | binder_call(secure_ui_service_app, system_server)
6 | binder_call(secure_ui_service_app, vendor_hal_tui_comm_qti)
7 |
8 | allow secure_ui_service_app app_api_service:service_manager find;
9 |
10 | allow secure_ui_service_app vendor_hal_tui_comm_hwservice:hwservice_manager find;
11 |
--------------------------------------------------------------------------------
/sepolicy/vendor/sensors.te:
--------------------------------------------------------------------------------
1 | # Allow sensors to access backlight sysfs state
2 | r_dir_file(vendor_sensors, vendor_sysfs_graphics)
3 |
--------------------------------------------------------------------------------
/sepolicy/vendor/service.te:
--------------------------------------------------------------------------------
1 | type DisplayFeatureControl, service_manager_type;
2 | type perfshielder, service_manager_type;
3 | type miui_multi_display, service_manager_type;
4 | type ProcessManager, service_manager_type;
5 |
--------------------------------------------------------------------------------
/sepolicy/vendor/service_contexts:
--------------------------------------------------------------------------------
1 | DisplayFeatureControl u:object_r:DisplayFeatureControl:s0
2 | perfshielder u:object_r:perfshielder:s0
3 | miui_multi_display u:object_r:miui_multi_display:s0
4 | ProcessManager u:object_r:ProcessManager:s0
5 |
--------------------------------------------------------------------------------
/sepolicy/vendor/system_app.te:
--------------------------------------------------------------------------------
1 | # Battery Health
2 | r_dir_file(system_app, sysfs_battery_supply);
3 |
4 | # Camera
5 | get_prop(hal_camera, vendor_camera_sensor_prop)
6 |
7 | # Allow KProfiles to be adjusted by a system app
8 | allow system_app sysfs_kprofiles:file rw_file_perms;
9 |
10 | # Motor
11 | allow system_app hal_motor_hwservice:hwservice_manager find;
12 |
13 | allow system_app hal_audio_default:binder call;
14 | allow system_app hal_health_default:binder call;
15 | allow system_app hal_power_default:binder call;
16 | allow system_app hal_vibrator_default:binder call;
17 | allow system_app hal_wifi_default:binder call;
18 | allow system_app rootfs:dir read;
19 | allow system_app sysfs_zram:dir search;
20 | allow system_app sysfs_zram:file r_file_perms;
21 |
--------------------------------------------------------------------------------
/sepolicy/vendor/system_server.te:
--------------------------------------------------------------------------------
1 | # Camera
2 | get_prop(system_server, vendor_camera_prop)
3 |
4 | # Last_kmsg
5 | allow system_server proc_last_kmsg:file r_file_perms;
6 |
7 | # Zygote
8 | allow system_server app_zygote:process { getpgid };
9 | allow system_server zygote_tmpfs:file write;
10 |
--------------------------------------------------------------------------------
/sepolicy/vendor/tee.te:
--------------------------------------------------------------------------------
1 | # Fingerprint data
2 | allow tee vendor_fingerprint_data_file:dir rw_dir_perms;
3 | allow tee vendor_fingerprint_data_file:file create_file_perms;
4 |
5 | get_prop({ appdomain -isolated_app_all }, vendor_tee_listener_prop)
6 |
7 | allow tee unlabeled:dir { add_name open read write };
8 |
--------------------------------------------------------------------------------
/sepolicy/vendor/ueventd.te:
--------------------------------------------------------------------------------
1 | allow ueventd metadata_file:dir search;
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/uncrypt.te:
--------------------------------------------------------------------------------
1 | # OTA with encrypted f2fs
2 | allow uncrypt self:capability sys_admin;
3 |
--------------------------------------------------------------------------------
/sepolicy/vendor/vendor_hal_perf_default.te:
--------------------------------------------------------------------------------
1 | r_dir_file(vendor_hal_perf_default, hal_camera_default);
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/vendor_init.te:
--------------------------------------------------------------------------------
1 | # Camera
2 | set_prop(vendor_init, vendor_camera_prop)
3 |
4 | # Fingerprint
5 | allow vendor_init vendor_fp_prop:property_service set;
6 |
7 | allow vendor_init cgroup:file getattr;
8 | allow vendor_init future_pm_prop:property_service set;
9 | allow vendor_init vendor_cnd_prop:property_service set;
10 | allow vendor_init vendor_ims_prop:property_service set;
11 | allow vendor_init proc_watermark_scale_factor:file write;
12 |
--------------------------------------------------------------------------------
/sepolicy/vendor/vendor_qti_init_shell.te:
--------------------------------------------------------------------------------
1 | allow vendor_qti_init_shell sysfs_wakeup:file setattr;
--------------------------------------------------------------------------------
/sepolicy/vendor/vendor_ssgtzd.te:
--------------------------------------------------------------------------------
1 | allow vendor_ssgtzd vendor_data_file:dir setattr;
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/vndservice.te:
--------------------------------------------------------------------------------
1 | type remosaic_daemon_service, vndservice_manager_type;
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/vndservice_contexts:
--------------------------------------------------------------------------------
1 | android.IRemosaicDaemon u:object_r:remosaic_daemon_service:s0
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/vppservice.te:
--------------------------------------------------------------------------------
1 | r_dir_file(vendor_vppservice, public_adsprpcd_file)
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/wcnss_service.te:
--------------------------------------------------------------------------------
1 | # Allow wcnss service to create wlan_mac.bin
2 | allow vendor_wcnss_service mnt_vendor_file:dir rw_dir_perms;
3 | allow vendor_wcnss_service mnt_vendor_file:file create_file_perms;
4 |
--------------------------------------------------------------------------------
/sepolicy/vendor/xiaomiparts.te:
--------------------------------------------------------------------------------
1 | type xiaomiparts, domain;
2 | typeattribute xiaomiparts mlstrustedsubject;
3 |
4 | app_domain(xiaomiparts)
5 |
6 | # Allow xiaomiparts to find system services
7 | allow xiaomiparts {
8 | app_api_service
9 | audioserver_service
10 | cameraserver_service
11 | drmserver_service
12 | mediaextractor_service
13 | mediametrics_service
14 | mediaserver_service
15 | }:service_manager find;
16 |
17 | # Allow xiaomiparts to access motor hal
18 | hal_client_domain(xiaomiparts, hal_motor)
19 |
20 | # Allow xiaomiparts read and write /data/data subdirectory
21 | allow xiaomiparts system_app_data_file:dir create_dir_perms;
22 | allow xiaomiparts system_app_data_file:{
23 | file
24 | lnk_file
25 | } create_file_perms;
26 | allow xiaomiparts system_data_file:dir search;
27 |
28 | # Allow binder communication with gpuservice/hal_motor
29 | binder_call(xiaomiparts, gpuservice)
30 | binder_call(xiaomiparts, hal_motor)
31 |
32 | # Allow xiaomiparts to read and write to cgroup/vendor_sysfs_graphics/sysfs_leds
33 | r_dir_file(xiaomiparts, sysfs_leds)
34 | r_dir_file(xiaomiparts, vendor_sysfs_graphics)
35 | allow xiaomiparts {
36 | cgroup
37 | sysfs_leds
38 | vendor_sysfs_graphics
39 | sysfs_thermal
40 | }:file rw_file_perms;
41 |
42 | # Allow xiaomiparts to write to mi_thermald
43 | allow xiaomiparts sysfs_thermal:file w_file_perms;
44 |
45 | allow xiaomiparts sysfs_vibrator:dir search;
46 | allow xiaomiparts sysfs_vibrator:file rw_file_perms;
47 |
--------------------------------------------------------------------------------
/sepolicy/vendor/zygote.te:
--------------------------------------------------------------------------------
1 | allow zygote adsprpcd_file:dir { search getattr read };
2 | allow zygote self:capability kill;
3 | r_dir_file(zygote, system_file)
4 | dontaudit zygote proc_cmdline:file r_file_perms;
5 |
--------------------------------------------------------------------------------
/setup-makefiles.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # SPDX-FileCopyrightText: 2016 The CyanogenMod Project
4 | # SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
5 | # SPDX-License-Identifier: Apache-2.0
6 | #
7 |
8 | set -e
9 |
10 | DEVICE=raphael
11 | VENDOR=xiaomi
12 |
13 | # Load extract_utils and do some sanity checks
14 | MY_DIR="${BASH_SOURCE%/*}"
15 | if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
16 |
17 | ANDROID_ROOT="${MY_DIR}/../../.."
18 |
19 | export TARGET_ENABLE_CHECKELF=true
20 |
21 | HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
22 | if [ ! -f "${HELPER}" ]; then
23 | echo "Unable to find helper script at ${HELPER}"
24 | exit 1
25 | fi
26 | source "${HELPER}"
27 |
28 | function vendor_imports() {
29 | cat <>"$1"
30 | "device/xiaomi/raphael",
31 | "hardware/qcom-caf/sm8150",
32 | "hardware/qcom-caf/wlan",
33 | "hardware/qcom/sm8150/display",
34 | "hardware/xiaomi",
35 | "vendor/qcom/opensource/dataservices",
36 | "vendor/qcom/opensource/commonsys-intf/display",
37 | "vendor/qcom/opensource/commonsys/display",
38 | "vendor/qcom/opensource/display",
39 | EOF
40 | }
41 |
42 | function lib_to_package_fixup_vendor_variants() {
43 | if [ "$2" != "vendor" ]; then
44 | return 1
45 | fi
46 |
47 | case "$1" in
48 | com.qualcomm.qti.dpm.api@1.0 | \
49 | libmmosal | \
50 | vendor.qti.hardware.alarm@1.0 | \
51 | vendor.qti.hardware.fm@1.0 | \
52 | vendor.qti.imsrtpservice@3.0)
53 | echo "${1}_vendor"
54 | ;;
55 | libOmxCore | \
56 | libwpa_client) ;;
57 | *)
58 | return 1
59 | ;;
60 | esac
61 | }
62 |
63 | function lib_to_package_fixup() {
64 | lib_to_package_fixup_clang_rt_ubsan_standalone "$1" ||
65 | lib_to_package_fixup_proto_3_9_1 "$1" ||
66 | lib_to_package_fixup_vendor_variants "$@"
67 | }
68 |
69 | # Initialize the helper
70 | setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}"
71 |
72 | # Warning headers and guards
73 | write_headers
74 |
75 | write_makefiles "${MY_DIR}/proprietary-files.txt" true
76 |
77 | # Finish
78 | write_footers
79 |
--------------------------------------------------------------------------------
/sort-proprietary-files.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright (C) 2022 The LineageOS Project
4 | #
5 | # SPDX-License-Identifier: Apache-2.0
6 | #
7 |
8 | if [[ -z "${1}" ]]; then
9 | file="proprietary-files.txt"
10 | else
11 | file=${1}
12 | fi
13 |
14 | if [[ ! -f ${file} ]]; then
15 | echo "${file} is not a file"
16 | exit
17 | fi
18 |
19 | # Create a temporary working directory
20 | TMPDIR=$(mktemp -d)
21 |
22 | # Ignore the line indicating the source of blobs.
23 | # If the line does not contain "extracted from" it
24 | # is assumed that the information is not provided.
25 | if [[ $(head -n 1 ${file}) == *"extracted from"* ]]; then
26 | tail -n +2 ${file} > ${TMPDIR}/files.txt
27 | echo $(head -n 1 ${file}) >> ${TMPDIR}/sorted_files.txt
28 | echo "" >> ${TMPDIR}/sorted_files.txt
29 | else
30 | cp ${file} ${TMPDIR}/files.txt
31 | fi
32 |
33 | # Make all section names unique
34 | sed -i "s/# .*/&00unique/g" ${TMPDIR}/files.txt
35 |
36 | # Get and sort the section
37 | cat ${TMPDIR}/files.txt | grep "# " | sort > ${TMPDIR}/sections.txt
38 |
39 | # Write the sorted sections to sorted_files.txt
40 | while read section; do
41 | echo "${section}" >> ${TMPDIR}/sorted_files.txt
42 | sed -n "/${section}/,/^$/p" ${TMPDIR}/files.txt | LC_ALL=C sort -u | grep -v "# "* | sed '/^[[:space:]]*$/d' >> ${TMPDIR}/sorted_files.txt
43 | echo -en '\n' >> ${TMPDIR}/sorted_files.txt
44 | done < ${TMPDIR}/sections.txt
45 |
46 | # There is one new line too much
47 | sed -i -e :a -e '/^\n*$/{$d;N;ba' -e '}' ${TMPDIR}/sorted_files.txt
48 |
49 | # Revert the unique section names
50 | sed -i "s/00unique//g" ${TMPDIR}/sorted_files.txt
51 |
52 | mv ${TMPDIR}/sorted_files.txt ${file}
53 |
54 | # Clear the temporary working directory
55 | rm -rf "${TMPDIR}"
56 |
--------------------------------------------------------------------------------
/system_ext.prop:
--------------------------------------------------------------------------------
1 | # Bluetooth
2 | bluetooth.device.class_of_device=90,2,12
3 | bluetooth.hardware.power.idle_cur_ma=36
4 | bluetooth.hardware.power.operating_voltage_mv=3300
5 | bluetooth.hardware.power.rx_cur_ma=20
6 | bluetooth.hardware.power.tx_cur_ma=3
7 | bluetooth.profile.a2dp.source.enabled=true
8 | bluetooth.profile.asha.central.enabled=false
9 | bluetooth.profile.avrcp.target.enabled=true
10 | bluetooth.profile.bas.client.enabled=true
11 | bluetooth.profile.gatt.enabled=true
12 | bluetooth.profile.hfp.ag.enabled=true
13 | bluetooth.profile.hid.device.enabled=true
14 | bluetooth.profile.hid.host.enabled=true
15 | bluetooth.profile.map.server.enabled=true
16 | bluetooth.profile.opp.enabled=true
17 | bluetooth.profile.pan.nap.enabled=true
18 | bluetooth.profile.pan.panu.enabled=true
19 | bluetooth.profile.pbap.server.enabled=true
20 | bluetooth.profile.sap.server.enabled=true
21 |
22 | # Camera
23 | persist.camera.gyro.disable=0
24 |
25 | # DPM
26 | persist.vendor.dpm.feature=11
27 |
--------------------------------------------------------------------------------
/udfps/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2022 The LineageOS Project
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 | //
6 | cc_library {
7 | name: "libudfpshandler",
8 | vendor: true,
9 | srcs: ["UdfpsHandler.cpp"],
10 | shared_libs: [
11 | "libbase",
12 | ],
13 | header_libs: [
14 | "//hardware/xiaomi:xiaomifingerprint_headers",
15 | ],
16 | }
17 |
--------------------------------------------------------------------------------
/udfps/UdfpsHandler.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 The LineageOS Project
3 | *
4 | * SPDX-License-Identifier: Apache-2.0
5 | */
6 | #define LOG_TAG "UdfpsHandler.xiaomi_msmnile"
7 | #include "UdfpsHandler.h"
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #define COMMAND_NIT 10
14 | #define PARAM_NIT_FOD 1
15 | #define PARAM_NIT_NONE 0
16 | static const char* kFodUiPaths[] = {
17 | "/sys/devices/platform/soc/soc:qcom,dsi-display-primary/fod_ui",
18 | "/sys/devices/platform/soc/soc:qcom,dsi-display/fod_ui",
19 | };
20 | static const char* kFodStatusPaths[] = {
21 | "/sys/touchpanel/fod_status",
22 | "/sys/devices/virtual/touch/tp_dev/fod_status",
23 | };
24 | static bool readBool(int fd) {
25 | char c;
26 | int rc;
27 | rc = lseek(fd, 0, SEEK_SET);
28 | if (rc) {
29 | LOG(ERROR) << "failed to seek fd, err: " << rc;
30 | return false;
31 | }
32 | rc = read(fd, &c, sizeof(char));
33 | if (rc != 1) {
34 | LOG(ERROR) << "failed to read bool from fd, err: " << rc;
35 | return false;
36 | }
37 | return c != '0';
38 | }
39 | class XiaomiMsmnileUdfpsHandler : public UdfpsHandler {
40 | public:
41 | void init(fingerprint_device_t *device) {
42 | mDevice = device;
43 | std::thread([this]() {
44 | int fodUiFd;
45 | for (auto& path : kFodUiPaths) {
46 | fodUiFd = open(path, O_RDONLY);
47 | if (fodUiFd >= 0) {
48 | break;
49 | }
50 | }
51 | if (fodUiFd < 0) {
52 | LOG(ERROR) << "failed to open fd, err: " << fodUiFd;
53 | return;
54 | }
55 | int fodStatusFd;
56 | for (auto& path : kFodStatusPaths) {
57 | fodStatusFd = open(path, O_WRONLY);
58 | if (fodStatusFd >= 0) {
59 | break;
60 | }
61 | }
62 | struct pollfd fodUiPoll = {
63 | .fd = fodUiFd,
64 | .events = POLLERR | POLLPRI,
65 | .revents = 0,
66 | };
67 | while (true) {
68 | int rc = poll(&fodUiPoll, 1, -1);
69 | if (rc < 0) {
70 | LOG(ERROR) << "failed to poll fd, err: " << rc;
71 | continue;
72 | }
73 | bool fodUi = readBool(fodUiFd);
74 | mDevice->extCmd(mDevice, COMMAND_NIT, fodUi ? PARAM_NIT_FOD : PARAM_NIT_NONE);
75 | if (fodStatusFd >= 0) {
76 | write(fodStatusFd, fodUi ? "1" : "0", 1);
77 | }
78 | }
79 | }).detach();
80 | }
81 | void onFingerDown(uint32_t /*x*/, uint32_t /*y*/, float /*minor*/, float /*major*/) {
82 | // nothing
83 | }
84 | void onFingerUp() {
85 | // nothing
86 | }
87 | void onAcquired(int32_t /*result*/, int32_t /*vendorCode*/) {
88 | // nothing
89 | }
90 | void cancel() {
91 | // nothing
92 | }
93 | private:
94 | fingerprint_device_t *mDevice;
95 | };
96 | static UdfpsHandler* create() {
97 | return new XiaomiMsmnileUdfpsHandler();
98 | }
99 | static void destroy(UdfpsHandler* handler) {
100 | delete handler;
101 | }
102 | extern "C" UdfpsHandlerFactory UDFPS_HANDLER_FACTORY = {
103 | .create = create,
104 | .destroy = destroy,
105 | };
106 |
--------------------------------------------------------------------------------
/update-sha1sums.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | #
3 | # Copyright (C) 2016 The CyanogenMod Project
4 | # Copyright (C) 2017-2020 The LineageOS Project
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | import os
20 | import sys
21 | from hashlib import sha1
22 |
23 | device = 'raphael'
24 | vendor = 'xiaomi'
25 |
26 | with open('proprietary-files.txt', 'r') as f:
27 | lines = f.read().splitlines()
28 | vendorPath = '../../../vendor/' + vendor + '/' + device + '/proprietary'
29 | needSHA1 = False
30 |
31 |
32 | def cleanup():
33 | for index, line in enumerate(lines):
34 | # Skip empty or commented lines
35 | if len(line) == 0 or line[0] == '#' or '|' not in line:
36 | continue
37 |
38 | # Drop SHA1 hash, if existing
39 | lines[index] = line.split('|')[0]
40 |
41 |
42 | def update():
43 | for index, line in enumerate(lines):
44 | # Skip empty lines
45 | if len(line) == 0:
46 | continue
47 |
48 | # Check if we need to set SHA1 hash for the next files
49 | if line[0] == '#':
50 | needSHA1 = (' - from' in line)
51 | continue
52 |
53 | if needSHA1:
54 | # Remove existing SHA1 hash
55 | line = line.split('|')[0]
56 |
57 | filePath = line.split(';')[0].split(':')[-1]
58 | if filePath[0] == '-':
59 | filePath = filePath[1:]
60 |
61 | with open(os.path.join(vendorPath, filePath), 'rb') as f:
62 | hash = sha1(f.read()).hexdigest()
63 |
64 | lines[index] = '%s|%s' % (line, hash)
65 |
66 |
67 | if len(sys.argv) == 2 and sys.argv[1] == '-c':
68 | cleanup()
69 | else:
70 | update()
71 |
72 | with open('proprietary-files.txt', 'w') as file:
73 | file.write('\n'.join(lines) + '\n')
74 |
--------------------------------------------------------------------------------
/vintf/framework_manifest.xml:
--------------------------------------------------------------------------------
1 |
26 |
27 |
28 | vendor.qti.hardware.radio.atcmdfwd
29 | hwbinder
30 | 1.0
31 |
32 | IAtCmdFwd
33 | AtCmdFwdService
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/vintf/manifest-qva.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | com.qualcomm.qti.dpm.api
4 | hwbinder
5 | @1.0::IdpmQmi/dpmQmiService
6 |
7 |
8 | vendor.qti.hardware.bluetooth_audio
9 | hwbinder
10 | @2.0::IBluetoothAudioProvidersFactory/default
11 |
12 |
13 | vendor.qti.hardware.btconfigstore
14 | hwbinder
15 | @2.0::IBTConfigStore/default
16 |
17 |
18 | vendor.qti.hardware.data.latency
19 | hwbinder
20 | @1.0::ILinkLatency/default
21 |
22 |
23 |
--------------------------------------------------------------------------------
/vintf/manifest_nfc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | android.hardware.nfc
4 | hwbinder
5 | @1.2::INfc/default
6 |
7 |
8 | vendor.nxp.nxpese
9 | hwbinder
10 | @1.0::INxpEse/default
11 |
12 |
13 | vendor.nxp.nxpnfc
14 | hwbinder
15 | @1.0::INxpNfc/default
16 |
17 |
18 |
--------------------------------------------------------------------------------