diff options
author | Carmen Agimof <carmenagimof@google.com> | 2019-12-13 16:41:21 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-12-13 16:41:21 +0000 |
commit | 79dc7ed61e35d8579ad3b80409beb2c4297c18f1 (patch) | |
tree | 4c7cc6659f60888916e6f368abd72208a3f0ed86 /services/backup/java | |
parent | 364568f6f7c5b8c0eddd107c86079032c1212b38 (diff) | |
parent | 4e55418864390dbdd763d8d794bc46dc69f2913d (diff) |
Merge "Do not try to do a restore at install if the user is not ready for backup."
Diffstat (limited to 'services/backup/java')
-rw-r--r-- | services/backup/java/com/android/server/backup/BackupManagerService.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/services/backup/java/com/android/server/backup/BackupManagerService.java b/services/backup/java/com/android/server/backup/BackupManagerService.java index e8c5299f47a3..3651a4143953 100644 --- a/services/backup/java/com/android/server/backup/BackupManagerService.java +++ b/services/backup/java/com/android/server/backup/BackupManagerService.java @@ -274,9 +274,14 @@ public class BackupManagerService extends IBackupManager.Stub { } } - // This method should not perform any I/O (e.g. do not call isBackupActivatedForUser), - // it's used in multiple places where I/O waits would cause system lock-ups. - private boolean isUserReadyForBackup(int userId) { + /** + * This method should not perform any I/O (e.g. do not call isBackupActivatedForUser), + * it's used in multiple places where I/O waits would cause system lock-ups. + * @param userId User id for which this operation should be performed. + * @return true if the user is ready for backup and false otherwise. + */ + @Override + public boolean isUserReadyForBackup(int userId) { return mUserServices.get(UserHandle.USER_SYSTEM) != null && mUserServices.get(userId) != null; } |