Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9ba99918 authored by Kevin Chyn's avatar Kevin Chyn
Browse files

Log HAL death count

Fixes: 122974105

Test: kill fingerprint hal
      adb shell dumpsys fingerprint

Change-Id: Id4c4b87f80bbca94c837b0f39b5422ab94504b25
parent c51b2c60
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -116,6 +116,7 @@ public abstract class BiometricServiceBase extends SystemService
    protected HashMap<Integer, PerformanceStats> mPerformanceMap = new HashMap<>();
    // Transactions that make use of CryptoObjects are tracked by mCryptoPerformaceMap.
    protected HashMap<Integer, PerformanceStats> mCryptoPerformanceMap = new HashMap<>();
    protected int mHALDeathCount;

    protected class PerformanceStats {
        public int accept; // number of accepted biometrics
@@ -596,6 +597,7 @@ public abstract class BiometricServiceBase extends SystemService
    public void serviceDied(long cookie) {
        Slog.e(getTag(), "HAL died");
        mMetricsLogger.count(getMetrics().tagHalDied(), 1);
        mHALDeathCount++;
        handleError(getHalDeviceId(), BiometricConstants.BIOMETRIC_ERROR_HW_UNAVAILABLE,
                0 /*vendorCode */);
    }
+8 −0
Original line number Diff line number Diff line
@@ -674,6 +674,12 @@ public class FaceService extends BiometricServiceBase {
        return false;
    }

    @Override
    public void serviceDied(long cookie) {
        super.serviceDied(cookie);
        mDaemon = null;
    }

    @Override
    protected void updateActiveGroup(int userId, String clientPackage) {
        IBiometricsFace daemon = getFaceDaemon();
@@ -864,6 +870,8 @@ public class FaceService extends BiometricServiceBase {
            Slog.e(TAG, "dump formatting failure", e);
        }
        pw.println(dump);
        pw.println("HAL Deaths: " + mHALDeathCount);
        mHALDeathCount = 0;
    }

    private void dumpProto(FileDescriptor fd) {
+8 −0
Original line number Diff line number Diff line
@@ -776,6 +776,12 @@ public class FingerprintService extends BiometricServiceBase {
        return false;
    }

    @Override
    public void serviceDied(long cookie) {
        super.serviceDied(cookie);
        mDaemon = null;
    }

    @Override
    protected void updateActiveGroup(int userId, String clientPackage) {
        IBiometricsFingerprint daemon = getFingerprintDaemon();
@@ -1074,6 +1080,8 @@ public class FingerprintService extends BiometricServiceBase {
            Slog.e(TAG, "dump formatting failure", e);
        }
        pw.println(dump);
        pw.println("HAL Deaths: " + mHALDeathCount);
        mHALDeathCount = 0;
    }

    private void dumpProto(FileDescriptor fd) {