Wake up to lock screen when bouncer is visible

Fixes: 128563724
Fixes: 128036182
Fixes: 123711017
Bug: 123874544
Test: swipe up from aod2, swipe down
Test: swipe up from aod2, let device sleep again
Test: go/sysui-bouncer-tests (a subset of them)
Change-Id: Ia399b9a944b48e5f4e3dfe7ec8359450cd2e0a30
This commit is contained in:
Lucas Dupin
2019-03-19 15:22:03 -07:00
parent 59d474b3c2
commit 3cfd6889cf
5 changed files with 20 additions and 14 deletions

View File

@@ -2031,7 +2031,6 @@ public class KeyguardViewMediator extends SystemUI {
private void handleNotifyScreenTurnedOff() {
synchronized (this) {
if (DEBUG) Log.d(TAG, "handleNotifyScreenTurnedOff");
mStatusBarKeyguardViewManager.onScreenTurnedOff();
mDrawnCallback = null;
}
}

View File

@@ -303,7 +303,6 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback {
case MODE_SHOW_BOUNCER:
Trace.beginSection("MODE_UNLOCK or MODE_SHOW_BOUNCER");
if (!wasDeviceInteractive) {
mStatusBarKeyguardViewManager.notifyDeviceWakeUpRequested();
mPendingShowBouncer = true;
} else {
showBouncer();

View File

@@ -1097,7 +1097,6 @@ public class StatusBar extends SystemUI implements DemoMode,
where.getLocationInWindow(mTmpInt2);
mWakeUpTouchLocation = new PointF(mTmpInt2[0] + where.getWidth() / 2,
mTmpInt2[1] + where.getHeight() / 2);
mStatusBarKeyguardViewManager.notifyDeviceWakeUpRequested();
mFalsingManager.onScreenOnFromTouch();
}
}
@@ -2993,7 +2992,7 @@ public class StatusBar extends SystemUI implements DemoMode,
private void updatePanelExpansionForKeyguard() {
if (mState == StatusBarState.KEYGUARD && mBiometricUnlockController.getMode()
!= BiometricUnlockController.MODE_WAKE_AND_UNLOCK) {
!= BiometricUnlockController.MODE_WAKE_AND_UNLOCK && !mBouncerShowing) {
instantExpandNotificationsPanel();
} else if (mState == StatusBarState.FULLSCREEN_USER_SWITCHER) {
instantCollapseNotificationPanel();
@@ -3551,6 +3550,9 @@ public class StatusBar extends SystemUI implements DemoMode,
}
}
/**
* Propagation of the bouncer state, indicating that it's fully visible.
*/
public void setBouncerShowing(boolean bouncerShowing) {
mBouncerShowing = bouncerShowing;
if (mStatusBarView != null) mStatusBarView.setBouncerShowing(bouncerShowing);
@@ -3724,7 +3726,6 @@ public class StatusBar extends SystemUI implements DemoMode,
PowerManager pm = mContext.getSystemService(PowerManager.class);
pm.wakeUp(SystemClock.uptimeMillis(), PowerManager.WAKE_REASON_CAMERA_LAUNCH,
"com.android.systemui:CAMERA_GESTURE");
mStatusBarKeyguardViewManager.notifyDeviceWakeUpRequested();
}
vibrateForCameraGesture();
if (!mStatusBarKeyguardViewManager.isShowing()) {

View File

@@ -85,6 +85,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
@Override
public void onFullyShown() {
updateStates();
mStatusBar.wakeUpIfDozing(SystemClock.uptimeMillis(), mContainer, "BOUNCER_VISIBLE");
}
@Override
@@ -346,14 +347,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
}
}
public void onScreenTurnedOff() {
// TODO: remove
}
public void notifyDeviceWakeUpRequested() {
// TODO: remove
}
public void setNeedsInput(boolean needsInput) {
mStatusBarWindowController.setKeyguardNeedsInput(needsInput);
}

View File

@@ -29,6 +29,7 @@ import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.clearInvocations;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
@@ -722,12 +723,25 @@ public class StatusBarTest extends SysuiTestCase {
public void testOnStartedWakingUp_isNotDozing() {
mStatusBar.setBarStateForTest(StatusBarState.KEYGUARD);
when(mStatusBarStateController.isKeyguardRequested()).thenReturn(true);
mStatusBar.mDozeServiceHost.startDozing();
verify(mStatusBarStateController).setIsDozing(eq(true));
clearInvocations(mNotificationPanelView);
mStatusBar.mWakefulnessObserver.onStartedWakingUp();
verify(mStatusBarStateController).setIsDozing(eq(false));
verify(mNotificationPanelView).expand(eq(false));
}
@Test
public void testOnStartedWakingUp_doesNotDismissBouncer_whenPulsing() {
mStatusBar.setBarStateForTest(StatusBarState.KEYGUARD);
when(mStatusBarStateController.isKeyguardRequested()).thenReturn(true);
mStatusBar.mDozeServiceHost.startDozing();
clearInvocations(mNotificationPanelView);
mStatusBar.setBouncerShowing(true);
mStatusBar.mWakefulnessObserver.onStartedWakingUp();
verify(mNotificationPanelView, never()).expand(anyBoolean());
}
static class TestableStatusBar extends StatusBar {