blob: d05ac189c834afa4967afee17f5326ab86eda050 [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 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";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070026import "frameworks/base/core/proto/android/app/settings_enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080027import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080028import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080029import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080030import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080031import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080032import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080033import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080034import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080035import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080036import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080037import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080038import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080039import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080040import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070041import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080042import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080043import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifr1f74b052019-04-16 22:16:30 +080044import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080045import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
46import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070047import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
48import "frameworks/base/core/proto/android/stats/enums.proto";
49import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070050import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070051import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080052import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Jeff Sharkey6bd21572019-11-15 20:45:33 -070053import "frameworks/base/core/proto/android/stats/mediaprovider/mediaprovider_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000054import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080055import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Will Brockman079fdaa2020-01-12 16:45:03 -050056import "frameworks/base/core/proto/android/stats/sysui/notification_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080057import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080058import "frameworks/base/core/proto/android/telephony/enums.proto";
59import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080060import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010061import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070062import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080063
Yao Chend54f9dd2017-10-17 17:37:48 +000064/**
Stefan Lafonae2df012017-11-14 09:17:21 -080065 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000066 * raw stats log events from the Android system, also known as "atoms."
67 *
68 * This field contains a single oneof with all of the available messages.
69 * The stats-log-api-gen tool runs as part of the Android build and
70 * generates the android.util.StatsLog class, which contains the constants
71 * and methods that Android uses to log.
72 *
Stefan Lafonae2df012017-11-14 09:17:21 -080073 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000074 * Instead, statsd on Android constructs these messages synthetically,
75 * in the format defined here and in stats_log.proto.
76 */
Stefan Lafonae2df012017-11-14 09:17:21 -080077message Atom {
78 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070079 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070080 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
81 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070082 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070083 BleScanResultReceived ble_scan_result_received = 4;
84 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080085 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070086 SyncStateChanged sync_state_changed = 7;
87 ScheduledJobStateChanged scheduled_job_state_changed = 8;
88 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070089 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080090 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
91 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
92 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070093 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
94 MemoryFactorStateChanged memory_factor_state_changed = 15;
95 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
96 CachedKillReported cached_kill_reported = 17;
97 ProcessMemoryStatReported process_memory_stat_reported = 18;
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -080098 LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
Bookatzddccf0a2017-11-28 16:48:14 -080099 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
100 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
101 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -0700102 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800103 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -0700104 CameraStateChanged camera_state_changed = 25;
105 FlashlightStateChanged flashlight_state_changed = 26;
106 UidProcessStateChanged uid_process_state_changed = 27;
107 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
108 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -0700109 BatteryLevelChanged battery_level_changed = 30;
110 ChargingStateChanged charging_state_changed = 31;
111 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700112 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800113 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700114 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
115 KernelWakeupReported kernel_wakeup_reported = 36;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800116 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
117 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
118 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Bookatze5885242017-10-24 20:10:31 -0700119 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700120 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700121 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700122 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900123 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700124 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800125 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000126 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800127 AppStartOccurred app_start_occurred = 48;
128 AppStartCanceled app_start_canceled = 49;
129 AppStartFullyDrawn app_start_fully_drawn = 50;
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800130 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Chenjie Yu52cacc62017-12-08 18:11:45 -0800131 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800132 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800133 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800134 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800135 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800136 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000137 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800138 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800139 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800140 CallStateChanged call_state_changed = 61;
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800141 KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
142 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
143 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800144 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800145 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800146 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
147 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800148 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700149 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800150 SpeakerImpedanceReported speaker_impedance_reported = 71;
151 HardwareFailed hardware_failed = 72;
152 PhysicalDropDetected physical_drop_detected = 73;
153 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800154 MobileConnectionStateChanged mobile_connection_state_changed = 75;
155 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700156 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800157 AppCrashOccurred app_crash_occurred = 78;
158 ANROccurred anr_occurred = 79;
159 WTFOccurred wtf_occurred = 80;
160 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700161 GenericAtom generic_atom = 82;
jianjin6eada302019-02-28 11:25:57 -0800162 KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
Bookatza7020bd2018-08-28 16:29:35 -0700163 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700164 DeferredJobStatsReported deferred_job_stats_reported = 85;
Tej Singha72344992019-04-17 18:55:08 -0700165 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Kevin Chyn1741a072019-01-17 11:54:40 -0800166 BiometricAcquired biometric_acquired = 87;
167 BiometricAuthenticated biometric_authenticated = 88;
168 BiometricErrorOccurred biometric_error_occurred = 89;
Will Brockmanfbaa7912019-10-24 15:15:09 -0400169 UiEventReported ui_event_reported = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700170 BatteryHealthSnapshot battery_health_snapshot = 91;
171 SlowIo slow_io = 92;
172 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700173 PhoneServiceStateChanged phone_service_state_changed = 94;
174 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100175 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700176 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700177 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700178 // TODO: service state change is very noisy shortly after boot, as well
179 // as at other transitions - coming out of doze, device plugged in, etc.
180 // Consider removing this if it becomes a problem
181 ServiceStateChanged service_state_changed = 99;
182 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800183 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800184 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000185 DevicePolicyEvent device_policy_event = 103;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800186 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
187 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
188 105 [(module) = "docsui"];
189 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
190 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
191 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
192 108 [(module) = "docsui"];
193 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
194 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
195 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
196 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Bookatzda1798c2018-12-13 14:16:00 -0800197 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
198 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f62018-12-06 11:01:38 +0000199 AppCompacted app_compacted = 115;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800200 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800201 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800202 117 [(module) = "docsui"];
203 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
204 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
205 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
206 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Christian Brunschenf86039e2018-12-21 12:26:14 +0000207 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000208 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800209 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800210 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800211 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
212 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000213 AppDowngraded app_downgraded = 128;
214 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
215 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800216 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
217 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800218 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800219 NfcErrorOccurred nfc_error_occurred = 134;
220 NfcStateChanged nfc_state_changed = 135;
221 NfcBeamOccurred nfc_beam_occurred = 136;
222 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
223 NfcTagOccurred nfc_tag_occurred = 138;
224 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
225 SeStateChanged se_state_changed = 140;
226 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800227 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800228 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800229 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800230 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800231 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800232 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800233 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800234 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Kweku Adams8845d012018-12-11 20:06:45 -0800235 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800236 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
237 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
238 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
239 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
240 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
241 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
242 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
243 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
244 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800245 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
246 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
Jack Heaea26982019-04-04 11:19:48 -0700247 BluetoothDeviceInfoReported bluetooth_device_info_reported = 162;
Jack He1021a612019-01-20 21:22:46 -0800248 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
249 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
250 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
251 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
252 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800253 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800254 ProcessStartTime process_start_time = 169;
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700255 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800256 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800257 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800258 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500259 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800260 AssistGestureStageReported assist_gesture_stage_reported = 174;
261 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
262 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800263 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000264 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800265 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700266 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800267 180 [(module) = "permissioncontroller"];
Carmen Agimof6688a352019-01-30 19:36:04 +0000268 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800269 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000270 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700271 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700272 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
273 TombStoneOccurred tomb_stone_occurred = 186;
Jack He71426802019-04-02 13:32:52 -0700274 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
Ben Blount763a5d52019-04-10 11:48:58 -0700275 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800276 188 [(module) = "intelligence"];
Tej Singha72344992019-04-17 18:55:08 -0700277 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed = 189;
Hai Zhang5d3328d2019-04-13 21:25:06 +0800278 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800279 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800280 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
281 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
282 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
283 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
284 MediametricsCodecReported mediametrics_codec_reported = 195;
285 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
286 MediametricsExtractorReported mediametrics_extractor_reported = 197;
287 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
288 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
289 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700290 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Yuncheol Heod1a85d22019-05-08 17:13:42 -0700291 CarPowerStateChanged car_power_state_changed = 203;
292 GarageModeInfo garage_mode_info = 204;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800293 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Adam He420947c2019-01-23 15:59:09 -0800294 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported = 206;
295 ContentCaptureServiceEvents content_capture_service_events = 207;
296 ContentCaptureSessionEvents content_capture_session_events = 208;
297 ContentCaptureFlushed content_capture_flushed = 209;
Hongyi Zhang700137e2019-05-23 21:19:36 -0700298 LocationManagerApiUsageReported location_manager_api_usage_reported = 210;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100299 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800300 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100301 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800302 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100303 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800304 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100305 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800306 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100307 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800308 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100309 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800310 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100311 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800312 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100313 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800314 218 [(module) = "permissioncontroller"];
315 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
316 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
317 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
318 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -0700319 ExclusionRectStateChanged exclusion_rect_state_changed = 223;
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800320 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700321 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
322 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Emilian Peev6729f372019-08-29 09:14:09 -0700323 CameraActionEvent camera_action_event = 227;
atrost01a20932019-08-28 15:40:37 +0100324 AppCompatibilityChangeReported app_compatibility_change_reported =
325 228 [(allow_from_any_uid) = true];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800326 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Mark Tabrya824a642019-11-05 12:26:12 -0800327 VmsClientConnectionStateChanged vms_client_connection_state_changed = 230;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800328 MediaProviderScanEvent media_provider_scan_event = 233 [(module) = "mediaprovider"];
329 MediaProviderDeletionEvent media_provider_deletion_event = 234 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700330 MediaProviderPermissionEvent media_provider_permission_event =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800331 235 [(module) = "mediaprovider"];
332 MediaProviderSchemaChange media_provider_schema_change = 236 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700333 MediaProviderIdleMaintenance media_provider_idle_maintenance =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800334 237 [(module) = "mediaprovider"];
Kenny Root4eacaaa2020-01-08 20:48:13 -0800335 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238;
Keun young Park3e033cb2019-12-18 11:27:35 -0800336 BootTimeEventDuration boot_time_event_duration_reported = 239;
337 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported = 240;
338 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
339 BootTimeEventErrorCode boot_time_event_error_code_reported = 242;
Nikita Ioffe41dd57e2020-01-10 16:05:08 +0000340 UserspaceRebootReported userspace_reboot_reported = 243;
Will Brockman079fdaa2020-01-12 16:45:03 -0500341 NotificationReported notification_reported = 244;
342 NotificationPanelReported notification_panel_reported = 245;
343 NotificationChannelModified notification_panel_modified = 246;
Yao Chend54f9dd2017-10-17 17:37:48 +0000344 }
David Chenc8a43242017-10-17 16:23:28 -0700345
David Chen6e3e6cb2018-01-03 16:14:06 -0800346 // Pulled events will start at field 10000.
Rafal Slawikbdd5a502020-01-14 14:14:29 +0000347 // Next: 10071
David Chenc8a43242017-10-17 16:23:28 -0700348 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800349 WifiBytesTransfer wifi_bytes_transfer = 10000;
350 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
351 MobileBytesTransfer mobile_bytes_transfer = 10002;
352 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800353 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800354 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800355 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800356 CpuTimePerFreq cpu_time_per_freq = 10008;
357 CpuTimePerUid cpu_time_per_uid = 10009;
358 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800359 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800360 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800361 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800362 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800363 SystemElapsedRealtime system_elapsed_realtime = 10014;
364 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800365 CpuActiveTime cpu_active_time = 10016;
366 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000367 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800368 RemainingBatteryCapacity remaining_battery_capacity = 10019;
369 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800370 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100371 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100372 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100373 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000374 DiskStats disk_stats = 10025;
375 DirectoryUsage directory_usage = 10026;
376 AppSize app_size = 10027;
377 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700378 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700379 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800380 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700381 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700382 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800383 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700384 ProcessCpuTime process_cpu_time = 10035;
Misha Wagner5a51e002018-10-03 15:04:09 +0100385 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700386 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800387 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
388 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
389 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000390 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800391 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800392 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800393 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000394 DebugElapsedClock debug_elapsed_clock = 10046;
395 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800396 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800397 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800398 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800399 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000400 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000401 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800402 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
403 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikbdd5a502020-01-14 14:14:29 +0000404 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true];
Carmen Agimofa769c152019-03-04 14:39:14 +0000405 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700406 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700407 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200408 AppOps app_ops = 10060;
Rafal Slawik77987ed2019-06-17 12:28:23 +0100409 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
Alec Mourie088e762019-07-02 13:10:55 -0700410 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
411 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Rafal Slawik7efcefb2019-09-20 11:16:20 +0100412 ProcessMemorySnapshot process_memory_snapshot = 10064;
Mark Tabrya824a642019-11-05 12:26:12 -0800413 VmsClientStats vms_client_stats = 10065;
Chris Wrencdea3b72019-11-22 16:58:17 -0500414 NotificationRemoteViews notification_remote_views = 10066;
Stanislav Zholninccb82e42019-11-29 18:59:49 +0000415 DangerousPermissionStateSampled dangerous_permission_state_sampled = 10067;
Stan Iliev637ba5e2019-08-16 13:43:08 -0400416 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin606454c2019-11-27 15:31:49 +0000417 RuntimeAppOpsAccess runtime_app_ops_access = 10069;
Rafal Slawikbdd5a502020-01-14 14:14:29 +0000418 IonHeapSize ion_heap_size = 10070;
David Chenc8a43242017-10-17 16:23:28 -0700419 }
yroa1fe77c2018-02-26 14:22:54 -0800420
Bookatz76aafcf2018-09-17 16:17:10 -0700421 // DO NOT USE field numbers above 100,000 in AOSP.
422 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
423 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100424
425 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700426}
427
Yao Chend54f9dd2017-10-17 17:37:48 +0000428/**
Yangster-mac20877162017-12-22 17:19:39 -0800429 * This proto represents a node of an attribution chain.
430 * Note: All attribution chains are represented as a repeated field of type
431 * AttributionNode. It is understood that in such arrays, the order is that
432 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000433 */
Yangster-mac20877162017-12-22 17:19:39 -0800434message AttributionNode {
435 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800436 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800437
Yangster-mac20877162017-12-22 17:19:39 -0800438 // The (optional) string tag for an element in the attribution chain. If the
439 // element has no tag, it is encoded as an empty string.
440 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700441}
442
Yangster-mac48b3d622018-08-18 12:38:11 -0700443message KeyValuePair {
444 optional int32 key = 1;
445 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700446 int32 value_int = 2;
447 int64 value_long = 3;
448 string value_str = 4;
449 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700450 }
451}
452
453message KeyValuePairsAtom {
454 optional int32 uid = 1;
455 repeated KeyValuePair pairs = 2;
456}
457
Yao Chend54f9dd2017-10-17 17:37:48 +0000458/*
459 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800460 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000461 *
462 * RULES:
463 * - The field ids for each atom must start at 1, and count upwards by 1.
464 * Skipping field ids is not allowed.
465 * - These form an API, so renaming, renumbering or removing fields is
466 * not allowed between android releases. (This is not currently enforced,
467 * but there will be a tool to enforce this restriction).
468 * - The types must be built-in protocol buffer types, namely, no sub-messages
469 * are allowed (yet). The bytes type is also not allowed.
470 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800471 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000472 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800473 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000474 * - A field that is a uid should be a string field, tagged with the [xxx]
475 * annotation. The generated code on android will be represented by UIDs,
476 * and those UIDs will be translated in xxx to those strings.
477 *
478 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700479 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000480 * - If there is a UID, it goes first. Think in an object-oriented fashion.
481 * *****************************************************************************
482 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700483
Yao Chend54f9dd2017-10-17 17:37:48 +0000484/**
Tej Singha72344992019-04-17 18:55:08 -0700485 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700486 * Logs when the Thermal service HAL notifies the throttling start/stop events.
487 *
488 * Logged from:
489 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
490 */
491message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700492 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700493 optional android.os.TemperatureTypeEnum sensor_type = 1;
494
Maggie White442b6312019-04-05 16:26:44 -0700495 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700496 enum State {
497 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700498 START = 1; // START indicated that throttling was triggered.
499 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700500 }
Yangster-mace16189a2018-08-26 12:20:16 -0700501 optional State state = 2;
502
503 optional float temperature = 3;
504}
505
506/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000507 * Logs when the screen state changes.
508 *
509 * Logged from:
510 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
511 */
512message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800513 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700514 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700515}
Yao Chend54f9dd2017-10-17 17:37:48 +0000516
517/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700518 * Logs that the process state of the uid, as determined by ActivityManager
519 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000520 *
521 * Logged from:
522 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
523 */
Bookatzc1a050a2017-10-10 15:49:28 -0700524message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700525 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000526
Bookatzdb026a22018-01-10 19:01:56 -0800527 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700528 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000529}
530
531/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700532 * Logs process state change of a process, as per the activity manager.
533 *
534 * Logged from:
535 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
536 */
537message ProcessStateChanged {
538 optional int32 uid = 1;
539 optional string process_name = 2;
540 optional string package_name = 3;
541 // TODO: remove this when validation is done
542 optional int64 version = 5;
543 // The state, from frameworks/base/core/proto/android/app/enums.proto.
544 optional android.app.ProcessStateEnum state = 4;
545}
546
547/**
548 * Logs when ActivityManagerService sleep state is changed.
549 *
550 * Logged from:
551 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
552 */
553message ActivityManagerSleepStateChanged {
554 // TODO: import frameworks proto
555 enum State {
556 UNKNOWN = 0;
557 ASLEEP = 1;
558 AWAKE = 2;
559 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700560 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700561}
562
563/**
564 * Logs when system memory state changes.
565 *
566 * Logged from:
567 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
568 */
569message MemoryFactorStateChanged {
570 // TODO: import frameworks proto
571 enum State {
572 MEMORY_UNKNOWN = 0;
573 NORMAL = 1; // normal.
574 MODERATE = 2; // moderate memory pressure.
575 LOW = 3; // low memory.
576 CRITICAL = 4; // critical memory.
577
578 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700579 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700580}
581
582/**
583 * Logs when app is using too much cpu, according to ActivityManagerService.
584 *
585 * Logged from:
586 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
587 */
588message ExcessiveCpuUsageReported {
589 optional int32 uid = 1;
590 optional string process_name = 2;
591 optional string package_name = 3;
592 // package version. TODO: remove this when validation is done
593 optional int64 version = 4;
594}
595
596/**
597 * Logs when a cached process is killed, along with its pss.
598 *
599 * Logged from:
600 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
601 */
602message CachedKillReported {
603 optional int32 uid = 1;
604 optional string process_name = 2;
605 optional string package_name = 3;
606 // TODO: remove this when validation is done
607 optional int64 version = 5;
608 optional int64 pss = 4;
609}
610
611/**
612 * Logs when memory stats of a process is reported.
613 *
614 * Logged from:
615 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
616 */
617message ProcessMemoryStatReported {
618 optional int32 uid = 1;
619 optional string process_name = 2;
620 optional string package_name = 3;
621 //TODO: remove this when validation is done
622 optional int64 version = 9;
623 optional int64 pss = 4;
624 optional int64 uss = 5;
625 optional int64 rss = 6;
626 enum Type {
627 ADD_PSS_INTERNAL_SINGLE = 0;
628 ADD_PSS_INTERNAL_ALL_MEM = 1;
629 ADD_PSS_INTERNAL_ALL_POLL = 2;
630 ADD_PSS_EXTERNAL = 3;
631 ADD_PSS_EXTERNAL_SLOW = 4;
632 }
633 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800634 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700635}
636
637/**
Bookatzc1a050a2017-10-10 15:49:28 -0700638 * Logs that a process started, finished, crashed, or ANRed.
639 *
640 * Logged from:
641 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
642 */
643message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700644 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700645
David Chen0b5c90c2018-01-25 16:51:49 -0800646 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800647 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700648
Bookatzddccf0a2017-11-28 16:48:14 -0800649 // What lifecycle state the process changed to.
650 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800651 enum State {
652 FINISHED = 0;
653 STARTED = 1;
654 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800655 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800656 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700657}
658
Bookatzc1a050a2017-10-10 15:49:28 -0700659/**
660 * Logs when the ble scan state changes.
661 *
662 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700663 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700664 */
665message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800666 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700667
668 enum State {
669 OFF = 0;
670 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700671 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
672 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700673 }
674 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700675
Bookatze5ec0b42018-03-26 13:34:56 -0700676 // Does the scan have a filter.
677 optional bool is_filtered = 3;
678 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
679 optional bool is_first_match = 4;
680 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
681 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700682}
683
684/**
685 * Logs reporting of a ble scan finding results.
686 *
687 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700688 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700689 */
Bookatzae6738e2018-09-13 11:38:56 -0700690// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700691message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800692 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700693
694 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800695 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700696}
697
698/**
699 * Logs when a sensor state changes.
700 *
701 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700702 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700703 */
704message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800705 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700706
Bookatzc1a050a2017-10-10 15:49:28 -0700707 // The id (int) of the sensor.
708 optional int32 sensor_id = 2;
709
710 enum State {
711 OFF = 0;
712 ON = 1;
713 }
714 optional State state = 3;
715}
716
Bookatzc1a050a2017-10-10 15:49:28 -0700717/**
718 * Logs when GPS state changes.
719 *
720 * Logged from:
721 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
722 */
723message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800724 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700725
726 enum State {
727 OFF = 0;
728 ON = 1;
729 }
730 optional State state = 2;
731}
732
Bookatz48d362e2018-11-06 15:49:08 -0800733/**
734 * Logs when GPS signal quality.
735 *
736 * Logged from:
737 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
738 */
739message GpsSignalQualityChanged {
740 optional android.server.location.GpsSignalQualityEnum level = 1;
741}
742
Bookatzc1a050a2017-10-10 15:49:28 -0700743
744/**
745 * Logs when a sync manager sync state changes.
746 *
747 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700748 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700749 */
750message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800751 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700752
David Chen0b5c90c2018-01-25 16:51:49 -0800753 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800754 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700755
756 enum State {
757 OFF = 0;
758 ON = 1;
759 }
760 optional State state = 3;
761}
762
Yangster-mac96353002018-09-05 11:18:55 -0700763/*
764 * Deferred job stats.
765 *
766 * Logged from:
767 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
768*/
769message DeferredJobStatsReported {
770 repeated AttributionNode attribution_node = 1;
771
772 // Number of jobs deferred.
773 optional int32 num_jobs_deferred = 2;
774
775 // Time since the last job runs.
776 optional int64 time_since_last_job_millis = 3;
777}
778
Bookatzc1a050a2017-10-10 15:49:28 -0700779/**
780 * Logs when a job scheduler job state changes.
781 *
782 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700783 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700784 */
785message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800786 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700787
788 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800789 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700790
791 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800792 FINISHED = 0;
793 STARTED = 1;
794 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700795 }
796 optional State state = 3;
797
Tej Singh33a412b2018-03-16 18:43:59 -0700798 // The reason a job has stopped.
799 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700800 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700801 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100802
803 // The standby bucket of the app that scheduled the job. These match the framework constants
804 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
805 // already assigned 0.
806 enum Bucket {
807 UNKNOWN = -1;
808 ACTIVE = 0;
809 WORKING_SET = 1;
810 FREQUENT = 2;
811 RARE = 3;
812 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -0800813 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +0100814 }
815 optional Bucket standby_bucket = 5 [default = UNKNOWN];
816
817 // The job id (as assigned by the app).
818 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700819}
820
821/**
822 * Logs when the audio state changes.
823 *
824 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700825 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700826 */
827message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800828 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700829
830 enum State {
831 OFF = 0;
832 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700833 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
834 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700835 }
836 optional State state = 2;
837}
838
839/**
840 * Logs when the video codec state changes.
841 *
842 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700843 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700844 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800845message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800846 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700847
848 enum State {
849 OFF = 0;
850 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700851 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
852 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700853 }
854 optional State state = 2;
855}
856
857/**
858 * Logs when the flashlight state changes.
859 *
860 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700861 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700862 */
863message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800864 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700865
866 enum State {
867 OFF = 0;
868 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700869 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
870 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700871 }
872 optional State state = 2;
873}
874
875/**
876 * Logs when the camera state changes.
877 *
878 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700879 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700880 */
881message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800882 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700883
884 enum State {
885 OFF = 0;
886 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700887 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
888 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700889 }
890 optional State state = 2;
891}
892
893/**
894 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000895 *
896 * Logged from:
897 * TODO
898 */
Bookatzd6746242017-10-24 18:39:35 -0700899message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -0800900 repeated AttributionNode attribution_node = 1
901 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +0000902
Bookatz1a1b0462018-01-12 11:47:03 -0800903 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
904 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristineed615642020-01-02 12:53:41 -0800905 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY];
906 ;
Bookatzc1a050a2017-10-10 15:49:28 -0700907
908 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristineed615642020-01-02 12:53:41 -0800909 optional string tag = 3 [(state_field_option).option = PRIMARY];
Bookatzc1a050a2017-10-10 15:49:28 -0700910
911 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800912 RELEASE = 0;
913 ACQUIRE = 1;
914 CHANGE_RELEASE = 2;
915 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700916 }
tsaichristineed615642020-01-02 12:53:41 -0800917 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Bookatzc1a050a2017-10-10 15:49:28 -0700918}
919
920/**
Bookatzc1a050a2017-10-10 15:49:28 -0700921 * Logs when a partial wakelock is considered 'long' (over 1 min).
922 *
923 * Logged from:
924 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
925 */
926message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800927 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700928
Yao Chend54f9dd2017-10-17 17:37:48 +0000929 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
930 optional string tag = 2;
931
Bookatzc1a050a2017-10-10 15:49:28 -0700932 // TODO: I have no idea what this is.
933 optional string history_tag = 3;
934
935 enum State {
936 OFF = 0;
937 ON = 1;
938 }
939 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000940}
941
Bookatzc1a050a2017-10-10 15:49:28 -0700942/**
Bookatza66083f2018-09-20 17:24:00 -0700943 * Logs when the device is interactive, according to the PowerManager Notifier.
944 *
945 * Logged from:
946 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
947 */
948message InteractiveStateChanged {
949 enum State {
950 OFF = 0;
951 ON = 1;
952 }
953 optional State state = 1;
954}
955
956/**
Bookatzc1a050a2017-10-10 15:49:28 -0700957 * Logs Battery Saver state change.
958 *
959 * Logged from:
960 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
961 */
962message BatterySaverModeStateChanged {
963 enum State {
964 OFF = 0;
965 ON = 1;
966 }
967 optional State state = 1;
968}
969
970/**
971 * Logs Doze mode state change.
972 *
973 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800974 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700975 */
976message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800977 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800978}
979
980
981/**
982 * Logs state change of Doze mode including maintenance windows.
983 *
984 * Logged from:
985 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
986 */
987message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800988 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700989}
990
991/**
992 * Logs screen brightness level.
993 *
994 * Logged from:
995 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
996 */
997message ScreenBrightnessChanged {
998 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
999 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001000}
1001
1002/**
1003 * Logs battery level (percent full, from 0 to 100).
1004 *
1005 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001006 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001007 */
1008message BatteryLevelChanged {
1009 // Battery level. Should be in [0, 100].
1010 optional int32 battery_level = 1;
1011}
1012
1013/**
1014 * Logs change in charging status of the device.
1015 *
1016 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001017 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001018 */
1019message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001020 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1021 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001022}
1023
1024/**
1025 * Logs whether the device is plugged in, and what power source it is using.
1026 *
1027 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001028 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001029 */
1030message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001031 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1032 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001033}
1034
Bookatz8c6571b2017-10-24 15:04:41 -07001035/**
1036 * Logs when an app's wakeup alarm fires.
1037 *
1038 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001039 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001040 */
1041message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001042 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001043
1044 // Name of the wakeup alarm.
1045 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001046
1047 // Name of source package (for historical reasons, since BatteryStats tracked it).
1048 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001049
1050 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1051 enum Bucket {
1052 UNKNOWN = 0;
1053 EXEMPTED = 5;
1054 ACTIVE = 10;
1055 WORKING_SET = 20;
1056 FREQUENT = 30;
1057 RARE = 40;
1058 NEVER = 50;
1059 }
1060 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1061 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001062}
1063
1064/**
1065 * Logs when an an app causes the mobile radio to change state.
1066 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1067 *
1068 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001069 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001070 */
1071message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001072 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001073
Bookatz1a1b0462018-01-12 11:47:03 -08001074 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1075 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001076}
1077
1078/**
1079 * Logs when an an app causes the wifi radio to change state.
1080 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1081 *
1082 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001083 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001084 */
1085message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001086 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001087
Bookatz1a1b0462018-01-12 11:47:03 -08001088 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1089 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001090}
1091
1092/**
1093 * Logs kernel wakeup reasons and aborts.
1094 *
1095 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001096 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001097 */
1098message KernelWakeupReported {
1099 // Name of the kernel wakeup reason (or abort).
1100 optional string wakeup_reason_name = 1;
1101
1102 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001103 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001104}
1105
1106/**
Bookatzda1798c2018-12-13 14:16:00 -08001107 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001108 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001109 *
1110 * Logged from:
1111 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1112 */
1113message WifiEnabledStateChanged {
1114 enum State {
1115 OFF = 0;
1116 ON = 1;
1117 }
1118 optional State state = 1;
1119}
1120
1121/**
1122 * Logs when an app causes Wifi to run. In this context, 'to run' means to use Wifi Client Mode.
Bookatza0a1f8a2018-12-17 12:28:32 -08001123 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1124 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001125 *
1126 * Logged from:
1127 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1128 */
1129message WifiRunningStateChanged {
1130 repeated AttributionNode attribution_node = 1;
1131
1132 enum State {
1133 OFF = 0;
1134 ON = 1;
1135 }
1136 optional State state = 2;
1137}
1138
1139/**
Bookatze5885242017-10-24 20:10:31 -07001140 * Logs wifi locks held by an app.
1141 *
1142 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001143 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001144 */
1145message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001146 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001147
1148 enum State {
1149 OFF = 0;
1150 ON = 1;
1151 }
1152 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001153
1154 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1155 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001156}
1157
1158/**
1159 * Logs wifi signal strength changes.
1160 *
1161 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001162 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001163 */
1164message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001165 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1166 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001167}
1168
1169/**
1170 * Logs wifi scans performed by an app.
1171 *
1172 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001173 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001174 */
1175message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001176 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001177
1178 enum State {
1179 OFF = 0;
1180 ON = 1;
1181 }
1182 optional State state = 2;
1183}
1184
1185/**
Tej Singh4503e102018-01-04 14:35:01 -08001186 * Logs wifi multicast locks held by an app
1187 *
1188 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001189 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001190 */
1191message WifiMulticastLockStateChanged {
1192 repeated AttributionNode attribution_node = 1;
1193
1194 enum State {
1195 OFF = 0;
1196 ON = 1;
1197 }
1198 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001199
1200 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001201}
1202
1203/**
Tej Singh1ea42892018-01-19 09:27:00 -08001204 * Logs shutdown reason and duration on next boot.
1205 *
1206 * Logged from:
1207 * frameworks/base/core/java/com/android/server/BootReceiver.java
1208 */
1209message ShutdownSequenceReported {
1210 // True if shutdown is for a reboot. Default: false if we do not know.
1211 optional bool reboot = 1;
1212
1213 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1214 optional string reason = 2;
1215
1216 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1217 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001218 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001219
1220 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001221 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001222}
1223
Tej Singh6483ea42018-01-25 17:45:49 -08001224
1225/**
1226 * Logs boot reason and duration.
1227 *
1228 * Logged from:
1229 * system/core/bootstat/bootstat.cpp
1230 */
1231message BootSequenceReported {
1232 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1233 // Default: "<EMPTY>" if not available.
1234 optional string bootloader_reason = 1;
1235
1236 // Reason for system boot. Eg. bootloader, reboot,userrequested
1237 // Default: "<EMPTY>" if not available.
1238 optional string system_reason = 2;
1239
1240 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001241 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001242
1243 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001244 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001245
1246 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001247 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001248
1249 // Time since last boot in ms. Default: 0 if not available.
1250 optional int64 time_since_last_boot = 6;
1251}
1252
Tej Singhc477d9c2018-02-05 18:31:39 -08001253
1254/**
1255 * Logs call state and disconnect cause (if applicable).
1256 *
1257 * Logged from:
1258 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1259 */
1260message CallStateChanged {
1261 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1262 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1263 optional android.telecom.CallStateEnum call_state = 1;
1264
1265 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1266 // This value is only applicable when the call_state is DISCONNECTED, and
1267 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1268 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1269 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1270
1271 // True if the call is self-managed, which are apps that use the
1272 // telecom infrastructure to make their own calls.
1273 optional bool self_managed = 3;
1274
1275 // True if call is external. External calls are calls on connected Wear
1276 // devices but show up in Telecom so the user can pull them onto the device.
1277 optional bool external_call = 4;
1278}
1279
Tej Singh1ea42892018-01-19 09:27:00 -08001280/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001281 * Logs keyguard state. The keyguard is the lock screen.
1282 *
1283 * Logged from:
1284 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1285 */
1286message KeyguardStateChanged {
1287 enum State {
1288 UNKNOWN = 0;
1289 // The keyguard is hidden when the phone is unlocked.
1290 HIDDEN = 1;
1291 // The keyguard is shown when the phone is locked (screen turns off).
1292 SHOWN= 2;
1293 // The keyguard is occluded when something is overlaying the keyguard.
1294 // Eg. Opening the camera while on the lock screen.
1295 OCCLUDED = 3;
1296 }
1297 optional State state = 1;
1298}
1299
1300/**
1301 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1302 * prompts the user to enter a password (pattern, pin, etc).
1303 *
1304 * Logged from:
1305 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1306 */
1307
1308message KeyguardBouncerStateChanged {
1309 enum State {
1310 UNKNOWN = 0;
1311 // Bouncer is hidden, either as a result of successfully entering the
1312 // password, screen timing out, or user going back to lock screen.
1313 HIDDEN = 1;
1314 // This is when the user is being prompted to enter the password.
1315 SHOWN = 2;
1316 }
1317 optional State state = 1;
1318}
1319
1320/**
1321 * Logs the result of entering a password into the keyguard bouncer.
1322 *
1323 * Logged from:
1324 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1325 */
1326message KeyguardBouncerPasswordEntered {
1327 enum BouncerResult {
1328 UNKNOWN = 0;
1329 // The password entered was incorrect.
1330 FAILURE = 1;
1331 // The password entered was correct.
1332 SUCCESS = 2;
1333 }
1334 optional BouncerResult result = 1;
1335}
1336
Tej Singha883b372018-02-15 11:30:01 -08001337/*
1338 * Logs changes to the configuration of the device. The configuration is defined
1339 * in frameworks/base/core/java/android/content/res/Configuration.java
1340 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1341 * Please go there to interpret the possible values each field can be.
1342 *
1343 * Logged from:
1344 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1345 */
1346message ResourceConfigurationChanged {
1347 // Bit mask of color capabilities of the screen.
1348 // Contains information about the color gamut and hdr mode of the screen.
1349 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001350 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001351
1352 // The target screen density being rendered to.
1353 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001354 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001355
1356 // Current user preference for the scaling factor for fonts,
1357 // relative to the base density scaling.
1358 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001359 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001360
1361 // Flag indicating whether the hard keyboard is hidden.
1362 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001363 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001364
1365 // The type of keyboard attached to the device.
1366 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1367 optional int32 keyboard = 5;
1368
1369 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1370 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001371 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001372
1373 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1374 // 0 if undefined.
1375 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1376 optional int32 mcc = 7;
1377
1378 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1379 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1380 // MNC_ZERO symbol defined in Configuration.java.
1381 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1382 optional int32 mnc = 8;
1383
1384 // The kind of navigation available on the device.
1385 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1386 optional int32 navigation = 9;
1387
1388 // Flag indicating whether the navigation is available.
1389 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001390 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001391
1392 // Overall orientation of the screen.
1393 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1394 optional int32 orientation = 11;
1395
1396 // The current height of the available screen space, in dp units.
1397 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001398 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001399
1400 // Bit mask of overall layout of the screen.
1401 // Contains information about screen size, whether the screen is wider/taller
1402 // than normal, whether the screen layout is right-tl-left or left-to-right,
1403 // and whether the screen has a rounded shape.
1404 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001405 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001406
1407 // Current width of the available screen space, in dp units.
1408 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001409 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001410
1411 // The smallest screen size an application will see in normal operation.
1412 // This is the smallest value of both screenWidthDp and screenHeightDp
1413 // in portrait and landscape.
1414 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001415 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001416
1417 // The type of touch screen attached to the device.
1418 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1419 optional int32 touchscreen = 16;
1420
1421 // Bit mask of the ui mode.
1422 // Contains information about the overall ui mode of the device.
1423 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1424 // Also contains information about whether the device is in night mode.
1425 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001426 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001427}
1428
Tej Singheee317b2018-03-07 19:28:05 -08001429
1430/**
1431 * Logs changes in the connection state of the mobile radio.
1432 *
1433 * Logged from:
1434 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1435 */
1436message MobileConnectionStateChanged {
1437 // States are from the state machine DataConnection.java.
1438 enum State {
1439 UNKNOWN = 0;
1440 // The connection is inactive, or disconnected.
1441 INACTIVE = 1;
1442 // The connection is being activated, or connecting.
1443 ACTIVATING = 2;
1444 // The connection is active, or connected.
1445 ACTIVE = 3;
1446 // The connection is disconnecting.
1447 DISCONNECTING = 4;
1448 // The connection is disconnecting after creating a connection.
1449 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1450 }
1451 optional State state = 1;
1452 // For multi-sim phones, this distinguishes between the sim cards.
1453 optional int32 sim_slot_index = 2;
1454 // Used to identify the connection. Starts at 0 and increments by 1 for
1455 // every new network created. Resets whenever the device reboots.
1456 optional int32 data_connection_id = 3;
1457 // A bitmask for the capabilities of this connection.
1458 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1459 // Default value (if we have no information): 0
1460 optional int64 capabilities = 4;
1461 // If this connection has internet.
1462 // This just checks if the DEFAULT bit of capabilities is set.
1463 optional bool has_internet = 5;
1464}
1465
1466/**
1467 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1468 *
1469 * Logged from:
1470 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1471 */
1472message MobileRadioTechnologyChanged {
1473 optional android.telephony.NetworkTypeEnum state = 1;
1474 // For multi-sim phones, this distinguishes between the sim cards.
1475 optional int32 sim_slot_index = 2;
1476}
1477
Andrew Chantb56388b2018-03-22 21:07:33 -07001478/**
1479 * Logs the VID and PID of any connected USB devices.
1480 *
1481 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1482 *
1483 * Logged by Vendor.
1484 */
1485message UsbDeviceAttached {
1486 optional int32 vid = 1;
1487 optional int32 pid = 2;
1488 optional bool has_audio = 3;
1489 optional bool has_hid = 4;
1490 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001491 enum State {
1492 STATE_DISCONNECTED = 0;
1493 STATE_CONNECTED = 1;
1494 }
1495 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001496 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001497}
1498
Tej Singheee317b2018-03-07 19:28:05 -08001499
Tej Singhdd7bd352018-02-09 19:33:15 -08001500/**
Tej Singh5d991e12018-03-09 19:48:11 -08001501 * Logs when Bluetooth is enabled and disabled.
1502 *
1503 * Logged from:
1504 * services/core/java/com/android/server/BluetoothManagerService.java
1505 */
1506message BluetoothEnabledStateChanged {
1507 repeated AttributionNode attribution_node = 1;
1508 // Whether or not bluetooth is enabled on the device.
1509 enum State {
1510 UNKNOWN = 0;
1511 ENABLED = 1;
1512 DISABLED = 2;
1513 }
1514 optional State state = 2;
1515 // The reason for being enabled/disabled.
1516 // Eg. Airplane mode, crash, application request.
1517 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1518 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001519 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001520}
1521
1522/**
Jack Hed9837c82019-01-09 01:19:13 -08001523 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001524 *
1525 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001526 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1527 *
1528 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001529 */
1530message BluetoothConnectionStateChanged {
1531 // The state of the connection.
1532 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1533 optional android.bluetooth.ConnectionStateEnum state = 1;
1534 // An identifier that can be used to match connect and disconnect events.
1535 // Currently is last two bytes of a hash of a device level ID and
1536 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001537 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001538 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001539 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1540 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001541 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001542 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001543 // An identifier that can be used to match events for this device.
1544 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1545 // Salt: Randomly generated 256 bit value
1546 // Hash algorithm: HMAC-SHA256
1547 // Size: 32 byte
1548 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001549 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001550}
1551
1552/**
1553 * Logs when a Bluetooth device connects and disconnects over ACL
1554 *
1555 * Logged from:
1556 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1557 *
1558 * Next Tag: 3
1559 */
1560message BluetoothAclConnectionStateChanged {
1561 // An identifier that can be used to match events for this device.
1562 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1563 // Salt: Randomly generated 256 bit value
1564 // Hash algorithm: HMAC-SHA256
1565 // Size: 32 byte
1566 // Default: null or empty if the device identifier is not known
1567 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1568 // The state of the connection.
1569 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1570 optional android.bluetooth.ConnectionStateEnum state = 2;
1571}
1572
1573/**
1574 * Logs when a Bluetooth device connects and disconnects over SCO
1575 *
1576 * Logged from:
1577 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1578 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1579 *
1580 * Next Tag: 4
1581 */
1582message BluetoothScoConnectionStateChanged {
1583 // An identifier that can be used to match events for this device.
1584 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1585 // Salt: Randomly generated 256 bit value
1586 // Hash algorithm: HMAC-SHA256
1587 // Size: 32 byte
1588 // Default: null or empty if the device identifier is not known
1589 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1590 // The state of the connection.
1591 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1592 optional android.bluetooth.ConnectionStateEnum state = 2;
1593 // Codec used for this SCO connection
1594 // Default: UNKNOWN
1595 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001596}
1597
Jack Hec27040a2019-01-09 20:54:41 -08001598/**
1599 * Logged when active device of a profile changes
1600 *
1601 * Logged from:
1602 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1603 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1604 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1605 */
1606message BluetoothActiveDeviceChanged {
1607 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1608 // From android.bluetooth.BluetoothProfile
1609 optional int32 bt_profile = 1;
1610 // An identifier that can be used to match events for this new active device.
1611 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1612 // Salt: Randomly generated 256 bit value
1613 // Hash algorithm: HMAC-SHA256
1614 // Size: 32 byte
1615 // Default: null or empty if there is no active device for this profile
1616 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1617}
1618
Jack Heab86dbd22018-12-18 15:43:27 -08001619// Logs when there is an event affecting Bluetooth device's link layer connection.
1620// - This event is triggered when there is a related HCI command or event
1621// - Users of this metrics can deduce Bluetooth device's connection state from these events
1622// - HCI commands are logged before the command is sent, after receiving command status, and after
1623// receiving command complete
1624// - HCI events are logged when they arrive
1625//
1626// Low level log from system/bt
1627//
1628// Bluetooth classic commands:
1629// - CMD_CREATE_CONNECTION
1630// - CMD_DISCONNECT
1631// - CMD_CREATE_CONNECTION_CANCEL
1632// - CMD_ACCEPT_CONNECTION_REQUEST
1633// - CMD_REJECT_CONNECTION_REQUEST
1634// - CMD_SETUP_ESCO_CONNECTION
1635// - CMD_ACCEPT_ESCO_CONNECTION
1636// - CMD_REJECT_ESCO_CONNECTION
1637// - CMD_ENH_SETUP_ESCO_CONNECTION
1638// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1639//
1640// Bluetooth low energy commands:
1641// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1642// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1643// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1644// - CMD_BLE_CLEAR_WHITE_LIST
1645// - CMD_BLE_ADD_WHITE_LIST
1646// - CMD_BLE_REMOVE_WHITE_LIST
1647//
1648// Bluetooth classic events:
1649// - EVT_CONNECTION_COMP
1650// - EVT_CONNECTION_REQUEST
1651// - EVT_DISCONNECTION_COMP
1652// - EVT_ESCO_CONNECTION_COMP
1653// - EVT_ESCO_CONNECTION_CHANGED
1654//
1655// Bluetooth low energy meta events:
1656// - BLE_EVT_CONN_COMPLETE_EVT
1657// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1658//
1659// Next tag: 10
1660message BluetoothLinkLayerConnectionEvent {
1661 // An identifier that can be used to match events for this device.
1662 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1663 // Salt: Randomly generated 256 bit value
1664 // Hash algorithm: HMAC-SHA256
1665 // Size: 32 byte
1666 // Default: null or empty if the device identifier is not known
1667 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1668 // Connection handle of this connection if available
1669 // Range: 0x0000 - 0x0EFF (12 bits)
1670 // Default: 0xFFFF if the handle is unknown
1671 optional int32 connection_handle = 2;
1672 // Direction of the link
1673 // Default: DIRECTION_UNKNOWN
1674 optional android.bluetooth.DirectionEnum direction = 3;
1675 // Type of this link
1676 // Default: LINK_TYPE_UNKNOWN
1677 optional android.bluetooth.LinkTypeEnum type = 4;
1678
1679 // Reason metadata for this link layer connection event, rules for interpretation:
1680 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1681 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1682 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1683 // set and valid, ignore hci_ble_event
1684
1685 // HCI command associated with this event
1686 // Default: CMD_UNKNOWN
1687 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1688 // HCI event associated with this event
1689 // Default: EVT_UNKNOWN
1690 optional android.bluetooth.hci.EventEnum hci_event = 6;
1691 // HCI BLE meta event associated with this event
1692 // Default: BLE_EVT_UNKNOWN
1693 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1694 // HCI command status code if this is triggerred by hci_cmd
1695 // Default: STATUS_UNKNOWN
1696 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1697 // HCI reason code associated with this event
1698 // Default: STATUS_UNKNOWN
1699 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1700}
1701
Howard Roe103fe22019-01-17 16:52:16 -08001702/**
1703 * Logs when a module is rolled back by Watchdog.
1704 *
1705 * Logged from: Rollback Manager
1706 */
1707message WatchdogRollbackOccurred {
1708 enum RollbackType {
1709 UNKNOWN = 0;
1710 ROLLBACK_INITIATE = 1;
1711 ROLLBACK_SUCCESS = 2;
1712 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001713 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001714 }
1715 optional RollbackType rollback_type = 1;
1716
1717 optional string package_name = 2;
1718
1719 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001720
1721 enum RollbackReasonType {
1722 REASON_UNKNOWN = 0;
1723 REASON_NATIVE_CRASH = 1;
1724 REASON_EXPLICIT_HEALTH_CHECK = 2;
1725 REASON_APP_CRASH = 3;
1726 REASON_APP_NOT_RESPONDING = 4;
1727 }
1728 optional RollbackReasonType rollback_reason = 4;
1729
1730 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1731 // is initiated. Empty if the package is unknown.
1732 optional string failing_package_name = 5;
Howard Roe103fe22019-01-17 16:52:16 -08001733}
1734
Jack Hec27040a2019-01-09 20:54:41 -08001735/**
1736 * Logs when there is a change in Bluetooth A2DP playback state
1737 *
1738 * Logged from:
1739 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1740 */
1741message BluetoothA2dpPlaybackStateChanged {
1742 // An identifier that can be used to match events for this device.
1743 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1744 // Salt: Randomly generated 256 bit value
1745 // Hash algorithm: HMAC-SHA256
1746 // Size: 32 byte
1747 // Default: null or empty if the device identifier is not known
1748 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1749 // Current playback state
1750 // Default: PLAYBACK_STATE_UNKNOWN
1751 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1752 // Current audio coding mode
1753 // Default: AUDIO_CODING_MODE_UNKNOWN
1754 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1755}
1756
1757/**
1758 * Logs when there is a change in A2DP codec config for a particular remote device
1759 *
1760 * Logged from:
1761 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1762 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1763 */
1764message BluetoothA2dpCodecConfigChanged {
1765 // An identifier that can be used to match events for this device.
1766 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1767 // Salt: Randomly generated 256 bit value
1768 // Hash algorithm: HMAC-SHA256
1769 // Size: 32 byte
1770 // Default: null or empty if the device identifier is not known
1771 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1772 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1773 // Default SOURCE_CODEC_TYPE_INVALID
1774 optional int32 codec_type = 2;
1775 // Codec priroity, the higher the more preferred, -1 for disabled
1776 // Default: CODEC_PRIORITY_DEFAULT
1777 optional int32 codec_priority = 3;
1778 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1779 // Default: SAMPLE_RATE_NONE
1780 optional int32 sample_rate = 4;
1781 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1782 // Default: BITS_PER_SAMPLE_NONE
1783 optional int32 bits_per_sample = 5;
1784 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1785 // Default: CHANNEL_MODE_NONE
1786 optional int32 channel_mode = 6;
1787 // Codec specific values
1788 // Default 0
1789 optional int64 codec_specific_1 = 7;
1790 optional int64 codec_specific_2 = 8;
1791 optional int64 codec_specific_3 = 9;
1792 optional int64 codec_specific_4 = 10;
1793}
1794
1795/**
1796 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1797 * Each codec's capability is logged separately due to statsd restriction
1798 *
1799 * Logged from:
1800 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1801 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1802 */
1803message BluetoothA2dpCodecCapabilityChanged {
1804 // An identifier that can be used to match events for this device.
1805 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1806 // Salt: Randomly generated 256 bit value
1807 // Hash algorithm: HMAC-SHA256
1808 // Size: 32 byte
1809 // Default: null or empty if the device identifier is not known
1810 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1811 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1812 // Default SOURCE_CODEC_TYPE_INVALID
1813 optional int32 codec_type = 2;
1814 // Codec priroity, the higher the more preferred, -1 for disabled
1815 // Default: CODEC_PRIORITY_DEFAULT
1816 optional int32 codec_priority = 3;
1817 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1818 // in BluetoothCodecConfig
1819 // Default: empty and SAMPLE_RATE_NONE for individual item
1820 optional int32 sample_rate = 4;
1821 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1822 // in BluetoothCodecConfig
1823 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1824 optional int32 bits_per_sample = 5;
1825 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1826 // BluetoothCodecConfig
1827 // Default: empty and CHANNEL_MODE_NONE for individual item
1828 optional int32 channel_mode = 6;
1829 // Codec specific values
1830 // Default 0
1831 optional int64 codec_specific_1 = 7;
1832 optional int64 codec_specific_2 = 8;
1833 optional int64 codec_specific_3 = 9;
1834 optional int64 codec_specific_4 = 10;
1835}
1836
1837/**
1838 * Logs when A2DP failed to read from PCM source.
1839 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1840 *
1841 * Logged from:
1842 * system/bt
1843 */
1844message BluetoothA2dpAudioUnderrunReported {
1845 // An identifier that can be used to match events for this device.
1846 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1847 // Salt: Randomly generated 256 bit value
1848 // Hash algorithm: HMAC-SHA256
1849 // Size: 32 byte
1850 // Default: null or empty if the device identifier is not known
1851 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1852 // Encoding interval in nanoseconds
1853 // Default: 0
1854 optional int64 encoding_interval_nanos = 2;
1855 // Number of bytes of PCM data that could not be read from the source
1856 // Default: 0
1857 optional int32 num_missing_pcm_bytes = 3;
1858}
1859
1860/**
1861 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1862 * buffer queue is full and we have to drop data
1863 *
1864 * Logged from:
1865 * system/bt
1866 */
1867message BluetoothA2dpAudioOverrunReported {
1868 // An identifier that can be used to match events for this device.
1869 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1870 // Salt: Randomly generated 256 bit value
1871 // Hash algorithm: HMAC-SHA256
1872 // Size: 32 byte
1873 // Default: null or empty if the device identifier is not known
1874 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1875 // Encoding interval in nanoseconds
1876 // Default: 0
1877 optional int64 encoding_interval_nanos = 2;
1878 // Number of buffers dropped in this event
1879 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1880 // Default: 0
1881 optional int32 num_dropped_buffers = 3;
1882 // Number of encoded buffers dropped in this event
1883 // Default 0
1884 optional int32 num_dropped_encoded_frames = 4;
1885 // Number of encoded bytes dropped in this event
1886 // Default: 0
1887 optional int32 num_dropped_encoded_bytes = 5;
1888}
1889
1890/**
1891 * Logs when we receive reports regarding a device's RSSI value
1892 *
1893 * Logged from:
1894 * system/bt
1895 */
1896message BluetoothDeviceRssiReported {
1897 // An identifier that can be used to match events for this device.
1898 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1899 // Salt: Randomly generated 256 bit value
1900 // Hash algorithm: HMAC-SHA256
1901 // Size: 32 byte
1902 // Default: null or empty if the device identifier is not known
1903 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1904 // Connection handle of this connection if available
1905 // Range: 0x0000 - 0x0EFF (12 bits)
1906 // Default: 0xFFFF if the handle is unknown
1907 optional int32 connection_handle = 2;
1908 // HCI command status code if this is triggerred by hci_cmd
1909 // Default: STATUS_UNKNOWN
1910 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1911 // BR/EDR
1912 // Range: -128 ≤ N ≤ 127 (signed integer)
1913 // Units: dB
1914 // LE:
1915 // Range: -127 to 20, 127 (signed integer)
1916 // Units: dBm
1917 // Invalid when an out of range value is reported
1918 optional int32 rssi = 4;
1919}
1920
1921/**
1922 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1923 *
1924 * Logged from:
1925 * system/bt
1926 */
1927message BluetoothDeviceFailedContactCounterReported {
1928 // An identifier that can be used to match events for this device.
1929 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1930 // Salt: Randomly generated 256 bit value
1931 // Hash algorithm: HMAC-SHA256
1932 // Size: 32 byte
1933 // Default: null or empty if the device identifier is not known
1934 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1935 // Connection handle of this connection if available
1936 // Range: 0x0000 - 0x0EFF (12 bits)
1937 // Default: 0xFFFF if the handle is unknown
1938 optional int32 connection_handle = 2;
1939 // HCI command status code if this is triggerred by hci_cmd
1940 // Default: STATUS_UNKNOWN
1941 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1942 // Number of consecutive failed contacts for a connection corresponding to the Handle
1943 // Range: uint16_t, 0-0xFFFF
1944 // Default: 0xFFFFF
1945 optional int32 failed_contact_counter = 4;
1946}
1947
1948/**
1949 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1950 *
1951 * Logged from:
1952 * system/bt
1953 */
1954message BluetoothDeviceTxPowerLevelReported {
1955 // An identifier that can be used to match events for this device.
1956 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1957 // Salt: Randomly generated 256 bit value
1958 // Hash algorithm: HMAC-SHA256
1959 // Size: 32 byte
1960 // Default: null or empty if the device identifier is not known
1961 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1962 // Connection handle of this connection if available
1963 // Range: 0x0000 - 0x0EFF (12 bits)
1964 // Default: 0xFFFF if the handle is unknown
1965 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001966 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001967 // Default: STATUS_UNKNOWN
1968 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1969 // Range: -30 ≤ N ≤ 20
1970 // Units: dBm
1971 // Invalid when an out of range value is reported
1972 optional int32 transmit_power_level = 4;
1973}
Jack Heab86dbd22018-12-18 15:43:27 -08001974
Tej Singh5d991e12018-03-09 19:48:11 -08001975/**
Jack He1021a612019-01-20 21:22:46 -08001976 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1977 * receiving an HCI command from the host
1978 *
1979 * Logged from: system/bt
1980 */
1981message BluetoothHciTimeoutReported {
1982 // HCI command associated with this event
1983 // Default: CMD_UNKNOWN
1984 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1985}
1986
1987/**
1988 * Logs when we receive Bluetooth Link Quality Report event from the controller
1989 * See Android Bluetooth HCI specification for more details
1990 *
1991 * Note: all count and bytes field are counted since last event
1992 *
1993 * Logged from: system/bt
1994 */
1995message BluetoothQualityReportReported {
1996 // Quality report ID
1997 // Original type: uint8_t
1998 // Default: BQR_ID_UNKNOWN
1999 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2000 // Packet type of the connection
2001 // Original type: uint8_t
2002 // Default: BQR_PACKET_TYPE_UNKNOWN
2003 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2004 // Connection handle of the connection
2005 // Original type: uint16_t
2006 optional int32 connection_handle = 3;
2007 // Performing Role for the connection
2008 // Original type: uint8_t
2009 optional int32 connection_role = 4;
2010 // Current Transmit Power Level for the connection. This value is the same as the controller's
2011 // response to the HCI_Read_Transmit_Power_Level HCI command
2012 // Original type: uint8_t
2013 optional int32 tx_power_level = 5;
2014 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2015 // absolute receiver signal strength value
2016 // Original type: int8_t
2017 optional int32 rssi = 6;
2018 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2019 // channels used by the link currently
2020 // Original type: uint8_t
2021 optional int32 snr = 7;
2022 // Indicates the number of unused channels in AFH_channel_map
2023 // Original type: uint8_t
2024 optional int32 unused_afh_channel_count = 8;
2025 // Indicates the number of the channels which are interfered and quality is bad but are still
2026 // selected for AFH
2027 // Original type: uint8_t
2028 optional int32 afh_select_unideal_channel_count = 9;
2029 // Current Link Supervision Timeout Setting
2030 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2031 // Original type: uint16_t
2032 optional int32 lsto = 10;
2033 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2034 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2035 // 0x01 (Piconet Clock)
2036 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2037 // Original type: uint32_t
2038 optional int64 connection_piconet_clock = 11;
2039 // The count of retransmission
2040 // Original type: uint32_t
2041 optional int64 retransmission_count = 12;
2042 // The count of no RX
2043 // Original type: uint32_t
2044 optional int64 no_rx_count = 13;
2045 // The count of NAK (Negative Acknowledge)
2046 // Original type: uint32_t
2047 optional int64 nak_count = 14;
2048 // Controller timestamp of last TX ACK
2049 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2050 // Original type: uint32_t
2051 optional int64 last_tx_ack_timestamp = 15;
2052 // The count of Flow-off (STOP)
2053 // Original type: uint32_t
2054 optional int64 flow_off_count = 16;
2055 // Controller timestamp of last Flow-on (GO)
2056 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2057 // Original type: uint32_t
2058 optional int64 last_flow_on_timestamp = 17;
2059 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2060 // Original type: uint32_t
2061 optional int64 buffer_overflow_bytes = 18;
2062 // Buffer underflow count (in byte) since last event
2063 // Original type: uint32_t
2064 optional int64 buffer_underflow_bytes = 19;
2065}
2066
2067/**
2068 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2069 *
2070 * Notes:
2071 * - Each event can be partially filled as we might learn different pieces of device
2072 * information at different time
2073 * - Multiple device info events can be combined to give more complete picture
2074 * - When multiple device info events tries to describe the same information, the
2075 * later one wins
2076 *
2077 * Logged from:
2078 * packages/apps/Bluetooth
2079 */
Jack Heaea26982019-04-04 11:19:48 -07002080message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002081 // An identifier that can be used to match events for this device.
2082 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2083 // Salt: Randomly generated 256 bit value
2084 // Hash algorithm: HMAC-SHA256
2085 // Size: 32 byte
2086 // Default: null or empty if the device identifier is not known
2087 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2088 // Where is this device info obtained from
2089 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2090 // Name of the data source
2091 // For EXTERNAL: package name of the data source
2092 // For INTERNAL: null for general case, component name otherwise
2093 optional string source_name = 3;
2094 // Name of the manufacturer of this device
2095 optional string manufacturer = 4;
2096 // Model of this device
2097 optional string model = 5;
2098 // Hardware version of this device
2099 optional string hardware_version = 6;
2100 // Software version of this device
2101 optional string software_version = 7;
2102}
2103
2104/**
2105 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2106 * device, as documented by the Bluetooth Core HCI specification
2107 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2108 * Vol 2, Part E, Page 1118
2109 *
2110 * Logged from:
2111 * system/bt
2112 */
2113message BluetoothRemoteVersionInfoReported {
2114 // Connection handle of the connection
2115 // Original type: uint16_t
2116 optional int32 connection_handle = 1;
2117 // HCI command status code
2118 // Default: STATUS_UNKNOWN
2119 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2120 // 1 byte Version of current LMP in the remote controller
2121 optional int32 lmp_version = 3;
2122 // 2 bytes LMP manufacturer code of the remote controller
2123 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2124 optional int32 lmp_manufacturer_code = 4;
2125 // 4 bytes subversion of the LMP in the remote controller
2126 optional int32 lmp_subversion = 5;
2127}
2128
2129/**
2130 * Logs when certain Bluetooth SDP attributes are discovered
2131 * Constant definitions are from:
2132 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2133 *
2134 * Current logged attributes:
2135 * - BluetoothProfileDescriptorList
2136 * - Supported Features Bitmask
2137 *
2138 * Logged from:
2139 * system/bt
2140 */
2141message BluetoothSdpAttributeReported {
2142 // An identifier that can be used to match events for this device.
2143 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2144 // Salt: Randomly generated 256 bit value
2145 // Hash algorithm: HMAC-SHA256
2146 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2147 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2148 // Original type: uint16_t
2149 optional int32 protocol_uuid = 2;
2150 // Short form UUIDs used to identify Bluetooth SDP attribute types
2151 // Original type: uint16_t
2152 optional int32 attribute_id = 3;
2153 // Attribute value for the particular attribute
2154 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2155}
2156
2157/**
2158 * Logs when bond state of a Bluetooth device changes
2159 *
2160 * Logged from:
2161 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2162 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2163 */
2164message BluetoothBondStateChanged {
2165 // An identifier that can be used to match events for this device.
2166 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2167 // Salt: Randomly generated 256 bit value
2168 // Hash algorithm: HMAC-SHA256
2169 // Size: 32 byte
2170 // Default: null or empty if the device identifier is not known
2171 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2172 // Preferred transport type to remote dual mode device
2173 // Default: TRANSPORT_AUTO means no preference
2174 optional android.bluetooth.TransportTypeEnum transport = 2;
2175 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2176 // Default: UNKNOWN
2177 optional android.bluetooth.DeviceTypeEnum type = 3;
2178 // Current bond state (NONE, BONDING, BONDED)
2179 // Default: BOND_STATE_UNKNOWN
2180 optional android.bluetooth.BondStateEnum bond_state = 4;
2181 // Bonding sub state
2182 // Default: BOND_SUB_STATE_UNKNOWN
2183 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2184 // Unbond Reason
2185 // Default: UNBOND_REASON_UNKNOWN
2186 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2187}
2188
2189/**
2190 * Logs there is an event related Bluetooth classic pairing
2191 *
2192 * Logged from:
2193 * system/bt
2194 */
2195message BluetoothClassicPairingEventReported {
2196 // An identifier that can be used to match events for this device.
2197 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2198 // Salt: Randomly generated 256 bit value
2199 // Hash algorithm: HMAC-SHA256
2200 // Size: 32 byte
2201 // Default: null or empty if the device identifier is not known
2202 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2203 // Connection handle of this connection if available
2204 // Range: 0x0000 - 0x0EFF (12 bits)
2205 // Default: 0xFFFF if the handle is unknown
2206 optional int32 connection_handle = 2;
2207 // HCI command associated with this event
2208 // Default: CMD_UNKNOWN
2209 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2210 // HCI event associated with this event
2211 // Default: EVT_UNKNOWN
2212 optional android.bluetooth.hci.EventEnum hci_event = 4;
2213 // HCI command status code if this is triggerred by hci_cmd
2214 // Default: STATUS_UNKNOWN
2215 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2216 // HCI reason code associated with this event
2217 // Default: STATUS_UNKNOWN
2218 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002219 // A status value related to this specific event
2220 // Default: 0
2221 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002222}
2223
2224/**
2225 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2226 *
2227 * Logged from:
2228 * system/bt
2229 */
2230message BluetoothSmpPairingEventReported {
2231 // An identifier that can be used to match events for this device.
2232 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2233 // Salt: Randomly generated 256 bit value
2234 // Hash algorithm: HMAC-SHA256
2235 // Size: 32 byte
2236 // Default: null or empty if the device identifier is not known
2237 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2238 // SMP command sent or received over L2CAP
2239 // Default: CMD_UNKNOWN
2240 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2241 // Whether this command is sent or received
2242 // Default: DIRECTION_UNKNOWN
2243 optional android.bluetooth.DirectionEnum direction = 3;
2244 // SMP failure reason code
2245 // Default: PAIRING_FAIL_REASON_DEFAULT
2246 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2247}
2248
2249/**
Jack He815cdba2019-01-30 17:24:55 -08002250 * Logs when a Bluetooth socket’s connection state changed
2251 *
2252 * Logged from:
2253 * system/bt
2254 */
2255message BluetoothSocketConnectionStateChanged {
2256 // An identifier that can be used to match events for this device.
2257 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2258 // Salt: Randomly generated 256 bit value
2259 // Hash algorithm: HMAC-SHA256
2260 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002261 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002262 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002263 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002264 // Default 0 when unknown or don't care
2265 optional int32 port = 2;
2266 // Socket type as mentioned in
2267 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2268 // Default: SOCKET_TYPE_UNKNOWN
2269 optional android.bluetooth.SocketTypeEnum type = 3;
2270 // Socket connection state
2271 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2272 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2273 // Number of bytes sent to remote device during this connection
2274 optional int64 tx_bytes = 5;
2275 // Number of bytes received from remote device during this connection
2276 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002277 // Socket owner's UID
2278 optional int32 uid = 7 [(is_uid) = true];
2279 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2280 // |port| must be spawned by |server_port|
2281 // Default 0 when unknown or don't care
2282 optional int32 server_port = 8;
2283 // Whether this is a server listener socket
2284 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002285}
2286
2287/**
Jack He71426802019-04-02 13:32:52 -07002288 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2289 *
2290 * Logged from:
2291 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2292 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2293 *
2294 */
2295message BluetoothClassOfDeviceReported {
2296 // An identifier that can be used to match events for this device.
2297 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2298 // Salt: Randomly generated 256 bit value
2299 // Hash algorithm: HMAC-SHA256
2300 // Size: 32 byte
2301 // Default: null or empty if this is a server listener socket
2302 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2303 // Class of Device (CoD) value including both Major, Minor device class and service class
2304 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2305 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2306 // Default: 0
2307 optional int32 class_of_device = 2;
2308}
2309
2310/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002311 * Logs when something is plugged into or removed from the USB-C connector.
2312 *
2313 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002314 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002315 */
2316message UsbConnectorStateChanged {
2317 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002318 STATE_DISCONNECTED = 0;
2319 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002320 }
2321 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002322 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002323 // Last active session in ms.
2324 // 0 when the port is in connected state.
2325 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002326}
2327
2328/**
2329 * Logs the reported speaker impedance.
2330 *
2331 * Logged from:
2332 * Vendor audio implementation.
2333 */
2334message SpeakerImpedanceReported {
2335 optional int32 speaker_location = 1;
2336 optional int32 impedance = 2;
2337}
2338
2339/**
2340 * Logs the report of a failed hardware.
2341 *
2342 * Logged from:
2343 * Vendor HALs.
2344 *
2345 */
2346message HardwareFailed {
2347 enum HardwareType {
2348 HARDWARE_FAILED_UNKNOWN = 0;
2349 HARDWARE_FAILED_MICROPHONE = 1;
2350 HARDWARE_FAILED_CODEC = 2;
2351 HARDWARE_FAILED_SPEAKER = 3;
2352 HARDWARE_FAILED_FINGERPRINT = 4;
2353 }
2354 optional HardwareType hardware_type = 1;
2355
Maggie White6dcd8572019-01-31 14:11:50 -08002356 /**
2357 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002358 * the same hardware_type. The specific locations are vendor defined integers,
2359 * referring to board-specific numbering schemes.
2360 */
2361 optional int32 hardware_location = 2;
2362
Maggie White6dcd8572019-01-31 14:11:50 -08002363 /**
2364 * failure_code is specific to the HardwareType of the failed hardware.
2365 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002366 */
Maggie White6dcd8572019-01-31 14:11:50 -08002367 enum HardwareErrorCode {
2368 UNKNOWN = 0;
2369 COMPLETE = 1;
2370 SPEAKER_HIGH_Z = 2;
2371 SPEAKER_SHORT = 3;
2372 FINGERPRINT_SENSOR_BROKEN = 4;
2373 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002374 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002375 }
2376 optional int32 failure_code = 3;
2377}
2378
2379/**
2380 * Log an event when the device has been physically dropped.
2381 * Reported from the /vendor partition.
2382 */
2383message PhysicalDropDetected {
2384 // Confidence that the event was actually a drop, 0 -> 100
2385 optional int32 confidence_pctg = 1;
2386 // Peak acceleration of the drop, in 1/1000s of a g.
2387 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002388 // Duration of freefall in ms
2389 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002390}
2391
2392/**
2393 * Log bucketed battery charge cycles.
2394 *
2395 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002396 * a given charge point. For example, if 10 cycle buckets are
2397 * initialized, bucket 1 is the lowest 1/10th of the battery,
2398 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002399 *
2400 * Logged from:
2401 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2402 */
2403message ChargeCyclesReported {
2404 optional int32 cycle_bucket_1 = 1;
2405 optional int32 cycle_bucket_2 = 2;
2406 optional int32 cycle_bucket_3 = 3;
2407 optional int32 cycle_bucket_4 = 4;
2408 optional int32 cycle_bucket_5 = 5;
2409 optional int32 cycle_bucket_6 = 6;
2410 optional int32 cycle_bucket_7 = 7;
2411 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002412 optional int32 cycle_bucket_9 = 9;
2413 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002414}
2415
2416/**
Howard Roa46b6582018-09-18 16:45:02 -07002417 * Log battery health snapshot.
2418 *
2419 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2420 * are snapshotted periodically over 24hrs.
2421 */
2422message BatteryHealthSnapshot {
2423 enum BatterySnapshotType {
2424 UNKNOWN = 0;
2425 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2426 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2427 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2428 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2429 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2430 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2431 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2432 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2433 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2434 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2435 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2436 }
2437 optional BatterySnapshotType type = 1;
2438 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002439 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002440 // Voltage Battery Voltage, in microVolts.
2441 optional int32 voltage_micro_volt = 3;
2442 // Current Battery current, in microAmps.
2443 optional int32 current_micro_amps = 4;
2444 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2445 optional int32 open_circuit_micro_volt = 5;
2446 // Resistance Battery Resistance, in microOhms.
2447 optional int32 resistance_micro_ohm = 6;
2448 // Level Battery Level, as % of full.
2449 optional int32 level_percent = 7;
2450}
2451
2452/**
2453 * Log slow I/O operations on the primary storage.
2454 */
2455message SlowIo {
2456 // Classifications of IO Operations.
2457 enum IoOperation {
2458 UNKNOWN = 0;
2459 READ = 1;
2460 WRITE = 2;
2461 UNMAP = 3;
2462 SYNC = 4;
2463 }
2464 optional IoOperation operation = 1;
2465
2466 // The number of slow IO operations of this type over 24 hours.
2467 optional int32 count = 2;
2468}
2469
2470/**
2471 * Log battery caused shutdown with the last recorded voltage.
2472 */
2473message BatteryCausedShutdown {
2474 // The last recorded battery voltage prior to shutdown.
2475 optional int32 last_recorded_micro_volt = 1;
2476}
2477
2478/**
Tej Singha72344992019-04-17 18:55:08 -07002479 * Logs when ThermalService receives throttling events.
2480 *
2481 * Logged from:
2482 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2483 */
2484message ThermalThrottlingSeverityStateChanged {
2485 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2486 optional android.os.TemperatureTypeEnum sensor_type = 1;
2487
2488 // The name of the temperature source. Eg. CPU0
2489 optional string sensor_name = 2;
2490
2491 // Temperature in tenths of a degree C.
2492 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2493 optional int32 temperature_deci_celsius = 3;
2494
2495 // Relative severity of the throttling, see enum definition.
2496 optional android.os.ThrottlingSeverityEnum severity = 4;
2497}
2498
2499/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002500 * Logs the duration of a davey (jank of >=700ms) when it occurs
2501 *
2502 * Logged from:
2503 * frameworks/base/libs/hwui/JankTracker.cpp
2504 */
2505message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002506 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002507 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002508
Tej Singhbb8554a2018-01-26 11:59:14 -08002509 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002510 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002511}
2512
2513/**
Bookatze5885242017-10-24 20:10:31 -07002514 * Logs phone signal strength changes.
2515 *
2516 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002517 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002518 */
2519message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002520 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2521 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002522}
2523
Yangster4ccebea2018-10-09 17:09:02 -07002524
2525/**
2526 * Logs when the phone state, sim state or signal strength changes
2527 *
2528 * Logged from:
2529 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2530 */
2531message PhoneServiceStateChanged {
2532 optional android.telephony.ServiceStateEnum state = 1;
2533 optional android.telephony.SimStateEnum sim_state = 2;
2534 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2535}
2536
2537/**
2538 * Logs when the phone becomes on or off.
2539 *
2540 * Logged from:
2541 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2542 */
2543message PhoneStateChanged {
2544 enum State {
2545 OFF = 0;
2546 ON = 1;
2547 }
2548 optional State state = 1;
2549}
2550
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002551message BackGesture {
2552 enum BackType {
2553 DEFAULT_BACK_TYPE = 0;
2554 COMPLETED = 1;
2555 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2556 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2557 INCOMPLETE = 4;
2558 }
2559 optional BackType type = 1;
2560
2561 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2562 enum WindowHorizontalLocation {
2563 DEFAULT_LOCATION = 0;
2564 LEFT = 1;
2565 RIGHT = 2;
2566 }
2567 optional WindowHorizontalLocation x_location = 3;
2568}
2569
2570message ExclusionRectStateChanged {
2571 optional string component_name = 1; // if not available, simply packageName
2572 optional int32 requested_height = 2; // px
2573 optional int32 rejected_height = 3; // px
2574
2575 enum WindowHorizontalLocation {
2576 DEFAULT_LOCATION = 0;
2577 LEFT = 1;
2578 RIGHT = 2;
2579 }
2580 optional WindowHorizontalLocation x_location = 4;
2581 optional bool landscape = 5;
2582 optional bool splitscreen = 6;
2583 optional int32 duration_millis = 7;
2584}
2585
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002586message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002587 optional android.stats.launcher.LauncherAction action = 1;
2588 optional android.stats.launcher.LauncherState src_state = 2;
2589 optional android.stats.launcher.LauncherState dst_state = 3;
2590 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002591 optional bool is_swipe_up_enabled = 5;
2592}
2593
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002594message StyleUIChanged {
2595 optional android.stats.style.Action action = 1;
2596 optional int32 color_package_hash = 2;
2597 optional int32 font_package_hash = 3;
2598 optional int32 shape_package_hash = 4;
2599 optional int32 clock_package_hash = 5;
2600 optional int32 launcher_grid = 6;
2601 optional int32 wallpaper_category_hash = 7;
2602 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002603 optional int32 color_preference = 9;
2604 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002605}
2606
David Chenc28b2bb2017-10-24 12:52:52 -07002607/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002608 * Logs when Settings UI has changed.
2609 *
2610 * Logged from:
2611 * packages/apps/Settings
2612 */
2613message SettingsUIChanged {
2614 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002615 * Where this SettingsUIChange event comes from. For example, if
2616 * it's a PAGE_VISIBLE event, where the page is opened from.
2617 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002618 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002619
2620 /**
2621 * What the UI action is.
2622 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002623 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002624
2625 /**
2626 * Where the action is happening
2627 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002628 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002629
2630 /**
2631 * What preference changed in this event.
2632 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002633 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002634
2635 /**
2636 * The new value of the changed preference.
2637 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002638 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002639}
2640
2641/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002642 * Logs basic timing information about touch events.
2643 * Reported at most every 5 minutes while device is being interacted with.
2644 *
2645 * Logged from:
2646 * frameworks/native/services/inputflinger
2647 */
2648message TouchEventReported {
2649 /**
2650 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002651 * and the standard deviation of the time spent processing touchscreen events
2652 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002653 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002654 * On supported devices, the starting point is taken during the hard interrupt inside the
2655 * kernel touch driver. On all other devices, the starting point is taken inside
2656 * the kernel's input event subsystem upon receipt of the input event.
2657 * The ending point is taken inside InputDispatcher, just after the input event
2658 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002659 */
2660 // Minimum value
2661 optional float latency_min_micros = 1;
2662 // Maximum value
2663 optional float latency_max_micros = 2;
2664 // Average value
2665 optional float latency_mean_micros = 3;
2666 // Standard deviation
2667 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002668 // Number of touch events (input_event) in this report
2669 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002670}
2671
2672/**
Philip Quinn0eded622019-01-29 12:46:28 -08002673 * Logs gesture classification and timing information for touch events.
2674 *
2675 * Logged from:
2676 * frameworks/base/core/java/android/view/GestureDetector.java
2677 * frameworks/base/core/java/android/view/View.java
2678 */
2679message TouchGestureClassified {
2680 // The source of the classification (e.g. Java class name).
2681 optional string source = 1;
2682
2683 enum Classification {
2684 UNKNOWN_CLASSIFICATION = 0;
2685 SINGLE_TAP = 1;
2686 DOUBLE_TAP = 2;
2687 LONG_PRESS = 3;
2688 DEEP_PRESS = 4;
2689 SCROLL = 5;
2690 }
2691 // The classification of the gesture.
2692 optional Classification classification = 2;
2693
2694 // The interval from the start of a touch event stream until the
2695 // classification was made.
2696 optional int32 latency_millis = 3;
2697
2698 // The distance from the location of the first touch event to the
2699 // location of the touch event when the classification was made.
2700 optional float displacement_px = 4;
2701}
2702
2703/**
David Chenc28b2bb2017-10-24 12:52:52 -07002704 * Logs that a setting was updated.
2705 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002706 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002707 * The tag and is_default allow resetting of settings to default values based on the specified
2708 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2709 */
2710message SettingChanged {
2711 // The name of the setting.
2712 optional string setting = 1;
2713
2714 // The change being imposed on this setting. May represent a number, eg "3".
2715 optional string value = 2;
2716
2717 // The new value of this setting. For most settings, this is same as value. For some settings,
2718 // value is +X or -X where X represents an element in a set. For example, if the previous value
2719 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2720 // The +/- feature is currently only used for location_providers_allowed.
2721 optional string new_value = 3;
2722
2723 // The previous value of this setting.
2724 optional string prev_value = 4;
2725
2726 // The tag used with the is_default for resetting sets of settings. This is generally null.
2727 optional string tag = 5;
2728
Bookatz90867622018-01-31 15:05:57 -08002729 // True if this setting with tag should be resettable.
2730 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002731
David Chenbd789912018-03-16 17:19:55 -07002732 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002733 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002734
2735 enum ChangeReason {
2736 UPDATED = 1; // Updated can be an insertion or an update.
2737 DELETED = 2;
2738 }
2739 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002740}
Chenjie Yub3dda412017-10-24 13:41:59 -07002741
Chenjie Yu05013b32017-11-21 10:21:41 -08002742/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002743 * Logs activity going to foreground or background
2744 *
2745 * Logged from:
2746 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2747 */
2748message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002749 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002750 optional string pkg_name = 2;
2751 optional string class_name = 3;
2752
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002753 enum State {
2754 BACKGROUND = 0;
2755 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002756 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002757 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002758}
David Chenc8a43242017-10-17 16:23:28 -07002759
2760/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002761 * Logs when a volume entered low Storage state.
2762 * Logged from:
2763 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2764 */
2765message LowStorageStateChanged {
2766 // Volume that ran out of storage.
2767 optional string volume_description = 1;
2768
2769 enum State {
2770 UNKNOWN = 0;
2771 OFF = 1;
2772 ON = 2;
2773 }
2774 optional State state = 2;
2775}
2776
2777/**
2778 * Logs when an app is downgraded.
2779 * Logged from:
2780 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2781 */
2782message AppDowngraded {
2783 optional string package_name = 1;
2784 // Size of the package (all data) before being downgraded.
2785 optional int64 size_in_bytes_before = 2;
2786 // Size of the package (all data) after being downgraded.
2787 optional int64 size_in_bytes_after = 3;
2788
2789 optional bool aggressive = 4;
2790}
2791
2792/**
2793 * Logs when an app is optimized after being downgraded.
2794 * Logged from:
2795 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2796 */
2797message AppOptimizedAfterDowngraded {
2798 optional string package_name = 1;
2799}
2800
2801/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002802 * Logs whenever an app is installed on external storage.
2803 * Logged from:
2804 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2805 */
2806message AppInstallOnExternalStorageReported {
2807 // The type of external storage.
2808 optional android.stats.storage.ExternalStorageType storage_type = 1;
2809 // The name of the package that is installed on the sd card.
2810 optional string package_name = 2;
2811}
2812
2813/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002814 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002815 * Logged from:
2816 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2817 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002818message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002819 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002820
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002821 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002822
2823 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002824 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002825 optional string process_name = 3;
2826
2827 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002828 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002829
2830 optional string package_name = 5;
2831
2832 enum InstantApp {
2833 UNAVAILABLE = 0;
2834 FALSE = 1;
2835 TRUE = 2;
2836 }
2837 optional InstantApp is_instant_app = 6;
2838
2839 enum ForegroundState {
2840 UNKNOWN = 0;
2841 BACKGROUND = 1;
2842 FOREGROUND = 2;
2843 }
2844 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002845
2846 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002847}
David Chen9e3808c2017-11-20 17:25:34 -08002848
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002849/**
2850 * Logs when a WTF (What a Terrible Failure) happened.
2851 * Logged from:
2852 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2853 */
2854message WTFOccurred {
2855 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002856
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002857 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002858
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002859 // The name of the process.
2860 // system_server if it is not by an app
2861 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002862
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002863 // The pid if available. -1 means not available.
2864 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002865
2866 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002867}
2868
2869/**
2870 * Logs when system server reports low memory.
2871 * Logged from:
2872 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2873 */
2874message LowMemReported {
2875}
2876
2877/**
2878 * Logs when an app ANR (App Not Responding) occurs.
2879 * Logged from:
2880 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2881 */
2882message ANROccurred {
2883 optional int32 uid = 1 [(is_uid) = true];
2884
2885 optional string process_name = 2;
2886
2887 optional string short_component_name = 3;
2888
2889 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002890
2891 enum InstantApp {
2892 UNAVAILABLE = 0;
2893 FALSE = 1;
2894 TRUE = 2;
2895 }
2896 optional InstantApp is_instant_app = 5;
2897
2898 enum ForegroundState {
2899 UNKNOWN = 0;
2900 BACKGROUND = 1;
2901 FOREGROUND = 2;
2902 }
2903 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002904
2905 optional android.server.ErrorSource error_source = 7;
2906
2907 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002908}
2909
Bookatza7020bd2018-08-28 16:29:35 -07002910/**
2911 * Logs when the vibrator state changes.
2912 * Logged from:
2913 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2914 */
2915message VibratorStateChanged {
2916 repeated AttributionNode attribution_node = 1;
2917
2918 enum State {
2919 OFF = 0;
2920 ON = 1;
2921 }
2922 optional State state = 2;
2923
2924 // Duration (in milliseconds) requested to keep the vibrator on.
2925 // Only applicable for State == ON.
2926 optional int64 duration_millis = 3;
2927}
2928
David Chen0a368b22017-12-06 16:28:16 -08002929/*
2930 * Allows other apps to push events into statsd.
2931 * Logged from:
2932 * frameworks/base/core/java/android/util/StatsLog.java
2933 */
David Chen0b5c90c2018-01-25 16:51:49 -08002934message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002935 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002936 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002937
2938 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2939 optional int32 label = 2;
2940
2941 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2942 // predicates for the metrics).
2943 enum State {
2944 UNKNOWN = 0;
2945 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2946 STOP = 2;
2947 START = 3;
2948 }
2949 optional State state = 3;
2950}
2951
David Chen9e3808c2017-11-20 17:25:34 -08002952/**
Bookatz7948c872018-09-04 12:58:33 -07002953 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2954 * For example, this could be due to the user manually changing the time.
2955 *
2956 * Logged from:
2957 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2958 */
2959message WallClockTimeShifted {
2960 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2961 optional int64 wall_clock_timestamp_millis = 1;
2962}
2963
2964/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002965 * Logs when statsd detects an anomaly.
2966 *
2967 * Logged from:
2968 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2969 */
2970message AnomalyDetected {
2971 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002972 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002973
Yangster-mac94e197c2018-01-02 16:03:03 -08002974 // Id of the config whose anomaly detection alert fired.
2975 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002976
Yangster-mac94e197c2018-01-02 16:03:03 -08002977 // Id of the alert (i.e. name of the anomaly that was detected).
2978 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002979}
2980
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002981message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002982 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002983 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002984
2985 // The app package name.
2986 optional string pkg_name = 2;
2987
2988 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002989 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002990 WARM = 1;
2991 HOT = 2;
2992 COLD = 3;
2993 }
2994 // The transition type.
2995 optional TransitionType type = 3;
2996
2997 // The activity name.
2998 optional string activity_name = 4;
2999
3000 // The name of the calling app. Empty if not set.
3001 optional string calling_pkg_name = 5;
3002
3003 // Whether the app is an instant app.
3004 optional bool is_instant_app = 6;
3005
3006 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003007 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003008
Bookatz80d11a02018-01-16 10:46:35 -08003009 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003010
David Chen0b5c90c2018-01-25 16:51:49 -08003011 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003012 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003013 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003014 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003015 optional int32 bind_application_delay_millis = 11;
3016 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003017
3018 // Empty if not set.
3019 optional string launch_token = 13;
3020
Calin Juravle759fbda2018-02-20 19:52:30 +00003021 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003022 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003023
3024 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003025 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003026}
3027
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003028message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003029 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003030 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003031
3032 // The app package name.
3033 optional string pkg_name = 2;
3034
3035 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003036 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003037 WARM = 1;
3038 HOT = 2;
3039 COLD = 3;
3040 }
3041 // The transition type.
3042 optional TransitionType type = 3;
3043
3044 // The activity name.
3045 optional string activity_name = 4;
3046}
3047
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003048message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003049 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003050 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003051
3052 // The app package name.
3053 optional string pkg_name = 2;
3054
3055 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003056 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003057 WITH_BUNDLE = 1;
3058 WITHOUT_BUNDLE = 2;
3059 }
3060 // The transition type.
3061 optional TransitionType type = 3;
3062
3063 // The activity name.
3064 optional string activity_name = 4;
3065
3066 optional bool transition_process_running = 5;
3067
3068 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003069 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003070}
3071
Bookatz8fcd09a2017-12-18 13:01:10 -08003072/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003073 * Logs a picture-in-picture action
3074 * Logged from:
3075 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3076 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3077 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3078 */
3079message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003080 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003081 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003082
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003083 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003084
Chenjie Yu52cacc62017-12-08 18:11:45 -08003085 enum State {
3086 ENTERED = 1;
3087 EXPANDED_TO_FULL_SCREEN = 2;
3088 MINIMIZED = 3;
3089 DISMISSED = 4;
3090 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003091 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003092}
3093
3094/**
Chenjie Yue8904192017-12-08 19:12:57 -08003095 * Logs overlay action
3096 * Logged from:
3097 * services/core/java/com/android/server/wm/Session.java
3098 */
3099message OverlayStateChanged {
tsaichristine10978642019-09-10 14:12:49 -07003100 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003101
tsaichristine10978642019-09-10 14:12:49 -07003102 optional string package_name = 2 [(state_field_option).option = PRIMARY];
Chenjie Yue8904192017-12-08 19:12:57 -08003103
3104 optional bool using_alert_window = 3;
3105
3106 enum State {
3107 ENTERED = 1;
3108 EXITED = 2;
3109 }
tsaichristine10978642019-09-10 14:12:49 -07003110 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Chenjie Yue8904192017-12-08 19:12:57 -08003111}
3112
Chenjie Yuccfe6452018-01-30 11:33:21 -08003113/*
3114 * Logs foreground service starts and stops.
3115 * Note that this is not when a service starts or stops, but when it is
3116 * considered foreground.
3117 * Logged from
3118 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3119 */
3120message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003121 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003122 // package_name + "/" + class_name
3123 optional string short_name = 2;
3124
3125 enum State {
3126 ENTER = 1;
3127 EXIT = 2;
3128 }
3129 optional State state = 3;
3130}
3131
Chenjie Yue8904192017-12-08 19:12:57 -08003132/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003133 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3134 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3135 * attributed back to the parent (host) uid. One example is Chrome.
3136 *
3137 * Logged from:
3138 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3139 */
3140message IsolatedUidChanged {
3141 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003142 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003143 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003144 optional int32 parent_uid = 1;
3145
3146 optional int32 isolated_uid = 2;
3147
3148 // We expect an isolated uid to be removed before if it's used for another parent uid.
3149 enum Event {
3150 REMOVED = 0;
3151 CREATED = 1;
3152 }
3153 optional Event event = 3;
3154}
3155
3156/*
3157 * Logs the reception of an incoming network packet causing the main system to wake up for
3158 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3159 * and processed by WakeupController.cpp.
3160 */
3161message PacketWakeupOccurred {
3162 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3163 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003164 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003165 // The interface name on which the packet was received.
3166 optional string iface = 2;
3167 // The ethertype value of the packet.
3168 optional int32 ethertype = 3;
3169 // String representation of the destination MAC address of the packet.
3170 optional string destination_hardware_address = 4;
3171 // String representation of the source address of the packet if this was an IP packet.
3172 optional string source_ip = 5;
3173 // String representation of the destination address of the packet if this was an IP packet.
3174 optional string destination_ip = 6;
3175 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3176 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3177 // families.
3178 optional int32 ip_next_header = 7;
3179 // The source port if this was a TCP or UDP packet.
3180 optional int32 source_port = 8;
3181 // The destination port if this was a TCP or UDP packet.
3182 optional int32 destination_port = 9;
3183}
3184
3185/*
3186 * Logs the memory stats for an app on startup.
3187 * Logged from:
3188 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3189 */
3190message AppStartMemoryStateCaptured {
3191 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003192 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003193
3194 // The process name.
3195 optional string process_name = 2;
3196
3197 // The activity name.
3198 optional string activity_name = 3;
3199
3200 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003201 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003202
3203 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003204 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003205
3206 // RSS
3207 optional int64 rss_in_bytes = 6;
3208
3209 // CACHE
3210 optional int64 cache_in_bytes = 7;
3211
3212 // SWAP
3213 optional int64 swap_in_bytes = 8;
3214}
3215
3216/*
3217 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3218 * for LMK event.
3219 * Logged from:
3220 * system/core/lmkd/lmkd.c
3221 */
3222message LmkStateChanged {
3223 enum State {
3224 UNKNOWN = 0;
3225 START = 1;
3226 STOP = 2;
3227 }
3228 optional State state = 1;
3229}
3230
3231/*
3232 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3233 * Logged from:
3234 * system/core/lmkd/lmkd.c
3235 */
3236message LmkKillOccurred {
3237 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003238 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003239
3240 // The process name.
3241 optional string process_name = 2;
3242
3243 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003244 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003245
3246 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003247 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003248
3249 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003250 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003251
3252 // RSS
3253 optional int64 rss_in_bytes = 6;
3254
3255 // CACHE
3256 optional int64 cache_in_bytes = 7;
3257
3258 // SWAP
3259 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003260
3261 // The elapsed real time of start of the process.
3262 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003263
3264 // Min oom adj score considered by lmkd.
3265 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003266}
3267
Rajeev Kumar51b54602018-03-01 12:18:26 -08003268/*
3269 * Logs when the ActivityManagerService detects that an app died.
3270 *
3271 * Logged from:
3272 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3273 */
3274message AppDied {
3275 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003276 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003277}
3278
Howard Ro21a039c2018-08-06 14:55:47 -07003279/**
3280 * An atom for generic metrics logging. Available from Android Q.
3281 */
3282message GenericAtom {
3283 // The uid of the application that sent this custom atom.
3284 optional int32 uid = 1 [(is_uid) = true];
3285
3286 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003287 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003288}
3289
Tej Singhd6d6d772018-09-05 17:41:25 -07003290/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003291 * Atom for simple logging of user interaction and impression events, such as "the user touched
3292 * this button" or "this dialog was displayed".
3293 * Keep the UI event stream clean: don't use for system or background events.
3294 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003295 *
3296 * Logged from:
3297 * frameworks/base/services/core/java/com/android/server/
3298 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003299 */
3300message UiEventReported {
3301 // The event_id.
3302 optional int32 event_id = 1;
3303 // The event's source or target uid and package, if applicable.
3304 // For example, the package posting a notification, or the destination package of a share.
3305 optional int32 uid = 2 [(is_uid) = true];
3306 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003307 // An identifier used to disambiguate which logs refer to a particular instance of some
3308 // UI element. Useful when there might be multiple instances simultaneously active.
3309 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003310}
3311
3312/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003313 * Reports a notification was created or updated.
3314 *
3315 * Logged from:
3316 * frameworks/base/services/core/java/com/android/server/notification/
3317 */
3318message NotificationReported {
3319 // The event_id (as for UiEventReported).
3320 optional int32 event_id = 1;
3321 // The notifying app's uid and package.
3322 optional int32 uid = 2 [(is_uid) = true];
3323 optional string package_name = 3;
3324 // A small system-assigned identifier for the notification.
3325 // Locally probably-unique, but expect collisions across users and/or days.
3326 optional int32 instance_id = 4;
3327 // The app-assigned notification ID and tag
3328 optional int32 notification_id = 5;
3329 optional string notification_tag = 6;
3330 optional string channel_id = 7; // App-assigned channel ID
3331
3332 // Grouping information
3333 optional string group_id = 8; // Group the notification currently belongs to
3334 optional int32 group_instance_id = 9; // Instance_id of the group-summary notification
3335 optional bool is_group_summary = 10; // Tags the group-summary notification
3336
3337 // Attributes
3338 optional string category = 11; // App-assigned notification category (API-defined strings)
3339 optional int32 style = 12; // App-assigned notification style
3340 optional int32 num_people = 13; // Number of Person records attached to the notification
3341
3342 // Ordering, importance and interruptiveness
3343
3344 optional int32 position = 14; // Position in NotificationManager's list
3345
3346 optional android.stats.sysui.NotificationImportance importance = 15;
3347 optional int32 alerting = 16; // Bitfield, 1=buzz 2=beep 4=blink
3348
3349 enum NotificationImportanceExplanation {
3350 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3351 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3352 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3353 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3354 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3355 // Like _APP, but based on pre-channels priority signal.
3356 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3357 }
3358
3359 optional NotificationImportanceExplanation importance_source = 17;
3360 optional android.stats.sysui.NotificationImportance importance_initial = 18;
3361 optional NotificationImportanceExplanation importance_initial_source = 19;
3362 optional android.stats.sysui.NotificationImportance importance_asst = 20;
3363 optional int32 assistant_hash = 21;
3364 optional float assistant_ranking_score = 22;
3365}
3366
3367message Notification {
3368 // The notifying app's uid and package.
3369 optional int32 uid = 1 [(is_uid) = true];
3370 optional string package_name = 2;
3371 // A small system-assigned identifier for the notification.
3372 optional int32 instance_id = 3;
3373
3374 // Grouping information.
3375 optional int32 group_instance_id = 4;
3376 optional bool is_group_summary = 5;
3377
3378 // The section of the shade that the notification is in.
3379 // See NotificationSectionsManager.PriorityBucket.
3380 enum NotificationSection {
3381 SECTION_UNKNOWN = 0;
3382 SECTION_PEOPLE = 1;
3383 SECTION_ALERTING = 2;
3384 SECTION_SILENT = 3;
3385 }
3386 optional NotificationSection section = 6;
3387}
3388
3389message NotificationList {
3390 repeated Notification notifications = 1; // An ordered sequence of notifications.
3391}
3392
3393/**
3394 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3395 *
3396 * Logged from:
3397 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3398 */
3399message NotificationPanelReported {
3400 // The event_id (as for UiEventReported).
3401 optional int32 event_id = 1;
3402 optional int32 num_notifications = 2;
3403 // The notifications in the panel, in the order that they appear there.
3404 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3405}
3406
3407/**
3408 * Reports a notification channel, or channel group, was created, updated, or deleted.
3409 *
3410 * Logged from:
3411 * frameworks/base/services/core/java/com/android/server/notification/
3412 */
3413message NotificationChannelModified {
3414 // The event_id (as for UiEventReported).
3415 optional int32 event_id = 1;
3416 // The notifying app's uid and package.
3417 optional int32 uid = 2 [(is_uid) = true];
3418 optional string package_name = 3;
3419 // App-assigned notification channel ID or channel-group ID
3420 optional string channel_id = 4;
3421 // Previous importance setting, if applicable
3422 optional android.stats.sysui.NotificationImportance old_importance = 5;
3423 // New importance setting
3424 optional android.stats.sysui.NotificationImportance importance = 6;
3425}
3426
3427
3428/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003429 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003430 *
3431 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003432 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003433 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003434message BiometricAcquired {
3435 // Biometric modality that was acquired.
3436 optional android.hardware.biometrics.ModalityEnum modality = 1;
3437 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3438 optional int32 user = 2;
3439 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3440 optional bool is_crypto = 3;
3441 // Action that the device is performing. Acquired messages are only expected for enroll and
3442 // authenticate. Other actions may indicate an error.
3443 optional android.hardware.biometrics.ActionEnum action = 4;
3444 // The client that this acquisition was received for.
3445 optional android.hardware.biometrics.ClientEnum client = 5;
3446 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3447 optional int32 acquire_info = 6;
3448 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3449 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003450 // Dictates if this message should trigger additional debugging.
3451 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003452}
3453
3454/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003455 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003456 *
3457 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003458 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003459 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003460message BiometricAuthenticated {
3461 // Biometric modality that was used.
3462 optional android.hardware.biometrics.ModalityEnum modality = 1;
3463 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3464 optional int32 user = 2;
3465 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3466 // storage.
3467 optional bool is_crypto = 3;
3468 // The client that this acquisition was received for.
3469 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003470 // If authentication requires user confirmation. See BiometricPrompt's
3471 // setRequireConfirmation(bool) method.
3472 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003473
Kevin Chyn1741a072019-01-17 11:54:40 -08003474 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003475 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003476 REJECTED = 1;
3477 PENDING_CONFIRMATION = 2;
3478 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003479 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003480
3481 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003482 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003483 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3484 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3485 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3486 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003487 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003488 // Dictates if this message should trigger additional debugging.
3489 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003490}
3491
3492/**
3493 * Logs when a biometric error occurs.
3494 *
3495 * Logged from:
3496 * frameworks/base/services/core/java/com/android/server/biometrics
3497 */
3498message BiometricErrorOccurred {
3499 // Biometric modality that was used.
3500 optional android.hardware.biometrics.ModalityEnum modality = 1;
3501 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3502 optional int32 user = 2;
3503 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3504 optional bool is_crypto = 3;
3505 // Action that the device is performing.
3506 optional android.hardware.biometrics.ActionEnum action = 4;
3507 // The client that this acquisition was received for.
3508 optional android.hardware.biometrics.ClientEnum client = 5;
3509 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3510 // are unique to modality.
3511 optional int32 error_info = 6;
3512 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3513 // by the vendor and not specified by the HIDL interface.
3514 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003515 // Dictates if this message should trigger additional debugging.
3516 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003517 // Time spent during the authentication attempt.
3518 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003519}
3520
3521/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003522 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003523 * Logged from:
3524 * frameworks/base/services/core/java/com/android/server/biometrics
3525 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003526message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003527 // Biometric modality.
3528 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003529 // Type of issue detected.
3530 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003531 // Dictates if this message should trigger additional debugging.
3532 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003533}
Howard Ro688ae182018-09-25 00:09:36 -07003534
joshmccloskey6f952b22019-03-25 20:59:35 -07003535/**
3536 * Logs when a biometric enrollment occurs.
3537 *
3538 * Logged from:
3539 * frameworks/base/services/core/java/com/android/server/biometrics
3540 */
3541message BiometricEnrolled {
3542 // Biometric modality that was used.
3543 optional android.hardware.biometrics.ModalityEnum modality = 1;
3544 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3545 optional int32 user = 2;
3546 // The amount of time the enrollment took in milliseconds.
3547 optional int64 latency_millis = 3;
3548 // Whether or not the enrollment was successful.
3549 optional bool success = 4;
3550}
3551
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003552/*
Tej Singh0d176952019-01-16 19:10:54 -08003553 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003554 */
Tej Singh0d176952019-01-16 19:10:54 -08003555message FlagFlipUpdateOccurred {
3556 // If the event is from a flag config package, specify the package name.
3557 optional string flag_flip_package_name = 1;
3558
3559 // The order id of the package
3560 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003561}
3562
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003563/**
3564 * Potential experiment ids that goes with a train install.
3565 */
3566message TrainExperimentIds {
3567 repeated int64 experiment_id = 1;
3568}
3569
Yangster-macb89807e2018-11-15 21:10:57 -08003570/*
3571 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003572 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003573 */
3574message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003575 // Name of the train.
3576 optional string train_name = 1;
3577 // Version code for a "train" of packages that need to be installed atomically
3578 optional int64 train_version_code = 2;
3579 // After installation of this package, device requires a restart.
3580 optional bool requires_staging = 3;
3581 // Rollback should be enabled for this install.
3582 optional bool rollback_enabled = 4;
3583 // Requires low latency monitoring if possible.
3584 optional bool requires_low_latency_monitor = 5;
3585
Yangster-macb89807e2018-11-15 21:10:57 -08003586 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003587 UNKNOWN = 0;
3588 INSTALL_REQUESTED = 1;
3589 INSTALL_STARTED = 2;
3590 INSTALL_STAGED_NOT_READY = 3;
3591 INSTALL_STAGED_READY = 4;
3592 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003593 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3594 // and INSTALL_FAILURE_COMMIT.
3595 INSTALL_FAILURE = 6 [deprecated = true];
3596 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003597 INSTALL_CANCELLED = 7;
3598 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003599 INSTALLER_ROLLBACK_INITIATED = 9;
3600 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3601 INSTALLER_ROLLBACK_STAGED = 11;
3602 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3603 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3604 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3605 INSTALLER_ROLLBACK_SUCCESS = 15;
3606 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003607 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3608 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3609 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3610 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3611 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3612 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003613 INSTALL_FAILURE_DOWNLOAD = 23;
3614 INSTALL_FAILURE_STATE_MISMATCH = 24;
3615 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003616 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003617 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003618 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003619 // Possible experiment ids for monitoring this push.
3620 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3621 // user id
3622 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003623 optional int32 reason = 9;
Yangster-macb89807e2018-11-15 21:10:57 -08003624}
3625
Tej Singhc9203082019-05-03 13:42:23 -07003626/* Test atom, is not logged anywhere */
3627message TestAtomReported {
3628 repeated AttributionNode attribution_node = 1;
3629 optional int32 int_field = 2;
3630 optional int64 long_field = 3;
3631 optional float float_field = 4;
3632 optional string string_field = 5;
3633 optional bool boolean_field = 6;
3634 enum State {
3635 UNKNOWN = 0;
3636 OFF = 1;
3637 ON = 2;
3638 }
3639 optional State state = 7;
3640 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3641}
3642
Maggie Whitefc1aa592018-11-28 21:55:23 -08003643/** Represents USB port overheat event. */
3644message UsbPortOverheatEvent {
3645 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3646 optional int32 plug_temperature_deci_c = 1;
3647
3648 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3649 optional int32 max_temperature_deci_c = 2;
3650
3651 /* Time between USB plug event and overheat threshold trip, in seconds. */
3652 optional int32 time_to_overheat_secs = 3;
3653
3654 /* Time between overheat threshold trip and hysteresis, in seconds. */
3655 optional int32 time_to_hysteresis_secs = 4;
3656
3657 /* Time between hysteresis and active mitigation ending, in seconds. */
3658 optional int32 time_to_inactive_secs = 5;
3659};
3660
Maggie White8735b852019-01-18 11:40:49 -08003661/**
3662 * Logs total effective full charge and discharge cycles on a battery.
3663 * Here are some examples of one effective cycle:
3664 * 1) the battery charges from 0% to 100% and drains back to 0%,
3665 * 2) charging from 50% to 100% and draining back to 50% twice.
3666 * Pulled from:
3667 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3668 */
3669message BatteryCycleCount {
3670 /* Number of total charge and discharge cycles on the system battery. */
3671 optional int32 cycle_count = 1;
3672}
3673
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003674/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003675 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3676 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003677 * Pulled from:
3678 * StatsCompanionService
3679 */
3680
Carmen Agimof12dec122019-03-06 16:14:38 +00003681message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003682
Carmen Agimof12dec122019-03-06 16:14:38 +00003683 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003684 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003685 PUBLIC = 1;
3686 PRIVATE = 2;
3687 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003688 }
3689
Carmen Agimof12dec122019-03-06 16:14:38 +00003690 // The type of external storage.
3691 optional android.stats.storage.ExternalStorageType storage_type = 1;
3692 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3693 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003694 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003695 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003696}
3697
Yangster-macb89807e2018-11-15 21:10:57 -08003698/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003699 * Logs when a connection becomes available and lost.
3700 * Logged in StatsCompanionService.java
3701 */
3702message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003703 // Id of the network.
3704 optional int32 net_id = 1;
3705
3706 enum State {
3707 UNKNOWN = 0;
3708 CONNECTED = 1;
3709 DISCONNECTED = 2;
3710 }
3711 // Connected state of a network.
3712 optional State state = 2;
3713}
3714
3715/**
3716 * Logs when a service starts and stops.
3717 * Logged from:
3718 * services/core/java/com/android/server/am/ActiveServices.java
3719 */
3720message ServiceStateChanged {
3721
3722 optional int32 uid = 1 [(is_uid) = true];
3723
3724 optional string package_name = 2;
3725
3726 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003727
3728 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003729 START = 1;
3730 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003731 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003732
3733 optional State state = 4;
3734}
3735
3736/**
3737 * Logs when a service is launched.
3738 * Logged from:
3739 * services/core/java/com/android/server/am/ActiveServices.java
3740 */
3741message ServiceLaunchReported {
3742
3743 optional int32 uid = 1 [(is_uid) = true];
3744
3745 optional string package_name = 2;
3746
3747 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003748}
Howard Ro688ae182018-09-25 00:09:36 -07003749
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003750/**
3751 * Logs when a hidden API is used.
3752 *
3753 * Logged from:
3754 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3755 */
3756message HiddenApiUsed {
3757 // The uid of the app making the hidden access.
3758 optional int32 uid = 1 [(is_uid) = true];
3759
3760 // Signature of the method or field accessed.
3761 optional string signature = 2;
3762
3763 enum AccessMethod {
3764 NONE = 0;
3765 REFLECTION = 1;
3766 JNI = 2;
3767 LINKING = 3;
3768 }
3769
3770 // Type of access.
3771 optional AccessMethod access_method = 3;
3772
3773 // Whether the access was prevented or not.
3774 optional bool access_denied = 4;
3775}
3776
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003777/**
3778 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3779 * - When user sees privacy chip
3780 * - When user clicks privacy chip
3781 * - How does the user exit the Privacy Dialog
3782 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003783 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3784 */
3785message PrivacyIndicatorsInteracted {
3786
3787 enum Type {
3788 UNKNOWN = 0;
3789 CHIP_VIEWED = 1;
3790 CHIP_CLICKED = 2;
3791 DIALOG_PRIVACY_SETTINGS = 3;
3792 DIALOG_DISMISS = 4;
3793 DIALOG_LINE_ITEM = 5;
3794 }
3795
3796 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3797
3798 // Used if the type is LINE_ITEM
3799 optional string package_name = 2;
3800}
3801
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003802/**
3803 * Logs information about a package that is moved from the internal to external storage and vice
3804 * versa.
3805 * It logs the package name, the type of the external storage where the package is installed
3806 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3807 * and the move type: if it's from internal to external or the other way around.
3808 *
3809 * Logged from:
3810 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3811 */
3812message AppMovedStorageReported {
3813 enum MoveType {
3814 UNKNOWN = 0;
3815 TO_EXTERNAL = 1;
3816 TO_INTERNAL = 2;
3817 }
3818 // The type of the external storage.
3819 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3820 // The type of move.
3821 optional MoveType move_type = 2;
3822 // The name of the package that was moved.
3823 optional string package_name = 3;
3824}
3825
jianjin8f2dee02019-03-29 14:03:08 -07003826/**
3827 * Logs when system server watchdog occurs.
3828 * Logged from:
3829 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3830 */
3831message SystemServerWatchdogOccurred {
3832 optional string subject = 1;
3833}
3834
3835/**
3836 * Logs when new file added to tombstones.
3837 * Logged from:
3838 * frameworks/base/core/java/com/android/server/BootReceiver.java
3839 */
3840message TombStoneOccurred {
3841}
3842
Hai Zhang5d3328d2019-04-13 21:25:06 +08003843/*
3844 * Information about a role request
3845 *
3846 * Logged from:
3847 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3848 */
3849message RoleRequestResultReported {
3850 // UID of application requesting the role
3851 optional int32 requesting_uid = 1;
3852
3853 // Package name of application requesting the role
3854 optional string requesting_package_name = 2;
3855
3856 // The role to be granted
3857 optional string role_name = 3;
3858
3859 // The count of applications qualifying for the role
3860 optional int32 qualifying_count = 4;
3861
3862 // UID of application current granted the role
3863 optional int32 current_uid = 5;
3864
3865 // Package name of application current granted the role
3866 optional string current_package_name = 6;
3867
3868 // UID of another application that user chose to grant the role to, instead of the requesting
3869 // application
3870 optional int32 granted_another_uid = 7;
3871
3872 // Package name of another application that user chose to grant the role to, instead of the
3873 // requesting application
3874 optional string granted_another_package_name = 8;
3875
3876 enum Result {
3877 UNDEFINED = 0;
3878 // role request was ignored
3879 IGNORED = 1;
3880 // role request was ignored because it's already granted
3881 IGNORED_ALREADY_GRANTED = 2;
3882 // role request was ignored because the application isn't qualified
3883 IGNORED_NOT_QUALIFIED = 3;
3884 // role request was ignored because user said it should be always denied
3885 IGNORED_USER_ALWAYS_DENIED = 4;
3886 // role was granted by user action
3887 USER_GRANTED = 5;
3888 // role was denied by user action
3889 USER_DENIED = 6;
3890 // role was denied by user granting another application the role
3891 USER_DENIED_GRANTED_ANOTHER = 7;
3892 // role was denied and set to be always denied by the user
3893 USER_DENIED_WITH_ALWAYS = 8;
3894 }
3895 // The result of the role request
3896 optional Result result = 9;
3897}
3898
Mark Tabrya824a642019-11-05 12:26:12 -08003899/**
3900 * Logs when a Vehicle Maps Service client's connection state has changed
3901 *
3902 * Logged from:
3903 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
3904 */
3905message VmsClientConnectionStateChanged {
3906 // The UID of the VMS client app
3907 optional int32 uid = 1 [(is_uid) = true];
3908
3909 enum State {
3910 UNKNOWN = 0;
3911 // Attempting to connect to the client
3912 CONNECTING = 1;
3913 // Client connection established
3914 CONNECTED = 2;
3915 // Client connection closed unexpectedly
3916 DISCONNECTED = 3;
3917 // Client connection closed by VMS
3918 TERMINATED = 4;
3919 // Error establishing the client connection
3920 CONNECTION_ERROR = 5;
3921 }
3922
3923 optional State state = 2;
3924}
3925
Jeff Sharkey6bd21572019-11-15 20:45:33 -07003926/**
3927 * Logs when MediaProvider has successfully finished scanning a storage volume.
3928 *
3929 * Logged from:
3930 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
3931 */
3932message MediaProviderScanEvent {
3933 enum Reason {
3934 // Scan triggered due to unknown reason
3935 UNKNOWN = 0;
3936 // Scan triggered due to storage volume being mounted
3937 MOUNTED = 1;
3938 // Scan triggered due to explicit user action or app request
3939 DEMAND = 2;
3940 // Scan triggered due to idle maintenance
3941 IDLE = 3;
3942 }
3943
3944 // Volume type that this event pertains to
3945 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3946 // Reason why this scan was triggered
3947 optional Reason reason = 2;
3948 // Total number of files scanned
3949 optional int64 item_count = 3;
3950 // Duration of scan, normalized per file
3951 optional float normalized_duration_millis = 4;
3952 // Number of database inserts, normalized per file
3953 optional float normalized_insert_count = 5;
3954 // Number of database updates, normalized per file
3955 optional float normalized_update_count = 6;
3956 // Number of database deletes, normalized per file
3957 optional float normalized_delete_count = 7;
3958}
3959
3960/**
3961 * Logs when an app has asked MediaProvider to delete media belonging to the user.
3962 *
3963 * Logged from:
3964 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
3965 */
3966message MediaProviderDeletionEvent {
3967 // Volume type that this event pertains to
3968 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3969 // Device timestamp when this deletion event occurred
3970 optional int64 timestamp_millis = 2;
3971 // App that requested deletion
3972 optional string package_name = 3;
3973 // Number of items that were deleted
3974 optional int32 item_count = 4;
3975}
3976
3977/**
3978 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
3979 *
3980 * Logged from:
3981 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
3982 */
3983message MediaProviderPermissionEvent {
3984 enum Result {
3985 UNKNOWN = 0;
3986 USER_GRANTED = 1;
3987 AUTO_GRANTED = 2;
3988 USER_DENIED = 3;
3989 USER_DENIED_WITH_PREJUDICE = 4;
3990 AUTO_DENIED = 5;
3991 }
3992
3993 // Volume type that this event pertains to
3994 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3995 // Device timestamp when this permission event occurred
3996 optional int64 timestamp_millis = 2;
3997 // App that requested permission
3998 optional string package_name = 3;
3999 // Number of items that were requested
4000 optional int32 item_count = 4;
4001 // Result of this request
4002 optional Result result = 5;
4003}
4004
4005/**
4006 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4007 *
4008 * Logged from:
4009 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4010 */
4011message MediaProviderSchemaChange {
4012 // Volume type that this event pertains to
4013 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4014 // Old database version code
4015 optional int32 version_from = 2;
4016 // New database version code
4017 optional int32 version_to = 3;
4018 // Total number of files in database
4019 optional int64 item_count = 4;
4020 // Duration of schema change, normalized per file
4021 optional float normalized_duration_millis = 5;
4022}
4023
4024/**
4025 * Logs when MediaProvider has finished an idle maintenance job.
4026 *
4027 * Logged from:
4028 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4029 */
4030message MediaProviderIdleMaintenance {
4031 // Volume type that this event pertains to
4032 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4033
4034 // Total number of files in database
4035 optional int64 item_count = 2;
4036 // Duration of idle maintenance, normalized per file
4037 optional float normalized_duration_millis = 3;
4038 // Number of thumbnails found to be stale, normalized per file
4039 optional float normalized_stale_thumbnails = 4;
4040 // Number of items found to be expired, normalized per file
4041 optional float normalized_expired_media = 5;
4042}
4043
Keun young Park3e033cb2019-12-18 11:27:35 -08004044/**
4045 * Represents boot time event with duration in ms.
4046 *
4047 * Logged from: bootstat and various system server components. Check each enums for details.
4048 */
4049message BootTimeEventDuration {
4050 enum DurationEvent {
4051 UNKNOWN = 0;
4052 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4053 ABSOLUTE_BOOT_TIME = 1;
4054 // Bootloader's 1st stage execution time.
4055 // Logged from bootstat.
4056 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4057 // Bootloader's 1st stage loading time.
4058 // Logged from bootstat.
4059 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4060 // Bootloader's kernel loading time.
4061 // Logged from bootstat.
4062 BOOTLOADER_KERNEL_LOAD = 4;
4063 // Bootloader's 2nd stage execution time.
4064 // Logged from bootstat.
4065 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4066 // Bootloader's 2nd stage loading time.
4067 // Logged from bootstat.
4068 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4069 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4070 // for locked device.
4071 // Logged from bootstat.
4072 BOOTLOADER_UI_WAIT = 7;
4073 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4074 // Logged from bootstat.
4075 BOOTLOADER_TOTAL = 8;
4076 // Shutdown duration inside init for the reboot before the current boot up.
4077 // Logged from f/b/services/.../BootReceiver.java.
4078 SHUTDOWN_DURATION = 9;
4079 // Total time for mounting of disk devices during bootup.
4080 // Logged from f/b/services/.../BootReceiver.java.
4081 MOUNT_DEFAULT_DURATION = 10;
4082 // Total time for early stage mounting of disk devices during bootup.
4083 // Logged from f/b/services/.../BootReceiver.java.
4084 MOUNT_EARLY_DURATION = 11;
4085 // Total time for late stage mounting of disk devices during bootup.
4086 // Logged from f/b/services/.../BootReceiver.java.
4087 MOUNT_LATE_DURATION = 12;
4088 // Average time to scan non-system app after OTA
4089 // Logged from f/b/services/.../PackageManagerService.java
4090 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4091 // Time to initialize Package manager after OTA
4092 // Logged from f/b/services/.../PackageManagerService.java
4093 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4094 // Time to scan all system app from Package manager after OTA
4095 // Logged from f/b/services/.../PackageManagerService.java
4096 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4097 // Init's total time for cold boot stage.
4098 // Logged from bootstat.
4099 COLDBOOT_WAIT = 16;
4100 // Init's total time for initializing selinux.
4101 // Logged from bootstat.
4102 SELINUX_INIT = 17;
4103 // Time since last factory reset.
4104 // Logged from bootstat.
4105 FACTORY_RESET_TIME_SINCE_RESET = 18;
4106 }
4107
4108 // Type of the event.
4109 optional DurationEvent event = 1;
4110 // Duration of the event in ms.
4111 optional int64 duration_millis = 2;
4112}
4113
4114/**
4115 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4116 * since boot-up.
4117 *
4118 * Logged from: bootstat and various system server components. Check each enums for details.
4119 */
4120message BootTimeEventElapsedTime {
4121 enum ElapsedTimeEvent {
4122 UNKNOWN = 0;
4123 // Time when init starts 1st stage. Logged from bootstat.
4124 ANDROID_INIT_STAGE_1 = 1;
4125 // Time when sys.boot_completed prop is set.
4126 // Logged from bootstat.
4127 BOOT_COMPLETE = 2;
4128 // BOOT_COMPLETE for encrypted device.
4129 BOOT_COMPLETE_ENCRYPTION = 3;
4130 // BOOT_COMPLETE for device with no encryption.
4131 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4132 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
4133 BOOT_COMPLETE_POST_DESCRYPT = 5;
4134 // BOOT_COMPLETE after factory reset.
4135 FACTORY_RESET_BOOT_COMPLETE = 6;
4136 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4137 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
4138 // BOOT_COMPLETE_POST_DESCRYPT after factory reset.
4139 FACTORY_RESET_BOOT_COMPLETE_POST_DESCRYPT = 8;
4140 // BOOT_COMPLETE after OTA.
4141 OTA_BOOT_COMPLETE = 9;
4142 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4143 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
4144 // BOOT_COMPLETE_POST_DESCRYPT after OTA.
4145 OTA_BOOT_COMPLETE_POST_DESCRYPT = 11;
4146 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4147 // Logged from f/b/services/.../UserController.java
4148 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4149 // Time when the system starts sending BOOT_COMPLETED broadcast.
4150 // Logged from f/b/services/.../UserController.java
4151 FRAMEWORK_BOOT_COMPLETED = 13;
4152 // Time when the package manager starts init.
4153 // Logged from f/b/services/.../SystemServer.java
4154 PACKAGE_MANAGER_INIT_START = 14;
4155 // Time when package manager is ready
4156 // Logged from f/b/services/.../SystemServer.java
4157 PACKAGE_MANAGER_INIT_READY = 15;
4158 // Represents the time when user has entered unlock credential for system with user pin.
4159 // Logged from bootstat.
4160 POST_DECRYPT = 16;
4161 // Represents the start of zygote's init.
4162 // Logged from zygote itself.
4163 ZYGOTE_INIT_START = 17;
4164 // Represents the start of secondary zygote's init.
4165 // TODO: add logging to zygote
4166 SECONDARY_ZYGOTE_INIT_START = 18;
4167 // Represents the start of system server's init.
4168 // Logged from f/b/services/.../SystemServer.java
4169 SYSTEM_SERVER_INIT_START = 19;
4170 // Represents the completion of system server's init.
4171 // Logged from f/b/services/.../SystemServer.java
4172 SYSTEM_SERVER_READY = 20;
4173 // Represents the start of launcher during boot-up.
4174 // TODO: add logging
4175 LAUNCHER_START = 21;
4176 // Represents the completion of launcher's initial rendering. User can use other apps from
4177 // launcher from this point.
4178 // TODO: add logging
4179 LAUNCHER_SHOWN = 22;
4180 }
4181
4182 // Type of the event.
4183 optional ElapsedTimeEvent event = 1;
4184 // Time since bootup for the event.
4185 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4186 optional int64 time_millis = 2;
4187}
4188
4189/**
4190 * Boot time events with UTC time.
4191 *
4192 * Logged from: bootstat and various system server components. Check each enums for details.
4193 */
4194message BootTimeEventUtcTime {
4195 enum UtcTimeEvent {
4196 UNKNOWN = 0;
4197 // Time of the bootstat's marking of 1st boot after the last factory reset.
4198 // Logged from bootstat.
4199 FACTORY_RESET_RESET_TIME = 1;
4200 // The time when bootstat records FACTORY_RESET_* events. This is close to
4201 // BOOT_COMPLETE time for the current bootup.
4202 // Logged from bootstat.
4203 FACTORY_RESET_CURRENT_TIME = 2;
4204 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4205 // Logged from bootstat.
4206 FACTORY_RESET_RECORD_VALUE = 3;
4207 }
4208
4209 // Type of the event.
4210 optional UtcTimeEvent event = 1;
4211 // UTC time for the event.
4212 optional int64 utc_time_secs = 2;
4213}
4214
4215/**
4216 * Boot time events representing specific error code during bootup.
4217 * Meaning of error code can be different per each event type.
4218 *
4219 * Logged from: bootstat and various system server components. Check each enums for details.
4220 */
4221message BootTimeEventErrorCode {
4222 enum ErrorCodeEvent {
4223 UNKNOWN = 0;
4224 // Linux error code for time() call to get the current UTC time.
4225 // Logged from bootstat.
4226 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4227 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4228 // as UMOUNT_STAT_* from init/reboot.cpp.
4229 // Logged from f/b/services/.../BootReceiver.java.
4230 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004231 // Reprepsents fie system mounting error code of /data partition for the current boot.
4232 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004233 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004234 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004235 }
4236
4237 // Type of the event.
4238 optional ErrorCodeEvent event = 1;
4239 // error code defined per each event type.
4240 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4241 // FS_MGR_FS_STAT.
4242 optional int32 error_code = 2;
4243}
4244
Chenjie Yubbcbc602018-02-05 16:51:52 -08004245//////////////////////////////////////////////////////////////////////
4246// Pulled atoms below this line //
4247//////////////////////////////////////////////////////////////////////
4248
4249/**
David Chenc8a43242017-10-17 16:23:28 -07004250 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4251 *
4252 * Pulled from:
4253 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4254 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004255message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004256 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004257
4258 optional int64 rx_bytes = 2;
4259
4260 optional int64 rx_packets = 3;
4261
4262 optional int64 tx_bytes = 4;
4263
4264 optional int64 tx_packets = 5;
4265}
4266
4267/**
4268 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4269 *
4270 * Pulled from:
4271 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4272 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004273message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004274 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004275
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004276 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4277 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004278
4279 optional int64 rx_bytes = 3;
4280
4281 optional int64 rx_packets = 4;
4282
4283 optional int64 tx_bytes = 5;
4284
4285 optional int64 tx_packets = 6;
4286}
4287
4288/**
4289 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4290 *
4291 * Pulled from:
4292 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4293 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004294message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004295 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004296
4297 optional int64 rx_bytes = 2;
4298
4299 optional int64 rx_packets = 3;
4300
4301 optional int64 tx_bytes = 4;
4302
4303 optional int64 tx_packets = 5;
4304}
4305
4306/**
4307 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4308 *
4309 * Pulled from:
4310 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4311 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004312message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004313 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004314
Yao Chenc40a19d2018-03-15 16:48:25 -07004315 // 1 denotes foreground and 0 denotes background. This is called Set in
4316 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004317 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004318
4319 optional int64 rx_bytes = 3;
4320
4321 optional int64 rx_packets = 4;
4322
4323 optional int64 tx_bytes = 5;
4324
4325 optional int64 tx_packets = 6;
4326}
4327
4328/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004329 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4330 *
4331 * Pulled from:
4332 * StatsCompanionService
4333 */
4334message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004335 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004336
4337 optional int64 rx_bytes = 2;
4338
4339 optional int64 tx_bytes = 3;
4340}
4341
4342/**
David Chenc8a43242017-10-17 16:23:28 -07004343 * Pulls the kernel wakelock durations. This atom is adapted from
4344 * android/internal/os/KernelWakelockStats.java
4345 *
4346 * Pulled from:
4347 * StatsCompanionService using KernelWakelockReader.
4348 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004349message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004350 optional string name = 1;
4351
4352 optional int32 count = 2;
4353
4354 optional int32 version = 3;
4355
Yangster-maca8a30442018-10-13 23:46:34 -07004356 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004357}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004358
Chenjie Yu05013b32017-11-21 10:21:41 -08004359/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004360 * Pulls low power state information. If power.stats HAL is not available, this
4361 * includes platform and subsystem sleep state information,
4362 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4363 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004364 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004365 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004366 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4367 * as defined in:
4368 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004369 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004370message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004371 // Subsystem name
4372 optional string subsystem_name = 1;
4373 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4374 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004375 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4376 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004377 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004378 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004379 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004380 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004381 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004382}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004383
Chenjie Yu05013b32017-11-21 10:21:41 -08004384/**
Bookatz92da2832018-11-01 18:10:03 -07004385 * Pulls on-device power measurement information.
4386 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4387 * Pulled from:
4388 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4389 */
4390message OnDevicePowerMeasurement {
4391 // Name of the subsystem (to which the rail belongs).
4392 optional string subsystem_name = 1;
4393
4394 // Rail name. The rail lies within the subsystem.
4395 optional string rail_name = 2;
4396
4397 // Time (in ms since boot) at which the rail energy value was measured.
4398 // This may differ slightly from the time that statsd logs this information.
4399 optional uint64 measurement_timestamp_millis = 3;
4400
4401 // Accumulated energy used via the rail since device boot in uWs.
4402 optional uint64 energy_microwatt_secs = 4;
4403}
4404
4405/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004406 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004407 * Pulls the time the cpu spend on the frequency index. Frequency index
4408 * starts from highest to lowest. The value should be monotonically
4409 * increasing since boot. However, if there is a cpu
4410 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004411 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004412message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004413 optional uint32 cluster = 1;
4414 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004415 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004416}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004417
Chenjie Yu05013b32017-11-21 10:21:41 -08004418/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004419 * Pulls Cpu Time Per Uid.
4420 * Note that isolated process uid time should be attributed to host uids.
4421 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004422message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004423 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004424 optional uint64 user_time_micros = 2;
4425 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004426}
4427
4428/**
4429 * Pulls Cpu Time Per Uid per frequency.
4430 * Note that isolated process uid time should be attributed to host uids.
4431 * For each uid, we order the time by descending frequencies.
4432 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004433message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004434 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004435 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004436 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004437}
Hugo Benichi884970e2017-11-14 22:42:46 +09004438
Chenjie Yu05013b32017-11-21 10:21:41 -08004439/**
4440 * Pulls Wifi Controller Activity Energy Info
4441 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004442message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004443 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004444 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004445 // stack reported state
4446 // TODO: replace this with proto enum
4447 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004448 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004449 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004450 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004451 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004452 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004453 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004454 // product of current(mA), voltage(V) and time(ms)
4455 optional uint64 controller_energy_used = 6;
4456}
4457
4458/**
4459 * Pulls Modem Activity Energy Info
4460 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004461message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004462 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004463 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004464 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004465 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004466 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004467 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004468 /**
4469 * Tx power index
4470 * index 0 = tx_power < 0dBm
4471 * index 1 = 0dBm < tx_power < 5dBm
4472 * index 2 = 5dBm < tx_power < 15dBm
4473 * index 3 = 15dBm < tx_power < 20dBm
4474 * index 4 = tx_power > 20dBm
4475 */
4476 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004477 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004478 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004479 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004480 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004481 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004482 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004483 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004484 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004485 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004486 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004487 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004488 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004489 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004490}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004491
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004492/**
4493 * Pulls Bluetooth Activity Energy Info
4494 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4495 */
4496message BluetoothActivityInfo {
4497 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004498 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004499 // bluetooth stack state
4500 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004501 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004502 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004503 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004504 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004505 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004506 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004507 // product of current(mA), voltage(V) and time(ms)
4508 optional uint64 energy_used = 6;
4509}
4510
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004511/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004512 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004513 *
4514 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004515 */
4516message ProcessMemoryState {
4517 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004518 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004519
4520 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004521 // Usually package name, "system" for system server.
4522 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004523 optional string process_name = 2;
4524
Rafal Slawikda51b932018-12-13 16:31:33 +00004525 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004526 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004527
4528 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004529 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004530
4531 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004532 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004533
Rajeev Kumar90235992018-01-29 11:06:48 -08004534 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004535 // Value is read from memory.stat, field total_rss if per-app memory
4536 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004537 optional int64 rss_in_bytes = 6;
4538
4539 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004540 // Value is read from memory.stat, field total_cache if per-app memory
4541 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004542 optional int64 cache_in_bytes = 7;
4543
4544 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004545 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004546 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004547 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004548
Rafal Slawik203c3db2019-09-25 19:53:01 +01004549 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004550 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004551
Rafal Slawik203c3db2019-09-25 19:53:01 +01004552 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4553 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004554
Rafal Slawik203c3db2019-09-25 19:53:01 +01004555 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4556 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004557}
4558
4559/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004560 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004561 *
4562 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4563 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004564 *
4565 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004566 */
4567message ProcessMemoryHighWaterMark {
4568 // The uid if available. -1 means not available.
4569 optional int32 uid = 1 [(is_uid) = true];
4570
Rafal Slawikda51b932018-12-13 16:31:33 +00004571 // The process name.
4572 // Usually package name or process cmdline.
4573 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004574 optional string process_name = 2;
4575
Rafal Slawik239b6802019-09-09 18:46:01 +01004576 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4577 // computed by converting kilobytes to bytes.
4578 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4579
Rafal Slawik3bea8952018-11-15 12:39:33 +00004580 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4581 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004582 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004583}
4584
4585/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004586 * Logs the memory stats for a process.
4587 *
4588 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4589 * and for selected native processes.
4590 */
4591message ProcessMemorySnapshot {
4592 // The uid if available. -1 means not available.
4593 optional int32 uid = 1 [(is_uid) = true];
4594
4595 // The process name.
4596 // Usually package name or process cmdline.
4597 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4598 optional string process_name = 2;
4599
4600 // The pid of the process.
4601 // Allows to disambiguate instances of the process.
4602 optional int32 pid = 3;
4603
4604 // The current OOM score adjustment value.
4605 // Read from ProcessRecord for managed processes.
4606 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4607 optional int32 oom_score_adj = 4;
4608
4609 // The current RSS of the process.
4610 // VmRSS from /proc/pid/status.
4611 optional int32 rss_in_kilobytes = 5;
4612
4613 // The current anon RSS of the process.
4614 // RssAnon from /proc/pid/status.
4615 optional int32 anon_rss_in_kilobytes = 6;
4616
4617 // The current swap size of the process.
4618 // VmSwap from /proc/pid/status.
4619 optional int32 swap_in_kilobytes = 7;
4620
4621 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4622 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4623}
4624
4625/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004626 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004627 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004628message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004629 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004630}
4631
4632/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004633 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004634 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004635message SystemUptime {
4636 // Milliseconds since the system was booted.
4637 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4638 // for external input).
4639 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004640 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004641}
4642
4643/*
4644 * Reads from /proc/uid_concurrent_active_time which has the format:
4645 * active: X (X is # cores)
4646 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4647 * [uid1]: [time-0] [time-1] [time-2] ... ...
4648 * ...
4649 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4650 * The file contains a monotonically increasing count of time for a single boot.
4651 */
4652message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004653 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004654 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004655}
4656
4657/**
4658 * Reads from /proc/uid_concurrent_policy_time which has the format:
4659 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4660 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4661 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4662 * ...
4663 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4664 * The file contains a monotonically increasing count of time for a single boot.
4665 */
4666message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004667 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004668 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004669 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004670}
4671
4672/*
4673 * Pulls free disk space, for data, system partition and temporary directory.
4674 */
4675message DiskSpace {
4676 // available bytes in data partition
4677 optional uint64 data_available_bytes = 1;
4678 // available bytes in system partition
4679 optional uint64 system_available_bytes = 2;
4680 // available bytes in download cache or temp directories
4681 optional uint64 temp_available_bytes = 3;
4682}
Tej Singhbf972d92018-01-10 20:51:13 -08004683
4684/**
4685 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004686 *
4687 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004688 */
4689message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004690 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004691}
4692
4693/**
4694 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004695 * Pulled from:
4696 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004697 */
4698message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004699 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004700}
4701
4702/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004703 * Pulls battery voltage.
4704 * Pulled from:
4705 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4706 */
4707message BatteryVoltage {
4708 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004709 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004710}
4711
4712/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004713 * Pulls battery level (percent full, from 0 to 100).
4714 *
4715 * Pulled from:
4716 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4717 */
4718message BatteryLevel {
4719 // Battery level. Should be in [0, 100].
4720 optional int32 battery_level = 1;
4721}
4722
4723/**
Tej Singhd89137e2018-03-26 14:51:40 -07004724 * Pulls the temperature of various parts of the device.
4725 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004726 *
Maggie White442b6312019-04-05 16:26:44 -07004727 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004728 */
4729message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004730 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004731 optional android.os.TemperatureTypeEnum sensor_location = 1;
4732
4733 // The name of the temperature source. Eg. CPU0
4734 optional string sensor_name = 2;
4735
Tej Singhd89137e2018-03-26 14:51:40 -07004736 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004737 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004738 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004739
4740 // Relative severity of the throttling, see enum definition.
4741 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004742}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004743
4744/**
4745 * Pulls the statistics of calls to Binder.
4746 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004747 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4748 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004749 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004750 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004751 */
4752message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004753 // UID of the process responsible for the binder transaction. It will be set if the process
4754 // executing the binder transaction attribute the transaction to another uid using
4755 // Binder.setThreadWorkSource().
4756 //
4757 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004758 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004759 // UID of the process executing the binder transaction.
4760 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004761 // Fully qualified class name of the API call.
4762 //
4763 // This is a system server class name.
4764 //
4765 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4766 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4767 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4768 // commonly used APIs.
4769 optional string service_class_name = 2;
4770 // Method name of the API call. It can also be a transaction code if we cannot
4771 // resolve it to a name. See Binder#getTransactionName.
4772 //
4773 // This is a system server method name.
4774 optional string service_method_name = 3;
4775 // Total number of API calls.
4776 optional int64 call_count = 4;
4777 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4778 optional bool screen_interactive = 13;
4779 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4780 // call_count will be equal to recorded_call_count.
4781 //
4782 // If recorded_call_count is different than call_count, it means data collection has been
4783 // sampled. All the fields below will be sampled in this case.
4784 optional int64 recorded_call_count = 12;
4785 // Number of exceptions thrown by the API.
4786 optional int64 recorded_exception_count = 5;
4787 // Total latency of all API calls.
4788 // Average can be computed using total_latency_micros / recorded_call_count.
4789 optional int64 recorded_total_latency_micros = 6;
4790 // Maximum latency of one API call.
4791 optional int64 recorded_max_latency_micros = 7;
4792 // Total CPU usage of all API calls.
4793 // Average can be computed using total_cpu_micros / recorded_call_count.
4794 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4795 optional int64 recorded_total_cpu_micros = 8;
4796 // Maximum CPU usage of one API call.
4797 optional int64 recorded_max_cpu_micros = 9;
4798 // Maximum parcel reply size of one API call.
4799 optional int64 recorded_max_reply_size_bytes = 10;
4800 // Maximum parcel request size of one API call.
4801 optional int64 recorded_max_request_size_bytes = 11;
4802}
4803
4804/**
4805 * Pulls the statistics of exceptions during calls to Binder.
4806 *
4807 * Binder stats are cumulative from boot unless somebody reset the data using
4808 * > adb shell dumpsys binder_calls_stats --reset
4809 */
4810message BinderCallsExceptions {
4811 // Exception class name, e.g. java.lang.IllegalArgumentException.
4812 //
4813 // This is an exception class name thrown by the system server.
4814 optional string exception_class_name = 1;
4815 // Total number of exceptions.
4816 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004817}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004818
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004819/**
4820 * Pulls the statistics of message dispatching on HandlerThreads.
4821 *
4822 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4823 * config on the device.
4824 *
4825 * Next tag: 11
4826 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004827message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004828 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004829 optional int32 uid = 1 [(is_uid) = true];
4830
4831 // Fully qualified class name of the handler target class.
4832 //
4833 // This field does not contain PII. This is a system server class name.
4834 optional string handler_class_name = 2;
4835
4836 // The name of the thread that runs the Looper.
4837 //
4838 // This field does not contain PII. This is a system server thread name.
4839 optional string looper_thread_name = 3;
4840
4841 // The name of the dispatched message.
4842 //
4843 // This field does not contain PII. This is a system server constant or class
4844 // name.
4845 optional string message_name = 4;
4846
4847 // Total number of successfully dispatched messages.
4848 optional int64 message_count = 5;
4849
4850 // Total number of messages that failed dispatching.
4851 optional int64 exception_count = 6;
4852
4853 // Total number of processed messages we have data recorded for. If we
4854 // collected data for all the messages, message_count will be equal to
4855 // recorded_message_count.
4856 //
4857 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004858 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004859 optional int64 recorded_message_count = 7;
4860
4861 // Total latency of all processed messages.
4862 // Average can be computed using recorded_total_latency_micros /
4863 // recorded_message_count.
4864 optional int64 recorded_total_latency_micros = 8;
4865
4866 // Total CPU usage of all processed message.
4867 // Average can be computed using recorded_total_cpu_micros /
4868 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004869 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004870 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004871
4872 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4873 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004874
4875 // Max recorded CPU usage of all processed messages.
4876 optional int64 recorded_max_cpu_micros = 11;
4877
4878 // Max recorded latency of all processed messages.
4879 optional int64 recorded_max_latency_micros = 12;
4880
4881 // Total number of messages we tracked the dispatching delay for. If we
4882 // collected data for all the messages, message_count will be equal to
4883 // recorded_delay_message_count.
4884 //
4885 // If recorded_delay_message_count is different than message_count, it means data
4886 // collection has been sampled or/and not all messages specified the target dispatch time.
4887 // The fields below will be sampled in this case.
4888 optional int64 recorded_delay_message_count = 13;
4889
4890 // Total dispatching delay of all processed messages.
4891 // Calculated as a difference between the target dispatching time (Message.when)
4892 // and the actual dispatching time.
4893 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4894 optional int64 recorded_total_delay_millis = 14;
4895
4896 // Max dispatching delay of all processed messages.
4897 // Calculated as a difference between the target dispatching time (Message.when)
4898 // and the actual dispatching time.
4899 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004900}
Tej Singh86dc9db2018-09-06 00:39:57 +00004901
4902/**
4903 * Pulls disk information, such as write speed and latency.
4904 */
4905message DiskStats {
4906 // Time taken to open, write 512B to, and close a file.
4907 // -1 if error performing the check.
4908 optional int64 data_write_latency_millis = 1;
4909
4910 optional bool file_based_encryption = 2;
4911
4912 // Recent disk write speed in kB/s.
4913 // -1 if error querying storageed.
4914 // 0 if data is unavailable.
4915 optional int32 recent_disk_write_speed = 3;
4916}
4917
4918
4919/**
4920 * Free and total bytes of the Data, Cache, and System partition.
4921 */
4922message DirectoryUsage {
4923 enum Directory {
4924 UNKNOWN = 0;
4925 DATA = 1;
4926 CACHE = 2;
4927 SYSTEM = 3;
4928 }
4929 optional Directory directory = 1;
4930 optional int64 free_bytes = 2;
4931 optional int64 total_bytes = 3;
4932}
4933
4934
4935/**
4936 * Size of an application: apk size, data size, and cache size.
4937 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4938 * Information is only reported for apps with the primary user (user 0).
4939 * Sizes are aggregated by package name.
4940 */
4941message AppSize {
4942 // Including uids will involve modifying diskstats logic.
4943 optional string package_name = 1;
4944 // App size in bytes. -1 if unavailable.
4945 optional int64 app_size_bytes = 2;
4946 // App data size in bytes. -1 if unavailable.
4947 optional int64 app_data_size_bytes = 3;
4948 // App cache size in bytes. -1 if unavailable.
4949 optional int64 app_cache_size_bytes = 4;
4950 // Time that the cache file was produced.
4951 // Uses System.currentTimeMillis(), which is wall clock time.
4952 optional int64 cache_time_millis = 5;
4953}
4954
4955
4956/**
4957 * Size of a particular category. Eg: photos, videos.
4958 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4959 */
4960message CategorySize {
4961 enum Category {
4962 UNKNOWN = 0;
4963 APP_SIZE = 1;
4964 APP_DATA_SIZE = 2;
4965 APP_CACHE_SIZE = 3;
4966 PHOTOS = 4;
4967 VIDEOS = 5;
4968 AUDIO = 6;
4969 DOWNLOADS = 7;
4970 SYSTEM = 8;
4971 OTHER = 9;
4972 }
4973 optional Category category = 1;
4974 // Category size in bytes.
4975 optional int64 size_bytes = 2;
4976 // Time that the cache file was produced.
4977 // Uses System.currentTimeMillis(), which is wall clock time.
4978 optional int64 cache_time_millis = 3;
4979}
Tej Singhd6d6d772018-09-05 17:41:25 -07004980
4981/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004982 * Pulls per uid I/O stats. The stats are cumulative since boot.
4983 *
4984 * Read/write bytes are I/O events from a storage device
4985 * Read/write chars are data requested by read/write syscalls, and can be
4986 * satisfied by caching.
4987 *
4988 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4989 */
4990message DiskIo {
4991 optional int32 uid = 1 [(is_uid) = true];
4992 optional int64 fg_chars_read = 2;
4993 optional int64 fg_chars_write = 3;
4994 optional int64 fg_bytes_read = 4;
4995 optional int64 fg_bytes_write = 5;
4996 optional int64 bg_chars_read = 6;
4997 optional int64 bg_chars_write = 7;
4998 optional int64 bg_bytes_read = 8;
4999 optional int64 bg_bytes_write = 9;
5000 optional int64 fg_fsync = 10;
5001 optional int64 bg_fsync= 11;
5002}
5003
5004
5005/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005006 * Pulls the number of fingerprints for each user.
5007 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005008 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005009 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005010message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005011 // The associated user. Eg: 0 for owners, 10+ for others.
5012 // Defined in android/os/UserHandle.java
5013 optional int32 user = 1;
5014 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005015 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005016}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005017
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005018/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005019 * Pulls the number of faces for each user.
5020 *
5021 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5022 */
5023message NumFacesEnrolled {
5024 // The associated user. Eg: 0 for owners, 10+ for others.
5025 // Defined in android/os/UserHandle.java
5026 optional int32 user = 1;
5027 // Number of faces registered to that user.
5028 optional int32 num_faces_enrolled = 2;
5029}
5030/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005031 * A mapping of role holder -> role
5032 */
5033message RoleHolder {
5034 // uid of the role holder
5035 optional int32 uid = 1 [(is_uid) = true];
5036
5037 // package name of the role holder
5038 optional string package_name = 2;
5039
5040 // the role held
5041 optional string role = 3;
5042}
5043
Yangsteraf9aee72018-10-12 09:26:16 -07005044message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005045 // These are all in byte resolution.
5046 optional int64 min = 1 [deprecated = true];
5047 optional int64 average = 2 [deprecated = true];
5048 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005049
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005050 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5051 // int64 fields.
5052 optional int32 mean_kb = 4;
5053 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005054}
5055
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005056// A reduced subset of process states; reducing the number of possible states allows more
5057// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5058enum ProcessStateAggregated {
5059 PROCESS_STATE_UNKNOWN = 0;
5060 // Persistent system process.
5061 PROCESS_STATE_PERSISTENT = 1;
5062 // Top activity; actually any visible activity.
5063 PROCESS_STATE_TOP = 2;
5064 // Process binding to top or a foreground service.
5065 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5066 // Processing running a foreground service.
5067 PROCESS_STATE_FGS = 4;
5068 // Important foreground process (ime, wallpaper, etc).
5069 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5070 // Important background process.
5071 PROCESS_STATE_BACKGROUND = 6;
5072 // Process running a receiver.
5073 PROCESS_STATE_RECEIVER = 7;
5074 // All kinds of cached processes.
5075 PROCESS_STATE_CACHED = 8;
5076}
5077
5078// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005079message ProcessStatsStateProto {
5080 optional android.service.procstats.ScreenState screen_state = 1;
5081
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005082 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005083
5084 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5085 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005086 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5087
5088 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005089
5090 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005091 optional int64 duration_millis = 4 [deprecated = true];
5092 // Same as above, but with minute resolution so it fits into an int32.
5093 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005094
5095 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005096 optional int64 realtime_duration_millis = 9 [deprecated = true];
5097 // Same as above, but with minute resolution so it fits into an int32.
5098 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005099
5100 // # of samples taken
5101 optional int32 sample_size = 5;
5102
5103 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005104 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005105
5106 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005107 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005108
5109 // RSS is memory resident for this process
5110 optional AggStats rss = 8;
5111}
5112
5113// Next Tag: 7
5114message ProcessStatsProto {
5115 // Name of process.
5116 optional string process = 1;
5117
5118 // Uid of the process.
5119 optional int32 uid = 2;
5120
5121 // Information about how often kills occurred
5122 message Kill {
5123 // Count of excessive CPU kills
5124 optional int32 cpu = 1;
5125
5126 // Count of kills when cached
5127 optional int32 cached = 2;
5128
5129 // PSS stats during cached kill
5130 optional AggStats cached_pss = 3;
5131 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005132 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005133
5134 // Time and memory spent in various states.
5135 repeated ProcessStatsStateProto states = 5;
5136
5137 // Total time process has been running... screen_state, memory_state, and process_state
5138 // will not be set.
5139 optional ProcessStatsStateProto total_running_state = 6;
5140}
5141
5142message PackageServiceOperationStatsProto {
5143 // Operate enum: Started, Foreground, Bound, Executing
5144 optional android.service.procstats.ServiceOperationState operation = 1;
5145
5146 // Number of times the service was in this operation.
5147 optional int32 count = 2;
5148
5149 // Information about a state the service can be in.
5150 message StateStats {
5151 // Screen state enum.
5152 optional android.service.procstats.ScreenState screen_state = 1;
5153 // Memory state enum.
5154 optional android.service.procstats.MemoryState memory_state = 2;
5155
5156 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005157 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005158 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005159 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005160 }
5161 repeated StateStats state_stats = 3;
5162}
5163
5164message PackageServiceStatsProto {
5165 // Name of service component.
5166 optional string service_name = 1;
5167
5168 // The operation stats.
5169 // The package_name, package_uid, package_version, service_name will not be set to save space.
5170 repeated PackageServiceOperationStatsProto operation_stats = 2;
5171}
5172
5173message PackageAssociationSourceProcessStatsProto {
5174 // Uid of the process.
5175 optional int32 process_uid = 1;
5176 // Process name.
5177 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005178 // Package name.
5179 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005180 // Total count of the times this association appeared.
5181 optional int32 total_count = 3;
5182
5183 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005184 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005185
5186 // Total count of the times this association became actively impacting its target process.
5187 optional int32 active_count = 5;
5188
5189 // Information on one source in this association.
5190 message StateStats {
5191 // Process state enum.
5192 optional android.service.procstats.ProcessState process_state = 1;
5193 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005194 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005195 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005196 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005197 }
5198 repeated StateStats active_state_stats = 6;
5199}
5200
5201message PackageAssociationProcessStatsProto {
5202 // Name of the target component.
5203 optional string component_name = 1;
5204 // Information on one source in this association.
5205 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5206}
5207
5208
5209message ProcessStatsPackageProto {
5210 // Name of package.
5211 optional string package = 1;
5212
5213 // Uid of the package.
5214 optional int32 uid = 2;
5215
5216 // Version of the package.
5217 optional int64 version = 3;
5218
5219 // Stats for each process running with the package loaded in to it.
5220 repeated ProcessStatsProto process_stats = 4;
5221
5222 // Stats for each of the package's services.
5223 repeated PackageServiceStatsProto service_stats = 5;
5224
5225 // Stats for each association with the package.
5226 repeated PackageAssociationProcessStatsProto association_stats = 6;
5227}
5228
5229message ProcessStatsSectionProto {
5230 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005231 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005232
5233 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005234 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005235
5236 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005237 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005238
5239 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005240 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005241
5242 // System runtime library. e.g. "libdvm.so", "libart.so".
5243 optional string runtime = 5;
5244
5245 // whether kernel reports swapped pss.
5246 optional bool has_swapped_pss = 6;
5247
5248 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5249 enum Status {
5250 STATUS_UNKNOWN = 0;
5251 STATUS_COMPLETE = 1;
5252 STATUS_PARTIAL = 2;
5253 STATUS_SHUTDOWN = 3;
5254 STATUS_SYSPROPS = 4;
5255 }
5256 repeated Status status = 7;
5257
Chenjie Yub2ecc792019-01-17 10:27:26 -08005258 // Number of pages available of various types and sizes, representation fragmentation.
5259 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5260
Yangsteraf9aee72018-10-12 09:26:16 -07005261 // Stats for each process.
5262 repeated ProcessStatsProto process_stats = 8;
5263
5264 // Stats for each package.
5265 repeated ProcessStatsPackageProto package_stats = 9;
5266}
5267
Chenjie Yub2ecc792019-01-17 10:27:26 -08005268message ProcessStatsAvailablePagesProto {
5269 // Node these pages are in (as per /proc/pagetypeinfo)
5270 optional int32 node = 1;
5271
5272 // Zone these pages are in (as per /proc/pagetypeinfo)
5273 optional string zone = 2;
5274
5275 // Label for the type of these pages (as per /proc/pagetypeinfo)
5276 optional string label = 3;
5277
5278 // Distribution of number of pages available by order size. First entry in array is
5279 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5280 repeated int32 pages_per_order = 4;
5281}
5282
Chenjie Yu12e5e672018-09-14 15:54:59 -07005283/**
5284 * Pulled from ProcessStatsService.java
5285 */
5286message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005287 optional ProcessStatsSectionProto proc_stats_section = 1;
5288}
5289
Chenjie Yuf910b7802019-01-11 16:08:20 -08005290/**
5291 * Pulled from ProcessStatsService.java
5292 */
5293message ProcStatsPkgProc {
5294 optional ProcessStatsSectionProto proc_stats_section = 1;
5295}
5296
Chris Wrencdea3b72019-11-22 16:58:17 -05005297// Next Tag: 2
5298message PackageRemoteViewInfoProto {
5299 optional string package_name = 1;
5300 // add per-package additional info here (like channels)
5301}
5302
5303// Next Tag: 2
5304message NotificationRemoteViewsProto {
5305 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5306}
5307
5308/**
5309 * Pulled from NotificationManagerService.java
5310 */
5311message NotificationRemoteViews {
5312 optional NotificationRemoteViewsProto notification_remote_views = 1;
5313}
5314
Yangsteraf9aee72018-10-12 09:26:16 -07005315message PowerProfileProto {
5316 optional double cpu_suspend = 1;
5317
5318 optional double cpu_idle = 2;
5319
5320 optional double cpu_active = 3;
5321
5322 message CpuCluster {
5323 optional int32 id = 1;
5324 optional double cluster_power = 2;
5325 optional int32 cores = 3;
5326 repeated int64 speed = 4;
5327 repeated double core_power = 5;
5328 }
5329
5330 repeated CpuCluster cpu_cluster = 40;
5331
5332 optional double wifi_scan = 4;
5333
5334 optional double wifi_on = 5;
5335
5336 optional double wifi_active = 6;
5337
5338 optional double wifi_controller_idle = 7;
5339
5340 optional double wifi_controller_rx = 8;
5341
5342 optional double wifi_controller_tx = 9;
5343
5344 repeated double wifi_controller_tx_levels = 10;
5345
5346 optional double wifi_controller_operating_voltage = 11;
5347
5348 optional double bluetooth_controller_idle = 12;
5349
5350 optional double bluetooth_controller_rx = 13;
5351
5352 optional double bluetooth_controller_tx = 14;
5353
5354 optional double bluetooth_controller_operating_voltage = 15;
5355
5356 optional double modem_controller_sleep = 16;
5357
5358 optional double modem_controller_idle = 17;
5359
5360 optional double modem_controller_rx = 18;
5361
5362 repeated double modem_controller_tx = 19;
5363
5364 optional double modem_controller_operating_voltage = 20;
5365
5366 optional double gps_on = 21;
5367
5368 repeated double gps_signal_quality_based = 22;
5369
5370 optional double gps_operating_voltage = 23;
5371
5372 optional double bluetooth_on = 24;
5373
5374 optional double bluetooth_active = 25;
5375
5376 optional double bluetooth_at_cmd = 26;
5377
5378 optional double ambient_display = 27;
5379
5380 optional double screen_on = 28;
5381
5382 optional double radio_on = 29;
5383
5384 optional double radio_scanning = 30;
5385
5386 optional double radio_active = 31;
5387
5388 optional double screen_full = 32;
5389
5390 optional double audio = 33;
5391
5392 optional double video = 34;
5393
5394 optional double flashlight = 35;
5395
5396 optional double memory = 36;
5397
5398 optional double camera = 37;
5399
5400 optional double wifi_batched_scan = 38;
5401
5402 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005403}
Chenjie Yuab530202018-09-26 12:39:20 -07005404
5405/**
5406 * power_profile.xml and other constants for power model calculations.
5407 * Pulled from PowerProfile.java
5408 */
5409message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005410 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005411}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005412
5413/**
arangelovd5db50e2018-10-12 20:24:39 +01005414 * Logs when a user restriction was added or removed.
5415 *
5416 * Logged from:
5417 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5418 */
5419message UserRestrictionChanged {
5420 // The raw string of the user restriction as defined in UserManager.
5421 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5422 optional string restriction = 1;
5423 // Whether the restriction is enabled or disabled.
5424 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005425}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005426
5427/**
5428 * Pulls process user time and system time. Puller takes a snapshot of all pids
5429 * in the system and returns cpu stats for those that are working at the time.
5430 * Dead pids will be dropped. Kernel processes are excluded.
5431 * Min cool-down is 5 sec.
5432 */
5433message ProcessCpuTime {
5434 optional int32 uid = 1 [(is_uid) = true];
5435
5436 optional string process_name = 2;
5437 // Process cpu time in user space, cumulative from boot/process start
5438 optional int64 user_time_millis = 3;
5439 // Process cpu time in system space, cumulative from boot/process start
5440 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005441}
Misha Wagner5a51e002018-10-03 15:04:09 +01005442
5443/**
5444 * Pulls the CPU usage for each thread.
5445 *
5446 * Read from /proc/$PID/task/$TID/time_in_state files.
5447 *
5448 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5449 * time_in_state files not being present on some phones, have not been addressed. These should be
5450 * considered before a public release.
5451 */
5452message CpuTimePerThreadFreq {
5453 // UID that owns the process.
5454 optional int32 uid = 1 [(is_uid) = true];
5455 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005456 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005457 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005458 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005459 // Name of the process taken from `/proc/$PID/cmdline`.
5460 optional string process_name = 4;
5461 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5462 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005463
5464 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5465 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5466 // frequencies are given here as the alternative is sending eight separate atoms. This method
5467 // significantly reduces the amount of data created
5468 optional int32 frequency1_khz = 6;
5469 optional int32 time1_millis = 7;
5470 optional int32 frequency2_khz = 8;
5471 optional int32 time2_millis = 9;
5472 optional int32 frequency3_khz = 10;
5473 optional int32 time3_millis = 11;
5474 optional int32 frequency4_khz = 12;
5475 optional int32 time4_millis = 13;
5476 optional int32 frequency5_khz = 14;
5477 optional int32 time5_millis = 15;
5478 optional int32 frequency6_khz = 16;
5479 optional int32 time6_millis = 17;
5480 optional int32 frequency7_khz = 18;
5481 optional int32 time7_millis = 19;
5482 optional int32 frequency8_khz = 20;
5483 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005484}
Bookatz75ee60422018-11-09 12:27:37 -08005485
5486/**
Bookatz366a4432018-11-20 09:42:33 -08005487 * Pulls information about the device's build.
5488 */
5489message BuildInformation {
5490 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5491 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5492 optional string fingerprint = 1;
5493
5494 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5495 optional string brand = 2;
5496
5497 // Build.PRODUCT. The name of the overall product.
5498 optional string product = 3;
5499
5500 // Build.DEVICE. The name of the industrial design.
5501 optional string device = 4;
5502
5503 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5504 optional string version_release = 5;
5505
5506 // Build.ID. E.g. a label like "M4-rc20".
5507 optional string id = 6;
5508
5509 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5510 // represent this build.
5511 optional string version_incremental = 7;
5512
5513 // Build.TYPE. The type of build, like "user" or "eng".
5514 optional string type = 8;
5515
5516 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5517 optional string tags = 9;
5518}
5519
5520/**
Adam He420947c2019-01-23 15:59:09 -08005521 * Logs information about mismatched caller for content capture.
5522 *
5523 * Logged from:
5524 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5525 */
5526message ContentCaptureCallerMismatchReported {
5527 optional string intended_package = 1;
5528 optional string calling_package = 2;
5529}
5530
5531/**
5532 * Logs information about content capture service events.
5533 *
5534 * Logged from:
5535 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5536 */
5537message ContentCaptureServiceEvents {
5538 // The type of event.
5539 enum Event {
5540 UNKNOWN = 0;
5541 ON_CONNECTED = 1;
5542 ON_DISCONNECTED = 2;
5543 SET_WHITELIST = 3;
5544 SET_DISABLED = 4;
5545 ON_USER_DATA_REMOVED = 5;
5546 }
5547 optional Event event = 1;
5548 // component/package of content capture service.
5549 optional string service_info = 2;
5550 // component/package of target.
5551 // it's a concatenated list of component/package for SET_WHITELIST event
5552 // separated by " ".
5553 optional string target_info = 3;
5554}
5555
5556/**
5557 * Logs information about content capture session events.
5558 *
5559 * Logged from:
5560 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5561 */
5562message ContentCaptureSessionEvents {
5563 // The type of event.
5564 enum Event {
5565 UNKNOWN = 0;
5566 ON_SESSION_STARTED = 1;
5567 ON_SESSION_FINISHED = 2;
5568 SESSION_NOT_CREATED = 3;
5569 }
5570 optional int32 session_id = 1;
5571 optional Event event = 2;
5572 // (n/a on session finished)
5573 optional int32 state_flags = 3;
5574 // component/package of content capture service.
5575 optional string service_info = 4;
5576 // component/package of app.
5577 // (n/a on session finished)
5578 optional string app_info = 5;
5579 optional bool is_child_session = 6;
5580}
5581
5582/**
5583 * Logs information about session being flushed.
5584 *
5585 * Logged from:
5586 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5587 */
5588message ContentCaptureFlushed {
5589 optional int32 session_id = 1;
5590 // component/package of content capture service.
5591 optional string service_info = 2;
5592 // component/package of app.
5593 optional string app_info = 3;
5594 // session start/finish events
5595 optional int32 child_session_started = 4;
5596 optional int32 child_session_finished = 5;
5597 // count of view events.
5598 optional int32 view_appeared_count = 6;
5599 optional int32 view_disappeared_count = 7;
5600 optional int32 view_text_changed_count = 8;
5601
5602 // Flush stats.
5603 optional int32 max_events = 9;
5604 optional int32 idle_flush_freq = 10;
5605 optional int32 text_flush_freq = 11;
5606 optional int32 flush_reason = 12;
5607}
5608
5609/**
Bookatz75ee60422018-11-09 12:27:37 -08005610 * Pulls on-device BatteryStats power use calculations for the overall device.
5611 */
5612message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005613 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5614 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5615 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5616 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005617}
5618
5619/**
5620 * Pulls on-device BatteryStats power use calculations broken down by uid.
5621 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5622 * that is attributed to non-uid items. They must all be included to get the total power use.
5623 */
5624message DeviceCalculatedPowerBlameUid {
5625 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5626 optional int32 uid = 1 [(is_uid) = true];
5627
Bookatz3dbc13a2018-12-21 12:16:51 -08005628 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5629 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5630 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005631}
5632
5633/**
5634 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5635 * drain type.
5636 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5637 * is attributed uids. They must all be included to get the total power use.
5638 */
5639message DeviceCalculatedPowerBlameOther {
5640 // The type of item whose power use is being reported.
5641 enum DrainType {
5642 AMBIENT_DISPLAY = 0;
5643 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5644 BLUETOOTH = 2;
5645 CAMERA = 3;
5646 // Cell-standby
5647 CELL = 4;
5648 FLASHLIGHT = 5;
5649 IDLE = 6;
5650 MEMORY = 7;
5651 // Amount that total computed drain exceeded the drain estimated using the
5652 // battery level changes and capacity.
5653 OVERCOUNTED = 8;
5654 PHONE = 9;
5655 SCREEN = 10;
5656 // Amount that total computed drain was below the drain estimated using the
5657 // battery level changes and capacity.
5658 UNACCOUNTED = 11;
5659 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5660 WIFI = 13;
5661 }
5662 optional DrainType drain_type = 1;
5663
Bookatz3dbc13a2018-12-21 12:16:51 -08005664 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5665 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5666 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005667}
arangelov4e994062018-11-13 16:12:38 +00005668
5669/**
5670 * Logs device policy features.
5671 *
5672 * Logged from:
5673 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5674 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5675 */
5676message DevicePolicyEvent {
5677 // The event id - unique for each event.
5678 optional android.stats.devicepolicy.EventId event_id = 1;
5679 // The admin package name.
5680 optional string admin_package_name = 2;
5681 // A generic integer parameter.
5682 optional int32 integer_value = 3;
5683 // A generic boolean parameter.
5684 optional bool boolean_value = 4;
5685 // A parameter specifying a time period in milliseconds.
5686 optional uint64 time_period_millis = 5;
5687 // A parameter specifying a list of package names, bundle extras or string parameters.
5688 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5689}
shawnlinea5b66b2018-11-13 15:05:29 +08005690
5691/**
5692 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5693 *
5694 * Logged from:
5695 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5696 */
5697message DocsUILaunchReported {
5698 optional android.stats.docsui.LaunchAction launch_action = 1;
5699 optional bool has_initial_uri = 2;
5700 optional android.stats.docsui.MimeType mime_type = 3;
5701 optional android.stats.docsui.Root initial_root = 4;
5702}
5703
5704/**
5705 * Logs root/app visited event in file managers/picker. Call this when the user
5706 * taps on root/app in hamburger menu.
5707 *
5708 * Logged from:
5709 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5710 */
5711message DocsUIRootVisitedReported {
5712 optional android.stats.docsui.ContextScope scope = 1;
5713 optional android.stats.docsui.Root root = 2;
5714}
5715
5716/**
5717 * Logs file operation stats. Call this when a file operation has completed.
5718 *
5719 * Logged from:
5720 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5721 */
5722message DocsUIFileOperationReported {
5723 optional android.stats.docsui.Provider provider = 1;
5724 optional android.stats.docsui.FileOperation file_op = 2;
5725}
5726
5727/**
5728 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5729 * mode.
5730 *
5731 * Logged from:
5732 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5733 */
5734message DocsUIFileOperationCopyMoveModeReported {
5735 optional android.stats.docsui.FileOperation file_op = 1;
5736 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5737}
5738
5739
5740/**
5741 * Logs file sub operation stats. Call this when a file operation has failed.
5742 *
5743 * Logged from:
5744 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5745 */
5746message DocsUIFileOperationFailureReported {
5747 optional android.stats.docsui.Authority authority = 1;
5748 optional android.stats.docsui.SubFileOperation sub_op = 2;
5749}
5750
5751/**
5752* Logs the cancellation of a file operation. Call this when a job is canceled
5753*
5754* Logged from:
5755* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5756*/
5757message DocsUIFileOperationCanceledReported {
5758 optional android.stats.docsui.FileOperation file_op = 1;
5759}
5760
5761/**
5762 * Logs startup time in milliseconds.
5763 *
5764 * Logged from:
5765 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5766 */
5767message DocsUIStartupMsReported {
5768 optional int32 startup_millis = 1;
5769}
5770
5771/**
5772 * Logs the action that was started by user.
5773 *
5774 * Logged from:
5775 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5776 */
5777message DocsUIUserActionReported {
5778 optional android.stats.docsui.UserAction action = 1;
5779}
5780
5781/**
5782 * Logs the invalid type when invalid scoped access is requested.
5783 *
5784 * Logged from:
5785 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5786 */
5787message DocsUIInvalidScopedAccessRequestReported {
5788 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005789}
Ben Murdochbab399f62018-12-06 11:01:38 +00005790
5791/**
shawnlina75e82d2019-01-07 10:31:12 +08005792 * Logs the package name that launches docsui picker mode.
5793 *
5794 * Logged from:
5795 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5796 */
5797message DocsUIPickerLaunchedFromReported {
5798 optional string package_name = 1;
5799}
5800
5801/**
5802 * Logs the search type.
5803 *
5804 * Logged from:
5805 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5806 */
5807message DocsUISearchTypeReported {
5808 optional android.stats.docsui.SearchType search_type = 1;
5809}
5810
5811/**
5812 * Logs the search mode.
5813 *
5814 * Logged from:
5815 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5816 */
5817message DocsUISearchModeReported {
5818 optional android.stats.docsui.SearchMode search_mode = 1;
5819}
5820
5821/**
5822 * Logs the pick result information.
5823 *
5824 * Logged from:
5825 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5826 */
5827message DocsUIPickResultReported {
5828 optional int32 total_action_count = 1;
5829 optional int64 duration_millis = 2;
5830 optional int32 file_count= 3;
5831 optional bool is_searching = 4;
5832 optional android.stats.docsui.Root picked_from = 5;
5833 optional android.stats.docsui.MimeType mime_type = 6;
5834 optional int32 repeatedly_pick_times = 7;
5835}
5836
5837/**
Ben Murdochbab399f62018-12-06 11:01:38 +00005838 * Logs when an app's memory is compacted.
5839 *
5840 * Logged from:
5841 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5842 */
5843message AppCompacted {
5844 // The pid of the process being compacted.
5845 optional int32 pid = 1;
5846
5847 // The name of the process being compacted.
5848 optional string process_name = 2;
5849
5850 // The type of compaction.
5851 enum Action {
5852 UNKNOWN = 0;
5853 SOME = 1;
5854 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005855 PERSISTENT = 3;
5856 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00005857 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005858 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00005859
5860 // Total RSS in kilobytes consumed by the process prior to compaction.
5861 optional int64 before_rss_total_kilobytes = 4;
5862
5863 // File RSS in kilobytes consumed by the process prior to compaction.
5864 optional int64 before_rss_file_kilobytes = 5;
5865
5866 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5867 optional int64 before_rss_anon_kilobytes = 6;
5868
5869 // Swap in kilobytes consumed by the process prior to compaction.
5870 optional int64 before_swap_kilobytes = 7;
5871
5872 // Total RSS in kilobytes consumed by the process after compaction.
5873 optional int64 after_rss_total_kilobytes = 8;
5874
5875 // File RSS in kilobytes consumed by the process after compaction.
5876 optional int64 after_rss_file_kilobytes = 9;
5877
5878 // Anonymous RSS in kilobytes consumed by the process after compaction.
5879 optional int64 after_rss_anon_kilobytes = 10;
5880
5881 // Swap in kilobytes consumed by the process after compaction.
5882 optional int64 after_swap_kilobytes = 11;
5883
5884 // The time taken to perform compaction in milliseconds.
5885 optional int64 time_to_compact_millis = 12;
5886
5887 // The last compaction action performed for this app.
5888 optional Action last_action = 13;
5889
Ben Murdoch01720b82018-12-19 18:03:44 +00005890 // The last time that compaction was attempted on this process in milliseconds
5891 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5892 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00005893
Ben Murdoch885c21b2019-03-15 18:02:04 +00005894 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005895 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00005896
5897 // The process state at the time of compaction.
5898 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005899
5900 // Free ZRAM in kilobytes before compaction.
5901 optional int64 before_zram_free_kilobytes = 17;
5902
5903 // Free ZRAM in kilobytes after compaction.
5904 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00005905}
lifr157fc552018-12-12 16:38:04 +08005906
5907/**
lifrb6b90b62019-03-29 00:40:17 +08005908 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5909 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5910 *
lifr1f74b052019-04-16 22:16:30 +08005911 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5912 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5913 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5914 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005915 */
5916message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08005917 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005918
lifr1f74b052019-04-16 22:16:30 +08005919 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005920
5921 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005922 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005923
lifr1f74b052019-04-16 22:16:30 +08005924 // Only valid for event_type = EVENT_GETADDRINFO.
5925 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005926
lifr1f74b052019-04-16 22:16:30 +08005927 // Flags passed to android_res_nsend() defined in multinetwork.h
5928 // Only valid for event_type = EVENT_RESNSEND.
5929 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005930
lifrad9becc2019-05-20 11:04:41 +08005931 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005932
5933 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08005934 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005935
5936 // Additional pass-through fields opaque to statsd.
5937 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08005938 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08005939
5940 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5941 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005942}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005943
5944/**
5945 * Logs when a data stall event occurs.
5946 *
5947 * Log from:
5948 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5949 */
5950message DataStallEvent {
5951 // Data stall evaluation type.
5952 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5953 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5954 optional int32 evaluation_type = 1;
5955 // See definition in data_stall_event.proto.
5956 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5957 // See definition in data_stall_event.proto.
5958 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5959 // See definition in data_stall_event.proto.
5960 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5961 // See definition in data_stall_event.proto.
5962 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5963 // See definition in data_stall_event.proto.
5964 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5965}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005966
5967/*
5968 * Logs when RescueParty resets some set of experiment flags.
5969 *
5970 * Logged from:
5971 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5972 */
5973message RescuePartyResetReported {
5974 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5975 optional int32 rescue_level = 1;
5976}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005977
5978/**
5979 * Logs when signed config is received from an APK, and if that config was applied successfully.
5980 * Logged from:
5981 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5982 */
5983message SignedConfigReported {
5984 enum Type {
5985 UNKNOWN_TYPE = 0;
5986 GLOBAL_SETTINGS = 1;
5987 }
5988 optional Type type = 1;
5989
5990 // The final status of the signed config received.
5991 enum Status {
5992 UNKNOWN_STATUS = 0;
5993 APPLIED = 1;
5994 BASE64_FAILURE_CONFIG = 2;
5995 BASE64_FAILURE_SIGNATURE = 3;
5996 SECURITY_EXCEPTION = 4;
5997 INVALID_CONFIG = 5;
5998 OLD_CONFIG = 6;
5999 SIGNATURE_CHECK_FAILED = 7;
6000 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006001 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006002 }
6003 optional Status status = 2;
6004
6005 // The version of the signed config processed.
6006 optional int32 version = 3;
6007
6008 // The package name that the config was extracted from.
6009 optional string from_package = 4;
6010
6011 enum Key {
6012 NO_KEY = 0;
6013 DEBUG = 1;
6014 PRODUCTION = 2;
6015 }
6016 // Which key was used to verify the config.
6017 optional Key verified_with = 5;
6018}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006019
6020/*
6021 * Logs GNSS Network-Initiated (NI) location events.
6022 *
6023 * Logged from:
6024 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6025 */
6026message GnssNiEventReported {
6027 // The type of GnssNiEvent.
6028 enum EventType {
6029 UNKNOWN = 0;
6030 NI_REQUEST = 1;
6031 NI_RESPONSE = 2;
6032 }
6033 optional EventType event_type = 1;
6034
6035 // An ID generated by HAL to associate NI notifications and UI responses.
6036 optional int32 notification_id = 2;
6037
6038 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006039 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006040
6041 // NI requires notification.
6042 optional bool need_notify = 4;
6043
6044 // NI requires verification.
6045 optional bool need_verify = 5;
6046
6047 // NI requires privacy override, no notification/minimal trace.
6048 optional bool privacy_override = 6;
6049
6050 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6051 // seconds.
6052 optional int32 timeout = 7;
6053
6054 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006055 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006056
6057 // String representing the requester of the network inititated location request.
6058 optional string requestor_id = 9;
6059
6060 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6061 // network initiated location request.
6062 optional string text = 10;
6063
6064 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006065 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006066
6067 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006068 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006069
6070 // True if SUPL ES is enabled.
6071 optional bool is_supl_es_enabled = 13;
6072
6073 // True if GNSS location is enabled.
6074 optional bool is_location_enabled = 14;
6075
6076 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006077 optional android.server.location.GnssUserResponseType user_response = 15;
6078}
6079
6080/**
6081 * Logs GNSS non-framework (NFW) location notification.
6082 *
6083 * Logged from:
6084 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6085 */
6086message GnssNfwNotificationReported {
6087 // Package name of the Android proxy application representing the non-framework entity that
6088 // requested location. Set to empty string if unknown.
6089 optional string proxy_app_package_name = 1;
6090
6091 // Protocol stack that initiated the non-framework location request.
6092 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6093
6094 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6095 // set to empty string. This field is opaque to the framework and used for logging purposes.
6096 optional string other_protocol_stack_name = 3;
6097
6098 // Source initiating/receiving the location information.
6099 optional android.server.location.NfwRequestor requestor = 4;
6100
6101 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6102 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6103 // and used for logging purposes.
6104 optional string requestor_id = 5;
6105
6106 // Indicates whether location information was provided for this request.
6107 optional android.server.location.NfwResponseType response_type = 6;
6108
6109 // True if the device is in user initiated emergency session.
6110 optional bool in_emergency_mode = 7;
6111
6112 // True if cached location is provided.
6113 optional bool is_cached_location = 8;
6114
6115 // True if proxy app permission mismatch between framework and GNSS HAL.
6116 optional bool is_permission_mismatched = 9;
6117}
6118
6119/**
6120 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6121 *
6122 * Logged from:
6123 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6124 */
6125message GnssConfigurationReported {
6126 // SUPL host name.
6127 optional string supl_host = 1;
6128
6129 // SUPL port number.
6130 optional int32 supl_port = 2;
6131
6132 // C2K host name.
6133 optional string c2k_host = 3;
6134
6135 // C2K port number.
6136 optional int32 c2k_port = 4;
6137
6138 // The SUPL version requested by Carrier.
6139 optional int32 supl_ver = 5;
6140
6141 // The SUPL mode.
6142 optional android.server.location.SuplMode supl_mode = 6;
6143
6144 // True if NI emergency SUPL restrictions is enabled.
6145 optional bool supl_es = 7;
6146
6147 // LTE Positioning Profile settings
6148 optional android.server.location.LppProfile lpp_profile = 8;
6149
6150 // Positioning protocol on A-Glonass system.
6151 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6152
6153 // True if emergency PDN is used. Otherwise, regular PDN is used.
6154 optional bool use_emergency_pdn_for_emergency_supl= 10;
6155
6156 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6157 optional android.server.location.GpsLock gps_lock = 11;
6158
6159 // Number of seconds to extend the emergency session duration post emergency call.
6160 optional int32 es_extension_sec = 12;
6161
6162 // The full list of package names of proxy Android applications representing the non-framework
6163 // location access entities (on/off the device) for which the framework user has granted
6164 // non-framework location access permission. The package names are concatenated in one string
6165 // with spaces as separators.
6166 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006167}
Jack Yu95b64f32018-12-13 18:26:11 +08006168
6169/**
6170 * Logs when a NFC device's error occurred.
6171 * Logged from:
6172 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6173 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6174 */
6175message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006176 enum Type {
6177 UNKNOWN = 0;
6178 CMD_TIMEOUT = 1;
6179 ERROR_NOTIFICATION = 2;
6180 AID_OVERFLOW = 3;
6181 }
6182 optional Type type = 1;
6183 // If it's nci cmd timeout, log the timeout command.
6184 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006185
Alex Salod7c3eef2019-01-25 14:43:27 -08006186 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006187}
6188
6189/**
6190 * Logs when a NFC device's state changed event
6191 * Logged from:
6192 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6193 */
6194message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006195 enum State {
6196 UNKNOWN = 0;
6197 OFF = 1;
6198 ON = 2;
6199 ON_LOCKED = 3; // Secure Nfc enabled.
6200 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6201 }
6202 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006203}
6204
6205/**
6206 * Logs when a NFC Beam Transaction occurred.
6207 * Logged from:
6208 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6209 */
6210message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006211 enum Operation {
6212 UNKNOWN = 0;
6213 SEND = 1;
6214 RECEIVE = 2;
6215 }
6216 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006217}
6218
6219/**
6220 * Logs when a NFC Card Emulation Transaction occurred.
6221 * Logged from:
6222 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6223 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6224 */
6225message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006226 enum Category {
6227 UNKNOWN = 0;
6228 HCE_PAYMENT = 1;
6229 HCE_OTHER = 2;
6230 OFFHOST = 3;
6231 }
6232 // Transaction belongs to HCE payment or HCE other category, or offhost.
6233 optional Category category = 1;
6234 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6235 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006236}
6237
6238/**
6239 * Logs when a NFC Tag event occurred.
6240 * Logged from:
6241 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6242 */
6243message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006244 enum Type {
6245 UNKNOWN = 0;
6246 URL = 1;
6247 BT_PAIRING = 2;
6248 PROVISION = 3;
6249 WIFI_CONNECT = 4;
6250 APP_LAUNCH = 5;
6251 OTHERS = 6;
6252 }
6253 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006254}
6255
6256/**
6257 * Logs when Hce transaction triggered
6258 * Logged from:
6259 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6260 */
6261message NfcHceTransactionOccurred {
6262 // The latency period(in microseconds) it took for the first HCE data
6263 // exchange.
6264 optional uint32 latency_micros = 1;
6265}
6266
6267/**
6268 * Logs when SecureElement state event changed
6269 * Logged from:
6270 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6271 */
6272message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006273 enum State {
6274 UNKNOWN = 0;
6275 INITIALIZED = 1;
6276 DISCONNECTED = 2;
6277 CONNECTED = 3;
6278 HALCRASH = 4;
6279 }
6280 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006281
Alex Salod7c3eef2019-01-25 14:43:27 -08006282 optional string state_change_reason = 2;
6283 // SIMx or eSEx.
6284 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006285}
6286
6287/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006288 * Information about a permission grant request
6289 */
6290message PermissionGrantRequestResultReported {
6291 // unique value identifying an API call. A API call might result in multiple of these atoms
6292 optional int64 request_id = 1;
6293
6294 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006295 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006296
6297 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006298 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006299
6300 // The permission to be granted
6301 optional string permission_name = 4;
6302
6303 // If the permission was explicitly requested via the API or added by the system
6304 optional bool is_implicit = 5;
6305
6306 enum Result {
6307 UNDEFINED = 0;
6308 // permission request was ignored
6309 IGNORED = 1;
6310 // permission request was ignored because it was user fixed
6311 IGNORED_USER_FIXED = 2;
6312 // permission request was ignored because it was policy fixed
6313 IGNORED_POLICY_FIXED = 3;
6314 // permission was granted by user action
6315 USER_GRANTED = 4;
6316 // permission was automatically granted
6317 AUTO_GRANTED = 5;
6318 // permission was denied by user action
6319 USER_DENIED = 6;
6320 // permission was denied with prejudice by the user
6321 USER_DENIED_WITH_PREJUDICE = 7;
6322 // permission was automatically denied
6323 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006324 // permission request was ignored because permission is restricted
6325 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006326 // one time permission was granted by user action
6327 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006328 // user ignored request by leaving the request screen without choosing any option
6329 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006330 // user granted the permission after being linked to settings
6331 USER_GRANTED_IN_SETTINGS = 12;
6332 // user denied the permission after being linked to settings
6333 USER_DENIED_IN_SETTINGS = 13;
6334 // user denied the permission with prejudice after being linked to settings
6335 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6336 // permission was automatically revoked after one-time permission expired
6337 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006338 }
6339 // The result of the permission grant
6340 optional Result result = 6;
6341}
6342
6343/**
Jack Yu95b64f32018-12-13 18:26:11 +08006344 * Logs when Omapi API used
6345 * Logged from:
6346 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6347 */
6348message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006349 enum Operation {
6350 UNKNOWN = 0;
6351 OPEN_CHANNEL = 1;
6352 }
6353 optional Operation operation = 1;
6354 // SIMx or eSEx.
6355 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006356
Alex Salod7c3eef2019-01-25 14:43:27 -08006357 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006358}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006359
6360/**
Alex Saloa060aee2019-01-21 14:36:41 -08006361 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6362 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006363 * Logged from:
6364 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6365 */
6366message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006367 optional int64 dispatch_latency_millis = 1;
6368}
6369
6370/**
6371 * Logs AttentionManagerService attention check result.
6372 *
6373 * Logged from:
6374 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6375 */
6376message AttentionManagerServiceResultReported {
6377 // See core/java/android/service/attention/AttentionService.java
6378 enum AttentionCheckResult {
6379 UNKNOWN = 20;
6380 ATTENTION_SUCCESS_ABSENT = 0;
6381 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006382 ATTENTION_FAILURE_UNKNOWN = 2;
6383 ATTENTION_FAILURE_CANCELLED = 3;
6384 ATTENTION_FAILURE_PREEMPTED = 4;
6385 ATTENTION_FAILURE_TIMED_OUT = 5;
6386 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006387 }
6388 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006389}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006390
6391/**
6392 * Logs when an adb connection changes state.
6393 *
6394 * Logged from:
6395 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6396 */
6397message AdbConnectionChanged {
6398 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6399 // previously selected for this system.
6400 optional int64 last_connection_time_millis = 1;
6401
6402 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6403 // to reconnect via adb without user interaction.
6404 optional int64 auth_window_millis = 2;
6405
6406 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6407 optional android.debug.AdbConnectionStateEnum state = 3;
6408
6409 // True if the 'always allow' option was selected for this system.
6410 optional bool always_allow = 4;
6411}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006412
6413/*
6414 * Logs the reported speech DSP status.
6415 *
6416 * Logged from:
6417 * Vendor audio implementation.
6418 */
6419message SpeechDspStatReported {
6420 // The total Speech DSP uptime in milliseconds.
6421 optional int32 total_uptime_millis = 1;
6422 // The total Speech DSP downtime in milliseconds.
6423 optional int32 total_downtime_millis = 2;
6424 optional int32 total_crash_count = 3;
6425 optional int32 total_recover_count = 4;
6426}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006427
6428/**
6429 * Logs USB connector contaminant status.
6430 *
6431 * Logged from: USB Service.
6432 */
6433message UsbContaminantReported {
6434 optional string id = 1;
6435 optional android.service.usb.ContaminantPresenceStatus status = 2;
6436}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006437
6438/**
6439 * This atom is for debugging purpose.
6440 */
6441message DebugElapsedClock {
6442 // Monotically increasing value for each pull.
6443 optional int64 pull_count = 1;
6444 // Time from System.elapsedRealtime.
6445 optional int64 elapsed_clock_millis = 2;
6446 // Time from System.elapsedRealtime.
6447 optional int64 same_elapsed_clock_millis = 3;
6448 // Diff between current elapsed time and elapsed time from previous pull.
6449 optional int64 elapsed_clock_diff_millis = 4;
6450
6451 enum Type {
6452 TYPE_UNKNOWN = 0;
6453 ALWAYS_PRESENT = 1;
6454 PRESENT_ON_ODD_PULLS = 2;
6455 }
6456 // Type of behavior for the pulled data.
6457 optional Type type = 5;
6458}
6459
6460/**
6461 * This atom is for debugging purpose.
6462 */
6463message DebugFailingElapsedClock {
6464 // Monotically increasing value for each pull.
6465 optional int64 pull_count = 1;
6466 // Time from System.elapsedRealtime.
6467 optional int64 elapsed_clock_millis = 2;
6468 // Time from System.elapsedRealtime.
6469 optional int64 same_elapsed_clock_millis = 3;
6470 // Diff between current elapsed time and elapsed time from previous pull.
6471 optional int64 elapsed_clock_diff_millis = 4;
6472}
Steven Wuacef6bb2019-01-23 14:21:17 -05006473
6474/** Logs System UI bubbles event changed.
6475 *
6476 * Logged from:
6477 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6478 */
6479message BubbleUIChanged {
6480
6481 // The app package that is posting the bubble.
6482 optional string package_name = 1;
6483
6484 // The notification channel that is posting the bubble.
6485 optional string notification_channel = 2;
6486
6487 // The notification id associated with the posted bubble.
6488 optional int32 notification_id = 3;
6489
6490 // The position of the bubble within the bubble stack.
6491 optional int32 position = 4;
6492
6493 // The total number of bubbles within the bubble stack.
6494 optional int32 total_number = 5;
6495
6496 // User interactions with the bubble.
6497 enum Action {
6498 UNKNOWN = 0;
6499 POSTED = 1;
6500 UPDATED = 2;
6501 EXPANDED = 3;
6502 COLLAPSED = 4;
6503 DISMISSED = 5;
6504 STACK_DISMISSED = 6;
6505 STACK_MOVED = 7;
6506 HEADER_GO_TO_APP = 8;
6507 HEADER_GO_TO_SETTINGS = 9;
6508 PERMISSION_OPT_IN = 10;
6509 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006510 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006511 SWIPE_LEFT = 13;
6512 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006513 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006514 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006515 }
6516 optional Action action = 6;
6517
6518 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6519 optional float normalized_x_position = 7;
6520 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006521
6522 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6523 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006524
6525 // Whether the bubble is an on-going one.
6526 optional bool is_ongoing = 10;
6527
6528 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006529 // This is deprecated and the value should be ignored.
6530 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006531}
Kweku Adams8845d012018-12-11 20:06:45 -08006532
6533/**
Steven Wu552f63f2019-02-05 13:41:36 -05006534 * Logs System UI bubbles developer errors.
6535 *
6536 * Logged from:
6537 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6538 */
6539message BubbleDeveloperErrorReported {
6540
6541 // The app package that is posting the bubble.
6542 optional string package_name = 1;
6543
6544 // Bubble developer error type enums.
6545 enum Error {
6546 UNKNOWN = 0;
6547 ACTIVITY_INFO_MISSING = 1;
6548 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6549 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6550 }
6551 optional Error error = 2 [default = UNKNOWN];
6552}
6553
6554/**
Kweku Adams8845d012018-12-11 20:06:45 -08006555 * Logs that a constraint for a scheduled job has changed.
6556 *
6557 * Logged from:
6558 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6559 */
6560message ScheduledJobConstraintChanged {
6561 repeated AttributionNode attribution_node = 1;
6562
6563 // Name of the job.
6564 optional string job_name = 2;
6565
6566 optional com.android.server.job.ConstraintEnum constraint = 3;
6567
6568 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006569 UNKNOWN = 0;
6570 UNSATISFIED = 1;
6571 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006572 }
6573 optional State state = 4;
6574}
Alex Salod7c3eef2019-01-25 14:43:27 -08006575
6576/**
6577 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6578 * returns true.
6579 *
6580 * Logged from:
6581 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6582 */
6583message ScreenTimeoutExtensionReported {
6584 // Describes how many times in a row did the power manager reset the screen off timeout.
6585 optional uint32 consecutive_timeout_extended_count = 1;
6586}
Hui Yu885aca12019-01-10 17:11:34 -08006587
6588/*
6589* Logs number of milliseconds it takes to start a process.
6590* The definition of app process start time is from the app launch time to
6591* the time that Zygote finished forking the app process and loaded the
6592* application package's java classes.
6593
6594* This metric is different from AppStartOccurred which is for foreground
6595* activity only.
6596
6597* ProcessStartTime can report all processes (both foreground and background)
6598* start time.
6599*
6600* Logged from:
6601* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6602*/
6603message ProcessStartTime {
6604 // The uid of the ProcessRecord.
6605 optional int32 uid = 1 [(is_uid) = true];
6606
6607 // The process pid.
6608 optional int32 pid = 2;
6609
6610 // The process name.
6611 // Usually package name, "system" for system server.
6612 // Provided by ActivityManagerService.
6613 optional string process_name = 3;
6614
6615 enum StartType {
6616 UNKNOWN = 0;
6617 WARM = 1;
6618 HOT = 2;
6619 COLD = 3;
6620 }
6621
6622 // The start type.
6623 optional StartType type = 4;
6624
6625 // The elapsed realtime at the start of the process.
6626 optional int64 process_start_time_millis = 5;
6627
6628 // Number of milliseconds it takes to reach bind application.
6629 optional int32 bind_application_delay_millis = 6;
6630
6631 // Number of milliseconds it takes to finish start of the process.
6632 optional int32 process_start_delay_millis = 7;
6633
6634 // hostingType field in ProcessRecord, the component type such as "activity",
6635 // "service", "content provider", "broadcast" or other strings.
6636 optional string hosting_type = 8;
6637
6638 // hostingNameStr field in ProcessRecord. The component class name that runs
6639 // in this process.
6640 optional string hosting_name = 9;
6641}
6642
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006643/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006644 * Track Media Codec usage
6645 * Logged from:
6646 * frameworks/av/media/libstagefright/MediaCodec.cpp
6647 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6648 */
6649message MediametricsCodecReported {
6650 optional int64 timestamp_nanos = 1;
6651 optional string package_name = 2;
6652 optional int64 package_version_code = 3;
6653 optional int64 media_apex_version = 4;
6654
6655 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6656}
6657
6658/**
6659 * Track Media Extractor (pulling video/audio streams out of containers) usage
6660 * Logged from:
6661 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6662 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6663 */
6664message MediametricsExtractorReported {
6665 optional int64 timestamp_nanos = 1;
6666 optional string package_name = 2;
6667 optional int64 package_version_code = 3;
6668 optional int64 media_apex_version = 4;
6669
6670 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6671}
6672
6673/**
6674 * Track how we arbitrate between microphone/input requests.
6675 * Logged from
6676 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6677 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6678 */
6679message MediametricsAudiopolicyReported {
6680 optional int64 timestamp_nanos = 1;
6681 optional string package_name = 2;
6682 optional int64 package_version_code = 3;
6683 optional int64 media_apex_version = 4;
6684
6685 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6686}
6687
6688/**
6689 * Track how we arbitrate between microphone requests.
6690 * Logged from
6691 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6692 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6693 */
6694message MediametricsAudiorecordReported {
6695 optional int64 timestamp_nanos = 1;
6696 optional string package_name = 2;
6697 optional int64 package_version_code = 3;
6698 optional int64 media_apex_version = 4;
6699
6700 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6701}
6702
6703/**
6704 * Track how we arbitrate between microphone/input requests.
6705 * Logged from
6706 * frameworks/av/media/libnblog/ReportPerformance.cpp
6707 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6708 */
6709message MediametricsAudiothreadReported {
6710 optional int64 timestamp_nanos = 1;
6711 optional string package_name = 2;
6712 optional int64 package_version_code = 3;
6713 optional int64 media_apex_version = 4;
6714
6715 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6716}
6717
6718/**
6719 * Track how we arbitrate between microphone/input requests.
6720 * Logged from
6721 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6722 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6723 */
6724message MediametricsAudiotrackReported {
6725 optional int64 timestamp_nanos = 1;
6726 optional string package_name = 2;
6727 optional int64 package_version_code = 3;
6728 optional int64 media_apex_version = 4;
6729
6730 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6731}
6732
6733/**
6734 * Track information about DRM framework performance
6735 * Logged from
6736 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6737 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6738 */
6739message MediametricsMediadrmReported {
6740 optional int64 timestamp_nanos = 1;
6741 optional string package_name = 2;
6742 optional int64 package_version_code = 3;
6743 optional int64 media_apex_version = 4;
6744
6745 // vendor+description tell about which DRM plugin is in use on this device
6746 optional string vendor = 5;
6747 optional string description = 6;
6748 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6749 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6750}
6751
6752/**
6753 * Track information about the widevine DRM plugin performance
6754 * Logged from
6755 * vendor/widevine/libwvdrmengine/cdm/metrics
6756 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6757 */
6758message MediametricsDrmWidevineReported {
6759 optional int64 timestamp_nanos = 1;
6760 optional string package_name = 2;
6761 optional int64 package_version_code = 3;
6762 optional int64 media_apex_version = 4;
6763
6764 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6765}
6766
6767/**
6768 * Track information about recordings (e.g. camcorder)
6769 * Logged from
6770 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6771 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6772 */
6773message MediametricsRecorderReported {
6774 optional int64 timestamp_nanos = 1;
6775 optional string package_name = 2;
6776 optional int64 package_version_code = 3;
6777 optional int64 media_apex_version = 4;
6778
6779 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6780}
6781
6782/**
6783 * Track Media Player usage
6784 * Logged from:
6785 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6786 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6787 */
6788message MediametricsNuPlayerReported {
6789 optional int64 timestamp_nanos = 1;
6790 optional string package_name = 2;
6791 optional int64 package_version_code = 3;
6792 optional int64 media_apex_version = 4;
6793
6794 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6795}
6796
6797/**
Robert Shiha4beed32019-08-19 14:15:23 -07006798 * Track Legacy DRM usage
6799 * Logged from
6800 * frameworks/av/drm/drmserver/DrmManager.cpp
6801 */
6802message MediametricsDrmManagerReported {
6803 optional int64 timestamp_nanos = 1;
6804 optional string package_name = 2;
6805 optional int64 package_version_code = 3;
6806 optional int64 media_apex_version = 4;
6807
6808 enum Method {
6809 METHOD_NOT_FOUND = -1;
6810 GET_CONSTRAINTS = 0;
6811 GET_METADATA = 1;
6812 CAN_HANDLE = 2;
6813 PROCESS_DRM_INFO = 3;
6814 ACQUIRE_DRM_INFO = 4;
6815 SAVE_RIGHTS = 5;
6816 GET_ORIGINAL_MIME_TYPE = 6;
6817 GET_DRM_OBJECT_TYPE = 7;
6818 CHECK_RIGHTS_STATUS = 8;
6819 REMOVE_RIGHTS = 9;
6820 REMOVE_ALL_RIGHTS = 10;
6821 OPEN_CONVERT_SESSION = 11;
6822 OPEN_DECRYPT_SESSION = 12;
6823 }
6824
6825 // plugin_id+description inform which Legacy DRM plugins are still in use on device
6826 optional string plugin_id = 5;
6827 optional string description = 6;
6828 optional Method method = 7;
6829 optional string mime_types = 8;
6830}
6831
6832/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006833 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00006834 * Pulled from: StatsCompanionService
6835*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006836message DangerousPermissionState {
6837 // Name of the permission
6838 optional string permission_name = 1;
6839
6840 // Uid of the package
6841 optional int32 uid = 2 [(is_uid) = true];
6842
6843 // Package requesting the permission
6844 optional string package_name = 3;
6845
6846 // If the permission is granted to the uid
6847 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006848
6849 // Permission flags as per android.content.pm.PermissionFlags
6850 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006851}
6852
Michael Groover4a0ca942019-01-24 17:41:25 -08006853/**
6854 * Logs when a package is denied access to a device identifier based on the new access requirements.
6855 *
6856 * Logged from:
6857 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6858 */
6859message DeviceIdentifierAccessDenied {
6860 // The name of the package denied access to the requested device identifier.
6861 optional string package_name = 1;
6862
6863 // The name of the device identifier method the package attempted to invoke.
6864 optional string method_name = 2;
6865
6866 // True if the package is preinstalled.
6867 optional bool is_preinstalled = 3;
6868
6869 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08006870 // Starting from Android 11, this boolean is not set and will always be false.
6871 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08006872}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006873
6874/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006875 * Pulls the ongoing mainline install train version code.
6876 * Pulled from StatsCompanionService
6877 */
6878message TrainInfo {
6879 optional int64 train_version_code = 1;
6880
6881 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006882
6883 optional string train_name = 3;
6884
6885 enum Status {
6886 UNKNOWN = 0;
6887 INSTALL_REQUESTED = 1;
6888 INSTALL_STARTED = 2;
6889 INSTALL_STAGED_NOT_READY = 3;
6890 INSTALL_STAGED_READY = 4;
6891 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006892 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6893 // and INSTALL_FAILURE_COMMIT.
6894 INSTALL_FAILURE = 6 [deprecated = true];
6895 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006896 INSTALL_CANCELLED = 7;
6897 INSTALLER_ROLLBACK_REQUESTED = 8;
6898 INSTALLER_ROLLBACK_INITIATED = 9;
6899 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6900 INSTALLER_ROLLBACK_STAGED = 11;
6901 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6902 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6903 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6904 INSTALLER_ROLLBACK_SUCCESS = 15;
6905 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006906 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6907 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6908 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6909 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6910 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6911 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006912 INSTALL_FAILURE_DOWNLOAD = 23;
6913 INSTALL_FAILURE_STATE_MISMATCH = 24;
6914 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08006915 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006916 }
6917 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006918}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006919
6920/**
6921 * Logs the gesture stage changed event.
6922 *
6923 * Logged from:
6924 * frameworks/base/packages/SystemUI/
6925 */
6926message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006927 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006928}
6929
6930/**
6931 * Logs the feedback type.
6932 *
6933 * Logged from:
6934 * frameworks/base/packages/SystemUI/
6935 */
6936message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006937 // Whether or not the gesture was used.
6938 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006939}
6940
6941/**
6942 * Logs the progress.
6943 *
6944 * Logged from:
6945 * frameworks/base/packages/SystemUI/
6946 */
6947message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006948 // [0,100] progress for the assist gesture.
6949 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006950}
Neil Fullerdb14b482019-02-05 19:44:44 +00006951
6952/*
6953 * Information about the time zone data on a device.
6954 */
6955message TimeZoneDataInfo {
6956 // A version identifier for the data set on device. e.g. "2018i"
6957 optional string tzdb_version = 1;
6958}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006959
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006960/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006961 * Logs the GPU stats global health information.
6962 *
6963 * Logged from:
6964 * frameworks/native/services/gpuservice/gpustats/
6965 */
6966message GpuStatsGlobalInfo {
6967 // Package name of the gpu driver.
6968 optional string driver_package_name = 1;
6969
6970 // Version name of the gpu driver.
6971 optional string driver_version_name = 2;
6972
6973 // Version code of the gpu driver.
6974 optional int64 driver_version_code = 3;
6975
6976 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6977 optional int64 driver_build_time = 4;
6978
6979 // Total count of the gl driver gets loaded.
6980 optional int64 gl_loading_count = 5;
6981
6982 // Total count of the gl driver fails to be loaded.
6983 optional int64 gl_loading_failure_count = 6;
6984
6985 // Total count of the Vulkan driver gets loaded.
6986 optional int64 vk_loading_count = 7;
6987
6988 // Total count of the Vulkan driver fails to be loaded.
6989 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006990
6991 // Api version of the system Vulkan driver.
6992 optional int32 vulkan_version = 9;
6993
6994 // Api version of the system CPU Vulkan driver.
6995 optional int32 cpu_vulkan_version = 10;
6996
6997 // Api version of the system GLES driver.
6998 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006999
7000 // Total count of the angle driver gets loaded.
7001 optional int64 angle_loading_count = 12;
7002
7003 // Total count of the angle driver fails to be loaded.
7004 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007005}
7006
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007007/**
7008 * GPU driver loading time info.
7009 */
7010message GpuDriverLoadingTime {
7011 // List of all the driver loading times for this app. The list size is
7012 // capped at 50.
7013 repeated int64 driver_loading_time = 1;
7014}
7015
7016/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007017 * Logs the GPU stats per app health information.
7018 *
7019 * Logged from:
7020 * frameworks/native/services/gpuservice/gpustats/
7021 */
7022message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007023 // Package name of the application that loads the gpu driver. Total number
7024 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007025 optional string app_package_name = 1;
7026
7027 // Version code of the gpu driver this app loads.
7028 optional int64 driver_version_code = 2;
7029
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007030 // gl driver loading time info.
7031 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7032 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007033
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007034 // Vulkan driver loading time info.
7035 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7036 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007037
7038 // Angle driver loading time info.
7039 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7040 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007041
7042 // CPU Vulkan implementation is in use.
7043 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007044
7045 // App is not doing pre-rotation correctly.
7046 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007047
7048 // App creates GLESv1 context.
7049 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007050}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007051
7052/*
7053 * Logs the size of the system ion heap.
7054 *
7055 * Pulled from StatsCompanionService.
7056 */
7057message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007058 // Deprecated due to limited support of ion stats in debugfs.
7059 // Use `IonHeapSize` instead.
7060 option deprecated = true;
7061
Rafal Slawikd4e87572019-03-12 13:08:38 +00007062 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007063 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007064 optional int64 size_in_bytes = 1;
7065}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007066
Rafal Slawik77987ed2019-06-17 12:28:23 +01007067/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007068 * Logs the total size of the ion heap.
7069 *
7070 * Pulled from StatsCompanionService.
7071 */
7072message IonHeapSize {
7073 // Total size of all ion heaps in kilobytes.
7074 // Read from: /sys/kernel/ion/total_heaps_kb.
7075 optional int32 total_size_kb = 1;
7076}
7077
7078/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007079 * Logs the per-process size of the system ion heap.
7080 *
7081 * Pulled from StatsCompanionService.
7082 */
7083message ProcessSystemIonHeapSize {
7084 // The uid if available. -1 means not available.
7085 optional int32 uid = 1 [(is_uid) = true];
7086
7087 // The process name (from /proc/PID/cmdline).
7088 optional string process_name = 2;
7089
7090 // Sum of sizes of all allocations.
7091 optional int32 total_size_in_kilobytes = 3;
7092
7093 // Number of allocations.
7094 optional int32 allocation_count = 4;
7095
7096 // Size of the largest allocation.
7097 optional int32 max_size_in_kilobytes = 5;
7098}
7099
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007100/**
7101 * Push network stack events.
7102 *
7103 * Log from:
7104 * frameworks/base/packages/NetworkStack/
7105 */
7106message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007107 // The id that indicates the event reported from NetworkStack.
7108 optional int32 event_id = 1;
7109 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007110 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7111}
Carmen Agimofa769c152019-03-04 14:39:14 +00007112
7113/**
7114 * Logs the apps that are installed on the external storage.
7115 * Pulled from:
7116 * StatsCompanionService
7117 */
7118message AppsOnExternalStorageInfo {
7119 // The type of the external storage.
7120 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7121 // The name of the package that is installed on the external storage.
7122 optional string package_name = 2;
7123}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007124
7125/**
7126 * Logs the settings related to Face.
7127 * Logged from:
7128 * frameworks/base/services/core/java/com/android/server/stats
7129 */
7130message FaceSettings {
7131 // Whether or not face unlock is allowed on Keyguard.
7132 optional bool unlock_keyguard_enabled = 1;
7133 // Whether or not face unlock dismisses the Keyguard.
7134 optional bool unlock_dismisses_keyguard = 2;
7135 // Whether or not face unlock requires attention.
7136 optional bool unlock_attention_required = 3;
7137 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7138 optional bool unlock_app_enabled = 4;
7139 // Whether or not face unlock always requires user confirmation.
7140 optional bool unlock_always_require_confirmation = 5;
7141 // Whether or not a diverse set of poses are required during enrollment.
7142 optional bool unlock_diversity_required = 6;
7143}
Maggie White442b6312019-04-05 16:26:44 -07007144
7145/**
7146 * Logs cooling devices maintained by the kernel.
7147 *
7148 * Pulled from StatsCompanionService.java
7149 */
7150message CoolingDevice {
7151 // The type of cooling device being reported. Eg. CPU, GPU...
7152 optional android.os.CoolingTypeEnum device_location = 1;
7153 // The name of the cooling device source. Eg. CPU0
7154 optional string device_name = 2;
7155 // Current throttle state of the cooling device. The value can any unsigned
7156 // integer between 0 and max_state defined in its driver. 0 means device is
7157 // not in throttling, higher value means deeper throttling.
7158 optional int32 state = 3;
7159}
Ben Blount763a5d52019-04-10 11:48:58 -07007160
7161/**
7162 * Intelligence has several counter-type events that don't warrant a
7163 * full separate atom. These are primarily API call counters but also include
7164 * counters for feature usage and specific failure modes.
7165 *
7166 * Logged from the Intelligence mainline module.
7167 */
7168message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007169 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007170 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007171 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007172 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007173 // How many times the event occured (to report a batch of high frequency events).
7174 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007175 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007176 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007177}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007178
7179/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007180 * Logs when Car Power state changed.
7181 *
7182 * Logged from:
7183 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7184 */
7185message CarPowerStateChanged {
7186 // States come from CpmsState in CarPowerManagementService.java.
7187 enum State {
7188 WAIT_FOR_VHAL = 0;
7189 ON = 1;
7190 SHUTDOWN_PREPARE = 2;
7191 WAIT_FOR_FINISH = 3;
7192 SUSPEND = 4;
7193 SIMULATE_SLEEP = 5;
7194 }
7195 optional State state = 1;
7196}
7197
7198/**
7199 * Logs whether GarageMode is entered.
7200 *
7201 * Logged from:
7202 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7203 */
7204message GarageModeInfo {
7205 // Whether GarageMode is entered.
7206 optional bool is_garage_mode = 1;
7207}
Martijn Coenencd95d462019-04-25 17:09:45 +02007208
7209/**
7210 * Historical app ops data per package.
7211 */
7212message AppOps {
7213 // Uid of the package requesting the op
7214 optional int32 uid = 1 [(is_uid) = true];
7215
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007216 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007217 optional string package_name = 2;
7218
7219 // operation id; maps to the OP_* constants in AppOpsManager.java
7220 optional int32 op_id = 3;
7221
7222 // The number of times the op was granted while the app was in the
7223 // foreground (only for trusted requests)
7224 optional int64 trusted_foreground_granted_count = 4;
7225
7226 // The number of times the op was granted while the app was in the
7227 // background (only for trusted requests)
7228 optional int64 trusted_background_granted_count = 5;
7229
7230 // The number of times the op was rejected while the app was in the
7231 // foreground (only for trusted requests)
7232 optional int64 trusted_foreground_rejected_count = 6;
7233
7234 // The number of times the op was rejected while the app was in the
7235 // background (only for trusted requests)
7236 optional int64 trusted_background_rejected_count = 7;
7237
7238 // For long-running operations, total duration of the operation
7239 // while the app was in the foreground (only for trusted requests)
7240 optional int64 trusted_foreground_duration_millis = 8;
7241
7242 // For long-running operations, total duration of the operation
7243 // while the app was in the background (only for trusted requests)
7244 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007245
7246 // Whether AppOps is guarded by Runtime permission
7247 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007248}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007249
7250/**
7251 * Location Manager API Usage information(e.g. API under usage,
7252 * API call's parameters).
7253 * Logged from:
7254 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7255 */
7256message LocationManagerApiUsageReported {
7257
7258 // Indicating if usage starts or usage ends.
7259 optional android.stats.location.UsageState state = 1;
7260
7261 // LocationManagerService's API in use.
7262 // We can identify which API from LocationManager is
7263 // invoking current LMS API by the combination of
7264 // API parameter(e.g. is_listener_null, is_intent_null,
7265 // is_location_request_null)
7266 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7267
7268 // Name of the package calling the API.
7269 optional string calling_package_name = 3;
7270
7271 // Type of the location provider.
7272 optional android.stats.location.ProviderType provider = 4;
7273
7274 // Quality of the location request
7275 optional android.stats.location.LocationRequestQuality quality = 5;
7276
7277 // The desired interval for active location updates, in milliseconds.
7278 // Bucketized to reduce cardinality.
7279 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7280
7281 // Minimum distance between location updates, in meters.
7282 // Bucketized to reduce cardinality.
7283 optional android.stats.location.SmallestDisplacementBucket
7284 bucketized_smallest_displacement = 7;
7285
7286 // The number of location updates.
7287 optional int64 num_updates = 8;
7288
7289 // The request expiration time, in millisecond since boot.
7290 // Bucketized to reduce cardinality.
7291 optional android.stats.location.ExpirationBucket
7292 bucketized_expire_in = 9;
7293
7294 // Type of Callback passed in for this API.
7295 optional android.stats.location.CallbackType callback_type = 10;
7296
7297 // The radius of the central point of the alert
7298 // region, in meters. Only for API REQUEST_GEOFENCE.
7299 // Bucketized to reduce cardinality.
7300 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7301
7302 // Activity Importance of API caller.
7303 // Categorized to 3 types that are interesting from location's perspective.
7304 optional android.stats.location.ActivityImportance activiy_importance = 12;
7305}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007306
7307/**
7308 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7309 */
7310message ReviewPermissionsFragmentResultReported {
7311 // unique value identifying a permission group change. A permission group change might result
7312 // in multiple of these atoms
7313 optional int64 change_id = 1;
7314
7315 // UID of package the permission belongs to
7316 optional int32 uid = 2 [(is_uid) = true];
7317
7318 // Name of package the permission belongs to
7319 optional string package_name = 3;
7320
7321 // The permission to be granted
7322 optional string permission_name = 4;
7323
7324 // The result of the permission grant
7325 optional bool permission_granted = 5;
7326}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007327
7328/**
7329* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7330* Logged from: RuntimePermissionUpdgradeController
7331*/
7332message RuntimePermissionsUpgradeResult {
7333 // Permission granted as result of upgrade
7334 optional string permission_name = 1;
7335
7336 // UID of package granted permission
7337 optional int32 uid = 2 [(is_uid) = true];
7338
7339 // Name of package granted permission
7340 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007341}
7342
7343/**
7344* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7345*/
7346message GrantPermissionsActivityButtonActions {
7347 // Permission granted as result of upgrade
7348 optional string permission_group_name = 1;
7349
7350 // UID of package granted permission
7351 optional int32 uid = 2 [(is_uid) = true];
7352
7353 // Name of package requesting permission
7354 optional string package_name = 3;
7355
7356 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7357 // LABEL_ constants in GrantPermissionActivity.java
7358 optional int32 buttons_presented = 4;
7359
7360 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7361 optional int32 button_clicked = 5;
7362}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007363
7364/**
7365 * Information about LocationAccessCheck notification presented to user
7366 */
7367message LocationAccessCheckNotificationAction {
7368
7369 // id which identifies single session of user interacting with permission controller
7370 optional int64 session_id = 1;
7371
7372 // Uid of package for which location access check is presented
7373 optional int32 package_uid = 2;
7374
7375 // Name of package for which location access check is presented
7376 optional string package_name = 3;
7377
7378 enum Result {
7379 UNDEFINED = 0;
7380 // notification was presented to the user
7381 NOTIFICATION_PRESENTED = 1;
7382 // notification was declined by the user
7383 NOTIFICATION_DECLINED = 2;
7384 // notification was clicked by the user
7385 NOTIFICATION_CLICKED = 3;
7386 }
7387
7388 // View / interaction recorded
7389 optional Result result = 4;
7390}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007391
7392/**
7393 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7394 */
7395message AppPermissionFragmentActionReported {
7396 // id which identifies single session of user interacting with permission controller
7397 optional int64 session_id = 1;
7398
7399 // unique value identifying a permission group change. A permission group change might result
7400 // in multiple of these atoms
7401 optional int64 change_id = 2;
7402
7403 // UID of package the permission belongs to
7404 optional int32 uid = 3 [(is_uid) = true];
7405
7406 // Name of package the permission belongs to
7407 optional string package_name = 4;
7408
7409 // The permission to be granted
7410 optional string permission_name = 5;
7411
7412 // The result of the permission grant
7413 optional bool permission_granted = 6;
7414}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007415
7416/**
7417* Information about a AppPermissionFragment viewed by user
7418*/
7419message AppPermissionFragmentViewed {
7420 // id which identifies single session of user interacting with permission controller
7421 optional int64 session_id = 1;
7422
7423 // UID of package for which permissions are viewed
7424 optional int32 uid = 2 [(is_uid) = true];
7425
7426 // Name of package for which permissions are viewed
7427 optional string package_name = 3;
7428
7429 // Permission group viewed
7430 optional string permission_group_name = 4;
7431}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007432
7433/**
7434* Information about a AppPermissionsFragment viewed by user
7435*/
7436message AppPermissionsFragmentViewed {
7437 // id which identifies single session of user interacting with permission controller
7438 optional int64 session_id = 1;
7439
7440 // id which identifies single view as every view might have several logging records
7441 // with different package information attached
7442 optional int64 view_id = 2;
7443
7444 // Permission group viewed
7445 optional string permission_group_name = 3;
7446
7447 // UID of package for which permissions are viewed
7448 optional int32 uid = 4 [(is_uid) = true];
7449
7450 // Name of package for which permissions are viewed
7451 optional string package_name = 5;
7452
7453 // Category in which permission is included
7454 enum Category {
7455 UNDEFINED = 0;
7456 ALLOWED = 1;
7457 ALLOWED_FOREGROUND = 2;
7458 DENIED = 3;
7459 }
7460 optional Category category = 6;
7461}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007462
7463/**
7464* Information about a PermissionAppsFragment viewed by user.
7465* Logged from ui/handheld/PermissionAppsFragment.java
7466*/
7467message PermissionAppsFragmentViewed {
7468 // id which identifies single session of user interacting with permission controller
7469 optional int64 session_id = 1;
7470
7471 // id which identifies single view as every view might have several logging records
7472 // with different package information attached
7473 optional int64 view_id = 2;
7474
7475 // Permission group viewed
7476 optional string permission_group_name = 3;
7477
7478 // UID of package for which permissions are viewed
7479 optional int32 uid = 4 [(is_uid) = true];
7480
7481 // Name of package for which permissions are viewed
7482 optional string package_name = 5;
7483
7484 // Category in which app is included
7485 enum Category {
7486 UNDEFINED = 0;
7487 ALLOWED = 1;
7488 ALLOWED_FOREGROUND = 2;
7489 DENIED = 3;
7490 }
7491 optional Category category = 6;
7492}
Tony Make2b1b672019-07-29 16:59:47 +01007493
7494/**
7495 * Logs when there is a smart selection related event.
7496 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7497 * Logged from: TextClassifierEventLogger.java
7498 */
7499message TextSelectionEvent {
7500 // A session ID.
7501 optional string session_id = 1;
7502
7503 // Event type of this event.
7504 optional android.stats.textclassifier.EventType event_type = 2;
7505
Tony Mak9c84bd22019-12-09 07:27:25 +00007506 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007507 optional string model_name = 3;
7508
7509 // Type of widget that was involved in triggering this event.
7510 optional android.stats.textclassifier.WidgetType widget_type = 4;
7511
7512 // Index of this event in a session.
7513 optional int32 event_index = 5;
7514
7515 // Entity type that is involved.
7516 optional string entity_type = 6;
7517
7518 // Relative word index of the start of the selection.
7519 optional int32 relative_word_start_index = 7;
7520
7521 // Relative word (exclusive) index of the end of the selection.
7522 optional int32 relative_word_end_index = 8;
7523
7524 // Relative word index of the start of the smart selection.
7525 optional int32 relative_suggested_word_start_index = 9;
7526
7527 // Relative word (exclusive) index of the end of the smart selection.
7528 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007529
7530 // Name of source package.
7531 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007532}
7533
7534/**
7535 * Logs when there is a smart linkify related event.
7536 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7537 * Logged from: TextClassifierEventLogger.java
7538 */
7539message TextLinkifyEvent {
7540 // A session ID.
7541 optional string session_id = 1;
7542
7543 // Event type of this event.
7544 optional android.stats.textclassifier.EventType event_type = 2;
7545
Tony Mak9c84bd22019-12-09 07:27:25 +00007546 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007547 optional string model_name = 3;
7548
7549 // Type of widget that was involved in triggering this event.
7550 optional android.stats.textclassifier.WidgetType widget_type = 4;
7551
7552 // Index of this event in a session.
7553 optional int32 event_index = 5;
7554
7555 // Entity type that is involved.
7556 optional string entity_type = 6;
7557
7558 // Number of links detected.
7559 optional int32 num_links = 7;
7560
7561 // The total length of all links.
7562 optional int32 linked_text_length = 8;
7563
7564 // Length of input text.
7565 optional int32 text_length = 9;
7566
7567 // Time spent on generating links in ms.
7568 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007569
7570 // Name of source package.
7571 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007572}
7573
7574/**
7575 * Logs when there is a conversation actions related event.
7576 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7577 * Logged from: TextClassifierEventLogger.java
7578 */
7579message ConversationActionsEvent {
7580 // A session ID.
7581 optional string session_id = 1;
7582
7583 // Event type of this event.
7584 optional android.stats.textclassifier.EventType event_type = 2;
7585
Tony Mak9c84bd22019-12-09 07:27:25 +00007586 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007587 optional string model_name = 3;
7588
7589 // Type of widget that was involved in triggering this event.
7590 optional android.stats.textclassifier.WidgetType widget_type = 4;
7591
7592 // The first entity type that is involved.
7593 optional string first_entity_type = 5;
7594
7595 // The second entity type that is involved.
7596 optional string second_entity_type = 6;
7597
7598 // The third entity type that is involved.
7599 optional string third_entity_type = 7;
7600
7601 // The score of the first entity type.
7602 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01007603
7604 // Name of source package.
7605 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00007606
7607 // Name of the annotator model that is involved in this event.
7608 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01007609}
7610
7611/**
7612 * Logs when there is a language detection related event.
7613 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7614 * Logged from: TextClassifierEventLogger.java
7615 */
7616message LanguageDetectionEvent {
7617 // A session ID.
7618 optional string session_id = 1;
7619
7620 // Event type of this event.
7621 optional android.stats.textclassifier.EventType event_type = 2;
7622
Tony Mak9c84bd22019-12-09 07:27:25 +00007623 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007624 optional string model_name = 3;
7625
7626 // Type of widget that was involved in triggering this event.
7627 optional android.stats.textclassifier.WidgetType widget_type = 4;
7628
7629 // Detected language.
7630 optional string language_tag = 5;
7631
7632 // Score of the detected language.
7633 optional float score = 6;
7634
7635 // Position of this action.
7636 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007637
7638 // Name of source package.
7639 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007640}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007641
7642/**
7643 * Information about an OTA update attempt by update_engine.
7644 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7645 */
7646message UpdateEngineUpdateAttemptReported {
7647 // The number of attempts for the update engine to apply a given payload.
7648 optional int32 attempt_number = 1;
7649
7650 optional android.stats.otaupdate.PayloadType payload_type = 2;
7651
7652 // The total time in minutes for the update engine to apply a given payload.
7653 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7654 // it's increased when the system is sleeping.
7655 optional int32 duration_boottime_in_minutes = 3;
7656
7657 // The total time in minutes for the update engine to apply a given payload.
7658 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7659 // and it's not increased when the system is sleeping.
7660 optional int32 duration_monotonic_in_minutes = 4;
7661
7662 // The size of the payload in MiBs.
7663 optional int32 payload_size_mib = 5;
7664
7665 // The attempt result reported by the update engine for an OTA update.
7666 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7667
7668 // The error code reported by the update engine after an OTA update attempt
7669 // on A/B devices.
7670 optional android.stats.otaupdate.ErrorCode error_code = 7;
7671
7672 // The build fingerprint of the source system. The value is read from a
7673 // system property when the device takes the update. e.g.
7674 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7675 optional string source_fingerprint = 8;
7676}
7677
7678/**
7679 * Information about all the attempts the device make before finishing the
7680 * successful update.
7681 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7682 */
7683message UpdateEngineSuccessfulUpdateReported {
7684 // The number of attempts for the update engine to apply the payload for a
7685 // successful update.
7686 optional int32 attempt_count = 1;
7687
7688 optional android.stats.otaupdate.PayloadType payload_type = 2;
7689
7690 optional int32 payload_size_mib = 3;
7691
7692 // The total number of bytes downloaded by update_engine since the last
7693 // successful update.
7694 optional int32 total_bytes_downloaded_mib = 4;
7695
7696 // The ratio in percentage of the over-downloaded bytes compared to the
7697 // total bytes needed to successfully install the update. e.g. 200 if we
7698 // download 200MiB in total for a 100MiB package.
7699 optional int32 download_overhead_percentage = 5;
7700
7701 // The total time in minutes for the update engine to apply the payload for a
7702 // successful update.
7703 optional int32 total_duration_minutes = 6;
7704
7705 // The number of reboot of the device during a successful update.
7706 optional int32 reboot_count = 7;
7707}
Alec Mourie088e762019-07-02 13:10:55 -07007708
7709/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08007710 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
7711 * key to indicate whether it was successful or not.
7712 *
7713 * Logged from:
7714 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
7715 */
7716message RebootEscrowRecoveryReported {
7717 optional bool successful = 1;
7718}
7719
7720/**
Alec Mourie088e762019-07-02 13:10:55 -07007721 * Global display pipeline metrics reported by SurfaceFlinger.
7722 * Pulled from:
7723 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7724 */
7725message SurfaceflingerStatsGlobalInfo {
7726 // Total number of frames presented during the tracing period
7727 optional int64 total_frames = 1;
7728 // Total number of frames missed
7729 optional int64 missed_frames = 2;
7730 // Total number of frames that fell back to client composition
7731 optional int64 client_composition_frames = 3;
7732 // Total time the display was turned on
7733 optional int64 display_on_millis = 4;
7734 // Total time that was spent performing animations.
7735 // This is derived from the present-to-present layer histogram
7736 optional int64 animation_millis = 5;
7737}
7738
7739/**
7740 * Per-layer display pipeline metrics reported by SurfaceFlinger.
7741 * The number of layers uploaded will be restricted due to size limitations.
7742 * Pulled from:
7743 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7744 */
7745message SurfaceflingerStatsLayerInfo {
7746 // The layer for this set of metrics
7747 // For now we can infer that the package name is included in the layer
7748 // name.
7749 optional string layer_name = 1;
7750 // Total number of frames presented
7751 optional int64 total_frames = 2;
7752 // Total number of dropped frames while latching a buffer for this layer.
7753 optional int64 dropped_frames = 3;
7754 // Set of timings measured between successive presentation timestamps.
7755 optional FrameTimingHistogram present_to_present = 4
7756 [(android.os.statsd.log_mode) = MODE_BYTES];
7757 // Set of timings measured from when an app queued a buffer for
7758 // presentation, until the buffer was actually presented to the
7759 // display.
7760 optional FrameTimingHistogram post_to_present = 5
7761 [(android.os.statsd.log_mode) = MODE_BYTES];
7762 // Set of timings measured from when a buffer is ready to be presented,
7763 // until the buffer was actually presented to the display.
7764 optional FrameTimingHistogram acquire_to_present = 6
7765 [(android.os.statsd.log_mode) = MODE_BYTES];
7766 // Set of timings measured from when a buffer was latched by
7767 // SurfaceFlinger, until the buffer was presented to the display
7768 optional FrameTimingHistogram latch_to_present = 7
7769 [(android.os.statsd.log_mode) = MODE_BYTES];
7770 // Set of timings measured from the desired presentation to the actual
7771 // presentation time
7772 optional FrameTimingHistogram desired_to_present = 8
7773 [(android.os.statsd.log_mode) = MODE_BYTES];
7774 // Set of timings measured from when an app queued a buffer for
7775 // presentation, until the buffer was ready to be presented.
7776 optional FrameTimingHistogram post_to_acquire = 9
7777 [(android.os.statsd.log_mode) = MODE_BYTES];
7778}
7779
7780/**
7781 * Histogram of frame counts bucketed by time in milliseconds.
7782 * Because of size limitations, we hard-cap the number of buckets, with
7783 * buckets for corresponding to larger milliseconds being less precise.
7784 */
7785message FrameTimingHistogram {
7786 // Timings in milliseconds that describes a set of histogram buckets
7787 repeated int32 time_millis_buckets = 1;
7788 // Number of frames that match to each time_millis, i.e. the bucket
7789 // contents
7790 // It's required that len(time_millis) == len(frame_count)
7791 repeated int64 frame_counts = 2;
7792}
Emilian Peev6729f372019-08-29 09:14:09 -07007793
Emilian Peev6729f372019-08-29 09:14:09 -07007794/**
7795 * Information about camera facing and API level usage.
7796 * Logged from:
7797 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
7798 */
7799message CameraActionEvent {
7800 // Camera session duration
7801 optional int64 duration = 1;
7802
7803 // Camera API level used
7804 optional int32 api_level = 2;
7805
7806 // Name of client package
7807 optional string package_name = 3;
7808
7809 // Camera facing
7810 enum Facing {
7811 UNKNOWN = 0;
7812 BACK = 1;
7813 FRONT = 2;
7814 EXTERNAL = 3;
7815 }
7816 optional Facing facing = 4;
7817}
atrost01a20932019-08-28 15:40:37 +01007818
7819/**
7820 * Logs when a compatibility change is affecting an app.
7821 *
7822 * Logged from:
7823 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
7824 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
7825 */
7826message AppCompatibilityChangeReported {
7827 // The UID of the app being affected by the compatibilty change.
7828 optional int32 uid = 1 [(is_uid) = true];
7829
7830 // The ID of the change affecting the app.
7831 optional int64 change_id = 2;
7832
7833 enum State {
7834 UNKNOWN_STATE = 0;
7835 ENABLED = 1;
7836 DISABLED = 2;
7837 LOGGED = 3;
7838 }
7839
7840 // The state of the change - if logged from gating whether it was enabled or disabled, or just
7841 // logged otherwise.
7842 optional State state = 3;
7843
7844 enum Source {
7845 UNKNOWN_SOURCE = 0;
7846 APP_PROCESS = 1;
7847 SYSTEM_SERVER = 2;
7848 }
7849
7850 // Where it was logged from.
7851 optional Source source = 4;
7852
7853}
Hector Dearman40579f62019-11-01 13:19:30 +00007854
7855/**
7856 * Logged from
7857 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
7858 */
7859message PerfettoUploaded {
7860 enum Event {
7861 PERFETTO_UNDEFINED = 0;
7862 PERFETTO_TRACE_BEGIN = 1;
7863 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
7864 PERFETTO_ON_CONNECT = 3;
7865 PERFETTO_ON_TRACING_DISABLED = 4;
7866 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
7867 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
7868 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
7869 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
7870 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
7871 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
7872 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
7873 PERFETTO_TRIGGER_BEGIN = 12;
7874 PERFETTO_TRIGGER_SUCCESS = 13;
7875 PERFETTO_TRIGGER_FAILURE = 14;
7876 PERFETTO_HIT_GUARDRAILS = 15;
7877 PERFETTO_ON_TIMEOUT = 16;
7878 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
7879 }
7880
7881 // Which stage of the pipeline we are reporting from.
7882 optional Event event = 1;
7883
7884 // UUID matching the one set inside the SystemInfo trace packet.
7885 optional int64 trace_uuid_lsb = 2;
7886 optional int64 trace_uuid_msb = 3;
7887}
Mark Tabrya824a642019-11-05 12:26:12 -08007888
7889/**
7890 * Pulls client metrics on data transferred via Vehicle Maps Service.
7891 * Metrics are keyed by uid + layer.
7892 *
7893 * Pulled from:
7894 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
7895 */
7896message VmsClientStats {
7897 // UID of the VMS client app
7898 optional int32 uid = 1 [(is_uid) = true];
7899
7900 // VMS layer definition
7901 optional int32 layer_type = 2;
7902 optional int32 layer_channel = 3;
7903 optional int32 layer_version = 4;
7904
7905 // Bytes and packets sent by the client for the layer
7906 optional int64 tx_bytes = 5;
7907 optional int64 tx_packets = 6;
7908
7909 // Bytes and packets received by the client for the layer
7910 optional int64 rx_bytes = 7;
7911 optional int64 rx_packets = 8;
7912
7913 // Bytes and packets dropped due to client error
7914 optional int64 dropped_bytes = 9;
7915 optional int64 dropped_packets = 10;
7916}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007917
7918/**
7919 * State of a dangerous permission requested by a package - sampled
7920 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
7921*/
7922message DangerousPermissionStateSampled {
7923 // Name of the permission
7924 optional string permission_name = 1;
7925
7926 // Uid of the package
7927 optional int32 uid = 2 [(is_uid) = true];
7928
7929 // If the permission is granted to the uid
7930 optional bool is_granted = 3;
7931
7932 // Permission flags as per android.content.pm.PermissionFlags
7933 optional int32 permission_flags = 4;
7934}
7935
Stan Iliev637ba5e2019-08-16 13:43:08 -04007936/**
7937 * HWUI renders pipeline type: GL (0) or Vulkan (1).
7938 */
7939enum PipelineType {
7940 GL = 0;
7941 VULKAN = 1;
7942}
7943
7944/**
7945 * HWUI stats for a given app.
7946 */
7947message GraphicsStats {
7948 // The package name of the app
7949 optional string package_name = 1;
7950
7951 // The version code of the app
7952 optional int64 version_code = 2;
7953
7954 // The start & end timestamps in UTC as
7955 // milliseconds since January 1, 1970
7956 // Compatible with java.util.Date#setTime()
7957 optional int64 stats_start = 3;
7958
7959 optional int64 stats_end = 4;
7960
7961 // HWUI renders pipeline type: GL or Vulkan.
7962 optional PipelineType pipeline = 5;
7963
7964 // Distinct frame count.
7965 optional int32 total_frames = 6;
7966
7967 // Number of "missed vsync" events.
7968 optional int32 missed_vsync_count = 7;
7969
7970 // Number of frames in triple-buffering scenario (high input latency)
7971 optional int32 high_input_latency_count = 8;
7972
7973 // Number of "slow UI thread" events.
7974 optional int32 slow_ui_thread_count = 9;
7975
7976 // Number of "slow bitmap upload" events.
7977 optional int32 slow_bitmap_upload_count = 10;
7978
7979 // Number of "slow draw" events.
7980 optional int32 slow_draw_count = 11;
7981
7982 // Number of frames that missed their deadline (aka, visibly janked)
7983 optional int32 missed_deadline_count = 12;
7984
7985 // The frame time histogram for the package
7986 optional FrameTimingHistogram cpu_histogram = 13
7987 [(android.os.statsd.log_mode) = MODE_BYTES];
7988
7989 // The gpu frame time histogram for the package
7990 optional FrameTimingHistogram gpu_histogram = 14
7991 [(android.os.statsd.log_mode) = MODE_BYTES];
7992
7993 // UI mainline module version.
7994 optional int64 version_ui_module = 15;
7995
7996 // If true, these are HWUI stats for up to a 24h period for a given app from today.
7997 // If false, these are HWUI stats for a 24h period for a given app from the last complete
7998 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
7999 // more apps are running / rendering.
8000 optional bool is_today = 16;
8001}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008002
8003/**
8004 * Message related to dangerous (runtime) app ops access
8005 */
8006message RuntimeAppOpsAccess {
8007 // Uid of the package accessing app op
8008 optional int32 uid = 1 [(is_uid) = true];
8009
8010 // Name of the package accessing app op
8011 optional string package_name = 2;
8012
8013 // operation id; maps to the OP_* constants in AppOpsManager.java
8014 optional int32 op_id = 3;
8015
8016 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
8017 // Features must be provided through manifest using <feature> tag available in R and above.
8018 optional string feature_id = 4;
8019
8020 // message related to app op access, limited to 600 chars by API
8021 optional string message = 5;
8022
8023 enum SamplingStrategy {
8024 DEFAULT = 0;
8025 UNIFORM = 1;
8026 RARELY_USED = 2;
8027 }
8028
8029 // sampling strategy used to collect this message
8030 optional SamplingStrategy sampling_strategy = 6;
8031}
8032
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008033/*
8034 * Logs userspace reboot outcome and duration.
8035 *
8036 * Logged from:
8037 * frameworks/base/core/java/com/android/server/BootReceiver.java
8038 */
8039message UserspaceRebootReported {
8040 // Possible outcomes of userspace reboot.
8041 enum Outcome {
8042 // Default value in case platform failed to determine the outcome.
8043 OUTCOME_UNKNOWN = 0;
8044 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8045 SUCCESS = 1;
8046 // Userspace reboot shutdown sequence was aborted.
8047 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8048 // Remounting userdata into checkpointing mode failed.
8049 FAILED_USERDATA_REMOUNT = 3;
8050 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8051 // reboot.
8052 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8053 }
8054 // Outcome of userspace reboot. Always set.
8055 optional Outcome outcome = 1;
8056 // Duration of userspace reboot in case it has a successful outcome.
8057 // Duration is measured as time between userspace reboot was initiated and until boot completed
8058 // (e.g. sys.boot_completed=1).
8059 optional int64 duration_millis = 2;
8060 // State of primary user's (user0) credential encryption storage.
8061 enum UserEncryptionState {
8062 // Default value.
8063 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8064 // Credential encrypted storage is unlocked.
8065 UNLOCKED = 1;
8066 // Credential encrypted storage is locked.
8067 LOCKED = 2;
8068 }
8069 // State of primary user's encryption storage at the moment boot completed. Always set.
8070 optional UserEncryptionState user_encryption_state = 3;
8071}