From ea243019f4cd3ff967ca8427aaaacd99eec749d2 Mon Sep 17 00:00:00 2001 From: Yunfan Chen Date: Wed, 18 Jan 2023 15:07:50 +0900 Subject: Update Nav Bar Attrs in onViewAttached This is necessary because the EdgeBackGestureHandler will only be enabled after the view is attached. If there's no other configuration updates, the view may hold the wrong attrs due to disabled edge back gesture handler. This only causes bug when the system config updated a little but caused nav bar recreation, e.g., dark mode settings change. Bug: 262194023 Test: See the reproduce steps in the bug. Change-Id: I8d47e161bf32bb6b5cc8ed560650ce05c396165e --- .../SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java index e0aa6a854822..86232ea841d1 100644 --- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java +++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java @@ -745,6 +745,7 @@ public class NavigationBar extends ViewController implements setWindowVisible(isNavBarWindowVisible()); mView.setBehavior(mBehavior); setNavBarMode(mNavBarMode); + repositionNavigationBar(mCurrentRotation); mView.setUpdateActiveTouchRegionsCallback( () -> mOverviewProxyService.onActiveNavBarRegionChanges( getButtonLocations( -- cgit v1.2.3-59-g8ed1b