forked from XIAOMI-SM6225-bengal-5-15/device_xiaomi_topaz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
device.mk
442 lines (361 loc) · 14.3 KB
/
device.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
PRODUCT_SOONG_NAMESPACES += \
$(LOCAL_PATH) \
hardware/xiaomi
TARGET_BOARD_PLATFORM := bengal
TARGET_BOARD_SUFFIX := _515
TARGET_KERNEL_VERSION := 5.15
# A/B
$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_ramdisk.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota/android_t_baseline.mk)
PRODUCT_VIRTUAL_AB_COMPRESSION_METHOD := gz
AB_OTA_POSTINSTALL_CONFIG += \
RUN_POSTINSTALL_system=true \
POSTINSTALL_PATH_system=system/bin/otapreopt_script \
FILESYSTEM_TYPE_system=ext4 \
POSTINSTALL_OPTIONAL_system=true
AB_OTA_POSTINSTALL_CONFIG += \
RUN_POSTINSTALL_vendor=true \
POSTINSTALL_PATH_vendor=bin/checkpoint_gc \
FILESYSTEM_TYPE_vendor=ext4 \
POSTINSTALL_OPTIONAL_vendor=true
PRODUCT_PACKAGES += \
checkpoint_gc \
otapreopt_script \
update_engine \
update_engine_sideload \
update_verifier
# AAPT
PRODUCT_AAPT_CONFIG := normal
PRODUCT_AAPT_PREF_CONFIG := xxhdpi
# APEX
$(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk)
# Enable project quotas and casefolding for emulated storage without sdcardfs
$(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk)
# Inherit from vendor blobs
$(call inherit-product, vendor/xiaomi/topaz/topaz-vendor.mk)
# Attestation
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.software.device_id_attestation.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.device_id_attestation.xml
# Audio
PRODUCT_COPY_FILES += \
$(call find-copy-subdir-files,*,$(LOCAL_PATH)/configs/audio/,$(TARGET_COPY_OUT_VENDOR)/etc) \
$(LOCAL_PATH)/configs/audio/audio/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/audio_policy_configuration.xml \
$(LOCAL_PATH)/configs/audio/mixer_paths_bengal_idp.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mixer_paths_idp_india.xml
PRODUCT_ODM_PROPERTIES += \
vendor.audio.offload.buffer.size.kb=256
PRODUCT_VENDOR_PROPERTIES += \
debug.stagefright.c2inputsurface=-1 \
ro.audio.monitorRotation=false \
ro.vendor.audio.game.mode=true \
ro.vendor.audio.policy.engine.odm=true \
ro.vendor.audio.soundfx.type=mi \
ro.vendor.audio.soundfx.usb=true \
ro.vendor.audio.surround.support=true \
ro.vendor.audio.scenario.support=true \
ro.vendor.audio.sfx.scenario=true \
ro.vendor.audio.sfx.earadj=true \
ro.vendor.audio.sdk.fluencetype=none \
ro.vendor.audio.vocal.support=true \
ro.vendor.audio.voice.change.support=true \
ro.vendor.audio.voice.change.version=2
# Authsecret
PRODUCT_PACKAGES += \
# Boot animation
TARGET_SCREEN_HEIGHT := 2400
TARGET_SCREEN_WIDTH := 1080
# Bluetooth
PRODUCT_SYSTEM_EXT_PROPERTIES += \
persist.vendor.service.bdroid.soc.alwayson=true
PRODUCT_VENDOR_PROPERTIES += \
persist.vendor.qcom.bluetooth.soc=cherokee \
persist.vendor.qcom.bluetooth.enable.splita2dp=true \
persist.vendor.qcom.bluetooth.a2dp_offload_cap=sbc-aptx-aptxtws-aptxhd-aac-ldac \
persist.vendor.qcom.bluetooth.twsp_state.enabled=false \
persist.vendor.qcom.bluetooth.scram.enabled=false \
persist.vendor.qcom.bluetooth.aac_vbr_ctl.enabled=false \
ro.vendor.bluetooth.wipower=false
# Camera
PRODUCT_PACKAGES += \
[email protected]_64 \
libcamera2ndk_vendor \
libdng_sdk.vendor \
libstdc++.vendor \
PRODUCT_VENDOR_PROPERTIES += \
camera.disable_zsl_mode=1 \
sys.haptic.ignoreWhenCamera=true
PRODUCT_SYSTEM_PROPERTIES += \
persist.vendor.camera.aon.cameraId=8 \
persist.vendor.camera.aon8475.cameraId=9
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \
frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \
frameworks/native/data/etc/android.hardware.camera.full.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.full.xml \
frameworks/native/data/etc/android.hardware.camera.raw.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.raw.xml
# Characteristics
PRODUCT_CHARACTERISTICS := nosdcard
# Consumer IR AIDL
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.consumerir.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.consumerir.xml
# Crypto
PRODUCT_VENDOR_PROPERTIES += \
ro.crypto.volume.filenames_mode=aes-256-cts \
ro.crypto.allow_encrypt_override=true
# Dalvik
$(call inherit-product, frameworks/native/build/phone-xhdpi-6144-dalvik-heap.mk)
# Device Settings
PRODUCT_PACKAGES += \
XiaomiParts
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/parts/privapp-permissions-parts.xml:$(TARGET_COPY_OUT_SYSTEM_EXT)/etc/permissions/privapp-permissions-parts.xml
# Display
PRODUCT_PACKAGES += \
android.hardware.graphics.common-V2-ndk.vendor \
vendor.qti.hardware.display.config-V2-ndk.vendor \
vendor.qti.hardware.display.config-V5-ndk.vendor \
vendor.qti.hardware.memtrack-service
PRODUCT_PRODUCT_PROPERTIES += \
debug.sf.disable_backpressure=1
PRODUCT_VENDOR_PROPERTIES += \
debug.sf.disable_client_composition_cache=1 \
debug.sf.layer_caching_active_layer_timeout_ms=1000 \
debug.sf.treat_170m_as_sRGB=1 \
ro.surface_flinger.set_display_power_timer_ms=1000 \
ro.surface_flinger.set_idle_timer_ms=1000 \
ro.vendor.display.sensortype=2 \
ro.vendor.display.svi=1 \
vendor.display.idle_time=0 \
vendor.display.svi.config=1 \
vendor.display.svi.config_path=/vendor/etc/SVIConfig.xml
# DPM vndr
PRODUCT_VENDOR_PROPERTIES += \
persist.vendor.dpm.vndr.idletimer.mode=default \
persist.vendor.dpm.vndr.halservice.enable=1 \
persist.vendor.dpm.vndr.feature=1
# DRM
PRODUCT_PACKAGES += \
android.hardware.drm-service.clearkey \
android.hardware.drm-service.widevine
PRODUCT_VENDOR_PROPERTIES += \
drm.service.enabled=true
# Fastboot
PRODUCT_PACKAGES += \
fastbootd
# Fingerprint
PRODUCT_VENDOR_PROPERTIES += \
ro.hardware.fp.sideCap=true
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.fingerprint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.fingerprint.xml
# FRP
PRODUCT_VENDOR_PROPERTIES += \
ro.frp.pst=/dev/block/bootdevice/by-name/frp
# FUSE passthrough
PRODUCT_PRODUCT_PROPERTIES += \
persist.sys.fuse.passthrough.enable=true
# IDC
PRODUCT_COPY_FILES += \
$(call find-copy-subdir-files,*,$(LOCAL_PATH)/configs/idc/,$(TARGET_COPY_OUT_VENDOR)/usr/idc)
# Identity
PRODUCT_PACKAGES += \
android.hardware.identity-V4-ndk.vendor
# Incremental FS
PRODUCT_VENDOR_PROPERTIES += \
ro.incremental.enable=1
# Kernel
KERNEL_PREBUILT_DIR := $(LOCAL_PATH)-kernel
# Keyguard
PRODUCT_VENDOR_PROPERTIES += \
persist.wm.enable_remote_keyguard_animation=0
# Keylayout
PRODUCT_COPY_FILES += \
$(call find-copy-subdir-files,*,$(LOCAL_PATH)/configs/keylayout/,$(TARGET_COPY_OUT_VENDOR)/usr/keylayout)
# Keymaster
PRODUCT_PACKAGES += \
libkeymaster_messages.vendor
# Keymint
PRODUCT_PACKAGES += \
android.hardware.hardware_keystore.xml \
android.hardware.security.keymint-V1-ndk.vendor \
android.hardware.security.secureclock-V1-ndk.vendor \
android.hardware.security.sharedsecret-V1-ndk.vendor
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.keystore.app_attest_key.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.keystore.app_attest_key.xml
# Media
PRODUCT_PACKAGES += \
libavservices_minijail_vendor \
libcodec2_soft_common.vendor \
libsfplugin_ccodec_utils.vendor
PRODUCT_SYSTEM_EXT_PROPERTIES += \
media.aac_51_output_enabled=true \
media.stagefright.enable-aac=true \
media.stagefright.enable-fma2dp=true \
media.stagefright.enable-http=true \
media.stagefright.enable-player=true \
media.stagefright.enable-qcp=true \
media.stagefright.enable-scan=true \
mmp.enable.3g2=true \
persist.mm.enable.prefetch=true
PRODUCT_VENDOR_PROPERTIES += \
ro.mediaserver.64b.enable=true
# NDK
NEED_AIDL_NDK_PLATFORM_BACKEND := true
# Netmgr
PRODUCT_SYSTEM_EXT_PROPERTIES += \
persist.data.netmgrd.qos.enable=true
# Neural Networks
PRODUCT_PACKAGES += \
android.hardware.neuralnetworks-V1-ndk.vendor
# NFC
$(call inherit-product, hardware/st/nfc/nfc_vendor_product.mk)
TARGET_USES_ST_AIDL_NFC := true
PRODUCT_PACKAGES += \
com.android.nfc_extras \
libchrome.vendor \
NfcNci \
SecureElement \
Tag
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/nfc/libnfc-hal-st.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libnfc-hal-st.conf
PRODUCT_SYSTEM_PROPERTIES += \
ro.nfc.port=I2C
# Overlays
PRODUCT_PACKAGES += \
AOSPATopazFrameworksOverlay \
TopazCarrierConfigOverlay \
TopazFrameworksOverlay \
TopazSettingsOverlay \
TopazSystemUIOverlay \
TopazWifiOverlay
# Partitions
PRODUCT_USE_DYNAMIC_PARTITIONS := true
# Perf
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/perf/msm_irqbalance.conf:$(TARGET_COPY_OUT_VENDOR)/etc/msm_irqbalance.conf \
$(LOCAL_PATH)/configs/perf/perfboostsconfig.xml:$(TARGET_COPY_OUT_VENDOR)/etc/perf/perfboostsconfig.xml \
$(LOCAL_PATH)/configs/perf/perfconfigstore.xml:$(TARGET_COPY_OUT_VENDOR)/etc/perf/perfconfigstore.xml
# QC common
TARGET_ADRENO_COMPONENT_VARIANT := adreno
TARGET_GPS_COMPONENT_VARIANT := gps
TARGET_MEDIA_COMPONENT_VARIANT := media
TARGET_PERF_COMPONENT_VARIANT := perf
TARGET_WLAN_COMPONENT_VARIANT := wlan
TARGET_USE_AIDL_QTI_HEALTH := true
TARGET_COMMON_QTI_COMPONENTS := \
adreno \
alarm \
audio \
av \
bt \
charging \
display \
gps \
init \
media \
overlay \
perf \
telephony \
usb \
vibrator \
wfd \
wlan
# Radio
PRODUCT_PRODUCT_PROPERTIES += \
persist.vendor.ims.no_stapa=1 \
persist.vendor.radio.enable_temp_dds=true \
rild.libpath=/vendor/lib64/libril-qc-hal-qmi.so \
ro.vendor.radio.features_common=3 \
ro.vendor.radio.fastdormancy=true
PRODUCT_VENDOR_PROPERTIES += \
ro.vendor.se.type=HCE,UICC \
persist.vendor.data.iwlan.enable=true \
persist.vendor.radio.data_con_rprt=1 \
persist.vendor.radio.snapshot_enabled=1 \
persist.vendor.radio.snapshot_timer=5 \
persist.vendor.radio.manual_nw_rej_ct=1 \
persist.vendor.radio.atfwd.start=true \
persist.vendor.rcs.singlereg.feature=1
# Rootdir / Init script files
PRODUCT_PACKAGES += \
init.goodix.events.sh \
init.qti.dcvs.sh \
init.qti.early_init.sh
PRODUCT_PACKAGES += \
init.target.rc \
init.topaz.rc \
init.topaz.perf.rc \
init.xiaomi.fingerprint.rc \
init.xiaomi.rc \
ueventd.xiaomi.rc
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/init/fstab.qcom:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.qcom \
$(LOCAL_PATH)/init/fstab.zram:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.zram \
$(LOCAL_PATH)/init/fstab.qcom:$(TARGET_COPY_OUT_RECOVERY)/root/first_stage_ramdisk/fstab.qcom \
$(LOCAL_PATH)/init/fstab.qcom:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/first_stage_ramdisk/fstab.qcom
# Sensors
PRODUCT_PACKAGES += \
libsensorndkbridge
PRODUCT_VENDOR_PROPERTIES += \
persist.vendor.sensors.debug.ssc_qmi_debug=true \
persist.vendor.sensors.hal_trigger_ssr=false \
persist.vendor.sensors.enable.rt_task=false \
persist.vendor.sensors.support_direct_channel=false \
persist.vendor.sensors.enable.bypass_worker=true
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \
frameworks/native/data/etc/android.hardware.sensor.barometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.barometer.xml \
frameworks/native/data/etc/android.hardware.sensor.compass.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.compass.xml \
frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope.xml \
frameworks/native/data/etc/android.hardware.sensor.light.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.light.xml \
frameworks/native/data/etc/android.hardware.sensor.proximity.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.proximity.xml \
frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepcounter.xml \
frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepdetector.xml
# Set GRF/Vendor freeze properties
SHIPPING_API_LEVEL := 33
PRODUCT_SHIPPING_API_LEVEL := $(SHIPPING_API_LEVEL)
BOARD_SHIPPING_API_LEVEL := 33
BOARD_API_LEVEL := 33
# Thermal
PRODUCT_PACKAGES += \
PRODUCT_VENDOR_PROPERTIES += \
vendor.sys.thermal.data.path=/data/vendor/thermal/
# Time-services
PRODUCT_PRODUCT_PROPERTIES += \
persist.timed.enable=true
# Treble
PRODUCT_FULL_TREBLE_OVERRIDE := true
# TrustedUI
PRODUCT_PACKAGES += \
# USB
ifneq ($(TARGET_BUILD_VARIANT),user)
PRODUCT_VENDOR_PROPERTIES += \
persist.vendor.usb.config=mtp,adb
endif
# Verified Boot
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.software.verified_boot.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.verified_boot.xml
# Wlan
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/wifi/WCNSS_qcom_cfg.ini:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/WCNSS_qcom_cfg.ini
PRODUCT_VENDOR_PROPERTIES += \
ro.hardware.wlan.vendor=qcom \
ro.hardware.wlan.chip=wcn3950 \
ro.hardware.wlan.mimo=0 \
ro.hardware.wlan.dbs=0