Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 786c9f52 authored by Joe Bolinger's avatar Joe Bolinger Committed by Android (Google) Code Review
Browse files

Merge "Ensure sensor id is set before face detect." into udc-dev

parents 6a83c7e0 b781f1cc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -260,9 +260,8 @@ public class FaceService extends SystemService {
            if (provider == null) {
                Slog.w(TAG, "Null provider for authenticate");
                return -1;
            } else {
                options.setSensorId(provider.first);
            }
            options.setSensorId(provider.first);

            return provider.second.scheduleAuthenticate(token, operationId,
                    0 /* cookie */, new ClientMonitorCallbackConverter(receiver), options,
@@ -286,6 +285,7 @@ public class FaceService extends SystemService {
                Slog.w(TAG, "Null provider for detectFace");
                return -1;
            }
            options.setSensorId(provider.first);

            return provider.second.scheduleFaceDetect(token,
                    new ClientMonitorCallbackConverter(receiver), options,
+7 −8
Original line number Diff line number Diff line
@@ -261,7 +261,6 @@ public class FingerprintService extends SystemService {
            final String opPackageName = options.getOpPackageName();
            final String attributionTag = options.getAttributionTag();
            final int userId = options.getUserId();
            final int sensorId = options.getSensorId();

            if (!canUseFingerprint(
                    opPackageName,
@@ -298,21 +297,22 @@ public class FingerprintService extends SystemService {
                    : BiometricsProtoEnums.CLIENT_FINGERPRINT_MANAGER;

            final Pair<Integer, ServiceProvider> provider;
            if (sensorId == FingerprintManager.SENSOR_ID_ANY) {
            if (options.getSensorId() == FingerprintManager.SENSOR_ID_ANY) {
                provider = mRegistry.getSingleProvider();
            } else {
                Utils.checkPermission(getContext(), USE_BIOMETRIC_INTERNAL);
                provider = new Pair<>(sensorId, mRegistry.getProviderForSensor(sensorId));
                provider = new Pair<>(options.getSensorId(),
                        mRegistry.getProviderForSensor(options.getSensorId()));
            }

            if (provider == null) {
                Slog.w(TAG, "Null provider for authenticate");
                return -1;
            } else {
                options.setSensorId(provider.first);
            }
            options.setSensorId(provider.first);

            final FingerprintSensorPropertiesInternal sensorProps =
                    provider.second.getSensorProperties(sensorId);
                    provider.second.getSensorProperties(options.getSensorId());
            if (!isKeyguard && !Utils.isSettings(getContext(), opPackageName)
                    && sensorProps != null && sensorProps.isAnyUdfpsType()) {
                try {
@@ -431,9 +431,8 @@ public class FingerprintService extends SystemService {
            if (provider == null) {
                Slog.w(TAG, "Null provider for detectFingerprint");
                return -1;
            } else {
                options.setSensorId(provider.first);
            }
            options.setSensorId(provider.first);

            return provider.second.scheduleFingerDetect(token,
                    new ClientMonitorCallbackConverter(receiver), options,