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
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
20TARGET_LINUX_KERNEL_VERSION := $(RELEASE_KERNEL_BLUEJAY_VERSION)
21# Keeps flexibility for kasan and ufs builds
22TARGET_KERNEL_DIR ?= $(RELEASE_KERNEL_BLUEJAY_DIR)
23TARGET_BOARD_KERNEL_HEADERS ?= $(RELEASE_KERNEL_BLUEJAY_DIR)/kernel-headers
24
25$(call inherit-product-if-exists, vendor/google_devices/bluejay/prebuilts/device-vendor-bluejay.mk)
26$(call inherit-product-if-exists, vendor/google_devices/gs101/prebuilts/device-vendor.mk)
27$(call inherit-product-if-exists, vendor/google_devices/gs101/proprietary/device-vendor.mk)
28$(call inherit-product-if-exists, vendor/google_devices/bluejay/proprietary/device-vendor.mk)
29$(call inherit-product-if-exists, vendor/google_devices/bluejay/proprietary/bluejay/device-vendor-bluejay.mk)
30$(call inherit-product-if-exists, vendor/google_devices/bluejay/proprietary/WallpapersBluejay.mk)
31
32DEVICE_PACKAGE_OVERLAYS += device/google/bluejay/bluejay/overlay
33
34include device/google/gs101/fingerprint/extension/fingerprint.extension.mk
35include device/google/bluejay-sepolicy/bluejay-sepolicy.mk
36include device/google/bluejay/audio/bluejay/audio-tables.mk
37include device/google/gs101/device-shipping-common.mk
38include device/google/gs101/telephony/pktrouter.mk
39include device/google/gs-common/bcmbt/bluetooth.mk
40include device/google/gs-common/touch/stm/stm11.mk
41
42# Fingerprint HAL
43GOODIX_CONFIG_BUILD_VERSION := g7_trusty
44$(call inherit-product-if-exists, vendor/goodix/udfps/configuration/udfps_common.mk)
45ifeq ($(filter factory%, $(TARGET_PRODUCT)),)
46$(call inherit-product-if-exists, vendor/goodix/udfps/configuration/udfps_shipping.mk)
47else
48$(call inherit-product-if-exists, vendor/goodix/udfps/configuration/udfps_factory.mk)
49endif
50
51# go/lyric-soong-variables
52$(call soong_config_set,lyric,camera_hardware,bluejay)
53$(call soong_config_set,lyric,tuning_product,bluejay)
54$(call soong_config_set,google3a_config,target_device,bluejay)
55
56# Init files
57PRODUCT_COPY_FILES += \
58	device/google/bluejay/conf/init.blueport.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.blueport.rc \
59	device/google/bluejay/conf/init.bluejay.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.bluejay.rc
60
61# Recovery files
62PRODUCT_COPY_FILES += \
63	device/google/gs101/conf/init.recovery.device.rc:$(TARGET_COPY_OUT_RECOVERY)/root/init.recovery.bluejay.rc
64
65# insmod files. Kernel 5.10 prebuilts don't provide these yet, so provide our
66# own copy if they're not in the prebuilts.
67# TODO(b/369686096): drop this when 5.10 is gone.
68ifeq ($(wildcard $(TARGET_KERNEL_DIR)/init.insmod.*.cfg),)
69PRODUCT_COPY_FILES += \
70	device/google/bluejay/init.insmod.bluejay.cfg:$(TARGET_COPY_OUT_VENDOR_DLKM)/etc/init.insmod.bluejay.cfg
71endif
72
73# Thermal Config
74PRODUCT_COPY_FILES += \
75	device/google/bluejay/thermal_info_config_bluejay.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config.json \
76	device/google/bluejay/thermal_info_config_charge_bluejay.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config_charge.json
77
78# Power HAL config
79PRODUCT_COPY_FILES += \
80	device/google/bluejay/powerhint.json:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint.json
81
82# Camera
83PRODUCT_COPY_FILES += \
84	device/google/bluejay/media_profiles_bluejay.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles_V1_0.xml
85
86PRODUCT_PROPERTY_OVERRIDES += \
87    persist.vendor.camera.extended_launch_boost=1 \
88    persist.vendor.camera.raise_buf_allocation_priority=1 \
89    persist.vendor.camera.fixed_fps_range_boost=1
90
91# Display Config
92PRODUCT_COPY_FILES += \
93	device/google/bluejay/display_colordata_dev_cal0.pb:$(TARGET_COPY_OUT_VENDOR)/etc/display_colordata_dev_cal0.pb \
94	device/google/bluejay/display_golden_cal0.pb:$(TARGET_COPY_OUT_VENDOR)/etc/display_golden_cal0.pb
95
96# Media Performance Class 12
97PRODUCT_PROPERTY_OVERRIDES += ro.odm.build.media_performance_class=31
98
99# NFC
100PRODUCT_COPY_FILES += \
101	frameworks/native/data/etc/android.hardware.nfc.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.xml \
102	frameworks/native/data/etc/android.hardware.nfc.hce.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.hce.xml \
103	frameworks/native/data/etc/android.hardware.nfc.hcef.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.hcef.xml \
104	frameworks/native/data/etc/com.nxp.mifare.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/com.nxp.mifare.xml \
105	frameworks/native/data/etc/android.hardware.nfc.uicc.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.uicc.xml \
106	frameworks/native/data/etc/android.hardware.nfc.ese.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.ese.xml \
107	device/google/bluejay/nfc/libnfc-hal-st.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libnfc-hal-st.conf \
108	device/google/bluejay/nfc/libnfc-hal-st-GB17L.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libnfc-hal-st-GB17L.conf \
109	device/google/bluejay/nfc/libnfc-nci.conf:$(TARGET_COPY_OUT_PRODUCT)/etc/libnfc-nci.conf
110
111PRODUCT_PACKAGES += \
112	$(RELEASE_PACKAGE_NFC_STACK) \
113	Tag \
114	android.hardware.nfc-service.st \
115	NfcOverlayBluejay
116
117# Shared Modem Platform
118SHARED_MODEM_PLATFORM_VENDOR := lassen
119
120# Shared Modem Platform
121include device/google/gs-common/modem/modem_svc_sit/shared_modem_platform.mk
122
123# SecureElement
124PRODUCT_PACKAGES += \
125	android.hardware.secure_element@1.2-service-gto
126
127PRODUCT_COPY_FILES += \
128	frameworks/native/data/etc/android.hardware.se.omapi.ese.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.se.omapi.ese.xml \
129	frameworks/native/data/etc/android.hardware.se.omapi.uicc.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.se.omapi.uicc.xml \
130        device/google/bluejay/nfc/libse-gto-hal.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libse-gto-hal.conf
131
132DEVICE_MANIFEST_FILE += \
133	device/google/bluejay/nfc/manifest_se_bluejay.xml
134
135# PowerStats HAL
136PRODUCT_SOONG_NAMESPACES += \
137    device/google/bluejay/powerstats/bluejay \
138    device/google/bluejay
139
140# Increment the SVN for any official public releases
141ifdef RELEASE_SVN_BLUEJAY
142TARGET_SVN ?= $(RELEASE_SVN_BLUEJAY)
143else
144# Set this for older releases that don't use build flag
145TARGET_SVN ?= 65
146endif
147
148PRODUCT_VENDOR_PROPERTIES += \
149    ro.vendor.build.svn=$(TARGET_SVN)
150
151# Set device family property for SMR
152PRODUCT_PROPERTY_OVERRIDES += \
153    ro.build.device_family=O6R4B9
154
155# Set build properties for SMR builds
156ifeq ($(RELEASE_IS_SMR), true)
157    ifneq (,$(RELEASE_BASE_OS_BLUEJAY))
158        PRODUCT_BASE_OS := $(RELEASE_BASE_OS_BLUEJAY)
159    endif
160endif
161
162# Set build properties for EMR builds
163ifeq ($(RELEASE_IS_EMR), true)
164    ifneq (,$(RELEASE_BASE_OS_BLUEJAY))
165        PRODUCT_PROPERTY_OVERRIDES += \
166        ro.build.version.emergency_base_os=$(RELEASE_BASE_OS_BLUEJAY)
167    endif
168endif
169
170# DCK properties based on target
171PRODUCT_PROPERTY_OVERRIDES += \
172    ro.gms.dck.eligible_wcc=2 \
173    ro.gms.dck.se_capability=1
174
175# Trusty liboemcrypto.so
176PRODUCT_SOONG_NAMESPACES += vendor/google_devices/bluejay/prebuilts
177
178# Display
179PRODUCT_DEFAULT_PROPERTY_OVERRIDES += vendor.display.lbe.supported=1
180PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.set_idle_timer_ms=0
181
182# Bluetooth Hal Extension test tools
183PRODUCT_PACKAGES_DEBUG += \
184    sar_test \
185    hci_inject
186
187# Config of primary display frames to reach LHBM peak brightness
188PRODUCT_DEFAULT_PROPERTY_OVERRIDES += vendor.primarydisplay.lhbm.frames_to_reach_peak_brightness=2
189
190# Bluetooth Tx power caps for bluejay
191PRODUCT_COPY_FILES += \
192    device/google/bluejay/bluetooth_power_limits.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits.csv \
193    device/google/bluejay/bluetooth_power_limits_GB17L_JP.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_JP.csv \
194    device/google/bluejay/bluetooth_power_limits_GX7AS_CA.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_CA.csv \
195    device/google/bluejay/bluetooth_power_limits_GB62Z_US.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_GB62Z_US.csv \
196    device/google/bluejay/bluetooth_power_limits_GX7AS_US.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_GX7AS_US.csv \
197    device/google/bluejay/bluetooth_power_limits_G1AZG_EU.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_G1AZG_EU.csv \
198    device/google/bluejay/bluetooth_power_limits_GB62Z_EU.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_GB62Z_EU.csv
199
200# Bluetooth
201PRODUCT_PRODUCT_PROPERTIES += \
202    persist.bluetooth.a2dp_aac.vbr_supported=true \
203    persist.bluetooth.firmware.selection=BCM.hcd \
204    bluetooth.server.automatic_turn_on=true
205
206# Set zram size
207PRODUCT_VENDOR_PROPERTIES += \
208    vendor.zram.size=3g
209
210# Enable camera 1080P 60FPS binning mode
211PRODUCT_VENDOR_PROPERTIES += \
212    persist.vendor.camera.1080P_60fps_binning=true
213
214# Enable camera exif model/make reporting
215PRODUCT_VENDOR_PROPERTIES += \
216    persist.vendor.camera.exif_reveal_make_model=true
217
218# Disable rear light sensor probing explicitly
219PRODUCT_VENDOR_PROPERTIES += \
220    persist.vendor.camera.rls_supported=false
221
222# Fingerprint antispoof property
223PRODUCT_PRODUCT_PROPERTIES +=\
224    persist.vendor.fingerprint.disable.fake.override=none
225
226# Fingerprint als feed forward
227PRODUCT_VENDOR_PROPERTIES += \
228    persist.vendor.udfps.als_feed_forward_supported=true \
229    persist.vendor.udfps.lhbm_controlled_in_hal_supported=true
230
231# Fingerprint MAX auth latency
232PRODUCT_VENDOR_PROPERTIES += \
233    vendor.gf.debug.timer.threshold=1,400,400,400,600,600,600
234
235# Hide cutout overlays
236PRODUCT_PACKAGES += \
237    NoCutoutOverlay \
238    AvoidAppsInCutoutOverlay
239
240# SKU specific RROs
241PRODUCT_PACKAGES += \
242    SettingsOverlayGB17L \
243    SettingsOverlayG1AZG \
244    SettingsOverlayGB62Z \
245    SettingsOverlayGX7AS
246
247# Set support hide display cutout feature
248PRODUCT_PRODUCT_PROPERTIES += \
249    ro.support_hide_display_cutout=true
250
251# Set support one-handed mode
252PRODUCT_PRODUCT_PROPERTIES += \
253    ro.support_one_handed_mode=true
254
255# GPS xml
256ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
257    ifneq (,$(filter 6.1, $(TARGET_LINUX_KERNEL_VERSION)))
258        PRODUCT_COPY_FILES += \
259            device/google/bluejay/gps.6.1.xml.b3:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml
260    else
261        PRODUCT_COPY_FILES += \
262            device/google/bluejay/gps.xml.b3:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml
263    endif
264else
265    ifneq (,$(filter 6.1, $(TARGET_LINUX_KERNEL_VERSION)))
266        PRODUCT_COPY_FILES += \
267            device/google/bluejay/gps_user.6.1.xml.b3:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml
268    else
269        PRODUCT_COPY_FILES += \
270            device/google/bluejay/gps_user.xml.b3:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml
271    endif
272endif
273
274# This device is shipped with 32 (Android S V2)
275PRODUCT_SHIPPING_API_LEVEL := 32
276
277# Vibrator HAL
278$(call soong_config_set,haptics,kernel_ver,v$(subst .,_,$(TARGET_LINUX_KERNEL_VERSION)))
279ADAPTIVE_HAPTICS_FEATURE := adaptive_haptics_v1
280ACTUATOR_MODEL := legacy_zlra_actuator
281PRODUCT_VENDOR_PROPERTIES += \
282	ro.vendor.vibrator.hal.f0.comp.enabled=0 \
283	ro.vendor.vibrator.hal.redc.comp.enabled=0 \
284	persist.vendor.vibrator.hal.context.enable=false \
285	persist.vendor.vibrator.hal.context.scale=40 \
286	persist.vendor.vibrator.hal.context.fade=true \
287	persist.vendor.vibrator.hal.context.cooldowntime=1600 \
288	persist.vendor.vibrator.hal.context.settlingtime=5000
289
290# Override Output Distortion Gain
291PRODUCT_VENDOR_PROPERTIES += \
292    vendor.audio.hapticgenerator.distortion.output.gain=0.29
293
294# Device features
295PRODUCT_COPY_FILES += \
296    frameworks/native/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml
297
298# Keyboard bottom padding in dp for portrait mode and height ratio
299PRODUCT_PRODUCT_PROPERTIES += \
300    ro.com.google.ime.kb_pad_port_b=6.4 \
301
302PRODUCT_PRODUCT_PROPERTIES ?= \
303    ro.com.google.ime.height_ratio=1.05
304
305# UFS: the script is used to select the corresponding firmware to run FFU.
306PRODUCT_PACKAGES += ufs_firmware_update.sh
307
308# Enable DeviceAsWebcam support
309PRODUCT_VENDOR_PROPERTIES += \
310    ro.usb.uvc.enabled=true
311
312# Quick Start device-specific settings
313PRODUCT_PRODUCT_PROPERTIES += \
314    ro.quick_start.oem_id=00e0 \
315    ro.quick_start.device_id=bluejay
316
317# Disable AVF Remote Attestation
318PRODUCT_AVF_REMOTE_ATTESTATION_DISABLED := true
319
320# Bluetooth device id
321# Bluejay: 0x4108
322PRODUCT_PRODUCT_PROPERTIES += \
323    bluetooth.device_id.product_id=16648
324