blob: 795062675f3f7939b873c8765fff9fcb65099eb8 [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;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +0000344 IntegrityCheckResultReported integrity_check_result_reported = 247;
345 IntegrityRulesPushed integrity_rules_pushed = 248;
Yao Chend54f9dd2017-10-17 17:37:48 +0000346 }
David Chenc8a43242017-10-17 16:23:28 -0700347
David Chen6e3e6cb2018-01-03 16:14:06 -0800348 // Pulled events will start at field 10000.
Rafal Slawikbdd5a502020-01-14 14:14:29 +0000349 // Next: 10071
David Chenc8a43242017-10-17 16:23:28 -0700350 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800351 WifiBytesTransfer wifi_bytes_transfer = 10000;
352 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
353 MobileBytesTransfer mobile_bytes_transfer = 10002;
354 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800355 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800356 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800357 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800358 CpuTimePerFreq cpu_time_per_freq = 10008;
359 CpuTimePerUid cpu_time_per_uid = 10009;
360 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800361 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800362 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800363 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800364 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800365 SystemElapsedRealtime system_elapsed_realtime = 10014;
366 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800367 CpuActiveTime cpu_active_time = 10016;
368 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000369 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800370 RemainingBatteryCapacity remaining_battery_capacity = 10019;
371 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800372 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100373 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100374 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100375 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000376 DiskStats disk_stats = 10025;
377 DirectoryUsage directory_usage = 10026;
378 AppSize app_size = 10027;
379 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700380 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700381 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800382 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700383 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700384 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800385 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700386 ProcessCpuTime process_cpu_time = 10035;
Misha Wagner5a51e002018-10-03 15:04:09 +0100387 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700388 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800389 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
390 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
391 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000392 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800393 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800394 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800395 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000396 DebugElapsedClock debug_elapsed_clock = 10046;
397 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800398 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800399 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800400 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800401 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000402 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000403 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800404 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
405 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikbdd5a502020-01-14 14:14:29 +0000406 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true];
Carmen Agimofa769c152019-03-04 14:39:14 +0000407 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700408 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700409 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200410 AppOps app_ops = 10060;
Rafal Slawik77987ed2019-06-17 12:28:23 +0100411 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
Alec Mourie088e762019-07-02 13:10:55 -0700412 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
413 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Rafal Slawik7efcefb2019-09-20 11:16:20 +0100414 ProcessMemorySnapshot process_memory_snapshot = 10064;
Mark Tabrya824a642019-11-05 12:26:12 -0800415 VmsClientStats vms_client_stats = 10065;
Chris Wrencdea3b72019-11-22 16:58:17 -0500416 NotificationRemoteViews notification_remote_views = 10066;
Stanislav Zholninccb82e42019-11-29 18:59:49 +0000417 DangerousPermissionStateSampled dangerous_permission_state_sampled = 10067;
Stan Iliev637ba5e2019-08-16 13:43:08 -0400418 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin606454c2019-11-27 15:31:49 +0000419 RuntimeAppOpsAccess runtime_app_ops_access = 10069;
Rafal Slawikbdd5a502020-01-14 14:14:29 +0000420 IonHeapSize ion_heap_size = 10070;
David Chenc8a43242017-10-17 16:23:28 -0700421 }
yroa1fe77c2018-02-26 14:22:54 -0800422
Bookatz76aafcf2018-09-17 16:17:10 -0700423 // DO NOT USE field numbers above 100,000 in AOSP.
424 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
425 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100426
427 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700428}
429
Yao Chend54f9dd2017-10-17 17:37:48 +0000430/**
Yangster-mac20877162017-12-22 17:19:39 -0800431 * This proto represents a node of an attribution chain.
432 * Note: All attribution chains are represented as a repeated field of type
433 * AttributionNode. It is understood that in such arrays, the order is that
434 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000435 */
Yangster-mac20877162017-12-22 17:19:39 -0800436message AttributionNode {
437 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800438 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800439
Yangster-mac20877162017-12-22 17:19:39 -0800440 // The (optional) string tag for an element in the attribution chain. If the
441 // element has no tag, it is encoded as an empty string.
442 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700443}
444
Yangster-mac48b3d622018-08-18 12:38:11 -0700445message KeyValuePair {
446 optional int32 key = 1;
447 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700448 int32 value_int = 2;
449 int64 value_long = 3;
450 string value_str = 4;
451 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700452 }
453}
454
455message KeyValuePairsAtom {
456 optional int32 uid = 1;
457 repeated KeyValuePair pairs = 2;
458}
459
Yao Chend54f9dd2017-10-17 17:37:48 +0000460/*
461 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800462 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000463 *
464 * RULES:
465 * - The field ids for each atom must start at 1, and count upwards by 1.
466 * Skipping field ids is not allowed.
467 * - These form an API, so renaming, renumbering or removing fields is
468 * not allowed between android releases. (This is not currently enforced,
469 * but there will be a tool to enforce this restriction).
470 * - The types must be built-in protocol buffer types, namely, no sub-messages
471 * are allowed (yet). The bytes type is also not allowed.
472 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800473 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000474 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800475 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000476 * - A field that is a uid should be a string field, tagged with the [xxx]
477 * annotation. The generated code on android will be represented by UIDs,
478 * and those UIDs will be translated in xxx to those strings.
479 *
480 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700481 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000482 * - If there is a UID, it goes first. Think in an object-oriented fashion.
483 * *****************************************************************************
484 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700485
Yao Chend54f9dd2017-10-17 17:37:48 +0000486/**
Tej Singha72344992019-04-17 18:55:08 -0700487 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700488 * Logs when the Thermal service HAL notifies the throttling start/stop events.
489 *
490 * Logged from:
491 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
492 */
493message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700494 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700495 optional android.os.TemperatureTypeEnum sensor_type = 1;
496
Maggie White442b6312019-04-05 16:26:44 -0700497 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700498 enum State {
499 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700500 START = 1; // START indicated that throttling was triggered.
501 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700502 }
Yangster-mace16189a2018-08-26 12:20:16 -0700503 optional State state = 2;
504
505 optional float temperature = 3;
506}
507
508/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000509 * Logs when the screen state changes.
510 *
511 * Logged from:
512 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
513 */
514message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800515 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700516 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700517}
Yao Chend54f9dd2017-10-17 17:37:48 +0000518
519/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700520 * Logs that the process state of the uid, as determined by ActivityManager
521 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000522 *
523 * Logged from:
524 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
525 */
Bookatzc1a050a2017-10-10 15:49:28 -0700526message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700527 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000528
Bookatzdb026a22018-01-10 19:01:56 -0800529 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700530 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000531}
532
533/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700534 * Logs process state change of a process, as per the activity manager.
535 *
536 * Logged from:
537 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
538 */
539message ProcessStateChanged {
540 optional int32 uid = 1;
541 optional string process_name = 2;
542 optional string package_name = 3;
543 // TODO: remove this when validation is done
544 optional int64 version = 5;
545 // The state, from frameworks/base/core/proto/android/app/enums.proto.
546 optional android.app.ProcessStateEnum state = 4;
547}
548
549/**
550 * Logs when ActivityManagerService sleep state is changed.
551 *
552 * Logged from:
553 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
554 */
555message ActivityManagerSleepStateChanged {
556 // TODO: import frameworks proto
557 enum State {
558 UNKNOWN = 0;
559 ASLEEP = 1;
560 AWAKE = 2;
561 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700562 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700563}
564
565/**
566 * Logs when system memory state changes.
567 *
568 * Logged from:
569 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
570 */
571message MemoryFactorStateChanged {
572 // TODO: import frameworks proto
573 enum State {
574 MEMORY_UNKNOWN = 0;
575 NORMAL = 1; // normal.
576 MODERATE = 2; // moderate memory pressure.
577 LOW = 3; // low memory.
578 CRITICAL = 4; // critical memory.
579
580 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700581 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700582}
583
584/**
585 * Logs when app is using too much cpu, according to ActivityManagerService.
586 *
587 * Logged from:
588 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
589 */
590message ExcessiveCpuUsageReported {
591 optional int32 uid = 1;
592 optional string process_name = 2;
593 optional string package_name = 3;
594 // package version. TODO: remove this when validation is done
595 optional int64 version = 4;
596}
597
598/**
599 * Logs when a cached process is killed, along with its pss.
600 *
601 * Logged from:
602 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
603 */
604message CachedKillReported {
605 optional int32 uid = 1;
606 optional string process_name = 2;
607 optional string package_name = 3;
608 // TODO: remove this when validation is done
609 optional int64 version = 5;
610 optional int64 pss = 4;
611}
612
613/**
614 * Logs when memory stats of a process is reported.
615 *
616 * Logged from:
617 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
618 */
619message ProcessMemoryStatReported {
620 optional int32 uid = 1;
621 optional string process_name = 2;
622 optional string package_name = 3;
623 //TODO: remove this when validation is done
624 optional int64 version = 9;
625 optional int64 pss = 4;
626 optional int64 uss = 5;
627 optional int64 rss = 6;
628 enum Type {
629 ADD_PSS_INTERNAL_SINGLE = 0;
630 ADD_PSS_INTERNAL_ALL_MEM = 1;
631 ADD_PSS_INTERNAL_ALL_POLL = 2;
632 ADD_PSS_EXTERNAL = 3;
633 ADD_PSS_EXTERNAL_SLOW = 4;
634 }
635 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800636 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700637}
638
639/**
Bookatzc1a050a2017-10-10 15:49:28 -0700640 * Logs that a process started, finished, crashed, or ANRed.
641 *
642 * Logged from:
643 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
644 */
645message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700646 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700647
David Chen0b5c90c2018-01-25 16:51:49 -0800648 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800649 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700650
Bookatzddccf0a2017-11-28 16:48:14 -0800651 // What lifecycle state the process changed to.
652 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800653 enum State {
654 FINISHED = 0;
655 STARTED = 1;
656 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800657 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800658 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700659}
660
Bookatzc1a050a2017-10-10 15:49:28 -0700661/**
662 * Logs when the ble scan state changes.
663 *
664 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700665 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700666 */
667message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800668 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700669
670 enum State {
671 OFF = 0;
672 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700673 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
674 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700675 }
676 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700677
Bookatze5ec0b42018-03-26 13:34:56 -0700678 // Does the scan have a filter.
679 optional bool is_filtered = 3;
680 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
681 optional bool is_first_match = 4;
682 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
683 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700684}
685
686/**
687 * Logs reporting of a ble scan finding results.
688 *
689 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700690 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700691 */
Bookatzae6738e2018-09-13 11:38:56 -0700692// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700693message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800694 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700695
696 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800697 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700698}
699
700/**
701 * Logs when a sensor state changes.
702 *
703 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700704 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700705 */
706message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800707 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700708
Bookatzc1a050a2017-10-10 15:49:28 -0700709 // The id (int) of the sensor.
710 optional int32 sensor_id = 2;
711
712 enum State {
713 OFF = 0;
714 ON = 1;
715 }
716 optional State state = 3;
717}
718
Bookatzc1a050a2017-10-10 15:49:28 -0700719/**
720 * Logs when GPS state changes.
721 *
722 * Logged from:
723 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
724 */
725message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800726 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700727
728 enum State {
729 OFF = 0;
730 ON = 1;
731 }
732 optional State state = 2;
733}
734
Bookatz48d362e2018-11-06 15:49:08 -0800735/**
736 * Logs when GPS signal quality.
737 *
738 * Logged from:
739 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
740 */
741message GpsSignalQualityChanged {
742 optional android.server.location.GpsSignalQualityEnum level = 1;
743}
744
Bookatzc1a050a2017-10-10 15:49:28 -0700745
746/**
747 * Logs when a sync manager sync state changes.
748 *
749 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700750 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700751 */
752message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800753 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700754
David Chen0b5c90c2018-01-25 16:51:49 -0800755 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800756 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700757
758 enum State {
759 OFF = 0;
760 ON = 1;
761 }
762 optional State state = 3;
763}
764
Yangster-mac96353002018-09-05 11:18:55 -0700765/*
766 * Deferred job stats.
767 *
768 * Logged from:
769 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
770*/
771message DeferredJobStatsReported {
772 repeated AttributionNode attribution_node = 1;
773
774 // Number of jobs deferred.
775 optional int32 num_jobs_deferred = 2;
776
777 // Time since the last job runs.
778 optional int64 time_since_last_job_millis = 3;
779}
780
Bookatzc1a050a2017-10-10 15:49:28 -0700781/**
782 * Logs when a job scheduler job state changes.
783 *
784 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700785 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700786 */
787message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800788 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700789
790 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800791 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700792
793 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800794 FINISHED = 0;
795 STARTED = 1;
796 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700797 }
798 optional State state = 3;
799
Tej Singh33a412b2018-03-16 18:43:59 -0700800 // The reason a job has stopped.
801 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700802 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700803 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100804
805 // The standby bucket of the app that scheduled the job. These match the framework constants
806 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
807 // already assigned 0.
808 enum Bucket {
809 UNKNOWN = -1;
810 ACTIVE = 0;
811 WORKING_SET = 1;
812 FREQUENT = 2;
813 RARE = 3;
814 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -0800815 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +0100816 }
817 optional Bucket standby_bucket = 5 [default = UNKNOWN];
818
819 // The job id (as assigned by the app).
820 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700821}
822
823/**
824 * Logs when the audio state changes.
825 *
826 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700827 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700828 */
829message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800830 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700831
832 enum State {
833 OFF = 0;
834 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700835 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
836 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700837 }
838 optional State state = 2;
839}
840
841/**
842 * Logs when the video codec state changes.
843 *
844 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700845 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700846 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800847message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800848 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700849
850 enum State {
851 OFF = 0;
852 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700853 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
854 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700855 }
856 optional State state = 2;
857}
858
859/**
860 * Logs when the flashlight state changes.
861 *
862 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700863 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700864 */
865message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800866 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700867
868 enum State {
869 OFF = 0;
870 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700871 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
872 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700873 }
874 optional State state = 2;
875}
876
877/**
878 * Logs when the camera state changes.
879 *
880 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700881 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700882 */
883message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800884 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700885
886 enum State {
887 OFF = 0;
888 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700889 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
890 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700891 }
892 optional State state = 2;
893}
894
895/**
896 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000897 *
898 * Logged from:
899 * TODO
900 */
Bookatzd6746242017-10-24 18:39:35 -0700901message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -0800902 repeated AttributionNode attribution_node = 1
903 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +0000904
Bookatz1a1b0462018-01-12 11:47:03 -0800905 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
906 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristineed615642020-01-02 12:53:41 -0800907 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY];
908 ;
Bookatzc1a050a2017-10-10 15:49:28 -0700909
910 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristineed615642020-01-02 12:53:41 -0800911 optional string tag = 3 [(state_field_option).option = PRIMARY];
Bookatzc1a050a2017-10-10 15:49:28 -0700912
913 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800914 RELEASE = 0;
915 ACQUIRE = 1;
916 CHANGE_RELEASE = 2;
917 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700918 }
tsaichristineed615642020-01-02 12:53:41 -0800919 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Bookatzc1a050a2017-10-10 15:49:28 -0700920}
921
922/**
Bookatzc1a050a2017-10-10 15:49:28 -0700923 * Logs when a partial wakelock is considered 'long' (over 1 min).
924 *
925 * Logged from:
926 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
927 */
928message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800929 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700930
Yao Chend54f9dd2017-10-17 17:37:48 +0000931 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
932 optional string tag = 2;
933
Bookatzc1a050a2017-10-10 15:49:28 -0700934 // TODO: I have no idea what this is.
935 optional string history_tag = 3;
936
937 enum State {
938 OFF = 0;
939 ON = 1;
940 }
941 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000942}
943
Bookatzc1a050a2017-10-10 15:49:28 -0700944/**
Bookatza66083f2018-09-20 17:24:00 -0700945 * Logs when the device is interactive, according to the PowerManager Notifier.
946 *
947 * Logged from:
948 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
949 */
950message InteractiveStateChanged {
951 enum State {
952 OFF = 0;
953 ON = 1;
954 }
955 optional State state = 1;
956}
957
958/**
Bookatzc1a050a2017-10-10 15:49:28 -0700959 * Logs Battery Saver state change.
960 *
961 * Logged from:
962 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
963 */
964message BatterySaverModeStateChanged {
965 enum State {
966 OFF = 0;
967 ON = 1;
968 }
969 optional State state = 1;
970}
971
972/**
973 * Logs Doze mode state change.
974 *
975 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800976 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700977 */
978message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800979 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800980}
981
982
983/**
984 * Logs state change of Doze mode including maintenance windows.
985 *
986 * Logged from:
987 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
988 */
989message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800990 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700991}
992
993/**
994 * Logs screen brightness level.
995 *
996 * Logged from:
997 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
998 */
999message ScreenBrightnessChanged {
1000 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1001 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001002}
1003
1004/**
1005 * Logs battery level (percent full, from 0 to 100).
1006 *
1007 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001008 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001009 */
1010message BatteryLevelChanged {
1011 // Battery level. Should be in [0, 100].
1012 optional int32 battery_level = 1;
1013}
1014
1015/**
1016 * Logs change in charging status of the device.
1017 *
1018 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001019 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001020 */
1021message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001022 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1023 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001024}
1025
1026/**
1027 * Logs whether the device is plugged in, and what power source it is using.
1028 *
1029 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001030 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001031 */
1032message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001033 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1034 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001035}
1036
Bookatz8c6571b2017-10-24 15:04:41 -07001037/**
1038 * Logs when an app's wakeup alarm fires.
1039 *
1040 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001041 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001042 */
1043message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001044 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001045
1046 // Name of the wakeup alarm.
1047 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001048
1049 // Name of source package (for historical reasons, since BatteryStats tracked it).
1050 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001051
1052 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1053 enum Bucket {
1054 UNKNOWN = 0;
1055 EXEMPTED = 5;
1056 ACTIVE = 10;
1057 WORKING_SET = 20;
1058 FREQUENT = 30;
1059 RARE = 40;
1060 NEVER = 50;
1061 }
1062 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1063 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001064}
1065
1066/**
1067 * Logs when an an app causes the mobile radio to change state.
1068 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1069 *
1070 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001071 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001072 */
1073message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001074 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001075
Bookatz1a1b0462018-01-12 11:47:03 -08001076 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1077 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001078}
1079
1080/**
1081 * Logs when an an app causes the wifi radio to change state.
1082 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1083 *
1084 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001085 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001086 */
1087message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001088 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001089
Bookatz1a1b0462018-01-12 11:47:03 -08001090 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1091 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001092}
1093
1094/**
1095 * Logs kernel wakeup reasons and aborts.
1096 *
1097 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001098 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001099 */
1100message KernelWakeupReported {
1101 // Name of the kernel wakeup reason (or abort).
1102 optional string wakeup_reason_name = 1;
1103
1104 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001105 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001106}
1107
1108/**
Bookatzda1798c2018-12-13 14:16:00 -08001109 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001110 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001111 *
1112 * Logged from:
1113 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1114 */
1115message WifiEnabledStateChanged {
1116 enum State {
1117 OFF = 0;
1118 ON = 1;
1119 }
1120 optional State state = 1;
1121}
1122
1123/**
1124 * 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 -08001125 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1126 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001127 *
1128 * Logged from:
1129 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1130 */
1131message WifiRunningStateChanged {
1132 repeated AttributionNode attribution_node = 1;
1133
1134 enum State {
1135 OFF = 0;
1136 ON = 1;
1137 }
1138 optional State state = 2;
1139}
1140
1141/**
Bookatze5885242017-10-24 20:10:31 -07001142 * Logs wifi locks held by an app.
1143 *
1144 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001145 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001146 */
1147message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001148 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001149
1150 enum State {
1151 OFF = 0;
1152 ON = 1;
1153 }
1154 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001155
1156 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1157 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001158}
1159
1160/**
1161 * Logs wifi signal strength changes.
1162 *
1163 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001164 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001165 */
1166message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001167 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1168 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001169}
1170
1171/**
1172 * Logs wifi scans performed by an app.
1173 *
1174 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001175 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001176 */
1177message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001178 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001179
1180 enum State {
1181 OFF = 0;
1182 ON = 1;
1183 }
1184 optional State state = 2;
1185}
1186
1187/**
Tej Singh4503e102018-01-04 14:35:01 -08001188 * Logs wifi multicast locks held by an app
1189 *
1190 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001191 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001192 */
1193message WifiMulticastLockStateChanged {
1194 repeated AttributionNode attribution_node = 1;
1195
1196 enum State {
1197 OFF = 0;
1198 ON = 1;
1199 }
1200 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001201
1202 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001203}
1204
1205/**
Tej Singh1ea42892018-01-19 09:27:00 -08001206 * Logs shutdown reason and duration on next boot.
1207 *
1208 * Logged from:
1209 * frameworks/base/core/java/com/android/server/BootReceiver.java
1210 */
1211message ShutdownSequenceReported {
1212 // True if shutdown is for a reboot. Default: false if we do not know.
1213 optional bool reboot = 1;
1214
1215 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1216 optional string reason = 2;
1217
1218 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1219 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001220 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001221
1222 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001223 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001224}
1225
Tej Singh6483ea42018-01-25 17:45:49 -08001226
1227/**
1228 * Logs boot reason and duration.
1229 *
1230 * Logged from:
1231 * system/core/bootstat/bootstat.cpp
1232 */
1233message BootSequenceReported {
1234 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1235 // Default: "<EMPTY>" if not available.
1236 optional string bootloader_reason = 1;
1237
1238 // Reason for system boot. Eg. bootloader, reboot,userrequested
1239 // Default: "<EMPTY>" if not available.
1240 optional string system_reason = 2;
1241
1242 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001243 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001244
1245 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001246 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001247
1248 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001249 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001250
1251 // Time since last boot in ms. Default: 0 if not available.
1252 optional int64 time_since_last_boot = 6;
1253}
1254
Tej Singhc477d9c2018-02-05 18:31:39 -08001255
1256/**
1257 * Logs call state and disconnect cause (if applicable).
1258 *
1259 * Logged from:
1260 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1261 */
1262message CallStateChanged {
1263 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1264 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1265 optional android.telecom.CallStateEnum call_state = 1;
1266
1267 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1268 // This value is only applicable when the call_state is DISCONNECTED, and
1269 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1270 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1271 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1272
1273 // True if the call is self-managed, which are apps that use the
1274 // telecom infrastructure to make their own calls.
1275 optional bool self_managed = 3;
1276
1277 // True if call is external. External calls are calls on connected Wear
1278 // devices but show up in Telecom so the user can pull them onto the device.
1279 optional bool external_call = 4;
1280}
1281
Tej Singh1ea42892018-01-19 09:27:00 -08001282/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001283 * Logs keyguard state. The keyguard is the lock screen.
1284 *
1285 * Logged from:
1286 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1287 */
1288message KeyguardStateChanged {
1289 enum State {
1290 UNKNOWN = 0;
1291 // The keyguard is hidden when the phone is unlocked.
1292 HIDDEN = 1;
1293 // The keyguard is shown when the phone is locked (screen turns off).
1294 SHOWN= 2;
1295 // The keyguard is occluded when something is overlaying the keyguard.
1296 // Eg. Opening the camera while on the lock screen.
1297 OCCLUDED = 3;
1298 }
1299 optional State state = 1;
1300}
1301
1302/**
1303 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1304 * prompts the user to enter a password (pattern, pin, etc).
1305 *
1306 * Logged from:
1307 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1308 */
1309
1310message KeyguardBouncerStateChanged {
1311 enum State {
1312 UNKNOWN = 0;
1313 // Bouncer is hidden, either as a result of successfully entering the
1314 // password, screen timing out, or user going back to lock screen.
1315 HIDDEN = 1;
1316 // This is when the user is being prompted to enter the password.
1317 SHOWN = 2;
1318 }
1319 optional State state = 1;
1320}
1321
1322/**
1323 * Logs the result of entering a password into the keyguard bouncer.
1324 *
1325 * Logged from:
1326 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1327 */
1328message KeyguardBouncerPasswordEntered {
1329 enum BouncerResult {
1330 UNKNOWN = 0;
1331 // The password entered was incorrect.
1332 FAILURE = 1;
1333 // The password entered was correct.
1334 SUCCESS = 2;
1335 }
1336 optional BouncerResult result = 1;
1337}
1338
Tej Singha883b372018-02-15 11:30:01 -08001339/*
1340 * Logs changes to the configuration of the device. The configuration is defined
1341 * in frameworks/base/core/java/android/content/res/Configuration.java
1342 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1343 * Please go there to interpret the possible values each field can be.
1344 *
1345 * Logged from:
1346 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1347 */
1348message ResourceConfigurationChanged {
1349 // Bit mask of color capabilities of the screen.
1350 // Contains information about the color gamut and hdr mode of the screen.
1351 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001352 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001353
1354 // The target screen density being rendered to.
1355 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001356 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001357
1358 // Current user preference for the scaling factor for fonts,
1359 // relative to the base density scaling.
1360 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001361 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001362
1363 // Flag indicating whether the hard keyboard is hidden.
1364 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001365 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001366
1367 // The type of keyboard attached to the device.
1368 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1369 optional int32 keyboard = 5;
1370
1371 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1372 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001373 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001374
1375 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1376 // 0 if undefined.
1377 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1378 optional int32 mcc = 7;
1379
1380 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1381 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1382 // MNC_ZERO symbol defined in Configuration.java.
1383 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1384 optional int32 mnc = 8;
1385
1386 // The kind of navigation available on the device.
1387 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1388 optional int32 navigation = 9;
1389
1390 // Flag indicating whether the navigation is available.
1391 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001392 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001393
1394 // Overall orientation of the screen.
1395 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1396 optional int32 orientation = 11;
1397
1398 // The current height of the available screen space, in dp units.
1399 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001400 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001401
1402 // Bit mask of overall layout of the screen.
1403 // Contains information about screen size, whether the screen is wider/taller
1404 // than normal, whether the screen layout is right-tl-left or left-to-right,
1405 // and whether the screen has a rounded shape.
1406 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001407 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001408
1409 // Current width of the available screen space, in dp units.
1410 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001411 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001412
1413 // The smallest screen size an application will see in normal operation.
1414 // This is the smallest value of both screenWidthDp and screenHeightDp
1415 // in portrait and landscape.
1416 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001417 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001418
1419 // The type of touch screen attached to the device.
1420 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1421 optional int32 touchscreen = 16;
1422
1423 // Bit mask of the ui mode.
1424 // Contains information about the overall ui mode of the device.
1425 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1426 // Also contains information about whether the device is in night mode.
1427 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001428 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001429}
1430
Tej Singheee317b2018-03-07 19:28:05 -08001431
1432/**
1433 * Logs changes in the connection state of the mobile radio.
1434 *
1435 * Logged from:
1436 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1437 */
1438message MobileConnectionStateChanged {
1439 // States are from the state machine DataConnection.java.
1440 enum State {
1441 UNKNOWN = 0;
1442 // The connection is inactive, or disconnected.
1443 INACTIVE = 1;
1444 // The connection is being activated, or connecting.
1445 ACTIVATING = 2;
1446 // The connection is active, or connected.
1447 ACTIVE = 3;
1448 // The connection is disconnecting.
1449 DISCONNECTING = 4;
1450 // The connection is disconnecting after creating a connection.
1451 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1452 }
1453 optional State state = 1;
1454 // For multi-sim phones, this distinguishes between the sim cards.
1455 optional int32 sim_slot_index = 2;
1456 // Used to identify the connection. Starts at 0 and increments by 1 for
1457 // every new network created. Resets whenever the device reboots.
1458 optional int32 data_connection_id = 3;
1459 // A bitmask for the capabilities of this connection.
1460 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1461 // Default value (if we have no information): 0
1462 optional int64 capabilities = 4;
1463 // If this connection has internet.
1464 // This just checks if the DEFAULT bit of capabilities is set.
1465 optional bool has_internet = 5;
1466}
1467
1468/**
1469 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1470 *
1471 * Logged from:
1472 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1473 */
1474message MobileRadioTechnologyChanged {
1475 optional android.telephony.NetworkTypeEnum state = 1;
1476 // For multi-sim phones, this distinguishes between the sim cards.
1477 optional int32 sim_slot_index = 2;
1478}
1479
Andrew Chantb56388b2018-03-22 21:07:33 -07001480/**
1481 * Logs the VID and PID of any connected USB devices.
1482 *
1483 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1484 *
1485 * Logged by Vendor.
1486 */
1487message UsbDeviceAttached {
1488 optional int32 vid = 1;
1489 optional int32 pid = 2;
1490 optional bool has_audio = 3;
1491 optional bool has_hid = 4;
1492 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001493 enum State {
1494 STATE_DISCONNECTED = 0;
1495 STATE_CONNECTED = 1;
1496 }
1497 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001498 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001499}
1500
Tej Singheee317b2018-03-07 19:28:05 -08001501
Tej Singhdd7bd352018-02-09 19:33:15 -08001502/**
Tej Singh5d991e12018-03-09 19:48:11 -08001503 * Logs when Bluetooth is enabled and disabled.
1504 *
1505 * Logged from:
1506 * services/core/java/com/android/server/BluetoothManagerService.java
1507 */
1508message BluetoothEnabledStateChanged {
1509 repeated AttributionNode attribution_node = 1;
1510 // Whether or not bluetooth is enabled on the device.
1511 enum State {
1512 UNKNOWN = 0;
1513 ENABLED = 1;
1514 DISABLED = 2;
1515 }
1516 optional State state = 2;
1517 // The reason for being enabled/disabled.
1518 // Eg. Airplane mode, crash, application request.
1519 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1520 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001521 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001522}
1523
1524/**
Jack Hed9837c82019-01-09 01:19:13 -08001525 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001526 *
1527 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001528 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1529 *
1530 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001531 */
1532message BluetoothConnectionStateChanged {
1533 // The state of the connection.
1534 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1535 optional android.bluetooth.ConnectionStateEnum state = 1;
1536 // An identifier that can be used to match connect and disconnect events.
1537 // Currently is last two bytes of a hash of a device level ID and
1538 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001539 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001540 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001541 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1542 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001543 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001544 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001545 // An identifier that can be used to match events for this device.
1546 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1547 // Salt: Randomly generated 256 bit value
1548 // Hash algorithm: HMAC-SHA256
1549 // Size: 32 byte
1550 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001551 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001552}
1553
1554/**
1555 * Logs when a Bluetooth device connects and disconnects over ACL
1556 *
1557 * Logged from:
1558 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1559 *
1560 * Next Tag: 3
1561 */
1562message BluetoothAclConnectionStateChanged {
1563 // An identifier that can be used to match events for this device.
1564 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1565 // Salt: Randomly generated 256 bit value
1566 // Hash algorithm: HMAC-SHA256
1567 // Size: 32 byte
1568 // Default: null or empty if the device identifier is not known
1569 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1570 // The state of the connection.
1571 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1572 optional android.bluetooth.ConnectionStateEnum state = 2;
1573}
1574
1575/**
1576 * Logs when a Bluetooth device connects and disconnects over SCO
1577 *
1578 * Logged from:
1579 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1580 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1581 *
1582 * Next Tag: 4
1583 */
1584message BluetoothScoConnectionStateChanged {
1585 // An identifier that can be used to match events for this device.
1586 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1587 // Salt: Randomly generated 256 bit value
1588 // Hash algorithm: HMAC-SHA256
1589 // Size: 32 byte
1590 // Default: null or empty if the device identifier is not known
1591 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1592 // The state of the connection.
1593 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1594 optional android.bluetooth.ConnectionStateEnum state = 2;
1595 // Codec used for this SCO connection
1596 // Default: UNKNOWN
1597 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001598}
1599
Jack Hec27040a2019-01-09 20:54:41 -08001600/**
1601 * Logged when active device of a profile changes
1602 *
1603 * Logged from:
1604 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1605 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1606 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1607 */
1608message BluetoothActiveDeviceChanged {
1609 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1610 // From android.bluetooth.BluetoothProfile
1611 optional int32 bt_profile = 1;
1612 // An identifier that can be used to match events for this new active device.
1613 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1614 // Salt: Randomly generated 256 bit value
1615 // Hash algorithm: HMAC-SHA256
1616 // Size: 32 byte
1617 // Default: null or empty if there is no active device for this profile
1618 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1619}
1620
Jack Heab86dbd22018-12-18 15:43:27 -08001621// Logs when there is an event affecting Bluetooth device's link layer connection.
1622// - This event is triggered when there is a related HCI command or event
1623// - Users of this metrics can deduce Bluetooth device's connection state from these events
1624// - HCI commands are logged before the command is sent, after receiving command status, and after
1625// receiving command complete
1626// - HCI events are logged when they arrive
1627//
1628// Low level log from system/bt
1629//
1630// Bluetooth classic commands:
1631// - CMD_CREATE_CONNECTION
1632// - CMD_DISCONNECT
1633// - CMD_CREATE_CONNECTION_CANCEL
1634// - CMD_ACCEPT_CONNECTION_REQUEST
1635// - CMD_REJECT_CONNECTION_REQUEST
1636// - CMD_SETUP_ESCO_CONNECTION
1637// - CMD_ACCEPT_ESCO_CONNECTION
1638// - CMD_REJECT_ESCO_CONNECTION
1639// - CMD_ENH_SETUP_ESCO_CONNECTION
1640// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1641//
1642// Bluetooth low energy commands:
1643// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1644// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1645// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1646// - CMD_BLE_CLEAR_WHITE_LIST
1647// - CMD_BLE_ADD_WHITE_LIST
1648// - CMD_BLE_REMOVE_WHITE_LIST
1649//
1650// Bluetooth classic events:
1651// - EVT_CONNECTION_COMP
1652// - EVT_CONNECTION_REQUEST
1653// - EVT_DISCONNECTION_COMP
1654// - EVT_ESCO_CONNECTION_COMP
1655// - EVT_ESCO_CONNECTION_CHANGED
1656//
1657// Bluetooth low energy meta events:
1658// - BLE_EVT_CONN_COMPLETE_EVT
1659// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1660//
1661// Next tag: 10
1662message BluetoothLinkLayerConnectionEvent {
1663 // An identifier that can be used to match events for this device.
1664 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1665 // Salt: Randomly generated 256 bit value
1666 // Hash algorithm: HMAC-SHA256
1667 // Size: 32 byte
1668 // Default: null or empty if the device identifier is not known
1669 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1670 // Connection handle of this connection if available
1671 // Range: 0x0000 - 0x0EFF (12 bits)
1672 // Default: 0xFFFF if the handle is unknown
1673 optional int32 connection_handle = 2;
1674 // Direction of the link
1675 // Default: DIRECTION_UNKNOWN
1676 optional android.bluetooth.DirectionEnum direction = 3;
1677 // Type of this link
1678 // Default: LINK_TYPE_UNKNOWN
1679 optional android.bluetooth.LinkTypeEnum type = 4;
1680
1681 // Reason metadata for this link layer connection event, rules for interpretation:
1682 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1683 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1684 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1685 // set and valid, ignore hci_ble_event
1686
1687 // HCI command associated with this event
1688 // Default: CMD_UNKNOWN
1689 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1690 // HCI event associated with this event
1691 // Default: EVT_UNKNOWN
1692 optional android.bluetooth.hci.EventEnum hci_event = 6;
1693 // HCI BLE meta event associated with this event
1694 // Default: BLE_EVT_UNKNOWN
1695 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1696 // HCI command status code if this is triggerred by hci_cmd
1697 // Default: STATUS_UNKNOWN
1698 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1699 // HCI reason code associated with this event
1700 // Default: STATUS_UNKNOWN
1701 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1702}
1703
Howard Roe103fe22019-01-17 16:52:16 -08001704/**
1705 * Logs when a module is rolled back by Watchdog.
1706 *
1707 * Logged from: Rollback Manager
1708 */
1709message WatchdogRollbackOccurred {
1710 enum RollbackType {
1711 UNKNOWN = 0;
1712 ROLLBACK_INITIATE = 1;
1713 ROLLBACK_SUCCESS = 2;
1714 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001715 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001716 }
1717 optional RollbackType rollback_type = 1;
1718
1719 optional string package_name = 2;
1720
1721 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001722
1723 enum RollbackReasonType {
1724 REASON_UNKNOWN = 0;
1725 REASON_NATIVE_CRASH = 1;
1726 REASON_EXPLICIT_HEALTH_CHECK = 2;
1727 REASON_APP_CRASH = 3;
1728 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001729 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001730 }
1731 optional RollbackReasonType rollback_reason = 4;
1732
1733 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1734 // is initiated. Empty if the package is unknown.
1735 optional string failing_package_name = 5;
Howard Roe103fe22019-01-17 16:52:16 -08001736}
1737
Jack Hec27040a2019-01-09 20:54:41 -08001738/**
1739 * Logs when there is a change in Bluetooth A2DP playback state
1740 *
1741 * Logged from:
1742 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1743 */
1744message BluetoothA2dpPlaybackStateChanged {
1745 // An identifier that can be used to match events for this device.
1746 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1747 // Salt: Randomly generated 256 bit value
1748 // Hash algorithm: HMAC-SHA256
1749 // Size: 32 byte
1750 // Default: null or empty if the device identifier is not known
1751 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1752 // Current playback state
1753 // Default: PLAYBACK_STATE_UNKNOWN
1754 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1755 // Current audio coding mode
1756 // Default: AUDIO_CODING_MODE_UNKNOWN
1757 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1758}
1759
1760/**
1761 * Logs when there is a change in A2DP codec config for a particular remote device
1762 *
1763 * Logged from:
1764 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1765 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1766 */
1767message BluetoothA2dpCodecConfigChanged {
1768 // An identifier that can be used to match events for this device.
1769 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1770 // Salt: Randomly generated 256 bit value
1771 // Hash algorithm: HMAC-SHA256
1772 // Size: 32 byte
1773 // Default: null or empty if the device identifier is not known
1774 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1775 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1776 // Default SOURCE_CODEC_TYPE_INVALID
1777 optional int32 codec_type = 2;
1778 // Codec priroity, the higher the more preferred, -1 for disabled
1779 // Default: CODEC_PRIORITY_DEFAULT
1780 optional int32 codec_priority = 3;
1781 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1782 // Default: SAMPLE_RATE_NONE
1783 optional int32 sample_rate = 4;
1784 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1785 // Default: BITS_PER_SAMPLE_NONE
1786 optional int32 bits_per_sample = 5;
1787 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1788 // Default: CHANNEL_MODE_NONE
1789 optional int32 channel_mode = 6;
1790 // Codec specific values
1791 // Default 0
1792 optional int64 codec_specific_1 = 7;
1793 optional int64 codec_specific_2 = 8;
1794 optional int64 codec_specific_3 = 9;
1795 optional int64 codec_specific_4 = 10;
1796}
1797
1798/**
1799 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1800 * Each codec's capability is logged separately due to statsd restriction
1801 *
1802 * Logged from:
1803 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1804 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1805 */
1806message BluetoothA2dpCodecCapabilityChanged {
1807 // An identifier that can be used to match events for this device.
1808 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1809 // Salt: Randomly generated 256 bit value
1810 // Hash algorithm: HMAC-SHA256
1811 // Size: 32 byte
1812 // Default: null or empty if the device identifier is not known
1813 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1814 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1815 // Default SOURCE_CODEC_TYPE_INVALID
1816 optional int32 codec_type = 2;
1817 // Codec priroity, the higher the more preferred, -1 for disabled
1818 // Default: CODEC_PRIORITY_DEFAULT
1819 optional int32 codec_priority = 3;
1820 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1821 // in BluetoothCodecConfig
1822 // Default: empty and SAMPLE_RATE_NONE for individual item
1823 optional int32 sample_rate = 4;
1824 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1825 // in BluetoothCodecConfig
1826 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1827 optional int32 bits_per_sample = 5;
1828 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1829 // BluetoothCodecConfig
1830 // Default: empty and CHANNEL_MODE_NONE for individual item
1831 optional int32 channel_mode = 6;
1832 // Codec specific values
1833 // Default 0
1834 optional int64 codec_specific_1 = 7;
1835 optional int64 codec_specific_2 = 8;
1836 optional int64 codec_specific_3 = 9;
1837 optional int64 codec_specific_4 = 10;
1838}
1839
1840/**
1841 * Logs when A2DP failed to read from PCM source.
1842 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1843 *
1844 * Logged from:
1845 * system/bt
1846 */
1847message BluetoothA2dpAudioUnderrunReported {
1848 // An identifier that can be used to match events for this device.
1849 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1850 // Salt: Randomly generated 256 bit value
1851 // Hash algorithm: HMAC-SHA256
1852 // Size: 32 byte
1853 // Default: null or empty if the device identifier is not known
1854 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1855 // Encoding interval in nanoseconds
1856 // Default: 0
1857 optional int64 encoding_interval_nanos = 2;
1858 // Number of bytes of PCM data that could not be read from the source
1859 // Default: 0
1860 optional int32 num_missing_pcm_bytes = 3;
1861}
1862
1863/**
1864 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1865 * buffer queue is full and we have to drop data
1866 *
1867 * Logged from:
1868 * system/bt
1869 */
1870message BluetoothA2dpAudioOverrunReported {
1871 // An identifier that can be used to match events for this device.
1872 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1873 // Salt: Randomly generated 256 bit value
1874 // Hash algorithm: HMAC-SHA256
1875 // Size: 32 byte
1876 // Default: null or empty if the device identifier is not known
1877 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1878 // Encoding interval in nanoseconds
1879 // Default: 0
1880 optional int64 encoding_interval_nanos = 2;
1881 // Number of buffers dropped in this event
1882 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1883 // Default: 0
1884 optional int32 num_dropped_buffers = 3;
1885 // Number of encoded buffers dropped in this event
1886 // Default 0
1887 optional int32 num_dropped_encoded_frames = 4;
1888 // Number of encoded bytes dropped in this event
1889 // Default: 0
1890 optional int32 num_dropped_encoded_bytes = 5;
1891}
1892
1893/**
1894 * Logs when we receive reports regarding a device's RSSI value
1895 *
1896 * Logged from:
1897 * system/bt
1898 */
1899message BluetoothDeviceRssiReported {
1900 // An identifier that can be used to match events for this device.
1901 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1902 // Salt: Randomly generated 256 bit value
1903 // Hash algorithm: HMAC-SHA256
1904 // Size: 32 byte
1905 // Default: null or empty if the device identifier is not known
1906 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1907 // Connection handle of this connection if available
1908 // Range: 0x0000 - 0x0EFF (12 bits)
1909 // Default: 0xFFFF if the handle is unknown
1910 optional int32 connection_handle = 2;
1911 // HCI command status code if this is triggerred by hci_cmd
1912 // Default: STATUS_UNKNOWN
1913 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1914 // BR/EDR
1915 // Range: -128 ≤ N ≤ 127 (signed integer)
1916 // Units: dB
1917 // LE:
1918 // Range: -127 to 20, 127 (signed integer)
1919 // Units: dBm
1920 // Invalid when an out of range value is reported
1921 optional int32 rssi = 4;
1922}
1923
1924/**
1925 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1926 *
1927 * Logged from:
1928 * system/bt
1929 */
1930message BluetoothDeviceFailedContactCounterReported {
1931 // An identifier that can be used to match events for this device.
1932 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1933 // Salt: Randomly generated 256 bit value
1934 // Hash algorithm: HMAC-SHA256
1935 // Size: 32 byte
1936 // Default: null or empty if the device identifier is not known
1937 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1938 // Connection handle of this connection if available
1939 // Range: 0x0000 - 0x0EFF (12 bits)
1940 // Default: 0xFFFF if the handle is unknown
1941 optional int32 connection_handle = 2;
1942 // HCI command status code if this is triggerred by hci_cmd
1943 // Default: STATUS_UNKNOWN
1944 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1945 // Number of consecutive failed contacts for a connection corresponding to the Handle
1946 // Range: uint16_t, 0-0xFFFF
1947 // Default: 0xFFFFF
1948 optional int32 failed_contact_counter = 4;
1949}
1950
1951/**
1952 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1953 *
1954 * Logged from:
1955 * system/bt
1956 */
1957message BluetoothDeviceTxPowerLevelReported {
1958 // An identifier that can be used to match events for this device.
1959 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1960 // Salt: Randomly generated 256 bit value
1961 // Hash algorithm: HMAC-SHA256
1962 // Size: 32 byte
1963 // Default: null or empty if the device identifier is not known
1964 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1965 // Connection handle of this connection if available
1966 // Range: 0x0000 - 0x0EFF (12 bits)
1967 // Default: 0xFFFF if the handle is unknown
1968 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001969 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001970 // Default: STATUS_UNKNOWN
1971 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1972 // Range: -30 ≤ N ≤ 20
1973 // Units: dBm
1974 // Invalid when an out of range value is reported
1975 optional int32 transmit_power_level = 4;
1976}
Jack Heab86dbd22018-12-18 15:43:27 -08001977
Tej Singh5d991e12018-03-09 19:48:11 -08001978/**
Jack He1021a612019-01-20 21:22:46 -08001979 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1980 * receiving an HCI command from the host
1981 *
1982 * Logged from: system/bt
1983 */
1984message BluetoothHciTimeoutReported {
1985 // HCI command associated with this event
1986 // Default: CMD_UNKNOWN
1987 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1988}
1989
1990/**
1991 * Logs when we receive Bluetooth Link Quality Report event from the controller
1992 * See Android Bluetooth HCI specification for more details
1993 *
1994 * Note: all count and bytes field are counted since last event
1995 *
1996 * Logged from: system/bt
1997 */
1998message BluetoothQualityReportReported {
1999 // Quality report ID
2000 // Original type: uint8_t
2001 // Default: BQR_ID_UNKNOWN
2002 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2003 // Packet type of the connection
2004 // Original type: uint8_t
2005 // Default: BQR_PACKET_TYPE_UNKNOWN
2006 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2007 // Connection handle of the connection
2008 // Original type: uint16_t
2009 optional int32 connection_handle = 3;
2010 // Performing Role for the connection
2011 // Original type: uint8_t
2012 optional int32 connection_role = 4;
2013 // Current Transmit Power Level for the connection. This value is the same as the controller's
2014 // response to the HCI_Read_Transmit_Power_Level HCI command
2015 // Original type: uint8_t
2016 optional int32 tx_power_level = 5;
2017 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2018 // absolute receiver signal strength value
2019 // Original type: int8_t
2020 optional int32 rssi = 6;
2021 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2022 // channels used by the link currently
2023 // Original type: uint8_t
2024 optional int32 snr = 7;
2025 // Indicates the number of unused channels in AFH_channel_map
2026 // Original type: uint8_t
2027 optional int32 unused_afh_channel_count = 8;
2028 // Indicates the number of the channels which are interfered and quality is bad but are still
2029 // selected for AFH
2030 // Original type: uint8_t
2031 optional int32 afh_select_unideal_channel_count = 9;
2032 // Current Link Supervision Timeout Setting
2033 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2034 // Original type: uint16_t
2035 optional int32 lsto = 10;
2036 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2037 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2038 // 0x01 (Piconet Clock)
2039 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2040 // Original type: uint32_t
2041 optional int64 connection_piconet_clock = 11;
2042 // The count of retransmission
2043 // Original type: uint32_t
2044 optional int64 retransmission_count = 12;
2045 // The count of no RX
2046 // Original type: uint32_t
2047 optional int64 no_rx_count = 13;
2048 // The count of NAK (Negative Acknowledge)
2049 // Original type: uint32_t
2050 optional int64 nak_count = 14;
2051 // Controller timestamp of last TX ACK
2052 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2053 // Original type: uint32_t
2054 optional int64 last_tx_ack_timestamp = 15;
2055 // The count of Flow-off (STOP)
2056 // Original type: uint32_t
2057 optional int64 flow_off_count = 16;
2058 // Controller timestamp of last Flow-on (GO)
2059 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2060 // Original type: uint32_t
2061 optional int64 last_flow_on_timestamp = 17;
2062 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2063 // Original type: uint32_t
2064 optional int64 buffer_overflow_bytes = 18;
2065 // Buffer underflow count (in byte) since last event
2066 // Original type: uint32_t
2067 optional int64 buffer_underflow_bytes = 19;
2068}
2069
2070/**
2071 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2072 *
2073 * Notes:
2074 * - Each event can be partially filled as we might learn different pieces of device
2075 * information at different time
2076 * - Multiple device info events can be combined to give more complete picture
2077 * - When multiple device info events tries to describe the same information, the
2078 * later one wins
2079 *
2080 * Logged from:
2081 * packages/apps/Bluetooth
2082 */
Jack Heaea26982019-04-04 11:19:48 -07002083message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002084 // An identifier that can be used to match events for this device.
2085 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2086 // Salt: Randomly generated 256 bit value
2087 // Hash algorithm: HMAC-SHA256
2088 // Size: 32 byte
2089 // Default: null or empty if the device identifier is not known
2090 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2091 // Where is this device info obtained from
2092 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2093 // Name of the data source
2094 // For EXTERNAL: package name of the data source
2095 // For INTERNAL: null for general case, component name otherwise
2096 optional string source_name = 3;
2097 // Name of the manufacturer of this device
2098 optional string manufacturer = 4;
2099 // Model of this device
2100 optional string model = 5;
2101 // Hardware version of this device
2102 optional string hardware_version = 6;
2103 // Software version of this device
2104 optional string software_version = 7;
2105}
2106
2107/**
2108 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2109 * device, as documented by the Bluetooth Core HCI specification
2110 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2111 * Vol 2, Part E, Page 1118
2112 *
2113 * Logged from:
2114 * system/bt
2115 */
2116message BluetoothRemoteVersionInfoReported {
2117 // Connection handle of the connection
2118 // Original type: uint16_t
2119 optional int32 connection_handle = 1;
2120 // HCI command status code
2121 // Default: STATUS_UNKNOWN
2122 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2123 // 1 byte Version of current LMP in the remote controller
2124 optional int32 lmp_version = 3;
2125 // 2 bytes LMP manufacturer code of the remote controller
2126 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2127 optional int32 lmp_manufacturer_code = 4;
2128 // 4 bytes subversion of the LMP in the remote controller
2129 optional int32 lmp_subversion = 5;
2130}
2131
2132/**
2133 * Logs when certain Bluetooth SDP attributes are discovered
2134 * Constant definitions are from:
2135 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2136 *
2137 * Current logged attributes:
2138 * - BluetoothProfileDescriptorList
2139 * - Supported Features Bitmask
2140 *
2141 * Logged from:
2142 * system/bt
2143 */
2144message BluetoothSdpAttributeReported {
2145 // An identifier that can be used to match events for this device.
2146 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2147 // Salt: Randomly generated 256 bit value
2148 // Hash algorithm: HMAC-SHA256
2149 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2150 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2151 // Original type: uint16_t
2152 optional int32 protocol_uuid = 2;
2153 // Short form UUIDs used to identify Bluetooth SDP attribute types
2154 // Original type: uint16_t
2155 optional int32 attribute_id = 3;
2156 // Attribute value for the particular attribute
2157 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2158}
2159
2160/**
2161 * Logs when bond state of a Bluetooth device changes
2162 *
2163 * Logged from:
2164 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2165 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2166 */
2167message BluetoothBondStateChanged {
2168 // An identifier that can be used to match events for this device.
2169 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2170 // Salt: Randomly generated 256 bit value
2171 // Hash algorithm: HMAC-SHA256
2172 // Size: 32 byte
2173 // Default: null or empty if the device identifier is not known
2174 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2175 // Preferred transport type to remote dual mode device
2176 // Default: TRANSPORT_AUTO means no preference
2177 optional android.bluetooth.TransportTypeEnum transport = 2;
2178 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2179 // Default: UNKNOWN
2180 optional android.bluetooth.DeviceTypeEnum type = 3;
2181 // Current bond state (NONE, BONDING, BONDED)
2182 // Default: BOND_STATE_UNKNOWN
2183 optional android.bluetooth.BondStateEnum bond_state = 4;
2184 // Bonding sub state
2185 // Default: BOND_SUB_STATE_UNKNOWN
2186 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2187 // Unbond Reason
2188 // Default: UNBOND_REASON_UNKNOWN
2189 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2190}
2191
2192/**
2193 * Logs there is an event related Bluetooth classic pairing
2194 *
2195 * Logged from:
2196 * system/bt
2197 */
2198message BluetoothClassicPairingEventReported {
2199 // An identifier that can be used to match events for this device.
2200 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2201 // Salt: Randomly generated 256 bit value
2202 // Hash algorithm: HMAC-SHA256
2203 // Size: 32 byte
2204 // Default: null or empty if the device identifier is not known
2205 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2206 // Connection handle of this connection if available
2207 // Range: 0x0000 - 0x0EFF (12 bits)
2208 // Default: 0xFFFF if the handle is unknown
2209 optional int32 connection_handle = 2;
2210 // HCI command associated with this event
2211 // Default: CMD_UNKNOWN
2212 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2213 // HCI event associated with this event
2214 // Default: EVT_UNKNOWN
2215 optional android.bluetooth.hci.EventEnum hci_event = 4;
2216 // HCI command status code if this is triggerred by hci_cmd
2217 // Default: STATUS_UNKNOWN
2218 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2219 // HCI reason code associated with this event
2220 // Default: STATUS_UNKNOWN
2221 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002222 // A status value related to this specific event
2223 // Default: 0
2224 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002225}
2226
2227/**
2228 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2229 *
2230 * Logged from:
2231 * system/bt
2232 */
2233message BluetoothSmpPairingEventReported {
2234 // An identifier that can be used to match events for this device.
2235 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2236 // Salt: Randomly generated 256 bit value
2237 // Hash algorithm: HMAC-SHA256
2238 // Size: 32 byte
2239 // Default: null or empty if the device identifier is not known
2240 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2241 // SMP command sent or received over L2CAP
2242 // Default: CMD_UNKNOWN
2243 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2244 // Whether this command is sent or received
2245 // Default: DIRECTION_UNKNOWN
2246 optional android.bluetooth.DirectionEnum direction = 3;
2247 // SMP failure reason code
2248 // Default: PAIRING_FAIL_REASON_DEFAULT
2249 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2250}
2251
2252/**
Jack He815cdba2019-01-30 17:24:55 -08002253 * Logs when a Bluetooth socket’s connection state changed
2254 *
2255 * Logged from:
2256 * system/bt
2257 */
2258message BluetoothSocketConnectionStateChanged {
2259 // An identifier that can be used to match events for this device.
2260 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2261 // Salt: Randomly generated 256 bit value
2262 // Hash algorithm: HMAC-SHA256
2263 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002264 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002265 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002266 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002267 // Default 0 when unknown or don't care
2268 optional int32 port = 2;
2269 // Socket type as mentioned in
2270 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2271 // Default: SOCKET_TYPE_UNKNOWN
2272 optional android.bluetooth.SocketTypeEnum type = 3;
2273 // Socket connection state
2274 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2275 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2276 // Number of bytes sent to remote device during this connection
2277 optional int64 tx_bytes = 5;
2278 // Number of bytes received from remote device during this connection
2279 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002280 // Socket owner's UID
2281 optional int32 uid = 7 [(is_uid) = true];
2282 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2283 // |port| must be spawned by |server_port|
2284 // Default 0 when unknown or don't care
2285 optional int32 server_port = 8;
2286 // Whether this is a server listener socket
2287 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002288}
2289
2290/**
Jack He71426802019-04-02 13:32:52 -07002291 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2292 *
2293 * Logged from:
2294 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2295 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2296 *
2297 */
2298message BluetoothClassOfDeviceReported {
2299 // An identifier that can be used to match events for this device.
2300 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2301 // Salt: Randomly generated 256 bit value
2302 // Hash algorithm: HMAC-SHA256
2303 // Size: 32 byte
2304 // Default: null or empty if this is a server listener socket
2305 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2306 // Class of Device (CoD) value including both Major, Minor device class and service class
2307 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2308 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2309 // Default: 0
2310 optional int32 class_of_device = 2;
2311}
2312
2313/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002314 * Logs when something is plugged into or removed from the USB-C connector.
2315 *
2316 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002317 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002318 */
2319message UsbConnectorStateChanged {
2320 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002321 STATE_DISCONNECTED = 0;
2322 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002323 }
2324 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002325 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002326 // Last active session in ms.
2327 // 0 when the port is in connected state.
2328 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002329}
2330
2331/**
2332 * Logs the reported speaker impedance.
2333 *
2334 * Logged from:
2335 * Vendor audio implementation.
2336 */
2337message SpeakerImpedanceReported {
2338 optional int32 speaker_location = 1;
2339 optional int32 impedance = 2;
2340}
2341
2342/**
2343 * Logs the report of a failed hardware.
2344 *
2345 * Logged from:
2346 * Vendor HALs.
2347 *
2348 */
2349message HardwareFailed {
2350 enum HardwareType {
2351 HARDWARE_FAILED_UNKNOWN = 0;
2352 HARDWARE_FAILED_MICROPHONE = 1;
2353 HARDWARE_FAILED_CODEC = 2;
2354 HARDWARE_FAILED_SPEAKER = 3;
2355 HARDWARE_FAILED_FINGERPRINT = 4;
2356 }
2357 optional HardwareType hardware_type = 1;
2358
Maggie White6dcd8572019-01-31 14:11:50 -08002359 /**
2360 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002361 * the same hardware_type. The specific locations are vendor defined integers,
2362 * referring to board-specific numbering schemes.
2363 */
2364 optional int32 hardware_location = 2;
2365
Maggie White6dcd8572019-01-31 14:11:50 -08002366 /**
2367 * failure_code is specific to the HardwareType of the failed hardware.
2368 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002369 */
Maggie White6dcd8572019-01-31 14:11:50 -08002370 enum HardwareErrorCode {
2371 UNKNOWN = 0;
2372 COMPLETE = 1;
2373 SPEAKER_HIGH_Z = 2;
2374 SPEAKER_SHORT = 3;
2375 FINGERPRINT_SENSOR_BROKEN = 4;
2376 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002377 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002378 }
2379 optional int32 failure_code = 3;
2380}
2381
2382/**
2383 * Log an event when the device has been physically dropped.
2384 * Reported from the /vendor partition.
2385 */
2386message PhysicalDropDetected {
2387 // Confidence that the event was actually a drop, 0 -> 100
2388 optional int32 confidence_pctg = 1;
2389 // Peak acceleration of the drop, in 1/1000s of a g.
2390 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002391 // Duration of freefall in ms
2392 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002393}
2394
2395/**
2396 * Log bucketed battery charge cycles.
2397 *
2398 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002399 * a given charge point. For example, if 10 cycle buckets are
2400 * initialized, bucket 1 is the lowest 1/10th of the battery,
2401 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002402 *
2403 * Logged from:
2404 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2405 */
2406message ChargeCyclesReported {
2407 optional int32 cycle_bucket_1 = 1;
2408 optional int32 cycle_bucket_2 = 2;
2409 optional int32 cycle_bucket_3 = 3;
2410 optional int32 cycle_bucket_4 = 4;
2411 optional int32 cycle_bucket_5 = 5;
2412 optional int32 cycle_bucket_6 = 6;
2413 optional int32 cycle_bucket_7 = 7;
2414 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002415 optional int32 cycle_bucket_9 = 9;
2416 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002417}
2418
2419/**
Howard Roa46b6582018-09-18 16:45:02 -07002420 * Log battery health snapshot.
2421 *
2422 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2423 * are snapshotted periodically over 24hrs.
2424 */
2425message BatteryHealthSnapshot {
2426 enum BatterySnapshotType {
2427 UNKNOWN = 0;
2428 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2429 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2430 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2431 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2432 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2433 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2434 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2435 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2436 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2437 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2438 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2439 }
2440 optional BatterySnapshotType type = 1;
2441 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002442 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002443 // Voltage Battery Voltage, in microVolts.
2444 optional int32 voltage_micro_volt = 3;
2445 // Current Battery current, in microAmps.
2446 optional int32 current_micro_amps = 4;
2447 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2448 optional int32 open_circuit_micro_volt = 5;
2449 // Resistance Battery Resistance, in microOhms.
2450 optional int32 resistance_micro_ohm = 6;
2451 // Level Battery Level, as % of full.
2452 optional int32 level_percent = 7;
2453}
2454
2455/**
2456 * Log slow I/O operations on the primary storage.
2457 */
2458message SlowIo {
2459 // Classifications of IO Operations.
2460 enum IoOperation {
2461 UNKNOWN = 0;
2462 READ = 1;
2463 WRITE = 2;
2464 UNMAP = 3;
2465 SYNC = 4;
2466 }
2467 optional IoOperation operation = 1;
2468
2469 // The number of slow IO operations of this type over 24 hours.
2470 optional int32 count = 2;
2471}
2472
2473/**
2474 * Log battery caused shutdown with the last recorded voltage.
2475 */
2476message BatteryCausedShutdown {
2477 // The last recorded battery voltage prior to shutdown.
2478 optional int32 last_recorded_micro_volt = 1;
2479}
2480
2481/**
Tej Singha72344992019-04-17 18:55:08 -07002482 * Logs when ThermalService receives throttling events.
2483 *
2484 * Logged from:
2485 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2486 */
2487message ThermalThrottlingSeverityStateChanged {
2488 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2489 optional android.os.TemperatureTypeEnum sensor_type = 1;
2490
2491 // The name of the temperature source. Eg. CPU0
2492 optional string sensor_name = 2;
2493
2494 // Temperature in tenths of a degree C.
2495 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2496 optional int32 temperature_deci_celsius = 3;
2497
2498 // Relative severity of the throttling, see enum definition.
2499 optional android.os.ThrottlingSeverityEnum severity = 4;
2500}
2501
2502/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002503 * Logs the duration of a davey (jank of >=700ms) when it occurs
2504 *
2505 * Logged from:
2506 * frameworks/base/libs/hwui/JankTracker.cpp
2507 */
2508message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002509 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002510 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002511
Tej Singhbb8554a2018-01-26 11:59:14 -08002512 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002513 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002514}
2515
2516/**
Bookatze5885242017-10-24 20:10:31 -07002517 * Logs phone signal strength changes.
2518 *
2519 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002520 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002521 */
2522message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002523 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2524 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002525}
2526
Yangster4ccebea2018-10-09 17:09:02 -07002527
2528/**
2529 * Logs when the phone state, sim state or signal strength changes
2530 *
2531 * Logged from:
2532 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2533 */
2534message PhoneServiceStateChanged {
2535 optional android.telephony.ServiceStateEnum state = 1;
2536 optional android.telephony.SimStateEnum sim_state = 2;
2537 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2538}
2539
2540/**
2541 * Logs when the phone becomes on or off.
2542 *
2543 * Logged from:
2544 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2545 */
2546message PhoneStateChanged {
2547 enum State {
2548 OFF = 0;
2549 ON = 1;
2550 }
2551 optional State state = 1;
2552}
2553
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002554message BackGesture {
2555 enum BackType {
2556 DEFAULT_BACK_TYPE = 0;
2557 COMPLETED = 1;
2558 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2559 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2560 INCOMPLETE = 4;
2561 }
2562 optional BackType type = 1;
2563
2564 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2565 enum WindowHorizontalLocation {
2566 DEFAULT_LOCATION = 0;
2567 LEFT = 1;
2568 RIGHT = 2;
2569 }
2570 optional WindowHorizontalLocation x_location = 3;
2571}
2572
2573message ExclusionRectStateChanged {
2574 optional string component_name = 1; // if not available, simply packageName
2575 optional int32 requested_height = 2; // px
2576 optional int32 rejected_height = 3; // px
2577
2578 enum WindowHorizontalLocation {
2579 DEFAULT_LOCATION = 0;
2580 LEFT = 1;
2581 RIGHT = 2;
2582 }
2583 optional WindowHorizontalLocation x_location = 4;
2584 optional bool landscape = 5;
2585 optional bool splitscreen = 6;
2586 optional int32 duration_millis = 7;
2587}
2588
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002589message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002590 optional android.stats.launcher.LauncherAction action = 1;
2591 optional android.stats.launcher.LauncherState src_state = 2;
2592 optional android.stats.launcher.LauncherState dst_state = 3;
2593 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002594 optional bool is_swipe_up_enabled = 5;
2595}
2596
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002597message StyleUIChanged {
2598 optional android.stats.style.Action action = 1;
2599 optional int32 color_package_hash = 2;
2600 optional int32 font_package_hash = 3;
2601 optional int32 shape_package_hash = 4;
2602 optional int32 clock_package_hash = 5;
2603 optional int32 launcher_grid = 6;
2604 optional int32 wallpaper_category_hash = 7;
2605 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002606 optional int32 color_preference = 9;
2607 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002608}
2609
David Chenc28b2bb2017-10-24 12:52:52 -07002610/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002611 * Logs when Settings UI has changed.
2612 *
2613 * Logged from:
2614 * packages/apps/Settings
2615 */
2616message SettingsUIChanged {
2617 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002618 * Where this SettingsUIChange event comes from. For example, if
2619 * it's a PAGE_VISIBLE event, where the page is opened from.
2620 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002621 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002622
2623 /**
2624 * What the UI action is.
2625 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002626 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002627
2628 /**
2629 * Where the action is happening
2630 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002631 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002632
2633 /**
2634 * What preference changed in this event.
2635 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002636 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002637
2638 /**
2639 * The new value of the changed preference.
2640 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002641 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002642}
2643
2644/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002645 * Logs basic timing information about touch events.
2646 * Reported at most every 5 minutes while device is being interacted with.
2647 *
2648 * Logged from:
2649 * frameworks/native/services/inputflinger
2650 */
2651message TouchEventReported {
2652 /**
2653 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002654 * and the standard deviation of the time spent processing touchscreen events
2655 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002656 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002657 * On supported devices, the starting point is taken during the hard interrupt inside the
2658 * kernel touch driver. On all other devices, the starting point is taken inside
2659 * the kernel's input event subsystem upon receipt of the input event.
2660 * The ending point is taken inside InputDispatcher, just after the input event
2661 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002662 */
2663 // Minimum value
2664 optional float latency_min_micros = 1;
2665 // Maximum value
2666 optional float latency_max_micros = 2;
2667 // Average value
2668 optional float latency_mean_micros = 3;
2669 // Standard deviation
2670 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002671 // Number of touch events (input_event) in this report
2672 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002673}
2674
2675/**
Philip Quinn0eded622019-01-29 12:46:28 -08002676 * Logs gesture classification and timing information for touch events.
2677 *
2678 * Logged from:
2679 * frameworks/base/core/java/android/view/GestureDetector.java
2680 * frameworks/base/core/java/android/view/View.java
2681 */
2682message TouchGestureClassified {
2683 // The source of the classification (e.g. Java class name).
2684 optional string source = 1;
2685
2686 enum Classification {
2687 UNKNOWN_CLASSIFICATION = 0;
2688 SINGLE_TAP = 1;
2689 DOUBLE_TAP = 2;
2690 LONG_PRESS = 3;
2691 DEEP_PRESS = 4;
2692 SCROLL = 5;
2693 }
2694 // The classification of the gesture.
2695 optional Classification classification = 2;
2696
2697 // The interval from the start of a touch event stream until the
2698 // classification was made.
2699 optional int32 latency_millis = 3;
2700
2701 // The distance from the location of the first touch event to the
2702 // location of the touch event when the classification was made.
2703 optional float displacement_px = 4;
2704}
2705
2706/**
David Chenc28b2bb2017-10-24 12:52:52 -07002707 * Logs that a setting was updated.
2708 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002709 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002710 * The tag and is_default allow resetting of settings to default values based on the specified
2711 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2712 */
2713message SettingChanged {
2714 // The name of the setting.
2715 optional string setting = 1;
2716
2717 // The change being imposed on this setting. May represent a number, eg "3".
2718 optional string value = 2;
2719
2720 // The new value of this setting. For most settings, this is same as value. For some settings,
2721 // value is +X or -X where X represents an element in a set. For example, if the previous value
2722 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2723 // The +/- feature is currently only used for location_providers_allowed.
2724 optional string new_value = 3;
2725
2726 // The previous value of this setting.
2727 optional string prev_value = 4;
2728
2729 // The tag used with the is_default for resetting sets of settings. This is generally null.
2730 optional string tag = 5;
2731
Bookatz90867622018-01-31 15:05:57 -08002732 // True if this setting with tag should be resettable.
2733 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002734
David Chenbd789912018-03-16 17:19:55 -07002735 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002736 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002737
2738 enum ChangeReason {
2739 UPDATED = 1; // Updated can be an insertion or an update.
2740 DELETED = 2;
2741 }
2742 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002743}
Chenjie Yub3dda412017-10-24 13:41:59 -07002744
Chenjie Yu05013b32017-11-21 10:21:41 -08002745/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002746 * Logs activity going to foreground or background
2747 *
2748 * Logged from:
2749 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2750 */
2751message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002752 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002753 optional string pkg_name = 2;
2754 optional string class_name = 3;
2755
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002756 enum State {
2757 BACKGROUND = 0;
2758 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002759 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002760 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002761}
David Chenc8a43242017-10-17 16:23:28 -07002762
2763/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002764 * Logs when a volume entered low Storage state.
2765 * Logged from:
2766 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2767 */
2768message LowStorageStateChanged {
2769 // Volume that ran out of storage.
2770 optional string volume_description = 1;
2771
2772 enum State {
2773 UNKNOWN = 0;
2774 OFF = 1;
2775 ON = 2;
2776 }
2777 optional State state = 2;
2778}
2779
2780/**
2781 * Logs when an app is downgraded.
2782 * Logged from:
2783 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2784 */
2785message AppDowngraded {
2786 optional string package_name = 1;
2787 // Size of the package (all data) before being downgraded.
2788 optional int64 size_in_bytes_before = 2;
2789 // Size of the package (all data) after being downgraded.
2790 optional int64 size_in_bytes_after = 3;
2791
2792 optional bool aggressive = 4;
2793}
2794
2795/**
2796 * Logs when an app is optimized after being downgraded.
2797 * Logged from:
2798 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2799 */
2800message AppOptimizedAfterDowngraded {
2801 optional string package_name = 1;
2802}
2803
2804/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002805 * Logs whenever an app is installed on external storage.
2806 * Logged from:
2807 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2808 */
2809message AppInstallOnExternalStorageReported {
2810 // The type of external storage.
2811 optional android.stats.storage.ExternalStorageType storage_type = 1;
2812 // The name of the package that is installed on the sd card.
2813 optional string package_name = 2;
2814}
2815
2816/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002817 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002818 * Logged from:
2819 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2820 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002821message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002822 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002823
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002824 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002825
2826 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002827 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002828 optional string process_name = 3;
2829
2830 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002831 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002832
2833 optional string package_name = 5;
2834
2835 enum InstantApp {
2836 UNAVAILABLE = 0;
2837 FALSE = 1;
2838 TRUE = 2;
2839 }
2840 optional InstantApp is_instant_app = 6;
2841
2842 enum ForegroundState {
2843 UNKNOWN = 0;
2844 BACKGROUND = 1;
2845 FOREGROUND = 2;
2846 }
2847 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002848
2849 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002850}
David Chen9e3808c2017-11-20 17:25:34 -08002851
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002852/**
2853 * Logs when a WTF (What a Terrible Failure) happened.
2854 * Logged from:
2855 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2856 */
2857message WTFOccurred {
2858 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002859
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002860 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002861
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002862 // The name of the process.
2863 // system_server if it is not by an app
2864 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002865
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002866 // The pid if available. -1 means not available.
2867 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002868
2869 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002870}
2871
2872/**
2873 * Logs when system server reports low memory.
2874 * Logged from:
2875 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2876 */
2877message LowMemReported {
2878}
2879
2880/**
2881 * Logs when an app ANR (App Not Responding) occurs.
2882 * Logged from:
2883 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2884 */
2885message ANROccurred {
2886 optional int32 uid = 1 [(is_uid) = true];
2887
2888 optional string process_name = 2;
2889
2890 optional string short_component_name = 3;
2891
2892 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002893
2894 enum InstantApp {
2895 UNAVAILABLE = 0;
2896 FALSE = 1;
2897 TRUE = 2;
2898 }
2899 optional InstantApp is_instant_app = 5;
2900
2901 enum ForegroundState {
2902 UNKNOWN = 0;
2903 BACKGROUND = 1;
2904 FOREGROUND = 2;
2905 }
2906 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002907
2908 optional android.server.ErrorSource error_source = 7;
2909
2910 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002911}
2912
Bookatza7020bd2018-08-28 16:29:35 -07002913/**
2914 * Logs when the vibrator state changes.
2915 * Logged from:
2916 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2917 */
2918message VibratorStateChanged {
2919 repeated AttributionNode attribution_node = 1;
2920
2921 enum State {
2922 OFF = 0;
2923 ON = 1;
2924 }
2925 optional State state = 2;
2926
2927 // Duration (in milliseconds) requested to keep the vibrator on.
2928 // Only applicable for State == ON.
2929 optional int64 duration_millis = 3;
2930}
2931
David Chen0a368b22017-12-06 16:28:16 -08002932/*
2933 * Allows other apps to push events into statsd.
2934 * Logged from:
2935 * frameworks/base/core/java/android/util/StatsLog.java
2936 */
David Chen0b5c90c2018-01-25 16:51:49 -08002937message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002938 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002939 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002940
2941 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2942 optional int32 label = 2;
2943
2944 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2945 // predicates for the metrics).
2946 enum State {
2947 UNKNOWN = 0;
2948 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2949 STOP = 2;
2950 START = 3;
2951 }
2952 optional State state = 3;
2953}
2954
David Chen9e3808c2017-11-20 17:25:34 -08002955/**
Bookatz7948c872018-09-04 12:58:33 -07002956 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2957 * For example, this could be due to the user manually changing the time.
2958 *
2959 * Logged from:
2960 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2961 */
2962message WallClockTimeShifted {
2963 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2964 optional int64 wall_clock_timestamp_millis = 1;
2965}
2966
2967/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002968 * Logs when statsd detects an anomaly.
2969 *
2970 * Logged from:
2971 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2972 */
2973message AnomalyDetected {
2974 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002975 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002976
Yangster-mac94e197c2018-01-02 16:03:03 -08002977 // Id of the config whose anomaly detection alert fired.
2978 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002979
Yangster-mac94e197c2018-01-02 16:03:03 -08002980 // Id of the alert (i.e. name of the anomaly that was detected).
2981 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002982}
2983
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002984message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002985 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002986 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002987
2988 // The app package name.
2989 optional string pkg_name = 2;
2990
2991 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002992 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002993 WARM = 1;
2994 HOT = 2;
2995 COLD = 3;
2996 }
2997 // The transition type.
2998 optional TransitionType type = 3;
2999
3000 // The activity name.
3001 optional string activity_name = 4;
3002
3003 // The name of the calling app. Empty if not set.
3004 optional string calling_pkg_name = 5;
3005
3006 // Whether the app is an instant app.
3007 optional bool is_instant_app = 6;
3008
3009 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003010 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003011
Bookatz80d11a02018-01-16 10:46:35 -08003012 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003013
David Chen0b5c90c2018-01-25 16:51:49 -08003014 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003015 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003016 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003017 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003018 optional int32 bind_application_delay_millis = 11;
3019 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003020
3021 // Empty if not set.
3022 optional string launch_token = 13;
3023
Calin Juravle759fbda2018-02-20 19:52:30 +00003024 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003025 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003026
3027 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003028 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003029}
3030
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003031message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003032 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003033 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003034
3035 // The app package name.
3036 optional string pkg_name = 2;
3037
3038 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003039 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003040 WARM = 1;
3041 HOT = 2;
3042 COLD = 3;
3043 }
3044 // The transition type.
3045 optional TransitionType type = 3;
3046
3047 // The activity name.
3048 optional string activity_name = 4;
3049}
3050
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003051message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003052 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003053 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003054
3055 // The app package name.
3056 optional string pkg_name = 2;
3057
3058 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003059 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003060 WITH_BUNDLE = 1;
3061 WITHOUT_BUNDLE = 2;
3062 }
3063 // The transition type.
3064 optional TransitionType type = 3;
3065
3066 // The activity name.
3067 optional string activity_name = 4;
3068
3069 optional bool transition_process_running = 5;
3070
3071 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003072 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003073}
3074
Bookatz8fcd09a2017-12-18 13:01:10 -08003075/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003076 * Logs a picture-in-picture action
3077 * Logged from:
3078 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3079 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3080 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3081 */
3082message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003083 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003084 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003085
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003086 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003087
Chenjie Yu52cacc62017-12-08 18:11:45 -08003088 enum State {
3089 ENTERED = 1;
3090 EXPANDED_TO_FULL_SCREEN = 2;
3091 MINIMIZED = 3;
3092 DISMISSED = 4;
3093 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003094 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003095}
3096
3097/**
Chenjie Yue8904192017-12-08 19:12:57 -08003098 * Logs overlay action
3099 * Logged from:
3100 * services/core/java/com/android/server/wm/Session.java
3101 */
3102message OverlayStateChanged {
tsaichristine10978642019-09-10 14:12:49 -07003103 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003104
tsaichristine10978642019-09-10 14:12:49 -07003105 optional string package_name = 2 [(state_field_option).option = PRIMARY];
Chenjie Yue8904192017-12-08 19:12:57 -08003106
3107 optional bool using_alert_window = 3;
3108
3109 enum State {
3110 ENTERED = 1;
3111 EXITED = 2;
3112 }
tsaichristine10978642019-09-10 14:12:49 -07003113 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Chenjie Yue8904192017-12-08 19:12:57 -08003114}
3115
Chenjie Yuccfe6452018-01-30 11:33:21 -08003116/*
3117 * Logs foreground service starts and stops.
3118 * Note that this is not when a service starts or stops, but when it is
3119 * considered foreground.
3120 * Logged from
3121 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3122 */
3123message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003124 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003125 // package_name + "/" + class_name
3126 optional string short_name = 2;
3127
3128 enum State {
3129 ENTER = 1;
3130 EXIT = 2;
3131 }
3132 optional State state = 3;
3133}
3134
Chenjie Yue8904192017-12-08 19:12:57 -08003135/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003136 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3137 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3138 * attributed back to the parent (host) uid. One example is Chrome.
3139 *
3140 * Logged from:
3141 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3142 */
3143message IsolatedUidChanged {
3144 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003145 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003146 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003147 optional int32 parent_uid = 1;
3148
3149 optional int32 isolated_uid = 2;
3150
3151 // We expect an isolated uid to be removed before if it's used for another parent uid.
3152 enum Event {
3153 REMOVED = 0;
3154 CREATED = 1;
3155 }
3156 optional Event event = 3;
3157}
3158
3159/*
3160 * Logs the reception of an incoming network packet causing the main system to wake up for
3161 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3162 * and processed by WakeupController.cpp.
3163 */
3164message PacketWakeupOccurred {
3165 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3166 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003167 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003168 // The interface name on which the packet was received.
3169 optional string iface = 2;
3170 // The ethertype value of the packet.
3171 optional int32 ethertype = 3;
3172 // String representation of the destination MAC address of the packet.
3173 optional string destination_hardware_address = 4;
3174 // String representation of the source address of the packet if this was an IP packet.
3175 optional string source_ip = 5;
3176 // String representation of the destination address of the packet if this was an IP packet.
3177 optional string destination_ip = 6;
3178 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3179 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3180 // families.
3181 optional int32 ip_next_header = 7;
3182 // The source port if this was a TCP or UDP packet.
3183 optional int32 source_port = 8;
3184 // The destination port if this was a TCP or UDP packet.
3185 optional int32 destination_port = 9;
3186}
3187
3188/*
3189 * Logs the memory stats for an app on startup.
3190 * Logged from:
3191 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3192 */
3193message AppStartMemoryStateCaptured {
3194 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003195 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003196
3197 // The process name.
3198 optional string process_name = 2;
3199
3200 // The activity name.
3201 optional string activity_name = 3;
3202
3203 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003204 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003205
3206 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003207 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003208
3209 // RSS
3210 optional int64 rss_in_bytes = 6;
3211
3212 // CACHE
3213 optional int64 cache_in_bytes = 7;
3214
3215 // SWAP
3216 optional int64 swap_in_bytes = 8;
3217}
3218
3219/*
3220 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3221 * for LMK event.
3222 * Logged from:
3223 * system/core/lmkd/lmkd.c
3224 */
3225message LmkStateChanged {
3226 enum State {
3227 UNKNOWN = 0;
3228 START = 1;
3229 STOP = 2;
3230 }
3231 optional State state = 1;
3232}
3233
3234/*
3235 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3236 * Logged from:
3237 * system/core/lmkd/lmkd.c
3238 */
3239message LmkKillOccurred {
3240 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003241 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003242
3243 // The process name.
3244 optional string process_name = 2;
3245
3246 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003247 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003248
3249 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003250 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003251
3252 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003253 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003254
3255 // RSS
3256 optional int64 rss_in_bytes = 6;
3257
3258 // CACHE
3259 optional int64 cache_in_bytes = 7;
3260
3261 // SWAP
3262 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003263
3264 // The elapsed real time of start of the process.
3265 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003266
3267 // Min oom adj score considered by lmkd.
3268 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003269}
3270
Rajeev Kumar51b54602018-03-01 12:18:26 -08003271/*
3272 * Logs when the ActivityManagerService detects that an app died.
3273 *
3274 * Logged from:
3275 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3276 */
3277message AppDied {
3278 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003279 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003280}
3281
Howard Ro21a039c2018-08-06 14:55:47 -07003282/**
3283 * An atom for generic metrics logging. Available from Android Q.
3284 */
3285message GenericAtom {
3286 // The uid of the application that sent this custom atom.
3287 optional int32 uid = 1 [(is_uid) = true];
3288
3289 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003290 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003291}
3292
Tej Singhd6d6d772018-09-05 17:41:25 -07003293/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003294 * Atom for simple logging of user interaction and impression events, such as "the user touched
3295 * this button" or "this dialog was displayed".
3296 * Keep the UI event stream clean: don't use for system or background events.
3297 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003298 *
3299 * Logged from:
3300 * frameworks/base/services/core/java/com/android/server/
3301 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003302 */
3303message UiEventReported {
3304 // The event_id.
3305 optional int32 event_id = 1;
3306 // The event's source or target uid and package, if applicable.
3307 // For example, the package posting a notification, or the destination package of a share.
3308 optional int32 uid = 2 [(is_uid) = true];
3309 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003310 // An identifier used to disambiguate which logs refer to a particular instance of some
3311 // UI element. Useful when there might be multiple instances simultaneously active.
3312 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003313}
3314
3315/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003316 * Reports a notification was created or updated.
3317 *
3318 * Logged from:
3319 * frameworks/base/services/core/java/com/android/server/notification/
3320 */
3321message NotificationReported {
3322 // The event_id (as for UiEventReported).
3323 optional int32 event_id = 1;
3324 // The notifying app's uid and package.
3325 optional int32 uid = 2 [(is_uid) = true];
3326 optional string package_name = 3;
3327 // A small system-assigned identifier for the notification.
3328 // Locally probably-unique, but expect collisions across users and/or days.
3329 optional int32 instance_id = 4;
3330 // The app-assigned notification ID and tag
3331 optional int32 notification_id = 5;
3332 optional string notification_tag = 6;
3333 optional string channel_id = 7; // App-assigned channel ID
3334
3335 // Grouping information
3336 optional string group_id = 8; // Group the notification currently belongs to
3337 optional int32 group_instance_id = 9; // Instance_id of the group-summary notification
3338 optional bool is_group_summary = 10; // Tags the group-summary notification
3339
3340 // Attributes
3341 optional string category = 11; // App-assigned notification category (API-defined strings)
3342 optional int32 style = 12; // App-assigned notification style
3343 optional int32 num_people = 13; // Number of Person records attached to the notification
3344
3345 // Ordering, importance and interruptiveness
3346
3347 optional int32 position = 14; // Position in NotificationManager's list
3348
3349 optional android.stats.sysui.NotificationImportance importance = 15;
3350 optional int32 alerting = 16; // Bitfield, 1=buzz 2=beep 4=blink
3351
3352 enum NotificationImportanceExplanation {
3353 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3354 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3355 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3356 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3357 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3358 // Like _APP, but based on pre-channels priority signal.
3359 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3360 }
3361
3362 optional NotificationImportanceExplanation importance_source = 17;
3363 optional android.stats.sysui.NotificationImportance importance_initial = 18;
3364 optional NotificationImportanceExplanation importance_initial_source = 19;
3365 optional android.stats.sysui.NotificationImportance importance_asst = 20;
3366 optional int32 assistant_hash = 21;
3367 optional float assistant_ranking_score = 22;
3368}
3369
3370message Notification {
3371 // The notifying app's uid and package.
3372 optional int32 uid = 1 [(is_uid) = true];
3373 optional string package_name = 2;
3374 // A small system-assigned identifier for the notification.
3375 optional int32 instance_id = 3;
3376
3377 // Grouping information.
3378 optional int32 group_instance_id = 4;
3379 optional bool is_group_summary = 5;
3380
3381 // The section of the shade that the notification is in.
3382 // See NotificationSectionsManager.PriorityBucket.
3383 enum NotificationSection {
3384 SECTION_UNKNOWN = 0;
3385 SECTION_PEOPLE = 1;
3386 SECTION_ALERTING = 2;
3387 SECTION_SILENT = 3;
3388 }
3389 optional NotificationSection section = 6;
3390}
3391
3392message NotificationList {
3393 repeated Notification notifications = 1; // An ordered sequence of notifications.
3394}
3395
3396/**
3397 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3398 *
3399 * Logged from:
3400 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3401 */
3402message NotificationPanelReported {
3403 // The event_id (as for UiEventReported).
3404 optional int32 event_id = 1;
3405 optional int32 num_notifications = 2;
3406 // The notifications in the panel, in the order that they appear there.
3407 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3408}
3409
3410/**
3411 * Reports a notification channel, or channel group, was created, updated, or deleted.
3412 *
3413 * Logged from:
3414 * frameworks/base/services/core/java/com/android/server/notification/
3415 */
3416message NotificationChannelModified {
3417 // The event_id (as for UiEventReported).
3418 optional int32 event_id = 1;
3419 // The notifying app's uid and package.
3420 optional int32 uid = 2 [(is_uid) = true];
3421 optional string package_name = 3;
3422 // App-assigned notification channel ID or channel-group ID
3423 optional string channel_id = 4;
3424 // Previous importance setting, if applicable
3425 optional android.stats.sysui.NotificationImportance old_importance = 5;
3426 // New importance setting
3427 optional android.stats.sysui.NotificationImportance importance = 6;
3428}
3429
3430
3431/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003432 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003433 *
3434 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003435 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003436 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003437message BiometricAcquired {
3438 // Biometric modality that was acquired.
3439 optional android.hardware.biometrics.ModalityEnum modality = 1;
3440 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3441 optional int32 user = 2;
3442 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3443 optional bool is_crypto = 3;
3444 // Action that the device is performing. Acquired messages are only expected for enroll and
3445 // authenticate. Other actions may indicate an error.
3446 optional android.hardware.biometrics.ActionEnum action = 4;
3447 // The client that this acquisition was received for.
3448 optional android.hardware.biometrics.ClientEnum client = 5;
3449 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3450 optional int32 acquire_info = 6;
3451 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3452 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003453 // Dictates if this message should trigger additional debugging.
3454 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003455}
3456
3457/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003458 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003459 *
3460 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003461 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003462 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003463message BiometricAuthenticated {
3464 // Biometric modality that was used.
3465 optional android.hardware.biometrics.ModalityEnum modality = 1;
3466 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3467 optional int32 user = 2;
3468 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3469 // storage.
3470 optional bool is_crypto = 3;
3471 // The client that this acquisition was received for.
3472 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003473 // If authentication requires user confirmation. See BiometricPrompt's
3474 // setRequireConfirmation(bool) method.
3475 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003476
Kevin Chyn1741a072019-01-17 11:54:40 -08003477 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003478 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003479 REJECTED = 1;
3480 PENDING_CONFIRMATION = 2;
3481 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003482 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003483
3484 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003485 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003486 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3487 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3488 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3489 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003490 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003491 // Dictates if this message should trigger additional debugging.
3492 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003493}
3494
3495/**
3496 * Logs when a biometric error occurs.
3497 *
3498 * Logged from:
3499 * frameworks/base/services/core/java/com/android/server/biometrics
3500 */
3501message BiometricErrorOccurred {
3502 // Biometric modality that was used.
3503 optional android.hardware.biometrics.ModalityEnum modality = 1;
3504 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3505 optional int32 user = 2;
3506 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3507 optional bool is_crypto = 3;
3508 // Action that the device is performing.
3509 optional android.hardware.biometrics.ActionEnum action = 4;
3510 // The client that this acquisition was received for.
3511 optional android.hardware.biometrics.ClientEnum client = 5;
3512 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3513 // are unique to modality.
3514 optional int32 error_info = 6;
3515 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3516 // by the vendor and not specified by the HIDL interface.
3517 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003518 // Dictates if this message should trigger additional debugging.
3519 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003520 // Time spent during the authentication attempt.
3521 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003522}
3523
3524/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003525 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003526 * Logged from:
3527 * frameworks/base/services/core/java/com/android/server/biometrics
3528 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003529message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003530 // Biometric modality.
3531 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003532 // Type of issue detected.
3533 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003534 // Dictates if this message should trigger additional debugging.
3535 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003536}
Howard Ro688ae182018-09-25 00:09:36 -07003537
joshmccloskey6f952b22019-03-25 20:59:35 -07003538/**
3539 * Logs when a biometric enrollment occurs.
3540 *
3541 * Logged from:
3542 * frameworks/base/services/core/java/com/android/server/biometrics
3543 */
3544message BiometricEnrolled {
3545 // Biometric modality that was used.
3546 optional android.hardware.biometrics.ModalityEnum modality = 1;
3547 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3548 optional int32 user = 2;
3549 // The amount of time the enrollment took in milliseconds.
3550 optional int64 latency_millis = 3;
3551 // Whether or not the enrollment was successful.
3552 optional bool success = 4;
3553}
3554
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003555/*
Tej Singh0d176952019-01-16 19:10:54 -08003556 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003557 */
Tej Singh0d176952019-01-16 19:10:54 -08003558message FlagFlipUpdateOccurred {
3559 // If the event is from a flag config package, specify the package name.
3560 optional string flag_flip_package_name = 1;
3561
3562 // The order id of the package
3563 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003564}
3565
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003566/**
3567 * Potential experiment ids that goes with a train install.
3568 */
3569message TrainExperimentIds {
3570 repeated int64 experiment_id = 1;
3571}
3572
Yangster-macb89807e2018-11-15 21:10:57 -08003573/*
3574 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003575 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003576 */
3577message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003578 // Name of the train.
3579 optional string train_name = 1;
3580 // Version code for a "train" of packages that need to be installed atomically
3581 optional int64 train_version_code = 2;
3582 // After installation of this package, device requires a restart.
3583 optional bool requires_staging = 3;
3584 // Rollback should be enabled for this install.
3585 optional bool rollback_enabled = 4;
3586 // Requires low latency monitoring if possible.
3587 optional bool requires_low_latency_monitor = 5;
3588
Yangster-macb89807e2018-11-15 21:10:57 -08003589 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003590 UNKNOWN = 0;
3591 INSTALL_REQUESTED = 1;
3592 INSTALL_STARTED = 2;
3593 INSTALL_STAGED_NOT_READY = 3;
3594 INSTALL_STAGED_READY = 4;
3595 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003596 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3597 // and INSTALL_FAILURE_COMMIT.
3598 INSTALL_FAILURE = 6 [deprecated = true];
3599 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003600 INSTALL_CANCELLED = 7;
3601 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003602 INSTALLER_ROLLBACK_INITIATED = 9;
3603 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3604 INSTALLER_ROLLBACK_STAGED = 11;
3605 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3606 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3607 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3608 INSTALLER_ROLLBACK_SUCCESS = 15;
3609 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003610 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3611 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3612 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3613 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3614 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3615 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003616 INSTALL_FAILURE_DOWNLOAD = 23;
3617 INSTALL_FAILURE_STATE_MISMATCH = 24;
3618 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003619 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003620 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003621 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003622 // Possible experiment ids for monitoring this push.
3623 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3624 // user id
3625 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003626 optional int32 reason = 9;
Yangster-macb89807e2018-11-15 21:10:57 -08003627}
3628
Tej Singhc9203082019-05-03 13:42:23 -07003629/* Test atom, is not logged anywhere */
3630message TestAtomReported {
3631 repeated AttributionNode attribution_node = 1;
3632 optional int32 int_field = 2;
3633 optional int64 long_field = 3;
3634 optional float float_field = 4;
3635 optional string string_field = 5;
3636 optional bool boolean_field = 6;
3637 enum State {
3638 UNKNOWN = 0;
3639 OFF = 1;
3640 ON = 2;
3641 }
3642 optional State state = 7;
3643 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3644}
3645
Maggie Whitefc1aa592018-11-28 21:55:23 -08003646/** Represents USB port overheat event. */
3647message UsbPortOverheatEvent {
3648 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3649 optional int32 plug_temperature_deci_c = 1;
3650
3651 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3652 optional int32 max_temperature_deci_c = 2;
3653
3654 /* Time between USB plug event and overheat threshold trip, in seconds. */
3655 optional int32 time_to_overheat_secs = 3;
3656
3657 /* Time between overheat threshold trip and hysteresis, in seconds. */
3658 optional int32 time_to_hysteresis_secs = 4;
3659
3660 /* Time between hysteresis and active mitigation ending, in seconds. */
3661 optional int32 time_to_inactive_secs = 5;
3662};
3663
Maggie White8735b852019-01-18 11:40:49 -08003664/**
3665 * Logs total effective full charge and discharge cycles on a battery.
3666 * Here are some examples of one effective cycle:
3667 * 1) the battery charges from 0% to 100% and drains back to 0%,
3668 * 2) charging from 50% to 100% and draining back to 50% twice.
3669 * Pulled from:
3670 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3671 */
3672message BatteryCycleCount {
3673 /* Number of total charge and discharge cycles on the system battery. */
3674 optional int32 cycle_count = 1;
3675}
3676
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003677/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003678 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3679 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003680 * Pulled from:
3681 * StatsCompanionService
3682 */
3683
Carmen Agimof12dec122019-03-06 16:14:38 +00003684message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003685
Carmen Agimof12dec122019-03-06 16:14:38 +00003686 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003687 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003688 PUBLIC = 1;
3689 PRIVATE = 2;
3690 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003691 }
3692
Carmen Agimof12dec122019-03-06 16:14:38 +00003693 // The type of external storage.
3694 optional android.stats.storage.ExternalStorageType storage_type = 1;
3695 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3696 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003697 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003698 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003699}
3700
Yangster-macb89807e2018-11-15 21:10:57 -08003701/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003702 * Logs when a connection becomes available and lost.
3703 * Logged in StatsCompanionService.java
3704 */
3705message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003706 // Id of the network.
3707 optional int32 net_id = 1;
3708
3709 enum State {
3710 UNKNOWN = 0;
3711 CONNECTED = 1;
3712 DISCONNECTED = 2;
3713 }
3714 // Connected state of a network.
3715 optional State state = 2;
3716}
3717
3718/**
3719 * Logs when a service starts and stops.
3720 * Logged from:
3721 * services/core/java/com/android/server/am/ActiveServices.java
3722 */
3723message ServiceStateChanged {
3724
3725 optional int32 uid = 1 [(is_uid) = true];
3726
3727 optional string package_name = 2;
3728
3729 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003730
3731 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003732 START = 1;
3733 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003734 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003735
3736 optional State state = 4;
3737}
3738
3739/**
3740 * Logs when a service is launched.
3741 * Logged from:
3742 * services/core/java/com/android/server/am/ActiveServices.java
3743 */
3744message ServiceLaunchReported {
3745
3746 optional int32 uid = 1 [(is_uid) = true];
3747
3748 optional string package_name = 2;
3749
3750 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003751}
Howard Ro688ae182018-09-25 00:09:36 -07003752
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003753/**
3754 * Logs when a hidden API is used.
3755 *
3756 * Logged from:
3757 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3758 */
3759message HiddenApiUsed {
3760 // The uid of the app making the hidden access.
3761 optional int32 uid = 1 [(is_uid) = true];
3762
3763 // Signature of the method or field accessed.
3764 optional string signature = 2;
3765
3766 enum AccessMethod {
3767 NONE = 0;
3768 REFLECTION = 1;
3769 JNI = 2;
3770 LINKING = 3;
3771 }
3772
3773 // Type of access.
3774 optional AccessMethod access_method = 3;
3775
3776 // Whether the access was prevented or not.
3777 optional bool access_denied = 4;
3778}
3779
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003780/**
3781 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3782 * - When user sees privacy chip
3783 * - When user clicks privacy chip
3784 * - How does the user exit the Privacy Dialog
3785 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003786 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3787 */
3788message PrivacyIndicatorsInteracted {
3789
3790 enum Type {
3791 UNKNOWN = 0;
3792 CHIP_VIEWED = 1;
3793 CHIP_CLICKED = 2;
3794 DIALOG_PRIVACY_SETTINGS = 3;
3795 DIALOG_DISMISS = 4;
3796 DIALOG_LINE_ITEM = 5;
3797 }
3798
3799 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3800
3801 // Used if the type is LINE_ITEM
3802 optional string package_name = 2;
3803}
3804
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003805/**
3806 * Logs information about a package that is moved from the internal to external storage and vice
3807 * versa.
3808 * It logs the package name, the type of the external storage where the package is installed
3809 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3810 * and the move type: if it's from internal to external or the other way around.
3811 *
3812 * Logged from:
3813 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3814 */
3815message AppMovedStorageReported {
3816 enum MoveType {
3817 UNKNOWN = 0;
3818 TO_EXTERNAL = 1;
3819 TO_INTERNAL = 2;
3820 }
3821 // The type of the external storage.
3822 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3823 // The type of move.
3824 optional MoveType move_type = 2;
3825 // The name of the package that was moved.
3826 optional string package_name = 3;
3827}
3828
jianjin8f2dee02019-03-29 14:03:08 -07003829/**
3830 * Logs when system server watchdog occurs.
3831 * Logged from:
3832 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3833 */
3834message SystemServerWatchdogOccurred {
3835 optional string subject = 1;
3836}
3837
3838/**
3839 * Logs when new file added to tombstones.
3840 * Logged from:
3841 * frameworks/base/core/java/com/android/server/BootReceiver.java
3842 */
3843message TombStoneOccurred {
3844}
3845
Hai Zhang5d3328d2019-04-13 21:25:06 +08003846/*
3847 * Information about a role request
3848 *
3849 * Logged from:
3850 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3851 */
3852message RoleRequestResultReported {
3853 // UID of application requesting the role
3854 optional int32 requesting_uid = 1;
3855
3856 // Package name of application requesting the role
3857 optional string requesting_package_name = 2;
3858
3859 // The role to be granted
3860 optional string role_name = 3;
3861
3862 // The count of applications qualifying for the role
3863 optional int32 qualifying_count = 4;
3864
3865 // UID of application current granted the role
3866 optional int32 current_uid = 5;
3867
3868 // Package name of application current granted the role
3869 optional string current_package_name = 6;
3870
3871 // UID of another application that user chose to grant the role to, instead of the requesting
3872 // application
3873 optional int32 granted_another_uid = 7;
3874
3875 // Package name of another application that user chose to grant the role to, instead of the
3876 // requesting application
3877 optional string granted_another_package_name = 8;
3878
3879 enum Result {
3880 UNDEFINED = 0;
3881 // role request was ignored
3882 IGNORED = 1;
3883 // role request was ignored because it's already granted
3884 IGNORED_ALREADY_GRANTED = 2;
3885 // role request was ignored because the application isn't qualified
3886 IGNORED_NOT_QUALIFIED = 3;
3887 // role request was ignored because user said it should be always denied
3888 IGNORED_USER_ALWAYS_DENIED = 4;
3889 // role was granted by user action
3890 USER_GRANTED = 5;
3891 // role was denied by user action
3892 USER_DENIED = 6;
3893 // role was denied by user granting another application the role
3894 USER_DENIED_GRANTED_ANOTHER = 7;
3895 // role was denied and set to be always denied by the user
3896 USER_DENIED_WITH_ALWAYS = 8;
3897 }
3898 // The result of the role request
3899 optional Result result = 9;
3900}
3901
Mark Tabrya824a642019-11-05 12:26:12 -08003902/**
3903 * Logs when a Vehicle Maps Service client's connection state has changed
3904 *
3905 * Logged from:
3906 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
3907 */
3908message VmsClientConnectionStateChanged {
3909 // The UID of the VMS client app
3910 optional int32 uid = 1 [(is_uid) = true];
3911
3912 enum State {
3913 UNKNOWN = 0;
3914 // Attempting to connect to the client
3915 CONNECTING = 1;
3916 // Client connection established
3917 CONNECTED = 2;
3918 // Client connection closed unexpectedly
3919 DISCONNECTED = 3;
3920 // Client connection closed by VMS
3921 TERMINATED = 4;
3922 // Error establishing the client connection
3923 CONNECTION_ERROR = 5;
3924 }
3925
3926 optional State state = 2;
3927}
3928
Jeff Sharkey6bd21572019-11-15 20:45:33 -07003929/**
3930 * Logs when MediaProvider has successfully finished scanning a storage volume.
3931 *
3932 * Logged from:
3933 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
3934 */
3935message MediaProviderScanEvent {
3936 enum Reason {
3937 // Scan triggered due to unknown reason
3938 UNKNOWN = 0;
3939 // Scan triggered due to storage volume being mounted
3940 MOUNTED = 1;
3941 // Scan triggered due to explicit user action or app request
3942 DEMAND = 2;
3943 // Scan triggered due to idle maintenance
3944 IDLE = 3;
3945 }
3946
3947 // Volume type that this event pertains to
3948 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3949 // Reason why this scan was triggered
3950 optional Reason reason = 2;
3951 // Total number of files scanned
3952 optional int64 item_count = 3;
3953 // Duration of scan, normalized per file
3954 optional float normalized_duration_millis = 4;
3955 // Number of database inserts, normalized per file
3956 optional float normalized_insert_count = 5;
3957 // Number of database updates, normalized per file
3958 optional float normalized_update_count = 6;
3959 // Number of database deletes, normalized per file
3960 optional float normalized_delete_count = 7;
3961}
3962
3963/**
3964 * Logs when an app has asked MediaProvider to delete media belonging to the user.
3965 *
3966 * Logged from:
3967 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
3968 */
3969message MediaProviderDeletionEvent {
3970 // Volume type that this event pertains to
3971 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3972 // Device timestamp when this deletion event occurred
3973 optional int64 timestamp_millis = 2;
3974 // App that requested deletion
3975 optional string package_name = 3;
3976 // Number of items that were deleted
3977 optional int32 item_count = 4;
3978}
3979
3980/**
3981 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
3982 *
3983 * Logged from:
3984 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
3985 */
3986message MediaProviderPermissionEvent {
3987 enum Result {
3988 UNKNOWN = 0;
3989 USER_GRANTED = 1;
3990 AUTO_GRANTED = 2;
3991 USER_DENIED = 3;
3992 USER_DENIED_WITH_PREJUDICE = 4;
3993 AUTO_DENIED = 5;
3994 }
3995
3996 // Volume type that this event pertains to
3997 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3998 // Device timestamp when this permission event occurred
3999 optional int64 timestamp_millis = 2;
4000 // App that requested permission
4001 optional string package_name = 3;
4002 // Number of items that were requested
4003 optional int32 item_count = 4;
4004 // Result of this request
4005 optional Result result = 5;
4006}
4007
4008/**
4009 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4010 *
4011 * Logged from:
4012 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4013 */
4014message MediaProviderSchemaChange {
4015 // Volume type that this event pertains to
4016 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4017 // Old database version code
4018 optional int32 version_from = 2;
4019 // New database version code
4020 optional int32 version_to = 3;
4021 // Total number of files in database
4022 optional int64 item_count = 4;
4023 // Duration of schema change, normalized per file
4024 optional float normalized_duration_millis = 5;
4025}
4026
4027/**
4028 * Logs when MediaProvider has finished an idle maintenance job.
4029 *
4030 * Logged from:
4031 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4032 */
4033message MediaProviderIdleMaintenance {
4034 // Volume type that this event pertains to
4035 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4036
4037 // Total number of files in database
4038 optional int64 item_count = 2;
4039 // Duration of idle maintenance, normalized per file
4040 optional float normalized_duration_millis = 3;
4041 // Number of thumbnails found to be stale, normalized per file
4042 optional float normalized_stale_thumbnails = 4;
4043 // Number of items found to be expired, normalized per file
4044 optional float normalized_expired_media = 5;
4045}
4046
Keun young Park3e033cb2019-12-18 11:27:35 -08004047/**
4048 * Represents boot time event with duration in ms.
4049 *
4050 * Logged from: bootstat and various system server components. Check each enums for details.
4051 */
4052message BootTimeEventDuration {
4053 enum DurationEvent {
4054 UNKNOWN = 0;
4055 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4056 ABSOLUTE_BOOT_TIME = 1;
4057 // Bootloader's 1st stage execution time.
4058 // Logged from bootstat.
4059 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4060 // Bootloader's 1st stage loading time.
4061 // Logged from bootstat.
4062 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4063 // Bootloader's kernel loading time.
4064 // Logged from bootstat.
4065 BOOTLOADER_KERNEL_LOAD = 4;
4066 // Bootloader's 2nd stage execution time.
4067 // Logged from bootstat.
4068 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4069 // Bootloader's 2nd stage loading time.
4070 // Logged from bootstat.
4071 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4072 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4073 // for locked device.
4074 // Logged from bootstat.
4075 BOOTLOADER_UI_WAIT = 7;
4076 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4077 // Logged from bootstat.
4078 BOOTLOADER_TOTAL = 8;
4079 // Shutdown duration inside init for the reboot before the current boot up.
4080 // Logged from f/b/services/.../BootReceiver.java.
4081 SHUTDOWN_DURATION = 9;
4082 // Total time for mounting of disk devices during bootup.
4083 // Logged from f/b/services/.../BootReceiver.java.
4084 MOUNT_DEFAULT_DURATION = 10;
4085 // Total time for early stage mounting of disk devices during bootup.
4086 // Logged from f/b/services/.../BootReceiver.java.
4087 MOUNT_EARLY_DURATION = 11;
4088 // Total time for late stage mounting of disk devices during bootup.
4089 // Logged from f/b/services/.../BootReceiver.java.
4090 MOUNT_LATE_DURATION = 12;
4091 // Average time to scan non-system app after OTA
4092 // Logged from f/b/services/.../PackageManagerService.java
4093 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4094 // Time to initialize Package manager after OTA
4095 // Logged from f/b/services/.../PackageManagerService.java
4096 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4097 // Time to scan all system app from Package manager after OTA
4098 // Logged from f/b/services/.../PackageManagerService.java
4099 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4100 // Init's total time for cold boot stage.
4101 // Logged from bootstat.
4102 COLDBOOT_WAIT = 16;
4103 // Init's total time for initializing selinux.
4104 // Logged from bootstat.
4105 SELINUX_INIT = 17;
4106 // Time since last factory reset.
4107 // Logged from bootstat.
4108 FACTORY_RESET_TIME_SINCE_RESET = 18;
4109 }
4110
4111 // Type of the event.
4112 optional DurationEvent event = 1;
4113 // Duration of the event in ms.
4114 optional int64 duration_millis = 2;
4115}
4116
4117/**
4118 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4119 * since boot-up.
4120 *
4121 * Logged from: bootstat and various system server components. Check each enums for details.
4122 */
4123message BootTimeEventElapsedTime {
4124 enum ElapsedTimeEvent {
4125 UNKNOWN = 0;
4126 // Time when init starts 1st stage. Logged from bootstat.
4127 ANDROID_INIT_STAGE_1 = 1;
4128 // Time when sys.boot_completed prop is set.
4129 // Logged from bootstat.
4130 BOOT_COMPLETE = 2;
4131 // BOOT_COMPLETE for encrypted device.
4132 BOOT_COMPLETE_ENCRYPTION = 3;
4133 // BOOT_COMPLETE for device with no encryption.
4134 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4135 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
4136 BOOT_COMPLETE_POST_DESCRYPT = 5;
4137 // BOOT_COMPLETE after factory reset.
4138 FACTORY_RESET_BOOT_COMPLETE = 6;
4139 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4140 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
4141 // BOOT_COMPLETE_POST_DESCRYPT after factory reset.
4142 FACTORY_RESET_BOOT_COMPLETE_POST_DESCRYPT = 8;
4143 // BOOT_COMPLETE after OTA.
4144 OTA_BOOT_COMPLETE = 9;
4145 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4146 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
4147 // BOOT_COMPLETE_POST_DESCRYPT after OTA.
4148 OTA_BOOT_COMPLETE_POST_DESCRYPT = 11;
4149 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4150 // Logged from f/b/services/.../UserController.java
4151 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4152 // Time when the system starts sending BOOT_COMPLETED broadcast.
4153 // Logged from f/b/services/.../UserController.java
4154 FRAMEWORK_BOOT_COMPLETED = 13;
4155 // Time when the package manager starts init.
4156 // Logged from f/b/services/.../SystemServer.java
4157 PACKAGE_MANAGER_INIT_START = 14;
4158 // Time when package manager is ready
4159 // Logged from f/b/services/.../SystemServer.java
4160 PACKAGE_MANAGER_INIT_READY = 15;
4161 // Represents the time when user has entered unlock credential for system with user pin.
4162 // Logged from bootstat.
4163 POST_DECRYPT = 16;
4164 // Represents the start of zygote's init.
4165 // Logged from zygote itself.
4166 ZYGOTE_INIT_START = 17;
4167 // Represents the start of secondary zygote's init.
4168 // TODO: add logging to zygote
4169 SECONDARY_ZYGOTE_INIT_START = 18;
4170 // Represents the start of system server's init.
4171 // Logged from f/b/services/.../SystemServer.java
4172 SYSTEM_SERVER_INIT_START = 19;
4173 // Represents the completion of system server's init.
4174 // Logged from f/b/services/.../SystemServer.java
4175 SYSTEM_SERVER_READY = 20;
4176 // Represents the start of launcher during boot-up.
4177 // TODO: add logging
4178 LAUNCHER_START = 21;
4179 // Represents the completion of launcher's initial rendering. User can use other apps from
4180 // launcher from this point.
4181 // TODO: add logging
4182 LAUNCHER_SHOWN = 22;
4183 }
4184
4185 // Type of the event.
4186 optional ElapsedTimeEvent event = 1;
4187 // Time since bootup for the event.
4188 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4189 optional int64 time_millis = 2;
4190}
4191
4192/**
4193 * Boot time events with UTC time.
4194 *
4195 * Logged from: bootstat and various system server components. Check each enums for details.
4196 */
4197message BootTimeEventUtcTime {
4198 enum UtcTimeEvent {
4199 UNKNOWN = 0;
4200 // Time of the bootstat's marking of 1st boot after the last factory reset.
4201 // Logged from bootstat.
4202 FACTORY_RESET_RESET_TIME = 1;
4203 // The time when bootstat records FACTORY_RESET_* events. This is close to
4204 // BOOT_COMPLETE time for the current bootup.
4205 // Logged from bootstat.
4206 FACTORY_RESET_CURRENT_TIME = 2;
4207 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4208 // Logged from bootstat.
4209 FACTORY_RESET_RECORD_VALUE = 3;
4210 }
4211
4212 // Type of the event.
4213 optional UtcTimeEvent event = 1;
4214 // UTC time for the event.
4215 optional int64 utc_time_secs = 2;
4216}
4217
4218/**
4219 * Boot time events representing specific error code during bootup.
4220 * Meaning of error code can be different per each event type.
4221 *
4222 * Logged from: bootstat and various system server components. Check each enums for details.
4223 */
4224message BootTimeEventErrorCode {
4225 enum ErrorCodeEvent {
4226 UNKNOWN = 0;
4227 // Linux error code for time() call to get the current UTC time.
4228 // Logged from bootstat.
4229 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4230 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4231 // as UMOUNT_STAT_* from init/reboot.cpp.
4232 // Logged from f/b/services/.../BootReceiver.java.
4233 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004234 // Reprepsents fie system mounting error code of /data partition for the current boot.
4235 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004236 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004237 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004238 }
4239
4240 // Type of the event.
4241 optional ErrorCodeEvent event = 1;
4242 // error code defined per each event type.
4243 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4244 // FS_MGR_FS_STAT.
4245 optional int32 error_code = 2;
4246}
4247
Chenjie Yubbcbc602018-02-05 16:51:52 -08004248//////////////////////////////////////////////////////////////////////
4249// Pulled atoms below this line //
4250//////////////////////////////////////////////////////////////////////
4251
4252/**
David Chenc8a43242017-10-17 16:23:28 -07004253 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4254 *
4255 * Pulled from:
4256 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4257 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004258message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004259 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004260
4261 optional int64 rx_bytes = 2;
4262
4263 optional int64 rx_packets = 3;
4264
4265 optional int64 tx_bytes = 4;
4266
4267 optional int64 tx_packets = 5;
4268}
4269
4270/**
4271 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4272 *
4273 * Pulled from:
4274 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4275 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004276message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004277 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004278
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004279 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4280 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004281
4282 optional int64 rx_bytes = 3;
4283
4284 optional int64 rx_packets = 4;
4285
4286 optional int64 tx_bytes = 5;
4287
4288 optional int64 tx_packets = 6;
4289}
4290
4291/**
4292 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4293 *
4294 * Pulled from:
4295 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4296 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004297message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004298 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004299
4300 optional int64 rx_bytes = 2;
4301
4302 optional int64 rx_packets = 3;
4303
4304 optional int64 tx_bytes = 4;
4305
4306 optional int64 tx_packets = 5;
4307}
4308
4309/**
4310 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4311 *
4312 * Pulled from:
4313 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4314 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004315message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004316 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004317
Yao Chenc40a19d2018-03-15 16:48:25 -07004318 // 1 denotes foreground and 0 denotes background. This is called Set in
4319 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004320 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004321
4322 optional int64 rx_bytes = 3;
4323
4324 optional int64 rx_packets = 4;
4325
4326 optional int64 tx_bytes = 5;
4327
4328 optional int64 tx_packets = 6;
4329}
4330
4331/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004332 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4333 *
4334 * Pulled from:
4335 * StatsCompanionService
4336 */
4337message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004338 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004339
4340 optional int64 rx_bytes = 2;
4341
4342 optional int64 tx_bytes = 3;
4343}
4344
4345/**
David Chenc8a43242017-10-17 16:23:28 -07004346 * Pulls the kernel wakelock durations. This atom is adapted from
4347 * android/internal/os/KernelWakelockStats.java
4348 *
4349 * Pulled from:
4350 * StatsCompanionService using KernelWakelockReader.
4351 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004352message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004353 optional string name = 1;
4354
4355 optional int32 count = 2;
4356
4357 optional int32 version = 3;
4358
Yangster-maca8a30442018-10-13 23:46:34 -07004359 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004360}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004361
Chenjie Yu05013b32017-11-21 10:21:41 -08004362/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004363 * Pulls low power state information. If power.stats HAL is not available, this
4364 * includes platform and subsystem sleep state information,
4365 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4366 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004367 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004368 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004369 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4370 * as defined in:
4371 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004372 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004373message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004374 // Subsystem name
4375 optional string subsystem_name = 1;
4376 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4377 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004378 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4379 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004380 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004381 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004382 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004383 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004384 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004385}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004386
Chenjie Yu05013b32017-11-21 10:21:41 -08004387/**
Bookatz92da2832018-11-01 18:10:03 -07004388 * Pulls on-device power measurement information.
4389 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4390 * Pulled from:
4391 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4392 */
4393message OnDevicePowerMeasurement {
4394 // Name of the subsystem (to which the rail belongs).
4395 optional string subsystem_name = 1;
4396
4397 // Rail name. The rail lies within the subsystem.
4398 optional string rail_name = 2;
4399
4400 // Time (in ms since boot) at which the rail energy value was measured.
4401 // This may differ slightly from the time that statsd logs this information.
4402 optional uint64 measurement_timestamp_millis = 3;
4403
4404 // Accumulated energy used via the rail since device boot in uWs.
4405 optional uint64 energy_microwatt_secs = 4;
4406}
4407
4408/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004409 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004410 * Pulls the time the cpu spend on the frequency index. Frequency index
4411 * starts from highest to lowest. The value should be monotonically
4412 * increasing since boot. However, if there is a cpu
4413 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004414 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004415message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004416 optional uint32 cluster = 1;
4417 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004418 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004419}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004420
Chenjie Yu05013b32017-11-21 10:21:41 -08004421/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004422 * Pulls Cpu Time Per Uid.
4423 * Note that isolated process uid time should be attributed to host uids.
4424 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004425message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004426 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004427 optional uint64 user_time_micros = 2;
4428 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004429}
4430
4431/**
4432 * Pulls Cpu Time Per Uid per frequency.
4433 * Note that isolated process uid time should be attributed to host uids.
4434 * For each uid, we order the time by descending frequencies.
4435 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004436message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004437 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004438 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004439 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004440}
Hugo Benichi884970e2017-11-14 22:42:46 +09004441
Chenjie Yu05013b32017-11-21 10:21:41 -08004442/**
4443 * Pulls Wifi Controller Activity Energy Info
4444 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004445message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004446 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004447 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004448 // stack reported state
4449 // TODO: replace this with proto enum
4450 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004451 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004452 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004453 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004454 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004455 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004456 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004457 // product of current(mA), voltage(V) and time(ms)
4458 optional uint64 controller_energy_used = 6;
4459}
4460
4461/**
4462 * Pulls Modem Activity Energy Info
4463 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004464message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004465 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004466 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004467 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004468 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004469 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004470 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004471 /**
4472 * Tx power index
4473 * index 0 = tx_power < 0dBm
4474 * index 1 = 0dBm < tx_power < 5dBm
4475 * index 2 = 5dBm < tx_power < 15dBm
4476 * index 3 = 15dBm < tx_power < 20dBm
4477 * index 4 = tx_power > 20dBm
4478 */
4479 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004480 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004481 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004482 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004483 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004484 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004485 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004486 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004487 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004488 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004489 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004490 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004491 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004492 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004493}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004494
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004495/**
4496 * Pulls Bluetooth Activity Energy Info
4497 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4498 */
4499message BluetoothActivityInfo {
4500 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004501 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004502 // bluetooth stack state
4503 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004504 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004505 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004506 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004507 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004508 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004509 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004510 // product of current(mA), voltage(V) and time(ms)
4511 optional uint64 energy_used = 6;
4512}
4513
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004514/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004515 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004516 *
4517 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004518 */
4519message ProcessMemoryState {
4520 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004521 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004522
4523 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004524 // Usually package name, "system" for system server.
4525 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004526 optional string process_name = 2;
4527
Rafal Slawikda51b932018-12-13 16:31:33 +00004528 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004529 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004530
4531 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004532 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004533
4534 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004535 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004536
Rajeev Kumar90235992018-01-29 11:06:48 -08004537 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004538 // Value is read from memory.stat, field total_rss if per-app memory
4539 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004540 optional int64 rss_in_bytes = 6;
4541
4542 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004543 // Value is read from memory.stat, field total_cache if per-app memory
4544 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004545 optional int64 cache_in_bytes = 7;
4546
4547 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004548 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004549 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004550 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004551
Rafal Slawik203c3db2019-09-25 19:53:01 +01004552 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004553 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004554
Rafal Slawik203c3db2019-09-25 19:53:01 +01004555 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4556 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004557
Rafal Slawik203c3db2019-09-25 19:53:01 +01004558 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4559 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004560}
4561
4562/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004563 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004564 *
4565 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4566 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004567 *
4568 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004569 */
4570message ProcessMemoryHighWaterMark {
4571 // The uid if available. -1 means not available.
4572 optional int32 uid = 1 [(is_uid) = true];
4573
Rafal Slawikda51b932018-12-13 16:31:33 +00004574 // The process name.
4575 // Usually package name or process cmdline.
4576 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004577 optional string process_name = 2;
4578
Rafal Slawik239b6802019-09-09 18:46:01 +01004579 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4580 // computed by converting kilobytes to bytes.
4581 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4582
Rafal Slawik3bea8952018-11-15 12:39:33 +00004583 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4584 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004585 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004586}
4587
4588/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004589 * Logs the memory stats for a process.
4590 *
4591 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4592 * and for selected native processes.
4593 */
4594message ProcessMemorySnapshot {
4595 // The uid if available. -1 means not available.
4596 optional int32 uid = 1 [(is_uid) = true];
4597
4598 // The process name.
4599 // Usually package name or process cmdline.
4600 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4601 optional string process_name = 2;
4602
4603 // The pid of the process.
4604 // Allows to disambiguate instances of the process.
4605 optional int32 pid = 3;
4606
4607 // The current OOM score adjustment value.
4608 // Read from ProcessRecord for managed processes.
4609 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4610 optional int32 oom_score_adj = 4;
4611
4612 // The current RSS of the process.
4613 // VmRSS from /proc/pid/status.
4614 optional int32 rss_in_kilobytes = 5;
4615
4616 // The current anon RSS of the process.
4617 // RssAnon from /proc/pid/status.
4618 optional int32 anon_rss_in_kilobytes = 6;
4619
4620 // The current swap size of the process.
4621 // VmSwap from /proc/pid/status.
4622 optional int32 swap_in_kilobytes = 7;
4623
4624 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4625 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4626}
4627
4628/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004629 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004630 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004631message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004632 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004633}
4634
4635/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004636 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004637 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004638message SystemUptime {
4639 // Milliseconds since the system was booted.
4640 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4641 // for external input).
4642 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004643 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004644}
4645
4646/*
4647 * Reads from /proc/uid_concurrent_active_time which has the format:
4648 * active: X (X is # cores)
4649 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4650 * [uid1]: [time-0] [time-1] [time-2] ... ...
4651 * ...
4652 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4653 * The file contains a monotonically increasing count of time for a single boot.
4654 */
4655message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004656 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004657 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004658}
4659
4660/**
4661 * Reads from /proc/uid_concurrent_policy_time which has the format:
4662 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4663 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4664 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4665 * ...
4666 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4667 * The file contains a monotonically increasing count of time for a single boot.
4668 */
4669message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004670 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004671 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004672 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004673}
4674
4675/*
4676 * Pulls free disk space, for data, system partition and temporary directory.
4677 */
4678message DiskSpace {
4679 // available bytes in data partition
4680 optional uint64 data_available_bytes = 1;
4681 // available bytes in system partition
4682 optional uint64 system_available_bytes = 2;
4683 // available bytes in download cache or temp directories
4684 optional uint64 temp_available_bytes = 3;
4685}
Tej Singhbf972d92018-01-10 20:51:13 -08004686
4687/**
4688 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004689 *
4690 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004691 */
4692message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004693 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004694}
4695
4696/**
4697 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004698 * Pulled from:
4699 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004700 */
4701message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004702 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004703}
4704
4705/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004706 * Pulls battery voltage.
4707 * Pulled from:
4708 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4709 */
4710message BatteryVoltage {
4711 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004712 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004713}
4714
4715/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004716 * Pulls battery level (percent full, from 0 to 100).
4717 *
4718 * Pulled from:
4719 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4720 */
4721message BatteryLevel {
4722 // Battery level. Should be in [0, 100].
4723 optional int32 battery_level = 1;
4724}
4725
4726/**
Tej Singhd89137e2018-03-26 14:51:40 -07004727 * Pulls the temperature of various parts of the device.
4728 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004729 *
Maggie White442b6312019-04-05 16:26:44 -07004730 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004731 */
4732message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004733 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004734 optional android.os.TemperatureTypeEnum sensor_location = 1;
4735
4736 // The name of the temperature source. Eg. CPU0
4737 optional string sensor_name = 2;
4738
Tej Singhd89137e2018-03-26 14:51:40 -07004739 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004740 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004741 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004742
4743 // Relative severity of the throttling, see enum definition.
4744 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004745}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004746
4747/**
4748 * Pulls the statistics of calls to Binder.
4749 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004750 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4751 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004752 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004753 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004754 */
4755message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004756 // UID of the process responsible for the binder transaction. It will be set if the process
4757 // executing the binder transaction attribute the transaction to another uid using
4758 // Binder.setThreadWorkSource().
4759 //
4760 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004761 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004762 // UID of the process executing the binder transaction.
4763 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004764 // Fully qualified class name of the API call.
4765 //
4766 // This is a system server class name.
4767 //
4768 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4769 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4770 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4771 // commonly used APIs.
4772 optional string service_class_name = 2;
4773 // Method name of the API call. It can also be a transaction code if we cannot
4774 // resolve it to a name. See Binder#getTransactionName.
4775 //
4776 // This is a system server method name.
4777 optional string service_method_name = 3;
4778 // Total number of API calls.
4779 optional int64 call_count = 4;
4780 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4781 optional bool screen_interactive = 13;
4782 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4783 // call_count will be equal to recorded_call_count.
4784 //
4785 // If recorded_call_count is different than call_count, it means data collection has been
4786 // sampled. All the fields below will be sampled in this case.
4787 optional int64 recorded_call_count = 12;
4788 // Number of exceptions thrown by the API.
4789 optional int64 recorded_exception_count = 5;
4790 // Total latency of all API calls.
4791 // Average can be computed using total_latency_micros / recorded_call_count.
4792 optional int64 recorded_total_latency_micros = 6;
4793 // Maximum latency of one API call.
4794 optional int64 recorded_max_latency_micros = 7;
4795 // Total CPU usage of all API calls.
4796 // Average can be computed using total_cpu_micros / recorded_call_count.
4797 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4798 optional int64 recorded_total_cpu_micros = 8;
4799 // Maximum CPU usage of one API call.
4800 optional int64 recorded_max_cpu_micros = 9;
4801 // Maximum parcel reply size of one API call.
4802 optional int64 recorded_max_reply_size_bytes = 10;
4803 // Maximum parcel request size of one API call.
4804 optional int64 recorded_max_request_size_bytes = 11;
4805}
4806
4807/**
4808 * Pulls the statistics of exceptions during calls to Binder.
4809 *
4810 * Binder stats are cumulative from boot unless somebody reset the data using
4811 * > adb shell dumpsys binder_calls_stats --reset
4812 */
4813message BinderCallsExceptions {
4814 // Exception class name, e.g. java.lang.IllegalArgumentException.
4815 //
4816 // This is an exception class name thrown by the system server.
4817 optional string exception_class_name = 1;
4818 // Total number of exceptions.
4819 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004820}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004821
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004822/**
4823 * Pulls the statistics of message dispatching on HandlerThreads.
4824 *
4825 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4826 * config on the device.
4827 *
4828 * Next tag: 11
4829 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004830message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004831 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004832 optional int32 uid = 1 [(is_uid) = true];
4833
4834 // Fully qualified class name of the handler target class.
4835 //
4836 // This field does not contain PII. This is a system server class name.
4837 optional string handler_class_name = 2;
4838
4839 // The name of the thread that runs the Looper.
4840 //
4841 // This field does not contain PII. This is a system server thread name.
4842 optional string looper_thread_name = 3;
4843
4844 // The name of the dispatched message.
4845 //
4846 // This field does not contain PII. This is a system server constant or class
4847 // name.
4848 optional string message_name = 4;
4849
4850 // Total number of successfully dispatched messages.
4851 optional int64 message_count = 5;
4852
4853 // Total number of messages that failed dispatching.
4854 optional int64 exception_count = 6;
4855
4856 // Total number of processed messages we have data recorded for. If we
4857 // collected data for all the messages, message_count will be equal to
4858 // recorded_message_count.
4859 //
4860 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004861 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004862 optional int64 recorded_message_count = 7;
4863
4864 // Total latency of all processed messages.
4865 // Average can be computed using recorded_total_latency_micros /
4866 // recorded_message_count.
4867 optional int64 recorded_total_latency_micros = 8;
4868
4869 // Total CPU usage of all processed message.
4870 // Average can be computed using recorded_total_cpu_micros /
4871 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004872 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004873 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004874
4875 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4876 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004877
4878 // Max recorded CPU usage of all processed messages.
4879 optional int64 recorded_max_cpu_micros = 11;
4880
4881 // Max recorded latency of all processed messages.
4882 optional int64 recorded_max_latency_micros = 12;
4883
4884 // Total number of messages we tracked the dispatching delay for. If we
4885 // collected data for all the messages, message_count will be equal to
4886 // recorded_delay_message_count.
4887 //
4888 // If recorded_delay_message_count is different than message_count, it means data
4889 // collection has been sampled or/and not all messages specified the target dispatch time.
4890 // The fields below will be sampled in this case.
4891 optional int64 recorded_delay_message_count = 13;
4892
4893 // Total dispatching delay of all processed messages.
4894 // Calculated as a difference between the target dispatching time (Message.when)
4895 // and the actual dispatching time.
4896 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4897 optional int64 recorded_total_delay_millis = 14;
4898
4899 // Max dispatching delay of all processed messages.
4900 // Calculated as a difference between the target dispatching time (Message.when)
4901 // and the actual dispatching time.
4902 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004903}
Tej Singh86dc9db2018-09-06 00:39:57 +00004904
4905/**
4906 * Pulls disk information, such as write speed and latency.
4907 */
4908message DiskStats {
4909 // Time taken to open, write 512B to, and close a file.
4910 // -1 if error performing the check.
4911 optional int64 data_write_latency_millis = 1;
4912
4913 optional bool file_based_encryption = 2;
4914
4915 // Recent disk write speed in kB/s.
4916 // -1 if error querying storageed.
4917 // 0 if data is unavailable.
4918 optional int32 recent_disk_write_speed = 3;
4919}
4920
4921
4922/**
4923 * Free and total bytes of the Data, Cache, and System partition.
4924 */
4925message DirectoryUsage {
4926 enum Directory {
4927 UNKNOWN = 0;
4928 DATA = 1;
4929 CACHE = 2;
4930 SYSTEM = 3;
4931 }
4932 optional Directory directory = 1;
4933 optional int64 free_bytes = 2;
4934 optional int64 total_bytes = 3;
4935}
4936
4937
4938/**
4939 * Size of an application: apk size, data size, and cache size.
4940 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4941 * Information is only reported for apps with the primary user (user 0).
4942 * Sizes are aggregated by package name.
4943 */
4944message AppSize {
4945 // Including uids will involve modifying diskstats logic.
4946 optional string package_name = 1;
4947 // App size in bytes. -1 if unavailable.
4948 optional int64 app_size_bytes = 2;
4949 // App data size in bytes. -1 if unavailable.
4950 optional int64 app_data_size_bytes = 3;
4951 // App cache size in bytes. -1 if unavailable.
4952 optional int64 app_cache_size_bytes = 4;
4953 // Time that the cache file was produced.
4954 // Uses System.currentTimeMillis(), which is wall clock time.
4955 optional int64 cache_time_millis = 5;
4956}
4957
4958
4959/**
4960 * Size of a particular category. Eg: photos, videos.
4961 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4962 */
4963message CategorySize {
4964 enum Category {
4965 UNKNOWN = 0;
4966 APP_SIZE = 1;
4967 APP_DATA_SIZE = 2;
4968 APP_CACHE_SIZE = 3;
4969 PHOTOS = 4;
4970 VIDEOS = 5;
4971 AUDIO = 6;
4972 DOWNLOADS = 7;
4973 SYSTEM = 8;
4974 OTHER = 9;
4975 }
4976 optional Category category = 1;
4977 // Category size in bytes.
4978 optional int64 size_bytes = 2;
4979 // Time that the cache file was produced.
4980 // Uses System.currentTimeMillis(), which is wall clock time.
4981 optional int64 cache_time_millis = 3;
4982}
Tej Singhd6d6d772018-09-05 17:41:25 -07004983
4984/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004985 * Pulls per uid I/O stats. The stats are cumulative since boot.
4986 *
4987 * Read/write bytes are I/O events from a storage device
4988 * Read/write chars are data requested by read/write syscalls, and can be
4989 * satisfied by caching.
4990 *
4991 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4992 */
4993message DiskIo {
4994 optional int32 uid = 1 [(is_uid) = true];
4995 optional int64 fg_chars_read = 2;
4996 optional int64 fg_chars_write = 3;
4997 optional int64 fg_bytes_read = 4;
4998 optional int64 fg_bytes_write = 5;
4999 optional int64 bg_chars_read = 6;
5000 optional int64 bg_chars_write = 7;
5001 optional int64 bg_bytes_read = 8;
5002 optional int64 bg_bytes_write = 9;
5003 optional int64 fg_fsync = 10;
5004 optional int64 bg_fsync= 11;
5005}
5006
5007
5008/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005009 * Pulls the number of fingerprints for each user.
5010 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005011 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005012 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005013message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005014 // The associated user. Eg: 0 for owners, 10+ for others.
5015 // Defined in android/os/UserHandle.java
5016 optional int32 user = 1;
5017 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005018 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005019}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005020
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005021/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005022 * Pulls the number of faces for each user.
5023 *
5024 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5025 */
5026message NumFacesEnrolled {
5027 // The associated user. Eg: 0 for owners, 10+ for others.
5028 // Defined in android/os/UserHandle.java
5029 optional int32 user = 1;
5030 // Number of faces registered to that user.
5031 optional int32 num_faces_enrolled = 2;
5032}
5033/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005034 * A mapping of role holder -> role
5035 */
5036message RoleHolder {
5037 // uid of the role holder
5038 optional int32 uid = 1 [(is_uid) = true];
5039
5040 // package name of the role holder
5041 optional string package_name = 2;
5042
5043 // the role held
5044 optional string role = 3;
5045}
5046
Yangsteraf9aee72018-10-12 09:26:16 -07005047message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005048 // These are all in byte resolution.
5049 optional int64 min = 1 [deprecated = true];
5050 optional int64 average = 2 [deprecated = true];
5051 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005052
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005053 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5054 // int64 fields.
5055 optional int32 mean_kb = 4;
5056 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005057}
5058
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005059// A reduced subset of process states; reducing the number of possible states allows more
5060// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5061enum ProcessStateAggregated {
5062 PROCESS_STATE_UNKNOWN = 0;
5063 // Persistent system process.
5064 PROCESS_STATE_PERSISTENT = 1;
5065 // Top activity; actually any visible activity.
5066 PROCESS_STATE_TOP = 2;
5067 // Process binding to top or a foreground service.
5068 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5069 // Processing running a foreground service.
5070 PROCESS_STATE_FGS = 4;
5071 // Important foreground process (ime, wallpaper, etc).
5072 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5073 // Important background process.
5074 PROCESS_STATE_BACKGROUND = 6;
5075 // Process running a receiver.
5076 PROCESS_STATE_RECEIVER = 7;
5077 // All kinds of cached processes.
5078 PROCESS_STATE_CACHED = 8;
5079}
5080
5081// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005082message ProcessStatsStateProto {
5083 optional android.service.procstats.ScreenState screen_state = 1;
5084
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005085 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005086
5087 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5088 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005089 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5090
5091 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005092
5093 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005094 optional int64 duration_millis = 4 [deprecated = true];
5095 // Same as above, but with minute resolution so it fits into an int32.
5096 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005097
5098 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005099 optional int64 realtime_duration_millis = 9 [deprecated = true];
5100 // Same as above, but with minute resolution so it fits into an int32.
5101 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005102
5103 // # of samples taken
5104 optional int32 sample_size = 5;
5105
5106 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005107 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005108
5109 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005110 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005111
5112 // RSS is memory resident for this process
5113 optional AggStats rss = 8;
5114}
5115
5116// Next Tag: 7
5117message ProcessStatsProto {
5118 // Name of process.
5119 optional string process = 1;
5120
5121 // Uid of the process.
5122 optional int32 uid = 2;
5123
5124 // Information about how often kills occurred
5125 message Kill {
5126 // Count of excessive CPU kills
5127 optional int32 cpu = 1;
5128
5129 // Count of kills when cached
5130 optional int32 cached = 2;
5131
5132 // PSS stats during cached kill
5133 optional AggStats cached_pss = 3;
5134 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005135 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005136
5137 // Time and memory spent in various states.
5138 repeated ProcessStatsStateProto states = 5;
5139
5140 // Total time process has been running... screen_state, memory_state, and process_state
5141 // will not be set.
5142 optional ProcessStatsStateProto total_running_state = 6;
5143}
5144
5145message PackageServiceOperationStatsProto {
5146 // Operate enum: Started, Foreground, Bound, Executing
5147 optional android.service.procstats.ServiceOperationState operation = 1;
5148
5149 // Number of times the service was in this operation.
5150 optional int32 count = 2;
5151
5152 // Information about a state the service can be in.
5153 message StateStats {
5154 // Screen state enum.
5155 optional android.service.procstats.ScreenState screen_state = 1;
5156 // Memory state enum.
5157 optional android.service.procstats.MemoryState memory_state = 2;
5158
5159 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005160 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005161 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005162 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005163 }
5164 repeated StateStats state_stats = 3;
5165}
5166
5167message PackageServiceStatsProto {
5168 // Name of service component.
5169 optional string service_name = 1;
5170
5171 // The operation stats.
5172 // The package_name, package_uid, package_version, service_name will not be set to save space.
5173 repeated PackageServiceOperationStatsProto operation_stats = 2;
5174}
5175
5176message PackageAssociationSourceProcessStatsProto {
5177 // Uid of the process.
5178 optional int32 process_uid = 1;
5179 // Process name.
5180 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005181 // Package name.
5182 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005183 // Total count of the times this association appeared.
5184 optional int32 total_count = 3;
5185
5186 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005187 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005188
5189 // Total count of the times this association became actively impacting its target process.
5190 optional int32 active_count = 5;
5191
5192 // Information on one source in this association.
5193 message StateStats {
5194 // Process state enum.
5195 optional android.service.procstats.ProcessState process_state = 1;
5196 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005197 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005198 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005199 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005200 }
5201 repeated StateStats active_state_stats = 6;
5202}
5203
5204message PackageAssociationProcessStatsProto {
5205 // Name of the target component.
5206 optional string component_name = 1;
5207 // Information on one source in this association.
5208 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5209}
5210
5211
5212message ProcessStatsPackageProto {
5213 // Name of package.
5214 optional string package = 1;
5215
5216 // Uid of the package.
5217 optional int32 uid = 2;
5218
5219 // Version of the package.
5220 optional int64 version = 3;
5221
5222 // Stats for each process running with the package loaded in to it.
5223 repeated ProcessStatsProto process_stats = 4;
5224
5225 // Stats for each of the package's services.
5226 repeated PackageServiceStatsProto service_stats = 5;
5227
5228 // Stats for each association with the package.
5229 repeated PackageAssociationProcessStatsProto association_stats = 6;
5230}
5231
5232message ProcessStatsSectionProto {
5233 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005234 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005235
5236 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005237 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005238
5239 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005240 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005241
5242 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005243 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005244
5245 // System runtime library. e.g. "libdvm.so", "libart.so".
5246 optional string runtime = 5;
5247
5248 // whether kernel reports swapped pss.
5249 optional bool has_swapped_pss = 6;
5250
5251 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5252 enum Status {
5253 STATUS_UNKNOWN = 0;
5254 STATUS_COMPLETE = 1;
5255 STATUS_PARTIAL = 2;
5256 STATUS_SHUTDOWN = 3;
5257 STATUS_SYSPROPS = 4;
5258 }
5259 repeated Status status = 7;
5260
Chenjie Yub2ecc792019-01-17 10:27:26 -08005261 // Number of pages available of various types and sizes, representation fragmentation.
5262 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5263
Yangsteraf9aee72018-10-12 09:26:16 -07005264 // Stats for each process.
5265 repeated ProcessStatsProto process_stats = 8;
5266
5267 // Stats for each package.
5268 repeated ProcessStatsPackageProto package_stats = 9;
5269}
5270
Chenjie Yub2ecc792019-01-17 10:27:26 -08005271message ProcessStatsAvailablePagesProto {
5272 // Node these pages are in (as per /proc/pagetypeinfo)
5273 optional int32 node = 1;
5274
5275 // Zone these pages are in (as per /proc/pagetypeinfo)
5276 optional string zone = 2;
5277
5278 // Label for the type of these pages (as per /proc/pagetypeinfo)
5279 optional string label = 3;
5280
5281 // Distribution of number of pages available by order size. First entry in array is
5282 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5283 repeated int32 pages_per_order = 4;
5284}
5285
Chenjie Yu12e5e672018-09-14 15:54:59 -07005286/**
5287 * Pulled from ProcessStatsService.java
5288 */
5289message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005290 optional ProcessStatsSectionProto proc_stats_section = 1;
5291}
5292
Chenjie Yuf910b7802019-01-11 16:08:20 -08005293/**
5294 * Pulled from ProcessStatsService.java
5295 */
5296message ProcStatsPkgProc {
5297 optional ProcessStatsSectionProto proc_stats_section = 1;
5298}
5299
Chris Wrencdea3b72019-11-22 16:58:17 -05005300// Next Tag: 2
5301message PackageRemoteViewInfoProto {
5302 optional string package_name = 1;
5303 // add per-package additional info here (like channels)
5304}
5305
5306// Next Tag: 2
5307message NotificationRemoteViewsProto {
5308 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5309}
5310
5311/**
5312 * Pulled from NotificationManagerService.java
5313 */
5314message NotificationRemoteViews {
5315 optional NotificationRemoteViewsProto notification_remote_views = 1;
5316}
5317
Yangsteraf9aee72018-10-12 09:26:16 -07005318message PowerProfileProto {
5319 optional double cpu_suspend = 1;
5320
5321 optional double cpu_idle = 2;
5322
5323 optional double cpu_active = 3;
5324
5325 message CpuCluster {
5326 optional int32 id = 1;
5327 optional double cluster_power = 2;
5328 optional int32 cores = 3;
5329 repeated int64 speed = 4;
5330 repeated double core_power = 5;
5331 }
5332
5333 repeated CpuCluster cpu_cluster = 40;
5334
5335 optional double wifi_scan = 4;
5336
5337 optional double wifi_on = 5;
5338
5339 optional double wifi_active = 6;
5340
5341 optional double wifi_controller_idle = 7;
5342
5343 optional double wifi_controller_rx = 8;
5344
5345 optional double wifi_controller_tx = 9;
5346
5347 repeated double wifi_controller_tx_levels = 10;
5348
5349 optional double wifi_controller_operating_voltage = 11;
5350
5351 optional double bluetooth_controller_idle = 12;
5352
5353 optional double bluetooth_controller_rx = 13;
5354
5355 optional double bluetooth_controller_tx = 14;
5356
5357 optional double bluetooth_controller_operating_voltage = 15;
5358
5359 optional double modem_controller_sleep = 16;
5360
5361 optional double modem_controller_idle = 17;
5362
5363 optional double modem_controller_rx = 18;
5364
5365 repeated double modem_controller_tx = 19;
5366
5367 optional double modem_controller_operating_voltage = 20;
5368
5369 optional double gps_on = 21;
5370
5371 repeated double gps_signal_quality_based = 22;
5372
5373 optional double gps_operating_voltage = 23;
5374
5375 optional double bluetooth_on = 24;
5376
5377 optional double bluetooth_active = 25;
5378
5379 optional double bluetooth_at_cmd = 26;
5380
5381 optional double ambient_display = 27;
5382
5383 optional double screen_on = 28;
5384
5385 optional double radio_on = 29;
5386
5387 optional double radio_scanning = 30;
5388
5389 optional double radio_active = 31;
5390
5391 optional double screen_full = 32;
5392
5393 optional double audio = 33;
5394
5395 optional double video = 34;
5396
5397 optional double flashlight = 35;
5398
5399 optional double memory = 36;
5400
5401 optional double camera = 37;
5402
5403 optional double wifi_batched_scan = 38;
5404
5405 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005406}
Chenjie Yuab530202018-09-26 12:39:20 -07005407
5408/**
5409 * power_profile.xml and other constants for power model calculations.
5410 * Pulled from PowerProfile.java
5411 */
5412message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005413 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005414}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005415
5416/**
arangelovd5db50e2018-10-12 20:24:39 +01005417 * Logs when a user restriction was added or removed.
5418 *
5419 * Logged from:
5420 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5421 */
5422message UserRestrictionChanged {
5423 // The raw string of the user restriction as defined in UserManager.
5424 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5425 optional string restriction = 1;
5426 // Whether the restriction is enabled or disabled.
5427 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005428}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005429
5430/**
5431 * Pulls process user time and system time. Puller takes a snapshot of all pids
5432 * in the system and returns cpu stats for those that are working at the time.
5433 * Dead pids will be dropped. Kernel processes are excluded.
5434 * Min cool-down is 5 sec.
5435 */
5436message ProcessCpuTime {
5437 optional int32 uid = 1 [(is_uid) = true];
5438
5439 optional string process_name = 2;
5440 // Process cpu time in user space, cumulative from boot/process start
5441 optional int64 user_time_millis = 3;
5442 // Process cpu time in system space, cumulative from boot/process start
5443 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005444}
Misha Wagner5a51e002018-10-03 15:04:09 +01005445
5446/**
5447 * Pulls the CPU usage for each thread.
5448 *
5449 * Read from /proc/$PID/task/$TID/time_in_state files.
5450 *
5451 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5452 * time_in_state files not being present on some phones, have not been addressed. These should be
5453 * considered before a public release.
5454 */
5455message CpuTimePerThreadFreq {
5456 // UID that owns the process.
5457 optional int32 uid = 1 [(is_uid) = true];
5458 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005459 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005460 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005461 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005462 // Name of the process taken from `/proc/$PID/cmdline`.
5463 optional string process_name = 4;
5464 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5465 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005466
5467 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5468 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5469 // frequencies are given here as the alternative is sending eight separate atoms. This method
5470 // significantly reduces the amount of data created
5471 optional int32 frequency1_khz = 6;
5472 optional int32 time1_millis = 7;
5473 optional int32 frequency2_khz = 8;
5474 optional int32 time2_millis = 9;
5475 optional int32 frequency3_khz = 10;
5476 optional int32 time3_millis = 11;
5477 optional int32 frequency4_khz = 12;
5478 optional int32 time4_millis = 13;
5479 optional int32 frequency5_khz = 14;
5480 optional int32 time5_millis = 15;
5481 optional int32 frequency6_khz = 16;
5482 optional int32 time6_millis = 17;
5483 optional int32 frequency7_khz = 18;
5484 optional int32 time7_millis = 19;
5485 optional int32 frequency8_khz = 20;
5486 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005487}
Bookatz75ee60422018-11-09 12:27:37 -08005488
5489/**
Bookatz366a4432018-11-20 09:42:33 -08005490 * Pulls information about the device's build.
5491 */
5492message BuildInformation {
5493 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5494 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5495 optional string fingerprint = 1;
5496
5497 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5498 optional string brand = 2;
5499
5500 // Build.PRODUCT. The name of the overall product.
5501 optional string product = 3;
5502
5503 // Build.DEVICE. The name of the industrial design.
5504 optional string device = 4;
5505
5506 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5507 optional string version_release = 5;
5508
5509 // Build.ID. E.g. a label like "M4-rc20".
5510 optional string id = 6;
5511
5512 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5513 // represent this build.
5514 optional string version_incremental = 7;
5515
5516 // Build.TYPE. The type of build, like "user" or "eng".
5517 optional string type = 8;
5518
5519 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5520 optional string tags = 9;
5521}
5522
5523/**
Adam He420947c2019-01-23 15:59:09 -08005524 * Logs information about mismatched caller for content capture.
5525 *
5526 * Logged from:
5527 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5528 */
5529message ContentCaptureCallerMismatchReported {
5530 optional string intended_package = 1;
5531 optional string calling_package = 2;
5532}
5533
5534/**
5535 * Logs information about content capture service events.
5536 *
5537 * Logged from:
5538 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5539 */
5540message ContentCaptureServiceEvents {
5541 // The type of event.
5542 enum Event {
5543 UNKNOWN = 0;
5544 ON_CONNECTED = 1;
5545 ON_DISCONNECTED = 2;
5546 SET_WHITELIST = 3;
5547 SET_DISABLED = 4;
5548 ON_USER_DATA_REMOVED = 5;
5549 }
5550 optional Event event = 1;
5551 // component/package of content capture service.
5552 optional string service_info = 2;
5553 // component/package of target.
5554 // it's a concatenated list of component/package for SET_WHITELIST event
5555 // separated by " ".
5556 optional string target_info = 3;
5557}
5558
5559/**
5560 * Logs information about content capture session events.
5561 *
5562 * Logged from:
5563 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5564 */
5565message ContentCaptureSessionEvents {
5566 // The type of event.
5567 enum Event {
5568 UNKNOWN = 0;
5569 ON_SESSION_STARTED = 1;
5570 ON_SESSION_FINISHED = 2;
5571 SESSION_NOT_CREATED = 3;
5572 }
5573 optional int32 session_id = 1;
5574 optional Event event = 2;
5575 // (n/a on session finished)
5576 optional int32 state_flags = 3;
5577 // component/package of content capture service.
5578 optional string service_info = 4;
5579 // component/package of app.
5580 // (n/a on session finished)
5581 optional string app_info = 5;
5582 optional bool is_child_session = 6;
5583}
5584
5585/**
5586 * Logs information about session being flushed.
5587 *
5588 * Logged from:
5589 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5590 */
5591message ContentCaptureFlushed {
5592 optional int32 session_id = 1;
5593 // component/package of content capture service.
5594 optional string service_info = 2;
5595 // component/package of app.
5596 optional string app_info = 3;
5597 // session start/finish events
5598 optional int32 child_session_started = 4;
5599 optional int32 child_session_finished = 5;
5600 // count of view events.
5601 optional int32 view_appeared_count = 6;
5602 optional int32 view_disappeared_count = 7;
5603 optional int32 view_text_changed_count = 8;
5604
5605 // Flush stats.
5606 optional int32 max_events = 9;
5607 optional int32 idle_flush_freq = 10;
5608 optional int32 text_flush_freq = 11;
5609 optional int32 flush_reason = 12;
5610}
5611
5612/**
Bookatz75ee60422018-11-09 12:27:37 -08005613 * Pulls on-device BatteryStats power use calculations for the overall device.
5614 */
5615message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005616 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5617 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5618 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5619 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005620}
5621
5622/**
5623 * Pulls on-device BatteryStats power use calculations broken down by uid.
5624 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5625 * that is attributed to non-uid items. They must all be included to get the total power use.
5626 */
5627message DeviceCalculatedPowerBlameUid {
5628 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5629 optional int32 uid = 1 [(is_uid) = true];
5630
Bookatz3dbc13a2018-12-21 12:16:51 -08005631 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5632 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5633 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005634}
5635
5636/**
5637 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5638 * drain type.
5639 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5640 * is attributed uids. They must all be included to get the total power use.
5641 */
5642message DeviceCalculatedPowerBlameOther {
5643 // The type of item whose power use is being reported.
5644 enum DrainType {
5645 AMBIENT_DISPLAY = 0;
5646 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5647 BLUETOOTH = 2;
5648 CAMERA = 3;
5649 // Cell-standby
5650 CELL = 4;
5651 FLASHLIGHT = 5;
5652 IDLE = 6;
5653 MEMORY = 7;
5654 // Amount that total computed drain exceeded the drain estimated using the
5655 // battery level changes and capacity.
5656 OVERCOUNTED = 8;
5657 PHONE = 9;
5658 SCREEN = 10;
5659 // Amount that total computed drain was below the drain estimated using the
5660 // battery level changes and capacity.
5661 UNACCOUNTED = 11;
5662 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5663 WIFI = 13;
5664 }
5665 optional DrainType drain_type = 1;
5666
Bookatz3dbc13a2018-12-21 12:16:51 -08005667 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5668 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5669 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005670}
arangelov4e994062018-11-13 16:12:38 +00005671
5672/**
5673 * Logs device policy features.
5674 *
5675 * Logged from:
5676 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5677 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5678 */
5679message DevicePolicyEvent {
5680 // The event id - unique for each event.
5681 optional android.stats.devicepolicy.EventId event_id = 1;
5682 // The admin package name.
5683 optional string admin_package_name = 2;
5684 // A generic integer parameter.
5685 optional int32 integer_value = 3;
5686 // A generic boolean parameter.
5687 optional bool boolean_value = 4;
5688 // A parameter specifying a time period in milliseconds.
5689 optional uint64 time_period_millis = 5;
5690 // A parameter specifying a list of package names, bundle extras or string parameters.
5691 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5692}
shawnlinea5b66b2018-11-13 15:05:29 +08005693
5694/**
5695 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5696 *
5697 * Logged from:
5698 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5699 */
5700message DocsUILaunchReported {
5701 optional android.stats.docsui.LaunchAction launch_action = 1;
5702 optional bool has_initial_uri = 2;
5703 optional android.stats.docsui.MimeType mime_type = 3;
5704 optional android.stats.docsui.Root initial_root = 4;
5705}
5706
5707/**
5708 * Logs root/app visited event in file managers/picker. Call this when the user
5709 * taps on root/app in hamburger menu.
5710 *
5711 * Logged from:
5712 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5713 */
5714message DocsUIRootVisitedReported {
5715 optional android.stats.docsui.ContextScope scope = 1;
5716 optional android.stats.docsui.Root root = 2;
5717}
5718
5719/**
5720 * Logs file operation stats. Call this when a file operation has completed.
5721 *
5722 * Logged from:
5723 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5724 */
5725message DocsUIFileOperationReported {
5726 optional android.stats.docsui.Provider provider = 1;
5727 optional android.stats.docsui.FileOperation file_op = 2;
5728}
5729
5730/**
5731 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5732 * mode.
5733 *
5734 * Logged from:
5735 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5736 */
5737message DocsUIFileOperationCopyMoveModeReported {
5738 optional android.stats.docsui.FileOperation file_op = 1;
5739 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5740}
5741
5742
5743/**
5744 * Logs file sub operation stats. Call this when a file operation has failed.
5745 *
5746 * Logged from:
5747 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5748 */
5749message DocsUIFileOperationFailureReported {
5750 optional android.stats.docsui.Authority authority = 1;
5751 optional android.stats.docsui.SubFileOperation sub_op = 2;
5752}
5753
5754/**
5755* Logs the cancellation of a file operation. Call this when a job is canceled
5756*
5757* Logged from:
5758* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5759*/
5760message DocsUIFileOperationCanceledReported {
5761 optional android.stats.docsui.FileOperation file_op = 1;
5762}
5763
5764/**
5765 * Logs startup time in milliseconds.
5766 *
5767 * Logged from:
5768 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5769 */
5770message DocsUIStartupMsReported {
5771 optional int32 startup_millis = 1;
5772}
5773
5774/**
5775 * Logs the action that was started by user.
5776 *
5777 * Logged from:
5778 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5779 */
5780message DocsUIUserActionReported {
5781 optional android.stats.docsui.UserAction action = 1;
5782}
5783
5784/**
5785 * Logs the invalid type when invalid scoped access is requested.
5786 *
5787 * Logged from:
5788 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5789 */
5790message DocsUIInvalidScopedAccessRequestReported {
5791 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005792}
Ben Murdochbab399f62018-12-06 11:01:38 +00005793
5794/**
shawnlina75e82d2019-01-07 10:31:12 +08005795 * Logs the package name that launches docsui picker mode.
5796 *
5797 * Logged from:
5798 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5799 */
5800message DocsUIPickerLaunchedFromReported {
5801 optional string package_name = 1;
5802}
5803
5804/**
5805 * Logs the search type.
5806 *
5807 * Logged from:
5808 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5809 */
5810message DocsUISearchTypeReported {
5811 optional android.stats.docsui.SearchType search_type = 1;
5812}
5813
5814/**
5815 * Logs the search mode.
5816 *
5817 * Logged from:
5818 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5819 */
5820message DocsUISearchModeReported {
5821 optional android.stats.docsui.SearchMode search_mode = 1;
5822}
5823
5824/**
5825 * Logs the pick result information.
5826 *
5827 * Logged from:
5828 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5829 */
5830message DocsUIPickResultReported {
5831 optional int32 total_action_count = 1;
5832 optional int64 duration_millis = 2;
5833 optional int32 file_count= 3;
5834 optional bool is_searching = 4;
5835 optional android.stats.docsui.Root picked_from = 5;
5836 optional android.stats.docsui.MimeType mime_type = 6;
5837 optional int32 repeatedly_pick_times = 7;
5838}
5839
5840/**
Ben Murdochbab399f62018-12-06 11:01:38 +00005841 * Logs when an app's memory is compacted.
5842 *
5843 * Logged from:
5844 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5845 */
5846message AppCompacted {
5847 // The pid of the process being compacted.
5848 optional int32 pid = 1;
5849
5850 // The name of the process being compacted.
5851 optional string process_name = 2;
5852
5853 // The type of compaction.
5854 enum Action {
5855 UNKNOWN = 0;
5856 SOME = 1;
5857 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005858 PERSISTENT = 3;
5859 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00005860 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005861 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00005862
5863 // Total RSS in kilobytes consumed by the process prior to compaction.
5864 optional int64 before_rss_total_kilobytes = 4;
5865
5866 // File RSS in kilobytes consumed by the process prior to compaction.
5867 optional int64 before_rss_file_kilobytes = 5;
5868
5869 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5870 optional int64 before_rss_anon_kilobytes = 6;
5871
5872 // Swap in kilobytes consumed by the process prior to compaction.
5873 optional int64 before_swap_kilobytes = 7;
5874
5875 // Total RSS in kilobytes consumed by the process after compaction.
5876 optional int64 after_rss_total_kilobytes = 8;
5877
5878 // File RSS in kilobytes consumed by the process after compaction.
5879 optional int64 after_rss_file_kilobytes = 9;
5880
5881 // Anonymous RSS in kilobytes consumed by the process after compaction.
5882 optional int64 after_rss_anon_kilobytes = 10;
5883
5884 // Swap in kilobytes consumed by the process after compaction.
5885 optional int64 after_swap_kilobytes = 11;
5886
5887 // The time taken to perform compaction in milliseconds.
5888 optional int64 time_to_compact_millis = 12;
5889
5890 // The last compaction action performed for this app.
5891 optional Action last_action = 13;
5892
Ben Murdoch01720b82018-12-19 18:03:44 +00005893 // The last time that compaction was attempted on this process in milliseconds
5894 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5895 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00005896
Ben Murdoch885c21b2019-03-15 18:02:04 +00005897 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005898 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00005899
5900 // The process state at the time of compaction.
5901 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005902
5903 // Free ZRAM in kilobytes before compaction.
5904 optional int64 before_zram_free_kilobytes = 17;
5905
5906 // Free ZRAM in kilobytes after compaction.
5907 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00005908}
lifr157fc552018-12-12 16:38:04 +08005909
5910/**
lifrb6b90b62019-03-29 00:40:17 +08005911 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5912 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5913 *
lifr1f74b052019-04-16 22:16:30 +08005914 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5915 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5916 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5917 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005918 */
5919message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08005920 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005921
lifr1f74b052019-04-16 22:16:30 +08005922 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005923
5924 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005925 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005926
lifr1f74b052019-04-16 22:16:30 +08005927 // Only valid for event_type = EVENT_GETADDRINFO.
5928 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005929
lifr1f74b052019-04-16 22:16:30 +08005930 // Flags passed to android_res_nsend() defined in multinetwork.h
5931 // Only valid for event_type = EVENT_RESNSEND.
5932 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005933
lifrad9becc2019-05-20 11:04:41 +08005934 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005935
5936 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08005937 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005938
5939 // Additional pass-through fields opaque to statsd.
5940 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08005941 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08005942
5943 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5944 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005945}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005946
5947/**
5948 * Logs when a data stall event occurs.
5949 *
5950 * Log from:
5951 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5952 */
5953message DataStallEvent {
5954 // Data stall evaluation type.
5955 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5956 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5957 optional int32 evaluation_type = 1;
5958 // See definition in data_stall_event.proto.
5959 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5960 // See definition in data_stall_event.proto.
5961 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5962 // See definition in data_stall_event.proto.
5963 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5964 // See definition in data_stall_event.proto.
5965 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5966 // See definition in data_stall_event.proto.
5967 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5968}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005969
5970/*
5971 * Logs when RescueParty resets some set of experiment flags.
5972 *
5973 * Logged from:
5974 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5975 */
5976message RescuePartyResetReported {
5977 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5978 optional int32 rescue_level = 1;
5979}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005980
5981/**
5982 * Logs when signed config is received from an APK, and if that config was applied successfully.
5983 * Logged from:
5984 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5985 */
5986message SignedConfigReported {
5987 enum Type {
5988 UNKNOWN_TYPE = 0;
5989 GLOBAL_SETTINGS = 1;
5990 }
5991 optional Type type = 1;
5992
5993 // The final status of the signed config received.
5994 enum Status {
5995 UNKNOWN_STATUS = 0;
5996 APPLIED = 1;
5997 BASE64_FAILURE_CONFIG = 2;
5998 BASE64_FAILURE_SIGNATURE = 3;
5999 SECURITY_EXCEPTION = 4;
6000 INVALID_CONFIG = 5;
6001 OLD_CONFIG = 6;
6002 SIGNATURE_CHECK_FAILED = 7;
6003 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006004 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006005 }
6006 optional Status status = 2;
6007
6008 // The version of the signed config processed.
6009 optional int32 version = 3;
6010
6011 // The package name that the config was extracted from.
6012 optional string from_package = 4;
6013
6014 enum Key {
6015 NO_KEY = 0;
6016 DEBUG = 1;
6017 PRODUCTION = 2;
6018 }
6019 // Which key was used to verify the config.
6020 optional Key verified_with = 5;
6021}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006022
6023/*
6024 * Logs GNSS Network-Initiated (NI) location events.
6025 *
6026 * Logged from:
6027 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6028 */
6029message GnssNiEventReported {
6030 // The type of GnssNiEvent.
6031 enum EventType {
6032 UNKNOWN = 0;
6033 NI_REQUEST = 1;
6034 NI_RESPONSE = 2;
6035 }
6036 optional EventType event_type = 1;
6037
6038 // An ID generated by HAL to associate NI notifications and UI responses.
6039 optional int32 notification_id = 2;
6040
6041 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006042 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006043
6044 // NI requires notification.
6045 optional bool need_notify = 4;
6046
6047 // NI requires verification.
6048 optional bool need_verify = 5;
6049
6050 // NI requires privacy override, no notification/minimal trace.
6051 optional bool privacy_override = 6;
6052
6053 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6054 // seconds.
6055 optional int32 timeout = 7;
6056
6057 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006058 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006059
6060 // String representing the requester of the network inititated location request.
6061 optional string requestor_id = 9;
6062
6063 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6064 // network initiated location request.
6065 optional string text = 10;
6066
6067 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006068 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006069
6070 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006071 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006072
6073 // True if SUPL ES is enabled.
6074 optional bool is_supl_es_enabled = 13;
6075
6076 // True if GNSS location is enabled.
6077 optional bool is_location_enabled = 14;
6078
6079 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006080 optional android.server.location.GnssUserResponseType user_response = 15;
6081}
6082
6083/**
6084 * Logs GNSS non-framework (NFW) location notification.
6085 *
6086 * Logged from:
6087 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6088 */
6089message GnssNfwNotificationReported {
6090 // Package name of the Android proxy application representing the non-framework entity that
6091 // requested location. Set to empty string if unknown.
6092 optional string proxy_app_package_name = 1;
6093
6094 // Protocol stack that initiated the non-framework location request.
6095 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6096
6097 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6098 // set to empty string. This field is opaque to the framework and used for logging purposes.
6099 optional string other_protocol_stack_name = 3;
6100
6101 // Source initiating/receiving the location information.
6102 optional android.server.location.NfwRequestor requestor = 4;
6103
6104 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6105 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6106 // and used for logging purposes.
6107 optional string requestor_id = 5;
6108
6109 // Indicates whether location information was provided for this request.
6110 optional android.server.location.NfwResponseType response_type = 6;
6111
6112 // True if the device is in user initiated emergency session.
6113 optional bool in_emergency_mode = 7;
6114
6115 // True if cached location is provided.
6116 optional bool is_cached_location = 8;
6117
6118 // True if proxy app permission mismatch between framework and GNSS HAL.
6119 optional bool is_permission_mismatched = 9;
6120}
6121
6122/**
6123 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6124 *
6125 * Logged from:
6126 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6127 */
6128message GnssConfigurationReported {
6129 // SUPL host name.
6130 optional string supl_host = 1;
6131
6132 // SUPL port number.
6133 optional int32 supl_port = 2;
6134
6135 // C2K host name.
6136 optional string c2k_host = 3;
6137
6138 // C2K port number.
6139 optional int32 c2k_port = 4;
6140
6141 // The SUPL version requested by Carrier.
6142 optional int32 supl_ver = 5;
6143
6144 // The SUPL mode.
6145 optional android.server.location.SuplMode supl_mode = 6;
6146
6147 // True if NI emergency SUPL restrictions is enabled.
6148 optional bool supl_es = 7;
6149
6150 // LTE Positioning Profile settings
6151 optional android.server.location.LppProfile lpp_profile = 8;
6152
6153 // Positioning protocol on A-Glonass system.
6154 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6155
6156 // True if emergency PDN is used. Otherwise, regular PDN is used.
6157 optional bool use_emergency_pdn_for_emergency_supl= 10;
6158
6159 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6160 optional android.server.location.GpsLock gps_lock = 11;
6161
6162 // Number of seconds to extend the emergency session duration post emergency call.
6163 optional int32 es_extension_sec = 12;
6164
6165 // The full list of package names of proxy Android applications representing the non-framework
6166 // location access entities (on/off the device) for which the framework user has granted
6167 // non-framework location access permission. The package names are concatenated in one string
6168 // with spaces as separators.
6169 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006170}
Jack Yu95b64f32018-12-13 18:26:11 +08006171
6172/**
6173 * Logs when a NFC device's error occurred.
6174 * Logged from:
6175 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6176 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6177 */
6178message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006179 enum Type {
6180 UNKNOWN = 0;
6181 CMD_TIMEOUT = 1;
6182 ERROR_NOTIFICATION = 2;
6183 AID_OVERFLOW = 3;
6184 }
6185 optional Type type = 1;
6186 // If it's nci cmd timeout, log the timeout command.
6187 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006188
Alex Salod7c3eef2019-01-25 14:43:27 -08006189 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006190}
6191
6192/**
6193 * Logs when a NFC device's state changed event
6194 * Logged from:
6195 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6196 */
6197message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006198 enum State {
6199 UNKNOWN = 0;
6200 OFF = 1;
6201 ON = 2;
6202 ON_LOCKED = 3; // Secure Nfc enabled.
6203 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6204 }
6205 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006206}
6207
6208/**
6209 * Logs when a NFC Beam Transaction occurred.
6210 * Logged from:
6211 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6212 */
6213message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006214 enum Operation {
6215 UNKNOWN = 0;
6216 SEND = 1;
6217 RECEIVE = 2;
6218 }
6219 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006220}
6221
6222/**
6223 * Logs when a NFC Card Emulation Transaction occurred.
6224 * Logged from:
6225 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6226 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6227 */
6228message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006229 enum Category {
6230 UNKNOWN = 0;
6231 HCE_PAYMENT = 1;
6232 HCE_OTHER = 2;
6233 OFFHOST = 3;
6234 }
6235 // Transaction belongs to HCE payment or HCE other category, or offhost.
6236 optional Category category = 1;
6237 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6238 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006239}
6240
6241/**
6242 * Logs when a NFC Tag event occurred.
6243 * Logged from:
6244 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6245 */
6246message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006247 enum Type {
6248 UNKNOWN = 0;
6249 URL = 1;
6250 BT_PAIRING = 2;
6251 PROVISION = 3;
6252 WIFI_CONNECT = 4;
6253 APP_LAUNCH = 5;
6254 OTHERS = 6;
6255 }
6256 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006257}
6258
6259/**
6260 * Logs when Hce transaction triggered
6261 * Logged from:
6262 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6263 */
6264message NfcHceTransactionOccurred {
6265 // The latency period(in microseconds) it took for the first HCE data
6266 // exchange.
6267 optional uint32 latency_micros = 1;
6268}
6269
6270/**
6271 * Logs when SecureElement state event changed
6272 * Logged from:
6273 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6274 */
6275message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006276 enum State {
6277 UNKNOWN = 0;
6278 INITIALIZED = 1;
6279 DISCONNECTED = 2;
6280 CONNECTED = 3;
6281 HALCRASH = 4;
6282 }
6283 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006284
Alex Salod7c3eef2019-01-25 14:43:27 -08006285 optional string state_change_reason = 2;
6286 // SIMx or eSEx.
6287 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006288}
6289
6290/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006291 * Information about a permission grant request
6292 */
6293message PermissionGrantRequestResultReported {
6294 // unique value identifying an API call. A API call might result in multiple of these atoms
6295 optional int64 request_id = 1;
6296
6297 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006298 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006299
6300 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006301 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006302
6303 // The permission to be granted
6304 optional string permission_name = 4;
6305
6306 // If the permission was explicitly requested via the API or added by the system
6307 optional bool is_implicit = 5;
6308
6309 enum Result {
6310 UNDEFINED = 0;
6311 // permission request was ignored
6312 IGNORED = 1;
6313 // permission request was ignored because it was user fixed
6314 IGNORED_USER_FIXED = 2;
6315 // permission request was ignored because it was policy fixed
6316 IGNORED_POLICY_FIXED = 3;
6317 // permission was granted by user action
6318 USER_GRANTED = 4;
6319 // permission was automatically granted
6320 AUTO_GRANTED = 5;
6321 // permission was denied by user action
6322 USER_DENIED = 6;
6323 // permission was denied with prejudice by the user
6324 USER_DENIED_WITH_PREJUDICE = 7;
6325 // permission was automatically denied
6326 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006327 // permission request was ignored because permission is restricted
6328 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006329 // one time permission was granted by user action
6330 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006331 // user ignored request by leaving the request screen without choosing any option
6332 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006333 // user granted the permission after being linked to settings
6334 USER_GRANTED_IN_SETTINGS = 12;
6335 // user denied the permission after being linked to settings
6336 USER_DENIED_IN_SETTINGS = 13;
6337 // user denied the permission with prejudice after being linked to settings
6338 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6339 // permission was automatically revoked after one-time permission expired
6340 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006341 }
6342 // The result of the permission grant
6343 optional Result result = 6;
6344}
6345
6346/**
Jack Yu95b64f32018-12-13 18:26:11 +08006347 * Logs when Omapi API used
6348 * Logged from:
6349 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6350 */
6351message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006352 enum Operation {
6353 UNKNOWN = 0;
6354 OPEN_CHANNEL = 1;
6355 }
6356 optional Operation operation = 1;
6357 // SIMx or eSEx.
6358 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006359
Alex Salod7c3eef2019-01-25 14:43:27 -08006360 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006361}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006362
6363/**
Alex Saloa060aee2019-01-21 14:36:41 -08006364 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6365 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006366 * Logged from:
6367 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6368 */
6369message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006370 optional int64 dispatch_latency_millis = 1;
6371}
6372
6373/**
6374 * Logs AttentionManagerService attention check result.
6375 *
6376 * Logged from:
6377 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6378 */
6379message AttentionManagerServiceResultReported {
6380 // See core/java/android/service/attention/AttentionService.java
6381 enum AttentionCheckResult {
6382 UNKNOWN = 20;
6383 ATTENTION_SUCCESS_ABSENT = 0;
6384 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006385 ATTENTION_FAILURE_UNKNOWN = 2;
6386 ATTENTION_FAILURE_CANCELLED = 3;
6387 ATTENTION_FAILURE_PREEMPTED = 4;
6388 ATTENTION_FAILURE_TIMED_OUT = 5;
6389 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006390 }
6391 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006392}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006393
6394/**
6395 * Logs when an adb connection changes state.
6396 *
6397 * Logged from:
6398 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6399 */
6400message AdbConnectionChanged {
6401 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6402 // previously selected for this system.
6403 optional int64 last_connection_time_millis = 1;
6404
6405 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6406 // to reconnect via adb without user interaction.
6407 optional int64 auth_window_millis = 2;
6408
6409 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6410 optional android.debug.AdbConnectionStateEnum state = 3;
6411
6412 // True if the 'always allow' option was selected for this system.
6413 optional bool always_allow = 4;
6414}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006415
6416/*
6417 * Logs the reported speech DSP status.
6418 *
6419 * Logged from:
6420 * Vendor audio implementation.
6421 */
6422message SpeechDspStatReported {
6423 // The total Speech DSP uptime in milliseconds.
6424 optional int32 total_uptime_millis = 1;
6425 // The total Speech DSP downtime in milliseconds.
6426 optional int32 total_downtime_millis = 2;
6427 optional int32 total_crash_count = 3;
6428 optional int32 total_recover_count = 4;
6429}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006430
6431/**
6432 * Logs USB connector contaminant status.
6433 *
6434 * Logged from: USB Service.
6435 */
6436message UsbContaminantReported {
6437 optional string id = 1;
6438 optional android.service.usb.ContaminantPresenceStatus status = 2;
6439}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006440
6441/**
6442 * This atom is for debugging purpose.
6443 */
6444message DebugElapsedClock {
6445 // Monotically increasing value for each pull.
6446 optional int64 pull_count = 1;
6447 // Time from System.elapsedRealtime.
6448 optional int64 elapsed_clock_millis = 2;
6449 // Time from System.elapsedRealtime.
6450 optional int64 same_elapsed_clock_millis = 3;
6451 // Diff between current elapsed time and elapsed time from previous pull.
6452 optional int64 elapsed_clock_diff_millis = 4;
6453
6454 enum Type {
6455 TYPE_UNKNOWN = 0;
6456 ALWAYS_PRESENT = 1;
6457 PRESENT_ON_ODD_PULLS = 2;
6458 }
6459 // Type of behavior for the pulled data.
6460 optional Type type = 5;
6461}
6462
6463/**
6464 * This atom is for debugging purpose.
6465 */
6466message DebugFailingElapsedClock {
6467 // Monotically increasing value for each pull.
6468 optional int64 pull_count = 1;
6469 // Time from System.elapsedRealtime.
6470 optional int64 elapsed_clock_millis = 2;
6471 // Time from System.elapsedRealtime.
6472 optional int64 same_elapsed_clock_millis = 3;
6473 // Diff between current elapsed time and elapsed time from previous pull.
6474 optional int64 elapsed_clock_diff_millis = 4;
6475}
Steven Wuacef6bb2019-01-23 14:21:17 -05006476
6477/** Logs System UI bubbles event changed.
6478 *
6479 * Logged from:
6480 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6481 */
6482message BubbleUIChanged {
6483
6484 // The app package that is posting the bubble.
6485 optional string package_name = 1;
6486
6487 // The notification channel that is posting the bubble.
6488 optional string notification_channel = 2;
6489
6490 // The notification id associated with the posted bubble.
6491 optional int32 notification_id = 3;
6492
6493 // The position of the bubble within the bubble stack.
6494 optional int32 position = 4;
6495
6496 // The total number of bubbles within the bubble stack.
6497 optional int32 total_number = 5;
6498
6499 // User interactions with the bubble.
6500 enum Action {
6501 UNKNOWN = 0;
6502 POSTED = 1;
6503 UPDATED = 2;
6504 EXPANDED = 3;
6505 COLLAPSED = 4;
6506 DISMISSED = 5;
6507 STACK_DISMISSED = 6;
6508 STACK_MOVED = 7;
6509 HEADER_GO_TO_APP = 8;
6510 HEADER_GO_TO_SETTINGS = 9;
6511 PERMISSION_OPT_IN = 10;
6512 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006513 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006514 SWIPE_LEFT = 13;
6515 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006516 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006517 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006518 }
6519 optional Action action = 6;
6520
6521 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6522 optional float normalized_x_position = 7;
6523 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006524
6525 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6526 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006527
6528 // Whether the bubble is an on-going one.
6529 optional bool is_ongoing = 10;
6530
6531 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006532 // This is deprecated and the value should be ignored.
6533 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006534}
Kweku Adams8845d012018-12-11 20:06:45 -08006535
6536/**
Steven Wu552f63f2019-02-05 13:41:36 -05006537 * Logs System UI bubbles developer errors.
6538 *
6539 * Logged from:
6540 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6541 */
6542message BubbleDeveloperErrorReported {
6543
6544 // The app package that is posting the bubble.
6545 optional string package_name = 1;
6546
6547 // Bubble developer error type enums.
6548 enum Error {
6549 UNKNOWN = 0;
6550 ACTIVITY_INFO_MISSING = 1;
6551 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6552 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6553 }
6554 optional Error error = 2 [default = UNKNOWN];
6555}
6556
6557/**
Kweku Adams8845d012018-12-11 20:06:45 -08006558 * Logs that a constraint for a scheduled job has changed.
6559 *
6560 * Logged from:
6561 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6562 */
6563message ScheduledJobConstraintChanged {
6564 repeated AttributionNode attribution_node = 1;
6565
6566 // Name of the job.
6567 optional string job_name = 2;
6568
6569 optional com.android.server.job.ConstraintEnum constraint = 3;
6570
6571 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006572 UNKNOWN = 0;
6573 UNSATISFIED = 1;
6574 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006575 }
6576 optional State state = 4;
6577}
Alex Salod7c3eef2019-01-25 14:43:27 -08006578
6579/**
6580 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6581 * returns true.
6582 *
6583 * Logged from:
6584 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6585 */
6586message ScreenTimeoutExtensionReported {
6587 // Describes how many times in a row did the power manager reset the screen off timeout.
6588 optional uint32 consecutive_timeout_extended_count = 1;
6589}
Hui Yu885aca12019-01-10 17:11:34 -08006590
6591/*
6592* Logs number of milliseconds it takes to start a process.
6593* The definition of app process start time is from the app launch time to
6594* the time that Zygote finished forking the app process and loaded the
6595* application package's java classes.
6596
6597* This metric is different from AppStartOccurred which is for foreground
6598* activity only.
6599
6600* ProcessStartTime can report all processes (both foreground and background)
6601* start time.
6602*
6603* Logged from:
6604* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6605*/
6606message ProcessStartTime {
6607 // The uid of the ProcessRecord.
6608 optional int32 uid = 1 [(is_uid) = true];
6609
6610 // The process pid.
6611 optional int32 pid = 2;
6612
6613 // The process name.
6614 // Usually package name, "system" for system server.
6615 // Provided by ActivityManagerService.
6616 optional string process_name = 3;
6617
6618 enum StartType {
6619 UNKNOWN = 0;
6620 WARM = 1;
6621 HOT = 2;
6622 COLD = 3;
6623 }
6624
6625 // The start type.
6626 optional StartType type = 4;
6627
6628 // The elapsed realtime at the start of the process.
6629 optional int64 process_start_time_millis = 5;
6630
6631 // Number of milliseconds it takes to reach bind application.
6632 optional int32 bind_application_delay_millis = 6;
6633
6634 // Number of milliseconds it takes to finish start of the process.
6635 optional int32 process_start_delay_millis = 7;
6636
6637 // hostingType field in ProcessRecord, the component type such as "activity",
6638 // "service", "content provider", "broadcast" or other strings.
6639 optional string hosting_type = 8;
6640
6641 // hostingNameStr field in ProcessRecord. The component class name that runs
6642 // in this process.
6643 optional string hosting_name = 9;
6644}
6645
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006646/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006647 * Track Media Codec usage
6648 * Logged from:
6649 * frameworks/av/media/libstagefright/MediaCodec.cpp
6650 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6651 */
6652message MediametricsCodecReported {
6653 optional int64 timestamp_nanos = 1;
6654 optional string package_name = 2;
6655 optional int64 package_version_code = 3;
6656 optional int64 media_apex_version = 4;
6657
6658 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6659}
6660
6661/**
6662 * Track Media Extractor (pulling video/audio streams out of containers) usage
6663 * Logged from:
6664 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6665 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6666 */
6667message MediametricsExtractorReported {
6668 optional int64 timestamp_nanos = 1;
6669 optional string package_name = 2;
6670 optional int64 package_version_code = 3;
6671 optional int64 media_apex_version = 4;
6672
6673 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6674}
6675
6676/**
6677 * Track how we arbitrate between microphone/input requests.
6678 * Logged from
6679 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6680 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6681 */
6682message MediametricsAudiopolicyReported {
6683 optional int64 timestamp_nanos = 1;
6684 optional string package_name = 2;
6685 optional int64 package_version_code = 3;
6686 optional int64 media_apex_version = 4;
6687
6688 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6689}
6690
6691/**
6692 * Track how we arbitrate between microphone requests.
6693 * Logged from
6694 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6695 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6696 */
6697message MediametricsAudiorecordReported {
6698 optional int64 timestamp_nanos = 1;
6699 optional string package_name = 2;
6700 optional int64 package_version_code = 3;
6701 optional int64 media_apex_version = 4;
6702
6703 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6704}
6705
6706/**
6707 * Track how we arbitrate between microphone/input requests.
6708 * Logged from
6709 * frameworks/av/media/libnblog/ReportPerformance.cpp
6710 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6711 */
6712message MediametricsAudiothreadReported {
6713 optional int64 timestamp_nanos = 1;
6714 optional string package_name = 2;
6715 optional int64 package_version_code = 3;
6716 optional int64 media_apex_version = 4;
6717
6718 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6719}
6720
6721/**
6722 * Track how we arbitrate between microphone/input requests.
6723 * Logged from
6724 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6725 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6726 */
6727message MediametricsAudiotrackReported {
6728 optional int64 timestamp_nanos = 1;
6729 optional string package_name = 2;
6730 optional int64 package_version_code = 3;
6731 optional int64 media_apex_version = 4;
6732
6733 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6734}
6735
6736/**
6737 * Track information about DRM framework performance
6738 * Logged from
6739 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6740 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6741 */
6742message MediametricsMediadrmReported {
6743 optional int64 timestamp_nanos = 1;
6744 optional string package_name = 2;
6745 optional int64 package_version_code = 3;
6746 optional int64 media_apex_version = 4;
6747
6748 // vendor+description tell about which DRM plugin is in use on this device
6749 optional string vendor = 5;
6750 optional string description = 6;
6751 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6752 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6753}
6754
6755/**
6756 * Track information about the widevine DRM plugin performance
6757 * Logged from
6758 * vendor/widevine/libwvdrmengine/cdm/metrics
6759 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6760 */
6761message MediametricsDrmWidevineReported {
6762 optional int64 timestamp_nanos = 1;
6763 optional string package_name = 2;
6764 optional int64 package_version_code = 3;
6765 optional int64 media_apex_version = 4;
6766
6767 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6768}
6769
6770/**
6771 * Track information about recordings (e.g. camcorder)
6772 * Logged from
6773 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6774 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6775 */
6776message MediametricsRecorderReported {
6777 optional int64 timestamp_nanos = 1;
6778 optional string package_name = 2;
6779 optional int64 package_version_code = 3;
6780 optional int64 media_apex_version = 4;
6781
6782 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6783}
6784
6785/**
6786 * Track Media Player usage
6787 * Logged from:
6788 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6789 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6790 */
6791message MediametricsNuPlayerReported {
6792 optional int64 timestamp_nanos = 1;
6793 optional string package_name = 2;
6794 optional int64 package_version_code = 3;
6795 optional int64 media_apex_version = 4;
6796
6797 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6798}
6799
6800/**
Robert Shiha4beed32019-08-19 14:15:23 -07006801 * Track Legacy DRM usage
6802 * Logged from
6803 * frameworks/av/drm/drmserver/DrmManager.cpp
6804 */
6805message MediametricsDrmManagerReported {
6806 optional int64 timestamp_nanos = 1;
6807 optional string package_name = 2;
6808 optional int64 package_version_code = 3;
6809 optional int64 media_apex_version = 4;
6810
6811 enum Method {
6812 METHOD_NOT_FOUND = -1;
6813 GET_CONSTRAINTS = 0;
6814 GET_METADATA = 1;
6815 CAN_HANDLE = 2;
6816 PROCESS_DRM_INFO = 3;
6817 ACQUIRE_DRM_INFO = 4;
6818 SAVE_RIGHTS = 5;
6819 GET_ORIGINAL_MIME_TYPE = 6;
6820 GET_DRM_OBJECT_TYPE = 7;
6821 CHECK_RIGHTS_STATUS = 8;
6822 REMOVE_RIGHTS = 9;
6823 REMOVE_ALL_RIGHTS = 10;
6824 OPEN_CONVERT_SESSION = 11;
6825 OPEN_DECRYPT_SESSION = 12;
6826 }
6827
6828 // plugin_id+description inform which Legacy DRM plugins are still in use on device
6829 optional string plugin_id = 5;
6830 optional string description = 6;
6831 optional Method method = 7;
6832 optional string mime_types = 8;
6833}
6834
6835/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006836 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00006837 * Pulled from: StatsCompanionService
6838*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006839message DangerousPermissionState {
6840 // Name of the permission
6841 optional string permission_name = 1;
6842
6843 // Uid of the package
6844 optional int32 uid = 2 [(is_uid) = true];
6845
6846 // Package requesting the permission
6847 optional string package_name = 3;
6848
6849 // If the permission is granted to the uid
6850 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006851
6852 // Permission flags as per android.content.pm.PermissionFlags
6853 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006854}
6855
Michael Groover4a0ca942019-01-24 17:41:25 -08006856/**
6857 * Logs when a package is denied access to a device identifier based on the new access requirements.
6858 *
6859 * Logged from:
6860 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6861 */
6862message DeviceIdentifierAccessDenied {
6863 // The name of the package denied access to the requested device identifier.
6864 optional string package_name = 1;
6865
6866 // The name of the device identifier method the package attempted to invoke.
6867 optional string method_name = 2;
6868
6869 // True if the package is preinstalled.
6870 optional bool is_preinstalled = 3;
6871
6872 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08006873 // Starting from Android 11, this boolean is not set and will always be false.
6874 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08006875}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006876
6877/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006878 * Pulls the ongoing mainline install train version code.
6879 * Pulled from StatsCompanionService
6880 */
6881message TrainInfo {
6882 optional int64 train_version_code = 1;
6883
6884 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006885
6886 optional string train_name = 3;
6887
6888 enum Status {
6889 UNKNOWN = 0;
6890 INSTALL_REQUESTED = 1;
6891 INSTALL_STARTED = 2;
6892 INSTALL_STAGED_NOT_READY = 3;
6893 INSTALL_STAGED_READY = 4;
6894 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006895 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6896 // and INSTALL_FAILURE_COMMIT.
6897 INSTALL_FAILURE = 6 [deprecated = true];
6898 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006899 INSTALL_CANCELLED = 7;
6900 INSTALLER_ROLLBACK_REQUESTED = 8;
6901 INSTALLER_ROLLBACK_INITIATED = 9;
6902 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6903 INSTALLER_ROLLBACK_STAGED = 11;
6904 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6905 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6906 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6907 INSTALLER_ROLLBACK_SUCCESS = 15;
6908 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006909 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6910 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6911 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6912 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6913 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6914 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006915 INSTALL_FAILURE_DOWNLOAD = 23;
6916 INSTALL_FAILURE_STATE_MISMATCH = 24;
6917 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08006918 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006919 }
6920 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006921}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006922
6923/**
6924 * Logs the gesture stage changed event.
6925 *
6926 * Logged from:
6927 * frameworks/base/packages/SystemUI/
6928 */
6929message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006930 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006931}
6932
6933/**
6934 * Logs the feedback type.
6935 *
6936 * Logged from:
6937 * frameworks/base/packages/SystemUI/
6938 */
6939message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006940 // Whether or not the gesture was used.
6941 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006942}
6943
6944/**
6945 * Logs the progress.
6946 *
6947 * Logged from:
6948 * frameworks/base/packages/SystemUI/
6949 */
6950message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006951 // [0,100] progress for the assist gesture.
6952 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006953}
Neil Fullerdb14b482019-02-05 19:44:44 +00006954
6955/*
6956 * Information about the time zone data on a device.
6957 */
6958message TimeZoneDataInfo {
6959 // A version identifier for the data set on device. e.g. "2018i"
6960 optional string tzdb_version = 1;
6961}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006962
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006963/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006964 * Logs the GPU stats global health information.
6965 *
6966 * Logged from:
6967 * frameworks/native/services/gpuservice/gpustats/
6968 */
6969message GpuStatsGlobalInfo {
6970 // Package name of the gpu driver.
6971 optional string driver_package_name = 1;
6972
6973 // Version name of the gpu driver.
6974 optional string driver_version_name = 2;
6975
6976 // Version code of the gpu driver.
6977 optional int64 driver_version_code = 3;
6978
6979 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6980 optional int64 driver_build_time = 4;
6981
6982 // Total count of the gl driver gets loaded.
6983 optional int64 gl_loading_count = 5;
6984
6985 // Total count of the gl driver fails to be loaded.
6986 optional int64 gl_loading_failure_count = 6;
6987
6988 // Total count of the Vulkan driver gets loaded.
6989 optional int64 vk_loading_count = 7;
6990
6991 // Total count of the Vulkan driver fails to be loaded.
6992 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006993
6994 // Api version of the system Vulkan driver.
6995 optional int32 vulkan_version = 9;
6996
6997 // Api version of the system CPU Vulkan driver.
6998 optional int32 cpu_vulkan_version = 10;
6999
7000 // Api version of the system GLES driver.
7001 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007002
7003 // Total count of the angle driver gets loaded.
7004 optional int64 angle_loading_count = 12;
7005
7006 // Total count of the angle driver fails to be loaded.
7007 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007008}
7009
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007010/**
7011 * GPU driver loading time info.
7012 */
7013message GpuDriverLoadingTime {
7014 // List of all the driver loading times for this app. The list size is
7015 // capped at 50.
7016 repeated int64 driver_loading_time = 1;
7017}
7018
7019/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007020 * Logs the GPU stats per app health information.
7021 *
7022 * Logged from:
7023 * frameworks/native/services/gpuservice/gpustats/
7024 */
7025message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007026 // Package name of the application that loads the gpu driver. Total number
7027 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007028 optional string app_package_name = 1;
7029
7030 // Version code of the gpu driver this app loads.
7031 optional int64 driver_version_code = 2;
7032
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007033 // gl driver loading time info.
7034 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7035 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007036
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007037 // Vulkan driver loading time info.
7038 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7039 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007040
7041 // Angle driver loading time info.
7042 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7043 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007044
7045 // CPU Vulkan implementation is in use.
7046 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007047
7048 // App is not doing pre-rotation correctly.
7049 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007050
7051 // App creates GLESv1 context.
7052 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007053}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007054
7055/*
7056 * Logs the size of the system ion heap.
7057 *
7058 * Pulled from StatsCompanionService.
7059 */
7060message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007061 // Deprecated due to limited support of ion stats in debugfs.
7062 // Use `IonHeapSize` instead.
7063 option deprecated = true;
7064
Rafal Slawikd4e87572019-03-12 13:08:38 +00007065 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007066 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007067 optional int64 size_in_bytes = 1;
7068}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007069
Rafal Slawik77987ed2019-06-17 12:28:23 +01007070/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007071 * Logs the total size of the ion heap.
7072 *
7073 * Pulled from StatsCompanionService.
7074 */
7075message IonHeapSize {
7076 // Total size of all ion heaps in kilobytes.
7077 // Read from: /sys/kernel/ion/total_heaps_kb.
7078 optional int32 total_size_kb = 1;
7079}
7080
7081/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007082 * Logs the per-process size of the system ion heap.
7083 *
7084 * Pulled from StatsCompanionService.
7085 */
7086message ProcessSystemIonHeapSize {
7087 // The uid if available. -1 means not available.
7088 optional int32 uid = 1 [(is_uid) = true];
7089
7090 // The process name (from /proc/PID/cmdline).
7091 optional string process_name = 2;
7092
7093 // Sum of sizes of all allocations.
7094 optional int32 total_size_in_kilobytes = 3;
7095
7096 // Number of allocations.
7097 optional int32 allocation_count = 4;
7098
7099 // Size of the largest allocation.
7100 optional int32 max_size_in_kilobytes = 5;
7101}
7102
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007103/**
7104 * Push network stack events.
7105 *
7106 * Log from:
7107 * frameworks/base/packages/NetworkStack/
7108 */
7109message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007110 // The id that indicates the event reported from NetworkStack.
7111 optional int32 event_id = 1;
7112 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007113 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7114}
Carmen Agimofa769c152019-03-04 14:39:14 +00007115
7116/**
7117 * Logs the apps that are installed on the external storage.
7118 * Pulled from:
7119 * StatsCompanionService
7120 */
7121message AppsOnExternalStorageInfo {
7122 // The type of the external storage.
7123 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7124 // The name of the package that is installed on the external storage.
7125 optional string package_name = 2;
7126}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007127
7128/**
7129 * Logs the settings related to Face.
7130 * Logged from:
7131 * frameworks/base/services/core/java/com/android/server/stats
7132 */
7133message FaceSettings {
7134 // Whether or not face unlock is allowed on Keyguard.
7135 optional bool unlock_keyguard_enabled = 1;
7136 // Whether or not face unlock dismisses the Keyguard.
7137 optional bool unlock_dismisses_keyguard = 2;
7138 // Whether or not face unlock requires attention.
7139 optional bool unlock_attention_required = 3;
7140 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7141 optional bool unlock_app_enabled = 4;
7142 // Whether or not face unlock always requires user confirmation.
7143 optional bool unlock_always_require_confirmation = 5;
7144 // Whether or not a diverse set of poses are required during enrollment.
7145 optional bool unlock_diversity_required = 6;
7146}
Maggie White442b6312019-04-05 16:26:44 -07007147
7148/**
7149 * Logs cooling devices maintained by the kernel.
7150 *
7151 * Pulled from StatsCompanionService.java
7152 */
7153message CoolingDevice {
7154 // The type of cooling device being reported. Eg. CPU, GPU...
7155 optional android.os.CoolingTypeEnum device_location = 1;
7156 // The name of the cooling device source. Eg. CPU0
7157 optional string device_name = 2;
7158 // Current throttle state of the cooling device. The value can any unsigned
7159 // integer between 0 and max_state defined in its driver. 0 means device is
7160 // not in throttling, higher value means deeper throttling.
7161 optional int32 state = 3;
7162}
Ben Blount763a5d52019-04-10 11:48:58 -07007163
7164/**
7165 * Intelligence has several counter-type events that don't warrant a
7166 * full separate atom. These are primarily API call counters but also include
7167 * counters for feature usage and specific failure modes.
7168 *
7169 * Logged from the Intelligence mainline module.
7170 */
7171message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007172 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007173 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007174 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007175 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007176 // How many times the event occured (to report a batch of high frequency events).
7177 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007178 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007179 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007180}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007181
7182/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007183 * Logs when Car Power state changed.
7184 *
7185 * Logged from:
7186 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7187 */
7188message CarPowerStateChanged {
7189 // States come from CpmsState in CarPowerManagementService.java.
7190 enum State {
7191 WAIT_FOR_VHAL = 0;
7192 ON = 1;
7193 SHUTDOWN_PREPARE = 2;
7194 WAIT_FOR_FINISH = 3;
7195 SUSPEND = 4;
7196 SIMULATE_SLEEP = 5;
7197 }
7198 optional State state = 1;
7199}
7200
7201/**
7202 * Logs whether GarageMode is entered.
7203 *
7204 * Logged from:
7205 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7206 */
7207message GarageModeInfo {
7208 // Whether GarageMode is entered.
7209 optional bool is_garage_mode = 1;
7210}
Martijn Coenencd95d462019-04-25 17:09:45 +02007211
7212/**
7213 * Historical app ops data per package.
7214 */
7215message AppOps {
7216 // Uid of the package requesting the op
7217 optional int32 uid = 1 [(is_uid) = true];
7218
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007219 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007220 optional string package_name = 2;
7221
7222 // operation id; maps to the OP_* constants in AppOpsManager.java
7223 optional int32 op_id = 3;
7224
7225 // The number of times the op was granted while the app was in the
7226 // foreground (only for trusted requests)
7227 optional int64 trusted_foreground_granted_count = 4;
7228
7229 // The number of times the op was granted while the app was in the
7230 // background (only for trusted requests)
7231 optional int64 trusted_background_granted_count = 5;
7232
7233 // The number of times the op was rejected while the app was in the
7234 // foreground (only for trusted requests)
7235 optional int64 trusted_foreground_rejected_count = 6;
7236
7237 // The number of times the op was rejected while the app was in the
7238 // background (only for trusted requests)
7239 optional int64 trusted_background_rejected_count = 7;
7240
7241 // For long-running operations, total duration of the operation
7242 // while the app was in the foreground (only for trusted requests)
7243 optional int64 trusted_foreground_duration_millis = 8;
7244
7245 // For long-running operations, total duration of the operation
7246 // while the app was in the background (only for trusted requests)
7247 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007248
7249 // Whether AppOps is guarded by Runtime permission
7250 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007251}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007252
7253/**
7254 * Location Manager API Usage information(e.g. API under usage,
7255 * API call's parameters).
7256 * Logged from:
7257 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7258 */
7259message LocationManagerApiUsageReported {
7260
7261 // Indicating if usage starts or usage ends.
7262 optional android.stats.location.UsageState state = 1;
7263
7264 // LocationManagerService's API in use.
7265 // We can identify which API from LocationManager is
7266 // invoking current LMS API by the combination of
7267 // API parameter(e.g. is_listener_null, is_intent_null,
7268 // is_location_request_null)
7269 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7270
7271 // Name of the package calling the API.
7272 optional string calling_package_name = 3;
7273
7274 // Type of the location provider.
7275 optional android.stats.location.ProviderType provider = 4;
7276
7277 // Quality of the location request
7278 optional android.stats.location.LocationRequestQuality quality = 5;
7279
7280 // The desired interval for active location updates, in milliseconds.
7281 // Bucketized to reduce cardinality.
7282 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7283
7284 // Minimum distance between location updates, in meters.
7285 // Bucketized to reduce cardinality.
7286 optional android.stats.location.SmallestDisplacementBucket
7287 bucketized_smallest_displacement = 7;
7288
7289 // The number of location updates.
7290 optional int64 num_updates = 8;
7291
7292 // The request expiration time, in millisecond since boot.
7293 // Bucketized to reduce cardinality.
7294 optional android.stats.location.ExpirationBucket
7295 bucketized_expire_in = 9;
7296
7297 // Type of Callback passed in for this API.
7298 optional android.stats.location.CallbackType callback_type = 10;
7299
7300 // The radius of the central point of the alert
7301 // region, in meters. Only for API REQUEST_GEOFENCE.
7302 // Bucketized to reduce cardinality.
7303 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7304
7305 // Activity Importance of API caller.
7306 // Categorized to 3 types that are interesting from location's perspective.
7307 optional android.stats.location.ActivityImportance activiy_importance = 12;
7308}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007309
7310/**
7311 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7312 */
7313message ReviewPermissionsFragmentResultReported {
7314 // unique value identifying a permission group change. A permission group change might result
7315 // in multiple of these atoms
7316 optional int64 change_id = 1;
7317
7318 // UID of package the permission belongs to
7319 optional int32 uid = 2 [(is_uid) = true];
7320
7321 // Name of package the permission belongs to
7322 optional string package_name = 3;
7323
7324 // The permission to be granted
7325 optional string permission_name = 4;
7326
7327 // The result of the permission grant
7328 optional bool permission_granted = 5;
7329}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007330
7331/**
7332* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7333* Logged from: RuntimePermissionUpdgradeController
7334*/
7335message RuntimePermissionsUpgradeResult {
7336 // Permission granted as result of upgrade
7337 optional string permission_name = 1;
7338
7339 // UID of package granted permission
7340 optional int32 uid = 2 [(is_uid) = true];
7341
7342 // Name of package granted permission
7343 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007344}
7345
7346/**
7347* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7348*/
7349message GrantPermissionsActivityButtonActions {
7350 // Permission granted as result of upgrade
7351 optional string permission_group_name = 1;
7352
7353 // UID of package granted permission
7354 optional int32 uid = 2 [(is_uid) = true];
7355
7356 // Name of package requesting permission
7357 optional string package_name = 3;
7358
7359 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7360 // LABEL_ constants in GrantPermissionActivity.java
7361 optional int32 buttons_presented = 4;
7362
7363 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7364 optional int32 button_clicked = 5;
7365}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007366
7367/**
7368 * Information about LocationAccessCheck notification presented to user
7369 */
7370message LocationAccessCheckNotificationAction {
7371
7372 // id which identifies single session of user interacting with permission controller
7373 optional int64 session_id = 1;
7374
7375 // Uid of package for which location access check is presented
7376 optional int32 package_uid = 2;
7377
7378 // Name of package for which location access check is presented
7379 optional string package_name = 3;
7380
7381 enum Result {
7382 UNDEFINED = 0;
7383 // notification was presented to the user
7384 NOTIFICATION_PRESENTED = 1;
7385 // notification was declined by the user
7386 NOTIFICATION_DECLINED = 2;
7387 // notification was clicked by the user
7388 NOTIFICATION_CLICKED = 3;
7389 }
7390
7391 // View / interaction recorded
7392 optional Result result = 4;
7393}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007394
7395/**
7396 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7397 */
7398message AppPermissionFragmentActionReported {
7399 // id which identifies single session of user interacting with permission controller
7400 optional int64 session_id = 1;
7401
7402 // unique value identifying a permission group change. A permission group change might result
7403 // in multiple of these atoms
7404 optional int64 change_id = 2;
7405
7406 // UID of package the permission belongs to
7407 optional int32 uid = 3 [(is_uid) = true];
7408
7409 // Name of package the permission belongs to
7410 optional string package_name = 4;
7411
7412 // The permission to be granted
7413 optional string permission_name = 5;
7414
7415 // The result of the permission grant
7416 optional bool permission_granted = 6;
7417}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007418
7419/**
7420* Information about a AppPermissionFragment viewed by user
7421*/
7422message AppPermissionFragmentViewed {
7423 // id which identifies single session of user interacting with permission controller
7424 optional int64 session_id = 1;
7425
7426 // UID of package for which permissions are viewed
7427 optional int32 uid = 2 [(is_uid) = true];
7428
7429 // Name of package for which permissions are viewed
7430 optional string package_name = 3;
7431
7432 // Permission group viewed
7433 optional string permission_group_name = 4;
7434}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007435
7436/**
7437* Information about a AppPermissionsFragment viewed by user
7438*/
7439message AppPermissionsFragmentViewed {
7440 // id which identifies single session of user interacting with permission controller
7441 optional int64 session_id = 1;
7442
7443 // id which identifies single view as every view might have several logging records
7444 // with different package information attached
7445 optional int64 view_id = 2;
7446
7447 // Permission group viewed
7448 optional string permission_group_name = 3;
7449
7450 // UID of package for which permissions are viewed
7451 optional int32 uid = 4 [(is_uid) = true];
7452
7453 // Name of package for which permissions are viewed
7454 optional string package_name = 5;
7455
7456 // Category in which permission is included
7457 enum Category {
7458 UNDEFINED = 0;
7459 ALLOWED = 1;
7460 ALLOWED_FOREGROUND = 2;
7461 DENIED = 3;
7462 }
7463 optional Category category = 6;
7464}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007465
7466/**
7467* Information about a PermissionAppsFragment viewed by user.
7468* Logged from ui/handheld/PermissionAppsFragment.java
7469*/
7470message PermissionAppsFragmentViewed {
7471 // id which identifies single session of user interacting with permission controller
7472 optional int64 session_id = 1;
7473
7474 // id which identifies single view as every view might have several logging records
7475 // with different package information attached
7476 optional int64 view_id = 2;
7477
7478 // Permission group viewed
7479 optional string permission_group_name = 3;
7480
7481 // UID of package for which permissions are viewed
7482 optional int32 uid = 4 [(is_uid) = true];
7483
7484 // Name of package for which permissions are viewed
7485 optional string package_name = 5;
7486
7487 // Category in which app is included
7488 enum Category {
7489 UNDEFINED = 0;
7490 ALLOWED = 1;
7491 ALLOWED_FOREGROUND = 2;
7492 DENIED = 3;
7493 }
7494 optional Category category = 6;
7495}
Tony Make2b1b672019-07-29 16:59:47 +01007496
7497/**
7498 * Logs when there is a smart selection related event.
7499 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7500 * Logged from: TextClassifierEventLogger.java
7501 */
7502message TextSelectionEvent {
7503 // A session ID.
7504 optional string session_id = 1;
7505
7506 // Event type of this event.
7507 optional android.stats.textclassifier.EventType event_type = 2;
7508
Tony Mak9c84bd22019-12-09 07:27:25 +00007509 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007510 optional string model_name = 3;
7511
7512 // Type of widget that was involved in triggering this event.
7513 optional android.stats.textclassifier.WidgetType widget_type = 4;
7514
7515 // Index of this event in a session.
7516 optional int32 event_index = 5;
7517
7518 // Entity type that is involved.
7519 optional string entity_type = 6;
7520
7521 // Relative word index of the start of the selection.
7522 optional int32 relative_word_start_index = 7;
7523
7524 // Relative word (exclusive) index of the end of the selection.
7525 optional int32 relative_word_end_index = 8;
7526
7527 // Relative word index of the start of the smart selection.
7528 optional int32 relative_suggested_word_start_index = 9;
7529
7530 // Relative word (exclusive) index of the end of the smart selection.
7531 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007532
7533 // Name of source package.
7534 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007535}
7536
7537/**
7538 * Logs when there is a smart linkify related event.
7539 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7540 * Logged from: TextClassifierEventLogger.java
7541 */
7542message TextLinkifyEvent {
7543 // A session ID.
7544 optional string session_id = 1;
7545
7546 // Event type of this event.
7547 optional android.stats.textclassifier.EventType event_type = 2;
7548
Tony Mak9c84bd22019-12-09 07:27:25 +00007549 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007550 optional string model_name = 3;
7551
7552 // Type of widget that was involved in triggering this event.
7553 optional android.stats.textclassifier.WidgetType widget_type = 4;
7554
7555 // Index of this event in a session.
7556 optional int32 event_index = 5;
7557
7558 // Entity type that is involved.
7559 optional string entity_type = 6;
7560
7561 // Number of links detected.
7562 optional int32 num_links = 7;
7563
7564 // The total length of all links.
7565 optional int32 linked_text_length = 8;
7566
7567 // Length of input text.
7568 optional int32 text_length = 9;
7569
7570 // Time spent on generating links in ms.
7571 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007572
7573 // Name of source package.
7574 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007575}
7576
7577/**
7578 * Logs when there is a conversation actions related event.
7579 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7580 * Logged from: TextClassifierEventLogger.java
7581 */
7582message ConversationActionsEvent {
7583 // A session ID.
7584 optional string session_id = 1;
7585
7586 // Event type of this event.
7587 optional android.stats.textclassifier.EventType event_type = 2;
7588
Tony Mak9c84bd22019-12-09 07:27:25 +00007589 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007590 optional string model_name = 3;
7591
7592 // Type of widget that was involved in triggering this event.
7593 optional android.stats.textclassifier.WidgetType widget_type = 4;
7594
7595 // The first entity type that is involved.
7596 optional string first_entity_type = 5;
7597
7598 // The second entity type that is involved.
7599 optional string second_entity_type = 6;
7600
7601 // The third entity type that is involved.
7602 optional string third_entity_type = 7;
7603
7604 // The score of the first entity type.
7605 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01007606
7607 // Name of source package.
7608 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00007609
7610 // Name of the annotator model that is involved in this event.
7611 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01007612}
7613
7614/**
7615 * Logs when there is a language detection related event.
7616 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7617 * Logged from: TextClassifierEventLogger.java
7618 */
7619message LanguageDetectionEvent {
7620 // A session ID.
7621 optional string session_id = 1;
7622
7623 // Event type of this event.
7624 optional android.stats.textclassifier.EventType event_type = 2;
7625
Tony Mak9c84bd22019-12-09 07:27:25 +00007626 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007627 optional string model_name = 3;
7628
7629 // Type of widget that was involved in triggering this event.
7630 optional android.stats.textclassifier.WidgetType widget_type = 4;
7631
7632 // Detected language.
7633 optional string language_tag = 5;
7634
7635 // Score of the detected language.
7636 optional float score = 6;
7637
7638 // Position of this action.
7639 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007640
7641 // Name of source package.
7642 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007643}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007644
7645/**
7646 * Information about an OTA update attempt by update_engine.
7647 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7648 */
7649message UpdateEngineUpdateAttemptReported {
7650 // The number of attempts for the update engine to apply a given payload.
7651 optional int32 attempt_number = 1;
7652
7653 optional android.stats.otaupdate.PayloadType payload_type = 2;
7654
7655 // The total time in minutes for the update engine to apply a given payload.
7656 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7657 // it's increased when the system is sleeping.
7658 optional int32 duration_boottime_in_minutes = 3;
7659
7660 // The total time in minutes for the update engine to apply a given payload.
7661 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7662 // and it's not increased when the system is sleeping.
7663 optional int32 duration_monotonic_in_minutes = 4;
7664
7665 // The size of the payload in MiBs.
7666 optional int32 payload_size_mib = 5;
7667
7668 // The attempt result reported by the update engine for an OTA update.
7669 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7670
7671 // The error code reported by the update engine after an OTA update attempt
7672 // on A/B devices.
7673 optional android.stats.otaupdate.ErrorCode error_code = 7;
7674
7675 // The build fingerprint of the source system. The value is read from a
7676 // system property when the device takes the update. e.g.
7677 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7678 optional string source_fingerprint = 8;
7679}
7680
7681/**
7682 * Information about all the attempts the device make before finishing the
7683 * successful update.
7684 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7685 */
7686message UpdateEngineSuccessfulUpdateReported {
7687 // The number of attempts for the update engine to apply the payload for a
7688 // successful update.
7689 optional int32 attempt_count = 1;
7690
7691 optional android.stats.otaupdate.PayloadType payload_type = 2;
7692
7693 optional int32 payload_size_mib = 3;
7694
7695 // The total number of bytes downloaded by update_engine since the last
7696 // successful update.
7697 optional int32 total_bytes_downloaded_mib = 4;
7698
7699 // The ratio in percentage of the over-downloaded bytes compared to the
7700 // total bytes needed to successfully install the update. e.g. 200 if we
7701 // download 200MiB in total for a 100MiB package.
7702 optional int32 download_overhead_percentage = 5;
7703
7704 // The total time in minutes for the update engine to apply the payload for a
7705 // successful update.
7706 optional int32 total_duration_minutes = 6;
7707
7708 // The number of reboot of the device during a successful update.
7709 optional int32 reboot_count = 7;
7710}
Alec Mourie088e762019-07-02 13:10:55 -07007711
7712/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08007713 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
7714 * key to indicate whether it was successful or not.
7715 *
7716 * Logged from:
7717 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
7718 */
7719message RebootEscrowRecoveryReported {
7720 optional bool successful = 1;
7721}
7722
7723/**
Alec Mourie088e762019-07-02 13:10:55 -07007724 * Global display pipeline metrics reported by SurfaceFlinger.
7725 * Pulled from:
7726 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7727 */
7728message SurfaceflingerStatsGlobalInfo {
7729 // Total number of frames presented during the tracing period
7730 optional int64 total_frames = 1;
7731 // Total number of frames missed
7732 optional int64 missed_frames = 2;
7733 // Total number of frames that fell back to client composition
7734 optional int64 client_composition_frames = 3;
7735 // Total time the display was turned on
7736 optional int64 display_on_millis = 4;
7737 // Total time that was spent performing animations.
7738 // This is derived from the present-to-present layer histogram
7739 optional int64 animation_millis = 5;
7740}
7741
7742/**
7743 * Per-layer display pipeline metrics reported by SurfaceFlinger.
7744 * The number of layers uploaded will be restricted due to size limitations.
7745 * Pulled from:
7746 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7747 */
7748message SurfaceflingerStatsLayerInfo {
7749 // The layer for this set of metrics
7750 // For now we can infer that the package name is included in the layer
7751 // name.
7752 optional string layer_name = 1;
7753 // Total number of frames presented
7754 optional int64 total_frames = 2;
7755 // Total number of dropped frames while latching a buffer for this layer.
7756 optional int64 dropped_frames = 3;
7757 // Set of timings measured between successive presentation timestamps.
7758 optional FrameTimingHistogram present_to_present = 4
7759 [(android.os.statsd.log_mode) = MODE_BYTES];
7760 // Set of timings measured from when an app queued a buffer for
7761 // presentation, until the buffer was actually presented to the
7762 // display.
7763 optional FrameTimingHistogram post_to_present = 5
7764 [(android.os.statsd.log_mode) = MODE_BYTES];
7765 // Set of timings measured from when a buffer is ready to be presented,
7766 // until the buffer was actually presented to the display.
7767 optional FrameTimingHistogram acquire_to_present = 6
7768 [(android.os.statsd.log_mode) = MODE_BYTES];
7769 // Set of timings measured from when a buffer was latched by
7770 // SurfaceFlinger, until the buffer was presented to the display
7771 optional FrameTimingHistogram latch_to_present = 7
7772 [(android.os.statsd.log_mode) = MODE_BYTES];
7773 // Set of timings measured from the desired presentation to the actual
7774 // presentation time
7775 optional FrameTimingHistogram desired_to_present = 8
7776 [(android.os.statsd.log_mode) = MODE_BYTES];
7777 // Set of timings measured from when an app queued a buffer for
7778 // presentation, until the buffer was ready to be presented.
7779 optional FrameTimingHistogram post_to_acquire = 9
7780 [(android.os.statsd.log_mode) = MODE_BYTES];
7781}
7782
7783/**
7784 * Histogram of frame counts bucketed by time in milliseconds.
7785 * Because of size limitations, we hard-cap the number of buckets, with
7786 * buckets for corresponding to larger milliseconds being less precise.
7787 */
7788message FrameTimingHistogram {
7789 // Timings in milliseconds that describes a set of histogram buckets
7790 repeated int32 time_millis_buckets = 1;
7791 // Number of frames that match to each time_millis, i.e. the bucket
7792 // contents
7793 // It's required that len(time_millis) == len(frame_count)
7794 repeated int64 frame_counts = 2;
7795}
Emilian Peev6729f372019-08-29 09:14:09 -07007796
Emilian Peev6729f372019-08-29 09:14:09 -07007797/**
7798 * Information about camera facing and API level usage.
7799 * Logged from:
7800 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
7801 */
7802message CameraActionEvent {
7803 // Camera session duration
7804 optional int64 duration = 1;
7805
7806 // Camera API level used
7807 optional int32 api_level = 2;
7808
7809 // Name of client package
7810 optional string package_name = 3;
7811
7812 // Camera facing
7813 enum Facing {
7814 UNKNOWN = 0;
7815 BACK = 1;
7816 FRONT = 2;
7817 EXTERNAL = 3;
7818 }
7819 optional Facing facing = 4;
7820}
atrost01a20932019-08-28 15:40:37 +01007821
7822/**
7823 * Logs when a compatibility change is affecting an app.
7824 *
7825 * Logged from:
7826 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
7827 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
7828 */
7829message AppCompatibilityChangeReported {
7830 // The UID of the app being affected by the compatibilty change.
7831 optional int32 uid = 1 [(is_uid) = true];
7832
7833 // The ID of the change affecting the app.
7834 optional int64 change_id = 2;
7835
7836 enum State {
7837 UNKNOWN_STATE = 0;
7838 ENABLED = 1;
7839 DISABLED = 2;
7840 LOGGED = 3;
7841 }
7842
7843 // The state of the change - if logged from gating whether it was enabled or disabled, or just
7844 // logged otherwise.
7845 optional State state = 3;
7846
7847 enum Source {
7848 UNKNOWN_SOURCE = 0;
7849 APP_PROCESS = 1;
7850 SYSTEM_SERVER = 2;
7851 }
7852
7853 // Where it was logged from.
7854 optional Source source = 4;
7855
7856}
Hector Dearman40579f62019-11-01 13:19:30 +00007857
7858/**
7859 * Logged from
7860 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
7861 */
7862message PerfettoUploaded {
7863 enum Event {
7864 PERFETTO_UNDEFINED = 0;
7865 PERFETTO_TRACE_BEGIN = 1;
7866 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
7867 PERFETTO_ON_CONNECT = 3;
7868 PERFETTO_ON_TRACING_DISABLED = 4;
7869 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
7870 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
7871 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
7872 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
7873 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
7874 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
7875 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
7876 PERFETTO_TRIGGER_BEGIN = 12;
7877 PERFETTO_TRIGGER_SUCCESS = 13;
7878 PERFETTO_TRIGGER_FAILURE = 14;
7879 PERFETTO_HIT_GUARDRAILS = 15;
7880 PERFETTO_ON_TIMEOUT = 16;
7881 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
7882 }
7883
7884 // Which stage of the pipeline we are reporting from.
7885 optional Event event = 1;
7886
7887 // UUID matching the one set inside the SystemInfo trace packet.
7888 optional int64 trace_uuid_lsb = 2;
7889 optional int64 trace_uuid_msb = 3;
7890}
Mark Tabrya824a642019-11-05 12:26:12 -08007891
7892/**
7893 * Pulls client metrics on data transferred via Vehicle Maps Service.
7894 * Metrics are keyed by uid + layer.
7895 *
7896 * Pulled from:
7897 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
7898 */
7899message VmsClientStats {
7900 // UID of the VMS client app
7901 optional int32 uid = 1 [(is_uid) = true];
7902
7903 // VMS layer definition
7904 optional int32 layer_type = 2;
7905 optional int32 layer_channel = 3;
7906 optional int32 layer_version = 4;
7907
7908 // Bytes and packets sent by the client for the layer
7909 optional int64 tx_bytes = 5;
7910 optional int64 tx_packets = 6;
7911
7912 // Bytes and packets received by the client for the layer
7913 optional int64 rx_bytes = 7;
7914 optional int64 rx_packets = 8;
7915
7916 // Bytes and packets dropped due to client error
7917 optional int64 dropped_bytes = 9;
7918 optional int64 dropped_packets = 10;
7919}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007920
7921/**
7922 * State of a dangerous permission requested by a package - sampled
7923 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
7924*/
7925message DangerousPermissionStateSampled {
7926 // Name of the permission
7927 optional string permission_name = 1;
7928
7929 // Uid of the package
7930 optional int32 uid = 2 [(is_uid) = true];
7931
7932 // If the permission is granted to the uid
7933 optional bool is_granted = 3;
7934
7935 // Permission flags as per android.content.pm.PermissionFlags
7936 optional int32 permission_flags = 4;
7937}
7938
Stan Iliev637ba5e2019-08-16 13:43:08 -04007939/**
7940 * HWUI renders pipeline type: GL (0) or Vulkan (1).
7941 */
7942enum PipelineType {
7943 GL = 0;
7944 VULKAN = 1;
7945}
7946
7947/**
7948 * HWUI stats for a given app.
7949 */
7950message GraphicsStats {
7951 // The package name of the app
7952 optional string package_name = 1;
7953
7954 // The version code of the app
7955 optional int64 version_code = 2;
7956
7957 // The start & end timestamps in UTC as
7958 // milliseconds since January 1, 1970
7959 // Compatible with java.util.Date#setTime()
7960 optional int64 stats_start = 3;
7961
7962 optional int64 stats_end = 4;
7963
7964 // HWUI renders pipeline type: GL or Vulkan.
7965 optional PipelineType pipeline = 5;
7966
7967 // Distinct frame count.
7968 optional int32 total_frames = 6;
7969
7970 // Number of "missed vsync" events.
7971 optional int32 missed_vsync_count = 7;
7972
7973 // Number of frames in triple-buffering scenario (high input latency)
7974 optional int32 high_input_latency_count = 8;
7975
7976 // Number of "slow UI thread" events.
7977 optional int32 slow_ui_thread_count = 9;
7978
7979 // Number of "slow bitmap upload" events.
7980 optional int32 slow_bitmap_upload_count = 10;
7981
7982 // Number of "slow draw" events.
7983 optional int32 slow_draw_count = 11;
7984
7985 // Number of frames that missed their deadline (aka, visibly janked)
7986 optional int32 missed_deadline_count = 12;
7987
7988 // The frame time histogram for the package
7989 optional FrameTimingHistogram cpu_histogram = 13
7990 [(android.os.statsd.log_mode) = MODE_BYTES];
7991
7992 // The gpu frame time histogram for the package
7993 optional FrameTimingHistogram gpu_histogram = 14
7994 [(android.os.statsd.log_mode) = MODE_BYTES];
7995
7996 // UI mainline module version.
7997 optional int64 version_ui_module = 15;
7998
7999 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8000 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8001 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8002 // more apps are running / rendering.
8003 optional bool is_today = 16;
8004}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008005
8006/**
8007 * Message related to dangerous (runtime) app ops access
8008 */
8009message RuntimeAppOpsAccess {
8010 // Uid of the package accessing app op
8011 optional int32 uid = 1 [(is_uid) = true];
8012
8013 // Name of the package accessing app op
8014 optional string package_name = 2;
8015
8016 // operation id; maps to the OP_* constants in AppOpsManager.java
8017 optional int32 op_id = 3;
8018
8019 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
8020 // Features must be provided through manifest using <feature> tag available in R and above.
8021 optional string feature_id = 4;
8022
8023 // message related to app op access, limited to 600 chars by API
8024 optional string message = 5;
8025
8026 enum SamplingStrategy {
8027 DEFAULT = 0;
8028 UNIFORM = 1;
8029 RARELY_USED = 2;
8030 }
8031
8032 // sampling strategy used to collect this message
8033 optional SamplingStrategy sampling_strategy = 6;
8034}
8035
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008036/*
8037 * Logs userspace reboot outcome and duration.
8038 *
8039 * Logged from:
8040 * frameworks/base/core/java/com/android/server/BootReceiver.java
8041 */
8042message UserspaceRebootReported {
8043 // Possible outcomes of userspace reboot.
8044 enum Outcome {
8045 // Default value in case platform failed to determine the outcome.
8046 OUTCOME_UNKNOWN = 0;
8047 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8048 SUCCESS = 1;
8049 // Userspace reboot shutdown sequence was aborted.
8050 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8051 // Remounting userdata into checkpointing mode failed.
8052 FAILED_USERDATA_REMOUNT = 3;
8053 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8054 // reboot.
8055 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8056 }
8057 // Outcome of userspace reboot. Always set.
8058 optional Outcome outcome = 1;
8059 // Duration of userspace reboot in case it has a successful outcome.
8060 // Duration is measured as time between userspace reboot was initiated and until boot completed
8061 // (e.g. sys.boot_completed=1).
8062 optional int64 duration_millis = 2;
8063 // State of primary user's (user0) credential encryption storage.
8064 enum UserEncryptionState {
8065 // Default value.
8066 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8067 // Credential encrypted storage is unlocked.
8068 UNLOCKED = 1;
8069 // Credential encrypted storage is locked.
8070 LOCKED = 2;
8071 }
8072 // State of primary user's encryption storage at the moment boot completed. Always set.
8073 optional UserEncryptionState user_encryption_state = 3;
8074}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008075
8076/*
8077 * Logs integrity check information during each install.
8078 *
8079 * Logged from:
8080 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8081 */
8082message IntegrityCheckResultReported {
8083 optional string package_name = 1;
8084 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008085 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008086 optional string installer_package_name = 4;
8087 enum Response {
8088 UNKNOWN = 0;
8089 ALLOWED = 1;
8090 REJECTED = 2;
8091 FORCE_ALLOWED = 3;
8092 }
8093 optional Response response = 5;
8094 // An estimate on the cause of the response. This will only be populated for
8095 // REJECTED and FORCE_ALLOWED
8096 optional bool caused_by_app_cert_rule = 6;
8097 optional bool caused_by_installer_rule = 7;
8098}
8099
8100/**
8101 * Logs the information about the rules and the provider whenever rules are
8102 * pushed into AppIntegrityManager.
8103 *
8104 * Logged from:
8105 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8106 */
8107message IntegrityRulesPushed {
8108 optional bool success = 1;
8109 // Package name of the app that pushed the rules.
8110 optional string rule_provider = 2;
8111 // Version string of arbitrary format provided by the rule provider to
8112 // identify the rules.
8113 optional string rule_version = 3;
8114}