Merge "Don't do anti-falsing on locked shade" into nyc-dev

This commit is contained in:
TreeHugger Robot
2016-04-20 03:00:28 +00:00
committed by Android (Google) Code Review
2 changed files with 13 additions and 7 deletions

View File

@@ -43,9 +43,9 @@ public class KeyguardAffordanceHelper {
private static final int HINT_CIRCLE_OPEN_DURATION = 500; private static final int HINT_CIRCLE_OPEN_DURATION = 500;
private final Context mContext; private final Context mContext;
private final Callback mCallback;
private FlingAnimationUtils mFlingAnimationUtils; private FlingAnimationUtils mFlingAnimationUtils;
private Callback mCallback;
private VelocityTracker mVelocityTracker; private VelocityTracker mVelocityTracker;
private boolean mSwipingInProgress; private boolean mSwipingInProgress;
private float mInitialTouchX; private float mInitialTouchX;
@@ -318,12 +318,11 @@ public class KeyguardAffordanceHelper {
float vel = getCurrentVelocity(lastX, lastY); float vel = getCurrentVelocity(lastX, lastY);
// We snap back if the current translation is not far enough // We snap back if the current translation is not far enough
boolean snapBack; boolean snapBack = false;
if (mFalsingManager.isFalseTouch()) { if (mCallback.needsAntiFalsing()) {
snapBack = mFalsingManager.isFalseTouch(); snapBack = snapBack || mFalsingManager.isFalseTouch();
} else {
snapBack = isBelowFalsingThreshold();
} }
snapBack = snapBack || isBelowFalsingThreshold();
// or if the velocity is in the opposite direction. // or if the velocity is in the opposite direction.
boolean velIsInWrongDirection = vel * mTranslation < 0; boolean velIsInWrongDirection = vel * mTranslation < 0;
@@ -582,5 +581,7 @@ public class KeyguardAffordanceHelper {
* @return The factor the minimum swipe amount should be multiplied with. * @return The factor the minimum swipe amount should be multiplied with.
*/ */
float getAffordanceFalsingFactor(); float getAffordanceFalsingFactor();
boolean needsAntiFalsing();
} }
} }

View File

@@ -701,7 +701,7 @@ public class NotificationPanelView extends PanelView implements
} }
private boolean isFalseTouch() { private boolean isFalseTouch() {
if (mStatusBarState != StatusBarState.KEYGUARD) { if (!needsAntiFalsing()) {
return false; return false;
} }
if (mFalsingManager.isClassiferEnabled()) { if (mFalsingManager.isClassiferEnabled()) {
@@ -1940,6 +1940,11 @@ public class NotificationPanelView extends PanelView implements
return mStatusBar.isWakeUpComingFromTouch() ? 1.5f : 1.0f; return mStatusBar.isWakeUpComingFromTouch() ? 1.5f : 1.0f;
} }
@Override
public boolean needsAntiFalsing() {
return mStatusBarState == StatusBarState.KEYGUARD;
}
@Override @Override
protected float getPeekHeight() { protected float getPeekHeight() {
if (mNotificationStackScroller.getNotGoneChildCount() > 0) { if (mNotificationStackScroller.getNotGoneChildCount() > 0) {