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# VirtWiFi interface settings
58DEVICE_VIRTWIFI_PORT ?= eth0
59PRODUCT_VENDOR_PROPERTIES += ro.vendor.disable_rename_eth0=true
60
61# Dumpstate HAL
62# TODO(b/215200137): Re-enable once converted to AIDL
63#LOCAL_DUMPSTATE_PRODUCT_PACKAGE ?= [email protected]
64#LOCAL_DUMPSTATE_PROPERTIES ?= \
65#    ro.vendor.dumpstate.server.cid=2 \
66#    ro.vendor.dumpstate.server.port=9310 \
67#    ro.vendor.helpersystem.log_loc=/data/host_logs \
68
69# Vehicle HAL
70ENABLE_VHAL_FAKE_GRPC_SERVER ?= false
71LOCAL_VHAL_PROPERTIES ?=
72TROUT_DEFAULT_VHAL_PACKAGES = android.hardware.automotive.vehicle@default-trout-service
73ifeq ($(ENABLE_VHAL_FAKE_GRPC_SERVER),true)
74TROUT_DEFAULT_VHAL_PACKAGES += android.hardware.automotive.vehicle@default-trout-fake-hardware-grpc-server
75LOCAL_VHAL_PROPERTIES += ro.vendor.vehiclehal.server.use_local_fake_server=true
76endif
77LOCAL_VHAL_PRODUCT_PACKAGE ?= ${TROUT_DEFAULT_VHAL_PACKAGES}
78
79# EVS HAL
80LOCAL_EVS_PROPERTIES ?= persist.automotive.evs.mode=1
81LOCAL_EVS_RRO_PACKAGE_OVERLAYS ?= TroutEvsOverlay
82ENABLE_EVS_SERVICE ?= true
83ENABLE_MOCK_EVSHAL ?= false
84ENABLE_EVS_SAMPLE ?= true
85ENABLE_SAMPLE_EVS_APP ?= false
86ENABLE_CAREVSSERVICE_SAMPLE ?= true
87
88PRODUCT_PACKAGES += $(LOCAL_EVS_RRO_PACKAGE_OVERLAYS)
89
90ifeq ($(LOCAL_EVS_PRODUCT_COPY_FILES),)
91LOCAL_EVS_PRODUCT_COPY_FILES := \
92    device/google/trout/product_files/etc/automotive/evs/config_override.json:${TARGET_COPY_OUT_VENDOR}/etc/automotive/evs/config_override.json \
93    device/google/trout/product_files/vendor/etc/automotive/evs/evs_configuration_override.xml:$(TARGET_COPY_OUT_VENDOR)/etc/automotive/evs/evs_configuration_override.xml
94endif
95PRODUCT_COPY_FILES += $(LOCAL_EVS_PRODUCT_COPY_FILES)
96
97# A device inheriting trout can enable Vulkan support.
98TARGET_VULKAN_SUPPORT ?= true
99
100PRODUCT_PROPERTY_OVERRIDES += \
101    ro.hardware.type=automotive \
102    ${LOCAL_AUDIO_PROPERTIES} \
103    ${LOCAL_AUDIOCONTROL_PROPERTIES} \
104    ${LOCAL_DUMPSTATE_PROPERTIES} \
105    ${LOCAL_TRACING_SERVER_PROPERTIES} \
106    ${LOCAL_VHAL_PROPERTIES} \
107    ro.audio.flinger_standbytime_ms=0
108
109ifeq ($(TARGET_DISABLE_BOOT_ANIMATION),true)
110PRODUCT_PROPERTY_OVERRIDES += debug.sf.nobootanimation=1
111endif
112
113PRODUCT_CHARACTERISTICS := nosdcard,automotive
114
115TARGET_BOARD_INFO_FILE ?= device/google/trout/board-info.txt
116
117# Keymaster HAL
118LOCAL_KEYMINT_PRODUCT_PACKAGE ?= android.hardware.keymaster@4.1-service
119
120# Gatekeeper HAL
121LOCAL_GATEKEEPER_PRODUCT_PACKAGE ?= android.hardware.gatekeeper@1.0-service.software
122
123PRODUCT_PACKAGES += tinyplay tinycap
124
125# Trout fstab (workaround b/182190949)
126PRODUCT_COPY_FILES += \
127    device/google/trout/product_files/fstab.trout:$(TARGET_COPY_OUT_RAMDISK)/fstab.trout \
128    device/google/trout/product_files/fstab.trout:$(TARGET_COPY_OUT_RAMDISK)/first_stage_ramdisk/fstab.trout \
129    device/google/trout/product_files/fstab.trout:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.trout \
130    device/google/trout/product_files/fstab.trout:$(TARGET_COPY_OUT_RECOVERY)/root/first_stage_ramdisk/fstab.trout \
131    device/google/trout/product_files/fstab.trout:$(TARGET_COPY_OUT_RAMDISK)/first_stage_ramdisk/fstab.trout
132
133# User HAL support
134TARGET_SUPPORTS_USER_HAL ?= false
135
136ifeq ($(TARGET_SUPPORTS_USER_HAL),false)
137PRODUCT_SYSTEM_DEFAULT_PROPERTIES += android.car.user_hal_enabled=false
138endif
139
140PRODUCT_PACKAGES += android.automotive.tracing-client.trout
141
142BOARD_SEPOLICY_DIRS += device/google/trout/sepolicy/vendor/google
143