diff options
author | Xin Li <delphij@google.com> | 2023-10-05 15:32:02 -0700 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2023-10-05 15:32:02 -0700 |
commit | 921ab8b9941c7f92bd8338f7c67d5b47fc38fbb9 (patch) | |
tree | 8388774cfe61595ace7f1f65c55380421a90789a | |
parent | 7fc38137dede273102fc4aaa27bcdd8dc5ea49d3 (diff) | |
parent | 15726c9a8dda3a73c01ff5202cc6f6a414e178b7 (diff) | |
download | car-921ab8b9941c7f92bd8338f7c67d5b47fc38fbb9.tar.gz |
Merge Android 14
Bug: 298295554
Merged-In: I85b8bc997d42c9d543b48f536a077ed42c3cb606
Change-Id: I4db19ed300897dabf43bc90a6ee7c942cdc3b7cf
90 files changed, 2632 insertions, 706 deletions
diff --git a/AndroidProducts.mk b/AndroidProducts.mk index b1bc7f1..047c5e1 100644 --- a/AndroidProducts.mk +++ b/AndroidProducts.mk @@ -21,6 +21,7 @@ PRODUCT_MAKEFILES := \ $(LOCAL_DIR)/gsi_car_x86_64.mk \ $(LOCAL_DIR)/sdk_car_arm64.mk \ $(LOCAL_DIR)/sdk_car_arm.mk \ + $(LOCAL_DIR)/sdk_car_md_arm64.mk \ $(LOCAL_DIR)/sdk_car_md_x86_64.mk \ $(LOCAL_DIR)/sdk_car_portrait_x86_64.mk \ $(LOCAL_DIR)/sdk_car_x86.mk \ diff --git a/car_ui_portrait.mk b/car_ui_portrait.mk index dc113d9..6c6b5f4 100644 --- a/car_ui_portrait.mk +++ b/car_ui_portrait.mk @@ -13,8 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -BUILD_EMULATOR_CLUSTER_DISPLAY := false - PRODUCT_COPY_FILES += \ packages/services/Car/car_product/car_ui_portrait/car_ui_portrait.ini:config.ini \ packages/services/Car/car_product/car_ui_portrait/bootanimation/bootanimation.zip:system/media/bootanimation.zip diff --git a/common/car.mk b/common/car.mk index 825cf47..11471fb 100644 --- a/common/car.mk +++ b/common/car.mk @@ -17,17 +17,20 @@ # Auto modules PRODUCT_PACKAGES += \ android.hardware.automotive.vehicle@V1-emulator-service \ - android.hardware.broadcastradio@2.0-service \ + android.hardware.broadcastradio-service.default \ android.hardware.audio.service-caremu \ - android.hardware.automotive.remoteaccess@V1-default-service + android.hardware.automotive.remoteaccess@V1-default-service \ + android.hardware.automotive.ivn@V1-default-service # Runtime Resource Overlay for Connectivity PRODUCT_PACKAGES += \ CarConnectivityOverlay +ifneq ($(EMULATOR_DYNAMIC_MULTIDISPLAY_CONFIG),true) # Emulator configuration PRODUCT_COPY_FILES += \ device/generic/car/common/config.ini:config.ini +endif # EMULATOR_DYNAMIC_MULTIDISPLAY_CONFIG # Car init.rc PRODUCT_COPY_FILES += \ diff --git a/common/car_md.mk b/common/car_md.mk new file mode 100644 index 0000000..4b5ed2b --- /dev/null +++ b/common/car_md.mk @@ -0,0 +1,58 @@ +# +# 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. + +# this overwrites Android Emulator's default input devices for virtual displays in device/generic/goldfish/input/ +PRODUCT_COPY_FILES += \ + device/generic/car/emulator/multi-display/input/virtio_input_multi_touch_7.idc:$(TARGET_COPY_OUT_VENDOR)/usr/idc/virtio_input_multi_touch_7.idc \ + device/generic/car/emulator/multi-display/input/virtio_input_multi_touch_8.idc:$(TARGET_COPY_OUT_VENDOR)/usr/idc/virtio_input_multi_touch_8.idc \ + device/generic/car/emulator/multi-display/input/virtio_input_multi_touch_9.idc:$(TARGET_COPY_OUT_VENDOR)/usr/idc/virtio_input_multi_touch_9.idc + +PRODUCT_COPY_FILES += device/generic/car/common/config.ini.car_md:config.ini + +# Overrides Goldfish's default display settings +PRODUCT_COPY_FILES += \ + device/generic/car/emulator/multi-display/display_layout_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/displayconfig/display_layout_configuration.xml \ + device/generic/car/emulator/multi-display/display_settings.xml:$(TARGET_COPY_OUT_VENDOR)/etc/display_settings.xml + +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.software.managed_users.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.managed_users.xml + +PRODUCT_PACKAGE_OVERLAYS += \ + device/generic/car/emulator/multi-display/overlay + +PRODUCT_COPY_FILES += \ + device/generic/car/emulator/multi-display/car_audio_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/car_audio_configuration.xml + +EMULATOR_DYNAMIC_MULTIDISPLAY_CONFIG := false +BUILD_EMULATOR_CLUSTER_DISPLAY := true +# Set up additional displays +EMULATOR_MULTIDISPLAY_HW_CONFIG := 1,968,792,160,0,2,1408,792,160,0,3,1408,792,160,0 +EMULATOR_MULTIDISPLAY_BOOTANIM_CONFIG := 4619827551948147201,4619827124781842690,4619827540095559171 +ENABLE_CLUSTER_OS_DOUBLE:=true + +PRODUCT_PACKAGES += CarServiceOverlayMdEmulatorOsDouble + +# Enable MZ audio by default +PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ + ro.vendor.simulateMultiZoneAudio=true \ + persist.sys.max_profiles=5 \ + com.android.car.internal.debug.num_auto_populated_users=1 + +PRODUCT_PACKAGES += \ + MultiDisplaySecondaryHomeTestLauncher \ + MultiDisplayTest + +# enables the rro package for passenger(secondary) user. +ENABLE_PASSENGER_SYSTEMUI_RRO := true diff --git a/common/config.ini b/common/config.ini index 127f215..8576698 100644 --- a/common/config.ini +++ b/common/config.ini @@ -1,13 +1,15 @@ hw.audioInput=yes -hw.lcd.density=120 +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=1080x600 -skin.path=1080x600 +skin.name=1408x792 +skin.path=1408x792 disk.dataPartition.size=6G hw.accelerometer=yes hw.accelerometer_uncalibrated=yes diff --git a/common/config.ini.car_md b/common/config.ini.car_md new file mode 100644 index 0000000..74e6abe --- /dev/null +++ b/common/config.ini.car_md @@ -0,0 +1,24 @@ +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=6144 +hw.keyboard=yes +skin.dynamic=yes +skin.name=1848x792 +skin.path=1848x792 +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 diff --git a/common/preinstalled-packages-product-car-emulator.xml b/common/preinstalled-packages-product-car-emulator.xml index a3a71be..75ac5c8 100644 --- a/common/preinstalled-packages-product-car-emulator.xml +++ b/common/preinstalled-packages-product-car-emulator.xml @@ -26,10 +26,6 @@ <install-in user-type="FULL" /> <install-in user-type="SYSTEM" /> </install-in-user-type> - <install-in-user-type package="com.android.car.hvac"> - <install-in user-type="FULL" /> - <install-in user-type="SYSTEM" /> - </install-in-user-type> <install-in-user-type package="com.android.phone"> <install-in user-type="FULL" /> <install-in user-type="SYSTEM" /> @@ -47,12 +43,6 @@ <install-in user-type="SYSTEM" /> </install-in-user-type> - <!-- Android remote display which need to work for all users--> - <install-in-user-type package="com.android.car.acast.source"> - <install-in user-type="FULL" /> - <install-in user-type="SYSTEM" /> - </install-in-user-type> - <!-- This application is needed in ModuleInfoProvider --> <install-in-user-type package="com.android.modulemetadata"> <install-in user-type="FULL" /> diff --git a/common/sepolicy/hal_audio_caremu.te b/common/sepolicy/hal_audio_caremu.te index fefe0cf..34be2d8 100644 --- a/common/sepolicy/hal_audio_caremu.te +++ b/common/sepolicy/hal_audio_caremu.te @@ -13,5 +13,6 @@ binder_use(hal_audio_caremu) carpowerpolicy_callback_domain(hal_audio_caremu) hal_client_domain(hal_audio_caremu, hal_allocator) +get_prop(hal_audio_caremu, vendor_caremu_audiohal_prop) allow hal_audio_caremu audioserver:fifo_file write; diff --git a/common/sepolicy/hal_ivn_default.te b/common/sepolicy/hal_ivn_default.te new file mode 100644 index 0000000..40740de --- /dev/null +++ b/common/sepolicy/hal_ivn_default.te @@ -0,0 +1,3 @@ +# Allow debug dump +allow hal_ivn_default shell:fd use; +allow hal_ivn_default shell:fifo_file write; diff --git a/common/sepolicy/property.te b/common/sepolicy/property.te new file mode 100644 index 0000000..afa1f81 --- /dev/null +++ b/common/sepolicy/property.te @@ -0,0 +1,2 @@ +# Audio HAL +vendor_internal_prop(vendor_caremu_audiohal_prop) diff --git a/common/sepolicy/property_contexts b/common/sepolicy/property_contexts new file mode 100644 index 0000000..6833690 --- /dev/null +++ b/common/sepolicy/property_contexts @@ -0,0 +1,2 @@ +# Audio HAL +ro.vendor.caremu.audiohal. u:object_r:vendor_caremu_audiohal_prop:s0 diff --git a/common/sepolicy/surfaceflinger.te b/common/sepolicy/surfaceflinger.te new file mode 100644 index 0000000..c46089c --- /dev/null +++ b/common/sepolicy/surfaceflinger.te @@ -0,0 +1,2 @@ +# Allow surfaceflinger to perform binder IPC to automotive_display_service +binder_call(surfaceflinger, automotive_display_service_server) diff --git a/common/vhaloverride/ev.car.json b/common/vhaloverride/ev.car.json index b063765..c35b1f1 100644 --- a/common/vhaloverride/ev.car.json +++ b/common/vhaloverride/ev.car.json @@ -1,16 +1,22 @@ -[ - { - "timestamp": 0, - "areaId": 0, - "name": "INFO_FUEL_TYPE", - "value": [10], - "prop": 289472773 - }, - { - "timestamp": 0, - "name": "INFO_EV_CONNECTOR_TYPE", - "value": [1, 5], - "areaId": 0, - "prop": 289472775 - } -] +{ + "apiVersion": 1, + "properties": [ + { + "property": "VehicleProperty::INFO_FUEL_TYPE", + "defaultValue": { + "int32Values": [ + "FuelType::FUEL_TYPE_ELECTRIC" + ] + } + }, + { + "property": "VehicleProperty::INFO_EV_CONNECTOR_TYPE", + "defaultValue": { + "int32Values": [ + "EvConnectorType::IEC_TYPE_1_AC", + "EvConnectorType::IEC_TYPE_1_CCS_DC" + ] + } + } + ] +} diff --git a/common/vhaloverride/uxr.car.json b/common/vhaloverride/uxr.car.json index c7652ba..c06d3d0 100644 --- a/common/vhaloverride/uxr.car.json +++ b/common/vhaloverride/uxr.car.json @@ -1,23 +1,42 @@ -[ - { - "timestamp": 0, - "areaId": 0, - "name": "PERF_VEHICLE_SPEED", - "value": 50.0, - "prop": 291504647 - }, - { - "timestamp": 0, - "areaId": 0, - "name": "GEAR_SELECTION", - "value": 8, - "prop": 289408000 - }, - { - "timestamp": 0, - "areaId": 0, - "name": "PARKING_BRAKE_ON", - "value": 0, - "prop": 287310850 - } -] +{ + "apiVersion": 1, + "properties": [ + { + "property": "VehicleProperty::PERF_VEHICLE_SPEED", + "defaultValue": { + "floatValues": [ + 50.0 + ] + }, + "maxSampleRate": 10.0, + "minSampleRate": 1.0 + }, + { + "property": "VehicleProperty::GEAR_SELECTION", + "defaultValue": { + "int32Values": [ + "VehicleGear::GEAR_DRIVE" + ] + }, + "configArray": [ + "VehicleGear::GEAR_PARK", + "VehicleGear::GEAR_NEUTRAL", + "VehicleGear::GEAR_REVERSE", + "VehicleGear::GEAR_DRIVE", + "VehicleGear::GEAR_1", + "VehicleGear::GEAR_2", + "VehicleGear::GEAR_3", + "VehicleGear::GEAR_4", + "VehicleGear::GEAR_5" + ] + }, + { + "property": "VehicleProperty::PARKING_BRAKE_ON", + "defaultValue": { + "int32Values": [ + 0 + ] + } + } + ] +} 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 c972245..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); @@ -80,10 +80,8 @@ std::vector<uint8_t> PipeComm::read() { int PipeComm::write(const std::vector<uint8_t>& data) { int retVal = 0; - std::lock_guard<std::mutex> lock(mPipeWriteLock); - 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 6c24037..2043ac4 100644 --- a/emulator/Conn/PipeComm/include/PipeComm.h +++ b/emulator/Conn/PipeComm/include/PipeComm.h @@ -44,17 +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::mutex mPipeWriteLock; + + 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 23eaf9c..7c74015 100644 --- a/emulator/aosp_car_emulator.mk +++ b/emulator/aosp_car_emulator.mk @@ -32,31 +32,33 @@ $(call inherit-product, device/generic/car/emulator/usbpt/car_usbpt.mk) TARGET_PRODUCT_PROP := device/generic/car/emulator/usbpt/bluetooth/bluetooth.prop -ifeq (true,$(BUILD_EMULATOR_CLUSTER_DISPLAY)) -PRODUCT_COPY_FILES += \ - device/generic/car/emulator/cluster/display_settings.xml:system/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),) -$(warning Setting displays to $(EMULATOR_MULTIDISPLAY_HW_CONFIG) and bootanims to $(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 +# 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 (true,$(ENABLE_CLUSTER_OS_DOUBLE)) -PRODUCT_PACKAGES += CarServiceOverlayEmulatorOsDouble -else -PRODUCT_PACKAGES += CarServiceOverlayEmulator -endif # ENABLE_CLUSTER_OS_DOUBLE -endif # BUILD_EMULATOR_CLUSTER_DISPLAY +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 PRODUCT_PACKAGES += CarServiceOverlayEmulatorMedia @@ -64,5 +66,11 @@ 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 0eed62a..6b3147f 100644 --- a/emulator/audio/car_emulator_audio.mk +++ b/emulator/audio/car_emulator_audio.mk @@ -28,7 +28,6 @@ PRODUCT_COPY_FILES += \ 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 07aa6b2..7714087 100644 --- a/emulator/audio/driver/audio_hw.c +++ b/emulator/audio/driver/audio_hw.c @@ -91,7 +91,7 @@ static const char* PROP_KEY_IN_PERIOD_COUNT[2] = { #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 @@ -1037,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__); @@ -1054,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); } @@ -1092,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 && @@ -1126,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; } 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/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 index 6fd5ddb..7109d3e 100644 --- a/emulator/multi-display/car_audio_configuration.xml +++ b/emulator/multi-display/car_audio_configuration.xml @@ -21,94 +21,165 @@ - Volume groups in the car environment. --> -<carAudioConfiguration version="2"> +<carAudioConfiguration version="3"> + <mirroringDevices> + <mirroringDevice address="bus1000_mirror_device"/> + </mirroringDevices> <zones> <zone name="primary zone" isPrimary="true" occupantZoneId="0"> - <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> + <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"> - <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="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"> - <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> + <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 index ad23b79..8f63b42 100644 --- a/emulator/multi-display/display_settings.xml +++ b/emulator/multi-display/display_settings.xml @@ -5,19 +5,19 @@ <!-- Display settings for cluster --> <display name="port:1" - forcedDensity="120" + forcedDensity="160" dontMoveToTop="true"/> <!-- Display settings for 2nd Home --> <display name="port:2" shouldShowSystemDecors="true" shouldShowIme="true" - forcedDensity="120" /> + forcedDensity="160" /> <!-- Display settings for 3rd Home --> <display name="port:3" shouldShowSystemDecors="true" shouldShowIme="true" - forcedDensity="120" /> + 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 index 388337f..fe56a0c 100644 --- a/emulator/multi-display/input/virtio_input_multi_touch_7.idc +++ b/emulator/multi-display/input/virtio_input_multi_touch_7.idc @@ -10,3 +10,9 @@ cursor.orientationAware = 1 # 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 index 726843a..3c7c0d8 100644 --- a/emulator/multi-display/input/virtio_input_multi_touch_8.idc +++ b/emulator/multi-display/input/virtio_input_multi_touch_8.idc @@ -10,3 +10,9 @@ cursor.orientationAware = 1 # 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 index 01d55b0..8035aad 100644 --- a/emulator/multi-display/input/virtio_input_multi_touch_9.idc +++ b/emulator/multi-display/input/virtio_input_multi_touch_9.idc @@ -10,3 +10,9 @@ cursor.orientationAware = 1 # 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 index 6efc094..e9a7179 100644 --- 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 @@ -23,7 +23,7 @@ <bool name="config_perDisplayFocusEnabled">true</bool> <!-- Maximum number of supported users --> - <integer name="config_multiuserMaximumUsers">5</integer> + <integer name="config_multiuserMaximumUsers">10</integer> <!-- Maximum number of users we allow to be running at a time --> <integer name="config_multiuserMaxRunningUsers">5</integer> @@ -56,8 +56,13 @@ support PROFILE user. --> <integer name="config_userTypePackageWhitelistMode">2</integer> - <!-- Whether the device allows users to start in background on secondary displays. + <!-- 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_multiuserUsersOnSecondaryDisplays">true</bool> + <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/usbpt/BoardConfig.mk b/emulator/usbpt/BoardConfig.mk index cb12a62..9352b25 100644 --- a/emulator/usbpt/BoardConfig.mk +++ b/emulator/usbpt/BoardConfig.mk @@ -13,5 +13,5 @@ # limitations under the License. # -include device/generic/car/emulator/usbpt/bluetooth/BoardConfig.mk -include device/generic/car/emulator/usbpt/wifi/BoardConfig.mk
\ No newline at end of file +#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 de87874..599d455 100644 --- a/emulator/usbpt/bluetooth/bluetooth.mk +++ b/emulator/usbpt/bluetooth/bluetooth.mk @@ -18,6 +18,7 @@ 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 \ 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/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/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 9029f8f..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-V1", + "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", + ], }, ], diff --git a/emulator_car64_x86_64/BoardConfig.mk b/emulator_car64_x86_64/BoardConfig.mk index bccff6c..977e8a4 100644 --- a/emulator_car64_x86_64/BoardConfig.mk +++ b/emulator_car64_x86_64/BoardConfig.mk @@ -1,4 +1,4 @@ -# Copyright (C) 2022 The Android Open Source Project +# 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. @@ -20,4 +20,5 @@ include device/generic/car/emulator/usbpt/BoardConfig.mk # Override BOARD_SUPER_PARTITION_SIZE to inclease the mounted system partition. BOARD_SUPER_PARTITION_SIZE := 5856296960 -BOARD_EMULATOR_DYNAMIC_PARTITIONS_SIZE = 3489660928 +# 3.5G +BOARD_EMULATOR_DYNAMIC_PARTITIONS_SIZE = 3758096384 diff --git a/gsi_car_arm64.mk b/gsi_car_arm64.mk index 0977da4..e12ca5e 100644 --- a/gsi_car_arm64.mk +++ b/gsi_car_arm64.mk @@ -13,10 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -$(call inherit-product, device/generic/car/gsi_car_base.mk) -$(call inherit-product, device/generic/common/gsi_arm64.mk) +include device/generic/car/gsi_car_base.mk PRODUCT_NAME := gsi_car_arm64 PRODUCT_DEVICE := generic_arm64 -PRODUCT_BRAND := Android -PRODUCT_MODEL := Car GSI on arm64
\ No newline at end of file +PRODUCT_MODEL := Car GSI on arm64 diff --git a/gsi_car_base.mk b/gsi_car_base.mk index 1284cda..b107b31 100644 --- a/gsi_car_base.mk +++ b/gsi_car_base.mk @@ -13,166 +13,42 @@ # See the License for the specific language governing permissions and # limitations under the License. -PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed -PRODUCT_PACKAGES += android.frameworks.automotive.display@1.0-service - -# TODO(b/193056430): Improve this temp fix for "artifact path requirement" -# errors. -# TODO(b/194941497): SHIPSTOP - remove CarServiceModule -PRODUCT_ARTIFACT_PATH_REQUIREMENT_ALLOWED_LIST += \ - root/init.bootstat.rc \ - root/init.car.rc \ - system/apex/com.android.car.framework.apex \ - system/app/Bluetooth/Bluetooth.apk \ - system/app/Bluetooth/lib/arm64/libbluetooth_jni.so \ - system/app/Bluetooth/lib/x86_64/libbluetooth_jni.so \ - system/app/CarFrameworkPackageStubs/CarFrameworkPackageStubs.apk \ - system/app/CarHTMLViewer/CarHTMLViewer.apk \ - system/app/CarLatinIME/CarLatinIME.apk \ - system/app/CarMapsPlaceholder/CarMapsPlaceholder.apk \ - system/app/CarPermissionControllerRRO/CarPermissionControllerRRO.apk \ - system/app/CarRotaryImeRRO/CarRotaryImeRRO.apk \ - system/app/HideCameraApps/HideCameraApps.apk \ - system/app/RotaryIME/RotaryIME.apk \ - system/app/RotaryPlayground/RotaryPlayground.apk \ - system/app/SampleCustomInputService/SampleCustomInputService.apk \ - system/app/SampleRearViewCamera/SampleRearViewCamera.apk \ - system/app/SystemUpdater/SystemUpdater.apk \ - system/bin/android.automotive.evs.manager@1.1 \ - system/bin/canhalconfigurator \ - system/bin/canhalctrl \ - system/bin/canhaldump \ - system/bin/canhalsend \ - system/bin/carbugreportd \ - system/bin/carpowerpolicyd \ - system/bin/carwatchdogd \ - system/bin/com.android.car.procfsinspector \ - system/bin/curl \ - system/bin/evsmanagerd \ - system/bin/vehicle_binding_util \ - system/etc/apns-conf.xml \ - system/etc/canbus_config.pb \ - system/etc/init/android.automotive.evs.manager@1.1.rc \ - system/etc/init/canhalconfigurator.rc \ - system/etc/init/carbugreportd.rc \ - system/etc/init/carpowerpolicyd.rc \ - system/etc/init/carwatchdogd.rc \ - system/etc/init/com.android.car.procfsinspector.rc \ - system/etc/init/evsmanagerd.rc \ - system/etc/init/init.bootstat.car.rc \ - system/etc/init/init.car.rc \ - system/etc/init/vehicle_binding_util.rc \ - system/etc/old-apns-conf.xml \ - system/etc/permissions/android.car.cluster.xml \ - system/etc/permissions/android.car.usb.handler.xml \ - system/etc/permissions/android.hardware.broadcastradio.xml \ - system/etc/permissions/android.hardware.type.automotive.xml \ - system/etc/permissions/car-frameworks-service.xml \ - system/etc/permissions/com.android.car.activityresolver.xml \ - system/etc/permissions/com.android.car.bugreport.xml \ - system/etc/permissions/com.android.car.cartelemetryapp.xml \ - system/etc/permissions/com.android.car.carlauncher.xml \ - system/etc/permissions/com.android.car.cluster.home.xml \ - system/etc/permissions/com.android.car.dialer.xml \ - system/etc/permissions/com.android.car.hvac.xml \ - system/etc/permissions/com.android.car.media.xml \ - system/etc/permissions/com.android.car.messenger.xml \ - system/etc/permissions/com.android.car.oemcarservice.testapp.xml \ - system/etc/permissions/com.android.car.radio.xml \ - system/etc/permissions/com.android.car.rotary.xml \ - system/etc/permissions/com.android.car.settings.xml \ - system/etc/permissions/com.android.car.shell.xml \ - system/etc/permissions/com.android.car.xml \ - system/etc/permissions/com.google.android.car.adaslocation.xml \ - system/etc/permissions/com.google.android.car.defaultstoragemonitoringcompanionapp.xml \ - system/etc/permissions/com.google.android.car.garagemode.testapp.xml \ - system/etc/permissions/com.google.android.car.kitchensink.xml \ - system/etc/permissions/com.google.android.car.networking.preferenceupdater.xml \ - system/etc/permissions/com.google.android.car.networking.railway.xml \ - system/etc/sysconfig/preinstalled-packages-product-car-base.xml \ - system/etc/sysconfig/preinstalled-packages-com.android.car.dialer.xml \ - system/etc/sysconfig/preinstalled-packages-com.android.car.messenger.xml \ - system/etc/vintf/manifest/carpowerpolicyd.xml \ - system/etc/vintf/manifest/carwatchdogd.xml \ - system/etc/vintf/manifest/manifest_android.automotive.evs.manager@1.1.xml \ - system/etc/vintf/manifest/manifest_evsmanagerd.xml \ - system/framework/android.car.jar \ - system/framework/android.car.builtin.jar \ - system/framework/car-frameworks-service.jar \ - system/framework/car-frameworks-service-module.jar \ - system/lib/libsuspend.so \ - system/lib64/android.automotive.watchdog-V3-cpp.so \ - system/lib64/android.automotive.watchdog.internal-cpp.so \ - system/lib64/android.frameworks.automotive.display@1.0.so \ - system/lib64/android.frameworks.automotive.powerpolicy-V1-cpp.so \ - system/lib64/android.frameworks.automotive.powerpolicy-V1-ndk.so \ - system/lib64/android.frameworks.automotive.powerpolicy.internal-V1-cpp.so \ - system/lib64/android.frameworks.automotive.powerpolicy.internal-V1-ndk.so \ - system/lib64/android.hardware.automotive.can@1.0.so \ - system/lib64/android.hardware.automotive.evs@1.0.so \ - system/lib64/android.hardware.automotive.evs@1.1.so \ - system/lib64/android.hardware.automotive.evs-V1-ndk.so \ - system/lib64/android.hardware.automotive.vehicle@2.0.so \ - system/lib64/android.os.statsbootstrap_aidl-cpp.so \ - system/lib64/libbluetooth_jni.so \ - system/lib64/libstatsbootstrap.so \ - system/lib64/libstatslog_evs.so \ - system/lib64/libstatslog_evsmanagerd.so \ - system/lib64/libsuspend.so \ - system/lib64/libwatchdog_binder_mediator.so \ - system/lib64/libwatchdog_package_info_resolver.so \ - system/lib64/libwatchdog_perf_service.so \ - system/lib64/libwatchdog_process_service.so \ - system/media/bootanimation.zip \ - system/priv-app/AdasLocationTestApp/AdasLocationTestApp.apk \ - system/priv-app/BugReportApp/BugReportApp.apk \ - system/priv-app/CarActivityResolver/CarActivityResolver.apk \ - system/priv-app/CarDialerApp/CarDialerApp.apk \ - system/priv-app/CarHvacApp/CarHvacApp.apk \ - system/priv-app/CarLauncher/CarLauncher.apk \ - system/priv-app/CarManagedProvisioning/CarManagedProvisioning.apk \ - system/priv-app/CarMediaApp/CarMediaApp.apk \ - system/priv-app/CarMessengerApp/CarMessengerApp.apk \ - system/priv-app/CarRadioApp/CarRadioApp.apk \ - system/priv-app/CarRotaryController/CarRotaryController.apk \ - system/priv-app/CarService/CarService.apk \ - system/priv-app/CarService/lib/arm64/libcarservicejni.so \ - system/priv-app/CarService/lib/x86_64/libcarservicejni.so \ - system/priv-app/CarSettings/CarSettings.apk \ - system/priv-app/CarShell/CarShell.apk \ - system/priv-app/CarTelemetryApp/CarTelemetryApp.apk \ - system/priv-app/CarUsbHandler/CarUsbHandler.apk \ - system/priv-app/ClusterHomeSample/ClusterHomeSample.apk \ - system/priv-app/DefaultStorageMonitoringCompanionApp/DefaultStorageMonitoringCompanionApp.apk \ - system/priv-app/DirectRenderingCluster/DirectRenderingCluster.apk \ - system/priv-app/EmbeddedKitchenSinkApp/EmbeddedKitchenSinkApp.apk \ - system/priv-app/ExperimentalCarService/ExperimentalCarService.apk \ - system/priv-app/GarageModeTestApp/GarageModeTestApp.apk \ - system/priv-app/LocalMediaPlayer/LocalMediaPlayer.apk \ - system/priv-app/NetworkPreferenceApp/NetworkPreferenceApp.apk \ - system/priv-app/OemCarServiceTestApp/OemCarServiceTestApp.apk \ - system/priv-app/RailwayReferenceApp/RailwayReferenceApp.apk \ - system/priv-app/RotaryIME/RotaryIME.apk \ - system/priv-app/RotaryPlayground/RotaryPlayground.apk \ - system/lib64/libcarservicejni.so \ - system/bin/android.automotive.telemetryd@1.0 \ - system/etc/init/android.automotive.telemetryd@1.0.rc \ - system/etc/vintf/manifest/android.automotive.telemetryd@1.0.xml \ - system/lib64/android.automotive.telemetryd@1.0-impl.so \ - system/lib64/android.frameworks.automotive.telemetry-V1-cpp.so \ - system/lib64/android.automotive.telemetry.internal-ndk.so \ - system/lib64/android.frameworks.automotive.telemetry-V1-ndk.so \ - system/etc/automotive/watchdog/system_resource_overuse_configuration.xml \ - system/etc/automotive/watchdog/third_party_resource_overuse_configuration.xml \ - system/bin/android.frameworks.automotive.display@1.0-service \ - system/etc/init/android.frameworks.automotive.display@1.0-service.rc \ - system/etc/vintf/manifest/manifest_android.frameworks.automotive.display@1.0.xml \ - -PRODUCT_ARTIFACT_PATH_REQUIREMENT_ALLOWED_LIST += %.odex %.vdex %.art - PRODUCT_PACKAGE_OVERLAYS := device/generic/car/common/overlay EMULATOR_VENDOR_NO_SENSORS := true PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true DO_NOT_INCLUDE_BT_SEPOLICY := true -$(call inherit-product, device/generic/car/emulator/aosp_car_emulator.mk) EMULATOR_VENDOR_NO_SOUND := true + +# +# All components inherited here go to system image +# +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +$(call inherit-product, packages/services/Car/car_product/build/car_generic_system.mk) + +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := strict + +# +# All components inherited here go to system_ext image +# +$(call inherit-product, packages/services/Car/car_product/build/car_system_ext.mk) + +# Install a copy of the debug policy to the system_ext partition, and allow +# init-second-stage to load debug policy from system_ext. +# This option is only meant to be set by compliance GSI targets. +PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT := true +PRODUCT_PACKAGES += system_ext_userdebug_plat_sepolicy.cil + +# pKVM is required to support nested virtualization for CF. Ideally we should +# move it out of /system. But it seems to be infeasible for now (b/207336449). +$(call inherit-product, packages/modules/Virtualization/apex/product_packages.mk) + +# +# All components inherited here go to product image +# +$(call inherit-product, packages/services/Car/car_product/build/car_product.mk) + +PRODUCT_BRAND := Android +# +# Special settings for GSI releasing +# +$(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_release.mk) diff --git a/gsi_car_x86_64.mk b/gsi_car_x86_64.mk index 378fa5c..e4b5599 100644 --- a/gsi_car_x86_64.mk +++ b/gsi_car_x86_64.mk @@ -13,10 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -$(call inherit-product, device/generic/car/gsi_car_base.mk) -$(call inherit-product, device/generic/common/gsi_x86_64.mk) +include device/generic/car/gsi_car_base.mk PRODUCT_NAME := gsi_car_x86_64 PRODUCT_DEVICE := generic_x86_64 -PRODUCT_BRAND := Android -PRODUCT_MODEL := Car GSI on x86_64
\ No newline at end of file +PRODUCT_MODEL := Car GSI on x86_64 diff --git a/sdk_car_arm64.mk b/sdk_car_arm64.mk index 2de97e2..61aa930 100644 --- a/sdk_car_arm64.mk +++ b/sdk_car_arm64.mk @@ -15,8 +15,39 @@ PRODUCT_PACKAGE_OVERLAYS := device/generic/car/common/overlay -$(call inherit-product, device/generic/car/emulator/aosp_car_emulator.mk) -$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_phone_arm64.mk) +QEMU_USE_SYSTEM_EXT_PARTITIONS := true +PRODUCT_USE_DYNAMIC_PARTITIONS := true + +ifneq ($(EMULATOR_DYNAMIC_MULTIDISPLAY_CONFIG),true) +# Emulator configuration +PRODUCT_COPY_FILES += \ + device/generic/car/common/config.ini:config.ini +endif # EMULATOR_DYNAMIC_MULTIDISPLAY_CONFIG + +# +# All components inherited here go to system image +# +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +$(call inherit-product, packages/services/Car/car_product/build/car_generic_system.mk) + +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := strict + +# +# All components inherited here go to system_ext image +# +$(call inherit-product, packages/services/Car/car_product/build/car_system_ext.mk) + +# +# All components inherited here go to product image +# +$(call inherit-product, device/generic/car/emulator/car_emulator_product.mk) + +# +# All components inherited here go to vendor image +# +$(call inherit-product, device/generic/car/emulator/car_emulator_vendor.mk) +$(call inherit-product-if-exists, device/generic/goldfish/arm64-vendor.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/board/emulator_arm64/device.mk) EMULATOR_VENDOR_NO_SOUND := true PRODUCT_NAME := sdk_car_arm64 diff --git a/sdk_car_md_arm64.mk b/sdk_car_md_arm64.mk new file mode 100644 index 0000000..a2131bd --- /dev/null +++ b/sdk_car_md_arm64.mk @@ -0,0 +1,26 @@ +# +# 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. + +$(call inherit-product, device/generic/car/common/car_md.mk) +$(call inherit-product, device/generic/car/sdk_car_arm64.mk) + +# TODO(b/266978709): Set it to true after cleaning up the system partition +# changes from this makefile +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := false + +PRODUCT_NAME := sdk_car_md_arm64 +PRODUCT_DEVICE := emulator_car64_arm64 +PRODUCT_BRAND := Android +PRODUCT_MODEL := Car multi-display on arm64 emulator diff --git a/sdk_car_md_x86_64.mk b/sdk_car_md_x86_64.mk index 449474f..7db6934 100644 --- a/sdk_car_md_x86_64.mk +++ b/sdk_car_md_x86_64.mk @@ -13,49 +13,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -# this overwrites Android Emulator's default input devices for virtual displays in device/generic/goldfish/input/ -PRODUCT_COPY_FILES += \ - device/generic/car/emulator/multi-display/input/virtio_input_multi_touch_7.idc:$(TARGET_COPY_OUT_VENDOR)/usr/idc/virtio_input_multi_touch_7.idc \ - device/generic/car/emulator/multi-display/input/virtio_input_multi_touch_8.idc:$(TARGET_COPY_OUT_VENDOR)/usr/idc/virtio_input_multi_touch_8.idc \ - device/generic/car/emulator/multi-display/input/virtio_input_multi_touch_9.idc:$(TARGET_COPY_OUT_VENDOR)/usr/idc/virtio_input_multi_touch_9.idc - -# Overrides Goldfish's default display_settings.xml -PRODUCT_COPY_FILES += \ - device/generic/car/emulator/multi-display/display_settings.xml:$(TARGET_COPY_OUT_VENDOR)/etc/display_settings.xml - -PRODUCT_COPY_FILES += \ - frameworks/native/data/etc/android.software.managed_users.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.managed_users.xml - -PRODUCT_PACKAGE_OVERLAYS += \ - device/generic/car/emulator/multi-display/overlay - -PRODUCT_COPY_FILES += \ - device/generic/car/emulator/multi-display/car_audio_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/car_audio_configuration.xml - -# Use to disable cluster display definitions in aosp_car_emulator -BUILD_EMULATOR_CLUSTER_DISPLAY := false -# Disable dynamic multidisplay support in the base target. -EMULATOR_DYNAMIC_MULTIDISPLAY_CONFIG := false -PRODUCT_PRODUCT_PROPERTIES += \ - hwservicemanager.external.displays=1,400,600,120,0,2,800,600,120,0,3,800,600,120,0 \ - persist.service.bootanim.displays=4619827551948147201,4619827124781842690,4619827540095559171 - -PRODUCT_PACKAGES += ClusterHomeSample ClusterOsDouble -PRODUCT_PACKAGES += CarServiceOverlayEmulatorOsDouble CarServiceOverlayMdEmulatorOsDouble - -# Enable MZ audio by default -PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ - ro.aae.simulateMultiZoneAudio=true \ - persist.sys.max_profiles=5 \ - com.android.car.internal.debug.num_auto_populated_users=1 - -PRODUCT_PACKAGES += \ - MultiDisplaySecondaryHomeTestLauncher \ - MultiDisplayTest - +$(call inherit-product, device/generic/car/common/car_md.mk) $(call inherit-product, device/generic/car/sdk_car_x86_64.mk) +# TODO(b/266978709): Set it to true after cleaning up the system partition +# changes from this makefile +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := false + PRODUCT_NAME := sdk_car_md_x86_64 -PRODUCT_DEVICE := emulator_car_x86_64 +PRODUCT_DEVICE := emulator_car64_x86_64 PRODUCT_BRAND := Android PRODUCT_MODEL := Car multi-display on x86_64 emulator diff --git a/sdk_car_x86_64.mk b/sdk_car_x86_64.mk index 86a6860..afe5c39 100644 --- a/sdk_car_x86_64.mk +++ b/sdk_car_x86_64.mk @@ -15,8 +15,39 @@ PRODUCT_PACKAGE_OVERLAYS := device/generic/car/common/overlay -$(call inherit-product, device/generic/car/emulator/aosp_car_emulator.mk) -$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_phone_x86_64.mk) +QEMU_USE_SYSTEM_EXT_PARTITIONS := true +PRODUCT_USE_DYNAMIC_PARTITIONS := true + +ifneq ($(EMULATOR_DYNAMIC_MULTIDISPLAY_CONFIG),true) +# Emulator configuration +PRODUCT_COPY_FILES += \ + device/generic/car/common/config.ini:config.ini +endif # EMULATOR_DYNAMIC_MULTIDISPLAY_CONFIG + +# +# All components inherited here go to system image +# +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +$(call inherit-product, packages/services/Car/car_product/build/car_generic_system.mk) + +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := strict + +# +# All components inherited here go to system_ext image +# +$(call inherit-product, packages/services/Car/car_product/build/car_system_ext.mk) + +# +# All components inherited here go to product image +# +$(call inherit-product, device/generic/car/emulator/car_emulator_product.mk) + +# +# All components inherited here go to vendor image +# +$(call inherit-product, device/generic/car/emulator/car_emulator_vendor.mk) +$(call inherit-product-if-exists, device/generic/goldfish/x86_64-vendor.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/board/emulator_x86_64/device.mk) EMULATOR_VENDOR_NO_SOUND := true PRODUCT_NAME := sdk_car_x86_64 |