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

Commit adf6f104 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Return immediately from isHardwareDetected" into sc-dev

parents e952eaa2 788d6659
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -160,6 +160,13 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider {
        return "FaceProvider/" + mHalInstanceName;
    }

    boolean hasHalInstance() {
        if (mTestHalEnabled) {
            return true;
        }
        return ServiceManager.checkService(IFace.DESCRIPTOR + "/" + mHalInstanceName) != null;
    }

    @Nullable
    @VisibleForTesting
    synchronized IFace getHalInstance() {
@@ -291,7 +298,7 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider {

    @Override
    public boolean isHardwareDetected(int sensorId) {
        return getHalInstance() != null;
        return hasHalInstance();
    }

    @Override
+9 −1
Original line number Diff line number Diff line
@@ -172,6 +172,14 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi
        return "FingerprintProvider/" + mHalInstanceName;
    }

    boolean hasHalInstance() {
        if (mTestHalEnabled) {
            return true;
        }
        return (ServiceManager.checkService(IFingerprint.DESCRIPTOR + "/" + mHalInstanceName)
                != null);
    }

    @Nullable
    @VisibleForTesting
    synchronized IFingerprint getHalInstance() {
@@ -454,7 +462,7 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi

    @Override
    public boolean isHardwareDetected(int sensorId) {
        return getHalInstance() != null;
        return hasHalInstance();
    }

    @Override