Loading core/java/android/hardware/biometrics/BiometricTestSession.java +6 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.TestApi; import android.content.Context; import android.hardware.fingerprint.FingerprintManager; import android.os.RemoteException; import android.util.ArraySet; import android.util.Log; Loading Loading @@ -248,6 +247,12 @@ public class BiometricTestSession implements AutoCloseable { } } if (!mUsersCleaningUp.isEmpty()) { // TODO(b/186600837): this seems common on multi sensor devices Log.e(getTag(), "Cleanup not finished before shutdown - pending: " + mUsersCleaningUp.size()); } // Disable the test HAL after the sensor becomes idle. setTestHalEnabled(false); } Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java +28 −14 Original line number Diff line number Diff line Loading @@ -481,14 +481,24 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, */ @Override public void onBiometricAuthenticated() { if (DEBUG) Log.d(TAG, "onBiometricAuthenticated: "); if (mCurrentDialog != null) { mCurrentDialog.onAuthenticationSucceeded(); } else { Log.w(TAG, "onBiometricAuthenticated callback but dialog gone"); } } @Override public void onBiometricHelp(String message) { if (DEBUG) Log.d(TAG, "onBiometricHelp: " + message); if (mCurrentDialog != null) { mCurrentDialog.onHelp(message); } else { Log.w(TAG, "onBiometricHelp callback but dialog gone"); } } @Nullable Loading Loading @@ -527,6 +537,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, final boolean isSoftError = (error == BiometricConstants.BIOMETRIC_PAUSED_REJECTED || error == BiometricConstants.BIOMETRIC_ERROR_TIMEOUT); if (mCurrentDialog != null) { if (mCurrentDialog.isAllowDeviceCredentials() && isLockout) { if (DEBUG) Log.d(TAG, "onBiometricError, lockout"); mCurrentDialog.animateToCredentialUI(); Loading @@ -541,6 +552,9 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, if (DEBUG) Log.d(TAG, "onBiometricError, hard error: " + errorMessage); mCurrentDialog.onError(errorMessage); } } else { Log.w(TAG, "onBiometricError callback but dialog is gone"); } onCancelUdfps(); } Loading services/core/java/com/android/server/biometrics/BiometricStrengthController.java +22 −13 Original line number Diff line number Diff line Loading @@ -48,17 +48,10 @@ public class BiometricStrengthController { */ private static final String KEY_BIOMETRIC_STRENGTHS = "biometric_strengths"; /** * Default (no-op) value of the flag KEY_BIOMETRIC_STRENGTHS */ public static final String DEFAULT_BIOMETRIC_STRENGTHS = null; private DeviceConfig.OnPropertiesChangedListener mDeviceConfigListener = properties -> { for (String name : properties.getKeyset()) { if (KEY_BIOMETRIC_STRENGTHS.equals(name)) { if (properties.getKeyset().contains(KEY_BIOMETRIC_STRENGTHS)) { updateStrengths(); } } }; public BiometricStrengthController(@NonNull BiometricService service) { Loading @@ -75,7 +68,17 @@ public class BiometricStrengthController { * has been changed. */ public void updateStrengths() { final Map<Integer, Integer> idToStrength = getIdToStrengthMap(); final String newValue = DeviceConfig.getString(DeviceConfig.NAMESPACE_BIOMETRICS, KEY_BIOMETRIC_STRENGTHS, "null"); if ("null".equals(newValue) || newValue.isEmpty()) { revertStrengths(); } else { updateStrengths(newValue); } } private void updateStrengths(String flags) { final Map<Integer, Integer> idToStrength = getIdToStrengthMap(flags); if (idToStrength == null) { return; } Loading @@ -91,12 +94,18 @@ public class BiometricStrengthController { } } private void revertStrengths() { for (BiometricSensor sensor : mService.mSensors) { Slog.d(TAG, "updateStrengths: revert sensorId=" + sensor.id + " to oemStrength=" + sensor.oemStrength); sensor.updateStrength(sensor.oemStrength); } } /** * @return a map of <ID, Strength> */ private Map<Integer, Integer> getIdToStrengthMap() { final String flags = DeviceConfig.getString(DeviceConfig.NAMESPACE_BIOMETRICS, KEY_BIOMETRIC_STRENGTHS, DEFAULT_BIOMETRIC_STRENGTHS); private static Map<Integer, Integer> getIdToStrengthMap(String flags) { if (flags == null || flags.isEmpty()) { Slog.d(TAG, "Flags are null or empty"); return null; Loading services/core/java/com/android/server/biometrics/sensors/BaseClientMonitor.java +14 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,20 @@ public abstract class BaseClientMonitor extends LoggableMonitor private final int mCookie; boolean mAlreadyDone; @NonNull protected Callback mCallback; // Use an empty callback by default since delayed operations can receive events // before they are started and cause NPE in subclasses that access this field directly. @NonNull protected Callback mCallback = new Callback() { @Override public void onClientStarted(@NonNull BaseClientMonitor clientMonitor) { Slog.e(TAG, "mCallback onClientStarted: called before set (should not happen)"); } @Override public void onClientFinished(@NonNull BaseClientMonitor clientMonitor, boolean success) { Slog.e(TAG, "mCallback onClientFinished: called before set (should not happen)"); } }; /** * @return A ClientMonitorEnum constant defined in biometrics.proto Loading Loading
core/java/android/hardware/biometrics/BiometricTestSession.java +6 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.TestApi; import android.content.Context; import android.hardware.fingerprint.FingerprintManager; import android.os.RemoteException; import android.util.ArraySet; import android.util.Log; Loading Loading @@ -248,6 +247,12 @@ public class BiometricTestSession implements AutoCloseable { } } if (!mUsersCleaningUp.isEmpty()) { // TODO(b/186600837): this seems common on multi sensor devices Log.e(getTag(), "Cleanup not finished before shutdown - pending: " + mUsersCleaningUp.size()); } // Disable the test HAL after the sensor becomes idle. setTestHalEnabled(false); } Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java +28 −14 Original line number Diff line number Diff line Loading @@ -481,14 +481,24 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, */ @Override public void onBiometricAuthenticated() { if (DEBUG) Log.d(TAG, "onBiometricAuthenticated: "); if (mCurrentDialog != null) { mCurrentDialog.onAuthenticationSucceeded(); } else { Log.w(TAG, "onBiometricAuthenticated callback but dialog gone"); } } @Override public void onBiometricHelp(String message) { if (DEBUG) Log.d(TAG, "onBiometricHelp: " + message); if (mCurrentDialog != null) { mCurrentDialog.onHelp(message); } else { Log.w(TAG, "onBiometricHelp callback but dialog gone"); } } @Nullable Loading Loading @@ -527,6 +537,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, final boolean isSoftError = (error == BiometricConstants.BIOMETRIC_PAUSED_REJECTED || error == BiometricConstants.BIOMETRIC_ERROR_TIMEOUT); if (mCurrentDialog != null) { if (mCurrentDialog.isAllowDeviceCredentials() && isLockout) { if (DEBUG) Log.d(TAG, "onBiometricError, lockout"); mCurrentDialog.animateToCredentialUI(); Loading @@ -541,6 +552,9 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, if (DEBUG) Log.d(TAG, "onBiometricError, hard error: " + errorMessage); mCurrentDialog.onError(errorMessage); } } else { Log.w(TAG, "onBiometricError callback but dialog is gone"); } onCancelUdfps(); } Loading
services/core/java/com/android/server/biometrics/BiometricStrengthController.java +22 −13 Original line number Diff line number Diff line Loading @@ -48,17 +48,10 @@ public class BiometricStrengthController { */ private static final String KEY_BIOMETRIC_STRENGTHS = "biometric_strengths"; /** * Default (no-op) value of the flag KEY_BIOMETRIC_STRENGTHS */ public static final String DEFAULT_BIOMETRIC_STRENGTHS = null; private DeviceConfig.OnPropertiesChangedListener mDeviceConfigListener = properties -> { for (String name : properties.getKeyset()) { if (KEY_BIOMETRIC_STRENGTHS.equals(name)) { if (properties.getKeyset().contains(KEY_BIOMETRIC_STRENGTHS)) { updateStrengths(); } } }; public BiometricStrengthController(@NonNull BiometricService service) { Loading @@ -75,7 +68,17 @@ public class BiometricStrengthController { * has been changed. */ public void updateStrengths() { final Map<Integer, Integer> idToStrength = getIdToStrengthMap(); final String newValue = DeviceConfig.getString(DeviceConfig.NAMESPACE_BIOMETRICS, KEY_BIOMETRIC_STRENGTHS, "null"); if ("null".equals(newValue) || newValue.isEmpty()) { revertStrengths(); } else { updateStrengths(newValue); } } private void updateStrengths(String flags) { final Map<Integer, Integer> idToStrength = getIdToStrengthMap(flags); if (idToStrength == null) { return; } Loading @@ -91,12 +94,18 @@ public class BiometricStrengthController { } } private void revertStrengths() { for (BiometricSensor sensor : mService.mSensors) { Slog.d(TAG, "updateStrengths: revert sensorId=" + sensor.id + " to oemStrength=" + sensor.oemStrength); sensor.updateStrength(sensor.oemStrength); } } /** * @return a map of <ID, Strength> */ private Map<Integer, Integer> getIdToStrengthMap() { final String flags = DeviceConfig.getString(DeviceConfig.NAMESPACE_BIOMETRICS, KEY_BIOMETRIC_STRENGTHS, DEFAULT_BIOMETRIC_STRENGTHS); private static Map<Integer, Integer> getIdToStrengthMap(String flags) { if (flags == null || flags.isEmpty()) { Slog.d(TAG, "Flags are null or empty"); return null; Loading
services/core/java/com/android/server/biometrics/sensors/BaseClientMonitor.java +14 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,20 @@ public abstract class BaseClientMonitor extends LoggableMonitor private final int mCookie; boolean mAlreadyDone; @NonNull protected Callback mCallback; // Use an empty callback by default since delayed operations can receive events // before they are started and cause NPE in subclasses that access this field directly. @NonNull protected Callback mCallback = new Callback() { @Override public void onClientStarted(@NonNull BaseClientMonitor clientMonitor) { Slog.e(TAG, "mCallback onClientStarted: called before set (should not happen)"); } @Override public void onClientFinished(@NonNull BaseClientMonitor clientMonitor, boolean success) { Slog.e(TAG, "mCallback onClientFinished: called before set (should not happen)"); } }; /** * @return A ClientMonitorEnum constant defined in biometrics.proto Loading