1

I have done below changes in Android R aosp (android-11.0.0_r29) to enable multi-display and test the same on emulator. But I see blank screen (screenshot) when I added another display using emulator settings, no luck even after rebooting/restarting emulator.

Change done in platform/packages/services/Car/service/res/values/config.xml

<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=2,seatSide=oppositeDriver</item>         <!--Newly added -->
</string-array>

<string-array translatable="false" name="config_occupant_display_mapping">
    <item>displayPort=0,displayType=MAIN,occupantZoneId=0</item>                        <!-- Newly added -->
    <item>displayPort=1,displayType=INSTRUMENT_CLUSTER,occupantZoneId=0</item>          <!-- Newly added -->
</string-array>

As per bootcamp videos, I can see emulator configured for Main, Instrument Cluster and Front Passenger as this.

Did I miss any other configurations?

Aswin
  • 1,154
  • 1
  • 11
  • 29

3 Answers3

0

You also need to set: BUILD_EMULATOR_CLUSTER_DISPLAY := true

0

There are following things needs to be adopted to have multiple screen support into Android-R(11).

Note: Your device folder could be different. Since I am using default AAOS emulator.

Move config.xml into overlay folder for example device/generic/car/emulator/cluster/overlay/packages/services/Car/service/res/values

Now, create display_settings.xml inside device/generic/car/emulator/cluster

<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<display-settings>
    <!-- Use physical port number instead of local id -->
    <config identifier="1" />
 
    <!-- Display settings for cluster -->
    <display name="port:1" forcedDensity="120" dontMoveToTop="true" />
</display-settings>

Add this file into product copy rule

PRODUCT_COPY_FILES += \
    device/generic/car/emulator/cluster/display_settings.xml:vendor/etc/display_settings.xml
DEVICE_PACKAGE_OVERLAYS += \
    device/generic/car/emulator/cluster/overlay

Finally export the variable

export BUILD_EMULATOR_CLUSTER_DISPLAY=true

Now, build the emulator again. You would see multiple screen.

Multi display support is already integrated into Android-S by default. Only need to export the variable BUILD_EMULATOR_CLUSTER_DISPLAY and build emulator.

Jitendra
  • 1,015
  • 9
  • 24
0

It is possible to get other displays working on Android S Automotive by adding the following in aosp_car_emulator.mk:

PRODUCT_PRODUCT_PROPERTIES +=
hwservicemanager.external.displays=1,1920,720,160,0,2,1920,720,160,0

And it adds two displays. The first one is a cluster as defined in display_settings.xml

Still we need to export the env variabile in order to use the mentioned prop at compile time.

Very similar also on Android R Automotive

user1638466
  • 300
  • 1
  • 5
  • 18
  • Doesn't seem to be working for me. Anything else I need to change? A guide will be really helpful pls. – Rahul Shukla Jul 19 '22 at 17:41
  • Okay finally got it working. I have three displays (Main, Cluster and Additional). But the issue is the Additional display mirrors the Main display, and of course this is not what I want. Any clue what wrong I might be doing? – Rahul Shukla Jul 20 '22 at 09:57
  • A display is usually a mirror of the primary until an Activity is launched on It.. I don't know if there is a way to avoid it – user1638466 Jul 20 '22 at 18:25
  • umm... that's strange. And it is not the case with AOSP Phone builds. The secondary displays operate independently. – Rahul Shukla Jul 21 '22 at 06:57
  • It mirrors the display when VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR is set: http://aospxref.com/android-13.0.0_r3/xref/frameworks/base/core/java/android/hardware/display/DisplayManager.java#288 If you don;t want mirror then you should use VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY instead. – LLL Jul 26 '23 at 10:05
  • I think this can't be set at AOSP compile-time.. this can be set if you are creating a display at runtime – user1638466 Jul 27 '23 at 12:17