From c59cd236f12b6af82197fcf4e4f76690392cf379 Mon Sep 17 00:00:00 2001 From: rhed_jao Date: Fri, 9 Oct 2015 22:17:57 +0800 Subject: Stop feeding restore engine if it's already in failed state and exit. b/24518516 modified: services/backup/java/com/android/server/backup/BackupManagerService.java Change-Id: I371b7e87fa7ba408b1255263c6d23821496916a2 Signed-off-by: rhed_jao --- .../backup/java/com/android/server/backup/BackupManagerService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/backup/java/com/android/server/backup/BackupManagerService.java b/services/backup/java/com/android/server/backup/BackupManagerService.java index b3bb9e6..1629a37 100644 --- a/services/backup/java/com/android/server/backup/BackupManagerService.java +++ b/services/backup/java/com/android/server/backup/BackupManagerService.java @@ -7948,6 +7948,11 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF } int toCopy = result; while (toCopy > 0) { + if (!mEngine.isRunning() && RestoreEngine.SUCCESS != mEngine.getResult()) { + Slog.e(TAG, "RestoreEngine fail"); + // throw IOException to abandon this package's restore + throw new IOException(); + } int n = transportIn.read(buffer, 0, toCopy); engineOut.write(buffer, 0, n); toCopy -= n; -- cgit v1.1