Building on Dual Display Framebuffer Settings, I was trying to get a usb-c touch screen and an hdmi monitor running today with android 9.0. I was encouraged when I booted with both plugged in and both displays were getting signal. I could see the Android home screen on both. Also encouraging, the android DisplayManager returns 2 displays “Built-In” and “HDMI”.
However when you use the Presentation API to draw content, it doesn’t behave as expected:
Draw on “Built-In” display: draws on both screens, nav bar buttons still visible and tappable. Ok, good
Draw on “HDMI” display: draws on just USB-C screen, HDMI screen unaffected. Draws on full screen on top of nav bar buttons. Tapping where they were does nothing.
Ok, not too bad for the first try. So I modified /vendor/build.prop as follows:
vendor.hwc.device.primary=DP # I'm not sure, is this correct value for usb-c video?
vendor.hwc.device.extend=HDMI-A
The behavior gets a little weird. Launcher doesn’t mirror to USB-C screen, only shows on HDMI screen. When I open the test app, it is mirrored on both screens. And the Presentation behavior is reversed, content drawn on both “Built in” and “HDMI” displays shows up only on HDMI screen.
I don’t think the “DP” value I put in build.prop is correct, but I also think there’s an issue where the android HWC can’t tell the 2 screens apart. It just thinks there’s 1 screen and it’s “HDMI” regardless of how it’s actually connected.