From 21a0d1eee17d708eae926df8b719eda7f847c1ac Mon Sep 17 00:00:00 2001 From: Ilya Matyukhin Date: Thu, 26 Apr 2018 15:57:29 -0700 Subject: [PATCH] Updated haptic effect for success Fixes: 78596832 Test: tested on a device Change-Id: I5953bdb367867b001bc85a2bf799c77b65b3b9d4 --- .../server/fingerprint/ClientMonitor.java | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/services/core/java/com/android/server/fingerprint/ClientMonitor.java b/services/core/java/com/android/server/fingerprint/ClientMonitor.java index 4100a9a5f71c2..b935ba2a2ea44 100644 --- a/services/core/java/com/android/server/fingerprint/ClientMonitor.java +++ b/services/core/java/com/android/server/fingerprint/ClientMonitor.java @@ -80,7 +80,7 @@ public abstract class ClientMonitor implements IBinder.DeathRecipient { mGroupId = groupId; mIsRestricted = restricted; mOwner = owner; - mSuccessVibrationEffect = getSuccessVibrationEffect(context); + mSuccessVibrationEffect = VibrationEffect.get(VibrationEffect.EFFECT_CLICK); mErrorVibrationEffect = VibrationEffect.get(VibrationEffect.EFFECT_DOUBLE_CLICK); try { if (token != null) { @@ -239,25 +239,4 @@ public abstract class ClientMonitor implements IBinder.DeathRecipient { vibrator.vibrate(mErrorVibrationEffect, FINGERPRINT_SONFICATION_ATTRIBUTES); } } - - private static VibrationEffect getSuccessVibrationEffect(Context ctx) { - int[] arr = ctx.getResources().getIntArray( - com.android.internal.R.array.config_longPressVibePattern); - final long[] vibePattern; - if (arr == null || arr.length == 0) { - vibePattern = DEFAULT_SUCCESS_VIBRATION_PATTERN; - } else { - vibePattern = new long[arr.length]; - for (int i = 0; i < arr.length; i++) { - vibePattern[i] = arr[i]; - } - } - if (vibePattern.length == 1) { - return VibrationEffect.createOneShot( - vibePattern[0], VibrationEffect.DEFAULT_AMPLITUDE); - } else { - return VibrationEffect.createWaveform(vibePattern, -1); - } - } - }