Fix issue #7214462: Some recent thumbnails are black.
Change-Id: I9a2704c95a8701c9fb6755662fb47d4743099bf9
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index 05ff379..32907f8 100755
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -4329,6 +4329,9 @@
if (resumed != null && resumed.thumbHolder == tr) {
info.mainThumbnail = resumed.stack.screenshotActivities(resumed);
}
+ if (info.mainThumbnail == null) {
+ info.mainThumbnail = tr.lastThumbnail;
+ }
return info;
}
@@ -4343,7 +4346,7 @@
// thumbnail to return.
TaskAccessInfo info = getTaskAccessInfoLocked(tr.taskId, true);
if (info.numSubThumbbails <= 0) {
- return info.mainThumbnail;
+ return info.mainThumbnail != null ? info.mainThumbnail : tr.lastThumbnail;
} else {
return info.subtasks.get(info.numSubThumbbails-1).holder.lastThumbnail;
}