Rename BiometricHalDeathReported to be futute-proof and extendable

Adds two more system health issues to the new atom

Fixes: 124110923

Test: Builds
Change-Id: I4a617363d1dcefe551124178d66114fa7d490153
This commit is contained in:
Kevin Chyn
2019-02-08 13:10:36 -08:00
parent a30095d965
commit e5a37fb477
5 changed files with 27 additions and 5 deletions

View File

@@ -214,7 +214,7 @@ message Atom {
SpeechDspStatReported speech_dsp_stat_reported = 145;
UsbContaminantReported usb_contaminant_reported = 146;
WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
BiometricHalDeathReported biometric_hal_death_reported = 148;
BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
BubbleUIChanged bubble_ui_changed = 149;
ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
@@ -3044,13 +3044,15 @@ message BiometricErrorOccurred {
}
/**
* Logs when a biometric HAL has crashed.
* Logs when a system health issue is detected.
* Logged from:
* frameworks/base/services/core/java/com/android/server/biometrics
*/
message BiometricHalDeathReported {
message BiometricSystemHealthIssueDetected {
// Biometric modality.
optional android.hardware.biometrics.ModalityEnum modality = 1;
// Type of issue detected.
optional android.hardware.biometrics.IssueEnum issue = 2;
}
message Notification {

View File

@@ -43,4 +43,16 @@ enum ActionEnum {
ACTION_AUTHENTICATE = 2;
ACTION_ENUMERATE = 3;
ACTION_REMOVE = 4;
}
enum IssueEnum {
ISSUE_UNKNOWN = 0;
// When a biometric HAL has crashed.
ISSUE_HAL_DEATH = 1;
// When Android Framework has a template that doesn't exist in the HAL. The framework
// is expected to remove its template to stay in sync with the HAL.
ISSUE_UNKNOWN_TEMPLATE_ENROLLED_FRAMEWORK = 2;
// When the HAL has a template that doesn't exist in Android Framework. The framework
// is expected to notify the HAL to remove this template to stay in sync with the framework.
ISSUE_UNKNOWN_TEMPLATE_ENROLLED_HAL = 3;
}

View File

@@ -624,7 +624,8 @@ public abstract class BiometricServiceBase extends SystemService
handleError(getHalDeviceId(), BiometricConstants.BIOMETRIC_ERROR_HW_UNAVAILABLE,
0 /*vendorCode */);
StatsLog.write(StatsLog.BIOMETRIC_HAL_DEATH_REPORTED, statsModality());
StatsLog.write(StatsLog.BIOMETRIC_SYSTEM_HEALTH_ISSUE_DETECTED, statsModality(),
BiometricsProtoEnums.ISSUE_HAL_DEATH);
}
protected ClientMonitor getCurrentClient() {

View File

@@ -28,7 +28,7 @@ import android.util.StatsLog;
public abstract class LoggableMonitor {
public static final String TAG = "BiometricStats";
public static final boolean DEBUG = true;
public static final boolean DEBUG = false;
private long mFirstAcquireTimeMs;
@@ -137,6 +137,8 @@ public abstract class LoggableMonitor {
+ ", RequireConfirmation: " + requireConfirmation
+ ", State: " + authState
+ ", Latency: " + latency);
} else {
Slog.v(TAG, "Authentication latency: " + latency);
}
StatsLog.write(StatsLog.BIOMETRIC_AUTHENTICATED,

View File

@@ -49,6 +49,7 @@ import android.os.SELinux;
import android.os.UserHandle;
import android.os.UserManager;
import android.util.Slog;
import android.util.StatsLog;
import android.util.proto.ProtoOutputStream;
import com.android.internal.annotations.GuardedBy;
@@ -553,6 +554,8 @@ public class FingerprintService extends BiometricServiceBase {
+ " " + f.getDeviceId());
FingerprintUtils.getInstance().removeBiometricForUser(getContext(),
getTargetUserId(), f.getBiometricId());
StatsLog.write(StatsLog.BIOMETRIC_SYSTEM_HEALTH_ISSUE_DETECTED,
BiometricsProtoEnums.ISSUE_UNKNOWN_TEMPLATE_ENROLLED_FRAMEWORK);
}
mEnrolledList.clear();
}
@@ -1002,6 +1005,8 @@ public class FingerprintService extends BiometricServiceBase {
mHalDeviceId, mToken, new ServiceListenerImpl(null), uf.f.getBiometricId(),
uf.f.getGroupId(), uf.userId, restricted, getContext().getOpPackageName());
removeInternal(client);
StatsLog.write(StatsLog.BIOMETRIC_SYSTEM_HEALTH_ISSUE_DETECTED, statsModality(),
BiometricsProtoEnums.ISSUE_UNKNOWN_TEMPLATE_ENROLLED_HAL);
} else {
clearEnumerateState();
}