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

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

Merge "Fix a crash because the BubbleCoordinator is not expecting the...

Merge "Fix a crash because the BubbleCoordinator is not expecting the NotificationEntry from BubbleManager to be from the old pipeline."
parents f0683ade 5bbdb447
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.statusbar.notification.collection.coordinator;

import com.android.systemui.statusbar.notification.NotifPipelineFlags;
import com.android.systemui.statusbar.notification.collection.NotifCollection;
import com.android.systemui.statusbar.notification.collection.NotifPipeline;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
@@ -57,6 +58,7 @@ import javax.inject.Inject;
public class BubbleCoordinator implements Coordinator {
    private static final String TAG = "BubbleCoordinator";

    private final NotifPipelineFlags mNotifPipelineFlags;
    private final Optional<BubblesManager> mBubblesManagerOptional;
    private final Optional<Bubbles> mBubblesOptional;
    private final NotifCollection mNotifCollection;
@@ -66,9 +68,11 @@ public class BubbleCoordinator implements Coordinator {

    @Inject
    public BubbleCoordinator(
            NotifPipelineFlags notifPipelineFlags,
            Optional<BubblesManager> bubblesManagerOptional,
            Optional<Bubbles> bubblesOptional,
            NotifCollection notifCollection) {
        mNotifPipelineFlags = notifPipelineFlags;
        mBubblesManagerOptional = bubblesManagerOptional;
        mBubblesOptional = bubblesOptional;
        mNotifCollection = notifCollection;
@@ -130,6 +134,14 @@ public class BubbleCoordinator implements Coordinator {
                DismissedByUserStats dismissedByUserStats,
                int reason
        ) {
            if (!mNotifPipelineFlags.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,