Add metrics logging for critical fingerprintd errors
This adds logging when fingerprintd dies or invoked functions fail so we can track driver breakage: - failure to start fingerprintd (fingerprintd_openhal_error) - fingerprintd dies (fingerprintd_died) - call to authenticate/enroll/enumerate/remove fails Fixes bug 30896409 Change-Id: Ic53fcd551ba909ef141893796b33b52cd5e56395
This commit is contained in:
@@ -115,6 +115,7 @@ public abstract class AuthenticationClient extends ClientMonitor {
|
||||
final int result = daemon.authenticate(mOpId, getGroupId());
|
||||
if (result != 0) {
|
||||
Slog.w(TAG, "startAuthentication failed, result=" + result);
|
||||
MetricsLogger.histogram(getContext(), "fingeprintd_auth_start_error", result);
|
||||
onError(FingerprintManager.FINGERPRINT_ERROR_HW_UNAVAILABLE);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -88,6 +88,7 @@ public abstract class EnrollClient extends ClientMonitor {
|
||||
final int result = daemon.enroll(mCryptoToken, getGroupId(), timeout);
|
||||
if (result != 0) {
|
||||
Slog.w(TAG, "startEnroll failed, result=" + result);
|
||||
MetricsLogger.histogram(getContext(), "fingerprintd_enroll_start_error", result);
|
||||
onError(FingerprintManager.FINGERPRINT_ERROR_HW_UNAVAILABLE);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import android.hardware.fingerprint.IFingerprintServiceReceiver;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Slog;
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
|
||||
/**
|
||||
* A class to keep track of the enumeration state for a given client.
|
||||
@@ -43,6 +44,7 @@ public abstract class EnumerateClient extends ClientMonitor {
|
||||
if (result != 0) {
|
||||
Slog.w(TAG, "start enumerate for user " + getTargetUserId()
|
||||
+ " failed, result=" + result);
|
||||
MetricsLogger.histogram(getContext(), "fingerprintd_enum_start_error", result);
|
||||
onError(FingerprintManager.FINGERPRINT_ERROR_HW_UNAVAILABLE);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -194,6 +194,7 @@ public class FingerprintService extends SystemService implements IBinder.DeathRe
|
||||
@Override
|
||||
public void binderDied() {
|
||||
Slog.v(TAG, "fingerprintd died");
|
||||
MetricsLogger.count(mContext, "fingerprintd_died", 1);
|
||||
mDaemon = null;
|
||||
mCurrentUserId = UserHandle.USER_CURRENT;
|
||||
handleError(mHalDeviceId, FingerprintManager.FINGERPRINT_ERROR_HW_UNAVAILABLE);
|
||||
@@ -211,6 +212,7 @@ public class FingerprintService extends SystemService implements IBinder.DeathRe
|
||||
updateActiveGroup(ActivityManager.getCurrentUser(), null);
|
||||
} else {
|
||||
Slog.w(TAG, "Failed to open Fingerprint HAL!");
|
||||
MetricsLogger.count(mContext, "fingerprintd_openhal_error", 1);
|
||||
mDaemon = null;
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
|
||||
@@ -24,6 +24,7 @@ import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.os.UserHandle;
|
||||
import android.util.Slog;
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
|
||||
/**
|
||||
* A class to keep track of the remove state for a given client.
|
||||
@@ -46,6 +47,7 @@ public abstract class RemovalClient extends ClientMonitor {
|
||||
final int result = daemon.remove(mFingerId, getGroupId());
|
||||
if (result != 0) {
|
||||
Slog.w(TAG, "startRemove with id = " + mFingerId + " failed, result=" + result);
|
||||
MetricsLogger.histogram(getContext(), "fingerprintd_remove_start_error", result);
|
||||
onError(FingerprintManager.FINGERPRINT_ERROR_HW_UNAVAILABLE);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user