Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +14 −5 Original line number Diff line number Diff line Loading @@ -83,7 +83,6 @@ import android.os.SystemProperties; import android.os.Trace; import android.os.UserHandle; import android.provider.Settings; import android.service.dreams.DreamService; import android.service.dreams.IDreamManager; import android.service.notification.StatusBarNotification; import android.text.TextUtils; Loading Loading @@ -780,7 +779,8 @@ public class CentralSurfacesImpl extends CoreStartable implements InteractionJankMonitor jankMonitor, DeviceStateManager deviceStateManager, DreamOverlayStateController dreamOverlayStateController, WiredChargingRippleController wiredChargingRippleController) { WiredChargingRippleController wiredChargingRippleController, IDreamManager dreamManager) { super(context); mNotificationsController = notificationsController; mFragmentService = fragmentService; Loading Loading @@ -871,6 +871,7 @@ public class CentralSurfacesImpl extends CoreStartable implements mLockscreenShadeTransitionController = lockscreenShadeTransitionController; mStartingSurfaceOptional = startingSurfaceOptional; mNotifPipelineFlags = notifPipelineFlags; mDreamManager = dreamManager; lockscreenShadeTransitionController.setCentralSurfaces(this); statusBarWindowStateController.addListener(this::onStatusBarWindowStateChanged); Loading Loading @@ -924,8 +925,6 @@ public class CentralSurfacesImpl extends CoreStartable implements SysuiStatusBarStateController.RANK_STATUS_BAR); mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE); mDreamManager = IDreamManager.Stub.asInterface( ServiceManager.checkService(DreamService.DREAM_SERVICE)); mDisplay = mContext.getDisplay(); mDisplayId = mDisplay.getDisplayId(); Loading Loading @@ -1792,6 +1791,12 @@ public class CentralSurfacesImpl extends CoreStartable implements collapseShade(); } // We should exit the dream to prevent the activity from starting below the // dream. if (mKeyguardUpdateMonitor.isDreaming()) { awakenDreams(); } mActivityLaunchAnimator.startIntentWithAnimation(controller, animate, intent.getPackage(), showOverLockscreenWhenLocked, (adapter) -> TaskStackBuilder .create(mContext) Loading Loading @@ -2731,6 +2736,10 @@ public class CentralSurfacesImpl extends CoreStartable implements mStatusBarKeyguardViewManager.dismissWithAction(action, cancelAction, afterKeyguardGone); } else { // If the keyguard isn't showing but the device is dreaming, we should exit the dream. if (mKeyguardUpdateMonitor.isDreaming()) { awakenDreams(); } action.onDismiss(); } } Loading Loading @@ -3964,7 +3973,7 @@ public class CentralSurfacesImpl extends CoreStartable implements protected WindowManager mWindowManager; protected IWindowManager mWindowManagerService; private IDreamManager mDreamManager; private final IDreamManager mDreamManager; protected Display mDisplay; private int mDisplayId; Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java +31 −1 Original line number Diff line number Diff line Loading @@ -477,7 +477,7 @@ public class CentralSurfacesImplTest extends SysuiTestCase { mJankMonitor, mDeviceStateManager, mDreamOverlayStateController, mWiredChargingRippleController); mWiredChargingRippleController, mDreamManager); when(mKeyguardViewMediator.registerCentralSurfaces( any(CentralSurfacesImpl.class), any(NotificationPanelViewController.class), Loading Loading @@ -533,6 +533,36 @@ public class CentralSurfacesImplTest extends SysuiTestCase { mCentralSurfaces.executeRunnableDismissingKeyguard(null, null, false, false, false); } @Test public void executeRunnableDismissingKeyguard_dreaming_notShowing() throws RemoteException { when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(false); when(mStatusBarKeyguardViewManager.isOccluded()).thenReturn(false); when(mKeyguardUpdateMonitor.isDreaming()).thenReturn(true); mCentralSurfaces.executeRunnableDismissingKeyguard(() -> {}, /* cancelAction= */ null, /* dismissShade= */ false, /* afterKeyguardGone= */ false, /* deferred= */ false); mUiBgExecutor.runAllReady(); verify(mDreamManager, times(1)).awaken(); } @Test public void executeRunnableDismissingKeyguard_notDreaming_notShowing() throws RemoteException { when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(false); when(mStatusBarKeyguardViewManager.isOccluded()).thenReturn(false); when(mKeyguardUpdateMonitor.isDreaming()).thenReturn(false); mCentralSurfaces.executeRunnableDismissingKeyguard(() -> {}, /* cancelAction= */ null, /* dismissShade= */ false, /* afterKeyguardGone= */ false, /* deferred= */ false); mUiBgExecutor.runAllReady(); verify(mDreamManager, never()).awaken(); } @Test public void lockscreenStateMetrics_notShowing() { // uninteresting state, except that fingerprint must be non-zero Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +14 −5 Original line number Diff line number Diff line Loading @@ -83,7 +83,6 @@ import android.os.SystemProperties; import android.os.Trace; import android.os.UserHandle; import android.provider.Settings; import android.service.dreams.DreamService; import android.service.dreams.IDreamManager; import android.service.notification.StatusBarNotification; import android.text.TextUtils; Loading Loading @@ -780,7 +779,8 @@ public class CentralSurfacesImpl extends CoreStartable implements InteractionJankMonitor jankMonitor, DeviceStateManager deviceStateManager, DreamOverlayStateController dreamOverlayStateController, WiredChargingRippleController wiredChargingRippleController) { WiredChargingRippleController wiredChargingRippleController, IDreamManager dreamManager) { super(context); mNotificationsController = notificationsController; mFragmentService = fragmentService; Loading Loading @@ -871,6 +871,7 @@ public class CentralSurfacesImpl extends CoreStartable implements mLockscreenShadeTransitionController = lockscreenShadeTransitionController; mStartingSurfaceOptional = startingSurfaceOptional; mNotifPipelineFlags = notifPipelineFlags; mDreamManager = dreamManager; lockscreenShadeTransitionController.setCentralSurfaces(this); statusBarWindowStateController.addListener(this::onStatusBarWindowStateChanged); Loading Loading @@ -924,8 +925,6 @@ public class CentralSurfacesImpl extends CoreStartable implements SysuiStatusBarStateController.RANK_STATUS_BAR); mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE); mDreamManager = IDreamManager.Stub.asInterface( ServiceManager.checkService(DreamService.DREAM_SERVICE)); mDisplay = mContext.getDisplay(); mDisplayId = mDisplay.getDisplayId(); Loading Loading @@ -1792,6 +1791,12 @@ public class CentralSurfacesImpl extends CoreStartable implements collapseShade(); } // We should exit the dream to prevent the activity from starting below the // dream. if (mKeyguardUpdateMonitor.isDreaming()) { awakenDreams(); } mActivityLaunchAnimator.startIntentWithAnimation(controller, animate, intent.getPackage(), showOverLockscreenWhenLocked, (adapter) -> TaskStackBuilder .create(mContext) Loading Loading @@ -2731,6 +2736,10 @@ public class CentralSurfacesImpl extends CoreStartable implements mStatusBarKeyguardViewManager.dismissWithAction(action, cancelAction, afterKeyguardGone); } else { // If the keyguard isn't showing but the device is dreaming, we should exit the dream. if (mKeyguardUpdateMonitor.isDreaming()) { awakenDreams(); } action.onDismiss(); } } Loading Loading @@ -3964,7 +3973,7 @@ public class CentralSurfacesImpl extends CoreStartable implements protected WindowManager mWindowManager; protected IWindowManager mWindowManagerService; private IDreamManager mDreamManager; private final IDreamManager mDreamManager; protected Display mDisplay; private int mDisplayId; Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java +31 −1 Original line number Diff line number Diff line Loading @@ -477,7 +477,7 @@ public class CentralSurfacesImplTest extends SysuiTestCase { mJankMonitor, mDeviceStateManager, mDreamOverlayStateController, mWiredChargingRippleController); mWiredChargingRippleController, mDreamManager); when(mKeyguardViewMediator.registerCentralSurfaces( any(CentralSurfacesImpl.class), any(NotificationPanelViewController.class), Loading Loading @@ -533,6 +533,36 @@ public class CentralSurfacesImplTest extends SysuiTestCase { mCentralSurfaces.executeRunnableDismissingKeyguard(null, null, false, false, false); } @Test public void executeRunnableDismissingKeyguard_dreaming_notShowing() throws RemoteException { when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(false); when(mStatusBarKeyguardViewManager.isOccluded()).thenReturn(false); when(mKeyguardUpdateMonitor.isDreaming()).thenReturn(true); mCentralSurfaces.executeRunnableDismissingKeyguard(() -> {}, /* cancelAction= */ null, /* dismissShade= */ false, /* afterKeyguardGone= */ false, /* deferred= */ false); mUiBgExecutor.runAllReady(); verify(mDreamManager, times(1)).awaken(); } @Test public void executeRunnableDismissingKeyguard_notDreaming_notShowing() throws RemoteException { when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(false); when(mStatusBarKeyguardViewManager.isOccluded()).thenReturn(false); when(mKeyguardUpdateMonitor.isDreaming()).thenReturn(false); mCentralSurfaces.executeRunnableDismissingKeyguard(() -> {}, /* cancelAction= */ null, /* dismissShade= */ false, /* afterKeyguardGone= */ false, /* deferred= */ false); mUiBgExecutor.runAllReady(); verify(mDreamManager, never()).awaken(); } @Test public void lockscreenStateMetrics_notShowing() { // uninteresting state, except that fingerprint must be non-zero Loading