1/*
2 * Copyright (C) 2022 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
18
19package android.os.statsd.autofill;
20
21option java_outer_classname = "AutofillProtoEnums";
22option java_multiple_files = true;
23
24// Logging constants for Autofill system UI events.
25enum UiEventType {
26  TYPE_UNKNOWN = 0;
27  // OPEN: Settings > Apps > Default Apps > Default autofill app
28  DEFAULT_AUTOFILL_PICKER = 1;
29  // ACTION: Update default app from Settings
30  ACTION_SETTINGS_UPDATE_DEFAULT_APP = 2;
31  // Autofill service called API that disables itself
32  AUTOFILL_SERVICE_DISABLED_SELF = 3;
33  // An autofill service asked to disable autofill for a given application.
34  AUTOFILL_SERVICE_DISABLED_APP = 4;
35  // An autofill service asked to disable autofill for a given activity.
36  AUTOFILL_SERVICE_DISABLED_ACTIVITY = 5;
37  // User manually enable autofill from the denylist for a given app.
38  AUTOFILL_ENABLED_FROM_DENYLIST = 6;
39  // An app attempted to forge a different component name in the AssisStructure that would be passed to the autofill service.
40  AUTOFILL_FORGED_COMPONENT_ATTEMPT = 7;
41}
42
43enum FillRequestTriggerReason {
44  TRIGGER_REASON_UNKNOWN = 0;
45  // A user or an app explicitly requests The request.
46  TRIGGER_REASON_EXPLICITLY_REQUESTED = 1;
47  // The request is retriggered by the provider.
48  TRIGGER_REASON_RETRIGGER = 2;
49  // The request is pre triggered.
50  TRIGGER_REASON_PRE_TRIGGER = 3;
51  // The request is normally triggered.
52  TRIGGER_REASON_NORMAL_TRIGGER = 4;
53  // The request is triggered from cached response.
54  TRIGGER_REASON_SERVED_FROM_CACHED_RESPONSE = 5;
55}
56
57enum AutofillDisplayPresentationType {
58  UNKNOWN_AUTOFILL_DISPLAY_PRESENTATION_TYPE = 0;
59  MENU = 1;    // aka drop-down
60  INLINE = 2;  // shown via IME
61  DIALOG = 3;  // aka Bottom-sheet dialog
62}
63
64enum FillResponseStatus {
65  RESPONSE_STATUS_UNKNOWN = 0;
66  RESPONSE_STATUS_FAILURE = 1;
67  RESPONSE_STATUS_SUCCESS = 2;
68  RESPONSE_STATUS_CANCELLED = 3;
69  RESPONSE_STATUS_TIMEOUT = 4;
70  RESPONSE_STATUS_SESSION_DESTROYED = 5;
71  RESPONSE_STATUS_TRANSACTION_TOO_LARGE = 6;
72}
73
74enum AuthenticationType {
75  AUTHENTICATION_TYPE_UNKNOWN = 0;
76  DATASET_AUTHENTICATION = 1;
77  FULL_AUTHENTICATION = 2;
78}
79
80enum AuthenticationResult {
81  AUTHENTICATION_RESULT_UNKNOWN = 0;
82  AUTHENTICATION_SUCCESS = 1;
83  AUTHENTICATION_FAILURE = 2;
84}
85
86enum SaveUiShownReason {
87  SAVE_UI_SHOWN_REASON_UNKNOWN = 0;
88  SAVE_UI_SHOWN_REASON_REQUIRED_ID_CHANGE = 1;
89  SAVE_UI_SHOWN_REASON_OPTIONAL_ID_CHANGE = 2;
90  SAVE_UI_SHOWN_REASON_TRIGGER_ID_SET = 3;
91}
92
93enum SaveUiNotShownReason {
94  NO_SAVE_REASON_UNKNOWN = 0;
95  NO_SAVE_REASON_NONE = 1;
96  NO_SAVE_REASON_NO_SAVE_INFO = 2;
97  NO_SAVE_REASON_WITH_DELAY_SAVE_FLAG = 3;
98  NO_SAVE_REASON_HAS_EMPTY_REQUIRED = 4;
99  NO_SAVE_REASON_NO_VALUE_CHANGED = 5;
100  NO_SAVE_REASON_FIELD_VALIDATION_FAILED = 6;
101  NO_SAVE_REASON_DATASET_MATCH = 7;
102  NO_SAVE_REASON_WITH_DONT_SAVE_ON_FINISH_FLAG = 8;
103  NO_SAVE_REASON_SESSION_DESTROYED = 9;
104  NO_SAVE_REASON_SCREEN_HAS_CREDMAN_FIELD = 10;
105}
106
107// Determines the reason for committing the autofill Session.
108enum AutofillCommitReason {
109  COMMIT_REASON_UNKNOWN = 0;
110  COMMIT_REASON_ACTIVITY_FINISHED = 1;
111  COMMIT_REASON_VIEW_COMMITTED = 2;
112  COMMIT_REASON_VIEW_CLICKED = 3;
113  COMMIT_REASON_VIEW_CHANGED = 4;
114  COMMIT_REASON_SESSION_DESTROYED = 5;
115}
116
117enum DatasetPickedReason {
118  PICK_REASON_UNKNOWN = 0;
119  PICK_REASON_NO_PCC = 1;
120  PICK_REASON_PROVIDER_DETECTION_ONLY = 2;
121  PICK_REASON_PROVIDER_DETECTION_PREFERRED_WITH_PCC = 3;
122  PICK_REASON_PCC_DETECTION_ONLY = 4;
123  PICK_REASON_PCC_DETECTION_PREFERRED_WITH_PROVIDER = 5;
124}
125
126// Enum for specifying which detection provider gets the preference when choosing
127// final datasets.
128enum DetectionPreference {
129  DETECTION_PREFER_UNKONWN = 0;
130  DETECTION_PREFER_AUTOFILL_PROVIDER = 1;
131  DETECTION_PREFER_PCC = 2;
132}
133
134// Enum for specifying which detection provider gets the preference when choosing
135// final datasets.
136enum FieldClassificationRequestStatus {
137  STATUS_UNKNOWN = 0;
138  STATUS_SUCCESS = 1;
139  STATUS_FAIL = 2;
140  STATUS_CANCELLED = 3;
141}
142