1 2/* 3 * Copyright (C) 2023 The Android Open Source Project 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17syntax = "proto2"; 18package android.os.statsd.ondevicepersonalization; 19import "frameworks/proto_logging/stats/atoms.proto"; 20import "frameworks/proto_logging/stats/atom_field_options.proto"; 21option java_package = "com.android.os.ondevicepersonalization"; 22option java_multiple_files = true; 23extend Atom { 24 optional OnDevicePersonalizationApiCalled ondevicepersonalization_api_called = 25 711 [(module) = "ondevicepersonalization", (truncate_timestamp) = true]; 26} 27extend Atom { 28 optional OnDevicePersonalizationTraceEvent ondevicepersonalization_trace_event = 29 952 [(module) = "ondevicepersonalization", (truncate_timestamp) = true]; 30} 31/** 32 * Logs when a public ODP api is called. 33 */ 34message OnDevicePersonalizationApiCalled { 35 enum OnDevicePersonalizationApiClassType { 36 UNKNOWN = 0; 37 DOWNLOADING = 1; 38 SERVING = 2; 39 OPTIMIZATION = 3; 40 REPORTING = 4; 41 } 42 enum OnDevicePersonalizationApiName { 43 API_NAME_UNKNOWN = 0; 44 EXECUTE = 1; 45 REQUEST_SURFACE_PACKAGE = 2; 46 SERVICE_ON_EXECUTE = 3; 47 SERVICE_ON_DOWNLOAD_COMPLETED = 4; 48 SERVICE_ON_RENDER = 5; 49 SERVICE_ON_EVENT = 6; 50 SERVICE_ON_TRAINING_EXAMPLE = 7; 51 SERVICE_ON_WEB_TRIGGER = 8; 52 REMOTE_DATA_GET = 9; 53 REMOTE_DATA_KEYSET = 10; 54 LOCAL_DATA_GET = 11; 55 LOCAL_DATA_KEYSET = 12; 56 LOCAL_DATA_PUT = 13; 57 LOCAL_DATA_REMOVE = 14; 58 EVENT_URL_CREATE_WITH_RESPONSE = 15; 59 EVENT_URL_CREATE_WITH_REDIRECT = 16; 60 LOG_READER_GET_REQUESTS = 17; 61 LOG_READER_GET_JOINED_EVENTS = 18; 62 FEDERATED_COMPUTE_SCHEDULE = 19; 63 MODEL_MANAGER_RUN = 20; 64 FEDERATED_COMPUTE_CANCEL = 21; 65 NOTIFY_MEASUREMENT_EVENT = 22; 66 ADSERVICES_GET_COMMON_STATES = 23; 67 IS_FEATURE_ENABLED = 24; 68 } 69 optional OnDevicePersonalizationApiClassType api_class = 1; 70 optional OnDevicePersonalizationApiName api_name = 2; 71 // end to end latency of the operation 72 optional int32 latency_millis = 3; 73 // response_code is the error/failure code for the given api. 74 optional int32 response_code = 4; 75 // latency excluding time spent in user code 76 optional int32 overhead_latency_millis = 5; 77 // latency between call and service entry 78 optional int32 rpc_call_latency_millis = 6; 79 // latency between service return and callback 80 optional int32 rpc_return_latency_millis = 7; 81 // Log the package name that calls ODP API. Default is 0. 82 optional int32 app_uid = 8 [(is_uid) = true]; 83 // Log the sdk package name that passed by app in API request. 84 optional string sdk_package_name = 9; 85} 86 87/** 88 * Logs trace events from internal processing in the ODP service. 89 */ 90message OnDevicePersonalizationTraceEvent { 91 enum TaskType { 92 TASK_TYPE_UNKNOWN = 0; 93 EXECUTE = 1; 94 RENDER = 2; 95 DOWNLOAD = 3; 96 WEBVIEW = 4; 97 TRAINING = 5; 98 MAINTENANCE = 6; 99 WEB_TRIGGER = 7; 100 } 101 enum EventType { 102 UNKNOWN = 0; 103 WRITE_REQUEST_LOG = 1; 104 WRITE_EVENT_LOG = 2; 105 } 106 // task type to trace for internal processing in ODP service 107 optional TaskType task_type = 1; 108 // event type to trace for internal processing in ODP service 109 optional EventType event_type = 2; 110 // status of the operation 111 optional int32 status = 3; 112 // end to end latency of the operation 113 optional int32 latency_millis = 4; 114 // isolated service package name 115 optional string service_package_name = 5; 116} 117