Loading core/java/android/hardware/face/FaceSensorPropertiesInternal.java +1 −2 Original line number Diff line number Diff line Loading @@ -96,7 +96,6 @@ public class FaceSensorPropertiesInternal extends SensorPropertiesInternal { @Override public String toString() { return "ID: " + sensorId + ", Strength: " + sensorStrength + ", Type: " + sensorType + ", SupportsFaceDetection: " + supportsFaceDetection; return "ID: " + sensorId + ", Strength: " + sensorStrength + ", Type: " + sensorType; } } packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +2 −8 Original line number Diff line number Diff line Loading @@ -2137,14 +2137,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab // Scan even when encrypted or timeout to show a preemptive bouncer when bypassing. // Lock-down mode shouldn't scan, since it is more explicit. boolean strongAuthAllowsScanning = (!isEncryptedOrTimedOut || canBypass && !mBouncer); // If the device supports face detection (without authentication), allow it to happen // if the device is in lockdown mode. Otherwise, prevent scanning. boolean supportsDetectOnly = mFaceSensorProperties.get(0).supportsFaceDetection; if (isLockDown && !supportsDetectOnly) { strongAuthAllowsScanning = false; } boolean strongAuthAllowsScanning = (!isEncryptedOrTimedOut || canBypass && !mBouncer) && !isLockDown; // Only listen if this KeyguardUpdateMonitor belongs to the primary user. There is an // instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware. Loading services/core/java/com/android/server/biometrics/BiometricSensor.java +3 −15 Original line number Diff line number Diff line Loading @@ -19,13 +19,10 @@ package com.android.server.biometrics; import static android.hardware.biometrics.BiometricManager.Authenticators; import android.annotation.IntDef; import android.annotation.NonNull; import android.content.Context; import android.hardware.biometrics.BiometricConstants; import android.hardware.biometrics.BiometricManager; import android.hardware.biometrics.IBiometricAuthenticator; import android.hardware.biometrics.IBiometricSensorReceiver; import android.hardware.biometrics.SensorPropertiesInternal; import android.os.IBinder; import android.os.RemoteException; import android.util.Slog; Loading Loading @@ -65,7 +62,6 @@ public abstract class BiometricSensor { @Retention(RetentionPolicy.SOURCE) @interface SensorState {} @NonNull private final Context mContext; public final int id; public final @Authenticators.Types int oemStrength; // strength as configured by the OEM public final int modality; Loading @@ -88,9 +84,8 @@ public abstract class BiometricSensor { */ abstract boolean confirmationSupported(); BiometricSensor(@NonNull Context context, int id, int modality, @Authenticators.Types int strength, IBiometricAuthenticator impl) { this.mContext = context; BiometricSensor(int id, int modality, @Authenticators.Types int strength, IBiometricAuthenticator impl) { this.id = id; this.modality = modality; this.oemStrength = strength; Loading Loading @@ -174,19 +169,12 @@ public abstract class BiometricSensor { @Override public String toString() { SensorPropertiesInternal properties = null; try { properties = impl.getSensorProperties(mContext.getOpPackageName()); } catch (RemoteException e) { Slog.e(TAG, "Remote exception", e); } return "ID(" + id + ")" + ", oemStrength: " + oemStrength + ", updatedStrength: " + mUpdatedStrength + ", modality " + modality + ", state: " + mSensorState + ", cookie: " + mCookie + ", props: " + properties; + ", authenticator: " + impl; } } services/core/java/com/android/server/biometrics/BiometricService.java +8 −3 Original line number Diff line number Diff line Loading @@ -725,7 +725,7 @@ public class BiometricService extends SystemService { } } mSensors.add(new BiometricSensor(getContext(), id, modality, strength, authenticator) { mSensors.add(new BiometricSensor(id, modality, strength, authenticator) { @Override boolean confirmationAlwaysRequired(int userId) { return mSettingObserver.getConfirmationAlwaysRequired(modality, userId); Loading Loading @@ -1351,8 +1351,13 @@ public class BiometricService extends SystemService { for (BiometricSensor sensor : mSensors) { pw.println(" " + sensor); } pw.println(); pw.println("CurrentSession: " + mCurrentAuthSession); pw.println(); final List<FingerprintSensorPropertiesInternal> fpProps = mInjector.getFingerprintSensorProperties(getContext()); pw.println("FingerprintSensorProperties: " + fpProps.size()); for (FingerprintSensorPropertiesInternal prop : fpProps) { pw.println(" " + prop); } } } services/core/java/com/android/server/biometrics/sensors/BiometricScheduler.java +8 −14 Original line number Diff line number Diff line Loading @@ -559,21 +559,22 @@ public class BiometricScheduler { } /** * Requests to cancel authentication or detection. * Requests to cancel authentication. * @param token from the caller, should match the token passed in when requesting authentication */ public void cancelAuthenticationOrDetection(IBinder token) { public void cancelAuthentication(IBinder token) { if (mCurrentOperation == null) { Slog.e(getTag(), "Unable to cancel authentication, null operation"); return; } final boolean isCorrectClient = isAuthenticationOrDetectionOperation(mCurrentOperation); final boolean isAuthenticating = mCurrentOperation.mClientMonitor instanceof AuthenticationConsumer; final boolean tokenMatches = mCurrentOperation.mClientMonitor.getToken() == token; if (isCorrectClient && tokenMatches) { Slog.d(getTag(), "Cancelling: " + mCurrentOperation); if (isAuthenticating && tokenMatches) { Slog.d(getTag(), "Cancelling authentication: " + mCurrentOperation); cancelInternal(mCurrentOperation); } else if (!isCorrectClient) { } else if (!isAuthenticating) { // Look through the current queue for all authentication clients for the specified // token, and mark them as STATE_WAITING_IN_QUEUE_CANCELING. Note that we're marking // all of them, instead of just the first one, since the API surface currently doesn't Loading @@ -581,7 +582,7 @@ public class BiometricScheduler { // process. However, this generally does not happen anyway, and would be a class of // bugs on its own. for (Operation operation : mPendingOperations) { if (isAuthenticationOrDetectionOperation(operation) if (operation.mClientMonitor instanceof AuthenticationConsumer && operation.mClientMonitor.getToken() == token) { Slog.d(getTag(), "Marking " + operation + " as STATE_WAITING_IN_QUEUE_CANCELING"); Loading @@ -591,13 +592,6 @@ public class BiometricScheduler { } } private boolean isAuthenticationOrDetectionOperation(@NonNull Operation operation) { final boolean isAuthentication = operation.mClientMonitor instanceof AuthenticationConsumer; final boolean isDetection = operation.mClientMonitor instanceof DetectionConsumer; return isAuthentication || isDetection; } /** * @return the current operation */ Loading Loading
core/java/android/hardware/face/FaceSensorPropertiesInternal.java +1 −2 Original line number Diff line number Diff line Loading @@ -96,7 +96,6 @@ public class FaceSensorPropertiesInternal extends SensorPropertiesInternal { @Override public String toString() { return "ID: " + sensorId + ", Strength: " + sensorStrength + ", Type: " + sensorType + ", SupportsFaceDetection: " + supportsFaceDetection; return "ID: " + sensorId + ", Strength: " + sensorStrength + ", Type: " + sensorType; } }
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +2 −8 Original line number Diff line number Diff line Loading @@ -2137,14 +2137,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab // Scan even when encrypted or timeout to show a preemptive bouncer when bypassing. // Lock-down mode shouldn't scan, since it is more explicit. boolean strongAuthAllowsScanning = (!isEncryptedOrTimedOut || canBypass && !mBouncer); // If the device supports face detection (without authentication), allow it to happen // if the device is in lockdown mode. Otherwise, prevent scanning. boolean supportsDetectOnly = mFaceSensorProperties.get(0).supportsFaceDetection; if (isLockDown && !supportsDetectOnly) { strongAuthAllowsScanning = false; } boolean strongAuthAllowsScanning = (!isEncryptedOrTimedOut || canBypass && !mBouncer) && !isLockDown; // Only listen if this KeyguardUpdateMonitor belongs to the primary user. There is an // instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware. Loading
services/core/java/com/android/server/biometrics/BiometricSensor.java +3 −15 Original line number Diff line number Diff line Loading @@ -19,13 +19,10 @@ package com.android.server.biometrics; import static android.hardware.biometrics.BiometricManager.Authenticators; import android.annotation.IntDef; import android.annotation.NonNull; import android.content.Context; import android.hardware.biometrics.BiometricConstants; import android.hardware.biometrics.BiometricManager; import android.hardware.biometrics.IBiometricAuthenticator; import android.hardware.biometrics.IBiometricSensorReceiver; import android.hardware.biometrics.SensorPropertiesInternal; import android.os.IBinder; import android.os.RemoteException; import android.util.Slog; Loading Loading @@ -65,7 +62,6 @@ public abstract class BiometricSensor { @Retention(RetentionPolicy.SOURCE) @interface SensorState {} @NonNull private final Context mContext; public final int id; public final @Authenticators.Types int oemStrength; // strength as configured by the OEM public final int modality; Loading @@ -88,9 +84,8 @@ public abstract class BiometricSensor { */ abstract boolean confirmationSupported(); BiometricSensor(@NonNull Context context, int id, int modality, @Authenticators.Types int strength, IBiometricAuthenticator impl) { this.mContext = context; BiometricSensor(int id, int modality, @Authenticators.Types int strength, IBiometricAuthenticator impl) { this.id = id; this.modality = modality; this.oemStrength = strength; Loading Loading @@ -174,19 +169,12 @@ public abstract class BiometricSensor { @Override public String toString() { SensorPropertiesInternal properties = null; try { properties = impl.getSensorProperties(mContext.getOpPackageName()); } catch (RemoteException e) { Slog.e(TAG, "Remote exception", e); } return "ID(" + id + ")" + ", oemStrength: " + oemStrength + ", updatedStrength: " + mUpdatedStrength + ", modality " + modality + ", state: " + mSensorState + ", cookie: " + mCookie + ", props: " + properties; + ", authenticator: " + impl; } }
services/core/java/com/android/server/biometrics/BiometricService.java +8 −3 Original line number Diff line number Diff line Loading @@ -725,7 +725,7 @@ public class BiometricService extends SystemService { } } mSensors.add(new BiometricSensor(getContext(), id, modality, strength, authenticator) { mSensors.add(new BiometricSensor(id, modality, strength, authenticator) { @Override boolean confirmationAlwaysRequired(int userId) { return mSettingObserver.getConfirmationAlwaysRequired(modality, userId); Loading Loading @@ -1351,8 +1351,13 @@ public class BiometricService extends SystemService { for (BiometricSensor sensor : mSensors) { pw.println(" " + sensor); } pw.println(); pw.println("CurrentSession: " + mCurrentAuthSession); pw.println(); final List<FingerprintSensorPropertiesInternal> fpProps = mInjector.getFingerprintSensorProperties(getContext()); pw.println("FingerprintSensorProperties: " + fpProps.size()); for (FingerprintSensorPropertiesInternal prop : fpProps) { pw.println(" " + prop); } } }
services/core/java/com/android/server/biometrics/sensors/BiometricScheduler.java +8 −14 Original line number Diff line number Diff line Loading @@ -559,21 +559,22 @@ public class BiometricScheduler { } /** * Requests to cancel authentication or detection. * Requests to cancel authentication. * @param token from the caller, should match the token passed in when requesting authentication */ public void cancelAuthenticationOrDetection(IBinder token) { public void cancelAuthentication(IBinder token) { if (mCurrentOperation == null) { Slog.e(getTag(), "Unable to cancel authentication, null operation"); return; } final boolean isCorrectClient = isAuthenticationOrDetectionOperation(mCurrentOperation); final boolean isAuthenticating = mCurrentOperation.mClientMonitor instanceof AuthenticationConsumer; final boolean tokenMatches = mCurrentOperation.mClientMonitor.getToken() == token; if (isCorrectClient && tokenMatches) { Slog.d(getTag(), "Cancelling: " + mCurrentOperation); if (isAuthenticating && tokenMatches) { Slog.d(getTag(), "Cancelling authentication: " + mCurrentOperation); cancelInternal(mCurrentOperation); } else if (!isCorrectClient) { } else if (!isAuthenticating) { // Look through the current queue for all authentication clients for the specified // token, and mark them as STATE_WAITING_IN_QUEUE_CANCELING. Note that we're marking // all of them, instead of just the first one, since the API surface currently doesn't Loading @@ -581,7 +582,7 @@ public class BiometricScheduler { // process. However, this generally does not happen anyway, and would be a class of // bugs on its own. for (Operation operation : mPendingOperations) { if (isAuthenticationOrDetectionOperation(operation) if (operation.mClientMonitor instanceof AuthenticationConsumer && operation.mClientMonitor.getToken() == token) { Slog.d(getTag(), "Marking " + operation + " as STATE_WAITING_IN_QUEUE_CANCELING"); Loading @@ -591,13 +592,6 @@ public class BiometricScheduler { } } private boolean isAuthenticationOrDetectionOperation(@NonNull Operation operation) { final boolean isAuthentication = operation.mClientMonitor instanceof AuthenticationConsumer; final boolean isDetection = operation.mClientMonitor instanceof DetectionConsumer; return isAuthentication || isDetection; } /** * @return the current operation */ Loading