From 00db92e7e4ff53d658cffc8f42a3e0783cb1e2b0 Mon Sep 17 00:00:00 2001 From: Christopher Tate Date: Sun, 27 Sep 2009 15:16:44 -0700 Subject: [PATCH] Don't forget to clear "backup in progress" state when finishing a pass If a backup pass had been skipped (either because the transport was unavailable or -- in a common case! -- because there was simply no work pending when the periodic backup check fired), we were forgetting to reset the "backup currently in progress" flag. Once we'd done that, the device would *NEVER* perform a backup until it was rebooted, since it would forever think that there was one currently in operation that must not be interfered with. Change-Id: I0d6d7375dc6de99b599222a449934e70fe13ebb9 --- .../java/com/android/server/BackupManagerService.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/services/java/com/android/server/BackupManagerService.java b/services/java/com/android/server/BackupManagerService.java index cb917db9e88d3..15290c182a9e7 100644 --- a/services/java/com/android/server/BackupManagerService.java +++ b/services/java/com/android/server/BackupManagerService.java @@ -637,6 +637,9 @@ class BackupManagerService extends IBackupManager.Stub { IBackupTransport transport = getTransport(mCurrentTransport); if (transport == null) { Log.v(TAG, "Backup requested but no transport available"); + synchronized (mQueueLock) { + mBackupOrRestoreInProgress = false; + } mWakelock.release(); break; } @@ -671,6 +674,9 @@ class BackupManagerService extends IBackupManager.Stub { (new PerformBackupThread(transport, queue, oldJournal)).start(); } else { Log.v(TAG, "Backup requested but nothing pending"); + synchronized (mQueueLock) { + mBackupOrRestoreInProgress = false; + } mWakelock.release(); } } @@ -1686,6 +1692,9 @@ class BackupManagerService extends IBackupManager.Stub { } // Last but not least, release the cpu + synchronized (mQueueLock) { + mBackupOrRestoreInProgress = false; + } mWakelock.release(); } }