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

Commit f805a24f authored by Shawn Lee's avatar Shawn Lee
Browse files

Only reset mExpectingSynthesizedDown once expansion actually starts

Previously, when expanding the shade via external input, mPanelExpanded would store an intermediate value between NPVC receiving the remote signal and the expansion height actually becoming non-zero. In order to avoid this, mExpectingSynthesizedDown is now not reset when we use it to trigger a fling, but rather when that fling either actually increases the expansion height to non-zero, or is cancelled.

Bug: 365234590
Test: Manually verified via logging that mPanelExpanded value is now only set once (and correctly) on shade expansion
Flag: EXEMPT bugfix
Change-Id: Ibf34b327620956a7f314f733e44d32c64ebfc5e5
parent be56c75e
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -2220,6 +2220,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
    @VisibleForTesting
    void onFlingEnd(boolean cancelled) {
        mIsFlinging = false;
        mExpectingSynthesizedDown = false;
        // No overshoot when the animation ends
        setOverExpansionInternal(0, false /* isFromGesture */);
        setAnimator(null);
@@ -2352,7 +2353,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
            return;
        }
        if (mExpectingSynthesizedDown) {
            mExpectingSynthesizedDown = false;
            // Window never will receive touch events that typically trigger haptic on open.
            maybeVibrateOnOpening(false /* openingWithTouch */);
            fling(velocity > 1f ? 1000f * velocity : 0  /* expand */);
@@ -3994,6 +3994,9 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
            }
            mExpandedFraction = Math.min(1f,
                    maxPanelHeight == 0 ? 0 : mExpandedHeight / maxPanelHeight);
            if (mExpandedFraction > 0f && mExpectingSynthesizedDown) {
                mExpectingSynthesizedDown = false;
            }
            mShadeRepository.setLegacyShadeExpansion(mExpandedFraction);
            mQsController.setShadeExpansion(mExpandedHeight, mExpandedFraction);
            mExpansionDragDownAmountPx = h;