Merge "Update operationContext with sessionInfo for Atom logs" into udc-d1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
bf9f55f058
@@ -150,6 +150,10 @@ public final class AuthSession implements IBinder.DeathRecipient {
|
|||||||
// Timestamp when hardware authentication occurred
|
// Timestamp when hardware authentication occurred
|
||||||
private long mAuthenticatedTimeMs;
|
private long mAuthenticatedTimeMs;
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
private final OperationContextExt mOperationContext;
|
||||||
|
|
||||||
|
|
||||||
AuthSession(@NonNull Context context,
|
AuthSession(@NonNull Context context,
|
||||||
@NonNull BiometricContext biometricContext,
|
@NonNull BiometricContext biometricContext,
|
||||||
@NonNull IStatusBarService statusBarService,
|
@NonNull IStatusBarService statusBarService,
|
||||||
@@ -215,6 +219,7 @@ public final class AuthSession implements IBinder.DeathRecipient {
|
|||||||
mFingerprintSensorProperties = fingerprintSensorProperties;
|
mFingerprintSensorProperties = fingerprintSensorProperties;
|
||||||
mCancelled = false;
|
mCancelled = false;
|
||||||
mBiometricFrameworkStatsLogger = logger;
|
mBiometricFrameworkStatsLogger = logger;
|
||||||
|
mOperationContext = new OperationContextExt(true /* isBP */);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
mClientReceiver.asBinder().linkToDeath(this, 0 /* flags */);
|
mClientReceiver.asBinder().linkToDeath(this, 0 /* flags */);
|
||||||
@@ -581,6 +586,8 @@ public final class AuthSession implements IBinder.DeathRecipient {
|
|||||||
} else {
|
} else {
|
||||||
Slog.d(TAG, "delaying fingerprint sensor start");
|
Slog.d(TAG, "delaying fingerprint sensor start");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mBiometricContext.updateContext(mOperationContext, isCrypto());
|
||||||
}
|
}
|
||||||
|
|
||||||
// call once anytime after onDialogAnimatedIn() to indicate it's appropriate to start the
|
// call once anytime after onDialogAnimatedIn() to indicate it's appropriate to start the
|
||||||
@@ -743,12 +750,12 @@ public final class AuthSession implements IBinder.DeathRecipient {
|
|||||||
+ ", Client: " + BiometricsProtoEnums.CLIENT_BIOMETRIC_PROMPT
|
+ ", Client: " + BiometricsProtoEnums.CLIENT_BIOMETRIC_PROMPT
|
||||||
+ ", RequireConfirmation: " + mPreAuthInfo.confirmationRequested
|
+ ", RequireConfirmation: " + mPreAuthInfo.confirmationRequested
|
||||||
+ ", State: " + FrameworkStatsLog.BIOMETRIC_AUTHENTICATED__STATE__CONFIRMED
|
+ ", State: " + FrameworkStatsLog.BIOMETRIC_AUTHENTICATED__STATE__CONFIRMED
|
||||||
+ ", Latency: " + latency);
|
+ ", Latency: " + latency
|
||||||
|
+ ", SessionId: " + mOperationContext.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
mBiometricFrameworkStatsLogger.authenticate(
|
mBiometricFrameworkStatsLogger.authenticate(
|
||||||
mBiometricContext.updateContext(new OperationContextExt(true /* isBP */),
|
mOperationContext,
|
||||||
isCrypto()),
|
|
||||||
statsModality(),
|
statsModality(),
|
||||||
BiometricsProtoEnums.ACTION_UNKNOWN,
|
BiometricsProtoEnums.ACTION_UNKNOWN,
|
||||||
BiometricsProtoEnums.CLIENT_BIOMETRIC_PROMPT,
|
BiometricsProtoEnums.CLIENT_BIOMETRIC_PROMPT,
|
||||||
@@ -780,13 +787,13 @@ public final class AuthSession implements IBinder.DeathRecipient {
|
|||||||
+ ", Client: " + BiometricsProtoEnums.CLIENT_BIOMETRIC_PROMPT
|
+ ", Client: " + BiometricsProtoEnums.CLIENT_BIOMETRIC_PROMPT
|
||||||
+ ", Reason: " + reason
|
+ ", Reason: " + reason
|
||||||
+ ", Error: " + error
|
+ ", Error: " + error
|
||||||
+ ", Latency: " + latency);
|
+ ", Latency: " + latency
|
||||||
|
+ ", SessionId: " + mOperationContext.getId());
|
||||||
}
|
}
|
||||||
// Auth canceled
|
// Auth canceled
|
||||||
if (error != 0) {
|
if (error != 0) {
|
||||||
mBiometricFrameworkStatsLogger.error(
|
mBiometricFrameworkStatsLogger.error(
|
||||||
mBiometricContext.updateContext(new OperationContextExt(true /* isBP */),
|
mOperationContext,
|
||||||
isCrypto()),
|
|
||||||
statsModality(),
|
statsModality(),
|
||||||
BiometricsProtoEnums.ACTION_AUTHENTICATE,
|
BiometricsProtoEnums.ACTION_AUTHENTICATE,
|
||||||
BiometricsProtoEnums.CLIENT_BIOMETRIC_PROMPT,
|
BiometricsProtoEnums.CLIENT_BIOMETRIC_PROMPT,
|
||||||
|
|||||||
@@ -351,6 +351,8 @@ public class AuthSessionTest {
|
|||||||
assertEquals(startFingerprintNow ? BiometricSensor.STATE_AUTHENTICATING
|
assertEquals(startFingerprintNow ? BiometricSensor.STATE_AUTHENTICATING
|
||||||
: BiometricSensor.STATE_COOKIE_RETURNED,
|
: BiometricSensor.STATE_COOKIE_RETURNED,
|
||||||
session.mPreAuthInfo.eligibleSensors.get(fingerprintSensorId).getSensorState());
|
session.mPreAuthInfo.eligibleSensors.get(fingerprintSensorId).getSensorState());
|
||||||
|
verify(mBiometricContext).updateContext((OperationContextExt) anyObject(),
|
||||||
|
eq(session.isCrypto()));
|
||||||
|
|
||||||
// start fingerprint sensor if it was delayed
|
// start fingerprint sensor if it was delayed
|
||||||
if (!startFingerprintNow) {
|
if (!startFingerprintNow) {
|
||||||
|
|||||||
Reference in New Issue
Block a user