├── Android.mk
├── AndroidProducts.mk
├── BoardConfig.mk
├── README.md
├── audio
├── audio_effects.xml
├── audio_io_policy.conf
├── audio_platform_info_intcodec.xml
├── audio_policy_configuration.xml
├── audio_tuning_mixer_tavil.txt
├── graphite_ipc_platform_info.xml
├── listen_platform_info.xml
├── mixer_paths_idp.xml
├── sound_trigger_mixer_paths.xml
└── sound_trigger_platform_info.xml
├── bluetooth
└── include
│ └── bdroid_buildcfg.h
├── compatibility_matrix.xml
├── config.fs
├── configs
├── gps
│ ├── apdr.conf
│ ├── flp.conf
│ ├── gps.conf
│ ├── izat.conf
│ ├── lowi.conf
│ ├── sap.conf
│ └── xtwifi.conf
├── idc
│ ├── uinput-fpc.idc
│ └── uinput-goodix.idc
├── msm_irqbalance.conf
├── privapp-permissions-qti.xml
├── public.libraries.txt
├── qti_whitelist.xml
└── sec_config
├── device.mk
├── extract-files.sh
├── fingerprint
├── Android.bp
├── BiometricsFingerprint.cpp
├── BiometricsFingerprint.h
├── android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sm8150.rc
└── service.cpp
├── framework_compatibility_matrix.xml
├── framework_manifest.xml
├── keylayout
├── gpio-keys.kl
├── uinput-fpc.kl
└── uinput-goodix.kl
├── libhidl
└── Android.mk
├── light
├── Android.bp
├── Light.cpp
├── Light.h
├── android.hardware.light@2.0-service.xiaomi_sm8150.rc
└── service.cpp
├── lineage.dependencies
├── lineage_cepheus.mk
├── manifest.xml
├── media
├── media_codecs.xml
├── media_codecs_performance.xml
└── media_profiles_V1_0.xml
├── org.ifaa.android.manager
├── Android.mk
├── AndroidManifest.xml
├── lib
│ └── org
│ │ └── ifaa
│ │ └── android
│ │ └── manager
│ │ ├── IFAAManager.java
│ │ ├── IFAAManagerFactory.java
│ │ ├── IFAAManagerImpl.java
│ │ ├── IFAAManagerV2.java
│ │ ├── IFAAManagerV3.java
│ │ └── IIFAAService.aidl
└── src
│ └── org
│ └── ifaa
│ └── android
│ └── manager
│ └── IFAAService.java
├── overlay-lineage
├── lineage-sdk
│ └── lineage
│ │ └── res
│ │ └── res
│ │ └── values
│ │ └── config.xml
└── packages
│ └── apps
│ └── Dialer
│ └── java
│ └── com
│ └── android
│ └── dialer
│ └── callrecord
│ └── res
│ └── values
│ └── config.xml
├── overlay
├── frameworks
│ └── base
│ │ ├── core
│ │ └── res
│ │ │ └── res
│ │ │ ├── values-mcc302-mnc220
│ │ │ └── config.xml
│ │ │ ├── values-mcc302-mnc221
│ │ │ └── config.xml
│ │ │ ├── values-mcc302-mnc370
│ │ │ └── config.xml
│ │ │ ├── values-mcc302-mnc610
│ │ │ └── config.xml
│ │ │ ├── values-mcc302-mnc640
│ │ │ └── config.xml
│ │ │ ├── values-mcc302-mnc720
│ │ │ └── config.xml
│ │ │ └── values
│ │ │ └── config.xml
│ │ └── packages
│ │ ├── SettingsProvider
│ │ └── res
│ │ │ └── values
│ │ │ └── defaults.xml
│ │ └── SystemUI
│ │ └── res
│ │ └── values
│ │ └── config.xml
└── packages
│ └── apps
│ ├── CarrierConfig
│ └── res
│ │ └── xml
│ │ ├── vendor.xml
│ │ ├── vendor_device.xml
│ │ └── vendor_miui.xml
│ └── Settings
│ └── res
│ └── values
│ └── arrays.xml
├── parts
├── Android.bk
├── AndroidManifest.xml
├── proguard.flags
├── res
│ ├── color
│ │ ├── switch_bar_bg.xml
│ │ ├── switchbar_switch_thumb_tint.xml
│ │ └── switchbar_switch_track_tint.xml
│ ├── drawable
│ │ └── switchbar_background.xml
│ ├── layout
│ │ ├── doze.xml
│ │ └── switch_bar.xml
│ ├── values
│ │ └── styles.xml
│ └── xml
│ │ └── doze_settings.xml
└── src
│ └── org
│ └── lineageos
│ └── settings
│ ├── BootCompletedReceiver.java
│ └── doze
│ ├── DozeService.java
│ ├── DozeSettingsActivity.java
│ ├── DozeSettingsFragment.java
│ ├── DozeUtils.java
│ ├── PickupSensor.java
│ └── ProximitySensor.java
├── proprietary-files.txt
├── recovery
├── Android.mk
├── init.recovery.qcom.rc
└── recovery_updater.cpp
├── releasetools.py
├── rootdir
├── Android.mk
├── bin
│ ├── init.class_main.sh
│ ├── init.qcom.early_boot.sh
│ ├── init.qcom.post_boot.sh
│ ├── init.qcom.sensors.sh
│ ├── init.qcom.sh
│ ├── init.qcom.usb.sh
│ └── init.qti.qseecomd.sh
└── etc
│ ├── fstab.qcom
│ ├── init.msm.usb.configfs.rc
│ ├── init.qcom.rc
│ ├── init.qcom.usb.rc
│ ├── init.target.rc
│ └── ueventd.qcom.rc
├── seccomp
├── mediacodec-seccomp.policy
└── mediaextractor-seccomp.policy
├── sensors
└── hals.conf
├── sepolicy
├── private
│ └── file_contexts
└── vendor
│ └── file_contexts
├── setup-makefiles.sh
├── system.prop
├── vendor_prop.mk
└── wifi
├── WCNSS_qcom_cfg.ini
├── p2p_supplicant_overlay.conf
└── wpa_supplicant_overlay.conf
/AndroidProducts.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2019 The LineageOS Project
3 | #
4 | # SPDX-License-Identifier: Apache-2.0
5 | #
6 |
7 | PRODUCT_MAKEFILES := \
8 | $(LOCAL_DIR)/lineage_cepheus.mk
9 |
--------------------------------------------------------------------------------
/BoardConfig.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2018-2019 The LineageOS Project
3 | #
4 | # SPDX-License-Identifier: Apache-2.0
5 | #
6 |
7 | BOARD_VENDOR := xiaomi
8 |
9 | DEVICE_PATH := device/xiaomi/cepheus
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 := kryo300
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-a75
23 |
24 | TARGET_USES_64_BIT_BINDER := true
25 |
26 | # Assert
27 | TARGET_OTA_ASSERT_DEVICE := cepheus
28 |
29 | # Bootloader
30 | TARGET_BOOTLOADER_BOARD_NAME := sm8150
31 | TARGET_NO_BOOTLOADER := true
32 |
33 |
34 |
35 | # Kernel
36 | BOARD_KERNEL_BASE := 0x00000000
37 | BOARD_KERNEL_CMDLINE := console=ttyMSM0,115200n8 earlycon=msm_geni_serial,0xa90000 androidboot.hardware=qcom androidboot.console=ttyMSM0 androidboot.memcg=1 lpm_levels.sleep_disabled=1 video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 service_locator.enable=1 swiotlb=2048 firmware_class.path=/vendor/firmware_mnt/image loop.max_part=7 androidboot.usbcontroller=a600000.dwc3 androidboot.selinux=permissive
38 | BOARD_KERNEL_CMDLINE += firmware_class.path=/vendor/firmware_mnt/image
39 | BOARD_KERNEL_IMAGE_NAME := Image.gz-dtb
40 | BOARD_KERNEL_PAGESIZE := 4096
41 | BOARD_KERNEL_TAGS_OFFSET := 0x00000100
42 | BOARD_RAMDISK_OFFSET := 0x01000000
43 | BOARD_KERNEL_SEPARATED_DTBO := true
44 | TARGET_KERNEL_ARCH := arm64
45 | TARGET_KERNEL_CLANG_COMPILE := true
46 | TARGET_KERNEL_CROSS_COMPILE_PREFIX := aarch64-linux-android-
47 | TARGET_KERNEL_SOURCE := kernel/xiaomi/sm8150
48 | TARGET_KERNEL_CONFIG := vendor/cepheus_user_defconfig
49 |
50 | # Platform
51 | TARGET_BOARD_PLATFORM := sm8150
52 | TARGET_BOARD_PLATFORM_GPU := qcom-adreno640
53 |
54 | # QCOM
55 | BOARD_USES_QCOM_HARDWARE := true
56 | TARGET_USE_SDCLANG := true
57 |
58 | # Audio
59 | AUDIO_FEATURE_ENABLED_AAC_ADTS_OFFLOAD := true
60 | AUDIO_FEATURE_ENABLED_EXTN_FORMATS := true
61 | AUDIO_FEATURE_ENABLED_HDMI_SPK := true
62 | AUDIO_FEATURE_ENABLED_PROXY_DEVICE := true
63 | USE_CUSTOM_AUDIO_POLICY := 1
64 | USE_XML_AUDIO_POLICY_CONF := 1
65 |
66 | # Bluetooth
67 | BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(DEVICE_PATH)/bluetooth/include
68 | BOARD_HAVE_BLUETOOTH := true
69 | BOARD_HAVE_BLUETOOTH_QCOM := true
70 | QCOM_BT_USE_BTNV := true
71 | TARGET_USE_QTI_BT_STACK := true
72 |
73 | # Camera
74 | TARGET_USES_QTI_CAMERA_DEVICE := true
75 | USE_DEVICE_SPECIFIC_CAMERA := true
76 |
77 | # Charger Mode
78 | BOARD_CHARGER_ENABLE_SUSPEND := true
79 |
80 | # CNE and DPM
81 | BOARD_USES_QCNE := true
82 |
83 | # Dex
84 | ifeq ($(HOST_OS),linux)
85 | ifneq ($(TARGET_BUILD_VARIANT),eng)
86 | WITH_DEXPREOPT ?= true
87 | endif
88 | endif
89 | WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY ?= true
90 |
91 | # DRM
92 | TARGET_ENABLE_MEDIADRM_64 := true
93 |
94 | # Filesystem
95 | TARGET_FS_CONFIG_GEN := $(DEVICE_PATH)/config.fs
96 |
97 | # FM
98 | BOARD_HAVE_QCOM_FM := true
99 | BOARD_HAS_QCA_FM_SOC := "cherokee"
100 |
101 | # GPS
102 | TARGET_NO_RPC := true
103 | USE_DEVICE_SPECIFIC_GPS := true
104 | BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := $(TARGET_BOARD_PLATFORM)
105 |
106 | # Graphics
107 | MAX_EGL_CACHE_KEY_SIZE := 12*1024
108 | MAX_EGL_CACHE_SIZE := 2048*1024
109 | MAX_VIRTUAL_DISPLAY_DIMENSION := 4096
110 | TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS := true
111 | NUM_FRAMEBUFFER_SURFACE_BUFFERS := 2
112 | TARGET_USES_ION := true
113 | TARGET_USES_NEW_ION_API :=true
114 | TARGET_USES_OVERLAY := true
115 | USE_OPENGL_RENDERER := true
116 | SF_VSYNC_EVENT_PHASE_OFFSET_NS := 6000000
117 | VSYNC_EVENT_PHASE_OFFSET_NS := 2000000
118 |
119 | # HIDL
120 | DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := $(DEVICE_PATH)/framework_compatibility_matrix.xml
121 | DEVICE_FRAMEWORK_MANIFEST_FILE := $(DEVICE_PATH)/framework_manifest.xml
122 | DEVICE_MANIFEST_FILE := $(DEVICE_PATH)/manifest.xml
123 | DEVICE_MATRIX_FILE := $(DEVICE_PATH)/compatibility_matrix.xml
124 |
125 | # Keystore
126 | TARGET_PROVIDES_KEYMASTER := true
127 |
128 | # Media
129 | TARGET_USES_MEDIA_EXTENSIONS := true
130 |
131 | # Partitions
132 | BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
133 | BOARD_SUPPRESS_SECURE_ERASE := true
134 |
135 | BOARD_BOOTIMAGE_PARTITION_SIZE := 134217728
136 | BOARD_DTBOIMG_PARTITION_SIZE := 8388608
137 | BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
138 | BOARD_CACHEIMAGE_PARTITION_SIZE := 268435456
139 | BOARD_RECOVERYIMAGE_PARTITION_SIZE := 67108864
140 | BOARD_SYSTEMIMAGE_PARTITION_SIZE := 3758096384
141 | BOARD_USERDATAIMAGE_PARTITION_SIZE := 116748414464
142 |
143 | BOARD_FLASH_BLOCK_SIZE := 262144 # (BOARD_KERNEL_PAGESIZE * 64)
144 | BOARD_VENDORIMAGE_PARTITION_SIZE := 1610612736
145 | BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
146 |
147 | TARGET_USERIMAGES_USE_EXT4 := true
148 | TARGET_USERIMAGES_USE_F2FS := true
149 | TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false
150 | TARGET_USES_MKE2FS := true
151 |
152 | TARGET_COPY_OUT_VENDOR := vendor
153 |
154 | # Power
155 | TARGET_TAP_TO_WAKE_NODE := "/proc/tp_gesture"
156 | TARGET_USES_INTERACTION_BOOST := true
157 |
158 | # QCOM
159 | BOARD_USES_QCOM_HARDWARE := true
160 |
161 | # Recovery
162 | TARGET_RECOVERY_PIXEL_FORMAT := "BGRA_8888"
163 | TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/rootdir/etc/fstab.qcom
164 |
165 | # Releasetools
166 | TARGET_RECOVERY_UPDATER_LIBS := librecovery_updater_xiaomi
167 | TARGET_RELEASETOOLS_EXTENSIONS := $(DEVICE_PATH)
168 |
169 | # RenderScript
170 | OVERRIDE_RS_DRIVER := libRSDriver_adreno.so
171 |
172 | # RIL
173 | ENABLE_VENDOR_RIL_SERVICE := true
174 | TARGET_PROVIDES_QTI_TELEPHONY_JAR := true
175 | TARGET_RIL_VARIANT := caf
176 |
177 | # Security patch level
178 | VENDOR_SECURITY_PATCH := 2019-03-01
179 |
180 | # Sepolicy
181 | include device/qcom/sepolicy/sepolicy.mk
182 |
183 | BOARD_PLAT_PRIVATE_SEPOLICY_DIR += $(DEVICE_PATH)/sepolicy/private
184 | BOARD_PLAT_PUBLIC_SEPOLICY_DIR += $(DEVICE_PATH)/sepolicy/public
185 | BOARD_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/vendor
186 |
187 | # Treble
188 | BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
189 | BOARD_VNDK_VERSION := current
190 | PRODUCT_FULL_TREBLE_OVERRIDE := true
191 | PRODUCT_VENDOR_MOVE_ENABLED := true
192 | TARGET_SYSTEM_PROP += $(DEVICE_PATH)/system.prop
193 |
194 | # Verified Boot
195 | BOARD_AVB_ENABLE := true
196 | BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flag 2
197 |
198 | # WiFi
199 | BOARD_WLAN_DEVICE := qcwcn
200 | BOARD_HOSTAPD_DRIVER := NL80211
201 | BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
202 | BOARD_WPA_SUPPLICANT_DRIVER := NL80211
203 | BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
204 | WIFI_DRIVER_DEFAULT := qca_cld3
205 | WIFI_DRIVER_STATE_CTRL_PARAM := "/dev/wlan"
206 | WIFI_DRIVER_STATE_OFF := "OFF"
207 | WIFI_DRIVER_STATE_ON := "ON"
208 | WIFI_HIDL_FEATURE_AWARE := true
209 | WIFI_HIDL_FEATURE_DUAL_INTERFACE := true
210 | WPA_SUPPLICANT_VERSION := VER_0_8_X
211 |
212 | # Inherit from the proprietary version
213 | -include vendor/xiaomi/cepheus/BoardConfigVendor.mk
214 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Copyright (C) 2019 - The LineageOS Project
2 |
3 | Common device tree for Xiaomi mi9 based devices
4 | ==============
5 |
--------------------------------------------------------------------------------
/audio/audio_io_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 | proaudio {
22 | flags AUDIO_OUTPUT_FLAG_FAST|AUDIO_OUTPUT_FLAG_RAW
23 | formats AUDIO_FORMAT_PCM_16_BIT
24 | sampling_rates 48000
25 | bit_width 16
26 | app_type 69943
27 | }
28 | voip_rx {
29 | flags AUDIO_OUTPUT_FLAG_VOIP_RX|AUDIO_OUTPUT_FLAG_DIRECT
30 | formats AUDIO_FORMAT_PCM_16_BIT
31 | sampling_rates 8000|16000|32000|48000
32 | bit_width 16
33 | app_type 69946
34 | }
35 | deep_buffer {
36 | flags AUDIO_OUTPUT_FLAG_DEEP_BUFFER
37 | formats AUDIO_FORMAT_PCM_16_BIT
38 | sampling_rates 48000
39 | bit_width 16
40 | app_type 69936
41 | }
42 | direct_pcm_16 {
43 | flags AUDIO_OUTPUT_FLAG_DIRECT
44 | formats AUDIO_FORMAT_PCM_16_BIT|AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_8_24_BIT|AUDIO_FORMAT_PCM_32_BIT
45 | sampling_rates 44100|48000|88200|96000|176400|192000
46 | bit_width 16
47 | app_type 69936
48 | }
49 | direct_pcm_24 {
50 | flags AUDIO_OUTPUT_FLAG_DIRECT
51 | formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_8_24_BIT|AUDIO_FORMAT_PCM_32_BIT
52 | sampling_rates 44100|48000|88200|96000|176400|192000|352800|384000
53 | bit_width 24
54 | app_type 69940
55 | }
56 | direct_pcm_32 {
57 | flags AUDIO_OUTPUT_FLAG_DIRECT
58 | formats AUDIO_FORMAT_PCM_32_BIT
59 | sampling_rates 44100|48000|88200|96000|176400|192000|352800|384000
60 | bit_width 32
61 | app_type 69942
62 | }
63 | compress_passthrough {
64 | flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING|AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH
65 | formats AUDIO_FORMAT_AC3|AUDIO_FORMAT_E_AC3|AUDIO_FORMAT_E_AC3_JOC|AUDIO_FORMAT_DTS|AUDIO_FORMAT_DTS_HD|AUDIO_FORMAT_DSD
66 | sampling_rates 32000|44100|48000|88200|96000|176400|192000|352800
67 | bit_width 16
68 | app_type 69941
69 | }
70 | compress_offload_16 {
71 | flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING
72 | formats AUDIO_FORMAT_MP3|AUDIO_FORMAT_PCM_16_BIT_OFFLOAD|AUDIO_FORMAT_PCM_24_BIT_OFFLOAD|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
73 | sampling_rates 44100|48000|88200|96000|176400|192000
74 | bit_width 16
75 | app_type 69936
76 | }
77 | compress_offload_24 {
78 | flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING
79 | formats AUDIO_FORMAT_PCM_24_BIT_OFFLOAD|AUDIO_FORMAT_FLAC|AUDIO_FORMAT_ALAC|AUDIO_FORMAT_APE|AUDIO_FORMAT_VORBIS|AUDIO_FORMAT_WMA|AUDIO_FORMAT_WMA_PRO
80 | sampling_rates 44100|48000|88200|96000|176400|192000
81 | bit_width 24
82 | app_type 69940
83 | }
84 | }
85 |
86 | inputs {
87 | record_16bit {
88 | formats AUDIO_FORMAT_PCM_16_BIT
89 | sampling_rates 8000|16000|32000|48000|88200|96000|176400|192000
90 | bit_width 16
91 | app_type 69938
92 | }
93 | record_24bit {
94 | formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_24_BIT
95 | sampling_rates 48000|88200|96000|176400|192000
96 | bit_width 24
97 | app_type 69948
98 | }
99 | record_32bit {
100 | formats AUDIO_FORMAT_PCM_32_BIT|AUDIO_FORMAT_PCM_FLOAT
101 | sampling_rates 48000|88200|96000|176400|192000
102 | bit_width 32
103 | app_type 69949
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/audio/audio_tuning_mixer_tavil.txt:
--------------------------------------------------------------------------------
1 | #ANC_TEST_P_PATH_MIC_STEREO Capture
2 | acdb_dev_id:85
3 | !Capture
4 | Txdevice:0
5 |
6 | enable
7 | AIF1_CAP Mixer SLIM TX7:1
8 | AIF1_CAP Mixer SLIM TX8:1
9 | CDC_IF TX7 MUX:DEC7
10 | ADC MUX7:DMIC
11 | DMIC MUX7:DMIC4
12 | CDC_IF TX8 MUX:DEC8
13 | ADC MUX8:DMIC
14 | DMIC MUX8:DMIC0
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 | CDC_IF TX7 MUX:ZERO
23 | CDC_IF TX8 MUX:ZERO
24 | DMIC MUX7:ZERO
25 | DMIC MUX8:ZERO
26 |
27 | #ANC_TEST_S_PATH_MIC_STEREO Capture
28 | acdb_dev_id:88
29 | !Capture
30 | Txdevice:0
31 |
32 | enable
33 | AIF1_CAP Mixer SLIM TX7:1
34 | AIF1_CAP Mixer SLIM TX8:1
35 | CDC_IF TX7 MUX:DEC7
36 | ADC MUX7:ANC_FB_TUNE1
37 | ADC MUX10:DMIC
38 | DMIC MUX10:DMIC0
39 | CDC_IF TX8 MUX:DEC8
40 | ADC MUX8:ANC_FB_TUNE2
41 | ADC MUX12:DMIC
42 | DMIC MUX12:DMIC0
43 | ANC0 FB MUX:ANC_IN_EAR_SPKR
44 | ANC OUT EAR SPKR Enable Switch:1
45 | SLIM_0_TX Channels:Two
46 | MultiMedia1 Mixer SLIM_0_TX:1
47 |
48 | disable
49 | MultiMedia1 Mixer SLIM_0_TX:0
50 | AIF1_CAP Mixer SLIM TX7:0
51 | AIF1_CAP Mixer SLIM TX8:0
52 | CDC_IF TX7 MUX:ZERO
53 | CDC_IF TX8 MUX:ZERO
54 | ADC MUX7:DMIC
55 | ADC MUX8:DMIC
56 | DMIC MUX10:ZERO
57 | DMIC MUX12:ZERO
58 | ANC0 FB MUX:ZERO
59 | ANC OUT EAR SPKR Enable Switch:0
60 |
61 |
62 | #ANC_TEST_E_PATH_MIC_STEREO Capture
63 | acdb_dev_id:91
64 | !Capture
65 | Txdevice:0
66 |
67 | enable
68 | AIF1_CAP Mixer SLIM TX7:1
69 | AIF1_CAP Mixer SLIM TX8:1
70 | CDC_IF TX7 MUX:DEC7
71 | ADC MUX7:ANC_FB_TUNE1
72 | ADC MUX10:DMIC
73 | DMIC MUX10:DMIC4
74 | CDC_IF TX8 MUX:DEC8
75 | ADC MUX8:ANC_FB_TUNE2
76 | ADC MUX12:DMIC
77 | DMIC MUX12:DMIC4
78 | ANC0 FB MUX:ANC_IN_EAR_SPKR
79 | ANC OUT EAR SPKR Enable Switch:1
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 | CDC_IF TX7 MUX:ZERO
88 | CDC_IF TX8 MUX:ZERO
89 | ADC MUX7:DMIC
90 | ADC MUX8:DMIC
91 | DMIC MUX10:ZERO
92 | DMIC MUX12:ZERO
93 | ANC0 FB MUX:ZERO
94 | ANC OUT EAR SPKR Enable Switch:0
95 |
96 |
97 | #ANC_TEST_S_PATH_HANDSET_SPKR_ANC_MONO
98 | acdb_dev_id:86
99 | !Playback
100 | Rxdevice:0
101 |
102 | enable
103 | ANC Function:ON
104 | SLIM RX0 MUX:AIF1_PB
105 | SLIM_0_RX Channels:One
106 | RX INT7_1 MIX1 INP0:RX0
107 | SpkrLeft SWR DAC_Port Switch:1
108 | ANC Slot:7
109 | ANC OUT EAR SPKR Enable Switch:1
110 | ANC SPKR PA Enable Switch:1
111 | SpkrLeft WSA PA Gain:G_6_DB
112 | SLIMBUS_0_RX Audio Mixer MultiMedia1:1
113 |
114 | disable
115 | SLIMBUS_0_RX Audio Mixer MultiMedia1:0
116 | SpkrLeft WSA PA Gain:G_0_DB
117 | ANC SPKR PA Enable Switch:0
118 | ANC OUT EAR SPKR Enable Switch:0
119 | SpkrLeft SWR DAC_Port Switch:0
120 | ANC Slot:0
121 | SLIM RX0 MUX:ZERO
122 | RX INT7_1 MIX1 INP0:ZERO
123 | ANC Function:OFF
124 |
125 | #ANC_TEST_E_PATH_HANDSET_SPKR_ANC_MONO
126 | acdb_dev_id:89
127 | !Playback
128 | Rxdevice:0
129 |
130 | enable
131 | ANC Function:ON
132 | SLIM RX0 MUX:AIF1_PB
133 | SLIM_0_RX Channels:One
134 | RX INT7_1 MIX1 INP0:RX0
135 | SpkrLeft SWR DAC_Port Switch:1
136 | ANC Slot:8
137 | ANC OUT EAR SPKR Enable Switch:1
138 | ANC SPKR PA Enable Switch:1
139 | SpkrLeft WSA PA Gain:G_6_DB
140 | SLIMBUS_0_RX Audio Mixer MultiMedia1:1
141 |
142 | disable
143 | SLIMBUS_0_RX Audio Mixer MultiMedia1:0
144 | SpkrLeft WSA PA Gain:G_0_DB
145 | ANC SPKR PA Enable Switch:0
146 | ANC OUT EAR SPKR Enable Switch:0
147 | SpkrLeft SWR DAC_Port Switch:0
148 | ANC Slot:0
149 | SLIM RX0 MUX:ZERO
150 | RX INT7_1 MIX1 INP0:ZERO
151 | ANC Function:OFF
152 |
153 | #RAS_TEST_SPKR_PHONE_SPKR_STEREO
154 | acdb_dev_id:136
155 | !Playback
156 | Rxdevice:0
157 |
158 | enable
159 | SLIM RX0 MUX:AIF1_PB
160 | SLIM RX1 MUX:AIF1_PB
161 | CDC_IF RX0 MUX:SLIM RX0
162 | CDC_IF RX1 MUX:SLIM RX1
163 | SLIM_0_RX Channels:Two
164 | RX INT7_1 MIX1 INP0:RX0
165 | RX INT8_1 MIX1 INP0:RX1
166 | COMP7 Switch:1
167 | COMP8 Switch:1
168 | SpkrLeft COMP Switch:1
169 | SpkrRight COMP Switch:1
170 | SpkrLeft BOOST Switch:1
171 | SpkrRight BOOST Switch:1
172 | SpkrLeft VISENSE Switch:1
173 | SpkrRight VISENSE Switch:1
174 | SpkrLeft SWR DAC_Port Switch:1
175 | SpkrRight SWR DAC_Port Switch:1
176 | SLIMBUS_0_RX Audio Mixer MultiMedia1:1
177 |
178 | disable
179 | SLIM RX0 MUX:ZERO
180 | SLIM RX1 MUX:ZERO
181 | RX INT7_1 MIX1 INP0:ZERO
182 | RX INT8_1 MIX1 INP0:ZERO
183 | COMP7 Switch:0
184 | COMP8 Switch:0
185 | SpkrLeft COMP Switch:0
186 | SpkrRight COMP Switch:0
187 | SpkrLeft BOOST Switch:0
188 | SpkrRight BOOST Switch:0
189 | SpkrLeft VISENSE Switch:0
190 | SpkrRight VISENSE Switch:0
191 | SpkrLeft SWR DAC_Port Switch:0
192 | SpkrRight SWR DAC_Port Switch:0
193 | SLIMBUS_0_RX Audio Mixer MultiMedia1:0
194 |
--------------------------------------------------------------------------------
/audio/graphite_ipc_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 |
34 |
35 |
36 |
38 |
39 |
40 |
42 |
43 |
44 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/audio/listen_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 |
--------------------------------------------------------------------------------
/bluetooth/include/bdroid_buildcfg.h:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Copyright (c) 2013, The Linux Foundation. All rights reserved.
4 | * Not a Contribution, Apache license notifications and license are retained
5 | * for attribution purposes only.
6 | *
7 | * Copyright (C) 2012 The Android Open Source Project
8 | * Copyright (C) 2018-2019 The LineageOS Project
9 | *
10 | * Licensed under the Apache License, Version 2.0 (the "License");
11 | * you may not use this file except in compliance with the License.
12 | * You may obtain a copy of the License at
13 | *
14 | * http://www.apache.org/licenses/LICENSE-2.0
15 | *
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | #ifndef _BDROID_BUILDCFG_H
24 | #define _BDROID_BUILDCFG_H
25 |
26 | #define BTM_DEF_LOCAL_NAME "Xiaomi Mi9"
27 | // Disables read remote device feature
28 | #define MAX_ACL_CONNECTIONS 16
29 | #define MAX_L2CAP_CHANNELS 16
30 | #define BLE_VND_INCLUDED TRUE
31 | // Skips conn update at conn completion
32 | #define BT_CLEAN_TURN_ON_DISABLED 1
33 | // Increasing SEPs to 12 from 6 to support SHO/MCast i.e. two streams per codec
34 | #define AVDT_NUM_SEPS 12
35 | #endif
36 |
--------------------------------------------------------------------------------
/compatibility_matrix.xml:
--------------------------------------------------------------------------------
1 |
28 |
29 |
30 | android.frameworks.schedulerservice
31 | 1.0
32 |
33 | ISchedulingPolicyService
34 | default
35 |
36 |
37 |
38 | android.frameworks.sensorservice
39 | 1.0
40 |
41 | ISensorManager
42 | default
43 |
44 |
45 |
46 | android.hidl.allocator
47 | 1.0
48 |
49 | IAllocator
50 | ashmem
51 |
52 |
53 |
54 | android.hidl.manager
55 | 1.0
56 |
57 | IServiceManager
58 | default
59 |
60 |
61 |
62 | android.hidl.memory
63 | 1.0
64 |
65 | IMapper
66 | ashmem
67 |
68 |
69 |
70 | android.hidl.token
71 | 1.0
72 |
73 | ITokenManager
74 | default
75 |
76 |
77 |
78 | android.system.wifi.keystore
79 | 1.0
80 |
81 | IKeystore
82 | default
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/config.fs:
--------------------------------------------------------------------------------
1 | [AID_VENDOR_QTI_DIAG]
2 | value:2901
3 |
4 | [AID_VENDOR_RFS]
5 | value:2903
6 |
7 | [AID_VENDOR_RFS_SHARED]
8 | value:2904
9 |
10 | [vendor/bin/wcnss_filter]
11 | mode: 0755
12 | user: AID_BLUETOOTH
13 | group: AID_BLUETOOTH
14 | caps: BLOCK_SUSPEND
15 |
16 | [vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti]
17 | mode: 0755
18 | user: AID_BLUETOOTH
19 | group: AID_BLUETOOTH
20 | caps: BLOCK_SUSPEND NET_ADMIN
21 |
22 | [vendor/bin/pm-service]
23 | mode: 0755
24 | user: AID_SYSTEM
25 | group: AID_SYSTEM
26 | caps: NET_BIND_SERVICE
27 |
28 | [vendor/bin/pd-mapper]
29 | mode: 0755
30 | user: AID_SYSTEM
31 | group: AID_SYSTEM
32 | caps: NET_BIND_SERVICE
33 |
34 | [vendor/bin/imsdatadaemon]
35 | mode: 0755
36 | user: AID_SYSTEM
37 | group: AID_SYSTEM
38 | caps: NET_BIND_SERVICE
39 |
40 | [vendor/bin/ims_rtp_daemon]
41 | mode: 0755
42 | user: AID_SYSTEM
43 | group: AID_RADIO
44 | caps: NET_BIND_SERVICE
45 |
46 | [vendor/bin/imsrcsd]
47 | mode: 0755
48 | user: AID_SYSTEM
49 | group: AID_RADIO
50 | caps: WAKE_ALARM
51 |
52 | [vendor/bin/cnd]
53 | mode: 0755
54 | user: AID_SYSTEM
55 | group: AID_SYSTEM
56 | caps: NET_BIND_SERVICE BLOCK_SUSPEND NET_ADMIN
57 |
58 | [vendor/bin/slim_daemon]
59 | mode: 0755
60 | user: AID_GPS
61 | group: AID_GPS
62 | caps: NET_BIND_SERVICE
63 |
64 | [vendor/bin/xtwifi-client]
65 | mode: 0755
66 | user: AID_GPS
67 | group: AID_GPS
68 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM
69 |
70 | [vendor/bin/sensors.qti]
71 | mode: 0755
72 | user: AID_SYSTEM
73 | group: AID_SYSTEM
74 | caps: NET_BIND_SERVICE
75 |
76 | [firmware/]
77 | mode: 0771
78 | user: AID_SYSTEM
79 | group: AID_SYSTEM
80 | caps: 0
81 |
82 | [firmware/image/*]
83 | mode: 0771
84 | user: AID_SYSTEM
85 | group: AID_SYSTEM
86 | caps: 0
87 |
88 | [vendor/firmware_mnt/image/*]
89 | mode: 0771
90 | user: AID_ROOT
91 | group: AID_SYSTEM
92 | caps: 0
93 |
94 | [bt_firmware/]
95 | mode: 0771
96 | user: AID_SYSTEM
97 | group: AID_SYSTEM
98 | caps: 0
99 |
100 | [persist/]
101 | mode: 0771
102 | user: AID_SYSTEM
103 | group: AID_SYSTEM
104 | caps: 0
105 |
106 | [dsp/]
107 | mode: 0771
108 | user: AID_MEDIA
109 | group: AID_MEDIA
110 | caps: 0
111 |
--------------------------------------------------------------------------------
/configs/gps/apdr.conf:
--------------------------------------------------------------------------------
1 | # AP DR SENSOR Configuration file
2 | #
3 | # SENSOR_SERVICE options are one of below
4 | # accel,gyro,vehicle_accel,vehicle_gyro,pedometer,vehicle_odometry,accel_temp,
5 | # gyro_temp,baro,mag_calib,mag_uncalib,amd,rmd.
6 | #
7 | # SENSOR_PROVIDER options is one of -- default,native,ssc,samlite.
8 | #
9 | # SENSOR_RATE = 1~100 (Hz)
10 | #
11 | # SENSOR_SAMPLES = 1~N
12 | #
13 | # SENSOR_STATISTIC_ENABLED
14 | # bit 0: Diag Print Enabled
15 | # bit 1: Adb Print Enabled
16 | # SENSOR_STATISTIC_PRINT_COUNT
17 | # Skip Number of Print
18 | #
19 | # QDR_DYNAMIC_LOADING = 1~3
20 | # Configure QDR library to be loaded
21 | # 1: QDR3
22 | # 2: QDR2-GYRO
23 | # 3: QDR2-DWT
24 | #
25 | #
26 |
27 |
28 | ######################################
29 | # #
30 | # Default Configuration #
31 | # (GNSS only,QDR Disabled) #
32 | # #
33 | # For QDR enablement, comment #
34 | # this section and enabled #
35 | # either QDR3 OR #
36 | # QDR2-DWT OR QDR2-Gyro related #
37 | # configuration section in below. #
38 | # #
39 | ######################################
40 |
41 | SENSOR_SERVICE = accel
42 | SENSOR_PROVIDER = native
43 | SENSOR_RATE = 100
44 | SENSOR_SAMPLES = 1
45 | SENSOR_STATISTIC_ENABLED = 3
46 | SENSOR_STATISTIC_PRINT_COUNT = 50
47 |
48 | SENSOR_SERVICE = gyro
49 | SENSOR_PROVIDER = native
50 | SENSOR_RATE = 100
51 | SENSOR_SAMPLES = 1
52 | SENSOR_STATISTIC_ENABLED = 3
53 | SENSOR_STATISTIC_PRINT_COUNT = 50
54 |
55 | SENSOR_SERVICE = vehicle_gear
56 | SENSOR_PROVIDER = native
57 | SENSOR_RATE = 100
58 | SENSOR_SAMPLES = 1
59 | SENSOR_STATISTIC_ENABLED = 3
60 | SENSOR_STATISTIC_PRINT_COUNT = 50
61 |
62 | GNSS_POS_STATISTIC_ENABLED = 3
63 | GNSS_POS_STATISTIC_PRNTCNT = 10
64 | GNSS_MSR_STATISTIC_ENABLED = 3
65 | GNSS_MSR_STATISTIC_PRNTCNT = 10
66 |
67 | ######################################
68 | # #
69 | # QDR3 Configuration #
70 | # #
71 | # For QDR3, #
72 | # comment default configuration above#
73 | # and #
74 | # uncomment below configuration #
75 | # settings. #
76 | # #
77 | ######################################
78 | #
79 | #SENSOR_SERVICE = accel
80 | #SENSOR_PROVIDER = native
81 | #SENSOR_RATE = 10
82 | #SENSOR_SAMPLES = 10
83 | #SENSOR_STATISTIC_ENABLED = 3
84 | #SENSOR_STATISTIC_PRINT_COUNT = 50
85 | #
86 | #SENSOR_SERVICE = vehicle_speed
87 | #SENSOR_PROVIDER = native
88 | #SENSOR_RATE = 100
89 | #SENSOR_SAMPLES = 1
90 | #SENSOR_STATISTIC_ENABLED = 3
91 | #SENSOR_STATISTIC_PRINT_COUNT = 50
92 | #
93 | #SENSOR_SERVICE = gyro
94 | #SENSOR_PROVIDER = native
95 | #SENSOR_RATE = 10
96 | #SENSOR_SAMPLES = 10
97 | #SENSOR_STATISTIC_ENABLED = 3
98 | #SENSOR_STATISTIC_PRINT_COUNT = 50
99 | #
100 | #SENSOR_SERVICE = vehicle_gear
101 | #SENSOR_PROVIDER = native
102 | #SENSOR_RATE = 100
103 | #SENSOR_SAMPLES = 1
104 | #SENSOR_STATISTIC_ENABLED = 3
105 | #SENSOR_STATISTIC_PRINT_COUNT = 50
106 | #
107 | #GNSS_POS_STATISTIC_ENABLED = 3
108 | #GNSS_POS_STATISTIC_PRNTCNT = 10
109 | #GNSS_MSR_STATISTIC_ENABLED = 3
110 | #GNSS_MSR_STATISTIC_PRNTCNT = 10
111 | #
112 | ##Enable/disable sensor data flashback feature
113 | #QDR_FLASHBACK_ENABLED = 0
114 | ##Configure QDR library to be loaded 1: QDR3 2: QDR2-GYRO 3: QDR2-DWS
115 | #QDR_DYNAMIC_LOADING = 1
116 | ##Enable/disable sensor data batching feature
117 | #QDR_BATCHING_ENABLED = 2
118 | ##Reporting offset before PPS boundary
119 | #QDR_REPORTING_OFFSET = 0
120 | ##Sensor dispatch threshold declaration
121 | #QDR_SENSDISPATCH_MS = 30
122 | #
123 |
124 | ######################################
125 | # #
126 | # QDR2-DWT Configuration #
127 | # #
128 | # For QDR2-DWT, #
129 | # comment default configuration above#
130 | # and #
131 | # uncomment below configuration #
132 | # settings. #
133 | # #
134 | ######################################
135 | #
136 | #SENSOR_SERVICE = vehicle_speed
137 | #SENSOR_PROVIDER = native
138 | #SENSOR_RATE = 100
139 | #SENSOR_SAMPLES = 1
140 | #SENSOR_STATISTIC_ENABLED = 3
141 | #SENSOR_STATISTIC_PRINT_COUNT = 50
142 | #
143 | #SENSOR_SERVICE = vehicle_dws
144 | #SENSOR_PROVIDER = native
145 | #SENSOR_RATE = 100
146 | #SENSOR_SAMPLES = 1
147 | #SENSOR_STATISTIC_ENABLED = 3
148 | #SENSOR_STATISTIC_PRINT_COUNT = 50
149 | #
150 | #SENSOR_SERVICE = vehicle_gear
151 | #SENSOR_PROVIDER = native
152 | #SENSOR_RATE = 100
153 | #SENSOR_SAMPLES = 1
154 | #SENSOR_STATISTIC_ENABLED = 3
155 | #SENSOR_STATISTIC_PRINT_COUNT = 50
156 | #
157 | #GNSS_POS_STATISTIC_ENABLED = 3
158 | #GNSS_POS_STATISTIC_PRNTCNT = 10
159 | #GNSS_MSR_STATISTIC_ENABLED = 3
160 | #GNSS_MSR_STATISTIC_PRNTCNT = 10
161 | #
162 | ##Enable/disable sensor data flashback feature
163 | #QDR_FLASHBACK_ENABLED = 0
164 | ##Configure QDR library to be loaded 1: QDR3 2: QDR2-GYRO 3: QDR2-DWS
165 | #QDR_DYNAMIC_LOADING = 3
166 | ##Enable/disable sensor data batching feature
167 | #QDR_BATCHING_ENABLED = 0
168 | ##Reporting offset before PPS boundary
169 | #QDR_REPORTING_OFFSET = 0
170 | ##Sensor dispatch threshold declaration
171 | #QDR_SENSDISPATCH_MS = 30
172 | #
173 |
174 | ######################################
175 | # #
176 | # QDR2-GYRO Configuration #
177 | # #
178 | # For QDR2-GYRO, #
179 | # comment default configuration above#
180 | # and #
181 | # uncomment below configuration #
182 | # settings. #
183 | # #
184 | ######################################
185 | #
186 | #SENSOR_SERVICE = vehicle_speed
187 | #SENSOR_PROVIDER = native
188 | #SENSOR_RATE = 100
189 | #SENSOR_SAMPLES = 1
190 | #SENSOR_STATISTIC_ENABLED = 3
191 | #SENSOR_STATISTIC_PRINT_COUNT = 50
192 | #
193 | #SENSOR_SERVICE = vehicle_gyro
194 | #SENSOR_PROVIDER = native
195 | #SENSOR_RATE = 100
196 | #SENSOR_SAMPLES = 1
197 | #SENSOR_STATISTIC_ENABLED = 3
198 | #SENSOR_STATISTIC_PRINT_COUNT = 50
199 | #
200 | #SENSOR_SERVICE = vehicle_gear
201 | #SENSOR_PROVIDER = native
202 | #SENSOR_RATE = 100
203 | #SENSOR_SAMPLES = 1
204 | #SENSOR_STATISTIC_ENABLED = 3
205 | #SENSOR_STATISTIC_PRINT_COUNT = 50
206 | #
207 | #GNSS_POS_STATISTIC_ENABLED = 3
208 | #GNSS_POS_STATISTIC_PRNTCNT = 10
209 | #GNSS_MSR_STATISTIC_ENABLED = 3
210 | #GNSS_MSR_STATISTIC_PRNTCNT = 10
211 | #
212 | ##Enable/disable sensor data flashback feature
213 | #QDR_FLASHBACK_ENABLED = 0
214 | ##Configure QDR library to be loaded 1: QDR3 2: QDR2-GYRO 3: QDR2-DWS
215 | #QDR_DYNAMIC_LOADING = 2
216 | ##Enable/disable sensor data batching feature
217 | #QDR_BATCHING_ENABLED = 0
218 | ##Reporting offset before PPS boundary
219 | #QDR_REPORTING_OFFSET = 0
220 | ##Sensor dispatch threshold declaration
221 | #QDR_SENSDISPATCH_MS = 30
222 | #
223 |
--------------------------------------------------------------------------------
/configs/gps/flp.conf:
--------------------------------------------------------------------------------
1 | ###################################
2 | ##### FLP settings #####
3 | ###################################
4 |
5 | ###################################
6 | # FLP BATCHING 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 | # The number of batched locations
18 | # requested to modem for outdoor
19 | # trip batching. The desired number
20 | # defined below may not be satisfied, as
21 | # the modem can only return the number
22 | # of batched locations that can be allocated,
23 | # which is limited by memory. The default
24 | # trip batch size defined as 600 as below.
25 | OUTDOOR_TRIP_BATCH_SIZE=600
26 |
27 | ###################################
28 | # FLP BATCHING SESSION TIMEOUT
29 | ###################################
30 | # Duration with which batch session timeout
31 | # happens in milliseconds. If not specified
32 | # or set to zero, batching session timeout
33 | # defaults to 20 seconds by the modem.
34 | # BATCH_SESSION_TIMEOUT=20000
35 |
36 | ###################################
37 | # FLP BATCHING ACCURACY
38 | ###################################
39 | # Set to one of the defined values below
40 | # to define the accuracy of batching.
41 | # If not specified, accuracy defaults
42 | # to LOW.
43 | # FLP BATCHING ACCURACY values:
44 | # Low accuracy = 0
45 | # Medium accuracy = 1
46 | # High accuracy = 2
47 | ACCURACY=1
48 |
49 | ###################################
50 | # FLP GEOFENCE RESPONSIVENESS
51 | ###################################
52 | # If set to one of the defined values below,
53 | # it will override the responsiveness for
54 | # FLP geofence, which implements the fused
55 | # location API. If not set to a value defined
56 | # below, which is default, it will not
57 | # override the responsivness.
58 | # FLP_GEOFENCE_RESPONSIVENESS_OVERRIDE Values:
59 | # 1: LOW responsiveness
60 | # 2: MEDIUM responsiveness
61 | # 3: HIGH responsiveness
62 | FLP_GEOFENCE_RESPONSIVENESS_OVERRIDE = 0
63 |
64 | ####################################
65 | # By default APPS must support LB only if modem support
66 | # LB 1.5 and above. This parameter adds an exception
67 | # for targets where modem only supports LB 1.0.
68 | # This might be useful for primarily outdoor devices.
69 | # 0: MUST NOT ALLOW LB IF MODEM ONLY SUPPORTS
70 | # LB 1.0
71 | # 1: ALLOW LB IF MODEM ONLY SUPPORTS LB 1.0
72 | ####################################
73 | ALLOW_LB_1_0 = 0
74 |
75 | ####################################
76 | # By default if network fixes are not sensor assisted
77 | # these fixes must be dropped. This parameter adds an exception
78 | # for targets where there is no PDR and we still want to
79 | # report out network fixes
80 | # 0: MUST NOT ALLOW NETWORK FIXES
81 | # 1: ALLOW NETWORK FIXES
82 | ####################################
83 | ALLOW_NETWORK_FIXES = 0
84 |
--------------------------------------------------------------------------------
/configs/gps/gps.conf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/randomblame/android_device_xiaomi_cepheus/1bb20d580cbc6972100e1750e4bb2270f9870ebf/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 = com.baidu.map.location
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 | #SAP valid modes:
99 | # DISABLED
100 | # BASIC
101 | # PREMIUM
102 | SAP=PREMIUM
103 |
104 | #FREE_WIFI_SCAN_INJECT valid modes:
105 | #DISABLED
106 | #BASIC
107 | FREE_WIFI_SCAN_INJECT=BASIC
108 |
109 | #SUPL_WIFI valid modes:
110 | #DISABLED
111 | #BASIC
112 | SUPL_WIFI=BASIC
113 |
114 | #WIFI_SUPPLICANT_INFO valid modes:
115 | #DISABLED
116 | #BASIC
117 | WIFI_SUPPLICANT_INFO=BASIC
118 |
119 | #####################################
120 | # Location process launcher settings
121 | #####################################
122 |
123 | # DO NOT MODIFY
124 | # Modifying below attributes without
125 | # caution can have serious implications.
126 |
127 | #Values for PROCESS_STATE:
128 | # ENABLED
129 | # DISABLED
130 |
131 | #PROCESS_NAME
132 | # Name of the executable file.
133 |
134 | #FEATURE MASKS:
135 | # GTP-WIFI 0X03
136 | # GTP-AP-CELL 0X0c
137 | # GTP-MP-CELL 0xc00
138 | # GTP-WAA 0X300
139 | # SAP 0Xc0
140 | # ODCPI 0x1000
141 | # FREE_WIFI_SCAN_INJECT 0x2000
142 | # SUPL_WIFI 0x4000
143 | # WIFI_SUPPLICANT_INFO 0x8000
144 |
145 | #Values for PLATFORMS can be:
146 | #1. Any valid values obtained from ro.board.platform separated by single space. For example: msm8960 msm8226
147 | #2. 'all' or 'all exclude' -> for All platforms
148 | #3. 'all exclude XXXX' -> All platforms exclude XXXX. For example: all exclude msm8937
149 |
150 | #Values for BASEBAND can be:
151 | #1. Any valid values obtained from ro.baseband separated by single space. For example: sglte sglte2
152 | #2. 'all' or 'all exclude' -> for all basebands
153 | #3. 'all exclude XXXX' -> All basebands exclude XXXX. For example: all exclude sglte
154 | PROCESS_NAME=lowi-server
155 | PROCESS_ARGUMENT=
156 | PROCESS_STATE=ENABLED
157 | PROCESS_GROUPS=gps net_admin wifi inet oem_2901
158 | PREMIUM_FEATURE=0
159 | IZAT_FEATURE_MASK=0xf303
160 | PLATFORMS=all
161 | BASEBAND=all
162 | HARDWARE_TYPE=all
163 |
164 | PROCESS_NAME=xtwifi-inet-agent
165 | PROCESS_ARGUMENT=
166 | PROCESS_STATE=ENABLED
167 | PROCESS_GROUPS=inet gps
168 | PREMIUM_FEATURE=1
169 | IZAT_FEATURE_MASK=0xf0f
170 | PLATFORMS=all
171 | BASEBAND=all
172 | HARDWARE_TYPE=all
173 |
174 | PROCESS_NAME=xtwifi-client
175 | PROCESS_ARGUMENT=
176 | PROCESS_STATE=ENABLED
177 | PROCESS_GROUPS=wifi inet gps system oem_2904
178 | PREMIUM_FEATURE=1
179 | IZAT_FEATURE_MASK=0xf0f
180 | PLATFORMS=all
181 | BASEBAND=all
182 | HARDWARE_TYPE=all
183 |
184 | PROCESS_NAME=slim_daemon
185 | PROCESS_ARGUMENT=
186 | PROCESS_STATE=DISABLED
187 | PROCESS_GROUPS=gps oem_2901 can
188 | PREMIUM_FEATURE=1
189 | IZAT_FEATURE_MASK=0xf0
190 | PLATFORMS=all
191 | BASEBAND=all
192 | HARDWARE_TYPE=all
193 |
194 | PROCESS_NAME=xtra-daemon
195 | PROCESS_ARGUMENT=
196 | PROCESS_STATE=ENABLED
197 | PROCESS_GROUPS=inet gps system
198 | PREMIUM_FEATURE=0
199 | IZAT_FEATURE_MASK=0
200 | PLATFORMS=all
201 | BASEBAND=all
202 | HARDWARE_TYPE=all
203 |
204 | ########################################
205 | # Engine Service which host DRE module #
206 | # To enable DRE engine service, change #
207 | # PROCESS_STATE=ENABLED #
208 | ########################################
209 | PROCESS_NAME=engine-service
210 | PROCESS_ARGUMENT=DRE-INT libloc_epDr.so
211 | PROCESS_STATE=DISABLED
212 | PROCESS_GROUPS=gps diag inet
213 | PREMIUM_FEATURE=0
214 | IZAT_FEATURE_MASK=0
215 | PLATFORMS=all
216 | BASEBAND=all
217 | HARDWARE_TYPE=all
218 |
219 | ########################################
220 | # Engine Service which host PPE module #
221 | # To enable PPE engine service, change #
222 | # PROCESS_STATE=ENABLED #
223 | # and update process arugements #
224 | # with PPE library name #
225 | #PROCESS_ARGUMENT=PPE libepsimulator.so#
226 | ########################################
227 | PROCESS_NAME=engine-service
228 | PROCESS_ARGUMENT=PPE libepsimulator.so
229 | PROCESS_STATE=DISABLED
230 | PROCESS_GROUPS=gps diag inet
231 | PREMIUM_FEATURE=0
232 | IZAT_FEATURE_MASK=0
233 | PLATFORMS=all
234 | BASEBAND=all
235 | HARDWARE_TYPE=all
236 |
--------------------------------------------------------------------------------
/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) 2012-2013 Qualcomm Atheros, Inc.
9 | # All Rights Reserved.
10 | # Qualcomm Atheros Confidential and Proprietary.
11 | #
12 | # Export of this technology or software is regulated by the U.S. Government.
13 | # Diversion contrary to U.S. law prohibited.
14 | #=============================================================================*/
15 |
16 | # X86 ONLY - UBUNTU:
17 | # Copy this file in the same directory where the executable is
18 |
19 | # Log level
20 | # EL_LOG_OFF = 0, EL_ERROR = 1, EL_WARNING = 2, EL_INFO = 3, EL_DEBUG = 4, EL_VERBOSE = 5, EL_LOG_ALL = 100
21 | LOWI_LOG_LEVEL = 3
22 |
--------------------------------------------------------------------------------
/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 | COUNT_BASED_BATCHING=1
123 | SYNC_ONCE=0
124 |
125 | #Sensor HAL Provider Configuration HAL Library name including path
126 | ################################################
127 | # #
128 | # Configuration for BMI 160 Sensor #
129 | # #
130 | ################################################
131 | SENSOR_TYPE=2
132 | SENSOR_HAL_LIB_PATH=/usr/lib/libbmi160sensors.so.1
133 |
134 | ################################################
135 | # #
136 | # Configuration for ASM330 Sensor #
137 | # #
138 | ################################################
139 | #SENSOR_TYPE=1
140 | #SENSOR_HAL_LIB_PATH=/usr/lib/libasm330sensors.so.1
141 |
142 |
143 | ################################################
144 | # #
145 | # Configuration for IAM20680 Sensor #
146 | # #
147 | ################################################
148 | #SENSOR_TYPE=3
149 | #SENSOR_HAL_LIB_PATH=/usr/lib/libiam20680sensors.so.1
150 |
151 |
152 | ################################################
153 | # #
154 | # Configuration for SMI130 Sensor #
155 | # #
156 | ################################################
157 | #SENSOR_TYPE=4
158 | #SENSOR_HAL_LIB_PATH=/usr/lib/libsmi130sensors.so.1
159 |
--------------------------------------------------------------------------------
/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-gf
14 | keyboard.builtIn = 1
15 | keyboard.orientationAware = 1
16 |
--------------------------------------------------------------------------------
/configs/msm_irqbalance.conf:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2017, The Linux Foundation. All rights reserved.
2 | #
3 | # Redistribution and use in source and binary forms, with or without
4 | # modification, are permitted provided that the following conditions are
5 | # met:
6 | # * Redistributions of source code must retain the above copyright
7 | # notice, this list of conditions and the following disclaimer.
8 | # * Redistributions in binary form must reproduce the above
9 | # copyright notice, this list of conditions and the following
10 | # disclaimer in the documentation and/or other materials provided
11 | # with the distribution.
12 | # * Neither the name of The Linux Foundation nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 | #
29 |
30 | PRIO=1,1,1,1,0,0,0,0
31 | #arch_timer, arm-pmu, arch_mem_timer, glink_lpass
32 | IGNORED_IRQ=19,21,39,188
33 |
--------------------------------------------------------------------------------
/configs/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 |
122 |
123 |
--------------------------------------------------------------------------------
/configs/public.libraries.txt:
--------------------------------------------------------------------------------
1 | libqti-perfd-client.so
2 | libadsprpc.so
3 | libcdsprpc.so
4 | libsdsprpc.so
5 | libfastcvopt.so
6 | liblistenjni.so
7 | liblistensoundmodel2.so
8 | libOpenCL.so
9 | libnpu.so
10 | libaix.so
11 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/extract-files.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright (C) 2019 The LineageOS Project
4 | #
5 | # SPDX-License-Identifier: Apache-2.0
6 | #
7 |
8 | set -e
9 |
10 | DEVICE=cepheus
11 | VENDOR=xiaomi
12 |
13 | # Load extract_utils and do some sanity checks
14 | MY_DIR="${BASH_SOURCE%/*}"
15 | if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
16 |
17 | LINEAGE_ROOT="$MY_DIR"/../../..
18 |
19 | HELPER="$LINEAGE_ROOT"/vendor/lineage/build/tools/extract_utils.sh
20 | if [ ! -f "$HELPER" ]; then
21 | echo "Unable to find helper script at $HELPER"
22 | exit 1
23 | fi
24 | . "$HELPER"
25 |
26 | # Default to sanitizing the vendor folder before extraction
27 | CLEAN_VENDOR=true
28 |
29 | while [ "$1" != "" ]; do
30 | case $1 in
31 | -n | --no-cleanup ) CLEAN_VENDOR=false
32 | ;;
33 | -s | --section ) shift
34 | SECTION=$1
35 | CLEAN_VENDOR=false
36 | ;;
37 | * ) SRC=$1
38 | ;;
39 | esac
40 | shift
41 | done
42 |
43 | if [ -z "$SRC" ]; then
44 | SRC=adb
45 | fi
46 |
47 | # Initialize the helper for common device
48 | setup_vendor "$DEVICE" "$VENDOR" "$LINEAGE_ROOT" true "$CLEAN_VENDOR"
49 |
50 | extract "$MY_DIR"/proprietary-files.txt "$SRC" "$SECTION"
51 |
52 | BLOB_ROOT="$LINEAGE_ROOT"/vendor/"$VENDOR"/"$DEVICE"/proprietary
53 |
54 | patchelf --remove-needed vendor.xiaomi.hardware.mtdservice@1.0.so "$BLOB_ROOT"/vendor/bin/mlipayd@1.1
55 | patchelf --remove-needed vendor.xiaomi.hardware.mtdservice@1.0.so "$BLOB_ROOT"/vendor/lib64/libmlipay.so
56 | patchelf --remove-needed vendor.xiaomi.hardware.mtdservice@1.0.so "$BLOB_ROOT"/vendor/lib64/libmlipay@1.1.so
57 |
58 | "$MY_DIR"/setup-makefiles.sh
59 |
--------------------------------------------------------------------------------
/fingerprint/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2017-2018 The LineageOS Project
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 |
16 | cc_binary {
17 | name: "android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sm8150",
18 | relative_install_path: "hw",
19 | defaults: ["hidl_defaults"],
20 | init_rc: ["android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sm8150.rc"],
21 | srcs: ["service.cpp", "BiometricsFingerprint.cpp"],
22 | shared_libs: [
23 | "libbase",
24 | "libhardware",
25 | "libhidlbase",
26 | "libhidltransport",
27 | "libhwbinder",
28 | "liblog",
29 | "libutils",
30 | "libcutils",
31 | "android.hardware.biometrics.fingerprint@2.1",
32 | ],
33 | proprietary: true,
34 | }
35 |
--------------------------------------------------------------------------------
/fingerprint/BiometricsFingerprint.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 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 | #ifndef ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
18 | #define ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
19 |
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 |
28 | namespace android {
29 | namespace hardware {
30 | namespace biometrics {
31 | namespace fingerprint {
32 | namespace V2_1 {
33 | namespace implementation {
34 |
35 | using ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
36 | using ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback;
37 | using ::android::hardware::biometrics::fingerprint::V2_1::RequestStatus;
38 | using ::android::hardware::Return;
39 | using ::android::hardware::Void;
40 | using ::android::hardware::hidl_vec;
41 | using ::android::hardware::hidl_string;
42 | using ::android::sp;
43 |
44 | struct BiometricsFingerprint : public IBiometricsFingerprint {
45 | public:
46 | BiometricsFingerprint();
47 | ~BiometricsFingerprint();
48 |
49 | // Method to wrap legacy HAL with BiometricsFingerprint class
50 | static IBiometricsFingerprint* getInstance();
51 |
52 | // Methods from ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint follow.
53 | Return setNotify(const sp& clientCallback) override;
54 | Return preEnroll() override;
55 | Return enroll(const hidl_array& hat, uint32_t gid, uint32_t timeoutSec) override;
56 | Return postEnroll() override;
57 | Return getAuthenticatorId() override;
58 | Return cancel() override;
59 | Return enumerate() override;
60 | Return remove(uint32_t gid, uint32_t fid) override;
61 | Return setActiveGroup(uint32_t gid, const hidl_string& storePath) override;
62 | Return authenticate(uint64_t operationId, uint32_t gid) override;
63 |
64 | private:
65 | static fingerprint_device_t* openHal();
66 | static void notify(const fingerprint_msg_t *msg); /* Static callback for legacy HAL implementation */
67 | static Return ErrorFilter(int32_t error);
68 | static FingerprintError VendorErrorFilter(int32_t error, int32_t* vendorCode);
69 | static FingerprintAcquiredInfo VendorAcquiredFilter(int32_t error, int32_t* vendorCode);
70 | static BiometricsFingerprint* sInstance;
71 |
72 | std::mutex mClientCallbackMutex;
73 | sp mClientCallback;
74 | fingerprint_device_t *mDevice;
75 | };
76 |
77 | } // namespace implementation
78 | } // namespace V2_1
79 | } // namespace fingerprint
80 | } // namespace biometrics
81 | } // namespace hardware
82 | } // namespace android
83 |
84 | #endif // ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
85 |
--------------------------------------------------------------------------------
/fingerprint/android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sm8150.rc:
--------------------------------------------------------------------------------
1 | service vendor.fps_hal /vendor/bin/hw/android.hardware.biometrics.fingerprint@2.1-service
2 | # "class hal" causes a race condition on some devices due to files created
3 | # in /data. As a workaround, postpone startup until later in boot once
4 | # /data is mounted.
5 | class late_start
6 | user system
7 | group system input
8 |
9 | on init
10 | # Goodix fingerprint
11 | chown system system /dev/goodix_fp
12 |
13 | #Synaptics fingerpint
14 | chown system system /dev/vfsspi
15 |
16 | on boot
17 | chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/irq
18 | chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/irq_enable
19 | chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/wakeup_enable
20 | chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/hw_reset
21 | chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/device_prepare
22 | chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/fingerdown_wait
23 | chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/vendor
24 | chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/regulator_enable
25 | chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/screen_status
26 | chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/vreg_op_cnt
27 |
28 | chmod 0700 /sys/bus/platform/devices/soc:fingerprint_fpc/irq
29 | chmod 0700 /sys/bus/platform/devices/soc:fingerprint_fpc/wakeup_enable
30 | chmod 0700 /sys/bus/platform/devices/soc:fingerprint_fpc/hw_reset
31 | chmod 0700 /sys/bus/platform/devices/soc:fingerprint_fpc/device_prepare
32 | chmod 0700 /sys/bus/platform/devices/soc:fingerprint_fpc/vendor
33 | chmod 0660 /sys/bus/platform/devices/soc:fingerprint_fpc/regulator_enable
34 | chmod 0660 /sys/bus/platform/devices/soc:fingerprint_fpc/screen_status
35 | chmod 0660 /sys/bus/platform/devices/soc:fingerprint_fpc/vreg_op_cnt
36 | chown system system /sys/class/drm/card0-DSI-1/disp_param
37 | chmod 0700 /sys/class/drm/card0-DSI-1/disp_param
38 | chmod 0666 /dev/input/event2
39 |
40 | on post-fs-data
41 | mkdir /data/vendor/syna 0770 system system
42 | mkdir /data/vendor/syna/ist/ 0770 system system
43 | mkdir /data/vendor/fpc 0770 system system
44 | mkdir /data/vendor/goodix 0770 system system
45 |
46 | on property:vendor.fps_hal.restartimes=max
47 | stop vendor.fps_hal
48 |
--------------------------------------------------------------------------------
/fingerprint/service.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 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 "android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sm8150"
18 |
19 | #include
20 | #include
21 |
22 | #include "BiometricsFingerprint.h"
23 |
24 | // libhwbinder:
25 | using android::hardware::configureRpcThreadpool;
26 | using android::hardware::joinRpcThreadpool;
27 |
28 | // Generated HIDL files
29 | using android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
30 | using android::hardware::biometrics::fingerprint::V2_1::implementation::BiometricsFingerprint;
31 |
32 | int main() {
33 | android::sp service = BiometricsFingerprint::getInstance();
34 |
35 | if (service == nullptr) {
36 | ALOGE("Instance of BiometricsFingerprint is null");
37 | return 1;
38 | }
39 |
40 | configureRpcThreadpool(1, true /*callerWillJoin*/);
41 |
42 | android::status_t status = service->registerAsService();
43 | if (status != android::OK) {
44 | ALOGE("Cannot register BiometricsFingerprint service");
45 | return 1;
46 | }
47 |
48 | joinRpcThreadpool();
49 |
50 | return 0; // should never get here
51 | }
52 |
--------------------------------------------------------------------------------
/framework_manifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | vendor.lineage.trust
4 | hwbinder
5 | 1.0
6 |
7 | IUsbRestrict
8 | default
9 |
10 |
11 |
12 | vendor.qti.hardware.radio.atcmdfwd
13 | hwbinder
14 | 1.0
15 |
16 | IAtCmdFwd
17 | AtCmdFwdService
18 |
19 | @1.0::IAtCmdFwd/AtCmdFwdService
20 |
21 |
22 |
--------------------------------------------------------------------------------
/keylayout/gpio-keys.kl:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2013, The Linux Foundation. All rights reserved.
2 | #
3 | # Redistribution and use in source and binary forms, with or without
4 | # modification, are permitted provided that the following conditions are
5 | # met:
6 | # * Redistributions of source code must retain the above copyright
7 | # notice, this list of conditions and the following disclaimer.
8 | # * Redistributions in binary form must reproduce the above
9 | # copyright notice, this list of conditions and the following
10 | # disclaimer in the documentation and/or other materials provided
11 | # with the distribution.
12 | # * Neither the name of The Linux Foundation nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 |
28 | key 115 VOLUME_UP
29 | key 114 VOLUME_DOWN
30 | key 102 HOME
31 | key 528 FOCUS
32 | key 766 CAMERA
33 | key 689 AI
34 |
--------------------------------------------------------------------------------
/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 VIRTUAL
12 | #key 102 HOME VIRTUAL
13 | #key 105 DPAD_LEFT VIRTUAL
14 | #key 106 DPAD_RIGHT VIRTUAL
15 |
16 |
--------------------------------------------------------------------------------
/keylayout/uinput-goodix.kl:
--------------------------------------------------------------------------------
1 | #
2 | # Goodix Touch sensor driver
3 | #
4 | # Copyright (c) 2017 Goodix
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 VIRTUAL
12 | #key 102 HOME VIRTUAL
13 | #key 105 DPAD_LEFT VIRTUAL
14 | #key 106 DPAD_RIGHT VIRTUAL
15 |
16 |
--------------------------------------------------------------------------------
/libhidl/Android.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2017 The LineageOS Project
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | include $(CLEAR_VARS)
17 | LOCAL_SHARED_LIBRARIES := libhidltransport
18 | LOCAL_MODULE := android.hidl.base@1.0
19 | LOCAL_MODULE_TAGS := optional
20 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES
21 | LOCAL_VENDOR_MODULE := true
22 | include $(BUILD_SHARED_LIBRARY)
23 |
24 | include $(CLEAR_VARS)
25 | LOCAL_SHARED_LIBRARIES := libhidltransport
26 | LOCAL_MODULE := android.hidl.manager@1.0
27 | LOCAL_MODULE_TAGS := optional
28 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES
29 | LOCAL_VENDOR_MODULE := true
30 | include $(BUILD_SHARED_LIBRARY)
31 |
32 | include $(CLEAR_VARS)
33 | LOCAL_SHARED_LIBRARIES := libhidltransport
34 | LOCAL_MODULE := android.hidl.base@1.0_system
35 | LOCAL_INSTALLED_MODULE_STEM := android.hidl.base@1.0.so
36 | LOCAL_MODULE_TAGS := optional
37 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES
38 | include $(BUILD_SHARED_LIBRARY)
39 |
40 | include $(CLEAR_VARS)
41 | LOCAL_SHARED_LIBRARIES := libhidltransport
42 | LOCAL_MODULE := android.hidl.manager@1.0_system
43 | LOCAL_INSTALLED_MODULE_STEM := android.hidl.manager@1.0.so
44 | LOCAL_MODULE_TAGS := optional
45 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES
46 | include $(BUILD_SHARED_LIBRARY)
47 |
--------------------------------------------------------------------------------
/light/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2018 The LineageOS Project
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | cc_binary {
16 | relative_install_path: "hw",
17 | defaults: ["hidl_defaults"],
18 | name: "android.hardware.light@2.0-service.xiaomi_sm8150",
19 | init_rc: ["android.hardware.light@2.0-service.xiaomi_sm8150.rc"],
20 | srcs: ["service.cpp", "Light.cpp"],
21 | shared_libs: [
22 | "android.hardware.light@2.0",
23 | "libbase",
24 | "libhardware",
25 | "libhidlbase",
26 | "libhidltransport",
27 | "libhwbinder",
28 | "liblog",
29 | "libutils",
30 | ],
31 | }
32 |
--------------------------------------------------------------------------------
/light/Light.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #define LOG_TAG "LightsService"
18 |
19 | #include "Light.h"
20 |
21 | #include
22 | #include
23 | #include
24 |
25 | namespace android {
26 | namespace hardware {
27 | namespace light {
28 | namespace V2_0 {
29 | namespace implementation {
30 |
31 | /*
32 | * Write value to path and close file.
33 | */
34 | template
35 | static void set(const std::string& path, const T& value) {
36 | std::ofstream file(path);
37 | file << value;
38 | }
39 |
40 | /*
41 | * Read from path and close file.
42 | * Return def in case of any failure.
43 | */
44 | template
45 | static T get(const std::string& path, const T& def) {
46 | std::ifstream file(path);
47 | T result;
48 |
49 | file >> result;
50 | return file.fail() ? def : result;
51 | }
52 |
53 | static constexpr int kDefaultMaxBrightness = 255;
54 | static constexpr int kRampSteps = 50;
55 | static constexpr int kRampMaxStepDurationMs = 5;
56 |
57 | static uint32_t getBrightness(const LightState& state) {
58 | uint32_t alpha, red, green, blue;
59 |
60 | // Extract brightness from AARRGGBB
61 | alpha = (state.color >> 24) & 0xff;
62 |
63 | // Retrieve each of the RGB colors
64 | red = (state.color >> 16) & 0xff;
65 | green = (state.color >> 8) & 0xff;
66 | blue = state.color & 0xff;
67 |
68 | // Scale RGB colors if a brightness has been applied by the user
69 | if (alpha != 0xff) {
70 | red = red * alpha / 0xff;
71 | green = green * alpha / 0xff;
72 | blue = blue * alpha / 0xff;
73 | }
74 |
75 | return (77 * red + 150 * green + 29 * blue) >> 8;
76 | }
77 |
78 | static uint32_t rgbToBrightness(const LightState& state) {
79 | uint32_t color = state.color & 0x00ffffff;
80 | return ((77 * ((color >> 16) & 0xff))
81 | + (150 * ((color >> 8) & 0xff))
82 | + (29 * (color & 0xff))) >> 8;
83 | }
84 |
85 | Light::Light() {
86 | mLights.emplace(Type::ATTENTION, std::bind(&Light::handleNotification, this, std::placeholders::_1, 0));
87 | mLights.emplace(Type::BACKLIGHT, std::bind(&Light::handleBacklight, this, std::placeholders::_1));
88 | mLights.emplace(Type::BATTERY, std::bind(&Light::handleNotification, this, std::placeholders::_1, 1));
89 | mLights.emplace(Type::NOTIFICATIONS, std::bind(&Light::handleNotification, this, std::placeholders::_1, 2));
90 | }
91 |
92 | void Light::handleBacklight(const LightState& state) {
93 | int maxBrightness = get("/sys/class/backlight/panel0-backlight/max_brightness", -1);
94 | if (maxBrightness < 0) {
95 | maxBrightness = kDefaultMaxBrightness;
96 | }
97 | uint32_t sentBrightness = rgbToBrightness(state);
98 | uint32_t brightness = sentBrightness * maxBrightness / kDefaultMaxBrightness;
99 | LOG(DEBUG) << "Writing backlight brightness " << brightness
100 | << " (orig " << sentBrightness << ")";
101 | set("/sys/class/backlight/panel0-backlight/brightness", brightness);
102 | }
103 |
104 | void Light::handleNotification(const LightState& state, size_t index) {
105 | mLightStates.at(index) = state;
106 |
107 | LightState stateToUse = mLightStates.front();
108 | for (const auto& lightState : mLightStates) {
109 | if (lightState.color & 0xffffff) {
110 | stateToUse = lightState;
111 | break;
112 | }
113 | }
114 |
115 | uint32_t whiteBrightness = getBrightness(stateToUse);
116 |
117 | uint32_t onMs = stateToUse.flashMode == Flash::TIMED ? stateToUse.flashOnMs : 0;
118 | uint32_t offMs = stateToUse.flashMode == Flash::TIMED ? stateToUse.flashOffMs : 0;
119 |
120 | auto getScaledDutyPercent = [](int brightness) -> std::string {
121 | std::string output;
122 | for (int i = 0; i <= kRampSteps; i++) {
123 | if (i != 0) {
124 | output += ",";
125 | }
126 | output += std::to_string(i * 100 * brightness / (kDefaultMaxBrightness * kRampSteps));
127 | }
128 | return output;
129 | };
130 |
131 | // Disable blinking to start
132 | set("/sys/class/leds/white/blink", 0);
133 |
134 | if (onMs > 0 && offMs > 0) {
135 | uint32_t pauseLo, pauseHi, stepDuration;
136 | if (kRampMaxStepDurationMs * kRampSteps > onMs) {
137 | stepDuration = onMs / kRampSteps;
138 | pauseHi = 0;
139 | } else {
140 | stepDuration = kRampMaxStepDurationMs;
141 | pauseHi = onMs - kRampSteps * stepDuration;
142 | pauseLo = offMs - kRampSteps * stepDuration;
143 | }
144 |
145 | set("/sys/class/leds/white/start_idx", 0);
146 | set("/sys/class/leds/white/duty_pcts", getScaledDutyPercent(whiteBrightness));
147 | set("/sys/class/leds/white/pause_lo", pauseLo);
148 | set("/sys/class/leds/white/pause_hi", pauseHi);
149 | set("/sys/class/leds/white/ramp_step_ms", stepDuration);
150 |
151 | // Start blinking
152 | set("/sys/class/leds/white/blink", 1);
153 | } else {
154 | set("/sys/class/leds/white/brightness", whiteBrightness);
155 | }
156 | }
157 |
158 | Return Light::setLight(Type type, const LightState& state) {
159 | auto it = mLights.find(type);
160 |
161 | if (it == mLights.end()) {
162 | return Status::LIGHT_NOT_SUPPORTED;
163 | }
164 |
165 | // Lock global mutex until light state is updated.
166 | std::lock_guard lock(mLock);
167 |
168 | it->second(state);
169 |
170 | return Status::SUCCESS;
171 | }
172 |
173 | Return Light::getSupportedTypes(getSupportedTypes_cb _hidl_cb) {
174 | std::vector types;
175 |
176 | for (auto const& light : mLights) {
177 | types.push_back(light.first);
178 | }
179 |
180 | _hidl_cb(types);
181 |
182 | return Void();
183 | }
184 |
185 | } // namespace implementation
186 | } // namespace V2_0
187 | } // namespace light
188 | } // namespace hardware
189 | } // namespace android
190 |
--------------------------------------------------------------------------------
/light/Light.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H
18 | #define ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H
19 |
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 |
26 | namespace android {
27 | namespace hardware {
28 | namespace light {
29 | namespace V2_0 {
30 | namespace implementation {
31 |
32 | using ::android::hardware::Return;
33 | using ::android::hardware::Void;
34 | using ::android::hardware::hidl_vec;
35 | using ::android::hardware::light::V2_0::ILight;
36 | using ::android::hardware::light::V2_0::LightState;
37 | using ::android::hardware::light::V2_0::Status;
38 | using ::android::hardware::light::V2_0::Type;
39 |
40 | class Light : public ILight {
41 | public:
42 | Light();
43 |
44 | Return setLight(Type type, const LightState& state) override;
45 | Return getSupportedTypes(getSupportedTypes_cb _hidl_cb) override;
46 |
47 | private:
48 | void handleBacklight(const LightState& state);
49 | void handleNotification(const LightState& state, size_t index);
50 |
51 | std::mutex mLock;
52 | std::unordered_map> mLights;
53 | std::array mLightStates;
54 | };
55 |
56 | } // namespace implementation
57 | } // namespace V2_0
58 | } // namespace light
59 | } // namespace hardware
60 | } // namespace android
61 |
62 | #endif // ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H
63 |
--------------------------------------------------------------------------------
/light/android.hardware.light@2.0-service.xiaomi_sm8150.rc:
--------------------------------------------------------------------------------
1 | on boot
2 | chown system system /sys/class/leds/white/brightness
3 |
4 | chown system system /sys/class/leds/white/blink
5 | chown system system /sys/class/leds/white/duty_pcts
6 | chown system system /sys/class/leds/white/pause_hi
7 | chown system system /sys/class/leds/white/pause_lo
8 | chown system system /sys/class/leds/white/ramp_step_ms
9 | chown system system /sys/class/leds/white/start_idx
10 |
11 | chmod 660 /sys/class/leds/white/blink
12 | chmod 660 /sys/class/leds/white/duty_pcts
13 | chmod 660 /sys/class/leds/white/pause_hi
14 | chmod 660 /sys/class/leds/white/pause_lo
15 | chmod 660 /sys/class/leds/white/ramp_step_ms
16 | chmod 660 /sys/class/leds/white/start_idx
17 |
18 | service vendor.light-hal-2-0 /system/bin/hw/android.hardware.light@2.0-service.xiaomi_sm8150
19 | interface android.hardware.light@2.0::ILight default
20 | class hal
21 | user system
22 | group system
23 | # shutting off lights while powering-off
24 | shutdown critical
25 |
--------------------------------------------------------------------------------
/light/service.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #define LOG_TAG "android.hardware.light@2.0-service.xiaomi_sm8150"
18 |
19 | #include
20 | #include
21 |
22 | #include "Light.h"
23 |
24 | using android::hardware::configureRpcThreadpool;
25 | using android::hardware::joinRpcThreadpool;
26 |
27 | using android::hardware::light::V2_0::ILight;
28 | using android::hardware::light::V2_0::implementation::Light;
29 |
30 | using android::OK;
31 | using android::sp;
32 | using android::status_t;
33 |
34 | int main() {
35 | status_t status;
36 | sp service = nullptr;
37 |
38 | LOG(INFO) << "Light HAL service 2.0 is starting.";
39 |
40 | service = new Light();
41 | if (service == nullptr) {
42 | LOG(ERROR) << "Can not create an instance of Light HAL Iface, exiting.";
43 | goto shutdown;
44 | }
45 |
46 | configureRpcThreadpool(1, true /*callerWillJoin*/);
47 |
48 | status = service->registerAsService();
49 | if (status != OK) {
50 | LOG(ERROR) << "Could not register service for Light HAL Iface (" << status << ")";
51 | goto shutdown;
52 | }
53 |
54 | LOG(INFO) << "Light HAL service is ready.";
55 | joinRpcThreadpool();
56 | // Should not pass this line
57 |
58 | shutdown:
59 | // In normal operation, we don't expect the thread pool to exit
60 | LOG(ERROR) << "Light HAL service is shutting down.";
61 | return 1;
62 | }
63 |
--------------------------------------------------------------------------------
/lineage.dependencies:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "repository": "android_kernel_xiaomi_sm8150",
4 | "target_path": "kernel/xiaomi/sm8150"
5 | },
6 | {
7 | "repository": "android_packages_resources_devicesettings",
8 | "target_path": "packages/resources/devicesettings"
9 | },
10 | {
11 | "repository": "android_vendor_xiaomi_cepheus",
12 | "target_path": "vendor/xiaomi/cepheus"
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/lineage_cepheus.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2019 The LineageOS Project
3 | #
4 | # SPDX-License-Identifier: Apache-2.0
5 | #
6 |
7 | # Inherit from those products. Most specific first.
8 | $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
9 | $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk)
10 | $(call inherit-product, $(SRC_TARGET_DIR)/product/product_launched_with_p.mk)
11 |
12 | # Inherit from cepheus device
13 | $(call inherit-product, device/xiaomi/cepheus/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_cepheus
20 | PRODUCT_DEVICE := cepheus
21 | PRODUCT_BRAND := Xiaomi
22 | PRODUCT_MODEL := Mi 9
23 | PRODUCT_MANUFACTURER := Xiaomi
24 |
25 | BUILD_FINGERPRINT := "Xiaomi/cepheus/cepheus:9/PKQ1.181121.001/9.3.1:user/release-keys"
26 |
27 | PRODUCT_BUILD_PROP_OVERRIDES += \
28 | PRIVATE_BUILD_DESC="cepheus-user 9 PKQ1.181121.001 9.3.1 release-keys" \
29 | PRODUCT_NAME="cepheus" \
30 | TARGET_DEVICE="cepheus"
31 |
32 | PRODUCT_GMS_CLIENTID_BASE := android-xiaomi
33 |
--------------------------------------------------------------------------------
/org.ifaa.android.manager/Android.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2017-2019 The LineageOS Project
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | LOCAL_PATH := $(call my-dir)
18 |
19 | include $(CLEAR_VARS)
20 |
21 | LOCAL_SRC_FILES := \
22 | $(call all-Iaidl-files-under, lib) \
23 | $(call all-java-files-under, lib)
24 |
25 | LOCAL_MODULE := org.ifaa.android.manager
26 | LOCAL_MODULE_TAGS := optional
27 | LOCAL_MODULE_CLASS := JAVA_LIBRARIES
28 |
29 | include $(BUILD_JAVA_LIBRARY)
30 |
31 | include $(CLEAR_VARS)
32 |
33 | LOCAL_SRC_FILES := $(call all-java-files-under, src)
34 |
35 | LOCAL_CERTIFICATE := platform
36 | LOCAL_JAVA_LIBRARIES := org.ifaa.android.manager
37 | LOCAL_MODULE_TAGS := optional
38 | LOCAL_PACKAGE_NAME := IFAAService
39 | LOCAL_PRIVATE_PLATFORM_APIS := true
40 | LOCAL_PROGUARD_ENABLED := disabled
41 |
42 | include $(BUILD_PACKAGE)
43 |
--------------------------------------------------------------------------------
/org.ifaa.android.manager/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
21 |
22 |
25 |
26 |
28 |
29 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/org.ifaa.android.manager/lib/org/ifaa/android/manager/IFAAManager.java:
--------------------------------------------------------------------------------
1 | package org.ifaa.android.manager;
2 |
3 | import android.content.Context;
4 | import android.os.Build.VERSION;
5 | import android.os.SystemProperties;
6 |
7 | public abstract class IFAAManager {
8 | private static final int IFAA_VERSION_V2 = 2;
9 | private static final int IFAA_VERSION_V3 = 3;
10 | static int sIfaaVer;
11 | static boolean sIsFod = SystemProperties.getBoolean("ro.hardware.fp.fod", false);
12 |
13 | /**
14 | * 返回手机系统上支持的校验方式,目前IFAF协议1.0版本指纹为0x01、虹膜为0x02
15 | */
16 | public abstract int getSupportBIOTypes(Context context);
17 |
18 | /**
19 | * 启动系统的指纹/虹膜管理应用界面,让用户进行指纹录入。指纹录入是在系统的指纹管理应用中实现的,
20 | * 本函数的作用只是将指纹管理应用运行起来,直接进行页面跳转,方便用户录入。
21 | * @param context
22 | * @param authType 生物特征识别类型,指纹为1,虹膜为2
23 | * @return 0,成功启动指纹管理应用;-1,启动指纹管理应用失败。
24 | */
25 | public abstract int startBIOManager(Context context, int authType);
26 |
27 | /**
28 | * 通过ifaateeclient的so文件实现REE到TA的通道
29 | * @param context
30 | * @param param 用于传输到IFAA TA的数据buffer
31 | * @return IFAA TA返回给REE数据buffer
32 | */
33 | public native byte[] processCmd(Context context, byte[] param);
34 |
35 | /**
36 | * 获取设备型号,同一款机型型号需要保持一致
37 | */
38 | public abstract String getDeviceModel();
39 |
40 | /**
41 | * 获取IFAAManager接口定义版本,目前为1
42 | */
43 | public abstract int getVersion();
44 |
45 | /**
46 | * load so to communicate from REE to TEE
47 | */
48 | static {
49 | sIfaaVer = 1;
50 | if (sIsFod) {
51 | sIfaaVer = 3;
52 | } else if (VERSION.SDK_INT >= 24) {
53 | sIfaaVer = 2;
54 | } else {
55 | System.loadLibrary("teeclientjni");//teeclientjni for TA test binary //ifaateeclient
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/org.ifaa.android.manager/lib/org/ifaa/android/manager/IFAAManagerFactory.java:
--------------------------------------------------------------------------------
1 | package org.ifaa.android.manager;
2 |
3 | import android.content.Context;
4 |
5 | public class IFAAManagerFactory {
6 | public static IFAAManager getIFAAManager(Context context, int authType) {
7 | return IFAAManagerImpl.getInstance(context);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/org.ifaa.android.manager/lib/org/ifaa/android/manager/IFAAManagerV2.java:
--------------------------------------------------------------------------------
1 | package org.ifaa.android.manager;
2 |
3 | import android.content.Context;
4 |
5 | public abstract class IFAAManagerV2 extends IFAAManager {
6 | public abstract byte[] processCmdV2(Context paramContext, byte[] paramArrayOfByte);
7 | }
8 |
--------------------------------------------------------------------------------
/org.ifaa.android.manager/lib/org/ifaa/android/manager/IFAAManagerV3.java:
--------------------------------------------------------------------------------
1 | package org.ifaa.android.manager;
2 |
3 | public abstract class IFAAManagerV3 extends IFAAManagerV2 {
4 | public static final String KEY_FINGERPRINT_FULLVIEW = "org.ifaa.ext.key.CUSTOM_VIEW";
5 | public static final String KEY_GET_SENSOR_LOCATION = "org.ifaa.ext.key.GET_SENSOR_LOCATION";
6 | public static final String VALUE_FINGERPRINT_DISABLE = "disable";
7 | public static final String VLAUE_FINGERPRINT_ENABLE = "enable";
8 |
9 | public abstract String getExtInfo(int authType, String keyExtInfo);
10 |
11 | public abstract void setExtInfo(int authType, String keyExtInfo, String valExtInfo);
12 | }
13 |
--------------------------------------------------------------------------------
/org.ifaa.android.manager/lib/org/ifaa/android/manager/IIFAAService.aidl:
--------------------------------------------------------------------------------
1 | package org.ifaa.android.manager;
2 |
3 | interface IIFAAService {
4 | byte[] processCmd_v2(in byte[] param);
5 | }
6 |
--------------------------------------------------------------------------------
/org.ifaa.android.manager/src/org/ifaa/android/manager/IFAAService.java:
--------------------------------------------------------------------------------
1 | package org.ifaa.android.manager;
2 |
3 | import android.app.Service;
4 | import android.content.Intent;
5 | import android.os.HwBinder;
6 | import android.os.HwBlob;
7 | import android.os.HwParcel;
8 | import android.os.IBinder;
9 | import android.os.IHwBinder;
10 | import android.os.RemoteException;
11 | import android.util.Slog;
12 | import java.util.ArrayList;
13 | import java.util.Arrays;
14 |
15 | public class IFAAService extends Service {
16 | private static final boolean DEBUG = false;
17 | private static final String TAG = "IFAAService";
18 |
19 | private final IBinder mIFAABinder = new IIFAAService.Stub() {
20 | private static final String INTERFACE_DESCRIPTOR =
21 | "vendor.xiaomi.hardware.mlipay@1.0::IMlipayService";
22 | private static final String SERVICE_NAME =
23 | "vendor.xiaomi.hardware.mlipay@1.0::IMlipayService";
24 |
25 | private static final int CODE_PROCESS_CMD = 1;
26 |
27 | private IHwBinder mService;
28 |
29 | @Override
30 | public byte[] processCmd_v2(byte[] param) {
31 | HwParcel reply = new HwParcel();
32 | try {
33 | if (mService == null) {
34 | mService = HwBinder.getService(SERVICE_NAME, "default");
35 | }
36 | if (mService != null) {
37 | HwParcel data = new HwParcel();
38 | data.writeInterfaceToken(INTERFACE_DESCRIPTOR);
39 | ArrayList arrayList = new ArrayList(Arrays.asList(HwBlob.wrapArray(param)));
40 | data.writeInt8Vector(arrayList);
41 | data.writeInt32(arrayList.size());
42 | mService.transact(CODE_PROCESS_CMD, data, reply, 0);
43 | reply.verifySuccess();
44 | data.releaseTemporaryStorage();
45 | ArrayList readInt8Vector = reply.readInt8Vector();
46 | int size = readInt8Vector.size();
47 | byte[] result = new byte[size];
48 | for (int i = 0; i < size; i++) {
49 | result[i] = ((Byte) readInt8Vector.get(i)).byteValue();
50 | }
51 | return result;
52 | }
53 | } catch (RemoteException e) {
54 | if (DEBUG) Slog.e(TAG, "transact failed. " + e);
55 | } finally {
56 | reply.release();
57 | }
58 | if (DEBUG) Slog.e(TAG, "processCmdV2, return null");
59 | return null;
60 | }
61 | };
62 |
63 | @Override
64 | public IBinder onBind(Intent intent) {
65 | return mIFAABinder;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/overlay-lineage/lineage-sdk/lineage/res/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 |
20 | - 3082046c30820354a003020102020900e552a8ecb9011b7c300d06092a864886f70d0101050500308180310b300906035504061302434e3110300e060355040813074265696a696e673110300e060355040713074265696a696e67310f300d060355040a13065869616f6d69310d300b060355040b13044d495549310d300b060355040313044d495549311e301c06092a864886f70d010901160f6d697569407869616f6d692e636f6d301e170d3131313230363033323632365a170d3339303432333033323632365a308180310b300906035504061302434e3110300e060355040813074265696a696e673110300e060355040713074265696a696e67310f300d060355040a13065869616f6d69310d300b060355040b13044d495549310d300b060355040313044d495549311e301c06092a864886f70d010901160f6d697569407869616f6d692e636f6d30820120300d06092a864886f70d01010105000382010d00308201080282010100c786568a9aff253ad74c5d3e6fbffa12fed44cd3244f18960ec5511bb551e413115197234845112cc3df9bbacd3e0f4b3528cd87ed397d577dc9008e9cbc6a25fc0664d3a3f440243786db8b250d40f6f148c9a3cd6fbc2dd8d24039bd6a8972a1bdee28c308798bfa9bb3b549877b10f98e265f118c05f264537d95e29339157b9d2a31485e0c823521cca6d0b721a8432600076d669e20ac43aa588b52c11c2a51f04c6bb31ad6ae8573991afe8e4957d549591fcb83ec62d1da35b1727dc6b63001a5ef387b5a7186c1e68da1325772b5307b1bc739ef236b9efe06d52dcaf1e32768e3403e55e3ec56028cf5680cfb33971ccf7870572bc47d3e3affa385020103a381e83081e5301d0603551d0e0416041491ae2f8c72e305f92aa9f7452e2a3160b841a15c3081b50603551d230481ad3081aa801491ae2f8c72e305f92aa9f7452e2a3160b841a15ca18186a48183308180310b300906035504061302434e3110300e060355040813074265696a696e673110300e060355040713074265696a696e67310f300d060355040a13065869616f6d69310d300b060355040b13044d495549310d300b060355040313044d495549311e301c06092a864886f70d010901160f6d697569407869616f6d692e636f6d820900e552a8ecb9011b7c300c0603551d13040530030101ff300d06092a864886f70d010105050003820101003b3a699ceb497300f2ab86cbd41c513440bf60aa5c43984eb1da140ef30544d9fbbb3733df24b26f2703d7ffc645bf598a5e6023596a947e91731542f2c269d0816a69c92df9bfe8b1c9bc3c54c46c12355bb4629fe6020ca9d15f8d6155dc5586f5616db806ecea2d06bd83e32b5f13f5a04fe3e5aa514f05df3d555526c63d3d62acf00adee894b923c2698dc571bc52c756ffa7a2221d834d10cb7175c864c30872fe217c31442dff0040a67a2fb1c8ba63eac2d5ba3d8e76b4ff2a49b0db8a33ef4ae0dd0a840dd2a8714cb5531a56b786819ec9eb1051d91b23fde06bd9d0708f150c4f9efe6a416ca4a5e0c23a952af931ad3579fb4a8b19de98f64bd9
21 |
22 |
23 |
24 | true
25 |
26 |
--------------------------------------------------------------------------------
/overlay-lineage/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 | true
19 | 4
20 |
21 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/core/res/res/values-mcc302-mnc220/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 |
22 |
23 |
24 | - SUPL_HOST=supl.google.com
25 | - SUPL_PORT=7275
26 | - SUPL_VER=0x20000
27 | - SUPL_MODE=1
28 | - SUPL_ES=1
29 | - LPP_PROFILE=3
30 | - USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1
31 | - A_GLONASS_POS_PROTOCOL_SELECT=0
32 | - GPS_LOCK=0
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/core/res/res/values-mcc302-mnc221/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 |
22 |
23 |
24 | - SUPL_HOST=supl.google.com
25 | - SUPL_PORT=7275
26 | - SUPL_VER=0x20000
27 | - SUPL_MODE=1
28 | - SUPL_ES=1
29 | - LPP_PROFILE=3
30 | - USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1
31 | - A_GLONASS_POS_PROTOCOL_SELECT=0
32 | - GPS_LOCK=0
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/core/res/res/values-mcc302-mnc370/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 |
22 |
23 |
24 | - SUPL_HOST=supl.google.com
25 | - SUPL_PORT=7275
26 | - SUPL_VER=0x20000
27 | - SUPL_MODE=1
28 | - SUPL_ES=1
29 | - LPP_PROFILE=2
30 | - USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1
31 | - A_GLONASS_POS_PROTOCOL_SELECT=0
32 | - GPS_LOCK=0
33 |
34 |
35 |
36 | - %s
37 | - %s Wi-Fi
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/core/res/res/values-mcc302-mnc610/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 |
22 |
23 |
24 | - SUPL_HOST=supl.google.com
25 | - SUPL_PORT=7275
26 | - SUPL_VER=0x20000
27 | - SUPL_MODE=1
28 | - SUPL_ES=1
29 | - LPP_PROFILE=2
30 | - USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1
31 | - A_GLONASS_POS_PROTOCOL_SELECT=0
32 | - GPS_LOCK=0
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/core/res/res/values-mcc302-mnc640/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 |
22 |
23 |
24 | - SUPL_HOST=supl.google.com
25 | - SUPL_PORT=7275
26 | - SUPL_VER=0x20000
27 | - SUPL_MODE=1
28 | - SUPL_ES=1
29 | - LPP_PROFILE=2
30 | - USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1
31 | - A_GLONASS_POS_PROTOCOL_SELECT=0
32 | - GPS_LOCK=0
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/core/res/res/values-mcc302-mnc720/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 |
22 |
23 |
24 | - SUPL_HOST=supl.google.com
25 | - SUPL_PORT=7275
26 | - SUPL_VER=0x20000
27 | - SUPL_MODE=1
28 | - SUPL_ES=1
29 | - LPP_PROFILE=2
30 | - USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1
31 | - A_GLONASS_POS_PROTOCOL_SELECT=0
32 | - GPS_LOCK=0
33 |
34 |
35 |
36 | - %s
37 | - %s Wi-Fi
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 | true
22 |
23 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
22 |
23 |
24 | true
25 |
26 |
27 |
--------------------------------------------------------------------------------
/overlay/packages/apps/CarrierConfig/res/xml/vendor_device.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 |
--------------------------------------------------------------------------------
/overlay/packages/apps/CarrierConfig/res/xml/vendor_miui.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 | 22177
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
--------------------------------------------------------------------------------
/overlay/packages/apps/Settings/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
23 |
24 | - 0
25 | - -1
26 | - -1
27 |
28 |
29 |
--------------------------------------------------------------------------------
/parts/Android.bk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2017-2018 The LineageOS Project
3 | #
4 | # SPDX-License-Identifier: Apache-2.0
5 | #
6 |
7 | LOCAL_PATH := $(call my-dir)
8 |
9 | include $(CLEAR_VARS)
10 |
11 | LOCAL_MODULE_TAGS := optional
12 |
13 | LOCAL_SRC_FILES := $(call all-java-files-under, src)
14 |
15 | LOCAL_PACKAGE_NAME := XiaomiParts
16 | LOCAL_CERTIFICATE := platform
17 | LOCAL_PRIVATE_PLATFORM_APIS := true
18 | LOCAL_PRIVILEGED_MODULE := true
19 |
20 | LOCAL_USE_AAPT2 := true
21 |
22 | LOCAL_STATIC_ANDROID_LIBRARIES := \
23 | android-support-v4 \
24 | android-support-v13 \
25 | android-support-v7-recyclerview \
26 | android-support-v7-preference \
27 | android-support-v7-appcompat \
28 | android-support-v14-preference
29 |
30 | LOCAL_RESOURCE_DIR := \
31 | $(LOCAL_PATH)/res \
32 | $(TOP)/packages/resources/devicesettings/res
33 |
34 | LOCAL_PROGUARD_FLAG_FILES := proguard.flags
35 |
36 | include $(BUILD_PACKAGE)
37 |
--------------------------------------------------------------------------------
/parts/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
32 |
33 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
46 |
47 |
48 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/parts/proguard.flags:
--------------------------------------------------------------------------------
1 | -keepclasseswithmembers class * {
2 | public (android.content.Context, android.util.AttributeSet);
3 | }
4 |
5 | -keep class ** extends android.support.v14.preference.PreferenceFragment
6 | -keep class org.lineageos.settings.doze.* {
7 | *;
8 | }
9 |
--------------------------------------------------------------------------------
/parts/res/color/switch_bar_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/parts/res/color/switchbar_switch_thumb_tint.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/parts/res/color/switchbar_switch_track_tint.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/parts/res/drawable/switchbar_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/parts/res/layout/doze.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/parts/res/layout/switch_bar.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
26 |
27 |
39 |
40 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/parts/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
27 |
28 |
30 |
31 |
36 |
37 |
40 |
41 |
47 |
48 |
50 |
51 |
54 |
55 |
57 |
58 |
62 |
63 |
--------------------------------------------------------------------------------
/parts/res/xml/doze_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
26 |
27 |
30 |
31 |
36 |
37 |
38 |
39 |
42 |
43 |
48 |
49 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/parts/src/org/lineageos/settings/BootCompletedReceiver.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 The CyanogenMod Project
3 | * 2017-2019 The LineageOS Project
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.lineageos.settings;
19 |
20 | import android.content.BroadcastReceiver;
21 | import android.content.Context;
22 | import android.content.Intent;
23 | import android.util.Log;
24 |
25 | import org.lineageos.settings.doze.DozeUtils;
26 |
27 | public class BootCompletedReceiver extends BroadcastReceiver {
28 |
29 | private static final boolean DEBUG = false;
30 | private static final String TAG = "XiaomiParts";
31 |
32 | @Override
33 | public void onReceive(final Context context, Intent intent) {
34 | if (DEBUG) Log.d(TAG, "Received boot completed intent");
35 | DozeUtils.checkDozeService(context);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/parts/src/org/lineageos/settings/doze/DozeService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 The CyanogenMod Project
3 | * 2017-2018 The LineageOS Project
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.lineageos.settings.doze;
19 |
20 | import android.app.Service;
21 | import android.content.BroadcastReceiver;
22 | import android.content.Context;
23 | import android.content.Intent;
24 | import android.content.IntentFilter;
25 | import android.os.IBinder;
26 | import android.util.Log;
27 |
28 | public class DozeService extends Service {
29 | private static final String TAG = "DozeService";
30 | private static final boolean DEBUG = false;
31 |
32 | private ProximitySensor mProximitySensor;
33 | private PickupSensor mPickupSensor;
34 |
35 | @Override
36 | public void onCreate() {
37 | if (DEBUG) Log.d(TAG, "Creating service");
38 | mProximitySensor = new ProximitySensor(this);
39 | mPickupSensor = new PickupSensor(this);
40 |
41 | IntentFilter screenStateFilter = new IntentFilter();
42 | screenStateFilter.addAction(Intent.ACTION_SCREEN_ON);
43 | screenStateFilter.addAction(Intent.ACTION_SCREEN_OFF);
44 | registerReceiver(mScreenStateReceiver, screenStateFilter);
45 | }
46 |
47 | @Override
48 | public int onStartCommand(Intent intent, int flags, int startId) {
49 | if (DEBUG) Log.d(TAG, "Starting service");
50 | return START_STICKY;
51 | }
52 |
53 | @Override
54 | public void onDestroy() {
55 | if (DEBUG) Log.d(TAG, "Destroying service");
56 | super.onDestroy();
57 | this.unregisterReceiver(mScreenStateReceiver);
58 | mProximitySensor.disable();
59 | mPickupSensor.disable();
60 | }
61 |
62 | @Override
63 | public IBinder onBind(Intent intent) {
64 | return null;
65 | }
66 |
67 | private void onDisplayOn() {
68 | if (DEBUG) Log.d(TAG, "Display on");
69 | if (DozeUtils.isPickUpEnabled(this)) {
70 | mPickupSensor.disable();
71 | }
72 | if (DozeUtils.isHandwaveGestureEnabled(this) ||
73 | DozeUtils.isPocketGestureEnabled(this)) {
74 | mProximitySensor.disable();
75 | }
76 | }
77 |
78 | private void onDisplayOff() {
79 | if (DEBUG) Log.d(TAG, "Display off");
80 | if (DozeUtils.isPickUpEnabled(this)) {
81 | mPickupSensor.enable();
82 | }
83 | if (DozeUtils.isHandwaveGestureEnabled(this) ||
84 | DozeUtils.isPocketGestureEnabled(this)) {
85 | mProximitySensor.enable();
86 | }
87 | }
88 |
89 | private BroadcastReceiver mScreenStateReceiver = new BroadcastReceiver() {
90 | @Override
91 | public void onReceive(Context context, Intent intent) {
92 | if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) {
93 | onDisplayOn();
94 | } else if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
95 | onDisplayOff();
96 | }
97 | }
98 | };
99 | }
100 |
--------------------------------------------------------------------------------
/parts/src/org/lineageos/settings/doze/DozeSettingsActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015-2016 The CyanogenMod Project
3 | * 2017 The LineageOS Project
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.lineageos.settings.doze;
19 |
20 | import android.os.Bundle;
21 | import android.preference.PreferenceActivity;
22 |
23 | public class DozeSettingsActivity extends PreferenceActivity {
24 |
25 | private static final String TAG_DOZE = "doze";
26 |
27 | @Override
28 | protected void onCreate(Bundle savedInstanceState) {
29 | super.onCreate(savedInstanceState);
30 |
31 | getFragmentManager().beginTransaction().replace(android.R.id.content,
32 | new DozeSettingsFragment(), TAG_DOZE).commit();
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/parts/src/org/lineageos/settings/doze/DozeUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 The CyanogenMod Project
3 | * 2017-2019 The LineageOS Project
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.lineageos.settings.doze;
19 |
20 | import android.content.Context;
21 | import android.content.Intent;
22 | import android.content.pm.PackageManager;
23 | import android.hardware.Sensor;
24 | import android.hardware.SensorManager;
25 | import android.os.UserHandle;
26 | import android.support.v7.preference.PreferenceManager;
27 | import android.provider.Settings;
28 | import android.util.Log;
29 |
30 | import com.android.internal.hardware.AmbientDisplayConfiguration;
31 |
32 | import static android.provider.Settings.Secure.DOZE_ALWAYS_ON;
33 | import static android.provider.Settings.Secure.DOZE_ENABLED;
34 |
35 | public final class DozeUtils {
36 |
37 | private static final String TAG = "DozeUtils";
38 | private static final boolean DEBUG = false;
39 |
40 | private static final String DOZE_INTENT = "com.android.systemui.doze.pulse";
41 |
42 | protected static final String ALWAYS_ON_DISPLAY = "always_on_display";
43 |
44 | protected static final String CATEG_PICKUP_SENSOR = "pickup_sensor";
45 | protected static final String CATEG_PROX_SENSOR = "proximity_sensor";
46 |
47 | protected static final String GESTURE_PICK_UP_KEY = "gesture_pick_up";
48 | protected static final String GESTURE_HAND_WAVE_KEY = "gesture_hand_wave";
49 | protected static final String GESTURE_POCKET_KEY = "gesture_pocket";
50 |
51 | public static void startService(Context context) {
52 | if (DEBUG) Log.d(TAG, "Starting service");
53 | context.startServiceAsUser(new Intent(context, DozeService.class),
54 | UserHandle.CURRENT);
55 | }
56 |
57 | protected static void stopService(Context context) {
58 | if (DEBUG) Log.d(TAG, "Stopping service");
59 | context.stopServiceAsUser(new Intent(context, DozeService.class),
60 | UserHandle.CURRENT);
61 | }
62 |
63 | public static void checkDozeService(Context context) {
64 | if (isDozeEnabled(context) && !isAlwaysOnEnabled(context) && sensorsEnabled(context)) {
65 | startService(context);
66 | } else {
67 | stopService(context);
68 | }
69 | }
70 |
71 | protected static boolean getProxCheckBeforePulse(Context context) {
72 | try {
73 | Context con = context.createPackageContext("com.android.systemui", 0);
74 | int id = con.getResources().getIdentifier("doze_proximity_check_before_pulse",
75 | "bool", "com.android.systemui");
76 | return con.getResources().getBoolean(id);
77 | } catch (PackageManager.NameNotFoundException e) {
78 | return false;
79 | }
80 | }
81 |
82 | protected static boolean enableDoze(Context context, boolean enable) {
83 | return Settings.Secure.putInt(context.getContentResolver(),
84 | DOZE_ENABLED, enable ? 1 : 0);
85 | }
86 |
87 | public static boolean isDozeEnabled(Context context) {
88 | return Settings.Secure.getInt(context.getContentResolver(),
89 | DOZE_ENABLED, 1) != 0;
90 | }
91 |
92 | protected static void launchDozePulse(Context context) {
93 | if (DEBUG) Log.d(TAG, "Launch doze pulse");
94 | context.sendBroadcastAsUser(new Intent(DOZE_INTENT),
95 | new UserHandle(UserHandle.USER_CURRENT));
96 | }
97 |
98 | protected static boolean enableAlwaysOn(Context context, boolean enable) {
99 | return Settings.Secure.putIntForUser(context.getContentResolver(),
100 | DOZE_ALWAYS_ON, enable ? 1 : 0, UserHandle.USER_CURRENT);
101 | }
102 |
103 | protected static boolean isAlwaysOnEnabled(Context context) {
104 | final boolean enabledByDefault = context.getResources()
105 | .getBoolean(com.android.internal.R.bool.config_dozeAlwaysOnEnabled);
106 |
107 | return Settings.Secure.getIntForUser(context.getContentResolver(),
108 | DOZE_ALWAYS_ON, alwaysOnDisplayAvailable(context) && enabledByDefault ? 1 : 0,
109 | UserHandle.USER_CURRENT) != 0;
110 | }
111 |
112 | protected static boolean alwaysOnDisplayAvailable(Context context) {
113 | return new AmbientDisplayConfiguration(context).alwaysOnAvailable();
114 | }
115 |
116 | protected static boolean isGestureEnabled(Context context, String gesture) {
117 | return PreferenceManager.getDefaultSharedPreferences(context)
118 | .getBoolean(gesture, false);
119 | }
120 |
121 | protected static boolean isPickUpEnabled(Context context) {
122 | return isGestureEnabled(context, GESTURE_PICK_UP_KEY);
123 | }
124 |
125 | protected static boolean isHandwaveGestureEnabled(Context context) {
126 | return isGestureEnabled(context, GESTURE_HAND_WAVE_KEY);
127 | }
128 |
129 | protected static boolean isPocketGestureEnabled(Context context) {
130 | return isGestureEnabled(context, GESTURE_POCKET_KEY);
131 | }
132 |
133 | public static boolean sensorsEnabled(Context context) {
134 | return isPickUpEnabled(context) || isHandwaveGestureEnabled(context)
135 | || isPocketGestureEnabled(context);
136 | }
137 |
138 | protected static Sensor getSensor(SensorManager sm, String type) {
139 | for (Sensor sensor : sm.getSensorList(Sensor.TYPE_ALL)) {
140 | if (type.equals(sensor.getStringType())) {
141 | return sensor;
142 | }
143 | }
144 | return null;
145 | }
146 | }
147 |
--------------------------------------------------------------------------------
/parts/src/org/lineageos/settings/doze/PickupSensor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 The CyanogenMod Project
3 | * 2017-2018 The LineageOS Project
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.lineageos.settings.doze;
19 |
20 | import android.content.Context;
21 | import android.hardware.Sensor;
22 | import android.hardware.SensorEvent;
23 | import android.hardware.SensorEventListener;
24 | import android.hardware.SensorManager;
25 | import android.os.SystemClock;
26 | import android.util.Log;
27 |
28 | import java.util.concurrent.ExecutorService;
29 | import java.util.concurrent.Executors;
30 | import java.util.concurrent.Future;
31 |
32 | public class PickupSensor implements SensorEventListener {
33 |
34 | private static final boolean DEBUG = false;
35 | private static final String TAG = "PickupSensor";
36 |
37 | private static final int MIN_PULSE_INTERVAL_MS = 2500;
38 |
39 | private SensorManager mSensorManager;
40 | private Sensor mSensor;
41 | private Context mContext;
42 | private ExecutorService mExecutorService;
43 |
44 | private long mEntryTimestamp;
45 |
46 | public PickupSensor(Context context) {
47 | mContext = context;
48 | mSensorManager = mContext.getSystemService(SensorManager.class);
49 | mSensor = DozeUtils.getSensor(mSensorManager, "xiaomi.sensor.pickup");
50 | mExecutorService = Executors.newSingleThreadExecutor();
51 | }
52 |
53 | private Future> submit(Runnable runnable) {
54 | return mExecutorService.submit(runnable);
55 | }
56 |
57 | @Override
58 | public void onSensorChanged(SensorEvent event) {
59 | if (DEBUG) Log.d(TAG, "Got sensor event: " + event.values[0]);
60 |
61 | long delta = SystemClock.elapsedRealtime() - mEntryTimestamp;
62 | if (delta < MIN_PULSE_INTERVAL_MS) {
63 | return;
64 | }
65 |
66 | mEntryTimestamp = SystemClock.elapsedRealtime();
67 |
68 | if (event.values[0] == 1) {
69 | DozeUtils.launchDozePulse(mContext);
70 | }
71 | }
72 |
73 | @Override
74 | public void onAccuracyChanged(Sensor sensor, int accuracy) {
75 | /* Empty */
76 | }
77 |
78 | protected void enable() {
79 | if (DEBUG) Log.d(TAG, "Enabling");
80 | submit(() -> {
81 | mSensorManager.registerListener(this, mSensor,
82 | SensorManager.SENSOR_DELAY_NORMAL);
83 | mEntryTimestamp = SystemClock.elapsedRealtime();
84 | });
85 | }
86 |
87 | protected void disable() {
88 | if (DEBUG) Log.d(TAG, "Disabling");
89 | submit(() -> {
90 | mSensorManager.unregisterListener(this, mSensor);
91 | });
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/parts/src/org/lineageos/settings/doze/ProximitySensor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 The CyanogenMod Project
3 | * 2017-2018 The LineageOS Project
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.lineageos.settings.doze;
19 |
20 | import android.content.Context;
21 | import android.hardware.Sensor;
22 | import android.hardware.SensorEvent;
23 | import android.hardware.SensorEventListener;
24 | import android.hardware.SensorManager;
25 | import android.util.Log;
26 |
27 | import java.util.concurrent.ExecutorService;
28 | import java.util.concurrent.Executors;
29 | import java.util.concurrent.Future;
30 |
31 | public class ProximitySensor implements SensorEventListener {
32 |
33 | private static final boolean DEBUG = false;
34 | private static final String TAG = "ProximitySensor";
35 |
36 | // Maximum time for the hand to cover the sensor: 1s
37 | private static final int HANDWAVE_MAX_DELTA_NS = 1000 * 1000 * 1000;
38 |
39 | // Minimum time until the device is considered to have been in the pocket: 2s
40 | private static final int POCKET_MIN_DELTA_NS = 2000 * 1000 * 1000;
41 |
42 | private SensorManager mSensorManager;
43 | private Sensor mSensor;
44 | private Context mContext;
45 | private ExecutorService mExecutorService;
46 |
47 | private boolean mSawNear = false;
48 | private long mInPocketTime = 0;
49 |
50 | public ProximitySensor(Context context) {
51 | mContext = context;
52 | mSensorManager = mContext.getSystemService(SensorManager.class);
53 | mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY, false);
54 | mExecutorService = Executors.newSingleThreadExecutor();
55 | }
56 |
57 | private Future> submit(Runnable runnable) {
58 | return mExecutorService.submit(runnable);
59 | }
60 |
61 | @Override
62 | public void onSensorChanged(SensorEvent event) {
63 | boolean isNear = event.values[0] < mSensor.getMaximumRange();
64 | if (mSawNear && !isNear) {
65 | if (shouldPulse(event.timestamp)) {
66 | DozeUtils.launchDozePulse(mContext);
67 | }
68 | } else {
69 | mInPocketTime = event.timestamp;
70 | }
71 | mSawNear = isNear;
72 | }
73 |
74 | private boolean shouldPulse(long timestamp) {
75 | long delta = timestamp - mInPocketTime;
76 |
77 | if (DozeUtils.isHandwaveGestureEnabled(mContext) &&
78 | DozeUtils.isPocketGestureEnabled(mContext)) {
79 | return true;
80 | } else if (DozeUtils.isHandwaveGestureEnabled(mContext)) {
81 | return delta < HANDWAVE_MAX_DELTA_NS;
82 | } else if (DozeUtils.isPocketGestureEnabled(mContext)) {
83 | return delta >= POCKET_MIN_DELTA_NS;
84 | }
85 | return false;
86 | }
87 |
88 | @Override
89 | public void onAccuracyChanged(Sensor sensor, int accuracy) {
90 | /* Empty */
91 | }
92 |
93 | protected void enable() {
94 | if (DEBUG) Log.d(TAG, "Enabling");
95 | submit(() -> {
96 | mSensorManager.registerListener(this, mSensor,
97 | SensorManager.SENSOR_DELAY_NORMAL);
98 | });
99 | }
100 |
101 | protected void disable() {
102 | if (DEBUG) Log.d(TAG, "Disabling");
103 | submit(() -> {
104 | mSensorManager.unregisterListener(this, mSensor);
105 | });
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/recovery/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 | LOCAL_C_INCLUDES := \
5 | bootable/recovery \
6 | bootable/recovery/edify/include \
7 | bootable/recovery/otautil/include
8 | LOCAL_SRC_FILES := recovery_updater.cpp
9 | LOCAL_MODULE := librecovery_updater_xiaomi
10 | LOCAL_MODULE_TAGS := eng
11 | include $(BUILD_STATIC_LIBRARY)
12 |
--------------------------------------------------------------------------------
/recovery/init.recovery.qcom.rc:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2009-2012, 2014-2015, 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 fs
29 | wait /dev/block/platform/soc/${ro.boot.bootdevice}
30 | symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
31 | chmod 0660 /dev/qseecom
32 | chown system drmrpc /dev/qseecom
33 | chmod 0664 /dev/ion
34 | chown system system /dev/ion
35 | install_keyring
36 | export ANDROID_ROOT /system_root
37 |
38 | on init
39 | mkdir /system/bin
40 | mkdir /system/etc
41 | symlink /system/etc /etc
42 | # symlink /sbin/busybox /system/bin/sh
43 | symlink /vendor/manifest.xml /system/manifest.xml
44 | # start prepdecrypt
45 | start hwservicemanager
46 |
47 |
48 | service prepdecrypt /sbin/prepdecrypt.sh
49 | oneshot
50 | user root
51 | group root
52 | disabled
53 | seclabel u:r:recovery:s0
54 |
55 | # Separate copy needed to use /sbin/linker64 instead of /system/bin/linker64
56 | service sbinqseecomd /sbin/qseecomd
57 | user root
58 | group root
59 | disabled
60 | seclabel u:r:recovery:s0
61 |
62 | service hwservicemanager /sbin/hwservicemanager
63 | user root
64 | group root
65 | disabled
66 | onrestart setprop hwservicemanager.ready false
67 | seclabel u:r:recovery:s0
68 |
69 | service servicemanager /sbin/servicemanager
70 | user root
71 | group root readproc
72 | disabled
73 | seclabel u:r:recovery:s0
74 |
75 | service keystore_auth /sbin/keystore_auth
76 | oneshot
77 | user system
78 | group root
79 | disabled
80 | seclabel u:r:recovery:s0
81 |
82 | # keystore is started and stopped on demand by TWRP
83 | service keystore /sbin/keystore /tmp/misc/keystore
84 | user root
85 | group root drmrpc readproc
86 | disabled
87 | seclabel u:r:recovery:s0
88 |
89 | service gatekeeper-1-0 /sbin/android.hardware.gatekeeper@1.0-service-qti
90 | user root
91 | group root
92 | disabled
93 | seclabel u:r:recovery:s0
94 |
95 |
96 | service keymaster-4-0 /sbin/android.hardware.keymaster@4.0-service-qti
97 | user root
98 | group root
99 | disabled
100 | seclabel u:r:recovery:s0
101 |
102 | on boot
103 | setprop sys.usb.config adb
104 |
105 | on property:prep.decrypt=1
106 | start sbinqseecomd
107 | start hwservicemanager
108 | start servicemanager
109 | start keymaster-4-0
110 |
111 | on property:crypto.ready=0
112 | stop sbinqseecomd
113 | stop keymaster-4-0
114 | stop gatekeeper-1-0
115 | stop servicemanager
116 |
117 | on property:crypto.ready=1
118 | start sbinqseecomd
119 | start hwservicemanager
120 | start servicemanager
121 | start keymaster-4-0
122 | start gatekeeper-1-0
123 |
124 | on property:vendor.sys.listeners.registered=true
125 | start keymaster-4-0
126 | start gatekeeper-1-0
127 | start servicemanager
128 |
--------------------------------------------------------------------------------
/recovery/recovery_updater.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016, The CyanogenMod Project
3 | * Copyright (C) 2017, The LineageOS Project
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | #include
19 | #include
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 | #include
29 |
30 | #include
31 | #include
32 |
33 | #include "edify/expr.h"
34 | #include "otautil/error_code.h"
35 |
36 | #define MAX(a, b) (((a) > (b)) ? (a) : (b))
37 |
38 | #define ALPHABET_LEN 256
39 |
40 | #define BASEBAND_PART_PATH "/dev/block/bootdevice/by-name/modem"
41 | #define BASEBAND_VER_STR_START "QC_IMAGE_VERSION_STRING=MPSS.AT."
42 | #define BASEBAND_VER_STR_START_LEN 32
43 | #define BASEBAND_VER_BUF_LEN 255
44 |
45 | /* Boyer-Moore string search implementation from Wikipedia */
46 |
47 | /* Return longest suffix length of suffix ending at str[p] */
48 | static int max_suffix_len(const char* str, size_t str_len, size_t p) {
49 | uint32_t i;
50 |
51 | for (i = 0; (str[p - i] == str[str_len - 1 - i]) && (i < p);) {
52 | i++;
53 | }
54 |
55 | return i;
56 | }
57 |
58 | /* Generate table of distance between last character of pat and rightmost
59 | * occurrence of character c in pat
60 | */
61 | static void bm_make_delta1(int* delta1, const char* pat, size_t pat_len) {
62 | uint32_t i;
63 | for (i = 0; i < ALPHABET_LEN; i++) {
64 | delta1[i] = pat_len;
65 | }
66 | for (i = 0; i < pat_len - 1; i++) {
67 | uint8_t idx = (uint8_t)pat[i];
68 | delta1[idx] = pat_len - 1 - i;
69 | }
70 | }
71 |
72 | /* Generate table of next possible full match from mismatch at pat[p] */
73 | static void bm_make_delta2(int* delta2, const char* pat, size_t pat_len) {
74 | int p;
75 | uint32_t last_prefix = pat_len - 1;
76 |
77 | for (p = pat_len - 1; p >= 0; p--) {
78 | /* Compare whether pat[p-pat_len] is suffix of pat */
79 | if (strncmp(pat + p, pat, pat_len - p) == 0) {
80 | last_prefix = p + 1;
81 | }
82 | delta2[p] = last_prefix + (pat_len - 1 - p);
83 | }
84 |
85 | for (p = 0; p < (int)pat_len - 1; p++) {
86 | /* Get longest suffix of pattern ending on character pat[p] */
87 | int suf_len = max_suffix_len(pat, pat_len, p);
88 | if (pat[p - suf_len] != pat[pat_len - 1 - suf_len]) {
89 | delta2[pat_len - 1 - suf_len] = pat_len - 1 - p + suf_len;
90 | }
91 | }
92 | }
93 |
94 | static char* bm_search(const char* str, size_t str_len, const char* pat, size_t pat_len) {
95 | int delta1[ALPHABET_LEN];
96 | int delta2[pat_len];
97 | int i;
98 |
99 | bm_make_delta1(delta1, pat, pat_len);
100 | bm_make_delta2(delta2, pat, pat_len);
101 |
102 | if (pat_len == 0) {
103 | return (char*)str;
104 | }
105 |
106 | i = pat_len - 1;
107 | while (i < (int)str_len) {
108 | int j = pat_len - 1;
109 | while (j >= 0 && (str[i] == pat[j])) {
110 | i--;
111 | j--;
112 | }
113 | if (j < 0) {
114 | return (char*)(str + i + 1);
115 | }
116 | i += MAX(delta1[(uint8_t)str[i]], delta2[j]);
117 | }
118 |
119 | return NULL;
120 | }
121 |
122 | static int get_baseband_version(char *ver_str, size_t len) {
123 | int ret = 0;
124 | int fd;
125 | int baseband_size;
126 | char *baseband_data = NULL;
127 | char *offset = NULL;
128 |
129 | fd = open(BASEBAND_PART_PATH, O_RDONLY);
130 | if (fd < 0) {
131 | ret = errno;
132 | goto err_ret;
133 | }
134 |
135 | baseband_size = lseek64(fd, 0, SEEK_END);
136 | if (baseband_size == -1) {
137 | ret = errno;
138 | goto err_fd_close;
139 | }
140 |
141 | baseband_data = (char *) mmap(NULL, baseband_size, PROT_READ, MAP_PRIVATE, fd, 0);
142 | if (baseband_data == (char *)-1) {
143 | ret = errno;
144 | goto err_fd_close;
145 | }
146 |
147 | /* Do Boyer-Moore search across BASEBAND data */
148 | offset = bm_search(baseband_data, baseband_size, BASEBAND_VER_STR_START,
149 | BASEBAND_VER_STR_START_LEN);
150 | if (offset != NULL) {
151 | strncpy(ver_str, offset + BASEBAND_VER_STR_START_LEN, len);
152 | } else {
153 | ret = -ENOENT;
154 | }
155 |
156 | munmap(baseband_data, baseband_size);
157 | err_fd_close:
158 | close(fd);
159 | err_ret:
160 | return ret;
161 | }
162 |
163 | /* verify_baseband("BASEBAND_VERSION", "BASEBAND_VERSION", ...) */
164 | Value * VerifyBasebandFn(const char *name, State *state,
165 | const std::vector>& argv) {
166 | char current_baseband_version[BASEBAND_VER_BUF_LEN];
167 | int ret;
168 |
169 | ret = get_baseband_version(current_baseband_version, BASEBAND_VER_BUF_LEN);
170 | if (ret) {
171 | return ErrorAbort(state, kFreadFailure, "%s() failed to read current baseband version: %d",
172 | name, ret);
173 | }
174 |
175 | std::vector args;
176 | if (!ReadArgs(state, argv, &args)) {
177 | return ErrorAbort(state, kArgsParsingFailure, "%s() error parsing arguments", name);
178 | }
179 |
180 | ret = 0;
181 | for (auto &baseband_version : args) {
182 | if (strncmp(baseband_version.c_str(), current_baseband_version,
183 | strlen(baseband_version.c_str())) == 0) {
184 | ret = 1;
185 | break;
186 | }
187 | }
188 |
189 | return StringValue(strdup(ret ? "1" : "0"));
190 | }
191 |
192 | void Register_librecovery_updater_xiaomi() {
193 | RegisterFunction("xiaomi.verify_baseband", VerifyBasebandFn);
194 | }
195 |
--------------------------------------------------------------------------------
/releasetools.py:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2009 The Android Open Source Project
2 | # Copyright (c) 2011, The Linux Foundation. All rights reserved.
3 | # Copyright (C) 2017-2018 The LineageOS Project
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | import hashlib
18 | import common
19 | import re
20 |
21 | def FullOTA_InstallEnd(info):
22 | OTA_InstallEnd(info)
23 | return
24 |
25 | def IncrementalOTA_InstallEnd(info):
26 | OTA_InstallEnd(info)
27 | return
28 |
29 | def AddImage(info, basename, dest):
30 | path = "IMAGES/" + basename
31 | if path not in info.input_zip.namelist():
32 | return
33 |
34 | data = info.input_zip.read(path)
35 | common.ZipWriteStr(info.output_zip, basename, data)
36 | info.script.AppendExtra('package_extract_file("%s", "%s");' % (basename, dest))
37 |
38 | def OTA_InstallEnd(info):
39 | info.script.Print("Patching firmware images...")
40 | AddImage(info, "dtbo.img", "/dev/block/bootdevice/by-name/dtbo")
41 | return
42 |
--------------------------------------------------------------------------------
/rootdir/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH:= $(call my-dir)
2 | include $(CLEAR_VARS)
3 |
4 | # files that live under device/qcom/common/rootdir/etc/
5 |
6 | include $(CLEAR_VARS)
7 | LOCAL_MODULE := init.qcom.early_boot.sh
8 | LOCAL_MODULE_TAGS := optional eng
9 | LOCAL_MODULE_CLASS := ETC
10 | LOCAL_SRC_FILES := bin/init.qcom.early_boot.sh
11 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
12 | include $(BUILD_PREBUILT)
13 |
14 | include $(CLEAR_VARS)
15 | LOCAL_MODULE := init.qcom.post_boot.sh
16 | LOCAL_MODULE_TAGS := optional eng
17 | LOCAL_MODULE_CLASS := ETC
18 | LOCAL_SRC_FILES := bin/init.qcom.post_boot.sh
19 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
20 | include $(BUILD_PREBUILT)
21 |
22 | include $(CLEAR_VARS)
23 | LOCAL_MODULE := init.qcom.rc
24 | LOCAL_MODULE_TAGS := optional eng
25 | LOCAL_MODULE_CLASS := ETC
26 | LOCAL_SRC_FILES := etc/init.qcom.rc
27 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw
28 | include $(BUILD_PREBUILT)
29 |
30 | include $(CLEAR_VARS)
31 | LOCAL_MODULE := init.qcom.sh
32 | LOCAL_MODULE_TAGS := optional eng
33 | LOCAL_MODULE_CLASS := ETC
34 | LOCAL_SRC_FILES := bin/init.qcom.sh
35 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
36 | include $(BUILD_PREBUILT)
37 |
38 | include $(CLEAR_VARS)
39 | LOCAL_MODULE := init.class_main.sh
40 | LOCAL_MODULE_TAGS := optional eng
41 | LOCAL_MODULE_CLASS := ETC
42 | LOCAL_SRC_FILES := bin/init.class_main.sh
43 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
44 | include $(BUILD_PREBUILT)
45 |
46 | include $(CLEAR_VARS)
47 | LOCAL_MODULE := init.qcom.sensors.sh
48 | LOCAL_MODULE_TAGS := optional eng
49 | LOCAL_MODULE_CLASS := ETC
50 | LOCAL_SRC_FILES := bin/init.qcom.sensors.sh
51 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
52 | include $(BUILD_PREBUILT)
53 |
54 | include $(CLEAR_VARS)
55 | LOCAL_MODULE := init.qti.qseecomd.sh
56 | LOCAL_MODULE_TAGS := optional eng
57 | LOCAL_MODULE_CLASS := ETC
58 | LOCAL_SRC_FILES := bin/init.qti.qseecomd.sh
59 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
60 | include $(BUILD_PREBUILT)
61 |
62 | include $(CLEAR_VARS)
63 | LOCAL_MODULE := init.qcom.usb.rc
64 | LOCAL_MODULE_TAGS := optional eng
65 | LOCAL_MODULE_CLASS := ETC
66 | LOCAL_SRC_FILES := etc/init.qcom.usb.rc
67 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw
68 | include $(BUILD_PREBUILT)
69 |
70 | include $(CLEAR_VARS)
71 | LOCAL_MODULE := init.msm.usb.configfs.rc
72 | LOCAL_MODULE_TAGS := optional eng
73 | LOCAL_MODULE_CLASS := ETC
74 | LOCAL_SRC_FILES := etc/init.msm.usb.configfs.rc
75 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw
76 | include $(BUILD_PREBUILT)
77 |
78 | include $(CLEAR_VARS)
79 | LOCAL_MODULE := init.qcom.usb.sh
80 | LOCAL_MODULE_TAGS := optional eng
81 | LOCAL_MODULE_CLASS := ETC
82 | LOCAL_SRC_FILES := bin/init.qcom.usb.sh
83 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
84 | include $(BUILD_PREBUILT)
85 |
86 | include $(CLEAR_VARS)
87 | LOCAL_MODULE := ueventd.qcom.rc
88 | LOCAL_MODULE_STEM := ueventd.rc
89 | LOCAL_MODULE_TAGS := optional eng
90 | LOCAL_MODULE_CLASS := ETC
91 | LOCAL_SRC_FILES := etc/ueventd.qcom.rc
92 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)
93 | include $(BUILD_PREBUILT)
94 |
95 | include $(CLEAR_VARS)
96 | LOCAL_MODULE := init.target.rc
97 | LOCAL_MODULE_TAGS := optional eng
98 | LOCAL_MODULE_CLASS := ETC
99 | LOCAL_SRC_FILES := etc/init.target.rc
100 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw
101 | include $(BUILD_PREBUILT)
102 |
103 | include $(CLEAR_VARS)
104 | LOCAL_MODULE := fstab.qcom
105 | LOCAL_MODULE_TAGS := optional eng
106 | LOCAL_MODULE_CLASS := ETC
107 | LOCAL_SRC_FILES := etc/fstab.qcom
108 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)
109 | include $(BUILD_PREBUILT)
110 |
--------------------------------------------------------------------------------
/rootdir/bin/init.class_main.sh:
--------------------------------------------------------------------------------
1 | #! /vendor/bin/sh
2 |
3 | # Copyright (c) 2013-2018, 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 | qcrild_status=true
37 |
38 | case "$baseband" in
39 | "apq" | "sda" | "qcs" )
40 | setprop ro.vendor.radio.noril yes
41 | stop ril-daemon
42 | stop vendor.ril-daemon
43 | stop vendor.qcrild
44 | start vendor.ipacm
45 | esac
46 |
47 | case "$baseband" in
48 | "sa8")
49 | start vendor.ipacm
50 | esac
51 |
52 | case "$baseband" in
53 | "msm" | "csfb" | "svlte2a" | "mdm" | "mdm2" | "sglte" | "sglte2" | "dsda2" | "unknown" | "dsda3")
54 | start vendor.qmuxd
55 | esac
56 |
57 | case "$baseband" in
58 | "msm" | "csfb" | "svlte2a" | "mdm" | "mdm2" | "sglte" | "sglte2" | "dsda2" | "unknown" | "dsda3" | "sdm" | "sdx" | "sm6")
59 |
60 | # For older modem packages launch ril-daemon.
61 | if [ -f /vendor/firmware_mnt/verinfo/ver_info.txt ]; then
62 | modem=`cat /vendor/firmware_mnt/verinfo/ver_info.txt |
63 | sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' |
64 | sed 's/.*MPSS.\(.*\)/\1/g' | cut -d \. -f 1`
65 | if [ "$modem" = "AT" ]; then
66 | version=`cat /vendor/firmware_mnt/verinfo/ver_info.txt |
67 | sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' |
68 | sed 's/.*AT.\(.*\)/\1/g' | cut -d \- -f 1`
69 | if [ ! -z $version ]; then
70 | if [ "$version" \< "3.1" ]; then
71 | qcrild_status=false
72 | fi
73 | fi
74 | elif [ "$modem" = "TA" ]; then
75 | version=`cat /vendor/firmware_mnt/verinfo/ver_info.txt |
76 | sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' |
77 | sed 's/.*TA.\(.*\)/\1/g' | cut -d \- -f 1`
78 | if [ ! -z $version ]; then
79 | if [ "$version" \< "3.0" ]; then
80 | qcrild_status=false
81 | fi
82 | fi
83 | elif [ "$modem" = "JO" ]; then
84 | version=`cat /vendor/firmware_mnt/verinfo/ver_info.txt |
85 | sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' |
86 | sed 's/.*JO.\(.*\)/\1/g' | cut -d \- -f 1`
87 | if [ ! -z $version ]; then
88 | if [ "$version" \< "3.2" ]; then
89 | qcrild_status=false
90 | fi
91 | fi
92 | elif [ "$modem" = "TH" ]; then
93 | qcrild_status=false
94 | fi
95 | fi
96 |
97 | if [ "$qcrild_status" = "true" ]; then
98 | # Make sure both rild, qcrild are not running at same time.
99 | # This is possible with vanilla aosp system image.
100 | stop ril-daemon
101 | stop vendor.ril-daemon
102 |
103 | start vendor.qcrild
104 | else
105 | start ril-daemon
106 | start vendor.ril-daemon
107 | fi
108 |
109 | start vendor.ipacm-diag
110 | start vendor.ipacm
111 | case "$baseband" in
112 | "svlte2a" | "csfb")
113 | start qmiproxy
114 | ;;
115 | "sglte" | "sglte2" )
116 | if [ "x$sgltecsfb" != "xtrue" ]; then
117 | start qmiproxy
118 | else
119 | setprop persist.vendor.radio.voice.modem.index 0
120 | fi
121 | ;;
122 | esac
123 |
124 | multisim=`getprop persist.radio.multisim.config`
125 |
126 | if [ "$multisim" = "dsds" ] || [ "$multisim" = "dsda" ]; then
127 | if [ "$qcrild_status" = "true" ]; then
128 | start vendor.qcrild2
129 | else
130 | start vendor.ril-daemon2
131 | fi
132 | elif [ "$multisim" = "tsts" ]; then
133 | if [ "$qcrild_status" = "true" ]; then
134 | start vendor.qcrild2
135 | start vendor.qcrild3
136 | else
137 | start vendor.ril-daemon2
138 | start vendor.ril-daemon3
139 | fi
140 | fi
141 |
142 | case "$datamode" in
143 | "tethered")
144 | start vendor.dataqti
145 | start vendor.dataadpl
146 | start vendor.port-bridge
147 | ;;
148 | "concurrent")
149 | start vendor.dataqti
150 | start vendor.dataadpl
151 | start vendor.netmgrd
152 | start vendor.port-bridge
153 | ;;
154 | *)
155 | start vendor.netmgrd
156 | ;;
157 | esac
158 | esac
159 |
160 | #
161 | # Allow persistent faking of bms
162 | # User needs to set fake bms charge in persist.vendor.bms.fake_batt_capacity
163 | #
164 | fake_batt_capacity=`getprop persist.vendor.bms.fake_batt_capacity`
165 | case "$fake_batt_capacity" in
166 | "") ;; #Do nothing here
167 | * )
168 | echo "$fake_batt_capacity" > /sys/class/power_supply/battery/capacity
169 | ;;
170 | esac
171 |
--------------------------------------------------------------------------------
/rootdir/bin/init.qcom.sensors.sh:
--------------------------------------------------------------------------------
1 | #!/vendor/bin/sh
2 | # Copyright (c) 2015,2018 The Linux Foundation. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions are 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 copyright
9 | # notice, this list of conditions and the following disclaimer in the
10 | # documentation and/or other materials provided with the distribution.
11 | # * Neither the name of The Linux Foundation nor
12 | # the names of its contributors may be used to endorse or promote
13 | # products derived from this software without specific prior written
14 | # permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | #
30 | # Function to start sensors for SSC enabled platforms
31 | #
32 | start_sensors()
33 | {
34 | sscrpcd_status=`getprop init.svc.vendor.sensors`
35 | chmod -h 664 /persist/sensors/sensors_settings
36 | chown -h -R system.system /persist/sensors
37 | start vendor.sensors.qti
38 | }
39 |
40 | start_sensors
41 |
--------------------------------------------------------------------------------
/rootdir/bin/init.qti.qseecomd.sh:
--------------------------------------------------------------------------------
1 | #!/vendor/bin/sh
2 | # Copyright (c) 2017, The Linux Foundation. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions are
6 | # 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
10 | # copyright notice, this list of conditions and the following
11 | # disclaimer in the documentation and/or other materials provided
12 | # with the distribution.
13 | # * Neither the name of The Linux Foundation nor the names of its
14 | # contributors may be used to endorse or promote products derived
15 | # from this software without specific prior written permission.
16 | #
17 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
18 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
21 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
24 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
26 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | #
29 | #
30 |
31 | while [ "$registered" != "true" ]
32 | do
33 | sleep 0.1
34 | registered="`getprop vendor.sys.listeners.registered`"
35 | done
36 |
--------------------------------------------------------------------------------
/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/system /system_root ext4 ro,barrier=1,discard wait,avb
37 | /dev/block/bootdevice/by-name/system / ext4 ro,barrier=1,discard wait,avb
38 | /dev/block/bootdevice/by-name/system /system_image emmc defaults wait,flashimg=1,backup=1,recoveryonly
39 | /dev/block/bootdevice/by-name/vendor /vendor ext4 ro,barrier=1 wait,recoveryonly
40 | /dev/block/bootdevice/by-name/vendor /vendor_image emmc defaults wait,recoveryonly
41 | /dev/block/bootdevice/by-name/boot /boot emmc defaults recoveryonly
42 | /dev/block/bootdevice/by-name/recovery /recovery emmc defaults recoveryonly
43 | /dev/block/bootdevice/by-name/cache /cache ext4 nosuid,noatime,nodev,barrier=1 wait
44 | /dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,discard,fsync_mode=nobarrier latemount,wait,check,fileencryption=ice,wrappedkey,reservedsize=128M
45 | /dev/block/mmcblk0p1 /sdcard vfat nosuid,nodev wait
46 | /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
47 | /dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 ro,nosuid,nodev,barrier=1 wait
48 | /dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 noatime,nosuid,nodev,barrier=1 wait
49 | /dev/block/bootdevice/by-name/bluetooth /vendor/bt_firmware vfat ro,shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0 wait
50 | /devices/platform/soc/a600000.ssusb/a600000.dwc3/xhci-hcd.0.auto* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto
51 | # Need to have this entry in here even though the mount point itself is no longer needed.
52 | # The update_engine code looks for this entry in order to determine the boot device address
53 | # and fails if it does not find it.
54 | /dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
55 | /dev/block/zram0 none swap defaults zramsize=1073741824
56 |
--------------------------------------------------------------------------------
/seccomp/mediacodec-seccomp.policy:
--------------------------------------------------------------------------------
1 | # device specific syscalls
2 | # extension of services/mediacodec/minijail/seccomp_policy/mediacodec-seccomp-arm.policy
3 | pselect6: 1
4 | eventfd2: 1
5 | sendto: 1
6 | recvfrom: 1
7 | _llseek: 1
8 | sysinfo: 1
9 | getcwd: 1
10 | getdents64: 1
11 | ARM_cacheflush: 1
12 | inotify_init1: 1
13 | inotify_add_watch: 1
14 | inotify_rm_watch: 1
15 | uname: 1
16 | ueventd: 1
17 | timer_create: 1
18 | timer_settime: 1
19 | rt_sigtimedwait: 1
20 |
--------------------------------------------------------------------------------
/seccomp/mediaextractor-seccomp.policy:
--------------------------------------------------------------------------------
1 | # device specific syscalls.
2 | # extension of services/mediaextractor/minijail/seccomp_policy/mediaextractor-seccomp-arm.policy
3 | readlinkat: 1
4 | pread64: 1
5 |
--------------------------------------------------------------------------------
/sensors/hals.conf:
--------------------------------------------------------------------------------
1 | sensors.ssc.so
2 | sensors.elliptic.so
3 | sensors.halls.so
4 |
--------------------------------------------------------------------------------
/sepolicy/private/file_contexts:
--------------------------------------------------------------------------------
1 | # Files in rootfs
2 | /bt_firmware(/.*)? u:object_r:bt_firmware_file:s0
3 | /firmware(/.*)? u:object_r:firmware_file:s0
4 |
--------------------------------------------------------------------------------
/sepolicy/vendor/file_contexts:
--------------------------------------------------------------------------------
1 | # Fingerprint
2 | /(vendor|system/vendor)/bin/hw/android\.hardware\.biometrics\.fingerprint@2\.1-service\.xiaomi_sm8150 u:object_r:hal_fingerprint_default_exec:s0
3 |
4 | # Light HAL
5 | /(vendor|system/vendor)/bin/hw/android\.hardware\.light@2\.0-service\.xiaomi_sm8150 u:object_r:hal_light_default_exec:s0
6 |
--------------------------------------------------------------------------------
/setup-makefiles.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright (C) 2018-2019 The LineageOS Project
4 | #
5 | # SPDX-License-Identifier: Apache-2.0
6 | #
7 |
8 | set -e
9 |
10 | DEVICE=cepheus
11 | VENDOR=xiaomi
12 |
13 | INITIAL_COPYRIGHT_YEAR=2019
14 |
15 | # Load extract_utils and do some sanity checks
16 | MY_DIR="${BASH_SOURCE%/*}"
17 | if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
18 |
19 | LINEAGE_ROOT="$MY_DIR"/../../..
20 |
21 | HELPER="$LINEAGE_ROOT"/vendor/lineage/build/tools/extract_utils.sh
22 | if [ ! -f "$HELPER" ]; then
23 | echo "Unable to find helper script at $HELPER"
24 | exit 1
25 | fi
26 | . "$HELPER"
27 |
28 | # Initialize the helper
29 | setup_vendor "$DEVICE" "$VENDOR" "$LINEAGE_ROOT"
30 |
31 | # Copyright headers and guards
32 | write_headers
33 |
34 | write_makefiles "$MY_DIR"/proprietary-files.txt true
35 |
36 | # Finish
37 | write_footers
38 |
--------------------------------------------------------------------------------
/vendor_prop.mk:
--------------------------------------------------------------------------------
1 | PRODUCT_PROPERTY_OVERRIDES += \
2 | persist.sys.job_delay=true \
3 | persist.sys.mcd_config_file=/system/etc/mcd_default.conf \
4 | ro.control_privapp_permissions=log \
5 | drm.service.enabled=true \
6 | ro.hardware.nfc_nci=nqx.default \
7 | ro.hardware.keystore_desede=true \
8 | persist.vendor.qcomsysd.enabled=1 \
9 | keyguard.no_require_sim=true \
10 | ro.com.android.dataroaming=true \
11 | ro.config.ringtone=Ring_Synth_04.ogg \
12 | ro.config.notification_sound=pixiedust.ogg \
13 | ro.carrier=unknown \
14 | ro.config.alarm_alert=Alarm_Classic.ogg \
15 | ro.dalvik.vm.native.bridge=0 \
16 | ro.vendor.extension_library=libqti-perfd-client.so \
17 | persist.vendor.radio.apm_sim_not_pwdn=1 \
18 | persist.vendor.radio.sib16_support=1 \
19 | persist.vendor.radio.custom_ecc=1 \
20 | persist.vendor.radio.rat_on=combine \
21 | persist.backup.ntpServer=0.pool.ntp.org \
22 | sys.vendor.shutdown.waittime=500 \
23 | ro.frp.pst=/dev/block/bootdevice/by-name/frp \
24 | persist.sys.offlinelog.kernel \
25 | persist.sys.offlinelog.logcat \
26 | persist.sys.qseelogd=true \
27 | dalvik.vm.heapstartsize=8m \
28 | dalvik.vm.heapsize=512m \
29 | dalvik.vm.heaptargetutilization=0.75 \
30 | dalvik.vm.heapminfree=512k \
31 | dalvik.vm.heapmaxfree=8m \
32 | persist.demo.hdmirotationlock=false \
33 | persist.sys.sf.color_saturation=1.0 \
34 | debug.sf.hw=0 \
35 | debug.egl.hw=0 \
36 | debug.sf.latch_unsignaled=1 \
37 | debug.mdpcomp.logs=0 \
38 | ro.vendor.display.cabl=0 \
39 | vendor.gralloc.disable_ubwc=0 \
40 | vendor.display.disable_scaler=0 \
41 | vendor.display.disable_inline_rotator=1 \
42 | vendor.display.disable_decimation=1 \
43 | vendor.display.enable_null_display=0 \
44 | vendor.display.disable_excl_rect=0 \
45 | vendor.display.comp_mask=0 \
46 | vendor.display.disable_hw_recovery=0 \
47 | vendor.display.dataspace_saturation_matrix=1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0 \
48 | vendor.qcom.bluetooth.soc=cherokee \
49 | persist.vendor.qfp=false \
50 | camera.disable_zsl_mode=true \
51 | vendor.power.pasr.enabled=true \
52 | ro.opengles.version=196610 \
53 | ro.vendor.df.effect.conflict=1 \
54 | persist.vendor.df.extcolor.proc=0 \
55 | persist.vendor.df.color.temp=0 \
56 | persist.vendor.max.brightness=0 \
57 | vendor.gatekeeper.disable_spu=true \
58 | ro.cit.stablebuild=true \
59 | persist.sys.labtest_flag=false \
60 | ro.cit.nonrootbuild=true \
61 | ro.vendor.scroll.preobtain.enable=false \
62 | ro.crypto.volume.filenames_mode=aes-256-cts \
63 | ro.crypto.allow_encrypt_override=true \
64 | ro.hardware.fp.goodix_fod=true \
65 | ro.hardware.fp.fod=true \
66 | persist.vendor.sys.fp.fod.location.X_Y=455,1920 \
67 | persist.vendor.sys.fp.fod.size.width_height=173,173 \
68 | af.fast_track_multiplier=1 \
69 | vendor.audio_hal.period_size=192 \
70 | ro.vendor.audio.sdk.fluencetype=fluence \
71 | persist.vendor.audio.fluence.voicecall=true \
72 | persist.vendor.audio.fluence.voicerec=false \
73 | persist.vendor.audio.fluence.speaker=true \
74 | persist.vendor.audio.fluence.tmic.enabled=false \
75 | vendor.audio.tunnel.encode=false \
76 | persist.vendor.audio.ras.enabled=false \
77 | vendor.audio.offload.buffer.size.kb=32 \
78 | audio.offload.video=true \
79 | vendor.audio.offload.track.enable=false \
80 | audio.deep_buffer.media=true \
81 | vendor.voice.path.for.pcm.voip=false \
82 | vendor.audio.offload.multiaac.enable=true \
83 | vendor.audio.dolby.ds2.enabled=false \
84 | vendor.audio.dolby.ds2.hardbypass=false \
85 | vendor.audio.offload.multiple.enabled=false \
86 | vendor.audio.offload.passthrough=false \
87 | ro.vendor.audio.sdk.ssr=false \
88 | vendor.audio.offload.gapless.enabled=true \
89 | vendor.audio.safx.pbe.enabled=true \
90 | vendor.audio.parser.ip.buffer.size=262144 \
91 | vendor.audio.flac.sw.decoder.24bit=true \
92 | persist.vendor.bt.a2dp_offload_cap=sbc-aptx-aptxtws-aptxhd-aptxadaptive-aac-ldac \
93 | vendor.audio.use.sw.alac.decoder=true \
94 | vendor.audio.use.sw.ape.decoder=true \
95 | vendor.audio.hw.aac.encoder=false \
96 | vendor.audio.noisy.broadcast.delay=600 \
97 | vendor.audio.offload.pstimeout.secs=3 \
98 | ro.af.client_heap_size_kbyte=7168 \
99 | vendor.audio_hal.in_period_size=144 \
100 | vendor.audio_hal.period_multiplier=3 \
101 | vendor.audio.adm.buffering.ms=6 \
102 | vendor.audio.hal.output.suspend.supported=false \
103 | aaudio.mmap_policy=2 \
104 | aaudio.mmap_exclusive_policy=2 \
105 | aaudio.hw_burst_min_usec=2000 \
106 | vendor.audio.enable.mirrorlink=false \
107 | persist.vendor.audio.voicecall.speaker.stereo=true \
108 | ro.config.vc_call_vol_steps=11 \
109 | persist.vendor.audio.button_jack.profile=volume \
110 | persist.vendor.audio.button_jack.switch=0 \
111 | ro.vendor.audio.soundfx.usb=true \
112 | ro.vendor.audio.voice.volume.boost=manual \
113 | ro.vendor.audio.us.proximity=true \
114 | ro.vendor.audio.soundfx.type=mi \
115 | ro.audio.recording.hd=true \
116 | ro.vendor.audio.soundtrigger=sva \
117 | ro.vendor.audio.soundtrigger.lowpower=true \
118 | ro.vendor.audio.soundtrigger.gmm.level=50 \
119 | ro.vendor.audio.soundtrigger.gmm.user.level=10 \
120 | ro.vendor.audio.soundtrigger.cnn.level=27 \
121 | ro.vendor.audio.soundtrigger.vop.level=10 \
122 | ro.vendor.audio.soundtrigger.gmm.adsp.level=50 \
123 | ro.vendor.audio.soundtrigger.gmm.user.adsp.level=10 \
124 | ro.vendor.audio.soundtrigger.cnn.adsp.level=27 \
125 | ro.vendor.audio.soundtrigger.vop.adsp.level=10 \
126 | ro.vendor.audio.soundtrigger.training.level=50 \
127 | ro.vendor.audio.sos=true \
128 | ro.vendor.audio.game.effect=true \
129 | sys.haptic.down.weak=0 \
130 | sys.haptic.down.normal=2 \
131 | sys.haptic.down.strong=5 \
132 | sys.haptic.runin=13 \
133 | ro.se.type=eSE,HCE,UICC \
134 | vendor.display.enable_default_color_mode=0 \
135 | persist.radio.multisim.config=dsds
136 |
--------------------------------------------------------------------------------
/wifi/p2p_supplicant_overlay.conf:
--------------------------------------------------------------------------------
1 | disable_scan_offload=1
2 | p2p_no_group_iface=1
3 | persistent_reconnect=1
4 | bss_max_count=400
5 |
--------------------------------------------------------------------------------
/wifi/wpa_supplicant_overlay.conf:
--------------------------------------------------------------------------------
1 | disable_scan_offload=1
2 | p2p_disabled=1
3 | tdls_external_control=1
4 | wowlan_triggers=magic_pkt
5 | bss_max_count=400
6 | interworking=1
7 |
--------------------------------------------------------------------------------