Loading packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java +13 −0 Original line number Diff line number Diff line Loading @@ -113,6 +113,7 @@ public class NotificationShadeWindowViewController implements Dumpable { private final SysUIKeyEventHandler mSysUIKeyEventHandler; private final PrimaryBouncerInteractor mPrimaryBouncerInteractor; private final AlternateBouncerInteractor mAlternateBouncerInteractor; private final QuickSettingsController mQuickSettingsController; private GestureDetector mPulsingWakeupGestureHandler; private GestureDetector mDreamingWakeupGestureHandler; private View mBrightnessMirror; Loading Loading @@ -188,6 +189,7 @@ public class NotificationShadeWindowViewController implements Dumpable { BouncerMessageInteractor bouncerMessageInteractor, BouncerLogger bouncerLogger, SysUIKeyEventHandler sysUIKeyEventHandler, QuickSettingsController quickSettingsController, PrimaryBouncerInteractor primaryBouncerInteractor, AlternateBouncerInteractor alternateBouncerInteractor, SelectedUserInteractor selectedUserInteractor) { Loading Loading @@ -220,6 +222,7 @@ public class NotificationShadeWindowViewController implements Dumpable { mSysUIKeyEventHandler = sysUIKeyEventHandler; mPrimaryBouncerInteractor = primaryBouncerInteractor; mAlternateBouncerInteractor = alternateBouncerInteractor; mQuickSettingsController = quickSettingsController; // This view is not part of the newly inflated expanded status bar. mBrightnessMirror = mView.findViewById(R.id.brightness_mirror_container); Loading Loading @@ -454,6 +457,16 @@ public class NotificationShadeWindowViewController implements Dumpable { && !bouncerShowing && !mStatusBarStateController.isDozing()) { if (mDragDownHelper.isDragDownEnabled()) { if (mFeatureFlagsClassic.isEnabled(Flags.MIGRATE_NSSL)) { // When on lockscreen, if the touch originates at the top of the screen // go directly to QS and not the shade if (mQuickSettingsController.shouldQuickSettingsIntercept( ev.getX(), ev.getY(), 0)) { mShadeLogger.d("NSWVC: QS intercepted"); return true; } } // This handles drag down over lockscreen boolean result = mDragDownHelper.onInterceptTouchEvent(ev); if (mFeatureFlagsClassic.isEnabled(Flags.MIGRATE_NSSL)) { Loading packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt +33 −8 Original line number Diff line number Diff line Loading @@ -97,6 +97,7 @@ import com.android.systemui.util.mockito.any import com.android.systemui.util.mockito.eq import com.android.systemui.util.time.FakeSystemClock import com.google.common.truth.Truth.assertThat import java.util.Optional import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.emptyFlow import kotlinx.coroutines.test.TestScope Loading @@ -111,9 +112,8 @@ import org.mockito.Mockito.mock import org.mockito.Mockito.never import org.mockito.Mockito.times import org.mockito.Mockito.verify import org.mockito.MockitoAnnotations import java.util.Optional import org.mockito.Mockito.`when` as whenever import org.mockito.MockitoAnnotations @OptIn(ExperimentalCoroutinesApi::class) @SmallTest Loading @@ -140,6 +140,7 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { @Mock private lateinit var stackScrollLayoutController: NotificationStackScrollLayoutController @Mock private lateinit var statusBarKeyguardViewManager: StatusBarKeyguardViewManager @Mock private lateinit var statusBarWindowStateController: StatusBarWindowStateController @Mock private lateinit var quickSettingsController: QuickSettingsController @Mock private lateinit var lockscreenShadeTransitionController: LockscreenShadeTransitionController @Mock private lateinit var lockIconViewController: LockIconViewController Loading Loading @@ -274,6 +275,7 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { ), BouncerLogger(logcatLogBuffer("BouncerLog")), sysUIKeyEventHandler, quickSettingsController, primaryBouncerInteractor, alternateBouncerInteractor, mSelectedUserInteractor, Loading Loading @@ -460,9 +462,11 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { // AND alternate bouncer doesn't want the touch whenever(statusBarKeyguardViewManager.shouldInterceptTouchEvent(DOWN_EVENT)) .thenReturn(false) // AND quick settings controller doesn't want it whenever(quickSettingsController.shouldQuickSettingsIntercept(any(), any(), any())) .thenReturn(false) // AND the lock icon wants the touch whenever(lockIconViewController.willHandleTouchWhileDozing(DOWN_EVENT)) .thenReturn(true) whenever(lockIconViewController.willHandleTouchWhileDozing(DOWN_EVENT)).thenReturn(true) featureFlagsClassic.set(MIGRATE_NSSL, true) Loading @@ -478,7 +482,9 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { whenever(statusBarKeyguardViewManager.shouldInterceptTouchEvent(DOWN_EVENT)) .thenReturn(false) // AND the lock icon does NOT want the touch whenever(lockIconViewController.willHandleTouchWhileDozing(DOWN_EVENT)) whenever(lockIconViewController.willHandleTouchWhileDozing(DOWN_EVENT)).thenReturn(false) // AND quick settings controller doesn't want it whenever(quickSettingsController.shouldQuickSettingsIntercept(any(), any(), any())) .thenReturn(false) featureFlagsClassic.set(MIGRATE_NSSL, true) Loading @@ -487,6 +493,25 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { assertThat(interactionEventHandler.shouldInterceptTouchEvent(DOWN_EVENT)).isTrue() } @Test fun shouldInterceptTouchEvent_dozing_touchInStatusBar_touchIntercepted() { // GIVEN dozing whenever(sysuiStatusBarStateController.isDozing).thenReturn(true) // AND alternate bouncer doesn't want the touch whenever(statusBarKeyguardViewManager.shouldInterceptTouchEvent(DOWN_EVENT)) .thenReturn(false) // AND the lock icon does NOT want the touch whenever(lockIconViewController.willHandleTouchWhileDozing(DOWN_EVENT)).thenReturn(false) // AND quick settings controller DOES want it whenever(quickSettingsController.shouldQuickSettingsIntercept(any(), any(), any())) .thenReturn(true) featureFlagsClassic.set(MIGRATE_NSSL, true) // THEN touch should NOT be intercepted by NotificationShade assertThat(interactionEventHandler.shouldInterceptTouchEvent(DOWN_EVENT)).isTrue() } @Test fun testGetKeyguardMessageArea() = testScope.runTest { Loading packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewTest.kt +2 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ class NotificationShadeWindowViewTest : SysuiTestCase() { @Mock private lateinit var notificationStackScrollLayout: NotificationStackScrollLayout @Mock private lateinit var notificationShadeDepthController: NotificationShadeDepthController @Mock private lateinit var notificationShadeWindowController: NotificationShadeWindowController @Mock private lateinit var quickSettingsController: QuickSettingsController @Mock private lateinit var notificationStackScrollLayoutController: NotificationStackScrollLayoutController Loading Loading @@ -264,6 +265,7 @@ class NotificationShadeWindowViewTest : SysuiTestCase() { ), BouncerLogger(logcatLogBuffer("BouncerLog")), Mockito.mock(SysUIKeyEventHandler::class.java), quickSettingsController, primaryBouncerInteractor, alternateBouncerInteractor, mSelectedUserInteractor, Loading Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java +13 −0 Original line number Diff line number Diff line Loading @@ -113,6 +113,7 @@ public class NotificationShadeWindowViewController implements Dumpable { private final SysUIKeyEventHandler mSysUIKeyEventHandler; private final PrimaryBouncerInteractor mPrimaryBouncerInteractor; private final AlternateBouncerInteractor mAlternateBouncerInteractor; private final QuickSettingsController mQuickSettingsController; private GestureDetector mPulsingWakeupGestureHandler; private GestureDetector mDreamingWakeupGestureHandler; private View mBrightnessMirror; Loading Loading @@ -188,6 +189,7 @@ public class NotificationShadeWindowViewController implements Dumpable { BouncerMessageInteractor bouncerMessageInteractor, BouncerLogger bouncerLogger, SysUIKeyEventHandler sysUIKeyEventHandler, QuickSettingsController quickSettingsController, PrimaryBouncerInteractor primaryBouncerInteractor, AlternateBouncerInteractor alternateBouncerInteractor, SelectedUserInteractor selectedUserInteractor) { Loading Loading @@ -220,6 +222,7 @@ public class NotificationShadeWindowViewController implements Dumpable { mSysUIKeyEventHandler = sysUIKeyEventHandler; mPrimaryBouncerInteractor = primaryBouncerInteractor; mAlternateBouncerInteractor = alternateBouncerInteractor; mQuickSettingsController = quickSettingsController; // This view is not part of the newly inflated expanded status bar. mBrightnessMirror = mView.findViewById(R.id.brightness_mirror_container); Loading Loading @@ -454,6 +457,16 @@ public class NotificationShadeWindowViewController implements Dumpable { && !bouncerShowing && !mStatusBarStateController.isDozing()) { if (mDragDownHelper.isDragDownEnabled()) { if (mFeatureFlagsClassic.isEnabled(Flags.MIGRATE_NSSL)) { // When on lockscreen, if the touch originates at the top of the screen // go directly to QS and not the shade if (mQuickSettingsController.shouldQuickSettingsIntercept( ev.getX(), ev.getY(), 0)) { mShadeLogger.d("NSWVC: QS intercepted"); return true; } } // This handles drag down over lockscreen boolean result = mDragDownHelper.onInterceptTouchEvent(ev); if (mFeatureFlagsClassic.isEnabled(Flags.MIGRATE_NSSL)) { Loading
packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt +33 −8 Original line number Diff line number Diff line Loading @@ -97,6 +97,7 @@ import com.android.systemui.util.mockito.any import com.android.systemui.util.mockito.eq import com.android.systemui.util.time.FakeSystemClock import com.google.common.truth.Truth.assertThat import java.util.Optional import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.emptyFlow import kotlinx.coroutines.test.TestScope Loading @@ -111,9 +112,8 @@ import org.mockito.Mockito.mock import org.mockito.Mockito.never import org.mockito.Mockito.times import org.mockito.Mockito.verify import org.mockito.MockitoAnnotations import java.util.Optional import org.mockito.Mockito.`when` as whenever import org.mockito.MockitoAnnotations @OptIn(ExperimentalCoroutinesApi::class) @SmallTest Loading @@ -140,6 +140,7 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { @Mock private lateinit var stackScrollLayoutController: NotificationStackScrollLayoutController @Mock private lateinit var statusBarKeyguardViewManager: StatusBarKeyguardViewManager @Mock private lateinit var statusBarWindowStateController: StatusBarWindowStateController @Mock private lateinit var quickSettingsController: QuickSettingsController @Mock private lateinit var lockscreenShadeTransitionController: LockscreenShadeTransitionController @Mock private lateinit var lockIconViewController: LockIconViewController Loading Loading @@ -274,6 +275,7 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { ), BouncerLogger(logcatLogBuffer("BouncerLog")), sysUIKeyEventHandler, quickSettingsController, primaryBouncerInteractor, alternateBouncerInteractor, mSelectedUserInteractor, Loading Loading @@ -460,9 +462,11 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { // AND alternate bouncer doesn't want the touch whenever(statusBarKeyguardViewManager.shouldInterceptTouchEvent(DOWN_EVENT)) .thenReturn(false) // AND quick settings controller doesn't want it whenever(quickSettingsController.shouldQuickSettingsIntercept(any(), any(), any())) .thenReturn(false) // AND the lock icon wants the touch whenever(lockIconViewController.willHandleTouchWhileDozing(DOWN_EVENT)) .thenReturn(true) whenever(lockIconViewController.willHandleTouchWhileDozing(DOWN_EVENT)).thenReturn(true) featureFlagsClassic.set(MIGRATE_NSSL, true) Loading @@ -478,7 +482,9 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { whenever(statusBarKeyguardViewManager.shouldInterceptTouchEvent(DOWN_EVENT)) .thenReturn(false) // AND the lock icon does NOT want the touch whenever(lockIconViewController.willHandleTouchWhileDozing(DOWN_EVENT)) whenever(lockIconViewController.willHandleTouchWhileDozing(DOWN_EVENT)).thenReturn(false) // AND quick settings controller doesn't want it whenever(quickSettingsController.shouldQuickSettingsIntercept(any(), any(), any())) .thenReturn(false) featureFlagsClassic.set(MIGRATE_NSSL, true) Loading @@ -487,6 +493,25 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { assertThat(interactionEventHandler.shouldInterceptTouchEvent(DOWN_EVENT)).isTrue() } @Test fun shouldInterceptTouchEvent_dozing_touchInStatusBar_touchIntercepted() { // GIVEN dozing whenever(sysuiStatusBarStateController.isDozing).thenReturn(true) // AND alternate bouncer doesn't want the touch whenever(statusBarKeyguardViewManager.shouldInterceptTouchEvent(DOWN_EVENT)) .thenReturn(false) // AND the lock icon does NOT want the touch whenever(lockIconViewController.willHandleTouchWhileDozing(DOWN_EVENT)).thenReturn(false) // AND quick settings controller DOES want it whenever(quickSettingsController.shouldQuickSettingsIntercept(any(), any(), any())) .thenReturn(true) featureFlagsClassic.set(MIGRATE_NSSL, true) // THEN touch should NOT be intercepted by NotificationShade assertThat(interactionEventHandler.shouldInterceptTouchEvent(DOWN_EVENT)).isTrue() } @Test fun testGetKeyguardMessageArea() = testScope.runTest { Loading
packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewTest.kt +2 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ class NotificationShadeWindowViewTest : SysuiTestCase() { @Mock private lateinit var notificationStackScrollLayout: NotificationStackScrollLayout @Mock private lateinit var notificationShadeDepthController: NotificationShadeDepthController @Mock private lateinit var notificationShadeWindowController: NotificationShadeWindowController @Mock private lateinit var quickSettingsController: QuickSettingsController @Mock private lateinit var notificationStackScrollLayoutController: NotificationStackScrollLayoutController Loading Loading @@ -264,6 +265,7 @@ class NotificationShadeWindowViewTest : SysuiTestCase() { ), BouncerLogger(logcatLogBuffer("BouncerLog")), Mockito.mock(SysUIKeyEventHandler::class.java), quickSettingsController, primaryBouncerInteractor, alternateBouncerInteractor, mSelectedUserInteractor, Loading