diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java index e4351d2c412c4..df70f6bd31daa 100644 --- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java +++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java @@ -839,6 +839,7 @@ public class NavigationBar extends ViewController implements } mFrame = null; mOrientationHandle = null; + notifyNavigationBarSurface(); } // TODO: Remove this when we update nav bar recreation @@ -1003,7 +1004,8 @@ public class NavigationBar extends ViewController implements private void notifyNavigationBarSurface() { ViewRootImpl viewRoot = mView.getViewRootImpl(); - SurfaceControl surface = viewRoot != null + SurfaceControl surface = mView.getParent() != null + && viewRoot != null && viewRoot.getSurfaceControl() != null && viewRoot.getSurfaceControl().isValid() ? viewRoot.getSurfaceControl()