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

Commit d2587a6f authored by Dave Mankoff's avatar Dave Mankoff Committed by Steve Elliott
Browse files

Move HeadsUpManager out of NSSL

Move the HeadsUpManager out of NotificationStackScrollLayout. All
relevant information is now pushed to the NSSL via
NotificationStackScrollLayoutController.

Bug: 147245740
Test: atest SystemUITests
Change-Id: I63f9107be782b17545ebcb57045e4f987f928c78
parent d7efb117
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -185,6 +185,7 @@ public abstract class AlertingNotificationManager implements NotificationLifetim
        mAlertEntries.put(entry.getKey(), alertEntry);
        mAlertEntries.put(entry.getKey(), alertEntry);
        onAlertEntryAdded(alertEntry);
        onAlertEntryAdded(alertEntry);
        entry.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
        entry.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
        entry.setIsAlerting(true);
    }
    }


    /**
    /**
+9 −0
Original line number Original line Diff line number Diff line
@@ -177,6 +177,7 @@ public final class NotificationEntry extends ListEntry {
    @Nullable private Long mPendingAnimationDuration;
    @Nullable private Long mPendingAnimationDuration;
    private boolean mIsMarkedForUserTriggeredMovement;
    private boolean mIsMarkedForUserTriggeredMovement;
    private boolean mShelfIconVisible;
    private boolean mShelfIconVisible;
    private boolean mIsAlerting;


    /**
    /**
     * @param sbn the StatusBarNotification from system server
     * @param sbn the StatusBarNotification from system server
@@ -955,6 +956,14 @@ public final class NotificationEntry extends ListEntry {
        mIsMarkedForUserTriggeredMovement = marked;
        mIsMarkedForUserTriggeredMovement = marked;
    }
    }


    public void setIsAlerting(boolean isAlerting) {
        mIsAlerting = isAlerting;
    }

    public boolean isAlerting() {
        return mIsAlerting;
    }

    /** Information about a suggestion that is being edited. */
    /** Information about a suggestion that is being edited. */
    public static class EditedSuggestionInfo {
    public static class EditedSuggestionInfo {


+10 −9
Original line number Original line Diff line number Diff line
@@ -81,17 +81,17 @@ public class AmbientState {
    private boolean mAppearing;
    private boolean mAppearing;
    private float mPulseHeight = MAX_PULSE_HEIGHT;
    private float mPulseHeight = MAX_PULSE_HEIGHT;
    private float mDozeAmount = 0.0f;
    private float mDozeAmount = 0.0f;
    private HeadsUpManager mHeadUpManager;
    private Runnable mOnPulseHeightChangedListener;
    private Runnable mOnPulseHeightChangedListener;
    private ExpandableNotificationRow mTrackedHeadsUpRow;
    private ExpandableNotificationRow mTrackedHeadsUpRow;
    private float mAppearFraction;
    private float mAppearFraction;


    /** Tracks the state from AlertingNotificationManager#hasNotifications() */
    private boolean mHasAlertEntries;

    public AmbientState(
    public AmbientState(
            Context context,
            Context context,
            @NonNull SectionProvider sectionProvider,
            @NonNull SectionProvider sectionProvider) {
            HeadsUpManager headsUpManager) {
        mSectionProvider = sectionProvider;
        mSectionProvider = sectionProvider;
        mHeadUpManager = headsUpManager;
        reload(context);
        reload(context);
    }
    }


@@ -393,7 +393,7 @@ public class AmbientState {
    }
    }


    public boolean hasPulsingNotifications() {
    public boolean hasPulsingNotifications() {
        return mPulsing && mHeadUpManager != null && mHeadUpManager.hasNotifications();
        return mPulsing && mHasAlertEntries;
    }
    }


    public void setPulsing(boolean hasPulsing) {
    public void setPulsing(boolean hasPulsing) {
@@ -408,10 +408,7 @@ public class AmbientState {
    }
    }


    public boolean isPulsing(NotificationEntry entry) {
    public boolean isPulsing(NotificationEntry entry) {
        if (!mPulsing || mHeadUpManager == null) {
        return mPulsing && entry.isAlerting();
            return false;
        }
        return mHeadUpManager.isAlerting(entry.getKey());
    }
    }


    public boolean isPanelTracking() {
    public boolean isPanelTracking() {
@@ -568,4 +565,8 @@ public class AmbientState {
    public float getAppearFraction() {
    public float getAppearFraction() {
        return mAppearFraction;
        return mAppearFraction;
    }
    }

    public void setHasAlertEntries(boolean hasAlertEntries) {
        mHasAlertEntries = hasAlertEntries;
    }
}
}
+20 −58
Original line number Original line Diff line number Diff line
@@ -92,7 +92,6 @@ import com.android.systemui.Dumpable;
import com.android.systemui.ExpandHelper;
import com.android.systemui.ExpandHelper;
import com.android.systemui.Interpolators;
import com.android.systemui.Interpolators;
import com.android.systemui.R;
import com.android.systemui.R;
import com.android.systemui.plugins.FalsingManager;
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper;
import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.CommandQueue;
@@ -102,7 +101,6 @@ import com.android.systemui.statusbar.FeatureFlags;
import com.android.systemui.statusbar.NotificationRemoteInputManager;
import com.android.systemui.statusbar.NotificationRemoteInputManager;
import com.android.systemui.statusbar.NotificationShelf;
import com.android.systemui.statusbar.NotificationShelf;
import com.android.systemui.statusbar.NotificationShelfController;
import com.android.systemui.statusbar.NotificationShelfController;
import com.android.systemui.statusbar.RemoteInputController;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.SysuiStatusBarStateController;
import com.android.systemui.statusbar.SysuiStatusBarStateController;
import com.android.systemui.statusbar.notification.DynamicPrivacyController;
import com.android.systemui.statusbar.notification.DynamicPrivacyController;
@@ -132,7 +130,6 @@ import com.android.systemui.statusbar.notification.row.NotificationGutsManager;
import com.android.systemui.statusbar.notification.row.NotificationSnooze;
import com.android.systemui.statusbar.notification.row.NotificationSnooze;
import com.android.systemui.statusbar.notification.row.StackScrollerDecorView;
import com.android.systemui.statusbar.notification.row.StackScrollerDecorView;
import com.android.systemui.statusbar.phone.HeadsUpAppearanceController;
import com.android.systemui.statusbar.phone.HeadsUpAppearanceController;
import com.android.systemui.statusbar.phone.HeadsUpManagerPhone;
import com.android.systemui.statusbar.phone.HeadsUpTouchHelper;
import com.android.systemui.statusbar.phone.HeadsUpTouchHelper;
import com.android.systemui.statusbar.phone.LockscreenGestureLogger;
import com.android.systemui.statusbar.phone.LockscreenGestureLogger;
import com.android.systemui.statusbar.phone.LockscreenGestureLogger.LockscreenUiEvent;
import com.android.systemui.statusbar.phone.LockscreenGestureLogger.LockscreenUiEvent;
@@ -340,13 +337,11 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
    private HashSet<ExpandableView> mClearTransientViewsWhenFinished = new HashSet<>();
    private HashSet<ExpandableView> mClearTransientViewsWhenFinished = new HashSet<>();
    private HashSet<Pair<ExpandableNotificationRow, Boolean>> mHeadsUpChangeAnimations
    private HashSet<Pair<ExpandableNotificationRow, Boolean>> mHeadsUpChangeAnimations
            = new HashSet<>();
            = new HashSet<>();
    private HeadsUpManagerPhone mHeadsUpManager;
    private final NotificationRoundnessManager mRoundnessManager;
    private final NotificationRoundnessManager mRoundnessManager;
    private boolean mTrackingHeadsUp;
    private boolean mTrackingHeadsUp;
    private ScrimController mScrimController;
    private ScrimController mScrimController;
    private boolean mForceNoOverlappingRendering;
    private boolean mForceNoOverlappingRendering;
    private final ArrayList<Pair<ExpandableNotificationRow, Boolean>> mTmpList = new ArrayList<>();
    private final ArrayList<Pair<ExpandableNotificationRow, Boolean>> mTmpList = new ArrayList<>();
    private FalsingManager mFalsingManager;
    private boolean mAnimationRunning;
    private boolean mAnimationRunning;
    private ViewTreeObserver.OnPreDrawListener mRunningAnimationUpdater
    private ViewTreeObserver.OnPreDrawListener mRunningAnimationUpdater
            = new ViewTreeObserver.OnPreDrawListener() {
            = new ViewTreeObserver.OnPreDrawListener() {
@@ -513,6 +508,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
    private NotificationStackScrollLayoutController mController;
    private NotificationStackScrollLayoutController mController;


    private boolean mKeyguardMediaControllorVisible;
    private boolean mKeyguardMediaControllorVisible;
    private NotificationEntry mTopHeadsUpEntry;
    private long mNumHeadsUp;


    private final ExpandableView.OnHeightChangedListener mOnChildHeightChangedListener =
    private final ExpandableView.OnHeightChangedListener mOnChildHeightChangedListener =
            new ExpandableView.OnHeightChangedListener() {
            new ExpandableView.OnHeightChangedListener() {
@@ -562,8 +559,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
            NotificationRoundnessManager notificationRoundnessManager,
            NotificationRoundnessManager notificationRoundnessManager,
            DynamicPrivacyController dynamicPrivacyController,
            DynamicPrivacyController dynamicPrivacyController,
            SysuiStatusBarStateController statusbarStateController,
            SysuiStatusBarStateController statusbarStateController,
            HeadsUpManagerPhone headsUpManager,
            FalsingManager falsingManager,
            NotificationGutsManager notificationGutsManager,
            NotificationGutsManager notificationGutsManager,
            NotificationSectionsManager notificationSectionsManager,
            NotificationSectionsManager notificationSectionsManager,
            ForegroundServiceSectionController fgsSectionController,
            ForegroundServiceSectionController fgsSectionController,
@@ -580,9 +575,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        mRoundnessManager = notificationRoundnessManager;
        mRoundnessManager = notificationRoundnessManager;


        mNotificationGutsManager = notificationGutsManager;
        mNotificationGutsManager = notificationGutsManager;
        mHeadsUpManager = headsUpManager;
        mHeadsUpManager.setAnimationStateHandler(this::setHeadsUpGoingAwayAnimationsAllowed);
        mFalsingManager = falsingManager;
        mFgsSectionController = fgsSectionController;
        mFgsSectionController = fgsSectionController;


        mSectionsManager = notificationSectionsManager;
        mSectionsManager = notificationSectionsManager;
@@ -594,7 +586,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        });
        });
        mSections = mSectionsManager.createSectionsForBuckets();
        mSections = mSectionsManager.createSectionsForBuckets();


        mAmbientState = new AmbientState(context, mSectionsManager, mHeadsUpManager);
        mAmbientState = new AmbientState(context, mSectionsManager);
        mBgColor = context.getColor(R.color.notification_shade_background_color);
        mBgColor = context.getColor(R.color.notification_shade_background_color);
        int minHeight = res.getDimensionPixelSize(R.dimen.notification_min_height);
        int minHeight = res.getDimensionPixelSize(R.dimen.notification_min_height);
        int maxHeight = res.getDimensionPixelSize(R.dimen.notification_max_height);
        int maxHeight = res.getDimensionPixelSize(R.dimen.notification_max_height);
@@ -750,27 +742,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        return false;
        return false;
    }
    }


  @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
  public RemoteInputController.Delegate createDelegate() {
        return new RemoteInputController.Delegate() {
            public void setRemoteInputActive(NotificationEntry entry,
                    boolean remoteInputActive) {
                mHeadsUpManager.setRemoteInputActive(entry, remoteInputActive);
                entry.notifyHeightChanged(true /* needsAnimation */);
                updateFooter();
            }

            public void lockScrollTo(NotificationEntry entry) {
                NotificationStackScrollLayout.this.lockScrollTo(entry.getRow());
            }

            public void requestDisallowLongPressAndDismiss() {
                requestDisallowLongPress();
                requestDisallowDismiss();
            }
        };
    }

    @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
    @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
    public NotificationSwipeActionHelper getSwipeActionHelper() {
    public NotificationSwipeActionHelper getSwipeActionHelper() {
        return mSwipeHelper;
        return mSwipeHelper;
@@ -1472,11 +1443,10 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
     */
     */
    @ShadeViewRefactor(RefactorComponent.COORDINATOR)
    @ShadeViewRefactor(RefactorComponent.COORDINATOR)
    private int getTopHeadsUpPinnedHeight() {
    private int getTopHeadsUpPinnedHeight() {
        NotificationEntry topEntry = mHeadsUpManager.getTopEntry();
        if (mTopHeadsUpEntry == null) {
        if (topEntry == null) {
            return 0;
            return 0;
        }
        }
        ExpandableNotificationRow row = topEntry.getRow();
        ExpandableNotificationRow row = mTopHeadsUpEntry.getRow();
        if (row.isChildInGroup()) {
        if (row.isChildInGroup()) {
            final NotificationEntry groupSummary =
            final NotificationEntry groupSummary =
                    mGroupManager.getGroupSummary(row.getEntry().getSbn());
                    mGroupManager.getGroupSummary(row.getEntry().getSbn());
@@ -1497,7 +1467,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        int visibleNotifCount = getVisibleNotificationCount();
        int visibleNotifCount = getVisibleNotificationCount();
        if (mEmptyShadeView.getVisibility() == GONE && visibleNotifCount > 0) {
        if (mEmptyShadeView.getVisibility() == GONE && visibleNotifCount > 0) {
            if (isHeadsUpTransition()
            if (isHeadsUpTransition()
                    || (mHeadsUpManager.hasPinnedHeadsUp() && !mAmbientState.isDozing())) {
                    || (mInHeadsUpPinnedMode && !mAmbientState.isDozing())) {
                if (mShelf.getVisibility() != GONE && visibleNotifCount > 1) {
                if (mShelf.getVisibility() != GONE && visibleNotifCount > 1) {
                    appearPosition += mShelf.getIntrinsicHeight() + mPaddingBetweenElements;
                    appearPosition += mShelf.getIntrinsicHeight() + mPaddingBetweenElements;
                }
                }
@@ -1655,9 +1625,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
                    ExpandableNotificationRow row = (ExpandableNotificationRow) slidingChild;
                    ExpandableNotificationRow row = (ExpandableNotificationRow) slidingChild;
                    NotificationEntry entry = row.getEntry();
                    NotificationEntry entry = row.getEntry();
                    if (!mIsExpanded && row.isHeadsUp() && row.isPinned()
                    if (!mIsExpanded && row.isHeadsUp() && row.isPinned()
                            && mHeadsUpManager.getTopEntry().getRow() != row
                            && mTopHeadsUpEntry.getRow() != row
                            && mGroupManager.getGroupSummary(
                            && mGroupManager.getGroupSummary(
                            mHeadsUpManager.getTopEntry().getSbn())
                            mTopHeadsUpEntry.getSbn())
                            != entry) {
                            != entry) {
                        continue;
                        continue;
                    }
                    }
@@ -2285,7 +2255,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        // In current design, it only use the top HUN to treat all of HUNs
        // In current design, it only use the top HUN to treat all of HUNs
        // although there are more than one HUNs
        // although there are more than one HUNs
        int contentHeight = mContentHeight;
        int contentHeight = mContentHeight;
        if (!isExpanded() && mHeadsUpManager.hasPinnedHeadsUp()) {
        if (!isExpanded() && mInHeadsUpPinnedMode) {
            contentHeight = mHeadsUpInset + getTopHeadsUpPinnedHeight();
            contentHeight = mHeadsUpInset + getTopHeadsUpPinnedHeight();
        }
        }
        int scrollRange = Math.max(0, contentHeight - mMaxLayoutHeight);
        int scrollRange = Math.max(0, contentHeight - mMaxLayoutHeight);
@@ -2636,7 +2606,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
                    false /* shiftPulsingWithFirst */);
                    false /* shiftPulsingWithFirst */);
            minTopPosition = firstVisibleSection.getBounds().top;
            minTopPosition = firstVisibleSection.getBounds().top;
        }
        }
        boolean shiftPulsingWithFirst = mHeadsUpManager.getAllEntries().count() <= 1
        boolean shiftPulsingWithFirst = mNumHeadsUp <= 1
                && (mAmbientState.isDozing()
                && (mAmbientState.isDozing()
                        || (mKeyguardBypassEnabledProvider.getBypassEnabled() && onKeyguard));
                        || (mKeyguardBypassEnabledProvider.getBypassEnabled() && onKeyguard));
        for (NotificationSection section : mSections) {
        for (NotificationSection section : mSections) {
@@ -3511,7 +3481,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
                    // Only animate if we still have pinned heads up, otherwise we just have the
                    // Only animate if we still have pinned heads up, otherwise we just have the
                    // regular collapse animation of the lock screen
                    // regular collapse animation of the lock screen
                    || (mKeyguardBypassEnabledProvider.getBypassEnabled() && onKeyguard()
                    || (mKeyguardBypassEnabledProvider.getBypassEnabled() && onKeyguard()
                            && mHeadsUpManager.hasPinnedHeadsUp());
                            && mInHeadsUpPinnedMode);
            if (performDisappearAnimation && !isHeadsUp) {
            if (performDisappearAnimation && !isHeadsUp) {
                type = row.wasJustClicked()
                type = row.wasJustClicked()
                        ? AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK
                        ? AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK
@@ -5811,23 +5781,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        mCurrentUserId = userId;
        mCurrentUserId = userId;
    }
    }


    void onMenuShown(View row) {
        mSwipeHelper.onMenuShown(row);
    }

    void onMenuReset(View row) {
        View translatingParentView = mSwipeHelper.getTranslatingParentView();
        if (translatingParentView != null && row == translatingParentView) {
            mSwipeHelper.clearExposedMenuView();
            mSwipeHelper.clearTranslatingParentView();
            if (row instanceof ExpandableNotificationRow) {
                mHeadsUpManager.setMenuShown(
                        ((ExpandableNotificationRow) row).getEntry(), false);

            }
        }
    }

    void addSwipedOutView(View v) {
    void addSwipedOutView(View v) {
        mSwipedOutViews.add(v);
        mSwipedOutViews.add(v);
    }
    }
@@ -5840,6 +5793,15 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        mAmbientState.onDragFinished(view);
        mAmbientState.onDragFinished(view);
    }
    }


    void setTopHeadsUpEntry(NotificationEntry topEntry) {
        mTopHeadsUpEntry = topEntry;
    }

    void setNumHeadsUp(long numHeadsUp) {
        mNumHeadsUp = numHeadsUp;
        mAmbientState.setHasAlertEntries(numHeadsUp > 0);
    }

    /**
    /**
     * A listener that is notified when the empty space below the notifications is clicked on
     * A listener that is notified when the empty space below the notifications is clicked on
     */
     */
+57 −8
Original line number Original line Diff line number Diff line
@@ -70,6 +70,7 @@ import com.android.systemui.statusbar.phone.StatusBar;
import com.android.systemui.statusbar.phone.dagger.StatusBarComponent;
import com.android.systemui.statusbar.phone.dagger.StatusBarComponent;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener;
import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener;
import com.android.systemui.statusbar.policy.OnHeadsUpChangedListener;
import com.android.systemui.statusbar.policy.ZenModeController;
import com.android.systemui.statusbar.policy.ZenModeController;
import com.android.systemui.tuner.TunerService;
import com.android.systemui.tuner.TunerService;


@@ -110,6 +111,7 @@ public class NotificationStackScrollLayoutController {


    private NotificationStackScrollLayout mView;
    private NotificationStackScrollLayout mView;
    private boolean mFadeNotificationsOnDismiss;
    private boolean mFadeNotificationsOnDismiss;
    private NotificationSwipeHelper mSwipeHelper;


    private final NotificationListContainerImpl mNotificationListContainer =
    private final NotificationListContainerImpl mNotificationListContainer =
            new NotificationListContainerImpl();
            new NotificationListContainerImpl();
@@ -217,7 +219,16 @@ public class NotificationStackScrollLayoutController {


        @Override
        @Override
        public void onMenuReset(View row) {
        public void onMenuReset(View row) {
            mView.onMenuReset(row);
            View translatingParentView = mSwipeHelper.getTranslatingParentView();
            if (translatingParentView != null && row == translatingParentView) {
                mSwipeHelper.clearExposedMenuView();
                mSwipeHelper.clearTranslatingParentView();
                if (row instanceof ExpandableNotificationRow) {
                    mHeadsUpManager.setMenuShown(
                            ((ExpandableNotificationRow) row).getEntry(), false);

                }
            }
        }
        }


        @Override
        @Override
@@ -228,7 +239,7 @@ public class NotificationStackScrollLayoutController {
                        .setCategory(MetricsEvent.ACTION_REVEAL_GEAR)
                        .setCategory(MetricsEvent.ACTION_REVEAL_GEAR)
                        .setType(MetricsEvent.TYPE_ACTION));
                        .setType(MetricsEvent.TYPE_ACTION));
                mHeadsUpManager.setMenuShown(notificationRow.getEntry(), true);
                mHeadsUpManager.setMenuShown(notificationRow.getEntry(), true);
                mView.onMenuShown(row);
                mSwipeHelper.onMenuShown(row);
                mNotificationGutsManager.closeAndSaveGuts(true /* removeLeavebehind */,
                mNotificationGutsManager.closeAndSaveGuts(true /* removeLeavebehind */,
                        false /* force */, false /* removeControls */, -1 /* x */, -1 /* y */,
                        false /* force */, false /* removeControls */, -1 /* x */, -1 /* y */,
                        false /* resetMenu */);
                        false /* resetMenu */);
@@ -438,7 +449,31 @@ public class NotificationStackScrollLayoutController {
                }
                }
            };
            };


    private NotificationSwipeHelper mSwipeHelper;
    private final OnHeadsUpChangedListener mOnHeadsUpChangedListener =
            new OnHeadsUpChangedListener() {
        @Override
        public void onHeadsUpPinnedModeChanged(boolean inPinnedMode) {
            mView.setInHeadsUpPinnedMode(inPinnedMode);
        }

        @Override
        public void onHeadsUpPinned(NotificationEntry entry) {

        }

        @Override
        public void onHeadsUpUnPinned(NotificationEntry entry) {

        }

        @Override
        public void onHeadsUpStateChanged(NotificationEntry entry, boolean isHeadsUp) {
            long numEntries = mHeadsUpManager.getAllEntries().count();
            NotificationEntry topEntry = mHeadsUpManager.getTopEntry();
            mView.setNumHeadsUp(numEntries);
            mView.setTopHeadsUpEntry(topEntry);
        }
    };


    @Inject
    @Inject
    public NotificationStackScrollLayoutController(
    public NotificationStackScrollLayoutController(
@@ -496,6 +531,8 @@ public class NotificationStackScrollLayoutController {
                mSwipeHelper);
                mSwipeHelper);


        mHeadsUpManager.addListener(mNotificationRoundnessManager); // TODO: why is this here?
        mHeadsUpManager.addListener(mNotificationRoundnessManager); // TODO: why is this here?
        mHeadsUpManager.addListener(mOnHeadsUpChangedListener);
        mHeadsUpManager.setAnimationStateHandler(mView::setHeadsUpGoingAwayAnimationsAllowed);
        mDynamicPrivacyController.addListener(mDynamicPrivacyControllerListener);
        mDynamicPrivacyController.addListener(mDynamicPrivacyControllerListener);


        mLockscreenUserManager.addUserChangedListener(mLockscreenUserChangeListener);
        mLockscreenUserManager.addUserChangedListener(mLockscreenUserChangeListener);
@@ -910,7 +947,23 @@ public class NotificationStackScrollLayoutController {
    }
    }


    public RemoteInputController.Delegate createDelegate() {
    public RemoteInputController.Delegate createDelegate() {
        return mView.createDelegate();
        return new RemoteInputController.Delegate() {
            public void setRemoteInputActive(NotificationEntry entry,
                    boolean remoteInputActive) {
                mHeadsUpManager.setRemoteInputActive(entry, remoteInputActive);
                entry.notifyHeightChanged(true /* needsAnimation */);
                updateFooter();
            }

            public void lockScrollTo(NotificationEntry entry) {
                mView.lockScrollTo(entry.getRow());
            }

            public void requestDisallowLongPressAndDismiss() {
                mView.requestDisallowLongPress();
                mView.requestDisallowDismiss();
            }
        };
    }
    }


    public void updateSectionBoundaries(String reason) {
    public void updateSectionBoundaries(String reason) {
@@ -966,10 +1019,6 @@ public class NotificationStackScrollLayoutController {
        return mView.getFirstChildNotGone();
        return mView.getFirstChildNotGone();
    }
    }


    public void setInHeadsUpPinnedMode(boolean inPinnedMode) {
        mView.setInHeadsUpPinnedMode(inPinnedMode);
    }

    public void generateHeadsUpAnimation(NotificationEntry entry, boolean isHeadsUp) {
    public void generateHeadsUpAnimation(NotificationEntry entry, boolean isHeadsUp) {
        mView.generateHeadsUpAnimation(entry, isHeadsUp);
        mView.generateHeadsUpAnimation(entry, isHeadsUp);
    }
    }
Loading