Loading core/java/android/hardware/biometrics/SensorPropertiesInternal.java +12 −4 Original line number Diff line number Diff line Loading @@ -16,13 +16,10 @@ package android.hardware.biometrics; import android.annotation.IntDef; import android.annotation.NonNull; import android.os.Parcel; import android.os.Parcelable; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * The base class containing all modality-agnostic information. This is a superset of the * {@link android.hardware.biometrics.common.CommonProps}, and provides backwards-compatible Loading @@ -35,6 +32,11 @@ public class SensorPropertiesInternal implements Parcelable { @SensorProperties.Strength public final int sensorStrength; public final int maxEnrollmentsPerUser; public static SensorPropertiesInternal from(@NonNull SensorPropertiesInternal prop) { return new SensorPropertiesInternal(prop.sensorId, prop.sensorStrength, prop.maxEnrollmentsPerUser); } protected SensorPropertiesInternal(int sensorId, @SensorProperties.Strength int sensorStrength, int maxEnrollmentsPerUser) { this.sensorId = sensorId; Loading Loading @@ -72,4 +74,10 @@ public class SensorPropertiesInternal implements Parcelable { dest.writeInt(sensorStrength); dest.writeInt(maxEnrollmentsPerUser); } @Override public String toString() { return "ID: " + sensorId + ", Strength: " + sensorStrength + ", MaxEnrollmentsPerUser: " + maxEnrollmentsPerUser; } } core/java/android/hardware/face/FaceSensorPropertiesInternal.java +5 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package android.hardware.face; import android.hardware.biometrics.SensorProperties; import android.hardware.biometrics.SensorPropertiesInternal; import android.os.Parcel; import android.os.Parcelable; /** * Container for face sensor properties. Loading Loading @@ -78,4 +77,9 @@ public class FaceSensorPropertiesInternal extends SensorPropertiesInternal { dest.writeBoolean(supportsFaceDetection); dest.writeBoolean(supportsSelfIllumination); } @Override public String toString() { return "ID: " + sensorId + ", Strength: " + sensorStrength; } } services/core/java/com/android/server/biometrics/BiometricService.java +5 −1 Original line number Diff line number Diff line Loading @@ -500,7 +500,11 @@ public class BiometricService extends SystemService { final List<SensorPropertiesInternal> sensors = new ArrayList<>(); for (BiometricSensor sensor : mSensors) { sensors.add(sensor.impl.getSensorProperties(opPackageName)); // Explicitly re-create as the super class, since AIDL doesn't play nicely with // "List<? extends SensorPropertiesInternal> ... final SensorPropertiesInternal prop = SensorPropertiesInternal .from(sensor.impl.getSensorProperties(opPackageName)); sensors.add(prop); } return sensors; Loading services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceProvider.java +6 −6 Original line number Diff line number Diff line Loading @@ -65,7 +65,6 @@ import java.util.List; * Provider for a single instance of the {@link IFace} HAL. */ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider { private static final String TAG = "FaceProvider"; private static final int ENROLL_TIMEOUT_SEC = 75; private boolean mTestHalEnabled; Loading @@ -88,7 +87,7 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider { public void onTaskStackChanged() { mHandler.post(() -> { for (int i = 0; i < mSensors.size(); i++) { final ClientMonitor<?> client = mSensors.get(i).getScheduler() final ClientMonitor<?> client = mSensors.valueAt(i).getScheduler() .getCurrentClient(); if (!(client instanceof AuthenticationClient)) { Slog.e(getTag(), "Task stack changed for client: " + client); Loading @@ -108,7 +107,7 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider { && !client.isAlreadyDone()) { Slog.e(getTag(), "Stopping background authentication, top: " + topPackage + " currentClient: " + client); mSensors.get(i).getScheduler() mSensors.valueAt(i).getScheduler() .cancelAuthentication(client.getToken()); } } Loading Loading @@ -550,12 +549,13 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider { JSONObject dump = new JSONObject(); try { dump.put("service", "Face Manager"); dump.put("service", getTag()); JSONArray sets = new JSONArray(); for (UserInfo user : UserManager.get(mContext).getUsers()) { final int userId = user.getUserHandle().getIdentifier(); final int c = FaceUtils.getInstance().getBiometricsForUser(mContext, userId).size(); final int c = FaceUtils.getInstance(sensorId) .getBiometricsForUser(mContext, userId).size(); JSONObject set = new JSONObject(); set.put("id", userId); set.put("count", c); Loading @@ -574,7 +574,7 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider { dump.put("prints", sets); } catch (JSONException e) { Slog.e(TAG, "dump formatting failure", e); Slog.e(getTag(), "dump formatting failure", e); } pw.println(dump); pw.println("HAL deaths since last reboot: " + performanceTracker.getHALDeathCount()); Loading services/core/java/com/android/server/biometrics/sensors/face/aidl/TestSession.java +1 −2 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import android.hardware.common.NativeHandle; import android.hardware.keymaster.HardwareAuthToken; import android.os.Binder; import android.os.IBinder; import android.os.RemoteException; /** * Test session that provides mostly no-ops. Loading Loading @@ -59,7 +58,7 @@ public class TestSession extends ISession.Stub { public ICancellationSignal authenticate(int cookie, long operationId) { return new ICancellationSignal() { @Override public void cancel() throws RemoteException { public void cancel() { mHalSessionCallback.onError(Error.CANCELED, 0 /* vendorCode */); } Loading Loading
core/java/android/hardware/biometrics/SensorPropertiesInternal.java +12 −4 Original line number Diff line number Diff line Loading @@ -16,13 +16,10 @@ package android.hardware.biometrics; import android.annotation.IntDef; import android.annotation.NonNull; import android.os.Parcel; import android.os.Parcelable; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * The base class containing all modality-agnostic information. This is a superset of the * {@link android.hardware.biometrics.common.CommonProps}, and provides backwards-compatible Loading @@ -35,6 +32,11 @@ public class SensorPropertiesInternal implements Parcelable { @SensorProperties.Strength public final int sensorStrength; public final int maxEnrollmentsPerUser; public static SensorPropertiesInternal from(@NonNull SensorPropertiesInternal prop) { return new SensorPropertiesInternal(prop.sensorId, prop.sensorStrength, prop.maxEnrollmentsPerUser); } protected SensorPropertiesInternal(int sensorId, @SensorProperties.Strength int sensorStrength, int maxEnrollmentsPerUser) { this.sensorId = sensorId; Loading Loading @@ -72,4 +74,10 @@ public class SensorPropertiesInternal implements Parcelable { dest.writeInt(sensorStrength); dest.writeInt(maxEnrollmentsPerUser); } @Override public String toString() { return "ID: " + sensorId + ", Strength: " + sensorStrength + ", MaxEnrollmentsPerUser: " + maxEnrollmentsPerUser; } }
core/java/android/hardware/face/FaceSensorPropertiesInternal.java +5 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package android.hardware.face; import android.hardware.biometrics.SensorProperties; import android.hardware.biometrics.SensorPropertiesInternal; import android.os.Parcel; import android.os.Parcelable; /** * Container for face sensor properties. Loading Loading @@ -78,4 +77,9 @@ public class FaceSensorPropertiesInternal extends SensorPropertiesInternal { dest.writeBoolean(supportsFaceDetection); dest.writeBoolean(supportsSelfIllumination); } @Override public String toString() { return "ID: " + sensorId + ", Strength: " + sensorStrength; } }
services/core/java/com/android/server/biometrics/BiometricService.java +5 −1 Original line number Diff line number Diff line Loading @@ -500,7 +500,11 @@ public class BiometricService extends SystemService { final List<SensorPropertiesInternal> sensors = new ArrayList<>(); for (BiometricSensor sensor : mSensors) { sensors.add(sensor.impl.getSensorProperties(opPackageName)); // Explicitly re-create as the super class, since AIDL doesn't play nicely with // "List<? extends SensorPropertiesInternal> ... final SensorPropertiesInternal prop = SensorPropertiesInternal .from(sensor.impl.getSensorProperties(opPackageName)); sensors.add(prop); } return sensors; Loading
services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceProvider.java +6 −6 Original line number Diff line number Diff line Loading @@ -65,7 +65,6 @@ import java.util.List; * Provider for a single instance of the {@link IFace} HAL. */ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider { private static final String TAG = "FaceProvider"; private static final int ENROLL_TIMEOUT_SEC = 75; private boolean mTestHalEnabled; Loading @@ -88,7 +87,7 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider { public void onTaskStackChanged() { mHandler.post(() -> { for (int i = 0; i < mSensors.size(); i++) { final ClientMonitor<?> client = mSensors.get(i).getScheduler() final ClientMonitor<?> client = mSensors.valueAt(i).getScheduler() .getCurrentClient(); if (!(client instanceof AuthenticationClient)) { Slog.e(getTag(), "Task stack changed for client: " + client); Loading @@ -108,7 +107,7 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider { && !client.isAlreadyDone()) { Slog.e(getTag(), "Stopping background authentication, top: " + topPackage + " currentClient: " + client); mSensors.get(i).getScheduler() mSensors.valueAt(i).getScheduler() .cancelAuthentication(client.getToken()); } } Loading Loading @@ -550,12 +549,13 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider { JSONObject dump = new JSONObject(); try { dump.put("service", "Face Manager"); dump.put("service", getTag()); JSONArray sets = new JSONArray(); for (UserInfo user : UserManager.get(mContext).getUsers()) { final int userId = user.getUserHandle().getIdentifier(); final int c = FaceUtils.getInstance().getBiometricsForUser(mContext, userId).size(); final int c = FaceUtils.getInstance(sensorId) .getBiometricsForUser(mContext, userId).size(); JSONObject set = new JSONObject(); set.put("id", userId); set.put("count", c); Loading @@ -574,7 +574,7 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider { dump.put("prints", sets); } catch (JSONException e) { Slog.e(TAG, "dump formatting failure", e); Slog.e(getTag(), "dump formatting failure", e); } pw.println(dump); pw.println("HAL deaths since last reboot: " + performanceTracker.getHALDeathCount()); Loading
services/core/java/com/android/server/biometrics/sensors/face/aidl/TestSession.java +1 −2 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import android.hardware.common.NativeHandle; import android.hardware.keymaster.HardwareAuthToken; import android.os.Binder; import android.os.IBinder; import android.os.RemoteException; /** * Test session that provides mostly no-ops. Loading Loading @@ -59,7 +58,7 @@ public class TestSession extends ISession.Stub { public ICancellationSignal authenticate(int cookie, long operationId) { return new ICancellationSignal() { @Override public void cancel() throws RemoteException { public void cancel() { mHalSessionCallback.onError(Error.CANCELED, 0 /* vendorCode */); } Loading