From 1989bf4e1dfd0bcd175b7db47685d472c3ec65e3 Mon Sep 17 00:00:00 2001 From: Steve Elliott Date: Tue, 19 Apr 2022 16:28:37 -0400 Subject: [PATCH] Remove pipeline construct thread asserts + effects Fixes: 220644598 Test: manual Change-Id: I1195630771ba9878e92a304b30c256b767bea0b6 --- .../statusbar/notification/collection/NotifCollection.java | 7 +++---- .../notification/collection/ShadeListBuilder.java | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifCollection.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifCollection.java index 292b911e1f7d0..bcd8e594ffbdf 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifCollection.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifCollection.java @@ -138,6 +138,7 @@ public class NotifCollection implements Dumpable { private final NotifCollectionLogger mLogger; private final Handler mMainHandler; private final LogBufferEulogizer mEulogizer; + private final DumpManager mDumpManager; private final Map mNotificationSet = new ArrayMap<>(); private final Collection mReadOnlyNotificationSet = @@ -163,15 +164,13 @@ public class NotifCollection implements Dumpable { @Main Handler mainHandler, LogBufferEulogizer logBufferEulogizer, DumpManager dumpManager) { - Assert.isMainThread(); mStatusBarService = statusBarService; mClock = clock; mNotifPipelineFlags = notifPipelineFlags; mLogger = logger; mMainHandler = mainHandler; mEulogizer = logBufferEulogizer; - - dumpManager.registerDumpable(TAG, this); + mDumpManager = dumpManager; } /** Initializes the NotifCollection and registers it to receive notification events. */ @@ -181,7 +180,7 @@ public class NotifCollection implements Dumpable { throw new RuntimeException("attach() called twice"); } mAttached = true; - + mDumpManager.registerDumpable(TAG, this); groupCoalescer.setNotificationHandler(mNotifHandler); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java index 1155fe214426d..51af9559eda29 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java @@ -91,6 +91,7 @@ public class ShadeListBuilder implements Dumpable { private final SystemClock mSystemClock; private final ShadeListBuilderLogger mLogger; private final NotificationInteractionTracker mInteractionTracker; + private final DumpManager mDumpManager; // used exclusivly by ShadeListBuilder#notifySectionEntriesUpdated private final ArrayList mTempSectionMembers = new ArrayList<>(); private final boolean mAlwaysLogList; @@ -133,14 +134,12 @@ public class ShadeListBuilder implements Dumpable { ShadeListBuilderLogger logger, SystemClock systemClock ) { - Assert.isMainThread(); mSystemClock = systemClock; mLogger = logger; mAlwaysLogList = flags.isDevLoggingEnabled(); mInteractionTracker = interactionTracker; mChoreographer = pipelineChoreographer; - dumpManager.registerDumpable(TAG, this); - + mDumpManager = dumpManager; setSectioners(Collections.emptyList()); } @@ -150,6 +149,7 @@ public class ShadeListBuilder implements Dumpable { */ public void attach(NotifCollection collection) { Assert.isMainThread(); + mDumpManager.registerDumpable(TAG, this); collection.addCollectionListener(mInteractionTracker); collection.setBuildListener(mReadyForBuildListener); mChoreographer.addOnEvalListener(this::buildList);