Loading core/java/android/hardware/biometrics/BiometricManager.java +19 −0 Original line number Diff line number Diff line Loading @@ -152,5 +152,24 @@ public class BiometricManager { Slog.w(TAG, "setActiveUser(): Service not connected"); } } /** * Reset the timeout when user authenticates with strong auth (e.g. PIN, pattern or password) * * @param token an opaque token returned by password confirmation. * @hide */ @RequiresPermission(USE_BIOMETRIC_INTERNAL) public void resetTimeout(byte[] token) { if (mService != null) { try { mService.resetTimeout(token); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } else { Slog.w(TAG, "resetTimeout(): Service not connected"); } } } core/java/android/hardware/biometrics/IBiometricService.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -48,4 +48,7 @@ interface IBiometricService { // Notify BiometricService when <Biometric>Service is ready to start the prepared client. // Client lifecycle is still managed in <Biometric>Service. void onReadyForAuthentication(int cookie, boolean requireConfirmation, int userId); // Reset the timeout when user authenticates with strong auth (e.g. PIN, pattern or password) void resetTimeout(in byte [] token); } services/core/java/com/android/server/biometrics/BiometricService.java +18 −0 Original line number Diff line number Diff line Loading @@ -813,6 +813,24 @@ public class BiometricService extends SystemService { } } @Override // Binder call public void resetTimeout(byte[] token) { checkInternalPermission(); final long ident = Binder.clearCallingIdentity(); try { if (mFingerprintService != null) { mFingerprintService.resetTimeout(token); } if (mFaceService != null) { mFaceService.resetTimeout(token); } } catch (RemoteException e) { Slog.e(TAG, "Remote exception", e); } finally { Binder.restoreCallingIdentity(ident); } } void cancelInternal(IBinder token, String opPackageName, boolean fromClient) { final int callingUid = Binder.getCallingUid(); final int callingPid = Binder.getCallingPid(); Loading services/core/java/com/android/server/locksettings/LockSettingsStrongAuth.java +7 −9 Original line number Diff line number Diff line Loading @@ -24,8 +24,7 @@ import android.app.AlarmManager.OnAlarmListener; import android.app.admin.DevicePolicyManager; import android.app.trust.IStrongAuthTracker; import android.content.Context; import android.content.pm.PackageManager; import android.hardware.fingerprint.FingerprintManager; import android.hardware.biometrics.BiometricManager; import android.os.Handler; import android.os.Message; import android.os.RemoteCallbackList; Loading Loading @@ -62,7 +61,7 @@ public class LockSettingsStrongAuth { private final Context mContext; private AlarmManager mAlarmManager; private FingerprintManager mFingerprintManager; private BiometricManager mBiometricManager; public LockSettingsStrongAuth(Context context) { mContext = context; Loading @@ -71,9 +70,8 @@ public class LockSettingsStrongAuth { } public void systemReady() { final PackageManager pm = mContext.getPackageManager(); if (pm.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)) { mFingerprintManager = mContext.getSystemService(FingerprintManager.class); if (BiometricManager.hasBiometrics(mContext)) { mBiometricManager = mContext.getSystemService(BiometricManager.class); } } Loading Loading @@ -187,9 +185,9 @@ public class LockSettingsStrongAuth { } public void reportSuccessfulStrongAuthUnlock(int userId) { if (mFingerprintManager != null) { byte[] token = null; /* TODO: pass real auth token once fp HAL supports it */ mFingerprintManager.resetTimeout(token); if (mBiometricManager != null) { byte[] token = null; /* TODO: pass real auth token once HAL supports it */ mBiometricManager.resetTimeout(token); } final int argNotUsed = 0; Loading Loading
core/java/android/hardware/biometrics/BiometricManager.java +19 −0 Original line number Diff line number Diff line Loading @@ -152,5 +152,24 @@ public class BiometricManager { Slog.w(TAG, "setActiveUser(): Service not connected"); } } /** * Reset the timeout when user authenticates with strong auth (e.g. PIN, pattern or password) * * @param token an opaque token returned by password confirmation. * @hide */ @RequiresPermission(USE_BIOMETRIC_INTERNAL) public void resetTimeout(byte[] token) { if (mService != null) { try { mService.resetTimeout(token); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } else { Slog.w(TAG, "resetTimeout(): Service not connected"); } } }
core/java/android/hardware/biometrics/IBiometricService.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -48,4 +48,7 @@ interface IBiometricService { // Notify BiometricService when <Biometric>Service is ready to start the prepared client. // Client lifecycle is still managed in <Biometric>Service. void onReadyForAuthentication(int cookie, boolean requireConfirmation, int userId); // Reset the timeout when user authenticates with strong auth (e.g. PIN, pattern or password) void resetTimeout(in byte [] token); }
services/core/java/com/android/server/biometrics/BiometricService.java +18 −0 Original line number Diff line number Diff line Loading @@ -813,6 +813,24 @@ public class BiometricService extends SystemService { } } @Override // Binder call public void resetTimeout(byte[] token) { checkInternalPermission(); final long ident = Binder.clearCallingIdentity(); try { if (mFingerprintService != null) { mFingerprintService.resetTimeout(token); } if (mFaceService != null) { mFaceService.resetTimeout(token); } } catch (RemoteException e) { Slog.e(TAG, "Remote exception", e); } finally { Binder.restoreCallingIdentity(ident); } } void cancelInternal(IBinder token, String opPackageName, boolean fromClient) { final int callingUid = Binder.getCallingUid(); final int callingPid = Binder.getCallingPid(); Loading
services/core/java/com/android/server/locksettings/LockSettingsStrongAuth.java +7 −9 Original line number Diff line number Diff line Loading @@ -24,8 +24,7 @@ import android.app.AlarmManager.OnAlarmListener; import android.app.admin.DevicePolicyManager; import android.app.trust.IStrongAuthTracker; import android.content.Context; import android.content.pm.PackageManager; import android.hardware.fingerprint.FingerprintManager; import android.hardware.biometrics.BiometricManager; import android.os.Handler; import android.os.Message; import android.os.RemoteCallbackList; Loading Loading @@ -62,7 +61,7 @@ public class LockSettingsStrongAuth { private final Context mContext; private AlarmManager mAlarmManager; private FingerprintManager mFingerprintManager; private BiometricManager mBiometricManager; public LockSettingsStrongAuth(Context context) { mContext = context; Loading @@ -71,9 +70,8 @@ public class LockSettingsStrongAuth { } public void systemReady() { final PackageManager pm = mContext.getPackageManager(); if (pm.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)) { mFingerprintManager = mContext.getSystemService(FingerprintManager.class); if (BiometricManager.hasBiometrics(mContext)) { mBiometricManager = mContext.getSystemService(BiometricManager.class); } } Loading Loading @@ -187,9 +185,9 @@ public class LockSettingsStrongAuth { } public void reportSuccessfulStrongAuthUnlock(int userId) { if (mFingerprintManager != null) { byte[] token = null; /* TODO: pass real auth token once fp HAL supports it */ mFingerprintManager.resetTimeout(token); if (mBiometricManager != null) { byte[] token = null; /* TODO: pass real auth token once HAL supports it */ mBiometricManager.resetTimeout(token); } final int argNotUsed = 0; Loading