diff options
author | Craig Mautner <cmautner@google.com> | 2014-05-26 16:52:58 -0700 |
---|---|---|
committer | Craig Mautner <cmautner@google.com> | 2014-05-26 16:52:58 -0700 |
commit | 87f851d0bad0183eccbb59b1fb378db9155e4a66 (patch) | |
tree | 57933ee48a128e086a0f0518ea2ae1bcbbadae78 /services | |
parent | 41b170d6066cb52bb3e396c608b01f2981b95e5d (diff) | |
download | frameworks_base-87f851d0bad0183eccbb59b1fb378db9155e4a66.zip frameworks_base-87f851d0bad0183eccbb59b1fb378db9155e4a66.tar.gz frameworks_base-87f851d0bad0183eccbb59b1fb378db9155e4a66.tar.bz2 |
Only start TaskPersister once.
Because ActivityManagerService.systemReady() is reentrant we could
restore tasks and start the TaskPersister more than one time. This
fix limits operations on TaskPersister to one time only.
Fixes bug 15256579.
Change-Id: I6bf2c26b37acdfd9b15a6f277966966b743d03b6
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerService.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 88bebcb..1755472 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -9574,11 +9574,13 @@ public final class ActivityManagerService extends ActivityManagerNative return; } - mRecentTasks = mTaskPersister.restoreTasksLocked(); - if (!mRecentTasks.isEmpty()) { - mStackSupervisor.createStackForRestoredTaskHistory(mRecentTasks); + if (mRecentTasks == null) { + mRecentTasks = mTaskPersister.restoreTasksLocked(); + if (!mRecentTasks.isEmpty()) { + mStackSupervisor.createStackForRestoredTaskHistory(mRecentTasks); + } + mTaskPersister.startPersisting(); } - mTaskPersister.startPersisting(); // Check to see if there are any update receivers to run. if (!mDidUpdate) { |