From c0ffce5ddd6446f1d46a49cdfaeda4a2ce408e1d Mon Sep 17 00:00:00 2001 From: Craig Mautner Date: Tue, 1 Jul 2014 12:38:52 -0700 Subject: Use cached thumbnails in Recent tasks. The thumbnail returned from ActivityManager.getTaskThumbnail() now contains either a Bitmap or a ParcelFileDescriptor that points to a file containing a compressed Bitmap. The Recent tasks list is now responsible for all thumbnail Bitmap caching as the activity manager keeps only the most recent 5. This also permits low memory devices to have many more tasks in the Recent tasks list. As part of this CL the concept of subtasks is removed eliminating code supporting the TaskAccessInfo and IThumbnailRetriever classes. Fixes bug 15828934. Change-Id: I0fd0320a1a04e3c78d79357899b83a2fff97abf2 --- .../google/android/test/activity/ActivityTestMain.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'tests/ActivityTests/src') diff --git a/tests/ActivityTests/src/com/google/android/test/activity/ActivityTestMain.java b/tests/ActivityTests/src/com/google/android/test/activity/ActivityTestMain.java index d7a6c1d56fa8..0e063d666793 100644 --- a/tests/ActivityTests/src/com/google/android/test/activity/ActivityTestMain.java +++ b/tests/ActivityTests/src/com/google/android/test/activity/ActivityTestMain.java @@ -72,7 +72,7 @@ public class ActivityTestMain extends Activity { private void addThumbnail(LinearLayout container, Bitmap bm, final ActivityManager.RecentTaskInfo task, - final ActivityManager.TaskThumbnails thumbs, final int subIndex) { + final ActivityManager.TaskThumbnail thumbs) { ImageView iv = new ImageView(this); if (bm != null) { iv.setImageBitmap(bm); @@ -86,9 +86,6 @@ public class ActivityTestMain extends Activity { @Override public void onClick(View v) { if (task.id >= 0 && thumbs != null) { - if (subIndex < (thumbs.numSubThumbbails-1)) { - mAm.removeSubTask(task.id, subIndex+1); - } mAm.moveTaskToFront(task.id, ActivityManager.MOVE_TASK_WITH_HOME); } else { try { @@ -104,11 +101,7 @@ public class ActivityTestMain extends Activity { @Override public boolean onLongClick(View v) { if (task.id >= 0 && thumbs != null) { - if (subIndex < 0) { - mAm.removeTask(task.id, ActivityManager.REMOVE_TASK_KILL_PROCESS); - } else { - mAm.removeSubTask(task.id, subIndex); - } + mAm.removeTask(task.id, ActivityManager.REMOVE_TASK_KILL_PROCESS); buildUi(); return true; } @@ -333,7 +326,7 @@ public class ActivityTestMain extends Activity { if (recents != null) { for (int i=0; i