diff options
author | Jim Miller <jaggies@google.com> | 2015-04-20 19:04:21 -0700 |
---|---|---|
committer | Jim Miller <jaggies@google.com> | 2015-04-20 19:04:21 -0700 |
commit | af281ca0d3fad6aaafde0d1979123368390779dc (patch) | |
tree | 1ba94bdaf8564dff62cb332d2b020bef7d352bdd /services | |
parent | 9d4efdf2802f06ccf7031610891f75af70ea5538 (diff) | |
download | frameworks_base-af281ca0d3fad6aaafde0d1979123368390779dc.zip frameworks_base-af281ca0d3fad6aaafde0d1979123368390779dc.tar.gz frameworks_base-af281ca0d3fad6aaafde0d1979123368390779dc.tar.bz2 |
Make fingerprint enroll/authenticate haptic feedback part of framework.
Change-Id: Icc2e9ec4b30a6f3a21e3bbe8476efc56361d6944
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/fingerprint/FingerprintService.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/services/core/java/com/android/server/fingerprint/FingerprintService.java b/services/core/java/com/android/server/fingerprint/FingerprintService.java index 770df82..ac488e3 100644 --- a/services/core/java/com/android/server/fingerprint/FingerprintService.java +++ b/services/core/java/com/android/server/fingerprint/FingerprintService.java @@ -67,6 +67,9 @@ public class FingerprintService extends SystemService { private static final int FINGERPRINT_TEMPLATE_ENROLLING = 3; private static final int FINGERPRINT_TEMPLATE_REMOVED = 4; private static final int FINGERPRINT_AUTHENTICATED = 5; + private static final long MS_PER_SEC = 1000; + private static final long FAIL_LOCKOUT_TIMEOUT_MS = 30*1000; + private static final int MAX_FAILED_ATTEMPTS = 5; Handler mHandler = new Handler() { public void handleMessage(android.os.Message msg) { @@ -91,14 +94,6 @@ public class FingerprintService extends SystemService { } }; - private static final int STATE_IDLE = 0; - private static final int STATE_AUTHENTICATING = 1; - private static final int STATE_ENROLLING = 2; - private static final int STATE_REMOVING = 3; - private static final long MS_PER_SEC = 1000; - private static final long FAIL_LOCKOUT_TIMEOUT_MS = 30*1000; - private static final int MAX_FAILED_ATTEMPTS = 5; - public FingerprintService(Context context) { super(context); mContext = context; @@ -427,6 +422,7 @@ public class FingerprintService extends SystemService { private boolean sendEnrollResult(int fpId, int groupId, int remaining) { IFingerprintServiceReceiver rx = receiver.get(); if (rx == null) return true; // client not listening + FingerprintUtils.vibrateFingerprintSuccess(getContext()); try { rx.onEnrollResult(mHalDeviceId, fpId, groupId, remaining); return remaining == 0; @@ -453,8 +449,10 @@ public class FingerprintService extends SystemService { result = true; // client not listening } if (fpId <= 0) { + FingerprintUtils.vibrateFingerprintError(getContext()); result |= handleFailedAttempt(this); } else { + FingerprintUtils.vibrateFingerprintSuccess(getContext()); result |= true; // we have a valid fingerprint mLockoutReset.run(); } |