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

Commit c7a3bc5d authored by Joe Bolinger's avatar Joe Bolinger Committed by Automerger Merge Worker
Browse files

Merge "Do not show side fingerprint sensor overlay when used from settings."...

Merge "Do not show side fingerprint sensor overlay when used from settings." into sc-v2-dev am: b9c6536a am: 06844dd2

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16124814

Change-Id: I10a6c913c7ea1cc3aaa0231e794a2c3354176478
parents fc188fb7 06844dd2
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -38,13 +38,16 @@ public interface BiometricOverlayConstants {
    int REASON_AUTH_KEYGUARD = 4;
    /** Non-specific usage (from FingerprintManager). */
    int REASON_AUTH_OTHER = 5;
    /** Usage from Settings. */
    int REASON_AUTH_SETTINGS = 6;

    @IntDef({REASON_UNKNOWN,
            REASON_ENROLL_FIND_SENSOR,
            REASON_ENROLL_ENROLLING,
            REASON_AUTH_BP,
            REASON_AUTH_KEYGUARD,
            REASON_AUTH_OTHER})
            REASON_AUTH_OTHER,
            REASON_AUTH_SETTINGS})
    @Retention(RetentionPolicy.SOURCE)
    @interface ShowReason {}
}
+2 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.graphics.PorterDuffColorFilter
import android.graphics.Rect
import android.hardware.biometrics.BiometricOverlayConstants
import android.hardware.biometrics.BiometricOverlayConstants.REASON_AUTH_KEYGUARD
import android.hardware.biometrics.BiometricOverlayConstants.REASON_AUTH_SETTINGS
import android.hardware.display.DisplayManager
import android.hardware.fingerprint.FingerprintManager
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal
@@ -181,6 +182,7 @@ class SidefpsController @Inject constructor(
@BiometricOverlayConstants.ShowReason
private fun Int.isReasonToShow(): Boolean = when (this) {
    REASON_AUTH_KEYGUARD -> false
    REASON_AUTH_SETTINGS -> false
    else -> true
}

+11 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.systemui.biometrics

import android.graphics.Rect
import android.hardware.biometrics.BiometricOverlayConstants.REASON_AUTH_KEYGUARD
import android.hardware.biometrics.BiometricOverlayConstants.REASON_AUTH_SETTINGS
import android.hardware.biometrics.BiometricOverlayConstants.REASON_UNKNOWN
import android.hardware.biometrics.SensorProperties
import android.hardware.display.DisplayManager
@@ -182,7 +183,16 @@ class SidefpsControllerTest : SysuiTestCase() {

    @Test
    fun testIgnoredForKeyguard() {
        overlayController.show(SENSOR_ID, REASON_AUTH_KEYGUARD)
        testIgnoredFor(REASON_AUTH_KEYGUARD)
    }

    @Test
    fun testIgnoredForSettings() {
        testIgnoredFor(REASON_AUTH_SETTINGS)
    }

    private fun testIgnoredFor(reason: Int) {
        overlayController.show(SENSOR_ID, reason)
        executor.runAllReady()

        verify(windowManager, never()).addView(any(), any())
+6 −0
Original line number Diff line number Diff line
@@ -168,6 +168,10 @@ public abstract class AuthenticationClient<T> extends AcquisitionClient<T>
        return Utils.isKeyguard(getContext(), getOwnerString());
    }

    private boolean isSettings() {
        return Utils.isSettings(getContext(), getOwnerString());
    }

    @Override
    protected boolean isCryptoOperation() {
        return mOperationId != 0;
@@ -499,6 +503,8 @@ public abstract class AuthenticationClient<T> extends AcquisitionClient<T>
    protected int getShowOverlayReason() {
        if (isKeyguard()) {
            return BiometricOverlayConstants.REASON_AUTH_KEYGUARD;
        } else if (isSettings()) {
            return BiometricOverlayConstants.REASON_AUTH_SETTINGS;
        } else if (isBiometricPrompt()) {
            return BiometricOverlayConstants.REASON_AUTH_BP;
        } else {