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

Commit 47811766 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[flexiglass] Verify that NSSL#mIntrinsicContentHeight is not accessed" into main

parents 99b5a966 a12ca9fe
Loading
Loading
Loading
Loading
+18 −12
Original line number Diff line number Diff line
@@ -900,7 +900,7 @@ public class NotificationStackScrollLayout
        drawDebugInfo(canvas, y, Color.LTGRAY,
                /* label= */ "mAmbientState.getStackY() + mAmbientState.getStackHeight() = " + y);

        y = (int) (mAmbientState.getStackY() + mIntrinsicContentHeight);
        y = (int) (mAmbientState.getStackY() + getIntrinsicContentHeight());
        drawDebugInfo(canvas, y, Color.YELLOW,
                /* label= */ "mAmbientState.getStackY() + mIntrinsicContentHeight = " + y);

@@ -1586,7 +1586,7 @@ public class NotificationStackScrollLayout
        if (mMaxDisplayedNotifications != -1) {
            // The stack intrinsic height already contains the correct value when there is a limit
            // in the max number of notifications (e.g. as in keyguard).
            stackEndHeight = mIntrinsicContentHeight;
            stackEndHeight = getIntrinsicContentHeight();
        } else {
            stackEndHeight = Math.max(0f, height - bottomMargin - topPadding);
        }
@@ -1762,14 +1762,6 @@ public class NotificationStackScrollLayout
        updateClipping();
    }

    /**
     * Return the height of the content ignoring the footer.
     */
    public int getIntrinsicContentHeight() {
        SceneContainerFlag.assertInLegacyMode();
        return (int) mIntrinsicContentHeight;
    }

    public void updateClipping() {
        boolean clipped = mRequestedClipBounds != null && !mInHeadsUpPinnedMode
                && !mHeadsUpAnimatingAway;
@@ -2643,7 +2635,7 @@ public class NotificationStackScrollLayout
                (int) scrimTopPadding + (int) mNotificationStackSizeCalculator.computeHeight(
                        /* notificationStackScrollLayout= */ this, mMaxDisplayedNotifications,
                        shelfIntrinsicHeight);
        mIntrinsicContentHeight = height;
        setIntrinsicContentHeight(height);

        // The topPadding can be bigger than the regular padding when qs is expanded, in that
        // state the maxPanelHeight and the contentHeight should be bigger
@@ -5525,7 +5517,6 @@ public class NotificationStackScrollLayout
            println(pw, "hideAmount", mAmbientState.getHideAmount());
            println(pw, "ambientStateSwipingUp", mAmbientState.isSwipingUp());
            println(pw, "maxDisplayedNotifications", mMaxDisplayedNotifications);
            println(pw, "intrinsicContentHeight", mIntrinsicContentHeight);
            println(pw, "intrinsicPadding", mIntrinsicPadding);
            println(pw, "bottomPadding", mBottomPadding);
            dumpRoundedRectClipping(pw);
@@ -5553,6 +5544,7 @@ public class NotificationStackScrollLayout
            mScrollViewFields.dump(pw);
            if (!SceneContainerFlag.isEnabled()) {
                // fields which will be removed with SceneContainer
                println(pw, "intrinsicContentHeight", getIntrinsicContentHeight());
                println(pw, "contentHeight", getContentHeight());
                println(pw, "topPadding", getTopPadding());
            }
@@ -6969,4 +6961,18 @@ public class NotificationStackScrollLayout
        SceneContainerFlag.assertInLegacyMode();
        mContentHeight = contentHeight;
    }

    /**
     * Use {@link ScrollViewFields#intrinsicStackHeight}, when SceneContainerFlag is enabled.
     * @return the height of the content ignoring the footer.
     */
    public float getIntrinsicContentHeight() {
        SceneContainerFlag.assertInLegacyMode();
        return mIntrinsicContentHeight;
    }

    private void setIntrinsicContentHeight(float intrinsicContentHeight) {
        SceneContainerFlag.assertInLegacyMode();
        mIntrinsicContentHeight = intrinsicContentHeight;
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -1188,7 +1188,7 @@ public class NotificationStackScrollLayoutController implements Dumpable {

    public int getIntrinsicContentHeight() {
        SceneContainerFlag.assertInLegacyMode();
        return mView.getIntrinsicContentHeight();
        return (int) mView.getIntrinsicContentHeight();
    }

    /**