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

Commit 4b633d68 authored by Alison Cichowlas's avatar Alison Cichowlas
Browse files

RONs - Inline permission helper, v0, temporary guts-based UI.

Bug: 379186372
Test: atest SystemUITests
Flag: com.android.systemui.permission_helper_ui_rich_ongoing
Change-Id: Id4ef7143669f5f056b0c7be8d4d68671a8ac4d13
parent eb06ce14
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1941,6 +1941,13 @@ flag {
    bug: "380901479"
}

flag {
  name: "permission_helper_ui_rich_ongoing"
  namespace: "systemui"
  description: "[RONs] Guards inline permission helper for demoting RONs"
  bug: "379186372"
}

flag {
    name: "aod_ui_rich_ongoing"
    namespace: "systemui"
+6 −3
Original line number Diff line number Diff line
@@ -198,7 +198,8 @@ public class BundleNotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);
        // and the feedback button is clicked,
        final View feedbackButton = mInfo.findViewById(R.id.notification_guts_bundle_feedback);
        feedbackButton.performClick();
@@ -253,7 +254,8 @@ public class BundleNotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);

        final View feedbackButton = mInfo.findViewById(R.id.notification_guts_bundle_feedback);
        feedbackButton.performClick();
@@ -294,7 +296,8 @@ public class BundleNotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);

        final View feedbackButton = mInfo.findViewById(R.id.notification_guts_bundle_feedback);
        feedbackButton.performClick();
+4 −0
Original line number Diff line number Diff line
@@ -544,6 +544,7 @@ class NotificationGutsManagerTest(flags: FlagsParameterization) : SysuiTestCase(
                /* wasShownHighPriority = */ eq(true),
                eq(assistantFeedbackController),
                eq(metricsLogger),
                any<View.OnClickListener>(),
            )
    }

@@ -580,6 +581,7 @@ class NotificationGutsManagerTest(flags: FlagsParameterization) : SysuiTestCase(
                /* wasShownHighPriority = */ eq(false),
                eq(assistantFeedbackController),
                eq(metricsLogger),
                any<View.OnClickListener>(),
            )
    }

@@ -614,6 +616,7 @@ class NotificationGutsManagerTest(flags: FlagsParameterization) : SysuiTestCase(
                /* wasShownHighPriority = */ eq(false),
                eq(assistantFeedbackController),
                eq(metricsLogger),
                any<View.OnClickListener>(),
            )
    }

@@ -651,6 +654,7 @@ class NotificationGutsManagerTest(flags: FlagsParameterization) : SysuiTestCase(
                /* wasShownHighPriority = */ eq(false),
                eq(assistantFeedbackController),
                eq(metricsLogger),
                any<View.OnClickListener>(),
            )
    }

+82 −45
Original line number Diff line number Diff line
@@ -187,7 +187,7 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger, null);
        final TextView textView = mNotificationInfo.findViewById(R.id.pkg_name);
        assertTrue(textView.getText().toString().contains("App Name"));
        assertEquals(VISIBLE, mNotificationInfo.findViewById(R.id.header).getVisibility());
@@ -213,7 +213,7 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger, null);
        final ImageView iconView = mNotificationInfo.findViewById(R.id.pkg_icon);
        assertEquals(iconDrawable, iconView.getDrawable());
    }
@@ -235,7 +235,7 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger, null);
        final TextView nameView = mNotificationInfo.findViewById(R.id.delegate_name);
        assertEquals(GONE, nameView.getVisibility());
    }
@@ -266,7 +266,7 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger, null);
        final TextView nameView = mNotificationInfo.findViewById(R.id.delegate_name);
        assertEquals(VISIBLE, nameView.getVisibility());
        assertTrue(nameView.getText().toString().contains("Proxied"));
@@ -289,7 +289,7 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger, null);
        final TextView groupNameView = mNotificationInfo.findViewById(R.id.group_name);
        assertEquals(GONE, groupNameView.getVisibility());
    }
