1/* 2 * Copyright (C) 2020 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"; 18package android.service; 19 20import "frameworks/base/core/proto/android/privacy.proto"; 21 22option java_multiple_files = true; 23 24/* 25 * Notes: 26 * 1. When using ProtoOutputStream to write this proto message, must call 27 * token = ProtoOutputStream#start(fieldId) before and ProtoOutputStream#end(token) after 28 * writing a nested message. 29 * 2. Never reuse a proto field number. When removing a field, mark it as reserved. 30 */ 31 32// Proto dump of android::SensorService. dumpsys sensorservice --proto 33message SensorServiceProto { 34 option (android.msg_privacy).dest = DEST_AUTOMATIC; 35 36 enum OperatingModeEnum { 37 OP_MODE_UNKNOWN = 0; 38 OP_MODE_NORMAL = 1; 39 OP_MODE_RESTRICTED = 2; 40 OP_MODE_DATA_INJECTION = 3; 41 } 42 optional sint32 init_status = 16; 43 optional int64 current_time_ms = 1; 44 optional SensorDeviceProto sensor_device = 2; 45 optional SensorListProto sensors = 3; 46 optional SensorFusionProto fusion_state = 4; 47 optional SensorEventsProto sensor_events = 5; 48 repeated ActiveSensorProto active_sensors = 6; 49 optional int32 socket_buffer_size = 7; 50 optional int32 socket_buffer_size_in_events = 8; 51 optional bool wake_lock_acquired = 9; 52 optional OperatingModeEnum operating_mode = 10; 53 // Non-empty only if operating_mode is RESTRICTED or DATA_INJECTION. 54 optional string whitelisted_package = 11; 55 optional bool sensor_privacy = 12; 56 repeated SensorEventConnectionProto active_connections = 13; 57 repeated SensorDirectConnectionProto direct_connections = 14; 58 repeated SensorRegistrationInfoProto previous_registrations = 15; 59 60 // Next tag: 17 61} 62 63// Proto dump of android::SensorDevice 64message SensorDeviceProto { 65 option (android.msg_privacy).dest = DEST_AUTOMATIC; 66 67 optional bool initialized = 1; 68 optional int32 total_sensors = 2; 69 optional int32 active_sensors = 3; 70 71 message SensorProto { 72 option (android.msg_privacy).dest = DEST_AUTOMATIC; 73 74 optional int32 handle = 1; 75 optional int32 active_count = 2; 76 repeated float sampling_period_ms = 3; 77 optional float sampling_period_selected = 4; 78 repeated float batching_period_ms = 5; 79 optional float batching_period_selected = 6; 80 } 81 repeated SensorProto sensors = 4; 82} 83 84// Proto dump of android::SensorServiceUtil::SensorList 85message SensorListProto { 86 option (android.msg_privacy).dest = DEST_AUTOMATIC; 87 88 enum ReportingModeEnum { 89 RM_UNKNOWN = 0; 90 RM_CONTINUOUS = 1; 91 RM_ON_CHANGE = 2; 92 RM_ONE_SHOT = 3; 93 RM_SPECIAL_TRIGGER = 4; 94 } 95 96 message SensorProto { 97 option (android.msg_privacy).dest = DEST_AUTOMATIC; 98 99 optional int32 handle = 1; 100 optional string name = 2; 101 optional string vendor = 3; 102 optional int32 version = 4; 103 optional string string_type = 5; 104 optional int32 type = 6; 105 optional string required_permission = 7; 106 optional int32 flags = 8; 107 optional ReportingModeEnum reporting_mode = 9; 108 optional int32 max_delay_us = 10; 109 optional int32 min_delay_us = 11; 110 optional int32 fifo_max_event_count = 12; 111 optional int32 fifo_reserved_event_count = 13; 112 optional bool is_wakeup = 14; 113 optional bool data_injection_supported = 15; 114 optional bool is_dynamic = 16; 115 optional bool has_additional_info = 17; 116 optional int32 highest_rate_level = 18; 117 optional bool ashmem = 19; 118 optional bool gralloc = 20; 119 optional float min_value = 21; 120 optional float max_value = 22; 121 optional float resolution = 23; 122 optional float power_usage = 24; 123 } 124 repeated SensorProto sensors = 1; 125} 126 127 128// Proto dump of android::SensorFusion 129message SensorFusionProto { 130 option (android.msg_privacy).dest = DEST_AUTOMATIC; 131 132 message FusionProto { 133 option (android.msg_privacy).dest = DEST_AUTOMATIC; 134 135 optional bool enabled = 1; 136 optional int32 num_clients = 2; 137 optional float estimated_gyro_rate = 3; 138 optional float attitude_x = 4; 139 optional float attitude_y = 5; 140 optional float attitude_z = 6; 141 optional float attitude_w = 7; 142 optional float attitude_length = 8; 143 optional float bias_x = 9; 144 optional float bias_y = 10; 145 optional float bias_z = 11; 146 } 147 optional FusionProto fusion_9axis = 1; 148 optional FusionProto fusion_nomag = 2; 149 optional FusionProto fusion_nogyro = 3; 150} 151 152// Proto dump of android::SensorServiceUtil::RecentEventLogger 153message SensorEventsProto { 154 option (android.msg_privacy).dest = DEST_AUTOMATIC; 155 156 message Event { 157 option (android.msg_privacy).dest = DEST_AUTOMATIC; 158 159 optional float timestamp_sec = 1; 160 optional int64 wall_timestamp_ms = 2; 161 optional bool masked = 3; 162 optional int64 int64_data = 4; 163 repeated float float_array = 5; 164 } 165 166 message RecentEventsLog { 167 option (android.msg_privacy).dest = DEST_AUTOMATIC; 168 169 optional string name = 1 [(.android.privacy).dest = DEST_EXPLICIT]; 170 optional int32 recent_events_count = 2; 171 repeated Event events = 3; 172 } 173 repeated RecentEventsLog recent_events_logs = 1; 174} 175 176message ActiveSensorProto { 177 option (android.msg_privacy).dest = DEST_AUTOMATIC; 178 179 optional string name = 1; 180 optional int32 handle = 2; 181 optional int32 num_connections = 3; 182} 183 184// Proto dump of android::SensorService::SensorDirectConnection 185message SensorDirectConnectionProto { 186 option (android.msg_privacy).dest = DEST_AUTOMATIC; 187 188 message SensorProto { 189 option (android.msg_privacy).dest = DEST_AUTOMATIC; 190 191 optional int32 sensor = 1; 192 optional int32 rate = 2; 193 } 194 195 optional string package_name = 1; 196 optional int32 hal_channel_handle = 2; 197 optional int32 num_sensor_activated = 3; 198 repeated SensorProto sensors = 4; 199} 200 201// Proto dump of android::SensorService::SensorEventConnection 202message SensorEventConnectionProto { 203 option (android.msg_privacy).dest = DEST_AUTOMATIC; 204 205 message FlushInfoProto { 206 option (android.msg_privacy).dest = DEST_AUTOMATIC; 207 208 optional string sensor_name = 1; 209 optional int32 sensor_handle = 2; 210 optional bool first_flush_pending = 3; 211 optional int32 pending_flush_events_to_send = 4; 212 } 213 214 enum OperatingModeEnum { 215 OP_MODE_UNKNOWN = 0; 216 OP_MODE_NORMAL = 1; 217 OP_MODE_RESTRICTED = 2; 218 OP_MODE_DATA_INJECTION = 3; 219 } 220 221 optional OperatingModeEnum operating_mode = 1; 222 optional string package_name = 2; 223 optional int32 wake_lock_ref_count = 3; 224 optional int32 uid = 4; 225 optional int32 cache_size = 5; 226 optional int32 max_cache_size = 6; 227 repeated FlushInfoProto flush_infos = 7; 228 optional int32 events_received = 8; 229 optional int32 events_sent = 9; 230 optional int32 events_cache = 10; 231 optional int32 events_dropped = 11; 232 optional int32 total_acks_needed = 12; 233 optional int32 total_acks_received = 13; 234} 235 236// Proto dump of android::SensorService::SensorRegistrationInfo 237message SensorRegistrationInfoProto { 238 option (android.msg_privacy).dest = DEST_AUTOMATIC; 239 240 optional int64 timestamp_sec = 1; 241 optional int32 sensor_handle = 2; 242 optional string package_name = 3; 243 optional int32 pid = 4; 244 optional int32 uid = 5; 245 optional int64 sampling_rate_us = 6; 246 optional int64 max_report_latency_us = 7; 247 optional bool activated = 8; 248} 249