-
Notifications
You must be signed in to change notification settings - Fork 6
/
common.mk
486 lines (397 loc) · 16.4 KB
/
common.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
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
# Copyright (C) 2022 Paranoid Android
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Platform
TARGET_BOARD_PLATFORM := bengal
# Include GSI
$(call inherit-product, $(SRC_TARGET_DIR)/product/developer_gsi_keys.mk)
# Project ID Quota
$(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk)
# Setup dalvik vm configs
$(call inherit-product, frameworks/native/build/phone-xhdpi-6144-dalvik-heap.mk)
# Inherit from vendor
$(call inherit-product, vendor/xiaomi/sm6225-common/sm6225-common-vendor.mk)
# A/B
ifeq ($(TARGET_IS_VAB),true)
$(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota/launch_with_vendor_ramdisk.mk)
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
PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \
update_engine \
update_engine_sideload \
update_verifier
endif
# 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)
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/audio/audio/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/audio_policy_configuration.xml \
$(LOCAL_PATH)/configs/audio/audio/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml
PRODUCT_PACKAGES += \
android.hardware.audio.service
PRODUCT_PRODUCT_PROPERTIES += \
vendor.audio.feature.dynamic_ecns.enable=false \
vendor.audio.offload.buffer.size.kb=256
PRODUCT_SYSTEM_PROPERTIES += \
ro.config.vc_call_vol_steps=11
PRODUCT_VENDOR_PROPERTIES += \
ro.audio.monitorRotation=true \
ro.vendor.audio.misound.bluetooth.enable=true \
ro.vendor.audio.soundfx.type=mi \
ro.vendor.audio.soundfx.usb=true
PRODUCT_VENDOR_PROPERTIES += \
ro.vendor.audio.soundtrigger.appdefine.cnn.level=31 \
ro.vendor.audio.soundtrigger.appdefine.gmm.level=55 \
ro.vendor.audio.soundtrigger.appdefine.gmm.user.level=50 \
ro.vendor.audio.soundtrigger.appdefine.vop.level=10 \
ro.vendor.audio.soundtrigger.lowpower=true \
ro.vendor.audio.soundtrigger.training.level=50 \
ro.vendor.audio.soundtrigger.xanzn.cnn.level=70 \
ro.vendor.audio.soundtrigger.xanzn.gmm.level=45 \
ro.vendor.audio.soundtrigger.xanzn.gmm.user.level=30 \
ro.vendor.audio.soundtrigger.xanzn.vop.level=10 \
ro.vendor.audio.soundtrigger.xatx.cnn.level=27 \
ro.vendor.audio.soundtrigger.xatx.gmm.level=50 \
ro.vendor.audio.soundtrigger.xatx.gmm.user.level=40 \
ro.vendor.audio.soundtrigger.xatx.vop.level=10 \
ro.vendor.audio.soundtrigger=sva
# Bluetooth
PRODUCT_PRODUCT_PROPERTIES += \
bluetooth.hardware.power.idle_cur_ma=7 \
bluetooth.hardware.power.operating_voltage_mv=3700 \
bluetooth.hardware.power.rx_cur_ma=75 \
bluetooth.hardware.power.tx_cur_ma=93
PRODUCT_VENDOR_PROPERTIES += \
persist.vendor.bluetooth.modem_nv_support=true \
persist.vendor.qcom.bluetooth.a2dp_offload_cap=sbc-aac-aptx-aptxadaptive-aptxhd-aptxtws-ldac \
persist.vendor.qcom.bluetooth.aac_vbr_ctl.enabled=false \
persist.vendor.qcom.bluetooth.enable.splita2dp=true \
persist.vendor.qcom.bluetooth.scram.enabled=false \
persist.vendor.qcom.bluetooth.soc=cherokee \
persist.vendor.qcom.bluetooth.twsp_state.enabled=false \
ro.vendor.bluetooth.wipower=false
# Camera
$(call inherit-product-if-exists, vendor/xiaomi/camera/miuicamera.mk)
PRODUCT_PACKAGES += \
[email protected]_64 \
libcamera2ndk_vendor \
libdng_sdk.vendor \
libstdc++_vendor \
PRODUCT_VENDOR_PROPERTIES += \
camera.disable_zsl_mode=1
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
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/camera/camxoverridesettings.txt:$(TARGET_COPY_OUT_VENDOR)/etc/camera/camxoverridesettings.txt \
$(LOCAL_PATH)/configs/camera/st_license.lic:$(TARGET_COPY_OUT_VENDOR)/etc/camera/st_license.lic
# Charger
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/init/[email protected]:$(TARGET_COPY_OUT_VENDOR)/etc/init/[email protected]
PRODUCT_PRODUCT_PROPERTIES += \
persist.vendor.quick.charge=1 \
ro.charger.disable_init_blank=true
# Crypto
PRODUCT_VENDOR_PROPERTIES += \
ro.crypto.allow_encrypt_override=true \
ro.crypto.dm_default_key.options_format.version=2 \
ro.crypto.volume.filenames_mode=aes-256-cts \
ro.crypto.volume.metadata.method=dm-default-key
# 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
# Cutout
PRODUCT_PRODUCT_PROPERTIES += \
ro.support_hide_display_cutout=true
# Display
TARGET_USE_AIDL_QTI_MEMTRACK := true
PRODUCT_PACKAGES += \
PRODUCT_VENDOR_PROPERTIES += \
debug.sf.enable_gl_backpressure=0 \
debug.sf.layer_caching_active_layer_timeout_ms=1000 \
debug.hwui.skia_atrace_enabled=false \
ro.vendor.display.sensortype=2 \
ro.vendor.display.svi=1 \
vendor.display.idle_time=0 \
vendor.display.idle_time_inactive=0 \
vendor.display.qdcm.mode_combine=2 \
vendor.display.svi.config=1 \
vendor.display.svi.config_path=/vendor/etc/SVIConfig.xml
# DPM
PRODUCT_VENDOR_PROPERTIES += \
persist.vendor.dpmhalservice.enable=1
# DRM
PRODUCT_PACKAGES += \
android.hardware.drm-service.clearkey \
libcrypto_shim
PRODUCT_VENDOR_PROPERTIES += \
drm.service.enabled=true
# Enable Dynamic partition
PRODUCT_BUILD_SUPER_PARTITION := false
PRODUCT_USE_DYNAMIC_PARTITIONS := true
# Fastboot
PRODUCT_PACKAGES += \
android.hardware.fastboot-service.example_recovery \
fastbootd
# Fingerprint
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.fingerprint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.fingerprint.xml
PRODUCT_SYSTEM_PROPERTIES += \
sys.fp.miui.token=0
# FM
BOARD_HAVE_QCOM_FM := true
# FRP
PRODUCT_VENDOR_PROPERTIES += \
ro.frp.pst=/dev/block/bootdevice/by-name/frp
# FUSE passthrough
PRODUCT_PRODUCT_PROPERTIES += \
persist.sys.fuse.passthrough.enable=true
# Graphics
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.opengles.aep.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.opengles.aep.xml \
frameworks/native/data/etc/android.hardware.vulkan.compute-0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.compute-0.xml \
frameworks/native/data/etc/android.hardware.vulkan.level-1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.level-1.xml \
frameworks/native/data/etc/android.hardware.vulkan.version-1_1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.version-1_1.xml \
frameworks/native/data/etc/android.software.opengles.deqp.level-2020-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.opengles.deqp.level.xml \
frameworks/native/data/etc/android.software.vulkan.deqp.level-2020-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.vulkan.deqp.level.xml
PRODUCT_VENDOR_PROPERTIES += \
ro.hardware.egl=adreno \
ro.hardware.vulkan=adreno \
ro.opengles.version=196610
# GPS
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/gps/flp.conf:$(TARGET_COPY_OUT_VENDOR)/etc/flp.conf \
$(LOCAL_PATH)/configs/gps/gps.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gps.conf \
$(LOCAL_PATH)/configs/gps/sap.conf:$(TARGET_COPY_OUT_VENDOR)/etc/sap.conf
# IDC
PRODUCT_COPY_FILES += \
$(call find-copy-subdir-files,*,$(LOCAL_PATH)/configs/idc/,$(TARGET_COPY_OUT_VENDOR)/usr/idc)
# Incremental FS
PRODUCT_VENDOR_PROPERTIES += \
ro.incremental.enable=1
# Keylayout
PRODUCT_COPY_FILES += \
$(call find-copy-subdir-files,*,$(LOCAL_PATH)/configs/keylayout/,$(TARGET_COPY_OUT_VENDOR)/usr/keylayout)
# Lights
PRODUCT_PACKAGES += \
android.hardware.light-service.xiaomi
# Lineage Health
PRODUCT_PACKAGES += \
vendor.lineage.health-service.default
TARGET_HEALTH_CHARGING_CONTROL_SUPPORTS_BYPASS := false
# LMK
PRODUCT_SYSTEM_PROPERTIES += \
ro.lmk.critical_upgrade=true \
ro.lmk.downgrade_pressure=60 \
ro.lmk.filecache_min_kb=153600 \
ro.lmk.kill_heaviest_task=false \
ro.lmk.kill_timeout_ms=100 \
ro.lmk.stall_limit_critical=40 \
ro.lmk.thrashing_limit=30 \
ro.lmk.thrashing_limit_decay=50 \
ro.lmk.upgrade_pressure=40 \
ro.lmk.use_minfree_levels=true
# Media
MSM_VIDC_TARGET_LIST := bengal
include hardware/qcom/media/conf_files/$(TARGET_BOARD_PLATFORM)/$(TARGET_BOARD_PLATFORM).mk
PRODUCT_COPY_FILES += \
device/qcom/common/vendor/media/media_profiles.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles.xml
PRODUCT_PACKAGES += \
libmm-omxcore \
libOmxCore \
libOmxVdec \
libOmxVenc \
libstagefrighthw \
libc2dcolorconvert \
init.qti.media.sh
PRODUCT_PACKAGES += \
libavservices_minijail.vendor \
libgui_vendor \
libstagefright_softomx.vendor \
libstagefright_softomx_plugin.vendor \
PRODUCT_SYSTEM_EXT_PROPERTIES += \
media.settings.xml=/vendor/etc/media_profiles_vendor.xml \
media.stagefright.thumbnail.prefer_hw_codecs=true \
ro.media.recorder-max-base-layer-fps=60
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
# Netmgr
PRODUCT_SYSTEM_EXT_PROPERTIES += \
persist.data.netmgrd.qos.enable=true
# Overlays
PRODUCT_PACKAGES += \
AOSPABengalFrameworksOverlay \
AvoidAppsInCutoutOverlay \
BengalCarrierConfigOverlay \
BengalFrameworksOverlay \
BengalSettingsOverlay \
BengalSystemUIOverlay \
BengalWifiOverlay \
DeviceAsWebcamOverlay \
WifiMainline
# Perf
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/perf/perfconfigstore.xml:$(TARGET_COPY_OUT_VENDOR)/etc/perf/perfconfigstore.xml
# Phantom process monitoring
PRODUCT_PRODUCT_PROPERTIES += \
sys.fflag.override.settings_enable_monitor_phantom_procs=false
# Public libraries
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/public.libraries.txt:$(TARGET_COPY_OUT_VENDOR)/etc/public.libraries.txt
# Rootdir / Init files
PRODUCT_PACKAGES += \
init.qti.dcvs.sh \
init.qti.early_init.sh
PRODUCT_PACKAGES += \
fstab.qcom \
fstab.qcom_ramdisk \
fstab.zram \
init.bengal.rc \
init.bengal.perf.rc \
init.target.rc \
init.xiaomi.fingerprint.rc \
init.xiaomi.rc \
ueventd.xiaomi.rc
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/init/init.recovery.qcom.rc:$(TARGET_COPY_OUT_RECOVERY)/root/init.recovery.qcom.rc
# QC common
TARGET_COMMON_QTI_COMPONENTS += \
alarm \
audio \
av \
bt \
charging \
display \
gps \
init \
keymaster \
overlay \
perf \
telephony \
usb \
vibrator \
wfd \
wlan
# Radio
PRODUCT_PRODUCT_PROPERTIES += \
rild.libpath=/vendor/lib64/libril-qc-hal-qmi.so
PRODUCT_VENDOR_PROPERTIES += \
persist.vendor.data.iwlan.enable=true \
persist.vendor.radio.add_power_save=0 \
persist.vendor.radio.atfwd.start=true \
persist.vendor.radio.data_con_rprt=1 \
persist.vendor.radio.enable_temp_dds=true \
persist.vendor.radio.force_on_dc=true \
persist.vendor.radio.mt_sms_ack=30 \
persist.vendor.radio.process_sups_ind=1 \
persist.vendor.radio.redir_party_num=0 \
ro.vendor.radio.features_common=3 \
ro.vendor.se.type=HCE,UICC \
sys.vendor.shutdown.waittime=500
# Sensors
PRODUCT_PACKAGES += \
android.hardware.sensors-service.xiaomi-multihal \
libsensorndkbridge
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
PRODUCT_VENDOR_PROPERTIES += \
persist.vendor.sensors.debug.ssc_qmi_debug=true \
persist.vendor.sensors.enable.bypass_worker=true \
persist.vendor.sensors.enable.rt_task=false \
persist.vendor.sensors.hal_trigger_ssr=false \
persist.vendor.sensors.support_direct_channel=false
# Soong namespaces
PRODUCT_SOONG_NAMESPACES += \
$(LOCAL_PATH) \
hardware/xiaomi
# Treble
PRODUCT_FULL_TREBLE_OVERRIDE := true
# Thermal
PRODUCT_VENDOR_PROPERTIES += \
vendor.sys.thermal.data.path=/data/vendor/thermal/
# Time-services
PRODUCT_PRODUCT_PROPERTIES += \
persist.timed.enable=true
# USB
ifneq ($(TARGET_BUILD_VARIANT),user)
PRODUCT_VENDOR_PROPERTIES += \
persist.vendor.usb.config=mtp,adb
endif
PRODUCT_VENDOR_PROPERTIES += \
ro.usb.uvc.enabled=true
PRODUCT_HAS_GADGET_HAL := true
PRODUCT_ODM_PROPERTIES += \
sys.usb.mtp.batchcancel=1 \
vendor.usb.use_ffs_mtp=1
# 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
# WiFi
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/wifi/WCNSS_qcom_cfg.ini:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/WCNSS_qcom_cfg.ini
# WiFi firmware symlinks
PRODUCT_PACKAGES += \
firmware_wlan_mac.bin_symlink \
firmware_WCNSS_qcom_cfg.ini_symlink
# WLAN
PRODUCT_VENDOR_PROPERTIES += \
ro.hardware.wlan.chip=wcn3988 \
ro.hardware.wlan.dbs=0 \
ro.hardware.wlan.mimo=0 \
ro.hardware.wlan.vendor=qcom
PRODUCT_VENDOR_PROPERTIES += \
ro.telephony.iwlan_operation_mode=legacy