diff options
author | Christopher Tate <ctate@google.com> | 2014-10-16 21:26:25 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-10-16 21:26:26 +0000 |
commit | 040d89bb0a4563d93073b7a27b3f201ce11dcf58 (patch) | |
tree | 0adde548bb305df550212aad73a35199e7035517 | |
parent | 6b53fb6227b884db2761fa146ed2f4f28100962d (diff) | |
parent | a28b5c51602ccc48f2672274dabda05d3776ccd9 (diff) | |
download | frameworks_base-040d89bb0a4563d93073b7a27b3f201ce11dcf58.zip frameworks_base-040d89bb0a4563d93073b7a27b3f201ce11dcf58.tar.gz frameworks_base-040d89bb0a4563d93073b7a27b3f201ce11dcf58.tar.bz2 |
Merge "Eliminate race condition around backup completion + resumption" into lmp-dev
-rw-r--r-- | services/backup/java/com/android/server/backup/BackupManagerService.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/services/backup/java/com/android/server/backup/BackupManagerService.java b/services/backup/java/com/android/server/backup/BackupManagerService.java index 60801fb..fea1a7a 100644 --- a/services/backup/java/com/android/server/backup/BackupManagerService.java +++ b/services/backup/java/com/android/server/backup/BackupManagerService.java @@ -2855,9 +2855,12 @@ public class BackupManagerService extends IBackupManager.Stub { try { if (mSavedState != null) mSavedState.close(); } catch (IOException e) {} try { if (mBackupData != null) mBackupData.close(); } catch (IOException e) {} try { if (mNewState != null) mNewState.close(); } catch (IOException e) {} - mSavedState = mBackupData = mNewState = null; synchronized (mCurrentOpLock) { + // Current-operation callback handling requires the validity of these various + // bits of internal state as an invariant of the operation still being live. + // This means we make sure to clear all of the state in unison inside the lock. mCurrentOperations.clear(); + mSavedState = mBackupData = mNewState = null; } // If this was a pseudopackage there's no associated Activity Manager state |