summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Joël Stemmer <jstemmer@google.com> 2025-02-21 06:49:15 +0000
committer Joël Stemmer <jstemmer@google.com> 2025-03-05 07:57:13 +0000
commitd0ee1b4042c312c35d5768399b4264e814d382f6 (patch)
treec399d8bd2881d95d8118a207ab3e05a1a1f98de6
parent2fef05b45c373cced71e4920eb7f6f528f4e3347 (diff)
Set `mStatus` when we don't have a next package to restore
In `dispatchNextRestore` we ask the transport for the next package to restore. If this package is null, we immediately abort the restore. This can happen when the transport encounters some permanent failure and returns null, or when the transport disappears and the `BackupTransportClient` returns null. The problem with the current implementation is that it doesn't set `mStatus` to `TRANSPORT_ERROR`, which means the restore session is reported to have ended successfully. This means we won't attempt to retry the restore. See also ag/26064663. Bug: 397944266 Bug: 381408714 Flag: EXEMPT bugfix Test: manually tested Test: presubmits Change-Id: I40f4406e4180f3224ab3a5d7c32e4c7028d6484e
-rw-r--r--services/backup/java/com/android/server/backup/restore/PerformUnifiedRestoreTask.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/services/backup/java/com/android/server/backup/restore/PerformUnifiedRestoreTask.java b/services/backup/java/com/android/server/backup/restore/PerformUnifiedRestoreTask.java
index 707ae03b3964..166c3ef4b3b4 100644
--- a/services/backup/java/com/android/server/backup/restore/PerformUnifiedRestoreTask.java
+++ b/services/backup/java/com/android/server/backup/restore/PerformUnifiedRestoreTask.java
@@ -589,6 +589,7 @@ public class PerformUnifiedRestoreTask implements BackupRestoreTask {
monitoringExtras);
Slog.e(TAG, "Failure getting next package name");
EventLog.writeEvent(EventLogTags.RESTORE_TRANSPORT_FAILURE);
+ mStatus = BackupTransport.TRANSPORT_ERROR;
nextState = UnifiedRestoreState.FINAL;
return;
} else if (mRestoreDescription == RestoreDescription.NO_MORE_PACKAGES) {