1#
2# Copyright (C) 2020 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
17# Restrict the visibility of Android.bp files to improve build analysis time
18$(call inherit-product-if-exists, vendor/google/products/sources_pixel.mk)
19
20ifdef RELEASE_GOOGLE_RAVEN_RADIO_DIR
21RELEASE_GOOGLE_PRODUCT_RADIO_DIR := $(RELEASE_GOOGLE_RAVEN_RADIO_DIR)
22endif
23RELEASE_GOOGLE_BOOTLOADER_RAVEN_DIR ?= pdk# Keep this for pdk TODO: b/327119000
24RELEASE_GOOGLE_PRODUCT_BOOTLOADER_DIR := bootloader/$(RELEASE_GOOGLE_BOOTLOADER_RAVEN_DIR)
25$(call soong_config_set,raviole_bootloader,prebuilt_dir,$(RELEASE_GOOGLE_BOOTLOADER_RAVEN_DIR))
26
27
28TARGET_LINUX_KERNEL_VERSION := $(RELEASE_KERNEL_RAVEN_VERSION)
29# Keeps flexibility for kasan and ufs builds
30TARGET_KERNEL_DIR ?= $(RELEASE_KERNEL_RAVEN_DIR)
31TARGET_BOARD_KERNEL_HEADERS ?= $(RELEASE_KERNEL_RAVEN_DIR)/kernel-headers
32
33$(call inherit-product, device/google/raviole/uwb/uwb_calibration_country.mk)
34$(call inherit-product-if-exists, vendor/google_devices/raviole/prebuilts/device-vendor-raven.mk)
35$(call inherit-product-if-exists, vendor/google_devices/gs101/prebuilts/device-vendor.mk)
36$(call inherit-product-if-exists, vendor/google_devices/gs101/proprietary/device-vendor.mk)
37$(call inherit-product-if-exists, vendor/google_devices/raven/proprietary/device-vendor.mk)
38$(call inherit-product-if-exists, vendor/google_devices/raviole/proprietary/raven/device-vendor-raven.mk)
39$(call inherit-product-if-exists, vendor/google/camera/devices/raviole/raven/device-vendor.mk)
40$(call inherit-product-if-exists, vendor/google_devices/raviole/proprietary/WallpapersRaven.mk)
41
42DEVICE_PACKAGE_OVERLAYS += device/google/raviole/raven/overlay
43
44include device/google/raviole/audio/raven/audio-tables.mk
45include device/google/gs101/device-shipping-common.mk
46include device/google/gs101/telephony/pktrouter.mk
47include device/google/gs-common/bcmbt/bluetooth.mk
48include device/google/gs-common/touch/lsi/lsi.mk
49
50# Fingerprint HAL
51GOODIX_CONFIG_BUILD_VERSION := g6_trusty
52$(call inherit-product-if-exists, vendor/goodix/udfps/configuration/udfps_common.mk)
53ifeq ($(filter factory%, $(TARGET_PRODUCT)),)
54$(call inherit-product-if-exists, vendor/goodix/udfps/configuration/udfps_shipping.mk)
55else
56$(call inherit-product-if-exists, vendor/goodix/udfps/configuration/udfps_factory.mk)
57endif
58
59ifeq ($(filter factory_raven, $(TARGET_PRODUCT)),)
60include device/google/raviole/uwb/uwb_calibration.mk
61endif
62
63# go/lyric-soong-variables
64$(call soong_config_set,lyric,camera_hardware,raven)
65$(call soong_config_set,lyric,tuning_product,raven)
66$(call soong_config_set,google3a_config,target_device,raven)
67
68PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.support_kernel_idle_timer=true
69PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.enable_frame_rate_override=true
70
71# Init files
72PRODUCT_COPY_FILES += \
73	device/google/raviole/conf/init.raviole.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.raviole.rc \
74	device/google/raviole/conf/init.raven.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.raven.rc
75
76# Recovery files
77PRODUCT_COPY_FILES += \
78	device/google/gs101/conf/init.recovery.device.rc:$(TARGET_COPY_OUT_RECOVERY)/root/init.recovery.raven.rc
79
80# insmod files. Kernel 5.10 prebuilts don't provide these yet, so provide our
81# own copy if they're not in the prebuilts.
82# TODO(b/369686096): drop this when 5.10 is gone.
83ifeq ($(wildcard $(TARGET_KERNEL_DIR)/init.insmod.*.cfg),)
84PRODUCT_COPY_FILES += \
85	device/google/raviole/init.insmod.raven.cfg:$(TARGET_COPY_OUT_VENDOR_DLKM)/etc/init.insmod.raven.cfg
86endif
87
88# Thermal Config
89PRODUCT_COPY_FILES += \
90	device/google/raviole/thermal_info_config_raven.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config.json \
91	device/google/raviole/thermal_info_config_charge_raven.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config_charge.json
92
93# Power HAL config
94PRODUCT_COPY_FILES += \
95	device/google/raviole/powerhint-raven.json:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint.json \
96	device/google/raviole/powerhint-raven-mainline.json:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint-mainline.json
97
98PRODUCT_PACKAGES += \
99      UwbOverlayR4
100
101# Bluetooth sepolicy
102include device/google/gs101-sepolicy/raven-sepolicy.mk
103
104# Bluetooth
105PRODUCT_PRODUCT_PROPERTIES += \
106    persist.bluetooth.a2dp_aac.vbr_supported=true \
107    persist.bluetooth.firmware.selection=BCM.hcd
108
109# Bluetooth Tx power caps for raven
110PRODUCT_COPY_FILES += \
111    device/google/raviole/bluetooth_power_limits_raven.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits.csv \
112    device/google/raviole/bluetooth_power_limits_raven_us.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_US.csv \
113    device/google/raviole/bluetooth_power_limits_raven_eu.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_EU.csv \
114    device/google/raviole/bluetooth_power_limits_raven_jp.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_JP.csv
115
116# Bluetooth HAL
117PRODUCT_COPY_FILES += \
118	device/google/raviole/bluetooth/bt_vendor_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth/bt_vendor_overlay.conf
119
120# Bluetooth Hal Extension test tools
121PRODUCT_PACKAGES_DEBUG += \
122    sar_test \
123    hci_inject
124
125# userdebug specific
126ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
127# Bluetooth LE Audio Hardware offload
128PRODUCT_PRODUCT_PROPERTIES += \
129    ro.bluetooth.leaudio_offload.supported=true \
130    persist.bluetooth.leaudio_offload.disabled=true \
131    persist.bluetooth.le_audio_test=false
132endif
133
134# MIPI Coex Configs
135PRODUCT_COPY_FILES += \
136	device/google/raviole/radio/raven_camera_rear_tele_mipi_coex_table.csv:$(TARGET_COPY_OUT_VENDOR)/etc/modem/camera_rear_tele_mipi_coex_table.csv
137
138# Camera
139PRODUCT_COPY_FILES += \
140	device/google/raviole/media_profiles_raven.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles_V1_0.xml
141
142# Display Config
143PRODUCT_COPY_FILES += \
144	device/google/raviole/raven/display_golden_cal0.pb:$(TARGET_COPY_OUT_VENDOR)/etc/display_golden_cal0.pb \
145	device/google/raviole/raven/display_colordata_dev_cal0.pb:$(TARGET_COPY_OUT_VENDOR)/etc/display_colordata_dev_cal0.pb
146
147#config of display brightness dimming
148PRODUCT_DEFAULT_PROPERTY_OVERRIDES += vendor.display.0.brightness.dimming.usage=1
149
150# NFC
151PRODUCT_COPY_FILES += \
152	frameworks/native/data/etc/android.hardware.nfc.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.xml \
153	frameworks/native/data/etc/android.hardware.nfc.hce.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.hce.xml \
154	frameworks/native/data/etc/android.hardware.nfc.hcef.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.hcef.xml \
155	frameworks/native/data/etc/com.nxp.mifare.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/com.nxp.mifare.xml \
156	frameworks/native/data/etc/android.hardware.nfc.uicc.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.uicc.xml \
157	frameworks/native/data/etc/android.hardware.nfc.ese.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.ese.xml \
158	device/google/raviole/nfc/libnfc-hal-st.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libnfc-hal-st.conf \
159	device/google/raviole/nfc/libnfc-nci-raven.conf:$(TARGET_COPY_OUT_PRODUCT)/etc/libnfc-nci.conf
160
161PRODUCT_PACKAGES += \
162	$(RELEASE_PACKAGE_NFC_STACK) \
163	Tag \
164	android.hardware.nfc-service.st \
165	NfcOverlayRaven
166
167# Shared Modem Platform
168SHARED_MODEM_PLATFORM_VENDOR := lassen
169
170# Shared Modem Platform
171include device/google/gs-common/modem/modem_svc_sit/shared_modem_platform.mk
172
173# SecureElement
174PRODUCT_PACKAGES += \
175	android.hardware.secure_element@1.2-service-gto \
176	android.hardware.secure_element@1.2-service-gto-ese2
177
178PRODUCT_COPY_FILES += \
179	frameworks/native/data/etc/android.hardware.se.omapi.ese.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.se.omapi.ese.xml \
180	frameworks/native/data/etc/android.hardware.se.omapi.uicc.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.se.omapi.uicc.xml \
181	device/google/raviole/nfc/libse-gto-hal.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libse-gto-hal.conf \
182	device/google/raviole/nfc/libse-gto-hal2.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libse-gto-hal2.conf
183
184DEVICE_MANIFEST_FILE += \
185	device/google/raviole/nfc/manifest_se.xml
186
187
188# Vibrator HAL
189PRODUCT_PRODUCT_PROPERTIES +=\
190    ro.vendor.vibrator.hal.long.frequency.shift=15 \
191    ro.vendor.vibrator.hal.device.mass=0.21 \
192    ro.vendor.vibrator.hal.loc.coeff=2.5 \
193    persist.vendor.vibrator.hal.chirp.enabled=0
194
195ACTUATOR_MODEL := luxshare_ict_081545
196
197# Display LBE
198PRODUCT_DEFAULT_PROPERTY_OVERRIDES += vendor.display.lbe.supported=1
199
200# Media Performance Class 12
201PRODUCT_PROPERTY_OVERRIDES += ro.odm.build.media_performance_class=31
202
203# PowerStats HAL
204PRODUCT_SOONG_NAMESPACES += \
205    device/google/raviole/powerstats/raven \
206    device/google/raviole
207
208
209# userdebug specific
210ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
211    PRODUCT_COPY_FILES += \
212        device/google/gs101/init.hardware.wlc.rc.userdebug:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.wlc.rc
213endif
214
215# Increment the SVN for any official public releases
216ifdef RELEASE_SVN_RAVEN
217TARGET_SVN ?= $(RELEASE_SVN_RAVEN)
218else
219# Set this for older releases that don't use build flag
220TARGET_SVN ?= 86
221endif
222
223PRODUCT_VENDOR_PROPERTIES += \
224    ro.vendor.build.svn=$(TARGET_SVN)
225
226# Set device family property for SMR
227PRODUCT_PROPERTY_OVERRIDES += \
228    ro.build.device_family=O6R4B9
229
230# Set build properties for SMR builds
231ifeq ($(RELEASE_IS_SMR), true)
232    ifneq (,$(RELEASE_BASE_OS_RAVEN))
233        PRODUCT_BASE_OS := $(RELEASE_BASE_OS_RAVEN)
234    endif
235endif
236
237# Set build properties for EMR builds
238ifeq ($(RELEASE_IS_EMR), true)
239    ifneq (,$(RELEASE_BASE_OS_RAVEN))
240        PRODUCT_PROPERTY_OVERRIDES += \
241        ro.build.version.emergency_base_os=$(RELEASE_BASE_OS_RAVEN)
242    endif
243endif
244
245# Set support hide display cutout feature
246PRODUCT_PRODUCT_PROPERTIES += \
247    ro.support_hide_display_cutout=true
248
249# Hide cutout overlays
250PRODUCT_PACKAGES += \
251    NoCutoutOverlay \
252    AvoidAppsInCutoutOverlay
253
254# Android DeviceAsWebcam specific overlay
255PRODUCT_PACKAGES += \
256    DeviceAsWebcamRaven
257
258# Fingerprint antispoof property
259PRODUCT_PRODUCT_PROPERTIES +=\
260    persist.vendor.fingerprint.disable.fake.override=none
261
262# Fingerprint HAL
263PRODUCT_VENDOR_PROPERTIES += \
264    persist.vendor.udfps.lhbm_controlled_in_hal_supported=true \
265    persist.vendor.udfps.als_feed_forward_supported=true
266
267
268# Keyboard side padding in dp for portrait mode
269PRODUCT_PRODUCT_PROPERTIES += ro.com.google.ime.kb_pad_port_r=11
270PRODUCT_PRODUCT_PROPERTIES += ro.com.google.ime.kb_pad_port_l=11
271
272# DCK properties based on target
273PRODUCT_PROPERTY_OVERRIDES += \
274    ro.gms.dck.eligible_wcc=3 \
275    ro.gms.dck.se_capability=1
276
277# SKU specific RROs
278PRODUCT_PACKAGES += \
279    SettingsOverlayGF5KQ \
280    SettingsOverlayGLU0G \
281    SettingsOverlayG8V0U
282
283# Trusty liboemcrypto.so
284PRODUCT_SOONG_NAMESPACES += vendor/google_devices/raviole/prebuilts
285
286# Set support one-handed mode
287PRODUCT_PRODUCT_PROPERTIES += \
288    ro.support_one_handed_mode=true
289
290# Enable camera exif model/make reporting
291PRODUCT_VENDOR_PROPERTIES += \
292    persist.vendor.camera.exif_reveal_make_model=true
293
294# tetheroffload HAL
295PRODUCT_PACKAGES += \
296	vendor.samsung_slsi.hardware.tetheroffload@1.1-service
297
298# Override default distortion output gain according to UX experiments
299PRODUCT_VENDOR_PROPERTIES += \
300    vendor.audio.hapticgenerator.distortion.output.gain=0.32
301
302# RKPD
303PRODUCT_PRODUCT_PROPERTIES += \
304    remote_provisioning.hostname=remoteprovisioning.googleapis.com \
305
306# Set zram size
307PRODUCT_VENDOR_PROPERTIES += \
308    vendor.zram.size=3g
309
310# This device is shipped with 31 (Android S)
311PRODUCT_SHIPPING_API_LEVEL := 31
312
313# declare use of spatial audio
314PRODUCT_PROPERTY_OVERRIDES += \
315    ro.audio.spatializer_enabled=true
316
317# optimize spatializer effect
318PRODUCT_PROPERTY_OVERRIDES += \
319    audio.spatializer.effect.util_clamp_min=300
320
321PRODUCT_PACKAGES += \
322	libspatialaudio
323
324# Device features
325PRODUCT_COPY_FILES += \
326    frameworks/native/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml
327
328# Display RRS default Config
329PRODUCT_DEFAULT_PROPERTY_OVERRIDES += persist.vendor.display.primary.boot_config=1440x3120@120
330
331# Bluetooth OPUS codec
332PRODUCT_PRODUCT_PROPERTIES += \
333    persist.bluetooth.opus.enabled=true
334
335# Location
336ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
337    ifneq (,$(filter 6.1, $(TARGET_LINUX_KERNEL_VERSION)))
338        PRODUCT_COPY_FILES += \
339            device/google/raviole/location/gps.6.1.xml.raven:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml
340    else
341        PRODUCT_COPY_FILES += \
342            device/google/raviole/location/gps.xml.raven:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml
343    endif
344else
345    ifneq (,$(filter 6.1, $(TARGET_LINUX_KERNEL_VERSION)))
346        PRODUCT_COPY_FILES += \
347            device/google/raviole/location/gps_user.6.1.xml.raven:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml
348    else
349        PRODUCT_COPY_FILES += \
350            device/google/raviole/location/gps_user.xml.raven:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml
351    endif
352endif
353
354# Enable DeviceAsWebcam support
355PRODUCT_VENDOR_PROPERTIES += \
356    ro.usb.uvc.enabled=true
357# Quick Start device-specific settings
358PRODUCT_PRODUCT_PROPERTIES += \
359    ro.quick_start.oem_id=00e0 \
360    ro.quick_start.device_id=raven
361
362# Disable AVF Remote Attestation
363PRODUCT_AVF_REMOTE_ATTESTATION_DISABLED := true
364
365# Bluetooth device id
366# Raven: 0x4107
367PRODUCT_PRODUCT_PROPERTIES += \
368    bluetooth.device_id.product_id=16647
369
370# ETM
371ifneq (,$(RELEASE_ETM_IN_USERDEBUG_ENG))
372ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
373$(call inherit-product-if-exists, device/google/common/etm/device-userdebug-modules.mk)
374endif
375endif
376
377# PlayVideos
378PLAYVIDEOS_VERSION_DIR := 4.20.6
379$(call soong_config_set_bool,playvideos,use_device_specific_version,true)
380PRODUCT_SOONG_NAMESPACES += vendor/unbundled_google/packages/PlayVideos/$(PLAYVIDEOS_VERSION_DIR)
381