summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
diff options
context:
space:
mode:
authorBeverly <beverlyt@google.com>2021-08-26 12:19:57 -0400
committerBeverly Tai <beverlyt@google.com>2021-08-26 16:37:28 +0000
commit374f321fca4572401911f1493122600140e918eb (patch)
tree08e0aad2aa9b2d0fbc62ccd76279184add0c0701 /packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
parente454d516ec38bdf56f648bb4d519c36e1487a95c (diff)
Remove ZigZagClassifer from lock-icon longpress falsing algo
If the touch leaves the lock icon area, we already drop the touch. Therefore, we don't also need to also take into consideration the ZigZagClassifier for the lock icon. Also, only play the longpress vibration if we will be bringing up the bouncer. If the FalsingManager think we're falsing, there's no reason to play the longpress vibration. Test: manually longpress lock icon on device with udfps capability (after lockdown or reboot) and observe longpress consistently brings up the bouncer Fixes: 197271526 Change-Id: Ic9fa82a549599e48d281b4db69c04627803c6c5a
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/LockIconViewController.java')
-rw-r--r--packages/SystemUI/src/com/android/keyguard/LockIconViewController.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
index 47f0714af164..2a4022ca57b6 100644
--- a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
@@ -501,8 +501,10 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
if (!wasClickableOnDownEvent()) {
return;
}
+ mDetectedLongPress = true;
- if (mVibrator != null) {
+ if (onAffordanceClick() && mVibrator != null) {
+ // only vibrate if the click went through and wasn't intercepted by falsing
mVibrator.vibrate(
Process.myUid(),
getContext().getOpPackageName(),
@@ -510,8 +512,6 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
"lockIcon-onLongPress",
VIBRATION_SONIFICATION_ATTRIBUTES);
}
- mDetectedLongPress = true;
- onAffordanceClick();
}
public boolean onSingleTapUp(MotionEvent e) {
@@ -535,9 +535,14 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
return mDownDetected;
}
- private void onAffordanceClick() {
+ /**
+ * Whether we tried to launch the affordance.
+ *
+ * If falsing intercepts the click, returns false.
+ */
+ private boolean onAffordanceClick() {
if (mFalsingManager.isFalseTouch(LOCK_ICON)) {
- return;
+ return false;
}
// pre-emptively set to true to hide view
@@ -547,6 +552,7 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
}
updateVisibility();
mKeyguardViewController.showBouncer(/* scrim */ true);
+ return true;
}
});