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

Commit 23d24a26 authored by Kevin Chyn's avatar Kevin Chyn
Browse files

Update logic when multiple fingerprint sensors exist

Bug: 172957689
Test: atest CtsBiometricsTestCases
Change-Id: Ifd61f8e4c1ec381837eb7c1b635b1bdeeaa54eb1
parent 1c0d722a
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -746,14 +746,14 @@ public class FingerprintService extends SystemService implements BiometricServic
    }
    }


    /**
    /**
     * For devices with only a single provider, returns that provider. If no providers, or multiple
     * For devices with only a single provider, returns that provider. If multiple providers,
     * providers exist, returns null.
     * returns the first one. If no providers, returns null.
     */
     */
    @Nullable
    @Nullable
    private Pair<Integer, ServiceProvider> getSingleProvider() {
    private Pair<Integer, ServiceProvider> getSingleProvider() {
        final List<FingerprintSensorPropertiesInternal> properties = getSensorProperties();
        final List<FingerprintSensorPropertiesInternal> properties = getSensorProperties();
        if (properties.size() != 1) {
        if (properties.isEmpty()) {
            Slog.e(TAG, "Multiple sensors found: " + properties.size());
            Slog.e(TAG, "No providers found");
            return null;
            return null;
        }
        }


@@ -766,7 +766,7 @@ public class FingerprintService extends SystemService implements BiometricServic
            }
            }
        }
        }


        Slog.e(TAG, "Single sensor, but provider not found");
        Slog.e(TAG, "Provider not found");
        return null;
        return null;
    }
    }