Skip to content

Commit

Permalink
emulator: wait for decryption to complete during avd create
Browse files Browse the repository at this point in the history
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: Ben Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/master@{#761039}
  • Loading branch information
Haiyang Pan authored and Commit Bot committed Apr 21, 2020
1 parent cfe6ac8 commit 0293b88
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions build/android/pylib/local/emulator/avd.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,16 @@ def Create(self,
instance = _AvdInstance(self._emulator_path, self._emulator_home,
self._config)
# 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(
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(
timeout=180, retries=0)
decrypt=True, timeout=180, retries=0)
instance.Stop()

# The multiinstance lock file seems to interfere with the emulator's
Expand Down

0 comments on commit 0293b88

Please sign in to comment.