summaryrefslogtreecommitdiff
path: root/emulator
diff options
context:
space:
mode:
Diffstat (limited to 'emulator')
-rw-r--r--emulator/Conn/CommConn/CommConn.cpp2
-rw-r--r--emulator/Conn/CommConn/include/CommConn.h33
-rw-r--r--emulator/Conn/PipeComm/Android.bp3
-rw-r--r--emulator/Conn/PipeComm/PipeComm.cpp10
-rw-r--r--emulator/Conn/PipeComm/include/PipeComm.h8
-rw-r--r--emulator/Conn/PipeComm/include/qemu_pipe.h65
-rw-r--r--emulator/Conn/PipeComm/qemu_pipe.cpp104
-rw-r--r--emulator/Conn/SocketComm/include/SocketComm.h27
-rw-r--r--emulator/aosp_car_emulator.mk53
-rw-r--r--emulator/audio/audio_policy_configuration.xml119
-rw-r--r--emulator/audio/car_audio_configuration.xml218
-rw-r--r--emulator/audio/car_emulator_audio.mk4
-rw-r--r--emulator/audio/driver/audio_hw.c75
-rw-r--r--emulator/audio/driver/ext_pcm.c2
-rw-r--r--emulator/car_emulator_product.mk28
-rw-r--r--emulator/car_emulator_vendor.mk141
-rw-r--r--emulator/cluster/cluster-hwservicemanager.mk43
-rw-r--r--emulator/cluster/display_settings.xml2
-rw-r--r--emulator/cluster/rro_overlays/CarServiceOverlay/res/values/config.xml23
-rw-r--r--emulator/cluster/rro_overlays/CarServiceOverlay_MdNd/Android.bp35
-rw-r--r--emulator/cluster/rro_overlays/CarServiceOverlay_MdNd/AndroidManifest.xml27
-rw-r--r--emulator/cluster/rro_overlays/CarServiceOverlay_MdNd/res/values/config.xml157
-rw-r--r--emulator/cluster/rro_overlays/CarServiceOverlay_MdNd/res/xml/car_ux_restrictions_map.xml104
-rw-r--r--emulator/cluster/rro_overlays/CarServiceOverlay_MdNd/res/xml/overlays.xml24
-rw-r--r--emulator/cluster/rro_overlays/CarServiceOverlay_MdOsDouble/Android.bp34
-rw-r--r--emulator/cluster/rro_overlays/CarServiceOverlay_MdOsDouble/AndroidManifest.xml26
-rw-r--r--emulator/cluster/rro_overlays/CarServiceOverlay_MdOsDouble/res/values/config.xml105
-rw-r--r--emulator/cluster/rro_overlays/CarServiceOverlay_MdOsDouble/res/xml/car_ux_restrictions_map.xml94
-rw-r--r--emulator/cluster/rro_overlays/CarServiceOverlay_MdOsDouble/res/xml/overlays.xml23
-rw-r--r--emulator/cluster/rro_overlays/CarServiceOverlay_OsDouble/res/values/config.xml18
-rw-r--r--emulator/evs/evs.mk42
-rw-r--r--emulator/evs/evs_app_config.json55
-rw-r--r--emulator/evs/init.evs.rc20
-rw-r--r--emulator/evs/rro_overlays/CarEvsServiceOverlay/Android.bp27
-rw-r--r--emulator/evs/rro_overlays/CarEvsServiceOverlay/AndroidManifest.xml24
-rw-r--r--emulator/evs/rro_overlays/CarEvsServiceOverlay/res/values/config.xml30
-rw-r--r--emulator/evs/rro_overlays/CarEvsServiceOverlay/res/xml/overlays.xml20
-rw-r--r--emulator/media/rro_overlay/CarServiceOverlay/Android.bp34
-rw-r--r--emulator/media/rro_overlay/CarServiceOverlay/AndroidManifest.xml25
-rw-r--r--emulator/media/rro_overlay/CarServiceOverlay/res/values/config.xml24
-rw-r--r--emulator/media/rro_overlay/CarServiceOverlay/res/xml/overlays.xml19
-rw-r--r--emulator/multi-display-dynamic/CarServiceMultiDisplayOverlayEmulator/Android.bp27
-rw-r--r--emulator/multi-display-dynamic/CarServiceMultiDisplayOverlayEmulator/AndroidManifest.xml25
-rw-r--r--emulator/multi-display-dynamic/CarServiceMultiDisplayOverlayEmulator/res/values/config.xml60
-rw-r--r--emulator/multi-display-dynamic/CarServiceMultiDisplayOverlayEmulator/res/xml/car_ux_restrictions_map.xml124
-rw-r--r--emulator/multi-display-dynamic/CarServiceMultiDisplayOverlayEmulator/res/xml/overlays.xml25
-rw-r--r--emulator/multi-display-dynamic/ClusterOsDoubleEmulatorVirtualDisplayOverlay/Android.bp27
-rw-r--r--emulator/multi-display-dynamic/ClusterOsDoubleEmulatorVirtualDisplayOverlay/AndroidManifest.xml25
-rw-r--r--emulator/multi-display-dynamic/ClusterOsDoubleEmulatorVirtualDisplayOverlay/res/values/config.xml21
-rw-r--r--emulator/multi-display-dynamic/ClusterOsDoubleEmulatorVirtualDisplayOverlay/res/xml/overlays.xml19
-rw-r--r--emulator/multi-display-dynamic/config.ini31
-rw-r--r--emulator/multi-display-dynamic/display_settings.xml54
-rw-r--r--emulator/multi-display-dynamic/multi-display-dynamic.mk47
-rw-r--r--emulator/multi-display-dynamic/overlay/frameworks/base/core/res/res/values/config.xml67
-rw-r--r--emulator/multi-display/ClusterOsDoubleEmulatorPhysicalDisplayOverlay/Android.bp27
-rw-r--r--emulator/multi-display/ClusterOsDoubleEmulatorPhysicalDisplayOverlay/AndroidManifest.xml25
-rw-r--r--emulator/multi-display/ClusterOsDoubleEmulatorPhysicalDisplayOverlay/res/values/config.xml21
-rw-r--r--emulator/multi-display/ClusterOsDoubleEmulatorPhysicalDisplayOverlay/res/xml/overlays.xml19
-rw-r--r--emulator/multi-display/car_audio_configuration.xml185
-rw-r--r--emulator/multi-display/display_layout_configuration.xml24
-rw-r--r--emulator/multi-display/display_settings.xml23
-rw-r--r--emulator/multi-display/input/virtio_input_multi_touch_7.idc18
-rw-r--r--emulator/multi-display/input/virtio_input_multi_touch_8.idc18
-rw-r--r--emulator/multi-display/input/virtio_input_multi_touch_9.idc18
-rw-r--r--emulator/multi-display/overlay/frameworks/base/core/res/res/values/config.xml68
-rw-r--r--emulator/multi-display/overlay/frameworks/base/core/res/res/xml/config_user_types.xml28
-rw-r--r--emulator/overlay/frameworks/base/core/res/res/values/config.xml22
-rw-r--r--emulator/sepolicy/hal_vehicle_default.te1
-rw-r--r--emulator/usbpt/BoardConfig.mk3
-rw-r--r--emulator/usbpt/bluetooth/bluetooth.mk2
-rw-r--r--emulator/usbpt/bluetooth/bluetooth.prop20
-rw-r--r--emulator/usbpt/bluetooth/btusb/BoardConfig.mk10
-rw-r--r--emulator/usbpt/bluetooth/btusb/hal/bdroid_buildcfg.h9
-rw-r--r--emulator/usbpt/bluetooth/btusb/init.btusb.rc14
-rw-r--r--emulator/usbpt/bluetooth/modules.blocklist2
-rw-r--r--emulator/usbpt/bluetooth/usb_modeswitch/usb_modeswitch.c4
-rw-r--r--emulator/usbpt/car_usbpt.mk4
-rw-r--r--emulator/usbpt/modules.blocklist10
-rw-r--r--emulator/usbpt/protocan/manifest.protocan.xml4
-rw-r--r--emulator/usbpt/protocan/protocan.mk8
-rw-r--r--emulator/usbpt/protocan/protocanbus/sepolicy/dumpstate.te2
-rw-r--r--emulator/usbpt/protocan/protocanbus/sepolicy/service.te2
-rw-r--r--emulator/usbpt/usbip-service/TEST_MAPPING2
-rw-r--r--emulator/usbpt/wifi/BoardConfig.mk14
-rw-r--r--emulator/usbpt/wifi/init.wifiusb.rc19
-rw-r--r--emulator/usbpt/wifi/wifi.mk17
-rw-r--r--emulator/vhal_aidl/EmulatedVehicleService.cpp13
-rw-r--r--emulator/vhal_aidl/vhal-emulator-service.xml2
-rw-r--r--emulator/vhal_v2_0/interfaces/aidl/Android.bp8
89 files changed, 2764 insertions, 381 deletions
diff --git a/emulator/Conn/CommConn/CommConn.cpp b/emulator/Conn/CommConn/CommConn.cpp
index c800edc..241c6a9 100644
--- a/emulator/Conn/CommConn/CommConn.cpp
+++ b/emulator/Conn/CommConn/CommConn.cpp
@@ -48,6 +48,8 @@ void CommConn::sendMessage(vhal_proto::EmulatorMessage const& msg) {
return;
}
+ std::lock_guard<std::mutex> lock(mSendMessageLock);
+
write(buffer);
}
diff --git a/emulator/Conn/CommConn/include/CommConn.h b/emulator/Conn/CommConn/include/CommConn.h
index ba5fd9f..ae6b9fb 100644
--- a/emulator/Conn/CommConn/include/CommConn.h
+++ b/emulator/Conn/CommConn/include/CommConn.h
@@ -97,6 +97,24 @@ class CommConn : public MessageSender {
virtual bool isOpen() = 0;
/**
+ * Serialized and send the given message to the other side.
+ */
+ void sendMessage(const vhal_proto::EmulatorMessage& msg) final;
+
+ protected:
+ MessageProcessor* mMessageProcessor;
+
+ private:
+ std::unique_ptr<std::thread> mReadThread;
+ std::mutex mSendMessageLock;
+
+ /**
+ * A thread that reads messages in a loop, and responds. You can stop this thread by calling
+ * stop().
+ */
+ void readThread();
+
+ /**
* Blocking call to read data from the connection.
*
* @return std::vector<uint8_t> Serialized protobuf data received from emulator. This will be
@@ -112,21 +130,6 @@ class CommConn : public MessageSender {
* @return int Number of bytes transmitted, or -1 if failed.
*/
virtual int write(const std::vector<uint8_t>& data) = 0;
-
- /**
- * Serialized and send the given message to the other side.
- */
- void sendMessage(const vhal_proto::EmulatorMessage& msg);
-
- protected:
- std::unique_ptr<std::thread> mReadThread;
- MessageProcessor* mMessageProcessor;
-
- /**
- * A thread that reads messages in a loop, and responds. You can stop this thread by calling
- * stop().
- */
- void readThread();
};
} // namespace impl
diff --git a/emulator/Conn/PipeComm/Android.bp b/emulator/Conn/PipeComm/Android.bp
index 6f8e3b4..4def19c 100644
--- a/emulator/Conn/PipeComm/Android.bp
+++ b/emulator/Conn/PipeComm/Android.bp
@@ -32,4 +32,7 @@ cc_library {
"android.hardware.automotive.vehicle@2.0-libproto-native",
"EmulatorCommConn",
],
+ whole_static_libs: [
+ "//device/generic/goldfish:libqemud.ranchu",
+ ],
}
diff --git a/emulator/Conn/PipeComm/PipeComm.cpp b/emulator/Conn/PipeComm/PipeComm.cpp
index c54bf9f..789cffb 100644
--- a/emulator/Conn/PipeComm/PipeComm.cpp
+++ b/emulator/Conn/PipeComm/PipeComm.cpp
@@ -18,11 +18,11 @@
#include <log/log.h>
-#include "qemu_pipe.h"
+#include "qemud.h"
#include "PipeComm.h"
-#define CAR_SERVICE_NAME "pipe:qemud:car"
+#define CAR_SERVICE_NAME "car"
namespace android {
@@ -36,7 +36,7 @@ namespace impl {
PipeComm::PipeComm(MessageProcessor* messageProcessor) : CommConn(messageProcessor), mPipeFd(-1) {}
void PipeComm::start() {
- int fd = qemu_pipe_open(CAR_SERVICE_NAME);
+ int fd = qemud_channel_open(CAR_SERVICE_NAME);
if (fd < 0) {
ALOGE("%s: Could not open connection to service: %s %d", __FUNCTION__, strerror(errno), fd);
@@ -62,7 +62,7 @@ std::vector<uint8_t> PipeComm::read() {
std::vector<uint8_t> msg = std::vector<uint8_t>(MAX_RX_MSG_SZ);
int numBytes;
- numBytes = qemu_pipe_frame_recv(mPipeFd, msg.data(), msg.size());
+ numBytes = qemud_channel_recv(mPipeFd, msg.data(), msg.size());
if (numBytes == MAX_RX_MSG_SZ) {
ALOGE("%s: Received max size = %d", __FUNCTION__, MAX_RX_MSG_SZ);
@@ -81,7 +81,7 @@ int PipeComm::write(const std::vector<uint8_t>& data) {
int retVal = 0;
if (mPipeFd != -1) {
- retVal = qemu_pipe_frame_send(mPipeFd, data.data(), data.size());
+ retVal = qemud_channel_send(mPipeFd, data.data(), data.size());
}
if (retVal < 0) {
diff --git a/emulator/Conn/PipeComm/include/PipeComm.h b/emulator/Conn/PipeComm/include/PipeComm.h
index 24dd686..2043ac4 100644
--- a/emulator/Conn/PipeComm/include/PipeComm.h
+++ b/emulator/Conn/PipeComm/include/PipeComm.h
@@ -44,16 +44,16 @@ class PipeComm : public CommConn {
void start() override;
void stop() override;
- std::vector<uint8_t> read() override;
- int write(const std::vector<uint8_t>& data) override;
-
inline bool isOpen() override { return mPipeFd > 0; }
private:
int mPipeFd;
+
+ std::vector<uint8_t> read() override;
+ int write(const std::vector<uint8_t>& data) override;
};
-} // impl
+} // namespace impl
} // namespace V2_0
} // namespace vehicle
diff --git a/emulator/Conn/PipeComm/include/qemu_pipe.h b/emulator/Conn/PipeComm/include/qemu_pipe.h
deleted file mode 100644
index bd3e71d..0000000
--- a/emulator/Conn/PipeComm/include/qemu_pipe.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_EMULATORPIPECOMM_QEMU_PIPE_H
-#define ANDROID_EMULATORPIPECOMM_QEMU_PIPE_H
-
-#include <stddef.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-// Try to open a new Qemu fast-pipe. This function returns a file descriptor
-// that can be used to communicate with a named service managed by the
-// emulator.
-//
-// This file descriptor can be used as a standard pipe/socket descriptor.
-//
-// 'pipeName' is the name of the emulator service you want to connect to,
-// and should begin with 'pipe:' (e.g. 'pipe:camera' or 'pipe:opengles').
-// For backward compatibility, the 'pipe:' prefix can be omitted, and in
-// that case, qemu_pipe_open will add it for you.
-
-// On success, return a valid file descriptor, or -1/errno on failure. E.g.:
-//
-// EINVAL -> unknown/unsupported pipeName
-// ENOSYS -> fast pipes not available in this system.
-//
-// ENOSYS should never happen, except if you're trying to run within a
-// misconfigured emulator.
-//
-// You should be able to open several pipes to the same pipe service,
-// except for a few special cases (e.g. GSM modem), where EBUSY will be
-// returned if more than one client tries to connect to it.
-int qemu_pipe_open(const char* pipeName);
-
-// Send a framed message |buff| of |len| bytes through the |fd| descriptor.
-// This really adds a 4-hexchar prefix describing the payload size.
-// Returns 0 on success, and -1 on error.
-int qemu_pipe_frame_send(int fd, const void* buff, size_t len);
-
-// Read a frame message from |fd|, and store it into |buff| of |len| bytes.
-// If the framed message is larger than |len|, then this returns -1 and the
-// content is lost. Otherwise, this returns the size of the message. NOTE:
-// empty messages are possible in a framed wire protocol and do not mean
-// end-of-stream.
-int qemu_pipe_frame_recv(int fd, void* buff, size_t len);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANDROID_EMULATORPIPECOMM_QEMU_PIPE_H
diff --git a/emulator/Conn/PipeComm/qemu_pipe.cpp b/emulator/Conn/PipeComm/qemu_pipe.cpp
deleted file mode 100644
index 1f541b5..0000000
--- a/emulator/Conn/PipeComm/qemu_pipe.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <android-base/file.h>
-
-#include "qemu_pipe.h"
-
-using android::base::ReadFully;
-using android::base::WriteFully;
-
-// Define QEMU_PIPE_DEBUG if you want to print error messages when an error
-// occurs during pipe operations. The macro should simply take a printf-style
-// formatting string followed by optional arguments.
-#ifndef QEMU_PIPE_DEBUG
-#define QEMU_PIPE_DEBUG(...) (void)0
-#endif
-
-int qemu_pipe_open(const char* pipeName) {
- if (!pipeName) {
- errno = EINVAL;
- return -1;
- }
-
- int fd = TEMP_FAILURE_RETRY(open("/dev/qemu_pipe", O_RDWR));
- if (fd < 0) {
- QEMU_PIPE_DEBUG("%s: Could not open /dev/qemu_pipe: %s", __FUNCTION__, strerror(errno));
- return -1;
- }
-
- // Write the pipe name, *including* the trailing zero which is necessary.
- size_t pipeNameLen = strlen(pipeName);
- if (WriteFully(fd, pipeName, pipeNameLen + 1U)) {
- return fd;
- }
-
- // now, add 'pipe:' prefix and try again
- // Note: host side will wait for the trailing '\0' to start
- // service lookup.
- const char pipe_prefix[] = "pipe:";
- if (WriteFully(fd, pipe_prefix, strlen(pipe_prefix)) &&
- WriteFully(fd, pipeName, pipeNameLen + 1U)) {
- return fd;
- }
- QEMU_PIPE_DEBUG("%s: Could not write to %s pipe service: %s", __FUNCTION__, pipeName,
- strerror(errno));
- close(fd);
- return -1;
-}
-
-int qemu_pipe_frame_send(int fd, const void* buff, size_t len) {
- char header[5];
- snprintf(header, sizeof(header), "%04zx", len);
- if (!WriteFully(fd, header, 4)) {
- QEMU_PIPE_DEBUG("Can't write qemud frame header: %s", strerror(errno));
- return -1;
- }
- if (!WriteFully(fd, buff, len)) {
- QEMU_PIPE_DEBUG("Can't write qemud frame payload: %s", strerror(errno));
- return -1;
- }
- return 0;
-}
-
-int qemu_pipe_frame_recv(int fd, void* buff, size_t len) {
- char header[5];
- if (!ReadFully(fd, header, 4)) {
- QEMU_PIPE_DEBUG("Can't read qemud frame header: %s", strerror(errno));
- return -1;
- }
- header[4] = '\0';
- size_t size;
- if (sscanf(header, "%04zx", &size) != 1) {
- QEMU_PIPE_DEBUG("Malformed qemud frame header: [%.*s]", 4, header);
- return -1;
- }
- if (size > len) {
- QEMU_PIPE_DEBUG("Oversized qemud frame (% bytes, expected <= %)", size, len);
- return -1;
- }
- if (!ReadFully(fd, buff, size)) {
- QEMU_PIPE_DEBUG("Could not read qemud frame payload: %s", strerror(errno));
- return -1;
- }
- return size;
-}
diff --git a/emulator/Conn/SocketComm/include/SocketComm.h b/emulator/Conn/SocketComm/include/SocketComm.h
index 4e385c3..7da546b 100644
--- a/emulator/Conn/SocketComm/include/SocketComm.h
+++ b/emulator/Conn/SocketComm/include/SocketComm.h
@@ -81,36 +81,19 @@ class SocketComm : public MessageSender {
* SocketConn represents a single connection to a client.
*/
class SocketConn : public CommConn {
- public:
+ public:
SocketConn(MessageProcessor* messageProcessor, int sfd);
virtual ~SocketConn() = default;
- /**
- * Blocking call to read data from the connection.
- *
- * @return std::vector<uint8_t> Serialized protobuf data received from emulator. This will be
- * an empty vector if the connection was closed or some other error occurred.
- */
- std::vector<uint8_t> read() override;
-
- /**
- * Closes a connection if it is open.
- */
void stop() override;
- /**
- * Transmits a string of data to the emulator.
- *
- * @param data Serialized protobuf data to transmit.
- *
- * @return int Number of bytes transmitted, or -1 if failed.
- */
- int write(const std::vector<uint8_t>& data) override;
-
inline bool isOpen() override { return mSockFd > 0; }
- private:
+ private:
int mSockFd;
+
+ std::vector<uint8_t> read() override;
+ int write(const std::vector<uint8_t>& data) override;
};
} // impl
diff --git a/emulator/aosp_car_emulator.mk b/emulator/aosp_car_emulator.mk
index f0810a9..85e18ac 100644
--- a/emulator/aosp_car_emulator.mk
+++ b/emulator/aosp_car_emulator.mk
@@ -21,6 +21,8 @@ ifeq (,$(ENABLE_REAR_VIEW_CAMERA_SAMPLE))
ENABLE_REAR_VIEW_CAMERA_SAMPLE:=true
endif
+PRODUCT_PACKAGE_OVERLAYS := device/generic/car/emulator/overlay
+
$(call inherit-product, device/generic/car/common/car.mk)
# This overrides device/generic/car/common/car.mk
$(call inherit-product, device/generic/car/emulator/audio/car_emulator_audio.mk)
@@ -28,21 +30,48 @@ $(call inherit-product, device/generic/car/emulator/rotary/car_rotary.mk)
# Enables USB related passthrough
$(call inherit-product, device/generic/car/emulator/usbpt/car_usbpt.mk)
-ifeq (true,$(BUILD_EMULATOR_CLUSTER_DISPLAY))
-PRODUCT_COPY_FILES += \
- device/generic/car/emulator/cluster/display_settings.xml:system/etc/display_settings.xml \
+TARGET_PRODUCT_PROP := device/generic/car/emulator/usbpt/bluetooth/bluetooth.prop
-PRODUCT_PRODUCT_PROPERTIES += \
- hwservicemanager.external.displays=1,400,600,120,0 \
- persist.service.bootanim.displays=8140900251843329 \
+# EVS
+# By default, we enable EvsManager, a sample EVS app, and a mock EVS HAL implementation.
+# If you want to use your own EVS HAL implementation, please set ENABLE_MOCK_EVSHAL as false
+# and add your HAL implementation to the product. Please also check init.evs.rc and see how
+# you can configure EvsManager to use your EVS HAL implementation. Similarly, please set
+# ENABLE_SAMPLE_EVS_APP as false if you want to use your own EVS app configuration or own EVS
+# app implementation.
+ENABLE_EVS_SAMPLE ?= false
+ENABLE_EVS_SERVICE ?= true
+ENABLE_MOCK_EVSHAL ?= true
+ENABLE_CAREVSSERVICE_SAMPLE ?= false
+ENABLE_SAMPLE_EVS_APP ?= false
+ENABLE_CARTELEMETRY_SERVICE ?= false
+ifeq ($(ENABLE_MOCK_EVSHAL), true)
+CUSTOMIZE_EVS_SERVICE_PARAMETER := true
+endif # ENABLE_MOCK_EVSHAL
+$(call inherit-product, device/generic/car/emulator/evs/evs.mk)
+
+ifeq ($(EMULATOR_DYNAMIC_MULTIDISPLAY_CONFIG),true)
+# This section configures multi-display without hardcoding the
+# displays on hwservicemanager.
+$(call inherit-product, device/generic/car/emulator/multi-display-dynamic/multi-display-dynamic.mk)
+else # EMULATOR_DYNAMIC_MULTIDISPLAY_CONFIG
+ifeq (true,$(BUILD_EMULATOR_CLUSTER_DISPLAY))
+$(call inherit-product, device/generic/car/emulator/cluster/cluster-hwservicemanager.mk)
+endif # BUILD_EMULATOR_CLUSTER_DISPLAY
+endif # EMULATOR_DYNAMIC_MULTIDISPLAY_CONFIG
-ifeq (true,$(ENABLE_CLUSTER_OS_DOUBLE))
-PRODUCT_PACKAGES += CarServiceOverlayEmulatorOsDouble
-else
-PRODUCT_PACKAGES += CarServiceOverlayEmulator
-endif # ENABLE_CLUSTER_OS_DOUBLE
-endif # BUILD_EMULATOR_CLUSTER_DISPLAY
+PRODUCT_PACKAGES += CarServiceOverlayEmulatorMedia
PRODUCT_PRODUCT_PROPERTIES += \
ro.carwatchdog.vhal_healthcheck.interval=10 \
ro.carwatchdog.client_healthcheck.interval=20 \
+
+# Drive Mode RROs
+PRODUCT_PACKAGES += \
+ DriveModeEcoRRO \
+ DriveModeSportRRO \
+ DriveModeOnRRO \
+
+# Enable socket for qemu VHAL
+BOARD_SEPOLICY_DIRS += device/generic/car/emulator/sepolicy
+
diff --git a/emulator/audio/audio_policy_configuration.xml b/emulator/audio/audio_policy_configuration.xml
index d2a2b26..bf9b585 100644
--- a/emulator/audio/audio_policy_configuration.xml
+++ b/emulator/audio/audio_policy_configuration.xml
@@ -62,7 +62,14 @@
<!-- names with _audio_zone_# are used for defined an emulator rear seat audio zone
where each number # is the zone id number -->
<item>bus100_audio_zone_1</item>
+ <item>bus101_audio_zone_1</item>
+ <item>bus110_audio_zone_1</item>
+ <item>bus111_audio_zone_1</item>
<item>bus200_audio_zone_2</item>
+ <item>bus201_audio_zone_2</item>
+ <item>bus210_audio_zone_2</item>
+ <item>bus211_audio_zone_2</item>
+ <item>bus1000_mirror_device</item>
<item>Built-In Mic</item>
<item>Built-In Back Mic</item>
<item>Echo-Reference Mic</item>
@@ -118,11 +125,46 @@
samplingRates="48000"
channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</mixPort>
+ <mixPort name="mixport_bus101_audio_zone_1" role="source">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="48000"
+ channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+ </mixPort>
+ <mixPort name="mixport_bus110_audio_zone_1" role="source">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="48000"
+ channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+ </mixPort>
+ <mixPort name="mixport_bus111_audio_zone_1" role="source">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="48000"
+ channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+ </mixPort>
<mixPort name="mixport_bus200_audio_zone_2" role="source">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="48000"
channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</mixPort>
+ <mixPort name="mixport_bus201_audio_zone_2" role="source">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="48000"
+ channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+ </mixPort>
+ <mixPort name="mixport_bus210_audio_zone_2" role="source">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="48000"
+ channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+ </mixPort>
+ <mixPort name="mixport_bus211_audio_zone_2" role="source">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="48000"
+ channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+ </mixPort>
+ <mixPort name="mixport_bus1000_mirror_device" role="source">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="48000"
+ channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+ </mixPort>
<mixPort name="primary input" role="sink">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
@@ -235,6 +277,46 @@
defaultValueMB="0" stepValueMB="100"/>
</gains>
</devicePort>
+ <devicePort tagName="bus101_audio_zone_1" role="sink" type="AUDIO_DEVICE_OUT_BUS"
+ address="bus101_audio_zone_1">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+ <gains>
+ <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
+ minValueMB="-3200" maxValueMB="600"
+ defaultValueMB="0" stepValueMB="100"/>
+ </gains>
+ </devicePort>
+ <devicePort tagName="bus110_audio_zone_1" role="sink" type="AUDIO_DEVICE_OUT_BUS"
+ address="bus110_audio_zone_1">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+ <gains>
+ <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
+ minValueMB="-3200" maxValueMB="600"
+ defaultValueMB="0" stepValueMB="100"/>
+ </gains>
+ </devicePort>
+ <devicePort tagName="bus111_audio_zone_1" role="sink" type="AUDIO_DEVICE_OUT_BUS"
+ address="bus111_audio_zone_1">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+ <gains>
+ <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
+ minValueMB="-3200" maxValueMB="600"
+ defaultValueMB="0" stepValueMB="100"/>
+ </gains>
+ </devicePort>
+ <devicePort tagName="bus1000_mirror_device" role="sink" type="AUDIO_DEVICE_OUT_BUS"
+ address="bus1000_mirror_device">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+ <gains>
+ <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
+ minValueMB="-3200" maxValueMB="600"
+ defaultValueMB="0" stepValueMB="100"/>
+ </gains>
+ </devicePort>
<devicePort tagName="bus200_audio_zone_2" role="sink" type="AUDIO_DEVICE_OUT_BUS"
address="bus200_audio_zone_2">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
@@ -245,6 +327,36 @@
defaultValueMB="0" stepValueMB="100"/>
</gains>
</devicePort>
+ <devicePort tagName="bus201_audio_zone_2" role="sink" type="AUDIO_DEVICE_OUT_BUS"
+ address="bus201_audio_zone_2">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+ <gains>
+ <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
+ minValueMB="-3200" maxValueMB="600"
+ defaultValueMB="0" stepValueMB="100"/>
+ </gains>
+ </devicePort>
+ <devicePort tagName="bus210_audio_zone_2" role="sink" type="AUDIO_DEVICE_OUT_BUS"
+ address="bus210_audio_zone_2">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+ <gains>
+ <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
+ minValueMB="-3200" maxValueMB="600"
+ defaultValueMB="0" stepValueMB="100"/>
+ </gains>
+ </devicePort>
+ <devicePort tagName="bus211_audio_zone_2" role="sink" type="AUDIO_DEVICE_OUT_BUS"
+ address="bus211_audio_zone_2">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+ <gains>
+ <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
+ minValueMB="-3200" maxValueMB="600"
+ defaultValueMB="0" stepValueMB="100"/>
+ </gains>
+ </devicePort>
<devicePort tagName="Built-In Mic" type="AUDIO_DEVICE_IN_BUILTIN_MIC" role="source"
address="Built-In Mic" >
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
@@ -307,7 +419,14 @@
<route type="mix" sink="bus7_system_sound_out"
sources="mixport_bus7_system_sound_out"/>
<route type="mix" sink="bus100_audio_zone_1" sources="mixport_bus100_audio_zone_1"/>
+ <route type="mix" sink="bus101_audio_zone_1" sources="mixport_bus101_audio_zone_1"/>
+ <route type="mix" sink="bus110_audio_zone_1" sources="mixport_bus110_audio_zone_1"/>
+ <route type="mix" sink="bus111_audio_zone_1" sources="mixport_bus111_audio_zone_1"/>
+ <route type="mix" sink="bus1000_mirror_device" sources="mixport_bus1000_mirror_device"/>
<route type="mix" sink="bus200_audio_zone_2" sources="mixport_bus200_audio_zone_2"/>
+ <route type="mix" sink="bus201_audio_zone_2" sources="mixport_bus201_audio_zone_2"/>
+ <route type="mix" sink="bus210_audio_zone_2" sources="mixport_bus210_audio_zone_2"/>
+ <route type="mix" sink="bus211_audio_zone_2" sources="mixport_bus211_audio_zone_2"/>
<route type="mix" sink="primary input"
sources="Built-In Mic,Built-In Back Mic,Echo-Reference Mic"/>
<route type="mix" sink="mixport_tuner0" sources="FM Tuner"/>
diff --git a/emulator/audio/car_audio_configuration.xml b/emulator/audio/car_audio_configuration.xml
index 5c0a880..81ccbfa 100644
--- a/emulator/audio/car_audio_configuration.xml
+++ b/emulator/audio/car_audio_configuration.xml
@@ -21,87 +21,155 @@
- Volume groups
in the car environment.
-->
-<carAudioConfiguration version="2">
+<carAudioConfiguration version="3">
<zones>
<zone name="primary zone" isPrimary="true" occupantZoneId="0">
- <volumeGroups>
- <group>
- <device address="bus0_media_out">
- <context context="music"/>
- <context context="announcement"/>
- </device>
- <device address="bus6_notification_out">
- <context context="notification"/>
- </device>
- </group>
- <group>
- <device address="bus1_navigation_out">
- <context context="navigation"/>
- </device>
- <device address="bus2_voice_command_out">
- <context context="voice_command"/>
- </device>
- </group>
- <group>
- <device address="bus4_call_out">
- <context context="call"/>
- </device>
- <device address="bus3_call_ring_out">
- <context context="call_ring"/>
- </device>
- </group>
- <group>
- <device address="bus5_alarm_out">
- <context context="alarm"/>
- </device>
- <device address="bus7_system_sound_out">
- <context context="system_sound"/>
- <context context="emergency"/>
- <context context="safety"/>
- <context context="vehicle_status"/>
- </device>
- </group>
- </volumeGroups>
+ <zoneConfigs>
+ <zoneConfig name="primary zone config 0" isDefault="true">
+ <volumeGroups>
+ <group>
+ <device address="bus0_media_out">
+ <context context="music"/>
+ <context context="announcement"/>
+ </device>
+ <device address="bus6_notification_out">
+ <context context="notification"/>
+ </device>
+ </group>
+ <group>
+ <device address="bus1_navigation_out">
+ <context context="navigation"/>
+ </device>
+ <device address="bus2_voice_command_out">
+ <context context="voice_command"/>
+ </device>
+ </group>
+ <group>
+ <device address="bus4_call_out">
+ <context context="call"/>
+ </device>
+ <device address="bus3_call_ring_out">
+ <context context="call_ring"/>
+ </device>
+ </group>
+ <group>
+ <device address="bus5_alarm_out">
+ <context context="alarm"/>
+ </device>
+ <device address="bus7_system_sound_out">
+ <context context="system_sound"/>
+ <context context="emergency"/>
+ <context context="safety"/>
+ <context context="vehicle_status"/>
+ </device>
+ </group>
+ </volumeGroups>
+ </zoneConfig>
+ </zoneConfigs>
</zone>
<zone name="rear seat zone 1" audioZoneId="1">
- <volumeGroups>
- <group>
- <device address="bus100_audio_zone_1">
- <context context="music"/>
- <context context="navigation"/>
- <context context="voice_command"/>
- <context context="call_ring"/>
- <context context="call"/>
- <context context="alarm"/>
- <context context="notification"/>
- <context context="system_sound"/>
- <context context="emergency"/>
- <context context="safety"/>
- <context context="vehicle_status"/>
- <context context="announcement"/>
- </device>
- </group>
- </volumeGroups>
+ <zoneConfigs>
+ <zoneConfig name="rear seat zone 1 config 0" isDefault="true">
+ <volumeGroups>
+ <group>
+ <device address="bus100_audio_zone_1">
+ <context context="music"/>
+ </device>
+ </group>
+ <group>
+ <device address="bus101_audio_zone_1">
+ <context context="navigation"/>
+ <context context="voice_command"/>
+ <context context="call_ring"/>
+ <context context="call"/>
+ <context context="alarm"/>
+ <context context="notification"/>
+ <context context="system_sound"/>
+ <context context="emergency"/>
+ <context context="safety"/>
+ <context context="vehicle_status"/>
+ <context context="announcement"/>
+ </device>
+ </group>
+ </volumeGroups>
+ </zoneConfig>
+ <zoneConfig name="rear seat zone 1 config 1">
+ <volumeGroups>
+ <group>
+ <device address="bus110_audio_zone_1">
+ <context context="music"/>
+ </device>
+ </group>
+ <group>
+ <device address="bus111_audio_zone_1">
+ <context context="navigation"/>
+ <context context="voice_command"/>
+ <context context="call_ring"/>
+ <context context="call"/>
+ <context context="alarm"/>
+ <context context="notification"/>
+ <context context="system_sound"/>
+ <context context="emergency"/>
+ <context context="safety"/>
+ <context context="vehicle_status"/>
+ <context context="announcement"/>
+ </device>
+ </group>
+ </volumeGroups>
+ </zoneConfig>
+ </zoneConfigs>
</zone>
<zone name="rear seat zone 2" audioZoneId="2">
- <volumeGroups>
- <group>
- <device address="bus200_audio_zone_2">
- <context context="music"/>
- <context context="navigation"/>
- <context context="voice_command"/>
- <context context="call_ring"/>
- <context context="call"/>
- <context context="alarm"/>
- <context context="notification"/>
- <context context="system_sound"/>
- <context context="emergency"/>
- <context context="safety"/>
- <context context="vehicle_status"/>
- <context context="announcement"/>
- </device>
- </group>
- </volumeGroups>
+ <zoneConfigs>
+ <zoneConfig name="rear seat zone 2 config 0" isDefault="true">
+ <volumeGroups>
+ <group>
+ <device address="bus200_audio_zone_2">
+ <context context="music"/>
+ </device>
+ </group>
+ <group>
+ <device address="bus201_audio_zone_2">
+ <context context="navigation"/>
+ <context context="voice_command"/>
+ <context context="call_ring"/>
+ <context context="call"/>
+ <context context="alarm"/>
+ <context context="notification"/>
+ <context context="system_sound"/>
+ <context context="emergency"/>
+ <context context="safety"/>
+ <context context="vehicle_status"/>
+ <context context="announcement"/>
+ </device>
+ </group>
+ </volumeGroups>
+ </zoneConfig>
+ <zoneConfig name="rear seat zone 2 config 1">
+ <volumeGroups>
+ <group>
+ <device address="bus210_audio_zone_2">
+ <context context="music"/>
+ </device>
+ </group>
+ <group>
+ <device address="bus211_audio_zone_2">
+ <context context="navigation"/>
+ <context context="voice_command"/>
+ <context context="call_ring"/>
+ <context context="call"/>
+ <context context="alarm"/>
+ <context context="notification"/>
+ <context context="system_sound"/>
+ <context context="emergency"/>
+ <context context="safety"/>
+ <context context="vehicle_status"/>
+ <context context="announcement"/>
+ </device>
+ </group>
+ </volumeGroups>
+ </zoneConfig>
+ </zoneConfigs>
</zone>
</zones>
</carAudioConfiguration>
diff --git a/emulator/audio/car_emulator_audio.mk b/emulator/audio/car_emulator_audio.mk
index 80e59f7..6b3147f 100644
--- a/emulator/audio/car_emulator_audio.mk
+++ b/emulator/audio/car_emulator_audio.mk
@@ -22,12 +22,12 @@ PRODUCT_PACKAGES += audio.primary.caremu
PRODUCT_PACKAGES += \
android.hardware.audio@6.0-impl:32
-DEVICE_MANIFEST_FILE += device/generic/car/emulator/audio/android.hardware.audio.effects@6.0.xml
+PRODUCT_COPY_FILES += \
+ device/generic/car/emulator/audio/android.hardware.audio.effects@6.0.xml:/vendor/etc/vintf/manifest/android.hardware.audio.effects@6.0.xml
PRODUCT_PROPERTY_OVERRIDES += ro.hardware.audio.primary=caremu
PRODUCT_COPY_FILES += \
- frameworks/native/data/etc/android.hardware.broadcastradio.xml:system/etc/permissions/android.hardware.broadcastradio.xml \
frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_audio_policy_configuration.xml \
frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usb_audio_policy_configuration.xml \
frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/r_submix_audio_policy_configuration.xml \
diff --git a/emulator/audio/driver/audio_hw.c b/emulator/audio/driver/audio_hw.c
index 94a4205..7714087 100644
--- a/emulator/audio/driver/audio_hw.c
+++ b/emulator/audio/driver/audio_hw.c
@@ -55,10 +55,26 @@
#define DEFAULT_IN_PERIOD_MS 15
#define DEFAULT_IN_PERIOD_COUNT 4
-static const char* PROP_KEY_OUT_PERIOD_MS = "ro.vendor.caremu.audiohal.out_period_ms";
-static const char* PROP_KEY_OUT_PERIOD_COUNT = "ro.vendor.caremu.audiohal.out_period_count";
-static const char* PROP_KEY_IN_PERIOD_MS = "ro.vendor.caremu.audiohal.in_period_ms";
-static const char* PROP_KEY_IN_PERIOD_COUNT = "ro.vendor.caremu.audiohal.in_period_count";
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+#endif
+
+static const char* PROP_KEY_OUT_PERIOD_MS[2] = {
+ "ro.boot.vendor.caremu.audiohal.out_period_ms",
+ "ro.vendor.caremu.audiohal.out_period_ms",
+};
+static const char* PROP_KEY_OUT_PERIOD_COUNT[2] = {
+ "ro.boot.vendor.caremu.audiohal.out_period_count",
+ "ro.vendor.caremu.audiohal.out_period_count",
+};
+static const char* PROP_KEY_IN_PERIOD_MS[2] = {
+ "ro.boot.vendor.caremu.audiohal.in_period_ms",
+ "ro.vendor.caremu.audiohal.in_period_ms",
+};
+static const char* PROP_KEY_IN_PERIOD_COUNT[2] = {
+ "ro.boot.vendor.caremu.audiohal.in_period_count",
+ "ro.vendor.caremu.audiohal.in_period_count",
+};
#define PI 3.14159265
#define TWO_PI (2*PI)
@@ -75,7 +91,7 @@ static const char* PROP_KEY_IN_PERIOD_COUNT = "ro.vendor.caremu.audiohal.in_peri
#define _bool_str(x) ((x)?"true":"false")
-static const char * const PROP_KEY_SIMULATE_MULTI_ZONE_AUDIO = "ro.aae.simulateMultiZoneAudio";
+static const char * const PROP_KEY_SIMULATE_MULTI_ZONE_AUDIO = "ro.vendor.caremu.audiohal.simulateMultiZoneAudio";
static const char * const AAE_PARAMETER_KEY_FOR_SELECTED_ZONE = "com.android.car.emulator.selected_zone";
#define PRIMARY_ZONE_ID 0
#define INVALID_ZONE_ID -1
@@ -92,10 +108,23 @@ static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
static int adev_get_mic_mute(const struct audio_hw_device *dev, bool *state);
+static int audio_get_property(const char** keys, size_t num_keys, int32_t default_value) {
+ static char prop_value[PROP_VALUE_MAX] = {0};
+ for (size_t i = 0; i < num_keys; ++i) {
+ if (property_get(keys[i], prop_value, NULL) > 0) {
+ return property_get_int32(keys[i], default_value);
+ }
+ }
+
+ return default_value;
+}
+
static int get_out_period_ms() {
static int out_period_ms = -1;
if (out_period_ms == -1) {
- out_period_ms = property_get_int32(PROP_KEY_OUT_PERIOD_MS, DEFAULT_OUT_PERIOD_MS);
+ out_period_ms = audio_get_property(PROP_KEY_OUT_PERIOD_MS,
+ ARRAY_SIZE(PROP_KEY_OUT_PERIOD_MS),
+ DEFAULT_OUT_PERIOD_MS);
}
return out_period_ms;
}
@@ -103,7 +132,9 @@ static int get_out_period_ms() {
static int get_out_period_count() {
static int out_period_count = -1;
if (out_period_count == -1) {
- out_period_count = property_get_int32(PROP_KEY_OUT_PERIOD_COUNT, DEFAULT_OUT_PERIOD_COUNT);
+ out_period_count = audio_get_property(PROP_KEY_OUT_PERIOD_COUNT,
+ ARRAY_SIZE(PROP_KEY_OUT_PERIOD_COUNT),
+ DEFAULT_OUT_PERIOD_COUNT);
}
return out_period_count;
}
@@ -111,7 +142,9 @@ static int get_out_period_count() {
static int get_in_period_ms() {
static int in_period_ms = -1;
if (in_period_ms == -1) {
- in_period_ms = property_get_int32(PROP_KEY_IN_PERIOD_MS, DEFAULT_IN_PERIOD_MS);
+ in_period_ms = audio_get_property(PROP_KEY_IN_PERIOD_MS,
+ ARRAY_SIZE(PROP_KEY_IN_PERIOD_MS),
+ DEFAULT_IN_PERIOD_MS);
}
return in_period_ms;
}
@@ -119,7 +152,9 @@ static int get_in_period_ms() {
static int get_in_period_count() {
static int in_period_count = -1;
if (in_period_count == -1) {
- in_period_count = property_get_int32(PROP_KEY_IN_PERIOD_COUNT, DEFAULT_IN_PERIOD_COUNT);
+ in_period_count = audio_get_property(PROP_KEY_IN_PERIOD_COUNT,
+ ARRAY_SIZE(PROP_KEY_IN_PERIOD_COUNT),
+ DEFAULT_IN_PERIOD_COUNT);
}
return in_period_count;
}
@@ -1002,12 +1037,19 @@ static bool is_tone_generator_device(struct generic_stream_in *in) {
address_has_tone_keyword(in->bus_address));
}
+static bool is_microphone_device(struct generic_stream_in *in) {
+ return in->device == AUDIO_DEVICE_IN_BACK_MIC ||
+ in->device == AUDIO_DEVICE_IN_BUILTIN_MIC;
+}
+
static ssize_t in_read(struct audio_stream_in *stream, void *buffer, size_t bytes) {
struct generic_stream_in *in = (struct generic_stream_in *)stream;
struct generic_audio_device *adev = in->dev;
const size_t frames = bytes / audio_stream_in_frame_size(stream);
int ret = 0;
+ bool read_mute = false;
bool mic_mute = false;
+ bool is_tone_generator = false;
size_t read_bytes = 0;
set_shortened_thread_name(pthread_self(), __func__);
@@ -1019,8 +1061,13 @@ static ssize_t in_read(struct audio_stream_in *stream, void *buffer, size_t byte
in->worker_standby = false;
}
+ // Only mute read if mic is muted and device is mic.
+ // Other devices, e.g. FM_TUNER, are not muted by mic mute
+ read_mute = mic_mute && is_microphone_device(in);
+
+ is_tone_generator = is_tone_generator_device(in);
// Tone generators fill the buffer via pseudo_pcm_read directly
- if (!is_tone_generator_device(in)) {
+ if (!is_tone_generator) {
pthread_cond_signal(&in->worker_wake);
}
@@ -1057,7 +1104,7 @@ static ssize_t in_read(struct audio_stream_in *stream, void *buffer, size_t byte
}
in->standby_frames_read += frames;
- if (is_tone_generator_device(in)) {
+ if (is_tone_generator) {
int read_bytes = pseudo_pcm_read(buffer, bytes, &in->oscillator);
read_frames = read_bytes / audio_stream_in_frame_size(stream);
} else if (popcount(in->req_config.channel_mask) == 1 &&
@@ -1091,7 +1138,7 @@ static ssize_t in_read(struct audio_stream_in *stream, void *buffer, size_t byte
exit:
read_bytes = read_frames*audio_stream_in_frame_size(stream);
- if (mic_mute) {
+ if (read_mute) {
read_bytes = 0;
}
@@ -1192,8 +1239,6 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
pthread_cond_init(&out->worker_wake, NULL);
out->worker_standby = true;
out->worker_exit = false;
- pthread_create(&out->worker_thread, NULL, out_write_worker, out);
- set_shortened_thread_name(out->worker_thread, address);
out->enabled_channels = BOTH_CHANNELS;
// For targets where output streams are closed regularly, currently ducked/muted addresses
@@ -1219,6 +1264,8 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
out->bus_address, out->enabled_channels == RIGHT_CHANNEL ? "Right" : "Left");
}
}
+ pthread_create(&out->worker_thread, NULL, out_write_worker, out);
+ set_shortened_thread_name(out->worker_thread, address);
*stream_out = &out->stream;
ALOGD("%s bus: %s", __func__, out->bus_address);
}
diff --git a/emulator/audio/driver/ext_pcm.c b/emulator/audio/driver/ext_pcm.c
index 2b0e825..5bbc547 100644
--- a/emulator/audio/driver/ext_pcm.c
+++ b/emulator/audio/driver/ext_pcm.c
@@ -87,7 +87,7 @@ static void *mixer_thread_loop(void *context) {
int ret = pcm_write(ext_pcm->pcm, (void *)ext_pcm->mixer_pipeline.buffer,
ext_pcm->mixer_pipeline.position * sizeof(int16_t));
if (ret != 0) {
- ALOGE("%s error[%d] writing data to pcm");
+ ALOGE("%s error[%d] writing data to pcm", __func__, ret);
}
}
memset(&ext_pcm->mixer_pipeline, 0, sizeof(struct ext_mixer_pipeline));
diff --git a/emulator/car_emulator_product.mk b/emulator/car_emulator_product.mk
new file mode 100644
index 0000000..0f1c94a
--- /dev/null
+++ b/emulator/car_emulator_product.mk
@@ -0,0 +1,28 @@
+#
+# Copyright (C) 2022 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+$(call inherit-product, packages/services/Car/car_product/build/car_product.mk)
+
+# Runtime Resource Overlay for Connectivity
+PRODUCT_PACKAGES += \
+ CarConnectivityOverlay
+
+# Allowed packages per user type
+PRODUCT_COPY_FILES += \
+ device/generic/car/common/preinstalled-packages-product-car-emulator.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/sysconfig/preinstalled-packages-product-car-emulator.xml
+
+# TODO(b/253459812): find a better way to handle it.
+DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += \
+ device/generic/car/common/device_framework_matrix_product.xml
diff --git a/emulator/car_emulator_vendor.mk b/emulator/car_emulator_vendor.mk
new file mode 100644
index 0000000..3e32d4c
--- /dev/null
+++ b/emulator/car_emulator_vendor.mk
@@ -0,0 +1,141 @@
+#
+# Copyright (C) 2022 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+$(call inherit-product, packages/services/Car/car_product/build/car_vendor.mk)
+
+# Need this for gles libraries to load properly
+# after moving to /vendor/lib/
+PRODUCT_PACKAGES += \
+ vndk-sp
+
+DEVICE_PACKAGE_OVERLAYS := device/generic/goldfish/overlay
+
+PRODUCT_CHARACTERISTICS := emulator
+
+PRODUCT_FULL_TREBLE_OVERRIDE := true
+
+# Enable Google-specific location features,
+# like NetworkLocationProvider and LocationCollector
+PRODUCT_VENDOR_PROPERTIES += \
+ ro.com.google.locationfeatures=1
+
+# Enable setupwizard
+PRODUCT_VENDOR_PROPERTIES += \
+ ro.setupwizard.mode?=OPTIONAL
+
+# More configurations
+PRODUCT_VENDOR_PROPERTIES += \
+ ro.carwatchdog.client_healthcheck.interval=20 \
+ ro.carwatchdog.vhal_healthcheck.interval=10 \
+
+ifeq (,$(ENABLE_REAR_VIEW_CAMERA_SAMPLE))
+ENABLE_REAR_VIEW_CAMERA_SAMPLE:=true
+endif
+
+# Auto modules
+PRODUCT_PACKAGES += \
+ android.hardware.automotive.vehicle@V1-emulator-service \
+ android.hardware.broadcastradio-service.default \
+ android.hardware.audio.service-caremu \
+ android.hardware.automotive.remoteaccess@V1-default-service \
+ android.hardware.automotive.ivn@V1-default-service
+
+# Copy car_core_hardware and overwrite handheld_core_hardware.xml with a disable config.
+# Overwrite goldfish related xml with a disable config.
+PRODUCT_COPY_FILES += \
+ device/generic/car/common/android.hardware.disable.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml \
+ device/generic/car/common/car_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/car_core_hardware.xml \
+ device/generic/car/common/android.hardware.disable.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.ar.xml \
+ device/generic/car/common/android.hardware.disable.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.autofocus.xml \
+ device/generic/car/common/android.hardware.disable.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.concurrent.xml \
+ device/generic/car/common/android.hardware.disable.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.full.xml \
+ device/generic/car/common/android.hardware.disable.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \
+ device/generic/car/common/android.hardware.disable.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.any.xml \
+ device/generic/car/common/android.hardware.disable.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \
+ device/generic/car/common/android.hardware.disable.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.raw.xml \
+ device/generic/car/common/android.hardware.disable.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.fingerprint.xml \
+ device/generic/car/common/android.hardware.disable.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.direct.xml \
+
+# Overwrite goldfish fstab.ranchu to turn off adoptable_storage
+PRODUCT_COPY_FILES += \
+ device/generic/car/common/fstab.ranchu.car:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.ranchu
+
+# Enable landscape
+PRODUCT_COPY_FILES += \
+ frameworks/native/data/etc/android.hardware.screen.landscape.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.screen.landscape.xml
+
+# Used to embed a map in an activity view
+PRODUCT_COPY_FILES += \
+ frameworks/native/data/etc/android.software.activities_on_secondary_displays.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.activities_on_secondary_displays.xml
+
+# Permission for Wi-Fi passpoint support
+PRODUCT_COPY_FILES += \
+ frameworks/native/data/etc/android.hardware.wifi.passpoint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.passpoint.xml
+
+# Additional permissions
+PRODUCT_COPY_FILES += \
+ frameworks/native/data/etc/android.hardware.bluetooth_le.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth_le.xml \
+ frameworks/native/data/etc/android.hardware.bluetooth.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth.xml \
+ frameworks/native/data/etc/android.hardware.broadcastradio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.broadcastradio.xml \
+ frameworks/native/data/etc/android.hardware.type.automotive.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.type.automotive.xml \
+
+# Sensor features
+PRODUCT_COPY_FILES += \
+ frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \
+ frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope.xml \
+ frameworks/native/data/etc/android.hardware.sensor.accelerometer_limited_axes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer_limited_axes.xml \
+ frameworks/native/data/etc/android.hardware.sensor.gyroscope_limited_axes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope_limited_axes.xml \
+ 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 \
+ 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 \
+
+# Additional selinux policy
+BOARD_SEPOLICY_DIRS += device/generic/car/common/sepolicy
+
+# This overrides device/generic/car/common/car.mk
+$(call inherit-product, device/generic/car/emulator/audio/car_emulator_audio.mk)
+$(call inherit-product, device/generic/car/emulator/rotary/car_rotary.mk)
+# Enables USB related passthrough
+$(call inherit-product, device/generic/car/emulator/usbpt/car_usbpt.mk)
+
+# EVS
+# By default, we enable EvsManager, a sample EVS app, and a mock EVS HAL implementation.
+# If you want to use your own EVS HAL implementation, please set ENABLE_MOCK_EVSHAL as false
+# and add your HAL implementation to the product. Please also check init.evs.rc and see how
+# you can configure EvsManager to use your EVS HAL implementation. Similarly, please set
+# ENABLE_SAMPLE_EVS_APP as false if you want to use your own EVS app configuration or own EVS
+# app implementation.
+ENABLE_EVS_SAMPLE ?= false
+ENABLE_EVS_SERVICE ?= true
+ENABLE_MOCK_EVSHAL ?= true
+ENABLE_CAREVSSERVICE_SAMPLE ?= false
+ENABLE_SAMPLE_EVS_APP ?= false
+ENABLE_CARTELEMETRY_SERVICE ?= false
+ifeq ($(ENABLE_MOCK_EVSHAL), true)
+CUSTOMIZE_EVS_SERVICE_PARAMETER := true
+endif # ENABLE_MOCK_EVSHAL
+$(call inherit-product, device/generic/car/emulator/evs/evs.mk)
+
+ifeq ($(EMULATOR_DYNAMIC_MULTIDISPLAY_CONFIG),true)
+# This section configures multi-display without hardcoding the
+# displays on hwservicemanager.
+$(call inherit-product, device/generic/car/emulator/multi-display-dynamic/multi-display-dynamic.mk)
+else # EMULATOR_DYNAMIC_MULTIDISPLAY_CONFIG
+ifeq (true,$(BUILD_EMULATOR_CLUSTER_DISPLAY))
+$(call inherit-product, device/generic/car/emulator/cluster/cluster-hwservicemanager.mk)
+endif # BUILD_EMULATOR_CLUSTER_DISPLAY
+endif # EMULATOR_DYNAMIC_MULTIDISPLAY_CONFIG
+
+# Goldfish vendor partition configurations
+$(call inherit-product-if-exists, device/generic/goldfish/vendor.mk)
diff --git a/emulator/cluster/cluster-hwservicemanager.mk b/emulator/cluster/cluster-hwservicemanager.mk
new file mode 100644
index 0000000..718c1d3
--- /dev/null
+++ b/emulator/cluster/cluster-hwservicemanager.mk
@@ -0,0 +1,43 @@
+#
+# Copyright (C) 2022 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Add non-removable cluster by creating a display on hwservicemanager.
+PRODUCT_COPY_FILES += \
+ device/generic/car/emulator/cluster/display_settings.xml:$(TARGET_COPY_OUT_VENDOR)/etc/display_settings.xml \
+
+ifeq ($(EMULATOR_MULTIDISPLAY_HW_CONFIG),)
+PRODUCT_PRODUCT_PROPERTIES += \
+ hwservicemanager.external.displays=1,400,600,120,0 \
+ persist.service.bootanim.displays=8140900251843329
+else
+ifneq ($(EMULATOR_MULTIDISPLAY_BOOTANIM_CONFIG),)
+ PRODUCT_PRODUCT_PROPERTIES += \
+ hwservicemanager.external.displays=$(EMULATOR_MULTIDISPLAY_HW_CONFIG) \
+ persist.service.bootanim.displays=$(EMULATOR_MULTIDISPLAY_BOOTANIM_CONFIG)
+else # EMULATOR_MULTIDISPLAY_BOOTANIM_CONFIG
+$(error EMULATOR_MULTIDISPLAY_BOOTANIM_CONFIG has to be defined when EMULATOR_MULTIDISPLAY_BOOTANIM_CONFIG is defined)
+endif # EMULATOR_MULTIDISPLAY_BOOTANIM_CONFIG
+endif # EMULATOR_HW_MULTIDISPLAY_CONFIG
+
+ifeq (true,$(ENABLE_CLUSTER_OS_DOUBLE))
+PRODUCT_PACKAGES += ClusterHomeSampleOverlay CarServiceOverlayEmulatorOsDouble ClusterOsDoubleEmulatorPhysicalDisplayOverlay
+else
+PRODUCT_PACKAGES += CarServiceOverlayEmulator
+endif # ENABLE_CLUSTER_OS_DOUBLE
+
+# Disable dynamic multidisplay for emulators with display added by
+# hwservicemanager.
+EMULATOR_DYNAMIC_MULTIDISPLAY_CONFIG := false
+
diff --git a/emulator/cluster/display_settings.xml b/emulator/cluster/display_settings.xml
index 1014c59..e06053e 100644
--- a/emulator/cluster/display_settings.xml
+++ b/emulator/cluster/display_settings.xml
@@ -4,5 +4,5 @@
<config identifier="1" />
<!-- Display settings for cluster -->
- <display name="port:1" forcedDensity="120" dontMoveToTop="true" />
+ <display name="port:1" forcedDensity="160" dontMoveToTop="true" />
</display-settings>
diff --git a/emulator/cluster/rro_overlays/CarServiceOverlay/res/values/config.xml b/emulator/cluster/rro_overlays/CarServiceOverlay/res/values/config.xml
index 40f47eb..c77764d 100644
--- a/emulator/cluster/rro_overlays/CarServiceOverlay/res/values/config.xml
+++ b/emulator/cluster/rro_overlays/CarServiceOverlay/res/values/config.xml
@@ -24,22 +24,27 @@
occupant.
Some examples are:
- <item>displayPort=0,displayType=MAIN,occupantZoneId=0</item>
- <item>displayPort=1,displayType=INSTRUMENT_CLUSTER,occupantZoneId=0</item>
- <item>displayPort=2,displayType=MAIN,occupantZoneId=1</item>
- <item>displayPort=3,displayType=MAIN,occupantZoneId=2</item>
- <item>displayPort=4,displayType=MAIN,occupantZoneId=3</item>
+ <item>displayPort=0,displayType=MAIN,occupantZoneId=0,inputTypes=TOUCH_SCREEN|DPAD_KEYS|
+ NAVIGATE_KEYS|ROTARY_NAVIGATION</item>
+ <item>displayPort=1,displayType=INSTRUMENT_CLUSTER,occupantZoneId=0,
+ inputTypes=DPAD_KEYS</item>
+ <item>displayPort=2,displayType=MAIN,occupantZoneId=1,
+ inputTypes=NAVIGATE_KEYS</item>
+ <item>displayPort=3,displayType=MAIN,occupantZoneId=2,
+ inputTypes=NAVIGATE_KEYS</item>
+ <item>displayUniqueId=virtual:com.example:MainD,displayType=MAIN,occupantZoneId=3,
+ inputTypes=NAVIGATE_KEYS</item>
displayPort: Unique port id for the display.
displayType: Display type for the display. Use * part from
CarOccupantZoneManager.DISPLAY_TYPE_* like MAIN, INSTRUMENT_CLUSTER and
etc.
occupantZoneId: occupantZoneId specified from config_occupant_zones.
-
+ inputTypes: supported input types for the corresponding display.
-->
<string-array translatable="false" name="config_occupant_display_mapping">
- <item>displayPort=0,displayType=MAIN,occupantZoneId=0</item>
- <item>displayPort=1,displayType=INSTRUMENT_CLUSTER,occupantZoneId=0</item>
+ <item>displayPort=0,displayType=MAIN,occupantZoneId=0,inputTypes=TOUCH_SCREEN|DPAD_KEYS|NAVIGATE_KEYS|ROTARY_NAVIGATION</item>
+ <item>displayPort=1,displayType=INSTRUMENT_CLUSTER,occupantZoneId=0,inputTypes=DPAD_KEYS</item>
</string-array>
<!--
@@ -56,8 +61,8 @@
The default list defined below will enable all optional features defined.
-->
- <!-- TODO(b/205908527): this overlay is to temporarily disable CarEvsService by default. -->
<string-array translatable="false" name="config_allowed_optional_car_features">
+ <item>car_evs_service</item>
<item>car_navigation_service</item>
<item>cluster_service</item>
<item>com.android.car.user.CarUserNoticeService</item>
diff --git a/emulator/cluster/rro_overlays/CarServiceOverlay_MdNd/Android.bp b/emulator/cluster/rro_overlays/CarServiceOverlay_MdNd/Android.bp
new file mode 100644
index 0000000..9cff5fb
--- /dev/null
+++ b/emulator/cluster/rro_overlays/CarServiceOverlay_MdNd/Android.bp
@@ -0,0 +1,35 @@
+// Copyright (C) 2023 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+package {
+ default_applicable_licenses: ["device_generic_car_license"],
+}
+
+runtime_resource_overlay {
+ name: "CarServiceOverlayMdNdEmulator",
+ resource_dirs: ["res"],
+ manifest: "AndroidManifest.xml",
+ sdk_version: "current",
+ product_specific: true
+}
+
+override_runtime_resource_overlay {
+ name: "CarServiceOverlayMdNdEmulatorGoogle",
+ base: "CarServiceOverlayMdNdEmulator",
+ package_name: "com.google.android.car.resources.mdnd_emulator",
+ target_package_name: "com.google.android.car.updatable",
+}
+
diff --git a/emulator/cluster/rro_overlays/CarServiceOverlay_MdNd/AndroidManifest.xml b/emulator/cluster/rro_overlays/CarServiceOverlay_MdNd/AndroidManifest.xml
new file mode 100644
index 0000000..caf4090
--- /dev/null
+++ b/emulator/cluster/rro_overlays/CarServiceOverlay_MdNd/AndroidManifest.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2023 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.car.resources.mdnd_emulator">
+ <application android:hasCode="false"/>
+ <!-- priority should be higher than CarServiceOverlayMdEmulatorOsDouble -->
+ <overlay android:priority="5003"
+ android:targetPackage="com.android.car.updatable"
+ android:targetName="CarServiceCustomization"
+ android:resourcesMap="@xml/overlays"
+ android:isStatic="true" />
+</manifest>
+
diff --git a/emulator/cluster/rro_overlays/CarServiceOverlay_MdNd/res/values/config.xml b/emulator/cluster/rro_overlays/CarServiceOverlay_MdNd/res/values/config.xml
new file mode 100644
index 0000000..2182a64
--- /dev/null
+++ b/emulator/cluster/rro_overlays/CarServiceOverlay_MdNd/res/values/config.xml
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2023, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!-- Resources to configure car service based on each OEM's preference. -->
+<resources>
+ <!--
+ Lists all occupant zones available in the car.
+ Some examples are:
+ <item>occupantZoneId=0,occupantType=DRIVER,seatRow=1,seatSide=driver</item>
+ <item>occupantZoneId=1,occupantType=FRONT_PASSENGER,seatRow=1,seatSide=oppositeDriver</item>
+ <item>occupantZoneId=2,occupantType=REAR_PASSENGER,seatRow=2,seatSide=left</item>
+ <item>occupantZoneId=3,occupantType=REAR_PASSENGER,seatRow=2,seatSide=right</item>
+
+ occupantZoneId: Unique unsigned integer id to represent each passenger zone. Each zone
+ should have different id.
+ occupantType: Occupant type for the display. Use * part from
+ CarOccupantZoneManager.OCCUPANT_TYPE_* like DRIVER, FRONT_PASSENGER,
+ REAR_PASSENGER and etc.
+ seatRow: Integer telling which row the seat is located. Row 1 is for front seats.
+ seatSide: left/center/right for known side. Or can use driver/center/oppositeDriver to
+ handle both right-hand driving and left-hand driving in one place.
+ If car's RHD / LHD is not specified, LHD will be assumed and driver side becomes
+ left.
+ -->
+ <string-array translatable="false" name="config_occupant_zones">
+ <item>occupantZoneId=0,occupantType=FRONT_PASSENGER,seatRow=1,seatSide=driver</item>
+ <item>occupantZoneId=1,occupantType=FRONT_PASSENGER,seatRow=1,seatSide=oppositeDriver</item>
+ <item>occupantZoneId=2,occupantType=REAR_PASSENGER,seatRow=2,seatSide=left</item>
+ <item>occupantZoneId=3,occupantType=REAR_PASSENGER,seatRow=2,seatSide=right</item>
+ </string-array>
+
+ <!--
+ Specifies configuration of displays in system telling its usage / type and assigned
+ occupant.
+
+ Some examples are:
+ <item>displayPort=0,displayType=MAIN,occupantZoneId=0,inputTypes=TOUCH_SCREEN|DPAD_KEYS|NAVIGATE_KEYS|ROTARY_NAVIGATION</item>
+ <item>displayPort=1,displayType=INSTRUMENT_CLUSTER,occupantZoneId=0,inputTypes=DPAD_KEYS</item>
+ <item>displayPort=2,displayType=MAIN,occupantZoneId=1,inputTypes=TOUCH_SCREEN</item>
+ <item>displayPort=3,displayType=MAIN,occupantZoneId=2,inputTypes=TOUCH_SCREEN</item>
+ <item>displayPort=4,displayType=MAIN,occupantZoneId=3,inputTypes=TOUCH_SCREEN</item>
+
+ displayPort: Unique port id for the display.
+ displayType: Display type for the display. Use * part from
+ CarOccupantZoneManager.DISPLAY_TYPE_* like MAIN, INSTRUMENT_CLUSTER and
+ etc.
+ occupantZoneId: occupantZoneId specified from config_occupant_zones.
+
+ inputTypes: supported input types for the corresponding display.
+ -->
+ <string-array translatable="false" name="config_occupant_display_mapping">
+ <item>displayPort=0,displayType=MAIN,occupantZoneId=0,inputTypes=TOUCH_SCREEN|DPAD_KEYS|NAVIGATE_KEYS|ROTARY_NAVIGATION</item>
+ <item>displayUniqueId=virtual:com.android.car.cluster.osdouble:ClusterDisplay,displayType=INSTRUMENT_CLUSTER,occupantZoneId=0,inputTypes=DPAD_KEYS</item>
+ <item>displayPort=2,displayType=MAIN,occupantZoneId=1,inputTypes=TOUCH_SCREEN</item>
+ <item>displayPort=3,displayType=MAIN,occupantZoneId=2,inputTypes=TOUCH_SCREEN</item>
+ <item>displayPort=4,displayType=MAIN,occupantZoneId=3,inputTypes=TOUCH_SCREEN</item>
+ </string-array>
+
+ <!--
+ Specifies optional features that can be enabled by this image. Note that vhal can disable
+ them depending on product variation.
+ Feature name can be either service name defined in Car.*_SERVICE for Car*Manager or any
+ optional feature defined under @OptionalFeature annotation.
+ Note that '/' is used to have subfeature under main feature like "MAIN_FEATURE/SUB_FEATURE".
+
+ Some examples are:
+ <item>storage_monitoring</item>
+ <item>com.android.car.user.CarUserNoticeService</item>
+ <item>com.example.Feature/SubFeature</item>
+
+ The default list defined below will enable all optional features defined.
+ -->
+ <string-array translatable="false" name="config_allowed_optional_car_features">
+ <item>car_evs_service</item>
+ <item>car_navigation_service</item>
+ <item>car_occupant_connection_service</item>
+ <item>car_remote_device_service</item>
+ <item>cluster_home_service</item>
+ <item>com.android.car.user.CarUserNoticeService</item>
+ <item>diagnostic</item>
+ <item>storage_monitoring</item>
+ <item>vehicle_map_service</item>
+ <item>car_telemetry_service</item>
+ </string-array>
+
+ <!-- Enable profile user assignment per each CarOccupantZone for per display android user
+ assignments. This feature is still experimental. -->
+ <bool name="enableProfileUserAssignmentForMultiDisplay" translatable="false">true</bool>
+
+ <!-- The services that need to be started earlier in the boot sequence and in particular order.
+ Every item in this array contains a flatten component name of a service that needs to be
+ started and a list of parameters after hashtag symbol. Here's the format:
+
+ <item>com.bar.foo/.Service#bind={bind|start|startForeground},user={all|system|foreground},
+ trigger={asap,userUnlocked}</item>
+
+ bind: bind - start service with Context#bindService
+ start - start service with Context#startService
+ startForeground - start service with Context#startForegroundService
+ If service was bound it will be restarted unless it is constantly crashing.
+ The default value is 'start'
+ user: all - the service will be bound/started for system and all foreground users
+ system - the service will be started/bound only for system user (u0)
+ foreground - the service will be bound/started only for foreground users
+ backgroundVisible - the service will be bound/started only for background users that
+ are visible.
+ The default value is 'all'
+ trigger: indicates when the service needs to be started/bound
+ asap - the service might be bound when user is not fully loaded, be careful with
+ this value, the service also needs to have directBootAware flag set to true
+ userUnlocked - start service when user unlocked the device
+ The default value is 'userUnlocked'
+
+ If the service bound/started for foreground user it will be unbound/stopped when user
+ is no longer foreground.
+ -->
+ <string-array translatable="false" name="config_earlyStartupServices">
+ <item>com.android.car.messenger/.MessengerService#bind=startForeground,user=foreground,trigger=userUnlocked</item>
+ <item>com.google.android.companiondevicesupport/com.google.android.connecteddevice.service.ConnectedDeviceService#bind=bind,user=system,trigger=asap</item>
+ <item>com.google.android.companiondevicesupport/com.google.android.connecteddevice.service.ConnectedDeviceFgUserService#bind=bind,user=foreground,trigger=asap</item>
+ <!-- Starting Android Auto receiver service earlier for wireless projection. -->
+ <item>com.google.android.embedded.projection/com.google.android.apps.auto.aareceiver.service.PersistentService#bind=bind,user=foreground,trigger=userUnlocked</item>
+
+ <!-- eGMM Vehicle Map Service Provider -->
+ <item>com.google.android.apps.maps/com.google.android.apps.geo.autograph.vms.platform.car.CarVmsPublisherClientService#bind=bind,user=foreground,trigger=userUnlocked</item>
+
+ <!-- OEM Custom Input Reference Service -->
+ <item>com.android.car.custominput.sample/.SampleCustomInputService#bind=bind,user=foreground,trigger=userUnlocked</item>
+
+ <!-- Car Telemetry Collector Service -->
+ <item>com.android.car.cartelemetryapp/.CarMetricsCollectorService#bind=bind,user=system,trigger=asap</item>
+
+ <!-- GSR Failover service to facilitate the publishing of speed limit information when eGMM is unable to do so -->
+ <item>com.google.android.apps.geo.automotive.adas/.failover.FailoverControllerService#bind=bind,user=foreground,trigger=userUnlocked</item>
+
+ <!-- The service responsible for starting/stopping the Cast receiver. -->
+ <item>com.android.car.castreceiver/.AutomotiveCastReceiverService#bind=bind,user=foreground,trigger=userUnlocked</item>
+ <!-- Early start service for Multi-display Control Center app -->
+ <item>com.android.car.multidisplay.controlcenter/com.android.car.multidisplay.controlcenter.service.ControlCenterService#bind=bind,user=backgroundVisible,trigger=userPostUnlocked</item>
+ </string-array>
+</resources>
diff --git a/emulator/cluster/rro_overlays/CarServiceOverlay_MdNd/res/xml/car_ux_restrictions_map.xml b/emulator/cluster/rro_overlays/CarServiceOverlay_MdNd/res/xml/car_ux_restrictions_map.xml
new file mode 100644
index 0000000..337b63a
--- /dev/null
+++ b/emulator/cluster/rro_overlays/CarServiceOverlay_MdNd/res/xml/car_ux_restrictions_map.xml
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2023, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<UxRestrictions xmlns:car="http://schemas.android.com/apk/res-auto">
+ <!-- Map the driving states to UX restrictions here -->
+ <!-- Note - The platform takes a fully restricted approach when there is no information or if
+ the information is malformed. As a result,
+ 1. Default values for requiresDistractionOptimization is true, and uxr is fully_restricted.
+ 2. If uxr != baseline, then requiresDistractionOptimization is automatically promoted to true,
+ even if it is declared as false. Because it doesn't make sense to have an non baseline UX
+ restriction without requiresDistractionOptimization set to true.
+ So if we don't want any restrictions, requiresDistractionOptimization should be explicitly
+ marked as false and uxr should be explicitly set to baseline. -->
+
+ <!--Setting baseline restrictions for all displays as this is a passenger only system-->
+ <RestrictionMapping physicalPort="0">
+ <DrivingState state="parked">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="idling">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="moving">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ </RestrictionMapping>
+
+ <RestrictionMapping physicalPort="2">
+ <DrivingState state="parked">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="idling">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="moving">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ </RestrictionMapping>
+
+ <RestrictionMapping physicalPort="3">
+ <DrivingState state="parked">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="idling">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="moving">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ </RestrictionMapping>
+
+ <RestrictionMapping physicalPort="4">
+ <DrivingState state="parked">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="idling">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="moving">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ </RestrictionMapping>
+
+ <!-- Configure restriction parameters here-->
+ <RestrictionParameters>
+ <!-- Parameters to express displayed String related restrictions -->
+ <!-- Max allowed length of general purpose strings when limit_string_length is imposed-->
+ <StringRestrictions maxLength="120"/>
+ <!-- Parameters to express content related restrictions -->
+ <!-- Max number of cumulative content items allowed to be displayed when
+ limit_content is imposed. -->
+ <!-- Maximum levels deep that the user can navigate to when limit_content is imposed. -->
+ <ContentRestrictions maxCumulativeItems="21" maxDepth="3"/>
+ </RestrictionParameters>
+
+</UxRestrictions>
diff --git a/emulator/cluster/rro_overlays/CarServiceOverlay_MdNd/res/xml/overlays.xml b/emulator/cluster/rro_overlays/CarServiceOverlay_MdNd/res/xml/overlays.xml
new file mode 100644
index 0000000..b0018f2
--- /dev/null
+++ b/emulator/cluster/rro_overlays/CarServiceOverlay_MdNd/res/xml/overlays.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2023 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<overlay>
+ <item target="array/config_occupant_zones" value="@array/config_occupant_zones" />
+ <item target="array/config_occupant_display_mapping" value="@array/config_occupant_display_mapping" />
+ <item target="array/config_allowed_optional_car_features" value="@array/config_allowed_optional_car_features" />
+ <item target="bool/enableProfileUserAssignmentForMultiDisplay" value="@bool/enableProfileUserAssignmentForMultiDisplay" />
+ <item target="array/config_earlyStartupServices" value="@array/config_earlyStartupServices" />
+ <item target="xml/car_ux_restrictions_map" value="@xml/car_ux_restrictions_map" />
+</overlay>
diff --git a/emulator/cluster/rro_overlays/CarServiceOverlay_MdOsDouble/Android.bp b/emulator/cluster/rro_overlays/CarServiceOverlay_MdOsDouble/Android.bp
new file mode 100644
index 0000000..db30649
--- /dev/null
+++ b/emulator/cluster/rro_overlays/CarServiceOverlay_MdOsDouble/Android.bp
@@ -0,0 +1,34 @@
+// Copyright (C) 2022 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+package {
+ default_applicable_licenses: ["device_generic_car_license"],
+}
+
+runtime_resource_overlay {
+ name: "CarServiceOverlayMdEmulatorOsDouble",
+ resource_dirs: ["res"],
+ manifest: "AndroidManifest.xml",
+ sdk_version: "current",
+ product_specific: true
+}
+
+override_runtime_resource_overlay {
+ name: "CarServiceOverlayMdEmulatorOsDoubleGoogle",
+ base: "CarServiceOverlayMdEmulatorOsDouble",
+ package_name: "com.google.android.car.resources.md_emulator.osdouble",
+ target_package_name: "com.google.android.car.updatable",
+}
diff --git a/emulator/cluster/rro_overlays/CarServiceOverlay_MdOsDouble/AndroidManifest.xml b/emulator/cluster/rro_overlays/CarServiceOverlay_MdOsDouble/AndroidManifest.xml
new file mode 100644
index 0000000..7795c0b
--- /dev/null
+++ b/emulator/cluster/rro_overlays/CarServiceOverlay_MdOsDouble/AndroidManifest.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2022 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.car.resources.md_emulator.osdouble">
+ <application android:hasCode="false"/>
+ <!-- priority should be higher than CarServiceOverlayEmulatorOsDouble -->
+ <overlay android:priority="5002"
+ android:targetPackage="com.android.car.updatable"
+ android:targetName="CarServiceCustomization"
+ android:resourcesMap="@xml/overlays"
+ android:isStatic="true" />
+</manifest>
diff --git a/emulator/cluster/rro_overlays/CarServiceOverlay_MdOsDouble/res/values/config.xml b/emulator/cluster/rro_overlays/CarServiceOverlay_MdOsDouble/res/values/config.xml
new file mode 100644
index 0000000..d88c016
--- /dev/null
+++ b/emulator/cluster/rro_overlays/CarServiceOverlay_MdOsDouble/res/values/config.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2022, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!-- Resources to configure car service based on each OEM's preference. -->
+<resources>
+ <!--
+ Lists all occupant (= driver + passenger) zones available in the car.
+ Some examples are:
+ <item>occupantZoneId=0,occupantType=DRIVER,seatRow=1,seatSide=driver</item>
+ <item>occupantZoneId=1,occupantType=FRONT_PASSENGER,seatRow=1,seatSide=oppositeDriver</item>
+ <item>occupantZoneId=2,occupantType=REAR_PASSENGER,seatRow=2,seatSide=left</item>
+ <item>occupantZoneId=3,occupantType=REAR_PASSENGER,seatRow=2,seatSide=right</item>
+
+ occupantZoneId: Unique unsigned integer id to represent each passenger zone. Each zone
+ should have different id.
+ occupantType: Occupant type for the display. Use * part from
+ CarOccupantZoneManager.OCCUPANT_TYPE_* like DRIVER, FRONT_PASSENGER,
+ REAR_PASSENGER and etc.
+ seatRow: Integer telling which row the seat is located. Row 1 is for front seats.
+ seatSide: left/center/right for known side. Or can use driver/center/oppositeDriver to
+ handle both right-hand driving and left-hand driving in one place.
+ If car's RHD / LHD is not specified, LHD will be assumed and driver side becomes
+ left.
+ -->
+ <string-array translatable="false" name="config_occupant_zones">
+ <item>occupantZoneId=0,occupantType=DRIVER,seatRow=1,seatSide=driver</item>
+ <item>occupantZoneId=1,occupantType=FRONT_PASSENGER,seatRow=1,seatSide=oppositeDriver</item>
+ <item>occupantZoneId=2,occupantType=REAR_PASSENGER,seatRow=2,seatSide=left</item>
+ <item>occupantZoneId=3,occupantType=REAR_PASSENGER,seatRow=2,seatSide=right</item>
+ </string-array>
+
+ <!--
+ Specifies configuration of displays in system telling its usage / type and assigned
+ occupant.
+
+ Some examples are:
+ <item>displayPort=0,displayType=MAIN,occupantZoneId=0,inputTypes=TOUCH_SCREEN|DPAD_KEYS|NAVIGATE_KEYS|ROTARY_NAVIGATION</item>
+ <item>displayPort=1,displayType=INSTRUMENT_CLUSTER,occupantZoneId=0,inputTypes=DPAD_KEYS</item>
+ <item>displayPort=2,displayType=MAIN,occupantZoneId=1,inputTypes=TOUCH_SCREEN</item>
+ <item>displayPort=3,displayType=MAIN,occupantZoneId=2,inputTypes=TOUCH_SCREEN</item>
+ <item>displayPort=4,displayType=MAIN,occupantZoneId=3,inputTypes=TOUCH_SCREEN</item>
+
+ displayPort: Unique port id for the display.
+ displayType: Display type for the display. Use * part from
+ CarOccupantZoneManager.DISPLAY_TYPE_* like MAIN, INSTRUMENT_CLUSTER and
+ etc.
+ occupantZoneId: occupantZoneId specified from config_occupant_zones.
+
+ inputTypes: supported input types for the corresponding display.
+ -->
+ <string-array translatable="false" name="config_occupant_display_mapping">
+ <item>displayPort=0,displayType=MAIN,occupantZoneId=0,inputTypes=TOUCH_SCREEN|DPAD_KEYS|NAVIGATE_KEYS|ROTARY_NAVIGATION</item>
+ <item>displayUniqueId=virtual:com.android.car.cluster.osdouble:ClusterDisplay,displayType=INSTRUMENT_CLUSTER,occupantZoneId=0,inputTypes=DPAD_KEYS</item>
+ <item>displayPort=2,displayType=MAIN,occupantZoneId=1,inputTypes=TOUCH_SCREEN</item>
+ <item>displayPort=3,displayType=MAIN,occupantZoneId=2,inputTypes=TOUCH_SCREEN</item>
+ <item>displayPort=4,displayType=MAIN,occupantZoneId=3,inputTypes=TOUCH_SCREEN</item>
+ </string-array>
+
+ <!--
+ Specifies optional features that can be enabled by this image. Note that vhal can disable
+ them depending on product variation.
+ Feature name can be either service name defined in Car.*_SERVICE for Car*Manager or any
+ optional feature defined under @OptionalFeature annotation.
+ Note that '/' is used to have subfeature under main feature like "MAIN_FEATURE/SUB_FEATURE".
+
+ Some examples are:
+ <item>storage_monitoring</item>
+ <item>com.android.car.user.CarUserNoticeService</item>
+ <item>com.example.Feature/SubFeature</item>
+
+ The default list defined below will enable all optional features defined.
+ -->
+ <string-array translatable="false" name="config_allowed_optional_car_features">
+ <item>car_evs_service</item>
+ <item>car_navigation_service</item>
+ <item>car_occupant_connection_service</item>
+ <item>car_remote_device_service</item>
+ <item>cluster_home_service</item>
+ <item>com.android.car.user.CarUserNoticeService</item>
+ <item>diagnostic</item>
+ <item>storage_monitoring</item>
+ <item>vehicle_map_service</item>
+ <item>car_telemetry_service</item>
+ </string-array>
+
+ <!-- Enable profile user assignment per each CarOccupantZone for per display android user
+ assignments. This feature is still experimental. -->
+ <bool name="enableProfileUserAssignmentForMultiDisplay" translatable="false">true</bool>
+</resources>
diff --git a/emulator/cluster/rro_overlays/CarServiceOverlay_MdOsDouble/res/xml/car_ux_restrictions_map.xml b/emulator/cluster/rro_overlays/CarServiceOverlay_MdOsDouble/res/xml/car_ux_restrictions_map.xml
new file mode 100644
index 0000000..018c3fe
--- /dev/null
+++ b/emulator/cluster/rro_overlays/CarServiceOverlay_MdOsDouble/res/xml/car_ux_restrictions_map.xml
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<UxRestrictions xmlns:car="http://schemas.android.com/apk/res-auto">
+ <!-- Map the driving states to UX restrictions here -->
+ <!-- Note - The platform takes a fully restricted approach when there is no information or if
+ the information is malformed. As a result,
+ 1. Default values for requiresDistractionOptimization is true, and uxr is fully_restricted.
+ 2. If uxr != baseline, then requiresDistractionOptimization is automatically promoted to true,
+ even if it is declared as false. Because it doesn't make sense to have an non baseline UX
+ restriction without requiresDistractionOptimization set to true.
+ So if we don't want any restrictions, requiresDistractionOptimization should be explicitly
+ marked as false and uxr should be explicitly set to baseline. -->
+
+ <RestrictionMapping physicalPort="0">
+ <DrivingState state="parked">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="idling">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline" mode="baseline"/>
+ </DrivingState>
+
+ <!-- This is restrictions for moving and speed [0,5m/s) -->
+ <DrivingState state="moving" minSpeed="0" maxSpeed="5.0">
+ <Restrictions requiresDistractionOptimization="true" uxr="no_dialpad|no_filtering|limit_string_length|no_keyboard|no_video|limit_content|no_setup|no_text_message"/>
+ </DrivingState>
+
+ <!-- Restrictions for speed >=5 -->
+ <DrivingState state="moving" minSpeed="5.0">
+ <Restrictions requiresDistractionOptimization="true" uxr="no_dialpad|no_filtering|limit_string_length|no_keyboard|no_video|limit_content|no_setup|no_text_message"/>
+ </DrivingState>
+
+ </RestrictionMapping>
+
+ <!--Setting baseline restrictions for all passenger displays -->
+ <RestrictionMapping physicalPort="2">
+ <DrivingState state="parked">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="idling">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="moving">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ </RestrictionMapping>
+
+ <RestrictionMapping physicalPort="3">
+ <DrivingState state="parked">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="idling">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="moving">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ </RestrictionMapping>
+
+ <RestrictionMapping physicalPort="4">
+ <DrivingState state="parked">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="idling">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="moving">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ </RestrictionMapping>
+
+ <!-- Configure restriction parameters here-->
+ <RestrictionParameters>
+ <!-- Parameters to express displayed String related restrictions -->
+ <!-- Max allowed length of general purpose strings when limit_string_length is imposed-->
+ <StringRestrictions maxLength="120"/>
+ <!-- Parameters to express content related restrictions -->
+ <!-- Max number of cumulative content items allowed to be displayed when
+ limit_content is imposed. -->
+ <!-- Maximum levels deep that the user can navigate to when limit_content is imposed. -->
+ <ContentRestrictions maxCumulativeItems="21" maxDepth="3"/>
+ </RestrictionParameters>
+
+</UxRestrictions>
+
diff --git a/emulator/cluster/rro_overlays/CarServiceOverlay_MdOsDouble/res/xml/overlays.xml b/emulator/cluster/rro_overlays/CarServiceOverlay_MdOsDouble/res/xml/overlays.xml
new file mode 100644
index 0000000..290c9db
--- /dev/null
+++ b/emulator/cluster/rro_overlays/CarServiceOverlay_MdOsDouble/res/xml/overlays.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2022 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<overlay>
+ <item target="array/config_occupant_zones" value="@array/config_occupant_zones" />
+ <item target="array/config_occupant_display_mapping" value="@array/config_occupant_display_mapping" />
+ <item target="array/config_allowed_optional_car_features" value="@array/config_allowed_optional_car_features" />
+ <item target="bool/enableProfileUserAssignmentForMultiDisplay" value="@bool/enableProfileUserAssignmentForMultiDisplay" />
+ <item target="xml/car_ux_restrictions_map" value="@xml/car_ux_restrictions_map" />
+</overlay>
diff --git a/emulator/cluster/rro_overlays/CarServiceOverlay_OsDouble/res/values/config.xml b/emulator/cluster/rro_overlays/CarServiceOverlay_OsDouble/res/values/config.xml
index 08ecf4b..ca59963 100644
--- a/emulator/cluster/rro_overlays/CarServiceOverlay_OsDouble/res/values/config.xml
+++ b/emulator/cluster/rro_overlays/CarServiceOverlay_OsDouble/res/values/config.xml
@@ -24,22 +24,22 @@
occupant.
Some examples are:
- <item>displayPort=0,displayType=MAIN,occupantZoneId=0</item>
- <item>displayPort=1,displayType=INSTRUMENT_CLUSTER,occupantZoneId=0</item>
- <item>displayPort=2,displayType=MAIN,occupantZoneId=1</item>
- <item>displayPort=3,displayType=MAIN,occupantZoneId=2</item>
- <item>displayPort=4,displayType=MAIN,occupantZoneId=3</item>
+ <item>displayPort=0,displayType=MAIN,occupantZoneId=0,inputTypes=TOUCH_SCREEN|DPAD_KEYS|NAVIGATE_KEYS|ROTARY_NAVIGATION</item>
+ <item>displayPort=1,displayType=INSTRUMENT_CLUSTER,occupantZoneId=0,inputTypes=DPAD_KEYS</item>
+ <item>displayPort=2,displayType=MAIN,occupantZoneId=1,inputTypes=TOUCH_SCREEN</item>
+ <item>displayPort=3,displayType=MAIN,occupantZoneId=2,inputTypes=TOUCH_SCREEN</item>
+ <item>displayPort=4,displayType=MAIN,occupantZoneId=3,inputTypes=TOUCH_SCREEN</item>
displayPort: Unique port id for the display.
displayType: Display type for the display. Use * part from
CarOccupantZoneManager.DISPLAY_TYPE_* like MAIN, INSTRUMENT_CLUSTER and
etc.
occupantZoneId: occupantZoneId specified from config_occupant_zones.
-
+ inputTypes: supported input types for the corresponding display.
-->
<string-array translatable="false" name="config_occupant_display_mapping">
- <item>displayPort=0,displayType=MAIN,occupantZoneId=0</item>
- <item>displayUniqueId=virtual:com.android.car.cluster.osdouble:ClusterDisplay,displayType=INSTRUMENT_CLUSTER,occupantZoneId=0</item>
+ <item>displayPort=0,displayType=MAIN,occupantZoneId=0,inputTypes=TOUCH_SCREEN|DPAD_KEYS|NAVIGATE_KEYS|ROTARY_NAVIGATION</item>
+ <item>displayUniqueId=virtual:com.android.car.cluster.osdouble:ClusterDisplay,displayType=INSTRUMENT_CLUSTER,occupantZoneId=0,inputTypes=DPAD_KEYS</item>
</string-array>
<!--
@@ -57,8 +57,8 @@
The default list defined below will enable all optional features defined.
-->
<!-- Override cluster_service with cluster_home_service. -->
- <!-- TODO(b/205908527): this overlay is to temporarily disable CarEvsService by default. -->
<string-array translatable="false" name="config_allowed_optional_car_features">
+ <item>car_evs_service</item>
<item>car_navigation_service</item>
<item>cluster_home_service</item>
<item>com.android.car.user.CarUserNoticeService</item>
diff --git a/emulator/evs/evs.mk b/emulator/evs/evs.mk
new file mode 100644
index 0000000..bc013ac
--- /dev/null
+++ b/emulator/evs/evs.mk
@@ -0,0 +1,42 @@
+#
+# Copyright (C) 2022 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+PRODUCT_PACKAGES += CarEvsServiceOverlay
+
+ifeq ($(ENABLE_MOCK_EVSHAL), true)
+CUSTOMIZE_EVS_SERVICE_PARAMETER := true
+PRODUCT_PACKAGES += \
+ android.hardware.automotive.evs-aidl-default-service
+
+# TODO(b/277389752): Below line should be removed when AAOS baseline is fully supported.
+PRODUCT_PACKAGES += cardisplayproxyd
+
+# EVS HAL implementation for the emulators requires AIDL version of the automotive display
+# service implementation.
+USE_AIDL_DISPLAY_SERVICE := true
+
+PRODUCT_COPY_FILES += \
+ device/generic/car/emulator/evs/init.evs.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.evs.rc
+endif
+
+ifeq ($(ENABLE_SAMPLE_EVS_APP), true)
+PRODUCT_COPY_FILES += \
+ device/generic/car/emulator/evs/evs_app_config.json:$(TARGET_COPY_OUT_VENDOR)/etc/automotive/evs/config_override.json
+ifneq ($(ENABLE_EVS_SAMPLE), true)
+# We need to add evs_app package and its selinux policy if ENABLE_EVS_SAMPLE is not set as true.
+PRODUCT_PACKAGES += evs_app
+$(call inherit-product, packages/services/Car/cpp/evs/apps/sepolicy/evsapp.mk)
+endif # ENABLE_EVS_SAMPLE
+endif # ENABLE_SAMPLE_EVS_APP
diff --git a/emulator/evs/evs_app_config.json b/emulator/evs/evs_app_config.json
new file mode 100644
index 0000000..bf0c5c4
--- /dev/null
+++ b/emulator/evs/evs_app_config.json
@@ -0,0 +1,55 @@
+{
+ "car" : {
+ "width" : 76.7,
+ "wheelBase" : 117.9,
+ "frontExtent" : 44.7,
+ "rearExtent" : 40
+ },
+ "displays" : [
+ {
+ "_comment": "Display0",
+ "displayPort" : 0,
+ "frontRange" : 100,
+ "rearRange" : 100
+ },
+ {
+ "_comment": "Display1",
+ "displayPort" : 1,
+ "frontRange" : 100,
+ "rearRange" : 100
+ },
+ {
+ "_comment": "Display2",
+ "displayPort" : 2,
+ "frontRange" : 100,
+ "rearRange" : 100
+ },
+ {
+ "_comment": "Display3",
+ "displayPort" : 3,
+ "frontRange" : 100,
+ "rearRange" : 100
+ }
+
+ ],
+ "graphic" : {
+ "frontPixel" : -20,
+ "rearPixel" : 260
+ },
+ "cameras" : [
+ {
+ "cameraId" : "/dev/video10",
+ "function" : "reverse",
+ "x" : 0.0,
+ "y" : 20.0,
+ "z" : 48,
+ "yaw" : 180,
+ "pitch" : -10,
+ "roll" : 0,
+ "hfov" : 115,
+ "vfov" : 80,
+ "hflip" : true,
+ "vflip" : false
+ }
+ ]
+}
diff --git a/emulator/evs/init.evs.rc b/emulator/evs/init.evs.rc
new file mode 100644
index 0000000..d0b997a
--- /dev/null
+++ b/emulator/evs/init.evs.rc
@@ -0,0 +1,20 @@
+on late-init
+ start cardisplayproxyd
+ start vendor.evs-hal-cf
+ start evs_manager_cf
+
+service evs_manager_cf /system/bin/evsmanagerd --target hw/0
+ class hal
+ priority -20
+ user automotive_evs
+ group automotive_evs system
+ disabled # will not automatically start with its class; must be explicitly started.
+
+service vendor.evs-hal-cf /vendor/bin/hw/android.hardware.automotive.evs-aidl-default-service
+ class hal
+ priority -20
+ user graphics
+ group automotive_evs camera
+ onrestart restart cardisplayproxyd
+ onrestart restart evs_manager_cf
+ disabled # will not automatically start with its class; must be explicitly started.
diff --git a/emulator/evs/rro_overlays/CarEvsServiceOverlay/Android.bp b/emulator/evs/rro_overlays/CarEvsServiceOverlay/Android.bp
new file mode 100644
index 0000000..a86dcd4
--- /dev/null
+++ b/emulator/evs/rro_overlays/CarEvsServiceOverlay/Android.bp
@@ -0,0 +1,27 @@
+// Copyright (C) 2022 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+package {
+ default_applicable_licenses: ["device_generic_car_license"],
+}
+
+runtime_resource_overlay {
+ name: "CarEvsServiceOverlay",
+ resource_dirs: ["res"],
+ manifest: "AndroidManifest.xml",
+ sdk_version: "current",
+ product_specific: true
+}
diff --git a/emulator/evs/rro_overlays/CarEvsServiceOverlay/AndroidManifest.xml b/emulator/evs/rro_overlays/CarEvsServiceOverlay/AndroidManifest.xml
new file mode 100644
index 0000000..cfdf768
--- /dev/null
+++ b/emulator/evs/rro_overlays/CarEvsServiceOverlay/AndroidManifest.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2022 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.car.resources.carevsservice">
+ <application android:hasCode="false"/>
+ <overlay android:targetPackage="com.android.car.updatable"
+ android:targetName="CarServiceCustomization"
+ android:resourcesMap="@xml/overlays"
+ android:isStatic="false" />
+</manifest>
diff --git a/emulator/evs/rro_overlays/CarEvsServiceOverlay/res/values/config.xml b/emulator/evs/rro_overlays/CarEvsServiceOverlay/res/values/config.xml
new file mode 100644
index 0000000..55a57df
--- /dev/null
+++ b/emulator/evs/rro_overlays/CarEvsServiceOverlay/res/values/config.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2022, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!-- Resources to configure car service based on each OEM's preference. -->
+<resources>
+ <!-- A name of a camera device that provides the rearview through EVS service -->
+ <string translatable="false" name="config_evsRearviewCameraId">/dev/video10</string>
+
+ <!-- The camera Activity name for EVS, if defined, the Activity will be launched by
+ CarEvsService. -->
+ <string name="config_evsCameraActivity" translatable="false">
+ com.google.android.car.evs/com.google.android.car.evs.CarEvsCameraPreviewActivity
+ </string>
+</resources>
diff --git a/emulator/evs/rro_overlays/CarEvsServiceOverlay/res/xml/overlays.xml b/emulator/evs/rro_overlays/CarEvsServiceOverlay/res/xml/overlays.xml
new file mode 100644
index 0000000..66272b6
--- /dev/null
+++ b/emulator/evs/rro_overlays/CarEvsServiceOverlay/res/xml/overlays.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2022 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<overlay>
+ <item target="string/config_evsRearviewCameraId" value="@string/config_evsRearviewCameraId" />
+ <item target="string/config_evsCameraActivity" value="@string/config_evsCameraActivity" />
+</overlay>
diff --git a/emulator/media/rro_overlay/CarServiceOverlay/Android.bp b/emulator/media/rro_overlay/CarServiceOverlay/Android.bp
new file mode 100644
index 0000000..292373c
--- /dev/null
+++ b/emulator/media/rro_overlay/CarServiceOverlay/Android.bp
@@ -0,0 +1,34 @@
+// Copyright (C) 2023 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+package {
+ default_applicable_licenses: ["device_generic_car_license"],
+}
+
+runtime_resource_overlay {
+ name: "CarServiceOverlayEmulatorMedia",
+ resource_dirs: ["res"],
+ manifest: "AndroidManifest.xml",
+ sdk_version: "current",
+ product_specific: true
+}
+
+override_runtime_resource_overlay {
+ name: "CarServiceOverlayEmulatorMediaGoogle",
+ base: "CarServiceOverlayEmulatorMedia",
+ package_name: "com.google.android.car.resources.emulator.media",
+ target_package_name: "com.google.android.car.updatable",
+}
diff --git a/emulator/media/rro_overlay/CarServiceOverlay/AndroidManifest.xml b/emulator/media/rro_overlay/CarServiceOverlay/AndroidManifest.xml
new file mode 100644
index 0000000..d4620fd
--- /dev/null
+++ b/emulator/media/rro_overlay/CarServiceOverlay/AndroidManifest.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2023 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.car.resources.emulator.media">
+ <application android:hasCode="false"/>
+ <overlay android:priority="5001"
+ android:targetPackage="com.android.car.updatable"
+ android:targetName="CarServiceCustomization"
+ android:resourcesMap="@xml/overlays"
+ android:isStatic="true" />
+</manifest>
diff --git a/emulator/media/rro_overlay/CarServiceOverlay/res/values/config.xml b/emulator/media/rro_overlay/CarServiceOverlay/res/values/config.xml
new file mode 100644
index 0000000..ec39832
--- /dev/null
+++ b/emulator/media/rro_overlay/CarServiceOverlay/res/values/config.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2023, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!-- Resources to configure car service based on each OEM's preference. -->
+<resources>
+ <!-- The ComponentName of the media source that will be selected as the default -->
+ <string name="config_defaultMediaSource">com.android.car.media.localmediaplayer/.LocalMediaBrowserService</string>
+</resources>
diff --git a/emulator/media/rro_overlay/CarServiceOverlay/res/xml/overlays.xml b/emulator/media/rro_overlay/CarServiceOverlay/res/xml/overlays.xml
new file mode 100644
index 0000000..c605422
--- /dev/null
+++ b/emulator/media/rro_overlay/CarServiceOverlay/res/xml/overlays.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2023 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<overlay>
+ <item target="string/config_defaultMediaSource" value="@string/config_defaultMediaSource" />
+</overlay>
diff --git a/emulator/multi-display-dynamic/CarServiceMultiDisplayOverlayEmulator/Android.bp b/emulator/multi-display-dynamic/CarServiceMultiDisplayOverlayEmulator/Android.bp
new file mode 100644
index 0000000..85d14f3
--- /dev/null
+++ b/emulator/multi-display-dynamic/CarServiceMultiDisplayOverlayEmulator/Android.bp
@@ -0,0 +1,27 @@
+// Copyright (C) 2022 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+package {
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+runtime_resource_overlay {
+ name: "CarServiceMultiDisplayOverlayEmulator",
+ resource_dirs: ["res"],
+ manifest: "AndroidManifest.xml",
+ sdk_version: "current",
+ product_specific: true
+}
diff --git a/emulator/multi-display-dynamic/CarServiceMultiDisplayOverlayEmulator/AndroidManifest.xml b/emulator/multi-display-dynamic/CarServiceMultiDisplayOverlayEmulator/AndroidManifest.xml
new file mode 100644
index 0000000..692ed91
--- /dev/null
+++ b/emulator/multi-display-dynamic/CarServiceMultiDisplayOverlayEmulator/AndroidManifest.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2022 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.car.resources.goldfish">
+ <application android:hasCode="false"/>
+ <overlay android:priority="5001"
+ android:targetPackage="com.android.car.updatable"
+ android:targetName="CarServiceCustomization"
+ android:resourcesMap="@xml/overlays"
+ android:isStatic="true" />
+</manifest> \ No newline at end of file
diff --git a/emulator/multi-display-dynamic/CarServiceMultiDisplayOverlayEmulator/res/values/config.xml b/emulator/multi-display-dynamic/CarServiceMultiDisplayOverlayEmulator/res/values/config.xml
new file mode 100644
index 0000000..8463455
--- /dev/null
+++ b/emulator/multi-display-dynamic/CarServiceMultiDisplayOverlayEmulator/res/values/config.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2022, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!--
+ Overlay resources to configure car service based on each OEM's preference.
+ See also packages/services/Car/service/res/values/config.xml
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- Assign occupant zones to seats/passengers. -->
+ <string-array translatable="false" name="config_occupant_zones">
+ <item>occupantZoneId=0,occupantType=DRIVER,seatRow=1,seatSide=driver</item>
+ <item>occupantZoneId=1,occupantType=FRONT_PASSENGER,seatRow=1,seatSide=oppositeDriver</item>
+ <item>occupantZoneId=2,occupantType=REAR_PASSENGER,seatRow=2,seatSide=left</item>
+ <item>occupantZoneId=3,occupantType=REAR_PASSENGER,seatRow=2,seatSide=right</item>
+ <item>occupantZoneId=4,occupantType=REAR_PASSENGER,seatRow=3,seatSide=left</item>
+ </string-array>
+
+ <!-- Assign displays to occupant zones. -->
+ <string-array translatable="false" name="config_occupant_display_mapping">
+ <item>displayPort=0,displayType=MAIN,occupantZoneId=0,inputTypes=TOUCH_SCREEN|DPAD_KEYS|NAVIGATE_KEYS|ROTARY_NAVIGATION</item>
+ <item>displayUniqueId=virtual:com.android.car.cluster.osdouble:ClusterDisplay,displayType=INSTRUMENT_CLUSTER,occupantZoneId=0,inputTypes=DPAD_KEYS</item>
+ <item>displayUniqueId=virtual:com.android.emulator.multidisplay:1234563,displayType=MAIN,occupantZoneId=1,inputTypes=DPAD_KEYS</item>
+ <item>displayUniqueId=virtual:com.android.emulator.multidisplay:1234564,displayType=MAIN,occupantZoneId=2,inputTypes=DPAD_KEYS</item>
+ <item>displayUniqueId=virtual:com.android.emulator.multidisplay:1234565,displayType=MAIN,occupantZoneId=3,inputTypes=DPAD_KEYS</item>
+ <item>displayUniqueId=virtual:com.android.emulator.multidisplay:1234566,displayType=MAIN,occupantZoneId=4,inputTypes=DPAD_KEYS</item>
+ </string-array>
+
+ <!-- Enable profile user assignment per each CarOccupantZone for per display android user
+ assignments. This feature is still experimental. -->
+ <bool name="enableProfileUserAssignmentForMultiDisplay" translatable="false">true</bool>
+
+ <string-array translatable="false" name="config_allowed_optional_car_features">
+ <item>car_navigation_service</item>
+ <item>cluster_home_service</item>
+ <item>com.android.car.user.CarUserNoticeService</item>
+ <item>diagnostic</item>
+ <item>storage_monitoring</item>
+ <item>vehicle_map_service</item>
+ <item>car_telemetry_service</item>
+ </string-array>
+
+ <bool name="audioUseDynamicRouting">true</bool>
+ <bool name="audioUseCarVolumeGroupMuting">true</bool>
+</resources>
diff --git a/emulator/multi-display-dynamic/CarServiceMultiDisplayOverlayEmulator/res/xml/car_ux_restrictions_map.xml b/emulator/multi-display-dynamic/CarServiceMultiDisplayOverlayEmulator/res/xml/car_ux_restrictions_map.xml
new file mode 100644
index 0000000..c2a242b
--- /dev/null
+++ b/emulator/multi-display-dynamic/CarServiceMultiDisplayOverlayEmulator/res/xml/car_ux_restrictions_map.xml
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2023 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+-->
+
+<UxRestrictions xmlns:car="http://schemas.android.com/apk/res-auto">
+ <!-- Map the driving states to UX restrictions here -->
+ <!-- Note - The platform takes a fully restricted approach when there is no information or if
+ the information is malformed. As a result,
+ 1. Default values for requiresDistractionOptimization is true, and uxr is fully_restricted.
+ 2. If uxr != baseline, then requiresDistractionOptimization is automatically promoted to true,
+ even if it is declared as false. Because it doesn't make sense to have an non baseline UX
+ restriction without requiresDistractionOptimization set to true.
+ So if we don't want any restrictions, requiresDistractionOptimization should be explicitly
+ marked as false and uxr should be explicitly set to baseline. -->
+
+ <RestrictionMapping physicalPort="0">
+ <DrivingState state="parked">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="idling">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline" mode="baseline"/>
+ </DrivingState>
+
+ <!-- This is restrictions for moving and speed [0,5m/s) -->
+ <DrivingState state="moving" minSpeed="0" maxSpeed="5.0">
+ <Restrictions requiresDistractionOptimization="true" uxr="no_dialpad|no_filtering|limit_string_length|no_keyboard|no_video|limit_content|no_setup|no_text_message"/>
+ </DrivingState>
+
+ <!-- Restrictions for speed >=5 -->
+ <DrivingState state="moving" minSpeed="5.0">
+ <Restrictions requiresDistractionOptimization="true" uxr="no_dialpad|no_filtering|limit_string_length|no_keyboard|no_video|limit_content|no_setup|no_text_message"/>
+ </DrivingState>
+
+ </RestrictionMapping>
+
+ <!--Setting baseline restrictions for all dynamically added virtual displays -->
+ <RestrictionMapping occupantZoneId="1" displayType="1">
+ <DrivingState state="parked">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="idling">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="moving">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ </RestrictionMapping>
+
+ <RestrictionMapping occupantZoneId="2" displayType="1">
+ <DrivingState state="parked">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="idling">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="moving">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ </RestrictionMapping>
+
+ <RestrictionMapping occupantZoneId="3" displayType="1">
+ <DrivingState state="parked">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="idling">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="moving">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ </RestrictionMapping>
+
+ <RestrictionMapping occupantZoneId="4" displayType="1">
+ <DrivingState state="parked">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="idling">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ <DrivingState state="moving">
+ <Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
+ </DrivingState>
+
+ </RestrictionMapping>
+
+ <!-- Configure restriction parameters here-->
+ <RestrictionParameters>
+ <!-- Parameters to express displayed String related restrictions -->
+ <!-- Max allowed length of general purpose strings when limit_string_length is imposed-->
+ <StringRestrictions maxLength="120"/>
+ <!-- Parameters to express content related restrictions -->
+ <!-- Max number of cumulative content items allowed to be displayed when
+ limit_content is imposed. -->
+ <!-- Maximum levels deep that the user can navigate to when limit_content is imposed. -->
+ <ContentRestrictions maxCumulativeItems="21" maxDepth="3"/>
+ </RestrictionParameters>
+
+</UxRestrictions>
diff --git a/emulator/multi-display-dynamic/CarServiceMultiDisplayOverlayEmulator/res/xml/overlays.xml b/emulator/multi-display-dynamic/CarServiceMultiDisplayOverlayEmulator/res/xml/overlays.xml
new file mode 100644
index 0000000..018d818
--- /dev/null
+++ b/emulator/multi-display-dynamic/CarServiceMultiDisplayOverlayEmulator/res/xml/overlays.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2022 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<overlay>
+ <item target="array/config_occupant_zones" value="@array/config_occupant_zones" />
+ <item target="array/config_occupant_display_mapping" value="@array/config_occupant_display_mapping" />
+ <item target="bool/enableProfileUserAssignmentForMultiDisplay" value="@bool/enableProfileUserAssignmentForMultiDisplay" />
+ <item target="array/config_allowed_optional_car_features" value="@array/config_allowed_optional_car_features" />
+ <item target="bool/audioUseDynamicRouting" value="@bool/audioUseDynamicRouting" />
+ <item target="bool/audioUseCarVolumeGroupMuting" value="@bool/audioUseCarVolumeGroupMuting" />
+ <item target="xml/car_ux_restrictions_map" value="@xml/car_ux_restrictions_map" />
+</overlay>
diff --git a/emulator/multi-display-dynamic/ClusterOsDoubleEmulatorVirtualDisplayOverlay/Android.bp b/emulator/multi-display-dynamic/ClusterOsDoubleEmulatorVirtualDisplayOverlay/Android.bp
new file mode 100644
index 0000000..adc5a83
--- /dev/null
+++ b/emulator/multi-display-dynamic/ClusterOsDoubleEmulatorVirtualDisplayOverlay/Android.bp
@@ -0,0 +1,27 @@
+// Copyright (C) 2022 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+package {
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+runtime_resource_overlay {
+ name: "ClusterOsDoubleEmulatorVirtualDisplayOverlay",
+ resource_dirs: ["res"],
+ manifest: "AndroidManifest.xml",
+ sdk_version: "current",
+ product_specific: true
+}
diff --git a/emulator/multi-display-dynamic/ClusterOsDoubleEmulatorVirtualDisplayOverlay/AndroidManifest.xml b/emulator/multi-display-dynamic/ClusterOsDoubleEmulatorVirtualDisplayOverlay/AndroidManifest.xml
new file mode 100644
index 0000000..47149af
--- /dev/null
+++ b/emulator/multi-display-dynamic/ClusterOsDoubleEmulatorVirtualDisplayOverlay/AndroidManifest.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2022 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.car.cluster.osdouble.emulator.virtualdisplay.overlay">
+ <application android:hasCode="false"/>
+ <overlay android:priority="1000"
+ android:targetPackage="com.android.car.cluster.osdouble"
+ android:targetName="ClusterOsConfig"
+ android:resourcesMap="@xml/overlays"
+ android:isStatic="true" />
+</manifest> \ No newline at end of file
diff --git a/emulator/multi-display-dynamic/ClusterOsDoubleEmulatorVirtualDisplayOverlay/res/values/config.xml b/emulator/multi-display-dynamic/ClusterOsDoubleEmulatorVirtualDisplayOverlay/res/values/config.xml
new file mode 100644
index 0000000..462841c
--- /dev/null
+++ b/emulator/multi-display-dynamic/ClusterOsDoubleEmulatorVirtualDisplayOverlay/res/values/config.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2021 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- Specify the display unique id as added by qemu -->
+ <string name="config_clusterDisplayUniqueId">virtual:com.android.emulator.multidisplay:1234562</string>
+</resources>
diff --git a/emulator/multi-display-dynamic/ClusterOsDoubleEmulatorVirtualDisplayOverlay/res/xml/overlays.xml b/emulator/multi-display-dynamic/ClusterOsDoubleEmulatorVirtualDisplayOverlay/res/xml/overlays.xml
new file mode 100644
index 0000000..60464de
--- /dev/null
+++ b/emulator/multi-display-dynamic/ClusterOsDoubleEmulatorVirtualDisplayOverlay/res/xml/overlays.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2022 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<overlay>
+ <item target="string/config_clusterDisplayUniqueId" value="@string/config_clusterDisplayUniqueId" />
+</overlay> \ No newline at end of file
diff --git a/emulator/multi-display-dynamic/config.ini b/emulator/multi-display-dynamic/config.ini
new file mode 100644
index 0000000..b8c7f76
--- /dev/null
+++ b/emulator/multi-display-dynamic/config.ini
@@ -0,0 +1,31 @@
+hw.audioInput=yes
+hw.lcd.density=160
+hw.cpu.ncore=6
+hw.gpu.enabled=yes
+hw.camera.back=none
+hw.camera.front=none
+hw.mainKeys=no
+hw.ramSize=4096
+hw.keyboard=yes
+skin.dynamic=yes
+skin.name=1408x792
+skin.path=1408x792
+disk.dataPartition.size=6G
+hw.accelerometer=yes
+hw.accelerometer_uncalibrated=yes
+hw.gyroscope=yes
+hw.sensors.light=no
+hw.sensors.pressure=no
+hw.sensors.humidity=no
+hw.sensors.proximity=no
+hw.sensors.magnetic_field=no
+hw.sensors.orientation=no
+hw.sensors.temperature=no
+hw.sensor.hinge=no
+# Instrument cluster display
+hw.display1.width = 528
+hw.display1.height = 792
+hw.display1.density = 160
+# VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY | VIRTUAL_DISPLAY_FLAG_TRUSTED
+# | VIRTUAL_DISPLAY_FLAG_DESTROY_CONTENT_ON_REMOVAL | VIRTUAL_DISPLAY_FLAG_SUPPORTS_TOUCH = 1352
+hw.display1.flag = 1352
diff --git a/emulator/multi-display-dynamic/display_settings.xml b/emulator/multi-display-dynamic/display_settings.xml
new file mode 100644
index 0000000..0576eb1
--- /dev/null
+++ b/emulator/multi-display-dynamic/display_settings.xml
@@ -0,0 +1,54 @@
+<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
+<!--
+/*
+** Copyright 2022, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<display-settings>
+ <!-- Use unique local ids added by Goldfish -->
+ <config identifier="0" />
+
+ <!-- Display settings for cluster -->
+ <display name="virtual:com.android.emulator.multidisplay:1234562"
+ shouldShowSystemDecors="false"
+ forcedDensity="160"
+ dontMoveToTop="true"/>
+
+ <!-- Display settings for 2nd Home -->
+ <display name="virtual:com.android.emulator.multidisplay:1234563"
+ shouldShowSystemDecors="true"
+ shouldShowIme="true"
+ forcedDensity="160" />
+
+ <!-- Display settings for 3rd Home -->
+ <display name="virtual:com.android.emulator.multidisplay:1234564"
+ shouldShowSystemDecors="true"
+ shouldShowIme="true"
+ forcedDensity="160" />
+
+ <!-- Display settings for 4th Home -->
+ <display name="virtual:com.android.emulator.multidisplay:1234565"
+ shouldShowSystemDecors="true"
+ shouldShowIme="true"
+ forcedDensity="160" />
+
+ <!-- Display settings for 5th Home -->
+ <display name="virtual:com.android.emulator.multidisplay:1234565"
+ shouldShowSystemDecors="true"
+ shouldShowIme="true"
+ forcedDensity="160" />
+
+</display-settings>
diff --git a/emulator/multi-display-dynamic/multi-display-dynamic.mk b/emulator/multi-display-dynamic/multi-display-dynamic.mk
new file mode 100644
index 0000000..54516f8
--- /dev/null
+++ b/emulator/multi-display-dynamic/multi-display-dynamic.mk
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2022 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Enable the displays UI on qEmu and add cluster display as default.
+
+# Use the config.ini with the cluster display declared.
+PRODUCT_COPY_FILES += \
+ device/generic/car/emulator/multi-display-dynamic/config.ini:config.ini
+# Enable the displays UI in qemu.
+PRODUCT_SYSTEM_PROPERTIES += \
+ ro.emulator.car.multidisplay=true
+# Must be before the emulator's vendor.mk.
+PRODUCT_COPY_FILES += \
+ device/generic/car/emulator/multi-display-dynamic/display_settings.xml:$(TARGET_COPY_OUT_VENDOR)/etc/display_settings.xml
+# Keep the original audio configuration from the MD emulator.
+PRODUCT_COPY_FILES += \
+ device/generic/car/emulator/multi-display/car_audio_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/car_audio_configuration.xml
+
+# support packages for multi-display
+$(call inherit-product, $(SRC_TARGET_DIR)/product/emulator_system.mk)
+PRODUCT_PACKAGES += \
+ MultiDisplaySecondaryHomeTestLauncher \
+ MultiDisplayTest \
+ SecondaryHomeApp \
+ MultiDisplayProvider \
+ CarServiceMultiDisplayOverlayEmulator
+
+PRODUCT_PACKAGES += ClusterHomeSample ClusterOsDouble ClusterHomeSampleOverlay ClusterOsDoubleEmulatorVirtualDisplayOverlay
+
+PRODUCT_COPY_FILES += \
+ frameworks/native/data/etc/android.software.managed_users.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.managed_users.xml
+
+# Selects the MultiDisplaySecondaryHomeTestLauncher as secondaryHome
+PRODUCT_PACKAGE_OVERLAYS += \
+ device/generic/car/emulator/multi-display-dynamic/overlay
diff --git a/emulator/multi-display-dynamic/overlay/frameworks/base/core/res/res/values/config.xml b/emulator/multi-display-dynamic/overlay/frameworks/base/core/res/res/values/config.xml
new file mode 100644
index 0000000..17d24e6
--- /dev/null
+++ b/emulator/multi-display-dynamic/overlay/frameworks/base/core/res/res/values/config.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2022, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!--
+ Overlay resources to configure car service based on each OEM's preference.
+ See also packages/services/Car/service/res/values/config.xml
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- Maximum number of users we allow to be running at a time -->
+ <integer name="config_multiuserMaxRunningUsers">5</integer>
+
+ <!-- True if the device supports system decorations on secondary displays. -->
+ <bool name="config_supportsSystemDecorsOnSecondaryDisplays">true</bool>
+
+ <!-- This is the default launcher package with an activity to use on secondary displays that
+ support system decorations.
+ This launcher package must have an activity that supports multiple instances and has
+ corresponding launch mode set in AndroidManifest.
+ {@see android.view.Display#FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS} -->
+ <string name="config_secondaryHomePackage" translatable="false">com.android.car.multidisplay</string>
+
+ <!-- Whether the system enables per-display focus. If the system has the input method for each
+ display, this value should be true. -->
+ <bool name="config_perDisplayFocusEnabled">true</bool>
+
+ <!-- Whether to only install system packages on a user if they're allow-listed for that user
+ type. These are flags and can be freely combined.
+ 0 - disable allow-list (install all system packages; no logging)
+ 1 - enforce (only install system packages if they are allow-listed)
+ 2 - log (log non-allow-listed packages)
+ 4 - any package not mentioned in the allow-list file is implicitly allow-listed on all users
+ 8 - same as 4, but just for the SYSTEM user
+ 16 - ignore OTAs (don't install system packages during OTAs)
+ Common scenarios:
+ - to enable feature (fully enforced) for a complete allow-list: 1
+ - to enable feature for an incomplete allow-list (so use implicit allow-list mode): 5
+ - to enable feature but implicitly allow-list for SYSTEM user to ease local development: 9
+ - to disable feature completely if it had never been enabled: 16
+ - to henceforth disable feature and try to undo its previous effects: 0
+ Note: This list must be kept current with PACKAGE_WHITELIST_MODE_PROP in
+ frameworks/base/services/core/java/com/android/server/pm/UserSystemPackageInstaller.java
+ Package allow-list disabled for testing profile user as default allow-list does not
+ support PROFILE user. -->
+ <integer name="config_userTypePackageWhitelistMode">2</integer>
+
+ <!-- Whether the device allows users to start in background visible on displays.
+ Should be false for most devices, except automotive vehicle with passenger displays. -->
+ <bool name="config_multiuserVisibleBackgroundUsers">true</bool>
+
+</resources>
diff --git a/emulator/multi-display/ClusterOsDoubleEmulatorPhysicalDisplayOverlay/Android.bp b/emulator/multi-display/ClusterOsDoubleEmulatorPhysicalDisplayOverlay/Android.bp
new file mode 100644
index 0000000..a1f3d42
--- /dev/null
+++ b/emulator/multi-display/ClusterOsDoubleEmulatorPhysicalDisplayOverlay/Android.bp
@@ -0,0 +1,27 @@
+// Copyright (C) 2022 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+package {
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+runtime_resource_overlay {
+ name: "ClusterOsDoubleEmulatorPhysicalDisplayOverlay",
+ resource_dirs: ["res"],
+ manifest: "AndroidManifest.xml",
+ sdk_version: "current",
+ product_specific: true
+}
diff --git a/emulator/multi-display/ClusterOsDoubleEmulatorPhysicalDisplayOverlay/AndroidManifest.xml b/emulator/multi-display/ClusterOsDoubleEmulatorPhysicalDisplayOverlay/AndroidManifest.xml
new file mode 100644
index 0000000..3b2f86c
--- /dev/null
+++ b/emulator/multi-display/ClusterOsDoubleEmulatorPhysicalDisplayOverlay/AndroidManifest.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2022 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.car.cluster.osdouble.emulator.physicaldisplay.overlay">
+ <application android:hasCode="false"/>
+ <overlay android:priority="1000"
+ android:targetPackage="com.android.car.cluster.osdouble"
+ android:targetName="ClusterOsConfig"
+ android:resourcesMap="@xml/overlays"
+ android:isStatic="true" />
+</manifest> \ No newline at end of file
diff --git a/emulator/multi-display/ClusterOsDoubleEmulatorPhysicalDisplayOverlay/res/values/config.xml b/emulator/multi-display/ClusterOsDoubleEmulatorPhysicalDisplayOverlay/res/values/config.xml
new file mode 100644
index 0000000..3e15a06
--- /dev/null
+++ b/emulator/multi-display/ClusterOsDoubleEmulatorPhysicalDisplayOverlay/res/values/config.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2021 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- Use port:1 for the cluster display -->
+ <integer name="config_clusterDisplayPort">1</integer>
+</resources>
diff --git a/emulator/multi-display/ClusterOsDoubleEmulatorPhysicalDisplayOverlay/res/xml/overlays.xml b/emulator/multi-display/ClusterOsDoubleEmulatorPhysicalDisplayOverlay/res/xml/overlays.xml
new file mode 100644
index 0000000..2f2044c
--- /dev/null
+++ b/emulator/multi-display/ClusterOsDoubleEmulatorPhysicalDisplayOverlay/res/xml/overlays.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2022 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<overlay>
+ <item target="integer/config_clusterDisplayPort" value="@integer/config_clusterDisplayPort" />
+</overlay> \ No newline at end of file
diff --git a/emulator/multi-display/car_audio_configuration.xml b/emulator/multi-display/car_audio_configuration.xml
new file mode 100644
index 0000000..7109d3e
--- /dev/null
+++ b/emulator/multi-display/car_audio_configuration.xml
@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2020 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!--
+ Defines the audio configuration in a car, including
+ - Audio zones
+ - Context to audio bus mappings
+ - Volume groups
+ in the car environment.
+-->
+<carAudioConfiguration version="3">
+ <mirroringDevices>
+ <mirroringDevice address="bus1000_mirror_device"/>
+ </mirroringDevices>
+ <zones>
+ <zone name="primary zone" isPrimary="true" occupantZoneId="0">
+ <zoneConfigs>
+ <zoneConfig name="primary zone config" isDefault="true">
+ <volumeGroups>
+ <group>
+ <device address="bus0_media_out">
+ <context context="music"/>
+ </device>
+ <device address="bus3_call_ring_out">
+ <context context="call_ring"/>
+ </device>
+ <device address="bus6_notification_out">
+ <context context="notification"/>
+ </device>
+ </group>
+ <group>
+ <device address="bus1_navigation_out">
+ <context context="navigation"/>
+ </device>
+ <device address="bus2_voice_command_out">
+ <context context="voice_command"/>
+ </device>
+ </group>
+ <group>
+ <device address="bus4_call_out">
+ <context context="call"/>
+ </device>
+ </group>
+ <group>
+ <device address="bus5_alarm_out">
+ <context context="alarm"/>
+ </device>
+ <device address="bus7_system_sound_out">
+ <context context="system_sound"/>
+ <context context="emergency"/>
+ <context context="safety"/>
+ <context context="vehicle_status"/>
+ <context context="announcement"/>
+ </device>
+ </group>
+ </volumeGroups>
+ </zoneConfig>
+ </zoneConfigs>
+ <inputDevices>
+ <inputDevice address="input_bus_tone_zone_0"/>
+ <inputDevice address="tuner0"/>
+ </inputDevices>
+ </zone>
+ <zone name="front passenger zone 1" audioZoneId="1" occupantZoneId="1">
+ <zoneConfigs>
+ <zoneConfig name="front passenger zone 1 config 0" isDefault="true">
+ <volumeGroups>
+ <group>
+ <device address="bus100_audio_zone_1">
+ <context context="music"/>
+ </device>
+ </group>
+ <group>
+ <device address="bus101_audio_zone_1">
+ <context context="navigation"/>
+ <context context="voice_command"/>
+ <context context="call_ring"/>
+ <context context="call"/>
+ <context context="alarm"/>
+ <context context="notification"/>
+ <context context="system_sound"/>
+ <context context="emergency"/>
+ <context context="safety"/>
+ <context context="vehicle_status"/>
+ <context context="announcement"/>
+ </device>
+ </group>
+ </volumeGroups>
+ </zoneConfig>
+ <zoneConfig name="front passenger zone 1 config 1">
+ <volumeGroups>
+ <group>
+ <device address="bus110_audio_zone_1">
+ <context context="music"/>
+ </device>
+ </group>
+ <group>
+ <device address="bus111_audio_zone_1">
+ <context context="navigation"/>
+ <context context="voice_command"/>
+ <context context="call_ring"/>
+ <context context="call"/>
+ <context context="alarm"/>
+ <context context="notification"/>
+ <context context="system_sound"/>
+ <context context="emergency"/>
+ <context context="safety"/>
+ <context context="vehicle_status"/>
+ <context context="announcement"/>
+ </device>
+ </group>
+ </volumeGroups>
+ </zoneConfig>
+ </zoneConfigs>
+ <inputDevices>
+ <inputDevice address="input_bus_tone_zone_1"/>
+ </inputDevices>
+ </zone>
+ <zone name="rear seat zone 2" audioZoneId="2" occupantZoneId="2">
+ <zoneConfigs>
+ <zoneConfig name="rear seat zone 2 config 0" isDefault="true">
+ <volumeGroups>
+ <group>
+ <device address="bus200_audio_zone_2">
+ <context context="music"/>
+ </device>
+ </group>
+ <group>
+ <device address="bus201_audio_zone_2">
+ <context context="navigation"/>
+ <context context="voice_command"/>
+ <context context="call_ring"/>
+ <context context="call"/>
+ <context context="alarm"/>
+ <context context="notification"/>
+ <context context="system_sound"/>
+ <context context="emergency"/>
+ <context context="safety"/>
+ <context context="vehicle_status"/>
+ <context context="announcement"/>
+ </device>
+ </group>
+ </volumeGroups>
+ </zoneConfig>
+ <zoneConfig name="rear seat zone 2 config 1">
+ <volumeGroups>
+ <group>
+ <device address="bus210_audio_zone_2">
+ <context context="music"/>
+ </device>
+ </group>
+ <group>
+ <device address="bus211_audio_zone_2">
+ <context context="navigation"/>
+ <context context="voice_command"/>
+ <context context="call_ring"/>
+ <context context="call"/>
+ <context context="alarm"/>
+ <context context="notification"/>
+ <context context="system_sound"/>
+ <context context="emergency"/>
+ <context context="safety"/>
+ <context context="vehicle_status"/>
+ <context context="announcement"/>
+ </device>
+ </group>
+ </volumeGroups>
+ </zoneConfig>
+ </zoneConfigs>
+ </zone>
+ </zones>
+</carAudioConfiguration>
diff --git a/emulator/multi-display/display_layout_configuration.xml b/emulator/multi-display/display_layout_configuration.xml
new file mode 100644
index 0000000..37b1cc8
--- /dev/null
+++ b/emulator/multi-display/display_layout_configuration.xml
@@ -0,0 +1,24 @@
+<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
+<layouts>
+ <layout>
+ <!-- Use the default state -->
+ <state>-1</state>
+
+ <display enabled="true" defaultDisplay="true">
+ <address>4619827259835644672</address>
+ </display>
+
+ <display enabled="true" defaultDisplay="false">
+ <address>4619827551948147201</address>
+ </display>
+
+ <display enabled="true" defaultDisplay="false" displayGroup="passenger_display1">
+ <address>4619827124781842690</address>
+ </display>
+
+ <display enabled="true" defaultDisplay="false" displayGroup="passenger_display2">
+ <address>4619827540095559171</address>
+ </display>
+
+ </layout>
+</layouts>
diff --git a/emulator/multi-display/display_settings.xml b/emulator/multi-display/display_settings.xml
new file mode 100644
index 0000000..8f63b42
--- /dev/null
+++ b/emulator/multi-display/display_settings.xml
@@ -0,0 +1,23 @@
+<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
+<display-settings>
+<!-- Use physical port number instead of local id -->
+<config identifier="1" />
+
+<!-- Display settings for cluster -->
+<display name="port:1"
+ forcedDensity="160"
+ dontMoveToTop="true"/>
+
+<!-- Display settings for 2nd Home -->
+<display name="port:2"
+ shouldShowSystemDecors="true"
+ shouldShowIme="true"
+ forcedDensity="160" />
+
+<!-- Display settings for 3rd Home -->
+<display name="port:3"
+ shouldShowSystemDecors="true"
+ shouldShowIme="true"
+ forcedDensity="160" />
+
+</display-settings>
diff --git a/emulator/multi-display/input/virtio_input_multi_touch_7.idc b/emulator/multi-display/input/virtio_input_multi_touch_7.idc
new file mode 100644
index 0000000..fe56a0c
--- /dev/null
+++ b/emulator/multi-display/input/virtio_input_multi_touch_7.idc
@@ -0,0 +1,18 @@
+device.internal = 1
+
+touch.deviceType = touchScreen
+touch.orientationAware = 1
+
+cursor.mode = navigation
+cursor.orientationAware = 1
+
+# This displayID matches the unique ID of the virtual display created for Emulator.
+# This will indicate to input flinger than it should link this input device
+# with the virtual display.
+touch.displayId = local:4619827551948147201
+
+# Allow touches while the screen is off
+touch.enableForInactiveViewport = 1
+
+# Tap on the display will wake the device.
+touch.wake = 1
diff --git a/emulator/multi-display/input/virtio_input_multi_touch_8.idc b/emulator/multi-display/input/virtio_input_multi_touch_8.idc
new file mode 100644
index 0000000..3c7c0d8
--- /dev/null
+++ b/emulator/multi-display/input/virtio_input_multi_touch_8.idc
@@ -0,0 +1,18 @@
+device.internal = 1
+
+touch.deviceType = touchScreen
+touch.orientationAware = 1
+
+cursor.mode = navigation
+cursor.orientationAware = 1
+
+# This displayID matches the unique ID of the virtual display created for Emulator.
+# This will indicate to input flinger than it should link this input device
+# with the virtual display.
+touch.displayId = local:4619827124781842690
+
+# Allow touches while the screen is off
+touch.enableForInactiveViewport = 1
+
+# Tap on the display will wake the device.
+touch.wake = 1
diff --git a/emulator/multi-display/input/virtio_input_multi_touch_9.idc b/emulator/multi-display/input/virtio_input_multi_touch_9.idc
new file mode 100644
index 0000000..8035aad
--- /dev/null
+++ b/emulator/multi-display/input/virtio_input_multi_touch_9.idc
@@ -0,0 +1,18 @@
+device.internal = 1
+
+touch.deviceType = touchScreen
+touch.orientationAware = 1
+
+cursor.mode = navigation
+cursor.orientationAware = 1
+
+# This displayID matches the unique ID of the virtual display created for Emulator.
+# This will indicate to input flinger than it should link this input device
+# with the virtual display.
+touch.displayId = local:4619827540095559171
+
+# Allow touches while the screen is off
+touch.enableForInactiveViewport = 1
+
+# Tap on the display will wake the device.
+touch.wake = 1
diff --git a/emulator/multi-display/overlay/frameworks/base/core/res/res/values/config.xml b/emulator/multi-display/overlay/frameworks/base/core/res/res/values/config.xml
new file mode 100644
index 0000000..e9a7179
--- /dev/null
+++ b/emulator/multi-display/overlay/frameworks/base/core/res/res/values/config.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2019, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- Whether the system enables per-display focus. If the system has the input method for each
+ display, this value should be true. -->
+ <bool name="config_perDisplayFocusEnabled">true</bool>
+
+ <!-- Maximum number of supported users -->
+ <integer name="config_multiuserMaximumUsers">10</integer>
+
+ <!-- Maximum number of users we allow to be running at a time -->
+ <integer name="config_multiuserMaxRunningUsers">5</integer>
+
+ <!-- True if the device supports system decorations on secondary displays. -->
+ <bool name="config_supportsSystemDecorsOnSecondaryDisplays">true</bool>
+ <!-- This is the default launcher package with an activity to use on secondary displays that
+ support system decorations.
+ This launcher package must have an activity that supports multiple instances and has
+ corresponding launch mode set in AndroidManifest.
+ {@see android.view.Display#FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS} -->
+ <string name="config_secondaryHomePackage" translatable="false">com.android.car.multidisplay</string>
+ <!-- Whether to only install system packages on a user if they're whitelisted for that user
+ type. These are flags and can be freely combined.
+ 0 - disable whitelist (install all system packages; no logging)
+ 1 - enforce (only install system packages if they are whitelisted)
+ 2 - log (log non-whitelisted packages)
+ 4 - any package not mentioned in the whitelist file is implicitly whitelisted on all users
+ 8 - same as 4, but just for the SYSTEM user
+ 16 - ignore OTAs (don't install system packages during OTAs)
+ Common scenarios:
+ - to enable feature (fully enforced) for a complete whitelist: 1
+ - to enable feature for an incomplete whitelist (so use implicit whitelist mode): 5
+ - to enable feature but implicitly whitelist for SYSTEM user to ease local development: 9
+ - to disable feature completely if it had never been enabled: 16
+ - to henceforth disable feature and try to undo its previous effects: 0
+ Note: This list must be kept current with PACKAGE_WHITELIST_MODE_PROP in
+ frameworks/base/services/core/java/com/android/server/pm/UserSystemPackageInstaller.java
+ Package whitelist disabled for testing profile user as default whitelist does not
+ support PROFILE user. -->
+ <integer name="config_userTypePackageWhitelistMode">2</integer>
+
+ <!-- Whether the device allows users to start in background visible on displays.
+ Should be false for most devices, except automotive vehicle with passenger displays. -->
+ <bool name="config_multiuserVisibleBackgroundUsers">true</bool>
+
+ <!-- Enable multi-user IME sessions -->
+ <string translatable="false" name="config_deviceSpecificInputMethodManagerService">com.android.server.inputmethod.InputMethodManagerServiceProxy$Lifecycle</string>
+ <!-- Disable hidding the NavBars (CarSystemBars), as a workaround for b/259604616 -->
+ <bool name="config_hideNavBarForKeyboard">false</bool>
+
+</resources>
diff --git a/emulator/multi-display/overlay/frameworks/base/core/res/res/xml/config_user_types.xml b/emulator/multi-display/overlay/frameworks/base/core/res/res/xml/config_user_types.xml
new file mode 100644
index 0000000..07f21fe
--- /dev/null
+++ b/emulator/multi-display/overlay/frameworks/base/core/res/res/xml/config_user_types.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<user-types>
+ <full-type name="android.os.usertype.full.GUEST"
+ max-allowed="3" >
+ <default-restrictions no_factory_reset="true" no_remove_user="true"
+ no_modify_accounts="true" no_install_apps="true" no_install_unknown_sources="true"
+ no_uninstall_apps="true"/>
+ </full-type>
+
+ <profile-type name="android.os.usertype.profile.CLONE"
+ enabled='0' >
+ </profile-type>
+</user-types>
diff --git a/emulator/overlay/frameworks/base/core/res/res/values/config.xml b/emulator/overlay/frameworks/base/core/res/res/values/config.xml
new file mode 100644
index 0000000..1544de4
--- /dev/null
+++ b/emulator/overlay/frameworks/base/core/res/res/values/config.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2023, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <bool name="config_automatic_brightness_available">true</bool>
+</resources>
diff --git a/emulator/sepolicy/hal_vehicle_default.te b/emulator/sepolicy/hal_vehicle_default.te
new file mode 100644
index 0000000..e201b75
--- /dev/null
+++ b/emulator/sepolicy/hal_vehicle_default.te
@@ -0,0 +1 @@
+allow hal_vehicle_default self:vsock_socket { connect create read write };
diff --git a/emulator/usbpt/BoardConfig.mk b/emulator/usbpt/BoardConfig.mk
index ea43a0b..9352b25 100644
--- a/emulator/usbpt/BoardConfig.mk
+++ b/emulator/usbpt/BoardConfig.mk
@@ -13,4 +13,5 @@
# limitations under the License.
#
-include device/generic/car/emulator/usbpt/bluetooth/BoardConfig.mk
+#include device/generic/car/emulator/usbpt/bluetooth/BoardConfig.mk
+#include device/generic/car/emulator/usbpt/wifi/BoardConfig.mk
diff --git a/emulator/usbpt/bluetooth/bluetooth.mk b/emulator/usbpt/bluetooth/bluetooth.mk
index 935097f..599d455 100644
--- a/emulator/usbpt/bluetooth/bluetooth.mk
+++ b/emulator/usbpt/bluetooth/bluetooth.mk
@@ -18,10 +18,10 @@
PRODUCT_PACKAGES += \
android.hardware.bluetooth@1.1-service.btlinux \
+ android.hardware.bluetooth.audio@2.2-impl \
PRODUCT_COPY_FILES += \
device/generic/car/emulator/usbpt/bluetooth/vendor.qemu.preferred.bt.service.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/vendor.qemu.preferred.bt.service.rc \
- device/generic/car/emulator/usbpt/bluetooth/modules.blocklist:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/lib/modules/modules.blocklist \
PRODUCT_SYSTEM_PROPERTIES += \
persist.bluetooth.enablenewavrcp=false \
diff --git a/emulator/usbpt/bluetooth/bluetooth.prop b/emulator/usbpt/bluetooth/bluetooth.prop
new file mode 100644
index 0000000..fdd00c0
--- /dev/null
+++ b/emulator/usbpt/bluetooth/bluetooth.prop
@@ -0,0 +1,20 @@
+# The default Bluetooth Class of Device
+# Service Field: 0x26 -> 38
+# - Bit 17: Networking
+# - Bit 18: Rendering
+# - Bit 21: Audio
+# Major Class: 0x04 -> 4 (Audio / Video)
+# Minor Class: 0x08 -> 8 (Car Audio)
+bluetooth.device.class_of_device=38,4,8
+bluetooth.device.default_name=gCar Emulator
+
+# The Bluetooth profiles that cars expect to have enabled. All other profiles
+# are disabled by default.
+bluetooth.profile.a2dp.sink.enabled=true
+bluetooth.profile.avrcp.controller.enabled=true
+bluetooth.profile.gatt.enabled=true
+bluetooth.profile.hfp.hf.enabled=true
+bluetooth.profile.map.client.enabled=true
+bluetooth.profile.pan.nap.enabled=true
+bluetooth.profile.pan.panu.enabled=true
+bluetooth.profile.pbap.client.enabled=true
diff --git a/emulator/usbpt/bluetooth/btusb/BoardConfig.mk b/emulator/usbpt/bluetooth/btusb/BoardConfig.mk
index 7011ee7..2a13328 100644
--- a/emulator/usbpt/bluetooth/btusb/BoardConfig.mk
+++ b/emulator/usbpt/bluetooth/btusb/BoardConfig.mk
@@ -12,13 +12,3 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-
-BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/generic/car/emulator/usbpt/bluetooth/btusb/hal
-
-TARGET_KERNEL_USE ?= 5.10
-
-ifeq ($(TARGET_ARCH),x86_64)
-BOARD_VENDOR_KERNEL_MODULES += kernel/prebuilts/common-modules/virtual-device/$(TARGET_KERNEL_USE)/x86-64/btusb.ko
-else ifeq ($(TARGET_ARCH),arm64)
-BOARD_VENDOR_KERNEL_MODULES += kernel/prebuilts/common-modules/virtual-device/$(TARGET_KERNEL_USE)/arm64/btusb.ko
-endif
diff --git a/emulator/usbpt/bluetooth/btusb/hal/bdroid_buildcfg.h b/emulator/usbpt/bluetooth/btusb/hal/bdroid_buildcfg.h
deleted file mode 100644
index 132b683..0000000
--- a/emulator/usbpt/bluetooth/btusb/hal/bdroid_buildcfg.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef _BDROID_BUILDCFG_H
-#define _BDROID_BUILDCFG_H
-#define BTM_DEF_LOCAL_NAME "gCar Emulator"
-#define BTA_AV_SINK_INCLUDED TRUE
-/* Handsfree device */
-#define BTA_DM_COD {0x26, 0x04, 0x08}
-/* Workaround for error at connection. */
-#define BT_CLEAN_TURN_ON_DISABLED 1
-#endif
diff --git a/emulator/usbpt/bluetooth/btusb/init.btusb.rc b/emulator/usbpt/bluetooth/btusb/init.btusb.rc
index 4603f83..55b5160 100644
--- a/emulator/usbpt/bluetooth/btusb/init.btusb.rc
+++ b/emulator/usbpt/bluetooth/btusb/init.btusb.rc
@@ -1,3 +1,17 @@
+# Copyright (C) 2022 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
on early-init
write /sys/module/firmware_class/parameters/path /vendor/firmware/
diff --git a/emulator/usbpt/bluetooth/modules.blocklist b/emulator/usbpt/bluetooth/modules.blocklist
deleted file mode 100644
index 5816cd8..0000000
--- a/emulator/usbpt/bluetooth/modules.blocklist
+++ /dev/null
@@ -1,2 +0,0 @@
-# List of sub-device specific modules to not load automatically
-blocklist btusb.ko
diff --git a/emulator/usbpt/bluetooth/usb_modeswitch/usb_modeswitch.c b/emulator/usbpt/bluetooth/usb_modeswitch/usb_modeswitch.c
index 3b7c48b..9b092ee 100644
--- a/emulator/usbpt/bluetooth/usb_modeswitch/usb_modeswitch.c
+++ b/emulator/usbpt/bluetooth/usb_modeswitch/usb_modeswitch.c
@@ -1707,13 +1707,13 @@ struct libusb_device* search_devices( int *numFound, int vendor, char* productLi
if (!vendor || *productList == '\0')
return NULL;
- listcopy = malloc(strlen(productList)+1);
-
if (libusb_get_device_list(ctx, &devs) < 0) {
perror("Libusb failed to get USB access!");
return 0;
}
+ listcopy = malloc(strlen(productList)+1);
+
while ((dev = devs[i++]) != NULL) {
struct libusb_device_descriptor descriptor;
libusb_get_device_descriptor(dev, &descriptor);
diff --git a/emulator/usbpt/car_usbpt.mk b/emulator/usbpt/car_usbpt.mk
index 922c5b3..e0e24bc 100644
--- a/emulator/usbpt/car_usbpt.mk
+++ b/emulator/usbpt/car_usbpt.mk
@@ -16,7 +16,9 @@
$(call inherit-product, device/generic/car/emulator/usbpt/bluetooth/bluetooth.mk)
$(call inherit-product, device/generic/car/emulator/usbpt/protocan/protocan.mk)
$(call inherit-product, device/generic/car/emulator/usbpt/usbip-service/usbip-service.mk)
+$(call inherit-product, device/generic/car/emulator/usbpt/wifi/wifi.mk)
# Required for USB passthrough
PRODUCT_COPY_FILES += \
- frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml
+ frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml \
+ device/generic/car/emulator/usbpt/modules.blocklist:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/lib/modules/modules.blocklist \
diff --git a/emulator/usbpt/modules.blocklist b/emulator/usbpt/modules.blocklist
new file mode 100644
index 0000000..34559e0
--- /dev/null
+++ b/emulator/usbpt/modules.blocklist
@@ -0,0 +1,10 @@
+# List of sub-device specific modules to not load automatically
+blocklist btusb.ko
+blocklist mt76x2u.ko
+blocklist mt76x2_common.ko
+blocklist mt76x0u.ko
+blocklist mt76x02_usb.ko
+blocklist mt76x0_common.ko
+blocklist mt76x02_lib.ko
+blocklist mt76_usb.ko
+blocklist mt76.ko
diff --git a/emulator/usbpt/protocan/manifest.protocan.xml b/emulator/usbpt/protocan/manifest.protocan.xml
index f23cbf9..7227a48 100644
--- a/emulator/usbpt/protocan/manifest.protocan.xml
+++ b/emulator/usbpt/protocan/manifest.protocan.xml
@@ -5,10 +5,6 @@
<impl level="generic"></impl>
<version>1.0</version>
<interface>
- <name>ICanController</name>
- <instance>socketcan</instance>
- </interface>
- <interface>
<name>ICanBus</name>
<instance>BCAN</instance>
<instance>CCAN</instance>
diff --git a/emulator/usbpt/protocan/protocan.mk b/emulator/usbpt/protocan/protocan.mk
index 4f02d52..4f54992 100644
--- a/emulator/usbpt/protocan/protocan.mk
+++ b/emulator/usbpt/protocan/protocan.mk
@@ -17,8 +17,12 @@
# CAN bus HAL
PRODUCT_PACKAGES += android.hardware.automotive.can@1.0-service
PRODUCT_PACKAGES += canhalconfigurator
-PRODUCT_COPY_FILES += device/generic/car/emulator/usbpt/protocan/canbus_config.pb:system/etc/canbus_config.pb
-PRODUCT_PACKAGES_DEBUG += canhalctrl \
+PRODUCT_COPY_FILES += device/generic/car/emulator/usbpt/protocan/canbus_config.pb:$(TARGET_COPY_OUT_VENDOR)/etc/canbus_config.pb
+
+# TODO(b/259994014): Remove CAN packages from here after AAOS baseline is
+# applied to all car emulators
+PRODUCT_PACKAGES_DEBUG += \
+ canhalctrl \
canhaldump \
canhalsend
diff --git a/emulator/usbpt/protocan/protocanbus/sepolicy/dumpstate.te b/emulator/usbpt/protocan/protocanbus/sepolicy/dumpstate.te
new file mode 100644
index 0000000..b43e786
--- /dev/null
+++ b/emulator/usbpt/protocan/protocanbus/sepolicy/dumpstate.te
@@ -0,0 +1,2 @@
+# Allow dumpstate to make binder calls to hal_vehiclebus_default
+binder_call(dumpstate, hal_vehiclebus_default)
diff --git a/emulator/usbpt/protocan/protocanbus/sepolicy/service.te b/emulator/usbpt/protocan/protocanbus/sepolicy/service.te
index 1016fe4..08c20e9 100644
--- a/emulator/usbpt/protocan/protocanbus/sepolicy/service.te
+++ b/emulator/usbpt/protocan/protocanbus/sepolicy/service.te
@@ -1 +1 @@
-type hal_vehiclebus_service, vendor_service, protected_service, service_manager_type;
+type hal_vehiclebus_service, hal_service_type, protected_service, service_manager_type;
diff --git a/emulator/usbpt/usbip-service/TEST_MAPPING b/emulator/usbpt/usbip-service/TEST_MAPPING
index c977d11..61eb9ae 100644
--- a/emulator/usbpt/usbip-service/TEST_MAPPING
+++ b/emulator/usbpt/usbip-service/TEST_MAPPING
@@ -1,7 +1,7 @@
{
"presubmit": [
{
- "name": "usbpip_test",
+ "name": "usbip_test",
"host": true
}
]
diff --git a/emulator/usbpt/wifi/BoardConfig.mk b/emulator/usbpt/wifi/BoardConfig.mk
new file mode 100644
index 0000000..2a13328
--- /dev/null
+++ b/emulator/usbpt/wifi/BoardConfig.mk
@@ -0,0 +1,14 @@
+# Copyright (C) 2022 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
diff --git a/emulator/usbpt/wifi/init.wifiusb.rc b/emulator/usbpt/wifi/init.wifiusb.rc
new file mode 100644
index 0000000..5b09e12
--- /dev/null
+++ b/emulator/usbpt/wifi/init.wifiusb.rc
@@ -0,0 +1,19 @@
+# Copyright (C) 2022 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+on early-init
+ write /sys/module/firmware_class/parameters/path /vendor/firmware/
+
+on boot
+ exec u:r:vendor_modprobe:s0 -- /vendor/bin/modprobe -a -d /vendor/lib/modules mt76.ko mt76-usb.ko mt76x02-lib.ko mt76x02-usb.ko mt76x0-common.ko mt76x0u.ko mt76x2-common.ko mt76x2u.ko
diff --git a/emulator/usbpt/wifi/wifi.mk b/emulator/usbpt/wifi/wifi.mk
new file mode 100644
index 0000000..e2da0f9
--- /dev/null
+++ b/emulator/usbpt/wifi/wifi.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2022 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+PRODUCT_COPY_FILES += \
+ device/generic/car/emulator/usbpt/wifi/init.wifiusb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.wifiusb.rc \
diff --git a/emulator/vhal_aidl/EmulatedVehicleService.cpp b/emulator/vhal_aidl/EmulatedVehicleService.cpp
index aeada2f..28a7bca 100644
--- a/emulator/vhal_aidl/EmulatedVehicleService.cpp
+++ b/emulator/vhal_aidl/EmulatedVehicleService.cpp
@@ -27,6 +27,13 @@ using ::android::hardware::automotive::vehicle::DefaultVehicleHal;
using ::android::hardware::automotive::vehicle::fake::EmulatedVehicleHardware;
int main(int /* argc */, char* /* argv */[]) {
+ ALOGI("Starting thread pool...");
+ if (!ABinderProcess_setThreadPoolMaxThreadCount(4)) {
+ ALOGE("%s", "failed to set thread pool max thread count");
+ return 1;
+ }
+ ABinderProcess_startThreadPool();
+
std::unique_ptr<EmulatedVehicleHardware> hardware = std::make_unique<EmulatedVehicleHardware>();
std::shared_ptr<DefaultVehicleHal> vhal =
::ndk::SharedRefBase::make<DefaultVehicleHal>(std::move(hardware));
@@ -39,12 +46,6 @@ int main(int /* argc */, char* /* argv */[]) {
return 1;
}
- if (!ABinderProcess_setThreadPoolMaxThreadCount(4)) {
- ALOGE("%s", "failed to set thread pool max thread count");
- return 1;
- }
- ABinderProcess_startThreadPool();
-
ALOGI("Emulator Vehicle Service Ready");
ABinderProcess_joinThreadPool();
diff --git a/emulator/vhal_aidl/vhal-emulator-service.xml b/emulator/vhal_aidl/vhal-emulator-service.xml
index adf40da..c0fffd3 100644
--- a/emulator/vhal_aidl/vhal-emulator-service.xml
+++ b/emulator/vhal_aidl/vhal-emulator-service.xml
@@ -1,7 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.automotive.vehicle</name>
- <version>1</version>
+ <version>2</version>
<interface>
<name>IVehicle</name>
<instance>default</instance>
diff --git a/emulator/vhal_v2_0/interfaces/aidl/Android.bp b/emulator/vhal_v2_0/interfaces/aidl/Android.bp
index b22d821..9d59cd2 100644
--- a/emulator/vhal_v2_0/interfaces/aidl/Android.bp
+++ b/emulator/vhal_v2_0/interfaces/aidl/Android.bp
@@ -14,7 +14,8 @@ aidl_interface {
vendor_available: true,
srcs: ["device/generic/car/emulator/*.aidl"],
imports: [
- "android.hardware.automotive.vehicle",
+ "android.hardware.automotive.vehicle-V2",
+ "android.hardware.automotive.vehicle.property-V2",
],
stability: "vintf",
backend: {
@@ -31,7 +32,10 @@ aidl_interface {
versions_with_info: [
{
version: "1",
- imports: ["android.hardware.automotive.vehicle-V1"],
+ imports: [
+ "android.hardware.automotive.vehicle-V2",
+ "android.hardware.automotive.vehicle.property-V2",
+ ],
},
],