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

Commit 34e358db authored by András Kurucz's avatar András Kurucz
Browse files

[Flexiglass] Disable NSSL.getScrollAmountToScrollBoundary usages

- Make NSSL.getScrollRange() always returns 0, because NSSL shouldn't
  have a scroll range anymore. Implicitly this was already happening,
  because NSSL.mContentHeight was never set.
- NSSL.clampScrollPosition() was already a no-op, because
  NSSL.setOwnScrollY doesn't do anything.
- NSSL.updateScrollStateForRemovedChild was already a no-op, because we
  cannot animate stackY changes, or contol NSSL.mOwnScrollY.

Bug: 360091533
Test: verify if stack scrolling still works
Flag: com.android.systemui.scene_container
Change-Id: I769d15b02eb3c008f20b6504a07b0150d401bdb6
parent af00aeaa
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -1387,6 +1387,10 @@ public class NotificationStackScrollLayout
    }

    private void clampScrollPosition() {
        // NSSL doesn't control scrolling with SceneContainer enabled
        if (SceneContainerFlag.isEnabled()) {
            return;
        }
        int scrollRange = getScrollRange();
        if (scrollRange < mOwnScrollY && !mAmbientState.isClearAllInProgress()) {
            // if the scroll boundary updates the position of the stack,
@@ -2444,6 +2448,11 @@ public class NotificationStackScrollLayout
    }

    private int getScrollRange() {
        // TODO(b/360091533) Disable the usages of #getScrollRange() with SceneContainer enabled,
        // because NSSL shouldn't control its own scrolling.
        if (SceneContainerFlag.isEnabled()) {
            return 0;
        }
        // In current design, it only use the top HUN to treat all of HUNs
        // although there are more than one HUNs
        int contentHeight = mContentHeight;
@@ -2874,7 +2883,9 @@ public class NotificationStackScrollLayout
            NotificationEntry entry = ((ExpandableNotificationRow) child).getEntry();
            entry.removeOnSensitivityChangedListener(mOnChildSensitivityChangedListener);
        }
        if (!SceneContainerFlag.isEnabled()) {
            updateScrollStateForRemovedChild(child);
        }
        boolean animationGenerated = container != null && generateRemoveAnimation(child);
        if (animationGenerated) {
            if (!mSwipedOutViews.contains(child) || !isFullySwipedOut(child)) {
@@ -3053,6 +3064,7 @@ public class NotificationStackScrollLayout
     * @param removedChild the removed child
     */
    private void updateScrollStateForRemovedChild(ExpandableView removedChild) {
        SceneContainerFlag.assertInLegacyMode();
        final int startingPosition = getPositionInLinearLayout(removedChild);
        final int childHeight = getIntrinsicHeight(removedChild) + mPaddingBetweenElements;
        final int endPosition = startingPosition + childHeight;
@@ -3074,6 +3086,7 @@ public class NotificationStackScrollLayout
     * @return the amount of scrolling needed to start clipping notifications.
     */
    private int getScrollAmountToScrollBoundary() {
        SceneContainerFlag.assertInLegacyMode();
        if (mShouldUseSplitNotificationShade) {
            return mSidePaddings;
        }