Fix NPE when adding window with policy to hide
WindowState will be created with token. But it may not add to the token immediately. So at that path it should use getDisplayContent() that use token to get display. Such as addWindow -> initAppOpsState -> setAppOpVisibilityLw -> hide -> startAnimation. "win.mToken.addWindow(win)" executes after that. Bug: 226259929 Test: switch user Change-Id: Ieba9df3bca87d10cd031d25e0b7f1e9a0c311dee
This commit is contained in:
@@ -5288,7 +5288,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
||||
if (mControllableInsetProvider != null) {
|
||||
return;
|
||||
}
|
||||
if (mDisplayContent.inTransition()) {
|
||||
if (getDisplayContent().inTransition()) {
|
||||
// Skip because the animation is usually unnoticeable (e.g. covered by rotation
|
||||
// animation) and the animation bounds could be inconsistent, such as depending
|
||||
// on when the window applies its draw transaction with new rotation.
|
||||
|
||||
Reference in New Issue
Block a user