Skip to content
Commit 1c781baf authored by Sarp Misoglu's avatar Sarp Misoglu
Browse files

Retrieve a monitor for backup Tasks when it's missing

Currently the monitor is already passed in via the
BackupManager#requestBackup API. This CL covers all the other entry
points to backups (that are still maintained).

Full backups:

1. FullBackupJob -- scheduled by the framework
2. The "bmgr fullbackup" adb command

Key-Value backups:

1. KeyValueBackupJob -- scheduled by the framework
2. BackupManager#backupNow API
3. "bmgr run" adb command

Requesting the monitor in PFTBT.java covers the full backup cases.
Unfortunately we can't request the monitor any earlier since PFTBT
only has access to a transport connection at this point. This means
sometimes (when KVBackupTask starts PFTBT when requestBackup() is
called) we won't need to request the monitor-- hence the null check.

Requesting it in BackupHandler when handling the MSG_RUN_BACKUP
covers the KV backups.

Bug: 252763821
Test: atest CtsBackupHostTestCases
Also manually by running the following commands and verifying the
correct methods are called with logcat logs.
  adb shell cmd jobscheduler run -f android {FullBackupJob id}
  adb shell bmgr fullbackup --all
  adb shell cmd jobscheduler run -f android {KeyValueBackupJob id}
  adb shell bmgr run --all

Change-Id: I1c49c30e5fa8d174f0974aef8384d1a113fa6c88
parent 64379f23
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment