1PRODUCT_SOONG_NAMESPACES += device/amlogic/yukawa
2
3# Check vendor package version
4include device/amlogic/yukawa/vendor-package-ver.mk
5ifneq (,$(wildcard $(YUKAWA_VENDOR_PATH)/bt-wifi-firmware))
6  ifneq (,$(wildcard $(YUKAWA_VENDOR_PATH)/bt-wifi-firmware/$(EXPECTED_YUKAWA_VENDOR_VERSION)/version.mk))
7    # Unfortunately inherit-product doesn't export build variables from the
8    # called make file to the caller, so we have to include it directly here.
9    include $(YUKAWA_VENDOR_PATH)/bt-wifi-firmware/$(EXPECTED_YUKAWA_VENDOR_VERSION)/version.mk
10    ifneq ($(TARGET_YUKAWA_VENDOR_VERSION), $(EXPECTED_YUKAWA_VENDOR_VERSION))
11      $(warning TARGET_YUKAWA_VENDOR_VERSION ($(TARGET_YUKAWA_VENDOR_VERSION)) does not match. Build may be invalid.)
12      $(warning Please download and extract the new binaries by running the following script:)
13      $(warning    ./device/amlogic/yukawa/fetch-vendor-package.sh )
14    endif
15  else
16      $(warning TARGET_YUKAWA_VENDOR_VERSION undefined.)
17      $(warning The vendor package version is incorrect. Please update the yukawa source tree.)
18  endif
19else
20  $(warning Missing yukawa vendor package!)
21  $(warning Please download and extract the vendor binaries by running the following script:)
22  $(warning    ./device/amlogic/yukawa/fetch-vendor-package.sh )
23endif
24
25ifeq ($(TARGET_PREBUILT_KERNEL),)
26LOCAL_KERNEL := device/amlogic/yukawa-kernel/$(TARGET_KERNEL_USE)/Image.lz4
27else
28LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL)
29endif
30
31PRODUCT_COPY_FILES +=  $(LOCAL_KERNEL):kernel
32
33# Build and run only ART
34PRODUCT_RUNTIMES := runtime_libart_default
35
36# Enable updating of APEXes
37$(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk)
38
39# Enable Scoped Storage related
40$(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk)
41
42DEVICE_PACKAGE_OVERLAYS := device/amlogic/yukawa/overlay
43ifeq ($(TARGET_USE_TABLET_LAUNCHER), true)
44# Setup tablet build
45$(call inherit-product, frameworks/native/build/tablet-10in-xhdpi-2048-dalvik-heap.mk)
46$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
47# Packages to invoke RC pairing
48PRODUCT_PACKAGES += YukawaService YukawaAndroidOverlay
49else
50# Setup TV Build
51USE_OEM_TV_APP := true
52$(call inherit-product, device/google/atv/products/atv_base.mk)
53PRODUCT_CHARACTERISTICS := tv
54PRODUCT_AAPT_PREF_CONFIG := tvdpi
55PRODUCT_IS_ATV := true
56endif
57
58# inherit binaries from the vendor package
59$(call inherit-product-if-exists, $(YUKAWA_VENDOR_PATH)/bt-wifi-firmware/$(EXPECTED_YUKAWA_VENDOR_VERSION)/vendor.mk)
60$(call inherit-product-if-exists, $(YUKAWA_VENDOR_PATH)/video_firmware/$(EXPECTED_YUKAWA_VENDOR_VERSION)/vendor.mk)
61$(call inherit-product-if-exists, $(YUKAWA_VENDOR_PATH)/gpu/$(EXPECTED_YUKAWA_VENDOR_VERSION)/vendor.mk)
62
63PRODUCT_PACKAGES += llkd
64
65ifeq ($(TARGET_USE_AB_SLOT), true)
66# A/B support
67PRODUCT_PACKAGES += \
68    otapreopt_script \
69    cppreopts.sh \
70    update_engine \
71    update_verifier
72AB_OTA_POSTINSTALL_CONFIG += \
73    RUN_POSTINSTALm=true \
74    POSTINSTALL_PATH=system/bin/otapreopt_script \
75    FILESYSTEM_TYPE=ext4 \
76    POSTINSTALL_OPTIONAL=true
77
78PRODUCT_PACKAGES += \
79    update_engine_sideload \
80    sg_write_buffer \
81    f2fs_io
82
83# The following modules are included in debuggable builds only.
84PRODUCT_PACKAGES_DEBUG += \
85    bootctl \
86    update_engine_client
87
88# Write flags to the vendor space in /misc partition.
89PRODUCT_PACKAGES += \
90    misc_writer
91
92PRODUCT_PACKAGES += \
93    fs_config_dirs \
94    fs_config_files
95
96# Boot control
97PRODUCT_PACKAGES += \
98    android.hardware.boot@1.2-impl \
99    android.hardware.boot@1.2-impl.recovery \
100    android.hardware.boot@1.2-service \
101    bootctrl.yukawa.recovery \
102    bootctrl.yukawa
103endif
104
105# System RO FS Type
106TARGET_RO_FILE_SYSTEM_TYPE ?= ext4
107
108# Dynamic partitions
109PRODUCT_BUILD_SUPER_PARTITION := true
110PRODUCT_USE_DYNAMIC_PARTITIONS := true
111PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true
112
113PRODUCT_PACKAGES += \
114	android.hardware.fastboot@1.0 \
115	android.hardware.fastboot@1.0-impl-mock \
116	fastbootd
117
118# All VNDK libraries (HAL interfaces, VNDK, VNDK-SP, LL-NDK)
119PRODUCT_PACKAGES += vndk_package
120
121PRODUCT_PACKAGES += \
122    android.hardware.health@2.1-impl-cuttlefish \
123    android.hardware.health@2.1-service
124
125ifeq ($(TARGET_USE_AB_SLOT), true)
126ifeq ($(TARGET_AVB_ENABLE), true)
127PRODUCT_COPY_FILES += \
128    $(LOCAL_PATH)/fstab.yukawa.avb.ab:$(TARGET_COPY_OUT_RECOVERY)/root/first_stage_ramdisk/fstab.yukawa \
129    $(LOCAL_PATH)/fstab.yukawa.avb.ab:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.yukawa
130else
131PRODUCT_COPY_FILES += \
132    $(LOCAL_PATH)/fstab.yukawa.ab:$(TARGET_COPY_OUT_RECOVERY)/root/first_stage_ramdisk/fstab.yukawa \
133    $(LOCAL_PATH)/fstab.yukawa.ab:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.yukawa
134endif
135else
136ifeq ($(TARGET_AVB_ENABLE), true)
137PRODUCT_COPY_FILES += \
138    $(LOCAL_PATH)/fstab.ramdisk.common.avb:$(TARGET_COPY_OUT_RAMDISK)/fstab.yukawa \
139    $(LOCAL_PATH)/fstab.yukawa:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.yukawa
140else
141PRODUCT_COPY_FILES += \
142    $(LOCAL_PATH)/fstab.ramdisk.common:$(TARGET_COPY_OUT_RAMDISK)/fstab.yukawa \
143    $(LOCAL_PATH)/fstab.yukawa:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.yukawa
144endif
145endif
146
147PRODUCT_COPY_FILES += \
148    $(LOCAL_PATH)/init.yukawa.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.yukawa.rc \
149    $(LOCAL_PATH)/init.yukawa.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.yukawa.usb.rc \
150    $(LOCAL_PATH)/init.recovery.hardware.rc:recovery/root/init.recovery.yukawa.rc \
151    $(LOCAL_PATH)/ueventd.rc:$(TARGET_COPY_OUT_VENDOR)/ueventd.rc \
152    $(LOCAL_PATH)/wifi/wpa_supplicant.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/wpa_supplicant.conf \
153    $(LOCAL_PATH)/wifi/wpa_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/wpa_supplicant_overlay.conf \
154    $(LOCAL_PATH)/wifi/p2p_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/p2p_supplicant_overlay.conf
155
156ifeq ($(TARGET_USE_TABLET_LAUNCHER), true)
157# Use Launcher3QuickStep
158PRODUCT_PACKAGES += Launcher3QuickStep
159else
160ifeq ($(TARGET_USE_SAMPLE_LAUNCHER), true)
161PRODUCT_PACKAGES += \
162    TvSampleLeanbackLauncher
163endif
164
165# TV Specific Packages
166PRODUCT_PACKAGES += \
167    LiveTv \
168    google-tv-pairing-protocol \
169    LeanbackSampleApp \
170    tv_input.default \
171    com.android.media.tv.remoteprovider \
172    InputDevices
173
174PRODUCT_PACKAGES += \
175    LeanbackIME
176
177ifeq (,$(filter $(TARGET_PRODUCT),yukawa_gms yukawa32_gms yukawa_sei510_gms))
178PRODUCT_PACKAGES += \
179    TvProvision \
180    TVLauncherNoGms \
181    TVRecommendationsNoGms
182endif
183endif
184
185PRODUCT_PACKAGES += \
186    libhidltransport \
187    libhwbinder
188
189PRODUCT_PROPERTY_OVERRIDES += ro.sf.lcd_density=320
190
191# Vulkan
192PRODUCT_COPY_FILES += \
193    frameworks/native/data/etc/android.hardware.vulkan.version-1_1.xml:vendor/etc/permissions/android.hardware.vulkan.version.xml \
194    frameworks/native/data/etc/android.hardware.vulkan.compute-0.xml:vendor/etc/permissions/android.hardware.vulkan.compute.xml \
195    frameworks/native/data/etc/android.hardware.vulkan.level-1.xml:vendor/etc/permissions/android.hardware.vulkan.level.xml
196
197PRODUCT_PACKAGES +=  vulkan.yukawa.so
198
199# Bluetooth
200PRODUCT_PACKAGES += android.hardware.bluetooth-service.default
201PRODUCT_PROPERTY_OVERRIDES += \
202    bluetooth.core.gap.le.privacy.enabled=false \
203    bluetooth.profile.asha.central.enabled=true \
204    bluetooth.profile.a2dp.source.enabled=true \
205    bluetooth.profile.avrcp.target.enabled=true \
206    bluetooth.profile.bap.broadcast.assist.enabled=true \
207    bluetooth.profile.bap.unicast.client.enabled=true \
208    bluetooth.profile.bas.client.enabled=true \
209    bluetooth.profile.ccp.server.enabled=true \
210    bluetooth.profile.csip.set_coordinator.enabled=true \
211    bluetooth.profile.gatt.enabled=true \
212    bluetooth.profile.hap.client.enabled=true \
213    bluetooth.profile.hfp.ag.enabled=true \
214    bluetooth.profile.hid.host.enabled=true \
215    bluetooth.profile.mcp.server.enabled=true \
216    bluetooth.profile.opp.enabled=true \
217    bluetooth.profile.pan.nap.enabled=true \
218    bluetooth.profile.pan.panu.enabled=true \
219    bluetooth.profile.vcp.controller.enabled=true
220
221# Wifi
222PRODUCT_PACKAGES += libwpa_client wpa_supplicant hostapd wificond wpa_cli
223PRODUCT_PROPERTY_OVERRIDES += wifi.interface=wlan0 \
224                              wifi.supplicant_scan_interval=15
225
226# Build default bluetooth a2dp and usb audio HALs
227PRODUCT_PACKAGES += \
228    android.hardware.bluetooth.audio@2.0-impl \
229    audio.usb.default \
230    audio.primary.yukawa \
231    audio.r_submix.default \
232    audio.bluetooth.default \
233    tinyplay \
234    tinycap \
235    tinymix \
236    tinypcminfo \
237    cplay
238
239PRODUCT_PACKAGES += \
240    android.hardware.audio.service \
241    android.hardware.audio@7.0-impl \
242    android.hardware.audio.effect@7.0-impl \
243    android.hardware.soundtrigger@2.3-impl \
244
245# Hardware Composer HAL
246#
247PRODUCT_PACKAGES += \
248    hwcomposer.drm_meson \
249    android.hardware.drm-service.widevine \
250    android.hardware.drm-service.clearkey
251
252# CEC on ATV only
253ifeq ($(PRODUCT_IS_ATV), true)
254PRODUCT_PACKAGES += \
255    android.hardware.tv.cec@1.0-impl \
256    android.hardware.tv.cec@1.0-service \
257    hdmi_cec.yukawa
258
259PRODUCT_PROPERTY_OVERRIDES += \
260    ro.hdmi.cec_device_types=playback_device
261
262PRODUCT_COPY_FILES += \
263    frameworks/native/data/etc/android.hardware.hdmi.cec.xml:system/etc/permissions/android.hardware.hdmi.cec.xml
264endif
265
266# HDMI display
267PRODUCT_PROPERTY_OVERRIDES += ro.hdmi.device_type=4 \
268    persist.sys.hdmi.keep_awake=false
269
270PRODUCT_COPY_FILES += \
271    $(LOCAL_PATH)/input/Generic.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/Generic.kl
272
273PRODUCT_PACKAGES += \
274    gralloc.yukawa \
275    android.hardware.graphics.composer@2.2-impl \
276    android.hardware.graphics.composer@2.2-service \
277    android.hardware.graphics.allocator@2.0-service \
278    android.hardware.graphics.allocator@2.0-impl \
279    android.hardware.graphics.mapper@2.0-impl-2.1
280
281# PowerHAL
282PRODUCT_PACKAGES += \
283    android.hardware.power-service.example
284
285# PowerStats HAL
286PRODUCT_PACKAGES += \
287    android.hardware.power.stats-service.example
288
289# Sensor HAL
290ifneq ($(TARGET_SENSOR_MEZZANINE),)
291TARGET_USES_NANOHUB_SENSORHAL := true
292NANOHUB_SENSORHAL_LID_STATE_ENABLED := true
293NANOHUB_SENSORHAL_SENSORLIST := $(LOCAL_PATH)/sensorhal/sensorlist_$(TARGET_SENSOR_MEZZANINE).cpp
294NANOHUB_SENSORHAL_DIRECT_REPORT_ENABLED := true
295NANOHUB_SENSORHAL_DYNAMIC_SENSOR_EXT_ENABLED := true
296
297PRODUCT_PACKAGES += \
298    context_hub.default \
299    sensors.yukawa \
300    android.hardware.sensors@1.0-service \
301    android.hardware.sensors@1.0-impl \
302    android.hardware.contexthub@1.2-service \
303    android.hardware.contexthub@1.2-impl
304
305# Nanohub tools
306PRODUCT_PACKAGES += stm32_flash nanoapp_cmd nanotool
307
308PRODUCT_COPY_FILES += \
309    device/amlogic/yukawa/init.common.nanohub.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.nanohub.rc
310
311# Copy sensors config file(s)
312PRODUCT_COPY_FILES += \
313    frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \
314    frameworks/native/data/etc/android.hardware.sensor.ambient_temperature.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.ambient_temperature.xml \
315    frameworks/native/data/etc/android.hardware.sensor.barometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.barometer.xml \
316    frameworks/native/data/etc/android.hardware.sensor.compass.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.compass.xml \
317    frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope.xml \
318    frameworks/native/data/etc/android.hardware.sensor.hifi_sensors.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.hifi_sensors.xml \
319    frameworks/native/data/etc/android.hardware.sensor.light.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.light.xml \
320    frameworks/native/data/etc/android.hardware.sensor.relative_humidity.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.relative_humidity.xml \
321    frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepcounter.xml \
322    frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepdetector.xml
323
324# Argonkey VL53L0X proximity driver is not available yet. So we are going to copy conf file for neonkey only
325ifeq ($(TARGET_SENSOR_MEZZANINE),neonkey)
326PRODUCT_COPY_FILES += \
327    frameworks/native/data/etc/android.hardware.sensor.proximity.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.proximity.xml
328endif
329endif
330
331# Software Gatekeeper HAL
332PRODUCT_PACKAGES += \
333    android.hardware.gatekeeper@1.0-service.software
334
335PRODUCT_PACKAGES += \
336    android.hardware.keymaster@3.0-impl \
337    android.hardware.keymaster@3.0-service
338
339# USB
340PRODUCT_PACKAGES += \
341    android.hardware.usb@1.1-service
342
343PRODUCT_COPY_FILES +=  \
344    frameworks/native/data/etc/android.software.app_widgets.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.app_widgets.xml \
345    frameworks/native/data/etc/android.hardware.ethernet.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.ethernet.xml \
346    frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml \
347    frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml \
348    frameworks/native/data/etc/android.software.device_admin.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.device_admin.xml \
349    frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml \
350    frameworks/native/data/etc/android.hardware.wifi.direct.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.direct.xml \
351    frameworks/native/data/etc/android.hardware.bluetooth.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth.xml \
352    frameworks/native/data/etc/android.hardware.bluetooth_le.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth_le.xml \
353    frameworks/native/data/etc/android.software.cts.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.cts.xml \
354    frameworks/native/data/etc/android.software.backup.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.backup.xml
355
356# audio policy configuration
357USE_XML_AUDIO_POLICY_CONF := 1
358PRODUCT_COPY_FILES += \
359    frameworks/av/services/audiopolicy/config/a2dp_in_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_in_audio_policy_configuration_7_0.xml \
360    frameworks/av/services/audiopolicy/config/bluetooth_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_audio_policy_configuration_7_0.xml \
361    frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/r_submix_audio_policy_configuration.xml \
362    frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usb_audio_policy_configuration.xml \
363    frameworks/av/services/audiopolicy/config/default_volume_tables.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default_volume_tables.xml \
364    frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml \
365    frameworks/av/media/libeffects/data/audio_effects.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects.xml
366
367AUDIO_DEFAULT_OUTPUT ?= speaker
368ifeq ($(AUDIO_DEFAULT_OUTPUT),hdmi)
369PRODUCT_COPY_FILES += \
370    device/amlogic/yukawa/hal/audio/mixer_paths_hdmi_only.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mixer_paths.xml \
371    device/amlogic/yukawa/hal/audio/audio_policy_configuration_hdmi_only.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml
372DEVICE_PACKAGE_OVERLAYS += \
373    device/amlogic/yukawa/hal/audio/overlay_hdmi_only
374TARGET_USE_HDMI_AUDIO ?= true
375else
376PRODUCT_COPY_FILES += \
377    device/amlogic/yukawa/hal/audio/mixer_paths.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mixer_paths.xml \
378    device/amlogic/yukawa/hal/audio/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml
379endif
380
381# Copy media codecs config file
382PRODUCT_COPY_FILES += \
383    device/amlogic/yukawa/media_xml/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \
384    device/amlogic/yukawa/media_xml/media_profiles.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles_V1_0.xml \
385    frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_audio.xml
386
387# Enable BT Pairing with button BTN_0 (key 256)
388
389PRODUCT_COPY_FILES += \
390    device/amlogic/yukawa/input/Vendor_0001_Product_0001.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/Vendor_0001_Product_0001.kl
391
392# Light HAL
393PRODUCT_PACKAGES += \
394    android.hardware.light-service \
395    lights-yukawa
396
397# Enable USB Camera
398PRODUCT_PACKAGES += android.hardware.camera.provider@2.4-impl
399PRODUCT_PACKAGES += android.hardware.camera.provider@2.4-external-service
400PRODUCT_COPY_FILES += \
401    device/amlogic/yukawa/hal/camera/external_camera_config.xml:$(TARGET_COPY_OUT_VENDOR)/etc/external_camera_config.xml
402
403# Include Virtualization APEX
404$(call inherit-product, packages/modules/Virtualization/apex/product_packages.mk)
405