diff options
| author | Carmen Agimof <carmenagimof@google.com> | 2019-11-20 15:11:06 +0000 |
|---|---|---|
| committer | Carmen Agimof <carmenagimof@google.com> | 2019-12-12 16:29:00 +0000 |
| commit | 4e55418864390dbdd763d8d794bc46dc69f2913d (patch) | |
| tree | 922a7d90e6fc7f969190589221620566bda83cbb /core/java/android | |
| parent | 49f933a71f6a0d5bbbf86d44275ff65c5b12d7ef (diff) | |
Do not try to do a restore at install if the user is not ready for
backup.
Bug: 144155744
This solves a bug which makes staged installs hang. This is
happening because when installing, the PackageManager is waiting for a response to be sent back from
the BackupManagerService after it finishes restoring. In the case of staged installs which happen at boot,
isUserReadyForBackup is false, so the method does nothing and the
PackageManager keeps on waiting on a response.
Test: 1) atest RunBackupFrameworksServicesRoboTests and atest AutoRestoreHostSideTest
2) Manual:
- Applied ag/9722795
- run `atest com.android.tests.rollback.host.StagedRollbackTest#testStagedInstallHang`
- The log file doesn't contain any "Watchdog: *** WATCHDOG KILLING SYSTEM PROCESS: Blocked in handler on main thread (main)".
Change-Id: I294c309b0c7e5a9e12bdbd0c3fc4946767f91cee
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/backup/IBackupManager.aidl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/java/android/app/backup/IBackupManager.aidl b/core/java/android/app/backup/IBackupManager.aidl index 099272d8e3ec..4940976133c5 100644 --- a/core/java/android/app/backup/IBackupManager.aidl +++ b/core/java/android/app/backup/IBackupManager.aidl @@ -597,6 +597,12 @@ interface IBackupManager { boolean isBackupServiceActive(int whichUser); /** + * Checks if the user is ready for backup or not. + * @param userId User id for which this operation should be performed. + */ + boolean isUserReadyForBackup(int userId); + + /** * Ask the framework which dataset, if any, the given package's data would be * restored from if we were to install it right now. * |
