Loading core/java/android/hardware/face/FaceSensorConfigurations.java +1 −1 Original line number Diff line number Diff line Loading @@ -186,7 +186,7 @@ public class FaceSensorConfigurations implements Parcelable { try { IVirtualHal vhal = IVirtualHal.Stub.asInterface( Binder.allowBlocking(ServiceManager.waitForService(fqNameMapped))); return vhal.getFaceHal(); return vhal != null ? vhal.getFaceHal() : null; } catch (RemoteException e) { Slog.e(TAG, "Remote exception in vhal.getFaceHal() call" + fqNameMapped); } Loading services/core/java/com/android/server/biometrics/sensors/face/FaceService.java +2 −32 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.server.biometrics.sensors.face; import static android.Manifest.permission.INTERACT_ACROSS_USERS; import static android.Manifest.permission.MANAGE_FACE; import static android.Manifest.permission.USE_BIOMETRIC_INTERNAL; import static android.hardware.face.FaceSensorConfigurations.getIFace; import android.annotation.NonNull; import android.annotation.Nullable; Loading Loading @@ -81,7 +80,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.function.Function; import java.util.function.Supplier; /** Loading @@ -105,9 +103,6 @@ public class FaceService extends SystemService { private final AuthenticationStateListeners mAuthenticationStateListeners; @NonNull private final FaceProviderFunction mFaceProviderFunction; @NonNull private final Function<String, FaceProvider> mFaceProvider; @NonNull private final Supplier<String[]> mAidlInstanceNameSupplier; interface FaceProviderFunction { FaceProvider getFaceProvider(Pair<String, SensorProps[]> filteredSensorProps, Loading Loading @@ -757,17 +752,13 @@ public class FaceService extends SystemService { BiometricContext.getInstance(context), null /* faceProviderFunction */, () -> IBiometricService.Stub.asInterface( ServiceManager.getService(Context.BIOMETRIC_SERVICE)), null /* faceProvider */, () -> getDeclaredInstances()); ServiceManager.getService(Context.BIOMETRIC_SERVICE))); } @VisibleForTesting FaceService(Context context, BiometricContext biometricContext, FaceProviderFunction faceProviderFunction, Supplier<IBiometricService> biometricServiceSupplier, Function<String, FaceProvider> faceProvider, Supplier<String[]> aidlInstanceNameSupplier) { Supplier<IBiometricService> biometricServiceSupplier) { super(context); mServiceWrapper = new FaceServiceWrapper(); mLockoutResetDispatcher = new LockoutResetDispatcher(context); Loading @@ -781,27 +772,6 @@ public class FaceService extends SystemService { mBiometricStateCallback.start(mRegistry.getProviders()); } }); mAidlInstanceNameSupplier = aidlInstanceNameSupplier; mFaceProvider = faceProvider != null ? faceProvider : (name) -> { final String fqName = IFace.DESCRIPTOR + "/" + name; final IFace face = getIFace(fqName); if (face == null) { Slog.e(TAG, "Unable to get declared service: " + fqName); return null; } try { final SensorProps[] props = face.getSensorProps(); return new FaceProvider(getContext(), mBiometricStateCallback, mAuthenticationStateListeners, props, name, mLockoutResetDispatcher, biometricContext, false /* resetLockoutRequiresChallenge */); } catch (RemoteException e) { Slog.e(TAG, "Remote exception in getSensorProps: " + fqName); } return null; }; mFaceProviderFunction = faceProviderFunction != null ? faceProviderFunction : ((filteredSensorProps, resetLockoutRequiresChallenge) -> new FaceProvider( Loading services/tests/servicestests/src/com/android/server/biometrics/sensors/face/FaceServiceTest.java +1 −7 Original line number Diff line number Diff line Loading @@ -140,13 +140,7 @@ public class FaceServiceTest { if (NAME_DEFAULT.equals(filteredSensorProps.first)) return mFaceProviderDefault; if (NAME_VIRTUAL.equals(filteredSensorProps.first)) return mFaceProviderVirtual; return null; }, () -> mIBiometricService, (name) -> { if (NAME_DEFAULT.equals(name)) return mFaceProviderDefault; if (NAME_VIRTUAL.equals(name)) return mFaceProviderVirtual; return null; }, () -> new String[]{NAME_DEFAULT, NAME_VIRTUAL}); }, () -> mIBiometricService); } @Test Loading Loading
core/java/android/hardware/face/FaceSensorConfigurations.java +1 −1 Original line number Diff line number Diff line Loading @@ -186,7 +186,7 @@ public class FaceSensorConfigurations implements Parcelable { try { IVirtualHal vhal = IVirtualHal.Stub.asInterface( Binder.allowBlocking(ServiceManager.waitForService(fqNameMapped))); return vhal.getFaceHal(); return vhal != null ? vhal.getFaceHal() : null; } catch (RemoteException e) { Slog.e(TAG, "Remote exception in vhal.getFaceHal() call" + fqNameMapped); } Loading
services/core/java/com/android/server/biometrics/sensors/face/FaceService.java +2 −32 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.server.biometrics.sensors.face; import static android.Manifest.permission.INTERACT_ACROSS_USERS; import static android.Manifest.permission.MANAGE_FACE; import static android.Manifest.permission.USE_BIOMETRIC_INTERNAL; import static android.hardware.face.FaceSensorConfigurations.getIFace; import android.annotation.NonNull; import android.annotation.Nullable; Loading Loading @@ -81,7 +80,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.function.Function; import java.util.function.Supplier; /** Loading @@ -105,9 +103,6 @@ public class FaceService extends SystemService { private final AuthenticationStateListeners mAuthenticationStateListeners; @NonNull private final FaceProviderFunction mFaceProviderFunction; @NonNull private final Function<String, FaceProvider> mFaceProvider; @NonNull private final Supplier<String[]> mAidlInstanceNameSupplier; interface FaceProviderFunction { FaceProvider getFaceProvider(Pair<String, SensorProps[]> filteredSensorProps, Loading Loading @@ -757,17 +752,13 @@ public class FaceService extends SystemService { BiometricContext.getInstance(context), null /* faceProviderFunction */, () -> IBiometricService.Stub.asInterface( ServiceManager.getService(Context.BIOMETRIC_SERVICE)), null /* faceProvider */, () -> getDeclaredInstances()); ServiceManager.getService(Context.BIOMETRIC_SERVICE))); } @VisibleForTesting FaceService(Context context, BiometricContext biometricContext, FaceProviderFunction faceProviderFunction, Supplier<IBiometricService> biometricServiceSupplier, Function<String, FaceProvider> faceProvider, Supplier<String[]> aidlInstanceNameSupplier) { Supplier<IBiometricService> biometricServiceSupplier) { super(context); mServiceWrapper = new FaceServiceWrapper(); mLockoutResetDispatcher = new LockoutResetDispatcher(context); Loading @@ -781,27 +772,6 @@ public class FaceService extends SystemService { mBiometricStateCallback.start(mRegistry.getProviders()); } }); mAidlInstanceNameSupplier = aidlInstanceNameSupplier; mFaceProvider = faceProvider != null ? faceProvider : (name) -> { final String fqName = IFace.DESCRIPTOR + "/" + name; final IFace face = getIFace(fqName); if (face == null) { Slog.e(TAG, "Unable to get declared service: " + fqName); return null; } try { final SensorProps[] props = face.getSensorProps(); return new FaceProvider(getContext(), mBiometricStateCallback, mAuthenticationStateListeners, props, name, mLockoutResetDispatcher, biometricContext, false /* resetLockoutRequiresChallenge */); } catch (RemoteException e) { Slog.e(TAG, "Remote exception in getSensorProps: " + fqName); } return null; }; mFaceProviderFunction = faceProviderFunction != null ? faceProviderFunction : ((filteredSensorProps, resetLockoutRequiresChallenge) -> new FaceProvider( Loading
services/tests/servicestests/src/com/android/server/biometrics/sensors/face/FaceServiceTest.java +1 −7 Original line number Diff line number Diff line Loading @@ -140,13 +140,7 @@ public class FaceServiceTest { if (NAME_DEFAULT.equals(filteredSensorProps.first)) return mFaceProviderDefault; if (NAME_VIRTUAL.equals(filteredSensorProps.first)) return mFaceProviderVirtual; return null; }, () -> mIBiometricService, (name) -> { if (NAME_DEFAULT.equals(name)) return mFaceProviderDefault; if (NAME_VIRTUAL.equals(name)) return mFaceProviderVirtual; return null; }, () -> new String[]{NAME_DEFAULT, NAME_VIRTUAL}); }, () -> mIBiometricService); } @Test Loading