blob: abe430495a5fe52f308f452b47cd094db04c34c4 [file] [log] [blame]
/*
* 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.adservices;
import "frameworks/proto_logging/stats/atoms.proto";
import "frameworks/proto_logging/stats/atom_field_options.proto";
option java_package = "com.android.os.adservices";
option java_multiple_files = true;
extend Atom {
optional AdServicesBackCompatGetTopicsReported
ad_services_back_compat_get_topics_reported = 598
[(module) = "adservices", (truncate_timestamp) = true];
optional AdServicesBackCompatEpochComputationClassifierReported
ad_services_back_compat_epoch_computation_classifier_reported = 599
[(module) = "adservices", (truncate_timestamp) = true];
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];
}
/**
* Represents a list of topic IDs.
*/
message AdServicesTopicIds {
repeated int32 topic_id = 1;
}
/**
* Logs for AdServices GetTopics API call on R+.
* This atom closely mimics AdServicesGetTopicsReported (for T+ logging) and
* avoids usage of field types (e.g. repeated) that aren't supported on R/S.
*/
message AdServicesBackCompatGetTopicsReported {
// See b/266626836 for why topic_ids is not a field yet.
// Number of filtered duplicate topics.
optional int32 duplicate_topic_count = 1;
// Number of filtered blocked topics.
optional int32 filtered_blocked_topic_count = 2;
// Number of topic ids returned.
optional int32 count_of_topic_ids = 3;
}
/**
* Logs for AdServices Epoch Computation Classifier on R+.
* One atom should be logged for each app classification.
* This atom closely mimics AdServicesEpochComputationClassifierReported (for T+ logging)
* and avoids usage of field types (e.g. repeated) that can't be supported on R/S.
*/
message AdServicesBackCompatEpochComputationClassifierReported {
// List of topics returned by the classifier for each app. The classification
// does not depend on the user's usage of the app.
optional AdServicesTopicIds topic_ids = 1 [(log_mode) = MODE_BYTES];
// Build id of the assets.
optional int32 build_id = 2;
// Version of the assets used.
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;
// 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;
// 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;
}
/**
* 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 bool is_matched = 3;
optional int64 join_key_hash = 4;
optional int64 join_key_hash_limit = 5;
}
/**
* Logs AdServices errors/exceptions.
*/
message AdServicesErrorReported {
// 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 {
ERROR_CODE_UNSPECIFIED = 0;
DATABASE_READ_EXCEPTION = 1;
DATABASE_WRITE_EXCEPTION = 2;
API_REMOTE_EXCEPTION = 3;
// UX errors
CONSENT_REVOKED_ERROR = 4001;
}
// Enum representing an error/exception.
optional ErrorCode error_code = 1;
enum PpapiName {
PPAPI_NAME_UNSPECIFIED = 0;
TOPICS = 1;
MEASUREMENT = 2;
FLEDGE = 3;
}
// Name of the PPAPI if possible where error is occurring.
optional 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;
}