Loading packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +3 −1 Original line number Diff line number Diff line Loading @@ -4838,7 +4838,9 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump switch (event.getActionMasked()) { case MotionEvent.ACTION_DOWN: if (!KeyguardShadeMigrationNssl.isEnabled()) { mCentralSurfaces.userActivity(); } mAnimatingOnDown = mHeightAnimator != null && !mIsSpringBackAnimation; mMinExpandHeight = 0.0f; mDownTime = mSystemClock.uptimeMillis(); Loading packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java +3 −0 Original line number Diff line number Diff line Loading @@ -311,6 +311,9 @@ public class NotificationShadeWindowViewController implements Dumpable { mTouchActive = true; mTouchCancelled = false; mDownEvent = ev; if (KeyguardShadeMigrationNssl.isEnabled()) { mService.userActivity(); } } else if (ev.getActionMasked() == MotionEvent.ACTION_UP || ev.getActionMasked() == MotionEvent.ACTION_CANCEL) { mTouchActive = false; Loading packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java +22 −0 Original line number Diff line number Diff line Loading @@ -361,6 +361,28 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo assertThat(mNotificationPanelViewController.isTracking()).isTrue(); } @Test public void onInterceptTouchEvent_nsslMigrationOff_userActivity() { mSetFlagsRule.disableFlags(com.android.systemui.Flags.FLAG_KEYGUARD_SHADE_MIGRATION_NSSL); mTouchHandler.onInterceptTouchEvent(MotionEvent.obtain(0L /* downTime */, 0L /* eventTime */, MotionEvent.ACTION_DOWN, 0f /* x */, 0f /* y */, 0 /* metaState */)); verify(mCentralSurfaces).userActivity(); } @Test public void onInterceptTouchEvent_nsslMigrationOn_userActivity_not_called() { mSetFlagsRule.enableFlags(com.android.systemui.Flags.FLAG_KEYGUARD_SHADE_MIGRATION_NSSL); mTouchHandler.onInterceptTouchEvent(MotionEvent.obtain(0L /* downTime */, 0L /* eventTime */, MotionEvent.ACTION_DOWN, 0f /* x */, 0f /* y */, 0 /* metaState */)); verify(mCentralSurfaces, times(0)).userActivity(); } @Test public void testOnTouchEvent_expansionResumesAfterBriefTouch() { mFalsingManager.setIsClassifierEnabled(true); Loading packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt +22 −2 Original line number Diff line number Diff line Loading @@ -98,7 +98,6 @@ 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 @@ -113,8 +112,9 @@ import org.mockito.Mockito.mock import org.mockito.Mockito.never import org.mockito.Mockito.times import org.mockito.Mockito.verify import org.mockito.Mockito.`when` as whenever import org.mockito.MockitoAnnotations import java.util.Optional import org.mockito.Mockito.`when` as whenever @OptIn(ExperimentalCoroutinesApi::class) @SmallTest Loading Loading @@ -445,6 +445,26 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { verify(notificationShadeWindowController).setLaunchingActivity(false) } @Test fun handleDispatchTouchEvent_nsslMigrationOff_userActivity_not_called() { mSetFlagsRule.disableFlags(Flags.FLAG_KEYGUARD_SHADE_MIGRATION_NSSL) underTest.setStatusBarViewController(phoneStatusBarViewController) interactionEventHandler.handleDispatchTouchEvent(DOWN_EVENT) verify(centralSurfaces, times(0)).userActivity() } @Test fun handleDispatchTouchEvent_nsslMigrationOn_userActivity() { mSetFlagsRule.enableFlags(Flags.FLAG_KEYGUARD_SHADE_MIGRATION_NSSL) underTest.setStatusBarViewController(phoneStatusBarViewController) interactionEventHandler.handleDispatchTouchEvent(DOWN_EVENT) verify(centralSurfaces).userActivity() } @Test fun shouldInterceptTouchEvent_statusBarKeyguardViewManagerShouldIntercept() { // down event should be intercepted by keyguardViewManager Loading Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +3 −1 Original line number Diff line number Diff line Loading @@ -4838,7 +4838,9 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump switch (event.getActionMasked()) { case MotionEvent.ACTION_DOWN: if (!KeyguardShadeMigrationNssl.isEnabled()) { mCentralSurfaces.userActivity(); } mAnimatingOnDown = mHeightAnimator != null && !mIsSpringBackAnimation; mMinExpandHeight = 0.0f; mDownTime = mSystemClock.uptimeMillis(); Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java +3 −0 Original line number Diff line number Diff line Loading @@ -311,6 +311,9 @@ public class NotificationShadeWindowViewController implements Dumpable { mTouchActive = true; mTouchCancelled = false; mDownEvent = ev; if (KeyguardShadeMigrationNssl.isEnabled()) { mService.userActivity(); } } else if (ev.getActionMasked() == MotionEvent.ACTION_UP || ev.getActionMasked() == MotionEvent.ACTION_CANCEL) { mTouchActive = false; Loading
packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java +22 −0 Original line number Diff line number Diff line Loading @@ -361,6 +361,28 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo assertThat(mNotificationPanelViewController.isTracking()).isTrue(); } @Test public void onInterceptTouchEvent_nsslMigrationOff_userActivity() { mSetFlagsRule.disableFlags(com.android.systemui.Flags.FLAG_KEYGUARD_SHADE_MIGRATION_NSSL); mTouchHandler.onInterceptTouchEvent(MotionEvent.obtain(0L /* downTime */, 0L /* eventTime */, MotionEvent.ACTION_DOWN, 0f /* x */, 0f /* y */, 0 /* metaState */)); verify(mCentralSurfaces).userActivity(); } @Test public void onInterceptTouchEvent_nsslMigrationOn_userActivity_not_called() { mSetFlagsRule.enableFlags(com.android.systemui.Flags.FLAG_KEYGUARD_SHADE_MIGRATION_NSSL); mTouchHandler.onInterceptTouchEvent(MotionEvent.obtain(0L /* downTime */, 0L /* eventTime */, MotionEvent.ACTION_DOWN, 0f /* x */, 0f /* y */, 0 /* metaState */)); verify(mCentralSurfaces, times(0)).userActivity(); } @Test public void testOnTouchEvent_expansionResumesAfterBriefTouch() { mFalsingManager.setIsClassifierEnabled(true); Loading
packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt +22 −2 Original line number Diff line number Diff line Loading @@ -98,7 +98,6 @@ 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 @@ -113,8 +112,9 @@ import org.mockito.Mockito.mock import org.mockito.Mockito.never import org.mockito.Mockito.times import org.mockito.Mockito.verify import org.mockito.Mockito.`when` as whenever import org.mockito.MockitoAnnotations import java.util.Optional import org.mockito.Mockito.`when` as whenever @OptIn(ExperimentalCoroutinesApi::class) @SmallTest Loading Loading @@ -445,6 +445,26 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { verify(notificationShadeWindowController).setLaunchingActivity(false) } @Test fun handleDispatchTouchEvent_nsslMigrationOff_userActivity_not_called() { mSetFlagsRule.disableFlags(Flags.FLAG_KEYGUARD_SHADE_MIGRATION_NSSL) underTest.setStatusBarViewController(phoneStatusBarViewController) interactionEventHandler.handleDispatchTouchEvent(DOWN_EVENT) verify(centralSurfaces, times(0)).userActivity() } @Test fun handleDispatchTouchEvent_nsslMigrationOn_userActivity() { mSetFlagsRule.enableFlags(Flags.FLAG_KEYGUARD_SHADE_MIGRATION_NSSL) underTest.setStatusBarViewController(phoneStatusBarViewController) interactionEventHandler.handleDispatchTouchEvent(DOWN_EVENT) verify(centralSurfaces).userActivity() } @Test fun shouldInterceptTouchEvent_statusBarKeyguardViewManagerShouldIntercept() { // down event should be intercepted by keyguardViewManager Loading