Loading core/java/android/hardware/fingerprint/FingerprintManager.java +21 −1 Original line number Original line Diff line number Diff line Loading @@ -380,6 +380,26 @@ public class FingerprintManager { */ */ public void authenticate(@Nullable CryptoObject crypto, @Nullable CancellationSignal cancel, public void authenticate(@Nullable CryptoObject crypto, @Nullable CancellationSignal cancel, @NonNull AuthenticationCallback callback, int flags) { @NonNull AuthenticationCallback callback, int flags) { authenticate(crypto, cancel, callback, flags, UserHandle.myUserId()); } /** * Request authentication of a crypto object. This call warms up the fingerprint hardware * and starts scanning for a fingerprint. It terminates when * {@link AuthenticationCallback#onAuthenticationError(int, CharSequence)} or * {@link AuthenticationCallback#onAuthenticationSucceeded(AuthenticationResult) is called, at * which point the object is no longer valid. The operation can be canceled by using the * provided cancel object. * * @param crypto object associated with the call or null if none required. * @param cancel an object that can be used to cancel authentication * @param callback an object to receive authentication events * @param flags optional flags; should be 0 * @param userId the userId the fingerprint belongs to * @hide */ public void authenticate(@Nullable CryptoObject crypto, @Nullable CancellationSignal cancel, @NonNull AuthenticationCallback callback, int flags, int userId) { if (callback == null) { if (callback == null) { throw new IllegalArgumentException("Must supply an authentication callback"); throw new IllegalArgumentException("Must supply an authentication callback"); } } Loading @@ -397,7 +417,7 @@ public class FingerprintManager { mAuthenticationCallback = callback; mAuthenticationCallback = callback; mCryptoObject = crypto; mCryptoObject = crypto; long sessionId = crypto != null ? crypto.getOpId() : 0; long sessionId = crypto != null ? crypto.getOpId() : 0; mService.authenticate(mToken, sessionId, getCurrentUserId(), mServiceReceiver, flags); mService.authenticate(mToken, sessionId, userId, mServiceReceiver, flags); } catch (RemoteException e) { } catch (RemoteException e) { Log.w(TAG, "Remote exception while authenticating: ", e); Log.w(TAG, "Remote exception while authenticating: ", e); if (callback != null) { if (callback != null) { Loading packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java +3 −1 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.keyguard; package com.android.keyguard; import android.app.ActivityManager; import android.app.ActivityManagerNative; import android.app.ActivityManagerNative; import android.app.AlarmManager; import android.app.AlarmManager; import android.app.IUserSwitchObserver; import android.app.IUserSwitchObserver; Loading Loading @@ -795,7 +796,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { mFingerprintCancelSignal.cancel(); mFingerprintCancelSignal.cancel(); } } mFingerprintCancelSignal = new CancellationSignal(); mFingerprintCancelSignal = new CancellationSignal(); mFpm.authenticate(null, mFingerprintCancelSignal, mAuthenticationCallback, 0); mFpm.authenticate(null, mFingerprintCancelSignal, mAuthenticationCallback, 0, ActivityManager.getCurrentUser()); setFingerprintRunningDetectionRunning(true); setFingerprintRunningDetectionRunning(true); } } } } Loading Loading
core/java/android/hardware/fingerprint/FingerprintManager.java +21 −1 Original line number Original line Diff line number Diff line Loading @@ -380,6 +380,26 @@ public class FingerprintManager { */ */ public void authenticate(@Nullable CryptoObject crypto, @Nullable CancellationSignal cancel, public void authenticate(@Nullable CryptoObject crypto, @Nullable CancellationSignal cancel, @NonNull AuthenticationCallback callback, int flags) { @NonNull AuthenticationCallback callback, int flags) { authenticate(crypto, cancel, callback, flags, UserHandle.myUserId()); } /** * Request authentication of a crypto object. This call warms up the fingerprint hardware * and starts scanning for a fingerprint. It terminates when * {@link AuthenticationCallback#onAuthenticationError(int, CharSequence)} or * {@link AuthenticationCallback#onAuthenticationSucceeded(AuthenticationResult) is called, at * which point the object is no longer valid. The operation can be canceled by using the * provided cancel object. * * @param crypto object associated with the call or null if none required. * @param cancel an object that can be used to cancel authentication * @param callback an object to receive authentication events * @param flags optional flags; should be 0 * @param userId the userId the fingerprint belongs to * @hide */ public void authenticate(@Nullable CryptoObject crypto, @Nullable CancellationSignal cancel, @NonNull AuthenticationCallback callback, int flags, int userId) { if (callback == null) { if (callback == null) { throw new IllegalArgumentException("Must supply an authentication callback"); throw new IllegalArgumentException("Must supply an authentication callback"); } } Loading @@ -397,7 +417,7 @@ public class FingerprintManager { mAuthenticationCallback = callback; mAuthenticationCallback = callback; mCryptoObject = crypto; mCryptoObject = crypto; long sessionId = crypto != null ? crypto.getOpId() : 0; long sessionId = crypto != null ? crypto.getOpId() : 0; mService.authenticate(mToken, sessionId, getCurrentUserId(), mServiceReceiver, flags); mService.authenticate(mToken, sessionId, userId, mServiceReceiver, flags); } catch (RemoteException e) { } catch (RemoteException e) { Log.w(TAG, "Remote exception while authenticating: ", e); Log.w(TAG, "Remote exception while authenticating: ", e); if (callback != null) { if (callback != null) { Loading
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java +3 −1 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.keyguard; package com.android.keyguard; import android.app.ActivityManager; import android.app.ActivityManagerNative; import android.app.ActivityManagerNative; import android.app.AlarmManager; import android.app.AlarmManager; import android.app.IUserSwitchObserver; import android.app.IUserSwitchObserver; Loading Loading @@ -795,7 +796,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { mFingerprintCancelSignal.cancel(); mFingerprintCancelSignal.cancel(); } } mFingerprintCancelSignal = new CancellationSignal(); mFingerprintCancelSignal = new CancellationSignal(); mFpm.authenticate(null, mFingerprintCancelSignal, mAuthenticationCallback, 0); mFpm.authenticate(null, mFingerprintCancelSignal, mAuthenticationCallback, 0, ActivityManager.getCurrentUser()); setFingerprintRunningDetectionRunning(true); setFingerprintRunningDetectionRunning(true); } } } } Loading