Android Automotive 14 Multi-screen Emulator Getting Started And Target Configuration Tutorial

Within the scope of in-vehicle system development, multi-screen collaboration has become a key indicator for measuring the intelligence of a car model. The technological achievement and evolution path behind it is worthy of in-depth exploration.

Multi-screen becomes the new standard feature of smart cars

In the current market, the number of screens in newly released new energy vehicles has increased significantly. In addition to the traditional central control screen and instrument panel, co-pilot entertainment screen, rear entertainment screen, and even armrest control screen, it has become common. Models such as Xpeng G9 and NIO ET9 are equipped with a rich screen array. These screens are not only used for information display, but also undertake entertainment, control and personalized interaction functions. This puts forward higher requirements for the multi-tasking and multi-user management capabilities of the underlying system.

Multi-screen evolution of Android car systems

The Android car operating system launched by Google has a clear and clear iteration process with its multi-screen support capabilities. Initially, it can support multiple display areas, and then assign independent sound sources to different areas. The latest version focuses on improving the multi-user management function. Each upgrade corresponds to the increasingly complex actual usage scenarios of the car cockpit, such as the interface for distinguishing drivers and passengers, and the management of display permissions for applications on different screens. Behind these updates, there is a lot of code refactoring and new functions.

Limitations of the emulator's default configuration

Developers generally use official simulators to carry out preliminary development and testing work. However, in the default engineering configuration, the simulator often only launches a home screen, which is different from the current multi-screen real vehicle environment. Such a single-screen configuration does not allow developers to pre-verify the adaption effects of applications on screens of different sizes and uses, and it is also difficult to test the interaction logic between multiple screens, which has become a real bottleneck in the development process.

Multi-screen support hidden in source code

$(call inherit-product, device/generic/car/common/car_md.mk)
$(call inherit-product, device/generic/car/sdk_car_x86_64.mk)
...
PRODUCT_NAME := sdk_car_md_x86_64
PRODUCT_DEVICE := emulator_car64_x86_64
PRODUCT_BRAND := Android
PRODUCT_MODEL := Car multi-display on x86_64 emulator
...

An in-depth review of the code repository of the Android open source project reveals that the underlying support for vehicle multi-screens has actually been laid out for a long time. Among the code submission records in 2022, there are modifications that specifically add multi-display configurations to the simulator. The relevant code is in the module path responsible for the vehicle system. The configuration file introduced allows developers to declare multiple virtual screens and set properties for each screen separately. This lays the foundation for reproducing the real cockpit layout in the simulation environment.

Compile and debug multi-screen simulator

# 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
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

To enable the multi-screen function, you must recompile the system image. Developers can use specific environment variables that can activate multi-screen configuration in the compilation command. After compiling, start the emulator with extended command line parameters to load multiple virtual screens. In addition, the system provides a series of debugging commands, which are used to dynamically query the screen status, switch display content, or simulate input events during operation, which is very important for debugging interactive logic.

Custom screen parameters and effect verification

PRODUCT_COPY_FILES += 
    frameworks/native/data/etc/android.software.managed_users.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.managed_users.xml

There are four screens, which are created by default by the emulator and have a lower resolution. In order to be close to the real hardware, developers have to modify the configuration file and adjust the resolution to the mainstream 2K or 4K level. After completing the configuration and running it again, you can observe the multi-screen UI effect close to the real car in the simulator. The main driver instrument screen, central control screen, passenger entertainment screen, etc. can display different contents at the same time, thereby verifying the adaptability of the application interface and the scheduling mechanism of system resources.

PRODUCT_PACKAGE_OVERLAYS += 
    device/generic/car/emulator/multi-display/overlay
PRODUCT_PACKAGES += 
    MultiDisplaySecondaryHomeTestLauncher 
    MultiDisplayTest

As the number of screens in the car increases, and the complexity of interactions continues to increase, what is your view on the biggest challenges that future technical solutions such as "one core, multiple screens" will face in terms of performance distribution and safety isolation? Feel free to share your personal insights and pleas in the comments section.

......
<bool name="config_perDisplayFocusEnabled">true</bool>
<bool name="config_supportsSystemDecorsOnSecondaryDisplays">true</bool>
<string name="config_secondaryHomePackage" translatable="false">com.android.car.multidisplay</string>
<bool name="config_multiuserVisibleBackgroundUsers">true</bool>
......

PRODUCT_COPY_FILES += 
    device/generic/car/emulator/multi-display/car_audio_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/car_audio_configuration.xml
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += 
    ro.vendor.simulateMultiZoneAudio=true 
    persist.sys.max_profiles=5 
    com.android.car.internal.debug.num_auto_populated_users=1