summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Riddle Hsu <riddlehsu@google.com> 2024-07-05 07:04:45 +0000
committer Riddle Hsu <riddlehsu@google.com> 2024-07-05 07:04:45 +0000
commit2fb1df695c16e2f02d1f94d02d5c63173029f6f6 (patch)
tree3b3e008f9f902a60732e9a498a507a11a7b3b096
parentf67c19a6699d6981f44f1c8a67a34387af16a70a (diff)
Do not block transition by non-resumed relayouted activity
When keyguard is showing or screen is off, only top activity can apply show-when-lock or turn-screen-on. The non-top visible activity (e.g. the top activity is translucent style) shouldn't be tracked as unknown visibility, because its visibility should rely on if the top can be real visible. Especially UnknownAppVisibilityController assumes that the tracked activities will perform relayout after completing resume, but non-top visible activity won't report competed resume, which causes the opening transition to wait until timeout. Bug: 349022462 Flag: EXEMPT bugfix Test: Assume A,B,C are activities in the same task with android:turnScreenOn="true" android:showWhenLocked="true" 1. Enter lock screen. 2. Launch A (test main). 3. Press A's button to call startActivity for B and C. (B won't be launched because C occludes it) 4. C's onCreate calls Activity#setTranslucent(true) which makes B start with andResume=false 5. The transition should run immediately from A to C. Change-Id: I6f6662cf6cc3d760684ba589c62f32a66b86317f
-rw-r--r--services/core/java/com/android/server/wm/UnknownAppVisibilityController.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/UnknownAppVisibilityController.java b/services/core/java/com/android/server/wm/UnknownAppVisibilityController.java
index c0713966d8de..3947d02c86c9 100644
--- a/services/core/java/com/android/server/wm/UnknownAppVisibilityController.java
+++ b/services/core/java/com/android/server/wm/UnknownAppVisibilityController.java
@@ -153,6 +153,10 @@ class UnknownAppVisibilityController {
mUnknownApps.put(activity, UNKNOWN_STATE_WAITING_VISIBILITY_UPDATE);
mDisplayContent.notifyKeyguardFlagsChanged();
notifyVisibilitiesUpdated();
+ } else if (state == UNKNOWN_STATE_WAITING_RESUME
+ && !activity.isState(ActivityRecord.State.RESUMED)) {
+ Slog.d(TAG, "UAVC: skip waiting for non-resumed relayouted " + activity);
+ mUnknownApps.remove(activity);
}
}