1#
2# Copyright (C) 2019 The Android Open-Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17TARGET_USERIMAGES_USE_F2FS := true
18
19LOCAL_PATH := device/google/crosshatch
20
21# define hardware platform
22PRODUCT_PLATFORM := sdm845
23
24# Enable updating of APEXes
25$(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk)
26
27include device/google/crosshatch/device.mk
28
29PRODUCT_PROPERTY_OVERRIDES += \
30    ro.control_privapp_permissions=disable
31
32PRODUCT_ENFORCE_RRO_TARGETS := framework-res
33
34# Audio fluence, ns, aec property, voice volume steps
35PRODUCT_PROPERTY_OVERRIDES += \
36    ro.qc.sdk.audio.fluencetype=fluencepro \
37    persist.audio.fluence.voicecall=true \
38    persist.audio.fluence.speaker=true \
39    persist.audio.fluence.voicecomm=true \
40    persist.audio.fluence.voicerec=false \
41    ro.config.vc_call_vol_steps=7
42
43# Bug 77867216
44PRODUCT_PROPERTY_OVERRIDES += audio.adm.buffering.ms=3
45PRODUCT_PROPERTY_OVERRIDES += vendor.audio.adm.buffering.ms=3
46PRODUCT_PROPERTY_OVERRIDES += audio_hal.period_multiplier=2
47PRODUCT_PROPERTY_OVERRIDES += af.fast_track_multiplier=1
48
49# Enable HW Codec 2.0 as default service
50# Set all codec components are available with their normal ranks
51# Set OMX components's default rank large than Codec 2.0 HW components's default rank (0x100)
52PRODUCT_PROPERTY_OVERRIDES += debug.stagefright.ccodec=4
53PRODUCT_PROPERTY_OVERRIDES += debug.stagefright.omx_default_rank=512
54
55# Pixelstats broken mic detection
56PRODUCT_PROPERTY_OVERRIDES += vendor.audio.mic_break=true
57
58# Setting vendor SPL
59VENDOR_SECURITY_PATCH = $(PLATFORM_SECURITY_PATCH)
60
61# Set boot SPL
62BOOT_SECURITY_PATCH = $(PLATFORM_SECURITY_PATCH)
63
64# MIDI feature
65PRODUCT_COPY_FILES += \
66    frameworks/native/data/etc/android.software.midi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.midi.xml
67
68# Audio low latency feature
69PRODUCT_COPY_FILES += \
70    frameworks/native/data/etc/android.hardware.audio.low_latency.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.low_latency.xml
71
72# Pro audio feature
73PRODUCT_COPY_FILES += \
74    frameworks/native/data/etc/android.hardware.audio.pro.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.pro.xml
75
76# Enable AAudio MMAP/NOIRQ data path.
77# 1 is AAUDIO_POLICY_NEVER  means only use Legacy path.
78# 2 is AAUDIO_POLICY_AUTO   means try MMAP then fallback to Legacy path.
79# 3 is AAUDIO_POLICY_ALWAYS means only use MMAP path.
80PRODUCT_PROPERTY_OVERRIDES += aaudio.mmap_policy=2
81# 1 is AAUDIO_POLICY_NEVER  means only use SHARED mode
82# 2 is AAUDIO_POLICY_AUTO   means try EXCLUSIVE then fallback to SHARED mode.
83# 3 is AAUDIO_POLICY_ALWAYS means only use EXCLUSIVE mode.
84PRODUCT_PROPERTY_OVERRIDES += aaudio.mmap_exclusive_policy=2
85
86# Increase the apparent size of a hardware burst from 1 msec to 2 msec.
87# A "burst" is the number of frames processed at one time.
88# That is an increase from 48 to 96 frames at 48000 Hz.
89# The DSP will still be bursting at 48 frames but AAudio will think the burst is 96 frames.
90# A low number, like 48, might increase power consumption or stress the system.
91PRODUCT_PROPERTY_OVERRIDES += aaudio.hw_burst_min_usec=2000
92
93# Set lmkd options
94PRODUCT_PRODUCT_PROPERTIES += \
95    ro.lmk.low=1001 \
96    ro.lmk.medium=800 \
97    ro.lmk.critical=0 \
98    ro.lmk.critical_upgrade=false \
99    ro.lmk.upgrade_pressure=100 \
100    ro.lmk.downgrade_pressure=100 \
101    ro.lmk.kill_heaviest_task=true \
102    ro.lmk.kill_timeout_ms=100 \
103    ro.lmk.use_minfree_levels=true \
104
105# A2DP offload enabled for compilation
106AUDIO_FEATURE_ENABLED_A2DP_OFFLOAD := true
107
108# A2DP offload supported
109PRODUCT_PROPERTY_OVERRIDES += \
110ro.bluetooth.a2dp_offload.supported=true
111
112# A2DP offload disabled (UI toggle property)
113PRODUCT_PROPERTY_OVERRIDES += \
114persist.bluetooth.a2dp_offload.disabled=false
115
116# A2DP offload DSP supported encoder list
117PRODUCT_PROPERTY_OVERRIDES += \
118persist.bluetooth.a2dp_offload.cap=sbc-aac-aptx-aptxhd-ldac
119
120# Modem loging file
121PRODUCT_COPY_FILES += \
122    device/google/crosshatch/init.logging.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.$(PRODUCT_PLATFORM).logging.rc
123
124# Dumpstate HAL
125PRODUCT_PACKAGES += \
126    android.hardware.dumpstate@1.0-service.crosshatch
127
128# Dmabuf dump tool for bug reports
129PRODUCT_PACKAGES += \
130    dmabuf_dump
131
132# whitelisted app
133PRODUCT_COPY_FILES += \
134    device/google/crosshatch/qti_whitelist.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/sysconfig/qti_whitelist.xml
135
136PRODUCT_PACKAGES += \
137    llkd
138#PRODUCT_PROPERTY_OVERRIDES += \
139#    ro.khungtask.enable=false
140#
141
142# Enable retrofit dynamic partitions for all blueline
143# and crosshatch targets
144PRODUCT_USE_DYNAMIC_PARTITIONS := true
145PRODUCT_RETROFIT_DYNAMIC_PARTITIONS := true
146PRODUCT_PACKAGES += \
147    android.hardware.boot@1.0-impl.recovery \
148    bootctrl.sdm845 \
149    bootctrl.sdm845.recovery \
150    check_dynamic_partitions \
151
152AB_OTA_POSTINSTALL_CONFIG += \
153    RUN_POSTINSTALL_product=true \
154    POSTINSTALL_PATH_product=bin/check_dynamic_partitions \
155    FILESYSTEM_TYPE_product=ext4 \
156    POSTINSTALL_OPTIONAL_product=false \
157