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

Commit bccd93b3 authored by Tony Wickham's avatar Tony Wickham Committed by Android Build Coastguard Worker
Browse files

Fix onIsStashedChanged() not called in 3 button mode

Calling this ensures we update touchableRegion accordingly.

Since this will also start the stashed handle region sampling,
which we don't need for 3 button mode, also adjust logic to
check that the StashedHandleView is actually visible.

Flag: None
Test: Lock screen, run `adb shell cmd uimode night yes`, unlock
Test: Lock screen, rotate, unlock
  In both cases, verify touchableRegion is accurate
Fixes: 315393203
(cherry picked from commit 438e6c90)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5c3404751afa62a8cab91b357e30a9595724c942)
Merged-In: I951af6b97cad0ee0f362dc22f3996cfd9286a21e
Change-Id: I951af6b97cad0ee0f362dc22f3996cfd9286a21e
parent 71703b74
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT
        });
        initRegionSampler();
        if (isPhoneGestureNavMode(deviceProfile)) {
            onIsStashedChanged(true);
            onIsStashedChanged();
        }
    }

@@ -236,10 +236,10 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT
    }

    /** Called when taskbar is stashed or unstashed. */
    public void onIsStashedChanged(boolean isStashed) {
        mIsStashed = isStashed;
    public void onIsStashedChanged() {
        mIsStashed = isStashedHandleVisible();
        updateRegionSamplingWindowVisibility();
        if (isStashed) {
        if (mIsStashed) {
            mStashedHandleView.updateSampledRegion(mStashedHandleBounds);
            mRegionSamplingHelper.start(mStashedHandleView.getSampledRegion());
        } else {
+4 −3
Original line number Diff line number Diff line
@@ -600,6 +600,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
            mAnimator.addListener(AnimatorListeners.forEndCallback(() -> {
                mAnimator = null;
                mIsStashed = isStashed;
                onIsStashedChanged();
            }));
            return;
        }
@@ -614,7 +615,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
            @Override
            public void onAnimationStart(Animator animation) {
                mIsStashed = isStashed;
                onIsStashedChanged(mIsStashed);
                onIsStashedChanged();

                cancelTimeoutIfExists();
            }
@@ -839,9 +840,9 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
                .setDuration(TASKBAR_HINT_STASH_DURATION).start();
    }

    private void onIsStashedChanged(boolean isStashed) {
    private void onIsStashedChanged() {
        mControllers.runAfterInit(() -> {
            mControllers.stashedHandleViewController.onIsStashedChanged(isStashed);
            mControllers.stashedHandleViewController.onIsStashedChanged();
            mControllers.taskbarInsetsController.onTaskbarOrBubblebarWindowHeightOrInsetsChanged();
        });
    }