From f49b0a45aece9bad42d81a09eeceaf1b5b6c06df Mon Sep 17 00:00:00 2001 From: Craig Mautner Date: Thu, 20 Nov 2014 15:06:40 -0800 Subject: [PATCH] Treat screen-on while pausing as pause timeout. If an activity is started pausing when the screen turns off and hasn't completed pausing by the time the screen turns back on then we will end up showing the activity below it when the pause times out. In particular pausing the secure camera exposes the activity on the top of the stack if you turn the screen off and back on immediately. Immediately forcing the existing pause to complete when the screen comes back on allows the keyguard to obscure anything that might otherwise be shown. Fixes bug 17713150. Change-Id: Ibe275991aa325a7d326bf2a24511aeb4dcbb7e1b --- services/core/java/com/android/server/am/ActivityStack.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index 3a1fafe2bbc3e..eee5340c61297 100755 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -700,6 +700,10 @@ final class ActivityStack { activities.get(activityNdx).setSleeping(false); } } + if (mPausingActivity != null) { + Slog.d(TAG, "awakeFromSleepingLocked: previously pausing activity didn't pause"); + activityPausedLocked(mPausingActivity.appToken, true); + } } /**