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
17ifeq ($(TARGET_USES_CUTTLEFISH_AUDIO),true)
18# Cuttlefish Audio HAL with custom configuration
19LOCAL_AUDIO_PRODUCT_COPY_FILES ?= \
20    device/google/cuttlefish/shared/config/audio_policy.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy.conf \
21    frameworks/av/services/audiopolicy/config/audio_policy_configuration_generic.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \
22    device/google/trout/product_files/vendor/etc/primary_audio_policy_configuration.cf.xml:$(TARGET_COPY_OUT_VENDOR)/etc/primary_audio_policy_configuration.xml
23
24LOCAL_AUDIO_PROPERTIES ?=
25else
26# Car Emulator Audio HAL
27LOCAL_AUDIO_PRODUCT_PACKAGE ?= \
28    audio.primary.caremu \
29    audio.r_submix.default \
30    android.hardware.audio@6.0-impl:32 \
31    android.hardware.audio.effect@7.0-impl:32 \
32    android.hardware.audio.service \
33    android.hardware.soundtrigger@2.3-impl
34
35LOCAL_AUDIO_DEVICE_PACKAGE_OVERLAYS ?= device/generic/car/emulator/audio/overlay
36
37LOCAL_AUDIO_PROPERTIES ?= \
38    ro.hardware.audio.primary=caremu \
39    ro.vendor.caremu.audiohal.out_period_ms=40 \
40    ro.vendor.caremu.audiohal.in_period_ms=40 \
41
42LOCAL_AUDIO_PRODUCT_COPY_FILES ?= \
43    device/generic/car/emulator/audio/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \
44    device/generic/car/emulator/audio/car_audio_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/car_audio_configuration.xml \
45    frameworks/native/data/etc/android.hardware.broadcastradio.xml:system/etc/permissions/android.hardware.broadcastradio.xml \
46    frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_audio_policy_configuration.xml \
47    frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usb_audio_policy_configuration.xml
48endif
49
50# Audio Control HAL
51LOCAL_AUDIOCONTROL_HAL_PRODUCT_PACKAGE ?= android.hardware.automotive.audiocontrol-service.trout
52
53# Dumpstate HAL
54LOCAL_DUMPSTATE_PRODUCT_PACKAGE ?= android.hardware.dumpstate@1.1-service.trout
55LOCAL_DUMPSTATE_PROPERTIES ?= \
56    ro.vendor.dumpstate.server.cid=2 \
57    ro.vendor.dumpstate.server.port=9310 \
58    ro.vendor.helpersystem.log_loc=/data/host_logs \
59
60# Vehicle HAL
61LOCAL_VHAL_PRODUCT_PACKAGE ?= android.hardware.automotive.vehicle@2.0-virtualization-service
62
63# EVS HAL
64LOCAL_EVS_PRODUCT_COPY_FILES ?= \
65    device/google/trout/product_files/etc/automotive/evs/config_override.json:${TARGET_COPY_OUT_SYSTEM}/etc/automotive/evs/config_override.json \
66    device/google/trout/product_files/vendor/etc/automotive/evs/evs_configuration_override.xml:$(TARGET_COPY_OUT_VENDOR)/etc/automotive/evs/evs_configuration_override.xml \
67
68LOCAL_EVS_PROPERTIES ?= persist.automotive.evs.mode=1
69ENABLE_EVS_SAMPLE := true
70
71PRODUCT_COPY_FILES += \
72    ${LOCAL_EVS_PRODUCT_COPY_FILES} \
73
74# Disable Vulkan feature flag as it is not supported on trout
75TARGET_VULKAN_SUPPORT := false
76
77PRODUCT_PROPERTY_OVERRIDES += \
78    ro.hardware.type=automotive \
79    ${LOCAL_AUDIO_PROPERTIES} \
80    ${LOCAL_AUDIOCONTROL_PROPERTIES} \
81    ${LOCAL_DUMPSTATE_PROPERTIES}
82
83PRODUCT_CHARACTERISTICS := nosdcard,automotive
84
85TARGET_BOARD_INFO_FILE ?= device/google/trout/board-info.txt
86
87# Keymaster HAL
88LOCAL_KEYMASTER_PRODUCT_PACKAGE ?= android.hardware.keymaster@4.1-service
89
90# Gatekeeper HAL
91LOCAL_GATEKEEPER_PRODUCT_PACKAGE ?= android.hardware.gatekeeper@1.0-service.software
92
93PRODUCT_PACKAGES += tinyplay
94
95include packages/services/Car/cpp/computepipe/products/computepipe.mk
96
97# Trout fstab (workaround b/182190949)
98PRODUCT_COPY_FILES += \
99    device/google/trout/product_files/fstab.trout:$(TARGET_COPY_OUT_RAMDISK)/fstab.trout \
100    device/google/trout/product_files/fstab.trout:$(TARGET_COPY_OUT_RAMDISK)/first_stage_ramdisk/fstab.trout \
101    device/google/trout/product_files/fstab.trout:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.trout \
102    device/google/trout/product_files/fstab.trout:$(TARGET_COPY_OUT_RECOVERY)/root/first_stage_ramdisk/fstab.trout \
103    device/google/trout/product_files/fstab.trout:$(TARGET_COPY_OUT_RAMDISK)/first_stage_ramdisk/fstab.trout
104
105# User HAL support
106TARGET_SUPPORTS_USER_HAL ?= true
107
108ifeq ($(TARGET_SUPPORTS_USER_HAL),true)
109PRODUCT_SYSTEM_DEFAULT_PROPERTIES += android.car.user_hal_enabled=true
110endif
111
112BOARD_SEPOLICY_DIRS += device/google/trout/sepolicy/vendor/google
113