Fix issue #3258849: Grab thumbnail when exiting an app via back
Also issue #3281400: Rotating a retained instance fragment leaks the fragment manager
And turn off fragment debug logging.
Change-Id: Ibdd7db82bb35618021bcba421ba92ced7cd691c2
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index d92695c..920bbc9 100644
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -650,7 +650,7 @@
}
}
- public final Bitmap screenshotActivities() {
+ public final Bitmap screenshotActivities(ActivityRecord who) {
Resources res = mService.mContext.getResources();
int w = mThumbnailWidth;
int h = mThumbnailHeight;
@@ -662,7 +662,7 @@
}
if (w > 0) {
- //return mService.mWindowManager.screenshotApplications(w, h);
+ //return mService.mWindowManager.screenshotApplications(who, w, h);
}
return null;
}
@@ -686,7 +686,10 @@
mLastPausedActivity = prev;
prev.state = ActivityState.PAUSING;
prev.task.touchActiveTime();
- prev.thumbnail = screenshotActivities();
+ prev.thumbnail = screenshotActivities(prev);
+ if (prev.task != null) {
+ prev.task.lastThumbnail = prev.thumbnail;
+ }
mService.updateCpuStats();