From f02ad39694b6d71c0d957e1fc105aa4a289c7889 Mon Sep 17 00:00:00 2001 From: Beverly Date: Mon, 6 Dec 2021 11:26:16 -0500 Subject: [PATCH] Unlock icon plays success haptic on device entry Updates long-press delay (min dwell time) to 200ms. Test: manual Fixes: 209062917 Change-Id: I9d01e4afe8dd7df8d8d18a9b253c1077b7ce027e Merged-In: I9d01e4afe8dd7df8d8d18a9b253c1077b7ce027e --- .../android/keyguard/LockIconViewController.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java index 60cc57df20e1a..e267c5c7919c8 100644 --- a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java @@ -93,7 +93,7 @@ public class LockIconViewController extends ViewController impleme .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) .setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION) .build(); - private static final long LONG_PRESS_TIMEOUT = 150L; // milliseconds + private static final long LONG_PRESS_TIMEOUT = 200L; // milliseconds @NonNull private final KeyguardUpdateMonitor mKeyguardUpdateMonitor; @NonNull private final KeyguardViewController mKeyguardViewController; @@ -686,6 +686,17 @@ public class LockIconViewController extends ViewController impleme if (mOnGestureDetectedRunnable != null) { mOnGestureDetectedRunnable.run(); } + + if (mVibrator != null) { + // play device entry haptic (same as biometric success haptic) + mVibrator.vibrate( + Process.myUid(), + getContext().getOpPackageName(), + UdfpsController.EFFECT_CLICK, + "lock-icon-device-entry", + VIBRATION_SONIFICATION_ATTRIBUTES); + } + mKeyguardViewController.showBouncer(/* scrim */ true); }