Fix the problem that the turn_screen_on Activity does not draw.
A phone call came when the screen was off, displayState may change from Display.STATE_OFF to STATE_ON before registerDisplayListener, which causes ViewRootImpl.mAttachInfo.mDisplayState of InCallActivity to remain Display.STATE_OFF, which causes performDraw to return directly. So we should update ViewRootImpl.mAttachInfo.mDisplayState after registerDisplayListener. Bug: 235446909 Test: pass existing Change-Id: I60b2da453da0ac5c4df6e5a1040defe4bfe726ec
This commit is contained in:
@@ -1100,7 +1100,6 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
if (mView == null) {
|
if (mView == null) {
|
||||||
mView = view;
|
mView = view;
|
||||||
|
|
||||||
mAttachInfo.mDisplayState = mDisplay.getState();
|
|
||||||
mDisplayInstallOrientation = mDisplay.getInstallOrientation();
|
mDisplayInstallOrientation = mDisplay.getInstallOrientation();
|
||||||
mViewLayoutDirectionInitial = mView.getRawLayoutDirection();
|
mViewLayoutDirectionInitial = mView.getRawLayoutDirection();
|
||||||
mFallbackEventHandler.setView(view);
|
mFallbackEventHandler.setView(view);
|
||||||
@@ -1312,6 +1311,9 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
}
|
}
|
||||||
|
|
||||||
registerListeners();
|
registerListeners();
|
||||||
|
// We should update mAttachInfo.mDisplayState after registerDisplayListener
|
||||||
|
// because displayState might be changed before registerDisplayListener.
|
||||||
|
mAttachInfo.mDisplayState = mDisplay.getState();
|
||||||
if ((res & WindowManagerGlobal.ADD_FLAG_USE_BLAST) != 0) {
|
if ((res & WindowManagerGlobal.ADD_FLAG_USE_BLAST) != 0) {
|
||||||
mUseBLASTAdapter = true;
|
mUseBLASTAdapter = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user