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

Commit 98d9d350 authored by Arpan Kaphle's avatar Arpan Kaphle Committed by Android (Google) Code Review
Browse files

Merge changes from topic "metrics API" into main

* changes:
  [CredMan System Metrics] - Bundle T1/T2 Session Ids
  Add Flag for Metrics SessId Bundle
parents d114955e 5ca2b328
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -85,6 +85,16 @@ flag {
    bug: "324291187"
}

flag {
    namespace: "credential_manager"
    name: "framework_session_id_metric_bundle"
    description: "Enables the session_id to be passed across to the UI logs"
    bug: "379880133"
    metadata {
            purpose: PURPOSE_BUGFIX
        }
}

flag {
    namespace: "credential_manager"
    name: "clear_credentials_fix_enabled"
+16 −4
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.content.Context;
import android.content.Intent;
import android.credentials.CredentialManager;
import android.credentials.CredentialProviderInfo;
import android.credentials.flags.Flags;
import android.credentials.selection.DisabledProviderData;
import android.credentials.selection.IntentCreationResult;
import android.credentials.selection.IntentFactory;
@@ -46,6 +47,12 @@ import java.util.UUID;

/** Initiates the Credential Manager UI and receives results. */
public class CredentialManagerUi {

    private static final String SESSION_ID_TRACK_ONE =
            "com.android.server.credentials.CredentialManagerUi.SESSION_ID_TRACK_ONE";
    private static final String SESSION_ID_TRACK_TWO =
            "com.android.server.credentials.CredentialManagerUi.SESSION_ID_TRACK_TWO";

    @NonNull
    private final CredentialManagerUiCallback mCallbacks;
    @NonNull
@@ -175,6 +182,11 @@ public class CredentialManagerUi {
                mContext, intentCreationResult, mUserId);
        Intent intent = intentCreationResult.getIntent();
        intent.setAction(UUID.randomUUID().toString());
        if (Flags.frameworkSessionIdMetricBundle()) {
            intent.putExtra(SESSION_ID_TRACK_ONE,
                    requestSessionMetric.getInitialPhaseMetric().getSessionIdCaller());
            intent.putExtra(SESSION_ID_TRACK_TWO, requestSessionMetric.getSessionIdTrackTwo());
        }
        //TODO: Create unique pending intent using request code and cancel any pre-existing pending
        // intents
        return PendingIntent.getActivityAsUser(