| /* |
| * 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 |
| * - FederatedCompute errors: 5001-6000 |
| * - AdExtDataServiceErrors: 6001-7000 |
| * - IAPC errors: 7001 - 8000 |
| * |
| * NOTE: AdId / AdSetId don't have a range yet (because they're just using common codes) |
| */ |
| 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; |
| |
| // Remote exception when calling the Cobalt upload API. |
| COBALT_UPLOAD_API_REMOTE_EXCEPTION = 9; |
| |
| // Exception occurred when parsing the Adservices Config XML provided by an app. |
| APP_MANIFEST_CONFIG_PARSING_ERROR = 10; |
| |
| // Generic exception when dealing with shared prefs. |
| SHARED_PREF_EXCEPTION = 11; |
| |
| // 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; |
| |
| // Error occurred when failed to find downloaded classifier model file. |
| DOWNLOADED_CLASSIFIER_MODEL_FILE_NOT_FOUND = 1021; |
| |
| // No downloaded or bundled classifier model available. |
| NO_CLASSIFIER_MODEL_AVAILABLE = 1022; |
| |
| // Error occurred when failed to read labels file. |
| READ_LABELS_FILE_FAILURE = 1023; |
| |
| // Error occurred when failed to read precomuted labels. |
| READ_PRECOMUTRED_LABELS_FAILURE = 1024; |
| |
| // Error occurred when failed to read top apps file. |
| READ_TOP_APPS_FILE_FAILURE = 1025; |
| |
| // Error occurred when saving a topic not in labels file. |
| INVALID_TOPIC_ID = 1026; |
| |
| // Error occurred when failed to read precomuted app topics list. |
| READ_PRECOMUTRED_APP_TOPICS_LIST_FAILURE = 1027; |
| |
| // Error occurred when failed to read bundled metadata file. |
| READ_BUNDLED_METADATA_FILE_FAILURE = 1028; |
| |
| // Error occurred when reading redundant metadata property. |
| CLASSIFIER_METADATA_REDUNDANT_PROPERTY= 1029; |
| |
| // Error occurred when reading redundant metadata asset. |
| CLASSIFIER_METADATA_REDUNDANT_ASSET = 1030; |
| |
| // Error occurred when parsing metadata json missing property or asset_name. |
| CLASSIFIER_METADATA_MISSING_PROPERTY_OR_ASSET_NAME = 1031; |
| |
| // Error occurred when failed to read classifier assets metadata file. |
| READ_CLASSIFIER_ASSETS_METADATA_FAILURE = 1032; |
| |
| // Error occurred when failed to load downloaded file by file Id. |
| DOWNLOADED_CLASSIFIER_MODEL_FILE_LOAD_FAILURE = 1033; |
| |
| // RuntimeException occurred when use invalid type of blocked topics |
| // source of truth. |
| TOPICS_INVALID_BLOCKED_TOPICS_SOURCE_OF_TRUTH = 1034; |
| |
| // RuntimeException occurred when unable to remove the blocked topic. |
| TOPICS_REMOVE_BLOCKED_TOPIC_FAILURE = 1035; |
| |
| // RuntimeException occurred when unable to get all blocked topics. |
| TOPICS_GET_BLOCKED_TOPIC_FAILURE = 1036; |
| |
| // RuntimeException occurred when unable to clear all blocked topics |
| // in system server. |
| TOPICS_CLEAR_ALL_BLOCKED_TOPICS_IN_SYSTEM_SERVER_FAILURE = 1037; |
| |
| // Error occurred when unable to handle JobService. |
| TOPICS_HANDLE_JOB_SERVICE_FAILURE = 1038; |
| |
| // Error occurred when unable to fetch job scheduler. |
| TOPICS_FETCH_JOB_SCHEDULER_FAILURE = 1039; |
| |
| // Error occurred while deleting a table for Topics. |
| TOPICS_DELETE_TABLE_FAILURE = 1040; |
| |
| // Cobalt initialisation failure for Topics. |
| TOPICS_COBALT_LOGGER_INITIALIZATION_FAILURE = 1041; |
| |
| // Failure to convert plaintext topic object to encrypted topic. |
| TOPICS_ENCRYPTION_FAILURE = 1042; |
| |
| // Topics encryption key with invalid length. |
| TOPICS_ENCRYPTION_INVALID_KEY_LENGTH = 1043; |
| |
| // Topics encryption with invalid response length. |
| TOPICS_ENCRYPTION_INVALID_RESPONSE_LENGTH = 1044; |
| |
| // Topics encryption key failed to decode with Base64 decoder. |
| TOPICS_ENCRYPTION_KEY_DECODE_FAILURE = 1045; |
| |
| // Topics encryption received null params in request for the encrypter. |
| TOPICS_ENCRYPTION_NULL_REQUEST = 1046; |
| |
| // Topics encryption received null response from the encrypter. |
| TOPICS_ENCRYPTION_NULL_RESPONSE = 1047; |
| |
| // Topics encryption received error while serialization to JSON. |
| TOPICS_ENCRYPTION_SERIALIZATION_ERROR = 1048; |
| |
| // Topics encryption public key is missing. |
| TOPICS_ENCRYPTION_KEY_MISSING = 1049; |
| |
| // Measurement errors: 2001-3000 |
| // Error occurred when inserting enrollment data to DB. |
| ENROLLMENT_DATA_INSERT_ERROR = 2001; |
| |
| // Error occurred when deleting enrollment data to DB. |
| ENROLLMENT_DATA_DELETE_ERROR = 2002; |
| |
| // Measurement foreground unknown failure. |
| MEASUREMENT_FOREGROUND_UNKNOWN_FAILURE = 2003; |
| |
| // Measurement datastore failure. |
| MEASUREMENT_DATASTORE_FAILURE = 2004; |
| |
| // Measurement datastore unknown failure. |
| MEASUREMENT_DATASTORE_UNKNOWN_FAILURE = 2005; |
| |
| // Measurement invalid parameter fetching public keys. |
| MEASUREMENT_PUBLIC_KEY_FETCHER_INVALID_PARAMETER = 2006; |
| |
| // Measurement IO exception while fetching public keys. |
| MEASUREMENT_PUBLIC_KEY_FETCHER_IO_ERROR = 2007; |
| |
| // Measurement error while parsing public keys. |
| MEASUREMENT_PUBLIC_KEY_FETCHER_PARSING_ERROR = 2008; |
| |
| // Failure to save seed in SharedPreferences |
| ENROLLMENT_SHARED_PREFERENCES_SEED_SAVE_FAILURE = 2009; |
| |
| // 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; |
| |
| // Adservices entry point failure. |
| AD_SERVICES_ENTRY_POINT_FAILURE = 4014; |
| |
| // Used to be MEASUREMENT_FOREGROUND_UNKNOWN_FAILURE but renamed in |
| // commit 94af8756d2f03ff17924721ee1b7c4a4520377ff |
| RESERVED_ERROR_CODE_4015 = 4015; |
| |
| // FederatedCompute errors: 5001-6000 |
| // Datastore exception while deleting a federated task. |
| DELETE_TASK_FAILURE = 5001; |
| |
| // Exception while trying to close file descriptor. |
| FILE_DESCRIPTOR_CLOSE_ERROR = 5002; |
| |
| // Error message indicating invalid federated job plan type. |
| CLIENT_PLAN_SPEC_ERROR = 5003; |
| |
| // Exception when trying to parse protobuf message. |
| INVALID_PROTOBUF_ERROR = 5004; |
| |
| // Exception occurred when isolated training process runs. |
| ISOLATED_TRAINING_PROCESS_ERROR = 5005; |
| |
| // Exception while trying to iterate data. |
| ITERATOR_NEXT_FAILURE = 5006; |
| |
| // Timeout exception while trying to iterate data. |
| ITERATOR__NEXT_TIMEOUT = 5007; |
| |
| // AdExtDataService get failed |
| GET_ADEXT_DATA_SERVICE_ERROR = 6001; |
| |
| // AdExtDataService put failed |
| PUT_ADEXT_DATA_SERVICE_ERROR = 6002; |
| |
| // IAPC errors: 7001-8000 |
| // AdIdProviderService is not available. |
| IAPC_AD_ID_PROVIDER_NOT_AVAILABLE = 7001; |
| // Exception when calling UpdateAdId API in service side. |
| IAPC_UPDATE_AD_ID_API_ERROR = 7002; |
| } |
| |
| /** |
| * Adservices API names. |
| */ |
| enum PpapiName { |
| PPAPI_NAME_UNSPECIFIED = 0; |
| TOPICS = 1; |
| MEASUREMENT = 2; |
| FLEDGE = 3; |
| AD_ID = 4; |
| APP_SET_ID = 5; |
| UX = 6; |
| // Use COMMON enum when the error happens in the common code path. |
| COMMON = 7; |
| // Represents federatedcompute APK in OnDevicePersonalization module. |
| FEDERATED_COMPUTE = 8; |
| ADEXT_DATA_SERVICE = 9; |
| } |
| |
| /** |
| * 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; |
| } |
| |
| // Region of the user who interacted with AdServicesSettings UI. |
| enum AdServiceSettingRegion { |
| // fallback when getDeviceRegion call failed. |
| REGION_UNSPECIFIED = 0; |
| // European Union user (based on isoCountryInfo). |
| EU = 1; |
| // Non-European Union user (based on isoCountryInfo). |
| ROW = 2; |
| } |