@@ -317,7 +317,7 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger, null);
        final TextView groupNameView = mNotificationInfo.findViewById(R.id.group_name);
        assertEquals(View.VISIBLE, groupNameView.getVisibility());
        assertEquals("Test Group Name", groupNameView.getText());
@@ -340,7 +340,7 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger, null);
        final TextView textView = mNotificationInfo.findViewById(R.id.channel_name);
        assertEquals(TEST_CHANNEL_NAME, textView.getText());
    }
@@ -362,7 +362,7 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger, null);
        final TextView textView = mNotificationInfo.findViewById(R.id.channel_name);
        assertEquals(GONE, textView.getVisibility());
    }
@@ -388,7 +388,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);
        final TextView textView = mNotificationInfo.findViewById(R.id.channel_name);
        assertEquals(VISIBLE, textView.getVisibility());
    }
@@ -410,7 +411,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                true,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);
        final TextView textView = mNotificationInfo.findViewById(R.id.channel_name);
        assertEquals(VISIBLE, textView.getVisibility());
    }
@@ -436,7 +438,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);

        final View settingsButton = mNotificationInfo.findViewById(R.id.info);
        settingsButton.performClick();
@@ -461,7 +464,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);
        final View settingsButton = mNotificationInfo.findViewById(R.id.info);
        assertTrue(settingsButton.getVisibility() != View.VISIBLE);
    }
@@ -486,7 +490,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);
        final View settingsButton = mNotificationInfo.findViewById(R.id.info);
        assertTrue(settingsButton.getVisibility() != View.VISIBLE);
    }
@@ -508,7 +513,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);
        mNotificationInfo.bindNotification(
                mMockPackageManager,
                mMockINotificationManager,
@@ -524,7 +530,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);
        final View settingsButton = mNotificationInfo.findViewById(R.id.info);
        assertEquals(View.VISIBLE, settingsButton.getVisibility());
    }
@@ -546,7 +553,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                true,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);
        final TextView view = mNotificationInfo.findViewById(R.id.non_configurable_text);
        assertEquals(View.VISIBLE, view.getVisibility());
        assertEquals(mContext.getString(R.string.notification_unblockable_desc),
@@ -589,7 +597,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);
        final TextView view = mNotificationInfo.findViewById(R.id.non_configurable_call_text);
        assertEquals(View.VISIBLE, view.getVisibility());
        assertEquals(mContext.getString(R.string.notification_unblockable_call_desc),
@@ -632,7 +641,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);
        assertEquals(GONE,
                mNotificationInfo.findViewById(R.id.non_configurable_call_text).getVisibility());
        assertEquals(VISIBLE,
@@ -659,7 +669,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);
        assertEquals(VISIBLE, mNotificationInfo.findViewById(R.id.automatic).getVisibility());
        assertEquals(VISIBLE, mNotificationInfo.findViewById(R.id.automatic_summary).getVisibility());
    }
@@ -681,7 +692,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);
        assertEquals(GONE, mNotificationInfo.findViewById(R.id.automatic).getVisibility());
        assertEquals(GONE, mNotificationInfo.findViewById(R.id.automatic_summary).getVisibility());
    }
@@ -705,7 +717,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);
        assertTrue(mNotificationInfo.findViewById(R.id.automatic).isSelected());
    }

@@ -726,7 +739,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);
        assertTrue(mNotificationInfo.findViewById(R.id.alert).isSelected());
    }

@@ -747,7 +761,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                false,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);
        assertTrue(mNotificationInfo.findViewById(R.id.silence).isSelected());
    }

@@ -768,7 +783,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);
        mTestableLooper.processAllMessages();
        verify(mMockINotificationManager, never()).updateNotificationChannelForPackage(
                anyString(), eq(TEST_UID), any());
@@ -791,7 +807,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);
        assertEquals(1, mUiEventLogger.numLogs());
        assertEquals(NotificationControlsEvent.NOTIFICATION_CONTROLS_OPEN.getId(),
                mUiEventLogger.eventId(0));
