summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2017-10-26 02:35:06 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-10-26 02:35:06 +0000
commit4ad6c372c65316a279052dd43b130d742b132e8e (patch)
tree7743aaf73625c56420025d39c73dd74a3599fa5c
parente439d72170c14e0b92cc906307010606f3d71521 (diff)
parentc62635ec07394f26eabfbfd1440ebb2b300e3ef7 (diff)
Merge "Fixed an issue where the falsing classifier wasn't used"
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java24
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/DoubleTapHelper.java2
2 files changed, 16 insertions, 10 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java b/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java
index 68fe9a83c707..84b7015f474e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java
@@ -29,7 +29,6 @@ import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewAnimationUtils;
-import android.view.ViewConfiguration;
import android.view.accessibility.AccessibilityManager;
import android.view.animation.Interpolator;
import android.view.animation.PathInterpolator;
@@ -173,12 +172,12 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
private int mOverrideTint;
private float mOverrideAmount;
private boolean mShadowHidden;
- private boolean mWasActivatedOnDown;
/**
* Similar to mDimmed but is also true if it's not dimmable but should be
*/
private boolean mNeedsDimming;
private int mDimmedAlpha;
+ private boolean mBlockNextTouch;
public ActivatableNotificationView(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -204,7 +203,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
} else {
makeInactive(true /* animate */);
}
- }, this::performClick, this::handleSlideBack, mFalsingManager::onNotificationDoubleTap);
+ }, super::performClick, this::handleSlideBack, mFalsingManager::onNotificationDoubleTap);
}
@Override
@@ -241,9 +240,15 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
- if (mNeedsDimming && !mActivated && ev.getActionMasked() == MotionEvent.ACTION_DOWN
+ if (mNeedsDimming && ev.getActionMasked() == MotionEvent.ACTION_DOWN
&& disallowSingleClick(ev) && !isTouchExplorationEnabled()) {
- return true;
+ if (!mActivated) {
+ return true;
+ } else if (!mDoubleTapHelper.isWithinDoubleTapSlop(ev)) {
+ mBlockNextTouch = true;
+ makeInactive(true /* animate */);
+ return true;
+ }
}
return super.onInterceptTouchEvent(ev);
}
@@ -263,10 +268,11 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
@Override
public boolean onTouchEvent(MotionEvent event) {
boolean result;
- if (event.getAction() == MotionEvent.ACTION_DOWN) {
- mWasActivatedOnDown = mActivated;
+ if (mBlockNextTouch) {
+ mBlockNextTouch = false;
+ return false;
}
- if ((mNeedsDimming && !mActivated) && !isTouchExplorationEnabled() && isInteractive()) {
+ if (mNeedsDimming && !isTouchExplorationEnabled() && isInteractive()) {
boolean wasActivated = mActivated;
result = handleTouchEventDimmed(event);
if (wasActivated && result && event.getAction() == MotionEvent.ACTION_UP) {
@@ -312,7 +318,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
@Override
public boolean performClick() {
- if (mWasActivatedOnDown || !mNeedsDimming || isTouchExplorationEnabled()) {
+ if (!mNeedsDimming || isTouchExplorationEnabled()) {
return super.performClick();
}
return false;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DoubleTapHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DoubleTapHelper.java
index dcb6a3801844..0d62703cbced 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DoubleTapHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DoubleTapHelper.java
@@ -142,7 +142,7 @@ public class DoubleTapHelper {
&& Math.abs(event.getY() - mDownY) < mTouchSlop;
}
- private boolean isWithinDoubleTapSlop(MotionEvent event) {
+ public boolean isWithinDoubleTapSlop(MotionEvent event) {
if (!mActivated) {
// If we're not activated there's no double tap slop to satisfy.
return true;