Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProvider.java +5 −1 Original line number Diff line number Diff line Loading @@ -94,7 +94,11 @@ public interface NotificationInterruptStateProvider { /** * No conditions blocking FSI launch. */ FSI_EXPECTED_NOT_TO_HUN(true); FSI_EXPECTED_NOT_TO_HUN(true), /** * The notification is coming from a suspended packages, so FSI is suppressed. */ NO_FSI_SUSPENDED(false); public final boolean shouldLaunch; Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImpl.java +6 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import android.database.ContentObserver; import android.hardware.display.AmbientDisplayConfiguration; import android.os.Handler; import android.os.PowerManager; import android.os.SystemProperties; import android.provider.Settings; import android.service.notification.StatusBarNotification; Loading Loading @@ -274,6 +273,12 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter suppressedByDND); } // Notification is coming from a suspended package, block FSI if (entry.getRanking().isSuspended()) { return getDecisionGivenSuppression(FullScreenIntentDecision.NO_FSI_SUSPENDED, suppressedByDND); } // If the screen is off, then launch the FullScreenIntent if (!mPowerManager.isInteractive()) { return getDecisionGivenSuppression(FullScreenIntentDecision.FSI_DEVICE_NOT_INTERACTIVE, Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java +17 −0 Original line number Diff line number Diff line Loading @@ -857,6 +857,23 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { verify(mLogger, never()).logFullscreen(any(), any()); } @Test public void testShouldNotScreen_appSuspended() throws RemoteException { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); modifyRanking(entry).setSuspended(true).build(); assertThat(mNotifInterruptionStateProvider.getFullScreenIntentDecision(entry)) .isEqualTo(FullScreenIntentDecision.NO_FSI_SUSPENDED); assertThat(mNotifInterruptionStateProvider.shouldLaunchFullScreenIntentWhenAdded(entry)) .isFalse(); verify(mLogger).logNoFullscreen(entry, "NO_FSI_SUSPENDED"); verify(mLogger, never()).logNoFullscreenWarning(any(), any()); verify(mLogger, never()).logFullscreen(any(), any()); } @Test public void logFullScreenIntentDecision_shouldAlmostAlwaysLogOneTime() { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProvider.java +5 −1 Original line number Diff line number Diff line Loading @@ -94,7 +94,11 @@ public interface NotificationInterruptStateProvider { /** * No conditions blocking FSI launch. */ FSI_EXPECTED_NOT_TO_HUN(true); FSI_EXPECTED_NOT_TO_HUN(true), /** * The notification is coming from a suspended packages, so FSI is suppressed. */ NO_FSI_SUSPENDED(false); public final boolean shouldLaunch; Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImpl.java +6 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import android.database.ContentObserver; import android.hardware.display.AmbientDisplayConfiguration; import android.os.Handler; import android.os.PowerManager; import android.os.SystemProperties; import android.provider.Settings; import android.service.notification.StatusBarNotification; Loading Loading @@ -274,6 +273,12 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter suppressedByDND); } // Notification is coming from a suspended package, block FSI if (entry.getRanking().isSuspended()) { return getDecisionGivenSuppression(FullScreenIntentDecision.NO_FSI_SUSPENDED, suppressedByDND); } // If the screen is off, then launch the FullScreenIntent if (!mPowerManager.isInteractive()) { return getDecisionGivenSuppression(FullScreenIntentDecision.FSI_DEVICE_NOT_INTERACTIVE, Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java +17 −0 Original line number Diff line number Diff line Loading @@ -857,6 +857,23 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { verify(mLogger, never()).logFullscreen(any(), any()); } @Test public void testShouldNotScreen_appSuspended() throws RemoteException { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); modifyRanking(entry).setSuspended(true).build(); assertThat(mNotifInterruptionStateProvider.getFullScreenIntentDecision(entry)) .isEqualTo(FullScreenIntentDecision.NO_FSI_SUSPENDED); assertThat(mNotifInterruptionStateProvider.shouldLaunchFullScreenIntentWhenAdded(entry)) .isFalse(); verify(mLogger).logNoFullscreen(entry, "NO_FSI_SUSPENDED"); verify(mLogger, never()).logNoFullscreenWarning(any(), any()); verify(mLogger, never()).logFullscreen(any(), any()); } @Test public void logFullScreenIntentDecision_shouldAlmostAlwaysLogOneTime() { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); Loading