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:
@@ -578,12 +578,10 @@ public class NotifCollection implements Dumpable, PipelineDumpable {
|
||||
// TODO: (b/145659174) update the sbn's overrideGroupKey in
|
||||
// NotificationEntry.setRanking instead of here once we fully migrate to the
|
||||
// NewNotifPipeline
|
||||
if (mNotifPipelineFlags.isNewPipelineEnabled()) {
|
||||
final String newOverrideGroupKey = ranking.getOverrideGroupKey();
|
||||
if (!Objects.equals(entry.getSbn().getOverrideGroupKey(),
|
||||
newOverrideGroupKey)) {
|
||||
entry.getSbn().setOverrideGroupKey(newOverrideGroupKey);
|
||||
}
|
||||
final String newOverrideGroupKey = ranking.getOverrideGroupKey();
|
||||
if (!Objects.equals(entry.getSbn().getOverrideGroupKey(),
|
||||
newOverrideGroupKey)) {
|
||||
entry.getSbn().setOverrideGroupKey(newOverrideGroupKey);
|
||||
}
|
||||
} else {
|
||||
if (currentEntriesWithoutRankings == null) {
|
||||
|
||||
@@ -76,7 +76,6 @@ import javax.inject.Inject
|
||||
*/
|
||||
@SysUISingleton
|
||||
class NotifPipeline @Inject constructor(
|
||||
notifPipelineFlags: NotifPipelineFlags,
|
||||
private val mNotifCollection: NotifCollection,
|
||||
private val mShadeListBuilder: ShadeListBuilder,
|
||||
private val mRenderStageManager: RenderStageManager
|
||||
@@ -107,8 +106,6 @@ class NotifPipeline @Inject constructor(
|
||||
return mNotifCollection.getEntry(key)
|
||||
}
|
||||
|
||||
val isNewPipelineEnabled: Boolean = notifPipelineFlags.isNewPipelineEnabled()
|
||||
|
||||
/**
|
||||
* 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.
|
||||
|
||||
@@ -127,14 +127,6 @@ public class BubbleCoordinator implements Coordinator {
|
||||
DismissedByUserStats dismissedByUserStats,
|
||||
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)) {
|
||||
mInterceptedDismissalEntries.remove(entry.getKey());
|
||||
mOnEndDismissInterception.onEndDismissInterception(mDismissInterceptor, entry,
|
||||
|
||||
@@ -68,9 +68,7 @@ class NotifCoordinatorsImpl @Inject constructor(
|
||||
// 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
|
||||
// NotifLiveDataStore.
|
||||
if (notifPipelineFlags.isNewPipelineEnabled()) {
|
||||
mCoordinators.add(dataStoreCoordinator)
|
||||
}
|
||||
mCoordinators.add(dataStoreCoordinator)
|
||||
|
||||
// Attach normal coordinators.
|
||||
mCoordinators.add(hideLocallyDismissedNotifsCoordinator)
|
||||
@@ -93,18 +91,14 @@ class NotifCoordinatorsImpl @Inject constructor(
|
||||
if (notifPipelineFlags.isSmartspaceDedupingEnabled()) {
|
||||
mCoordinators.add(smartspaceDedupingCoordinator)
|
||||
}
|
||||
if (notifPipelineFlags.isNewPipelineEnabled()) {
|
||||
mCoordinators.add(headsUpCoordinator)
|
||||
mCoordinators.add(gutsCoordinator)
|
||||
mCoordinators.add(preparationCoordinator)
|
||||
mCoordinators.add(remoteInputCoordinator)
|
||||
}
|
||||
mCoordinators.add(headsUpCoordinator)
|
||||
mCoordinators.add(gutsCoordinator)
|
||||
mCoordinators.add(preparationCoordinator)
|
||||
mCoordinators.add(remoteInputCoordinator)
|
||||
|
||||
// Manually add Ordered Sections
|
||||
// HeadsUp > FGS > People > Alerting > Silent > Minimized > Unknown/Default
|
||||
if (notifPipelineFlags.isNewPipelineEnabled()) {
|
||||
mOrderedSections.add(headsUpCoordinator.sectioner) // HeadsUp
|
||||
}
|
||||
mOrderedSections.add(headsUpCoordinator.sectioner)
|
||||
mOrderedSections.add(appOpsCoordinator.sectioner) // ForegroundService
|
||||
mOrderedSections.add(conversationCoordinator.sectioner) // People
|
||||
mOrderedSections.add(rankingCoordinator.alertingSectioner) // Alerting
|
||||
|
||||
@@ -65,13 +65,6 @@ class SmartspaceDedupingCoordinator @Inject constructor(
|
||||
statusBarStateController.addCallback(statusBarStateListener)
|
||||
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)
|
||||
}
|
||||
|
||||
|
||||
@@ -70,11 +70,9 @@ class ViewConfigCoordinator @Inject internal constructor(
|
||||
|
||||
override fun attach(pipeline: NotifPipeline) {
|
||||
mPipeline = pipeline
|
||||
if (pipeline.isNewPipelineEnabled) {
|
||||
mLockscreenUserManager.addUserChangedListener(mUserChangedListener)
|
||||
mConfigurationController.addCallback(this)
|
||||
mKeyguardUpdateMonitor.registerCallback(mKeyguardUpdateCallback)
|
||||
}
|
||||
mLockscreenUserManager.addUserChangedListener(mUserChangedListener)
|
||||
mConfigurationController.addCallback(this)
|
||||
mKeyguardUpdateMonitor.registerCallback(mKeyguardUpdateCallback)
|
||||
}
|
||||
|
||||
override fun onDensityOrFontScaleChanged() {
|
||||
|
||||
@@ -24,7 +24,6 @@ import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.dagger.SysUISingleton;
|
||||
import com.android.systemui.dump.DumpManager;
|
||||
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.NotifInflaterImpl;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifPipeline;
|
||||
@@ -58,7 +57,6 @@ public class NotifPipelineInitializer implements Dumpable, PipelineDumpable {
|
||||
private final NotifInflaterImpl mNotifInflater;
|
||||
private final DumpManager mDumpManager;
|
||||
private final ShadeViewManagerFactory mShadeViewManagerFactory;
|
||||
private final NotifPipelineFlags mNotifPipelineFlags;
|
||||
|
||||
/* These are saved just for dumping. */
|
||||
private ShadeViewManager mShadeViewManager;
|
||||
@@ -74,8 +72,7 @@ public class NotifPipelineInitializer implements Dumpable, PipelineDumpable {
|
||||
NotifCoordinators notifCoordinators,
|
||||
NotifInflaterImpl notifInflater,
|
||||
DumpManager dumpManager,
|
||||
ShadeViewManagerFactory shadeViewManagerFactory,
|
||||
NotifPipelineFlags notifPipelineFlags
|
||||
ShadeViewManagerFactory shadeViewManagerFactory
|
||||
) {
|
||||
mPipelineWrapper = pipelineWrapper;
|
||||
mGroupCoalescer = groupCoalescer;
|
||||
@@ -86,7 +83,6 @@ public class NotifPipelineInitializer implements Dumpable, PipelineDumpable {
|
||||
mDumpManager = dumpManager;
|
||||
mNotifInflater = notifInflater;
|
||||
mShadeViewManagerFactory = shadeViewManagerFactory;
|
||||
mNotifPipelineFlags = notifPipelineFlags;
|
||||
}
|
||||
|
||||
/** Hooks the new pipeline up to NotificationManager */
|
||||
@@ -100,25 +96,21 @@ public class NotifPipelineInitializer implements Dumpable, PipelineDumpable {
|
||||
mNotificationService = notificationService;
|
||||
|
||||
// Setup inflation
|
||||
if (mNotifPipelineFlags.isNewPipelineEnabled()) {
|
||||
mNotifInflater.setRowBinder(rowBinder);
|
||||
}
|
||||
mNotifInflater.setRowBinder(rowBinder);
|
||||
|
||||
// Wire up coordinators
|
||||
mNotifPluggableCoordinators.attach(mPipelineWrapper);
|
||||
|
||||
// Wire up pipeline
|
||||
if (mNotifPipelineFlags.isNewPipelineEnabled()) {
|
||||
mShadeViewManager = mShadeViewManagerFactory.create(listContainer, stackController);
|
||||
mShadeViewManager.attach(mRenderStageManager);
|
||||
}
|
||||
mShadeViewManager = mShadeViewManagerFactory.create(listContainer, stackController);
|
||||
mShadeViewManager.attach(mRenderStageManager);
|
||||
mRenderStageManager.attach(mListBuilder);
|
||||
mListBuilder.attach(mNotifCollection);
|
||||
mNotifCollection.attach(mGroupCoalescer);
|
||||
mGroupCoalescer.attach(mNotificationService);
|
||||
|
||||
Log.d(TAG, "Notif pipeline initialized."
|
||||
+ " rendering=" + mNotifPipelineFlags.isNewPipelineEnabled());
|
||||
+ " rendering=" + true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -152,8 +152,6 @@ public class NotifCollectionTest extends SysuiTestCase {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
allowTestableLooperAsMainThread();
|
||||
|
||||
when(mNotifPipelineFlags.isNewPipelineEnabled()).thenReturn(true);
|
||||
|
||||
when(mEulogizer.record(any(Exception.class))).thenAnswer(i -> i.getArguments()[0]);
|
||||
|
||||
mListenerInOrder = inOrder(mCollectionListener);
|
||||
|
||||
@@ -60,7 +60,6 @@ class ViewConfigCoordinatorTest : SysuiTestCase() {
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
whenever(pipeline.isNewPipelineEnabled).thenReturn(true)
|
||||
whenever(pipeline.allNotifs).thenReturn(listOf(entry))
|
||||
whenever(entry.row).thenReturn(row)
|
||||
coordinator = ViewConfigCoordinator(
|
||||
|
||||
Reference in New Issue
Block a user