Testing and development environment

The fastest and easiest way to test secondary displays is to use a simulated display, which is owned by the system. Because it shares the system_server UID, it's trusted and allowed to host all decor windows and activities.

If you have a device that supports a hardware connection (for example, HDMI or DisplayPort over USB-C), you can use external hardware displays to test.

By default, virtual displays that aren't owned by the system UID are considered to be not trusted and a number of restrictions are applied to prevent the leaking of user data.

Use desktop mode to test new windowing features and capabilities added to the platform in Android 10. It's a developer option targeted for app developers and enables developers to test apps in multi-display and freeform windowing mode environments.

Figure 1. Desktop mode on two displays, simulated (top) and external (bottom)

When device manufacturers want to provide a desktop-like experience, use this feature to showcase the recommended way to implement some of the windowing features.

  1. Enable the Force desktop mode developer option.
  2. Reboot the phone.
  3. Connect the mouse (via USB or Bluetooth).
  4. Create a simulated display from the developer options or use a hardware display.
  5. Launch activities from the launcher on that display and use the mouse to interact.

MD Launcher (platform/development/samples/MultiDisplay) is useful for testing a targeted activity launch and to request a new instance.