@@ -815,7 +832,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                false,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);

        mNotificationInfo.findViewById(R.id.alert).performClick();
        mTestableLooper.processAllMessages();
@@ -842,7 +860,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);

        mNotificationInfo.findViewById(R.id.silence).performClick();
        mTestableLooper.processAllMessages();
@@ -869,7 +888,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);

        mNotificationInfo.findViewById(R.id.automatic).performClick();
        mTestableLooper.processAllMessages();
@@ -897,7 +917,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);

        mNotificationInfo.handleCloseControls(true, false);
        mTestableLooper.processAllMessages();
@@ -924,7 +945,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);

        mNotificationInfo.handleCloseControls(true, false);
        mTestableLooper.processAllMessages();
@@ -959,7 +981,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);

        mNotificationInfo.handleCloseControls(true, false);

@@ -987,7 +1010,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);

        mNotificationInfo.findViewById(R.id.silence).performClick();
        mNotificationInfo.findViewById(R.id.done).performClick();
@@ -1028,7 +1052,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                false,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);

        mNotificationInfo.findViewById(R.id.alert).performClick();
        mNotificationInfo.findViewById(R.id.done).performClick();
@@ -1065,7 +1090,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);

        mNotificationInfo.findViewById(R.id.automatic).performClick();
        mNotificationInfo.findViewById(R.id.done).performClick();
@@ -1097,7 +1123,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);

        mNotificationInfo.findViewById(R.id.silence).performClick();
        mNotificationInfo.findViewById(R.id.done).performClick();
@@ -1133,7 +1160,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                false,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);

        assertEquals(mContext.getString(R.string.inline_done_button),
                ((TextView) mNotificationInfo.findViewById(R.id.done)).getText());
@@ -1171,7 +1199,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                false,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);

        mNotificationInfo.findViewById(R.id.silence).performClick();
        mNotificationInfo.handleCloseControls(false, false);
@@ -1202,7 +1231,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                false,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);

        assertEquals(mContext.getString(R.string.inline_done_button),
                ((TextView) mNotificationInfo.findViewById(R.id.done)).getText());
@@ -1240,7 +1270,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);

        mNotificationInfo.findViewById(R.id.silence).performClick();
        mNotificationInfo.findViewById(R.id.done).performClick();
@@ -1269,7 +1300,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                false,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);

        assertEquals(mContext.getString(R.string.inline_done_button),
                ((TextView) mNotificationInfo.findViewById(R.id.done)).getText());
@@ -1300,7 +1332,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                false,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);

        mNotificationInfo.findViewById(R.id.alert).performClick();
        mNotificationInfo.findViewById(R.id.done).performClick();
@@ -1335,7 +1368,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                false,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);

        mNotificationInfo.findViewById(R.id.alert).performClick();
        mNotificationInfo.findViewById(R.id.done).performClick();
@@ -1368,7 +1402,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                false,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);

        mNotificationInfo.findViewById(R.id.alert).performClick();
        mNotificationInfo.findViewById(R.id.done).performClick();
@@ -1401,7 +1436,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                false,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);

        mNotificationInfo.findViewById(R.id.alert).performClick();

@@ -1427,7 +1463,8 @@ public class NotificationInfoTest extends SysuiTestCase {
                false,
                false,
                mAssistantFeedbackController,
                mMetricsLogger);
                mMetricsLogger,
                null);

        assertFalse(mNotificationInfo.willBeRemoved());
    }
+156 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.statusbar.notification.row;

import static android.app.Notification.EXTRA_BUILDER_APPLICATION_INFO;
import static android.app.NotificationManager.IMPORTANCE_LOW;

import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import android.app.INotificationManager;
import android.app.Notification;
import android.app.NotificationChannel;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.os.UserHandle;
import android.platform.test.annotations.EnableFlags;
import android.service.notification.StatusBarNotification;
import android.telecom.TelecomManager;
import android.testing.TestableLooper;
import android.view.LayoutInflater;
import android.view.View;

import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;

