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

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

Merge "Browsing Phase Data Type to Store Information" into udc-dev am: ba90594b

parents 39db361a ba90594b
Loading
Loading
Loading
Loading
+75 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.server.credentials.metrics;

/**
 * A part of the Candidate Phase, but emitted alongside {@link ChosenProviderMetric}. The user is
 * shown various entries from the provider responses, and may selectively browse through many
 * entries. It is possible that the initial set of browsing is for a provider that is ultimately
 * not chosen. This metric will be gathered PER browsing click, and aggregated, so that we can
 * understand where user interaction is more cumbersome, informing us for future improvements. This
 * can only be complete when the browsing is finished, ending in a final user choice, or possibly
 * a cancellation. Thus, this will be collected and emitted in the final phase, though collection
 * will begin in the candidate phase when the user begins browsing options.
 */
public class CandidateBrowsingPhaseMetric {

    private static final String TAG = "CandidateSelectionPhaseMetric";
    private static final int SEQUENCE_ID = 3;
    // The session id associated with the API Call this candidate provider is a part of, default -1
    private int mSessionId = -1;
    // The EntryEnum that was pressed, defaults to -1 (TODO immediately, generate entry enum).
    private int mEntryEnum = -1;
    // The provider associated with the press, defaults to -1
    private int mProviderUid = -1;

    /* -- The session ID -- */

    public void setSessionId(int sessionId) {
        mSessionId = sessionId;
    }

    public int getSessionId() {
        return mSessionId;
    }

    /* -- The sequence ID -- */

    public int getSequenceId() {
        return SEQUENCE_ID;
    }

    /* -- The Entry of this tap -- */

    public void setEntryEnum(int entryEnum) {
        mEntryEnum = entryEnum;
    }

    public int getEntryEnum() {
        return mEntryEnum;
    }

    /* -- The Provider UID of this Tap -- */

    public void setProviderUid(int providerUid) {
        mProviderUid = providerUid;
    }

    public int getProviderUid() {
        return mProviderUid;
    }
}