Merge "Ensure negative latencies are not being reported"

This commit is contained in:
TreeHugger Robot
2020-02-11 00:35:37 +00:00
committed by Android (Google) Code Review

View File

@@ -124,7 +124,7 @@ public abstract class LoggableMonitor {
error,
vendorCode,
Utils.isDebugEnabled(context, targetUserId),
latency);
sanitizeLatency(latency));
}
protected final void logOnAuthenticated(Context context, boolean authenticated,
@@ -165,7 +165,7 @@ public abstract class LoggableMonitor {
statsClient(),
requireConfirmation,
authState,
latency,
sanitizeLatency(latency),
Utils.isDebugEnabled(context, targetUserId));
}
@@ -183,8 +183,16 @@ public abstract class LoggableMonitor {
FrameworkStatsLog.write(FrameworkStatsLog.BIOMETRIC_ENROLLED,
statsModality(),
targetUserId,
latency,
sanitizeLatency(latency),
enrollSuccessful);
}
private long sanitizeLatency(long latency) {
if (latency < 0) {
Slog.w(TAG, "found a negative latency : " + latency);
return -1;
}
return latency;
}
}