Merge "[Notif] Don't show bouncer on dismiss" into pi-dev
am: fe1b1f19fe
Change-Id: I124ce0724620ea457a0c4d7834a0189946e03600
This commit is contained in:
@@ -300,9 +300,11 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
|
|||||||
|
|
||||||
private void saveImportance() {
|
private void saveImportance() {
|
||||||
if (!mIsNonblockable) {
|
if (!mIsNonblockable) {
|
||||||
// Only go through the lock screen/bouncer if the user didn't hit 'Keep showing'.
|
// Only go through the lock screen/bouncer if the user hit 'Stop notifications'.
|
||||||
|
// Otherwise, update the importance immediately.
|
||||||
if (mCheckSaveListener != null
|
if (mCheckSaveListener != null
|
||||||
&& !NotificationCounters.BLOCKING_HELPER_KEEP_SHOWING.equals(mExitReason)) {
|
&& NotificationCounters.BLOCKING_HELPER_STOP_NOTIFICATIONS.equals(
|
||||||
|
mExitReason)) {
|
||||||
mCheckSaveListener.checkSave(this::updateImportance, mSbn);
|
mCheckSaveListener.checkSave(this::updateImportance, mSbn);
|
||||||
} else {
|
} else {
|
||||||
updateImportance();
|
updateImportance();
|
||||||
|
|||||||
@@ -508,7 +508,6 @@ public class NotificationInfoTest extends SysuiTestCase {
|
|||||||
anyString(), eq(TEST_UID), eq(true));
|
anyString(), eq(TEST_UID), eq(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCloseControls_nonNullCheckSaveListenerDoesntDelayKeepShowing()
|
public void testCloseControls_nonNullCheckSaveListenerDoesntDelayKeepShowing()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
@@ -537,6 +536,43 @@ public class NotificationInfoTest extends SysuiTestCase {
|
|||||||
anyString(), eq(TEST_UID), eq(true));
|
anyString(), eq(TEST_UID), eq(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testCloseControls_nonNullCheckSaveListenerDoesntDelayDismiss()
|
||||||
|
throws Exception {
|
||||||
|
NotificationInfo.CheckSaveListener listener =
|
||||||
|
mock(NotificationInfo.CheckSaveListener.class);
|
||||||
|
mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager,
|
||||||
|
TEST_PACKAGE_NAME, mNotificationChannel /* notificationChannel */,
|
||||||
|
10 /* numUniqueChannelsInRow */, mSbn, listener /* checkSaveListener */,
|
||||||
|
null /* onSettingsClick */, null /* onAppSettingsClick */ ,
|
||||||
|
false /* isNonblockable */, true /* isForBlockingHelper */,
|
||||||
|
true /* isUserSentimentNegative */);
|
||||||
|
|
||||||
|
mNotificationInfo.handleCloseControls(true /* save */, false /* force */);
|
||||||
|
|
||||||
|
mTestableLooper.processAllMessages();
|
||||||
|
verify(listener, times(0)).checkSave(any(Runnable.class), eq(mSbn));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testCloseControls_checkSaveListenerDelaysStopNotifications()
|
||||||
|
throws Exception {
|
||||||
|
NotificationInfo.CheckSaveListener listener =
|
||||||
|
mock(NotificationInfo.CheckSaveListener.class);
|
||||||
|
mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager,
|
||||||
|
TEST_PACKAGE_NAME, mNotificationChannel /* notificationChannel */,
|
||||||
|
10 /* numUniqueChannelsInRow */, mSbn, listener /* checkSaveListener */,
|
||||||
|
null /* onSettingsClick */, null /* onAppSettingsClick */ ,
|
||||||
|
false /* isNonblockable */, true /* isForBlockingHelper */,
|
||||||
|
true /* isUserSentimentNegative */);
|
||||||
|
|
||||||
|
mNotificationInfo.findViewById(R.id.block).performClick();
|
||||||
|
waitForUndoButton();
|
||||||
|
mNotificationInfo.handleCloseControls(true /* save */, false /* force */);
|
||||||
|
|
||||||
|
mTestableLooper.processAllMessages();
|
||||||
|
verify(listener).checkSave(any(Runnable.class), eq(mSbn));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCloseControls_blockingHelperDismissedIfShown() throws Exception {
|
public void testCloseControls_blockingHelperDismissedIfShown() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user