From 09893e9a4157f77938a0f688d17476df8be9441a Mon Sep 17 00:00:00 2001 From: Christopher Tate Date: Thu, 9 Jun 2016 16:28:26 -0700 Subject: [PATCH] Don't allow restore sessions during backups Gracefully no-op if apps attempt to restore themselves while there is a backup pass in flight. Bug 29135379 Change-Id: I8f0b5cd9d149b703e1de7a3a0b4b54c3aff766b6 --- .../com/android/server/backup/BackupManagerService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/backup/java/com/android/server/backup/BackupManagerService.java b/services/backup/java/com/android/server/backup/BackupManagerService.java index acc2ec30d67f7..334b228a4ab77 100644 --- a/services/backup/java/com/android/server/backup/BackupManagerService.java +++ b/services/backup/java/com/android/server/backup/BackupManagerService.java @@ -9849,7 +9849,11 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF synchronized(this) { if (mActiveRestoreSession != null) { - Slog.d(TAG, "Restore session requested but one already active"); + Slog.i(TAG, "Restore session requested but one already active"); + return null; + } + if (mBackupRunning) { + Slog.i(TAG, "Restore session requested but currently running backups"); return null; } mActiveRestoreSession = new ActiveRestoreSession(packageName, transport);