summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiddle Hsu <riddlehsu@google.com>2020-04-29 23:24:41 +0800
committerRiddle Hsu <riddlehsu@google.com>2020-04-30 01:26:51 +0800
commitb26efb47f920d33c23f6e878d059acb756ab6c4c (patch)
tree44ff6219af4132f7a03739c05f76f6db3d295586
parent33cf9d091c61d47597ebb28b6def7cee6e99b2d2 (diff)
Avoid ignoring turning on screen requested by slow activity
If an activity is slow and has set the flags turn-screen-on and show-when-locked, once it triggers pause timeout, the activity will be stopped, so the relayout invisible won't apply the flags. Then it relies on an additional transaction item to be visible again to request relayout with visible state. Since commit b9faa03, it no longer send a visibility change item (makeClientVisible) for a visible activity, but attempts to resume the activity (makeActiveIfNeeded). That falls to the condition that doesn't check if the activity can turn on screen and just skip the resume, so the activity won't have relayout visible to apply the flags. Bug: 148145248 Test: atest ActivityVisibilityTests#testTurnScreenOnActivity_slowLaunch Change-Id: I0220451e61dcc1e18fbea505e02a2c5dca6a96cb
-rw-r--r--services/core/java/com/android/server/wm/ActivityStack.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityStack.java b/services/core/java/com/android/server/wm/ActivityStack.java
index 2ab03ce058b2..1af722dd84e9 100644
--- a/services/core/java/com/android/server/wm/ActivityStack.java
+++ b/services/core/java/com/android/server/wm/ActivityStack.java
@@ -1687,6 +1687,8 @@ class ActivityStack extends Task {
ensureActivitiesVisible(null /* starting */, 0 /* configChanges */,
!PRESERVE_WINDOWS);
nothingToResume = shouldSleepActivities();
+ } else if (next.currentLaunchCanTurnScreenOn() && next.canTurnScreenOn()) {
+ nothingToResume = false;
}
}
if (nothingToResume) {