Merge "Revert "Do not show side fingerprint sensor overlay when used from settings."" into sc-v2-dev

This commit is contained in:
Lucas Dupin
2021-10-29 22:18:20 +00:00
committed by Android (Google) Code Review
4 changed files with 2 additions and 23 deletions

View File

@@ -38,16 +38,13 @@ public interface BiometricOverlayConstants {
int REASON_AUTH_KEYGUARD = 4; int REASON_AUTH_KEYGUARD = 4;
/** Non-specific usage (from FingerprintManager). */ /** Non-specific usage (from FingerprintManager). */
int REASON_AUTH_OTHER = 5; int REASON_AUTH_OTHER = 5;
/** Usage from Settings. */
int REASON_AUTH_SETTINGS = 6;
@IntDef({REASON_UNKNOWN, @IntDef({REASON_UNKNOWN,
REASON_ENROLL_FIND_SENSOR, REASON_ENROLL_FIND_SENSOR,
REASON_ENROLL_ENROLLING, REASON_ENROLL_ENROLLING,
REASON_AUTH_BP, REASON_AUTH_BP,
REASON_AUTH_KEYGUARD, REASON_AUTH_KEYGUARD,
REASON_AUTH_OTHER, REASON_AUTH_OTHER})
REASON_AUTH_SETTINGS})
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@interface ShowReason {} @interface ShowReason {}
} }

View File

@@ -22,7 +22,6 @@ import android.graphics.PorterDuffColorFilter
import android.graphics.Rect import android.graphics.Rect
import android.hardware.biometrics.BiometricOverlayConstants import android.hardware.biometrics.BiometricOverlayConstants
import android.hardware.biometrics.BiometricOverlayConstants.REASON_AUTH_KEYGUARD import android.hardware.biometrics.BiometricOverlayConstants.REASON_AUTH_KEYGUARD
import android.hardware.biometrics.BiometricOverlayConstants.REASON_AUTH_SETTINGS
import android.hardware.display.DisplayManager import android.hardware.display.DisplayManager
import android.hardware.fingerprint.FingerprintManager import android.hardware.fingerprint.FingerprintManager
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal import android.hardware.fingerprint.FingerprintSensorPropertiesInternal
@@ -182,7 +181,6 @@ class SidefpsController @Inject constructor(
@BiometricOverlayConstants.ShowReason @BiometricOverlayConstants.ShowReason
private fun Int.isReasonToShow(): Boolean = when (this) { private fun Int.isReasonToShow(): Boolean = when (this) {
REASON_AUTH_KEYGUARD -> false REASON_AUTH_KEYGUARD -> false
REASON_AUTH_SETTINGS -> false
else -> true else -> true
} }

View File

@@ -18,7 +18,6 @@ package com.android.systemui.biometrics
import android.graphics.Rect import android.graphics.Rect
import android.hardware.biometrics.BiometricOverlayConstants.REASON_AUTH_KEYGUARD 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.BiometricOverlayConstants.REASON_UNKNOWN
import android.hardware.biometrics.SensorProperties import android.hardware.biometrics.SensorProperties
import android.hardware.display.DisplayManager import android.hardware.display.DisplayManager
@@ -183,16 +182,7 @@ class SidefpsControllerTest : SysuiTestCase() {
@Test @Test
fun testIgnoredForKeyguard() { fun testIgnoredForKeyguard() {
testIgnoredFor(REASON_AUTH_KEYGUARD) overlayController.show(SENSOR_ID, REASON_AUTH_KEYGUARD)
}
@Test
fun testIgnoredForSettings() {
testIgnoredFor(REASON_AUTH_SETTINGS)
}
private fun testIgnoredFor(reason: Int) {
overlayController.show(SENSOR_ID, reason)
executor.runAllReady() executor.runAllReady()
verify(windowManager, never()).addView(any(), any()) verify(windowManager, never()).addView(any(), any())

View File

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