Loading core/java/android/hardware/biometrics/BiometricManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -236,7 +236,7 @@ public class BiometricManager { @RequiresPermission(TEST_BIOMETRIC) public BiometricTestSession createTestSession(int sensorId) { try { return new BiometricTestSession(mContext, return new BiometricTestSession(mContext, sensorId, mService.createTestSession(sensorId, mContext.getOpPackageName())); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading core/java/android/hardware/biometrics/BiometricTestSession.java +8 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.content.Context; import android.hardware.fingerprint.FingerprintManager; import android.os.RemoteException; import android.util.ArraySet; import android.util.Log; /** * Common set of interfaces to test biometric-related APIs, including {@link BiometricPrompt} and Loading @@ -33,7 +34,10 @@ import android.util.ArraySet; */ @TestApi public class BiometricTestSession implements AutoCloseable { private static final String TAG = "BiometricTestSession"; private final Context mContext; private final int mSensorId; private final ITestSession mTestSession; // Keep track of users that were tested, which need to be cleaned up when finishing. Loading @@ -42,8 +46,10 @@ public class BiometricTestSession implements AutoCloseable { /** * @hide */ public BiometricTestSession(@NonNull Context context, @NonNull ITestSession testSession) { public BiometricTestSession(@NonNull Context context, int sensorId, @NonNull ITestSession testSession) { mContext = context; mSensorId = sensorId; mTestSession = testSession; mTestedUsers = new ArraySet<>(); setTestHalEnabled(true); Loading @@ -61,6 +67,7 @@ public class BiometricTestSession implements AutoCloseable { @RequiresPermission(TEST_BIOMETRIC) private void setTestHalEnabled(boolean enabled) { try { Log.w(TAG, "setTestHalEnabled, sensor: " + mSensorId + " enabled: " + enabled); mTestSession.setTestHalEnabled(enabled); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading core/java/android/hardware/fingerprint/FingerprintManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -153,7 +153,7 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing @RequiresPermission(TEST_BIOMETRIC) public BiometricTestSession createTestSession(int sensorId) { try { return new BiometricTestSession(mContext, return new BiometricTestSession(mContext, sensorId, mService.createTestSession(sensorId, mContext.getOpPackageName())); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading services/core/java/com/android/server/biometrics/sensors/face/aidl/Sensor.java +1 −0 Original line number Diff line number Diff line Loading @@ -496,6 +496,7 @@ public class Sensor { } void setTestHalEnabled(boolean enabled) { Slog.w(mTag, "setTestHalEnabled: " + enabled); mTestHalEnabled = enabled; } Loading services/core/java/com/android/server/biometrics/sensors/face/aidl/TestHal.java +16 −17 Original line number Diff line number Diff line Loading @@ -23,86 +23,85 @@ import android.hardware.biometrics.face.ISessionCallback; import android.hardware.biometrics.face.SensorProps; import android.hardware.common.NativeHandle; import android.hardware.keymaster.HardwareAuthToken; import android.os.Binder; import android.os.IBinder; import android.util.Slog; /** * Test HAL that provides only no-ops. */ public class TestHal extends IFace.Stub { private static final String TAG = "face.aidl.TestHal"; @Override public SensorProps[] getSensorProps() { Slog.w(TAG, "getSensorProps"); return new SensorProps[0]; } @Override public ISession createSession(int sensorId, int userId, ISessionCallback cb) { return new ISession() { return new ISession.Stub() { @Override public void generateChallenge(int cookie, int timeoutSec) { Slog.w(TAG, "generateChallenge, cookie: " + cookie); } @Override public void revokeChallenge(int cookie, long challenge) { Slog.w(TAG, "revokeChallenge: " + challenge + ", cookie: " + cookie); } @Override public ICancellationSignal enroll(int cookie, HardwareAuthToken hat, byte enrollmentType, byte[] features, NativeHandle previewSurface) { Slog.w(TAG, "enroll, cookie: " + cookie); return null; } @Override public ICancellationSignal authenticate(int cookie, long operationId) { Slog.w(TAG, "authenticate, cookie: " + cookie); return null; } @Override public ICancellationSignal detectInteraction(int cookie) { Slog.w(TAG, "detectInteraction, cookie: " + cookie); return null; } @Override public void enumerateEnrollments(int cookie) { Slog.w(TAG, "enumerateEnrollments, cookie: " + cookie); } @Override public void removeEnrollments(int cookie, int[] enrollmentIds) { Slog.w(TAG, "removeEnrollments, cookie: " + cookie); } @Override public void getFeatures(int cookie, int enrollmentId) { Slog.w(TAG, "getFeatures, cookie: " + cookie); } @Override public void setFeature(int cookie, HardwareAuthToken hat, int enrollmentId, byte feature, boolean enabled) { Slog.w(TAG, "setFeature, cookie: " + cookie); } @Override public void getAuthenticatorId(int cookie) { Slog.w(TAG, "getAuthenticatorId, cookie: " + cookie); } @Override public void invalidateAuthenticatorId(int cookie) { Slog.w(TAG, "invalidateAuthenticatorId, cookie: " + cookie); } @Override public void resetLockout(int cookie, HardwareAuthToken hat) { } @Override public IBinder asBinder() { return new Binder(); Slog.w(TAG, "resetLockout, cookie: " + cookie); } }; } Loading Loading
core/java/android/hardware/biometrics/BiometricManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -236,7 +236,7 @@ public class BiometricManager { @RequiresPermission(TEST_BIOMETRIC) public BiometricTestSession createTestSession(int sensorId) { try { return new BiometricTestSession(mContext, return new BiometricTestSession(mContext, sensorId, mService.createTestSession(sensorId, mContext.getOpPackageName())); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading
core/java/android/hardware/biometrics/BiometricTestSession.java +8 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.content.Context; import android.hardware.fingerprint.FingerprintManager; import android.os.RemoteException; import android.util.ArraySet; import android.util.Log; /** * Common set of interfaces to test biometric-related APIs, including {@link BiometricPrompt} and Loading @@ -33,7 +34,10 @@ import android.util.ArraySet; */ @TestApi public class BiometricTestSession implements AutoCloseable { private static final String TAG = "BiometricTestSession"; private final Context mContext; private final int mSensorId; private final ITestSession mTestSession; // Keep track of users that were tested, which need to be cleaned up when finishing. Loading @@ -42,8 +46,10 @@ public class BiometricTestSession implements AutoCloseable { /** * @hide */ public BiometricTestSession(@NonNull Context context, @NonNull ITestSession testSession) { public BiometricTestSession(@NonNull Context context, int sensorId, @NonNull ITestSession testSession) { mContext = context; mSensorId = sensorId; mTestSession = testSession; mTestedUsers = new ArraySet<>(); setTestHalEnabled(true); Loading @@ -61,6 +67,7 @@ public class BiometricTestSession implements AutoCloseable { @RequiresPermission(TEST_BIOMETRIC) private void setTestHalEnabled(boolean enabled) { try { Log.w(TAG, "setTestHalEnabled, sensor: " + mSensorId + " enabled: " + enabled); mTestSession.setTestHalEnabled(enabled); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading
core/java/android/hardware/fingerprint/FingerprintManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -153,7 +153,7 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing @RequiresPermission(TEST_BIOMETRIC) public BiometricTestSession createTestSession(int sensorId) { try { return new BiometricTestSession(mContext, return new BiometricTestSession(mContext, sensorId, mService.createTestSession(sensorId, mContext.getOpPackageName())); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading
services/core/java/com/android/server/biometrics/sensors/face/aidl/Sensor.java +1 −0 Original line number Diff line number Diff line Loading @@ -496,6 +496,7 @@ public class Sensor { } void setTestHalEnabled(boolean enabled) { Slog.w(mTag, "setTestHalEnabled: " + enabled); mTestHalEnabled = enabled; } Loading
services/core/java/com/android/server/biometrics/sensors/face/aidl/TestHal.java +16 −17 Original line number Diff line number Diff line Loading @@ -23,86 +23,85 @@ import android.hardware.biometrics.face.ISessionCallback; import android.hardware.biometrics.face.SensorProps; import android.hardware.common.NativeHandle; import android.hardware.keymaster.HardwareAuthToken; import android.os.Binder; import android.os.IBinder; import android.util.Slog; /** * Test HAL that provides only no-ops. */ public class TestHal extends IFace.Stub { private static final String TAG = "face.aidl.TestHal"; @Override public SensorProps[] getSensorProps() { Slog.w(TAG, "getSensorProps"); return new SensorProps[0]; } @Override public ISession createSession(int sensorId, int userId, ISessionCallback cb) { return new ISession() { return new ISession.Stub() { @Override public void generateChallenge(int cookie, int timeoutSec) { Slog.w(TAG, "generateChallenge, cookie: " + cookie); } @Override public void revokeChallenge(int cookie, long challenge) { Slog.w(TAG, "revokeChallenge: " + challenge + ", cookie: " + cookie); } @Override public ICancellationSignal enroll(int cookie, HardwareAuthToken hat, byte enrollmentType, byte[] features, NativeHandle previewSurface) { Slog.w(TAG, "enroll, cookie: " + cookie); return null; } @Override public ICancellationSignal authenticate(int cookie, long operationId) { Slog.w(TAG, "authenticate, cookie: " + cookie); return null; } @Override public ICancellationSignal detectInteraction(int cookie) { Slog.w(TAG, "detectInteraction, cookie: " + cookie); return null; } @Override public void enumerateEnrollments(int cookie) { Slog.w(TAG, "enumerateEnrollments, cookie: " + cookie); } @Override public void removeEnrollments(int cookie, int[] enrollmentIds) { Slog.w(TAG, "removeEnrollments, cookie: " + cookie); } @Override public void getFeatures(int cookie, int enrollmentId) { Slog.w(TAG, "getFeatures, cookie: " + cookie); } @Override public void setFeature(int cookie, HardwareAuthToken hat, int enrollmentId, byte feature, boolean enabled) { Slog.w(TAG, "setFeature, cookie: " + cookie); } @Override public void getAuthenticatorId(int cookie) { Slog.w(TAG, "getAuthenticatorId, cookie: " + cookie); } @Override public void invalidateAuthenticatorId(int cookie) { Slog.w(TAG, "invalidateAuthenticatorId, cookie: " + cookie); } @Override public void resetLockout(int cookie, HardwareAuthToken hat) { } @Override public IBinder asBinder() { return new Binder(); Slog.w(TAG, "resetLockout, cookie: " + cookie); } }; } Loading