Merge "Prevent flings after motion gestures on fully expanded keyguard" into tm-qpr-dev am: 6c78bab2e3

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21895667

Change-Id: I573e2f9497d9073448c49ea0e45f82b83ef57467
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Shawn Lee
2023-03-14 06:52:17 +00:00
committed by Automerger Merge Worker

View File

@@ -3508,12 +3508,15 @@ public final class NotificationPanelViewController implements Dumpable {
}
private void endMotionEvent(MotionEvent event, float x, float y, boolean forceCancel) {
// don't fling while in keyguard to avoid jump in shade expand animation
boolean fullyExpandedInKeyguard = mBarState == KEYGUARD && mExpandedFraction >= 1.0;
mTrackingPointer = -1;
mAmbientState.setSwipingUp(false);
if ((mTracking && mTouchSlopExceeded) || Math.abs(x - mInitialExpandX) > mTouchSlop
if (!fullyExpandedInKeyguard && ((mTracking && mTouchSlopExceeded)
|| Math.abs(x - mInitialExpandX) > mTouchSlop
|| Math.abs(y - mInitialExpandY) > mTouchSlop
|| (!isFullyExpanded() && !isFullyCollapsed())
|| event.getActionMasked() == MotionEvent.ACTION_CANCEL || forceCancel) {
|| event.getActionMasked() == MotionEvent.ACTION_CANCEL || forceCancel)) {
mVelocityTracker.computeCurrentVelocity(1000);
float vel = mVelocityTracker.getYVelocity();
float vectorVel = (float) Math.hypot(
@@ -3561,9 +3564,9 @@ public final class NotificationPanelViewController implements Dumpable {
if (mUpdateFlingOnLayout) {
mUpdateFlingVelocity = vel;
}
} else if (!mCentralSurfaces.isBouncerShowing()
} else if (fullyExpandedInKeyguard || (!mCentralSurfaces.isBouncerShowing()
&& !mAlternateBouncerInteractor.isVisibleState()
&& !mKeyguardStateController.isKeyguardGoingAway()) {
&& !mKeyguardStateController.isKeyguardGoingAway())) {
onEmptySpaceClick();
onTrackingStopped(true);
}