import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.testing.UiEventLoggerFake;
import com.android.systemui.Dependency;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.res.R;
import com.android.systemui.statusbar.notification.AssistantFeedbackController;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;

import java.util.concurrent.CountDownLatch;

@SmallTest
@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class PromotedNotificationInfoTest extends SysuiTestCase {
    private static final String TEST_PACKAGE_NAME = "test_package";
    private static final int TEST_UID = 1;
    private static final String TEST_CHANNEL = "test_channel";
    private static final String TEST_CHANNEL_NAME = "TEST CHANNEL NAME";

    private TestableLooper mTestableLooper;
    private PromotedNotificationInfo mInfo;
    private NotificationChannel mNotificationChannel;
    private StatusBarNotification mSbn;
    private NotificationEntry mEntry;
    private UiEventLoggerFake mUiEventLogger = new UiEventLoggerFake();

    @Rule
    public MockitoRule mockito = MockitoJUnit.rule();
    @Mock
    private MetricsLogger mMetricsLogger;
    @Mock
    private INotificationManager mMockINotificationManager;
    @Mock
    private PackageManager mMockPackageManager;
    @Mock
    private OnUserInteractionCallback mOnUserInteractionCallback;
    @Mock
    private ChannelEditorDialogController mChannelEditorDialogController;
    @Mock
    private AssistantFeedbackController mAssistantFeedbackController;
    @Mock
    private TelecomManager mTelecomManager;

    @Before
    public void setUp() throws Exception {
        final ApplicationInfo applicationInfo = new ApplicationInfo();
        applicationInfo.uid = TEST_UID;  // non-zero

        mNotificationChannel = new NotificationChannel(
                TEST_CHANNEL, TEST_CHANNEL_NAME, IMPORTANCE_LOW);
        Notification notification = new Notification();
        notification.extras.putParcelable(EXTRA_BUILDER_APPLICATION_INFO, applicationInfo);
        mSbn = new StatusBarNotification(TEST_PACKAGE_NAME, TEST_PACKAGE_NAME, 0, null, TEST_UID, 0,
                notification, UserHandle.getUserHandleForUid(TEST_UID), null, 0);
        mEntry = new NotificationEntryBuilder().setSbn(mSbn).build();
        when(mAssistantFeedbackController.isFeedbackEnabled()).thenReturn(false);

        mTestableLooper = TestableLooper.get(this);

        mContext.addMockSystemService(TelecomManager.class, mTelecomManager);

        mDependency.injectTestDependency(Dependency.BG_LOOPER, mTestableLooper.getLooper());
        // Inflate the layout
        final LayoutInflater layoutInflater = LayoutInflater.from(mContext);
        mInfo = (PromotedNotificationInfo) layoutInflater.inflate(
                R.layout.promoted_notification_info, null);
        mInfo.setGutsParent(mock(NotificationGuts.class));
        // Our view is never attached to a window so the View#post methods in
        // BundleNotificationInfo never get called. Setting this will skip the post and do the
        // action immediately.
        mInfo.mSkipPost = true;
    }

    @Test
    @EnableFlags(android.app.Flags.FLAG_NOTIFICATION_CLASSIFICATION_UI)
    public void testBindNotification_setsOnClickListenerForFeedback() throws Exception {

        // Bind the notification to the Info object
        final CountDownLatch latch = new CountDownLatch(1);
        mInfo.bindNotification(
                mMockPackageManager,
                mMockINotificationManager,
                mOnUserInteractionCallback,
                mChannelEditorDialogController,
                TEST_PACKAGE_NAME,
                mNotificationChannel,
                mEntry,
                null,
                null,
                mUiEventLogger,
                true,
                false,
                true,
                mAssistantFeedbackController,
                mMetricsLogger,
                null);
        // Click demote button
        final View demoteButton = mInfo.findViewById(R.id.promoted_demote);
        demoteButton.performClick();
        // verify that notiManager tried to demote
        verify(mMockINotificationManager, atLeastOnce()).setCanBePromoted(TEST_PACKAGE_NAME,
                mSbn.getUid(), false, true);

    }
}
Loading