Merge "Swipe up to unlock when pulsing"
This commit is contained in:
committed by
Android (Google) Code Review
commit
dcc45dcbbc
@@ -1843,6 +1843,13 @@ public class KeyguardViewMediator extends SystemUI {
|
||||
*/
|
||||
private void handleHide() {
|
||||
Trace.beginSection("KeyguardViewMediator#handleHide");
|
||||
|
||||
// It's possible that the device was unlocked in a dream state. It's time to wake up.
|
||||
if (mAodShowing) {
|
||||
PowerManager pm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
|
||||
pm.wakeUp(SystemClock.uptimeMillis(), "com.android.systemui:BOUNCER_DOZING");
|
||||
}
|
||||
|
||||
synchronized (KeyguardViewMediator.this) {
|
||||
if (DEBUG) Log.d(TAG, "handleHide");
|
||||
|
||||
|
||||
@@ -956,7 +956,7 @@ public class NotificationPanelView extends PanelView implements
|
||||
handled = true;
|
||||
}
|
||||
handled |= super.onTouchEvent(event);
|
||||
return mDozing ? handled : true;
|
||||
return !mDozing || mPulsing || handled;
|
||||
}
|
||||
|
||||
private boolean handleQsTouch(MotionEvent event) {
|
||||
|
||||
@@ -364,7 +364,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
|
||||
mExpansionFraction = fraction;
|
||||
|
||||
final boolean keyguardOrUnlocked = mState == ScrimState.UNLOCKED
|
||||
|| mState == ScrimState.KEYGUARD;
|
||||
|| mState == ScrimState.KEYGUARD || mState == ScrimState.PULSING;
|
||||
if (!keyguardOrUnlocked || !mExpansionAffectsAlpha) {
|
||||
return;
|
||||
}
|
||||
@@ -409,7 +409,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
|
||||
behindFraction = (float) Math.pow(behindFraction, 0.8f);
|
||||
mCurrentBehindAlpha = behindFraction * GRADIENT_SCRIM_ALPHA_BUSY;
|
||||
mCurrentInFrontAlpha = 0;
|
||||
} else if (mState == ScrimState.KEYGUARD) {
|
||||
} else if (mState == ScrimState.KEYGUARD || mState == ScrimState.PULSING) {
|
||||
// Either darken of make the scrim transparent when you
|
||||
// pull down the shade
|
||||
float interpolatedFract = getInterpolatedFraction();
|
||||
@@ -562,8 +562,8 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
|
||||
if (alpha == 0f) {
|
||||
scrim.setClickable(false);
|
||||
} else {
|
||||
// Eat touch events (unless dozing or pulsing).
|
||||
scrim.setClickable(mState != ScrimState.AOD && mState != ScrimState.PULSING);
|
||||
// Eat touch events (unless dozing).
|
||||
scrim.setClickable(mState != ScrimState.AOD);
|
||||
}
|
||||
updateScrim(scrim, alpha);
|
||||
}
|
||||
|
||||
@@ -3573,10 +3573,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
mVisualStabilityManager.setScreenOn(false);
|
||||
updateVisibleToUser();
|
||||
|
||||
// We need to disable touch events because these might
|
||||
// collapse the panel after we expanded it, and thus we would end up with a blank
|
||||
// Keyguard.
|
||||
mNotificationPanel.setTouchAndAnimationDisabled(true);
|
||||
updateNotificationPanelTouchState();
|
||||
mStatusBarWindow.cancelCurrentTouch();
|
||||
if (mLaunchCameraOnFinishedGoingToSleep) {
|
||||
mLaunchCameraOnFinishedGoingToSleep = false;
|
||||
@@ -3599,13 +3596,22 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
mDeviceInteractive = true;
|
||||
mAmbientPulseManager.releaseAllImmediately();
|
||||
mVisualStabilityManager.setScreenOn(true);
|
||||
mNotificationPanel.setTouchAndAnimationDisabled(false);
|
||||
updateNotificationPanelTouchState();
|
||||
updateVisibleToUser();
|
||||
updateIsKeyguard();
|
||||
mDozeServiceHost.stopDozing();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* We need to disable touch events because these might
|
||||
* collapse the panel after we expanded it, and thus we would end up with a blank
|
||||
* Keyguard.
|
||||
*/
|
||||
private void updateNotificationPanelTouchState() {
|
||||
mNotificationPanel.setTouchAndAnimationDisabled(!mDeviceInteractive && !mPulsing);
|
||||
}
|
||||
|
||||
final ScreenLifecycle.Observer mScreenObserver = new ScreenLifecycle.Observer() {
|
||||
@Override
|
||||
public void onScreenTurningOn() {
|
||||
@@ -3871,17 +3877,15 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
@Override
|
||||
public void onPulseStarted() {
|
||||
callback.onPulseStarted();
|
||||
if (mAmbientPulseManager.hasNotifications()) {
|
||||
// Only pulse the stack scroller if there's actually something to show.
|
||||
// Otherwise just show the always-on screen.
|
||||
setPulsing(true);
|
||||
}
|
||||
updateNotificationPanelTouchState();
|
||||
setPulsing(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPulseFinished() {
|
||||
mPulsing = false;
|
||||
callback.onPulseFinished();
|
||||
updateNotificationPanelTouchState();
|
||||
setPulsing(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
mBouncer.setExpansion(KeyguardBouncer.EXPANSION_HIDDEN);
|
||||
} else if (bouncerNeedsScrimming()) {
|
||||
mBouncer.setExpansion(KeyguardBouncer.EXPANSION_VISIBLE);
|
||||
} else if (mShowing && !mDozing) {
|
||||
} else if (mShowing) {
|
||||
if (!isWakeAndUnlocking() && !mStatusBar.isInLaunchTransition()) {
|
||||
mBouncer.setExpansion(expansion);
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ public class StatusBarWindowView extends FrameLayout {
|
||||
@Override
|
||||
public boolean onInterceptTouchEvent(MotionEvent ev) {
|
||||
NotificationStackScrollLayout stackScrollLayout = getStackScrollLayout();
|
||||
if (mService.isDozing() && !stackScrollLayout.hasPulsingNotifications()) {
|
||||
if (mService.isDozing() && !mService.isPulsing()) {
|
||||
// Capture all touch events in always-on.
|
||||
return true;
|
||||
}
|
||||
@@ -347,8 +347,7 @@ public class StatusBarWindowView extends FrameLayout {
|
||||
if (mNotificationPanel.isFullyExpanded()
|
||||
&& stackScrollLayout.getVisibility() == View.VISIBLE
|
||||
&& mStatusBarStateController.getState() == StatusBarState.KEYGUARD
|
||||
&& !mService.isBouncerShowing()
|
||||
&& !mService.isDozing()) {
|
||||
&& !mService.isBouncerShowing()) {
|
||||
intercept = mDragDownHelper.onInterceptTouchEvent(ev);
|
||||
}
|
||||
if (!intercept) {
|
||||
@@ -369,7 +368,7 @@ public class StatusBarWindowView extends FrameLayout {
|
||||
boolean handled = false;
|
||||
if (mService.isDozing()) {
|
||||
mDoubleTapHelper.onTouchEvent(ev);
|
||||
handled = true;
|
||||
handled = !mService.isPulsing();
|
||||
}
|
||||
if ((mStatusBarStateController.getState() == StatusBarState.KEYGUARD && !handled)
|
||||
|| mDragDownHelper.isDraggingDown()) {
|
||||
|
||||
@@ -54,7 +54,7 @@ import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@@ -578,7 +578,7 @@ public class ScrimControllerTest extends SysuiTestCase {
|
||||
@Test
|
||||
public void testEatsTouchEvent() {
|
||||
HashSet<ScrimState> eatsTouches =
|
||||
new HashSet<>(Arrays.asList(ScrimState.AOD, ScrimState.PULSING));
|
||||
new HashSet<>(Collections.singletonList(ScrimState.AOD));
|
||||
for (ScrimState state : ScrimState.values()) {
|
||||
if (state == ScrimState.UNINITIALIZED) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user