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

Commit 253a041a authored by Jeff DeCew's avatar Jeff DeCew Committed by Android (Google) Code Review
Browse files

Merge changes from topic "rm_NOTIFICATION_INLINE_REPLY_ANIMATION" into main

* changes:
  Clean up SENSITIVE_REVEAL_ANIM flag
  Clean up ANIMATED_NOTIFICATION_SHADE_INSETS flag
  Clean up ASYNC_HYBRID_VIEW_INFLATION flag
  Clean up NOTIFICATION_INLINE_REPLY_ANIMATION flag
parents c3f76c75 c072c478
Loading
Loading
Loading
Loading
+0 −17
Original line number Diff line number Diff line
@@ -76,23 +76,6 @@ object Flags {
    val NOTIFICATION_MEMORY_LOGGING_ENABLED =
            releasedFlag("notification_memory_logging_enabled")

    // TODO(b/260335638): Tracking Bug
    @JvmField
    val NOTIFICATION_INLINE_REPLY_ANIMATION = releasedFlag("notification_inline_reply_animation")

    // TODO(b/288326013): Tracking Bug
    @JvmField
    val NOTIFICATION_ASYNC_HYBRID_VIEW_INFLATION =
        unreleasedFlag("notification_async_hybrid_view_inflation", teamfood = false)

    @JvmField
    val ANIMATED_NOTIFICATION_SHADE_INSETS =
        releasedFlag("animated_notification_shade_insets")

    // TODO(b/268005230): Tracking Bug
    @JvmField
    val SENSITIVE_REVEAL_ANIM = releasedFlag("sensitive_reveal_anim")

    // TODO(b/280783617): Tracking Bug
    @Keep
    @JvmField
+8 −29
Original line number Diff line number Diff line
@@ -39,8 +39,6 @@ import com.android.app.animation.Interpolators;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.policy.SystemBarUtils;
import com.android.systemui.animation.ShadeInterpolation;
import com.android.systemui.flags.Flags;
import com.android.systemui.flags.RefactorFlag;
import com.android.systemui.res.R;
import com.android.systemui.shade.transition.LargeScreenShadeInterpolator;
import com.android.systemui.statusbar.notification.ColorUpdateLogger;
@@ -95,8 +93,6 @@ public class NotificationShelf extends ActivatableNotificationView {
    private float mCornerAnimationDistance;
    private float mActualWidth = -1;
    private int mMaxIconsOnLockscreen;
    private final RefactorFlag mSensitiveRevealAnim =
            RefactorFlag.forView(Flags.SENSITIVE_REVEAL_ANIM);
    private boolean mCanModifyColorOfNotifications;
    private boolean mCanInteract;
    private NotificationStackScrollLayout mHostLayout;
@@ -266,7 +262,7 @@ public class NotificationShelf extends ActivatableNotificationView {
        }

        final float stackEnd = ambientState.getStackY() + ambientState.getStackHeight();
        if (mSensitiveRevealAnim.isEnabled() && viewState.hidden) {
        if (viewState.hidden) {
            // if the shelf is hidden, position it at the end of the stack (plus the clip
            // padding), such that when it appears animated, it will smoothly move in from the
            // bottom, without jump cutting any notifications
@@ -398,10 +394,6 @@ public class NotificationShelf extends ActivatableNotificationView {
        //  find the first view that doesn't overlap with the shelf
        int notGoneIndex = 0;
        int colorOfViewBeforeLast = NO_COLOR;
        boolean backgroundForceHidden = false;
        if (mHideBackground && !((ShelfState) getViewState()).hasItemsInStableShelf) {
            backgroundForceHidden = true;
        }
        int colorTwoBefore = NO_COLOR;
        int previousColor = NO_COLOR;
        float transitionAmount = 0.0f;
@@ -429,8 +421,7 @@ public class NotificationShelf extends ActivatableNotificationView {
                    expandingAnimated, isLastChild, shelfClipStart);

            // TODO(b/172289889) scale mPaddingBetweenElements with expansion amount
            if ((!mSensitiveRevealAnim.isEnabled() && ((isLastChild && !child.isInShelf())
                    || backgroundForceHidden)) || aboveShelf) {
            if (aboveShelf) {
                notificationClipEnd = shelfStart + getIntrinsicHeight();
            } else {
                notificationClipEnd = shelfStart - mPaddingBetweenElements;
@@ -440,8 +431,7 @@ public class NotificationShelf extends ActivatableNotificationView {

            // If the current row is an ExpandableNotificationRow, update its color, roundedness,
            // and icon state.
            if (child instanceof ExpandableNotificationRow) {
                ExpandableNotificationRow expandableRow = (ExpandableNotificationRow) child;
            if (child instanceof ExpandableNotificationRow expandableRow) {
                numViewsInShelf += inShelfAmount;
                int ownColorUntinted = expandableRow.getBackgroundColorWithoutTint();
                if (viewStart >= shelfStart && mNotGoneIndex == -1) {
@@ -471,16 +461,8 @@ public class NotificationShelf extends ActivatableNotificationView {
                notGoneIndex++;
            }

            if (child instanceof ActivatableNotificationView) {
                ActivatableNotificationView anv = (ActivatableNotificationView) child;
                // Because we show whole notifications on the lockscreen, the bottom notification is
                // always "just about to enter the shelf" by normal scrolling rules.  This is fine
                // if the shelf is visible, but if the shelf is hidden, it causes incorrect curling.
                // notificationClipEnd handles the discrepancy between a visible and hidden shelf,
                // so we use that when on the keyguard (and while animating away) to reduce curling.
                final float keyguardSafeShelfStart = !mSensitiveRevealAnim.isEnabled()
                        && mAmbientState.isOnKeyguard() ? notificationClipEnd : shelfStart;
                updateCornerRoundnessOnScroll(anv, viewStart, keyguardSafeShelfStart);
            if (child instanceof ActivatableNotificationView anv) {
                updateCornerRoundnessOnScroll(anv, viewStart, shelfStart);
            }
        }

@@ -519,11 +501,10 @@ public class NotificationShelf extends ActivatableNotificationView {
        mShelfIcons.applyIconStates();
        for (int i = 0; i < getHostLayoutChildCount(); i++) {
            View child = getHostLayoutChildAt(i);
            if (!(child instanceof ExpandableNotificationRow)
            if (!(child instanceof ExpandableNotificationRow row)
                    || child.getVisibility() == GONE) {
                continue;
            }
            ExpandableNotificationRow row = (ExpandableNotificationRow) child;
            updateContinuousClipping(row);
        }
        boolean hideBackground = isHidden;
@@ -613,8 +594,7 @@ public class NotificationShelf extends ActivatableNotificationView {
    private void clipTransientViews() {
        for (int i = 0; i < getHostLayoutTransientViewCount(); i++) {
            View transientView = getHostLayoutTransientView(i);
            if (transientView instanceof ExpandableView) {
                ExpandableView transientExpandableView = (ExpandableView) transientView;
            if (transientView instanceof ExpandableView transientExpandableView) {
                updateNotificationClipHeight(transientExpandableView, getTranslationY(), -1);
            }
        }
@@ -871,10 +851,9 @@ public class NotificationShelf extends ActivatableNotificationView {
    }

    private void setIconTransformationAmount(ExpandableView view, float transitionAmount) {
        if (!(view instanceof ExpandableNotificationRow)) {
        if (!(view instanceof ExpandableNotificationRow row)) {
            return;
        }
        ExpandableNotificationRow row = (ExpandableNotificationRow) view;
        StatusBarIconView icon = row.getShelfIcon();
        NotificationIconContainer.IconState iconState = getIconState(icon);
        if (iconState == null) {
+2 −10
Original line number Diff line number Diff line
@@ -278,8 +278,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
    private OnExpandClickListener mOnExpandClickListener;
    private View.OnClickListener mOnFeedbackClickListener;
    private Path mExpandingClipPath;
    private final RefactorFlag mInlineReplyAnimation =
            RefactorFlag.forView(Flags.NOTIFICATION_INLINE_REPLY_ANIMATION);

    private static boolean shouldSimulateSlowMeasure() {
        return Compile.IS_DEBUG && RefactorFlag.forView(
@@ -2880,8 +2878,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        mSensitiveHiddenInGeneral = hideSensitive;
        int intrinsicAfter = getIntrinsicHeight();
        if (intrinsicBefore != intrinsicAfter) {
            boolean needsAnimation = mFeatureFlags.isEnabled(Flags.SENSITIVE_REVEAL_ANIM);
            notifyHeightChanged(needsAnimation);
            notifyHeightChanged(true);
        }
    }

@@ -3241,13 +3238,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
            mGuts.setActualHeight(height);
            return;
        }
        int contentHeight = Math.max(getMinHeight(), height);
        for (NotificationContentView l : mLayouts) {
            if (mInlineReplyAnimation.isEnabled()) {
            l.setContentHeight(height);
            } else {
                l.setContentHeight(contentHeight);
            }
        }
        if (mIsSummaryWithChildren) {
            mChildrenContainer.setActualHeight(height);
+1 −2
Original line number Diff line number Diff line
@@ -699,8 +699,7 @@ public class NotificationContentView extends FrameLayout implements Notification
        int hint;
        if (mHeadsUpChild != null && isVisibleOrTransitioning(VISIBLE_TYPE_HEADSUP)) {
            hint = getViewHeight(VISIBLE_TYPE_HEADSUP);
            if (mHeadsUpRemoteInput != null && mHeadsUpRemoteInput.isAnimatingAppearance()
                    && mHeadsUpRemoteInputController.isFocusAnimationFlagActive()) {
            if (mHeadsUpRemoteInput != null && mHeadsUpRemoteInput.isAnimatingAppearance()) {
                // While the RemoteInputView is animating its appearance, it should be allowed
                // to overlap the hint, therefore no space is reserved for the hint during the
                // appearance animation of the RemoteInputView
+5 −33
Original line number Diff line number Diff line
@@ -87,7 +87,6 @@ import com.android.systemui.Dumpable;
import com.android.systemui.ExpandHelper;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.flags.Flags;
import com.android.systemui.flags.RefactorFlag;
import com.android.systemui.plugins.ActivityStarter;
import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper;
import com.android.systemui.res.R;
@@ -197,8 +196,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
     */
    private Set<Integer> mDebugTextUsedYPositions;
    private final boolean mDebugRemoveAnimation;
    private final boolean mSensitiveRevealAnimEndabled;
    private final RefactorFlag mAnimatedInsets;
    private int mContentHeight;
    private float mIntrinsicContentHeight;
    private int mPaddingBetweenElements;
@@ -619,9 +616,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
                Flags.LOCKSCREEN_ENABLE_LANDSCAPE);
        mDebugLines = mFeatureFlags.isEnabled(Flags.NSSL_DEBUG_LINES);
        mDebugRemoveAnimation = mFeatureFlags.isEnabled(Flags.NSSL_DEBUG_REMOVE_ANIMATION);
        mSensitiveRevealAnimEndabled = mFeatureFlags.isEnabled(Flags.SENSITIVE_REVEAL_ANIM);
        mAnimatedInsets =
                new RefactorFlag(mFeatureFlags, Flags.ANIMATED_NOTIFICATION_SHADE_INSETS);
        mSectionsManager = Dependency.get(NotificationSectionsManager.class);
        mScreenOffAnimationController =
                Dependency.get(ScreenOffAnimationController.class);
@@ -656,10 +650,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        mGroupMembershipManager = Dependency.get(GroupMembershipManager.class);
        mGroupExpansionManager = Dependency.get(GroupExpansionManager.class);
        setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);
        if (mAnimatedInsets.isEnabled()) {
        setWindowInsetsAnimationCallback(mInsetsCallback);
    }
    }

    /**
     * Set the overexpansion of the panel to be applied to the view.
@@ -1734,11 +1726,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
            return;
        }
        mForcedScroll = v;
        if (mAnimatedInsets.isEnabled()) {
        updateForcedScroll();
        } else {
            scrollTo(v);
        }
    }

    public boolean scrollTo(View v) {
@@ -1783,31 +1771,15 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable

    @Override
    public WindowInsets onApplyWindowInsets(WindowInsets insets) {
        if (!mAnimatedInsets.isEnabled()) {
            mBottomInset = insets.getInsets(WindowInsets.Type.ime()).bottom;
        }
        mWaterfallTopInset = 0;
        final DisplayCutout cutout = insets.getDisplayCutout();
        if (cutout != null) {
            mWaterfallTopInset = cutout.getWaterfallInsets().top;
        }
        if (mAnimatedInsets.isEnabled() && !mIsInsetAnimationRunning) {
        if (!mIsInsetAnimationRunning) {
            // update bottom inset e.g. after rotation
            updateBottomInset(insets);
        }
        if (!mAnimatedInsets.isEnabled()) {
            int range = getScrollRange();
            if (mOwnScrollY > range) {
                // HACK: We're repeatedly getting staggered insets here while the IME is
                // animating away. To work around that we'll wait until things have settled.
                removeCallbacks(mReclamp);
                postDelayed(mReclamp, 50);
            } else if (mForcedScroll != null) {
                // The scroll was requested before we got the actual inset - in case we need
                // to scroll up some more do so now.
                scrollTo(mForcedScroll);
            }
        }
        return insets;
    }

@@ -2576,7 +2548,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
            return;
        }
        child.setOnHeightChangedListener(null);
        if (child instanceof ExpandableNotificationRow && mSensitiveRevealAnimEndabled) {
        if (child instanceof ExpandableNotificationRow) {
            NotificationEntry entry = ((ExpandableNotificationRow) child).getEntry();
            entry.removeOnSensitivityChangedListener(mOnChildSensitivityChangedListener);
        }
@@ -2872,7 +2844,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
    private void onViewAddedInternal(ExpandableView child) {
        updateHideSensitiveForChild(child);
        child.setOnHeightChangedListener(mOnChildHeightChangedListener);
        if (child instanceof ExpandableNotificationRow && mSensitiveRevealAnimEndabled) {
        if (child instanceof ExpandableNotificationRow) {
            NotificationEntry entry = ((ExpandableNotificationRow) child).getEntry();
            entry.addOnSensitivityChangedListener(mOnChildSensitivityChangedListener);
        }
Loading