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

Commit 72f14da8 authored by András Kurucz's avatar András Kurucz Committed by Android (Google) Code Review
Browse files

Merge changes I75bd6bcc,I769d15b0 into main

* changes:
  [Flexiglass] Verify that NSSL.getTopPadding() is not used
  [Flexiglass] Disable NSSL.getScrollAmountToScrollBoundary usages
parents 79afb49c 4d7cb427
Loading
Loading
Loading
Loading
+16 −7
Original line number Diff line number Diff line
@@ -1389,6 +1389,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,
@@ -1399,13 +1403,9 @@ public class NotificationStackScrollLayout
    }

    public int getTopPadding() {
        // TODO(b/332574413) replace all usages of getTopPadding()
        if (SceneContainerFlag.isEnabled()) {
            return (int) mAmbientState.getStackTop();
        } else {
        SceneContainerFlag.assertInLegacyMode();
        return mAmbientState.getTopPadding();
    }
    }

    private void onTopPaddingChanged(boolean animate) {
        boolean shouldAnimate = animate || mAnimateNextTopPaddingChange;
@@ -2446,6 +2446,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;
@@ -2881,7 +2886,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)) {
@@ -3060,6 +3067,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;
@@ -3081,6 +3089,7 @@ public class NotificationStackScrollLayout
     * @return the amount of scrolling needed to start clipping notifications.
     */
    private int getScrollAmountToScrollBoundary() {
        SceneContainerFlag.assertInLegacyMode();
        if (mShouldUseSplitNotificationShade) {
            return mSidePaddings;
        }