From d9d17ce1330b163cb4c0ec446f6d3351b8869ad4 Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Sun, 20 Aug 2023 16:03:31 -0700 Subject: [PATCH] Init nav mode in TaskbarActivityContext between fold/unfold In RotationButtonController, we show the floating rotation button either when the bar is visible, or when the device is in gesture nav mode, even in an immersive app. The issue here is that mNavMode is not correctly initialized after the device is unfolded. Fixes: 272164624 Test: Open townhall. Fold and then unfold. Tilt the device and make sure the floating rotation button shows. Change-Id: I09025132fdca5c764e66d9ac21f29b853741d257 --- .../com/android/launcher3/taskbar/TaskbarActivityContext.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java index 9fe0c00bac..0b83a88bcc 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java @@ -306,6 +306,9 @@ public class TaskbarActivityContext extends BaseTaskbarContext { // Initialize controllers after all are constructed. mControllers.init(sharedState); + // This may not be necessary and can be reverted once we move towards recreating all + // controllers without re-creating the window + mControllers.rotationButtonController.onNavigationModeChanged(mNavMode.resValue); updateSysuiStateFlags(sharedState.sysuiStateFlags, true /* fromInit */); disableNavBarElements(sharedState.disableNavBarDisplayId, sharedState.disableNavBarState1, sharedState.disableNavBarState2, false /* animate */);