Merge "Suppress singletap wakeup gesture while pulsing on dock" into qt-dev
am: 85a99c394b
Change-Id: Ib42fddd5a7b4fe5213a368f135f6648c8eb6dcca
This commit is contained in:
@@ -3926,6 +3926,10 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
mScrimController.setWakeLockScreenSensorActive(true);
|
mScrimController.setWakeLockScreenSensorActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (reason == DozeLog.PULSE_REASON_DOCKING && mStatusBarWindow != null) {
|
||||||
|
mStatusBarWindow.suppressWakeUpGesture(true);
|
||||||
|
}
|
||||||
|
|
||||||
boolean passiveAuthInterrupt = reason == DozeLog.PULSE_REASON_NOTIFICATION;
|
boolean passiveAuthInterrupt = reason == DozeLog.PULSE_REASON_NOTIFICATION;
|
||||||
// Set the state to pulsing, so ScrimController will know what to do once we ask it to
|
// 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
|
// execute the transition. The pulse callback will then be invoked when the scrims
|
||||||
@@ -3945,6 +3949,9 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
callback.onPulseFinished();
|
callback.onPulseFinished();
|
||||||
updateNotificationPanelTouchState();
|
updateNotificationPanelTouchState();
|
||||||
mScrimController.setWakeLockScreenSensorActive(false);
|
mScrimController.setWakeLockScreenSensorActive(false);
|
||||||
|
if (mStatusBarWindow != null) {
|
||||||
|
mStatusBarWindow.suppressWakeUpGesture(false);
|
||||||
|
}
|
||||||
setPulsing(false);
|
setPulsing(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -107,12 +107,13 @@ public class StatusBarWindowView extends FrameLayout {
|
|||||||
private boolean mTouchActive;
|
private boolean mTouchActive;
|
||||||
private boolean mExpandAnimationRunning;
|
private boolean mExpandAnimationRunning;
|
||||||
private boolean mExpandAnimationPending;
|
private boolean mExpandAnimationPending;
|
||||||
|
private boolean mSuppressingWakeUpGesture;
|
||||||
|
|
||||||
private final GestureDetector.SimpleOnGestureListener mGestureListener =
|
private final GestureDetector.SimpleOnGestureListener mGestureListener =
|
||||||
new GestureDetector.SimpleOnGestureListener() {
|
new GestureDetector.SimpleOnGestureListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onSingleTapConfirmed(MotionEvent e) {
|
public boolean onSingleTapConfirmed(MotionEvent e) {
|
||||||
if (mSingleTapEnabled) {
|
if (mSingleTapEnabled && !mSuppressingWakeUpGesture) {
|
||||||
mService.wakeUpIfDozing(SystemClock.uptimeMillis(), StatusBarWindowView.this,
|
mService.wakeUpIfDozing(SystemClock.uptimeMillis(), StatusBarWindowView.this,
|
||||||
"SINGLE_TAP");
|
"SINGLE_TAP");
|
||||||
return true;
|
return true;
|
||||||
@@ -327,6 +328,10 @@ public class StatusBarWindowView extends FrameLayout {
|
|||||||
mTouchActive = touchActive;
|
mTouchActive = touchActive;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void suppressWakeUpGesture(boolean suppress) {
|
||||||
|
mSuppressingWakeUpGesture = suppress;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean dispatchTouchEvent(MotionEvent ev) {
|
public boolean dispatchTouchEvent(MotionEvent ev) {
|
||||||
boolean isDown = ev.getActionMasked() == MotionEvent.ACTION_DOWN;
|
boolean isDown = ev.getActionMasked() == MotionEvent.ACTION_DOWN;
|
||||||
|
|||||||
@@ -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
|
@Test
|
||||||
public void testSetState_changesIsFullScreenUserSwitcherState() {
|
public void testSetState_changesIsFullScreenUserSwitcherState() {
|
||||||
mStatusBar.setBarStateForTest(StatusBarState.KEYGUARD);
|
mStatusBar.setBarStateForTest(StatusBarState.KEYGUARD);
|
||||||
|
|||||||
Reference in New Issue
Block a user