Merge "Call finishDrawing for Windows with visiblity GONE" into rvc-dev

This commit is contained in:
Chavi Weingarten
2020-05-12 17:17:21 +00:00
committed by Android (Google) Code Review
2 changed files with 12 additions and 1 deletions

View File

@@ -2259,7 +2259,7 @@ public class WindowManagerService extends IWindowManager.Stub
win.mRelayoutCalled = true;
win.mInRelayout = true;
win.mViewVisibility = viewVisibility;
win.setViewVisibility(viewVisibility);
ProtoLog.i(WM_DEBUG_SCREEN_ON,
"Relayout %s: oldVis=%d newVis=%d. %s", win, oldVisibility,
viewVisibility, new RuntimeException().fillInStackTrace());

View File

@@ -5689,6 +5689,17 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
return mSession.mPid == pid && isNonToastOrStarting() && isVisibleNow();
}
void setViewVisibility(int viewVisibility) {
mViewVisibility = viewVisibility;
// The viewVisibility is set to GONE with a client request to relayout. If this occurs and
// there's a blast sync transaction waiting, finishDrawing will never be called since the
// client will not render when visibility is GONE. Therefore, call finishDrawing here to
// prevent system server from blocking on a window that will not draw.
if (viewVisibility == View.GONE && mUsingBLASTSyncTransaction) {
finishDrawing(null);
}
}
SurfaceControl getClientViewRootSurface() {
return mWinAnimator.getClientViewRootSurface();
}