Loading packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +5 −1 Original line number Diff line number Diff line Loading @@ -6051,6 +6051,10 @@ public final class NotificationPanelViewController { mShadeLog.logMotionEvent(event, "onTouch: PulseExpansionHandler handled event"); return true; } if (mPulsing) { mShadeLog.logMotionEvent(event, "onTouch: eat touch, device pulsing"); return true; } if (mListenForHeadsUp && !mHeadsUpTouchHelper.isTrackingHeadsUp() && !mNotificationStackScrollLayoutController.isLongPressInProgress() && mHeadsUpTouchHelper.onInterceptTouchEvent(event)) { Loading @@ -6073,7 +6077,7 @@ public final class NotificationPanelViewController { } handled |= handleTouch(event); return !mDozing || mPulsing || handled; return !mDozing || handled; } private boolean handleTouch(MotionEvent event) { Loading packages/SystemUI/src/com/android/systemui/statusbar/PulseExpansionHandler.kt +5 −2 Original line number Diff line number Diff line Loading @@ -52,7 +52,10 @@ import javax.inject.Inject import kotlin.math.max /** * A utility class to enable the downward swipe on when pulsing. * A utility class that handles notification panel expansion when a user swipes downward on a * notification from the pulsing state. * If face-bypass is enabled, the user can swipe down anywhere on the screen (not just from a * notification) to trigger the notification panel expansion. */ @SysUISingleton class PulseExpansionHandler @Inject Loading @@ -62,7 +65,7 @@ constructor( private val bypassController: KeyguardBypassController, private val headsUpManager: HeadsUpManagerPhone, private val roundnessManager: NotificationRoundnessManager, private val configurationController: ConfigurationController, configurationController: ConfigurationController, private val statusBarStateController: StatusBarStateController, private val falsingManager: FalsingManager, private val lockscreenShadeTransitionController: LockscreenShadeTransitionController, Loading packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java +34 −0 Original line number Diff line number Diff line Loading @@ -715,6 +715,40 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase { assertThat(mNotificationPanelViewController.isTrackingBlocked()).isFalse(); } @Test public void test_pulsing_onTouchEvent_noTracking() { // GIVEN device is pulsing mNotificationPanelViewController.setPulsing(true); // WHEN touch DOWN & MOVE events received onTouchEvent(MotionEvent.obtain(0L /* downTime */, 0L /* eventTime */, MotionEvent.ACTION_DOWN, 0f /* x */, 0f /* y */, 0 /* metaState */)); onTouchEvent(MotionEvent.obtain(0L /* downTime */, 0L /* eventTime */, MotionEvent.ACTION_MOVE, 0f /* x */, 200f /* y */, 0 /* metaState */)); // THEN touch is NOT tracked (since the device is pulsing) assertThat(mNotificationPanelViewController.isTracking()).isFalse(); } @Test public void test_onTouchEvent_startTracking() { // GIVEN device is NOT pulsing mNotificationPanelViewController.setPulsing(false); // WHEN touch DOWN & MOVE events received onTouchEvent(MotionEvent.obtain(0L /* downTime */, 0L /* eventTime */, MotionEvent.ACTION_DOWN, 0f /* x */, 0f /* y */, 0 /* metaState */)); onTouchEvent(MotionEvent.obtain(0L /* downTime */, 0L /* eventTime */, MotionEvent.ACTION_MOVE, 0f /* x */, 200f /* y */, 0 /* metaState */)); // THEN touch is tracked assertThat(mNotificationPanelViewController.isTracking()).isTrue(); } @Test public void handleTouchEventFromStatusBar_panelsNotEnabled_returnsFalseAndNoViewEvent() { when(mCommandQueue.panelsEnabled()).thenReturn(false); Loading Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +5 −1 Original line number Diff line number Diff line Loading @@ -6051,6 +6051,10 @@ public final class NotificationPanelViewController { mShadeLog.logMotionEvent(event, "onTouch: PulseExpansionHandler handled event"); return true; } if (mPulsing) { mShadeLog.logMotionEvent(event, "onTouch: eat touch, device pulsing"); return true; } if (mListenForHeadsUp && !mHeadsUpTouchHelper.isTrackingHeadsUp() && !mNotificationStackScrollLayoutController.isLongPressInProgress() && mHeadsUpTouchHelper.onInterceptTouchEvent(event)) { Loading @@ -6073,7 +6077,7 @@ public final class NotificationPanelViewController { } handled |= handleTouch(event); return !mDozing || mPulsing || handled; return !mDozing || handled; } private boolean handleTouch(MotionEvent event) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/PulseExpansionHandler.kt +5 −2 Original line number Diff line number Diff line Loading @@ -52,7 +52,10 @@ import javax.inject.Inject import kotlin.math.max /** * A utility class to enable the downward swipe on when pulsing. * A utility class that handles notification panel expansion when a user swipes downward on a * notification from the pulsing state. * If face-bypass is enabled, the user can swipe down anywhere on the screen (not just from a * notification) to trigger the notification panel expansion. */ @SysUISingleton class PulseExpansionHandler @Inject Loading @@ -62,7 +65,7 @@ constructor( private val bypassController: KeyguardBypassController, private val headsUpManager: HeadsUpManagerPhone, private val roundnessManager: NotificationRoundnessManager, private val configurationController: ConfigurationController, configurationController: ConfigurationController, private val statusBarStateController: StatusBarStateController, private val falsingManager: FalsingManager, private val lockscreenShadeTransitionController: LockscreenShadeTransitionController, Loading
packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java +34 −0 Original line number Diff line number Diff line Loading @@ -715,6 +715,40 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase { assertThat(mNotificationPanelViewController.isTrackingBlocked()).isFalse(); } @Test public void test_pulsing_onTouchEvent_noTracking() { // GIVEN device is pulsing mNotificationPanelViewController.setPulsing(true); // WHEN touch DOWN & MOVE events received onTouchEvent(MotionEvent.obtain(0L /* downTime */, 0L /* eventTime */, MotionEvent.ACTION_DOWN, 0f /* x */, 0f /* y */, 0 /* metaState */)); onTouchEvent(MotionEvent.obtain(0L /* downTime */, 0L /* eventTime */, MotionEvent.ACTION_MOVE, 0f /* x */, 200f /* y */, 0 /* metaState */)); // THEN touch is NOT tracked (since the device is pulsing) assertThat(mNotificationPanelViewController.isTracking()).isFalse(); } @Test public void test_onTouchEvent_startTracking() { // GIVEN device is NOT pulsing mNotificationPanelViewController.setPulsing(false); // WHEN touch DOWN & MOVE events received onTouchEvent(MotionEvent.obtain(0L /* downTime */, 0L /* eventTime */, MotionEvent.ACTION_DOWN, 0f /* x */, 0f /* y */, 0 /* metaState */)); onTouchEvent(MotionEvent.obtain(0L /* downTime */, 0L /* eventTime */, MotionEvent.ACTION_MOVE, 0f /* x */, 200f /* y */, 0 /* metaState */)); // THEN touch is tracked assertThat(mNotificationPanelViewController.isTracking()).isTrue(); } @Test public void handleTouchEventFromStatusBar_panelsNotEnabled_returnsFalseAndNoViewEvent() { when(mCommandQueue.panelsEnabled()).thenReturn(false); Loading