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

Commit aa5859f2 authored by Austin Delgado's avatar Austin Delgado Committed by Android (Google) Code Review
Browse files

Merge "Add setIgnoreDisplayTouches to FingerprintManager" into main

parents 4c72af61 6193bde0
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -698,6 +698,25 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
        }
    }

    /**
     * Set whether the HAL should ignore display touches.
     * Only applies to sensors where the HAL is reponsible for handling touches.
     * @hide
     */
    @RequiresPermission(USE_BIOMETRIC_INTERNAL)
    public void setIgnoreDisplayTouches(long requestId, int sensorId, boolean ignoreTouch) {
        if (mService == null) {
            Slog.w(TAG, "setIgnoreDisplayTouches: no fingerprint service");
            return;
        }

        try {
            mService.setIgnoreDisplayTouches(requestId, sensorId, ignoreTouch);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Request fingerprint enrollment. This call warms up the fingerprint hardware
     * and starts scanning for fingerprints. Progress will be indicated by callbacks to the
+8 −0
Original line number Diff line number Diff line
@@ -119,6 +119,14 @@ public class FingerprintSensorPropertiesInternal extends SensorPropertiesInterna
        }
    }

    /**
     * Returns if sensor type is ultrasonic Udfps
     * @return true if sensor is ultrasonic Udfps, false otherwise
     */
    public boolean isUltrasonicUdfps() {
        return sensorType == TYPE_UDFPS_ULTRASONIC;
    }

    /**
     * Returns if sensor type is side-FPS
     * @return true if sensor is side-fps, false otherwise
+3 −0
Original line number Diff line number Diff line
@@ -195,6 +195,9 @@ interface IFingerprintService {
    @EnforcePermission("USE_BIOMETRIC_INTERNAL")
    void onUdfpsUiEvent(int event, long requestId, int sensorId);

    @EnforcePermission("USE_BIOMETRIC_INTERNAL")
    void setIgnoreDisplayTouches(long requestId, int sensorId, boolean ignoreTouches);

    // Sets the controller for managing the UDFPS overlay.
    @EnforcePermission("USE_BIOMETRIC_INTERNAL")
    void setUdfpsOverlayController(in IUdfpsOverlayController controller);
+10 −0
Original line number Diff line number Diff line
@@ -994,6 +994,16 @@ public class AuthController implements
        return getUdfpsProps() != null && !getUdfpsProps().isEmpty();
    }

    /**
     * @return true if ultrasonic udfps HW is supported on this device. Can return true even if
     * the user has not enrolled udfps. This may be false if called before
     * onAllAuthenticatorsRegistered.
     */
    public boolean isUltrasonicUdfpsSupported() {
        return getUdfpsProps() != null && !getUdfpsProps().isEmpty() && getUdfpsProps()
                .get(0).isUltrasonicUdfps();
    }

    /**
     * @return true if sfps HW is supported on this device. Can return true even if the user has
     * not enrolled sfps. This may be false if called before onAllAuthenticatorsRegistered.
+10 −0
Original line number Diff line number Diff line
@@ -270,6 +270,7 @@ public class UdfpsController implements DozeReceiver, Dumpable {
        @Override
        public void showUdfpsOverlay(long requestId, int sensorId, int reason,
                @NonNull IUdfpsOverlayControllerCallback callback) {
            mUdfpsOverlayInteractor.setRequestId(requestId);
            mFgExecutor.execute(() -> UdfpsController.this.showUdfpsOverlay(
                    new UdfpsControllerOverlay(
                        mContext,
@@ -404,6 +405,15 @@ public class UdfpsController implements DozeReceiver, Dumpable {
                    handler::post,
                    authenticationCallback);
        }

        /**
         * Debug to run setIgnoreDisplayTouches
         */
        public void debugSetIgnoreDisplayTouches(boolean ignoreTouch) {
            final long requestId = (mOverlay != null) ? mOverlay.getRequestId() : 0L;
            UdfpsController.this.mFingerprintManager.setIgnoreDisplayTouches(
                    requestId, mSensorProps.sensorId, ignoreTouch);
        }
    }

    /**
Loading