OSDN Git Service

Fix issue #17674789: Recents icon resets if persist mode is 'persistNever'
authorWale Ogunwale <ogunwale@google.com>
Tue, 21 Oct 2014 23:29:51 +0000 (16:29 -0700)
committerWale Ogunwale <ogunwale@google.com>
Tue, 21 Oct 2014 23:47:58 +0000 (16:47 -0700)
Changed TaskPersister worker thread to not delete task information on disk
for tasks that are in recents but not persistable.

Also, changed logic that writes tasks information (excluding thunmbnail)
to disk to not write information for tasks that are not persistable.

Bug: 17674789
Change-Id: Iff7c5d24677f8a75157bb6be504fc2d9d6bcc098

services/core/java/com/android/server/am/TaskPersister.java
services/core/java/com/android/server/am/TaskRecord.java

index afc781f..b331c84 100644 (file)
@@ -166,7 +166,7 @@ public class TaskPersister {
                         break;
                     }
                 }
-                if (queueNdx < 0) {
+                if (queueNdx < 0 && task.isPersistable) {
                     mWriteQueue.add(new TaskWriteQueueItem(task));
                 }
             } else {
@@ -473,13 +473,15 @@ public class TaskPersister {
                         if (DEBUG) Slog.d(TAG, "mRecents=" + tasks);
                         for (int taskNdx = tasks.size() - 1; taskNdx >= 0; --taskNdx) {
                             final TaskRecord task = tasks.get(taskNdx);
-                            if (DEBUG) Slog.d(TAG, "LazyTaskWriter: task=" + task + " persistable=" +
-                                    task.isPersistable);
-                            if (task.isPersistable && !task.stack.isHomeStack()) {
+                            if (DEBUG) Slog.d(TAG, "LazyTaskWriter: task=" + task +
+                                    " persistable=" + task.isPersistable);
+                            if ((task.isPersistable || task.inRecents)
+                                    && !task.stack.isHomeStack()) {
                                 if (DEBUG) Slog.d(TAG, "adding to persistentTaskIds task=" + task);
                                 persistentTaskIds.add(task.taskId);
                             } else {
-                                if (DEBUG) Slog.d(TAG, "omitting from persistentTaskIds task=" + task);
+                                if (DEBUG) Slog.d(TAG,
+                                        "omitting from persistentTaskIds task=" + task);
                             }
                         }
                     }
index 4dfd23b..ee93233 100644 (file)
@@ -144,7 +144,7 @@ final class TaskRecord {
     boolean mReuseTask = false;
 
     private Bitmap mLastThumbnail; // Last thumbnail captured for this item.
-    private final File mLastThumbnailFile; // File containing last thubmnail.
+    private final File mLastThumbnailFile; // File containing last thumbnail.
     private final String mFilename;
     CharSequence lastDescription; // Last description captured for this item.