forked from David112x/pe_device_xiaomi_surya
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevice.mk
446 lines (365 loc) · 14.8 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
443
444
445
446
#
# Copyright (C) 2021 Paranoid Android
#
# SPDX-License-Identifier: Apache-2.0
#
# GSI keys
$(call inherit-product, $(SRC_TARGET_DIR)/product/developer_gsi_keys.mk)
# Project ID Quota
$(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk)
# Vendor blobs
$(call inherit-product, vendor/xiaomi/surya/surya-vendor.mk)
# AAPT
PRODUCT_AAPT_CONFIG := xxhdpi
PRODUCT_AAPT_PREF_CONFIG := xxhdpi
# Audio
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/audio/audio_effects.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects.xml \
$(LOCAL_PATH)/configs/audio/audio_io_policy.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_io_policy.conf \
$(LOCAL_PATH)/configs/audio/audio_platform_info_intcodec.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_info_intcodec.xml \
$(LOCAL_PATH)/configs/audio/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/audio_policy_configuration.xml \
$(LOCAL_PATH)/configs/audio/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml \
$(LOCAL_PATH)/configs/audio/mixer_paths_wcd9375.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mixer_paths_wcd9375.xml
PRODUCT_ODM_PROPERTIES += \
aaudio.mmap_policy=1 \
ro.config.media_vol_default=8 \
ro.config.vc_call_vol_default=5 \
ro.config.vc_call_vol_steps=10 \
ro.vendor.audio.sdk.fluencetype=fluence \
vendor.audio.offload.buffer.size.kb=256
PRODUCT_VENDOR_PROPERTIES += \
ro.vendor.audio.soundfx.type=mi \
ro.vendor.audio.soundfx.usb=true \
ro.vendor.audio.misound.bluetooth.enable=true \
persist.vendor.audio_hal.dsp_bit_width_enforce_mode=24 \
persist.vendor.audio.voicecall.speaker.stereo=true
# Bluetooth
PRODUCT_VENDOR_PROPERTIES += \
persist.vendor.bluetooth.modem_nv_support=true \
persist.vendor.qcom.bluetooth.a2dp_offload_cap=sbc-aac-aptx-aptxhd-ldac \
persist.vendor.qcom.bluetooth.aac_frm_ctl.enabled=true \
persist.vendor.qcom.bluetooth.aac_vbr_ctl.enabled=false \
persist.vendor.qcom.bluetooth.enable.splita2dp=true \
persist.vendor.qcom.bluetooth.scram.enabled=true \
persist.vendor.qcom.bluetooth.soc=cherokee \
persist.vendor.qcom.bluetooth.twsp_state.enabled=false \
ro.vendor.bluetooth.wipower=false
PRODUCT_SYSTEM_EXT_PROPERTIES += \
persist.vendor.btstack.a2dp_offload_cap=sbc-aac-aptx-aptxhd-ldac \
persist.vendor.btstack.aac_frm_ctl.enabled=true \
persist.vendor.btstack.connect.peer_earbud=true \
persist.vendor.btstack.enable.lpa=true \
persist.vendor.btstack.enable.swb=true \
persist.vendor.btstack.enable.swbpm=true \
persist.vendor.btstack.enable.twsplus=true \
persist.vendor.btstack.enable.twsplussho=true \
persist.vendor.service.bdroid.soc.alwayson=true \
ro.bluetooth.emb_wp_mode=false \
ro.bluetooth.wipower=false
# Camera
$(call inherit-product-if-exists, device/xiaomi/surya-miuicamera/config.mk)
PRODUCT_PACKAGES += \
[email protected]_64 \
libdng_sdk.vendor \
libpiex_shim \
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_VENDOR_PROPERTIES += \
camera.disable_zsl_mode=1 \
# Charger
PRODUCT_VENDOR_PROPERTIES += \
persist.vendor.cp.fcc_main_ua=400000 \
persist.vendor.cp.taper_term_mv=6500 \
persist.vendor.cp.vbus_offset_mv=1040
# ContextHub
PRODUCT_PACKAGES += \
# Crypto
PRODUCT_VENDOR_PROPERTIES += \
ro.crypto.dm_default_key.options_format.version=2 \
ro.crypto.volume.metadata.method=dm-default-key \
ro.crypto.volume.filenames_mode=aes-256-cts \
ro.crypto.volume.options=::v2
# Dalvik
$(call inherit-product, frameworks/native/build/phone-xhdpi-6144-dalvik-heap.mk)
# Device Settings
PRODUCT_PACKAGES += \
XiaomiParts
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/parts/init.xiaomiparts.rc:$(TARGET_COPY_OUT_SYSTEM_EXT)/etc/init/init.xiaomiparts.rc \
$(LOCAL_PATH)/parts/privapp-permissions-parts.xml:$(TARGET_COPY_OUT_SYSTEM_EXT)/etc/permissions/privapp-permissions-parts.xml
PRODUCT_SYSTEM_EXT_PROPERTIES += \
persist.lcd.cabc_mode=1
# Dex/ART optimization
PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD := false
PRODUCT_DEX_PREOPT_DEFAULT_COMPILER_FILTER := everything
USE_DEX2OAT_DEBUG := false
# Display
PRODUCT_COPY_FILES += \
$(call find-copy-subdir-files,*,$(LOCAL_PATH)/configs/display/,$(TARGET_COPY_OUT_VENDOR)/etc)
PRODUCT_PACKAGES += \
disable_configstore
PRODUCT_PACKAGES += \
PRODUCT_VENDOR_PROPERTIES += \
debug.sf.disable_backpressure=1 \
debug.sf.latch_unsignaled=1 \
debug.sf.defer_refresh_rate_when_off=1 \
debug.sf.frame_rate_multiple_threshold=120 \
debug.sf.layer_caching_active_layer_timeout_ms=1000 \
persist.sys.sf.native_mode=2 \
ro.surface_flinger.enable_frame_rate_override=false \
ro.surface_flinger.set_display_power_timer_ms=1000 \
ro.surface_flinger.set_idle_timer_ms=200 \
ro.surface_flinger.set_touch_timer_ms=1000 \
ro.surface_flinger.use_content_detection_for_refresh_rate=true \
ro.vendor.display.ad=1 \
ro.vendor.display.ad.sdr_calib_data=/vendor/etc/sdr_config.cfg \
ro.vendor.display.ad.hdr_calib_data=/vendor/etc/hdr_config.cfg \
ro.vendor.display.sensortype=2 \
vendor.display.disable_idle_time_hdr=1 \
vendor.display.disable_idle_time_video=1 \
vendor.display.disable_rotator_downscale=1 \
vendor.display.idle_time=0 \
vendor.display.idle_time_inactive=0 \
vendor.display.qdcm.mode_combine=2
PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
debug.sf.use_phase_offsets_as_durations=1 \
debug.sf.late.sf.duration=7333333 \
debug.sf.late.app.duration=15666666 \
debug.sf.early.sf.duration=7333333 \
debug.sf.early.app.duration=15666666 \
debug.sf.earlyGl.sf.duration=7333333 \
debug.sf.earlyGl.app.duration=15666666
# DPM
PRODUCT_VENDOR_PROPERTIES += \
persist.vendor.dpmhalservice.enable=1
# DRM
PRODUCT_PACKAGES += \
android.hardware.drm-service.clearkey
PRODUCT_VENDOR_PROPERTIES += \
drm.service.enabled=true
# Fingerprint
PRODUCT_PACKAGES += \
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.fingerprint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.fingerprint.xml
# FM
BOARD_HAVE_QCOM_FM := true
# FRP
PRODUCT_VENDOR_PROPERTIES += \
ro.frp.pst=/dev/block/bootdevice/by-name/frp
# FUSE
PRODUCT_PRODUCT_PROPERTIES += \
persist.sys.fuse.passthrough.enable=true
# GFX
PRODUCT_VENDOR_PROPERTIES += \
ro.config.avoid_gfx_accel=true
# Lineage Health
PRODUCT_PACKAGES += \
vendor.lineage.health-service.default
TARGET_HEALTH_CHARGING_CONTROL_SUPPORTS_BYPASS := false
# HIDL
PRODUCT_PACKAGES += \
# 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
# Init scripts
PRODUCT_PACKAGES += \
init.qti.dcvs.sh \
init.qti.early_init.sh \
init.qti.diag.sh
PRODUCT_PACKAGES += \
fstab.zram \
init.surya.rc \
init.surya.perf.rc \
init.target.rc \
init.target.charger.rc \
init.xiaomi.fingerprint.rc \
init.xiaomi.rc \
init.qti.diag.rc \
ueventd.xiaomi.rc
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/init/fstab.qcom:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.qcom \
$(LOCAL_PATH)/init/fstab.qcom:$(TARGET_COPY_OUT_RAMDISK)/fstab.qcom
# Input
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/input/excluded-input-devices.xml:$(TARGET_COPY_OUT_VENDOR)/etc/excluded-input-devices.xml
# IR
PRODUCT_PACKAGES += \
android.hardware.ir-service.example
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.consumerir.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.consumerir.xml
# IWLAN
PRODUCT_VENDOR_PROPERTIES += \
persist.vendor.data.iwlan.enable=true
# 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)
# Keystore
PRODUCT_VENDOR_PROPERTIES += \
ro.hardware.keystore_desede=true
# Lights
PRODUCT_PACKAGES += \
android.hardware.light-service.xiaomi
# Media
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/media/media_codecs_c2.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_c2.xml
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
# Namespaces
PRODUCT_SOONG_NAMESPACES += \
$(LOCAL_PATH) \
hardware/google/interfaces \
hardware/google/pixel \
hardware/xiaomi
# Netflix
PRODUCT_SYSTEM_PROPERTIES += \
ro.netflix.bsp_rev=Q6150-17263-1
# NeuralNetworks
PRODUCT_PACKAGES += \
# NFC
PRODUCT_PACKAGES += \
NfcNci \
SecureElement \
Tag \
com.android.nfc_extras \
libchrome.vendor
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/com.nxp.mifare.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_surya/com.nxp.mifare.xml \
frameworks/native/data/etc/com.android.nfc_extras.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_surya/com.android.nfc_extras.xml \
frameworks/native/data/etc/android.hardware.nfc.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_surya/android.hardware.nfc.xml \
frameworks/native/data/etc/android.hardware.nfc.hce.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_surya/android.hardware.nfc.hce.xml \
frameworks/native/data/etc/android.hardware.nfc.hcef.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_surya/android.hardware.nfc.hcef.xml \
frameworks/native/data/etc/android.hardware.nfc.uicc.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_surya/android.hardware.nfc.uicc.xml \
frameworks/native/data/etc/android.hardware.se.omapi.uicc.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_surya/android.hardware.se.omapi.uicc.xml
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/nfc/libnfc-nci.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libnfc-nci.conf
# Overlays
PRODUCT_PACKAGES += \
AOSPSuryaFrameworksOverlay \
AOSPSuryaSettings \
AOSPSuryaSystemUIOverlay \
KarnaFrameworksOverlay \
SuryaNoCutoutOverlay \
NotchBarKillerOverlay \
SuryaCarrierConfigOverlay \
SuryaFrameworksOverlay \
SuryaNfcOverlay \
SuryaApertureOverlay \
SuryaSettingsOverlay \
SuryaSystemUIOverlay
# Partitions
PRODUCT_BUILD_SUPER_PARTITION := false
PRODUCT_USE_DYNAMIC_PARTITIONS := true
# Power
TARGET_PROVIDES_POWERHAL := true
PRODUCT_PACKAGES += android.hardware.power-service.xiaomi-libperfmgr
PRODUCT_COPY_FILES += $(LOCAL_PATH)/configs/power/powerhint.json:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint.json
# Platform
MSMSTEPPE := sm6150
TARGET_BOARD_PLATFORM := $(MSMSTEPPE)
TARGET_SEPOLICY_DIR := msmsteppe
# QTI
$(call inherit-product, device/qcom/common/common.mk)
TARGET_USE_SM8150_HALS := true
TARGET_COMMON_QTI_COMPONENTS := \
adreno \
alarm \
audio \
av \
bt \
charging \
display \
dsprpcd \
gps \
init \
keymaster \
media \
overlay \
perf \
telephony \
usb \
vibrator \
wfd \
wlan
# Radio
PRODUCT_VENDOR_PROPERTIES += \
persist.vendor.radio.add_power_save=0 \
persist.vendor.radio.atfwd.start=true \
persist.vendor.radio.data_con_rprt=1 \
persist.vendor.radio.force_on_dc=true \
persist.vendor.radio.manual_nw_rej_ct=1 \
persist.vendor.radio.mt_sms_ack=30 \
persist.vendor.radio.process_sups_ind=1 \
persist.vendor.radio.report_codec=1
# Sensors
PRODUCT_PACKAGES += \
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.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.enable.mag_filter=true
# Shipping API
PRODUCT_SHIPPING_API_LEVEL := 29
# Treble
PRODUCT_FULL_TREBLE_OVERRIDE := true
# Thermal
PRODUCT_VENDOR_PROPERTIES += \
vendor.sys.thermal.data.path=/data/vendor/thermal/
# USB
PRODUCT_SOONG_NAMESPACES += vendor/qcom/opensource/usb/etc
PRODUCT_PACKAGES += \
init.qcom.usb.rc \
init.qcom.usb.sh
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/init/init.mi.usb.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.mi.usb.sh
ifneq ($(TARGET_BUILD_VARIANT),user)
PRODUCT_VENDOR_PROPERTIES += \
persist.vendor.usb.config=mtp,adb
endif
# Userspace fastboot
PRODUCT_PACKAGES += \
fastbootd
# VNDK
PRODUCT_COPY_FILES += \
prebuilts/vndk/v32/arm64/arch-arm64-armv8-a/shared/vndk-sp/libhidlbase.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libhidlbase-v32.so
# WiFi
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/wifi/WCNSS_qcom_cfg.ini:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/WCNSS_qcom_cfg.ini
# ZRAM
PRODUCT_VENDOR_PROPERTIES += \
ro.zram.mark_idle_delay_mins=60 \
ro.zram.first_wb_delay_mins=1440 \
ro.zram.periodic_wb_delay_hours=24