├── Android.bp ├── Android.mk ├── AndroidProducts.mk ├── BoardConfig.mk ├── README.md ├── audio ├── audio_effects.xml ├── audio_output_policy.conf ├── audio_platform_info.xml ├── audio_policy.conf ├── audio_policy_configuration.xml ├── audio_tuning_mixer.txt ├── mixer_paths_mtp.xml ├── sound_trigger_mixer_paths.xml └── sound_trigger_platform_info.xml ├── config.fs ├── configs ├── gps │ ├── flp.conf │ ├── gps.conf │ ├── izat.conf │ ├── lowi.conf │ ├── sap.conf │ └── xtwifi.conf ├── idc │ ├── uinput-fpc.idc │ └── uinput-goodix.idc ├── media_codecs.xml ├── media_codecs_performance.xml ├── media_profiles_V1_0.xml ├── msm_irqbalance_little_big.conf ├── powerhint.xml ├── public.libraries.txt ├── qti_whitelist.xml ├── sec_config └── sensors │ ├── hals.conf │ └── sensor_def_qcomdev.conf ├── device.mk ├── doze ├── Android.bp ├── AndroidManifest.xml ├── proguard.flags ├── res │ └── xml │ │ └── doze_settings.xml └── src │ └── org │ └── lineageos │ └── settings │ └── doze │ ├── BootCompletedReceiver.java │ ├── DozeService.java │ ├── DozeSettingsActivity.java │ ├── DozeSettingsFragment.java │ ├── DozeUtils.java │ ├── ProximitySensor.java │ └── TiltSensor.java ├── extract-files.sh ├── fastboot-info.txt ├── framework_compatibility_matrix.xml ├── framework_manifest.xml ├── keylayout ├── msm8953-snd-card-mtp_Button_Jack.kl ├── uinput-fpc.kl └── uinput-goodix.kl ├── libinit ├── Android.bp └── init_onclite.cpp ├── lineage.dependencies ├── lineage_onclite.mk ├── manifest.xml ├── overlay-lineage ├── lineage-sdk │ └── lineage │ │ └── res │ │ └── res │ │ └── values │ │ └── config.xml └── packages │ └── apps │ ├── Aperture │ └── app │ │ └── src │ │ └── main │ │ └── res │ │ └── values │ │ └── config.xml │ └── Dialer │ └── java │ └── com │ └── android │ └── dialer │ └── callrecord │ └── res │ └── values │ └── config.xml ├── overlay ├── frameworks │ └── base │ │ ├── core │ │ └── res │ │ │ └── res │ │ │ ├── values │ │ │ ├── config.xml │ │ │ └── dimens.xml │ │ │ └── xml │ │ │ └── power_profile.xml │ │ └── packages │ │ └── SystemUI │ │ └── res │ │ └── values │ │ ├── config.xml │ │ └── dimens.xml └── packages │ ├── apps │ ├── CarrierConfig │ │ └── res │ │ │ └── xml │ │ │ └── vendor.xml │ └── Settings │ │ └── res │ │ └── values │ │ ├── arrays.xml │ │ └── config.xml │ └── services │ └── Telephony │ └── res │ └── values │ └── config.xml ├── permissions ├── privapp-permissions-qti.xml └── telephony_system-ext_privapp-permissions-qti.xml ├── power └── power-mode.cpp ├── product.prop ├── proprietary-files.txt ├── releasetools.py ├── rootdir ├── Android.mk ├── bin │ ├── init.class_main.sh │ ├── init.qcom.early_boot.sh │ ├── init.qcom.post_boot.sh │ └── init.qcom.sh └── etc │ ├── fstab.qcom │ ├── init.msm.usb.configfs.rc │ ├── init.onclite.rc │ ├── init.qcom.rc │ ├── init.qcom.usb.rc │ ├── init.recovery.qcom.rc │ ├── init.target.rc │ └── ueventd.qcom.rc ├── rro_overlays ├── OncWifiOverlay │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ │ └── values │ │ └── config.xml └── WifiOverlay │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ └── values │ └── config.xml ├── seccomp_policy └── mediacodec.policy ├── sepolicy └── vendor │ ├── bootanim.te │ ├── device.te │ ├── file.te │ ├── file_contexts │ ├── genfs_contexts │ ├── hal_audio_default.te │ ├── hal_bluetooth_default.te │ ├── hal_camera_default.te │ ├── hal_cas_default.te │ ├── hal_fingerprint_default.te │ ├── hal_ir_default.te │ ├── hal_power_default.te │ ├── hwservice_contexts │ ├── init.te │ ├── kernel.te │ ├── netmgrd.te │ ├── property.te │ ├── property_contexts │ ├── qti_init_shell.te │ ├── radio.te │ ├── rild.te │ ├── rmt_storage.te │ ├── system_app.te │ ├── system_server.te │ ├── tee.te │ ├── thermal-engine.te │ ├── ueventd.te │ ├── vendor_init.te │ ├── vndservice.te │ ├── vndservice_contexts │ └── wcnss_service.te ├── setup-makefiles.sh ├── system.prop ├── system_ext.prop ├── update-sha1sums.py ├── vendor.prop ├── vibrator ├── Android.bp ├── OWNERS ├── Vibrator.cpp ├── Vibrator.h ├── android.hardware.vibrator@1.3-service.xiaomi_onclite.rc ├── android.hardware.vibrator@1.3-service.xiaomi_onclite.xml └── service.cpp └── wifi ├── WCNSS_cfg.dat ├── WCNSS_qcom_cfg.ini ├── p2p_supplicant_overlay.conf └── wpa_supplicant_overlay.conf /Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // SPDX-FileCopyrightText: 2022-2024 The LineageOS Project 3 | // SPDX-License-Identifier: Apache-2.0 4 | // 5 | 6 | soong_namespace { 7 | } 8 | 9 | install_symlink { 10 | name: "firmware_WCNSS_qcom_cfg.ini_symlink", 11 | vendor: true, 12 | installed_location: "firmware/wlan/prima/WCNSS_qcom_cfg.ini", 13 | symlink_target: "/vendor/etc/wifi/WCNSS_qcom_cfg.ini", 14 | } 15 | 16 | install_symlink { 17 | name: "firmware_WCNSS_qcom_wlan_nv.bin_symlink", 18 | vendor: true, 19 | installed_location: "firmware/wlan/prima/WCNSS_qcom_wlan_nv.bin", 20 | symlink_target: "/mnt/vendor/persist/WCNSS_qcom_wlan_nv.bin", 21 | } 22 | 23 | install_symlink { 24 | name: "firmware_WCNSS_wlan_dictionary.dat_symlink", 25 | vendor: true, 26 | installed_location: "firmware/wlan/prima/WCNSS_wlan_dictionary.dat", 27 | symlink_target: "/mnt/vendor/persist/WCNSS_wlan_dictionary.dat", 28 | } 29 | -------------------------------------------------------------------------------- /Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: 2017-2024 The LineageOS Project 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | LOCAL_PATH := $(call my-dir) 7 | 8 | ifeq ($(TARGET_DEVICE),onclite) 9 | 10 | include $(call all-makefiles-under,$(LOCAL_PATH)) 11 | 12 | include $(CLEAR_VARS) 13 | 14 | #A/B builds require us to create the mount points at compile time. 15 | #Just creating it for all cases since it does not hurt. 16 | FIRMWARE_MOUNT_POINT := $(TARGET_OUT_VENDOR)/firmware_mnt 17 | DSP_MOUNT_POINT := $(TARGET_OUT_VENDOR)/dsp 18 | ALL_DEFAULT_INSTALLED_MODULES += $(FIRMWARE_MOUNT_POINT) \ 19 | $(DSP_MOUNT_POINT) 20 | $(FIRMWARE_MOUNT_POINT): 21 | @echo "Creating $(FIRMWARE_MOUNT_POINT)" 22 | @mkdir -p $(TARGET_OUT_VENDOR)/firmware_mnt 23 | 24 | $(DSP_MOUNT_POINT): 25 | @echo "Creating $(DSP_MOUNT_POINT)" 26 | @mkdir -p $(TARGET_OUT_VENDOR)/dsp 27 | 28 | endif 29 | -------------------------------------------------------------------------------- /AndroidProducts.mk: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: 2020-2024 The LineageOS Project 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | PRODUCT_MAKEFILES := \ 7 | $(LOCAL_DIR)/lineage_onclite.mk 8 | -------------------------------------------------------------------------------- /BoardConfig.mk: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: 2017-2024 The LineageOS Project 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | DEVICE_PATH := device/xiaomi/onclite 7 | 8 | # ANT 9 | BOARD_ANT_WIRELESS_DEVICE := "vfs-prerelease" 10 | 11 | # Architecture 12 | TARGET_ARCH := arm64 13 | TARGET_ARCH_VARIANT := armv8-a 14 | TARGET_CPU_ABI := arm64-v8a 15 | TARGET_CPU_ABI2 := 16 | TARGET_CPU_VARIANT := generic 17 | 18 | TARGET_2ND_ARCH := arm 19 | TARGET_2ND_ARCH_VARIANT := armv8-a 20 | TARGET_2ND_CPU_ABI := armeabi-v7a 21 | TARGET_2ND_CPU_ABI2 := armeabi 22 | TARGET_2ND_CPU_VARIANT := cortex-a53 23 | 24 | TARGET_BOARD_PLATFORM := msm8953 25 | 26 | TARGET_BOARD_SUFFIX := _64 27 | 28 | # Assert 29 | TARGET_OTA_ASSERT_DEVICE := onclite,onc 30 | 31 | # Audio 32 | AUDIO_FEATURE_ENABLED_ANC_HEADSET := true 33 | AUDIO_FEATURE_ENABLED_ALAC_OFFLOAD := true 34 | AUDIO_FEATURE_ENABLED_COMPRESS_VOIP := true 35 | AUDIO_FEATURE_ENABLED_CUSTOMSTEREO := true 36 | AUDIO_FEATURE_ENABLED_EXTN_FORMATS := true 37 | AUDIO_FEATURE_ENABLED_FM_POWER_OPT := true 38 | AUDIO_FEATURE_ENABLED_FLAC_OFFLOAD := true 39 | AUDIO_FEATURE_ENABLED_FLUENCE := true 40 | AUDIO_FEATURE_ENABLED_HFP := true 41 | AUDIO_FEATURE_ENABLED_KPI_OPTIMIZE := true 42 | AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true 43 | AUDIO_FEATURE_ENABLED_PCM_OFFLOAD := true 44 | AUDIO_FEATURE_ENABLED_PCM_OFFLOAD_24 := true 45 | AUDIO_FEATURE_ENABLED_PROXY_DEVICE := true 46 | AUDIO_FEATURE_ENABLED_SOURCE_TRACKING := true 47 | AUDIO_FEATURE_ENABLED_EXT_AMPLIFIER := false 48 | AUDIO_USE_LL_AS_PRIMARY_OUTPUT := true 49 | BOARD_SUPPORTS_SOUND_TRIGGER := true 50 | BOARD_USES_ALSA_AUDIO := true 51 | USE_CUSTOM_AUDIO_POLICY := 1 52 | USE_XML_AUDIO_POLICY_CONF := 1 53 | 54 | # Bluetooth 55 | BOARD_HAVE_BLUETOOTH_QCOM := true 56 | 57 | # Bootloader 58 | TARGET_BOOTLOADER_BOARD_NAME := onc 59 | TARGET_NO_BOOTLOADER := true 60 | 61 | # Build broken 62 | BUILD_BROKEN_DUP_RULES := true 63 | BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true 64 | 65 | # Camera 66 | USE_DEVICE_SPECIFIC_CAMERA := true 67 | BOARD_QTI_CAMERA_32BIT_ONLY := true 68 | TARGET_TS_MAKEUP := true 69 | 70 | # Display 71 | TARGET_SCREEN_DENSITY := 280 72 | TARGET_USES_ION := true 73 | TARGET_USES_GRALLOC1 := true 74 | TARGET_USES_HWC2 := true 75 | 76 | # DRM 77 | TARGET_ENABLE_MEDIADRM_64 := true 78 | 79 | # Filesystem 80 | TARGET_FS_CONFIG_GEN := $(DEVICE_PATH)/config.fs 81 | 82 | # FM 83 | BOARD_HAVE_QCOM_FM := true 84 | TARGET_QCOM_NO_FM_FIRMWARE := true 85 | 86 | # GPS 87 | USE_DEVICE_SPECIFIC_GPS := true 88 | TARGET_NO_RPC := true 89 | 90 | # HIDL 91 | DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := \ 92 | $(DEVICE_PATH)/framework_compatibility_matrix.xml \ 93 | hardware/qcom-caf/common/vendor_framework_compatibility_matrix.xml \ 94 | hardware/xiaomi/vintf/xiaomi_framework_compatibility_matrix.xml \ 95 | vendor/lineage/config/device_framework_matrix.xml 96 | DEVICE_MANIFEST_FILE := $(DEVICE_PATH)/manifest.xml 97 | DEVICE_MATRIX_FILE := hardware/qcom-caf/common/compatibility_matrix.xml 98 | DEVICE_FRAMEWORK_MANIFEST_FILE := $(DEVICE_PATH)/framework_manifest.xml 99 | 100 | # Init 101 | TARGET_INIT_VENDOR_LIB := //$(DEVICE_PATH):libinit_onclite 102 | TARGET_RECOVERY_DEVICE_MODULES := libinit_onclite 103 | 104 | # Kernel 105 | BOARD_KERNEL_BASE := 0x80000000 106 | BOARD_KERNEL_CMDLINE := \ 107 | androidboot.bootdevice=7824900.sdhci \ 108 | androidboot.console=ttyMSM0 \ 109 | androidboot.hardware=qcom \ 110 | androidboot.usbconfigfs=true \ 111 | console=ttyMSM0,115200,n8 \ 112 | earlycon=msm_serial_dm,0x78af000 \ 113 | ehci-hcd.park=3 \ 114 | firmware_class.path=/vendor/firmware_mnt/image \ 115 | loop.max_part=7 \ 116 | lpm_levels.sleep_disabled=1 \ 117 | msm_rtb.filter=0x237 118 | BOARD_KERNEL_IMAGE_NAME := Image.gz-dtb 119 | BOARD_KERNEL_PAGESIZE := 2048 120 | BOARD_BOOTIMG_HEADER_VERSION := 1 121 | BOARD_MKBOOTIMG_ARGS := --header_version $(BOARD_BOOTIMG_HEADER_VERSION) 122 | TARGET_KERNEL_SOURCE := kernel/xiaomi/onclite 123 | TARGET_KERNEL_CONFIG := onclite-perf_defconfig 124 | BOARD_KERNEL_SEPARATED_DTBO := true 125 | BOARD_DTBOIMG_PARTITION_SIZE := 8388608 126 | TARGET_KERNEL_VERSION := 4.9 127 | 128 | # Partitions 129 | BOARD_FLASH_BLOCK_SIZE := 131072 # (BOARD_KERNEL_PAGESIZE * 64) 130 | 131 | BOARD_BOOTIMAGE_PARTITION_SIZE := 67108864 132 | BOARD_CACHEIMAGE_PARTITION_SIZE := 268435456 133 | BOARD_SYSTEMIMAGE_PARTITION_SIZE := 3758096384 134 | BOARD_RECOVERYIMAGE_PARTITION_SIZE := 67108864 135 | BOARD_USERDATAIMAGE_PARTITION_SIZE := 24222088704 136 | BOARD_VENDORIMAGE_PARTITION_SIZE := 1073741824 137 | 138 | TARGET_USERIMAGES_USE_F2FS := true 139 | TARGET_USERIMAGES_USE_EXT4 := true 140 | 141 | BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 142 | BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4 143 | 144 | TARGET_COPY_OUT_VENDOR := vendor 145 | 146 | # Peripheral manager 147 | TARGET_PER_MGR_ENABLED := true 148 | 149 | # Power 150 | TARGET_POWERHAL_MODE_EXT := $(DEVICE_PATH)/power/power-mode.cpp 151 | TARGET_USES_INTERACTION_BOOST := true 152 | 153 | # Properties 154 | TARGET_PRODUCT_PROP += $(DEVICE_PATH)/product.prop 155 | TARGET_SYSTEM_PROP += $(DEVICE_PATH)/system.prop 156 | TARGET_SYSTEM_EXT_PROP += $(DEVICE_PATH)/system_ext.prop 157 | TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop 158 | 159 | # Qualcomm 160 | BOARD_USES_QCOM_HARDWARE := true 161 | 162 | # Recovery 163 | BOARD_INCLUDE_RECOVERY_DTBO := true 164 | TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/rootdir/etc/fstab.qcom 165 | 166 | # Releasetools 167 | TARGET_RELEASETOOLS_EXTENSIONS := $(DEVICE_PATH) 168 | 169 | # RIL 170 | ENABLE_VENDOR_RIL_SERVICE := true 171 | 172 | # Security patch level 173 | VENDOR_SECURITY_PATCH := 2021-02-01 174 | 175 | # Sepolicy 176 | include device/qcom/sepolicy-legacy-um/SEPolicy.mk 177 | BOARD_VENDOR_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/vendor 178 | 179 | # Treble 180 | BOARD_VNDK_VERSION := current 181 | PRODUCT_VENDOR_MOVE_ENABLED := true 182 | 183 | # Verified Boot 184 | BOARD_AVB_ENABLE := true 185 | BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --set_hashtree_disabled_flag 186 | BOARD_AVB_RECOVERY_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem 187 | BOARD_AVB_RECOVERY_ALGORITHM := SHA256_RSA4096 188 | BOARD_AVB_RECOVERY_ROLLBACK_INDEX := 1 189 | BOARD_AVB_RECOVERY_ROLLBACK_INDEX_LOCATION := 1 190 | 191 | # Wi-Fi 192 | BOARD_HOSTAPD_DRIVER := NL80211 193 | BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_qcwcn 194 | BOARD_WLAN_DEVICE := qcwcn 195 | BOARD_WPA_SUPPLICANT_DRIVER := NL80211 196 | BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_qcwcn 197 | WIFI_DRIVER_FW_PATH_AP := "ap" 198 | WIFI_DRIVER_FW_PATH_STA := "sta" 199 | WIFI_HIDL_UNIFIED_SUPPLICANT_SERVICE_RC_ENTRY := true 200 | WPA_SUPPLICANT_VERSION := VER_0_8_X 201 | 202 | # Inherit from the proprietary version 203 | include vendor/xiaomi/onclite/BoardConfigVendor.mk 204 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ``` 2 | 3 | SPDX-FileCopyrightText: 2019-2024 The LineageOS Project 4 | 5 | SPDX-License-Identifier: Apache-2.0 6 | 7 | ``` 8 | 9 | Device configuration for Xiaomi Redmi 7 10 | ========================================= 11 | 12 | The Xiaomi Redmi 7 (codenamed "onclite") is an 13 | budget smartphone from Xiaomi. 14 | 15 | It was announced and released in April 2019. 16 | 17 | ## Device specifications 18 | 19 | Basic | Spec Sheet 20 | -------:|:------------------------- 21 | SoC | Qualcomm MSM8953 Snapdragon 632 22 | CPU | Octa core (1.8 GHz, Quad core, Kryo 250 + 1.8 GHz Quad core, Kryo 250) 23 | GPU | Adreno 506 24 | Memory | 2/3 GB RAM 25 | Shipped Android Version | 9.0 26 | Storage | 32 GB 27 | MicroSD | Up to 512 GB (dedicated slot) 28 | Battery | Non-removable Li-Polymer 4000 mAh battery 29 | Dimensions | 158.6 x 76.4 x 8.4 mm 30 | Display | 720 x 1520 pixels, 19:9 ratio, 6.26 inches (~269 ppi density) 31 | Rear camera | 12 MP, f/2.2, 1.25 μm , PDAF , 2 MP, f/2.2, depth sensor 32 | Front camera | 8 MP, f/2.0 33 | 34 | 35 | ## Device picture 36 | 37 | ![Xiaomi Redmi 7 ](https://i.imgur.com/PjaQrqr.png "Xiaomi Redmi 7") 38 | -------------------------------------------------------------------------------- /audio/audio_effects.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /audio/audio_output_policy.conf: -------------------------------------------------------------------------------- 1 | # List of profiles for the output device session where stream is routed. 2 | # A stream opened with the inputs attributes which match the "flags" and 3 | # "formats" as specified in the profile is routed to a device at 4 | # sample rate specified under "sampling_rates" and bit width under 5 | # "bit_width" and the topology extracted from the acdb data against 6 | # the "app_type". 7 | # 8 | # the flags and formats are specified using the strings corresponding to 9 | # enums in audio.h and audio_policy.h. They are concatenated with "|" 10 | # without space or "\n". 11 | # the flags and formats should match the ones in "audio_policy.conf" 12 | 13 | outputs { 14 | default { 15 | flags AUDIO_OUTPUT_FLAG_PRIMARY 16 | formats AUDIO_FORMAT_PCM_16_BIT 17 | sampling_rates 48000 18 | bit_width 16 19 | app_type 69937 20 | } 21 | deep_buffer { 22 | flags AUDIO_OUTPUT_FLAG_DEEP_BUFFER 23 | formats AUDIO_FORMAT_PCM_16_BIT 24 | sampling_rates 48000 25 | bit_width 16 26 | app_type 69936 27 | } 28 | direct_pcm_16 { 29 | flags AUDIO_OUTPUT_FLAG_DIRECT 30 | formats AUDIO_FORMAT_PCM_16_BIT|AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_8_24_BIT 31 | sampling_rates 44100|48000|96000|192000 32 | bit_width 16 33 | app_type 69936 34 | } 35 | direct_pcm_24 { 36 | flags AUDIO_OUTPUT_FLAG_DIRECT 37 | formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_8_24_BIT 38 | sampling_rates 44100|48000|96000|192000 39 | bit_width 24 40 | app_type 69940 41 | } 42 | compress_offload_16 { 43 | flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING 44 | formats AUDIO_FORMAT_MP3|AUDIO_FORMAT_FLAC|AUDIO_FORMAT_ALAC|AUDIO_FORMAT_APE|AUDIO_FORMAT_AAC_LC|AUDIO_FORMAT_AAC_HE_V1|AUDIO_FORMAT_AAC_HE_V2|AUDIO_FORMAT_WMA|AUDIO_FORMAT_WMA_PRO|AUDIO_FORMAT_VORBIS|AUDIO_FORMAT_AAC_ADTS_LC|AUDIO_FORMAT_AAC_ADTS_HE_V1|AUDIO_FORMAT_AAC_ADTS_HE_V2 45 | sampling_rates 44100|48000|96000|192000 46 | bit_width 16 47 | app_type 69936 48 | } 49 | compress_offload_24 { 50 | flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING 51 | formats AUDIO_FORMAT_FLAC|AUDIO_FORMAT_ALAC|AUDIO_FORMAT_APE|AUDIO_FORMAT_VORBIS 52 | sampling_rates 44100|48000|96000|192000 53 | bit_width 24 54 | app_type 69940 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /audio/audio_policy.conf: -------------------------------------------------------------------------------- 1 | # Global configuration section: 2 | # - lists input and output devices always present on the device 3 | # as well as the output device selected by default. 4 | # Devices are designated by a string that corresponds to the enum in audio.h 5 | # - defines whether the speaker output path uses DRC 6 | # "TRUE" means DRC is enabled, "FALSE" or omission means DRC isn't used. 7 | global_configuration { 8 | attached_output_devices AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_TELEPHONY_TX 9 | default_output_device AUDIO_DEVICE_OUT_SPEAKER 10 | attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_BACK_MIC|AUDIO_DEVICE_IN_REMOTE_SUBMIX|AUDIO_DEVICE_IN_FM_TUNER|AUDIO_DEVICE_IN_VOICE_CALL|AUDIO_DEVICE_IN_TELEPHONY_RX 11 | 12 | speaker_drc_enabled TRUE 13 | } 14 | 15 | # audio hardware module section: contains descriptors for all audio hw modules present on the 16 | # device. Each hw module node is named after the corresponding hw module library base name. 17 | # For instance, "primary" corresponds to audio.primary..so. 18 | # The "primary" module is mandatory and must include at least one output with 19 | # AUDIO_OUTPUT_FLAG_PRIMARY flag. 20 | # Each module descriptor contains one or more output profile descriptors and zero or more 21 | # input profile descriptors. Each profile lists all the parameters supported by a given output 22 | # or input stream category. 23 | # The "channel_masks", "formats", "devices" and "flags" are specified using strings corresponding 24 | # to enums in audio.h and audio_policy.h. They are concatenated by use of "|" without space or "\n". 25 | 26 | audio_hw_modules { 27 | primary { 28 | outputs { 29 | primary { 30 | sampling_rates 44100|48000 31 | channel_masks AUDIO_CHANNEL_OUT_STEREO 32 | formats AUDIO_FORMAT_PCM_16_BIT 33 | devices AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_LINE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_AUX_DIGITAL|AUDIO_DEVICE_OUT_PROXY|AUDIO_DEVICE_OUT_FM 34 | flags AUDIO_OUTPUT_FLAG_PRIMARY|AUDIO_OUTPUT_FLAG_FAST 35 | } 36 | raw { 37 | sampling_rates 48000 38 | channel_masks AUDIO_CHANNEL_OUT_STEREO 39 | formats AUDIO_FORMAT_PCM_16_BIT 40 | devices AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_LINE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_AUX_DIGITAL|AUDIO_DEVICE_OUT_PROXY 41 | flags AUDIO_OUTPUT_FLAG_FAST|AUDIO_OUTPUT_FLAG_RAW 42 | } 43 | deep_buffer { 44 | sampling_rates 44100|48000 45 | channel_masks AUDIO_CHANNEL_OUT_STEREO 46 | formats AUDIO_FORMAT_PCM_16_BIT 47 | devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_LINE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_AUX_DIGITAL|AUDIO_DEVICE_OUT_PROXY 48 | flags AUDIO_OUTPUT_FLAG_DEEP_BUFFER 49 | } 50 | direct_pcm { 51 | sampling_rates 8000|11025|16000|22050|32000|44100|48000|64000|88200|96000|176400|192000 52 | channel_masks AUDIO_CHANNEL_OUT_MONO|AUDIO_CHANNEL_OUT_STEREO|AUDIO_CHANNEL_OUT_2POINT1|AUDIO_CHANNEL_OUT_QUAD|AUDIO_CHANNEL_OUT_PENTA|AUDIO_CHANNEL_OUT_5POINT1|AUDIO_CHANNEL_OUT_6POINT1|AUDIO_CHANNEL_OUT_7POINT1 53 | formats AUDIO_FORMAT_PCM_16_BIT|AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_8_24_BIT 54 | devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_LINE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_PROXY|AUDIO_DEVICE_OUT_AUX_DIGITAL 55 | flags AUDIO_OUTPUT_FLAG_DIRECT 56 | } 57 | compress_offload { 58 | sampling_rates 8000|11025|12000|16000|22050|24000|32000|44100|48000|64000|88200|96000|176400|192000 59 | channel_masks AUDIO_CHANNEL_OUT_MONO|AUDIO_CHANNEL_OUT_STEREO|AUDIO_CHANNEL_OUT_2POINT1|AUDIO_CHANNEL_OUT_QUAD|AUDIO_CHANNEL_OUT_PENTA|AUDIO_CHANNEL_OUT_5POINT1|AUDIO_CHANNEL_OUT_6POINT1|AUDIO_CHANNEL_OUT_7POINT1 60 | formats AUDIO_FORMAT_MP3|AUDIO_FORMAT_FLAC|AUDIO_FORMAT_ALAC|AUDIO_FORMAT_APE|AUDIO_FORMAT_AAC_LC|AUDIO_FORMAT_AAC_HE_V1|AUDIO_FORMAT_AAC_HE_V2|AUDIO_FORMAT_WMA|AUDIO_FORMAT_WMA_PRO|AUDIO_FORMAT_VORBIS|AUDIO_FORMAT_AAC_ADTS_LC|AUDIO_FORMAT_AAC_ADTS_HE_V1|AUDIO_FORMAT_AAC_ADTS_HE_V2 61 | devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_LINE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_AUX_DIGITAL|AUDIO_DEVICE_OUT_PROXY 62 | flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING 63 | } 64 | incall_music { 65 | sampling_rates 8000|16000|48000 66 | channel_masks AUDIO_CHANNEL_OUT_MONO 67 | formats AUDIO_FORMAT_PCM_16_BIT 68 | devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_LINE|AUDIO_DEVICE_OUT_ALL_SCO 69 | flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_INCALL_MUSIC 70 | } 71 | voice_tx { 72 | sampling_rates 8000|16000|48000 73 | channel_masks AUDIO_CHANNEL_OUT_STEREO|AUDIO_CHANNEL_OUT_MONO 74 | formats AUDIO_FORMAT_PCM_16_BIT 75 | devices AUDIO_DEVICE_OUT_TELEPHONY_TX 76 | } 77 | voip_rx { 78 | sampling_rates 8000|16000 79 | channel_masks AUDIO_CHANNEL_OUT_MONO 80 | formats AUDIO_FORMAT_PCM_16_BIT 81 | devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_LINE|AUDIO_DEVICE_OUT_ALL_SCO 82 | flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_VOIP_RX 83 | } 84 | } 85 | inputs { 86 | primary { 87 | sampling_rates 8000|11025|12000|16000|22050|24000|32000|44100|48000 88 | channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO|AUDIO_CHANNEL_IN_FRONT_BACK 89 | formats AUDIO_FORMAT_PCM_16_BIT 90 | devices AUDIO_DEVICE_IN_WIRED_HEADSET|AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET|AUDIO_DEVICE_IN_FM_TUNER|AUDIO_DEVICE_IN_VOICE_CALL 91 | } 92 | surround_sound { 93 | sampling_rates 8000|11025|12000|16000|22050|24000|32000|44100|48000 94 | channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO|AUDIO_CHANNEL_IN_FRONT_BACK|AUDIO_CHANNEL_INDEX_MASK_3|AUDIO_CHANNEL_INDEX_MASK_4|AUDIO_CHANNEL_IN_5POINT1 95 | formats AUDIO_FORMAT_PCM_16_BIT 96 | devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_BACK_MIC 97 | } 98 | record_24 { 99 | sampling_rates 8000|11025|12000|16000|22050|24000|32000|44100|48000|96000|192000 100 | channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO|AUDIO_CHANNEL_IN_FRONT_BACK|AUDIO_CHANNEL_INDEX_MASK_3|AUDIO_CHANNEL_INDEX_MASK_4 101 | formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_8_24_BIT|AUDIO_FORMAT_PCM_FLOAT 102 | devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_BACK_MIC|AUDIO_DEVICE_IN_WIRED_HEADSET 103 | } 104 | voice_rx { 105 | sampling_rates 8000|16000|48000 106 | channel_masks AUDIO_CHANNEL_IN_STEREO|AUDIO_CHANNEL_IN_MONO 107 | formats AUDIO_FORMAT_PCM_16_BIT 108 | devices AUDIO_DEVICE_IN_TELEPHONY_RX 109 | } 110 | } 111 | } 112 | a2dp { 113 | outputs { 114 | a2dp { 115 | sampling_rates 44100 116 | channel_masks AUDIO_CHANNEL_OUT_STEREO 117 | formats AUDIO_FORMAT_PCM_16_BIT 118 | devices AUDIO_DEVICE_OUT_ALL_A2DP 119 | } 120 | } 121 | inputs { 122 | a2dp { 123 | sampling_rates 44100|48000 124 | channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO 125 | formats AUDIO_FORMAT_PCM_16_BIT 126 | devices AUDIO_DEVICE_IN_BLUETOOTH_A2DP 127 | } 128 | } 129 | } 130 | usb { 131 | outputs { 132 | usb_accessory { 133 | sampling_rates 44100 134 | channel_masks AUDIO_CHANNEL_OUT_STEREO 135 | formats AUDIO_FORMAT_PCM_16_BIT 136 | devices AUDIO_DEVICE_OUT_USB_ACCESSORY 137 | } 138 | usb_device { 139 | sampling_rates dynamic 140 | channel_masks dynamic 141 | formats dynamic 142 | devices AUDIO_DEVICE_OUT_USB_DEVICE 143 | } 144 | } 145 | inputs { 146 | usb_device { 147 | sampling_rates dynamic 148 | channel_masks AUDIO_CHANNEL_IN_STEREO 149 | formats AUDIO_FORMAT_PCM_16_BIT 150 | devices AUDIO_DEVICE_IN_USB_DEVICE 151 | } 152 | } 153 | } 154 | r_submix { 155 | outputs { 156 | submix { 157 | sampling_rates 48000 158 | channel_masks AUDIO_CHANNEL_OUT_STEREO 159 | formats AUDIO_FORMAT_PCM_16_BIT 160 | devices AUDIO_DEVICE_OUT_REMOTE_SUBMIX 161 | } 162 | } 163 | inputs { 164 | submix { 165 | sampling_rates 48000 166 | channel_masks AUDIO_CHANNEL_IN_STEREO 167 | formats AUDIO_FORMAT_PCM_16_BIT 168 | devices AUDIO_DEVICE_IN_REMOTE_SUBMIX 169 | } 170 | } 171 | } 172 | } 173 | -------------------------------------------------------------------------------- /audio/audio_tuning_mixer.txt: -------------------------------------------------------------------------------- 1 | #ANC_TEST_P_PATH_MIC_STEREO Capture 2 | acdb_dev_id:85 3 | !Capture 4 | Txdevice:0 5 | 6 | enable 7 | TX7 HPF Switch:0 8 | TX8 HPF Switch:0 9 | AIF1_CAP Mixer SLIM TX7:1 10 | AIF1_CAP Mixer SLIM TX8:1 11 | SLIM TX7 MUX:DEC9 12 | DEC9 MUX:DMIC4 13 | SLIM TX8 MUX:DEC10 14 | DEC10 MUX:DMIC3 15 | SLIM_0_TX Channels:Two 16 | MultiMedia1 Mixer SLIM_0_TX:1 17 | 18 | disable 19 | MultiMedia1 Mixer SLIM_0_TX:0 20 | AIF1_CAP Mixer SLIM TX7:0 21 | AIF1_CAP Mixer SLIM TX8:0 22 | SLIM TX7 MUX:ZERO 23 | SLIM TX8 MUX:ZERO 24 | DEC10 MUX:ZERO 25 | DEC9 MUX:ZERO 26 | TX7 HPF Switch:0 27 | TX8 HPF Switch:0 28 | 29 | #ANC_TEST_S_PATH_MIC_STEREO Capture 30 | acdb_dev_id:88 31 | !Capture 32 | Txdevice:0 33 | 34 | enable 35 | TX7 HPF Switch:0 36 | TX8 HPF Switch:0 37 | AIF1_CAP Mixer SLIM TX7:1 38 | AIF1_CAP Mixer SLIM TX8:1 39 | SLIM TX7 MUX:DEC8 40 | DEC7 MUX:ANC2_FB 41 | ANC2 MUX:DMIC3 42 | SLIM TX8 MUX:DEC7 43 | DEC8 MUX:ANC1_FB 44 | ANC1 MUX:DMIC3 45 | ANC1 FB MUX:EAR_HPH_L 46 | SLIM_0_TX Channels:Two 47 | MultiMedia1 Mixer SLIM_0_TX:1 48 | 49 | disable 50 | MultiMedia1 Mixer SLIM_0_TX:0 51 | AIF1_CAP Mixer SLIM TX7:0 52 | AIF1_CAP Mixer SLIM TX8:0 53 | SLIM TX7 MUX:ZERO 54 | SLIM TX8 MUX:ZERO 55 | DEC7 MUX:ZERO 56 | ANC2 MUX:ZERO 57 | ANC1 MUX:ZERO 58 | DEC8 MUX:ZERO 59 | ANC1 FB MUX:ZERO 60 | TX7 HPF Switch:0 61 | TX8 HPF Switch:0 62 | 63 | #ANC_TEST_E_PATH_MIC_STEREO Capture 64 | acdb_dev_id:91 65 | !Capture 66 | Txdevice:0 67 | 68 | enable 69 | TX7 HPF Switch:0 70 | TX8 HPF Switch:0 71 | AIF1_CAP Mixer SLIM TX7:1 72 | AIF1_CAP Mixer SLIM TX8:1 73 | SLIM TX7 MUX:DEC8 74 | DEC7 MUX:ANC2_FB 75 | ANC2 MUX:DMIC4 76 | ANC1 MUX:DMIC4 77 | SLIM TX8 MUX:DEC7 78 | DEC8 MUX:ANC1_FB 79 | ANC1 FB MUX:EAR_HPH_L 80 | SLIM_0_TX Channels:Two 81 | MultiMedia1 Mixer SLIM_0_TX:1 82 | 83 | disable 84 | MultiMedia1 Mixer SLIM_0_TX:0 85 | AIF1_CAP Mixer SLIM TX7:0 86 | AIF1_CAP Mixer SLIM TX8:0 87 | SLIM TX7 MUX:ZERO 88 | SLIM TX8 MUX:ZERO 89 | DEC7 MUX:ZERO 90 | ANC2 MUX:ZERO 91 | DEC10 MUX:ZERO 92 | ANC1 FB MUX:ZERO 93 | TX7 HPF Switch:0 94 | TX8 HPF Switch:0 95 | 96 | #ANC_TEST_S_PATH_HANDSET_SPKR_ANC_MONO 97 | acdb_dev_id:86 98 | !Playback 99 | Rxdevice:0 100 | 101 | enable 102 | ANC Function:ON 103 | SLIM RX1 MUX:AIF1_PB 104 | SLIM_0_RX Channels:One 105 | RX1 MIX1 INP1:RX1 106 | CLASS_H_DSM MUX:DSM_HPHL_RX1 107 | RX1 Digital Volume:87 108 | DAC1 Switch:1 109 | ANC Slot:7 110 | SLIMBUS_0_RX Audio Mixer MultiMedia1:1 111 | 112 | disable 113 | SLIMBUS_0_RX Audio Mixer MultiMedia1:0 114 | ANC Slot:0 115 | SLIM RX1 MUX:ZERO 116 | RX1 MIX1 INP1:ZERO 117 | RX1 Digital Volume:0 118 | DAC1 Switch:0 119 | ANC Function:OFF 120 | 121 | #ANC_TEST_E_PATH_HANDSET_SPKR_ANC_MONO 122 | acdb_dev_id:89 123 | !Playback 124 | Rxdevice:0 125 | 126 | enable 127 | ANC Function:ON 128 | SLIM RX1 MUX:AIF1_PB 129 | SLIM_0_RX Channels:One 130 | RX1 MIX1 INP1:RX1 131 | CLASS_H_DSM MUX:DSM_HPHL_RX1 132 | RX1 Digital Volume:87 133 | DAC1 Switch:1 134 | ANC Slot:8 135 | SLIMBUS_0_RX Audio Mixer MultiMedia1:1 136 | 137 | disable 138 | SLIMBUS_0_RX Audio Mixer MultiMedia1:0 139 | ANC Slot:0 140 | SLIM RX1 MUX:ZERO 141 | RX1 MIX1 INP1:ZERO 142 | RX1 Digital Volume:0 143 | DAC1 Switch:0 144 | ANC Function:OFF 145 | -------------------------------------------------------------------------------- /audio/sound_trigger_mixer_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /audio/sound_trigger_platform_info.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | -------------------------------------------------------------------------------- /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 | [vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti] 23 | mode: 0755 24 | user: AID_BLUETOOTH 25 | group: AID_BLUETOOTH 26 | caps: BLOCK_SUSPEND NET_ADMIN 27 | 28 | [vendor/bin/pm-service] 29 | mode: 0755 30 | user: AID_SYSTEM 31 | group: AID_SYSTEM 32 | caps: NET_BIND_SERVICE 33 | 34 | [vendor/bin/pd-mapper] 35 | mode: 0755 36 | user: AID_SYSTEM 37 | group: AID_SYSTEM 38 | caps: NET_BIND_SERVICE 39 | 40 | [vendor/bin/imsdatadaemon] 41 | mode: 0755 42 | user: AID_RADIO 43 | group: AID_RADIO 44 | caps: NET_BIND_SERVICE 45 | 46 | [vendor/bin/ims_rtp_daemon] 47 | mode: 0755 48 | user: AID_RADIO 49 | group: AID_RADIO 50 | caps: NET_BIND_SERVICE 51 | 52 | [vendor/bin/imsrcsd] 53 | mode: 0755 54 | user: AID_RADIO 55 | group: AID_RADIO 56 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM 57 | 58 | [vendor/bin/imsdaemon] 59 | mode: 0755 60 | user: AID_RADIO 61 | group: AID_RADIO 62 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM 63 | 64 | [vendor/bin/cnd] 65 | mode: 0755 66 | user: AID_SYSTEM 67 | group: AID_SYSTEM 68 | caps: NET_BIND_SERVICE BLOCK_SUSPEND NET_ADMIN 69 | 70 | [vendor/bin/slim_daemon] 71 | mode: 0755 72 | user: AID_GPS 73 | group: AID_GPS 74 | caps: NET_BIND_SERVICE 75 | 76 | [vendor/bin/loc_launcher] 77 | mode: 0755 78 | user: AID_GPS 79 | group: AID_GPS 80 | caps: SETUID SETGID 81 | 82 | [vendor/bin/xtwifi-client] 83 | mode: 0755 84 | user: AID_GPS 85 | group: AID_GPS 86 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM 87 | 88 | [vendor/bin/sensors.qti] 89 | mode: 0755 90 | user: AID_SYSTEM 91 | group: AID_SYSTEM 92 | caps: NET_BIND_SERVICE 93 | 94 | [vendor/firmware_mnt/image/*] 95 | mode: 0771 96 | user: AID_SYSTEM 97 | group: AID_SYSTEM 98 | caps: 0 99 | -------------------------------------------------------------------------------- /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/gps.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LineageOS/android_device_xiaomi_onclite/bb0a4088a0d5c49d49b2ff415000f9d9bba8ed19/configs/gps/gps.conf -------------------------------------------------------------------------------- /configs/gps/izat.conf: -------------------------------------------------------------------------------- 1 | ######################################### 2 | # Log verbosity control for izat modules 3 | ######################################### 4 | # OFF = 0, ERROR = 1, WARNING = 2, INFO = 3, DEBUG = 4, VERBOSE = 5 5 | IZAT_DEBUG_LEVEL = 2 6 | 7 | ################################################## 8 | # Select WIFI Wait Timeout value in seconds for SUPL 9 | ################################################## 10 | WIFI_WAIT_TIMEOUT_SELECT = 0 11 | 12 | ################################################## 13 | # Time interval of injecting SRN scan data to modem 14 | # time in seconds. 15 | # Note: recommended value is between 1-5 sec 16 | ################################################## 17 | LPPE_SRN_DATA_SCAN_INJECT_TIME=2 18 | 19 | ################################ 20 | # NLP Settings 21 | ################################ 22 | # NLP_MODE 1: OSNLP Only, 2: QNP Only, 3: Combo, 4: QNP preferred 23 | # For Automotive products, please use NLP_MODE = 4 only. 24 | # NLP_TOLERANCE_TIME_FIRST: Time in ms used in Combo mode 25 | # to determine how much Tolerance for first position 26 | # NLP_TOLERANCE_TIME_AFTER: Time in ms used in Combo mode 27 | # to determine how much Tolerance for positions after first 28 | # NLP_THRESHOLD: Sets how many failures needed before 29 | # switching preferred NLP in Combo mode 30 | # NLP_ACCURACY_MULTIPLE: Determines how far off the accuracy 31 | # must be, in multiples, between two NLP location reports to 32 | # be considered much worse accuracy. Used in switching logic 33 | # NLP COMBO MODE USES QNP WITH NO EULA CONSENT: Determines 34 | # whether or not to still send network location requests to 35 | # QNP when the EULA is not consented to by the user. QNP can 36 | # still return ZPP locations or injected locations even 37 | # without EULA consent, but the uncertainty can be high. 38 | # QNP preferred mode prefers QNP when there is EULA consent, 39 | # otherwise OSNLP is used. 40 | NLP_MODE = 1 41 | NLP_MODE_EMERGENCY = 2 42 | NLP_TOLERANCE_TIME_FIRST = 5000 43 | NLP_TOLERANCE_TIME_AFTER = 20000 44 | NLP_THRESHOLD = 3 45 | NLP_ACCURACY_MULTIPLE = 2 46 | NLP_COMBO_MODE_USES_QNP_WITH_NO_EULA_CONSENT = 1 47 | 48 | ######################################### 49 | # NLP PACKAGE SETTINGS 50 | ######################################### 51 | # OSNLP_PACKAGE: name of default NLP package 52 | OSNLP_PACKAGE = com.google.android.gms 53 | # REGION_OSNLP_PACKAGE: 54 | # This value will be used as alternative 55 | # for particular region where default NLP is not functional. 56 | #REGION_OSNLP_PACKAGE = 57 | 58 | ################################### 59 | # GEOFENCE SERVICES 60 | ################################### 61 | # If set to one of the defined values below, it will override 62 | # the responsiveness for geofence services, which implements 63 | # the Proximity Alert API. If not set to a value defined below, 64 | # which is default, it will not override the responsivness. 65 | # The geofence HAL API is unaffected by this value. 66 | # GEOFENCE_SERVICES_RESPONSIVENESS_OVERRIDE Values: 67 | # 1: LOW responsiveness 68 | # 2: MEDIUM responsiveness 69 | # 3: HIGH responsiveness 70 | GEOFENCE_SERVICES_RESPONSIVENESS_OVERRIDE = 0 71 | 72 | ##################################### 73 | #GTP Opt-In app 74 | ##################################### 75 | 76 | #GTP privacy policy version url 77 | #https support is required 78 | GTP_PRIVACY_VERSION_URL = https://info.izatcloud.net/privacy/version.html 79 | 80 | #GTP privacy policy version download retry interval 81 | #unit is second. default is 86400 82 | GTP_PRIVACY_RETRY_INTERVAL = 86400 83 | 84 | ##################################### 85 | # IZAT PREMIUM FEATURE SETTINGS 86 | ##################################### 87 | #Possible states of a feature: 88 | #DISABLED 89 | #BASIC 90 | #PREMIUM 91 | 92 | #GTP_MODE valid modes: 93 | # DISABLED 94 | # LEGACY_WWAN 95 | # SDK (WWAN not available for Modems before LocTech 10.0) 96 | GTP_MODE=DISABLED 97 | 98 | #GTP_WAA valid modes: 99 | # DISABLED 100 | # BASIC 101 | GTP_WAA=DISABLED 102 | 103 | #SAP valid modes: 104 | # DISABLED 105 | # BASIC 106 | # PREMIUM 107 | # MODEM_DEFAULT 108 | SAP=MODEM_DEFAULT 109 | 110 | #FREE_WIFI_SCAN_INJECT valid modes: 111 | #DISABLED 112 | #BASIC 113 | FREE_WIFI_SCAN_INJECT=BASIC 114 | 115 | #SUPL_WIFI valid modes: 116 | #DISABLED 117 | #BASIC 118 | SUPL_WIFI=BASIC 119 | 120 | #WIFI_SUPPLICANT_INFO valid modes: 121 | #DISABLED 122 | #BASIC 123 | WIFI_SUPPLICANT_INFO=BASIC 124 | 125 | ##################################### 126 | # Location process launcher settings 127 | ##################################### 128 | 129 | # DO NOT MODIFY 130 | # Modifying below attributes without 131 | # caution can have serious implications. 132 | 133 | #Values for PROCESS_STATE: 134 | # ENABLED 135 | # DISABLED 136 | 137 | #Values for LOW_RAM_TARGETS: 138 | # ENABLED 139 | # DISABLED 140 | # Property to enable/disable processes for low ram targets. Uses ro.config.low_ram property 141 | # to identify low ram targets. 142 | 143 | #PROCESS_NAME 144 | # Name of the executable file. 145 | 146 | #FEATURE MASKS: 147 | # GTP-WIFI 0X03 148 | # GTP-MP-CELL 0xc00 149 | # GTP-WAA 0x100 150 | # SAP 0Xc0 151 | # ODCPI 0x1000 152 | # FREE_WIFI_SCAN_INJECT 0x2000 153 | # SUPL_WIFI 0x4000 154 | # WIFI_SUPPLICANT_INFO 0x8000 155 | 156 | #Values for PLATFORMS can be: 157 | #1. Any valid values obtained from ro.board.platform separated by single space. For example: msm8960 msm8226 158 | #2. 'all' or 'all exclude' -> for All platforms 159 | #3. 'all exclude XXXX' -> All platforms exclude XXXX. For example: all exclude msm8937 160 | 161 | #Values for SOC_IDS can be: 162 | #1. Any valid values obtained from soc_id node separated by single space. For example: 339 386 436 163 | ## soc_id value can be obtained from any one of below node: 164 | ## - /sys/devices/soc0/soc_id 165 | ## - /sys/devices/system/soc/soc0/id 166 | #2. 'all' or 'all exclude' -> for All soc id's 167 | #3. 'all exclude XXXX' -> All soc id's exclude XXXX. For example: all exclude 339 386 168 | 169 | #Values for BASEBAND can be: 170 | #1. Any valid values obtained from ro.baseband separated by single space. For example: sglte sglte2 171 | #2. 'all' or 'all exclude' -> for all basebands 172 | #3. 'all exclude XXXX' -> All basebands exclude XXXX. For example: all exclude sglte 173 | PROCESS_NAME=lowi-server 174 | PROCESS_ARGUMENT= 175 | PROCESS_STATE=ENABLED 176 | PROCESS_GROUPS=gps wifi inet oem_2901 177 | PREMIUM_FEATURE=0 178 | IZAT_FEATURE_MASK=0xf303 179 | PLATFORMS=all 180 | SOC_IDS=all 181 | BASEBAND=all 182 | LOW_RAM_TARGETS=DISABLED 183 | HARDWARE_TYPE=all 184 | VENDOR_ENHANCED_PROCESS=0 185 | 186 | PROCESS_NAME=xtwifi-inet-agent 187 | PROCESS_ARGUMENT= 188 | PROCESS_STATE=ENABLED 189 | PROCESS_GROUPS=inet gps 190 | PREMIUM_FEATURE=1 191 | IZAT_FEATURE_MASK=0xc03 192 | PLATFORMS=all 193 | SOC_IDS=all exclude 386 436 194 | BASEBAND=all 195 | LOW_RAM_TARGETS=DISABLED 196 | HARDWARE_TYPE=all 197 | VENDOR_ENHANCED_PROCESS=1 198 | 199 | PROCESS_NAME=xtwifi-client 200 | PROCESS_ARGUMENT= 201 | PROCESS_STATE=ENABLED 202 | PROCESS_GROUPS=wifi inet gps system oem_2904 203 | PREMIUM_FEATURE=1 204 | IZAT_FEATURE_MASK=0xd03 205 | PLATFORMS=all 206 | SOC_IDS=all exclude 386 436 207 | BASEBAND=all 208 | LOW_RAM_TARGETS=DISABLED 209 | HARDWARE_TYPE=all 210 | VENDOR_ENHANCED_PROCESS=1 211 | 212 | PROCESS_NAME=slim_daemon 213 | PROCESS_ARGUMENT= 214 | PROCESS_STATE=ENABLED 215 | PROCESS_GROUPS=gps oem_2901 can plugdev diag sensors 216 | PREMIUM_FEATURE=1 217 | IZAT_FEATURE_MASK=0xf0 218 | PLATFORMS=all 219 | SOC_IDS=all exclude 386 436 220 | BASEBAND=all 221 | LOW_RAM_TARGETS=DISABLED 222 | HARDWARE_TYPE=all 223 | VENDOR_ENHANCED_PROCESS=1 224 | 225 | PROCESS_NAME=xtra-daemon 226 | PROCESS_ARGUMENT= 227 | PROCESS_STATE=ENABLED 228 | PROCESS_GROUPS=inet gps system 229 | PREMIUM_FEATURE=0 230 | IZAT_FEATURE_MASK=0 231 | PLATFORMS=all 232 | SOC_IDS=all 233 | BASEBAND=all 234 | LOW_RAM_TARGETS=ENABLED 235 | HARDWARE_TYPE=all 236 | VENDOR_ENHANCED_PROCESS=0 237 | 238 | ######################################## 239 | # Engine Service which host DRE module # 240 | # To enable DRE engine service, change # 241 | # PROCESS_STATE=ENABLED # 242 | ######################################## 243 | PROCESS_NAME=engine-service 244 | PROCESS_ARGUMENT=DRE-INT libloc_epDr.so 245 | PROCESS_STATE=DISABLED 246 | PROCESS_GROUPS=gps diag inet qwes oem_2901 system 247 | PREMIUM_FEATURE=0 248 | IZAT_FEATURE_MASK=0 249 | PLATFORMS=all 250 | SOC_IDS=all 251 | BASEBAND=all 252 | LOW_RAM_TARGETS=DISABLED 253 | HARDWARE_TYPE=all 254 | VENDOR_ENHANCED_PROCESS=1 255 | 256 | ######################################## 257 | # Engine Service which host PPE module # 258 | # To enable PPE engine service, change # 259 | # PROCESS_STATE=ENABLED # 260 | # and update process arugements # 261 | # with PPE library name # 262 | #PROCESS_ARGUMENT=PPE libepsimulator.so# 263 | ######################################## 264 | PROCESS_NAME=engine-service 265 | PROCESS_ARGUMENT=PPE libepsimulator.so 266 | PROCESS_STATE=DISABLED 267 | PROCESS_GROUPS=gps diag inet oem_2901 268 | PREMIUM_FEATURE=0 269 | IZAT_FEATURE_MASK=0 270 | PLATFORMS=all 271 | SOC_IDS=all 272 | BASEBAND=all 273 | LOW_RAM_TARGETS=DISABLED 274 | HARDWARE_TYPE=all 275 | VENDOR_ENHANCED_PROCESS=1 276 | -------------------------------------------------------------------------------- /configs/gps/lowi.conf: -------------------------------------------------------------------------------- 1 | #*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* 2 | # 3 | # LOWI Config file 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/sap.conf: -------------------------------------------------------------------------------- 1 | ################################ 2 | # Sensor Settings 3 | ################################ 4 | #The following parameters are optional. 5 | #Internal defaults support MEMS sensors 6 | #native to most handset devices. 7 | #Device specific sensor characterization 8 | #for improved performance is possible as 9 | #described in SAP application notes. 10 | #GYRO_BIAS_RANDOM_WALK= 11 | #ACCEL_RANDOM_WALK_SPECTRAL_DENSITY= 12 | #ANGLE_RANDOM_WALK_SPECTRAL_DENSITY= 13 | #RATE_RANDOM_WALK_SPECTRAL_DENSITY= 14 | #VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY= 15 | 16 | # Sensor Sampling Rate Parameters for Low-Data Rate Filter (should be greater than 0) 17 | # used in loc_eng_reinit 18 | SENSOR_ACCEL_BATCHES_PER_SEC=2 19 | SENSOR_ACCEL_SAMPLES_PER_BATCH=5 20 | SENSOR_GYRO_BATCHES_PER_SEC=2 21 | SENSOR_GYRO_SAMPLES_PER_BATCH=5 22 | # Sensor Sampling Rate Parameters for High-Data Rate Filter (should be greater than 0) 23 | SENSOR_ACCEL_BATCHES_PER_SEC_HIGH=4 24 | SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH=25 25 | SENSOR_GYRO_BATCHES_PER_SEC_HIGH=4 26 | SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH=25 27 | 28 | # Sensor Control Mode (0=AUTO, 1=FORCE_ON, 2=MODEM_DEFAULT) 29 | # used in loc_eng_reinit 30 | SENSOR_CONTROL_MODE=2 31 | 32 | # Bit mask used to define which sensor algorithms are used. 33 | # Setting each bit has the following definition: 34 | # 0x1 - DISABLE_INS_POSITIONING_FILTER 35 | # 0x0 - ENABLE_INS_POSITIONING_FILTER 36 | SENSOR_ALGORITHM_CONFIG_MASK=0x0 37 | 38 | #Vehicle Network Provider configuration 39 | 40 | #Service configuration strings 41 | #The number before colon in VN_X items defines version of the format of the rest of the string 42 | #VN_ACCEL_CFG=0:5 43 | #VN_GYRO_CFG=0:5.5 44 | #VN_ODOMETRY_CFG=0:2,4.5 45 | 46 | ################################################ 47 | # QDR3 configurations # 48 | ################################################ 49 | VN_SPEED_CFG=1:131,5,8,1,2,3,1,1,9,2,14,2 50 | VN_GEAR_CFG=1:422,20,4,0,4,1,9,0,1,2,3,4,5,6,7,8 51 | 52 | ################################################ 53 | # QDR2-Gyro configurations # 54 | ################################################ 55 | #VN_GYRO_CFG=1:555,0,1,0,0,0,0,-6.5,6.6066,-6.5,-1.00,2,6.607,6.6068,0,0,16,0.0002,0,16,0.0002,0,16,0.0002 56 | #VN_SPEED_CFG=1:555,0,0,1,2,1,0.01,0,56,8,48,8 57 | #VN_GEAR_CFG=1:555,16,4,0,1,1,9,0,1,2,3,4,5,6,7,8 58 | 59 | ################################################ 60 | # QDR2-DWT configurations # 61 | ################################################ 62 | #VN_SPEED_CFG=1:555,22,1,2,1,1,1,0,8,8,23,1,2,0,1,0,8,8,23,1 63 | #VN_GEAR_CFG=1:555,12,4,16,14,16,8,1,2,3,4,5,6,7,8 64 | #VN_DWS_CFG=1:555,0,0,1,3,1,1,0,0,8,0,0,8,8,0,0,16,8,0,0,24,8,0,0 65 | #VN_GYRO_CFG=1:555,40,16,1.0,40,16,1.0,40,16,1.0 66 | 67 | ##################################################################################### 68 | # VNW service batching configuration strings # 69 | # VNW provider will initialize default type as Time based batching # 70 | # Each service batch value is configured to be 100 # 71 | # VN_ACCEL_CFG_BATCH_VALUE will be treated as time in Ms if VN_CFG_BATCH_TYPE # 72 | # is set to time based batching # 73 | # VN_ACCEL_CFG_BATCH_VALUE will be treated as sample count if VN_CFG_BATCH_TYPE # 74 | # is set to count based batching # 75 | # Uncomment and update batch time /sample count as per selected batching type # 76 | ##################################################################################### 77 | # Batching type 78 | # 1 - Time based (default) 79 | # 2 - Count based 80 | #VN_CFG_BATCH_TYPE=1 81 | 82 | #Vehicle Accel batching value, it can either accept time in milli seconds or sample count 83 | #VN_ACCEL_CFG_BATCH_VALUE=100 84 | 85 | #Vehicle Gyro batching value, it can either accept time in milli seconds or sample count 86 | #VN_GYRO_CFG_BATCH_VALUE=100 87 | 88 | #Vehicle Odo batching value, it can either accept time in milli seconds or sample count 89 | #VN_ODOMETRY_CFG_BATCH_VALUE=100 90 | 91 | #Vehicle Speed batching value, it can either accept time in milli seconds or sample count 92 | #VN_SPEED_CFG_BATCH_VALUE=100 93 | 94 | #Vehicle Gear batching value, it can either accept time in milli seconds or sample count 95 | #VN_GEAR_CFG_BATCH_VALUE=100 96 | 97 | #Vehicle DWS batching value, it can either accept time in milli seconds or sample count 98 | #VN_DWS_CFG_BATCH_VALUE=100 99 | #################################################################################### 100 | 101 | #Procesors clock ratio: AP and CAN bus microcontroller 102 | ################################################ 103 | # QDR3 configurations # 104 | ################################################ 105 | VN_PROC_CLOCK_RATIO=1.0 106 | 107 | ################################################ 108 | # QDR2-DWT OR QDR2-Gyro configurations # 109 | ################################################ 110 | #VN_PROC_CLOCK_RATIO = 1.0 111 | 112 | # Time source used by Sensor HAL 113 | # Setting this value controls accuracy of location sensor services. 114 | # 0 - Unknown 115 | # 1 - CLOCK_BOOTTIME 116 | # 2 - CLOCK_MONOTONIC 117 | # 3 - CLOCK_REALTIME 118 | # 4 - CLOCK_BOOTTIME using Alarm timer interface 119 | NDK_PROVIDER_TIME_SOURCE=1 120 | 121 | # Sensor Batching Configuration 122 | # 0 - Time based 123 | # 1 - Fixed count based 124 | # 2 - Variable count based 125 | COUNT_BASED_BATCHING=1 126 | SYNC_ONCE=0 127 | 128 | #Sensor HAL Provider Configuration HAL Library name including path 129 | ################################################ 130 | # # 131 | # Configuration for BMI 160 Sensor # 132 | # # 133 | ################################################ 134 | SENSOR_TYPE=2 135 | SENSOR_HAL_LIB_PATH=/usr/lib/libbmi160sensors.so.1 136 | 137 | ################################################ 138 | # # 139 | # Configuration for ASM330 Sensor # 140 | # # 141 | ################################################ 142 | #SENSOR_TYPE=1 143 | #SENSOR_HAL_LIB_PATH=/usr/lib/libasm330sensors.so.1 144 | 145 | 146 | ################################################ 147 | # # 148 | # Configuration for IAM20680 Sensor # 149 | # # 150 | ################################################ 151 | #SENSOR_TYPE=3 152 | #SENSOR_HAL_LIB_PATH=/usr/lib/libiam20680sensors.so.1 153 | 154 | 155 | ################################################ 156 | # # 157 | # Configuration for SMI130 Sensor # 158 | # # 159 | ################################################ 160 | #SENSOR_TYPE=4 161 | #SENSOR_HAL_LIB_PATH=/usr/lib/libsmi130sensors.so.1 162 | -------------------------------------------------------------------------------- /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/idc/uinput-fpc.idc: -------------------------------------------------------------------------------- 1 | # 2 | # FPC1020 Touch sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | device.internal = 1 12 | 13 | keyboard.layout = uinput-fpc 14 | keyboard.builtIn = 1 15 | keyboard.orientationAware = 1 16 | -------------------------------------------------------------------------------- /configs/idc/uinput-goodix.idc: -------------------------------------------------------------------------------- 1 | # 2 | # FPC1020 Touch sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | device.internal = 1 12 | 13 | keyboard.layout = uinput-goodix 14 | keyboard.builtIn = 1 15 | keyboard.orientationAware = 1 16 | -------------------------------------------------------------------------------- /configs/msm_irqbalance_little_big.conf: -------------------------------------------------------------------------------- 1 | PRIO=1,1,1,1,0,0,0,0 2 | IGNORED_IRQ=20,39 3 | -------------------------------------------------------------------------------- /configs/powerhint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /configs/public.libraries.txt: -------------------------------------------------------------------------------- 1 | libqti-perfd-client.so 2 | libadsprpc.so 3 | libcdsprpc.so 4 | libsdsprpc.so 5 | libfastcvopt.so 6 | liblistensoundmodel2.so 7 | libOpenCL.so 8 | libprotobuf-cpp-full.so 9 | libprotobuf-cpp-lite.so 10 | -------------------------------------------------------------------------------- /configs/qti_whitelist.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /configs/sensors/hals.conf: -------------------------------------------------------------------------------- 1 | sensors.ssc.so 2 | -------------------------------------------------------------------------------- /doze/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // SPDX-FileCopyrightText: 2017-2024 The LineageOS Project 3 | // SPDX-License-Identifier: Apache-2.0 4 | // 5 | 6 | android_app { 7 | name: "XiaomiDoze", 8 | 9 | srcs: ["src/**/*.java"], 10 | resource_dirs: ["res"], 11 | certificate: "platform", 12 | platform_apis: true, 13 | privileged: true, 14 | system_ext_specific: true, 15 | 16 | static_libs: [ 17 | "org.lineageos.settings.resources", 18 | ], 19 | 20 | optimize: { 21 | proguard_flags_files: ["proguard.flags"], 22 | }, 23 | } 24 | -------------------------------------------------------------------------------- /doze/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /doze/proguard.flags: -------------------------------------------------------------------------------- 1 | -keep class org.lineageos.settings.doze.* { 2 | *; 3 | } 4 | -------------------------------------------------------------------------------- /doze/res/xml/doze_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 9 | 10 | 14 | 15 | 20 | 21 | 24 | 25 | 30 | 31 | 32 | 33 | 36 | 37 | 42 | 43 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /doze/src/org/lineageos/settings/doze/BootCompletedReceiver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2015 The CyanogenMod Project 3 | * SPDX-FileCopyrightText: 2017 The LineageOS Project 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | package org.lineageos.settings.doze; 7 | 8 | import android.content.BroadcastReceiver; 9 | import android.content.Context; 10 | import android.content.Intent; 11 | import android.util.Log; 12 | 13 | public class BootCompletedReceiver extends BroadcastReceiver { 14 | 15 | private static final boolean DEBUG = false; 16 | private static final String TAG = "XiaomiDoze"; 17 | 18 | @Override 19 | public void onReceive(final Context context, Intent intent) { 20 | if (DozeUtils.isDozeEnabled(context) && DozeUtils.sensorsEnabled(context)) { 21 | if (DEBUG) Log.d(TAG, "Starting service"); 22 | DozeUtils.checkDozeService(context); 23 | } 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /doze/src/org/lineageos/settings/doze/DozeService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2015 The CyanogenMod Project 3 | * SPDX-FileCopyrightText: 2017-2018,2021 The LineageOS Project 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | package org.lineageos.settings.doze; 7 | 8 | import android.app.Service; 9 | import android.content.BroadcastReceiver; 10 | import android.content.Context; 11 | import android.content.Intent; 12 | import android.content.IntentFilter; 13 | import android.os.IBinder; 14 | import android.util.Log; 15 | 16 | public class DozeService extends Service { 17 | private static final String TAG = "DozeService"; 18 | private static final boolean DEBUG = false; 19 | 20 | private ProximitySensor mProximitySensor; 21 | private TiltSensor mTiltSensor; 22 | 23 | @Override 24 | public void onCreate() { 25 | if (DEBUG) Log.d(TAG, "Creating service"); 26 | mProximitySensor = new ProximitySensor(this); 27 | mTiltSensor = new TiltSensor(this); 28 | 29 | IntentFilter screenStateFilter = new IntentFilter(); 30 | screenStateFilter.addAction(Intent.ACTION_SCREEN_ON); 31 | screenStateFilter.addAction(Intent.ACTION_SCREEN_OFF); 32 | registerReceiver(mScreenStateReceiver, screenStateFilter); 33 | } 34 | 35 | @Override 36 | public int onStartCommand(Intent intent, int flags, int startId) { 37 | if (DEBUG) Log.d(TAG, "Starting service"); 38 | return START_STICKY; 39 | } 40 | 41 | @Override 42 | public void onDestroy() { 43 | if (DEBUG) Log.d(TAG, "Destroying service"); 44 | super.onDestroy(); 45 | this.unregisterReceiver(mScreenStateReceiver); 46 | mProximitySensor.disable(); 47 | mTiltSensor.disable(); 48 | } 49 | 50 | @Override 51 | public IBinder onBind(Intent intent) { 52 | return null; 53 | } 54 | 55 | private void onDisplayOn() { 56 | if (DEBUG) Log.d(TAG, "Display on"); 57 | if (DozeUtils.isPickUpEnabled(this)) { 58 | mTiltSensor.disable(); 59 | } 60 | if (DozeUtils.isHandwaveGestureEnabled(this) || 61 | DozeUtils.isPocketGestureEnabled(this)) { 62 | mProximitySensor.disable(); 63 | } 64 | } 65 | 66 | private void onDisplayOff() { 67 | if (DEBUG) Log.d(TAG, "Display off"); 68 | if (DozeUtils.isPickUpEnabled(this)) { 69 | mTiltSensor.enable(); 70 | } 71 | if (DozeUtils.isHandwaveGestureEnabled(this) || 72 | DozeUtils.isPocketGestureEnabled(this)) { 73 | mProximitySensor.enable(); 74 | } 75 | } 76 | 77 | private BroadcastReceiver mScreenStateReceiver = new BroadcastReceiver() { 78 | @Override 79 | public void onReceive(Context context, Intent intent) { 80 | if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) { 81 | onDisplayOn(); 82 | } else if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) { 83 | onDisplayOff(); 84 | } 85 | } 86 | }; 87 | } 88 | -------------------------------------------------------------------------------- /doze/src/org/lineageos/settings/doze/DozeSettingsActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2015-2016 The CyanogenMod Project 3 | * SPDX-FileCopyrightText: 2017,2021-2022 The LineageOS Project 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | package org.lineageos.settings.doze; 7 | 8 | import android.os.Bundle; 9 | 10 | import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity; 11 | 12 | public class DozeSettingsActivity extends CollapsingToolbarBaseActivity { 13 | 14 | private static final String TAG_DOZE = "doze"; 15 | 16 | @Override 17 | protected void onCreate(Bundle savedInstanceState) { 18 | super.onCreate(savedInstanceState); 19 | 20 | getFragmentManager().beginTransaction().replace( 21 | com.android.settingslib.collapsingtoolbar.R.id.content_frame, 22 | new DozeSettingsFragment(), TAG_DOZE).commit(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /doze/src/org/lineageos/settings/doze/DozeSettingsFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2015 The CyanogenMod Project 3 | * SPDX-FileCopyrightText: 2017-2023 The LineageOS Project 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | package org.lineageos.settings.doze; 7 | 8 | import android.app.Activity; 9 | import android.app.AlertDialog; 10 | import android.app.Dialog; 11 | import android.app.DialogFragment; 12 | import android.content.DialogInterface; 13 | import android.content.SharedPreferences; 14 | import android.os.Bundle; 15 | import android.os.Handler; 16 | import android.widget.CompoundButton; 17 | 18 | import androidx.preference.PreferenceFragment; 19 | import androidx.preference.SwitchPreferenceCompat; 20 | import androidx.preference.Preference; 21 | import androidx.preference.PreferenceCategory; 22 | 23 | import com.android.settingslib.widget.MainSwitchPreference; 24 | 25 | public class DozeSettingsFragment extends PreferenceFragment implements 26 | Preference.OnPreferenceChangeListener, CompoundButton.OnCheckedChangeListener { 27 | 28 | private MainSwitchPreference mSwitchBar; 29 | 30 | private SwitchPreferenceCompat mWakeOnGesturePreference; 31 | private SwitchPreferenceCompat mPickUpPreference; 32 | private SwitchPreferenceCompat mHandwavePreference; 33 | private SwitchPreferenceCompat mPocketPreference; 34 | 35 | private Handler mHandler = new Handler(); 36 | 37 | @Override 38 | public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { 39 | addPreferencesFromResource(R.xml.doze_settings); 40 | 41 | SharedPreferences prefs = getActivity().getSharedPreferences("doze_settings", 42 | Activity.MODE_PRIVATE); 43 | if (savedInstanceState == null && !prefs.getBoolean("first_help_shown", false)) { 44 | showHelp(); 45 | } 46 | 47 | boolean dozeEnabled = DozeUtils.isDozeEnabled(getActivity()); 48 | 49 | mSwitchBar = (MainSwitchPreference) findPreference(DozeUtils.DOZE_ENABLE); 50 | mSwitchBar.addOnSwitchChangeListener(this); 51 | mSwitchBar.setChecked(dozeEnabled); 52 | 53 | mWakeOnGesturePreference = (SwitchPreferenceCompat) findPreference(DozeUtils.WAKE_ON_GESTURE_KEY); 54 | mWakeOnGesturePreference.setEnabled(dozeEnabled); 55 | mWakeOnGesturePreference.setOnPreferenceChangeListener(this); 56 | 57 | PreferenceCategory proximitySensorCategory = 58 | (PreferenceCategory) getPreferenceScreen().findPreference(DozeUtils.CATEG_PROX_SENSOR); 59 | 60 | mPickUpPreference = (SwitchPreferenceCompat) findPreference(DozeUtils.GESTURE_PICK_UP_KEY); 61 | mPickUpPreference.setEnabled(dozeEnabled); 62 | mPickUpPreference.setOnPreferenceChangeListener(this); 63 | 64 | mHandwavePreference = (SwitchPreferenceCompat) findPreference(DozeUtils.GESTURE_HAND_WAVE_KEY); 65 | mHandwavePreference.setEnabled(dozeEnabled); 66 | mHandwavePreference.setOnPreferenceChangeListener(this); 67 | 68 | mPocketPreference = (SwitchPreferenceCompat) findPreference(DozeUtils.GESTURE_POCKET_KEY); 69 | mPocketPreference.setEnabled(dozeEnabled); 70 | mPocketPreference.setOnPreferenceChangeListener(this); 71 | 72 | // Hide proximity sensor related features if the device doesn't support them 73 | if (!DozeUtils.getProxCheckBeforePulse(getActivity())) { 74 | getPreferenceScreen().removePreference(proximitySensorCategory); 75 | } 76 | } 77 | 78 | @Override 79 | public boolean onPreferenceChange(Preference preference, Object newValue) { 80 | mHandler.post(() -> DozeUtils.checkDozeService(getActivity())); 81 | 82 | return true; 83 | } 84 | 85 | @Override 86 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { 87 | DozeUtils.enableDoze(getActivity(), isChecked); 88 | DozeUtils.checkDozeService(getActivity()); 89 | 90 | mSwitchBar.setChecked(isChecked); 91 | 92 | mWakeOnGesturePreference.setEnabled(isChecked); 93 | mPickUpPreference.setEnabled(isChecked); 94 | mHandwavePreference.setEnabled(isChecked); 95 | mPocketPreference.setEnabled(isChecked); 96 | } 97 | 98 | private void showHelp() { 99 | AlertDialog fragment = new AlertDialog.Builder(getActivity()) 100 | .setTitle(R.string.doze_settings_help_title) 101 | .setMessage(R.string.doze_settings_help_text) 102 | .setPositiveButton(R.string.dialog_ok, 103 | (dialog, which) -> { 104 | getActivity() 105 | .getSharedPreferences("doze_settings", Activity.MODE_PRIVATE) 106 | .edit() 107 | .putBoolean("first_help_shown", true) 108 | .commit(); 109 | dialog.cancel(); 110 | }) 111 | .create(); 112 | fragment.show(); 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /doze/src/org/lineageos/settings/doze/DozeUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2015 The CyanogenMod Project 3 | * SPDX-FileCopyrightText: 2017-2022 The LineageOS Project 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | package org.lineageos.settings.doze; 7 | 8 | import android.content.Context; 9 | import android.content.Intent; 10 | import android.content.pm.PackageManager; 11 | import android.os.PowerManager; 12 | import android.os.SystemClock; 13 | import android.os.UserHandle; 14 | import androidx.preference.PreferenceManager; 15 | import android.provider.Settings; 16 | import android.util.Log; 17 | 18 | import static android.provider.Settings.Secure.DOZE_ENABLED; 19 | 20 | public final class DozeUtils { 21 | 22 | private static final String TAG = "DozeUtils"; 23 | private static final boolean DEBUG = false; 24 | 25 | private static final String DOZE_INTENT = "com.android.systemui.doze.pulse"; 26 | 27 | protected static final String DOZE_ENABLE = "doze_enable"; 28 | 29 | protected static final String WAKE_ON_GESTURE_KEY = "wake_on_gesture"; 30 | protected static final String CATEG_PROX_SENSOR = "proximity_sensor"; 31 | 32 | protected static final String GESTURE_PICK_UP_KEY = "gesture_pick_up"; 33 | protected static final String GESTURE_HAND_WAVE_KEY = "gesture_hand_wave"; 34 | protected static final String GESTURE_POCKET_KEY = "gesture_pocket"; 35 | 36 | protected static void startService(Context context) { 37 | if (DEBUG) Log.d(TAG, "Starting service"); 38 | context.startServiceAsUser(new Intent(context, DozeService.class), 39 | UserHandle.CURRENT); 40 | } 41 | 42 | protected static void stopService(Context context) { 43 | if (DEBUG) Log.d(TAG, "Stopping service"); 44 | context.stopServiceAsUser(new Intent(context, DozeService.class), 45 | UserHandle.CURRENT); 46 | } 47 | 48 | protected static void checkDozeService(Context context) { 49 | if (isDozeEnabled(context) && sensorsEnabled(context)) { 50 | startService(context); 51 | } else { 52 | stopService(context); 53 | } 54 | } 55 | 56 | protected static boolean getProxCheckBeforePulse(Context context) { 57 | try { 58 | Context con = context.createPackageContext("com.android.systemui", 0); 59 | int id = con.getResources().getIdentifier("doze_proximity_check_before_pulse", 60 | "bool", "com.android.systemui"); 61 | return con.getResources().getBoolean(id); 62 | } catch (PackageManager.NameNotFoundException e) { 63 | return false; 64 | } 65 | } 66 | 67 | protected static boolean isDozeEnabled(Context context) { 68 | return Settings.Secure.getInt(context.getContentResolver(), 69 | DOZE_ENABLED, 1) != 0; 70 | } 71 | 72 | protected static boolean enableDoze(Context context, boolean enable) { 73 | return Settings.Secure.putInt(context.getContentResolver(), 74 | DOZE_ENABLED, enable ? 1 : 0); 75 | } 76 | 77 | protected static void wakeOrLaunchDozePulse(Context context) { 78 | if (isWakeOnGestureEnabled(context)) { 79 | if (DEBUG) Log.d(TAG, "Wake up display"); 80 | PowerManager powerManager = context.getSystemService(PowerManager.class); 81 | powerManager.wakeUp(SystemClock.uptimeMillis(), PowerManager.WAKE_REASON_GESTURE, TAG); 82 | } else { 83 | if (DEBUG) Log.d(TAG, "Launch doze pulse"); 84 | context.sendBroadcastAsUser( 85 | new Intent(DOZE_INTENT), new UserHandle(UserHandle.USER_CURRENT)); 86 | } 87 | } 88 | 89 | protected static boolean isGestureEnabled(Context context, String gesture) { 90 | return PreferenceManager.getDefaultSharedPreferences(context) 91 | .getBoolean(gesture, false); 92 | } 93 | 94 | protected static boolean isWakeOnGestureEnabled(Context context) { 95 | return isGestureEnabled(context, WAKE_ON_GESTURE_KEY); 96 | } 97 | 98 | protected static boolean isPickUpEnabled(Context context) { 99 | return isGestureEnabled(context, GESTURE_PICK_UP_KEY); 100 | } 101 | 102 | protected static boolean isHandwaveGestureEnabled(Context context) { 103 | return isGestureEnabled(context, GESTURE_HAND_WAVE_KEY); 104 | } 105 | 106 | protected static boolean isPocketGestureEnabled(Context context) { 107 | return isGestureEnabled(context, GESTURE_POCKET_KEY); 108 | } 109 | 110 | protected static boolean sensorsEnabled(Context context) { 111 | return isPickUpEnabled(context) || isHandwaveGestureEnabled(context) 112 | || isPocketGestureEnabled(context); 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /doze/src/org/lineageos/settings/doze/ProximitySensor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2015 The CyanogenMod Project 3 | * SPDX-FileCopyrightText: 2017-2018,2021 The LineageOS Project 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | package org.lineageos.settings.doze; 7 | 8 | import android.content.Context; 9 | import android.hardware.Sensor; 10 | import android.hardware.SensorEvent; 11 | import android.hardware.SensorEventListener; 12 | import android.hardware.SensorManager; 13 | import android.util.Log; 14 | 15 | import java.util.concurrent.ExecutorService; 16 | import java.util.concurrent.Executors; 17 | import java.util.concurrent.Future; 18 | 19 | public class ProximitySensor implements SensorEventListener { 20 | 21 | private static final boolean DEBUG = false; 22 | private static final String TAG = "ProximitySensor"; 23 | 24 | // Maximum time for the hand to cover the sensor: 1s 25 | private static final int HANDWAVE_MAX_DELTA_NS = 1000 * 1000 * 1000; 26 | 27 | // Minimum time until the device is considered to have been in the pocket: 2s 28 | private static final int POCKET_MIN_DELTA_NS = 2000 * 1000 * 1000; 29 | 30 | private SensorManager mSensorManager; 31 | private Sensor mSensor; 32 | private Context mContext; 33 | private ExecutorService mExecutorService; 34 | 35 | private boolean mSawNear = false; 36 | private long mInPocketTime = 0; 37 | 38 | public ProximitySensor(Context context) { 39 | mContext = context; 40 | mSensorManager = mContext.getSystemService(SensorManager.class); 41 | mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY, false); 42 | mExecutorService = Executors.newSingleThreadExecutor(); 43 | } 44 | 45 | private Future submit(Runnable runnable) { 46 | return mExecutorService.submit(runnable); 47 | } 48 | 49 | @Override 50 | public void onSensorChanged(SensorEvent event) { 51 | boolean isNear = event.values[0] < mSensor.getMaximumRange(); 52 | if (mSawNear && !isNear) { 53 | if (shouldPulse(event.timestamp)) { 54 | DozeUtils.wakeOrLaunchDozePulse(mContext); 55 | } 56 | } else { 57 | mInPocketTime = event.timestamp; 58 | } 59 | mSawNear = isNear; 60 | } 61 | 62 | private boolean shouldPulse(long timestamp) { 63 | long delta = timestamp - mInPocketTime; 64 | 65 | if (DozeUtils.isHandwaveGestureEnabled(mContext) && DozeUtils.isPocketGestureEnabled(mContext)) { 66 | return true; 67 | } else if (DozeUtils.isHandwaveGestureEnabled(mContext)) { 68 | return delta < HANDWAVE_MAX_DELTA_NS; 69 | } else if (DozeUtils.isPocketGestureEnabled(mContext)) { 70 | return delta >= POCKET_MIN_DELTA_NS; 71 | } 72 | return false; 73 | } 74 | 75 | @Override 76 | public void onAccuracyChanged(Sensor sensor, int accuracy) { 77 | /* Empty */ 78 | } 79 | 80 | protected void enable() { 81 | if (DEBUG) Log.d(TAG, "Enabling"); 82 | submit(() -> { 83 | mSensorManager.registerListener(this, mSensor, 84 | SensorManager.SENSOR_DELAY_NORMAL); 85 | }); 86 | } 87 | 88 | protected void disable() { 89 | if (DEBUG) Log.d(TAG, "Disabling"); 90 | submit(() -> { 91 | mSensorManager.unregisterListener(this, mSensor); 92 | }); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /doze/src/org/lineageos/settings/doze/TiltSensor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2015 The CyanogenMod Project 3 | * SPDX-FileCopyrightText: 2017-2018,2021 The LineageOS Project 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | package org.lineageos.settings.doze; 7 | 8 | import android.content.Context; 9 | import android.hardware.Sensor; 10 | import android.hardware.SensorEvent; 11 | import android.hardware.SensorEventListener; 12 | import android.hardware.SensorManager; 13 | import android.os.SystemClock; 14 | import android.util.Log; 15 | 16 | import java.util.concurrent.ExecutorService; 17 | import java.util.concurrent.Executors; 18 | import java.util.concurrent.Future; 19 | 20 | public class TiltSensor implements SensorEventListener { 21 | 22 | private static final boolean DEBUG = false; 23 | private static final String TAG = "TiltSensor"; 24 | 25 | private static final int BATCH_LATENCY_IN_MS = 100; 26 | private static final int MIN_PULSE_INTERVAL_MS = 2500; 27 | 28 | private SensorManager mSensorManager; 29 | private Sensor mSensor; 30 | private Context mContext; 31 | private ExecutorService mExecutorService; 32 | 33 | private long mEntryTimestamp; 34 | 35 | public TiltSensor(Context context) { 36 | mContext = context; 37 | mSensorManager = mContext.getSystemService(SensorManager.class); 38 | mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_TILT_DETECTOR); 39 | mExecutorService = Executors.newSingleThreadExecutor(); 40 | } 41 | 42 | private Future submit(Runnable runnable) { 43 | return mExecutorService.submit(runnable); 44 | } 45 | 46 | @Override 47 | public void onSensorChanged(SensorEvent event) { 48 | if (DEBUG) Log.d(TAG, "Got sensor event: " + event.values[0]); 49 | 50 | long delta = SystemClock.elapsedRealtime() - mEntryTimestamp; 51 | if (delta < MIN_PULSE_INTERVAL_MS) { 52 | return; 53 | } else { 54 | mEntryTimestamp = SystemClock.elapsedRealtime(); 55 | } 56 | 57 | if (event.values[0] == 1) { 58 | DozeUtils.wakeOrLaunchDozePulse(mContext); 59 | } 60 | } 61 | 62 | @Override 63 | public void onAccuracyChanged(Sensor sensor, int accuracy) { 64 | /* Empty */ 65 | } 66 | 67 | protected void enable() { 68 | if (DEBUG) Log.d(TAG, "Enabling"); 69 | submit(() -> { 70 | mSensorManager.registerListener(this, mSensor, 71 | SensorManager.SENSOR_DELAY_NORMAL, BATCH_LATENCY_IN_MS * 1000); 72 | mEntryTimestamp = SystemClock.elapsedRealtime(); 73 | }); 74 | } 75 | 76 | protected void disable() { 77 | if (DEBUG) Log.d(TAG, "Disabling"); 78 | submit(() -> { 79 | mSensorManager.unregisterListener(this, mSensor); 80 | }); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /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 | # Required! 11 | export DEVICE=onclite 12 | export VENDOR=xiaomi 13 | 14 | export DEVICE_BRINGUP_YEAR=2019 15 | 16 | # Load extract_utils and do some sanity checks 17 | MY_DIR="${BASH_SOURCE%/*}" 18 | if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi 19 | 20 | ANDROID_ROOT="${MY_DIR}/../../.." 21 | 22 | HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" 23 | if [ ! -f "${HELPER}" ]; then 24 | echo "Unable to find helper script at ${HELPER}" 25 | exit 1 26 | fi 27 | source "${HELPER}" 28 | 29 | # Default to sanitizing the vendor folder before extraction 30 | CLEAN_VENDOR=true 31 | 32 | SECTION= 33 | KANG= 34 | 35 | while [ "${#}" -gt 0 ]; do 36 | case "${1}" in 37 | -n | --no-cleanup ) 38 | CLEAN_VENDOR=false 39 | ;; 40 | -k | --kang ) 41 | KANG="--kang" 42 | ;; 43 | -s | --section ) 44 | SECTION="${2}" 45 | shift 46 | CLEAN_VENDOR=false 47 | ;; 48 | * ) 49 | SRC="${1}" 50 | ;; 51 | esac 52 | shift 53 | done 54 | 55 | if [ -z "${SRC}" ]; then 56 | SRC="adb" 57 | fi 58 | 59 | function blob_fixup() { 60 | case "${1}" in 61 | vendor/lib/hw/camera.msm8953.so) 62 | [ "$2" = "" ] && return 0 63 | grep -q "libui_shim.so" "${2}" || "${PATCHELF}" --add-needed "libui_shim.so" "${2}" 64 | ;; 65 | vendor/lib/lib_lowlight.so) 66 | [ "$2" = "" ] && return 0 67 | "${PATCHELF}" --replace-needed "libstdc++.so" "libstdc++_vendor.so" "${2}" 68 | ;; 69 | vendor/lib64/hw/fingerprint.goodix.default.so | vendor/lib64/libvendor.goodix.hardware.fingerprint@1.0-service.so) 70 | [ "$2" = "" ] && return 0 71 | "${PATCHELF_0_17_2}" --replace-needed "libvendor.goodix.hardware.fingerprint@1.0.so" "vendor.goodix.hardware.fingerprint@1.0.so" "${2}" 72 | ;; 73 | *) 74 | return 1 75 | ;; 76 | esac 77 | return 0 78 | } 79 | 80 | function blob_fixup_dry() { 81 | blob_fixup "$1" "" 82 | } 83 | 84 | setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}" 85 | 86 | extract "${MY_DIR}/proprietary-files.txt" "${SRC}" \ 87 | "${KANG}" --section "${SECTION}" 88 | 89 | "${MY_DIR}/setup-makefiles.sh" 90 | -------------------------------------------------------------------------------- /fastboot-info.txt: -------------------------------------------------------------------------------- 1 | version 1 2 | flash boot 3 | flash dtbo 4 | flash --apply-vbmeta vbmeta 5 | flash recovery 6 | flash system 7 | flash vendor 8 | if-wipe erase cache 9 | if-wipe erase userdata 10 | -------------------------------------------------------------------------------- /framework_compatibility_matrix.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | android.hardware.vibrator 9 | 1.0-3 10 | 11 | IVibrator 12 | default 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /framework_manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | vendor.qti.hardware.radio.atcmdfwd 9 | hwbinder 10 | 1.0 11 | 12 | IAtCmdFwd 13 | AtCmdFwdService 14 | 15 | @1.0::IAtCmdFwd/AtCmdFwdService 16 | 17 | 18 | -------------------------------------------------------------------------------- /keylayout/msm8953-snd-card-mtp_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 | -------------------------------------------------------------------------------- /keylayout/uinput-fpc.kl: -------------------------------------------------------------------------------- 1 | # 2 | # FPC1020 Touch sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | #key 96 DPAD_CENTER 12 | #key 102 HOME 13 | #key 105 DPAD_LEFT 14 | #key 106 DPAD_RIGHT 15 | 16 | -------------------------------------------------------------------------------- /keylayout/uinput-goodix.kl: -------------------------------------------------------------------------------- 1 | # 2 | # Goodix fingerprint sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | #key 96 DPAD_CENTER 11 | #key 96 DPAD_CENTER 12 | #key 102 HOME 13 | #key 105 DPAD_LEFT 14 | #key 106 DPAD_RIGHT 15 | -------------------------------------------------------------------------------- /libinit/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // SPDX-FileCopyrightText: 2023 The LineageOS Project 3 | // SPDX-License-Identifier: Apache-2.0 4 | // 5 | 6 | cc_library_static { 7 | name: "libinit_onclite", 8 | recovery_available: true, 9 | srcs: ["init_onclite.cpp"], 10 | whole_static_libs: ["libbase"], 11 | include_dirs: ["system/core/init"] 12 | } 13 | -------------------------------------------------------------------------------- /libinit/init_onclite.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2023 The LineageOS Project 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include 7 | #define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ 8 | #include 9 | 10 | #include "vendor_init.h" 11 | 12 | // Define variants 13 | #define VARIANT_ONE "Redmi 7" 14 | #define VARIANT_TWO "Redmi Y3" 15 | 16 | using android::base::GetProperty; 17 | 18 | static const std::string ro_props_sources[] = { 19 | "", 20 | "odm.", 21 | "product.", 22 | "system.", 23 | "system_ext.", 24 | "vendor.", 25 | "vendor_dlkm." 26 | }; 27 | 28 | void property_override(const std::string& name, const std::string& value, bool add = true) { 29 | auto pi = const_cast(__system_property_find(name.c_str())); 30 | 31 | if (pi != nullptr) { 32 | __system_property_update(pi, value.c_str(), value.size()); 33 | } else if (add) { 34 | __system_property_add(name.c_str(), name.size(), value.c_str(), value.size()); 35 | } 36 | } 37 | 38 | void set_model_props(const std::string &model) { 39 | // Set device model 40 | for (const std::string &source : ro_props_sources) { 41 | std::string prop = "ro.product." + source + "model"; 42 | property_override(prop, model); 43 | } 44 | // Set bluetooth name 45 | property_override("bluetooth.device.default_name", model); 46 | } 47 | 48 | void set_device_model() { 49 | // Get the hwversion prop 50 | const std::string hwversion = GetProperty("ro.boot.hwversion", ""); 51 | // Only Redmi Y3 has hwversion 1.19.0. 52 | // So set the device model based on it. 53 | if (hwversion == "1.19.0") { 54 | set_model_props(VARIANT_TWO); 55 | } else { 56 | set_model_props(VARIANT_ONE); 57 | } 58 | } 59 | 60 | void vendor_load_properties() { 61 | set_device_model(); 62 | } 63 | -------------------------------------------------------------------------------- /lineage.dependencies: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "repository": "android_hardware_xiaomi", 4 | "target_path": "hardware/xiaomi" 5 | }, 6 | { 7 | "repository": "android_kernel_xiaomi_onclite", 8 | "target_path": "kernel/xiaomi/onclite" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /lineage_onclite.mk: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: 2019-2020 The LineageOS Project 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | # Inherit from those products. Most specific first. 7 | $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) 8 | $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) 9 | $(call inherit-product, $(SRC_TARGET_DIR)/product/product_launched_with_p.mk) 10 | $(call inherit-product, $(SRC_TARGET_DIR)/product/non_ab_device.mk) 11 | 12 | # Inherit from onclite device 13 | $(call inherit-product, device/xiaomi/onclite/device.mk) 14 | 15 | # Inherit some common Lineage stuff. 16 | $(call inherit-product, vendor/lineage/config/common_full_phone.mk) 17 | 18 | # Device identifier. This must come after all inclusions. 19 | PRODUCT_NAME := lineage_onclite 20 | PRODUCT_DEVICE := onclite 21 | PRODUCT_BRAND := Xiaomi 22 | PRODUCT_MODEL := Redmi 7 23 | PRODUCT_MANUFACTURER := Xiaomi 24 | 25 | BUILD_FINGERPRINT := "xiaomi/onc/onc:9/PKQ1.181021.001/V11.0.3.0.PFLMIXM:user/release-keys" 26 | 27 | PRODUCT_BUILD_PROP_OVERRIDES += \ 28 | PRIVATE_BUILD_DESC="onc-user 9 PKQ1.181021.001 V11.0.3.0.PFLMIXM release-keys" 29 | 30 | PRODUCT_GMS_CLIENTID_BASE := android-xiaomi 31 | -------------------------------------------------------------------------------- /overlay-lineage/lineage-sdk/lineage/res/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | true 10 | true 11 | 12 | 53 | 224 54 | 55 | 57 | true 58 | 59 | 60 | true 61 | 62 | -------------------------------------------------------------------------------- /overlay-lineage/packages/apps/Aperture/app/src/main/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | true 9 | 10 | -------------------------------------------------------------------------------- /overlay-lineage/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | true 8 | 4 9 | 10 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 21 | 68.0px 22 | 23 | 25 | 51.0px 26 | 27 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/xml/power_profile.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 75 4 | 320 5 | 6 | 4 7 | 4 8 | 9 | 10 | 614400 11 | 883200 12 | 1036800 13 | 1363200 14 | 1536000 15 | 1670400 16 | 1804800 17 | 18 | 19 | 13 20 | 20 21 | 38 22 | 36 23 | 45 24 | 55 25 | 65 26 | 27 | 28 | 633600 29 | 902400 30 | 1094400 31 | 1401600 32 | 1555200 33 | 1804800 34 | 35 | 36 | 13 37 | 23 38 | 33 39 | 44 40 | 55 41 | 68 42 | 43 | 4 44 | 3 45 | 4000 46 | 40 47 | 2 48 | 2 49 | 1 50 | 100 51 | 30 52 | 22 53 | 80 54 | 121 55 | 400 56 | 100 57 | 140 58 | 45 59 | 60 | 8 61 | 6 62 | 63 | 3300 64 | -------------------------------------------------------------------------------- /overlay/frameworks/base/packages/SystemUI/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 24 | true 25 | 26 | -------------------------------------------------------------------------------- /overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 7dp 21 | 22 | 23 | 7dp 24 | 25 | -------------------------------------------------------------------------------- /overlay/packages/apps/Settings/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 24 | 25 | 0 26 | -1 27 | -1 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /overlay/packages/apps/Settings/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 32 | 3 33 | 34 | -------------------------------------------------------------------------------- /overlay/packages/services/Telephony/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 21 | 22 | 24 | 25 | 27 | 1 28 | 29 | 33 | 34 | true 35 | 36 | 37 | false 38 | 39 | 40 | org.codeaurora.ims 41 | 42 | 43 | org.codeaurora.ims 44 | 45 | -------------------------------------------------------------------------------- /permissions/privapp-permissions-qti.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 23 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /permissions/telephony_system-ext_privapp-permissions-qti.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 29 | 30 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /power/power-mode.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2020 The LineageOS Project 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | #include 6 | #include 7 | #include 8 | 9 | namespace aidl { 10 | namespace android { 11 | namespace hardware { 12 | namespace power { 13 | namespace impl { 14 | 15 | static constexpr int kInputEventWakeupModeOff = 4; 16 | static constexpr int kInputEventWakeupModeOn = 5; 17 | 18 | using ::aidl::android::hardware::power::Mode; 19 | 20 | bool isDeviceSpecificModeSupported(Mode type, bool* _aidl_return) { 21 | switch (type) { 22 | case Mode::DOUBLE_TAP_TO_WAKE: 23 | *_aidl_return = true; 24 | return true; 25 | default: 26 | return false; 27 | } 28 | } 29 | 30 | bool setDeviceSpecificMode(Mode type, bool enabled) { 31 | switch (type) { 32 | case Mode::DOUBLE_TAP_TO_WAKE: { 33 | int fd = open("/dev/input/event2", O_RDWR); 34 | struct input_event ev; 35 | ev.type = EV_SYN; 36 | ev.code = SYN_CONFIG; 37 | ev.value = enabled ? kInputEventWakeupModeOn : kInputEventWakeupModeOff; 38 | write(fd, &ev, sizeof(ev)); 39 | close(fd); 40 | } 41 | return true; 42 | default: 43 | return false; 44 | } 45 | } 46 | 47 | } // namespace impl 48 | } // namespace power 49 | } // namespace hardware 50 | } // namespace android 51 | } // namespace aidl 52 | -------------------------------------------------------------------------------- /product.prop: -------------------------------------------------------------------------------- 1 | # Bluetooth 2 | bluetooth.device.class_of_device=90,2,12 3 | bluetooth.hardware.power.operating_voltage_mv=3300 4 | bluetooth.profile.a2dp.source.enabled?=true 5 | bluetooth.profile.asha.central.enabled?=true 6 | bluetooth.profile.avrcp.target.enabled?=true 7 | bluetooth.profile.bas.client.enabled?=true 8 | bluetooth.profile.gatt.enabled?=true 9 | bluetooth.profile.hfp.ag.enabled?=true 10 | bluetooth.profile.hid.device.enabled?=true 11 | bluetooth.profile.hid.host.enabled?=true 12 | bluetooth.profile.map.server.enabled?=true 13 | bluetooth.profile.opp.enabled?=true 14 | bluetooth.profile.pan.nap.enabled?=true 15 | bluetooth.profile.pan.panu.enabled?=true 16 | bluetooth.profile.pbap.server.enabled?=true 17 | bluetooth.profile.sap.server.enabled?=true 18 | -------------------------------------------------------------------------------- /releasetools.py: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: 2009 The Android Open Source Project 3 | # SPDX-FileCopyrightText: 2011 The Linux Foundation 4 | # SPDX-FileCopyrightText: 2017-2018 The LineageOS Project 5 | # SPDX-License-Identifier: Apache-2.0 6 | # 7 | import hashlib 8 | import common 9 | import re 10 | 11 | def FullOTA_InstallEnd(info): 12 | OTA_InstallEnd(info) 13 | return 14 | 15 | def IncrementalOTA_InstallEnd(info): 16 | OTA_InstallEnd(info) 17 | return 18 | 19 | def AddImage(info, basename, dest): 20 | path = "IMAGES/" + basename 21 | if path not in info.input_zip.namelist(): 22 | return 23 | 24 | data = info.input_zip.read(path) 25 | common.ZipWriteStr(info.output_zip, basename, data) 26 | info.script.Print("Patching {} image unconditionally...".format(dest.split('/')[-1])) 27 | info.script.AppendExtra('package_extract_file("%s", "%s");' % (basename, dest)) 28 | 29 | def OTA_InstallEnd(info): 30 | AddImage(info, "dtbo.img", "/dev/block/bootdevice/by-name/dtbo") 31 | AddImage(info, "vbmeta.img", "/dev/block/bootdevice/by-name/vbmeta") 32 | return 33 | -------------------------------------------------------------------------------- /rootdir/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | # Init scripts 4 | 5 | include $(CLEAR_VARS) 6 | LOCAL_MODULE := fstab.qcom 7 | LOCAL_MODULE_TAGS := optional 8 | LOCAL_MODULE_CLASS := ETC 9 | LOCAL_SRC_FILES := etc/fstab.qcom 10 | LOCAL_REQUIRED_MODULES := fstab.qcom_ramdisk 11 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC) 12 | include $(BUILD_PREBUILT) 13 | 14 | include $(CLEAR_VARS) 15 | LOCAL_MODULE := fstab.qcom_ramdisk 16 | LOCAL_MODULE_STEM := fstab.qcom 17 | LOCAL_MODULE_TAGS := optional 18 | LOCAL_MODULE_CLASS := ETC 19 | LOCAL_SRC_FILES := etc/fstab.qcom 20 | LOCAL_MODULE_PATH := $(TARGET_RAMDISK_OUT) 21 | include $(BUILD_PREBUILT) 22 | 23 | include $(CLEAR_VARS) 24 | LOCAL_MODULE := init.msm.usb.configfs.rc 25 | LOCAL_MODULE_TAGS := optional 26 | LOCAL_MODULE_CLASS := ETC 27 | LOCAL_SRC_FILES := etc/init.msm.usb.configfs.rc 28 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw 29 | include $(BUILD_PREBUILT) 30 | 31 | include $(CLEAR_VARS) 32 | LOCAL_MODULE := init.onclite.rc 33 | LOCAL_MODULE_TAGS := optional 34 | LOCAL_MODULE_CLASS := ETC 35 | LOCAL_SRC_FILES := etc/init.onclite.rc 36 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init 37 | include $(BUILD_PREBUILT) 38 | 39 | include $(CLEAR_VARS) 40 | LOCAL_MODULE := init.qcom.rc 41 | LOCAL_MODULE_TAGS := optional 42 | LOCAL_MODULE_CLASS := ETC 43 | LOCAL_SRC_FILES := etc/init.qcom.rc 44 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw 45 | include $(BUILD_PREBUILT) 46 | 47 | include $(CLEAR_VARS) 48 | LOCAL_MODULE := init.qcom.sh 49 | LOCAL_MODULE_TAGS := optional 50 | LOCAL_MODULE_CLASS := ETC 51 | LOCAL_SRC_FILES := bin/init.qcom.sh 52 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES) 53 | include $(BUILD_PREBUILT) 54 | 55 | include $(CLEAR_VARS) 56 | LOCAL_MODULE := init.recovery.qcom.rc 57 | LOCAL_MODULE_TAGS := optional 58 | LOCAL_MODULE_CLASS := ETC 59 | LOCAL_SRC_FILES := etc/init.recovery.qcom.rc 60 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) 61 | include $(BUILD_PREBUILT) 62 | 63 | include $(CLEAR_VARS) 64 | LOCAL_MODULE := init.target.rc 65 | LOCAL_MODULE_TAGS := optional 66 | LOCAL_MODULE_CLASS := ETC 67 | LOCAL_SRC_FILES := etc/init.target.rc 68 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw 69 | include $(BUILD_PREBUILT) 70 | 71 | 72 | include $(CLEAR_VARS) 73 | LOCAL_MODULE := init.qcom.usb.rc 74 | LOCAL_MODULE_TAGS := optional 75 | LOCAL_MODULE_CLASS := ETC 76 | LOCAL_SRC_FILES := etc/init.qcom.usb.rc 77 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw 78 | include $(BUILD_PREBUILT) 79 | 80 | include $(CLEAR_VARS) 81 | LOCAL_MODULE := ueventd.qcom.rc 82 | LOCAL_MODULE_STEM := ueventd.rc 83 | LOCAL_MODULE_TAGS := optional 84 | LOCAL_MODULE_CLASS := ETC 85 | LOCAL_SRC_FILES := etc/ueventd.qcom.rc 86 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC) 87 | include $(BUILD_PREBUILT) 88 | 89 | # Configuration scripts 90 | 91 | include $(CLEAR_VARS) 92 | LOCAL_MODULE := init.class_main.sh 93 | LOCAL_MODULE_TAGS := optional 94 | LOCAL_MODULE_CLASS := ETC 95 | LOCAL_SRC_FILES := bin/init.class_main.sh 96 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES) 97 | include $(BUILD_PREBUILT) 98 | 99 | include $(CLEAR_VARS) 100 | LOCAL_MODULE := init.qcom.early_boot.sh 101 | LOCAL_MODULE_TAGS := optional 102 | LOCAL_MODULE_CLASS := ETC 103 | LOCAL_SRC_FILES := bin/init.qcom.early_boot.sh 104 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES) 105 | include $(BUILD_PREBUILT) 106 | 107 | include $(CLEAR_VARS) 108 | LOCAL_MODULE := init.qcom.post_boot.sh 109 | LOCAL_MODULE_TAGS := optional 110 | LOCAL_MODULE_CLASS := ETC 111 | LOCAL_SRC_FILES := bin/init.qcom.post_boot.sh 112 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES) 113 | include $(BUILD_PREBUILT) 114 | 115 | -------------------------------------------------------------------------------- /rootdir/bin/init.class_main.sh: -------------------------------------------------------------------------------- 1 | #! /vendor/bin/sh 2 | 3 | # Copyright (c) 2013-2014, 2019 The Linux Foundation. All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of The Linux Foundation nor 13 | # the names of its contributors may be used to endorse or promote 14 | # products derived from this software without specific prior written 15 | # permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 26 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 27 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # 29 | 30 | # 31 | # start ril-daemon only for targets on which radio is present 32 | # 33 | baseband=`getprop ro.baseband` 34 | sgltecsfb=`getprop persist.vendor.radio.sglte_csfb` 35 | datamode=`getprop persist.vendor.data.mode` 36 | low_ram=`getprop ro.config.low_ram` 37 | qcrild_status=true 38 | 39 | case "$baseband" in 40 | "apq" | "sda" | "qcs" ) 41 | setprop ro.vendor.radio.noril yes 42 | stop vendor.ril-daemon 43 | stop vendor.qcrild 44 | esac 45 | 46 | case "$baseband" in 47 | "msm" | "csfb" | "svlte2a" | "mdm" | "mdm2" | "sglte" | "sglte2" | "dsda2" | "unknown" | "dsda3" | "sdm" | "sdx" | "sm6") 48 | 49 | # For older modem packages launch ril-daemon. 50 | if [ -f /vendor/firmware_mnt/verinfo/ver_info.txt ]; then 51 | modem=`cat /vendor/firmware_mnt/verinfo/ver_info.txt | 52 | sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' | 53 | sed 's/.*MPSS.\(.*\)/\1/g' | cut -d \. -f 1` 54 | if [ "$modem" = "AT" ]; then 55 | version=`cat /vendor/firmware_mnt/verinfo/ver_info.txt | 56 | sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' | 57 | sed 's/.*AT.\(.*\)/\1/g' | cut -d \- -f 1` 58 | if [ ! -z $version ]; then 59 | if [ "$version" \< "3.1" ]; then 60 | qcrild_status=false 61 | fi 62 | fi 63 | elif [ "$modem" = "TA" ]; then 64 | version=`cat /vendor/firmware_mnt/verinfo/ver_info.txt | 65 | sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' | 66 | sed 's/.*TA.\(.*\)/\1/g' | cut -d \- -f 1` 67 | if [ ! -z $version ]; then 68 | if [ "$version" \< "3.0" ]; then 69 | qcrild_status=false 70 | fi 71 | fi 72 | elif [ "$modem" = "JO" ]; then 73 | version=`cat /vendor/firmware_mnt/verinfo/ver_info.txt | 74 | sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' | 75 | sed 's/.*JO.\(.*\)/\1/g' | cut -d \- -f 1` 76 | if [ ! -z $version ]; then 77 | if [ "$version" \< "3.2" ]; then 78 | qcrild_status=false 79 | fi 80 | fi 81 | elif [ "$modem" = "TH" ]; then 82 | qcrild_status=false 83 | fi 84 | fi 85 | 86 | if [ "$qcrild_status" = "true" ]; then 87 | # Make sure both rild, qcrild are not running at same time. 88 | # This is possible with vanilla aosp system image. 89 | stop vendor.ril-daemon 90 | 91 | start vendor.qcrild 92 | else 93 | start vendor.ril-daemon 94 | fi 95 | 96 | case "$baseband" in 97 | "svlte2a" | "csfb") 98 | start qmiproxy 99 | ;; 100 | "sglte" | "sglte2" ) 101 | if [ "x$sgltecsfb" != "xtrue" ]; then 102 | start qmiproxy 103 | else 104 | setprop persist.vendor.radio.voice.modem.index 0 105 | fi 106 | ;; 107 | esac 108 | 109 | multisim=`getprop persist.radio.multisim.config` 110 | 111 | if [ "$multisim" = "dsds" ] || [ "$multisim" = "dsda" ]; then 112 | if [ "$qcrild_status" = "true" ]; then 113 | start vendor.qcrild2 114 | else 115 | start vendor.ril-daemon2 116 | fi 117 | elif [ "$multisim" = "tsts" ]; then 118 | if [ "$qcrild_status" = "true" ]; then 119 | start vendor.qcrild2 120 | start vendor.qcrild3 121 | else 122 | start vendor.ril-daemon2 123 | start vendor.ril-daemon3 124 | fi 125 | fi 126 | 127 | case "$datamode" in 128 | "tethered") 129 | start vendor.dataqti 130 | if [ "$low_ram" != "true" ]; then 131 | start vendor.dataadpl 132 | fi 133 | ;; 134 | "concurrent") 135 | start vendor.dataqti 136 | if [ "$low_ram" != "true" ]; then 137 | start vendor.dataadpl 138 | fi 139 | ;; 140 | *) 141 | ;; 142 | esac 143 | esac 144 | 145 | # 146 | # Allow persistent faking of bms 147 | # User needs to set fake bms charge in persist.vendor.bms.fake_batt_capacity 148 | # 149 | fake_batt_capacity=`getprop persist.vendor.bms.fake_batt_capacity` 150 | case "$fake_batt_capacity" in 151 | "") ;; #Do nothing here 152 | * ) 153 | echo "$fake_batt_capacity" > /sys/class/power_supply/battery/capacity 154 | ;; 155 | esac 156 | -------------------------------------------------------------------------------- /rootdir/etc/fstab.qcom: -------------------------------------------------------------------------------- 1 | # Copyright (c) 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 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 | # Android fstab file. 29 | # The filesystem that contains the filesystem checker binary (typically /system) cannot 30 | # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK 31 | 32 | #TODO: Add 'check' as fs_mgr_flags with data partition. 33 | # Currently we dont have e2fsck compiled. So fs check would failed. 34 | 35 | # 36 | /dev/block/bootdevice/by-name/boot /boot emmc defaults recoveryonly 37 | /dev/block/bootdevice/by-name/cache /cache ext4 noatime,nosuid,nodev,barrier=1 wait,check,formattable 38 | /dev/block/bootdevice/by-name/cache /cache f2fs nosuid,nodev,noatime,inline_xattr,flush_merge,data_flush wait,check,formattable 39 | /dev/block/bootdevice/by-name/config /frp emmc defaults defaults 40 | /dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 ro,nosuid,nodev,barrier=1 wait 41 | /dev/block/bootdevice/by-name/misc /misc emmc defaults defaults 42 | /dev/block/bootdevice/by-name/modem /vendor/firmware_mnt vfat ro,shortname=lower,uid=0,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait 43 | /dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 noatime,nosuid,nodev,barrier=1 wait,check 44 | /dev/block/bootdevice/by-name/recovery /recovery emmc defaults recoveryonly 45 | /dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc latemount,wait,check,formattable,fileencryption=ice,quota,reservedsize=128M 46 | /dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,reserve_root=32768,resgid=1065,fsync_mode=nobarrier latemount,wait,check,formattable,fileencryption=ice,quota,reservedsize=128M 47 | /dev/block/by-name/system /system ext4 ro,barrier=1,discard wait,avb,first_stage_mount 48 | /dev/block/by-name/vendor /vendor ext4 ro,barrier=1 wait,first_stage_mount 49 | 50 | /devices/platform/soc/7000000.ssusb/7000000.dwc3/xhci-hcd.0.auto* auto auto defaults wait,voldmanaged=usbotg:auto 51 | /devices/platform/soc/7864900.sdhci/mmc_host* auto auto defaults wait,voldmanaged=sdcard1:auto,noemulatedsd,encryptable=userdata 52 | -------------------------------------------------------------------------------- /rootdir/etc/init.onclite.rc: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2012, 2014-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 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 boot 29 | 30 | # add for goodix 31 | chown system system /dev/goodix_fp 32 | chmod 0644 /dev/goodix_fp 33 | 34 | 35 | # add for fpc 36 | chown system system /sys/devices/platform/soc/soc:fpc1020/compatible_all 37 | chmod 0664 /sys/devices/platform/soc/soc:fpc1020/compatible_all 38 | chown system system /sys/devices/platform/soc/soc:fpc1020/irq 39 | chmod 0660 /sys/devices/platform/soc/soc:fpc1020/irq 40 | chown system system /sys/devices/platform/soc/soc:fpc1020/hw_reset 41 | chmod 0660 /sys/devices/platform/soc/soc:fpc1020/hw_reset 42 | chown system system /sys/devices/platform/soc/soc:fpc1020/wakeup_enable 43 | chmod 0660 /sys/devices/platform/soc/soc:fpc1020/wakeup_enable 44 | chown system system /sys/devices/platform/soc/soc:fpc1020/fingerdown_wait 45 | chmod 0660 /sys/devices/platform/soc/soc:fpc1020/fingerdown_wait 46 | 47 | on post-fs-data 48 | # Create directory for goodix fingerprint 49 | mkdir /data/vendor/goodix 0770 system system 50 | 51 | on property:sys.fp.vendor=goodix 52 | setprop ro.boot.fpsensor goodix 53 | setprop persist.sys.fp.vendor goodix 54 | 55 | on property:sys.fp.vendor=FPC 56 | setprop ro.boot.fpsensor fpc 57 | -------------------------------------------------------------------------------- /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 | write /sys/class/backlight/panel0-backlight/brightness 200 30 | 31 | mkdir /config 32 | mount configfs none /config 33 | mkdir /config/usb_gadget/g1 0770 shell shell 34 | write /config/usb_gadget/g1/bcdUSB 0x0200 35 | write /config/usb_gadget/g1/idVendor 0x18d1 36 | write /config/usb_gadget/g1/idProduct 0xd001 37 | mkdir /config/usb_gadget/g1/strings/0x409 0770 shell shell 38 | write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno} 39 | write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer} 40 | write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model} 41 | mkdir /config/usb_gadget/g1/functions/ffs.adb 42 | write /config/usb_gadget/g1/os_desc/use 1 43 | write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1 44 | write /config/usb_gadget/g1/os_desc/qw_sign "MSFT100" 45 | setprop sys.usb.configfs 1 46 | 47 | on property:ro.boot.usbconfigfs=false 48 | setprop sys.usb.configfs 0 49 | 50 | on property:ro.boot.recover_usb=* 51 | write /sys/bus/platform/devices/a600000.ssusb/mode "peripheral" 52 | 53 | on property:ro.boot.usbcontroller=* 54 | setprop sys.usb.controller ${ro.boot.usbcontroller} 55 | 56 | on property:sys.usb.ffs.ready=1 57 | mkdir /config/usb_gadget/g1/configs/b.1 0777 shell shell 58 | symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1 59 | mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell 60 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb" 61 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1 62 | write /config/usb_gadget/g1/UDC ${sys.usb.controller} 63 | 64 | on fs 65 | wait /dev/block/platform/soc/${ro.boot.bootdevice} 66 | symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice 67 | -------------------------------------------------------------------------------- /rootdir/etc/init.target.rc: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013-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 | on early-init 30 | write /proc/sys/kernel/sched_boost 1 31 | symlink /data/tombstones /tombstones 32 | 33 | on fs 34 | wait /dev/block/platform/soc/${ro.boot.bootdevice} 35 | symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice 36 | mount_all /vendor/etc/fstab.qcom 37 | 38 | chown root system /mnt/vendor/persist 39 | chmod 0771 /mnt/vendor/persist 40 | mkdir /mnt/vendor/persist/data 0700 system system 41 | mkdir /mnt/vendor/persist/bms 0700 root system 42 | restorecon_recursive /mnt/vendor/persist 43 | 44 | on init 45 | write /dev/stune/foreground/schedtune.sched_boost_no_override 1 46 | write /dev/stune/top-app/schedtune.sched_boost_no_override 1 47 | write /dev/stune/schedtune.colocate 0 48 | write /dev/stune/background/schedtune.colocate 0 49 | write /dev/stune/foreground/schedtune.colocate 0 50 | write /dev/stune/top-app/schedtune.colocate 1 51 | write /sys/module/qpnp_rtc/parameters/poweron_alarm 1 52 | 53 | on post-fs 54 | # set RLIMIT_MEMLOCK to 64MB 55 | setrlimit 8 67108864 67108864 56 | start vendor.qseecomd 57 | wait_for_prop vendor.sys.listeners.registered true 58 | write /dev/ipa 1 59 | 60 | on post-fs-data 61 | mkdir /data/tombstones 0771 system system 62 | mkdir /tombstones/modem 0771 system system 63 | mkdir /tombstones/lpass 0771 system system 64 | mkdir /tombstones/wcnss 0771 system system 65 | mkdir /tombstones/dsps 0771 system system 66 | mkdir /persist/data/sfs 0700 system system 67 | mkdir /persist/data/tz 0700 system system 68 | mkdir /persist/qti_fp 0700 system system 69 | mkdir /data/misc/seemp 0700 system system 70 | mkdir /data/misc/audio_pp 0771 media audio 71 | 72 | #Start up peripheral manager 73 | service vendor.per_mgr /vendor/bin/pm-service 74 | class core 75 | user system 76 | group system 77 | ioprio rt 4 78 | task_profiles ServiceCapacityLow 79 | 80 | service vendor.per_proxy /vendor/bin/pm-proxy 81 | class core 82 | user system 83 | group system 84 | disabled 85 | task_profiles ServiceCapacityLow 86 | 87 | on property:init.svc.vendor.per_mgr=running 88 | start vendor.per_proxy 89 | 90 | on property:sys.shutdown.requested=* 91 | stop vendor.per_proxy 92 | 93 | service vendor.qseecomd /vendor/bin/qseecomd 94 | class core 95 | user root 96 | group root 97 | task_profiles ServiceCapacityLow 98 | 99 | service thermal-engine /system/vendor/bin/thermal-engine 100 | class main 101 | user root 102 | socket thermal-send-client stream 0666 system system 103 | socket thermal-recv-client stream 0660 system system 104 | socket thermal-recv-passive-client stream 0666 system system 105 | socket thermal-send-rule stream 0660 system system 106 | group root 107 | task_profiles ServiceCapacityLow 108 | 109 | service adsprpcd /system/vendor/bin/adsprpcd 110 | class main 111 | user media 112 | group media 113 | 114 | service wcnss-service /system/vendor/bin/wcnss_service 115 | class main 116 | user system 117 | group system wifi radio 118 | oneshot 119 | 120 | on property:init.svc.surfaceflinger=stopped 121 | stop ppd 122 | 123 | on property:init.svc.surfaceflinger=running 124 | start ppd 125 | 126 | on property:init.svc.surfaceflinger=restarting 127 | stop ppd 128 | 129 | on property:init.svc.zygote=stopped 130 | stop ppd 131 | 132 | on property:init.svc.zygote=running 133 | start ppd 134 | 135 | on property:init.svc.zygote=restarting 136 | stop ppd 137 | 138 | service energy-awareness /system/vendor/bin/energy-awareness 139 | class main 140 | user root 141 | group system 142 | oneshot 143 | 144 | service vendor.hvdcp_opti /system/vendor/bin/hvdcp_opti 145 | class main 146 | user root 147 | group system wakelock 148 | 149 | on charger 150 | write /sys/devices/system/cpu/cpu2/online 0 151 | write /sys/devices/system/cpu/cpu3/online 0 152 | write /sys/module/lpm_levels/parameters/sleep_disabled 0 153 | wait /dev/block/bootdevice/by-name/system 154 | mount ext4 /dev/block/bootdevice/by-name/system /system ro barrier=1 155 | start vendor.hvdcp_opti 156 | 157 | on boot 158 | chown system system /sys/kernel/hbtp/display_pwr 159 | 160 | # access permission for DT2W 161 | chown system system /dev/input/event2 162 | 163 | # access permission for wlan 164 | chown system system /mnt/vendor/persist/WCNSS_qcom_wlan_nv.bin 165 | 166 | #USB controller configuration 167 | write /sys/module/g_android/parameters/mtp_tx_req_len 131072 168 | write /sys/module/g_android/parameters/mtp_rx_req_len 131072 169 | write /sys/class/android_usb/android0/f_rndis_qc/rndis_transports BAM2BAM_IPA 170 | setprop vendor.usb.rndis.func.name "rndis_bam" 171 | setprop vendor.usb.rmnet.func.name "rmnet_bam" 172 | setprop vendor.usb.rmnet.inst.name "rmnet" 173 | setprop vendor.usb.dpl.inst.name "dpl" 174 | 175 | service ppd /vendor/bin/mm-pp-dpps 176 | class late_start 177 | user system 178 | group system graphics 179 | socket pps stream 0660 system system 180 | disabled 181 | -------------------------------------------------------------------------------- /rro_overlays/OncWifiOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // SPDX-FileCopyrightText: 2023 The LineageOS Project 3 | // SPDX-License-Identifier: Apache-2.0 4 | // 5 | 6 | runtime_resource_overlay { 7 | name: "OncWifiOverlay", 8 | vendor: true 9 | } 10 | -------------------------------------------------------------------------------- /rro_overlays/OncWifiOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 10 | 11 | 18 | 19 | -------------------------------------------------------------------------------- /rro_overlays/OncWifiOverlay/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | Redmi Y3 9 | 10 | -------------------------------------------------------------------------------- /rro_overlays/WifiOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | runtime_resource_overlay { 2 | name: "WifiOverlay", 3 | theme: "WifiOverlay", 4 | sdk_version: "current", 5 | product_specific: true 6 | } 7 | -------------------------------------------------------------------------------- /rro_overlays/WifiOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 21 | 22 | 27 | 28 | -------------------------------------------------------------------------------- /rro_overlays/WifiOverlay/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | true 21 | 22 | 23 | 32 24 | 25 | 26 | false 27 | 28 | 29 | Redmi 7 30 | 31 | 32 | -------------------------------------------------------------------------------- /seccomp_policy/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 | inotify_init1: 1 12 | inotify_add_watch: 1 13 | -------------------------------------------------------------------------------- /sepolicy/vendor/bootanim.te: -------------------------------------------------------------------------------- 1 | allow bootanim sysfs_kgsl:dir { search }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/device.te: -------------------------------------------------------------------------------- 1 | type lirc_device, dev_type; 2 | 3 | # Goodix FP device 4 | type goodix_fp_device, dev_type; 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/file.te: -------------------------------------------------------------------------------- 1 | # Boot reason 2 | type proc_boot_reason, fs_type, proc_type; 3 | 4 | # Camera 5 | type camera_socket, file_type, data_file_type; 6 | 7 | # Fiingerprint Data Files 8 | type fp_data_file, file_type, data_file_type; 9 | type gf_data_file, file_type, data_file_type, core_data_file_type; 10 | 11 | # FPC FP 12 | type sysfs_fpc, sysfs_type, fs_type; 13 | 14 | # Input devices 15 | type idc_file, file_type, vendor_file_type; 16 | type keylayout_file, file_type, vendor_file_type; 17 | 18 | # Rild 19 | type rild_file, file_type, vendor_file_type; 20 | 21 | # Rmt 22 | type debugfs_rmt, debugfs_type, fs_type; 23 | 24 | -------------------------------------------------------------------------------- /sepolicy/vendor/file_contexts: -------------------------------------------------------------------------------- 1 | # Fingerprint Data files 2 | /data/vendor/goodix(/.*)? u:object_r:fp_data_file:s0 3 | /data/vendor/fpc(/.*)? u:object_r:fp_data_file:s0 4 | /data/gf_data(/.*)? u:object_r:gf_data_file:s0 5 | 6 | # FPC FP 7 | /sys/devices/platform/soc/soc:fpc1020(/.*)? u:object_r:sysfs_fpc:s0 8 | 9 | # Goodix FP 10 | /dev/goodix_fp u:object_r:goodix_fp_device:s0 11 | 12 | # HALs 13 | /vendor/bin/hw/android\.hardware\.biometrics\.fingerprint@2\.3-service\.xiaomi u:object_r:hal_fingerprint_default_exec:s0 14 | /(vendor|system/vendor)/bin/hw/android\.hardware\.light-service\.xiaomi u:object_r:hal_light_default_exec:s0 15 | /(vendor|system/vendor)/bin/hw/android\.hardware\.vibrator@1\.3-service\.xiaomi_onclite u:object_r:hal_vibrator_default_exec:s0 16 | 17 | # Input devices 18 | /(vendor|system/vendor)/usr/idc(/.*)? u:object_r:idc_file:s0 19 | /(vendor|system/vendor)/usr/keylayout(/.*)? u:object_r:keylayout_file:s0 20 | 21 | # IR 22 | /dev/spidev6\.1 u:object_r:lirc_device:s0 23 | 24 | # Rild 25 | /(vendor|system/vendor)/radio/qcril_database/qcril.db u:object_r:rild_file:s0 26 | -------------------------------------------------------------------------------- /sepolicy/vendor/genfs_contexts: -------------------------------------------------------------------------------- 1 | # Boot reason 2 | genfscon proc /sys/kernel/boot_reason u:object_r:proc_boot_reason:s0 3 | 4 | # Extcon 5 | genfscon sysfs /devices/platform/soc/200f000.qcom,spmi/spmi-0/spmi0-02/200f000.qcom,spmi:qcom,pmi632@2:qcom,qpnp-smb5/extcon u:object_r:sysfs_extcon:s0 6 | genfscon sysfs /devices/platform/soc/soc:qcom,mdss_wb_panel/extcon u:object_r:sysfs_extcon:s0 7 | 8 | # Rmt 9 | genfscon debugfs /rmt_storage u:object_r:debugfs_rmt:s0 10 | 11 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_audio_default.te: -------------------------------------------------------------------------------- 1 | allow hal_audio_default sysfs:dir { open read}; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_bluetooth_default.te: -------------------------------------------------------------------------------- 1 | typeattribute hal_bluetooth_default data_between_core_and_vendor_violators; 2 | 3 | allow hal_bluetooth_default bluetooth_data_file:dir search; 4 | allow hal_bluetooth_default bluetooth_data_file:file r_file_perms; 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_camera_default.te: -------------------------------------------------------------------------------- 1 | allow hal_camera_default camera_data_file:sock_file write; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_cas_default.te: -------------------------------------------------------------------------------- 1 | vndbinder_use(hal_cas_default); 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_fingerprint_default.te: -------------------------------------------------------------------------------- 1 | typeattribute hal_fingerprint_default data_between_core_and_vendor_violators; 2 | allow hal_fingerprint_default goodix_fp_device:chr_file {ioctl open read write}; 3 | allow hal_fingerprint_default tee_device:chr_file {ioctl open read write}; 4 | allow hal_fingerprint_default hal_fingerprint_default:netlink_socket {read}; 5 | 6 | binder_call(hal_fingerprint_default,hal_perf_default); 7 | allow hal_fingerprint_default hal_perf_hwservice:hwservice_manager find; 8 | 9 | allow hal_fingerprint_default mnt_user_file:dir {search}; 10 | allow hal_fingerprint_default mnt_user_file:lnk_file {read}; 11 | 12 | allow hal_fingerprint_default sysfs_fpc:dir r_dir_perms; 13 | allow hal_fingerprint_default sysfs_fpc:file {ioctl open read write}; 14 | allow hal_fingerprint_default tee_device:chr_file {ioctl open read write}; 15 | 16 | allow hal_fingerprint_default uhid_device:chr_file rw_file_perms; 17 | 18 | vndbinder_use(hal_fingerprint_default); 19 | binder_call(hal_fingerprint_default,goodix_fingerprint_vndservice); 20 | allow hal_fingerprint_default goodix_fingerprint_vndservice:service_manager add; 21 | 22 | allow hal_fingerprint_default self:netlink_socket create_socket_perms_no_ioctl; 23 | 24 | allow hal_fingerprint_default sdcardfs:dir { search }; 25 | 26 | allow hal_fingerprint_default gf_data_file:file create_file_perms; 27 | allow hal_fingerprint_default gf_data_file:dir create_dir_perms; 28 | 29 | allow hal_fingerprint_default storage_file:dir { getattr search }; 30 | allow hal_fingerprint_default storage_file:lnk_file { getattr read }; 31 | 32 | r_dir_file(hal_fingerprint_default, firmware_file) 33 | 34 | set_prop(hal_fingerprint_default, vendor_fp_prop); 35 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_ir_default.te: -------------------------------------------------------------------------------- 1 | allow hal_ir_default lirc_device:chr_file rw_file_perms; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_power_default.te: -------------------------------------------------------------------------------- 1 | # Allow to write in /dev/input/event2 2 | allow hal_power_default input_device:dir search; 3 | allow hal_power_default input_device:chr_file rw_file_perms; 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/hwservice_contexts: -------------------------------------------------------------------------------- 1 | # Fingerprint 2 | com.fingerprints.extension::IFingerprintEngineering u:object_r:hal_fingerprint_hwservice:s0 3 | com.fingerprints.extension::IFingerprintNavigation u:object_r:hal_fingerprint_hwservice:s0 4 | com.fingerprints.extension::IFingerprintSensorTest u:object_r:hal_fingerprint_hwservice:s0 5 | vendor.goodix.hardware.fingerprint::IGoodixBiometricsFingerprint u:object_r:hal_fingerprint_hwservice:s0 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/init.te: -------------------------------------------------------------------------------- 1 | allow init proc_boot_reason:file r_file_perms; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/kernel.te: -------------------------------------------------------------------------------- 1 | allow kernel kernel:capability { kill }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/netmgrd.te: -------------------------------------------------------------------------------- 1 | set_prop(netmgrd, vendor_xlat_prop) 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/property.te: -------------------------------------------------------------------------------- 1 | # Fingerprint 2 | vendor_public_prop(vendor_fp_prop) 3 | 4 | # Thermal-Engine 5 | vendor_internal_prop(thermal_engine_prop) 6 | 7 | # Wifi 8 | vendor_internal_prop(vendor_wifi_config) 9 | 10 | -------------------------------------------------------------------------------- /sepolicy/vendor/property_contexts: -------------------------------------------------------------------------------- 1 | sys.listeners.registered u:object_r:vendor_tee_listener_prop:s0 2 | sys.post_boot.parsed u:object_r:vendor_mpctl_prop:s0 3 | persist.net.doxlat u:object_r:vendor_xlat_prop:s0 4 | 5 | # Camera 6 | camera.dual.mode u:object_r:camera_prop:s0 7 | persist.camera. u:object_r:camera_prop:s0 8 | persist.vendor.camera. u:object_r:camera_prop:s0 9 | persist.vendor.vidhance. u:object_r:camera_prop:s0 10 | 11 | # Fingerprint 12 | sys.fp.goodix u:object_r:vendor_fp_prop:s0 13 | sys.fp.vendor u:object_r:vendor_fp_prop:s0 14 | persist.sys.fp. u:object_r:vendor_fp_prop:s0 15 | persist.vendor.sys.fp. u:object_r:vendor_fp_prop:s0 16 | 17 | # Thermal-Engine 18 | persist.sys.thermal. u:object_r:thermal_engine_prop:s0 19 | sys.thermal. u:object_r:thermal_engine_prop:s0 20 | 21 | # Wifi 22 | vendor.wlan.driver.config u:object_r:vendor_wifi_config:s0 23 | -------------------------------------------------------------------------------- /sepolicy/vendor/qti_init_shell.te: -------------------------------------------------------------------------------- 1 | typeattribute qti_init_shell data_between_core_and_vendor_violators; 2 | 3 | allow qti_init_shell proc_boot_reason:file { open read }; 4 | allow qti_init_shell bluetooth_data_file:file r_file_perms; 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/radio.te: -------------------------------------------------------------------------------- 1 | allow radio hal_datafactory_hwservice:hwservice_manager find; 2 | 3 | binder_call(radio, cnd) 4 | 5 | get_prop(radio, vendor_qcom_ims_prop) 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/rild.te: -------------------------------------------------------------------------------- 1 | allow rild rild_file:file r_file_perms; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/rmt_storage.te: -------------------------------------------------------------------------------- 1 | # debugfs access 2 | userdebug_or_eng(` 3 | allow rmt_storage debugfs_rmt:dir search; 4 | allow rmt_storage debugfs_rmt:file rw_file_perms; 5 | ') 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/system_app.te: -------------------------------------------------------------------------------- 1 | allow system_app fm_radio_device:chr_file r_file_perms; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/system_server.te: -------------------------------------------------------------------------------- 1 | typeattribute system_server system_executes_vendor_violators; 2 | 3 | # Input devices 4 | r_dir_file(system_server, idc_file); 5 | r_dir_file(system_server, keylayout_file); 6 | 7 | # Fingerprint 8 | get_prop(system_server, vendor_fp_prop); 9 | -------------------------------------------------------------------------------- /sepolicy/vendor/tee.te: -------------------------------------------------------------------------------- 1 | typeattribute tee data_between_core_and_vendor_violators; 2 | allow tee fp_data_file:dir rw_dir_perms; 3 | allow tee fp_data_file:file create_file_perms; 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/thermal-engine.te: -------------------------------------------------------------------------------- 1 | allow thermal-engine sysfs:dir { open read }; 2 | allow thermal-engine property_socket:sock_file { write }; 3 | allow thermal-engine init:unix_stream_socket {connectto }; 4 | set_prop(thermal-engine, thermal_engine_prop) 5 | 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/ueventd.te: -------------------------------------------------------------------------------- 1 | typeattribute ueventd data_between_core_and_vendor_violators; 2 | 3 | allow ueventd wifi_vendor_data_file:dir r_dir_perms; 4 | allow ueventd wifi_vendor_data_file:file r_file_perms; 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_init.te: -------------------------------------------------------------------------------- 1 | typeattribute vendor_init data_between_core_and_vendor_violators; 2 | 3 | allow vendor_init { 4 | bluetooth_data_file 5 | camera_data_file 6 | media_rw_data_file 7 | nfc_data_file 8 | system_data_file 9 | wifi_data_file 10 | wpa_socket 11 | }:dir { create search getattr open read setattr ioctl write add_name remove_name rmdir relabelfrom }; 12 | 13 | allow vendor_init vendor_fm_prop:file { getattr open read }; 14 | -------------------------------------------------------------------------------- /sepolicy/vendor/vndservice.te: -------------------------------------------------------------------------------- 1 | type goodix_fingerprint_vndservice, vndservice_manager_type; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/vndservice_contexts: -------------------------------------------------------------------------------- 1 | android.hardware.fingerprint.IGoodixFingerprintDaemon u:object_r:goodix_fingerprint_vndservice:s0 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/wcnss_service.te: -------------------------------------------------------------------------------- 1 | allow wcnss_service property_socket:sock_file { write }; 2 | allow wcnss_service init:unix_stream_socket { connectto }; 3 | set_prop(wcnss_service, vendor_wifi_config) 4 | 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 | # Required! 11 | export DEVICE=onclite 12 | export VENDOR=xiaomi 13 | 14 | export DEVICE_BRINGUP_YEAR=2019 15 | 16 | # Load extract_utils and do some sanity checks 17 | MY_DIR="${BASH_SOURCE%/*}" 18 | if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi 19 | 20 | ANDROID_ROOT="${MY_DIR}/../../.." 21 | 22 | HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" 23 | if [ ! -f "${HELPER}" ]; then 24 | echo "Unable to find helper script at ${HELPER}" 25 | exit 1 26 | fi 27 | source "${HELPER}" 28 | 29 | # Initialize the helper for common 30 | setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false 31 | 32 | # Copyright headers and guards 33 | write_headers "onclite" 34 | 35 | # The standard common blobs 36 | write_makefiles "${MY_DIR}/proprietary-files.txt" true 37 | 38 | # Finish 39 | write_footers 40 | -------------------------------------------------------------------------------- /system.prop: -------------------------------------------------------------------------------- 1 | # Audio 2 | af.fast_track_multiplier=1 3 | audio.deep_buffer.media=true 4 | audio.offload.min.duration.secs=30 5 | audio.offload.video=true 6 | ro.af.client_heap_size_kbyte=7168 7 | 8 | # Bluetooth 9 | vendor.bluetooth.soc=pronto 10 | 11 | # Camera 12 | persist.vendor.camera.expose.aux=1 13 | vendor.camera.aux.packagelist=org.codeaurora.snapcam,com.android.camera,com.qualcomm.qti.qmmi,com.longcheertel.cit 14 | vendor.camera.lowpower.record.enable=1 15 | vidc.enc.dcvs.extra-buff-count=2 16 | 17 | # Charger 18 | ro.charger.disable_init_blank=true 19 | ro.charger.enable_suspend=true 20 | 21 | # CnE 22 | persist.vendor.cne.feature=1 23 | 24 | # Data modules 25 | persist.vendor.data.mode=concurrent 26 | ro.vendor.use_data_netmgrd=true 27 | 28 | # Graphics 29 | debug.sf.disable_backpressure=1 30 | debug.sf.enable_hwc_vds=1 31 | debug.sf.hw=0 32 | persist.demo.hdmirotationlock=false 33 | ro.surface_flinger.force_hwc_copy_for_virtual_displays=true 34 | ro.surface_flinger.max_virtual_display_dimension=4096 35 | vendor.display.disable_skip_validate=1 36 | 37 | # Media 38 | media.stagefright.thumbnail.prefer_hw_codecs=true 39 | vendor.mm.enable.qcom_parser=1048575 40 | vendor.vidc.dec.downscalar_height=1088 41 | vendor.vidc.dec.downscalar_width=1920 42 | vendor.vidc.enc.disable_bframes=1 43 | vendor.video.disable.ubwc=1 44 | 45 | # QC framework value-adds 46 | ro.vendor.qti.va_aosp.support=1 47 | 48 | # Radio 49 | DEVICE_PROVISIONED=1 50 | ril.subscription.types=NV,RUIM 51 | rild.libargs=-d /dev/smd0 52 | ro.telephony.default_network=22,22 53 | telephony.lteOnCdmaDevice=1 54 | 55 | # WFD 56 | persist.debug.wfd.enable=1 57 | -------------------------------------------------------------------------------- /system_ext.prop: -------------------------------------------------------------------------------- 1 | # Dalvik 2 | dalvik.vm.dex2oat64.enabled=true 3 | 4 | # DPM 5 | persist.vendor.dpm.feature=11 6 | 7 | # Telephony 8 | # Disable handling audio direction changes on IMS calls. 9 | ro.telephony.handle_audio_direction_changes_between_call_state_changes=false 10 | 11 | -------------------------------------------------------------------------------- /update-sha1sums.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # SPDX-FileCopyrightText: 2016 The CyanogenMod Project 4 | # SPDX-FileCopyrightText: 2017-2018 The LineageOS Project 5 | # SPDX-License-Identifier: Apache-2.0 6 | # 7 | from hashlib import sha1 8 | import sys 9 | 10 | device='onclite' 11 | vendor='xiaomi' 12 | 13 | lines = [ line for line in open('proprietary-files.txt', 'r') ] 14 | vendorPath = '../../../vendor/' + vendor + '/' + device + '/proprietary' 15 | needSHA1 = False 16 | 17 | def cleanup(): 18 | for index, line in enumerate(lines): 19 | # Remove '\n' character 20 | line = line[:-1] 21 | 22 | # Skip empty or commented lines 23 | if len(line) == 0 or line[0] == '#': 24 | continue 25 | 26 | # Drop SHA1 hash, if existing 27 | if '|' in line: 28 | line = line.split('|')[0] 29 | lines[index] = '%s\n' % (line) 30 | 31 | def update(): 32 | for index, line in enumerate(lines): 33 | # Remove '\n' character 34 | line = line[:-1] 35 | 36 | # Skip empty lines 37 | if len(line) == 0: 38 | continue 39 | 40 | # Check if we need to set SHA1 hash for the next files 41 | if line[0] == '#': 42 | needSHA1 = (' - from' in line) 43 | continue 44 | 45 | if needSHA1: 46 | # Remove existing SHA1 hash 47 | line = line.split('|')[0] 48 | filePath = line.split(':')[1] if len(line.split(':')) == 2 else line 49 | 50 | if filePath[0] == '-': 51 | file = open('%s/%s' % (vendorPath, filePath[1:]), 'rb').read() 52 | else: 53 | file = open('%s/%s' % (vendorPath, filePath), 'rb').read() 54 | 55 | hash = sha1(file).hexdigest() 56 | lines[index] = '%s|%s\n' % (line, hash) 57 | 58 | if len(sys.argv) == 2 and sys.argv[1] == '-c': 59 | cleanup() 60 | else: 61 | update() 62 | 63 | with open('proprietary-files.txt', 'w') as file: 64 | for line in lines: 65 | file.write(line) 66 | 67 | file.close() 68 | -------------------------------------------------------------------------------- /vendor.prop: -------------------------------------------------------------------------------- 1 | # Audio 2 | persist.vendor.audio.fluence.speaker=true 3 | persist.vendor.audio.fluence.voicecall=true 4 | persist.vendor.audio.fluence.voicerec=false 5 | ro.vendor.audio.sdk.fluencetype=fluence 6 | vendor.audio.offload.buffer.size.kb=64 7 | vendor.audio.offload.gapless.enabled=true 8 | vendor.audio.offload.multiple.enabled=false 9 | vendor.audio.offload.track.enable=true 10 | vendor.audio.playback.mch.downsample=true 11 | vendor.audio.pp.asphere.enabled=false 12 | vendor.audio.safx.pbe.enabled=true 13 | vendor.audio.tunnel.encode=false 14 | vendor.audio.use.sw.alac.decoder=true 15 | vendor.audio.use.sw.ape.decoder=true 16 | vendor.audio_hal.period_size=192 17 | vendor.voice.conc.fallbackpath=deep-buffer 18 | vendor.voice.path.for.pcm.voip=true 19 | vendor.voice.playback.conc.disabled=true 20 | vendor.voice.record.conc.disabled=false 21 | vendor.voice.voip.conc.disabled=true 22 | 23 | # Bluetooth 24 | vendor.qcom.bluetooth.soc=pronto 25 | 26 | # Camera 27 | persist.vendor.camera.expose.aux=1 28 | 29 | # Chipset 30 | ro.soc.manufacturer=Qualcomm 31 | ro.soc.model=SDM450 32 | 33 | # Crypto 34 | ro.crypto.volume.contents_mode=ice 35 | ro.crypto.volume.filenames_mode=aes-256-cts 36 | 37 | # Display post-processing 38 | ro.surface_flinger.enable_frame_rate_override=false 39 | ro.vendor.display.cabl=0 40 | ro.vendor.display.sensortype=2 41 | 42 | # DPM 43 | persist.vendor.dpmhalservice.enable=1 44 | 45 | # DRM 46 | drm.service.enabled=true 47 | 48 | # FRP 49 | ro.frp.pst=/dev/block/bootdevice/by-name/config 50 | 51 | # Graphics 52 | ro.hardware.egl=adreno 53 | ro.opengles.version=196610 54 | 55 | # IMS 56 | persist.dbg.volte_avail_ovr=1 57 | persist.dbg.vt_avail_ovr=1 58 | persist.dbg.wfc_avail_ovr=1 59 | 60 | # Keystore 61 | ro.hardware.keystore_desede=true 62 | 63 | # Media 64 | debug.stagefright.omx_default_rank.sw-audio=1 65 | debug.stagefright.omx_default_rank=0 66 | vendor.vidc.disable.split.mode=1 67 | vendor.vidc.enc.disable.pq=true 68 | 69 | # Perf 70 | ro.vendor.extension_library=libqti-perfd-client.so 71 | 72 | # Radio 73 | persist.radio.multisim.config=dsds 74 | persist.vendor.radio.apm_sim_not_pwdn=1 75 | persist.vendor.radio.custom_ecc=1 76 | persist.vendor.radio.data_con_rprt=1 77 | persist.vendor.radio.hw_mbn_update=0 78 | persist.vendor.radio.procedure_bytes=SKIP 79 | persist.vendor.radio.rat_on=combine 80 | persist.vendor.radio.redir_party_num=1 81 | persist.vendor.radio.report_codec=1 82 | persist.vendor.radio.sib16_support=1 83 | persist.vendor.radio.start_ota_daemon=1 84 | persist.vendor.radio.sw_mbn_update=0 85 | vendor.rild.libpath=/vendor/lib64/libril-qc-qmi-1.so 86 | 87 | # Zygote 88 | zygote.critical_window.minute=10 89 | -------------------------------------------------------------------------------- /vibrator/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2019 The Android Open Source Project 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | cc_binary { 17 | name: "android.hardware.vibrator@1.3-service.xiaomi_onclite", 18 | vendor: true, 19 | relative_install_path: "hw", 20 | init_rc: ["android.hardware.vibrator@1.3-service.xiaomi_onclite.rc"], 21 | vintf_fragments: ["android.hardware.vibrator@1.3-service.xiaomi_onclite.xml"], 22 | srcs: ["service.cpp", "Vibrator.cpp"], 23 | cflags: ["-Wall", "-Werror"], 24 | shared_libs: [ 25 | "libbase", 26 | "libhidlbase", 27 | "liblog", 28 | "libutils", 29 | "android.hardware.vibrator@1.0", 30 | "android.hardware.vibrator@1.1", 31 | "android.hardware.vibrator@1.2", 32 | "android.hardware.vibrator@1.3", 33 | ], 34 | } 35 | -------------------------------------------------------------------------------- /vibrator/OWNERS: -------------------------------------------------------------------------------- 1 | eliptus@google.com 2 | michaelwr@google.com 3 | -------------------------------------------------------------------------------- /vibrator/Vibrator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #define LOG_TAG "VibratorService" 18 | 19 | #include 20 | #include 21 | 22 | #include "Vibrator.h" 23 | 24 | namespace android { 25 | namespace hardware { 26 | namespace vibrator { 27 | namespace V1_3 { 28 | namespace implementation { 29 | 30 | static const std::string kLedVibDeviceDir = "/sys/class/leds/vibrator/"; 31 | static const std::string kLedVibDeviceActivateFile = kLedVibDeviceDir + "activate"; 32 | static const std::string kLedVibDeviceDurationFile = kLedVibDeviceDir + "duration"; 33 | static const std::string kLedVibDeviceStateFile = kLedVibDeviceDir + "state"; 34 | static const std::string kLedVibDeviceVmaxMvFile = kLedVibDeviceDir + "vmax_mv"; 35 | 36 | static constexpr uint32_t QPNP_VIB_LDO_VMIN_MV = 1504; 37 | static constexpr uint32_t QPNP_VIB_LDO_VMAX_MV = 3544; 38 | static constexpr uint32_t MV_ADDITION_MAX = QPNP_VIB_LDO_VMAX_MV - QPNP_VIB_LDO_VMIN_MV; 39 | 40 | Vibrator::Vibrator() {} 41 | 42 | // Methods from ::android::hardware::vibrator::V1_0::IVibrator follow. 43 | 44 | Return Vibrator::on(uint32_t timeoutMs) { 45 | mHasEffect = false; 46 | return enable(true, timeoutMs); 47 | } 48 | 49 | Return Vibrator::off() { 50 | if (mHasEffect) 51 | return Status::OK; 52 | else 53 | return enable(false, 0); 54 | } 55 | 56 | Return Vibrator::supportsAmplitudeControl() { 57 | return true; 58 | } 59 | 60 | Return Vibrator::setAmplitude(uint8_t amplitude) { 61 | if (amplitude < 0) { 62 | return Status::BAD_VALUE; 63 | } 64 | 65 | uint32_t mv_addition = amplitude * MV_ADDITION_MAX / 0xFF; 66 | uint32_t mv = QPNP_VIB_LDO_VMIN_MV + mv_addition; 67 | if (!android::base::WriteStringToFile(std::to_string(mv), kLedVibDeviceVmaxMvFile)) { 68 | ALOGE("Failed to set amplitude!"); 69 | return Status::UNKNOWN_ERROR; 70 | } 71 | 72 | ALOGI("Amplitude: %u -> %u, mv = %u, mv_addition = %u\n", 73 | mAmplitude, amplitude, mv, mv_addition); 74 | mAmplitude = amplitude; 75 | return Status::OK; 76 | } 77 | 78 | Return Vibrator::perform(V1_0::Effect effect, EffectStrength strength, perform_cb _hidl_cb) { 79 | return perform(effect, strength, _hidl_cb); 80 | } 81 | 82 | // Methods from ::android::hardware::vibrator::V1_1::IVibrator follow. 83 | 84 | Return Vibrator::perform_1_1(V1_1::Effect_1_1 effect, EffectStrength strength, 85 | perform_cb _hidl_cb) { 86 | return perform(effect, strength, _hidl_cb); 87 | } 88 | 89 | // Methods from ::android::hardware::vibrator::V1_2::IVibrator follow. 90 | 91 | Return Vibrator::perform_1_2(V1_2::Effect effect, EffectStrength strength, 92 | perform_cb _hidl_cb) { 93 | return perform(effect, strength, _hidl_cb); 94 | } 95 | 96 | // Methods from ::android::hardware::vibrator::V1_3::IVibrator follow. 97 | 98 | Return Vibrator::supportsExternalControl() { 99 | return true; 100 | } 101 | 102 | Return Vibrator::setExternalControl(bool enabled) { 103 | ALOGI("ExternalControl: %s -> %s\n", mExternalControl ? "true" : "false", 104 | enabled ? "true" : "false"); 105 | mExternalControl = enabled; 106 | return Status::OK; 107 | } 108 | 109 | Return Vibrator::perform_1_3(Effect effect, EffectStrength strength, perform_cb _hidl_cb) { 110 | return perform(effect, strength, _hidl_cb); 111 | } 112 | 113 | // Private methods follow. 114 | 115 | Return Vibrator::perform(Effect effect, EffectStrength strength, perform_cb _hidl_cb) { 116 | uint8_t amplitude; 117 | uint32_t ms; 118 | Status status = Status::OK; 119 | 120 | ALOGI("Perform: Effect %s\n", effectToName(effect).c_str()); 121 | mHasEffect = true; 122 | 123 | amplitude = strengthToAmplitude(strength, &status); 124 | if (status != Status::OK) { 125 | _hidl_cb(status, 0); 126 | return Void(); 127 | } 128 | setAmplitude(amplitude); 129 | 130 | ms = effectToMs(effect, &status); 131 | ALOGI("ms = %u", ms); 132 | if (status != Status::OK) { 133 | _hidl_cb(status, 0); 134 | return Void(); 135 | } 136 | status = enable(true, ms); 137 | 138 | _hidl_cb(status, ms); 139 | 140 | return Void(); 141 | } 142 | 143 | template 144 | Return Vibrator::perform(T effect, EffectStrength strength, perform_cb _hidl_cb) { 145 | auto validRange = hidl_enum_range(); 146 | if (effect < *validRange.begin() || effect > *std::prev(validRange.end())) { 147 | _hidl_cb(Status::UNSUPPORTED_OPERATION, 0); 148 | return Void(); 149 | } 150 | return perform(static_cast(effect), strength, _hidl_cb); 151 | } 152 | 153 | Status Vibrator::enable(bool enabled, uint32_t ms) { 154 | if (mExternalControl) { 155 | ALOGW("Enabling/disabling while the vibrator is externally controlled is unsupported!"); 156 | return Status::UNSUPPORTED_OPERATION; 157 | } else { 158 | if (!android::base::WriteStringToFile(enabled ? "1" : "0", kLedVibDeviceStateFile) || 159 | !android::base::WriteStringToFile(std::to_string(ms), kLedVibDeviceDurationFile) || 160 | !android::base::WriteStringToFile(enabled ? "1" : "0", kLedVibDeviceActivateFile)) { 161 | ALOGE("Failed to enable vibration!"); 162 | return Status::UNKNOWN_ERROR; 163 | } 164 | return Status::OK; 165 | } 166 | } 167 | 168 | const std::string Vibrator::effectToName(Effect effect) { 169 | return toString(effect); 170 | } 171 | 172 | uint32_t Vibrator::effectToMs(Effect effect, Status* status) { 173 | switch (effect) { 174 | case Effect::CLICK: 175 | return 10; 176 | case Effect::DOUBLE_CLICK: 177 | return 15; 178 | case Effect::TICK: 179 | case Effect::TEXTURE_TICK: 180 | return 5; 181 | case Effect::THUD: 182 | return 5; 183 | case Effect::POP: 184 | return 5; 185 | case Effect::HEAVY_CLICK: 186 | return 10; 187 | case Effect::RINGTONE_1: 188 | return 30000; 189 | case Effect::RINGTONE_2: 190 | return 30000; 191 | case Effect::RINGTONE_3: 192 | return 30000; 193 | case Effect::RINGTONE_4: 194 | return 30000; 195 | case Effect::RINGTONE_5: 196 | return 30000; 197 | case Effect::RINGTONE_6: 198 | return 30000; 199 | case Effect::RINGTONE_7: 200 | return 30000; 201 | case Effect::RINGTONE_8: 202 | return 30000; 203 | case Effect::RINGTONE_9: 204 | return 30000; 205 | case Effect::RINGTONE_10: 206 | return 30000; 207 | case Effect::RINGTONE_11: 208 | return 30000; 209 | case Effect::RINGTONE_12: 210 | return 30000; 211 | case Effect::RINGTONE_13: 212 | return 30000; 213 | case Effect::RINGTONE_14: 214 | return 30000; 215 | case Effect::RINGTONE_15: 216 | return 30000; 217 | } 218 | *status = Status::UNSUPPORTED_OPERATION; 219 | return 0; 220 | } 221 | 222 | uint8_t Vibrator::strengthToAmplitude(EffectStrength strength, Status* status) { 223 | switch (strength) { 224 | case EffectStrength::LIGHT: 225 | return 63; 226 | case EffectStrength::MEDIUM: 227 | return 159; 228 | case EffectStrength::STRONG: 229 | return 255; 230 | } 231 | *status = Status::UNSUPPORTED_OPERATION; 232 | return 0; 233 | } 234 | 235 | } // namespace implementation 236 | } // namespace V1_3 237 | } // namespace vibrator 238 | } // namespace hardware 239 | } // namespace android 240 | -------------------------------------------------------------------------------- /vibrator/Vibrator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef ANDROID_HARDWARE_VIBRATOR_V1_3_VIBRATOR_H 17 | #define ANDROID_HARDWARE_VIBRATOR_V1_3_VIBRATOR_H 18 | 19 | #include 20 | #include 21 | 22 | namespace android { 23 | namespace hardware { 24 | namespace vibrator { 25 | namespace V1_3 { 26 | namespace implementation { 27 | 28 | using android::hardware::vibrator::V1_0::EffectStrength; 29 | using android::hardware::vibrator::V1_0::Status; 30 | 31 | class Vibrator : public IVibrator { 32 | public: 33 | Vibrator(); 34 | 35 | // Methods from ::android::hardware::vibrator::V1_0::IVibrator follow. 36 | Return on(uint32_t timeoutMs) override; 37 | Return off() override; 38 | Return supportsAmplitudeControl() override; 39 | Return setAmplitude(uint8_t amplitude) override; 40 | Return perform(V1_0::Effect effect, EffectStrength strength, 41 | perform_cb _hidl_cb) override; 42 | 43 | // Methods from ::android::hardware::vibrator::V1_1::IVibrator follow. 44 | Return perform_1_1(V1_1::Effect_1_1 effect, EffectStrength strength, 45 | perform_cb _hidl_cb) override; 46 | 47 | // Methods from ::android::hardware::vibrator::V1_2::IVibrator follow. 48 | Return perform_1_2(V1_2::Effect effect, EffectStrength strength, 49 | perform_cb _hidl_cb) override; 50 | 51 | // Methods from ::android::hardware::vibrator::V1_3::IVibrator follow. 52 | Return supportsExternalControl() override; 53 | Return setExternalControl(bool enabled) override; 54 | Return perform_1_3(Effect effect, EffectStrength strength, perform_cb _hidl_cb) override; 55 | 56 | private: 57 | Return perform(Effect effect, EffectStrength strength, perform_cb _hidl_cb); 58 | template 59 | Return perform(T effect, EffectStrength strength, perform_cb _hidl_cb); 60 | Status enable(bool enabled, uint32_t ms); 61 | 62 | static const std::string effectToName(Effect effect); 63 | static uint32_t effectToMs(Effect effect, Status* status); 64 | static uint8_t strengthToAmplitude(EffectStrength strength, Status* status); 65 | 66 | private: 67 | uint8_t mAmplitude{UINT8_MAX}; 68 | bool mHasEffect{false}; 69 | bool mExternalControl{false}; 70 | std::mutex mMutex; 71 | }; 72 | } // namespace implementation 73 | } // namespace V1_3 74 | } // namespace vibrator 75 | } // namespace hardware 76 | } // namespace android 77 | 78 | #endif // ANDROID_HARDWARE_VIBRATOR_V1_3_VIBRATOR_H 79 | -------------------------------------------------------------------------------- /vibrator/android.hardware.vibrator@1.3-service.xiaomi_onclite.rc: -------------------------------------------------------------------------------- 1 | service vendor.vibrator-1-3 /vendor/bin/hw/android.hardware.vibrator@1.3-service.xiaomi_onclite 2 | class hal 3 | user system 4 | group system 5 | 6 | on early-boot 7 | chown system system /sys/class/leds/vibrator/vmax_mv 8 | -------------------------------------------------------------------------------- /vibrator/android.hardware.vibrator@1.3-service.xiaomi_onclite.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.hardware.vibrator 4 | hwbinder 5 | 1.3 6 | 7 | IVibrator 8 | default 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /vibrator/service.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #define LOG_TAG "android.hardware.vibrator@1.3-service.xiaomi_onclite" 17 | 18 | #include 19 | #include 20 | 21 | #include "Vibrator.h" 22 | 23 | using android::hardware::configureRpcThreadpool; 24 | using android::hardware::joinRpcThreadpool; 25 | using android::hardware::vibrator::V1_3::IVibrator; 26 | using android::hardware::vibrator::V1_3::implementation::Vibrator; 27 | using namespace android; 28 | 29 | status_t registerVibratorService() { 30 | sp vibrator = new Vibrator(); 31 | 32 | return vibrator->registerAsService(); 33 | } 34 | 35 | int main() { 36 | configureRpcThreadpool(1, true); 37 | status_t status = registerVibratorService(); 38 | 39 | if (status != OK) { 40 | return status; 41 | } 42 | 43 | joinRpcThreadpool(); 44 | 45 | return 1; 46 | } 47 | -------------------------------------------------------------------------------- /wifi/WCNSS_cfg.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LineageOS/android_device_xiaomi_onclite/bb0a4088a0d5c49d49b2ff415000f9d9bba8ed19/wifi/WCNSS_cfg.dat -------------------------------------------------------------------------------- /wifi/p2p_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | disable_scan_offload=1 2 | p2p_no_group_iface=1 3 | persistent_reconnect=1 4 | -------------------------------------------------------------------------------- /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=512 6 | interworking=1 7 | hs20=1 8 | auto_interworking=0 9 | bss_no_flush_when_down=1 10 | driver_param=use_p2p_group_interface=1 11 | pmf=0 12 | --------------------------------------------------------------------------------