1#
2# Copyright (C) 2022 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$(call inherit-product, packages/services/Car/car_product/build/car_vendor.mk)
17
18# Need this for gles libraries to load properly
19# after moving to /vendor/lib/
20PRODUCT_PACKAGES += \
21    vndk-sp
22
23DEVICE_PACKAGE_OVERLAYS := device/generic/goldfish/overlay
24
25PRODUCT_CHARACTERISTICS := emulator
26
27# Enable Google-specific location features,
28# like NetworkLocationProvider and LocationCollector
29PRODUCT_VENDOR_PROPERTIES += \
30    ro.com.google.locationfeatures=1
31
32# Enable setupwizard
33PRODUCT_VENDOR_PROPERTIES += \
34    ro.setupwizard.mode?=OPTIONAL
35
36# More configurations
37PRODUCT_VENDOR_PROPERTIES += \
38    ro.carwatchdog.client_healthcheck.interval=20 \
39    ro.carwatchdog.vhal_healthcheck.interval=10 \
40    ro.surface_flinger.has_wide_color_display=false \
41    ro.surface_flinger.has_HDR_display=false \
42    ro.surface_flinger.protected_contents=false \
43    ro.surface_flinger.use_color_management=false
44
45ifeq (,$(ENABLE_REAR_VIEW_CAMERA_SAMPLE))
46ENABLE_REAR_VIEW_CAMERA_SAMPLE := true
47endif
48
49# Goldfish emulator features
50PRODUCT_COPY_FILES += \
51    device/generic/car/emulator/data/etc/advancedFeatures.ini.car:advancedFeatures.ini
52
53# Auto modules
54PRODUCT_PACKAGES += \
55    android.hardware.automotive.vehicle@V3-emulator-service \
56    android.hardware.broadcastradio-service.default \
57    android.hardware.audio.service-caremu \
58    android.hardware.automotive.remoteaccess@V2-default-service \
59    android.hardware.automotive.ivn@V1-default-service
60
61# Copy car_core_hardware and overwrite handheld_core_hardware.xml with a disable config.
62# Overwrite goldfish related xml with a disable config.
63PRODUCT_COPY_FILES += \
64    device/generic/car/common/android.hardware.disable.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml \
65    device/generic/car/common/car_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/car_core_hardware.xml \
66    device/generic/car/common/android.hardware.disable.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.ar.xml \
67    device/generic/car/common/android.hardware.disable.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.autofocus.xml \
68    device/generic/car/common/android.hardware.disable.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.concurrent.xml \
69    device/generic/car/common/android.hardware.disable.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.full.xml \
70    device/generic/car/common/android.hardware.disable.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \
71    device/generic/car/common/android.hardware.disable.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.any.xml \
72    device/generic/car/common/android.hardware.disable.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \
73    device/generic/car/common/android.hardware.disable.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.raw.xml \
74    device/generic/car/common/android.hardware.disable.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.fingerprint.xml \
75    device/generic/car/common/android.hardware.disable.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.direct.xml \
76
77# Overwrite goldfish fstab.ranchu to turn off adoptable_storage
78PRODUCT_COPY_FILES += \
79    device/generic/car/common/fstab.ranchu.car:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.ranchu
80
81# Enable landscape
82PRODUCT_COPY_FILES += \
83    frameworks/native/data/etc/android.hardware.screen.landscape.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.screen.landscape.xml \
84    frameworks/native/data/etc/android.hardware.screen.portrait.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.screen.portrait.xml
85
86# Used to embed a map in an activity view
87PRODUCT_COPY_FILES += \
88    frameworks/native/data/etc/android.software.activities_on_secondary_displays.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.activities_on_secondary_displays.xml
89
90# Permission for Wi-Fi passpoint support
91PRODUCT_COPY_FILES += \
92    frameworks/native/data/etc/android.hardware.wifi.passpoint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.passpoint.xml
93
94# Additional permissions
95PRODUCT_COPY_FILES += \
96    frameworks/native/data/etc/android.hardware.bluetooth_le.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth_le.xml \
97    frameworks/native/data/etc/android.hardware.bluetooth.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth.xml \
98    frameworks/native/data/etc/android.hardware.broadcastradio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.broadcastradio.xml \
99    frameworks/native/data/etc/android.hardware.type.automotive.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.type.automotive.xml \
100
101# Sensor features
102PRODUCT_COPY_FILES += \
103    frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \
104    frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope.xml \
105    frameworks/native/data/etc/android.hardware.sensor.accelerometer_limited_axes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer_limited_axes.xml \
106    frameworks/native/data/etc/android.hardware.sensor.gyroscope_limited_axes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope_limited_axes.xml \
107    frameworks/native/data/etc/android.hardware.sensor.accelerometer_limited_axes_uncalibrated.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer_limited_axes_uncalibrated.xml \
108    frameworks/native/data/etc/android.hardware.sensor.gyroscope_limited_axes_uncalibrated.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope_limited_axes_uncalibrated.xml \
109
110# Additional selinux policy
111BOARD_SEPOLICY_DIRS += device/generic/car/common/sepolicy
112
113# This overrides device/generic/car/common/car.mk
114$(call inherit-product, device/generic/car/emulator/audio/car_emulator_audio.mk)
115$(call inherit-product, device/generic/car/emulator/rotary/car_rotary.mk)
116# Enables USB related passthrough
117$(call inherit-product, device/generic/car/emulator/usbpt/car_usbpt.mk)
118
119# EVS
120# By default, we enable EvsManager, a sample EVS app, and a mock EVS HAL implementation.
121# If you want to use your own EVS HAL implementation, please set ENABLE_MOCK_EVSHAL as false
122# and add your HAL implementation to the product.  Please also check init.evs.rc and see how
123# you can configure EvsManager to use your EVS HAL implementation.  Similarly, please set
124# ENABLE_SAMPLE_EVS_APP as false if you want to use your own EVS app configuration or own EVS
125# app implementation.
126ENABLE_EVS_SAMPLE ?= false
127ENABLE_EVS_SERVICE ?= true
128ENABLE_MOCK_EVSHAL ?= true
129ENABLE_CAREVSSERVICE_SAMPLE ?= false
130ENABLE_SAMPLE_EVS_APP ?= false
131ENABLE_CARTELEMETRY_SERVICE ?= false
132ifeq ($(ENABLE_MOCK_EVSHAL), true)
133CUSTOMIZE_EVS_SERVICE_PARAMETER := true
134endif  # ENABLE_MOCK_EVSHAL
135$(call inherit-product, device/generic/car/emulator/evs/evs.mk)
136
137ifeq ($(EMULATOR_DYNAMIC_MULTIDISPLAY_CONFIG),true)
138# This section configures multi-display without hardcoding the
139# displays on hwservicemanager.
140$(call inherit-product, device/generic/car/emulator/multi-display-dynamic/multi-display-dynamic.mk)
141else # EMULATOR_DYNAMIC_MULTIDISPLAY_CONFIG
142ifeq (true,$(BUILD_EMULATOR_CLUSTER_DISPLAY))
143$(call inherit-product, device/generic/car/emulator/cluster/cluster-hwservicemanager.mk)
144endif # BUILD_EMULATOR_CLUSTER_DISPLAY
145endif # EMULATOR_DYNAMIC_MULTIDISPLAY_CONFIG
146
147# Should use car bluetooth.prop.
148# This replaces value from device/generic/goldfish/product/generic.mk below
149ifeq (,$(ENABLE_CAR_USB_PASSTHROUGH))
150ENABLE_CAR_USB_PASSTHROUGH := false
151endif
152ifeq (true,$(ENABLE_CAR_USB_PASSTHROUGH))
153TARGET_PRODUCT_PROP := device/generic/car/emulator/usbpt/bluetooth/bluetooth.prop
154endif
155
156# Disable biometrics for AAOS emulators
157EMULATOR_VENDOR_NO_BIOMETRICS := true
158
159# Goldfish vendor partition configurations
160$(call inherit-product, device/generic/goldfish/product/generic.mk)
161
162# Enable socket for qemu VHAL
163BOARD_SEPOLICY_DIRS += device/generic/car/emulator/sepolicy
164
165$(call inherit-product-if-exists, device/generic/car/emulator/skins/overlays/car_emu_skin_overlays.mk)
166