Friday, April 5, 2019

Emulator 29.0.1 Canary

Emulator 29.0.1 is now available in the Canary and Dev channels. We will first discuss relevant changes from the Android Q Beta 2 update, then list emulator specific changes.

Android Q Beta 2: Foldable Hardware Profiles

Along with the release of Android Q Beta 2, and Android Studio 3.5 Canary 10, we've added support for foldable virtual devices. Two hardware configurations for foldable devices are provided.
  • 7.3” Foldable: 1536x2152 & folded: 4.6” 840x1960 
  • 8” Foldable: 2200x2480 & folded: 6.6” 1480x2480
Please ensure you have the latest (rev 2+) version of Android Q system images along with Android Studio 3.5 Canary 10+, as foldable UI will not work properly with earlier versions.
Foldable hardware profiles can be selected in the AVD manager in Studio 3.5 Canary 10+:




A new panel is added to the left side of the emulator UI allowing control of whether the device is in folded or unfolded state. The panel itself can be toggled on and off in Extended Controls > Settings.

Android Q Beta 2: Vulkan 1.0 (Windows, Linux)
If you are using a Windows or Linux machine with a modern GPU (Intel HD 5xx+, AMD 4xx+/Vega, NVIDIA GTX 5xx+) , the Q Beta 2 system image supports running Vulkan 1.0 apps. This is currently a rough, experimental level of support where snapshots and Android Vulkan UI are not supported yet, but allows testing individual Android Vulkan apps. To enable, add the following lines to ~/.android/advancedFeatures.ini:

Vulkan = on
GLDirectMem = on

In a future Android Q system image update, Vulkan 1.1 will be supported (the host side emulator bits in 29.0.x already support Vulkan 1.1), and we will also support running the Android UI renderer (Skia) on Vulkan backend for GPUs that have the OpenGL/Vulkan interop extension GL_EXT_memory_object (Most AMD/NVIDIA GPUs, but not Intel).

Known issue: HAXM can sometimes fail to map Vulkan coherent memory to the guest and shuts down the emulator. This will be addressed in an upcoming HAXM update.

The following are changes specific to the emulator that are independent of Q system images:

Linux: Packaging more shared libraries
The headless build of the emulator allows running the emulator on a wide variety of Linux systems, but even with the non-headless (headful?) build of the emulator, we're still working to make sure the Linux emulator can run on a wide variety of systems. In 29.0.1, we now also package libxkbcommon.so with the Linux emulator. This allows the emulator to run on a wider variety of Linux systems.

If the emulator does not launch for you on Linux, please try to run it from the command line with -verbose -no-snapshot and having the environment variable LD_DEBUG=all set, and file a report in Issuetracker so we can add any other shared libraries that might be missing (or fix the issue if it's not because of missing shared libraries).

Foldable UI improvements
  • Fixed issue where foldable hardware profile AVD was created, but foldable UI did not show up by default.
  • Fixed issue where left side panel would disappear when restoring the emulator from a minimized state.
  • Corrected button help string for the fold button in the left panel.
  • Fixed tooltip for the fold button.
  • Added keyboard shortcuts to fold and unfold:
    • Ctrl (Command on macOS) + F: Fold
    • Ctrl (Command on macOS) + U: Unfold
AR Macro UI improvements
  • Fixed issue where video would sometimes keep playing if the selected macro was changed.
  • Improved the UI layout.
Other Changes
  • Fixed issue where on older API levels (< 26), the screen would turn off unexpectedly. This was due to setting the emulator on battery power, but the adb command to set screen off timeout did not go through reliably on these system images.
  • Fixed issue where -partition-size command line option would not set the data partition size even after -wipe-data.
  • glReadPixels GL_IMPLEMENTATION_COLOR_READ_TYPE will now use the host GPU's result instead of an emulated one, which can fix issues with images/assets not showing up because of improper format for readback. More details
  • We no longer use Qt libraries to get the monitor dimensions as it is unreliable. Instead, we use the platform's native windowing libraries to do so.
  • Because Android Q seems to require much more RAM in the device compared to previous Android versions, we've bumped up the minimum RAM size for Android Q to 2 GB. Note that this is still not enough to keep lowmemorykiller from tripping (4 GB is needed to avoid lowmemorykiller events) but is a compromise between the emulator itself becoming extremely slow due to low RAM versus the host system running out of RAM (which is worse).
    • Edit: This may be improved in the future with compressed RAM enabled for the emulator.
  • Fixed issue where Vulkan loader was not packaged with the Linux emulator.
  • AR Macro UI now sends metrics on usage if user has opted in to metrics from Studio.
  • Fixed possible concurrency issue when copy/pasting text into the emulator.
  • Fixed possible concurrency issue when querying GL strings.