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$(call add_soong_config_namespace,audio_extn_config)
18$(call add_soong_config_var_value,audio_extn_config,isHFPEnabled,$(AUDIO_FEATURE_HFP_ENABLED))
19
20PRODUCT_PACKAGE_OVERLAYS += device/google/trout/product_files/overlay
21
22LOCAL_DEVICE_FCM_MANIFEST_FILE ?= device/google/trout/manifest.xml
23
24# Disable shared system image checking
25PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := false
26
27ifeq ($(TARGET_USES_CUTTLEFISH_AUDIO),false)
28# Car Emulator Audio HAL
29LOCAL_AUDIO_PRODUCT_PACKAGE ?= \
30    audio.primary.caremu \
31    audio.r_submix.default \
32    android.hardware.audio@6.0-impl:32 \
33    android.hardware.audio.effect@6.0-impl:32 \
34    android.hardware.audio.service \
35    android.hardware.soundtrigger@2.3-impl
36
37LOCAL_AUDIO_DEVICE_PACKAGE_OVERLAYS ?= device/generic/car/emulator/audio/overlay
38
39LOCAL_AUDIO_PROPERTIES ?= \
40    ro.hardware.audio.primary=caremu \
41    ro.vendor.caremu.audiohal.out_period_ms=16 \
42    ro.vendor.caremu.audiohal.in_period_ms=16
43
44ifndef LOCAL_AUDIO_PRODUCT_COPY_FILES
45LOCAL_AUDIO_PRODUCT_COPY_FILES := \
46    device/google/trout/product_files/vendor/etc/audio_policy_configuration.emulator.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \
47    device/google/trout/product_files/vendor/etc/car_audio_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/car_audio_configuration.xml \
48    frameworks/native/data/etc/android.hardware.broadcastradio.xml:system/etc/permissions/android.hardware.broadcastradio.xml \
49    frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_audio_policy_configuration.xml \
50    frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usb_audio_policy_configuration.xml
51endif
52endif
53
54# Audio Control HAL
55LOCAL_AUDIOCONTROL_HAL_PRODUCT_PACKAGE ?= android.hardware.automotive.audiocontrol-service.trout
56
57# Dumpstate HAL
58# TODO(b/215200137): Re-enable once converted to AIDL
59#LOCAL_DUMPSTATE_PRODUCT_PACKAGE ?= android.hardware.dumpstate@1.1-service.trout
60#LOCAL_DUMPSTATE_PROPERTIES ?= \
61#    ro.vendor.dumpstate.server.cid=2 \
62#    ro.vendor.dumpstate.server.port=9310 \
63#    ro.vendor.helpersystem.log_loc=/data/host_logs \
64
65# Vehicle HAL
66ENABLE_VHAL_FAKE_GRPC_SERVER ?= false
67LOCAL_VHAL_PROPERTIES ?=
68TROUT_DEFAULT_VHAL_PACKAGES = android.hardware.automotive.vehicle@default-trout-service
69ifeq ($(ENABLE_VHAL_FAKE_GRPC_SERVER),true)
70TROUT_DEFAULT_VHAL_PACKAGES += android.hardware.automotive.vehicle@default-trout-fake-hardware-grpc-server
71LOCAL_VHAL_PROPERTIES += ro.vendor.vehiclehal.server.use_local_fake_server=true
72endif
73LOCAL_VHAL_PRODUCT_PACKAGE ?= ${TROUT_DEFAULT_VHAL_PACKAGES}
74
75# EVS HAL
76LOCAL_EVS_RRO_PACKAGE_OVERLAYS ?= TroutEvsOverlay
77ENABLE_EVS_SERVICE ?= true
78ENABLE_MOCK_EVSHAL ?= false
79ENABLE_EVS_SAMPLE ?= true
80ENABLE_SAMPLE_EVS_APP ?= false
81ENABLE_CAREVSSERVICE_SAMPLE ?= true
82
83PRODUCT_PACKAGES += $(LOCAL_EVS_RRO_PACKAGE_OVERLAYS)
84
85ifeq ($(LOCAL_EVS_PRODUCT_COPY_FILES),)
86LOCAL_EVS_PRODUCT_COPY_FILES := \
87    device/google/trout/product_files/etc/automotive/evs/config_override.json:${TARGET_COPY_OUT_VENDOR}/etc/automotive/evs/config_override.json \
88    device/google/trout/product_files/vendor/etc/automotive/evs/evs_configuration_override.xml:$(TARGET_COPY_OUT_VENDOR)/etc/automotive/evs/evs_configuration_override.xml
89endif
90PRODUCT_COPY_FILES += $(LOCAL_EVS_PRODUCT_COPY_FILES)
91
92# A device inheriting trout can enable Vulkan support.
93TARGET_VULKAN_SUPPORT ?= false
94
95PRODUCT_PROPERTY_OVERRIDES += \
96    ro.hardware.type=automotive \
97    ${LOCAL_AUDIO_PROPERTIES} \
98    ${LOCAL_AUDIOCONTROL_PROPERTIES} \
99    ${LOCAL_DUMPSTATE_PROPERTIES} \
100    ${LOCAL_TRACING_SERVER_PROPERTIES} \
101    ${LOCAL_VHAL_PROPERTIES} \
102    ro.audio.flinger_standbytime_ms=0
103
104ifeq ($(TARGET_DISABLE_BOOT_ANIMATION),true)
105PRODUCT_PROPERTY_OVERRIDES += debug.sf.nobootanimation=1
106endif
107
108PRODUCT_CHARACTERISTICS := nosdcard,automotive
109
110TARGET_BOARD_INFO_FILE ?= device/google/trout/board-info.txt
111
112# Keymaster HAL
113LOCAL_KEYMINT_PRODUCT_PACKAGE ?= android.hardware.keymaster@4.1-service
114
115# Gatekeeper HAL
116LOCAL_GATEKEEPER_PRODUCT_PACKAGE ?= android.hardware.gatekeeper@1.0-service.software
117
118PRODUCT_PACKAGES += tinyplay tinycap
119
120# Trout fstab (workaround b/182190949)
121PRODUCT_COPY_FILES += \
122    device/google/trout/product_files/fstab.trout:$(TARGET_COPY_OUT_RAMDISK)/fstab.trout \
123    device/google/trout/product_files/fstab.trout:$(TARGET_COPY_OUT_RAMDISK)/first_stage_ramdisk/fstab.trout \
124    device/google/trout/product_files/fstab.trout:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.trout \
125    device/google/trout/product_files/fstab.trout:$(TARGET_COPY_OUT_RECOVERY)/root/first_stage_ramdisk/fstab.trout \
126    device/google/trout/product_files/fstab.trout:$(TARGET_COPY_OUT_RAMDISK)/first_stage_ramdisk/fstab.trout
127
128# User HAL support
129TARGET_SUPPORTS_USER_HAL ?= false
130
131ifeq ($(TARGET_SUPPORTS_USER_HAL),false)
132PRODUCT_SYSTEM_DEFAULT_PROPERTIES += android.car.user_hal_enabled=false
133endif
134
135PRODUCT_PACKAGES += android.automotive.tracing-client.trout
136
137BOARD_SEPOLICY_DIRS += device/google/trout/sepolicy/vendor/google
138