Dynamic System Update (DSU)

Overview

Dynamic System Updates (DSU) is a system feature introduced in Android Q that does the following:

  • Downloads a new GSI (or other Android system image) onto your device.
  • Creates a new dynamic partition.
  • Loads the downloaded GSI onto the new partition.
  • Boots the GSI as a guest OS on the device.

DSU also enables you to easily switch between the current system image and the GSI so you can try GSI without risking corruption of the current system image.

DSU requirements

DSU depends on the Android Dynamic Partition feature and requires the GSIs to be signed by Google or your OEMs as a trusted system image.

DSU is a feature provided by your device’s manufacturer. Refer to your device manufacturer’s support page for availability. Google has enabled DSU on Pixel 3 and Pixel 3 XL devices as of the Android Q Beta 4 release.

Using DSU

This section describes how to use DSU.

Enable DSU feature flag

Before using DSU, ensure the corresponding feature flag is enabled. You can enable the flag through one of the following methods:

  • With a userdebug Android build, you can enable the feature in Settings > System > Developer options > Feature flags > settings_dynamic_system.
  • Use the following adb command:

    adb shell setprop persist.sys.fflag.override.settings_dynamic_system true

Start DSU

After the feature is enabled, launch DSU using the adb tool.

  1. Download the Android Q GSI from the GSI preview page or other GSI image server.

    Note: If you build your GSI, or if you download a GSI from a separate image server, your GSI might not be in unsparse format. In that case, use the following command inside your build tree to convert to an unsparse image: simg2img system.img system_raw.img

  2. Launch DSU using adb:

    gzip -c system_raw.img > system_raw.gz
    adb push system_raw.gz /storage/emulated/0/Download/
    adb shell am start-activity \
    -n com.android.dynsystem/com.android.dynsystem.VerificationActivity  \
    -a android.os.image.action.START_INSTALL    \
    -d file:///storage/emulated/0/Download/system_raw.gz  \
    --el KEY_SYSTEM_SIZE $(du -b system_raw.img|cut -f1)  \
    --el KEY_USERDATA_SIZE 8589934592

    Something similar to the following appears inside your device's notification drawer:

    Installation in progress

    Figure 1. Installation in progress

Boot into GSI

After DSU installs the GSI, a DSU menu appears inside the system notification drawer, as shown in the following image:

DSU menu

Figure 2. DSU menu

At this point, you can do one of the following:

  • Boot into the GSI by clicking RESTART
  • Clean up the GSI by clicking DISCARD

Switch back to the original OS

After you are done with the GSI for your application validation, you can perform a code reboot to boot the system back into its original OS.

When setting the next reboot to use a GSI, you can have the GSI stay installed through multiple boot cycles (until discarded) by enabling sticky mode, or have it used for only one boot cycle by disabling sticky mode.

The following command enables sticky mode:

adb shell gsi_tool enable

The following commands disable sticky mode:

adb shell gsi_tool disable
adb shell gsi_tool enable -s
adb shell gsi_tool disable

Provide feedback

DSU is in an early experimental stage. We welcome your thoughts about DSU. File bugs for any issues that you encounter, or let us know via social media channels such as Reddit or Stack Overflow.