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

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

Merge "Inline notif pipeline flag into new pipeline code"

parents 2df7b9e1 953c470b
Loading
Loading
Loading
Loading
+4 −6
Original line number Original line Diff line number Diff line
@@ -578,13 +578,11 @@ public class NotifCollection implements Dumpable, PipelineDumpable {
                    // TODO: (b/145659174) update the sbn's overrideGroupKey in
                    // TODO: (b/145659174) update the sbn's overrideGroupKey in
                    //  NotificationEntry.setRanking instead of here once we fully migrate to the
                    //  NotificationEntry.setRanking instead of here once we fully migrate to the
                    //  NewNotifPipeline
                    //  NewNotifPipeline
                    if (mNotifPipelineFlags.isNewPipelineEnabled()) {
                    final String newOverrideGroupKey = ranking.getOverrideGroupKey();
                    final String newOverrideGroupKey = ranking.getOverrideGroupKey();
                    if (!Objects.equals(entry.getSbn().getOverrideGroupKey(),
                    if (!Objects.equals(entry.getSbn().getOverrideGroupKey(),
                            newOverrideGroupKey)) {
                            newOverrideGroupKey)) {
                        entry.getSbn().setOverrideGroupKey(newOverrideGroupKey);
                        entry.getSbn().setOverrideGroupKey(newOverrideGroupKey);
                    }
                    }
                    }
                } else {
                } else {
                    if (currentEntriesWithoutRankings == null) {
                    if (currentEntriesWithoutRankings == null) {
                        currentEntriesWithoutRankings = new ArrayMap<>();
                        currentEntriesWithoutRankings = new ArrayMap<>();
+0 −3
Original line number Original line Diff line number Diff line
@@ -76,7 +76,6 @@ import javax.inject.Inject
 */
 */
@SysUISingleton
@SysUISingleton
class NotifPipeline @Inject constructor(
class NotifPipeline @Inject constructor(
    notifPipelineFlags: NotifPipelineFlags,
    private val mNotifCollection: NotifCollection,
    private val mNotifCollection: NotifCollection,
    private val mShadeListBuilder: ShadeListBuilder,
    private val mShadeListBuilder: ShadeListBuilder,
    private val mRenderStageManager: RenderStageManager
    private val mRenderStageManager: RenderStageManager
@@ -107,8 +106,6 @@ class NotifPipeline @Inject constructor(
        return mNotifCollection.getEntry(key)
        return mNotifCollection.getEntry(key)
    }
    }


    val isNewPipelineEnabled: Boolean = notifPipelineFlags.isNewPipelineEnabled()

    /**
    /**
     * Registers a lifetime extender. Lifetime extenders can cause notifications that have been
     * Registers a lifetime extender. Lifetime extenders can cause notifications that have been
     * dismissed or retracted by system server to be temporarily retained in the collection.
     * dismissed or retracted by system server to be temporarily retained in the collection.
+0 −8
Original line number Original line Diff line number Diff line
@@ -127,14 +127,6 @@ public class BubbleCoordinator implements Coordinator {
                DismissedByUserStats dismissedByUserStats,
                DismissedByUserStats dismissedByUserStats,
                int reason
                int reason
        ) {
        ) {
            if (!mNotifPipeline.isNewPipelineEnabled()) {
                // The `entry` will be from whichever pipeline is active, so if the old pipeline is
                // running, make sure that we use the new pipeline's entry (if it still exists).
                NotificationEntry newPipelineEntry = mNotifPipeline.getEntry(entry.getKey());
                if (newPipelineEntry != null) {
                    entry = newPipelineEntry;
                }
            }
            if (isInterceptingDismissal(entry)) {
            if (isInterceptingDismissal(entry)) {
                mInterceptedDismissalEntries.remove(entry.getKey());
                mInterceptedDismissalEntries.remove(entry.getKey());
                mOnEndDismissInterception.onEndDismissInterception(mDismissInterceptor, entry,
                mOnEndDismissInterception.onEndDismissInterception(mDismissInterceptor, entry,
+6 −12
Original line number Original line Diff line number Diff line
@@ -68,9 +68,7 @@ class NotifCoordinatorsImpl @Inject constructor(
        //  pipeline, such as this DataStoreCoordinator which cannot be removed, as it's a critical
        //  pipeline, such as this DataStoreCoordinator which cannot be removed, as it's a critical
        //  glue between the pipeline and parts of SystemUI which depend on pipeline output via the
        //  glue between the pipeline and parts of SystemUI which depend on pipeline output via the
        //  NotifLiveDataStore.
        //  NotifLiveDataStore.
        if (notifPipelineFlags.isNewPipelineEnabled()) {
        mCoordinators.add(dataStoreCoordinator)
        mCoordinators.add(dataStoreCoordinator)
        }


        // Attach normal coordinators.
        // Attach normal coordinators.
        mCoordinators.add(hideLocallyDismissedNotifsCoordinator)
        mCoordinators.add(hideLocallyDismissedNotifsCoordinator)
@@ -93,18 +91,14 @@ class NotifCoordinatorsImpl @Inject constructor(
        if (notifPipelineFlags.isSmartspaceDedupingEnabled()) {
        if (notifPipelineFlags.isSmartspaceDedupingEnabled()) {
            mCoordinators.add(smartspaceDedupingCoordinator)
            mCoordinators.add(smartspaceDedupingCoordinator)
        }
        }
        if (notifPipelineFlags.isNewPipelineEnabled()) {
        mCoordinators.add(headsUpCoordinator)
        mCoordinators.add(headsUpCoordinator)
        mCoordinators.add(gutsCoordinator)
        mCoordinators.add(gutsCoordinator)
        mCoordinators.add(preparationCoordinator)
        mCoordinators.add(preparationCoordinator)
        mCoordinators.add(remoteInputCoordinator)
        mCoordinators.add(remoteInputCoordinator)
        }


        // Manually add Ordered Sections
        // Manually add Ordered Sections
        // HeadsUp > FGS > People > Alerting > Silent > Minimized > Unknown/Default
        // HeadsUp > FGS > People > Alerting > Silent > Minimized > Unknown/Default
        if (notifPipelineFlags.isNewPipelineEnabled()) {
        mOrderedSections.add(headsUpCoordinator.sectioner)
            mOrderedSections.add(headsUpCoordinator.sectioner) // HeadsUp
        }
        mOrderedSections.add(appOpsCoordinator.sectioner) // ForegroundService
        mOrderedSections.add(appOpsCoordinator.sectioner) // ForegroundService
        mOrderedSections.add(conversationCoordinator.sectioner) // People
        mOrderedSections.add(conversationCoordinator.sectioner) // People
        mOrderedSections.add(rankingCoordinator.alertingSectioner) // Alerting
        mOrderedSections.add(rankingCoordinator.alertingSectioner) // Alerting
+0 −7
Original line number Original line Diff line number Diff line
@@ -65,13 +65,6 @@ class SmartspaceDedupingCoordinator @Inject constructor(
        statusBarStateController.addCallback(statusBarStateListener)
        statusBarStateController.addCallback(statusBarStateListener)
        smartspaceController.addListener(this::onNewSmartspaceTargets)
        smartspaceController.addListener(this::onNewSmartspaceTargets)


        if (!pipeline.isNewPipelineEnabled) {
            // TODO (b/173126564): Remove this once the old pipeline is no longer necessary
            notificationLockscreenUserManager.addKeyguardNotificationSuppressor { entry ->
                isDupedWithSmartspaceContent(entry)
            }
        }

        recordStatusBarState(statusBarStateController.state)
        recordStatusBarState(statusBarStateController.state)
    }
    }


Loading