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

Commit 5ce2437a authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz Committed by Automerger Merge Worker
Browse files

Merge "Cache NotifCollection for next pipeline run" into udc-dev am: c2384f8b

parents 5b1fed9e c2384f8b
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -110,6 +110,8 @@ public class ShadeListBuilder implements Dumpable, PipelineDumpable {
    private final PipelineState mPipelineState = new PipelineState();
    private final Map<String, GroupEntry> mGroups = new ArrayMap<>();
    private Collection<NotificationEntry> mAllEntries = Collections.emptyList();
    @Nullable
    private Collection<NotificationEntry> mPendingEntries = null;
    private int mIterationCount = 0;

    private final List<NotifFilter> mNotifPreGroupFilters = new ArrayList<>();
@@ -317,11 +319,9 @@ public class ShadeListBuilder implements Dumpable, PipelineDumpable {
                @Override
                public void onBuildList(Collection<NotificationEntry> entries, String reason) {
                    Assert.isMainThread();
                    mPipelineState.requireIsBefore(STATE_BUILD_STARTED);

                    mPendingEntries = new ArrayList<>(entries);
                    mLogger.logOnBuildList(reason);
                    mAllEntries = entries;
                    scheduleRebuild(/* reentrant = */ false);
                    rebuildListIfBefore(STATE_BUILD_STARTED);
                }
            };

@@ -398,6 +398,11 @@ public class ShadeListBuilder implements Dumpable, PipelineDumpable {
        Trace.beginSection("ShadeListBuilder.buildList");
        mPipelineState.requireIsBefore(STATE_BUILD_STARTED);

        if (mPendingEntries != null) {
            mAllEntries = mPendingEntries;
            mPendingEntries = null;
        }

        if (!mNotifStabilityManager.isPipelineRunAllowed()) {
            mLogger.logPipelineRunSuppressed();
            Trace.endSection();