Merge "Do not wait for invisible activity when turning on screen" into tm-qpr-dev am: 0c8d32f858

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18457824

Change-Id: Ib78917e25637535c5e003e0fe0ba745d62ab3641
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-05-19 08:34:54 +00:00
committed by Automerger Merge Worker
2 changed files with 9 additions and 0 deletions

View File

@@ -2171,6 +2171,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
return;
}
if (mActivityRecord != null) {
if (!mActivityRecord.mVisibleRequested) return;
if (mActivityRecord.allDrawn) {
// The allDrawn of activity is reset when the visibility is changed to visible, so
// the content should be ready if allDrawn is set.

View File

@@ -673,6 +673,14 @@ public class WindowStateTests extends WindowTestsBase {
// Keyguard host window should be always contained. The drawn app or app with starting
// window are unnecessary to draw.
assertEquals(Arrays.asList(keyguardHostWindow, startingWindow), outWaitingForDrawn);
// No need to wait for a window of invisible activity even if the window has surface.
final WindowState invisibleApp = mAppWindow;
invisibleApp.mActivityRecord.mVisibleRequested = false;
invisibleApp.mActivityRecord.allDrawn = false;
outWaitingForDrawn.clear();
invisibleApp.requestDrawIfNeeded(outWaitingForDrawn);
assertTrue(outWaitingForDrawn.isEmpty());
}
@UseTestDisplay(addWindows = W_ABOVE_ACTIVITY)