1#
2# Copyright (C) 2021 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
17ifdef RELEASE_GOOGLE_TOKAY_RADIO_DIR
18RELEASE_GOOGLE_PRODUCT_RADIO_DIR ?= $(RELEASE_GOOGLE_TOKAY_RADIO_DIR)
19endif
20ifdef RELEASE_GOOGLE_TOKAY_RADIOCFG_DIR
21RELEASE_GOOGLE_PRODUCT_RADIOCFG_DIR ?= $(RELEASE_GOOGLE_TOKAY_RADIOCFG_DIR)
22endif
23RELEASE_GOOGLE_BOOTLOADER_TOKAY_DIR ?= 24D1# Keep this for pdk TODO: b/327119000
24RELEASE_GOOGLE_PRODUCT_BOOTLOADER_DIR := bootloader/$(RELEASE_GOOGLE_BOOTLOADER_TOKAY_DIR)
25$(call soong_config_set,caimito_bootloader,prebuilt_dir,$(RELEASE_GOOGLE_BOOTLOADER_TOKAY_DIR))
26
27ifdef RELEASE_KERNEL_TOKAY_DIR
28TARGET_KERNEL_DIR ?= $(RELEASE_KERNEL_TOKAY_DIR)
29TARGET_BOARD_KERNEL_HEADERS ?= $(RELEASE_KERNEL_TOKAY_DIR)/kernel-headers
30else
31TARGET_KERNEL_DIR ?= device/google/caimito-kernels/6.1/24D1
32TARGET_BOARD_KERNEL_HEADERS ?= device/google/caimito-kernels/6.1/24D1/kernel-headers
33endif
34
35$(call inherit-product-if-exists, vendor/google_devices/caimito/prebuilts/device-vendor-tokay.mk)
36$(call inherit-product-if-exists, vendor/google_devices/zumapro/prebuilts/device-vendor.mk)
37$(call inherit-product-if-exists, vendor/google_devices/zumapro/proprietary/device-vendor.mk)
38$(call inherit-product-if-exists, vendor/google_devices/tokay/proprietary/device-vendor.mk)
39$(call inherit-product-if-exists, vendor/google_devices/caimito/proprietary/tokay/device-vendor-tokay.mk)
40
41ifeq ($(filter factory_tokay, $(TARGET_PRODUCT)),)
42    $(call inherit-product-if-exists, vendor/google_devices/caimito/proprietary/WallpapersTokay.mk)
43endif
44
45# display
46DEVICE_PACKAGE_OVERLAYS += device/google/caimito/tokay/overlay
47
48ifeq ($(RELEASE_PIXEL_AIDL_AUDIO_HAL),true)
49USE_AUDIO_HAL_AIDL := true
50endif
51
52include device/google/caimito/audio/tokay/audio-tables.mk
53include device/google/zumapro/device-shipping-common.mk
54include hardware/google/pixel/vibrator/cs40l26/device.mk
55include device/google/gs-common/bcmbt/bluetooth.mk
56include device/google/gs-common/touch/gti/predump_gti.mk
57include device/google/caimito/fingerprint/ultrasonic_udfps.mk
58include device/google/gs-common/modem/radio_ext/radio_ext.mk
59include device/google/gs-common/pixelsupport/pixelsupport.mk
60
61# Increment the SVN for any official public releases
62ifdef RELEASE_SVN_TOKAY
63TARGET_SVN ?= $(RELEASE_SVN_TOKAY)
64else
65# Set this for older releases that don't use build flag
66TARGET_SVN ?= 04
67endif
68
69PRODUCT_VENDOR_PROPERTIES += \
70    ro.vendor.build.svn=$(TARGET_SVN)
71
72# go/lyric-soong-variables
73$(call soong_config_set,lyric,camera_hardware,tokay)
74$(call soong_config_set,lyric,tuning_product,tokay)
75$(call soong_config_set,google3a_config,target_device,tokay)
76
77# display
78DEVICE_PACKAGE_OVERLAYS += device/google/caimito/tokay/overlay
79PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.set_idle_timer_ms=1000
80PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.ignore_hdr_camera_layers=true
81
82# Init files
83PRODUCT_COPY_FILES += \
84	device/google/caimito/conf/init.tokay.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.tokay.rc
85
86# Recovery files
87PRODUCT_COPY_FILES += \
88        device/google/caimito/conf/init.recovery.device.rc:$(TARGET_COPY_OUT_RECOVERY)/root/init.recovery.tokay.rc
89
90# NFC
91PRODUCT_COPY_FILES += \
92	frameworks/native/data/etc/android.hardware.nfc.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.xml \
93	frameworks/native/data/etc/android.hardware.nfc.hce.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.hce.xml \
94	frameworks/native/data/etc/android.hardware.nfc.hcef.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.hcef.xml \
95	frameworks/native/data/etc/com.nxp.mifare.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/com.nxp.mifare.xml \
96	frameworks/native/data/etc/android.hardware.nfc.ese.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.ese.xml \
97	device/google/caimito/nfc/libnfc-hal-st.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libnfc-hal-st.conf \
98	device/google/caimito/nfc/libnfc-nci.conf:$(TARGET_COPY_OUT_PRODUCT)/etc/libnfc-nci.conf
99
100PRODUCT_PACKAGES += \
101	$(RELEASE_PACKAGE_NFC_STACK) \
102	Tag \
103	android.hardware.nfc-service.st \
104	NfcOverlayTokay
105
106# SecureElement
107PRODUCT_PACKAGES += \
108	android.hardware.secure_element-service.thales
109
110PRODUCT_COPY_FILES += \
111	frameworks/native/data/etc/android.hardware.se.omapi.ese.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.se.omapi.ese.xml \
112	frameworks/native/data/etc/android.hardware.se.omapi.uicc.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.se.omapi.uicc.xml \
113	device/google/caimito/nfc/libse-gto-hal.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libse-gto-hal.conf
114
115# Bluetooth HAL
116PRODUCT_COPY_FILES += \
117	device/google/caimito/bluetooth/bt_vendor_overlay_tokay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth/bt_vendor_overlay.conf
118PRODUCT_PROPERTY_OVERRIDES += \
119    ro.bluetooth.a2dp_offload.supported=true \
120    persist.bluetooth.a2dp_offload.disabled=false \
121    persist.bluetooth.a2dp_offload.cap=sbc-aac-aptx-aptxhd-ldac-opus
122
123# Coex Config
124PRODUCT_SOONG_NAMESPACES += device/google/caimito/radio/tokay/coex
125PRODUCT_PACKAGES += \
126    camera_front_dbr_coex_table \
127    camera_front_mipi_coex_table \
128    camera_rear_main_mipi_coex_table \
129    camera_rear_wide_mipi_coex_table \
130    display_primary_mipi_coex_table \
131    display_primary_ssc_coex_table
132
133# Bluetooth Tx power caps
134PRODUCT_COPY_FILES += \
135        $(LOCAL_PATH)/bluetooth/bluetooth_power_limits_tokay.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits.csv \
136        $(LOCAL_PATH)/bluetooth/bluetooth_power_limits_tokay_JP.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_JP.csv \
137        $(LOCAL_PATH)/bluetooth/bluetooth_power_limits_tokay_CA.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_CA.csv \
138        $(LOCAL_PATH)/bluetooth/bluetooth_power_limits_tokay_EU.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_EU.csv \
139        $(LOCAL_PATH)/bluetooth/bluetooth_power_limits_tokay_US.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_US.csv
140
141# DCK properties based on target
142PRODUCT_PROPERTY_OVERRIDES += \
143    ro.gms.dck.eligible_wcc=2 \
144    ro.gms.dck.se_capability=1
145
146# POF
147PRODUCT_PRODUCT_PROPERTIES += \
148    ro.bluetooth.finder.supported=true
149
150# Spatial Audio
151PRODUCT_PACKAGES += \
152	libspatialaudio
153
154# declare use of spatial audio
155PRODUCT_PROPERTY_OVERRIDES += \
156       ro.audio.spatializer_enabled=true
157
158# declare use of stereo spatialization
159PRODUCT_PROPERTY_OVERRIDES += \
160    ro.audio.stereo_spatialization_enabled=true
161
162ifneq ($(USE_AUDIO_HAL_AIDL),true)
163# HIDL Sound Dose
164PRODUCT_PACKAGES += \
165	android.hardware.audio.sounddose-vendor-impl \
166	audio_sounddose_aoc
167endif
168
169# HdMic Audio
170PRODUCT_SOONG_NAMESPACES += device/google/caimito/audio/tokay/prebuilt/libspeechenhancer
171PRODUCT_PROPERTY_OVERRIDES += \
172    persist.vendor.app.audio.gsenet.version=1
173PRODUCT_PACKAGES += \
174    libspeechenhancer
175
176# Audio CCA property
177PRODUCT_PROPERTY_OVERRIDES += \
178	persist.vendor.audio.cca.enabled=false
179
180# Bluetooth hci_inject test tool
181PRODUCT_PACKAGES_DEBUG += \
182    hci_inject
183
184# Bluetooth OPUS codec
185PRODUCT_PRODUCT_PROPERTIES += \
186    persist.bluetooth.opus.enabled=true
187
188# Bluetooth SAR test tool
189PRODUCT_PACKAGES_DEBUG += \
190    sar_test
191
192# Bluetooth EWP test tool
193PRODUCT_PACKAGES_DEBUG += \
194    ewp_tool
195
196# Bluetooth AAC VBR
197PRODUCT_PRODUCT_PROPERTIES += \
198    persist.bluetooth.a2dp_aac.vbr_supported=true
199
200# Bluetooth Super Wide Band
201PRODUCT_PRODUCT_PROPERTIES += \
202    bluetooth.hfp.swb.supported=true
203
204# Override BQR mask to enable LE Audio Choppy report, remove BTRT logging
205ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
206PRODUCT_PRODUCT_PROPERTIES += \
207    persist.bluetooth.bqr.event_mask=295006 \
208    persist.bluetooth.bqr.vnd_quality_mask=29 \
209    persist.bluetooth.bqr.vnd_trace_mask=0 \
210    persist.bluetooth.vendor.btsnoop=true
211else
212PRODUCT_PRODUCT_PROPERTIES += \
213    persist.bluetooth.bqr.event_mask=295006 \
214    persist.bluetooth.bqr.vnd_quality_mask=16 \
215    persist.bluetooth.bqr.vnd_trace_mask=0 \
216    persist.bluetooth.vendor.btsnoop=false
217endif
218
219# default BDADDR for EVB only
220PRODUCT_PROPERTY_OVERRIDES += \
221	ro.vendor.bluetooth.evb_bdaddr="22:22:22:33:44:55"
222
223# Spatial Audio
224PRODUCT_PACKAGES += \
225	libspatialaudio \
226	librondo
227
228# Keymaster HAL
229#LOCAL_KEYMASTER_PRODUCT_PACKAGE ?= android.hardware.keymaster@4.1-service
230
231# Gatekeeper HAL
232#LOCAL_GATEKEEPER_PRODUCT_PACKAGE ?= android.hardware.gatekeeper@1.0-service.software
233
234
235# Gatekeeper
236# PRODUCT_PACKAGES += \
237# 	android.hardware.gatekeeper@1.0-service.software
238
239# Keymint replaces Keymaster
240# PRODUCT_PACKAGES += \
241# 	android.hardware.security.keymint-service
242
243# Keymaster
244#PRODUCT_PACKAGES += \
245#	android.hardware.keymaster@4.0-impl \
246#	android.hardware.keymaster@4.0-service
247
248#PRODUCT_PACKAGES += android.hardware.keymaster@4.0-service.remote
249#PRODUCT_PACKAGES += android.hardware.keymaster@4.1-service.remote
250#LOCAL_KEYMASTER_PRODUCT_PACKAGE := android.hardware.keymaster@4.1-service
251#LOCAL_KEYMASTER_PRODUCT_PACKAGE ?= android.hardware.keymaster@4.1-service
252
253# PRODUCT_PROPERTY_OVERRIDES += \
254# 	ro.hardware.keystore_desede=true \
255# 	ro.hardware.keystore=software \
256# 	ro.hardware.gatekeeper=software
257
258# PowerStats HAL
259PRODUCT_SOONG_NAMESPACES += \
260    device/google/caimito/powerstats/tokay
261
262# WiFi Overlay
263PRODUCT_PACKAGES += \
264    WifiOverlay2024
265
266# Settings Overlay
267PRODUCT_PACKAGES += \
268    SettingsTokayOverlay
269
270# Trusty liboemcrypto.so
271PRODUCT_SOONG_NAMESPACES += vendor/google_devices/caimito/prebuilts
272
273# Location
274PRODUCT_SOONG_NAMESPACES += device/google/caimito/location/tokay
275$(call soong_config_set, gpssdk, buildtype, $(TARGET_BUILD_VARIANT))
276PRODUCT_PACKAGES += gps.cfg
277# For GPS property
278PRODUCT_VENDOR_PROPERTIES += ro.vendor.gps.pps.enabled=true
279
280# Display LBE
281PRODUCT_DEFAULT_PROPERTY_OVERRIDES += vendor.display.lbe.supported=1
282
283#Thermal VT estimator
284PRODUCT_PACKAGES += \
285    libthermal_tflite_wrapper
286
287PRODUCT_VENDOR_PROPERTIES += \
288	persist.device_config.configuration.disable_rescue_party=true
289
290PRODUCT_VENDOR_PROPERTIES += \
291    persist.vendor.udfps.als_feed_forward_supported=true \
292    persist.vendor.udfps.lhbm_controlled_in_hal_supported=true
293
294# OIS with system imu
295PRODUCT_VENDOR_PROPERTIES += \
296    persist.vendor.camera.ois_with_system_imu=true
297
298# Allow external binning setting
299PRODUCT_VENDOR_PROPERTIES += \
300    persist.vendor.camera.allow_external_binning_setting=true
301
302# Camera Vendor property
303PRODUCT_VENDOR_PROPERTIES += \
304    persist.vendor.camera.front_720P_always_binning=true
305
306# Enable camera exif model/make reporting
307PRODUCT_VENDOR_PROPERTIES += \
308    persist.vendor.camera.exif_reveal_make_model=true
309
310# Media Performance Class 14
311PRODUCT_PRODUCT_PROPERTIES += ro.odm.build.media_performance_class=34
312
313# Vibrator HAL
314$(call soong_config_set,haptics,kernel_ver,v$(subst .,_,$(TARGET_LINUX_KERNEL_VERSION)))
315ACTUATOR_MODEL := luxshare_ict_081545
316ADAPTIVE_HAPTICS_FEATURE := adaptive_haptics_v1
317PRODUCT_VENDOR_PROPERTIES += \
318    ro.vendor.vibrator.hal.chirp.enabled=1 \
319    ro.vendor.vibrator.hal.device.mass=0.222 \
320    ro.vendor.vibrator.hal.loc.coeff=2.8 \
321    persist.vendor.vibrator.hal.context.enable=false \
322    persist.vendor.vibrator.hal.context.scale=60 \
323    persist.vendor.vibrator.hal.context.fade=true \
324    persist.vendor.vibrator.hal.context.cooldowntime=1600 \
325    persist.vendor.vibrator.hal.context.settlingtime=5000 \
326    ro.vendor.vibrator.hal.pm.activetimeout=5
327
328# PKVM Memory Reclaim
329PRODUCT_VENDOR_PROPERTIES += \
330    hypervisor.memory_reclaim.supported=1
331
332# Bluetooth LE Audio
333# Unicast
334PRODUCT_PRODUCT_PROPERTIES += \
335	bluetooth.profile.bap.unicast.client.enabled=true \
336	bluetooth.profile.csip.set_coordinator.enabled=true \
337	bluetooth.profile.hap.client.enabled=true \
338	bluetooth.profile.mcp.server.enabled=true \
339	bluetooth.profile.ccp.server.enabled=true \
340	bluetooth.profile.vcp.controller.enabled=true
341
342# Set support one-handed mode
343PRODUCT_PRODUCT_PROPERTIES += \
344    ro.support_one_handed_mode=true
345
346ifeq ($(RELEASE_PIXEL_BROADCAST_ENABLED), true)
347PRODUCT_PRODUCT_PROPERTIES += \
348	bluetooth.profile.bap.broadcast.assist.enabled=true \
349	bluetooth.profile.bap.broadcast.source.enabled=true
350endif
351
352# LE Audio switcher in developer options
353PRODUCT_PRODUCT_PROPERTIES += \
354	ro.bluetooth.leaudio_switcher.supported=true \
355
356# Enable hardware offloading
357PRODUCT_PRODUCT_PROPERTIES += \
358	ro.bluetooth.leaudio_offload.supported=true \
359	persist.bluetooth.leaudio_offload.disabled=false
360
361# Bluetooth LE Audio CIS handover to SCO
362# Set the property only for the controller couldn't support CIS/SCO simultaneously. More detailed in b/242908683.
363PRODUCT_PRODUCT_PROPERTIES += \
364	persist.bluetooth.leaudio.notify.idle.during.call=true
365
366# LE Audio Offload Capabilities setting
367PRODUCT_COPY_FILES += \
368    device/google/caimito/bluetooth/le_audio_codec_capabilities.xml:$(TARGET_COPY_OUT_VENDOR)/etc/le_audio_codec_capabilities.xml
369
370# Disable LE Audio dual mic SWB call support
371# This may depend on the BT controller capability or the launch strategy
372# For example, P22 BT chip is not able to support 32k dual mic
373# P23a disabled the 32k dual mic as it is not in the phase 2 launch plan
374PRODUCT_PRODUCT_PROPERTIES += \
375    bluetooth.leaudio.dual_bidirection_swb.supported=true
376
377# LE Audio Unicast Allowlist
378PRODUCT_PRODUCT_PROPERTIES += \
379   persist.bluetooth.leaudio.allow_list=SM-R510
380
381# Support LE & Classic concurrent encryption (b/330704060)
382PRODUCT_PRODUCT_PROPERTIES += \
383    bluetooth.ble.allow_enc_with_bredr=true
384
385# Exynos RIL and telephony
386# Support RIL Domain-selection
387SUPPORT_RIL_DOMAIN_SELECTION := true
388
389# Keyboard height ratio and bottom padding in dp for portrait mode
390PRODUCT_PRODUCT_PROPERTIES += \
391          ro.com.google.ime.kb_pad_port_b=8 \
392          ro.com.google.ime.height_ratio=1.09
393
394# Enable Bluetooth AutoOn feature
395PRODUCT_PRODUCT_PROPERTIES += \
396    bluetooth.server.automatic_turn_on=true
397
398# Window Extensions
399$(call inherit-product, $(SRC_TARGET_DIR)/product/window_extensions.mk)
400
401# ETM
402ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
403$(call inherit-product-if-exists, device/google/common/etm/device-userdebug-modules.mk)
404endif
405
406# Connectivity Resources Overlay
407PRODUCT_PACKAGES += \
408    ConnectivityResourcesOverlayCaimitoOverride
409
410#Component Override for Pixel Troubleshooting App
411PRODUCT_COPY_FILES += \
412    device/google/caimito/tokay/tokay-component-overrides.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sysconfig/tokay-component-overrides.xml
413
414PRODUCT_PRODUCT_PROPERTIES += \
415    persist.bluetooth.thread_dispatcher.enabled=true
416
417# Reduce lmkd aggressiveness
418PRODUCT_PROPERTY_OVERRIDES += \
419    ro.lmk.swap_free_low_percentage=7
420