1/*
2 * Copyright (C) 2023 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";
18package android.adservices.service.measurement;
19
20option java_outer_classname = "MeasurementProtoEnums";
21option java_multiple_files = true;
22
23/**
24 * Enum used by AdServicesMeasurement(Registration, Attribution).
25 */
26enum SourceType {
27  UNKNOWN_SOURCE_TYPE = 0;
28  EVENT_SOURCE_TYPE = 1; // only deprecated for AdServicesMeasurementAttribution in favor of a VIEW_SOURCE_TYPE
29  NAVIGATION_SOURCE_TYPE = 2; // only deprecated for AdServicesMeasurementAttribution in favor of a CLICK_SOURCE_TYPE
30  VIEW_SOURCE_TYPE = 3;
31  CLICK_SOURCE_TYPE = 4;
32}
33
34/**
35 * Enum used by AdServicesMeasurementRegistration.
36 */
37enum RegistrationSurfaceType {
38  UNKNOWN_REGISTRATION_SURFACE_TYPE = 0;
39  WEB_REGISTRATION_SURFACE_TYPE = 1;
40  APP_REGISTRATION_SURFACE_TYPE = 2;
41}
42
43/**
44 * Enum used by AdServicesMeasurement(Registration, Attribution, Reporting,
45 * Jobs)
46 */
47enum Status {
48  UNKNOWN_STATUS = 0;
49  SUCCESS_STATUS = 1;
50  FAILURE_STATUS = 2;
51  AGGREGATE_REPORT_GENERATED_SUCCESS_STATUS = 3;
52  EVENT_REPORT_GENERATED_SUCCESS_STATUS = 4;
53  AGGREGATE_AND_EVENT_REPORTS_GENERATED_SUCCESS_STATUS = 5;
54}
55
56/**
57 * Enum used by AdServicesMeasurementRegistration.
58 */
59enum RegistrationFailureType {
60  UNKNOWN_REGISTRATION_FAILURE_TYPE = 0;
61  PARSING_REGISTRATION_FAILURE_TYPE = 1;
62  NETWORK_REQUEST_REGISTRATION_FAILURE_TYPE = 2;
63  ENROLLMENT_REGISTRATION_FAILURE_TYPE = 3;
64  REDIRECT_REGISTRATION_FAILURE_TYPE = 4;
65  STORAGE_REGISTRATION_FAILURE_TYPE = 5;
66  JOB_RETRY_LIMIT_EXCEEDED_REGISTRATION_FAILURE_TYPE = 6;
67  HEADER_SIZE_LIMIT_EXCEEDED_FAILURE_TYPE  = 7;
68  SERVER_UNAVAILABLE_REGISTRATION_FAILURE_TYPE = 8;
69  INVALID_URL_REGISTRATION_FAILURE_TYPE = 9;
70}
71
72/**
73 * Enum used by AdServicesMeasurementReporting.
74 */
75enum ReportUploadFailureType {
76  UNKNOWN_REPORT_UPLOAD_FAILURE_TYPE = 0;
77  ENROLLMENT_NOT_FOUND_REPORT_UPLOAD_FAILURE_TYPE = 1;
78  NETWORK_ERROR_REPORT_UPLOAD_FAILURE_TYPE = 2;
79  DATASTORE_ERROR_REPORT_UPLOAD_FAILURE_TYPE = 3;
80  REPORT_NOT_PENDING_REPORT_UPLOAD_FAILURE_TYPE = 4;
81  JOB_RETRY_LIMIT_EXCEEDED_REPORT_UPLOAD_FAILURE_TYPE = 5;
82  SERIALIZATION_ERROR_REPORT_UPLOAD_FAILURE_TYPE = 6;
83  ENCRYPTION_ERROR_REPORT_UPLOAD_FAILURE_TYPE = 7;
84  UNSUCCESSFUL_HTTP_RESPONSE_CODE_FAILURE_TYPE = 8;
85  REPORT_NOT_FOUND_FAILURE_TYPE = 9;
86}
87
88/**
89 * Enum used by AdServicesMeasurementReporting.
90 */
91enum ReportUploadMethod {
92  UNKNOWN_REPORT_UPLOAD_METHOD = 0;
93  REGULAR_REPORT_UPLOAD_METHOD = 1;
94  FALLBACK_REPORT_UPLOAD_METHOD = 2;
95}
96
97/**
98 * Enum used by AdServicesMeasurementDelayedSourceRegistration.
99 */
100enum DelayedSourceRegistrationStatus {
101  UNKNOWN_DELAYED_SOURCE_REGISTRATION_STATUS = 0;
102  MISSING_DELAYED_SOURCE_REGISTRATION_STATUS = 1;
103  VALID_DELAYED_SOURCE_REGISTRATION_STATUS = 2;
104}
105
106/**
107 * Enum used by AdServicesMeasurementAttribution.
108 */
109enum AttributionSurfaceCombination {
110  UNKNOWN_ATTRIBUTION_SURFACE_COMBINATION = 0;
111  APP_APP_ATTRIBUTION_SURFACE_COMBINATION = 1;
112  APP_WEB_ATTRIBUTION_SURFACE_COMBINATION = 2;
113  WEB_APP_ATTRIBUTION_SURFACE_COMBINATION = 3;
114  WEB_WEB_ATTRIBUTION_SURFACE_COMBINATION = 4;
115}
116
117/**
118 * Enum used by AdServicesMeasurementAttribution.
119 */
120enum AttributionFailureType {
121  UNKNOWN_ATTRIBUTION_FAILURE_TYPE = 0;
122  TRIGGER_IGNORED_ATTRIBUTION_FAILURE_TYPE = 1;
123  TRIGGER_ALREADY_ATTRIBUTED_ATTRIBUTION_FAILURE_TYPE = 2;
124  TRIGGER_MARKED_FOR_DELETION_ATTRIBUTION_FAILURE_TYPE = 3;
125  NO_MATCHING_SOURCE_ATTRIBUTION_FAILURE_TYPE = 4;
126  NO_TOP_LEVEL_FILTER_MATCH_ATTRIBUTION_FAILURE_TYPE = 5;
127  RATE_LIMIT_EXCEEDED_ATTRIBUTION_FAILURE_TYPE = 6;
128  NO_REPORTS_GENERATED_ATTRIBUTION_FAILURE_TYPE = 7;
129  JOB_RETRY_LIMIT_EXCEEDED_ATTRIBUTION_FAILURE_TYPE = 8;
130  TRIGGER_NOT_FOUND_FAILURE_TYPE = 9;
131}
132
133/**
134 * Enum used by AdServicesMeasurementJobs.
135 */
136enum JobType {
137  UNKNOWN_JOB_TYPE = 0;
138  ASYNC_REGISTRATION_JOB_TYPE = 1;
139  ASYNC_REGISTRATION_FALLBACK_JOB_TYPE = 2;
140  ATTRIBUTION_JOB_TYPE = 3;
141  AGGREGATION_REPORTING_JOB_TYPE = 4;
142  AGGREGATE_REPORTING_FALLBACK_JOB_TYPE = 5;
143  EVENT_REPORTING_JOB_TYPE = 6;
144  EVENT_REPORTING_FALLBACK_JOB_TYPE = 7;
145  DELETE_EXPIRED_JOB_TYPE = 8;
146  DELETE_UNINSTALLED_JOB_TYPE = 9;
147}
148
149/**
150 * Enum used by AdServicesMeasurementWipeout.
151 */
152enum WipeoutCause {
153  UNKNOWN_WIPEOUT_CAUSE = 0;
154  UNINSTALL_WIPEOUT_CAUSE = 1;
155  CONSENT_FLIP_WIPEOUT_CAUSE = 2;
156  CLEAR_DATA_WIPEOUT_CAUSE = 3;
157  DELETE_REGISTRATIONS_API_CLEAR_DATA_WIPEOUT_CAUSE = 4;
158  PACKAGE_CHANGED_WIPEOUT_CAUSE = 5;
159  ROLLBACK_WIPEOUT_CAUSE = 6;
160}
161
162/**
163 * Enum used by AdServicesMeasurementProcessOdpRegistration.
164 */
165enum OdpRegistrationType {
166  UNKNOWN_ODP_REGISTRATION_TYPE = 0;
167  TRIGGER_ODP_REGISTRATION_TYPE = 1;
168}
169
170/**
171 * Enum used by AdServicesMeasurementProcessOdpRegistration.
172 */
173enum OdpRegistrationStatus {
174  UNKNOWN_ODP_REGISTRATION_STATUS = 0;
175  SUCCESS_ODP_REGISTRATION_STATUS = 1;
176  ODP_UNAVAILABLE_REGISTRATION_STATUS = 2;
177  INVALID_HEADER_FORMAT_ODP_REGISTRATION_STATUS = 3;
178  MISSING_REQUIRED_HEADER_FIELD_ODP_REGISTRATION_STATUS = 4;
179  INVALID_HEADER_FIELD_VALUE_ODP_REGISTRATION_STATUS = 5;
180  INVALID_ENROLLMENT_ODP_REGISTRATION_STATUS = 6;
181  HEADER_SIZE_LIMIT_EXCEEDED_ODP_REGISTRATION_STATUS = 7;
182  PARSING_EXCEPTION_ODP_REGISTRATION_STATUS = 8;
183}
184
185/**
186 * Enum used by AdServicesMeasurementNotifyRegistrationToOdp.
187 */
188enum OdpApiCallStatus {
189  UNKNOWN_ODP_API_CALL_STATUS = 0;
190  SUCCESS_ODP_API_CALL_STATUS = 1;
191  FAILED_ODP_API_CALL_STATUS = 2;
192}