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

Commit 894696d6 authored by Bill Lin's avatar Bill Lin
Browse files

Dispatch newDisplayLayout in updateDisplayLayout() directly

Empty DisplayLayout do not contain navigation bar height

Bug : Cold boot and set 3 Button NavBar Mode, observe
one handed mode can not trigger

Recovery step : Rotate once and the gesture become activate

Fixes: 183951120
Test: create forest and flash ROM, set NavBar 3 Button Mode.
Test: atest WMShellUnitTests
Change-Id: I930216719f77d0e15d46790e02b788ce9cd80e98
parent b6521e0a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -403,9 +403,9 @@ public class OneHandedController implements RemoteCallable<OneHandedController>
    }

    private void updateDisplayLayout(int displayId) {
        mDisplayAreaOrganizer.setDisplayLayout(
                mDisplayController.getDisplayLayout(displayId));
        mGestureHandler.onDisplayChanged(mDisplayAreaOrganizer.getDisplayLayout());
        final DisplayLayout newDisplayLayout = mDisplayController.getDisplayLayout(displayId);
        mDisplayAreaOrganizer.setDisplayLayout(newDisplayLayout);
        mGestureHandler.onDisplayChanged(newDisplayLayout);
    }

    private ContentObserver getObserver(Runnable onChangeRunnable) {
+1 −1
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ public class OneHandedGestureHandler implements OneHandedTransitionCallback {
    private boolean mIsEnabled;
    private int mNavGestureHeight;
    private boolean mIsThreeButtonModeEnabled;
    private int mRotation;
    private int mRotation = Surface.ROTATION_0;

    @VisibleForTesting
    InputMonitor mInputMonitor;