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

Commit f446c02c authored by Chloris Kuo's avatar Chloris Kuo Committed by Android (Google) Code Review
Browse files

Merge "Fix notification cancel reason when AutoCancel flag is present"

parents e11aa0c7 d44a04db
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -378,8 +378,8 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
                // We have to post the removal to the UI thread for synchronization.
                mMainThreadHandler.post(() -> {
                    final Runnable removeNotification = () -> {
                        mOnUserInteractionCallback.onDismiss(entry, REASON_CLICK);
                        mClickNotifier.onNotificationClick(entry.getKey(), nv);
                        mOnUserInteractionCallback.onDismiss(entry, REASON_CLICK);
                    };
                    if (mPresenter.isCollapsing()) {
                        // To avoid lags we're only performing the remove
+6 −3
Original line number Diff line number Diff line
@@ -81,7 +81,9 @@ import com.android.systemui.wmshell.BubblesManager;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InOrder;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.mockito.stubbing.Answer;

@@ -261,11 +263,12 @@ public class StatusBarNotificationActivityStarterTest extends SysuiTestCase {

        verify(mAssistManager).hideAssist();

        verify(mClickNotifier).onNotificationClick(
        InOrder orderVerifier = Mockito.inOrder(mClickNotifier, mOnUserInteractionCallback);
        orderVerifier.verify(mClickNotifier).onNotificationClick(
                eq(sbn.getKey()), any(NotificationVisibility.class));

        // Notification calls dismiss callback to remove notification due to FLAG_AUTO_CANCEL
        verify(mOnUserInteractionCallback).onDismiss(mNotificationRow.getEntry(), REASON_CLICK);
        orderVerifier.verify(mOnUserInteractionCallback).onDismiss(mNotificationRow.getEntry(),
                REASON_CLICK);
    }

    @Test