Skip to content

Commit 5f2f413

Browse files
author
Christopher Tate
committed
Don't hang in restore if the transport reports failure
Casualty of the recent refactoring: in this particular error case, the restore sequence wasn't being directed into the finalization state. Fixes bug 5336295. Change-Id: Ibf5570cd1003e123da8b561685de8479663340ce
1 parent 61b645a commit 5f2f413

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

services/java/com/android/server/BackupManagerService.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4372,8 +4372,13 @@ void initiateOneRestore(PackageInfo app, int appVersionCode, IBackupAgent agent,
43724372
ParcelFileDescriptor.MODE_TRUNCATE);
43734373

43744374
if (mTransport.getRestoreData(mBackupData) != BackupConstants.TRANSPORT_OK) {
4375+
// Transport-level failure, so we wind everything up and
4376+
// terminate the restore operation.
43754377
Slog.e(TAG, "Error getting restore data for " + packageName);
43764378
EventLog.writeEvent(EventLogTags.RESTORE_TRANSPORT_FAILURE);
4379+
mBackupData.close();
4380+
mBackupDataName.delete();
4381+
executeNextState(RestoreState.FINAL);
43774382
return;
43784383
}
43794384

0 commit comments

Comments
 (0)