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

Commit f776ee08 authored by Ilya Matyukhin's avatar Ilya Matyukhin
Browse files

Add isUdfps to FingerprintService

Bug: 158135499
Test: build
Change-Id: If04528c08a7d855aff9bb61d6cf241c26a049aba
parent a36dcece
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -110,4 +110,7 @@ interface IFingerprintService {


    // Notifies about a finger leaving the sensor area.
    // Notifies about a finger leaving the sensor area.
    void onFingerUp();
    void onFingerUp();

    // Returns whether the specified sensor is a UDFPS.
    boolean isUdfps(int sensorId);
}
}
+23 −0
Original line number Original line Diff line number Diff line
@@ -389,6 +389,29 @@ public class FingerprintService extends BiometricServiceBase {
                }
                }
            }
            }
        }
        }

        @Override
        public boolean isUdfps(int sensorId) {
            checkPermission(USE_BIOMETRIC_INTERNAL);
            IBiometricsFingerprint daemon = getFingerprintDaemon();
            if (daemon == null) {
                Slog.e(TAG, "isUdfps | daemon is null");
            } else {
                android.hardware.biometrics.fingerprint.V2_3.IBiometricsFingerprint extension =
                        android.hardware.biometrics.fingerprint.V2_3.IBiometricsFingerprint.castFrom(
                                daemon);
                if (extension == null) {
                    Slog.v(TAG, "isUdfps | failed to cast the HIDL to V2_3");
                } else {
                    try {
                        return extension.isUdfps(sensorId);
                    } catch (RemoteException e) {
                        Slog.e(TAG, "isUdfps | RemoteException: ", e);
                    }
                }
            }
            return false;
        }
    }
    }


    private final LockoutFrameworkImpl mLockoutTracker;
    private final LockoutFrameworkImpl mLockoutTracker;