From d3e2a0891b9710dc63fbc15800e7c45909301737 Mon Sep 17 00:00:00 2001 From: Wale Ogunwale Date: Tue, 4 Nov 2014 16:09:19 -0800 Subject: [PATCH] Fix issue #18240452: No recents screenshot when resuming from keyguard. WindowManager.keyguardGoingAway() isn't called early enough when you exit the keyguard by clicking on a notification. So, the WindowState for the preivous activity behind the keyguard is never transitioned to visible and the activity manager then fails to take the screenshot for recents. We will now be taking a screenshot of the activity before we go to sleep so we are not dependent on signals from the keyguard. Change-Id: I2acb2ad7a627d4e446ba11c9a0842d21fa6922d3 --- services/core/java/com/android/server/am/ActivityStack.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index e1b827843d6dc..b61bd8aa90c45 100755 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -835,7 +835,7 @@ final class ActivityStack { prev.task.touchActiveTime(); clearLaunchTime(prev); final ActivityRecord next = mStackSupervisor.topRunningActivityLocked(); - if (mService.mHasRecents && (next == null || next.noDisplay || next.task != prev.task)) { + if (mService.mHasRecents && (next == null || next.noDisplay || next.task != prev.task || uiSleeping)) { prev.updateThumbnail(screenshotActivities(prev), null); } stopFullyDrawnTraceIfNeeded();