Inline notif pipeline flag into new pipeline code

This change is a no-op; the flag is now enabled-by-default, so all
removed code paths here are effectively dead.

Bug: 200269355
Test: atest SystemUITests
Change-Id: I8e1b0eb0a6cd7b43e1ff3cb5292d187f46810202
This commit is contained in:
Steve Elliott
2022-06-28 17:07:54 -04:00
parent 442896b4be
commit 953c470b8d
9 changed files with 18 additions and 57 deletions

View File

@@ -578,12 +578,10 @@ 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) {

View File

@@ -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.

View File

@@ -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,

View File

@@ -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

View File

@@ -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)
} }

View File

@@ -70,11 +70,9 @@ class ViewConfigCoordinator @Inject internal constructor(
override fun attach(pipeline: NotifPipeline) { override fun attach(pipeline: NotifPipeline) {
mPipeline = pipeline mPipeline = pipeline
if (pipeline.isNewPipelineEnabled) { mLockscreenUserManager.addUserChangedListener(mUserChangedListener)
mLockscreenUserManager.addUserChangedListener(mUserChangedListener) mConfigurationController.addCallback(this)
mConfigurationController.addCallback(this) mKeyguardUpdateMonitor.registerCallback(mKeyguardUpdateCallback)
mKeyguardUpdateMonitor.registerCallback(mKeyguardUpdateCallback)
}
} }
override fun onDensityOrFontScaleChanged() { override fun onDensityOrFontScaleChanged() {

View File

@@ -24,7 +24,6 @@ import com.android.systemui.Dumpable;
import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dump.DumpManager; import com.android.systemui.dump.DumpManager;
import com.android.systemui.statusbar.NotificationListener; import com.android.systemui.statusbar.NotificationListener;
import com.android.systemui.statusbar.notification.NotifPipelineFlags;
import com.android.systemui.statusbar.notification.collection.NotifCollection; import com.android.systemui.statusbar.notification.collection.NotifCollection;
import com.android.systemui.statusbar.notification.collection.NotifInflaterImpl; import com.android.systemui.statusbar.notification.collection.NotifInflaterImpl;
import com.android.systemui.statusbar.notification.collection.NotifPipeline; import com.android.systemui.statusbar.notification.collection.NotifPipeline;
@@ -58,7 +57,6 @@ public class NotifPipelineInitializer implements Dumpable, PipelineDumpable {
private final NotifInflaterImpl mNotifInflater; private final NotifInflaterImpl mNotifInflater;
private final DumpManager mDumpManager; private final DumpManager mDumpManager;
private final ShadeViewManagerFactory mShadeViewManagerFactory; private final ShadeViewManagerFactory mShadeViewManagerFactory;
private final NotifPipelineFlags mNotifPipelineFlags;
/* These are saved just for dumping. */ /* These are saved just for dumping. */
private ShadeViewManager mShadeViewManager; private ShadeViewManager mShadeViewManager;
@@ -74,8 +72,7 @@ public class NotifPipelineInitializer implements Dumpable, PipelineDumpable {
NotifCoordinators notifCoordinators, NotifCoordinators notifCoordinators,
NotifInflaterImpl notifInflater, NotifInflaterImpl notifInflater,
DumpManager dumpManager, DumpManager dumpManager,
ShadeViewManagerFactory shadeViewManagerFactory, ShadeViewManagerFactory shadeViewManagerFactory
NotifPipelineFlags notifPipelineFlags
) { ) {
mPipelineWrapper = pipelineWrapper; mPipelineWrapper = pipelineWrapper;
mGroupCoalescer = groupCoalescer; mGroupCoalescer = groupCoalescer;
@@ -86,7 +83,6 @@ public class NotifPipelineInitializer implements Dumpable, PipelineDumpable {
mDumpManager = dumpManager; mDumpManager = dumpManager;
mNotifInflater = notifInflater; mNotifInflater = notifInflater;
mShadeViewManagerFactory = shadeViewManagerFactory; mShadeViewManagerFactory = shadeViewManagerFactory;
mNotifPipelineFlags = notifPipelineFlags;
} }
/** Hooks the new pipeline up to NotificationManager */ /** Hooks the new pipeline up to NotificationManager */
@@ -100,25 +96,21 @@ public class NotifPipelineInitializer implements Dumpable, PipelineDumpable {
mNotificationService = notificationService; mNotificationService = notificationService;
// Setup inflation // Setup inflation
if (mNotifPipelineFlags.isNewPipelineEnabled()) { mNotifInflater.setRowBinder(rowBinder);
mNotifInflater.setRowBinder(rowBinder);
}
// Wire up coordinators // Wire up coordinators
mNotifPluggableCoordinators.attach(mPipelineWrapper); mNotifPluggableCoordinators.attach(mPipelineWrapper);
// Wire up pipeline // Wire up pipeline
if (mNotifPipelineFlags.isNewPipelineEnabled()) { mShadeViewManager = mShadeViewManagerFactory.create(listContainer, stackController);
mShadeViewManager = mShadeViewManagerFactory.create(listContainer, stackController); mShadeViewManager.attach(mRenderStageManager);
mShadeViewManager.attach(mRenderStageManager);
}
mRenderStageManager.attach(mListBuilder); mRenderStageManager.attach(mListBuilder);
mListBuilder.attach(mNotifCollection); mListBuilder.attach(mNotifCollection);
mNotifCollection.attach(mGroupCoalescer); mNotifCollection.attach(mGroupCoalescer);
mGroupCoalescer.attach(mNotificationService); mGroupCoalescer.attach(mNotificationService);
Log.d(TAG, "Notif pipeline initialized." Log.d(TAG, "Notif pipeline initialized."
+ " rendering=" + mNotifPipelineFlags.isNewPipelineEnabled()); + " rendering=" + true);
} }
@Override @Override

View File

@@ -152,8 +152,6 @@ public class NotifCollectionTest extends SysuiTestCase {
MockitoAnnotations.initMocks(this); MockitoAnnotations.initMocks(this);
allowTestableLooperAsMainThread(); allowTestableLooperAsMainThread();
when(mNotifPipelineFlags.isNewPipelineEnabled()).thenReturn(true);
when(mEulogizer.record(any(Exception.class))).thenAnswer(i -> i.getArguments()[0]); when(mEulogizer.record(any(Exception.class))).thenAnswer(i -> i.getArguments()[0]);
mListenerInOrder = inOrder(mCollectionListener); mListenerInOrder = inOrder(mCollectionListener);

View File

@@ -60,7 +60,6 @@ class ViewConfigCoordinatorTest : SysuiTestCase() {
@Before @Before
fun setUp() { fun setUp() {
whenever(pipeline.isNewPipelineEnabled).thenReturn(true)
whenever(pipeline.allNotifs).thenReturn(listOf(entry)) whenever(pipeline.allNotifs).thenReturn(listOf(entry))
whenever(entry.row).thenReturn(row) whenever(entry.row).thenReturn(row)
coordinator = ViewConfigCoordinator( coordinator = ViewConfigCoordinator(