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

Commit fd8c7108 authored by Arpan Kaphle's avatar Arpan Kaphle Committed by Automerger Merge Worker
Browse files

Merge "Gracefully failing Exceptions during logging" into udc-dev am: 6789d002

parents b006e9b3 6789d002
Loading
Loading
Loading
Loading
+48 −40
Original line number Diff line number Diff line
@@ -90,6 +90,7 @@ public class MetricUtilities {
    protected static void logApiCalled(ApiName apiName, ApiStatus apiStatus,
            Map<String, ProviderSession> providers, int callingUid,
            ChosenProviderMetric chosenProviderMetric) {
        try {
            var providerSessions = providers.values();
            int providerSize = providerSessions.size();
            int[] candidateUidList = new int[providerSize];
@@ -117,6 +118,9 @@ public class MetricUtilities {
                    /* chosen_provider_final_phase_microseconds (backwards compat only) */
                    DEFAULT_INT_32,
                    /* chosen_provider_status */ chosenProviderMetric.getChosenProviderStatus());
        } catch (Exception e) {
            Log.w(TAG, "Unexpected error during metric logging: " + e);
        }
    }

    /**
@@ -131,6 +135,7 @@ public class MetricUtilities {
     */
    protected static void logApiCalled(ApiName apiName, ApiStatus apiStatus,
            int callingUid) {
        try {
            FrameworkStatsLog.write(FrameworkStatsLog.CREDENTIAL_MANAGER_API_CALLED,
                    /* api_name */apiName.getMetricCode(),
                    /* caller_uid */ callingUid,
@@ -145,6 +150,9 @@ public class MetricUtilities {
                    /* chosen_provider_final_phase_microseconds */
                    DEFAULT_INT_32,
                    /* chosen_provider_status */ DEFAULT_INT_32);
        } catch (Exception e) {
            Log.w(TAG, "Unexpected error during metric logging: " + e);
        }
    }

}