Added user ID to AuthenticationEvent
Test: Authenticated with work and user profiles and
verified that adb shell dumpsys now prints the user ID.
Fixes: 148103419
Change-Id: Idc9b9ac3d99b1cee939027fdd396ad787be97e14
diff --git a/services/core/java/com/android/server/biometrics/face/FaceService.java b/services/core/java/com/android/server/biometrics/face/FaceService.java
index a0c8e23..a0573db 100644
--- a/services/core/java/com/android/server/biometrics/face/FaceService.java
+++ b/services/core/java/com/android/server/biometrics/face/FaceService.java
@@ -118,14 +118,16 @@
private int mError;
// Only valid if mError is ERROR_VENDOR
private int mVendorError;
+ private int mUser;
AuthenticationEvent(long startTime, long latency, boolean authenticated, int error,
- int vendorError) {
+ int vendorError, int user) {
mStartTime = startTime;
mLatency = latency;
mAuthenticated = authenticated;
mError = error;
mVendorError = vendorError;
+ mUser = user;
}
public String toString(Context context) {
@@ -134,6 +136,7 @@
+ "\tAuthenticated: " + mAuthenticated
+ "\tError: " + mError
+ "\tVendorCode: " + mVendorError
+ + "\tUser: " + mUser
+ "\t" + FaceManager.getErrorString(context, mError, mVendorError);
}
}
@@ -242,7 +245,8 @@
System.currentTimeMillis() - getStartTimeMs() /* latency */,
authenticated,
0 /* error */,
- 0 /* vendorError */));
+ 0 /* vendorError */,
+ getTargetUserId()));
// For face, the authentication lifecycle ends either when
// 1) Authenticated == true
@@ -260,7 +264,8 @@
System.currentTimeMillis() - getStartTimeMs() /* latency */,
false /* authenticated */,
error,
- vendorCode));
+ vendorCode,
+ getTargetUserId()));
return super.onError(deviceId, error, vendorCode);
}