Loading Android.mk +1 −0 Original line number Original line Diff line number Diff line Loading @@ -160,6 +160,7 @@ LOCAL_SRC_FILES += \ core/java/android/hardware/fingerprint/IFingerprintDaemon.aidl \ core/java/android/hardware/fingerprint/IFingerprintDaemon.aidl \ core/java/android/hardware/fingerprint/IFingerprintDaemonCallback.aidl \ core/java/android/hardware/fingerprint/IFingerprintDaemonCallback.aidl \ core/java/android/hardware/fingerprint/IFingerprintService.aidl \ core/java/android/hardware/fingerprint/IFingerprintService.aidl \ core/java/android/hardware/fingerprint/IFingerprintServiceLockoutResetCallback.aidl \ core/java/android/hardware/fingerprint/IFingerprintServiceReceiver.aidl \ core/java/android/hardware/fingerprint/IFingerprintServiceReceiver.aidl \ core/java/android/hardware/hdmi/IHdmiControlCallback.aidl \ core/java/android/hardware/hdmi/IHdmiControlCallback.aidl \ core/java/android/hardware/hdmi/IHdmiControlService.aidl \ core/java/android/hardware/hdmi/IHdmiControlService.aidl \ Loading core/java/android/hardware/fingerprint/FingerprintManager.java +41 −2 Original line number Original line Diff line number Diff line Loading @@ -391,6 +391,18 @@ public class FingerprintManager { public void onRemovalSucceeded(Fingerprint fingerprint) { } public void onRemovalSucceeded(Fingerprint fingerprint) { } }; }; /** * @hide */ public static abstract class LockoutResetCallback { /** * Called when lockout period expired and clients are allowed to listen for fingerprint * again. */ public void onLockoutReset() { } }; /** /** * Request authentication of a crypto object. This call warms up the fingerprint hardware * Request authentication of a crypto object. This call warms up the fingerprint hardware * and starts scanning for a fingerprint. It terminates when * and starts scanning for a fingerprint. It terminates when Loading Loading @@ -680,10 +692,37 @@ public class FingerprintManager { try { try { mService.resetTimeout(token); mService.resetTimeout(token); } catch (RemoteException e) { } catch (RemoteException e) { Log.v(TAG, "Remote exception in getAuthenticatorId(): ", e); Log.v(TAG, "Remote exception in resetTimeout(): ", e); } } } else { } else { Log.w(TAG, "getAuthenticatorId(): Service not connected!"); Log.w(TAG, "resetTimeout(): Service not connected!"); } } /** * @hide */ public void addLockoutResetCallback(final LockoutResetCallback callback) { if (mService != null) { try { mService.addLockoutResetCallback( new IFingerprintServiceLockoutResetCallback.Stub() { @Override public void onLockoutReset(long deviceId) throws RemoteException { mHandler.post(new Runnable() { @Override public void run() { callback.onLockoutReset(); } }); } }); } catch (RemoteException e) { Log.v(TAG, "Remote exception in addLockoutResetCallback(): ", e); } } else { Log.w(TAG, "addLockoutResetCallback(): Service not connected!"); } } } } Loading core/java/android/hardware/fingerprint/IFingerprintService.aidl +4 −0 Original line number Original line Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.hardware.fingerprint; import android.os.Bundle; import android.os.Bundle; import android.hardware.fingerprint.IFingerprintServiceReceiver; import android.hardware.fingerprint.IFingerprintServiceReceiver; import android.hardware.fingerprint.IFingerprintServiceLockoutResetCallback; import android.hardware.fingerprint.Fingerprint; import android.hardware.fingerprint.Fingerprint; import java.util.List; import java.util.List; Loading Loading @@ -71,4 +72,7 @@ interface IFingerprintService { // Reset the timeout when user authenticates with strong auth (e.g. PIN, pattern or password) // Reset the timeout when user authenticates with strong auth (e.g. PIN, pattern or password) void resetTimeout(in byte [] cryptoToken); void resetTimeout(in byte [] cryptoToken); // Add a callback which gets notified when the fingerprint lockout period expired. void addLockoutResetCallback(IFingerprintServiceLockoutResetCallback callback); } } core/java/android/hardware/fingerprint/IFingerprintServiceLockoutResetCallback.aidl 0 → 100644 +28 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2015 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.hardware.fingerprint; import android.hardware.fingerprint.Fingerprint; import android.os.Bundle; import android.os.UserHandle; /** * Callback when lockout period expired and clients are allowed to authenticate again. * @hide */ oneway interface IFingerprintServiceLockoutResetCallback { void onLockoutReset(long deviceId); } packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java +16 −0 Original line number Original line Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.content.Intent; import android.content.IntentFilter; import android.content.IntentFilter; import android.database.ContentObserver; import android.database.ContentObserver; import android.graphics.Bitmap; import android.graphics.Bitmap; import android.hardware.fingerprint.Fingerprint; import android.hardware.fingerprint.FingerprintManager; import android.hardware.fingerprint.FingerprintManager; import android.hardware.fingerprint.FingerprintManager.AuthenticationCallback; import android.hardware.fingerprint.FingerprintManager.AuthenticationCallback; import android.hardware.fingerprint.FingerprintManager.AuthenticationResult; import android.hardware.fingerprint.FingerprintManager.AuthenticationResult; Loading Loading @@ -472,6 +473,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } } } } private void handleFingerprintLockoutReset() { updateFingerprintListeningState(); } private void setFingerprintRunningState(int fingerprintRunningState) { private void setFingerprintRunningState(int fingerprintRunningState) { boolean wasRunning = mFingerprintRunningState == FINGERPRINT_STATE_RUNNING; boolean wasRunning = mFingerprintRunningState == FINGERPRINT_STATE_RUNNING; boolean isRunning = fingerprintRunningState == FINGERPRINT_STATE_RUNNING; boolean isRunning = fingerprintRunningState == FINGERPRINT_STATE_RUNNING; Loading Loading @@ -681,6 +686,14 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } } }; }; private final FingerprintManager.LockoutResetCallback mLockoutResetCallback = new FingerprintManager.LockoutResetCallback() { @Override public void onLockoutReset() { handleFingerprintLockoutReset(); } }; private FingerprintManager.AuthenticationCallback mAuthenticationCallback private FingerprintManager.AuthenticationCallback mAuthenticationCallback = new AuthenticationCallback() { = new AuthenticationCallback() { Loading Loading @@ -1003,6 +1016,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { mFpm = (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE); mFpm = (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE); updateFingerprintListeningState(); updateFingerprintListeningState(); if (mFpm != null) { mFpm.addLockoutResetCallback(mLockoutResetCallback); } } } private void updateFingerprintListeningState() { private void updateFingerprintListeningState() { Loading Loading
Android.mk +1 −0 Original line number Original line Diff line number Diff line Loading @@ -160,6 +160,7 @@ LOCAL_SRC_FILES += \ core/java/android/hardware/fingerprint/IFingerprintDaemon.aidl \ core/java/android/hardware/fingerprint/IFingerprintDaemon.aidl \ core/java/android/hardware/fingerprint/IFingerprintDaemonCallback.aidl \ core/java/android/hardware/fingerprint/IFingerprintDaemonCallback.aidl \ core/java/android/hardware/fingerprint/IFingerprintService.aidl \ core/java/android/hardware/fingerprint/IFingerprintService.aidl \ core/java/android/hardware/fingerprint/IFingerprintServiceLockoutResetCallback.aidl \ core/java/android/hardware/fingerprint/IFingerprintServiceReceiver.aidl \ core/java/android/hardware/fingerprint/IFingerprintServiceReceiver.aidl \ core/java/android/hardware/hdmi/IHdmiControlCallback.aidl \ core/java/android/hardware/hdmi/IHdmiControlCallback.aidl \ core/java/android/hardware/hdmi/IHdmiControlService.aidl \ core/java/android/hardware/hdmi/IHdmiControlService.aidl \ Loading
core/java/android/hardware/fingerprint/FingerprintManager.java +41 −2 Original line number Original line Diff line number Diff line Loading @@ -391,6 +391,18 @@ public class FingerprintManager { public void onRemovalSucceeded(Fingerprint fingerprint) { } public void onRemovalSucceeded(Fingerprint fingerprint) { } }; }; /** * @hide */ public static abstract class LockoutResetCallback { /** * Called when lockout period expired and clients are allowed to listen for fingerprint * again. */ public void onLockoutReset() { } }; /** /** * Request authentication of a crypto object. This call warms up the fingerprint hardware * Request authentication of a crypto object. This call warms up the fingerprint hardware * and starts scanning for a fingerprint. It terminates when * and starts scanning for a fingerprint. It terminates when Loading Loading @@ -680,10 +692,37 @@ public class FingerprintManager { try { try { mService.resetTimeout(token); mService.resetTimeout(token); } catch (RemoteException e) { } catch (RemoteException e) { Log.v(TAG, "Remote exception in getAuthenticatorId(): ", e); Log.v(TAG, "Remote exception in resetTimeout(): ", e); } } } else { } else { Log.w(TAG, "getAuthenticatorId(): Service not connected!"); Log.w(TAG, "resetTimeout(): Service not connected!"); } } /** * @hide */ public void addLockoutResetCallback(final LockoutResetCallback callback) { if (mService != null) { try { mService.addLockoutResetCallback( new IFingerprintServiceLockoutResetCallback.Stub() { @Override public void onLockoutReset(long deviceId) throws RemoteException { mHandler.post(new Runnable() { @Override public void run() { callback.onLockoutReset(); } }); } }); } catch (RemoteException e) { Log.v(TAG, "Remote exception in addLockoutResetCallback(): ", e); } } else { Log.w(TAG, "addLockoutResetCallback(): Service not connected!"); } } } } Loading
core/java/android/hardware/fingerprint/IFingerprintService.aidl +4 −0 Original line number Original line Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.hardware.fingerprint; import android.os.Bundle; import android.os.Bundle; import android.hardware.fingerprint.IFingerprintServiceReceiver; import android.hardware.fingerprint.IFingerprintServiceReceiver; import android.hardware.fingerprint.IFingerprintServiceLockoutResetCallback; import android.hardware.fingerprint.Fingerprint; import android.hardware.fingerprint.Fingerprint; import java.util.List; import java.util.List; Loading Loading @@ -71,4 +72,7 @@ interface IFingerprintService { // Reset the timeout when user authenticates with strong auth (e.g. PIN, pattern or password) // Reset the timeout when user authenticates with strong auth (e.g. PIN, pattern or password) void resetTimeout(in byte [] cryptoToken); void resetTimeout(in byte [] cryptoToken); // Add a callback which gets notified when the fingerprint lockout period expired. void addLockoutResetCallback(IFingerprintServiceLockoutResetCallback callback); } }
core/java/android/hardware/fingerprint/IFingerprintServiceLockoutResetCallback.aidl 0 → 100644 +28 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2015 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.hardware.fingerprint; import android.hardware.fingerprint.Fingerprint; import android.os.Bundle; import android.os.UserHandle; /** * Callback when lockout period expired and clients are allowed to authenticate again. * @hide */ oneway interface IFingerprintServiceLockoutResetCallback { void onLockoutReset(long deviceId); }
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java +16 −0 Original line number Original line Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.content.Intent; import android.content.IntentFilter; import android.content.IntentFilter; import android.database.ContentObserver; import android.database.ContentObserver; import android.graphics.Bitmap; import android.graphics.Bitmap; import android.hardware.fingerprint.Fingerprint; import android.hardware.fingerprint.FingerprintManager; import android.hardware.fingerprint.FingerprintManager; import android.hardware.fingerprint.FingerprintManager.AuthenticationCallback; import android.hardware.fingerprint.FingerprintManager.AuthenticationCallback; import android.hardware.fingerprint.FingerprintManager.AuthenticationResult; import android.hardware.fingerprint.FingerprintManager.AuthenticationResult; Loading Loading @@ -472,6 +473,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } } } } private void handleFingerprintLockoutReset() { updateFingerprintListeningState(); } private void setFingerprintRunningState(int fingerprintRunningState) { private void setFingerprintRunningState(int fingerprintRunningState) { boolean wasRunning = mFingerprintRunningState == FINGERPRINT_STATE_RUNNING; boolean wasRunning = mFingerprintRunningState == FINGERPRINT_STATE_RUNNING; boolean isRunning = fingerprintRunningState == FINGERPRINT_STATE_RUNNING; boolean isRunning = fingerprintRunningState == FINGERPRINT_STATE_RUNNING; Loading Loading @@ -681,6 +686,14 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } } }; }; private final FingerprintManager.LockoutResetCallback mLockoutResetCallback = new FingerprintManager.LockoutResetCallback() { @Override public void onLockoutReset() { handleFingerprintLockoutReset(); } }; private FingerprintManager.AuthenticationCallback mAuthenticationCallback private FingerprintManager.AuthenticationCallback mAuthenticationCallback = new AuthenticationCallback() { = new AuthenticationCallback() { Loading Loading @@ -1003,6 +1016,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { mFpm = (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE); mFpm = (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE); updateFingerprintListeningState(); updateFingerprintListeningState(); if (mFpm != null) { mFpm.addLockoutResetCallback(mLockoutResetCallback); } } } private void updateFingerprintListeningState() { private void updateFingerprintListeningState() { Loading