Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0d4f3d72 authored by Winson Chung's avatar Winson Chung
Browse files

Update back-gesture-allowed state before calling state change callback

- When a device is first set up, isHandlingGestures() is false because
  we are in SUW, but when user setup completes, we need to update
  mIsBackGestureAllowed prior to calling the callback which will
  query that state, otherwise there is no other signal to trigger
  another relayout after the state is set.

Bug: 331601358
Test: atest Launcher3Tests
Change-Id: I9b37df4b3e63c6fcdd91e166c613866f8f046554
parent 5ab712cb
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -506,11 +506,13 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
        final boolean previousForcedVisible = mIsButtonForcedVisible;
        mIsButtonForcedVisible =
                mGestureNavigationSettingsObserver.areNavigationButtonForcedVisible();
        // Update this before calling mButtonForcedVisibleCallback since NavigationBar will relayout
        // and query isHandlingGestures() as a part of the callback
        mIsBackGestureAllowed = !mIsButtonForcedVisible;
        if (previousForcedVisible != mIsButtonForcedVisible
                && mButtonForcedVisibleCallback != null) {
            mButtonForcedVisibleCallback.accept(mIsButtonForcedVisible);
        }
        mIsBackGestureAllowed = !mIsButtonForcedVisible;

        final DisplayMetrics dm = res.getDisplayMetrics();
        final float defaultGestureHeight = res.getDimension(