summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-05-10 17:58:47 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-05-10 17:58:47 +0000
commita1b704f6cc097b64ae971e06db0213044697aca6 (patch)
tree06add501b5bca29831632621d0809ded03739ace
parent2b03116da042dd4e2f52b6a654afd17314ad7f21 (diff)
parent8a45230bb735a40c520df9407aa9c8bc171690f4 (diff)
downloadproto_logging-aml_sta_331910000.tar.gz
Snap for 10104556 from 8a45230bb735a40c520df9407aa9c8bc171690f4 to mainline-os-statsd-releaseaml_sta_331910000
Change-Id: I5d6d4a5a6b2635af8b993a928b7ccdc2732cff9e
-rw-r--r--OWNERS3
-rw-r--r--stats/Android.bp3
-rw-r--r--stats/atoms.proto39
-rw-r--r--stats/atoms/adservices/adservices_extension_atoms.proto142
-rw-r--r--stats/atoms/expresslog/expresslog_extension_atoms.proto96
-rw-r--r--stats/enums/adservices/common/adservices_enums.proto255
-rw-r--r--stats/enums/adservices/measurement/enums.proto141
7 files changed, 642 insertions, 37 deletions
diff --git a/OWNERS b/OWNERS
index e02753e6..ceaac7de 100644
--- a/OWNERS
+++ b/OWNERS
@@ -9,3 +9,6 @@ yaochen@google.com
# Settings UI
per-file settings_enums.proto=tmfang@google.com
+
+# Adservices
+per-file adservices_enums.proto=binhnguyen@google.com
diff --git a/stats/Android.bp b/stats/Android.bp
index c1cde302..c97eaa94 100644
--- a/stats/Android.bp
+++ b/stats/Android.bp
@@ -22,7 +22,9 @@ package {
}
enum_protos = [
+ "enums/adservices/common/*.proto",
"enums/adservices/fledge/*.proto",
+ "enums/adservices/measurement/*.proto",
"enums/app/**/*.proto",
"enums/contexthub/*.proto",
"enums/debug/*.proto",
@@ -80,6 +82,7 @@ atom_protos = [
"attribution_node.proto",
"atoms/gps/*.proto",
"atoms/adservices/*.proto",
+ "atoms/expresslog/*.proto",
"atoms/providers/mediaprovider/*.proto",
"atoms/wifi/*.proto",
"atoms/bluetooth/*.proto",
diff --git a/stats/atoms.proto b/stats/atoms.proto
index 69e9a095..750025c9 100644
--- a/stats/atoms.proto
+++ b/stats/atoms.proto
@@ -27,6 +27,7 @@ import "frameworks/proto_logging/stats/atoms/gps/gps_atoms.proto";
import "frameworks/proto_logging/stats/atoms/providers/mediaprovider/media_provider_atoms.proto";
import "frameworks/proto_logging/stats/atom_field_options.proto";
import "frameworks/proto_logging/stats/enums/adservices/fledge/enums.proto";
+import "frameworks/proto_logging/stats/enums/adservices/measurement/enums.proto";
import "frameworks/proto_logging/stats/enums/app/enums.proto";
import "frameworks/proto_logging/stats/enums/app/job/enums.proto";
import "frameworks/proto_logging/stats/enums/app/remoteprovisioner_enums.proto";
@@ -777,6 +778,8 @@ message Atom {
// Pushed atom extensions.
// The atom definitions are under atoms/<feature>/<feature>_extension_atoms.proto
+ extensions 528; // ExpressEventReported express_event_reported
+ extensions 593; // ExpressHistogramSampleReported express_histogram_sample_reported
extensions 598; // AdServicesBackCompatGetTopicsReported ad_services_back_compat_get_topics_reported
extensions 599; // AdServicesBackCompatEpochComputationClassifierReported ad_services_back_compat_epoch_computation_classifier_reported
extensions 613; // BluetoothHashedDeviceNameReported bluetooth_hashed_device_name_reported
@@ -785,8 +788,16 @@ message Atom {
extensions 638; // WifiAwareNdpReported wifi_aware_ndp_reported
extensions 639; // WifiAwareAttachReported wifi_aware_attach_reported
extensions 640; // AdServicesMeasurementDebugKeys ad_services_measurement_debug_keys
+ extensions 644; // ExpressUidEventReported express_uid_event_reported
extensions 650; // DailykeepaliveInfoReported daily_keepalive_info_reported
extensions 656; // BluetoothLeSessionConnected bluetooth_le_session_connected
+ extensions 658; // ExpressUidHistogramSampleReported express_uid_histogram_sample_reported
+ extensions 662; // AdServicesErrorReported ad_services_error_reported
+ extensions 663; // AdServicesBackgroundJobsExecutionReported ad_services_background_jobs_execution_reported
+ extensions 673; // AdServicesMeasurementDelayedSourceRegistration ad_services_measurement_delayed_source_registration
+ extensions 674; // AdServicesMeasurementAttribution ad_services_measurement_attribution
+ extensions 675; // AdServicesMeasurementJobs ad_services_measurement_jobs
+ extensions 676; // AdServicesMeasurementWipeout ad_services_measurement_wipeout
extensions 9999; // Atom9999 atom_9999
// Pulled events will start at field 10000.
@@ -9266,13 +9277,21 @@ message AppCompacted {
optional int64 after_zram_free_kilobytes = 18;
}
-// Logs each upstream for a successful switch over
+/**
+ * Represents an event that logs information about a successful switch to an upstream network.
+ */
message UpstreamEvent {
- // Transport type of upstream network
+ // Indicates the transport type of network.
optional android.stats.connectivity.UpstreamType upstream_type = 1;
- // A time period that an upstream continued
+ // The duration of network usage.
optional int64 duration_millis = 2;
+
+ // The amount of data received from tethered clients.
+ optional int64 tx_bytes = 3;
+
+ // The amount of data received from remote.
+ optional int64 rx_bytes = 4;
}
message UpstreamEvents {
@@ -20241,6 +20260,10 @@ message UwbSessionInitiated {
optional int32 latency_200ms = 10;
// The uid of the app that initiates the connection.
optional int32 uid = 11 [(is_uid) = true];
+ // Ranging interval of the session in ms.
+ optional int32 ranging_interval_ms = 12;
+ // How many ongoing session when current session is initiated?
+ optional int32 parallel_session_count = 13;
}
/*
@@ -21269,6 +21292,10 @@ message AdServicesMeasurementReportsUploaded {
}
optional ReportUploadStatus response_code = 2;
+ optional android.adservices.service.measurement.ReportUploadFailureType failure_type = 3;
+ optional android.adservices.service.measurement.ReportUploadMethod upload_method = 4;
+ // delay (in milliseconds) between scheduled delivery time and actual delivery time.
+ optional int64 reporting_delay_millis = 5;
}
/**
@@ -21284,6 +21311,12 @@ message AdServicesMeasurementRegistrations {
optional RegistrationType type = 1;
optional int64 response_size_in_bytes = 2;
optional string adtech_url_domain_if_size_above_threshold = 3;
+ optional android.adservices.service.measurement.SourceType source_type = 4;
+ optional android.adservices.service.measurement.RegistrationSurfaceType surface_type = 5;
+ optional android.adservices.service.measurement.Status status = 6;
+ optional android.adservices.service.measurement.RegistrationFailureType failure_type = 7;
+ // delay (in milliseconds) between registration queue request and the time it gets processed
+ optional int64 registration_delay_millis = 8;
}
/**
diff --git a/stats/atoms/adservices/adservices_extension_atoms.proto b/stats/atoms/adservices/adservices_extension_atoms.proto
index de928276..b2744df2 100644
--- a/stats/atoms/adservices/adservices_extension_atoms.proto
+++ b/stats/atoms/adservices/adservices_extension_atoms.proto
@@ -20,6 +20,9 @@ package android.os.statsd.adservices;
import "frameworks/proto_logging/stats/atoms.proto";
import "frameworks/proto_logging/stats/atom_field_options.proto";
+import "frameworks/proto_logging/stats/enums/adservices/common/adservices_enums.proto";
+import "frameworks/proto_logging/stats/enums/app/job/enums.proto";
+import "frameworks/proto_logging/stats/enums/adservices/measurement/enums.proto";
option java_package = "com.android.os.adservices";
option java_multiple_files = true;
@@ -35,6 +38,25 @@ extend Atom {
optional AdServicesMeasurementDebugKeys
ad_services_measurement_debug_keys = 640
[(module) = "adservices", (truncate_timestamp) = true];
+ optional AdServicesErrorReported
+ ad_services_error_reported = 662
+ [(module) = "adservices", (truncate_timestamp) = true];
+ optional AdServicesBackgroundJobsExecutionReported
+ ad_services_background_jobs_execution_reported = 663
+ [(module) = "adservices"];
+
+ optional AdServicesMeasurementDelayedSourceRegistration
+ ad_services_measurement_delayed_source_registration = 673
+ [(module) = "adservices", (truncate_timestamp) = true];
+ optional AdServicesMeasurementAttribution
+ ad_services_measurement_attribution = 674
+ [(module) = "adservices", (truncate_timestamp) = true];
+ optional AdServicesMeasurementJobs
+ ad_services_measurement_jobs = 675
+ [(module) = "adservices", (truncate_timestamp) = true];
+ optional AdServicesMeasurementWipeout
+ ad_services_measurement_wipeout = 676
+ [(module) = "adservices", (truncate_timestamp) = true];
}
/**
@@ -80,53 +102,105 @@ message AdServicesBackCompatEpochComputationClassifierReported {
optional string asset_version = 3;
// Type of the classifier used for classifying apps.
- enum ClassifierType {
- /** Unknown classifier option. */
- UNKNOWN_CLASSIFIER = 0;
- /** Only on-device classification. */
- ON_DEVICE_CLASSIFIER = 1;
- /** Only Precomputed classification. */
- PRECOMPUTED_CLASSIFIER = 2;
- /** Precomputed classification values are preferred over on-device classification values. */
- PRECOMPUTED_THEN_ON_DEVICE_CLASSIFIER = 3;
- }
- optional ClassifierType classifier_type = 4;
+ optional android.adservices.ClassifierType classifier_type = 4;
// On Device classifier status.
- enum OnDeviceClassifierStatus {
- ON_DEVICE_CLASSIFIER_STATUS_UNSPECIFIED = 0;
- ON_DEVICE_CLASSIFIER_STATUS_NOT_INVOKED = 1;
- ON_DEVICE_CLASSIFIER_STATUS_SUCCESS = 2;
- ON_DEVICE_CLASSIFIER_STATUS_FAILURE = 3;
- }
- optional OnDeviceClassifierStatus on_device_classifier_status = 5;
+ optional android.adservices.OnDeviceClassifierStatus on_device_classifier_status = 5;
// Precomputed classifier status.
- enum PrecomputedClassifierStatus {
- PRECOMPUTED_CLASSIFIER_STATUS_UNSPECIFIED = 0;
- PRECOMPUTED_CLASSIFIER_STATUS_NOT_INVOKED = 1;
- PRECOMPUTED_CLASSIFIER_STATUS_SUCCESS = 2;
- PRECOMPUTED_CLASSIFIER_STATUS_FAILURE = 3;
- }
- optional PrecomputedClassifierStatus precomputed_classifier_status = 6;
+ optional android.adservices.PrecomputedClassifierStatus precomputed_classifier_status = 6;
}
/**
* Logs debug keys match state when measurement reports are being generated.
*/
message AdServicesMeasurementDebugKeys {
- enum AttributionType {
- UNKNOWN = 0;
- APP_APP = 1;
- APP_WEB = 2;
- WEB_APP = 3;
- WEB_WEB = 4;
- }
-
optional string adtech_enrollment_id = 1;
- optional AttributionType attribution_type = 2;
+ optional android.adservices.AttributionType attribution_type = 2;
optional bool is_matched = 3;
optional int64 join_key_hash = 4;
optional int64 join_key_hash_limit = 5;
}
+/**
+ * Logs AdServices errors/exceptions.
+ */
+message AdServicesErrorReported {
+ optional android.adservices.ErrorCode error_code = 1;
+
+ // Name of the PPAPI if possible where error is occurring.
+ optional android.adservices.PpapiName ppapi_name = 2;
+
+ // Name of the class where we catch the exception or log the error.
+ optional string class_name = 3;
+
+ // Name of the method where we catch the exception or log the error.
+ optional string method_name = 4;
+
+ // Line number where we catch the exception or log the error.
+ optional int32 line_number = 5;
+
+ // The fully qualified name of the last encountered exception.
+ optional string last_observed_exception_name = 6;
+}
+
+/** Logs background job stats to monitor the stability of Rubidium background jobs. */
+message AdServicesBackgroundJobsExecutionReported {
+ // A unique identifier for a background job
+ optional int32 job_id = 1;
+
+ // Time interval from the start to the end of an execution of a background job.
+ // It is on a milli-second basis.
+ optional int32 execution_latency_ms = 2;
+
+ // Time interval from the start of previous execution to the start of current execution of
+ // a background job. It is on a minute basis.
+ optional int32 execution_period_minute = 3;
+
+ // Type of the result code that implies different execution results of Adservices background jobs.
+ optional android.adservices.ExecutionResultCode execution_result_code = 4;
+
+ // The publicly returned reason onStopJob() was called.
+ // This is only applicable when the state is FINISHED, but may be undefined if
+ // JobService.onStopJob() was never called for the job.
+ // The default value is STOP_REASON_UNDEFINED.
+ optional android.app.job.StopReasonEnum public_stop_reason = 5;
+}
+
+/**
+ * Logs when an AdServices delayed source is fetched and registered.
+ */
+message AdServicesMeasurementDelayedSourceRegistration {
+ optional android.adservices.service.measurement.DelayedSourceRegistrationStatus registration_status = 1;
+ // delay (in milliseconds) between a source registration and a previously registered trigger with matching attribution destination
+ optional int64 missed_source_delay_millis = 2;
+}
+
+/**
+ * Logs when an AdServices trigger is attributed to a source.
+ */
+message AdServicesMeasurementAttribution {
+ optional android.adservices.service.measurement.SourceType source_type = 1;
+ optional android.adservices.service.measurement.AttributionSurfaceCombination attribution_surface_combination = 2;
+ optional android.adservices.service.measurement.Status status = 3;
+ optional android.adservices.service.measurement.AttributionFailureType failure_type = 4;
+ optional bool is_source_derived = 5;
+ optional bool is_install_attribution = 6;
+ // delay (in milliseconds) between trigger registration and a trigger becoming attributed.
+ optional int64 trigger_to_attribution_delay_millis = 7;
+}
+
+/**
+ * Logs AdServices job finish status
+ */
+message AdServicesMeasurementJobs {
+ optional android.adservices.service.measurement.Status status = 1;
+ optional android.adservices.service.measurement.JobType job_type = 2;
+}
+
+/**
+ * Logs when AdServices deletion API is called.
+ */
+message AdServicesMeasurementWipeout {
+ optional android.adservices.service.measurement.WipeoutCause wipeout_cause = 1;
+} \ No newline at end of file
diff --git a/stats/atoms/expresslog/expresslog_extension_atoms.proto b/stats/atoms/expresslog/expresslog_extension_atoms.proto
new file mode 100644
index 00000000..d2172e29
--- /dev/null
+++ b/stats/atoms/expresslog/expresslog_extension_atoms.proto
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+syntax = "proto2";
+
+package android.os.statsd.expresslog;
+
+import "frameworks/proto_logging/stats/atoms.proto";
+import "frameworks/proto_logging/stats/atom_field_options.proto";
+
+option java_package = "com.android.os.expresslog";
+option java_multiple_files = true;
+
+extend Atom {
+ optional ExpressEventReported express_event_reported =
+ 528 [(module) = "framework", (module) = "expresslog"];
+ optional ExpressHistogramSampleReported express_histogram_sample_reported =
+ 593 [(module) = "framework", (module) = "expresslog"];
+ optional ExpressUidEventReported express_uid_event_reported =
+ 644 [(module) = "framework", (module) = "expresslog"];
+ optional ExpressUidHistogramSampleReported express_uid_histogram_sample_reported =
+ 658 [(module) = "framework", (module) = "expresslog"];
+}
+
+/*
+ * Logs by Express library.
+ */
+message ExpressEventReported {
+ optional int64 metric_id = 1;
+
+ // for counter metric it is an incremental amount
+ optional int64 value = 2;
+}
+
+/*
+ * Logs by Express library.
+ */
+message ExpressUidEventReported {
+ optional int64 metric_id = 1;
+
+ // for counter metric it is an incremental amount
+ optional int64 value = 2;
+
+ // will be used as uid dimension.
+ optional int32 uid = 3 [(is_uid) = true];
+}
+
+/*
+ * Logs by Express library.
+ */
+message ExpressHistogramSampleReported {
+ optional int64 metric_id = 1;
+
+ // will be used as a samples count increment value per bin
+ optional int64 count = 2;
+
+ // will be used as a dimension to represent the bin index
+ // dim[0] .. dim[bins_count - 1] - valid samples count bins
+ // 2 extra bins reserved to represent underflow/overflow
+ // dim[bins_count] - could be considered as an underflow bin
+ // dim[bins_count + 1] - could be considered as an overflow bin
+ optional int32 bin_index = 3;
+}
+
+/*
+ * Logs by Express library.
+ */
+ message ExpressUidHistogramSampleReported {
+ optional int64 metric_id = 1;
+
+ // will be used as a samples count increment value per bin
+ optional int64 count = 2;
+
+ // will be used as a dimension to represent the bin index
+ // dim[0] .. dim[bins_count - 1] - valid samples count bins
+ // 2 extra bins reserved to represent underflow/overflow
+ // dim[bins_count] - could be considered as an underflow bin
+ // dim[bins_count + 1] - could be considered as an overflow bin
+ optional int32 bin_index = 3;
+
+ // will be used as uid dimension.
+ optional int32 uid = 4 [(is_uid) = true];
+}
diff --git a/stats/enums/adservices/common/adservices_enums.proto b/stats/enums/adservices/common/adservices_enums.proto
new file mode 100644
index 00000000..a5b9a630
--- /dev/null
+++ b/stats/enums/adservices/common/adservices_enums.proto
@@ -0,0 +1,255 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+syntax = "proto2";
+package android.adservices;
+
+// Recommended setup in go/java-proto-names
+option java_outer_classname = "AdservicesProtoEnums";
+option java_multiple_files = true;
+
+/**
+ * Type of the classifier used for classifying apps.
+ */
+enum ClassifierType {
+ /** Unknown classifier option. */
+ UNKNOWN_CLASSIFIER = 0;
+ /** Only on-device classification. */
+ ON_DEVICE_CLASSIFIER = 1;
+ /** Only Precomputed classification. */
+ PRECOMPUTED_CLASSIFIER = 2;
+ /** Precomputed classification values are preferred over on-device classification values. */
+ PRECOMPUTED_THEN_ON_DEVICE_CLASSIFIER = 3;
+}
+
+/**
+ * On Device classifier status.
+ */
+enum OnDeviceClassifierStatus {
+ ON_DEVICE_CLASSIFIER_STATUS_UNSPECIFIED = 0;
+ ON_DEVICE_CLASSIFIER_STATUS_NOT_INVOKED = 1;
+ ON_DEVICE_CLASSIFIER_STATUS_SUCCESS = 2;
+ ON_DEVICE_CLASSIFIER_STATUS_FAILURE = 3;
+}
+
+/**
+ * Precomputed classifier status.
+ */
+enum PrecomputedClassifierStatus {
+ PRECOMPUTED_CLASSIFIER_STATUS_UNSPECIFIED = 0;
+ PRECOMPUTED_CLASSIFIER_STATUS_NOT_INVOKED = 1;
+ PRECOMPUTED_CLASSIFIER_STATUS_SUCCESS = 2;
+ PRECOMPUTED_CLASSIFIER_STATUS_FAILURE = 3;
+}
+
+/**
+ * Attribution types.
+ */
+enum AttributionType {
+ UNKNOWN = 0;
+ APP_APP = 1;
+ APP_WEB = 2;
+ WEB_APP = 3;
+ WEB_WEB = 4;
+}
+
+/**
+ * Enum representing an error/exception. These errors can be common to all
+ * PPAPIs or specific to a particular API. We will group enums in blocks of
+ * 1000 like this below:
+ * - Common errors: 1-1000
+ * - Topics errors: 1001-2000
+ * - Measurement errors: 2001-3000
+ * - Fledge errors: 3001-4000
+ * - UX errors: 4001-5000
+ */
+enum ErrorCode {
+ // Common Errors: 1-1000
+ ERROR_CODE_UNSPECIFIED = 0;
+ DATABASE_READ_EXCEPTION = 1;
+ DATABASE_WRITE_EXCEPTION = 2;
+ API_REMOTE_EXCEPTION = 3;
+
+ // Error occurred when unable to send result to the callback.
+ API_CALLBACK_ERROR = 4;
+
+ // Error occurred when failed to call the callback on Rate Limit Reached.
+ RATE_LIMIT_CALLBACK_FAILURE = 5;
+
+ // Error occurred when calling package name is not found.
+ PACKAGE_NAME_NOT_FOUND_EXCEPTION = 6;
+
+ // Shared pref update failure.
+ SHARED_PREF_UPDATE_FAILURE = 7;
+
+ // Shared pref reset failure.
+ SHARED_PREF_RESET_FAILURE = 8;
+
+ // Topics errors: 1001-2000
+ // Remote exception when calling get topics.
+ GET_TOPICS_REMOTE_EXCEPTION = 1001;
+
+ // Topics API is disabled.
+ TOPICS_API_DISABLED = 1002;
+
+ // SQLException occurred when failed to persist classified Topics.
+ TOPICS_PERSIST_CLASSIFIED_TOPICS_FAILURE = 1003;
+
+ // SQLException occurred when failed to persist Top Topics.
+ TOPICS_PERSIST_TOP_TOPICS_FAILURE = 1004;
+
+ // SQLException occurred when failed to record App-Sdk usage history.
+ TOPICS_RECORD_APP_SDK_USAGE_FAILURE = 1005;
+
+ // SQLException occurred when failed to record App Only usage history.
+ TOPICS_RECORD_APP_USAGE_FAILURE = 1006;
+
+ // SQLException occurred when failed to record can learn topic.
+ TOPICS_RECORD_CAN_LEARN_TOPICS_FAILURE = 1007;
+
+ // SQLException occurred when failed to record returned topic.
+ TOPICS_RECORD_RETURNED_TOPICS_FAILURE = 1008;
+
+ // SQLException occurred when failed to record returned topic.
+ TOPICS_RECORD_BLOCKED_TOPICS_FAILURE = 1009;
+
+ // SQLException occurred when failed to remove blocked topic.
+ TOPICS_DELETE_BLOCKED_TOPICS_FAILURE = 1010;
+
+ // SQLException occurred when failed to delete old epochs.
+ TOPICS_DELETE_OLD_EPOCH_FAILURE = 1011;
+
+ // SQLException occurred when failed to delete a column in table
+ TOPICS_DELETE_COLUMN_FAILURE = 1012;
+
+ // SQLException occurred when failed to persist topic contributors.
+ TOPICS_PERSIST_TOPICS_CONTRIBUTORS_FAILURE = 1013;
+
+ // SQLException occurred when failed to delete all entries from table.
+ TOPICS_DELETE_ALL_ENTRIES_IN_TABLE_FAILURE = 1014;
+
+ // Exception occurred when classify call failed.
+ TOPICS_ON_DEVICE_CLASSIFY_FAILURE = 1015;
+
+ // Exception occurred ML model did not return a topic id.
+ TOPICS_ON_DEVICE_NUMBER_FORMAT_EXCEPTION = 1016;
+
+ // Exception occurred when failed to load ML model.
+ TOPICS_LOAD_ML_MODEL_FAILURE = 1017;
+
+ // Exception occurred when unable to retrieve topics id to topics name.
+ TOPICS_ID_TO_NAME_LIST_READ_FAILURE = 1018;
+
+ // Exception occurred when unable to read classifier asset file.
+ TOPICS_READ_CLASSIFIER_ASSET_FILE_FAILURE = 1019;
+
+ // NoSuchAlgorithmException occurred when unable to find correct message.
+ // digest algorithm.
+ TOPICS_MESSAGE_DIGEST_ALGORITHM_NOT_FOUND = 1020;
+
+ // UX errors: 4001-5000
+ CONSENT_REVOKED_ERROR = 4001;
+
+ // Error occurred when failed to get downloaded OTA file URI.
+ DOWNLOADED_OTA_FILE_ERROR = 4002;
+
+ // Exception while trying to add ResourcesProvider.
+ RESOURCES_PROVIDER_ADD_ERROR = 4003;
+
+ // Exception occurred when unable to load MDD file group
+ LOAD_MDD_FILE_GROUP_FAILURE = 4004;
+
+ // Dismiss notification error
+ DISMISS_NOTIFICATION_FAILURE = 4005;
+
+ // Datastore exception while get content
+ DATASTORE_EXCEPTION_WHILE_GET_CONTENT = 4006;
+
+ // Datastore exception while recording notification
+ DATASTORE_EXCEPTION_WHILE_RECORDING_NOTIFICATION = 4007;
+
+ // Datastore exception while recording default consent.
+ DATASTORE_EXCEPTION_WHILE_RECORDING_DEFAULT_CONSENT = 4008;
+
+ // Exception while recording manual consent interaction
+ DATASTORE_EXCEPTION_WHILE_RECORDING_MANUAL_CONSENT_INTERACTION = 4009;
+
+ // Exception while saving privacy sandbox feature.
+ PRIVACY_SANDBOX_SAVE_FAILURE = 4010;
+
+ // Error message indicating invalid consent source of truth.
+ INVALID_CONSENT_SOURCE_OF_TRUTH = 4011;
+
+ // Error message while calling get consent.
+ ERROR_WHILE_GET_CONSENT = 4012;
+
+ // App search consent data migration failure.
+ APP_SEARCH_DATA_MIGRATION_FAILURE = 4013;
+
+ // Ad services entry point failure.
+ AD_SERVICES_ENTRY_POINT_FAILURE = 4014;
+}
+
+/**
+ * Adservices API names.
+ */
+enum PpapiName {
+ PPAPI_NAME_UNSPECIFIED = 0;
+ TOPICS = 1;
+ MEASUREMENT = 2;
+ FLEDGE = 3;
+ AD_ID = 4;
+ APP_SET_ID = 5;
+ UX = 6;
+}
+
+/**
+ * Type of the result code that implies different execution results of Adservices background jobs.
+ */
+enum ExecutionResultCode {
+ /** Unspecified result code. */
+ UNSPECIFIED_CODE = 0;
+
+ /** Successful execution. */
+ SUCCESSFUL = 1;
+
+ /** Failed execution with retrying the job. */
+ FAILED_WITH_RETRY = 2;
+
+ /** Failed execution without retrying the job. */
+ FAILED_WITHOUT_RETRY = 3;
+
+ /** OnJobStop() is invoked with retrying the job. */
+ ONSTOP_CALLED_WITH_RETRY = 4;
+
+ /** OnJobStop() is invoked without retrying the job. */
+ ONSTOP_CALLED_WITHOUT_RETRY = 5;
+
+ /**
+ * The execution is halted by system or device for unknown reason, leaving
+ * a not finished execution.
+ */
+ HALTED_FOR_UNKNOWN_REASON = 6;
+
+ /** Skipped execution due to a job scheduled in ExtServices running on T+. */
+ SKIP_FOR_EXTSERVICES_JOB_ON_TPLUS = 7;
+
+ /** Skipped execution due to kill switch is on. */
+ SKIP_FOR_KILL_SWITCH_ON = 8;
+
+ /** Skipped execution due to user consent is revoked. */
+ SKIP_FOR_USER_CONSENT_REVOKED = 9;
+}
diff --git a/stats/enums/adservices/measurement/enums.proto b/stats/enums/adservices/measurement/enums.proto
new file mode 100644
index 00000000..261ccf7b
--- /dev/null
+++ b/stats/enums/adservices/measurement/enums.proto
@@ -0,0 +1,141 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+syntax = "proto2";
+package android.adservices.service.measurement;
+
+option java_outer_classname = "MeasurementProtoEnums";
+option java_multiple_files = true;
+
+/**
+ * Enum used by AdServicesMeasurement(Registration, Attribution).
+ */
+enum SourceType {
+ UNKNOWN_SOURCE_TYPE = 0;
+ EVENT_SOURCE_TYPE = 1;
+ NAVIGATION_SOURCE_TYPE = 2;
+}
+
+/**
+ * Enum used by AdServicesMeasurementRegistration.
+ */
+enum RegistrationSurfaceType {
+ UNKNOWN_REGISTRATION_SURFACE_TYPE = 0;
+ WEB_REGISTRATION_SURFACE_TYPE = 1;
+ APP_REGISTRATION_SURFACE_TYPE = 2;
+}
+
+/**
+ * Enum used by AdServicesMeasurement(Registration, Attribution, Reporting,
+ * Jobs)
+ */
+enum Status {
+ UNKNOWN_STATUS = 0;
+ SUCCESS_STATUS = 1;
+ FAILURE_STATUS = 2;
+}
+
+/**
+ * Enum used by AdServicesMeasurementRegistration.
+ */
+enum RegistrationFailureType {
+ UNKNOWN_REGISTRATION_FAILURE_TYPE = 0;
+ PARSING_REGISTRATION_FAILURE_TYPE = 1;
+ NETWORK_REQUEST_REGISTRATION_FAILURE_TYPE = 2;
+ ENROLLMENT_REGISTRATION_FAILURE_TYPE = 3;
+ REDIRECT_REGISTRATION_FAILURE_TYPE = 4;
+ STORAGE_REGISTRATION_FAILURE_TYPE = 5;
+}
+
+/**
+ * Enum used by AdServicesMeasurementReporting.
+ */
+enum ReportUploadFailureType {
+ UNKNOWN_REPORT_UPLOAD_FAILURE_TYPE = 0;
+ ENROLLMENT_NOT_FOUND_REPORT_UPLOAD_FAILURE_TYPE = 1;
+ NETWORK_ERROR_REPORT_UPLOAD_FAILURE_TYPE = 2;
+ DATASTORE_ERROR_REPORT_UPLOAD_FAILURE_TYPE = 3;
+ REPORT_NOT_PENDING_REPORT_UPLOAD_FAILURE_TYPE = 4;
+}
+
+/**
+ * Enum used by AdServicesMeasurementReporting.
+ */
+enum ReportUploadMethod {
+ UNKNOWN_REPORT_UPLOAD_METHOD = 0;
+ REGULAR_REPORT_UPLOAD_METHOD = 1;
+ FALLBACK_REPORT_UPLOAD_METHOD = 2;
+}
+
+/**
+ * Enum used by AdServicesMeasurementDelayedSourceRegistration.
+ */
+enum DelayedSourceRegistrationStatus {
+ UNKNOWN_DELAYED_SOURCE_REGISTRATION_STATUS = 0;
+ MISSING_DELAYED_SOURCE_REGISTRATION_STATUS = 1;
+ VALID_DELAYED_SOURCE_REGISTRATION_STATUS = 2;
+}
+
+/**
+ * Enum used by AdServicesMeasurementAttribution.
+ */
+enum AttributionSurfaceCombination {
+ UNKNOWN_ATTRIBUTION_SURFACE_COMBINATION = 0;
+ APP_APP_ATTRIBUTION_SURFACE_COMBINATION = 1;
+ APP_WEB_ATTRIBUTION_SURFACE_COMBINATION = 2;
+ WEB_APP_ATTRIBUTION_SURFACE_COMBINATION = 3;
+ WEB_WEB_ATTRIBUTION_SURFACE_COMBINATION = 4;
+}
+
+/**
+ * Enum used by AdServicesMeasurementAttribution.
+ */
+enum AttributionFailureType {
+ UNKNOWN_ATTRIBUTION_FAILURE_TYPE = 0;
+ TRIGGER_IGNORED_ATTRIBUTION_FAILURE_TYPE = 1;
+ TRIGGER_ALREADY_ATTRIBUTED_ATTRIBUTION_FAILURE_TYPE = 2;
+ TRIGGER_MARKED_FOR_DELETION_ATTRIBUTION_FAILURE_TYPE = 3;
+ NO_MATCHING_SOURCE_ATTRIBUTION_FAILURE_TYPE = 4;
+ NO_TOP_LEVEL_FILTER_MATCH_ATTRIBUTION_FAILURE_TYPE = 5;
+ RATE_LIMIT_EXCEEDED_ATTRIBUTION_FAILURE_TYPE = 6;
+ NO_REPORTS_GENERATED_ATTRIBUTION_FAILURE_TYPE = 7;
+}
+
+/**
+ * Enum used by AdServicesMeasurementJobs.
+ */
+enum JobType {
+ UNKNOWN_JOB_TYPE = 0;
+ ASYNC_REGISTRATION_JOB_TYPE = 1;
+ ASYNC_REGISTRATION_FALLBACK_JOB_TYPE = 2;
+ ATTRIBUTION_JOB_TYPE = 3;
+ AGGREGATION_REPORTING_JOB_TYPE = 4;
+ AGGREGATE_REPORTING_FALLBACK_JOB_TYPE = 5;
+ EVENT_REPORTING_JOB_TYPE = 6;
+ EVENT_REPORTING_FALLBACK_JOB_TYPE = 7;
+ DELETE_EXPIRED_JOB_TYPE = 8;
+ DELETE_UNINSTALLED_JOB_TYPE = 9;
+}
+
+/**
+ * Enum used by AdServicesMeasurementWipeout.
+ */
+enum WipeoutCause {
+ UNKNOWN_WIPEOUT_CAUSE = 0;
+ UNINSTALL_WIPEOUT_CAUSE = 1;
+ CONSENT_FLIP_WIPEOUT_CAUSE = 2;
+ CLEAR_DATA_WIPEOUT_CAUSE = 3;
+} \ No newline at end of file