From 5cae01d5b32d6ca3dc4f06c9a954a31b812d3f7b Mon Sep 17 00:00:00 2001 From: Arpan Kaphle Date: Tue, 7 Mar 2023 22:48:35 +0000 Subject: Browsing Phase Data Type to Store Information This adds the new 'tapped entry list' metric object that captures all the browsed data prior to final selection. This will need to be put into a collection in order when used, but allows us to know about every tapped entry, regardless of final outcome. Bug: 270403549 Test: To be chained in later, builds for now Change-Id: Ibb89e66a5b641b493d79d08d10ec68b7bf0c34c9 --- .../metrics/CandidateBrowsingPhaseMetric.java | 75 ++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 services/credentials/java/com/android/server/credentials/metrics/CandidateBrowsingPhaseMetric.java (limited to 'services/credentials/java') diff --git a/services/credentials/java/com/android/server/credentials/metrics/CandidateBrowsingPhaseMetric.java b/services/credentials/java/com/android/server/credentials/metrics/CandidateBrowsingPhaseMetric.java new file mode 100644 index 000000000000..37ec8f06c3eb --- /dev/null +++ b/services/credentials/java/com/android/server/credentials/metrics/CandidateBrowsingPhaseMetric.java @@ -0,0 +1,75 @@ +/* + * 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; + } +} -- cgit v1.2.3-59-g8ed1b