Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +7 −0 Original line number Diff line number Diff line Loading @@ -3926,6 +3926,10 @@ public class StatusBar extends SystemUI implements DemoMode, mScrimController.setWakeLockScreenSensorActive(true); } if (reason == DozeLog.PULSE_REASON_DOCKING && mStatusBarWindow != null) { mStatusBarWindow.suppressWakeUpGesture(true); } boolean passiveAuthInterrupt = reason == DozeLog.PULSE_REASON_NOTIFICATION; // Set the state to pulsing, so ScrimController will know what to do once we ask it to // execute the transition. The pulse callback will then be invoked when the scrims Loading @@ -3945,6 +3949,9 @@ public class StatusBar extends SystemUI implements DemoMode, callback.onPulseFinished(); updateNotificationPanelTouchState(); mScrimController.setWakeLockScreenSensorActive(false); if (mStatusBarWindow != null) { mStatusBarWindow.suppressWakeUpGesture(false); } setPulsing(false); } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java +6 −1 Original line number Diff line number Diff line Loading @@ -107,12 +107,13 @@ public class StatusBarWindowView extends FrameLayout { private boolean mTouchActive; private boolean mExpandAnimationRunning; private boolean mExpandAnimationPending; private boolean mSuppressingWakeUpGesture; private final GestureDetector.SimpleOnGestureListener mGestureListener = new GestureDetector.SimpleOnGestureListener() { @Override public boolean onSingleTapConfirmed(MotionEvent e) { if (mSingleTapEnabled) { if (mSingleTapEnabled && !mSuppressingWakeUpGesture) { mService.wakeUpIfDozing(SystemClock.uptimeMillis(), StatusBarWindowView.this, "SINGLE_TAP"); return true; Loading Loading @@ -327,6 +328,10 @@ public class StatusBarWindowView extends FrameLayout { mTouchActive = touchActive; } void suppressWakeUpGesture(boolean suppress) { mSuppressingWakeUpGesture = suppress; } @Override public boolean dispatchTouchEvent(MotionEvent ev) { boolean isDown = ev.getActionMasked() == MotionEvent.ACTION_DOWN; Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java +19 −0 Original line number Diff line number Diff line Loading @@ -680,6 +680,25 @@ public class StatusBarTest extends SysuiTestCase { } } @Test public void testPulseWhileDozingWithDockingReason_suppressWakeUpGesture() { // Keep track of callback to be able to stop the pulse final DozeHost.PulseCallback[] pulseCallback = new DozeHost.PulseCallback[1]; doAnswer(invocation -> { pulseCallback[0] = invocation.getArgument(0); return null; }).when(mDozeScrimController).pulse(any(), anyInt()); // Starting a pulse while docking should suppress wakeup gesture mStatusBar.mDozeServiceHost.pulseWhileDozing(mock(DozeHost.PulseCallback.class), DozeLog.PULSE_REASON_DOCKING); verify(mStatusBarWindowView).suppressWakeUpGesture(eq(true)); // Ending a pulse should restore wakeup gesture pulseCallback[0].onPulseFinished(); verify(mStatusBarWindowView).suppressWakeUpGesture(eq(false)); } @Test public void testSetState_changesIsFullScreenUserSwitcherState() { mStatusBar.setBarStateForTest(StatusBarState.KEYGUARD); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +7 −0 Original line number Diff line number Diff line Loading @@ -3926,6 +3926,10 @@ public class StatusBar extends SystemUI implements DemoMode, mScrimController.setWakeLockScreenSensorActive(true); } if (reason == DozeLog.PULSE_REASON_DOCKING && mStatusBarWindow != null) { mStatusBarWindow.suppressWakeUpGesture(true); } boolean passiveAuthInterrupt = reason == DozeLog.PULSE_REASON_NOTIFICATION; // Set the state to pulsing, so ScrimController will know what to do once we ask it to // execute the transition. The pulse callback will then be invoked when the scrims Loading @@ -3945,6 +3949,9 @@ public class StatusBar extends SystemUI implements DemoMode, callback.onPulseFinished(); updateNotificationPanelTouchState(); mScrimController.setWakeLockScreenSensorActive(false); if (mStatusBarWindow != null) { mStatusBarWindow.suppressWakeUpGesture(false); } setPulsing(false); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java +6 −1 Original line number Diff line number Diff line Loading @@ -107,12 +107,13 @@ public class StatusBarWindowView extends FrameLayout { private boolean mTouchActive; private boolean mExpandAnimationRunning; private boolean mExpandAnimationPending; private boolean mSuppressingWakeUpGesture; private final GestureDetector.SimpleOnGestureListener mGestureListener = new GestureDetector.SimpleOnGestureListener() { @Override public boolean onSingleTapConfirmed(MotionEvent e) { if (mSingleTapEnabled) { if (mSingleTapEnabled && !mSuppressingWakeUpGesture) { mService.wakeUpIfDozing(SystemClock.uptimeMillis(), StatusBarWindowView.this, "SINGLE_TAP"); return true; Loading Loading @@ -327,6 +328,10 @@ public class StatusBarWindowView extends FrameLayout { mTouchActive = touchActive; } void suppressWakeUpGesture(boolean suppress) { mSuppressingWakeUpGesture = suppress; } @Override public boolean dispatchTouchEvent(MotionEvent ev) { boolean isDown = ev.getActionMasked() == MotionEvent.ACTION_DOWN; Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java +19 −0 Original line number Diff line number Diff line Loading @@ -680,6 +680,25 @@ public class StatusBarTest extends SysuiTestCase { } } @Test public void testPulseWhileDozingWithDockingReason_suppressWakeUpGesture() { // Keep track of callback to be able to stop the pulse final DozeHost.PulseCallback[] pulseCallback = new DozeHost.PulseCallback[1]; doAnswer(invocation -> { pulseCallback[0] = invocation.getArgument(0); return null; }).when(mDozeScrimController).pulse(any(), anyInt()); // Starting a pulse while docking should suppress wakeup gesture mStatusBar.mDozeServiceHost.pulseWhileDozing(mock(DozeHost.PulseCallback.class), DozeLog.PULSE_REASON_DOCKING); verify(mStatusBarWindowView).suppressWakeUpGesture(eq(true)); // Ending a pulse should restore wakeup gesture pulseCallback[0].onPulseFinished(); verify(mStatusBarWindowView).suppressWakeUpGesture(eq(false)); } @Test public void testSetState_changesIsFullScreenUserSwitcherState() { mStatusBar.setBarStateForTest(StatusBarState.KEYGUARD); Loading