From 69cb1f1908910607b7749974fa378c14fec37edc Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Wed, 8 Mar 2023 07:56:04 +0000 Subject: [PATCH] Update the navbar surface when the nav bar is detached - When detaching the nav bar, also update the surface in OverviewProxyService so it does not parcel and already released surface Bug: 271972752 Test: atest SystemUITests Change-Id: Ie5d2b51e86f089423dfabe02bc0320249abc92f6 --- .../src/com/android/systemui/navigationbar/NavigationBar.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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()