Fix shade collapse on keyguard with bypass enabled

Only with face unlock + bypass enabled, when dragging down the shade
over keyguard, the end motion event was forcing the shade to collapse
again, due to an incorrect check on the keyguard state. Use the
KeyguardStateController.isShowing() method instead, which is a more
accurate check on keyguard state.

Fixes: 242813247
Test: All combinations of face unlock enabled/disabled, notifications
visible on lockscreen on/off, notification redacted on/off, face
bypass on/off

Change-Id: I99c6ced66f3269dbf4e6df1d078d7c793492c157
This commit is contained in:
Matt Pietal
2022-08-19 14:13:12 +00:00
parent 898f1624c5
commit e11a139fac

View File

@@ -395,7 +395,7 @@ public abstract class PanelViewController {
mInitialOffsetOnTouch = expandedHeight; mInitialOffsetOnTouch = expandedHeight;
mInitialTouchY = newY; mInitialTouchY = newY;
mInitialTouchX = newX; mInitialTouchX = newX;
mInitialTouchFromKeyguard = mStatusBarStateController.getState() == StatusBarState.KEYGUARD; mInitialTouchFromKeyguard = mKeyguardStateController.isShowing();
if (startTracking) { if (startTracking) {
mTouchSlopExceeded = true; mTouchSlopExceeded = true;
setExpandedHeight(mInitialOffsetOnTouch); setExpandedHeight(mInitialOffsetOnTouch);
@@ -414,9 +414,7 @@ public abstract class PanelViewController {
float vectorVel = (float) Math.hypot( float vectorVel = (float) Math.hypot(
mVelocityTracker.getXVelocity(), mVelocityTracker.getYVelocity()); mVelocityTracker.getXVelocity(), mVelocityTracker.getYVelocity());
final boolean onKeyguard = final boolean onKeyguard = mKeyguardStateController.isShowing();
mStatusBarStateController.getState() == StatusBarState.KEYGUARD;
final boolean expand; final boolean expand;
if (mKeyguardStateController.isKeyguardFadingAway() if (mKeyguardStateController.isKeyguardFadingAway()
|| (mInitialTouchFromKeyguard && !onKeyguard)) { || (mInitialTouchFromKeyguard && !onKeyguard)) {