From 3035c81ef8aebae98d97698b0a6115739557625f Mon Sep 17 00:00:00 2001 From: Aitor Viana Date: Fri, 16 Sep 2016 11:14:44 +0200 Subject: [PATCH] fix parameter type in recreateKey() method --- .../java/com/aitorvs/android/fingerlock/FingerLock.java | 7 ++++--- .../com/aitorvs/android/fingerlock/FingerLockManager.java | 7 ++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/aitorvs/android/fingerlock/FingerLock.java b/core/src/main/java/com/aitorvs/android/fingerlock/FingerLock.java index 82fe1a0..ceae904 100644 --- a/core/src/main/java/com/aitorvs/android/fingerlock/FingerLock.java +++ b/core/src/main/java/com/aitorvs/android/fingerlock/FingerLock.java @@ -159,9 +159,10 @@ public void stop() { } @Override - public void recreateKey(final Object listener) { - if (listener instanceof FingerLockResultCallback) { - impl.recreateKey((FingerLockResultCallback) listener); + public void recreateKey(@NonNull final FingerLockResultCallback listener) { + //noinspection ConstantConditions + if (listener != null) { + impl.recreateKey(listener); } } diff --git a/core/src/main/java/com/aitorvs/android/fingerlock/FingerLockManager.java b/core/src/main/java/com/aitorvs/android/fingerlock/FingerLockManager.java index 1d19067..a0d0ff8 100644 --- a/core/src/main/java/com/aitorvs/android/fingerlock/FingerLockManager.java +++ b/core/src/main/java/com/aitorvs/android/fingerlock/FingerLockManager.java @@ -48,5 +48,10 @@ public interface FingerLockManager { */ void stop(); - void recreateKey(final Object listener); + /** + * Call this method to re-create the keys so that new (added) fingerprints are validated. + * + * @param listener instance that implements {@linkplain FingerLockResultCallback} interface + */ + void recreateKey(final FingerLockResultCallback listener); }