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.healthfitness.api; 20 21import "frameworks/proto_logging/stats/atoms.proto"; 22import "frameworks/proto_logging/stats/atom_field_options.proto"; 23import "frameworks/proto_logging/stats/enums/healthfitness/api/enums.proto"; 24 25option java_multiple_files = true; 26option java_package = "com.android.os.healthfitness.api"; 27 28extend Atom { 29 optional HealthConnectApiCalled health_connect_api_called = 616 [(module) = "healthfitness"]; 30 31 optional HealthConnectUsageStats health_connect_usage_stats = 617 [(module) = "healthfitness"]; 32 33 optional HealthConnectStorageStats health_connect_storage_stats = 618 [(module) = "healthfitness"]; 34 35 optional HealthConnectApiInvoked health_connect_api_invoked = 643 [(module) = "healthfitness", (restriction_category) = RESTRICTION_DIAGNOSTIC]; 36 37 optional ExerciseRouteApiCalled exercise_route_api_called = 654 [(module) = "healthfitness", (restriction_category) = RESTRICTION_DIAGNOSTIC]; 38} 39 40// Track HealthDataService API operations. 41message HealthConnectApiCalled { 42 43 // API method invoked. 44 optional android.healthfitness.api.ApiMethod api_method = 1; 45 46 // Status whether the API call executed successfully or not. 47 optional android.healthfitness.api.ApiStatus api_status = 2; 48 49 // Only relevant when status == ERROR; 50 optional int32 error_code = 3; 51 52 // Total API call duration in milliseconds. 53 optional int64 duration_millis = 4; 54 55 // Number of records being inserted/updated etc. (If any) 56 optional int32 number_of_records = 5; 57 58 // Type of rate limiting being used (If any) 59 optional android.healthfitness.api.RateLimit rate_limit = 6; 60} 61 62// Track if users are connecting apps with Health Connect 63message HealthConnectUsageStats { 64 65 // Number of connected apps 66 optional int32 connected_apps_count = 1; 67 68 // Number of apps on device that can be connected to Health Connect. 69 optional int32 available_apps_count = 2; 70 71} 72 73// Monitor Health Connect database 74message HealthConnectStorageStats { 75 76 // Size of database 77 optional int64 database_size = 1; 78 79 // Total number of instant records in the database. 80 optional int64 instant_data_count = 2; 81 82 // Total number of interval records in the database. 83 optional int64 interval_data_count = 3; 84 85 // Total number of series records in the database. 86 optional int64 series_data_count = 4; 87 88 // Total number of changelog counts. 89 optional int64 changelog_count = 5; 90 91} 92 93// Track when ExerciseRoute is being read/written. 94message ExerciseRouteApiCalled { 95 96 // Read/write. 97 optional android.healthfitness.api.Operation operation = 1; 98 99 // Package name of the client that invoked the API. 100 optional string package_name = 2; 101 102 // Number of records under operation 103 optional int32 number_of_records = 3; 104 105} 106 107// Track Health Connect API operations stats. 108message HealthConnectApiInvoked { 109 110 // API method invoked. 111 optional android.healthfitness.api.ApiMethod api_method = 1; 112 113 // Status whether the API call executed successfully or not. 114 optional android.healthfitness.api.ApiStatus api_status = 2; 115 116 // Only relevant when status == ERROR; 117 optional int32 error_code = 3; 118 119 // Total API call duration in milliseconds. 120 optional int64 duration_millis = 4; 121 122 // Package name of the client that invoked the API. 123 optional string package_name = 5; 124 125 // Data types under consideration in the API call (if any) 126 optional android.healthfitness.api.DataType data_type_one = 6 127 [(field_restriction_option).health_connect = true]; 128 129 optional android.healthfitness.api.DataType data_type_two = 7 130 [(field_restriction_option).health_connect = true]; 131 132 optional android.healthfitness.api.DataType data_type_three = 8 133 [(field_restriction_option).health_connect = true]; 134 135 optional android.healthfitness.api.DataType data_type_four = 9 136 [(field_restriction_option).health_connect = true]; 137 138 optional android.healthfitness.api.DataType data_type_five = 10 139 [(field_restriction_option).health_connect = true]; 140 141 optional android.healthfitness.api.DataType data_type_six = 11 142 [(field_restriction_option).health_connect = true]; 143 144}