• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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";
18
19package android.os.statsd.adservices;
20
21import "frameworks/proto_logging/stats/atoms.proto";
22import "frameworks/proto_logging/stats/atom_field_options.proto";
23import "frameworks/proto_logging/stats/enums/adservices/common/adservices_enums.proto";
24import "frameworks/proto_logging/stats/enums/adservices/common/adservices_api_metrics_enums.proto";
25import "frameworks/proto_logging/stats/enums/adservices/common/adservices_cel_enums.proto";
26import "frameworks/proto_logging/stats/enums/app/job/job_enums.proto";
27import "frameworks/proto_logging/stats/enums/adservices/enrollment/enums.proto";
28import "frameworks/proto_logging/stats/enums/adservices/measurement/enums.proto";
29import "frameworks/proto_logging/stats/enums/adservices/fledge/enums.proto";
30import "frameworks/proto_logging/stats/enums/stats/mobiledatadownload/enums.proto";
31
32option java_package = "com.android.os.adservices";
33option java_multiple_files = true;
34
35extend Atom {
36  optional JSScriptEngineLatencyReported jsscriptengine_latency_reported = 483
37  [(module) = "adservices", (truncate_timestamp) = true];
38
39  optional AdServicesApiCalled ad_services_api_called = 435
40  [(module) = "adservices", (truncate_timestamp) = true];
41
42  optional AdServicesMeasurementReportsUploaded ad_services_mesurement_reports_uploaded = 436
43  [(module) = "adservices", (truncate_timestamp) = true];
44
45  optional MobileDataDownloadFileGroupDownloadStatusReported mobile_data_download_file_group_status_reported = 490
46  [(module) = "adservices", (truncate_timestamp) = true];
47
48  optional MobileDataDownloadDownloadResultReported mobile_data_download_download_result_reported = 502
49  [(module) = "adservices", (truncate_timestamp) = true];
50
51  optional AdServicesSettingsUsageReported ad_services_settings_usage_reported = 493
52  [(module) = "adservices", (truncate_timestamp) = true];
53
54  optional BackgroundFetchProcessReported background_fetch_process_reported = 496
55  [(module) = "adservices", (truncate_timestamp) = true];
56
57  optional UpdateCustomAudienceProcessReported update_custom_audience_process_reported = 497
58  [(module) = "adservices"];
59
60  optional RunAdBiddingProcessReported run_ad_bidding_process_reported = 498
61  [(module) = "adservices"];
62  optional RunAdScoringProcessReported run_ad_scoring_process_reported = 499
63  [(module) = "adservices"];
64  optional RunAdSelectionProcessReported run_ad_selection_process_reported = 500
65  [(module) = "adservices"];
66  optional RunAdBiddingPerCAProcessReported run_ad_bidding_per_ca_process_reported = 501
67  [(module) = "adservices"];
68
69  optional MobileDataDownloadFileGroupStorageStatsReported mobile_data_download_file_group_storage_stats_reported = 503
70  [(module) = "adservices", (truncate_timestamp) = true];
71
72  optional AdServicesMeasurementRegistrations ad_services_measurement_registrations =
73      512 [(module) = "adservices", (truncate_timestamp) = true];
74
75  optional AdServicesGetTopicsReported ad_services_get_topics_reported = 535
76  [(module) = "adservices", (truncate_timestamp) = true];
77  optional AdServicesEpochComputationGetTopTopicsReported ad_services_epoch_computation_get_top_topics_reported = 536
78  [(module) = "adservices", (truncate_timestamp) = true];
79  optional AdServicesEpochComputationClassifierReported ad_services_epoch_computation_classifier_reported = 537
80  [(module) = "adservices", (truncate_timestamp) = true];
81
82  optional AdServicesBackCompatGetTopicsReported
83      ad_services_back_compat_get_topics_reported = 598
84        [(module) = "adservices", (truncate_timestamp) = true];
85
86  optional AdServicesBackCompatEpochComputationClassifierReported
87      ad_services_back_compat_epoch_computation_classifier_reported = 599
88          [(module) = "adservices", (truncate_timestamp) = true];
89  optional AdServicesMeasurementDebugKeys
90      ad_services_measurement_debug_keys = 640
91        [(module) = "adservices", (truncate_timestamp) = true];
92  optional AdServicesErrorReported
93      ad_services_error_reported = 662
94        [(module) = "adservices", (truncate_timestamp) = true];
95  optional AdServicesBackgroundJobsExecutionReported
96      ad_services_background_jobs_execution_reported = 663
97        [(module) = "adservices"];
98
99  optional AdServicesMeasurementDelayedSourceRegistration
100      ad_services_measurement_delayed_source_registration = 673
101        [(module) = "adservices", (truncate_timestamp) = true];
102  optional AdServicesMeasurementAttribution
103      ad_services_measurement_attribution = 674
104        [(module) = "adservices", (truncate_timestamp) = true];
105  optional AdServicesMeasurementJobs
106      ad_services_measurement_jobs = 675
107        [(module) = "adservices", (truncate_timestamp) = true];
108  optional AdServicesMeasurementWipeout
109      ad_services_measurement_wipeout = 676
110        [(module) = "adservices", (truncate_timestamp) = true];
111  optional AdServicesMeasurementAdIdMatchForDebugKeys
112      ad_services_measurement_ad_id_match_for_debug_keys = 695
113        [(module) = "adservices", (truncate_timestamp) = true];
114
115  optional AdServicesEnrollmentDataStored ad_services_enrollment_data_stored = 697
116      [(module) = "adservices", (truncate_timestamp) = true];
117  optional AdServicesEnrollmentFileDownloaded
118      ad_services_enrollment_file_downloaded = 698
119      [(module) = "adservices", (truncate_timestamp) = true];
120  optional AdServicesEnrollmentMatched ad_services_enrollment_matched = 699
121      [(module) = "adservices", (truncate_timestamp) = true];
122
123  optional AdServicesConsentMigrated ad_services_consent_migrated = 702
124  [(module) = "adservices", (truncate_timestamp) = true];
125
126  optional AdServicesEnrollmentFailed ad_services_enrollment_failed = 714
127      [(module) = "adservices", (truncate_timestamp) = true];
128
129  optional AdServicesMeasurementClickVerification ad_services_measurement_click_verification = 756
130      [(module) = "adservices", (truncate_timestamp) = true];
131
132  optional AdServicesEncryptionKeyFetched ad_services_encryption_key_fetched = 765
133      [(module) = "adservices", (truncate_timestamp) = true];
134  optional AdServicesEncryptionKeyDbTransactionEnded ad_services_encryption_key_db_transaction_ended = 766
135      [(module) = "adservices", (truncate_timestamp) = true];
136
137  optional DestinationRegisteredBeacons destination_registered_beacons = 767
138      [(module) = "adservices", (truncate_timestamp) = true];
139  optional ReportInteractionApiCalled report_interaction_api_called = 768
140      [(module) = "adservices", (truncate_timestamp) = true];
141  optional InteractionReportingTableCleared interaction_reporting_table_cleared = 769
142      [(module) = "adservices", (truncate_timestamp) = true];
143  optional AppManifestConfigHelperCalled app_manifest_config_helper_called = 788
144      [(module) = "adservices", (truncate_timestamp) = true];
145
146  optional AdFilteringProcessJoinCAReported ad_filtering_process_join_ca_reported = 793
147      [(module) = "adservices", (truncate_timestamp) = true];
148  optional AdFilteringProcessAdSelectionReported ad_filtering_process_ad_selection_reported = 794
149      [(module) = "adservices", (truncate_timestamp) = true];
150  optional AdCounterHistogramUpdaterReported ad_counter_histogram_updater_reported = 795
151      [(module) = "adservices", (truncate_timestamp) = true];
152  optional SignatureVerification signature_verification = 807
153        [(module) = "adservices", (truncate_timestamp) = true];
154  optional KAnonImmediateSignJoinStatusReported k_anon_immediate_sign_join_status_reported = 808
155  [(module) = "adservices", (truncate_timestamp) = true];
156  optional KAnonBackgroundJobStatusReported k_anon_background_job_status_reported = 809
157  [(module) = "adservices", (truncate_timestamp) = true];
158  optional KAnonInitializeStatusReported k_anon_initialize_status_reported = 810
159  [(module) = "adservices", (truncate_timestamp) = true];
160  optional KAnonSignStatusReported k_anon_sign_status_reported = 811
161  [(module) = "adservices", (truncate_timestamp) = true];
162  optional KAnonJoinStatusReported k_anon_join_status_reported= 812
163  [(module) = "adservices", (truncate_timestamp) = true];
164  optional KAnonKeyAttestationStatusReported k_anon_key_attestation_status_reported = 813
165  [(module) = "adservices", (truncate_timestamp) = true];
166
167  optional GetAdSelectionDataApiCalled get_ad_selection_data_api_called = 814
168  [(module) = "adservices", (truncate_timestamp) = true];
169  optional GetAdSelectionDataBuyerInputGenerated get_ad_selection_data_buyer_input_generated = 815
170  [(module) = "adservices", (truncate_timestamp) = true];
171
172  optional BackgroundJobSchedulingReported background_job_scheduling_reported = 834
173  [(module) = "adservices", (truncate_timestamp) = true];
174
175  optional TopicsEncryptionEpochComputationReported topics_encryption_epoch_computation_reported = 840
176  [(module) = "adservices", (truncate_timestamp) = true];
177  optional TopicsEncryptionGetTopicsReported topics_encryption_get_topics_reported = 841
178  [(module) = "adservices", (truncate_timestamp) = true];
179
180  optional AdServicesShellCommandCalled adservices_shell_command_called = 842
181  [(module) = "adservices", (truncate_timestamp) = true];
182
183  optional UpdateSignalsApiCalled update_signals_api_called = 843
184  [(module) = "adservices", (truncate_timestamp) = true];
185  optional EncodingJobRun encoding_job_run = 844
186  [(module) = "adservices", (truncate_timestamp) = true];
187  optional EncodingJsFetch encoding_js_fetch = 845
188  [(module) = "adservices", (truncate_timestamp) = true];
189  optional EncodingJsExecution encoding_js_execution = 846
190  [(module) = "adservices", (truncate_timestamp) = true];
191  optional PersistAdSelectionResultCalled persist_ad_selection_result_called = 847
192  [(module) = "adservices", (truncate_timestamp) = true];
193  optional ServerAuctionKeyFetchCalled server_auction_key_fetch_called = 848
194  [(module) = "adservices", (truncate_timestamp) = true];
195  optional ServerAuctionBackgroundKeyFetchScheduled server_auction_background_key_fetch_enabled = 849
196  [(module) = "adservices", (truncate_timestamp) = true];
197
198  optional AdServicesMeasurementProcessOdpRegistration ad_services_measurement_process_odp_registration = 864
199      [(module) = "adservices", (truncate_timestamp) = true];
200  optional AdServicesMeasurementNotifyRegistrationToOdp ad_services_measurement_notify_registration_to_odp = 865
201      [(module) = "adservices", (truncate_timestamp) = true];
202
203  optional SelectAdsFromOutcomesApiCalled select_ads_from_outcomes_api_called = 876
204  [(module) = "adservices", (truncate_timestamp) = true];
205  optional ReportImpressionApiCalled report_impression_api_called = 877
206  [(module) = "adservices", (truncate_timestamp) = true];
207  optional AdServicesEnrollmentTransactionStats ad_services_enrollment_transaction_stats = 885
208  [(module) = "adservices", (truncate_timestamp) = true];
209  optional AdServicesCobaltLoggerEventReported ad_services_cobalt_logger_event_reported = 902
210  [(module) = "adservices", (truncate_timestamp) = true];
211  optional AdServicesCobaltPeriodicJobEventReported ad_services_cobalt_periodic_job_event_reported = 903
212  [(module) = "adservices", (truncate_timestamp) = true];
213
214  optional UpdateSignalsProcessReported update_signals_process_reported = 905
215  [(module) = "adservices", (truncate_timestamp) = true];
216
217  optional TopicsScheduleEpochJobSettingReported topics_schedule_epoch_job_setting_reported = 930
218  [(module) = "adservices", (truncate_timestamp) = true];
219
220  optional ScheduledCustomAudienceUpdateScheduleAttempted scheduled_custom_audience_update_schedule_attempted = 967
221  [(module) = "adservices", (truncate_timestamp) = true];
222  optional ScheduledCustomAudienceUpdatePerformed scheduled_custom_audience_update_performed = 968
223  [(module) = "adservices", (truncate_timestamp) = true];
224  optional ScheduledCustomAudienceUpdatePerformedAttemptedFailureReported scheduled_custom_audience_update_performed_attempted_failure_reported = 969
225  [(module) = "adservices", (truncate_timestamp) = true];
226  optional ScheduledCustomAudienceUpdateBackgroundJobRan scheduled_custom_audience_update_background_job_ran = 970
227  [(module) = "adservices", (truncate_timestamp) = true];
228
229  optional AdServicesProcessLifecycleReported ad_services_process_lifecycle_reported = 1006
230  [(module) = "adservices", (truncate_timestamp) = true];
231  optional AdServicesProcessStableFlagsReported ad_services_process_stable_flags_reported = 1007
232  [(module) = "adservices", (truncate_timestamp) = true];
233  optional AdServicesFlagUpdateReported ad_services_flag_update_reported = 1008
234  [(module) = "adservices", (truncate_timestamp) = true];
235
236  optional ReportingWithDestinationPerformed reporting_with_destination_performed = 1013
237  [(module) = "adservices", (truncate_timestamp) = true];
238  optional NumberOfTypesOfReportingUrlsReceived number_of_types_of_reporting_url_received = 1014
239  [(module) = "adservices", (truncate_timestamp) = true];
240
241  optional MobileDataDownloadLatencyReported mobile_data_download_latency_reported = 1031
242  [(module) = "adservices", (truncate_timestamp) = true];
243
244  optional AdservicesMeasurementBackgroundJobInfo adservices_measurement_background_job_info = 1046
245  [(module) = "adservices", (truncate_timestamp) = true];
246}
247
248/**
249 * Represents a list of topic IDs.
250 */
251message AdServicesTopicIds {
252  repeated int32 topic_id = 1;
253}
254
255/**
256 * Logs for AdServices GetTopics API call on R+.
257 * This atom closely mimics AdServicesGetTopicsReported (for T+ logging) and
258 * avoids usage of field types (e.g. repeated) that aren't supported on R/S.
259 */
260message AdServicesBackCompatGetTopicsReported {
261  // Number of filtered duplicate topics.
262  optional int32 duplicate_topic_count = 1;
263
264  // Number of filtered blocked topics.
265  optional int32 filtered_blocked_topic_count = 2;
266
267  // Number of topic ids returned.
268  optional int32 count_of_topic_ids = 3;
269
270  // Topic ids returned, randomized using a random response mechanism.
271  optional AdServicesTopicIds topic_ids = 4 [(log_mode) = MODE_BYTES];
272}
273
274/**
275 * Logs for AdServices Epoch Computation Classifier on R+.
276 * One atom should be logged for each app classification.
277 * This atom closely mimics AdServicesEpochComputationClassifierReported (for T+ logging)
278 * and avoids usage of field types (e.g. repeated) that can't be supported on R/S.
279 */
280message AdServicesBackCompatEpochComputationClassifierReported {
281  // List of topics returned by the classifier for each app. The classification
282  // does not depend on the user's usage of the app.
283  optional AdServicesTopicIds topic_ids = 1 [(log_mode) = MODE_BYTES];
284
285  // Build id of the assets.
286  optional int32 build_id = 2;
287
288  // Version of the assets used.
289  optional string asset_version = 3;
290
291  // Type of the classifier used for classifying apps.
292  optional android.adservices.ClassifierType classifier_type = 4;
293
294  // On Device classifier status.
295  optional android.adservices.OnDeviceClassifierStatus on_device_classifier_status = 5;
296
297  // Precomputed classifier status.
298  optional android.adservices.PrecomputedClassifierStatus precomputed_classifier_status = 6;
299}
300
301/**
302 * Logs debug keys match state when measurement reports are being generated.
303 */
304message AdServicesMeasurementDebugKeys {
305  optional string adtech_enrollment_id = 1;
306  optional android.adservices.AttributionType attribution_type = 2;
307  optional bool is_matched = 3;
308  optional int64 join_key_hash = 4;
309  optional int64 join_key_hash_limit = 5;
310  optional string app_package_name = 6;
311}
312
313/**
314 * Logs AdServices errors/exceptions.
315 */
316message AdServicesErrorReported {
317  optional android.adservices.common.ErrorCode error_code = 1;
318
319  // Name of the PPAPI if possible where error is occurring.
320  optional android.adservices.PpapiName ppapi_name = 2;
321
322  // Name of the class where we catch the exception or log the error.
323  optional string class_name = 3;
324
325  // Name of the method where we catch the exception or log the error.
326  optional string method_name = 4;
327
328  // Line number where we catch the exception or log the error.
329  optional int32 line_number = 5;
330
331  // The fully qualified name of the last encountered exception.
332  optional string last_observed_exception_name = 6;
333}
334
335/** Logs background job stats to monitor the stability of Rubidium background jobs. */
336message AdServicesBackgroundJobsExecutionReported {
337  // A unique identifier for a background job
338  optional int32 job_id = 1;
339
340  // Time interval from the start to the end of an execution of a background job.
341  // It is on a milli-second basis.
342  optional int32 execution_latency_ms = 2;
343
344  // Time interval from the start of previous execution to the start of current execution of
345  // a background job. It is on a minute basis.
346  optional int32 execution_period_minute = 3;
347
348  // Type of the result code that implies different execution results of Adservices background jobs.
349  optional android.adservices.ExecutionResultCode execution_result_code = 4;
350
351  // The publicly returned reason onStopJob() was called.
352  // This is only applicable when the state is FINISHED, but may be undefined if
353  // JobService.onStopJob() was never called for the job.
354  // The default value is STOP_REASON_UNDEFINED.
355  optional android.app.job.StopReasonEnum public_stop_reason = 5;
356
357  // Module name from which the job execution is being reported.
358  optional android.adservices.ModuleName module_name = 6;
359
360  // Indicates the scheduler type that schedules the job.
361  optional android.adservices.SchedulerType scheduler_type = 7;
362}
363
364/** Logs background job Stats to monitor job scheduling in Rubidium. */
365message BackgroundJobSchedulingReported {
366
367  // A unique identifier for a background job.
368  optional int32 job_id = 1;
369
370  // Scheduling result code.
371  optional android.adservices.JobSchedulingResultCode result_code = 2;
372
373  // Indicates the scheduler type that schedules the job.
374  optional android.adservices.SchedulerType scheduler_type = 3;
375
376  // Module name from which the job execution is being reported.
377  optional android.adservices.ModuleName module_name = 4;
378}
379
380/**
381 * Logs when an AdServices delayed source is fetched and registered.
382 */
383message AdServicesMeasurementDelayedSourceRegistration {
384  optional android.adservices.service.measurement.DelayedSourceRegistrationStatus registration_status = 1;
385  // delay (in milliseconds) between a source registration and a previously registered trigger with matching attribution destination
386  optional int64 missed_source_delay_millis = 2;
387  optional string app_package_name = 3;
388}
389
390/**
391 * Logs when an AdServices trigger is attributed to a source.
392 */
393message AdServicesMeasurementAttribution {
394  optional android.adservices.service.measurement.SourceType source_type = 1;
395  optional android.adservices.service.measurement.AttributionSurfaceCombination attribution_surface_combination = 2;
396  optional android.adservices.service.measurement.Status status = 3;
397  optional android.adservices.service.measurement.AttributionFailureType failure_type = 4;
398  optional bool is_source_derived = 5;
399  optional bool is_install_attribution = 6;
400  // delay (in milliseconds) between trigger registration and a trigger becoming attributed.
401  optional int64 trigger_to_attribution_delay_millis = 7;
402  optional string app_package_name = 8;
403  optional int32 aggregate_report_count = 9;
404  optional int32 aggregate_debug_report_count = 10;
405  optional int32 event_report_count = 11;
406  optional int32 event_debug_report_count = 12;
407  optional int32 retry_count = 13;
408  // Number of null aggregate reports that were generated as a result of this
409  // attribution. A null aggregate report is an aggregate report meant to
410  // obscure the true number of aggregate reports sent to consumers of the
411  // Attribution Reporting API. An aggregate report is an input to the Private
412  // Aggregate API and contains detailed conversion data associated with an
413  // attribution. Obscuring the true number of aggregate reports preserves
414  // privacy.
415  optional int32 null_aggregate_report_count = 14;
416}
417
418/**
419 * Logs AdServices job finish status
420 */
421message AdServicesMeasurementJobs {
422  optional android.adservices.service.measurement.Status status = 1;
423  optional android.adservices.service.measurement.JobType job_type = 2;
424}
425
426/**
427 * Logs when AdServices deletion API is called.
428 */
429message AdServicesMeasurementWipeout {
430  optional android.adservices.service.measurement.WipeoutCause wipeout_cause = 1;
431  optional string app_package_name = 2;
432}
433
434/**
435 * Logs Ad Id match state for debug keys when measurement reports are being generated.
436 */
437message AdServicesMeasurementAdIdMatchForDebugKeys {
438  optional string adtech_enrollment_id = 1;
439  optional android.adservices.AttributionType attribution_type = 2;
440  optional bool is_matched = 3;
441  optional int64 num_unique_ad_ids_used = 4;
442  optional int64 num_unique_ad_id_limit = 5;
443  optional string app_package_name = 6;
444}
445
446/**
447 * Logs when AdServices enrollment data is stored.
448 */
449message AdServicesEnrollmentDataStored {
450  optional android.stats.adservices.enrollment.TransactionType transaction_type = 1;
451  optional bool success = 2;
452  optional int32 build_id = 3; // id of the enrollment file downloaded via mdd
453}
454
455/**
456 * Logs when AdServices enrollment file get downloaded.
457 */
458message AdServicesEnrollmentFileDownloaded {
459  optional bool success = 1;
460  optional int32 build_id = 2; // id of the enrollment file downloaded via mdd
461}
462
463/**
464 * Logs when AdServices enrollment match occurs.
465 */
466message AdServicesEnrollmentMatched {
467  optional bool success = 1;
468  optional int32 build_id = 2; // id of the enrollment file downloaded via mdd
469}
470
471/**
472 * Logs when AdServices enrollment fails.
473 */
474message AdServicesEnrollmentFailed {
475  optional int32 build_id = 1; // id of the enrollment file downloaded via mdd
476  optional android.stats.adservices.enrollment.DataFileGroupStatus data_file_group_status = 2;
477  optional int32 enrollment_record_count_in_table = 3;
478  optional string query_parameter = 4;
479  optional android.stats.adservices.enrollment.ErrorCause error_cause = 5;
480}
481
482/**
483 * Logs when AdServices enrollment database is accessed.
484 */
485message AdServicesEnrollmentTransactionStats {
486  optional android.stats.adservices.enrollment.EnrollmentTransactionType transaction_type = 1;
487  optional android.stats.adservices.enrollment.TransactionStatus transaction_status = 2;
488  optional int32 transaction_parameter_count = 3;
489  optional int32 transaction_result_count = 4;
490  optional int32 query_result_count = 5;
491  optional int32 datasource_record_count_pre = 6;
492  optional int32 datasource_record_count_post = 7;
493  optional int32 enrollment_file_latest_build_id = 8;
494  optional int32 latency_ms = 9;
495}
496
497/**
498 * Logs for AdServices Consent Migration after OTA.
499 * This atom captures the event of consent migration when we OTA from S to T+.
500 */
501message AdServicesConsentMigrated {
502
503  // Logs the Migration status
504  enum MigrationStatus {
505    UNSPECIFIED_MIGRATION_STATUS = 0;
506
507    // Consent migration unsuccessful
508    FAILURE = 1;
509
510    // Consent migration successful with shared prefs updated
511    SUCCESS_WITH_SHARED_PREF_UPDATED = 2;
512
513    // Consent migration successful with shared prefs not updated
514    SUCCESS_WITH_SHARED_PREF_NOT_UPDATED = 3;
515
516  }
517
518  // Logs the type of migration
519  enum MigrationType {
520    UNSPECIFIED_MIGRATION_TYPE = 0;
521
522    // Migrating consent from PPAPI to system service
523    PPAPI_TO_SYSTEM_SERVICE = 1;
524
525    // Migrating consent from App Search to system service
526    APPSEARCH_TO_SYSTEM_SERVICE = 2;
527
528    // Migrating consent from AdServicesExtDataStorageService to system service
529    ADEXT_SERVICE_TO_SYSTEM_SERVICE = 3;
530
531    // Migrating consent from AdServicesExtDataStorageService to App Search
532    ADEXT_SERVICE_TO_APPSEARCH = 4;
533  }
534
535  // Logs the opt-in/ opt-out value of measurement app
536  optional bool is_measurement_consent_enabled = 1;
537
538  // Logs the opt-in/ opt-out value of topics app
539  optional bool is_topics_consent_enabled = 2;
540
541  // Logs the opt-in/ opt-out value of fledge app
542  optional bool is_fledge_consent_enabled = 3;
543
544  // Logs the opt-in/ opt-out value for all apps in beta
545  optional bool is_default_consent_enabled = 4;
546
547  // Logs the type of migration
548  optional MigrationType migration_type = 5;
549
550  // Logs the region where the OTA took place
551  optional android.adservices.AdServiceSettingRegion region = 6;
552
553  // Logs the Migration status
554  optional MigrationStatus migration_status = 7;
555}
556
557/**
558 * Logs for AdServices click verification for measurement API calls.
559 */
560 message AdServicesMeasurementClickVerification {
561  //  The final source type of the source.
562  optional android.adservices.service.measurement.SourceType source_type = 1;
563
564  // If an input event was included with the registration.
565  // The calling app wanted a click event if an input event is present.
566  optional bool input_event_present = 2;
567
568  // If the system click verification passed.
569  optional bool system_click_verification_passed = 3;
570
571  // If the flag is set to enable the system click verification check.
572  optional bool system_click_verification_enabled = 4;
573
574  // The delay (in millis) from when the input event was created to when the API was called.
575  optional int64 input_event_delay_millis = 5;
576
577  // The max difference (in millis) between input event creation and API call for the source to not get downgraded.
578  optional int64 valid_delay_window_millis = 6;
579
580  // The package calling the API.
581  optional string app_package_name = 7;
582
583  optional bool click_dedup_enabled = 8;
584
585  optional bool click_dedup_enforced = 9;
586
587  optional int64 click_dedup_max_sources_per_click = 10;
588
589  optional bool click_dedup_under_limit = 11;
590}
591
592message AdServicesMeasurementProcessOdpRegistration {
593  optional android.adservices.service.measurement.OdpRegistrationType odp_registration_type = 1;
594  optional android.adservices.service.measurement.OdpRegistrationStatus odp_registration_status = 2;
595}
596
597message AdServicesMeasurementNotifyRegistrationToOdp {
598  optional int64 odp_api_latency_ms = 1;
599  optional android.adservices.service.measurement.OdpApiCallStatus odp_api_call_status = 2;
600
601}
602
603/**
604 * Logs for AdServices encryption key background job status.
605 */
606message AdServicesEncryptionKeyFetched {
607
608  // Encryption key fetch job type.
609  enum FetchJobType {
610    UNKNOWN_JOB = 0;
611    ENCRYPTION_KEY_DAILY_FETCH_JOB = 1;
612    MDD_DOWNLOAD_JOB = 2;
613  }
614
615  // Encryption key fetch status.
616  enum FetchStatus {
617    UNKNOWN = 0;
618    NULL_ENDPOINT = 1;
619    INVALID_ENDPOINT = 2;
620    IO_EXCEPTION = 3;
621    BAD_REQUEST_EXCEPTION = 4;
622    KEY_NOT_MODIFIED = 5;
623    SUCCESS = 6;
624  }
625
626  // Encryption key fetch job type.
627  optional FetchJobType fetch_job_type = 1;
628  // Encryption key fetch status.
629  optional FetchStatus fetch_status = 2;
630  // Whether the key is fetched for the first time.
631  optional bool is_first_time_fetch = 3;
632  // Enrollment id for the adtech corresponding to the encryption key.
633  // Example: "XYZABC"
634  optional string adtech_enrollment_id = 4;
635  // Company id for the adtech corresponding to this encryption key.
636  // Example: "XYZCompany"
637  optional string company_id = 5;
638  // Encryption key url.
639  optional string encryption_key_url = 6;
640}
641
642/**
643 * Logs for AdServices encryption key datastore transaction status.
644 */
645message AdServicesEncryptionKeyDbTransactionEnded {
646
647  // Encryption key datastore transaction type.
648  enum DbTransactionType {
649    UNKNOWN = 0;
650    READ_TRANSACTION_TYPE = 1;
651    WRITE_TRANSACTION_TYPE = 2;
652  }
653
654  // Encryption key datastore transaction status.
655  enum DbTransactionStatus {
656    UNKNOWN_EXCEPTION = 0;
657    INVALID_KEY= 1;
658    INSERT_EXCEPTION = 2;
659    DELETE_EXCEPTION = 3;
660    SEARCH_EXCEPTION = 4;
661    SUCCESS = 5;
662  }
663
664  // Encryption key dao method names.
665  enum MethodName {
666    UNKNOWN_METHOD = 0;
667    GET_KEY_FROM_ENROLLMENT_ID = 1;
668    GET_KEY_FROM_ENROLLMENT_ID_AND_KEY_TYPE = 2;
669    GET_KEY_FROM_ENROLLMENT_ID_AND_KEY_ID = 3;
670    GET_KEY_FROM_REPORTING_ORIGIN = 4;
671    GET_ALL_KEYS = 5;
672    INSERT_KEY = 6;
673    INSERT_KEYS = 7;
674    DELETE_KEY = 8;
675  }
676
677  // Encryption key datastore transaction type.
678  optional DbTransactionType db_transaction_type = 1;
679  // Encryption key datastore transaction status.
680  optional DbTransactionStatus  db_transaction_status = 2;
681  // Encryption key DAO method name.
682  optional MethodName method_name = 3;
683}
684
685/**
686 * Logs for beacon level reporting for destination registered beacons.
687 */
688message DestinationRegisteredBeacons {
689
690  // Logs the range of key size for interaction key.
691  enum InteractionKeySizeRangeType {
692    UNSET_TYPE = 0;
693    // The key size is smaller than 50% maximum key size.
694    MUCH_SMALLER_THAN_MAXIMUM_KEY_SIZE = 1;
695    // The key size is equal or greater than 50% maximum key size but smaller than maximum key size.
696    SMALLER_THAN_MAXIMUM_KEY_SIZE = 2;
697    // The key size is equal to maximum key size.
698    EQUAL_TO_MAXIMUM_KEY_SIZE = 3;
699    // The key size is greater than maximum key size.
700    LARGER_THAN_MAXIMUM_KEY_SIZE = 4;
701  }
702
703  // What kind of winner did the beacon come from?
704  enum BeaconSource {
705    UNSET = 0;
706    PROTECTED_SIGNALS = 1;
707    CUSTOM_AUDIENCE = 2;
708  }
709
710  // The entity who registered the beacons.
711  optional android.adservices.service.BeaconReportingDestinationType destination = 1;
712
713  // Number of beacons ad-tech tries to register during reportImpression.
714  optional int32 attempted_registered_beacons = 2;
715
716  // Key size range for interactionKey in every registerAdBeacon call.
717  repeated InteractionKeySizeRangeType attempted_key_sizes = 3;
718
719  // Size of registered_ad_interactions database after each update to it.
720  optional int32 table_num_rows = 4;
721
722  // The status response code in AdServices.
723  optional int32 status_code = 5;
724
725  // Which type of signals the beacon come from?
726  optional BeaconSource beacon_source = 6;
727}
728
729/**
730 * Logs for beacon level reporting for ReportInteraction API.
731 */
732message ReportInteractionApiCalled {
733  // The entity who registered the beacons.
734  optional android.adservices.service.BeaconReportingDestinationType destination = 1;
735
736  // Number of matching uris for the reportInteraction request is found.
737  optional int32 num_matching_uris = 2;
738}
739
740/**
741 * Logs for beacon level reporting for clearing interaction reporting table.
742 */
743message InteractionReportingTableCleared {
744  // Number of registered URIs cleared every 24 hours.
745  optional int32 num_uris_cleared = 1;
746
747  // Number of unreported URIs before clearing.
748  optional int32 num_unreported_uris = 2;
749}
750
751/**
752 * Logs a call to check if an app is allowed to call an AdServices API.
753 */
754message AppManifestConfigHelperCalled {
755  // Package name of the app that has been queried about.
756  optional string app_package_name = 1;
757  // Which API was called
758  optional android.adservices.AppApiAccessType api_access_type = 2;
759  // Result of the call
760  optional android.adservices.AppApiAccessResult api_access_result = 3;
761}
762
763/**
764 * Logs for Ad filtering process during join CA.
765 */
766message AdFilteringProcessJoinCAReported {
767  // The status response code in AdServices.
768  optional int32 status_code = 1;
769
770  // The following 5 fields are logging the count of Ads in each bucket
771  // when joining CA with the keys.
772  // The total number of Ads using keys less than the maximum number of keys limitation.
773  optional int32 count_of_ads_with_keys_much_smaller_than_limitation = 2;
774
775  // The total number of Ads using keys are equal or greater than
776  // 50% maximum number of keys limitation but smaller than maximum number of keys limitation.
777  optional int32 count_of_ads_with_keys_smaller_than_limitation = 3;
778
779  // The total number of Ads using keys are equal to maximum number of keys limitation.
780  optional int32 count_of_ads_with_keys_equal_to_limitation = 4;
781
782  // The total number of Ads using keys greater than the maximum number of keys limitation.
783  optional int32 count_of_ads_with_keys_larger_than_limitation = 5;
784
785  // The total number of Ads using empty keys.
786  optional int32 count_of_ads_with_empty_keys = 6;
787
788  // The following 5 fields are logging the count of Ads in each bucket
789  // when joining CA with the filters.
790  // The total number of Ads using filters less than the maximum number of filters limitation.
791  optional int32 count_of_ads_with_filters_much_smaller_than_limitation = 7;
792
793  // The total number of Ads using filters are equal or greater than
794  // 50% maximum number of filters limitation but smaller than maximum number of filters limitation.
795  optional int32 count_of_ads_with_filters_smaller_than_limitation = 8;
796
797  // The total number of Ads using filters are equal to maximum number of filters limitation.
798  optional int32 count_of_ads_with_filters_equal_to_limitation = 9;
799
800  // The total number of Ads using filters greater than the maximum number of filters limitation.
801  optional int32 count_of_ads_with_filters_larger_than_limitation = 10;
802
803  // The total number of Ads using empty filters.
804  optional int32 count_of_ads_with_empty_filters = 11;
805
806  // The total number of used Ad filtering keys per custom audience.
807  optional int32 total_num_of_used_keys = 12;
808
809  // The total number of used Ad filtering filters per custom audience.
810  optional int32 total_num_of_used_filters = 13;
811}
812
813/**
814 * Logs for Ad filtering process during ad selection.
815 */
816message AdFilteringProcessAdSelectionReported {
817  // The process type of Ad filtering.
818  enum FilterProcessType {
819    FILTER_UNSET = 0;
820    FILTER_CUSTOM_AUDIENCES = 1;
821    FILTER_CONTEXTUAL_ADS = 2;
822  }
823
824  // Latency when running the whole Ad filtering process.
825  optional int32 latency_in_millis_of_all_ad_filtering = 1;
826
827  // Latency when calling app install filters in ad filters.
828  optional int32 latency_in_millis_of_app_install_filtering = 2;
829
830  // Latency when calling FCap filters in ad filters.
831  optional int32 latency_in_millis_of_fcap_filters = 3;
832
833  // The status response code in AdServices.
834  optional int32 status_code = 4;
835
836  // The number of Ads which are filtered out of bidding.
837  // The field will be set as FIELD_UNSET if filter_process_type is FILTER_CONTEXTUAL_ADS
838  optional int32 num_of_ads_filtered_out_of_bidding = 5;
839
840  // The number of custom audiences which are filtered out of bidding.
841  optional int32 num_of_custom_audiences_filtered_out_of_bidding = 6;
842
843  // The total number of Ads before Ad filtering process.
844  optional int32 total_num_of_ads_before_filtering = 7;
845
846  // The total number of custom audiences before Ad filtering process.
847  // The field will be set as FIELD_UNSET if filter_process_type is FILTER_CONTEXTUAL_ADS
848  optional int32 total_num_of_custom_audiences_before_filtering = 8;
849
850  // The number of app packages involve in app install filters.
851  optional int32 num_of_package_in_app_install_filters = 9;
852
853  // The number of database operations during ad selection.
854  optional int32 num_of_db_operations = 10;
855
856  // The process type when calling Ad filtering
857  optional FilterProcessType filter_process_type = 11;
858
859  // The number of Ads which are filtered during contextual ads.
860  // The field will be set as FIELD_UNSET if filter_process_type is FILTER_CUSTOM_AUDIENCES
861  optional int32 num_of_contextual_ads_filtered = 12;
862
863  // The number of ad counter keys in fcap filters.
864  optional int32 num_of_ad_counter_keys_in_fcap_filters = 13;
865
866  // The number of contextual Ads filtered out of bidding because of invalid signatures.
867  optional int32 num_of_contextual_ads_filtered_out_of_bidding_invalid_signatures = 14;
868
869  //The number of contextual Ads filtered out of bidding because of no Ads.
870  optional int32 num_of_contextual_ads_filtered_out_of_bidding_no_ads = 15;
871
872  // The total number of contextual Ads before filtering.
873  optional int32 total_num_of_contextual_ads_before_filtering = 16;
874}
875
876/**
877 * Logs for Ad counter histogram updater per DB insertion
878 */
879message AdCounterHistogramUpdaterReported {
880  // Latency when calling Ad counter histogram updater.
881  optional int32 latency_in_millis = 1;
882
883  // The status response code in AdServices.
884  optional int32 status_code = 2;
885
886  // The total number of Ad events in database after Ad counter histogram updater process.
887  optional int32 total_num_of_events_in_database_after_insert = 3;
888
889  // The number of histogram events were inserted in database
890  // during Ad counter histogram updater process.
891  optional int32 num_of_inserted_event = 4;
892
893  // The number of histogram events were evicted from database
894  // during Ad counter histogram updater process.
895  optional int32 num_of_evicted_event = 5;
896}
897
898/**
899 * Logs a request for signature verification for a buyer
900 */
901message SignatureVerification {
902  // Latency of the serialization of a given SignedContextualAds object
903  optional int64 serialization_latency = 1;
904
905  // Latency of fetching the key from key management store
906  optional int64 key_fetch_latency = 2;
907
908  // Latency of the verifying the signature (only the signature verification, without including the
909  // serialization and key fetch)
910  optional int64 verification_latency = 3;
911
912  // Number of keys fetched for a given ad tech
913  optional int32 num_of_keys_fetched = 4;
914
915  // End status of the verification request
916  // A verification request can end in success or a failure
917  optional android.adservices.service.VerificationStatus signature_verification_status = 5;
918
919  // To log in case of failures
920  // Enrollment id of the buyer that has a signature verification failure
921  optional string failed_signature_buyer_enrollment_id = 6;
922
923  // Enrollment id of the seller that has a signature verification failure
924  optional string failed_signature_seller_enrollment_id = 7;
925
926  // Caller package name that has a signature verification failure
927  optional string failed_signature_caller_package_name = 8;
928
929  // Key failure causes
930  // Unknown error
931  optional int32 failure_detail_unknown_error = 9;
932
933  // Enrollment data not found for the buyer or was null
934  optional int32 failure_detail_no_enrollment_data_for_buyer = 10;
935
936  // Zero keys fetched for the buyer
937  optional int32 failure_detail_no_keys_fetched_for_buyer = 11;
938
939  // Signature is not formatted correctly
940  optional int32 failure_detail_wrong_signature_format = 12;
941
942  // Number of keys that has the wrong format
943  optional int32 failure_detail_count_of_keys_with_wrong_format = 13;
944
945  // Number of keys that failed to verified the signature
946  optional int32 failure_detail_count_of_keys_failed_to_verify_signature = 14;
947}
948
949// The status of the event when we make a SignJoin call immediately on receiving an ad winner
950message KAnonImmediateSignJoinStatusReported {
951
952  // The result of the immediate sign join operation
953  optional android.adservices.service.KAnonJobResult result = 1;
954
955  // The total number of messages that the operation attempted to process
956  optional int32 total_messages_attempted = 2;
957
958  // The total number of messages that we failed to join
959  optional int32 messages_failed_to_join = 3;
960
961  // The total number of messages that we failed to sign
962  optional int32 messages_failed_to_sign = 4;
963
964  // The latency in milliseconds of the operation
965  optional int32 latency_in_millis = 5;
966}
967
968// The status of the background job where we read messages from database and make
969// batch sign join calls
970message KAnonBackgroundJobStatusReported {
971
972  // The result of the background sign join job
973  optional android.adservices.service.KAnonJobResult result = 1;
974
975  // The total number of messages that the operation attempted to process
976  optional int32 total_messages_attempted = 2;
977
978  // The total number of messages that are unprocessed in the database after the job run
979  optional int32 messages_unprocessed_in_db_after_job = 3;
980
981  // The total number of messages that we failed to join
982  optional int32 messages_failed_to_join = 4;
983
984  // The total number of messages that we failed to sign
985  optional int32 messages_failed_to_sign = 5;
986
987  // The latency in milliseconds of the operation
988  optional int32 latency_in_millis = 6;
989}
990
991// The status of the K-Anonymous Initialize Operation
992message KAnonInitializeStatusReported {
993
994  // Marks true if the operation was completely successful
995  optional bool was_successful = 1;
996
997  // Marks the action due to which the initialize operation failed
998  optional android.adservices.service.KAnonAction failed_action = 2;
999
1000  // Marks the reason for the action's failure
1001  optional android.adservices.service.KAnonActionResult failed_action_cause = 3;
1002
1003  // The latency in milliseconds of the operation
1004  optional int32 latency_in_millis = 4;
1005
1006}
1007
1008// The status of an individual K-anon sign operation
1009message KAnonSignStatusReported {
1010
1011  // Marks true if the operation was completely successful
1012  optional bool was_successful = 1;
1013
1014  // Marks the action due to which the initialize operation failed
1015  optional android.adservices.service.KAnonAction failed_action = 2;
1016
1017  optional android.adservices.service.KAnonActionResult failed_action_cause = 3;
1018
1019  // The number of messages in a single sign batch
1020  optional int32  number_of_messages_in_batch = 4;
1021
1022  // The latency in milliseconds of the operation
1023  optional int32 latency_in_millis = 5;
1024}
1025
1026// The status of an individual K-Anon join operation
1027message KAnonJoinStatusReported {
1028
1029  // Marks true if the operation was completely successful
1030  optional bool all_successful = 1;
1031
1032  // The total number of messages corresponding to this log event
1033  optional int32 total_messages = 2;
1034
1035  // The total number of messages we failed to join
1036  optional int32 messages_failed_to_join = 3;
1037
1038  // The latency in milliseconds of the operation
1039  optional int32 latency_in_millis = 4;
1040
1041}
1042
1043// The status of the KAnon key attestation certificate generation operation
1044message KAnonKeyAttestationStatusReported {
1045
1046  // The size in bytes of the X.509 certificate chain
1047  optional int32 certificate_size_in_bytes = 1;
1048
1049  // Logs the result code of the Key Attestation operation
1050  optional android.adservices.service.KAnonKeyAttestationResult result_code = 2;
1051
1052  // The latency in milliseconds of the operation
1053  optional int32 latency_in_millis = 3;
1054}
1055
1056/*
1057 * Logs for per API call for GetAdSelectionData API.
1058 */
1059message GetAdSelectionDataApiCalled {
1060  // Size of the payload in KB
1061  optional int32 payload_size_kb = 1;
1062
1063  // Number of buyers participating in this payload
1064  optional int32 num_buyers = 2;
1065
1066  // The status response code in AdServices.
1067  optional int32 status_code = 3;
1068
1069  // The source of the coordinator used, i.e., DEFAULT or provided via API
1070  optional android.adservices.service.ServerAuctionCoordinatorSource coordinator_source = 4;
1071
1072  // Maximum size set by the seller
1073  optional int32 seller_max_size_kb = 5;
1074
1075  // Result of payload optimization
1076  optional android.adservices.service.PayloadOptimizationResult payload_optimization_result = 6;
1077
1078  // Latency of buyer input generation
1079  optional int32 input_generation_latency_ms = 7;
1080
1081  // Version of compressed buyer input creator
1082  optional int32 compressed_buyer_input_creator_version = 8;
1083
1084  // Number of times the entire payload was recompressed to update the current size estimation
1085  optional int32 num_re_estimations = 9;
1086}
1087
1088/**
1089 * Logs per buyer input for GetAdSelectionData API.
1090 */
1091message GetAdSelectionDataBuyerInputGenerated {
1092  // Number of custom audiences in this buyer input
1093  optional int32 num_custom_audiences = 1;
1094
1095  // Number of custom audiences opting into the omit-ads feature
1096  optional int32 num_custom_audiences_omit_ads = 2;
1097
1098  // Mean of the size of a custom audience for this buyer input
1099  optional float custom_audience_size_mean = 3;
1100
1101  // Variance of the size of a custom audience for this buyer input
1102  optional float custom_audience_size_variance = 4;
1103
1104  // Mean of the size of the trusted bidding signals keys for this buyer input
1105  optional float trusted_bidding_signals_keys_size_mean = 5;
1106
1107  // Variance of the size of the trusted bidding signals keys for this buyer input
1108  optional float trusted_bidding_signals_size_variance = 6;
1109
1110  // Mean of the size of the user bidding signals for this buyer input
1111  optional float user_bidding_signals_size_mean = 7;
1112
1113  // Variance of the size of the user bidding signals for this buyer input
1114  optional float user_bidding_signals_size_variance = 8;
1115
1116  // Number of encoded signals payloads included in the auctions
1117  optional int32 num_encoded_signals = 9;
1118
1119  // Mean size of encoded signals payloads
1120  optional int32 encoded_signals_size_mean = 10;
1121
1122  // Max size of encoded signals payloads
1123  optional int32 encoded_signals_size_max = 11;
1124
1125  // Min size of encoded signals payloads
1126  optional int32 encoded_signals_size_min = 12;
1127
1128  // Number of custom audiences in this buyer input sending component ads
1129  optional int32 num_custom_audiences_with_component_ads = 13;
1130}
1131
1132/*
1133 * Logged each time the updateSignals API is called.
1134 */
1135message UpdateSignalsApiCalled {
1136    enum JsonProcessingStatus {
1137        UNSET = 0;
1138        SUCCESS = 1;
1139        TOO_BIG = 2;
1140        SYNTACTIC_ERROR = 3;
1141        SEMANTIC_ERROR = 4;
1142        OTHER_ERROR = 5;
1143    }
1144
1145    // Http response code
1146    optional int32 http_response_code = 1;
1147
1148    // The size of the JSON
1149    optional android.adservices.service.Size json_size = 2;
1150
1151    // The status of JSON processing
1152    optional JsonProcessingStatus json_processing_status = 3;
1153
1154    // Uid of calling app, only included in error cases
1155    optional int32 uid = 4 [(is_uid) = true];
1156
1157    // Adtech's eTLD+1, only included in error cases
1158    optional string adtech_id = 5;
1159}
1160
1161/*
1162 * Logs per encoding background job run
1163 */
1164message EncodingJobRun {
1165    enum EncodingSourceType {
1166      UNSET = 0;
1167      PAS_ENCODING_JOB_SERVICE = 1;
1168      PAS_SERVICE_IMPL = 2;
1169    }
1170
1171    // The number of adtechs who successfully encoded in this background job run
1172    optional int32 signal_encoding_successes = 1;
1173
1174    // The number of adtechs who failed to encoded in this background job run
1175    optional int32 signal_encoding_failures = 2;
1176
1177    // The number of adtechs skipped due to their signals being unmodified
1178    optional int32 signal_encoding_skips = 3;
1179
1180    // The encoding resource type
1181    optional EncodingSourceType encoding_source_type = 4;
1182}
1183
1184/*
1185 * Logs per download of the encoding javascript
1186 */
1187message EncodingJsFetch {
1188    enum JsFetchStatus {
1189        UNSET = 0;
1190        SUCCESS = 1;
1191        TOO_BIG = 2;
1192        TIMEOUT = 3;
1193        NETWORK_FAILURE = 4;
1194        OTHER_FAILURE = 5;
1195    }
1196
1197    // The time to download the js
1198    optional android.adservices.service.Size js_download_time = 1;
1199
1200    // Http response code
1201    optional int32 http_response_code = 2;
1202
1203    // Was the JS rejected for being too big or taking too long?
1204    optional JsFetchStatus fetch_status = 3;
1205
1206    // Adtech's eTLD+1, only included in error cases
1207    optional string adtech_id = 4;
1208}
1209
1210/*
1211 * Logs per execution of the encoding javascript.
1212 */
1213message EncodingJsExecution {
1214    // The time to run the js
1215    optional android.adservices.service.Size js_latency = 1;
1216
1217    // Encoded signals size in bytes
1218    optional android.adservices.service.Size encoded_signals_size = 2;
1219
1220    // JS run status
1221    optional android.adservices.service.JsRunStatus run_status = 3;
1222
1223    // How much memory did the JS use (if this is easy to gather)
1224    optional int32 js_memory_used = 4;
1225
1226    // Adtech's eTLD+1, only included in error cases
1227    optional string adtech_id = 5;
1228}
1229
1230/*
1231 * Logs per API call to persistAdSelectionResult.
1232 */
1233message PersistAdSelectionResultCalled {
1234    enum WinnerType {
1235        UNSET = 0;
1236        NO_WINNER = 1;
1237        CA_WINNER = 2;
1238        PAS_WINNER = 3;
1239    }
1240
1241    // The type of auction winner
1242    optional WinnerType winner = 1;
1243
1244    // Number of component ads in winner
1245    optional int32 num_component_ads = 2;
1246}
1247
1248/** Logs for Topics encryption during epoch computation */
1249message TopicsEncryptionEpochComputationReported {
1250  // Number of topics before encryption during epoch computation process.
1251  optional int32 count_of_topics_before_encryption = 1;
1252
1253  // Number of empty encrypted topics during epoch computation process.
1254  optional int32 count_of_empty_encrypted_topics = 2;
1255
1256  // Number of encrypted topics during epoch computation process.
1257  optional int32 count_of_encrypted_topics = 3;
1258
1259  // The latency in milliseconds of the whole encryption process during epoch computation.
1260  optional int32 latency_of_whole_encryption_process_ms = 4;
1261
1262  // The latency in milliseconds of encryption of each topic.
1263  optional int32 latency_of_encryption_per_topic_ms = 5;
1264
1265  // The latency in milliseconds of persisting encrypted topics to database
1266  // during epoch computation.
1267  optional int32 latency_of_persisting_encrypted_topics_to_db_ms = 6;
1268}
1269
1270/** Logs for encrypted topics during getTopics() API calls */
1271message TopicsEncryptionGetTopicsReported {
1272
1273  // Number of encrypted topics during getTopics() API calls.
1274  optional int32 count_of_encrypted_topics = 1;
1275
1276  // The latency in milliseconds of reading encrypted topics from database
1277  // during getTopics() API calls.
1278  optional int32 latency_of_reading_encrypted_topics_from_db_ms = 2;
1279
1280}
1281/**
1282 * Metrics for each shell command indicating success/failure, latency.
1283 */
1284message AdServicesShellCommandCalled {
1285  // Name of the shell command.
1286  optional android.adservices.Command command = 1;
1287
1288  // Shell command result indicating success/failure.
1289  optional android.adservices.CommandResult result_code = 2;
1290
1291  // Shell command execution latency in milli-second.
1292  optional int32 latency_millis = 3;
1293}
1294
1295/**
1296 * Logs whenever we try to fetch the key from either the database or over network during server
1297 * auction
1298 */
1299message ServerAuctionKeyFetchCalled {
1300  // The source of key fetch. Eg: during auction, background fetch
1301  optional android.adservices.service.ServerAuctionKeyFetchSource source = 1;
1302
1303  // Specifies whether the key was fetched over the network or the database
1304  optional android.adservices.service.ServerAuctionEncryptionKeySource encryption_key_source = 2;
1305
1306  // Whether we used the default coordinator or adtech-provided coordinator via API call
1307  optional android.adservices.service.ServerAuctionCoordinatorSource coordinator_source = 3;
1308
1309  // The status code of the network call
1310  optional int32 network_status_code = 4;
1311
1312  // The latency of network key fetch
1313  optional int32 network_latency_millis = 5;
1314}
1315
1316/** Logs whenever the background key fetch job is scheduled */
1317message ServerAuctionBackgroundKeyFetchScheduled {
1318  optional android.adservices.service.BackgroundKeyFetchStatus status = 1;
1319
1320  optional int32 count_auction_urls = 2;
1321
1322  optional int32 count_join_urls = 3;
1323}
1324
1325/*
1326 * Logs for per API call for SelectAdsFromOutcomes API.
1327 */
1328message SelectAdsFromOutcomesApiCalled {
1329  // Number of IDs passed to the mediation call
1330  optional int32 count_ids = 1;
1331
1332  // Number of non existing IDs during mediation call
1333  optional int32 count_non_existing_ids = 2;
1334
1335  // Specified whether the truncation API call used a prebuilt script.
1336  optional bool used_prebuilt = 3;
1337
1338  // Mediation script download result code.
1339  optional int32 download_result_code = 4;
1340
1341  // Mediation script download latency in milliseconds.
1342  optional int32 download_latency_millis = 5;
1343
1344  // Mediation script execution result code.
1345  optional android.adservices.service.JsRunStatus execution_result_code = 6;
1346
1347  // Mediation script execution latency in milliseconds.
1348  optional int32 execution_latency_millis = 7;
1349}
1350
1351/*
1352 * Logs for per API call for ReportImpression API.
1353 */
1354message ReportImpressionApiCalled {
1355  // Specified whether the BuyerContextualSignals contained ad cost
1356  optional bool reportWin_buyer_additional_signals_contained_ad_cost = 1;
1357
1358  // Specified whether the BuyerContextualSignals contained data version
1359  optional bool reportWin_buyer_additional_signals_contained_data_version = 2;
1360
1361  // Specified whether the SellerContextualSignals contained data version
1362  optional bool reportResult_seller_additional_signals_contained_data_version = 3;
1363
1364  // Result code of the buyer JS script (reportWin)
1365  optional android.adservices.service.JsRunStatus reportWin_js_script_result_code = 4;
1366
1367  // Result code of the seller JS script (reportResult)
1368  optional android.adservices.service.JsRunStatus reportResult_js_script_result_code = 5;
1369}
1370
1371
1372/*
1373 * Logs when JSScriptEngine is used to execute JavaScript code on device.
1374 *
1375 * Logged from Cell Broadcast module:
1376 *   packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/js/
1377 */
1378message JSScriptEngineLatencyReported {
1379  enum LatencyStat {
1380    UNKNOWN = 0;
1381    SANDBOX_INIT = 1;
1382    ISOLATE_CREATE = 2;
1383    JAVA_PROCESS_EXECUTION = 3;
1384    WEBVIEW_PROCESS_EXECUTION = 4;
1385  }
1386
1387  optional LatencyStat stat = 1;
1388  optional int64 latency_millis = 2;
1389}
1390
1391
1392/**
1393 * Logs for AdServices GetTopics API call on T+ only due to repeated fields.
1394 * Keep in sync with AdServicesBackCompatGetTopicsReported for R+ logging.
1395 */
1396message AdServicesGetTopicsReported {
1397  // List of topic ids returned.
1398  repeated int32 topic_ids = 1;
1399
1400  // Number of filtered duplicate topics.
1401  optional int32 duplicate_topic_count = 2;
1402
1403  // Number of filtered blocked topics.
1404  optional int32 filtered_blocked_topic_count = 3;
1405
1406  // Number of topic ids returned.
1407  optional int32 count_of_topic_ids = 4;
1408}
1409
1410/**
1411 * Logs for AdServices Epoch computation GetTopTopics.
1412 */
1413message AdServicesEpochComputationGetTopTopicsReported {
1414  // Number of top topics generated.
1415  optional int32 top_topics_count = 1;
1416
1417  // Number of padded random topics generated.
1418  optional int32 padded_random_topics_count = 2;
1419
1420  // Number of apps considered for calculating top topics.
1421  optional int32 apps_considered_count = 3;
1422
1423  // Number of sdks that called Topics API in the epoch.
1424  optional int32 sdks_considered_count = 4;
1425}
1426
1427/**
1428 * Logs for AdServices Epoch Computation Classifier on T+ only due to repeated fields.
1429 * Keep in sync with AdServicesBackCompatEpochComputationClassifierReported for R+ logging.
1430 * One atom should be logged for each app classification.
1431 */
1432message AdServicesEpochComputationClassifierReported {
1433
1434  // List of topics returned by the classifier for each app. The classification
1435  // does not depend on the user's usage of the app.
1436  repeated int32 topic_ids = 1;
1437
1438  // Build id of the assets.
1439  optional int32 build_id = 2;
1440
1441  // Version of the assets used.
1442  optional string asset_version = 3;
1443
1444  // Type of the classifier used for classifying apps.
1445  enum ClassifierType {
1446    /** Unknown classifier option. */
1447    UNKNOWN_CLASSIFIER = 0;
1448    /** Only on-device classification. */
1449    ON_DEVICE_CLASSIFIER = 1;
1450    /** Only Precomputed classification. */
1451    PRECOMPUTED_CLASSIFIER = 2;
1452    /** Precomputed classification values are preferred over on-device classification values. */
1453    PRECOMPUTED_THEN_ON_DEVICE_CLASSIFIER = 3;
1454  }
1455  optional ClassifierType classifier_type = 4;
1456
1457  // On Device classifier status.
1458  enum OnDeviceClassifierStatus {
1459    ON_DEVICE_CLASSIFIER_STATUS_UNSPECIFIED = 0;
1460    ON_DEVICE_CLASSIFIER_STATUS_NOT_INVOKED = 1;
1461    ON_DEVICE_CLASSIFIER_STATUS_SUCCESS = 2;
1462    ON_DEVICE_CLASSIFIER_STATUS_FAILURE = 3;
1463  }
1464  optional OnDeviceClassifierStatus on_device_classifier_status = 5;
1465
1466  // Precomputed classifier status.
1467  enum PrecomputedClassifierStatus {
1468    PRECOMPUTED_CLASSIFIER_STATUS_UNSPECIFIED = 0;
1469    PRECOMPUTED_CLASSIFIER_STATUS_NOT_INVOKED = 1;
1470    PRECOMPUTED_CLASSIFIER_STATUS_SUCCESS = 2;
1471    PRECOMPUTED_CLASSIFIER_STATUS_FAILURE = 3;
1472  }
1473  optional PrecomputedClassifierStatus precomputed_classifier_status = 6;
1474}
1475
1476/**
1477 * Logs registration response size when registration URI is pinged.
1478 */
1479message AdServicesMeasurementRegistrations {
1480  enum RegistrationType {
1481    UNKNOWN_REGISTRATION = 0;
1482    SOURCE = 1;
1483    TRIGGER = 2;
1484  }
1485
1486  optional RegistrationType type = 1;
1487  optional int64 response_size_in_bytes = 2;
1488  optional string adtech_url_domain_if_size_above_threshold = 3;
1489  optional android.adservices.service.measurement.SourceType source_type = 4;
1490  optional android.adservices.service.measurement.RegistrationSurfaceType surface_type = 5;
1491  optional android.adservices.service.measurement.Status status = 6;
1492  optional android.adservices.service.measurement.RegistrationFailureType failure_type = 7;
1493  // delay (in milliseconds) between registration queue request and the time it gets processed
1494  optional int64 registration_delay_millis = 8;
1495  optional string app_package_name = 9;
1496  optional int32 retry_count = 10;
1497  optional int32 http_response_code = 11;
1498  optional bool is_redirect = 12;
1499  optional bool is_pa_request = 13;
1500  optional int32 num_entities_deleted = 14;
1501  optional bool is_event_level_epsilon_configured = 15;
1502  optional bool is_trigger_aggregatable_value_filters_configured = 16;
1503  optional bool is_trigger_filtering_id_configured = 17;
1504  optional bool is_trigger_context_id_configured = 18;
1505}
1506
1507
1508/**
1509 * Logs for the bidding stage of an ad selection process when the getBuyersCustomAudience() or
1510 * the runAdBidding() is called.
1511 */
1512message RunAdBiddingProcessReported {
1513  /* Logs when the getBuyersCustomAudience() is called. */
1514  optional int32 get_buyers_custom_audience_latency_in_millis = 1;
1515  optional int32 get_buyers_custom_audience_result_code = 2;
1516  optional int32 num_buyers_requested = 3;
1517  optional int32 num_buyers_fetched = 4;
1518
1519  /* Logs when the runAdBidding() is called. */
1520  optional int32 num_of_ads_entering_bidding = 5;
1521  optional int32 num_of_cas_entering_bidding = 6;
1522  optional int32 num_of_cas_post_bidding = 7;
1523  optional float ratio_of_cas_selecting_rmkt_ads = 8;
1524  optional int32 run_ad_bidding_latency_in_millis = 9;
1525  optional int32 run_ad_bidding_result_code = 10;
1526
1527  /* Time from the start of the getBuyersCustomAudience() to the end of the runAdBidding(). */
1528  optional int32 total_ad_bidding_stage_latency_in_millis = 11;
1529}
1530
1531/**
1532 * Logs for the scoring stage of an ad selection process when the runAdScoring() is called.
1533 */
1534message RunAdScoringProcessReported {
1535  /* Logs when the getAdSelectionLogic() is called. */
1536  optional int32 get_ad_selection_logic_latency_in_millis = 1;
1537  optional int32 get_ad_selection_logic_result_code = 2;
1538  optional android.adservices.service.ScriptType get_ad_selection_logic_script_type = 3;
1539  optional int32 fetched_ad_selection_logic_script_size_in_bytes = 4;
1540
1541  /* Logs when the getTrustedScoringSignals() is called. */
1542  optional int32 get_trusted_scoring_signals_latency_in_millis = 5;
1543  optional int32 get_trusted_scoring_signals_result_code = 6;
1544  optional int32 fetched_trusted_scoring_signals_data_size_in_bytes = 7;
1545
1546  /* Logs when the getAdScores() is called. */
1547  // the total scoreAds script execution time when getAdScores() is called.
1548  optional int32 score_ads_latency_in_millis = 8;
1549  // the overall latency of the getAdScores().
1550  optional int32 get_ad_scores_latency_in_millis = 9;
1551  optional int32 get_ad_scores_result_code = 10;
1552
1553  optional int32 num_of_cas_entering_scoring = 11;
1554  optional int32 num_of_remarketing_ads_entering_scoring = 12;
1555  optional int32 num_of_contextual_ads_entering_scoring = 13;
1556  // the overall latency of the runAdScoring process.
1557  optional int32 run_ad_scoring_latency_in_millis = 14;
1558  optional int32 run_ad_scoring_result_code = 15;
1559
1560  /* Logs when data header is used in scoreAd. */
1561  optional bool scoreAd_seller_additional_signals_contained_data_version = 16;
1562  optional android.adservices.service.JsRunStatus scoreAd_js_script_result_code = 17;
1563}
1564
1565/* Logs for the ad selection process when the runAdSelection() is called.*/
1566message RunAdSelectionProcessReported {
1567  /* Logs for the persisting ad selection process. */
1568  optional bool is_remarketing_ads_won = 1;
1569  optional int32 db_ad_selection_size_in_bytes = 2;
1570  optional int32 persist_ad_selection_latency_in_millis = 3;
1571  optional int32 persist_ad_selection_result_code = 4;
1572
1573  /* Logs for the overall runAdSelection process. */
1574  optional int32 run_ad_selection_latency_in_millis = 5;
1575  optional int32 run_ad_selection_result_code = 6;
1576}
1577
1578/**
1579 *  Logs for the bidding process on a single custom audience when the runAdBiddingPerCA() is called.
1580 */
1581message RunAdBiddingPerCAProcessReported {
1582  optional int32 num_of_ads_for_bidding = 1;
1583  optional int32 run_ad_bidding_per_ca_latency_in_millis = 2;
1584  optional int32 run_ad_bidding_per_ca_result_code = 3;
1585
1586  /* Logs for the getting buyer's decision logic script process. */
1587  optional int32 get_buyer_decision_logic_latency_in_millis = 4;
1588  optional int32 get_buyer_decision_logic_result_code = 5;
1589  optional android.adservices.service.ScriptType buyer_decision_logic_script_type = 6;
1590  optional int32 fetched_buyer_decision_logic_script_size_in_bytes = 7;
1591
1592  /* Logs for the getting trusted bidding signals process. */
1593  optional int32 num_of_keys_of_trusted_bidding_signals = 8;
1594  optional int32 fetched_trusted_bidding_signals_data_size_in_bytes = 9;
1595  optional int32 get_trusted_bidding_signals_latency_in_millis = 10;
1596  optional int32 get_trusted_bidding_signals_result_code = 11;
1597
1598  /* Logs when runBidding() is called. */
1599  // the total generateBids script execution time when runBidding() is called..
1600  optional int32 generate_bids_latency_in_millis = 12;
1601  // the overall latency of runBidding().
1602  optional int32 run_bidding_latency_in_millis = 13;
1603  optional int32 run_bidding_result_code = 14;
1604
1605  /* Logs when CPC is used. */
1606  optional bool run_ad_bidding_per_ca_returned_ad_cost = 15;
1607
1608  /* Logs when data header is used in GenerateBid. */
1609  optional bool generateBid_buyer_additional_signals_contained_data_version = 16;
1610  optional android.adservices.service.JsRunStatus generateBid_js_script_result_code = 17;
1611}
1612
1613/**
1614 *  Logs for an updating a single custom audience process when the updateCustomAudience() is called.
1615 */
1616message UpdateCustomAudienceProcessReported {
1617  optional int32 latency_in_millis = 1;
1618  optional int32 result_code = 2;
1619  optional int32 data_size_of_ads_in_bytes = 3;
1620  optional int32 num_of_ads = 4;
1621}
1622
1623
1624/**
1625 *  Logs for a background fetch process when the runBackgroundFetch() is called.
1626 */
1627message BackgroundFetchProcessReported {
1628  optional int32 latency_in_millis = 1;
1629  optional int32 num_of_eligible_to_update_cas = 2;
1630  optional int32 result_code = 3;
1631}
1632
1633/**
1634 * Logs when various Privacy Sandbox settings are used.
1635 */
1636message AdServicesSettingsUsageReported {
1637  // Region of the user who interacted with AdServicesSettings UI.
1638  enum AdServiceSettingRegion {
1639    // fallback when getDeviceRegion call failed.
1640    REGION_UNSPECIFIED = 0;
1641    // European Union user (based on isoCountryInfo).
1642    EU = 1;
1643    // Non-European Union user (based on isoCountryInfo).
1644    ROW = 2;
1645  }
1646  // Region where the device was used.
1647  optional AdServiceSettingRegion region = 1;
1648
1649  // UI settings page action performed by the user.
1650  enum AdServiceSettingsName {
1651    // fallback when getAction call failed.
1652    ACTION_UNSPECIFIED = 0;
1653    // notification was requested to be sent to the user.
1654    REQUESTED_NOTIFICATION = 1;
1655    // the notification landing page was displayed.
1656    LANDING_PAGE_DISPLAYED = 2;
1657    // user opt-in for PP API.
1658    OPT_IN_SELECTED = 3;
1659    // user opt-out of PP API.
1660    OPT_OUT_SELECTED = 4;
1661    // the topics page was displayed.
1662    MANAGE_TOPICS_SELECTED = 5;
1663    // the fledge page was displayed.
1664    MANAGE_APPS_SELECTED = 6;
1665    // user reset topics.
1666    RESET_TOPIC_SELECTED = 7;
1667    /// user reset fledge apps.
1668    RESET_APP_SELECTED = 8;
1669    // user blocked topics.
1670    BLOCK_TOPIC_SELECTED = 9;
1671    // user unblocked topics.
1672    UNBLOCK_TOPIC_SELECTED = 10;
1673    // user blocked fledge apps.
1674    BLOCK_APP_SELECTED = 11;
1675    // user unblocked fledge apps.
1676    UNBLOCK_APP_SELECTED = 12;
1677    // Measurement page and data reset.
1678    MANAGE_MEASUREMENT_SELECTED = 13;
1679    RESET_MEASUREMENT_SELECTED = 14;
1680    // user opt-in to topics.
1681    TOPICS_OPT_IN_SELECTED = 15;
1682    // user opt-out of topics.
1683    TOPICS_OPT_OUT_SELECTED = 16;
1684    // user opt-in to fledge.
1685    FLEDGE_OPT_IN_SELECTED = 17;
1686    // user opt-out of fledge.
1687    FLEDGE_OPT_OUT_SELECTED = 18;
1688    // user opt-in to measurement.
1689    MEASUREMENT_OPT_IN_SELECTED = 19;
1690    // user opt-out of measurement.
1691    MEASUREMENT_OPT_OUT_SELECTED = 20;
1692    // Notification and landing page for kids policy
1693    // notification was requested for GA  user.
1694    GA_UX_NOTIFICATION_REQUESTED = 21;
1695    // GA landing page was displayed.
1696    GA_UX_NOTIFICATION_LANDING_PAGE_DISPLAYED = 22;
1697    // GA confirmation page was displayed.
1698    GA_UX_NOTIFICATION_CONFIRMATION_PAGE_DISPLAYED = 23;
1699    // GA version of opt_in/out selected.
1700    // opt-in for GA user.
1701    NOTIFICATION_OPT_IN_SELECTED = 24;
1702    // opt-out for GA user.
1703    NOTIFICATION_OPT_OUT_SELECTED = 25;
1704    // user selected manage settings in consent notification.
1705    NOTIFICATION_MANAGE_SETTINGS_SELECTED = 26;
1706    // the privacy sandbox settings page was displayed.
1707    PRIVACY_SANDBOX_SETTINGS_PAGE_DISPLAYED = 27;
1708    // the confirmation page was displayed for a user.
1709    CONFIRMATION_PAGE_DISPLAYED = 28;
1710    // notification was blocked by a user.
1711    NOTIFICATION_DISABLED = 29;
1712    // notification was blocked by a GA user.
1713    GA_UX_NOTIFICATION_DISABLED = 30;
1714    // notification was displayed to a user.
1715    NOTIFICATION_DISPLAYED = 31;
1716    // notification was displayed to a GA user.
1717    GA_UX_NOTIFICATION_DISPLAYED = 32;
1718    // user clicked on the more button on the landing page.
1719    LANDING_PAGE_MORE_BUTTON_CLICKED = 33;
1720    // GA user clicked on the more button on the landing page.
1721    GA_UX_LANDING_PAGE_MORE_BUTTON_CLICKED = 34;
1722    // user clicked the additional info button on the landing page.
1723    LANDING_PAGE_ADDITIONAL_INFO_CLICKED = 35;
1724    // GA user clicked the additional info button on the landing page.
1725    GA_UX_LANDING_PAGE_ADDITIONAL_INFO_CLICKED = 36;
1726    // user scrolled the landing page.
1727    LANDING_PAGE_SCROLLED = 37;
1728    // GA user scrolled the landing page.
1729    GA_UX_LANDING_PAGE_SCROLLED = 38;
1730    // user scrolled to the bottom of the landing page.
1731    LANDING_PAGE_SCROLLED_TO_BOTTOM = 39;
1732    // GA user scrolled to the bottom of the landing page.
1733    GA_UX_LANDING_PAGE_SCROLLED_TO_BOTTOM = 40;
1734    // user clicked the settings button on the landing page.
1735    LANDING_PAGE_SETTINGS_BUTTON_CLICKED = 41;
1736    // GA user clicked the settings button on the landing page.
1737    GA_UX_LANDING_PAGE_SETTINGS_BUTTON_CLICKED = 42;
1738    // user clicked the got it button on the landing page.
1739    LANDING_PAGE_GOT_IT_BUTTON_CLICKED = 43;
1740    // GA user clicked the got it button on the landing page.
1741    GA_UX_LANDING_PAGE_GOT_IT_BUTTON_CLICKED = 44;
1742    // user clicked opt-out on the landing page.
1743    LANDING_PAGE_OPT_OUT_CLICKED = 45;
1744    // GA user clicked opt-out on the landing page.
1745    GA_UX_LANDING_PAGE_OPT_OUT_CLICKED = 46;
1746    // user dismissed the landing page.
1747    LANDING_PAGE_DISMISSED = 47;
1748    // GA user dismissed the landing page.
1749    GA_UX_LANDING_PAGE_DISMISSED = 48;
1750    // user opt-in from the landing page.
1751    LANDING_PAGE_OPT_IN = 49;
1752    // GA user opt-in from the landing page.
1753    GA_UX_LANDING_PAGE_OPT_IN = 50;
1754    // user clicked settings on the opt-in confirmation page.
1755    OPT_IN_CONFIRMATION_PAGE_SETTINGS_CLICKED = 51;
1756    // GA user clicked settings on the opt-in confirmation page.
1757    GA_UX_OPT_IN_CONFIRMATION_PAGE_SETTINGS_CLICKED = 52;
1758    // user clicked settings on the opt-out confirmation page.
1759    OPT_OUT_CONFIRMATION_PAGE_SETTINGS_CLICKED = 53;
1760    // GA user clicked settings on the opt-out confirmation page.
1761    GA_UX_OPT_OUT_CONFIRMATION_PAGE_SETTINGS_CLICKED = 54;
1762    // user clicked got it on the opt-in confirmation page.
1763    OPT_IN_CONFIRMATION_PAGE_GOT_IT_CLICKED = 55;
1764    // GA user clicked got it on the opt-in confirmation page.
1765    GA_UX_OPT_IN_CONFIRMATION_PAGE_GOT_IT_CLICKED = 56;
1766    // user clicked got it on the opt-out confirmation page.
1767    OPT_OUT_CONFIRMATION_PAGE_GOT_IT_CLICKED = 57;
1768    // GA user clicked got it on the opt-out confirmation page.
1769    GA_UX_OPT_OUT_CONFIRMATION_PAGE_GOT_IT_CLICKED = 58;
1770    // user dismissed confirmation page.
1771    CONFIRMATION_PAGE_DISMISSED = 59;
1772    // GA user dismissed confirmation page.
1773    GA_UX_CONFIRMATION_PAGE_DISMISSED = 60;
1774    // user clicked more info on the opt in confirmation page.
1775    OPT_IN_CONFIRMATION_PAGE_MORE_INFO_CLICKED = 61;
1776    // user clicked more info on the opt out confirmation page.
1777    OPT_OUT_CONFIRMATION_PAGE_MORE_INFO_CLICKED = 62;
1778    // GA user clicked more info on the opt in confirmation page.
1779    GA_UX_OPT_IN_CONFIRMATION_PAGE_MORE_INFO_CLICKED = 63;
1780    // GA user clicked more info on the opt out confirmation page.
1781    GA_UX_OPT_OUT_CONFIRMATION_PAGE_MORE_INFO_CLICKED = 64;
1782    // GA user clicked opt out on the landing page.
1783    GA_UX_LANDING_PAGE_OPT_OUT = 65;
1784    // user clicked opt out on the landing page.
1785    LANDING_PAGE_OPT_OUT = 66;
1786    // (enrolled) user clicked on the privacy sandbox entry point.
1787    PRIVACY_SANDBOX_ENTRY_POINT_CLICKED = 67;
1788    // daily maintenance job was run.
1789    DAILY_MAINTENANCE_JOB_FINISHED = 68;
1790    // GA user clicked the 2nd additional info button on the landing page.
1791    GA_UX_LANDING_PAGE_ADDITIONAL_INFO_2_CLICKED = 69;
1792  }
1793  // UI action performed by user.
1794  optional AdServiceSettingsName action = 2;
1795
1796  enum AdServicesSettingsDefaultConsent {
1797    // fallback when getDefaultConsent failed.
1798    CONSENT_UNSPECIFIED = 0;
1799    // user was opted-in to PP API by default.
1800    PP_API_DEFAULT_OPT_IN = 1;
1801    // user was opted-out of PP API by default.
1802    PP_API_DEFAULT_OPT_OUT = 2;
1803    // user was opted-in to topics by default.
1804    TOPICS_DEFAULT_OPT_IN = 3;
1805    // user was opted-in to topics by default.
1806    TOPICS_DEFAULT_OPT_OUT = 4;
1807    // user was opted-in to fledge by default.
1808    FLEDGE_DEFAULT_OPT_IN = 5;
1809    // user was opted-in to fledge by default.
1810    FLEDGE_DEFAULT_OPT_OUT = 6;
1811    // user was opted-in to measurement by default.
1812    MEASUREMENT_DEFAULT_OPT_IN = 7;
1813    // user was opted-in to measurement by default.
1814    MEASUREMENT_DEFAULT_OPT_OUT = 8;
1815  }
1816  // AdServices consents of a user when consent notification was first sent.
1817  optional AdServicesSettingsDefaultConsent default_consent = 3;
1818
1819  // AdId state of a user when consent notification was first sent.
1820  enum AdServicesSettingsDefaultAdIdState {
1821    // fallback when getDefaultAdId failed.
1822    STATE_UNSPECIFIED = 0;
1823    // AdId was not zeroed-out when user first received consent notification.
1824    AD_ID_ENABLED = 1;
1825    // AdId was zeroed-out when user first received consent notification.
1826    AD_ID_DISABLED = 2;
1827  }
1828
1829  // Default ad id state when consent notification was first sent.
1830  optional AdServicesSettingsDefaultAdIdState default_ad_id_state = 4;
1831
1832  // (Deprecated) Type of AdService feature running on device.
1833  enum PrivacySandboxFeatureType {
1834    // fallback when getFeature failed.
1835    FEATURE_UNSPECIFIED = 0;
1836    // the first consent feature is enabled.
1837    PRIVACY_SANDBOX_FIRST_CONSENT = 1;
1838    // the reconsent feature is enabled.
1839    PRIVACY_SANDBOX_RECONSENT = 2;
1840    // privacy sandbox is not yet supported on the device.
1841    PRIVACY_SANDBOX_UNSUPPORTED = 3;
1842    // privacy sandbox is already running on the device.
1843    PRIVACY_SANDBOX_ALREADY_RUNNING = 4;
1844    // the first consent feature with flipped flow is enabled.
1845    PRIVACY_SANDBOX_FIRST_CONSENT_FF = 5;
1846    // the reconsent feature with flipped flow is enabled.
1847    PRIVACY_SANDBOX_RECONSENT_FF = 6;
1848  }
1849
1850  // (Deprecated) Privacy sandbox feature currently running on the device.
1851  optional PrivacySandboxFeatureType feature_type = 5 [deprecated = true];
1852
1853  // Type of privacy sandbox UX.
1854  enum PrivacySandboxUx {
1855    // fallback when no UX can be selected.
1856    UNSUPPORTED_UX = 0;
1857    // all UXs that are not unspecified.
1858    UNSPECIFIED_UX = 1;
1859    // GA UX.
1860    GA_UX = 2;
1861    // Beta UX.
1862    BETA_UX = 3;
1863    // UX for Android RVC.
1864    RVC_UX = 4;
1865    // GA UX with Updated PAS APIs
1866    GA_UX_WITH_PAS = 5;
1867  }
1868
1869  // Type of privacy sandbox UX.
1870  optional PrivacySandboxUx ux = 6;
1871
1872  // Type of privacy sandbox enrollment channel.
1873  enum PrivacySandboxUxEnrollmentChannel {
1874    // fallback when no enrollment channel can be selected.
1875    UNSUPPORTED_CHANNEL = 0;
1876    // all enrollment channels that are unspecified.
1877    UNSPECIFIED_CHANNEL = 1;
1878    // already enrolled channel.
1879    ALREADY_ENROLLED_CHANNEL = 2;
1880    // consent notification debug channel.
1881    CONSENT_NOTIFICATION_DEBUG_CHANNEL = 3;
1882    // first consent notification.
1883    FIRST_CONSENT_NOTIFICATION_CHANNEL = 4;
1884    // reconsent notification.
1885    RECONSENT_NOTIFICATION_CHANNEL = 5;
1886    // consent notification reset channel.
1887    CONSENT_NOTIFICATION_RESET_CHANNEL = 6;
1888    // 2nd GA notification post R OTA.
1889    RVC_POST_OTA_NOTIFICATION_CHANNEL = 7;
1890    // PAS first notification channel
1891    PAS_FIRST_NOTIFICATION_CHANNEL = 8;
1892    // PAS renotify notification channel
1893    PAS_RENOTIFY_NOTIFICATION_CHANNEL = 9;
1894  }
1895
1896  // Type of privacy sandbox enrollment channel.
1897  optional PrivacySandboxUxEnrollmentChannel enrollment_channel = 7;
1898}
1899
1900/**
1901* Container for MobileDataDownloadFileGroupStorageStats
1902*/
1903message MobileDataDownloadStorageStats {
1904  repeated MobileDataDownloadFileGroupStorageStats mobile_data_download_file_group_storage_stats = 1;
1905}
1906
1907/**
1908* Storage stats for a single file group. This is logged as a nested field and is not meant to be logged as a top level proto.
1909*/
1910message MobileDataDownloadFileGroupStorageStats {
1911  // The total number of bytes used by this file group
1912  optional int64 total_bytes_used = 1;
1913  // The total number of inline file bytes used by this file group
1914  optional int64 total_inline_bytes_used = 2;
1915  // The number of bytes used for the downloaded version of the file group
1916  optional int64 downloaded_group_bytes_used = 3;
1917  // Specifies which file group this storage is associated with
1918  optional MobileDataDownloadFileGroupStats file_group_stats = 4 [(log_mode) = MODE_BYTES];
1919}
1920
1921/**
1922* Logs stats on the amount of storage being used by file groups.
1923*/
1924message MobileDataDownloadFileGroupStorageStatsReported {
1925  // Storage stats for all file groups in the MDD Instance
1926  optional MobileDataDownloadStorageStats storage_stats = 1  [(log_mode) = MODE_BYTES];
1927  // All the bytes used by mdd file groups
1928  optional int64 total_mdd_bytes_used = 2;
1929  // All the bytes used in the entire mdd directory
1930  optional int64 total_mdd_directory_bytes_used = 3;
1931}
1932
1933/**
1934* Logs stats on the result of download attempts of file groups. Provides info on individual download attempts.
1935*/
1936message MobileDataDownloadDownloadResultReported {
1937  // The result of the download attempt
1938  optional android.stats.mobiledatadownload.DownloadResult download_result = 1;
1939
1940  // Specifies which file group the download attempt was for
1941  optional MobileDataDownloadFileGroupStats file_group_stats = 2 [(log_mode) = MODE_BYTES];
1942}
1943
1944/**
1945 * Logs stats on the download status of file groups. Provides information on
1946 * download latency and download penetration.
1947 */
1948message MobileDataDownloadFileGroupDownloadStatusReported {
1949  // The status of the file group on device: PENDING, DOWNLOADED, FAILED
1950  optional android.stats.mobiledatadownload.DownloadStatus
1951      file_group_download_status = 1;
1952  // Timestamp of when this file group was added to the device.
1953  optional int64 group_added_timestamp = 2;
1954  // Timestamp of when MDD completed downloading the file group.
1955  optional int64 group_downloaded_timestamp = 3;
1956  // Stats specific to the file group
1957  optional MobileDataDownloadFileGroupStats file_group_stats = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1958  // Number of days since the last time the device attempted to log file group download status for any file group.
1959  optional int32 days_since_last_log = 5;
1960}
1961
1962/** Shared data among MobileDataDownload statistics. Not meant to be a top level atom proto.*/
1963message MobileDataDownloadFileGroupStats {
1964  // The name of the file group. This a string set server side used to retrieve
1965  // the files. Does not contain PII.
1966  optional string file_group_name = 1;
1967  // Allows the clients to identify a file group based on a given set of
1968  // properties. This string is set server side and does not contain PII.
1969  optional string variant_id = 2;
1970  // Identifier for the data file group created to identify the version of the
1971  // file group.
1972  optional int64 build_id = 3;
1973  // The number of files in the file group.
1974  optional int32 file_count = 4;
1975  // Whether the file group has an account associated with it.
1976  optional bool has_account = 5;
1977  // Inverse of the sampling rate used to sample this event.
1978  optional int32 sampling_interval = 6;
1979  // Note: we do not have owner_package since that's already transmitted.
1980}
1981
1982/** Download latency stats logged after download completes. */
1983message MobileDataDownloadLatencyReported {
1984  // The number of download attempts needed to fully download the file group.
1985  optional int32 download_attempt_count = 1;
1986
1987  // The download latency in milliseconds, which is the time elapsed between
1988  // download started and download complete.
1989  optional int64 download_latency_ms = 2;
1990
1991  // The total MDD download latency in milliseconds, which is the time elapsed
1992  // between new config received and download complete.
1993  // True E2E download latency = Flag propagation latency + MDD total download
1994  // latency. Here we are talking about the later.
1995  optional int64 total_latency_ms = 3;
1996  optional MobileDataDownloadFileGroupStats file_group_stats = 4
1997  [(log_mode) = MODE_BYTES];
1998}
1999
2000/**
2001 * Logs when an AdServices measurement reports are being uploaded.
2002 */
2003message AdServicesMeasurementReportsUploaded {
2004  enum ReportType {
2005    UNKNOWN_REPORT = 0;
2006    EVENT = 1;
2007    AGGREGATE = 2;
2008    DEBUG_EVENT = 3;
2009    DEBUG_AGGREGATE = 4;
2010    VERBOSE_DEBUG_SOURCE_DESTINATION_LIMIT = 5;
2011    VERBOSE_DEBUG_SOURCE_NOISED = 6;
2012    VERBOSE_DEBUG_SOURCE_STORAGE_LIMIT = 7;
2013    VERBOSE_DEBUG_SOURCE_SUCCESS = 8;
2014    VERBOSE_DEBUG_SOURCE_UNKNOWN_ERROR = 9;
2015    VERBOSE_DEBUG_SOURCE_FLEXIBLE_EVENT_REPORT_VALUE_ERROR = 10;
2016    VERBOSE_DEBUG_TRIGGER_AGGREGATE_DEDUPLICATED = 11;
2017    VERBOSE_DEBUG_TRIGGER_AGGREGATE_INSUFFICIENT_BUDGET = 12;
2018    VERBOSE_DEBUG_TRIGGER_AGGREGATE_NO_CONTRIBUTIONS = 13;
2019    VERBOSE_DEBUG_TRIGGER_AGGREGATE_REPORT_WINDOW_PASSED = 14;
2020    VERBOSE_DEBUG_TRIGGER_ATTRIBUTIONS_PER_SOURCE_DESTINATION_LIMIT = 15;
2021    VERBOSE_DEBUG_TRIGGER_EVENT_DEDUPLICATED = 16;
2022    VERBOSE_DEBUG_TRIGGER_EVENT_EXCESSIVE_REPORTS = 17;
2023    VERBOSE_DEBUG_TRIGGER_EVENT_LOW_PRIORITY = 18;
2024    VERBOSE_DEBUG_TRIGGER_EVENT_NO_MATCHING_CONFIGURATIONS = 19;
2025    VERBOSE_DEBUG_TRIGGER_EVENT_NOISE = 20;
2026    VERBOSE_DEBUG_TRIGGER_EVENT_REPORT_WINDOW_PASSED = 21;
2027    VERBOSE_DEBUG_TRIGGER_NO_MATCHING_FILTER_DATA = 22;
2028    VERBOSE_DEBUG_TRIGGER_NO_MATCHING_SOURCE = 23;
2029    VERBOSE_DEBUG_TRIGGER_REPORTING_ORIGIN_LIMIT = 24;
2030    VERBOSE_DEBUG_TRIGGER_EVENT_STORAGE_LIMIT = 25;
2031    VERBOSE_DEBUG_TRIGGER_UNKNOWN_ERROR = 26;
2032    VERBOSE_DEBUG_TRIGGER_AGGREGATE_STORAGE_LIMIT = 27;
2033    VERBOSE_DEBUG_TRIGGER_AGGREGATE_EXCESSIVE_REPORTS = 28;
2034    VERBOSE_DEBUG_TRIGGER_EVENT_REPORT_WINDOW_NOT_STARTED = 29;
2035    VERBOSE_DEBUG_TRIGGER_EVENT_NO_MATCHING_TRIGGER_DATA = 30;
2036    VERBOSE_DEBUG_TRIGGER_EVENT_ATTRIBUTIONS_PER_SOURCE_DESTINATION_LIMIT = 31;
2037    VERBOSE_DEBUG_TRIGGER_AGG_ATTRIBUTIONS_PER_SOURCE_DESTINATION_LIMIT = 32;
2038    VERBOSE_DEBUG_HEADER_ERROR = 33;
2039    AGGREGATE_DEBUG_REPORT = 34;
2040    VERBOSE_DEBUG_UNKNOWN = 9999;
2041  }
2042
2043  optional ReportType type = 1;
2044
2045  enum ReportUploadStatus {
2046    UNKNOWN_STATUS = 0;
2047    SUCCESS = 1;
2048    FAILURE = 2;
2049  }
2050
2051  optional ReportUploadStatus response_code = 2;
2052  optional android.adservices.service.measurement.ReportUploadFailureType failure_type = 3;
2053  optional android.adservices.service.measurement.ReportUploadMethod upload_method = 4;
2054  // delay (in milliseconds) between scheduled delivery time and actual delivery time.
2055  optional int64 reporting_delay_millis = 5;
2056  optional string app_package_name = 6;
2057  optional int32 retry_count = 7;
2058  optional int32 http_response_code = 8;
2059  optional bool is_marked_for_deletion = 9;
2060  optional bool is_fake_report = 10;
2061}
2062
2063/**
2064 * Logs when an AdServices api is called.
2065 */
2066message AdServicesApiCalled {
2067
2068  optional android.adservices.common.api.metrics.AdServicesApiClassType api_class = 1;
2069
2070  // The actual name of the api within the 3 classes described above.
2071  optional android.adservices.common.api.metrics.AdServicesApiName api_name = 2;
2072
2073  optional string app_package_name = 3;
2074  optional string sdk_package_name = 4;
2075
2076  optional int32 latency_millis = 5;
2077
2078  // response_code is the error code for the given api.
2079  optional int32 response_code = 6;
2080}
2081
2082/**
2083 * Logs Cobalt logging events in AdServices. This provides information about
2084 * Cobalt operational metrics.
2085 */
2086message AdServicesCobaltLoggerEventReported{
2087  // The Cobalt metric id of the event that is being logged. The metric id is defined in
2088  // packages/modules/AdServices/adservices/libraries/cobalt/proto/metric_definition.proto
2089  optional int32 metric_id = 1;
2090
2091  // The Cobalt report id of the event that is being logged. The report id is defined in
2092  // packages/modules/AdServices/adservices/libraries/cobalt/proto/report_definition.proto
2093  optional int32 report_id = 2;
2094
2095  // Logging event which is over the defined threshold in the registry.
2096  optional android.adservices.CobaltLoggingEvent cobalt_logging_event = 3;
2097}
2098
2099/**
2100 * Logs Cobalt periodic job execution events in AdServices. The periodic job
2101 * event contains
2102 * Cobalt metrics upload status.
2103 */
2104message AdServicesCobaltPeriodicJobEventReported {
2105  optional android.adservices.CobaltPeriodicJobEvent cobalt_periodic_job_event = 1;
2106}
2107
2108// Logs when updateSignals api is called.
2109message UpdateSignalsProcessReported {
2110  // The updated signals process latency in milliseconds for this API call.
2111  optional int32 update_signals_process_latency_millis = 1;
2112
2113  // Adservices api status code for this API call.
2114  optional int32 adservices_api_status_code = 2;
2115
2116  // Number of signals written for this API call.
2117  optional int32 signals_written_count = 3;
2118
2119  // Number of keys from downloaded JSON for this API call.
2120  optional int32 keys_stored_count = 4;
2121
2122  // Number of values from downloaded JSON for this API call.
2123  optional int32 values_stored_count = 5;
2124
2125  // Number of eviction rules for this API call.
2126  optional int32 eviction_rules_count = 6;
2127
2128  // The bucketed size of the buyer who called the APIs signals.
2129  optional android.adservices.service.Size per_buyer_signal_size = 7;
2130
2131  // The average size of raw protected signals per buyer in bytes.
2132  optional float mean_raw_protected_signals_size_bytes = 8;
2133
2134  // The maximum size of raw protected signals per buyer in bytes.
2135  optional float max_raw_protected_signals_size_bytes = 9;
2136
2137  // The minimum size of raw protected signals per buyer in bytes.
2138  optional float min_raw_protected_signals_size_bytes = 10;
2139}
2140
2141/** Logs for Topics epoch job setting during scheduling EpochJobService. */
2142message TopicsScheduleEpochJobSettingReported {
2143  // Status when forcing reschedule EpochJob.
2144  enum RescheduleEpochJobStatus {
2145    STATUS_UNSET = 0;
2146    RESCHEDULE_SUCCESS = 1;
2147    SKIP_RESCHEDULE_EMPTY_JOB_SCHEDULER = 2;
2148    SKIP_RESCHEDULE_EMPTY_PENDING_JOB = 3;
2149  }
2150
2151  // Epoch job setting of the EpochJob.
2152  enum EpochJobBatteryConstraint {
2153    UNKNOWN_SETTING = 0;
2154    REQUIRES_CHARGING = 1;
2155    REQUIRES_BATTERY_NOT_LOW = 2;
2156  }
2157
2158  // Status when forcing reschedule EpochJob.
2159  optional RescheduleEpochJobStatus reschedule_epoch_job_status = 1;
2160
2161  // The previous epoch job setting.
2162  // This field will be UNKNOWN_SETTING when reschedule_epoch_job_status is not RESCHEDULE_SUCCESS.
2163  optional EpochJobBatteryConstraint previous_epoch_job_setting = 2;
2164
2165  // The current epoch job setting.
2166  // This field will be UNKNOWN_SETTING when reschedule_epoch_job_status is not RESCHEDULE_SUCCESS.
2167  optional EpochJobBatteryConstraint current_epoch_job_setting = 3;
2168
2169  // The epoch job setting when scheduling the epoch job in EpochJobService.scheduleIfNeeded().
2170  optional EpochJobBatteryConstraint schedule_if_needed_epoch_job_status = 4;
2171}
2172
2173/**
2174 * Logs when an update for custom audience is scheduled using ScheduledCustomAudienceUpdate API.
2175 *
2176 * Pushed from:
2177 *   packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/customaudience/ScheduleCustomAudienceUpdateImpl.java
2178 */
2179message ScheduledCustomAudienceUpdateScheduleAttempted {
2180  // Denotes the existing status before the update is performed.
2181  enum ExistingUpdateStatus {
2182    UNKNOWN = 0;
2183    DID_OVERWRITE_EXISTING_UPDATE = 1;
2184    NO_EXISTING_UPDATE = 2;
2185    REJECTED_BY_EXISTING_UPDATE = 3;
2186  }
2187
2188  // Number of partial custom audiences in the schedule CA update.
2189  optional int32 num_partial_custom_audiences = 1;
2190
2191  // Delay in minutes after which custom audiences are scheduled to be updated.
2192  optional int32 min_delay_minutes = 2;
2193
2194  // Field denoting if there was an already pending update in the database.
2195  optional ExistingUpdateStatus existing_update_status = 3;
2196
2197  // Number of leave custom audience in the schedule CA update.
2198  optional int32 num_leave_custom_audiences = 4;
2199
2200  // boolean denoting if the schedule CA update scheduled is for the second hop.
2201  optional bool is_second_hop = 5;
2202}
2203
2204/**
2205 * Logs for ScheduledCustomAudienceUpdate after the update is performed.
2206 *
2207 * Pushed from:
2208 *   packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/customaudience/ScheduleUpdatesHandler.java
2209 */
2210message ScheduledCustomAudienceUpdatePerformed {
2211  // number of partial custom audience in the schedule ca update request.
2212  optional int32 num_partial_custom_audiences_in_request = 1;
2213
2214  // number of custom audiences to be joined in the response from the server.
2215  optional int32 num_join_custom_audiences_in_response = 2;
2216
2217  // number of custom audiences actually joined.
2218  optional int32 num_custom_audiences_joined = 3;
2219
2220  // number of custom audiences to leave in schedule ca update request.
2221  optional int32 num_leave_custom_audiences_in_request = 4;
2222
2223  // number of custom audience to in the response from the server.
2224  optional int32 num_leave_custom_audiences_in_response = 5;
2225
2226  // number of actual custom audiences left.
2227  optional int32 num_custom_audiences_left = 6;
2228
2229  // boolean denoting if the schedule CA update performed was the initial hop.
2230  optional bool was_initial_hop = 7;
2231
2232  // number of schedule CA updates in the response from the server.
2233  optional int32 num_schedule_updates_in_response = 8;
2234
2235  // number of CA schedules for a update.
2236  optional int32 num_updates_scheduled = 9;
2237}
2238
2239/**
2240 * Logs for the scheduleCustomAudienceUpdate background job.
2241 *
2242 * Pushed from:
2243 *   packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/customaudience/ScheduleUpdatesHandler.java
2244 *
2245 * Estimated Logging Rate:
2246 *  Peak: 1 time in 1 hour | Avg: 24 per device per day.
2247 */
2248message ScheduledCustomAudienceUpdateBackgroundJobRan {
2249  // number of schedule custom audience update found in the queue (database).
2250  optional int32 num_updates_found = 1;
2251
2252  // number of schedule custom audience updates performed successfully.
2253  optional int32 num_successful_updates = 2;
2254}
2255
2256/**
2257 * Logs for failure during updating Scheduled custom audience.
2258 *
2259 * Pushed from:
2260 *   packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/customaudience/ScheduleUpdatesHandler.java
2261 */
2262message ScheduledCustomAudienceUpdatePerformedAttemptedFailureReported {
2263  // Enum denoting the type of failure logged.
2264  enum FailureType {
2265    UNKNOWN = 0;
2266    HTTP_UNKNOWN = 1;
2267    HTTP_TOO_MANY_REQUESTS = 2;
2268    HTTP_REDIRECTION = 3;
2269    HTTP_CLIENT_ERROR = 4;
2270    HTTP_SERVER_ERROR = 5;
2271    JSON_PARSING_ERROR = 6;
2272    INTERNAL_ERROR = 7;
2273    HTTP_IO_EXCEPTION = 8;
2274    HTTP_CONTENT_SIZE_EXCEPTION = 9;
2275  }
2276  /// Enum denoting the action that caused the failure.
2277  enum FailureAction {
2278    HTTP_CALL = 0;
2279    LEAVE_CUSTOM_AUDIENCE = 1;
2280    JOIN_CUSTOM_AUDIENCE = 2;
2281    SCHEDULE_CUSTOM_AUDIENCE = 3;
2282  }
2283
2284  optional FailureType failure_type = 1;
2285  optional FailureAction failure_action = 2;
2286}
2287
2288/**
2289 * Logs for the stats of AdServices process lifecycle.
2290 */
2291message AdServicesProcessLifecycleReported {
2292  // The type of an AdServices process event. It should be used to log the count of different types
2293  // of AdServices process events and will be aggregated to imply the frequency of each event.
2294  enum EventType {
2295    UNKNOWN = 0;
2296
2297    // The AdServices process restarts.
2298    RESTART = 1;
2299
2300    // The memory level of the AdServices process drops to a certain threshold.
2301    LOW_MEMORY_LEVEL = 2;
2302  }
2303
2304  // The type of an AdServices process event.
2305  optional EventType event_type = 1;
2306}
2307
2308/**
2309 * Logs for the stats for AdServices Process Stable Flags framework.
2310 */
2311message AdServicesProcessStableFlagsReported {
2312  // The latency to initialize flag values in microsecond.
2313  optional int64 initialization_latency_us = 1;
2314}
2315
2316/**
2317 * Logs for the stats of AdServices flags updates.
2318 */
2319message AdServicesFlagUpdateReported {
2320  // The number of cache missed flags in an event of AdServices flag update.
2321  optional int32 num_of_cache_miss_flags = 1;
2322}
2323
2324/**
2325 Logs the number of report impression requests for each destination along with its status.
2326*/
2327message ReportingWithDestinationPerformed {
2328  /* Type of reporting api: either report impression or report event */
2329  optional android.adservices.service.ReportingType reportingType = 1;
2330
2331  /* Destination of this Report Impression call. */
2332  optional android.adservices.service.ReportingCallDestination destination = 2;
2333
2334  /* Status of this Report Impression call. */
2335  optional android.adservices.service.ReportingCallStatus status = 3;
2336}
2337
2338/**
2339Logs the number of different of reporting url returned by B&A
2340*/
2341message NumberOfTypesOfReportingUrlsReceived {
2342  /* Number of top level seller reporting urls. */
2343  optional int32 numberOfTopLevelSellerReportingUrl = 1;
2344
2345  /* Number of buyer reporting urls. */
2346  optional int32 numberOfBuyerReportingUrl = 2;
2347
2348  /* Number of component seller reporting urls. */
2349  optional int32 numberOfComponentSellerReportingUrl = 3;
2350
2351  /* Number of buyer event reporting urls. */
2352  optional int32 numberOfBuyerEventReportingUrl = 4;
2353
2354  /* Number of top level seller event reporting urls. */
2355  optional int32 numberOfTopLevelSellerEventReportingUrl = 5;
2356
2357  /* Number of component event reporting urls. */
2358  optional int32 numberOfComponentEventReportingUrl = 6;
2359}
2360
2361/** Logs the number of items processed per type per measurement background job. */
2362message MeasurementBackgroundItemsInfo {
2363  // Type of the items.
2364  optional int32 item_type = 1;
2365
2366  // Number of items processed per type.
2367  optional int32 number_of_items = 2;
2368
2369  // Timestamp of the oldest item processed per type per job.
2370  optional int64 oldest_item_timestamp = 3;
2371}
2372
2373/** Wrapper to log the nested number of items processed per type per measurement background job. */
2374message RepeatedMeasurementBackgroundItemsInfo {
2375   repeated MeasurementBackgroundItemsInfo items_info = 1;
2376}
2377
2378/**
2379 * Logging for Adservice's measurement background jobs information. Provides data for analyzing
2380 * measurement background jobs' health and workload.
2381 */
2382message AdservicesMeasurementBackgroundJobInfo {
2383  // A unique identifier for a background job
2384  optional int32 job_id = 1;
2385
2386  // Information about items in the database before processing.
2387  optional RepeatedMeasurementBackgroundItemsInfo database_items_before_processing = 2
2388  [(log_mode) = MODE_BYTES];
2389
2390  // Information about items being processed in the background job.
2391  // The number of items being processed doesn't always equal to items in the database before
2392  // processing because there may be redirects and retries.
2393  optional RepeatedMeasurementBackgroundItemsInfo items_processed = 3 [(log_mode) = MODE_BYTES];
2394
2395  // Time interval from the start to the end of an execution of a background job.
2396  // It is on a milli-second basis.
2397  optional int32 job_duration = 4;
2398
2399  // Type of the result code that implies different execution results of Adservices background jobs.
2400  optional android.adservices.ExecutionResultCode execution_result_code = 5;
2401
2402  // The publicly returned reason onStopJob() was called.
2403  // This is only applicable when the state is FINISHED, but may be undefined if
2404  // JobService.onStopJob() was never called for the job.
2405  // The default value is STOP_REASON_UNDEFINED.
2406  optional android.app.job.StopReasonEnum public_stop_reason = 6;
2407}
2408