Commit 0293b88e authored by Haiyang Pan's avatar Haiyang Pan Committed by Commit Bot

emulator: wait for decryption to complete during avd create

Android devices with full-disk encryption will be encrypted on first boot,
and then get decrypted to continue the boot process.
Wait for this step to complete otherwise the avd may have
"Encryption Unsuccessful" error.

Also add debug tag "init" for avd create to print more debug message

Need crrev.com/c/2153811 to land first

Bug: 922145, 1057811
Change-Id: I2037d8f6a7f8edfa83e276e7ef94b93bebbb83ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2150398
Commit-Queue: Haiyang Pan <hypan@google.com>
Reviewed-by: default avatarBen Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/master@{#761039}
parent cfe6ac89
...@@ -265,11 +265,16 @@ class AvdConfig(object): ...@@ -265,11 +265,16 @@ class AvdConfig(object):
instance = _AvdInstance(self._emulator_path, self._emulator_home, instance = _AvdInstance(self._emulator_path, self._emulator_home,
self._config) self._config)
# Enable debug for snapshot when it is set to True # Enable debug for snapshot when it is set to True
debug_tags = 'snapshot' if snapshot else None debug_tags = 'init,snapshot' if snapshot else None
instance.Start( instance.Start(
read_only=False, snapshot_save=snapshot, debug_tags=debug_tags) read_only=False, snapshot_save=snapshot, debug_tags=debug_tags)
# Android devices with full-disk encryption are encrypted on first boot,
# and then get decrypted to continue the boot process (See details in
# https://bit.ly/3agmjcM).
# Wait for this step to complete since it can take a while for old OSs
# like M, otherwise the avd may have "Encryption Unsuccessful" error.
device_utils.DeviceUtils(instance.serial).WaitUntilFullyBooted( device_utils.DeviceUtils(instance.serial).WaitUntilFullyBooted(
timeout=180, retries=0) decrypt=True, timeout=180, retries=0)
instance.Stop() instance.Stop()
# The multiinstance lock file seems to interfere with the emulator's # The multiinstance lock file seems to interfere with the emulator's
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment