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

Commit 9540f4ab authored by Arpan Kaphle's avatar Arpan Kaphle
Browse files

Ensuring default emits to aid build for atom ids

This ensures the atoms that are claimed can be built and pass presubmit.
This is needed in order to ensure old emit methods are properly updated
with default values.

Bug: 271135048
Bug: 273351248
Test: Build Test
Change-Id: Iba5274e23b54495dbfe2962f014fe4914462a115
parent ffe169fd
Loading
Loading
Loading
Loading
+17 −4
Original line number Diff line number Diff line
@@ -43,7 +43,9 @@ public class MetricUtilities {
    public static final String USER_CANCELED_SUBSTRING = "TYPE_USER_CANCELED";

    public static final int DEFAULT_INT_32 = -1;
    public static final String DEFAULT_STRING = "";
    public static final int[] DEFAULT_REPEATED_INT_32 = new int[0];
    public static final String[] DEFAULT_REPEATED_STR = new String[0];
    // Used for single count metric emits, such as singular amounts of various types
    public static final int UNIT = 1;
    // Used for zero count metric emits, such as zero amounts of various types
@@ -143,7 +145,12 @@ public class MetricUtilities {
                    finalPhaseMetric.getAuthenticationEntryCount(),
                    /* clicked_entries */ browsedClickedEntries,
                    /* provider_of_clicked_entry */ browsedProviderUid,
                    /* api_status */ apiStatus
                    /* api_status */ apiStatus,
                    DEFAULT_REPEATED_INT_32,
                    DEFAULT_REPEATED_INT_32,
                    DEFAULT_REPEATED_STR,
                    DEFAULT_REPEATED_INT_32,
                    DEFAULT_STRING
            );
        } catch (Exception e) {
            Log.w(TAG, "Unexpected error during metric logging: " + e);
@@ -222,7 +229,11 @@ public class MetricUtilities {
                    /* candidate_provider_credential_entry_type_count */
                    candidateCredentialTypeCountList,
                    /* candidate_provider_remote_entry_count */ candidateRemoteEntryCountList,
                    /* candidate_provider_authentication_entry_count */ candidateAuthEntryCountList
                    /* candidate_provider_authentication_entry_count */ candidateAuthEntryCountList,
                    DEFAULT_REPEATED_STR,
                    false,
                    DEFAULT_REPEATED_STR,
                    DEFAULT_REPEATED_INT_32
            );
        } catch (Exception e) {
            Log.w(TAG, "Unexpected error during metric logging: " + e);
@@ -285,10 +296,12 @@ public class MetricUtilities {
                    /* initial_timestamp_reference_nanoseconds */
                    initialPhaseMetric.getCredentialServiceStartedTimeNanoseconds(),
                    /* count_credential_request_classtypes */
                    initialPhaseMetric.getCountRequestClassType()
                    initialPhaseMetric.getCountRequestClassType(),
                    // TODO(b/271135048) - add total count of request options
                    // TODO(b/271135048) - Uncomment once built past PWG review -
                    // initialPhaseMetric.isOriginSpecified()
                    DEFAULT_REPEATED_STR,
                    DEFAULT_REPEATED_INT_32,
                    initialPhaseMetric.isOriginSpecified()
            );
        } catch (Exception e) {
            Log.w(TAG, "Unexpected error during metric logging: " + e);