Loading packages/SystemUI/plugin/src/com/android/systemui/plugins/statusbar/StatusBarStateController.java +7 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,13 @@ public interface StatusBarStateController { */ boolean isPulsing(); /** * Is device dreaming. This method is more inclusive than * {@link android.service.dreams.IDreamManager.isDreaming}, as it will return true during the * dream's wake-up phase. */ boolean isDreaming(); /** * Adds a state listener */ Loading packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java +8 −1 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ import com.android.systemui.plugins.statusbar.StatusBarStateController.StateList import com.android.systemui.shade.ShadeExpansionStateManager; import com.android.systemui.statusbar.notification.stack.StackStateAnimator; import com.android.systemui.statusbar.policy.CallbackController; import com.android.systemui.util.Compile; import java.io.PrintWriter; import java.util.ArrayList; Loading Loading @@ -300,7 +301,7 @@ public class StatusBarStateControllerImpl implements @Override public boolean setIsDreaming(boolean isDreaming) { if (Log.isLoggable(TAG, Log.DEBUG)) { if (Log.isLoggable(TAG, Log.DEBUG) || Compile.IS_DEBUG) { Log.d(TAG, "setIsDreaming:" + isDreaming); } if (mIsDreaming == isDreaming) { Loading @@ -321,6 +322,11 @@ public class StatusBarStateControllerImpl implements return true; } @Override public boolean isDreaming() { return mIsDreaming; } @Override public void setAndInstrumentDozeAmount(View view, float dozeAmount, boolean animated) { if (mDarkAnimator != null && mDarkAnimator.isRunning()) { Loading Loading @@ -581,6 +587,7 @@ public class StatusBarStateControllerImpl implements pw.println(" mLeaveOpenOnKeyguardHide=" + mLeaveOpenOnKeyguardHide); pw.println(" mKeyguardRequested=" + mKeyguardRequested); pw.println(" mIsDozing=" + mIsDozing); pw.println(" mIsDreaming=" + mIsDreaming); pw.println(" mListeners{" + mListeners.size() + "}="); for (RankedListener rl : mListeners) { pw.println(" " + rl.mListener); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImpl.java +4 −18 Original line number Diff line number Diff line Loading @@ -28,11 +28,8 @@ import android.database.ContentObserver; import android.hardware.display.AmbientDisplayConfiguration; import android.os.Handler; import android.os.PowerManager; import android.os.RemoteException; import android.provider.Settings; import android.service.dreams.IDreamManager; import android.service.notification.StatusBarNotification; import android.util.Log; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.logging.UiEvent; Loading Loading @@ -67,7 +64,6 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter private final KeyguardStateController mKeyguardStateController; private final ContentResolver mContentResolver; private final PowerManager mPowerManager; private final IDreamManager mDreamManager; private final AmbientDisplayConfiguration mAmbientDisplayConfiguration; private final BatteryController mBatteryController; private final HeadsUpManager mHeadsUpManager; Loading Loading @@ -109,7 +105,6 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter public NotificationInterruptStateProviderImpl( ContentResolver contentResolver, PowerManager powerManager, IDreamManager dreamManager, AmbientDisplayConfiguration ambientDisplayConfiguration, BatteryController batteryController, StatusBarStateController statusBarStateController, Loading @@ -123,7 +118,6 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter UserTracker userTracker) { mContentResolver = contentResolver; mPowerManager = powerManager; mDreamManager = dreamManager; mBatteryController = batteryController; mAmbientDisplayConfiguration = ambientDisplayConfiguration; mStatusBarStateController = statusBarStateController; Loading Loading @@ -283,7 +277,9 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter } // If the device is currently dreaming, then launch the FullScreenIntent if (isDreaming()) { // We avoid using IDreamManager#isDreaming here as that method will return false during // the dream's wake-up phase. if (mStatusBarStateController.isDreaming()) { return getDecisionGivenSuppression(FullScreenIntentDecision.FSI_DEVICE_IS_DREAMING, suppressedByDND); } Loading Loading @@ -383,16 +379,6 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter mLogger.logFullscreen(entry, "Expected not to HUN"); } } private boolean isDreaming() { try { return mDreamManager.isDreaming(); } catch (RemoteException e) { Log.e(TAG, "Failed to query dream manager.", e); return false; } } private boolean shouldHeadsUpWhenAwake(NotificationEntry entry, boolean log) { StatusBarNotification sbn = entry.getSbn(); Loading Loading @@ -442,7 +428,7 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter return false; } boolean inUse = mPowerManager.isScreenOn() && !isDreaming(); boolean inUse = mPowerManager.isScreenOn() && !mStatusBarStateController.isDreaming(); if (!inUse) { if (log) mLogger.logNoHeadsUpNotInUse(entry); Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarStateControllerImplTest.kt +9 −0 Original line number Diff line number Diff line Loading @@ -167,4 +167,13 @@ class StatusBarStateControllerImplTest : SysuiTestCase() { controller.setIsDreaming(false) verify(listener).onDreamingChanged(false) } @Test fun testSetDreamState_getterReturnsCurrentState() { controller.setIsDreaming(true) assertTrue(controller.isDreaming()) controller.setIsDreaming(false) assertFalse(controller.isDreaming()) } } packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java +18 −22 Original line number Diff line number Diff line Loading @@ -51,7 +51,6 @@ import android.hardware.display.AmbientDisplayConfiguration; import android.os.Handler; import android.os.PowerManager; import android.os.RemoteException; import android.service.dreams.IDreamManager; import android.testing.AndroidTestingRunner; import androidx.test.filters.SmallTest; Loading Loading @@ -87,8 +86,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { @Mock PowerManager mPowerManager; @Mock IDreamManager mDreamManager; @Mock AmbientDisplayConfiguration mAmbientDisplayConfiguration; @Mock StatusBarStateController mStatusBarStateController; Loading Loading @@ -126,7 +123,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { new NotificationInterruptStateProviderImpl( mContext.getContentResolver(), mPowerManager, mDreamManager, mAmbientDisplayConfiguration, mBatteryController, mStatusBarStateController, Loading @@ -150,7 +146,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { when(mHeadsUpManager.isSnoozed(any())).thenReturn(false); when(mStatusBarStateController.isDozing()).thenReturn(false); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mPowerManager.isScreenOn()).thenReturn(true); } Loading Loading @@ -352,7 +348,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { // Also not in use if screen is on but we're showing screen saver / "dreaming" when(mPowerManager.isDeviceIdleMode()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(true); when(mStatusBarStateController.isDreaming()).thenReturn(true); assertThat(mNotifInterruptionStateProvider.shouldHeadsUp(entry)).isFalse(); } Loading Loading @@ -532,7 +528,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { public void testShouldNotFullScreen_notPendingIntent() throws RemoteException { NotificationEntry entry = createNotification(IMPORTANCE_HIGH); when(mPowerManager.isInteractive()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); assertThat(mNotifInterruptionStateProvider.getFullScreenIntentDecision(entry)) Loading @@ -551,7 +547,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { .setSuppressedVisualEffects(SUPPRESSED_EFFECT_FULL_SCREEN_INTENT) .build(); when(mPowerManager.isInteractive()).thenReturn(false); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); assertThat(mNotifInterruptionStateProvider.getFullScreenIntentDecision(entry)) Loading @@ -570,7 +566,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { .setSuppressedVisualEffects(SUPPRESSED_EFFECT_FULL_SCREEN_INTENT) .build(); when(mPowerManager.isInteractive()).thenReturn(false); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); assertThat(mNotifInterruptionStateProvider.getFullScreenIntentDecision(entry)) Loading @@ -592,7 +588,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { public void testShouldNotFullScreen_notHighImportance() throws RemoteException { NotificationEntry entry = createFsiNotification(IMPORTANCE_DEFAULT, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); assertThat(mNotifInterruptionStateProvider.getFullScreenIntentDecision(entry)) Loading @@ -614,7 +610,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { public void testShouldNotFullScreen_isGroupAlertSilenced() throws RemoteException { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ true); when(mPowerManager.isInteractive()).thenReturn(false); when(mDreamManager.isDreaming()).thenReturn(true); when(mStatusBarStateController.isDreaming()).thenReturn(true); when(mStatusBarStateController.getState()).thenReturn(KEYGUARD); assertThat(mNotifInterruptionStateProvider.getFullScreenIntentDecision(entry)) Loading Loading @@ -643,7 +639,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { public void testShouldFullScreen_notInteractive() throws RemoteException { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(false); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); assertThat(mNotifInterruptionStateProvider.getFullScreenIntentDecision(entry)) Loading @@ -665,7 +661,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { public void testShouldFullScreen_isDreaming() throws RemoteException { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(true); when(mStatusBarStateController.isDreaming()).thenReturn(true); when(mStatusBarStateController.getState()).thenReturn(SHADE); assertThat(mNotifInterruptionStateProvider.getFullScreenIntentDecision(entry)) Loading @@ -687,7 +683,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { public void testShouldFullScreen_onKeyguard() throws RemoteException { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(KEYGUARD); assertThat(mNotifInterruptionStateProvider.getFullScreenIntentDecision(entry)) Loading @@ -710,7 +706,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(true); when(mPowerManager.isScreenOn()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); assertThat(mNotifInterruptionStateProvider.getFullScreenIntentDecision(entry)) Loading @@ -727,7 +723,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(true); when(mPowerManager.isScreenOn()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); when(mHeadsUpManager.isSnoozed("a")).thenReturn(true); Loading @@ -746,7 +742,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(true); when(mPowerManager.isScreenOn()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); when(mHeadsUpManager.isSnoozed("a")).thenReturn(true); when(mKeyguardStateController.isShowing()).thenReturn(true); Loading @@ -767,7 +763,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(true); when(mPowerManager.isScreenOn()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); when(mHeadsUpManager.isSnoozed("a")).thenReturn(true); when(mKeyguardStateController.isShowing()).thenReturn(true); Loading @@ -792,7 +788,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(true); when(mPowerManager.isScreenOn()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE_LOCKED); when(mHeadsUpManager.isSnoozed("a")).thenReturn(true); when(mKeyguardStateController.isShowing()).thenReturn(true); Loading @@ -813,7 +809,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(true); when(mPowerManager.isScreenOn()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE_LOCKED); when(mHeadsUpManager.isSnoozed("a")).thenReturn(true); when(mKeyguardStateController.isShowing()).thenReturn(true); Loading @@ -838,7 +834,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(true); when(mPowerManager.isScreenOn()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); when(mHeadsUpManager.isSnoozed("a")).thenReturn(true); when(mKeyguardStateController.isShowing()).thenReturn(false); Loading @@ -859,7 +855,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(true); when(mPowerManager.isScreenOn()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); when(mHeadsUpManager.isSnoozed("a")).thenReturn(true); when(mKeyguardStateController.isShowing()).thenReturn(false); Loading Loading
packages/SystemUI/plugin/src/com/android/systemui/plugins/statusbar/StatusBarStateController.java +7 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,13 @@ public interface StatusBarStateController { */ boolean isPulsing(); /** * Is device dreaming. This method is more inclusive than * {@link android.service.dreams.IDreamManager.isDreaming}, as it will return true during the * dream's wake-up phase. */ boolean isDreaming(); /** * Adds a state listener */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java +8 −1 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ import com.android.systemui.plugins.statusbar.StatusBarStateController.StateList import com.android.systemui.shade.ShadeExpansionStateManager; import com.android.systemui.statusbar.notification.stack.StackStateAnimator; import com.android.systemui.statusbar.policy.CallbackController; import com.android.systemui.util.Compile; import java.io.PrintWriter; import java.util.ArrayList; Loading Loading @@ -300,7 +301,7 @@ public class StatusBarStateControllerImpl implements @Override public boolean setIsDreaming(boolean isDreaming) { if (Log.isLoggable(TAG, Log.DEBUG)) { if (Log.isLoggable(TAG, Log.DEBUG) || Compile.IS_DEBUG) { Log.d(TAG, "setIsDreaming:" + isDreaming); } if (mIsDreaming == isDreaming) { Loading @@ -321,6 +322,11 @@ public class StatusBarStateControllerImpl implements return true; } @Override public boolean isDreaming() { return mIsDreaming; } @Override public void setAndInstrumentDozeAmount(View view, float dozeAmount, boolean animated) { if (mDarkAnimator != null && mDarkAnimator.isRunning()) { Loading Loading @@ -581,6 +587,7 @@ public class StatusBarStateControllerImpl implements pw.println(" mLeaveOpenOnKeyguardHide=" + mLeaveOpenOnKeyguardHide); pw.println(" mKeyguardRequested=" + mKeyguardRequested); pw.println(" mIsDozing=" + mIsDozing); pw.println(" mIsDreaming=" + mIsDreaming); pw.println(" mListeners{" + mListeners.size() + "}="); for (RankedListener rl : mListeners) { pw.println(" " + rl.mListener); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImpl.java +4 −18 Original line number Diff line number Diff line Loading @@ -28,11 +28,8 @@ import android.database.ContentObserver; import android.hardware.display.AmbientDisplayConfiguration; import android.os.Handler; import android.os.PowerManager; import android.os.RemoteException; import android.provider.Settings; import android.service.dreams.IDreamManager; import android.service.notification.StatusBarNotification; import android.util.Log; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.logging.UiEvent; Loading Loading @@ -67,7 +64,6 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter private final KeyguardStateController mKeyguardStateController; private final ContentResolver mContentResolver; private final PowerManager mPowerManager; private final IDreamManager mDreamManager; private final AmbientDisplayConfiguration mAmbientDisplayConfiguration; private final BatteryController mBatteryController; private final HeadsUpManager mHeadsUpManager; Loading Loading @@ -109,7 +105,6 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter public NotificationInterruptStateProviderImpl( ContentResolver contentResolver, PowerManager powerManager, IDreamManager dreamManager, AmbientDisplayConfiguration ambientDisplayConfiguration, BatteryController batteryController, StatusBarStateController statusBarStateController, Loading @@ -123,7 +118,6 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter UserTracker userTracker) { mContentResolver = contentResolver; mPowerManager = powerManager; mDreamManager = dreamManager; mBatteryController = batteryController; mAmbientDisplayConfiguration = ambientDisplayConfiguration; mStatusBarStateController = statusBarStateController; Loading Loading @@ -283,7 +277,9 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter } // If the device is currently dreaming, then launch the FullScreenIntent if (isDreaming()) { // We avoid using IDreamManager#isDreaming here as that method will return false during // the dream's wake-up phase. if (mStatusBarStateController.isDreaming()) { return getDecisionGivenSuppression(FullScreenIntentDecision.FSI_DEVICE_IS_DREAMING, suppressedByDND); } Loading Loading @@ -383,16 +379,6 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter mLogger.logFullscreen(entry, "Expected not to HUN"); } } private boolean isDreaming() { try { return mDreamManager.isDreaming(); } catch (RemoteException e) { Log.e(TAG, "Failed to query dream manager.", e); return false; } } private boolean shouldHeadsUpWhenAwake(NotificationEntry entry, boolean log) { StatusBarNotification sbn = entry.getSbn(); Loading Loading @@ -442,7 +428,7 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter return false; } boolean inUse = mPowerManager.isScreenOn() && !isDreaming(); boolean inUse = mPowerManager.isScreenOn() && !mStatusBarStateController.isDreaming(); if (!inUse) { if (log) mLogger.logNoHeadsUpNotInUse(entry); Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarStateControllerImplTest.kt +9 −0 Original line number Diff line number Diff line Loading @@ -167,4 +167,13 @@ class StatusBarStateControllerImplTest : SysuiTestCase() { controller.setIsDreaming(false) verify(listener).onDreamingChanged(false) } @Test fun testSetDreamState_getterReturnsCurrentState() { controller.setIsDreaming(true) assertTrue(controller.isDreaming()) controller.setIsDreaming(false) assertFalse(controller.isDreaming()) } }
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java +18 −22 Original line number Diff line number Diff line Loading @@ -51,7 +51,6 @@ import android.hardware.display.AmbientDisplayConfiguration; import android.os.Handler; import android.os.PowerManager; import android.os.RemoteException; import android.service.dreams.IDreamManager; import android.testing.AndroidTestingRunner; import androidx.test.filters.SmallTest; Loading Loading @@ -87,8 +86,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { @Mock PowerManager mPowerManager; @Mock IDreamManager mDreamManager; @Mock AmbientDisplayConfiguration mAmbientDisplayConfiguration; @Mock StatusBarStateController mStatusBarStateController; Loading Loading @@ -126,7 +123,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { new NotificationInterruptStateProviderImpl( mContext.getContentResolver(), mPowerManager, mDreamManager, mAmbientDisplayConfiguration, mBatteryController, mStatusBarStateController, Loading @@ -150,7 +146,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { when(mHeadsUpManager.isSnoozed(any())).thenReturn(false); when(mStatusBarStateController.isDozing()).thenReturn(false); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mPowerManager.isScreenOn()).thenReturn(true); } Loading Loading @@ -352,7 +348,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { // Also not in use if screen is on but we're showing screen saver / "dreaming" when(mPowerManager.isDeviceIdleMode()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(true); when(mStatusBarStateController.isDreaming()).thenReturn(true); assertThat(mNotifInterruptionStateProvider.shouldHeadsUp(entry)).isFalse(); } Loading Loading @@ -532,7 +528,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { public void testShouldNotFullScreen_notPendingIntent() throws RemoteException { NotificationEntry entry = createNotification(IMPORTANCE_HIGH); when(mPowerManager.isInteractive()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); assertThat(mNotifInterruptionStateProvider.getFullScreenIntentDecision(entry)) Loading @@ -551,7 +547,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { .setSuppressedVisualEffects(SUPPRESSED_EFFECT_FULL_SCREEN_INTENT) .build(); when(mPowerManager.isInteractive()).thenReturn(false); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); assertThat(mNotifInterruptionStateProvider.getFullScreenIntentDecision(entry)) Loading @@ -570,7 +566,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { .setSuppressedVisualEffects(SUPPRESSED_EFFECT_FULL_SCREEN_INTENT) .build(); when(mPowerManager.isInteractive()).thenReturn(false); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); assertThat(mNotifInterruptionStateProvider.getFullScreenIntentDecision(entry)) Loading @@ -592,7 +588,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { public void testShouldNotFullScreen_notHighImportance() throws RemoteException { NotificationEntry entry = createFsiNotification(IMPORTANCE_DEFAULT, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); assertThat(mNotifInterruptionStateProvider.getFullScreenIntentDecision(entry)) Loading @@ -614,7 +610,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { public void testShouldNotFullScreen_isGroupAlertSilenced() throws RemoteException { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ true); when(mPowerManager.isInteractive()).thenReturn(false); when(mDreamManager.isDreaming()).thenReturn(true); when(mStatusBarStateController.isDreaming()).thenReturn(true); when(mStatusBarStateController.getState()).thenReturn(KEYGUARD); assertThat(mNotifInterruptionStateProvider.getFullScreenIntentDecision(entry)) Loading Loading @@ -643,7 +639,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { public void testShouldFullScreen_notInteractive() throws RemoteException { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(false); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); assertThat(mNotifInterruptionStateProvider.getFullScreenIntentDecision(entry)) Loading @@ -665,7 +661,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { public void testShouldFullScreen_isDreaming() throws RemoteException { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(true); when(mStatusBarStateController.isDreaming()).thenReturn(true); when(mStatusBarStateController.getState()).thenReturn(SHADE); assertThat(mNotifInterruptionStateProvider.getFullScreenIntentDecision(entry)) Loading @@ -687,7 +683,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { public void testShouldFullScreen_onKeyguard() throws RemoteException { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(KEYGUARD); assertThat(mNotifInterruptionStateProvider.getFullScreenIntentDecision(entry)) Loading @@ -710,7 +706,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(true); when(mPowerManager.isScreenOn()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); assertThat(mNotifInterruptionStateProvider.getFullScreenIntentDecision(entry)) Loading @@ -727,7 +723,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(true); when(mPowerManager.isScreenOn()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); when(mHeadsUpManager.isSnoozed("a")).thenReturn(true); Loading @@ -746,7 +742,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(true); when(mPowerManager.isScreenOn()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); when(mHeadsUpManager.isSnoozed("a")).thenReturn(true); when(mKeyguardStateController.isShowing()).thenReturn(true); Loading @@ -767,7 +763,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(true); when(mPowerManager.isScreenOn()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); when(mHeadsUpManager.isSnoozed("a")).thenReturn(true); when(mKeyguardStateController.isShowing()).thenReturn(true); Loading @@ -792,7 +788,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(true); when(mPowerManager.isScreenOn()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE_LOCKED); when(mHeadsUpManager.isSnoozed("a")).thenReturn(true); when(mKeyguardStateController.isShowing()).thenReturn(true); Loading @@ -813,7 +809,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(true); when(mPowerManager.isScreenOn()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE_LOCKED); when(mHeadsUpManager.isSnoozed("a")).thenReturn(true); when(mKeyguardStateController.isShowing()).thenReturn(true); Loading @@ -838,7 +834,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(true); when(mPowerManager.isScreenOn()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); when(mHeadsUpManager.isSnoozed("a")).thenReturn(true); when(mKeyguardStateController.isShowing()).thenReturn(false); Loading @@ -859,7 +855,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false); when(mPowerManager.isInteractive()).thenReturn(true); when(mPowerManager.isScreenOn()).thenReturn(true); when(mDreamManager.isDreaming()).thenReturn(false); when(mStatusBarStateController.isDreaming()).thenReturn(false); when(mStatusBarStateController.getState()).thenReturn(SHADE); when(mHeadsUpManager.isSnoozed("a")).thenReturn(true); when(mKeyguardStateController.isShowing()).thenReturn(false); Loading