Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImpl.java +7 −8 Original line number Diff line number Diff line Loading @@ -206,6 +206,13 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter return false; } if (isSnoozedPackage(sbn)) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No alerting: snoozed package: " + sbn.getKey()); } return false; } boolean inShade = mStatusBarStateController.getState() == SHADE; if (entry.isBubble() && inShade) { if (DEBUG_HEADS_UP) { Loading Loading @@ -365,14 +372,6 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter return false; } } if (isSnoozedPackage(sbn)) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No alerting: snoozed package: " + sbn.getKey()); } return false; } return true; } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java +1 −13 Original line number Diff line number Diff line Loading @@ -115,15 +115,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { when(mNotificationFilter.shouldFilterOut(any())).thenReturn(false); } /** * Sets up the state such that any requests to * {@link NotificationInterruptStateProviderImpl#canAlertAwakeCommon(NotificationEntry)} will * pass as long its provided NotificationEntry fulfills launch fullscreen check. */ private void ensureStateForAlertAwakeCommon() { when(mHeadsUpManager.isSnoozed(any())).thenReturn(false); } /** * Sets up the state such that any requests to * {@link NotificationInterruptStateProviderImpl#shouldHeadsUp(NotificationEntry)} will Loading @@ -131,7 +122,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { */ private void ensureStateForHeadsUpWhenAwake() throws RemoteException { ensureStateForAlertCommon(); ensureStateForAlertAwakeCommon(); when(mHeadsUpManager.isSnoozed(any())).thenReturn(false); when(mStatusBarStateController.isDozing()).thenReturn(false); when(mDreamManager.isDreaming()).thenReturn(false); Loading @@ -157,7 +148,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { */ private void ensureStateForBubbleUp() { ensureStateForAlertCommon(); ensureStateForAlertAwakeCommon(); } @Test Loading Loading @@ -392,7 +382,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { @Test public void testShouldNotHeadsUp_snoozedPackage() { NotificationEntry entry = createNotification(IMPORTANCE_DEFAULT); ensureStateForAlertAwakeCommon(); when(mHeadsUpManager.isSnoozed(entry.getSbn().getPackageName())).thenReturn(true); Loading @@ -402,7 +391,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { @Test public void testShouldNotHeadsUp_justLaunchedFullscreen() { ensureStateForAlertAwakeCommon(); // On screen alerts don't happen when that package has just launched fullscreen. NotificationEntry entry = createNotification(IMPORTANCE_DEFAULT); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImpl.java +7 −8 Original line number Diff line number Diff line Loading @@ -206,6 +206,13 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter return false; } if (isSnoozedPackage(sbn)) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No alerting: snoozed package: " + sbn.getKey()); } return false; } boolean inShade = mStatusBarStateController.getState() == SHADE; if (entry.isBubble() && inShade) { if (DEBUG_HEADS_UP) { Loading Loading @@ -365,14 +372,6 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter return false; } } if (isSnoozedPackage(sbn)) { if (DEBUG_HEADS_UP) { Log.d(TAG, "No alerting: snoozed package: " + sbn.getKey()); } return false; } return true; } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java +1 −13 Original line number Diff line number Diff line Loading @@ -115,15 +115,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { when(mNotificationFilter.shouldFilterOut(any())).thenReturn(false); } /** * Sets up the state such that any requests to * {@link NotificationInterruptStateProviderImpl#canAlertAwakeCommon(NotificationEntry)} will * pass as long its provided NotificationEntry fulfills launch fullscreen check. */ private void ensureStateForAlertAwakeCommon() { when(mHeadsUpManager.isSnoozed(any())).thenReturn(false); } /** * Sets up the state such that any requests to * {@link NotificationInterruptStateProviderImpl#shouldHeadsUp(NotificationEntry)} will Loading @@ -131,7 +122,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { */ private void ensureStateForHeadsUpWhenAwake() throws RemoteException { ensureStateForAlertCommon(); ensureStateForAlertAwakeCommon(); when(mHeadsUpManager.isSnoozed(any())).thenReturn(false); when(mStatusBarStateController.isDozing()).thenReturn(false); when(mDreamManager.isDreaming()).thenReturn(false); Loading @@ -157,7 +148,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { */ private void ensureStateForBubbleUp() { ensureStateForAlertCommon(); ensureStateForAlertAwakeCommon(); } @Test Loading Loading @@ -392,7 +382,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { @Test public void testShouldNotHeadsUp_snoozedPackage() { NotificationEntry entry = createNotification(IMPORTANCE_DEFAULT); ensureStateForAlertAwakeCommon(); when(mHeadsUpManager.isSnoozed(entry.getSbn().getPackageName())).thenReturn(true); Loading @@ -402,7 +391,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { @Test public void testShouldNotHeadsUp_justLaunchedFullscreen() { ensureStateForAlertAwakeCommon(); // On screen alerts don't happen when that package has just launched fullscreen. NotificationEntry entry = createNotification(IMPORTANCE_DEFAULT); Loading