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

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

Refactor UDFPS display logic and remove illumination

Bug: 243818429
Test: atest SystemUITests
Change-Id: I285f136a75bbd26226a39c544f3c07101ff8eb80
parent 54500c61
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -315,17 +315,17 @@ public interface BiometricFingerprintConstants {
    int FINGERPRINT_ACQUIRED_VENDOR_BASE = 1000;

    /**
     * Whether the FingerprintAcquired message is a signal to turn off HBM
     * Whether the FingerprintAcquired message is a signal to disable the UDFPS display mode.
     * We want to disable the UDFPS mode as soon as possible to conserve power and provide better
     * UX. For example, prolonged high-brightness illumination of optical sensors can be unpleasant
     * to the user, can cause long term display burn-in, and can drain the battery faster.
     */
    static boolean shouldTurnOffHbm(@FingerprintAcquired int acquiredInfo) {
    static boolean shouldDisableUdfpsDisplayMode(@FingerprintAcquired int acquiredInfo) {
        switch (acquiredInfo) {
            case FINGERPRINT_ACQUIRED_START:
                // Authentication just began
                // Keep the UDFPS mode because the authentication just began.
                return false;
            case FINGERPRINT_ACQUIRED_GOOD:
                // Good image captured. Turn off HBM. Success/Reject comes after, which is when
                // hideUdfpsOverlay will be called.
                return true;
            case FINGERPRINT_ACQUIRED_PARTIAL:
            case FINGERPRINT_ACQUIRED_INSUFFICIENT:
            case FINGERPRINT_ACQUIRED_IMAGER_DIRTY:
@@ -334,11 +334,12 @@ public interface BiometricFingerprintConstants {
            case FINGERPRINT_ACQUIRED_IMMOBILE:
            case FINGERPRINT_ACQUIRED_TOO_BRIGHT:
            case FINGERPRINT_ACQUIRED_VENDOR:
                // Bad image captured. Turn off HBM. Matcher will not run, so there's no need to
                // keep HBM on.
                // Disable the UDFPS mode because the image capture has finished. The overlay
                // can be hidden later, once the authentication result arrives.
                return true;
            case FINGERPRINT_ACQUIRED_UNKNOWN:
            default:
                // Keep the UDFPS mode in case of an unknown message.
                return false;
        }
    }
+0 −3
Original line number Diff line number Diff line
@@ -4850,9 +4850,6 @@
        -->
    </array>

    <!-- How long it takes for the HW to start illuminating after the illumination is requested. -->
    <integer name="config_udfps_illumination_transition_ms">50</integer>

    <!-- Indicates whether device has a power button fingerprint sensor. -->
    <bool name="config_is_powerbutton_fps" translatable="false" >false</bool>

+0 −1
Original line number Diff line number Diff line
@@ -2705,7 +2705,6 @@
  <java-symbol type="bool" name="allow_test_udfps" />
  <java-symbol type="array" name="config_udfps_sensor_props" />
  <java-symbol type="array" name="config_sfps_sensor_props" />
  <java-symbol type="integer" name="config_udfps_illumination_transition_ms" />
  <java-symbol type="bool" name="config_is_powerbutton_fps" />
  <java-symbol type="array" name="config_udfps_enroll_stage_thresholds" />
  <java-symbol type="array" name="config_sfps_enroll_stage_thresholds" />
+0 −1
Original line number Diff line number Diff line
@@ -287,7 +287,6 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba
                }
            });
            mUdfpsController.setAuthControllerUpdateUdfpsLocation(this::updateUdfpsLocation);
            mUdfpsController.setHalControlsIllumination(mUdfpsProps.get(0).halControlsIllumination);
            mUdfpsBounds = mUdfpsProps.get(0).getLocation().getRect();
        }

+1 −1
Original line number Diff line number Diff line
@@ -264,7 +264,7 @@ class AuthRippleController @Inject constructor(
            acquireInfo: Int
        ) {
            if (biometricSourceType == BiometricSourceType.FINGERPRINT &&
                    BiometricFingerprintConstants.shouldTurnOffHbm(acquireInfo) &&
                    BiometricFingerprintConstants.shouldDisableUdfpsDisplayMode(acquireInfo) &&
                    acquireInfo != BiometricFingerprintConstants.FINGERPRINT_ACQUIRED_GOOD) {
                // received an 'acquiredBad' message, so immediately retract
                mView.retractDwellRipple()
Loading