blob: 5ac00d05f0225eb036d4dfe4b73b27aa1a37ad32 [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;
Muhammad Qureshidbe9e812020-01-25 07:41:39 -0800140 CallStateChanged call_state_changed = 61 [(module) = "telecom"];
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;
Muhammad Qureshia4efed82020-01-23 13:53:51 -0800154 MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
155 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
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;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800258 DeviceIdentifierAccessDenied device_identifier_access_denied =
259 172 [(module) = "telephony_common"];
Steven Wu552f63f2019-02-05 13:41:36 -0500260 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800261 AssistGestureStageReported assist_gesture_stage_reported = 174;
262 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
263 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800264 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000265 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800266 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700267 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800268 180 [(module) = "permissioncontroller"];
Carmen Agimof6688a352019-01-30 19:36:04 +0000269 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800270 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000271 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700272 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700273 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
274 TombStoneOccurred tomb_stone_occurred = 186;
Jack He71426802019-04-02 13:32:52 -0700275 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
Ben Blount763a5d52019-04-10 11:48:58 -0700276 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800277 188 [(module) = "intelligence"];
Tej Singha72344992019-04-17 18:55:08 -0700278 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed = 189;
Hai Zhang5d3328d2019-04-13 21:25:06 +0800279 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800280 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800281 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
282 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
283 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
284 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
285 MediametricsCodecReported mediametrics_codec_reported = 195;
286 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
287 MediametricsExtractorReported mediametrics_extractor_reported = 197;
288 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
289 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
290 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700291 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800292 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
293 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800294 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Adam He420947c2019-01-23 15:59:09 -0800295 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported = 206;
296 ContentCaptureServiceEvents content_capture_service_events = 207;
297 ContentCaptureSessionEvents content_capture_session_events = 208;
298 ContentCaptureFlushed content_capture_flushed = 209;
Hongyi Zhang700137e2019-05-23 21:19:36 -0700299 LocationManagerApiUsageReported location_manager_api_usage_reported = 210;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100300 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800301 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100302 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800303 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100304 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800305 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100306 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800307 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100308 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800309 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100310 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800311 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100312 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800313 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100314 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800315 218 [(module) = "permissioncontroller"];
316 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
317 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
318 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
319 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -0700320 ExclusionRectStateChanged exclusion_rect_state_changed = 223;
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800321 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700322 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
323 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Emilian Peev6729f372019-08-29 09:14:09 -0700324 CameraActionEvent camera_action_event = 227;
atrost01a20932019-08-28 15:40:37 +0100325 AppCompatibilityChangeReported app_compatibility_change_reported =
326 228 [(allow_from_any_uid) = true];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800327 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800328 VmsClientConnectionStateChanged vms_client_connection_state_changed =
329 230 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800330 MediaProviderScanEvent media_provider_scan_event = 233 [(module) = "mediaprovider"];
331 MediaProviderDeletionEvent media_provider_deletion_event = 234 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700332 MediaProviderPermissionEvent media_provider_permission_event =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800333 235 [(module) = "mediaprovider"];
334 MediaProviderSchemaChange media_provider_schema_change = 236 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700335 MediaProviderIdleMaintenance media_provider_idle_maintenance =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800336 237 [(module) = "mediaprovider"];
Kenny Root4eacaaa2020-01-08 20:48:13 -0800337 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238;
Keun young Park3e033cb2019-12-18 11:27:35 -0800338 BootTimeEventDuration boot_time_event_duration_reported = 239;
339 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported = 240;
340 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
341 BootTimeEventErrorCode boot_time_event_error_code_reported = 242;
Nikita Ioffe41dd57e2020-01-10 16:05:08 +0000342 UserspaceRebootReported userspace_reboot_reported = 243;
Will Brockman079fdaa2020-01-12 16:45:03 -0500343 NotificationReported notification_reported = 244;
344 NotificationPanelReported notification_panel_reported = 245;
345 NotificationChannelModified notification_panel_modified = 246;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +0000346 IntegrityCheckResultReported integrity_check_result_reported = 247;
347 IntegrityRulesPushed integrity_rules_pushed = 248;
Jordan Liubedfa702019-12-20 15:08:45 -0800348 CellBroadcastMessageReported cb_message_reported =
349 249 [(module) = "cellbroadcast"];
350 CellBroadcastMessageError cb_message_error =
351 250 [(module) = "cellbroadcast"];
Yao Chend54f9dd2017-10-17 17:37:48 +0000352 }
David Chenc8a43242017-10-17 16:23:28 -0700353
David Chen6e3e6cb2018-01-03 16:14:06 -0800354 // Pulled events will start at field 10000.
Rafal Slawikbdd5a502020-01-14 14:14:29 +0000355 // Next: 10071
David Chenc8a43242017-10-17 16:23:28 -0700356 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800357 WifiBytesTransfer wifi_bytes_transfer = 10000;
358 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
359 MobileBytesTransfer mobile_bytes_transfer = 10002;
360 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800361 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800362 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800363 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800364 CpuTimePerFreq cpu_time_per_freq = 10008;
365 CpuTimePerUid cpu_time_per_uid = 10009;
366 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800367 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800368 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800369 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800370 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800371 SystemElapsedRealtime system_elapsed_realtime = 10014;
372 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800373 CpuActiveTime cpu_active_time = 10016;
374 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000375 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800376 RemainingBatteryCapacity remaining_battery_capacity = 10019;
377 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800378 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100379 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100380 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100381 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000382 DiskStats disk_stats = 10025;
383 DirectoryUsage directory_usage = 10026;
384 AppSize app_size = 10027;
385 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700386 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700387 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800388 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700389 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700390 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800391 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700392 ProcessCpuTime process_cpu_time = 10035;
Misha Wagner5a51e002018-10-03 15:04:09 +0100393 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700394 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800395 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
396 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
397 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000398 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800399 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800400 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800401 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000402 DebugElapsedClock debug_elapsed_clock = 10046;
403 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800404 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800405 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800406 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800407 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000408 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000409 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800410 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
411 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikbdd5a502020-01-14 14:14:29 +0000412 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true];
Carmen Agimofa769c152019-03-04 14:39:14 +0000413 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700414 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700415 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200416 AppOps app_ops = 10060;
Rafal Slawik77987ed2019-06-17 12:28:23 +0100417 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
Alec Mourie088e762019-07-02 13:10:55 -0700418 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
419 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Rafal Slawik7efcefb2019-09-20 11:16:20 +0100420 ProcessMemorySnapshot process_memory_snapshot = 10064;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800421 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Chris Wrencdea3b72019-11-22 16:58:17 -0500422 NotificationRemoteViews notification_remote_views = 10066;
Stanislav Zholninccb82e42019-11-29 18:59:49 +0000423 DangerousPermissionStateSampled dangerous_permission_state_sampled = 10067;
Stan Iliev637ba5e2019-08-16 13:43:08 -0400424 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin606454c2019-11-27 15:31:49 +0000425 RuntimeAppOpsAccess runtime_app_ops_access = 10069;
Rafal Slawikbdd5a502020-01-14 14:14:29 +0000426 IonHeapSize ion_heap_size = 10070;
David Chenc8a43242017-10-17 16:23:28 -0700427 }
yroa1fe77c2018-02-26 14:22:54 -0800428
Bookatz76aafcf2018-09-17 16:17:10 -0700429 // DO NOT USE field numbers above 100,000 in AOSP.
430 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
431 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100432
433 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700434}
435
Yao Chend54f9dd2017-10-17 17:37:48 +0000436/**
Yangster-mac20877162017-12-22 17:19:39 -0800437 * This proto represents a node of an attribution chain.
438 * Note: All attribution chains are represented as a repeated field of type
439 * AttributionNode. It is understood that in such arrays, the order is that
440 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000441 */
Yangster-mac20877162017-12-22 17:19:39 -0800442message AttributionNode {
443 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800444 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800445
Yangster-mac20877162017-12-22 17:19:39 -0800446 // The (optional) string tag for an element in the attribution chain. If the
447 // element has no tag, it is encoded as an empty string.
448 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700449}
450
Yangster-mac48b3d622018-08-18 12:38:11 -0700451message KeyValuePair {
452 optional int32 key = 1;
453 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700454 int32 value_int = 2;
455 int64 value_long = 3;
456 string value_str = 4;
457 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700458 }
459}
460
461message KeyValuePairsAtom {
462 optional int32 uid = 1;
463 repeated KeyValuePair pairs = 2;
464}
465
Yao Chend54f9dd2017-10-17 17:37:48 +0000466/*
467 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800468 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000469 *
470 * RULES:
471 * - The field ids for each atom must start at 1, and count upwards by 1.
472 * Skipping field ids is not allowed.
473 * - These form an API, so renaming, renumbering or removing fields is
474 * not allowed between android releases. (This is not currently enforced,
475 * but there will be a tool to enforce this restriction).
476 * - The types must be built-in protocol buffer types, namely, no sub-messages
477 * are allowed (yet). The bytes type is also not allowed.
478 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800479 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000480 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800481 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000482 * - A field that is a uid should be a string field, tagged with the [xxx]
483 * annotation. The generated code on android will be represented by UIDs,
484 * and those UIDs will be translated in xxx to those strings.
485 *
486 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700487 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000488 * - If there is a UID, it goes first. Think in an object-oriented fashion.
489 * *****************************************************************************
490 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700491
Yao Chend54f9dd2017-10-17 17:37:48 +0000492/**
Tej Singha72344992019-04-17 18:55:08 -0700493 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700494 * Logs when the Thermal service HAL notifies the throttling start/stop events.
495 *
496 * Logged from:
497 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
498 */
499message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700500 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700501 optional android.os.TemperatureTypeEnum sensor_type = 1;
502
Maggie White442b6312019-04-05 16:26:44 -0700503 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700504 enum State {
505 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700506 START = 1; // START indicated that throttling was triggered.
507 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700508 }
Yangster-mace16189a2018-08-26 12:20:16 -0700509 optional State state = 2;
510
511 optional float temperature = 3;
512}
513
514/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000515 * Logs when the screen state changes.
516 *
517 * Logged from:
518 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
519 */
520message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800521 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700522 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700523}
Yao Chend54f9dd2017-10-17 17:37:48 +0000524
525/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700526 * Logs that the process state of the uid, as determined by ActivityManager
527 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000528 *
529 * Logged from:
530 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
531 */
Bookatzc1a050a2017-10-10 15:49:28 -0700532message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700533 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000534
Bookatzdb026a22018-01-10 19:01:56 -0800535 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700536 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000537}
538
539/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700540 * Logs process state change of a process, as per the activity manager.
541 *
542 * Logged from:
543 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
544 */
545message ProcessStateChanged {
546 optional int32 uid = 1;
547 optional string process_name = 2;
548 optional string package_name = 3;
549 // TODO: remove this when validation is done
550 optional int64 version = 5;
551 // The state, from frameworks/base/core/proto/android/app/enums.proto.
552 optional android.app.ProcessStateEnum state = 4;
553}
554
555/**
556 * Logs when ActivityManagerService sleep state is changed.
557 *
558 * Logged from:
559 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
560 */
561message ActivityManagerSleepStateChanged {
562 // TODO: import frameworks proto
563 enum State {
564 UNKNOWN = 0;
565 ASLEEP = 1;
566 AWAKE = 2;
567 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700568 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700569}
570
571/**
572 * Logs when system memory state changes.
573 *
574 * Logged from:
575 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
576 */
577message MemoryFactorStateChanged {
578 // TODO: import frameworks proto
579 enum State {
580 MEMORY_UNKNOWN = 0;
581 NORMAL = 1; // normal.
582 MODERATE = 2; // moderate memory pressure.
583 LOW = 3; // low memory.
584 CRITICAL = 4; // critical memory.
585
586 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700587 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700588}
589
590/**
591 * Logs when app is using too much cpu, according to ActivityManagerService.
592 *
593 * Logged from:
594 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
595 */
596message ExcessiveCpuUsageReported {
597 optional int32 uid = 1;
598 optional string process_name = 2;
599 optional string package_name = 3;
600 // package version. TODO: remove this when validation is done
601 optional int64 version = 4;
602}
603
604/**
605 * Logs when a cached process is killed, along with its pss.
606 *
607 * Logged from:
608 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
609 */
610message CachedKillReported {
611 optional int32 uid = 1;
612 optional string process_name = 2;
613 optional string package_name = 3;
614 // TODO: remove this when validation is done
615 optional int64 version = 5;
616 optional int64 pss = 4;
617}
618
619/**
620 * Logs when memory stats of a process is reported.
621 *
622 * Logged from:
623 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
624 */
625message ProcessMemoryStatReported {
626 optional int32 uid = 1;
627 optional string process_name = 2;
628 optional string package_name = 3;
629 //TODO: remove this when validation is done
630 optional int64 version = 9;
631 optional int64 pss = 4;
632 optional int64 uss = 5;
633 optional int64 rss = 6;
634 enum Type {
635 ADD_PSS_INTERNAL_SINGLE = 0;
636 ADD_PSS_INTERNAL_ALL_MEM = 1;
637 ADD_PSS_INTERNAL_ALL_POLL = 2;
638 ADD_PSS_EXTERNAL = 3;
639 ADD_PSS_EXTERNAL_SLOW = 4;
640 }
641 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800642 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700643}
644
645/**
Bookatzc1a050a2017-10-10 15:49:28 -0700646 * Logs that a process started, finished, crashed, or ANRed.
647 *
648 * Logged from:
649 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
650 */
651message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700652 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700653
David Chen0b5c90c2018-01-25 16:51:49 -0800654 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800655 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700656
Bookatzddccf0a2017-11-28 16:48:14 -0800657 // What lifecycle state the process changed to.
658 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800659 enum State {
660 FINISHED = 0;
661 STARTED = 1;
662 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800663 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800664 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700665}
666
Bookatzc1a050a2017-10-10 15:49:28 -0700667/**
668 * Logs when the ble scan state changes.
669 *
670 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700671 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700672 */
673message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800674 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700675
676 enum State {
677 OFF = 0;
678 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700679 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
680 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700681 }
682 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700683
Bookatze5ec0b42018-03-26 13:34:56 -0700684 // Does the scan have a filter.
685 optional bool is_filtered = 3;
686 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
687 optional bool is_first_match = 4;
688 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
689 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700690}
691
692/**
693 * Logs reporting of a ble scan finding results.
694 *
695 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700696 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700697 */
Bookatzae6738e2018-09-13 11:38:56 -0700698// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700699message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800700 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700701
702 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800703 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700704}
705
706/**
707 * Logs when a sensor state changes.
708 *
709 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700710 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700711 */
712message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800713 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700714
Bookatzc1a050a2017-10-10 15:49:28 -0700715 // The id (int) of the sensor.
716 optional int32 sensor_id = 2;
717
718 enum State {
719 OFF = 0;
720 ON = 1;
721 }
722 optional State state = 3;
723}
724
Bookatzc1a050a2017-10-10 15:49:28 -0700725/**
726 * Logs when GPS state changes.
727 *
728 * Logged from:
729 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
730 */
731message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800732 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700733
734 enum State {
735 OFF = 0;
736 ON = 1;
737 }
738 optional State state = 2;
739}
740
Bookatz48d362e2018-11-06 15:49:08 -0800741/**
742 * Logs when GPS signal quality.
743 *
744 * Logged from:
745 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
746 */
747message GpsSignalQualityChanged {
748 optional android.server.location.GpsSignalQualityEnum level = 1;
749}
750
Bookatzc1a050a2017-10-10 15:49:28 -0700751
752/**
753 * Logs when a sync manager sync state changes.
754 *
755 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700756 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700757 */
758message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800759 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700760
David Chen0b5c90c2018-01-25 16:51:49 -0800761 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800762 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700763
764 enum State {
765 OFF = 0;
766 ON = 1;
767 }
768 optional State state = 3;
769}
770
Yangster-mac96353002018-09-05 11:18:55 -0700771/*
772 * Deferred job stats.
773 *
774 * Logged from:
775 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
776*/
777message DeferredJobStatsReported {
778 repeated AttributionNode attribution_node = 1;
779
780 // Number of jobs deferred.
781 optional int32 num_jobs_deferred = 2;
782
783 // Time since the last job runs.
784 optional int64 time_since_last_job_millis = 3;
785}
786
Bookatzc1a050a2017-10-10 15:49:28 -0700787/**
788 * Logs when a job scheduler job state changes.
789 *
790 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700791 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700792 */
793message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800794 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700795
796 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800797 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700798
799 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800800 FINISHED = 0;
801 STARTED = 1;
802 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700803 }
804 optional State state = 3;
805
Tej Singh33a412b2018-03-16 18:43:59 -0700806 // The reason a job has stopped.
807 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700808 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700809 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100810
811 // The standby bucket of the app that scheduled the job. These match the framework constants
812 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
813 // already assigned 0.
814 enum Bucket {
815 UNKNOWN = -1;
816 ACTIVE = 0;
817 WORKING_SET = 1;
818 FREQUENT = 2;
819 RARE = 3;
820 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -0800821 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +0100822 }
823 optional Bucket standby_bucket = 5 [default = UNKNOWN];
824
825 // The job id (as assigned by the app).
826 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700827}
828
829/**
830 * Logs when the audio state changes.
831 *
832 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700833 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700834 */
835message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800836 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700837
838 enum State {
839 OFF = 0;
840 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700841 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
842 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700843 }
844 optional State state = 2;
845}
846
847/**
848 * Logs when the video codec state changes.
849 *
850 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700851 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700852 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800853message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800854 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700855
856 enum State {
857 OFF = 0;
858 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700859 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
860 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700861 }
862 optional State state = 2;
863}
864
865/**
866 * Logs when the flashlight state changes.
867 *
868 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700869 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700870 */
871message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800872 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700873
874 enum State {
875 OFF = 0;
876 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700877 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
878 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700879 }
880 optional State state = 2;
881}
882
883/**
884 * Logs when the camera state changes.
885 *
886 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700887 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700888 */
889message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800890 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700891
892 enum State {
893 OFF = 0;
894 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700895 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
896 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700897 }
898 optional State state = 2;
899}
900
901/**
902 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000903 *
904 * Logged from:
905 * TODO
906 */
Bookatzd6746242017-10-24 18:39:35 -0700907message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -0800908 repeated AttributionNode attribution_node = 1
909 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +0000910
Bookatz1a1b0462018-01-12 11:47:03 -0800911 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
912 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristineed615642020-01-02 12:53:41 -0800913 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY];
914 ;
Bookatzc1a050a2017-10-10 15:49:28 -0700915
916 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristineed615642020-01-02 12:53:41 -0800917 optional string tag = 3 [(state_field_option).option = PRIMARY];
Bookatzc1a050a2017-10-10 15:49:28 -0700918
919 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800920 RELEASE = 0;
921 ACQUIRE = 1;
922 CHANGE_RELEASE = 2;
923 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700924 }
tsaichristineed615642020-01-02 12:53:41 -0800925 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Bookatzc1a050a2017-10-10 15:49:28 -0700926}
927
928/**
Bookatzc1a050a2017-10-10 15:49:28 -0700929 * Logs when a partial wakelock is considered 'long' (over 1 min).
930 *
931 * Logged from:
932 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
933 */
934message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800935 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700936
Yao Chend54f9dd2017-10-17 17:37:48 +0000937 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
938 optional string tag = 2;
939
Bookatzc1a050a2017-10-10 15:49:28 -0700940 // TODO: I have no idea what this is.
941 optional string history_tag = 3;
942
943 enum State {
944 OFF = 0;
945 ON = 1;
946 }
947 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000948}
949
Bookatzc1a050a2017-10-10 15:49:28 -0700950/**
Bookatza66083f2018-09-20 17:24:00 -0700951 * Logs when the device is interactive, according to the PowerManager Notifier.
952 *
953 * Logged from:
954 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
955 */
956message InteractiveStateChanged {
957 enum State {
958 OFF = 0;
959 ON = 1;
960 }
961 optional State state = 1;
962}
963
964/**
Bookatzc1a050a2017-10-10 15:49:28 -0700965 * Logs Battery Saver state change.
966 *
967 * Logged from:
968 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
969 */
970message BatterySaverModeStateChanged {
971 enum State {
972 OFF = 0;
973 ON = 1;
974 }
975 optional State state = 1;
976}
977
978/**
979 * Logs Doze mode state change.
980 *
981 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800982 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700983 */
984message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800985 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800986}
987
988
989/**
990 * Logs state change of Doze mode including maintenance windows.
991 *
992 * Logged from:
993 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
994 */
995message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800996 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700997}
998
999/**
1000 * Logs screen brightness level.
1001 *
1002 * Logged from:
1003 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1004 */
1005message ScreenBrightnessChanged {
1006 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1007 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001008}
1009
1010/**
1011 * Logs battery level (percent full, from 0 to 100).
1012 *
1013 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001014 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001015 */
1016message BatteryLevelChanged {
1017 // Battery level. Should be in [0, 100].
1018 optional int32 battery_level = 1;
1019}
1020
1021/**
1022 * Logs change in charging status of the device.
1023 *
1024 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001025 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001026 */
1027message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001028 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1029 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001030}
1031
1032/**
1033 * Logs whether the device is plugged in, and what power source it is using.
1034 *
1035 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001036 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001037 */
1038message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001039 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1040 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001041}
1042
Bookatz8c6571b2017-10-24 15:04:41 -07001043/**
1044 * Logs when an app's wakeup alarm fires.
1045 *
1046 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001047 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001048 */
1049message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001050 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001051
1052 // Name of the wakeup alarm.
1053 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001054
1055 // Name of source package (for historical reasons, since BatteryStats tracked it).
1056 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001057
1058 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1059 enum Bucket {
1060 UNKNOWN = 0;
1061 EXEMPTED = 5;
1062 ACTIVE = 10;
1063 WORKING_SET = 20;
1064 FREQUENT = 30;
1065 RARE = 40;
1066 NEVER = 50;
1067 }
1068 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1069 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001070}
1071
1072/**
1073 * Logs when an an app causes the mobile radio to change state.
1074 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1075 *
1076 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001077 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001078 */
1079message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001080 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001081
Bookatz1a1b0462018-01-12 11:47:03 -08001082 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1083 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001084}
1085
1086/**
1087 * Logs when an an app causes the wifi radio to change state.
1088 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1089 *
1090 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001091 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001092 */
1093message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001094 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001095
Bookatz1a1b0462018-01-12 11:47:03 -08001096 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1097 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001098}
1099
1100/**
1101 * Logs kernel wakeup reasons and aborts.
1102 *
1103 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001104 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001105 */
1106message KernelWakeupReported {
1107 // Name of the kernel wakeup reason (or abort).
1108 optional string wakeup_reason_name = 1;
1109
1110 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001111 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001112}
1113
1114/**
Bookatzda1798c2018-12-13 14:16:00 -08001115 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001116 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001117 *
1118 * Logged from:
1119 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1120 */
1121message WifiEnabledStateChanged {
1122 enum State {
1123 OFF = 0;
1124 ON = 1;
1125 }
1126 optional State state = 1;
1127}
1128
1129/**
1130 * 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 -08001131 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1132 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001133 *
1134 * Logged from:
1135 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1136 */
1137message WifiRunningStateChanged {
1138 repeated AttributionNode attribution_node = 1;
1139
1140 enum State {
1141 OFF = 0;
1142 ON = 1;
1143 }
1144 optional State state = 2;
1145}
1146
1147/**
Bookatze5885242017-10-24 20:10:31 -07001148 * Logs wifi locks held by an app.
1149 *
1150 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001151 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001152 */
1153message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001154 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001155
1156 enum State {
1157 OFF = 0;
1158 ON = 1;
1159 }
1160 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001161
1162 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1163 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001164}
1165
1166/**
1167 * Logs wifi signal strength changes.
1168 *
1169 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001170 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001171 */
1172message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001173 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1174 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001175}
1176
1177/**
1178 * Logs wifi scans performed by an app.
1179 *
1180 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001181 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001182 */
1183message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001184 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001185
1186 enum State {
1187 OFF = 0;
1188 ON = 1;
1189 }
1190 optional State state = 2;
1191}
1192
1193/**
Tej Singh4503e102018-01-04 14:35:01 -08001194 * Logs wifi multicast locks held by an app
1195 *
1196 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001197 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001198 */
1199message WifiMulticastLockStateChanged {
1200 repeated AttributionNode attribution_node = 1;
1201
1202 enum State {
1203 OFF = 0;
1204 ON = 1;
1205 }
1206 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001207
1208 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001209}
1210
1211/**
Tej Singh1ea42892018-01-19 09:27:00 -08001212 * Logs shutdown reason and duration on next boot.
1213 *
1214 * Logged from:
1215 * frameworks/base/core/java/com/android/server/BootReceiver.java
1216 */
1217message ShutdownSequenceReported {
1218 // True if shutdown is for a reboot. Default: false if we do not know.
1219 optional bool reboot = 1;
1220
1221 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1222 optional string reason = 2;
1223
1224 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1225 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001226 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001227
1228 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001229 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001230}
1231
Tej Singh6483ea42018-01-25 17:45:49 -08001232
1233/**
1234 * Logs boot reason and duration.
1235 *
1236 * Logged from:
1237 * system/core/bootstat/bootstat.cpp
1238 */
1239message BootSequenceReported {
1240 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1241 // Default: "<EMPTY>" if not available.
1242 optional string bootloader_reason = 1;
1243
1244 // Reason for system boot. Eg. bootloader, reboot,userrequested
1245 // Default: "<EMPTY>" if not available.
1246 optional string system_reason = 2;
1247
1248 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001249 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001250
1251 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001252 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001253
1254 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001255 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001256
1257 // Time since last boot in ms. Default: 0 if not available.
1258 optional int64 time_since_last_boot = 6;
1259}
1260
Tej Singhc477d9c2018-02-05 18:31:39 -08001261
1262/**
1263 * Logs call state and disconnect cause (if applicable).
1264 *
1265 * Logged from:
1266 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1267 */
1268message CallStateChanged {
1269 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1270 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1271 optional android.telecom.CallStateEnum call_state = 1;
1272
1273 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1274 // This value is only applicable when the call_state is DISCONNECTED, and
1275 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1276 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1277 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1278
1279 // True if the call is self-managed, which are apps that use the
1280 // telecom infrastructure to make their own calls.
1281 optional bool self_managed = 3;
1282
1283 // True if call is external. External calls are calls on connected Wear
1284 // devices but show up in Telecom so the user can pull them onto the device.
1285 optional bool external_call = 4;
1286}
1287
Tej Singh1ea42892018-01-19 09:27:00 -08001288/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001289 * Logs keyguard state. The keyguard is the lock screen.
1290 *
1291 * Logged from:
1292 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1293 */
1294message KeyguardStateChanged {
1295 enum State {
1296 UNKNOWN = 0;
1297 // The keyguard is hidden when the phone is unlocked.
1298 HIDDEN = 1;
1299 // The keyguard is shown when the phone is locked (screen turns off).
1300 SHOWN= 2;
1301 // The keyguard is occluded when something is overlaying the keyguard.
1302 // Eg. Opening the camera while on the lock screen.
1303 OCCLUDED = 3;
1304 }
1305 optional State state = 1;
1306}
1307
1308/**
1309 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1310 * prompts the user to enter a password (pattern, pin, etc).
1311 *
1312 * Logged from:
1313 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1314 */
1315
1316message KeyguardBouncerStateChanged {
1317 enum State {
1318 UNKNOWN = 0;
1319 // Bouncer is hidden, either as a result of successfully entering the
1320 // password, screen timing out, or user going back to lock screen.
1321 HIDDEN = 1;
1322 // This is when the user is being prompted to enter the password.
1323 SHOWN = 2;
1324 }
1325 optional State state = 1;
1326}
1327
1328/**
1329 * Logs the result of entering a password into the keyguard bouncer.
1330 *
1331 * Logged from:
1332 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1333 */
1334message KeyguardBouncerPasswordEntered {
1335 enum BouncerResult {
1336 UNKNOWN = 0;
1337 // The password entered was incorrect.
1338 FAILURE = 1;
1339 // The password entered was correct.
1340 SUCCESS = 2;
1341 }
1342 optional BouncerResult result = 1;
1343}
1344
Tej Singha883b372018-02-15 11:30:01 -08001345/*
1346 * Logs changes to the configuration of the device. The configuration is defined
1347 * in frameworks/base/core/java/android/content/res/Configuration.java
1348 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1349 * Please go there to interpret the possible values each field can be.
1350 *
1351 * Logged from:
1352 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1353 */
1354message ResourceConfigurationChanged {
1355 // Bit mask of color capabilities of the screen.
1356 // Contains information about the color gamut and hdr mode of the screen.
1357 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001358 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001359
1360 // The target screen density being rendered to.
1361 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001362 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001363
1364 // Current user preference for the scaling factor for fonts,
1365 // relative to the base density scaling.
1366 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001367 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001368
1369 // Flag indicating whether the hard keyboard is hidden.
1370 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001371 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001372
1373 // The type of keyboard attached to the device.
1374 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1375 optional int32 keyboard = 5;
1376
1377 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1378 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001379 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001380
1381 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1382 // 0 if undefined.
1383 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1384 optional int32 mcc = 7;
1385
1386 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1387 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1388 // MNC_ZERO symbol defined in Configuration.java.
1389 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1390 optional int32 mnc = 8;
1391
1392 // The kind of navigation available on the device.
1393 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1394 optional int32 navigation = 9;
1395
1396 // Flag indicating whether the navigation is available.
1397 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001398 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001399
1400 // Overall orientation of the screen.
1401 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1402 optional int32 orientation = 11;
1403
1404 // The current height of the available screen space, in dp units.
1405 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001406 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001407
1408 // Bit mask of overall layout of the screen.
1409 // Contains information about screen size, whether the screen is wider/taller
1410 // than normal, whether the screen layout is right-tl-left or left-to-right,
1411 // and whether the screen has a rounded shape.
1412 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001413 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001414
1415 // Current width of the available screen space, in dp units.
1416 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001417 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001418
1419 // The smallest screen size an application will see in normal operation.
1420 // This is the smallest value of both screenWidthDp and screenHeightDp
1421 // in portrait and landscape.
1422 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001423 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001424
1425 // The type of touch screen attached to the device.
1426 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1427 optional int32 touchscreen = 16;
1428
1429 // Bit mask of the ui mode.
1430 // Contains information about the overall ui mode of the device.
1431 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1432 // Also contains information about whether the device is in night mode.
1433 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001434 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001435}
1436
Tej Singheee317b2018-03-07 19:28:05 -08001437
1438/**
1439 * Logs changes in the connection state of the mobile radio.
1440 *
1441 * Logged from:
1442 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1443 */
1444message MobileConnectionStateChanged {
1445 // States are from the state machine DataConnection.java.
1446 enum State {
1447 UNKNOWN = 0;
1448 // The connection is inactive, or disconnected.
1449 INACTIVE = 1;
1450 // The connection is being activated, or connecting.
1451 ACTIVATING = 2;
1452 // The connection is active, or connected.
1453 ACTIVE = 3;
1454 // The connection is disconnecting.
1455 DISCONNECTING = 4;
1456 // The connection is disconnecting after creating a connection.
1457 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1458 }
1459 optional State state = 1;
1460 // For multi-sim phones, this distinguishes between the sim cards.
1461 optional int32 sim_slot_index = 2;
1462 // Used to identify the connection. Starts at 0 and increments by 1 for
1463 // every new network created. Resets whenever the device reboots.
1464 optional int32 data_connection_id = 3;
1465 // A bitmask for the capabilities of this connection.
1466 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1467 // Default value (if we have no information): 0
1468 optional int64 capabilities = 4;
1469 // If this connection has internet.
1470 // This just checks if the DEFAULT bit of capabilities is set.
1471 optional bool has_internet = 5;
1472}
1473
1474/**
1475 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1476 *
1477 * Logged from:
1478 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1479 */
1480message MobileRadioTechnologyChanged {
1481 optional android.telephony.NetworkTypeEnum state = 1;
1482 // For multi-sim phones, this distinguishes between the sim cards.
1483 optional int32 sim_slot_index = 2;
1484}
1485
Andrew Chantb56388b2018-03-22 21:07:33 -07001486/**
1487 * Logs the VID and PID of any connected USB devices.
1488 *
1489 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1490 *
1491 * Logged by Vendor.
1492 */
1493message UsbDeviceAttached {
1494 optional int32 vid = 1;
1495 optional int32 pid = 2;
1496 optional bool has_audio = 3;
1497 optional bool has_hid = 4;
1498 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001499 enum State {
1500 STATE_DISCONNECTED = 0;
1501 STATE_CONNECTED = 1;
1502 }
1503 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001504 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001505}
1506
Tej Singheee317b2018-03-07 19:28:05 -08001507
Tej Singhdd7bd352018-02-09 19:33:15 -08001508/**
Tej Singh5d991e12018-03-09 19:48:11 -08001509 * Logs when Bluetooth is enabled and disabled.
1510 *
1511 * Logged from:
1512 * services/core/java/com/android/server/BluetoothManagerService.java
1513 */
1514message BluetoothEnabledStateChanged {
1515 repeated AttributionNode attribution_node = 1;
1516 // Whether or not bluetooth is enabled on the device.
1517 enum State {
1518 UNKNOWN = 0;
1519 ENABLED = 1;
1520 DISABLED = 2;
1521 }
1522 optional State state = 2;
1523 // The reason for being enabled/disabled.
1524 // Eg. Airplane mode, crash, application request.
1525 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1526 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001527 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001528}
1529
1530/**
Jack Hed9837c82019-01-09 01:19:13 -08001531 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001532 *
1533 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001534 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1535 *
1536 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001537 */
1538message BluetoothConnectionStateChanged {
1539 // The state of the connection.
1540 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1541 optional android.bluetooth.ConnectionStateEnum state = 1;
1542 // An identifier that can be used to match connect and disconnect events.
1543 // Currently is last two bytes of a hash of a device level ID and
1544 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001545 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001546 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001547 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1548 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001549 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001550 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001551 // An identifier that can be used to match events for this device.
1552 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1553 // Salt: Randomly generated 256 bit value
1554 // Hash algorithm: HMAC-SHA256
1555 // Size: 32 byte
1556 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001557 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001558}
1559
1560/**
1561 * Logs when a Bluetooth device connects and disconnects over ACL
1562 *
1563 * Logged from:
1564 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1565 *
1566 * Next Tag: 3
1567 */
1568message BluetoothAclConnectionStateChanged {
1569 // An identifier that can be used to match events for this device.
1570 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1571 // Salt: Randomly generated 256 bit value
1572 // Hash algorithm: HMAC-SHA256
1573 // Size: 32 byte
1574 // Default: null or empty if the device identifier is not known
1575 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1576 // The state of the connection.
1577 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1578 optional android.bluetooth.ConnectionStateEnum state = 2;
1579}
1580
1581/**
1582 * Logs when a Bluetooth device connects and disconnects over SCO
1583 *
1584 * Logged from:
1585 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1586 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1587 *
1588 * Next Tag: 4
1589 */
1590message BluetoothScoConnectionStateChanged {
1591 // An identifier that can be used to match events for this device.
1592 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1593 // Salt: Randomly generated 256 bit value
1594 // Hash algorithm: HMAC-SHA256
1595 // Size: 32 byte
1596 // Default: null or empty if the device identifier is not known
1597 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1598 // The state of the connection.
1599 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1600 optional android.bluetooth.ConnectionStateEnum state = 2;
1601 // Codec used for this SCO connection
1602 // Default: UNKNOWN
1603 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001604}
1605
Jack Hec27040a2019-01-09 20:54:41 -08001606/**
1607 * Logged when active device of a profile changes
1608 *
1609 * Logged from:
1610 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1611 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1612 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1613 */
1614message BluetoothActiveDeviceChanged {
1615 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1616 // From android.bluetooth.BluetoothProfile
1617 optional int32 bt_profile = 1;
1618 // An identifier that can be used to match events for this new active device.
1619 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1620 // Salt: Randomly generated 256 bit value
1621 // Hash algorithm: HMAC-SHA256
1622 // Size: 32 byte
1623 // Default: null or empty if there is no active device for this profile
1624 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1625}
1626
Jack Heab86dbd22018-12-18 15:43:27 -08001627// Logs when there is an event affecting Bluetooth device's link layer connection.
1628// - This event is triggered when there is a related HCI command or event
1629// - Users of this metrics can deduce Bluetooth device's connection state from these events
1630// - HCI commands are logged before the command is sent, after receiving command status, and after
1631// receiving command complete
1632// - HCI events are logged when they arrive
1633//
1634// Low level log from system/bt
1635//
1636// Bluetooth classic commands:
1637// - CMD_CREATE_CONNECTION
1638// - CMD_DISCONNECT
1639// - CMD_CREATE_CONNECTION_CANCEL
1640// - CMD_ACCEPT_CONNECTION_REQUEST
1641// - CMD_REJECT_CONNECTION_REQUEST
1642// - CMD_SETUP_ESCO_CONNECTION
1643// - CMD_ACCEPT_ESCO_CONNECTION
1644// - CMD_REJECT_ESCO_CONNECTION
1645// - CMD_ENH_SETUP_ESCO_CONNECTION
1646// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1647//
1648// Bluetooth low energy commands:
1649// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1650// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1651// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1652// - CMD_BLE_CLEAR_WHITE_LIST
1653// - CMD_BLE_ADD_WHITE_LIST
1654// - CMD_BLE_REMOVE_WHITE_LIST
1655//
1656// Bluetooth classic events:
1657// - EVT_CONNECTION_COMP
1658// - EVT_CONNECTION_REQUEST
1659// - EVT_DISCONNECTION_COMP
1660// - EVT_ESCO_CONNECTION_COMP
1661// - EVT_ESCO_CONNECTION_CHANGED
1662//
1663// Bluetooth low energy meta events:
1664// - BLE_EVT_CONN_COMPLETE_EVT
1665// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1666//
1667// Next tag: 10
1668message BluetoothLinkLayerConnectionEvent {
1669 // An identifier that can be used to match events for this device.
1670 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1671 // Salt: Randomly generated 256 bit value
1672 // Hash algorithm: HMAC-SHA256
1673 // Size: 32 byte
1674 // Default: null or empty if the device identifier is not known
1675 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1676 // Connection handle of this connection if available
1677 // Range: 0x0000 - 0x0EFF (12 bits)
1678 // Default: 0xFFFF if the handle is unknown
1679 optional int32 connection_handle = 2;
1680 // Direction of the link
1681 // Default: DIRECTION_UNKNOWN
1682 optional android.bluetooth.DirectionEnum direction = 3;
1683 // Type of this link
1684 // Default: LINK_TYPE_UNKNOWN
1685 optional android.bluetooth.LinkTypeEnum type = 4;
1686
1687 // Reason metadata for this link layer connection event, rules for interpretation:
1688 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1689 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1690 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1691 // set and valid, ignore hci_ble_event
1692
1693 // HCI command associated with this event
1694 // Default: CMD_UNKNOWN
1695 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1696 // HCI event associated with this event
1697 // Default: EVT_UNKNOWN
1698 optional android.bluetooth.hci.EventEnum hci_event = 6;
1699 // HCI BLE meta event associated with this event
1700 // Default: BLE_EVT_UNKNOWN
1701 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1702 // HCI command status code if this is triggerred by hci_cmd
1703 // Default: STATUS_UNKNOWN
1704 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1705 // HCI reason code associated with this event
1706 // Default: STATUS_UNKNOWN
1707 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1708}
1709
Howard Roe103fe22019-01-17 16:52:16 -08001710/**
1711 * Logs when a module is rolled back by Watchdog.
1712 *
1713 * Logged from: Rollback Manager
1714 */
1715message WatchdogRollbackOccurred {
1716 enum RollbackType {
1717 UNKNOWN = 0;
1718 ROLLBACK_INITIATE = 1;
1719 ROLLBACK_SUCCESS = 2;
1720 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001721 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001722 }
1723 optional RollbackType rollback_type = 1;
1724
1725 optional string package_name = 2;
1726
1727 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001728
1729 enum RollbackReasonType {
1730 REASON_UNKNOWN = 0;
1731 REASON_NATIVE_CRASH = 1;
1732 REASON_EXPLICIT_HEALTH_CHECK = 2;
1733 REASON_APP_CRASH = 3;
1734 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001735 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001736 }
1737 optional RollbackReasonType rollback_reason = 4;
1738
1739 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1740 // is initiated. Empty if the package is unknown.
1741 optional string failing_package_name = 5;
Howard Roe103fe22019-01-17 16:52:16 -08001742}
1743
Jack Hec27040a2019-01-09 20:54:41 -08001744/**
1745 * Logs when there is a change in Bluetooth A2DP playback state
1746 *
1747 * Logged from:
1748 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1749 */
1750message BluetoothA2dpPlaybackStateChanged {
1751 // An identifier that can be used to match events for this device.
1752 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1753 // Salt: Randomly generated 256 bit value
1754 // Hash algorithm: HMAC-SHA256
1755 // Size: 32 byte
1756 // Default: null or empty if the device identifier is not known
1757 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1758 // Current playback state
1759 // Default: PLAYBACK_STATE_UNKNOWN
1760 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1761 // Current audio coding mode
1762 // Default: AUDIO_CODING_MODE_UNKNOWN
1763 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1764}
1765
1766/**
1767 * Logs when there is a change in A2DP codec config for a particular remote device
1768 *
1769 * Logged from:
1770 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1771 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1772 */
1773message BluetoothA2dpCodecConfigChanged {
1774 // An identifier that can be used to match events for this device.
1775 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1776 // Salt: Randomly generated 256 bit value
1777 // Hash algorithm: HMAC-SHA256
1778 // Size: 32 byte
1779 // Default: null or empty if the device identifier is not known
1780 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1781 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1782 // Default SOURCE_CODEC_TYPE_INVALID
1783 optional int32 codec_type = 2;
1784 // Codec priroity, the higher the more preferred, -1 for disabled
1785 // Default: CODEC_PRIORITY_DEFAULT
1786 optional int32 codec_priority = 3;
1787 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1788 // Default: SAMPLE_RATE_NONE
1789 optional int32 sample_rate = 4;
1790 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1791 // Default: BITS_PER_SAMPLE_NONE
1792 optional int32 bits_per_sample = 5;
1793 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1794 // Default: CHANNEL_MODE_NONE
1795 optional int32 channel_mode = 6;
1796 // Codec specific values
1797 // Default 0
1798 optional int64 codec_specific_1 = 7;
1799 optional int64 codec_specific_2 = 8;
1800 optional int64 codec_specific_3 = 9;
1801 optional int64 codec_specific_4 = 10;
1802}
1803
1804/**
1805 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1806 * Each codec's capability is logged separately due to statsd restriction
1807 *
1808 * Logged from:
1809 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1810 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1811 */
1812message BluetoothA2dpCodecCapabilityChanged {
1813 // An identifier that can be used to match events for this device.
1814 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1815 // Salt: Randomly generated 256 bit value
1816 // Hash algorithm: HMAC-SHA256
1817 // Size: 32 byte
1818 // Default: null or empty if the device identifier is not known
1819 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1820 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1821 // Default SOURCE_CODEC_TYPE_INVALID
1822 optional int32 codec_type = 2;
1823 // Codec priroity, the higher the more preferred, -1 for disabled
1824 // Default: CODEC_PRIORITY_DEFAULT
1825 optional int32 codec_priority = 3;
1826 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1827 // in BluetoothCodecConfig
1828 // Default: empty and SAMPLE_RATE_NONE for individual item
1829 optional int32 sample_rate = 4;
1830 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1831 // in BluetoothCodecConfig
1832 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1833 optional int32 bits_per_sample = 5;
1834 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1835 // BluetoothCodecConfig
1836 // Default: empty and CHANNEL_MODE_NONE for individual item
1837 optional int32 channel_mode = 6;
1838 // Codec specific values
1839 // Default 0
1840 optional int64 codec_specific_1 = 7;
1841 optional int64 codec_specific_2 = 8;
1842 optional int64 codec_specific_3 = 9;
1843 optional int64 codec_specific_4 = 10;
1844}
1845
1846/**
1847 * Logs when A2DP failed to read from PCM source.
1848 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1849 *
1850 * Logged from:
1851 * system/bt
1852 */
1853message BluetoothA2dpAudioUnderrunReported {
1854 // An identifier that can be used to match events for this device.
1855 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1856 // Salt: Randomly generated 256 bit value
1857 // Hash algorithm: HMAC-SHA256
1858 // Size: 32 byte
1859 // Default: null or empty if the device identifier is not known
1860 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1861 // Encoding interval in nanoseconds
1862 // Default: 0
1863 optional int64 encoding_interval_nanos = 2;
1864 // Number of bytes of PCM data that could not be read from the source
1865 // Default: 0
1866 optional int32 num_missing_pcm_bytes = 3;
1867}
1868
1869/**
1870 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1871 * buffer queue is full and we have to drop data
1872 *
1873 * Logged from:
1874 * system/bt
1875 */
1876message BluetoothA2dpAudioOverrunReported {
1877 // An identifier that can be used to match events for this device.
1878 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1879 // Salt: Randomly generated 256 bit value
1880 // Hash algorithm: HMAC-SHA256
1881 // Size: 32 byte
1882 // Default: null or empty if the device identifier is not known
1883 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1884 // Encoding interval in nanoseconds
1885 // Default: 0
1886 optional int64 encoding_interval_nanos = 2;
1887 // Number of buffers dropped in this event
1888 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1889 // Default: 0
1890 optional int32 num_dropped_buffers = 3;
1891 // Number of encoded buffers dropped in this event
1892 // Default 0
1893 optional int32 num_dropped_encoded_frames = 4;
1894 // Number of encoded bytes dropped in this event
1895 // Default: 0
1896 optional int32 num_dropped_encoded_bytes = 5;
1897}
1898
1899/**
1900 * Logs when we receive reports regarding a device's RSSI value
1901 *
1902 * Logged from:
1903 * system/bt
1904 */
1905message BluetoothDeviceRssiReported {
1906 // An identifier that can be used to match events for this device.
1907 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1908 // Salt: Randomly generated 256 bit value
1909 // Hash algorithm: HMAC-SHA256
1910 // Size: 32 byte
1911 // Default: null or empty if the device identifier is not known
1912 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1913 // Connection handle of this connection if available
1914 // Range: 0x0000 - 0x0EFF (12 bits)
1915 // Default: 0xFFFF if the handle is unknown
1916 optional int32 connection_handle = 2;
1917 // HCI command status code if this is triggerred by hci_cmd
1918 // Default: STATUS_UNKNOWN
1919 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1920 // BR/EDR
1921 // Range: -128 ≤ N ≤ 127 (signed integer)
1922 // Units: dB
1923 // LE:
1924 // Range: -127 to 20, 127 (signed integer)
1925 // Units: dBm
1926 // Invalid when an out of range value is reported
1927 optional int32 rssi = 4;
1928}
1929
1930/**
1931 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1932 *
1933 * Logged from:
1934 * system/bt
1935 */
1936message BluetoothDeviceFailedContactCounterReported {
1937 // An identifier that can be used to match events for this device.
1938 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1939 // Salt: Randomly generated 256 bit value
1940 // Hash algorithm: HMAC-SHA256
1941 // Size: 32 byte
1942 // Default: null or empty if the device identifier is not known
1943 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1944 // Connection handle of this connection if available
1945 // Range: 0x0000 - 0x0EFF (12 bits)
1946 // Default: 0xFFFF if the handle is unknown
1947 optional int32 connection_handle = 2;
1948 // HCI command status code if this is triggerred by hci_cmd
1949 // Default: STATUS_UNKNOWN
1950 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1951 // Number of consecutive failed contacts for a connection corresponding to the Handle
1952 // Range: uint16_t, 0-0xFFFF
1953 // Default: 0xFFFFF
1954 optional int32 failed_contact_counter = 4;
1955}
1956
1957/**
1958 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1959 *
1960 * Logged from:
1961 * system/bt
1962 */
1963message BluetoothDeviceTxPowerLevelReported {
1964 // An identifier that can be used to match events for this device.
1965 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1966 // Salt: Randomly generated 256 bit value
1967 // Hash algorithm: HMAC-SHA256
1968 // Size: 32 byte
1969 // Default: null or empty if the device identifier is not known
1970 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1971 // Connection handle of this connection if available
1972 // Range: 0x0000 - 0x0EFF (12 bits)
1973 // Default: 0xFFFF if the handle is unknown
1974 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001975 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001976 // Default: STATUS_UNKNOWN
1977 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1978 // Range: -30 ≤ N ≤ 20
1979 // Units: dBm
1980 // Invalid when an out of range value is reported
1981 optional int32 transmit_power_level = 4;
1982}
Jack Heab86dbd22018-12-18 15:43:27 -08001983
Tej Singh5d991e12018-03-09 19:48:11 -08001984/**
Jack He1021a612019-01-20 21:22:46 -08001985 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1986 * receiving an HCI command from the host
1987 *
1988 * Logged from: system/bt
1989 */
1990message BluetoothHciTimeoutReported {
1991 // HCI command associated with this event
1992 // Default: CMD_UNKNOWN
1993 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1994}
1995
1996/**
1997 * Logs when we receive Bluetooth Link Quality Report event from the controller
1998 * See Android Bluetooth HCI specification for more details
1999 *
2000 * Note: all count and bytes field are counted since last event
2001 *
2002 * Logged from: system/bt
2003 */
2004message BluetoothQualityReportReported {
2005 // Quality report ID
2006 // Original type: uint8_t
2007 // Default: BQR_ID_UNKNOWN
2008 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2009 // Packet type of the connection
2010 // Original type: uint8_t
2011 // Default: BQR_PACKET_TYPE_UNKNOWN
2012 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2013 // Connection handle of the connection
2014 // Original type: uint16_t
2015 optional int32 connection_handle = 3;
2016 // Performing Role for the connection
2017 // Original type: uint8_t
2018 optional int32 connection_role = 4;
2019 // Current Transmit Power Level for the connection. This value is the same as the controller's
2020 // response to the HCI_Read_Transmit_Power_Level HCI command
2021 // Original type: uint8_t
2022 optional int32 tx_power_level = 5;
2023 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2024 // absolute receiver signal strength value
2025 // Original type: int8_t
2026 optional int32 rssi = 6;
2027 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2028 // channels used by the link currently
2029 // Original type: uint8_t
2030 optional int32 snr = 7;
2031 // Indicates the number of unused channels in AFH_channel_map
2032 // Original type: uint8_t
2033 optional int32 unused_afh_channel_count = 8;
2034 // Indicates the number of the channels which are interfered and quality is bad but are still
2035 // selected for AFH
2036 // Original type: uint8_t
2037 optional int32 afh_select_unideal_channel_count = 9;
2038 // Current Link Supervision Timeout Setting
2039 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2040 // Original type: uint16_t
2041 optional int32 lsto = 10;
2042 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2043 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2044 // 0x01 (Piconet Clock)
2045 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2046 // Original type: uint32_t
2047 optional int64 connection_piconet_clock = 11;
2048 // The count of retransmission
2049 // Original type: uint32_t
2050 optional int64 retransmission_count = 12;
2051 // The count of no RX
2052 // Original type: uint32_t
2053 optional int64 no_rx_count = 13;
2054 // The count of NAK (Negative Acknowledge)
2055 // Original type: uint32_t
2056 optional int64 nak_count = 14;
2057 // Controller timestamp of last TX ACK
2058 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2059 // Original type: uint32_t
2060 optional int64 last_tx_ack_timestamp = 15;
2061 // The count of Flow-off (STOP)
2062 // Original type: uint32_t
2063 optional int64 flow_off_count = 16;
2064 // Controller timestamp of last Flow-on (GO)
2065 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2066 // Original type: uint32_t
2067 optional int64 last_flow_on_timestamp = 17;
2068 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2069 // Original type: uint32_t
2070 optional int64 buffer_overflow_bytes = 18;
2071 // Buffer underflow count (in byte) since last event
2072 // Original type: uint32_t
2073 optional int64 buffer_underflow_bytes = 19;
2074}
2075
2076/**
2077 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2078 *
2079 * Notes:
2080 * - Each event can be partially filled as we might learn different pieces of device
2081 * information at different time
2082 * - Multiple device info events can be combined to give more complete picture
2083 * - When multiple device info events tries to describe the same information, the
2084 * later one wins
2085 *
2086 * Logged from:
2087 * packages/apps/Bluetooth
2088 */
Jack Heaea26982019-04-04 11:19:48 -07002089message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002090 // An identifier that can be used to match events for this device.
2091 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2092 // Salt: Randomly generated 256 bit value
2093 // Hash algorithm: HMAC-SHA256
2094 // Size: 32 byte
2095 // Default: null or empty if the device identifier is not known
2096 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2097 // Where is this device info obtained from
2098 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2099 // Name of the data source
2100 // For EXTERNAL: package name of the data source
2101 // For INTERNAL: null for general case, component name otherwise
2102 optional string source_name = 3;
2103 // Name of the manufacturer of this device
2104 optional string manufacturer = 4;
2105 // Model of this device
2106 optional string model = 5;
2107 // Hardware version of this device
2108 optional string hardware_version = 6;
2109 // Software version of this device
2110 optional string software_version = 7;
2111}
2112
2113/**
2114 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2115 * device, as documented by the Bluetooth Core HCI specification
2116 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2117 * Vol 2, Part E, Page 1118
2118 *
2119 * Logged from:
2120 * system/bt
2121 */
2122message BluetoothRemoteVersionInfoReported {
2123 // Connection handle of the connection
2124 // Original type: uint16_t
2125 optional int32 connection_handle = 1;
2126 // HCI command status code
2127 // Default: STATUS_UNKNOWN
2128 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2129 // 1 byte Version of current LMP in the remote controller
2130 optional int32 lmp_version = 3;
2131 // 2 bytes LMP manufacturer code of the remote controller
2132 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2133 optional int32 lmp_manufacturer_code = 4;
2134 // 4 bytes subversion of the LMP in the remote controller
2135 optional int32 lmp_subversion = 5;
2136}
2137
2138/**
2139 * Logs when certain Bluetooth SDP attributes are discovered
2140 * Constant definitions are from:
2141 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2142 *
2143 * Current logged attributes:
2144 * - BluetoothProfileDescriptorList
2145 * - Supported Features Bitmask
2146 *
2147 * Logged from:
2148 * system/bt
2149 */
2150message BluetoothSdpAttributeReported {
2151 // An identifier that can be used to match events for this device.
2152 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2153 // Salt: Randomly generated 256 bit value
2154 // Hash algorithm: HMAC-SHA256
2155 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2156 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2157 // Original type: uint16_t
2158 optional int32 protocol_uuid = 2;
2159 // Short form UUIDs used to identify Bluetooth SDP attribute types
2160 // Original type: uint16_t
2161 optional int32 attribute_id = 3;
2162 // Attribute value for the particular attribute
2163 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2164}
2165
2166/**
2167 * Logs when bond state of a Bluetooth device changes
2168 *
2169 * Logged from:
2170 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2171 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2172 */
2173message BluetoothBondStateChanged {
2174 // An identifier that can be used to match events for this device.
2175 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2176 // Salt: Randomly generated 256 bit value
2177 // Hash algorithm: HMAC-SHA256
2178 // Size: 32 byte
2179 // Default: null or empty if the device identifier is not known
2180 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2181 // Preferred transport type to remote dual mode device
2182 // Default: TRANSPORT_AUTO means no preference
2183 optional android.bluetooth.TransportTypeEnum transport = 2;
2184 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2185 // Default: UNKNOWN
2186 optional android.bluetooth.DeviceTypeEnum type = 3;
2187 // Current bond state (NONE, BONDING, BONDED)
2188 // Default: BOND_STATE_UNKNOWN
2189 optional android.bluetooth.BondStateEnum bond_state = 4;
2190 // Bonding sub state
2191 // Default: BOND_SUB_STATE_UNKNOWN
2192 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2193 // Unbond Reason
2194 // Default: UNBOND_REASON_UNKNOWN
2195 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2196}
2197
2198/**
2199 * Logs there is an event related Bluetooth classic pairing
2200 *
2201 * Logged from:
2202 * system/bt
2203 */
2204message BluetoothClassicPairingEventReported {
2205 // An identifier that can be used to match events for this device.
2206 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2207 // Salt: Randomly generated 256 bit value
2208 // Hash algorithm: HMAC-SHA256
2209 // Size: 32 byte
2210 // Default: null or empty if the device identifier is not known
2211 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2212 // Connection handle of this connection if available
2213 // Range: 0x0000 - 0x0EFF (12 bits)
2214 // Default: 0xFFFF if the handle is unknown
2215 optional int32 connection_handle = 2;
2216 // HCI command associated with this event
2217 // Default: CMD_UNKNOWN
2218 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2219 // HCI event associated with this event
2220 // Default: EVT_UNKNOWN
2221 optional android.bluetooth.hci.EventEnum hci_event = 4;
2222 // HCI command status code if this is triggerred by hci_cmd
2223 // Default: STATUS_UNKNOWN
2224 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2225 // HCI reason code associated with this event
2226 // Default: STATUS_UNKNOWN
2227 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002228 // A status value related to this specific event
2229 // Default: 0
2230 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002231}
2232
2233/**
2234 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2235 *
2236 * Logged from:
2237 * system/bt
2238 */
2239message BluetoothSmpPairingEventReported {
2240 // An identifier that can be used to match events for this device.
2241 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2242 // Salt: Randomly generated 256 bit value
2243 // Hash algorithm: HMAC-SHA256
2244 // Size: 32 byte
2245 // Default: null or empty if the device identifier is not known
2246 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2247 // SMP command sent or received over L2CAP
2248 // Default: CMD_UNKNOWN
2249 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2250 // Whether this command is sent or received
2251 // Default: DIRECTION_UNKNOWN
2252 optional android.bluetooth.DirectionEnum direction = 3;
2253 // SMP failure reason code
2254 // Default: PAIRING_FAIL_REASON_DEFAULT
2255 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2256}
2257
2258/**
Jack He815cdba2019-01-30 17:24:55 -08002259 * Logs when a Bluetooth socket’s connection state changed
2260 *
2261 * Logged from:
2262 * system/bt
2263 */
2264message BluetoothSocketConnectionStateChanged {
2265 // An identifier that can be used to match events for this device.
2266 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2267 // Salt: Randomly generated 256 bit value
2268 // Hash algorithm: HMAC-SHA256
2269 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002270 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002271 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002272 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002273 // Default 0 when unknown or don't care
2274 optional int32 port = 2;
2275 // Socket type as mentioned in
2276 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2277 // Default: SOCKET_TYPE_UNKNOWN
2278 optional android.bluetooth.SocketTypeEnum type = 3;
2279 // Socket connection state
2280 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2281 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2282 // Number of bytes sent to remote device during this connection
2283 optional int64 tx_bytes = 5;
2284 // Number of bytes received from remote device during this connection
2285 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002286 // Socket owner's UID
2287 optional int32 uid = 7 [(is_uid) = true];
2288 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2289 // |port| must be spawned by |server_port|
2290 // Default 0 when unknown or don't care
2291 optional int32 server_port = 8;
2292 // Whether this is a server listener socket
2293 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002294}
2295
2296/**
Jack He71426802019-04-02 13:32:52 -07002297 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2298 *
2299 * Logged from:
2300 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2301 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2302 *
2303 */
2304message BluetoothClassOfDeviceReported {
2305 // An identifier that can be used to match events for this device.
2306 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2307 // Salt: Randomly generated 256 bit value
2308 // Hash algorithm: HMAC-SHA256
2309 // Size: 32 byte
2310 // Default: null or empty if this is a server listener socket
2311 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2312 // Class of Device (CoD) value including both Major, Minor device class and service class
2313 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2314 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2315 // Default: 0
2316 optional int32 class_of_device = 2;
2317}
2318
2319/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002320 * Logs when something is plugged into or removed from the USB-C connector.
2321 *
2322 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002323 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002324 */
2325message UsbConnectorStateChanged {
2326 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002327 STATE_DISCONNECTED = 0;
2328 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002329 }
2330 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002331 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002332 // Last active session in ms.
2333 // 0 when the port is in connected state.
2334 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002335}
2336
2337/**
2338 * Logs the reported speaker impedance.
2339 *
2340 * Logged from:
2341 * Vendor audio implementation.
2342 */
2343message SpeakerImpedanceReported {
2344 optional int32 speaker_location = 1;
2345 optional int32 impedance = 2;
2346}
2347
2348/**
2349 * Logs the report of a failed hardware.
2350 *
2351 * Logged from:
2352 * Vendor HALs.
2353 *
2354 */
2355message HardwareFailed {
2356 enum HardwareType {
2357 HARDWARE_FAILED_UNKNOWN = 0;
2358 HARDWARE_FAILED_MICROPHONE = 1;
2359 HARDWARE_FAILED_CODEC = 2;
2360 HARDWARE_FAILED_SPEAKER = 3;
2361 HARDWARE_FAILED_FINGERPRINT = 4;
2362 }
2363 optional HardwareType hardware_type = 1;
2364
Maggie White6dcd8572019-01-31 14:11:50 -08002365 /**
2366 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002367 * the same hardware_type. The specific locations are vendor defined integers,
2368 * referring to board-specific numbering schemes.
2369 */
2370 optional int32 hardware_location = 2;
2371
Maggie White6dcd8572019-01-31 14:11:50 -08002372 /**
2373 * failure_code is specific to the HardwareType of the failed hardware.
2374 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002375 */
Maggie White6dcd8572019-01-31 14:11:50 -08002376 enum HardwareErrorCode {
2377 UNKNOWN = 0;
2378 COMPLETE = 1;
2379 SPEAKER_HIGH_Z = 2;
2380 SPEAKER_SHORT = 3;
2381 FINGERPRINT_SENSOR_BROKEN = 4;
2382 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002383 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002384 }
2385 optional int32 failure_code = 3;
2386}
2387
2388/**
2389 * Log an event when the device has been physically dropped.
2390 * Reported from the /vendor partition.
2391 */
2392message PhysicalDropDetected {
2393 // Confidence that the event was actually a drop, 0 -> 100
2394 optional int32 confidence_pctg = 1;
2395 // Peak acceleration of the drop, in 1/1000s of a g.
2396 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002397 // Duration of freefall in ms
2398 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002399}
2400
2401/**
2402 * Log bucketed battery charge cycles.
2403 *
2404 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002405 * a given charge point. For example, if 10 cycle buckets are
2406 * initialized, bucket 1 is the lowest 1/10th of the battery,
2407 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002408 *
2409 * Logged from:
2410 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2411 */
2412message ChargeCyclesReported {
2413 optional int32 cycle_bucket_1 = 1;
2414 optional int32 cycle_bucket_2 = 2;
2415 optional int32 cycle_bucket_3 = 3;
2416 optional int32 cycle_bucket_4 = 4;
2417 optional int32 cycle_bucket_5 = 5;
2418 optional int32 cycle_bucket_6 = 6;
2419 optional int32 cycle_bucket_7 = 7;
2420 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002421 optional int32 cycle_bucket_9 = 9;
2422 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002423}
2424
2425/**
Howard Roa46b6582018-09-18 16:45:02 -07002426 * Log battery health snapshot.
2427 *
2428 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2429 * are snapshotted periodically over 24hrs.
2430 */
2431message BatteryHealthSnapshot {
2432 enum BatterySnapshotType {
2433 UNKNOWN = 0;
2434 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2435 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2436 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2437 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2438 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2439 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2440 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2441 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2442 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2443 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2444 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2445 }
2446 optional BatterySnapshotType type = 1;
2447 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002448 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002449 // Voltage Battery Voltage, in microVolts.
2450 optional int32 voltage_micro_volt = 3;
2451 // Current Battery current, in microAmps.
2452 optional int32 current_micro_amps = 4;
2453 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2454 optional int32 open_circuit_micro_volt = 5;
2455 // Resistance Battery Resistance, in microOhms.
2456 optional int32 resistance_micro_ohm = 6;
2457 // Level Battery Level, as % of full.
2458 optional int32 level_percent = 7;
2459}
2460
2461/**
2462 * Log slow I/O operations on the primary storage.
2463 */
2464message SlowIo {
2465 // Classifications of IO Operations.
2466 enum IoOperation {
2467 UNKNOWN = 0;
2468 READ = 1;
2469 WRITE = 2;
2470 UNMAP = 3;
2471 SYNC = 4;
2472 }
2473 optional IoOperation operation = 1;
2474
2475 // The number of slow IO operations of this type over 24 hours.
2476 optional int32 count = 2;
2477}
2478
2479/**
2480 * Log battery caused shutdown with the last recorded voltage.
2481 */
2482message BatteryCausedShutdown {
2483 // The last recorded battery voltage prior to shutdown.
2484 optional int32 last_recorded_micro_volt = 1;
2485}
2486
2487/**
Tej Singha72344992019-04-17 18:55:08 -07002488 * Logs when ThermalService receives throttling events.
2489 *
2490 * Logged from:
2491 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2492 */
2493message ThermalThrottlingSeverityStateChanged {
2494 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2495 optional android.os.TemperatureTypeEnum sensor_type = 1;
2496
2497 // The name of the temperature source. Eg. CPU0
2498 optional string sensor_name = 2;
2499
2500 // Temperature in tenths of a degree C.
2501 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2502 optional int32 temperature_deci_celsius = 3;
2503
2504 // Relative severity of the throttling, see enum definition.
2505 optional android.os.ThrottlingSeverityEnum severity = 4;
2506}
2507
2508/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002509 * Logs the duration of a davey (jank of >=700ms) when it occurs
2510 *
2511 * Logged from:
2512 * frameworks/base/libs/hwui/JankTracker.cpp
2513 */
2514message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002515 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002516 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002517
Tej Singhbb8554a2018-01-26 11:59:14 -08002518 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002519 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002520}
2521
2522/**
Bookatze5885242017-10-24 20:10:31 -07002523 * Logs phone signal strength changes.
2524 *
2525 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002526 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002527 */
2528message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002529 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2530 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002531}
2532
Yangster4ccebea2018-10-09 17:09:02 -07002533
2534/**
2535 * Logs when the phone state, sim state or signal strength changes
2536 *
2537 * Logged from:
2538 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2539 */
2540message PhoneServiceStateChanged {
2541 optional android.telephony.ServiceStateEnum state = 1;
2542 optional android.telephony.SimStateEnum sim_state = 2;
2543 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2544}
2545
2546/**
2547 * Logs when the phone becomes on or off.
2548 *
2549 * Logged from:
2550 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2551 */
2552message PhoneStateChanged {
2553 enum State {
2554 OFF = 0;
2555 ON = 1;
2556 }
2557 optional State state = 1;
2558}
2559
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002560message BackGesture {
2561 enum BackType {
2562 DEFAULT_BACK_TYPE = 0;
2563 COMPLETED = 1;
2564 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2565 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2566 INCOMPLETE = 4;
2567 }
2568 optional BackType type = 1;
2569
2570 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2571 enum WindowHorizontalLocation {
2572 DEFAULT_LOCATION = 0;
2573 LEFT = 1;
2574 RIGHT = 2;
2575 }
2576 optional WindowHorizontalLocation x_location = 3;
2577}
2578
2579message ExclusionRectStateChanged {
2580 optional string component_name = 1; // if not available, simply packageName
2581 optional int32 requested_height = 2; // px
2582 optional int32 rejected_height = 3; // px
2583
2584 enum WindowHorizontalLocation {
2585 DEFAULT_LOCATION = 0;
2586 LEFT = 1;
2587 RIGHT = 2;
2588 }
2589 optional WindowHorizontalLocation x_location = 4;
2590 optional bool landscape = 5;
2591 optional bool splitscreen = 6;
2592 optional int32 duration_millis = 7;
2593}
2594
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002595message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002596 optional android.stats.launcher.LauncherAction action = 1;
2597 optional android.stats.launcher.LauncherState src_state = 2;
2598 optional android.stats.launcher.LauncherState dst_state = 3;
2599 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002600 optional bool is_swipe_up_enabled = 5;
2601}
2602
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002603message StyleUIChanged {
2604 optional android.stats.style.Action action = 1;
2605 optional int32 color_package_hash = 2;
2606 optional int32 font_package_hash = 3;
2607 optional int32 shape_package_hash = 4;
2608 optional int32 clock_package_hash = 5;
2609 optional int32 launcher_grid = 6;
2610 optional int32 wallpaper_category_hash = 7;
2611 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002612 optional int32 color_preference = 9;
2613 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002614}
2615
David Chenc28b2bb2017-10-24 12:52:52 -07002616/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002617 * Logs when Settings UI has changed.
2618 *
2619 * Logged from:
2620 * packages/apps/Settings
2621 */
2622message SettingsUIChanged {
2623 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002624 * Where this SettingsUIChange event comes from. For example, if
2625 * it's a PAGE_VISIBLE event, where the page is opened from.
2626 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002627 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002628
2629 /**
2630 * What the UI action is.
2631 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002632 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002633
2634 /**
2635 * Where the action is happening
2636 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002637 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002638
2639 /**
2640 * What preference changed in this event.
2641 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002642 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002643
2644 /**
2645 * The new value of the changed preference.
2646 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002647 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002648}
2649
2650/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002651 * Logs basic timing information about touch events.
2652 * Reported at most every 5 minutes while device is being interacted with.
2653 *
2654 * Logged from:
2655 * frameworks/native/services/inputflinger
2656 */
2657message TouchEventReported {
2658 /**
2659 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002660 * and the standard deviation of the time spent processing touchscreen events
2661 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002662 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002663 * On supported devices, the starting point is taken during the hard interrupt inside the
2664 * kernel touch driver. On all other devices, the starting point is taken inside
2665 * the kernel's input event subsystem upon receipt of the input event.
2666 * The ending point is taken inside InputDispatcher, just after the input event
2667 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002668 */
2669 // Minimum value
2670 optional float latency_min_micros = 1;
2671 // Maximum value
2672 optional float latency_max_micros = 2;
2673 // Average value
2674 optional float latency_mean_micros = 3;
2675 // Standard deviation
2676 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002677 // Number of touch events (input_event) in this report
2678 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002679}
2680
2681/**
Philip Quinn0eded622019-01-29 12:46:28 -08002682 * Logs gesture classification and timing information for touch events.
2683 *
2684 * Logged from:
2685 * frameworks/base/core/java/android/view/GestureDetector.java
2686 * frameworks/base/core/java/android/view/View.java
2687 */
2688message TouchGestureClassified {
2689 // The source of the classification (e.g. Java class name).
2690 optional string source = 1;
2691
2692 enum Classification {
2693 UNKNOWN_CLASSIFICATION = 0;
2694 SINGLE_TAP = 1;
2695 DOUBLE_TAP = 2;
2696 LONG_PRESS = 3;
2697 DEEP_PRESS = 4;
2698 SCROLL = 5;
2699 }
2700 // The classification of the gesture.
2701 optional Classification classification = 2;
2702
2703 // The interval from the start of a touch event stream until the
2704 // classification was made.
2705 optional int32 latency_millis = 3;
2706
2707 // The distance from the location of the first touch event to the
2708 // location of the touch event when the classification was made.
2709 optional float displacement_px = 4;
2710}
2711
2712/**
David Chenc28b2bb2017-10-24 12:52:52 -07002713 * Logs that a setting was updated.
2714 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002715 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002716 * The tag and is_default allow resetting of settings to default values based on the specified
2717 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2718 */
2719message SettingChanged {
2720 // The name of the setting.
2721 optional string setting = 1;
2722
2723 // The change being imposed on this setting. May represent a number, eg "3".
2724 optional string value = 2;
2725
2726 // The new value of this setting. For most settings, this is same as value. For some settings,
2727 // value is +X or -X where X represents an element in a set. For example, if the previous value
2728 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2729 // The +/- feature is currently only used for location_providers_allowed.
2730 optional string new_value = 3;
2731
2732 // The previous value of this setting.
2733 optional string prev_value = 4;
2734
2735 // The tag used with the is_default for resetting sets of settings. This is generally null.
2736 optional string tag = 5;
2737
Bookatz90867622018-01-31 15:05:57 -08002738 // True if this setting with tag should be resettable.
2739 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002740
David Chenbd789912018-03-16 17:19:55 -07002741 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002742 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002743
2744 enum ChangeReason {
2745 UPDATED = 1; // Updated can be an insertion or an update.
2746 DELETED = 2;
2747 }
2748 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002749}
Chenjie Yub3dda412017-10-24 13:41:59 -07002750
Chenjie Yu05013b32017-11-21 10:21:41 -08002751/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002752 * Logs activity going to foreground or background
2753 *
2754 * Logged from:
2755 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2756 */
2757message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002758 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002759 optional string pkg_name = 2;
2760 optional string class_name = 3;
2761
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002762 enum State {
2763 BACKGROUND = 0;
2764 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002765 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002766 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002767}
David Chenc8a43242017-10-17 16:23:28 -07002768
2769/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002770 * Logs when a volume entered low Storage state.
2771 * Logged from:
2772 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2773 */
2774message LowStorageStateChanged {
2775 // Volume that ran out of storage.
2776 optional string volume_description = 1;
2777
2778 enum State {
2779 UNKNOWN = 0;
2780 OFF = 1;
2781 ON = 2;
2782 }
2783 optional State state = 2;
2784}
2785
2786/**
2787 * Logs when an app is downgraded.
2788 * Logged from:
2789 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2790 */
2791message AppDowngraded {
2792 optional string package_name = 1;
2793 // Size of the package (all data) before being downgraded.
2794 optional int64 size_in_bytes_before = 2;
2795 // Size of the package (all data) after being downgraded.
2796 optional int64 size_in_bytes_after = 3;
2797
2798 optional bool aggressive = 4;
2799}
2800
2801/**
2802 * Logs when an app is optimized after being downgraded.
2803 * Logged from:
2804 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2805 */
2806message AppOptimizedAfterDowngraded {
2807 optional string package_name = 1;
2808}
2809
2810/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002811 * Logs whenever an app is installed on external storage.
2812 * Logged from:
2813 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2814 */
2815message AppInstallOnExternalStorageReported {
2816 // The type of external storage.
2817 optional android.stats.storage.ExternalStorageType storage_type = 1;
2818 // The name of the package that is installed on the sd card.
2819 optional string package_name = 2;
2820}
2821
2822/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002823 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002824 * Logged from:
2825 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2826 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002827message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002828 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002829
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002830 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002831
2832 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002833 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002834 optional string process_name = 3;
2835
2836 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002837 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002838
2839 optional string package_name = 5;
2840
2841 enum InstantApp {
2842 UNAVAILABLE = 0;
2843 FALSE = 1;
2844 TRUE = 2;
2845 }
2846 optional InstantApp is_instant_app = 6;
2847
2848 enum ForegroundState {
2849 UNKNOWN = 0;
2850 BACKGROUND = 1;
2851 FOREGROUND = 2;
2852 }
2853 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002854
2855 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002856}
David Chen9e3808c2017-11-20 17:25:34 -08002857
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002858/**
2859 * Logs when a WTF (What a Terrible Failure) happened.
2860 * Logged from:
2861 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2862 */
2863message WTFOccurred {
2864 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002865
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002866 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002867
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002868 // The name of the process.
2869 // system_server if it is not by an app
2870 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002871
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002872 // The pid if available. -1 means not available.
2873 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002874
2875 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002876}
2877
2878/**
2879 * Logs when system server reports low memory.
2880 * Logged from:
2881 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2882 */
2883message LowMemReported {
2884}
2885
2886/**
2887 * Logs when an app ANR (App Not Responding) occurs.
2888 * Logged from:
2889 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2890 */
2891message ANROccurred {
2892 optional int32 uid = 1 [(is_uid) = true];
2893
2894 optional string process_name = 2;
2895
2896 optional string short_component_name = 3;
2897
2898 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002899
2900 enum InstantApp {
2901 UNAVAILABLE = 0;
2902 FALSE = 1;
2903 TRUE = 2;
2904 }
2905 optional InstantApp is_instant_app = 5;
2906
2907 enum ForegroundState {
2908 UNKNOWN = 0;
2909 BACKGROUND = 1;
2910 FOREGROUND = 2;
2911 }
2912 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002913
2914 optional android.server.ErrorSource error_source = 7;
2915
2916 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002917}
2918
Bookatza7020bd2018-08-28 16:29:35 -07002919/**
2920 * Logs when the vibrator state changes.
2921 * Logged from:
2922 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2923 */
2924message VibratorStateChanged {
2925 repeated AttributionNode attribution_node = 1;
2926
2927 enum State {
2928 OFF = 0;
2929 ON = 1;
2930 }
2931 optional State state = 2;
2932
2933 // Duration (in milliseconds) requested to keep the vibrator on.
2934 // Only applicable for State == ON.
2935 optional int64 duration_millis = 3;
2936}
2937
David Chen0a368b22017-12-06 16:28:16 -08002938/*
2939 * Allows other apps to push events into statsd.
2940 * Logged from:
2941 * frameworks/base/core/java/android/util/StatsLog.java
2942 */
David Chen0b5c90c2018-01-25 16:51:49 -08002943message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002944 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002945 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002946
2947 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2948 optional int32 label = 2;
2949
2950 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2951 // predicates for the metrics).
2952 enum State {
2953 UNKNOWN = 0;
2954 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2955 STOP = 2;
2956 START = 3;
2957 }
2958 optional State state = 3;
2959}
2960
David Chen9e3808c2017-11-20 17:25:34 -08002961/**
Bookatz7948c872018-09-04 12:58:33 -07002962 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2963 * For example, this could be due to the user manually changing the time.
2964 *
2965 * Logged from:
2966 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2967 */
2968message WallClockTimeShifted {
2969 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2970 optional int64 wall_clock_timestamp_millis = 1;
2971}
2972
2973/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002974 * Logs when statsd detects an anomaly.
2975 *
2976 * Logged from:
2977 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2978 */
2979message AnomalyDetected {
2980 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002981 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002982
Yangster-mac94e197c2018-01-02 16:03:03 -08002983 // Id of the config whose anomaly detection alert fired.
2984 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002985
Yangster-mac94e197c2018-01-02 16:03:03 -08002986 // Id of the alert (i.e. name of the anomaly that was detected).
2987 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002988}
2989
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002990message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002991 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002992 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002993
2994 // The app package name.
2995 optional string pkg_name = 2;
2996
2997 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002998 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002999 WARM = 1;
3000 HOT = 2;
3001 COLD = 3;
3002 }
3003 // The transition type.
3004 optional TransitionType type = 3;
3005
3006 // The activity name.
3007 optional string activity_name = 4;
3008
3009 // The name of the calling app. Empty if not set.
3010 optional string calling_pkg_name = 5;
3011
3012 // Whether the app is an instant app.
3013 optional bool is_instant_app = 6;
3014
3015 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003016 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003017
Bookatz80d11a02018-01-16 10:46:35 -08003018 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003019
David Chen0b5c90c2018-01-25 16:51:49 -08003020 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003021 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003022 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003023 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003024 optional int32 bind_application_delay_millis = 11;
3025 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003026
3027 // Empty if not set.
3028 optional string launch_token = 13;
3029
Calin Juravle759fbda2018-02-20 19:52:30 +00003030 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003031 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003032
3033 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003034 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003035}
3036
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003037message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003038 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003039 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003040
3041 // The app package name.
3042 optional string pkg_name = 2;
3043
3044 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003045 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003046 WARM = 1;
3047 HOT = 2;
3048 COLD = 3;
3049 }
3050 // The transition type.
3051 optional TransitionType type = 3;
3052
3053 // The activity name.
3054 optional string activity_name = 4;
3055}
3056
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003057message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003058 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003059 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003060
3061 // The app package name.
3062 optional string pkg_name = 2;
3063
3064 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003065 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003066 WITH_BUNDLE = 1;
3067 WITHOUT_BUNDLE = 2;
3068 }
3069 // The transition type.
3070 optional TransitionType type = 3;
3071
3072 // The activity name.
3073 optional string activity_name = 4;
3074
3075 optional bool transition_process_running = 5;
3076
3077 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003078 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003079}
3080
Bookatz8fcd09a2017-12-18 13:01:10 -08003081/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003082 * Logs a picture-in-picture action
3083 * Logged from:
3084 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3085 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3086 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3087 */
3088message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003089 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003090 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003091
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003092 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003093
Chenjie Yu52cacc62017-12-08 18:11:45 -08003094 enum State {
3095 ENTERED = 1;
3096 EXPANDED_TO_FULL_SCREEN = 2;
3097 MINIMIZED = 3;
3098 DISMISSED = 4;
3099 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003100 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003101}
3102
3103/**
Chenjie Yue8904192017-12-08 19:12:57 -08003104 * Logs overlay action
3105 * Logged from:
3106 * services/core/java/com/android/server/wm/Session.java
3107 */
3108message OverlayStateChanged {
tsaichristine10978642019-09-10 14:12:49 -07003109 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003110
tsaichristine10978642019-09-10 14:12:49 -07003111 optional string package_name = 2 [(state_field_option).option = PRIMARY];
Chenjie Yue8904192017-12-08 19:12:57 -08003112
3113 optional bool using_alert_window = 3;
3114
3115 enum State {
3116 ENTERED = 1;
3117 EXITED = 2;
3118 }
tsaichristine10978642019-09-10 14:12:49 -07003119 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Chenjie Yue8904192017-12-08 19:12:57 -08003120}
3121
Chenjie Yuccfe6452018-01-30 11:33:21 -08003122/*
3123 * Logs foreground service starts and stops.
3124 * Note that this is not when a service starts or stops, but when it is
3125 * considered foreground.
3126 * Logged from
3127 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3128 */
3129message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003130 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003131 // package_name + "/" + class_name
3132 optional string short_name = 2;
3133
3134 enum State {
3135 ENTER = 1;
3136 EXIT = 2;
3137 }
3138 optional State state = 3;
3139}
3140
Chenjie Yue8904192017-12-08 19:12:57 -08003141/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003142 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3143 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3144 * attributed back to the parent (host) uid. One example is Chrome.
3145 *
3146 * Logged from:
3147 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3148 */
3149message IsolatedUidChanged {
3150 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003151 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003152 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003153 optional int32 parent_uid = 1;
3154
3155 optional int32 isolated_uid = 2;
3156
3157 // We expect an isolated uid to be removed before if it's used for another parent uid.
3158 enum Event {
3159 REMOVED = 0;
3160 CREATED = 1;
3161 }
3162 optional Event event = 3;
3163}
3164
3165/*
3166 * Logs the reception of an incoming network packet causing the main system to wake up for
3167 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3168 * and processed by WakeupController.cpp.
3169 */
3170message PacketWakeupOccurred {
3171 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3172 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003173 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003174 // The interface name on which the packet was received.
3175 optional string iface = 2;
3176 // The ethertype value of the packet.
3177 optional int32 ethertype = 3;
3178 // String representation of the destination MAC address of the packet.
3179 optional string destination_hardware_address = 4;
3180 // String representation of the source address of the packet if this was an IP packet.
3181 optional string source_ip = 5;
3182 // String representation of the destination address of the packet if this was an IP packet.
3183 optional string destination_ip = 6;
3184 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3185 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3186 // families.
3187 optional int32 ip_next_header = 7;
3188 // The source port if this was a TCP or UDP packet.
3189 optional int32 source_port = 8;
3190 // The destination port if this was a TCP or UDP packet.
3191 optional int32 destination_port = 9;
3192}
3193
3194/*
3195 * Logs the memory stats for an app on startup.
3196 * Logged from:
3197 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3198 */
3199message AppStartMemoryStateCaptured {
3200 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003201 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003202
3203 // The process name.
3204 optional string process_name = 2;
3205
3206 // The activity name.
3207 optional string activity_name = 3;
3208
3209 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003210 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003211
3212 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003213 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003214
3215 // RSS
3216 optional int64 rss_in_bytes = 6;
3217
3218 // CACHE
3219 optional int64 cache_in_bytes = 7;
3220
3221 // SWAP
3222 optional int64 swap_in_bytes = 8;
3223}
3224
3225/*
3226 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3227 * for LMK event.
3228 * Logged from:
3229 * system/core/lmkd/lmkd.c
3230 */
3231message LmkStateChanged {
3232 enum State {
3233 UNKNOWN = 0;
3234 START = 1;
3235 STOP = 2;
3236 }
3237 optional State state = 1;
3238}
3239
3240/*
3241 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3242 * Logged from:
3243 * system/core/lmkd/lmkd.c
3244 */
3245message LmkKillOccurred {
3246 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003247 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003248
3249 // The process name.
3250 optional string process_name = 2;
3251
3252 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003253 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003254
3255 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003256 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003257
3258 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003259 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003260
3261 // RSS
3262 optional int64 rss_in_bytes = 6;
3263
3264 // CACHE
3265 optional int64 cache_in_bytes = 7;
3266
3267 // SWAP
3268 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003269
3270 // The elapsed real time of start of the process.
3271 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003272
3273 // Min oom adj score considered by lmkd.
3274 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003275}
3276
Rajeev Kumar51b54602018-03-01 12:18:26 -08003277/*
3278 * Logs when the ActivityManagerService detects that an app died.
3279 *
3280 * Logged from:
3281 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3282 */
3283message AppDied {
3284 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003285 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003286}
3287
Howard Ro21a039c2018-08-06 14:55:47 -07003288/**
3289 * An atom for generic metrics logging. Available from Android Q.
3290 */
3291message GenericAtom {
3292 // The uid of the application that sent this custom atom.
3293 optional int32 uid = 1 [(is_uid) = true];
3294
3295 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003296 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003297}
3298
Tej Singhd6d6d772018-09-05 17:41:25 -07003299/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003300 * Atom for simple logging of user interaction and impression events, such as "the user touched
3301 * this button" or "this dialog was displayed".
3302 * Keep the UI event stream clean: don't use for system or background events.
3303 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003304 *
3305 * Logged from:
3306 * frameworks/base/services/core/java/com/android/server/
3307 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003308 */
3309message UiEventReported {
3310 // The event_id.
3311 optional int32 event_id = 1;
3312 // The event's source or target uid and package, if applicable.
3313 // For example, the package posting a notification, or the destination package of a share.
3314 optional int32 uid = 2 [(is_uid) = true];
3315 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003316 // An identifier used to disambiguate which logs refer to a particular instance of some
3317 // UI element. Useful when there might be multiple instances simultaneously active.
3318 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003319}
3320
3321/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003322 * Reports a notification was created or updated.
3323 *
3324 * Logged from:
3325 * frameworks/base/services/core/java/com/android/server/notification/
3326 */
3327message NotificationReported {
3328 // The event_id (as for UiEventReported).
3329 optional int32 event_id = 1;
3330 // The notifying app's uid and package.
3331 optional int32 uid = 2 [(is_uid) = true];
3332 optional string package_name = 3;
3333 // A small system-assigned identifier for the notification.
3334 // Locally probably-unique, but expect collisions across users and/or days.
3335 optional int32 instance_id = 4;
3336 // The app-assigned notification ID and tag
3337 optional int32 notification_id = 5;
3338 optional string notification_tag = 6;
3339 optional string channel_id = 7; // App-assigned channel ID
3340
3341 // Grouping information
3342 optional string group_id = 8; // Group the notification currently belongs to
3343 optional int32 group_instance_id = 9; // Instance_id of the group-summary notification
3344 optional bool is_group_summary = 10; // Tags the group-summary notification
3345
3346 // Attributes
3347 optional string category = 11; // App-assigned notification category (API-defined strings)
3348 optional int32 style = 12; // App-assigned notification style
3349 optional int32 num_people = 13; // Number of Person records attached to the notification
3350
3351 // Ordering, importance and interruptiveness
3352
3353 optional int32 position = 14; // Position in NotificationManager's list
3354
3355 optional android.stats.sysui.NotificationImportance importance = 15;
3356 optional int32 alerting = 16; // Bitfield, 1=buzz 2=beep 4=blink
3357
3358 enum NotificationImportanceExplanation {
3359 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3360 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3361 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3362 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3363 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3364 // Like _APP, but based on pre-channels priority signal.
3365 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3366 }
3367
3368 optional NotificationImportanceExplanation importance_source = 17;
3369 optional android.stats.sysui.NotificationImportance importance_initial = 18;
3370 optional NotificationImportanceExplanation importance_initial_source = 19;
3371 optional android.stats.sysui.NotificationImportance importance_asst = 20;
3372 optional int32 assistant_hash = 21;
3373 optional float assistant_ranking_score = 22;
3374}
3375
3376message Notification {
3377 // The notifying app's uid and package.
3378 optional int32 uid = 1 [(is_uid) = true];
3379 optional string package_name = 2;
3380 // A small system-assigned identifier for the notification.
3381 optional int32 instance_id = 3;
3382
3383 // Grouping information.
3384 optional int32 group_instance_id = 4;
3385 optional bool is_group_summary = 5;
3386
3387 // The section of the shade that the notification is in.
3388 // See NotificationSectionsManager.PriorityBucket.
3389 enum NotificationSection {
3390 SECTION_UNKNOWN = 0;
3391 SECTION_PEOPLE = 1;
3392 SECTION_ALERTING = 2;
3393 SECTION_SILENT = 3;
3394 }
3395 optional NotificationSection section = 6;
3396}
3397
3398message NotificationList {
3399 repeated Notification notifications = 1; // An ordered sequence of notifications.
3400}
3401
3402/**
3403 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3404 *
3405 * Logged from:
3406 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3407 */
3408message NotificationPanelReported {
3409 // The event_id (as for UiEventReported).
3410 optional int32 event_id = 1;
3411 optional int32 num_notifications = 2;
3412 // The notifications in the panel, in the order that they appear there.
3413 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3414}
3415
3416/**
3417 * Reports a notification channel, or channel group, was created, updated, or deleted.
3418 *
3419 * Logged from:
3420 * frameworks/base/services/core/java/com/android/server/notification/
3421 */
3422message NotificationChannelModified {
3423 // The event_id (as for UiEventReported).
3424 optional int32 event_id = 1;
3425 // The notifying app's uid and package.
3426 optional int32 uid = 2 [(is_uid) = true];
3427 optional string package_name = 3;
3428 // App-assigned notification channel ID or channel-group ID
3429 optional string channel_id = 4;
3430 // Previous importance setting, if applicable
3431 optional android.stats.sysui.NotificationImportance old_importance = 5;
3432 // New importance setting
3433 optional android.stats.sysui.NotificationImportance importance = 6;
3434}
3435
3436
3437/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003438 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003439 *
3440 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003441 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003442 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003443message BiometricAcquired {
3444 // Biometric modality that was acquired.
3445 optional android.hardware.biometrics.ModalityEnum modality = 1;
3446 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3447 optional int32 user = 2;
3448 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3449 optional bool is_crypto = 3;
3450 // Action that the device is performing. Acquired messages are only expected for enroll and
3451 // authenticate. Other actions may indicate an error.
3452 optional android.hardware.biometrics.ActionEnum action = 4;
3453 // The client that this acquisition was received for.
3454 optional android.hardware.biometrics.ClientEnum client = 5;
3455 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3456 optional int32 acquire_info = 6;
3457 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3458 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003459 // Dictates if this message should trigger additional debugging.
3460 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003461}
3462
3463/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003464 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003465 *
3466 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003467 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003468 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003469message BiometricAuthenticated {
3470 // Biometric modality that was used.
3471 optional android.hardware.biometrics.ModalityEnum modality = 1;
3472 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3473 optional int32 user = 2;
3474 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3475 // storage.
3476 optional bool is_crypto = 3;
3477 // The client that this acquisition was received for.
3478 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003479 // If authentication requires user confirmation. See BiometricPrompt's
3480 // setRequireConfirmation(bool) method.
3481 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003482
Kevin Chyn1741a072019-01-17 11:54:40 -08003483 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003484 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003485 REJECTED = 1;
3486 PENDING_CONFIRMATION = 2;
3487 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003488 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003489
3490 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003491 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003492 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3493 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3494 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3495 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003496 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003497 // Dictates if this message should trigger additional debugging.
3498 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003499}
3500
3501/**
3502 * Logs when a biometric error occurs.
3503 *
3504 * Logged from:
3505 * frameworks/base/services/core/java/com/android/server/biometrics
3506 */
3507message BiometricErrorOccurred {
3508 // Biometric modality that was used.
3509 optional android.hardware.biometrics.ModalityEnum modality = 1;
3510 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3511 optional int32 user = 2;
3512 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3513 optional bool is_crypto = 3;
3514 // Action that the device is performing.
3515 optional android.hardware.biometrics.ActionEnum action = 4;
3516 // The client that this acquisition was received for.
3517 optional android.hardware.biometrics.ClientEnum client = 5;
3518 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3519 // are unique to modality.
3520 optional int32 error_info = 6;
3521 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3522 // by the vendor and not specified by the HIDL interface.
3523 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003524 // Dictates if this message should trigger additional debugging.
3525 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003526 // Time spent during the authentication attempt.
3527 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003528}
3529
3530/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003531 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003532 * Logged from:
3533 * frameworks/base/services/core/java/com/android/server/biometrics
3534 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003535message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003536 // Biometric modality.
3537 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003538 // Type of issue detected.
3539 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003540 // Dictates if this message should trigger additional debugging.
3541 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003542}
Howard Ro688ae182018-09-25 00:09:36 -07003543
joshmccloskey6f952b22019-03-25 20:59:35 -07003544/**
3545 * Logs when a biometric enrollment occurs.
3546 *
3547 * Logged from:
3548 * frameworks/base/services/core/java/com/android/server/biometrics
3549 */
3550message BiometricEnrolled {
3551 // Biometric modality that was used.
3552 optional android.hardware.biometrics.ModalityEnum modality = 1;
3553 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3554 optional int32 user = 2;
3555 // The amount of time the enrollment took in milliseconds.
3556 optional int64 latency_millis = 3;
3557 // Whether or not the enrollment was successful.
3558 optional bool success = 4;
3559}
3560
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003561/*
Tej Singh0d176952019-01-16 19:10:54 -08003562 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003563 */
Tej Singh0d176952019-01-16 19:10:54 -08003564message FlagFlipUpdateOccurred {
3565 // If the event is from a flag config package, specify the package name.
3566 optional string flag_flip_package_name = 1;
3567
3568 // The order id of the package
3569 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003570}
3571
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003572/**
3573 * Potential experiment ids that goes with a train install.
3574 */
3575message TrainExperimentIds {
3576 repeated int64 experiment_id = 1;
3577}
3578
Yangster-macb89807e2018-11-15 21:10:57 -08003579/*
3580 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003581 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003582 */
3583message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003584 // Name of the train.
3585 optional string train_name = 1;
3586 // Version code for a "train" of packages that need to be installed atomically
3587 optional int64 train_version_code = 2;
3588 // After installation of this package, device requires a restart.
3589 optional bool requires_staging = 3;
3590 // Rollback should be enabled for this install.
3591 optional bool rollback_enabled = 4;
3592 // Requires low latency monitoring if possible.
3593 optional bool requires_low_latency_monitor = 5;
3594
Yangster-macb89807e2018-11-15 21:10:57 -08003595 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003596 UNKNOWN = 0;
3597 INSTALL_REQUESTED = 1;
3598 INSTALL_STARTED = 2;
3599 INSTALL_STAGED_NOT_READY = 3;
3600 INSTALL_STAGED_READY = 4;
3601 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003602 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3603 // and INSTALL_FAILURE_COMMIT.
3604 INSTALL_FAILURE = 6 [deprecated = true];
3605 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003606 INSTALL_CANCELLED = 7;
3607 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003608 INSTALLER_ROLLBACK_INITIATED = 9;
3609 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3610 INSTALLER_ROLLBACK_STAGED = 11;
3611 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3612 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3613 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3614 INSTALLER_ROLLBACK_SUCCESS = 15;
3615 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003616 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3617 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3618 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3619 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3620 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3621 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003622 INSTALL_FAILURE_DOWNLOAD = 23;
3623 INSTALL_FAILURE_STATE_MISMATCH = 24;
3624 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003625 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003626 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003627 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003628 // Possible experiment ids for monitoring this push.
3629 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3630 // user id
3631 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003632 optional int32 reason = 9;
Yangster-macb89807e2018-11-15 21:10:57 -08003633}
3634
Tej Singhc9203082019-05-03 13:42:23 -07003635/* Test atom, is not logged anywhere */
3636message TestAtomReported {
3637 repeated AttributionNode attribution_node = 1;
3638 optional int32 int_field = 2;
3639 optional int64 long_field = 3;
3640 optional float float_field = 4;
3641 optional string string_field = 5;
3642 optional bool boolean_field = 6;
3643 enum State {
3644 UNKNOWN = 0;
3645 OFF = 1;
3646 ON = 2;
3647 }
3648 optional State state = 7;
3649 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3650}
3651
Maggie Whitefc1aa592018-11-28 21:55:23 -08003652/** Represents USB port overheat event. */
3653message UsbPortOverheatEvent {
3654 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3655 optional int32 plug_temperature_deci_c = 1;
3656
3657 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3658 optional int32 max_temperature_deci_c = 2;
3659
3660 /* Time between USB plug event and overheat threshold trip, in seconds. */
3661 optional int32 time_to_overheat_secs = 3;
3662
3663 /* Time between overheat threshold trip and hysteresis, in seconds. */
3664 optional int32 time_to_hysteresis_secs = 4;
3665
3666 /* Time between hysteresis and active mitigation ending, in seconds. */
3667 optional int32 time_to_inactive_secs = 5;
3668};
3669
Maggie White8735b852019-01-18 11:40:49 -08003670/**
3671 * Logs total effective full charge and discharge cycles on a battery.
3672 * Here are some examples of one effective cycle:
3673 * 1) the battery charges from 0% to 100% and drains back to 0%,
3674 * 2) charging from 50% to 100% and draining back to 50% twice.
3675 * Pulled from:
3676 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3677 */
3678message BatteryCycleCount {
3679 /* Number of total charge and discharge cycles on the system battery. */
3680 optional int32 cycle_count = 1;
3681}
3682
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003683/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003684 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3685 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003686 * Pulled from:
3687 * StatsCompanionService
3688 */
3689
Carmen Agimof12dec122019-03-06 16:14:38 +00003690message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003691
Carmen Agimof12dec122019-03-06 16:14:38 +00003692 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003693 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003694 PUBLIC = 1;
3695 PRIVATE = 2;
3696 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003697 }
3698
Carmen Agimof12dec122019-03-06 16:14:38 +00003699 // The type of external storage.
3700 optional android.stats.storage.ExternalStorageType storage_type = 1;
3701 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3702 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003703 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003704 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003705}
3706
Yangster-macb89807e2018-11-15 21:10:57 -08003707/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003708 * Logs when a connection becomes available and lost.
3709 * Logged in StatsCompanionService.java
3710 */
3711message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003712 // Id of the network.
3713 optional int32 net_id = 1;
3714
3715 enum State {
3716 UNKNOWN = 0;
3717 CONNECTED = 1;
3718 DISCONNECTED = 2;
3719 }
3720 // Connected state of a network.
3721 optional State state = 2;
3722}
3723
3724/**
3725 * Logs when a service starts and stops.
3726 * Logged from:
3727 * services/core/java/com/android/server/am/ActiveServices.java
3728 */
3729message ServiceStateChanged {
3730
3731 optional int32 uid = 1 [(is_uid) = true];
3732
3733 optional string package_name = 2;
3734
3735 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003736
3737 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003738 START = 1;
3739 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003740 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003741
3742 optional State state = 4;
3743}
3744
3745/**
3746 * Logs when a service is launched.
3747 * Logged from:
3748 * services/core/java/com/android/server/am/ActiveServices.java
3749 */
3750message ServiceLaunchReported {
3751
3752 optional int32 uid = 1 [(is_uid) = true];
3753
3754 optional string package_name = 2;
3755
3756 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003757}
Howard Ro688ae182018-09-25 00:09:36 -07003758
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003759/**
3760 * Logs when a hidden API is used.
3761 *
3762 * Logged from:
3763 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3764 */
3765message HiddenApiUsed {
3766 // The uid of the app making the hidden access.
3767 optional int32 uid = 1 [(is_uid) = true];
3768
3769 // Signature of the method or field accessed.
3770 optional string signature = 2;
3771
3772 enum AccessMethod {
3773 NONE = 0;
3774 REFLECTION = 1;
3775 JNI = 2;
3776 LINKING = 3;
3777 }
3778
3779 // Type of access.
3780 optional AccessMethod access_method = 3;
3781
3782 // Whether the access was prevented or not.
3783 optional bool access_denied = 4;
3784}
3785
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003786/**
3787 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3788 * - When user sees privacy chip
3789 * - When user clicks privacy chip
3790 * - How does the user exit the Privacy Dialog
3791 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003792 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3793 */
3794message PrivacyIndicatorsInteracted {
3795
3796 enum Type {
3797 UNKNOWN = 0;
3798 CHIP_VIEWED = 1;
3799 CHIP_CLICKED = 2;
3800 DIALOG_PRIVACY_SETTINGS = 3;
3801 DIALOG_DISMISS = 4;
3802 DIALOG_LINE_ITEM = 5;
3803 }
3804
3805 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3806
3807 // Used if the type is LINE_ITEM
3808 optional string package_name = 2;
3809}
3810
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003811/**
3812 * Logs information about a package that is moved from the internal to external storage and vice
3813 * versa.
3814 * It logs the package name, the type of the external storage where the package is installed
3815 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3816 * and the move type: if it's from internal to external or the other way around.
3817 *
3818 * Logged from:
3819 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3820 */
3821message AppMovedStorageReported {
3822 enum MoveType {
3823 UNKNOWN = 0;
3824 TO_EXTERNAL = 1;
3825 TO_INTERNAL = 2;
3826 }
3827 // The type of the external storage.
3828 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3829 // The type of move.
3830 optional MoveType move_type = 2;
3831 // The name of the package that was moved.
3832 optional string package_name = 3;
3833}
3834
jianjin8f2dee02019-03-29 14:03:08 -07003835/**
3836 * Logs when system server watchdog occurs.
3837 * Logged from:
3838 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3839 */
3840message SystemServerWatchdogOccurred {
3841 optional string subject = 1;
3842}
3843
3844/**
3845 * Logs when new file added to tombstones.
3846 * Logged from:
3847 * frameworks/base/core/java/com/android/server/BootReceiver.java
3848 */
3849message TombStoneOccurred {
3850}
3851
Hai Zhang5d3328d2019-04-13 21:25:06 +08003852/*
3853 * Information about a role request
3854 *
3855 * Logged from:
3856 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3857 */
3858message RoleRequestResultReported {
3859 // UID of application requesting the role
3860 optional int32 requesting_uid = 1;
3861
3862 // Package name of application requesting the role
3863 optional string requesting_package_name = 2;
3864
3865 // The role to be granted
3866 optional string role_name = 3;
3867
3868 // The count of applications qualifying for the role
3869 optional int32 qualifying_count = 4;
3870
3871 // UID of application current granted the role
3872 optional int32 current_uid = 5;
3873
3874 // Package name of application current granted the role
3875 optional string current_package_name = 6;
3876
3877 // UID of another application that user chose to grant the role to, instead of the requesting
3878 // application
3879 optional int32 granted_another_uid = 7;
3880
3881 // Package name of another application that user chose to grant the role to, instead of the
3882 // requesting application
3883 optional string granted_another_package_name = 8;
3884
3885 enum Result {
3886 UNDEFINED = 0;
3887 // role request was ignored
3888 IGNORED = 1;
3889 // role request was ignored because it's already granted
3890 IGNORED_ALREADY_GRANTED = 2;
3891 // role request was ignored because the application isn't qualified
3892 IGNORED_NOT_QUALIFIED = 3;
3893 // role request was ignored because user said it should be always denied
3894 IGNORED_USER_ALWAYS_DENIED = 4;
3895 // role was granted by user action
3896 USER_GRANTED = 5;
3897 // role was denied by user action
3898 USER_DENIED = 6;
3899 // role was denied by user granting another application the role
3900 USER_DENIED_GRANTED_ANOTHER = 7;
3901 // role was denied and set to be always denied by the user
3902 USER_DENIED_WITH_ALWAYS = 8;
3903 }
3904 // The result of the role request
3905 optional Result result = 9;
3906}
3907
Mark Tabrya824a642019-11-05 12:26:12 -08003908/**
3909 * Logs when a Vehicle Maps Service client's connection state has changed
3910 *
3911 * Logged from:
3912 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
3913 */
3914message VmsClientConnectionStateChanged {
3915 // The UID of the VMS client app
3916 optional int32 uid = 1 [(is_uid) = true];
3917
3918 enum State {
3919 UNKNOWN = 0;
3920 // Attempting to connect to the client
3921 CONNECTING = 1;
3922 // Client connection established
3923 CONNECTED = 2;
3924 // Client connection closed unexpectedly
3925 DISCONNECTED = 3;
3926 // Client connection closed by VMS
3927 TERMINATED = 4;
3928 // Error establishing the client connection
3929 CONNECTION_ERROR = 5;
3930 }
3931
3932 optional State state = 2;
3933}
3934
Jeff Sharkey6bd21572019-11-15 20:45:33 -07003935/**
3936 * Logs when MediaProvider has successfully finished scanning a storage volume.
3937 *
3938 * Logged from:
3939 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
3940 */
3941message MediaProviderScanEvent {
3942 enum Reason {
3943 // Scan triggered due to unknown reason
3944 UNKNOWN = 0;
3945 // Scan triggered due to storage volume being mounted
3946 MOUNTED = 1;
3947 // Scan triggered due to explicit user action or app request
3948 DEMAND = 2;
3949 // Scan triggered due to idle maintenance
3950 IDLE = 3;
3951 }
3952
3953 // Volume type that this event pertains to
3954 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3955 // Reason why this scan was triggered
3956 optional Reason reason = 2;
3957 // Total number of files scanned
3958 optional int64 item_count = 3;
3959 // Duration of scan, normalized per file
3960 optional float normalized_duration_millis = 4;
3961 // Number of database inserts, normalized per file
3962 optional float normalized_insert_count = 5;
3963 // Number of database updates, normalized per file
3964 optional float normalized_update_count = 6;
3965 // Number of database deletes, normalized per file
3966 optional float normalized_delete_count = 7;
3967}
3968
3969/**
3970 * Logs when an app has asked MediaProvider to delete media belonging to the user.
3971 *
3972 * Logged from:
3973 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
3974 */
3975message MediaProviderDeletionEvent {
3976 // Volume type that this event pertains to
3977 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3978 // Device timestamp when this deletion event occurred
3979 optional int64 timestamp_millis = 2;
3980 // App that requested deletion
3981 optional string package_name = 3;
3982 // Number of items that were deleted
3983 optional int32 item_count = 4;
3984}
3985
3986/**
3987 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
3988 *
3989 * Logged from:
3990 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
3991 */
3992message MediaProviderPermissionEvent {
3993 enum Result {
3994 UNKNOWN = 0;
3995 USER_GRANTED = 1;
3996 AUTO_GRANTED = 2;
3997 USER_DENIED = 3;
3998 USER_DENIED_WITH_PREJUDICE = 4;
3999 AUTO_DENIED = 5;
4000 }
4001
4002 // Volume type that this event pertains to
4003 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4004 // Device timestamp when this permission event occurred
4005 optional int64 timestamp_millis = 2;
4006 // App that requested permission
4007 optional string package_name = 3;
4008 // Number of items that were requested
4009 optional int32 item_count = 4;
4010 // Result of this request
4011 optional Result result = 5;
4012}
4013
4014/**
4015 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4016 *
4017 * Logged from:
4018 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4019 */
4020message MediaProviderSchemaChange {
4021 // Volume type that this event pertains to
4022 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4023 // Old database version code
4024 optional int32 version_from = 2;
4025 // New database version code
4026 optional int32 version_to = 3;
4027 // Total number of files in database
4028 optional int64 item_count = 4;
4029 // Duration of schema change, normalized per file
4030 optional float normalized_duration_millis = 5;
4031}
4032
4033/**
4034 * Logs when MediaProvider has finished an idle maintenance job.
4035 *
4036 * Logged from:
4037 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4038 */
4039message MediaProviderIdleMaintenance {
4040 // Volume type that this event pertains to
4041 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4042
4043 // Total number of files in database
4044 optional int64 item_count = 2;
4045 // Duration of idle maintenance, normalized per file
4046 optional float normalized_duration_millis = 3;
4047 // Number of thumbnails found to be stale, normalized per file
4048 optional float normalized_stale_thumbnails = 4;
4049 // Number of items found to be expired, normalized per file
4050 optional float normalized_expired_media = 5;
4051}
4052
Keun young Park3e033cb2019-12-18 11:27:35 -08004053/**
4054 * Represents boot time event with duration in ms.
4055 *
4056 * Logged from: bootstat and various system server components. Check each enums for details.
4057 */
4058message BootTimeEventDuration {
4059 enum DurationEvent {
4060 UNKNOWN = 0;
4061 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4062 ABSOLUTE_BOOT_TIME = 1;
4063 // Bootloader's 1st stage execution time.
4064 // Logged from bootstat.
4065 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4066 // Bootloader's 1st stage loading time.
4067 // Logged from bootstat.
4068 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4069 // Bootloader's kernel loading time.
4070 // Logged from bootstat.
4071 BOOTLOADER_KERNEL_LOAD = 4;
4072 // Bootloader's 2nd stage execution time.
4073 // Logged from bootstat.
4074 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4075 // Bootloader's 2nd stage loading time.
4076 // Logged from bootstat.
4077 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4078 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4079 // for locked device.
4080 // Logged from bootstat.
4081 BOOTLOADER_UI_WAIT = 7;
4082 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4083 // Logged from bootstat.
4084 BOOTLOADER_TOTAL = 8;
4085 // Shutdown duration inside init for the reboot before the current boot up.
4086 // Logged from f/b/services/.../BootReceiver.java.
4087 SHUTDOWN_DURATION = 9;
4088 // Total time for mounting of disk devices during bootup.
4089 // Logged from f/b/services/.../BootReceiver.java.
4090 MOUNT_DEFAULT_DURATION = 10;
4091 // Total time for early stage mounting of disk devices during bootup.
4092 // Logged from f/b/services/.../BootReceiver.java.
4093 MOUNT_EARLY_DURATION = 11;
4094 // Total time for late stage mounting of disk devices during bootup.
4095 // Logged from f/b/services/.../BootReceiver.java.
4096 MOUNT_LATE_DURATION = 12;
4097 // Average time to scan non-system app after OTA
4098 // Logged from f/b/services/.../PackageManagerService.java
4099 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4100 // Time to initialize Package manager after OTA
4101 // Logged from f/b/services/.../PackageManagerService.java
4102 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4103 // Time to scan all system app from Package manager after OTA
4104 // Logged from f/b/services/.../PackageManagerService.java
4105 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4106 // Init's total time for cold boot stage.
4107 // Logged from bootstat.
4108 COLDBOOT_WAIT = 16;
4109 // Init's total time for initializing selinux.
4110 // Logged from bootstat.
4111 SELINUX_INIT = 17;
4112 // Time since last factory reset.
4113 // Logged from bootstat.
4114 FACTORY_RESET_TIME_SINCE_RESET = 18;
4115 }
4116
4117 // Type of the event.
4118 optional DurationEvent event = 1;
4119 // Duration of the event in ms.
4120 optional int64 duration_millis = 2;
4121}
4122
4123/**
4124 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4125 * since boot-up.
4126 *
4127 * Logged from: bootstat and various system server components. Check each enums for details.
4128 */
4129message BootTimeEventElapsedTime {
4130 enum ElapsedTimeEvent {
4131 UNKNOWN = 0;
4132 // Time when init starts 1st stage. Logged from bootstat.
4133 ANDROID_INIT_STAGE_1 = 1;
4134 // Time when sys.boot_completed prop is set.
4135 // Logged from bootstat.
4136 BOOT_COMPLETE = 2;
4137 // BOOT_COMPLETE for encrypted device.
4138 BOOT_COMPLETE_ENCRYPTION = 3;
4139 // BOOT_COMPLETE for device with no encryption.
4140 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4141 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
4142 BOOT_COMPLETE_POST_DESCRYPT = 5;
4143 // BOOT_COMPLETE after factory reset.
4144 FACTORY_RESET_BOOT_COMPLETE = 6;
4145 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4146 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
4147 // BOOT_COMPLETE_POST_DESCRYPT after factory reset.
4148 FACTORY_RESET_BOOT_COMPLETE_POST_DESCRYPT = 8;
4149 // BOOT_COMPLETE after OTA.
4150 OTA_BOOT_COMPLETE = 9;
4151 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4152 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
4153 // BOOT_COMPLETE_POST_DESCRYPT after OTA.
4154 OTA_BOOT_COMPLETE_POST_DESCRYPT = 11;
4155 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4156 // Logged from f/b/services/.../UserController.java
4157 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4158 // Time when the system starts sending BOOT_COMPLETED broadcast.
4159 // Logged from f/b/services/.../UserController.java
4160 FRAMEWORK_BOOT_COMPLETED = 13;
4161 // Time when the package manager starts init.
4162 // Logged from f/b/services/.../SystemServer.java
4163 PACKAGE_MANAGER_INIT_START = 14;
4164 // Time when package manager is ready
4165 // Logged from f/b/services/.../SystemServer.java
4166 PACKAGE_MANAGER_INIT_READY = 15;
4167 // Represents the time when user has entered unlock credential for system with user pin.
4168 // Logged from bootstat.
4169 POST_DECRYPT = 16;
4170 // Represents the start of zygote's init.
4171 // Logged from zygote itself.
4172 ZYGOTE_INIT_START = 17;
4173 // Represents the start of secondary zygote's init.
4174 // TODO: add logging to zygote
4175 SECONDARY_ZYGOTE_INIT_START = 18;
4176 // Represents the start of system server's init.
4177 // Logged from f/b/services/.../SystemServer.java
4178 SYSTEM_SERVER_INIT_START = 19;
4179 // Represents the completion of system server's init.
4180 // Logged from f/b/services/.../SystemServer.java
4181 SYSTEM_SERVER_READY = 20;
4182 // Represents the start of launcher during boot-up.
4183 // TODO: add logging
4184 LAUNCHER_START = 21;
4185 // Represents the completion of launcher's initial rendering. User can use other apps from
4186 // launcher from this point.
4187 // TODO: add logging
4188 LAUNCHER_SHOWN = 22;
4189 }
4190
4191 // Type of the event.
4192 optional ElapsedTimeEvent event = 1;
4193 // Time since bootup for the event.
4194 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4195 optional int64 time_millis = 2;
4196}
4197
4198/**
4199 * Boot time events with UTC time.
4200 *
4201 * Logged from: bootstat and various system server components. Check each enums for details.
4202 */
4203message BootTimeEventUtcTime {
4204 enum UtcTimeEvent {
4205 UNKNOWN = 0;
4206 // Time of the bootstat's marking of 1st boot after the last factory reset.
4207 // Logged from bootstat.
4208 FACTORY_RESET_RESET_TIME = 1;
4209 // The time when bootstat records FACTORY_RESET_* events. This is close to
4210 // BOOT_COMPLETE time for the current bootup.
4211 // Logged from bootstat.
4212 FACTORY_RESET_CURRENT_TIME = 2;
4213 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4214 // Logged from bootstat.
4215 FACTORY_RESET_RECORD_VALUE = 3;
4216 }
4217
4218 // Type of the event.
4219 optional UtcTimeEvent event = 1;
4220 // UTC time for the event.
4221 optional int64 utc_time_secs = 2;
4222}
4223
4224/**
4225 * Boot time events representing specific error code during bootup.
4226 * Meaning of error code can be different per each event type.
4227 *
4228 * Logged from: bootstat and various system server components. Check each enums for details.
4229 */
4230message BootTimeEventErrorCode {
4231 enum ErrorCodeEvent {
4232 UNKNOWN = 0;
4233 // Linux error code for time() call to get the current UTC time.
4234 // Logged from bootstat.
4235 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4236 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4237 // as UMOUNT_STAT_* from init/reboot.cpp.
4238 // Logged from f/b/services/.../BootReceiver.java.
4239 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004240 // Reprepsents fie system mounting error code of /data partition for the current boot.
4241 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004242 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004243 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004244 }
4245
4246 // Type of the event.
4247 optional ErrorCodeEvent event = 1;
4248 // error code defined per each event type.
4249 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4250 // FS_MGR_FS_STAT.
4251 optional int32 error_code = 2;
4252}
4253
Chenjie Yubbcbc602018-02-05 16:51:52 -08004254//////////////////////////////////////////////////////////////////////
4255// Pulled atoms below this line //
4256//////////////////////////////////////////////////////////////////////
4257
4258/**
David Chenc8a43242017-10-17 16:23:28 -07004259 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4260 *
4261 * Pulled from:
4262 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4263 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004264message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004265 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004266
4267 optional int64 rx_bytes = 2;
4268
4269 optional int64 rx_packets = 3;
4270
4271 optional int64 tx_bytes = 4;
4272
4273 optional int64 tx_packets = 5;
4274}
4275
4276/**
4277 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4278 *
4279 * Pulled from:
4280 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4281 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004282message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004283 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004284
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004285 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4286 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004287
4288 optional int64 rx_bytes = 3;
4289
4290 optional int64 rx_packets = 4;
4291
4292 optional int64 tx_bytes = 5;
4293
4294 optional int64 tx_packets = 6;
4295}
4296
4297/**
4298 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4299 *
4300 * Pulled from:
4301 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4302 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004303message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004304 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004305
4306 optional int64 rx_bytes = 2;
4307
4308 optional int64 rx_packets = 3;
4309
4310 optional int64 tx_bytes = 4;
4311
4312 optional int64 tx_packets = 5;
4313}
4314
4315/**
4316 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4317 *
4318 * Pulled from:
4319 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4320 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004321message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004322 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004323
Yao Chenc40a19d2018-03-15 16:48:25 -07004324 // 1 denotes foreground and 0 denotes background. This is called Set in
4325 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004326 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004327
4328 optional int64 rx_bytes = 3;
4329
4330 optional int64 rx_packets = 4;
4331
4332 optional int64 tx_bytes = 5;
4333
4334 optional int64 tx_packets = 6;
4335}
4336
4337/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004338 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4339 *
4340 * Pulled from:
4341 * StatsCompanionService
4342 */
4343message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004344 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004345
4346 optional int64 rx_bytes = 2;
4347
4348 optional int64 tx_bytes = 3;
4349}
4350
4351/**
David Chenc8a43242017-10-17 16:23:28 -07004352 * Pulls the kernel wakelock durations. This atom is adapted from
4353 * android/internal/os/KernelWakelockStats.java
4354 *
4355 * Pulled from:
4356 * StatsCompanionService using KernelWakelockReader.
4357 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004358message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004359 optional string name = 1;
4360
4361 optional int32 count = 2;
4362
4363 optional int32 version = 3;
4364
Yangster-maca8a30442018-10-13 23:46:34 -07004365 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004366}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004367
Chenjie Yu05013b32017-11-21 10:21:41 -08004368/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004369 * Pulls low power state information. If power.stats HAL is not available, this
4370 * includes platform and subsystem sleep state information,
4371 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4372 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004373 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004374 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004375 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4376 * as defined in:
4377 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004378 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004379message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004380 // Subsystem name
4381 optional string subsystem_name = 1;
4382 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4383 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004384 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4385 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004386 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004387 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004388 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004389 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004390 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004391}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004392
Chenjie Yu05013b32017-11-21 10:21:41 -08004393/**
Bookatz92da2832018-11-01 18:10:03 -07004394 * Pulls on-device power measurement information.
4395 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4396 * Pulled from:
4397 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4398 */
4399message OnDevicePowerMeasurement {
4400 // Name of the subsystem (to which the rail belongs).
4401 optional string subsystem_name = 1;
4402
4403 // Rail name. The rail lies within the subsystem.
4404 optional string rail_name = 2;
4405
4406 // Time (in ms since boot) at which the rail energy value was measured.
4407 // This may differ slightly from the time that statsd logs this information.
4408 optional uint64 measurement_timestamp_millis = 3;
4409
4410 // Accumulated energy used via the rail since device boot in uWs.
4411 optional uint64 energy_microwatt_secs = 4;
4412}
4413
4414/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004415 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004416 * Pulls the time the cpu spend on the frequency index. Frequency index
4417 * starts from highest to lowest. The value should be monotonically
4418 * increasing since boot. However, if there is a cpu
4419 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004420 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004421message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004422 optional uint32 cluster = 1;
4423 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004424 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004425}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004426
Chenjie Yu05013b32017-11-21 10:21:41 -08004427/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004428 * Pulls Cpu Time Per Uid.
4429 * Note that isolated process uid time should be attributed to host uids.
4430 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004431message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004432 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004433 optional uint64 user_time_micros = 2;
4434 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004435}
4436
4437/**
4438 * Pulls Cpu Time Per Uid per frequency.
4439 * Note that isolated process uid time should be attributed to host uids.
4440 * For each uid, we order the time by descending frequencies.
4441 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004442message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004443 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004444 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004445 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004446}
Hugo Benichi884970e2017-11-14 22:42:46 +09004447
Chenjie Yu05013b32017-11-21 10:21:41 -08004448/**
4449 * Pulls Wifi Controller Activity Energy Info
4450 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004451message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004452 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004453 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004454 // stack reported state
4455 // TODO: replace this with proto enum
4456 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004457 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004458 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004459 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004460 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004461 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004462 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004463 // product of current(mA), voltage(V) and time(ms)
4464 optional uint64 controller_energy_used = 6;
4465}
4466
4467/**
4468 * Pulls Modem Activity Energy Info
4469 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004470message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004471 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004472 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004473 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004474 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004475 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004476 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004477 /**
4478 * Tx power index
4479 * index 0 = tx_power < 0dBm
4480 * index 1 = 0dBm < tx_power < 5dBm
4481 * index 2 = 5dBm < tx_power < 15dBm
4482 * index 3 = 15dBm < tx_power < 20dBm
4483 * index 4 = tx_power > 20dBm
4484 */
4485 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004486 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004487 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004488 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004489 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004490 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004491 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004492 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004493 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004494 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004495 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004496 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004497 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004498 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004499}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004500
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004501/**
4502 * Pulls Bluetooth Activity Energy Info
4503 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4504 */
4505message BluetoothActivityInfo {
4506 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004507 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004508 // bluetooth stack state
4509 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004510 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004511 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004512 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004513 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004514 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004515 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004516 // product of current(mA), voltage(V) and time(ms)
4517 optional uint64 energy_used = 6;
4518}
4519
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004520/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004521 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004522 *
4523 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004524 */
4525message ProcessMemoryState {
4526 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004527 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004528
4529 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004530 // Usually package name, "system" for system server.
4531 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004532 optional string process_name = 2;
4533
Rafal Slawikda51b932018-12-13 16:31:33 +00004534 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004535 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004536
4537 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004538 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004539
4540 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004541 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004542
Rajeev Kumar90235992018-01-29 11:06:48 -08004543 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004544 // Value is read from memory.stat, field total_rss if per-app memory
4545 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004546 optional int64 rss_in_bytes = 6;
4547
4548 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004549 // Value is read from memory.stat, field total_cache if per-app memory
4550 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004551 optional int64 cache_in_bytes = 7;
4552
4553 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004554 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004555 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004556 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004557
Rafal Slawik203c3db2019-09-25 19:53:01 +01004558 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004559 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004560
Rafal Slawik203c3db2019-09-25 19:53:01 +01004561 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4562 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004563
Rafal Slawik203c3db2019-09-25 19:53:01 +01004564 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4565 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004566}
4567
4568/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004569 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004570 *
4571 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4572 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004573 *
4574 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004575 */
4576message ProcessMemoryHighWaterMark {
4577 // The uid if available. -1 means not available.
4578 optional int32 uid = 1 [(is_uid) = true];
4579
Rafal Slawikda51b932018-12-13 16:31:33 +00004580 // The process name.
4581 // Usually package name or process cmdline.
4582 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004583 optional string process_name = 2;
4584
Rafal Slawik239b6802019-09-09 18:46:01 +01004585 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4586 // computed by converting kilobytes to bytes.
4587 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4588
Rafal Slawik3bea8952018-11-15 12:39:33 +00004589 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4590 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004591 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004592}
4593
4594/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004595 * Logs the memory stats for a process.
4596 *
4597 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4598 * and for selected native processes.
4599 */
4600message ProcessMemorySnapshot {
4601 // The uid if available. -1 means not available.
4602 optional int32 uid = 1 [(is_uid) = true];
4603
4604 // The process name.
4605 // Usually package name or process cmdline.
4606 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4607 optional string process_name = 2;
4608
4609 // The pid of the process.
4610 // Allows to disambiguate instances of the process.
4611 optional int32 pid = 3;
4612
4613 // The current OOM score adjustment value.
4614 // Read from ProcessRecord for managed processes.
4615 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4616 optional int32 oom_score_adj = 4;
4617
4618 // The current RSS of the process.
4619 // VmRSS from /proc/pid/status.
4620 optional int32 rss_in_kilobytes = 5;
4621
4622 // The current anon RSS of the process.
4623 // RssAnon from /proc/pid/status.
4624 optional int32 anon_rss_in_kilobytes = 6;
4625
4626 // The current swap size of the process.
4627 // VmSwap from /proc/pid/status.
4628 optional int32 swap_in_kilobytes = 7;
4629
4630 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4631 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4632}
4633
4634/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004635 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004636 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004637message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004638 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004639}
4640
4641/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004642 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004643 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004644message SystemUptime {
4645 // Milliseconds since the system was booted.
4646 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4647 // for external input).
4648 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004649 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004650}
4651
4652/*
4653 * Reads from /proc/uid_concurrent_active_time which has the format:
4654 * active: X (X is # cores)
4655 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4656 * [uid1]: [time-0] [time-1] [time-2] ... ...
4657 * ...
4658 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4659 * The file contains a monotonically increasing count of time for a single boot.
4660 */
4661message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004662 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004663 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004664}
4665
4666/**
4667 * Reads from /proc/uid_concurrent_policy_time which has the format:
4668 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4669 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4670 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4671 * ...
4672 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4673 * The file contains a monotonically increasing count of time for a single boot.
4674 */
4675message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004676 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004677 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004678 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004679}
4680
4681/*
4682 * Pulls free disk space, for data, system partition and temporary directory.
4683 */
4684message DiskSpace {
4685 // available bytes in data partition
4686 optional uint64 data_available_bytes = 1;
4687 // available bytes in system partition
4688 optional uint64 system_available_bytes = 2;
4689 // available bytes in download cache or temp directories
4690 optional uint64 temp_available_bytes = 3;
4691}
Tej Singhbf972d92018-01-10 20:51:13 -08004692
4693/**
4694 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004695 *
4696 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004697 */
4698message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004699 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004700}
4701
4702/**
4703 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004704 * Pulled from:
4705 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004706 */
4707message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004708 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004709}
4710
4711/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004712 * Pulls battery voltage.
4713 * Pulled from:
4714 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4715 */
4716message BatteryVoltage {
4717 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004718 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004719}
4720
4721/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004722 * Pulls battery level (percent full, from 0 to 100).
4723 *
4724 * Pulled from:
4725 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4726 */
4727message BatteryLevel {
4728 // Battery level. Should be in [0, 100].
4729 optional int32 battery_level = 1;
4730}
4731
4732/**
Tej Singhd89137e2018-03-26 14:51:40 -07004733 * Pulls the temperature of various parts of the device.
4734 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004735 *
Maggie White442b6312019-04-05 16:26:44 -07004736 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004737 */
4738message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004739 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004740 optional android.os.TemperatureTypeEnum sensor_location = 1;
4741
4742 // The name of the temperature source. Eg. CPU0
4743 optional string sensor_name = 2;
4744
Tej Singhd89137e2018-03-26 14:51:40 -07004745 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004746 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004747 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004748
4749 // Relative severity of the throttling, see enum definition.
4750 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004751}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004752
4753/**
4754 * Pulls the statistics of calls to Binder.
4755 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004756 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4757 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004758 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004759 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004760 */
4761message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004762 // UID of the process responsible for the binder transaction. It will be set if the process
4763 // executing the binder transaction attribute the transaction to another uid using
4764 // Binder.setThreadWorkSource().
4765 //
4766 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004767 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004768 // UID of the process executing the binder transaction.
4769 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004770 // Fully qualified class name of the API call.
4771 //
4772 // This is a system server class name.
4773 //
4774 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4775 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4776 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4777 // commonly used APIs.
4778 optional string service_class_name = 2;
4779 // Method name of the API call. It can also be a transaction code if we cannot
4780 // resolve it to a name. See Binder#getTransactionName.
4781 //
4782 // This is a system server method name.
4783 optional string service_method_name = 3;
4784 // Total number of API calls.
4785 optional int64 call_count = 4;
4786 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4787 optional bool screen_interactive = 13;
4788 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4789 // call_count will be equal to recorded_call_count.
4790 //
4791 // If recorded_call_count is different than call_count, it means data collection has been
4792 // sampled. All the fields below will be sampled in this case.
4793 optional int64 recorded_call_count = 12;
4794 // Number of exceptions thrown by the API.
4795 optional int64 recorded_exception_count = 5;
4796 // Total latency of all API calls.
4797 // Average can be computed using total_latency_micros / recorded_call_count.
4798 optional int64 recorded_total_latency_micros = 6;
4799 // Maximum latency of one API call.
4800 optional int64 recorded_max_latency_micros = 7;
4801 // Total CPU usage of all API calls.
4802 // Average can be computed using total_cpu_micros / recorded_call_count.
4803 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4804 optional int64 recorded_total_cpu_micros = 8;
4805 // Maximum CPU usage of one API call.
4806 optional int64 recorded_max_cpu_micros = 9;
4807 // Maximum parcel reply size of one API call.
4808 optional int64 recorded_max_reply_size_bytes = 10;
4809 // Maximum parcel request size of one API call.
4810 optional int64 recorded_max_request_size_bytes = 11;
4811}
4812
4813/**
4814 * Pulls the statistics of exceptions during calls to Binder.
4815 *
4816 * Binder stats are cumulative from boot unless somebody reset the data using
4817 * > adb shell dumpsys binder_calls_stats --reset
4818 */
4819message BinderCallsExceptions {
4820 // Exception class name, e.g. java.lang.IllegalArgumentException.
4821 //
4822 // This is an exception class name thrown by the system server.
4823 optional string exception_class_name = 1;
4824 // Total number of exceptions.
4825 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004826}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004827
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004828/**
4829 * Pulls the statistics of message dispatching on HandlerThreads.
4830 *
4831 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4832 * config on the device.
4833 *
4834 * Next tag: 11
4835 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004836message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004837 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004838 optional int32 uid = 1 [(is_uid) = true];
4839
4840 // Fully qualified class name of the handler target class.
4841 //
4842 // This field does not contain PII. This is a system server class name.
4843 optional string handler_class_name = 2;
4844
4845 // The name of the thread that runs the Looper.
4846 //
4847 // This field does not contain PII. This is a system server thread name.
4848 optional string looper_thread_name = 3;
4849
4850 // The name of the dispatched message.
4851 //
4852 // This field does not contain PII. This is a system server constant or class
4853 // name.
4854 optional string message_name = 4;
4855
4856 // Total number of successfully dispatched messages.
4857 optional int64 message_count = 5;
4858
4859 // Total number of messages that failed dispatching.
4860 optional int64 exception_count = 6;
4861
4862 // Total number of processed messages we have data recorded for. If we
4863 // collected data for all the messages, message_count will be equal to
4864 // recorded_message_count.
4865 //
4866 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004867 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004868 optional int64 recorded_message_count = 7;
4869
4870 // Total latency of all processed messages.
4871 // Average can be computed using recorded_total_latency_micros /
4872 // recorded_message_count.
4873 optional int64 recorded_total_latency_micros = 8;
4874
4875 // Total CPU usage of all processed message.
4876 // Average can be computed using recorded_total_cpu_micros /
4877 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004878 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004879 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004880
4881 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4882 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004883
4884 // Max recorded CPU usage of all processed messages.
4885 optional int64 recorded_max_cpu_micros = 11;
4886
4887 // Max recorded latency of all processed messages.
4888 optional int64 recorded_max_latency_micros = 12;
4889
4890 // Total number of messages we tracked the dispatching delay for. If we
4891 // collected data for all the messages, message_count will be equal to
4892 // recorded_delay_message_count.
4893 //
4894 // If recorded_delay_message_count is different than message_count, it means data
4895 // collection has been sampled or/and not all messages specified the target dispatch time.
4896 // The fields below will be sampled in this case.
4897 optional int64 recorded_delay_message_count = 13;
4898
4899 // Total 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 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4903 optional int64 recorded_total_delay_millis = 14;
4904
4905 // Max dispatching delay of all processed messages.
4906 // Calculated as a difference between the target dispatching time (Message.when)
4907 // and the actual dispatching time.
4908 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004909}
Tej Singh86dc9db2018-09-06 00:39:57 +00004910
4911/**
4912 * Pulls disk information, such as write speed and latency.
4913 */
4914message DiskStats {
4915 // Time taken to open, write 512B to, and close a file.
4916 // -1 if error performing the check.
4917 optional int64 data_write_latency_millis = 1;
4918
4919 optional bool file_based_encryption = 2;
4920
4921 // Recent disk write speed in kB/s.
4922 // -1 if error querying storageed.
4923 // 0 if data is unavailable.
4924 optional int32 recent_disk_write_speed = 3;
4925}
4926
4927
4928/**
4929 * Free and total bytes of the Data, Cache, and System partition.
4930 */
4931message DirectoryUsage {
4932 enum Directory {
4933 UNKNOWN = 0;
4934 DATA = 1;
4935 CACHE = 2;
4936 SYSTEM = 3;
4937 }
4938 optional Directory directory = 1;
4939 optional int64 free_bytes = 2;
4940 optional int64 total_bytes = 3;
4941}
4942
4943
4944/**
4945 * Size of an application: apk size, data size, and cache size.
4946 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4947 * Information is only reported for apps with the primary user (user 0).
4948 * Sizes are aggregated by package name.
4949 */
4950message AppSize {
4951 // Including uids will involve modifying diskstats logic.
4952 optional string package_name = 1;
4953 // App size in bytes. -1 if unavailable.
4954 optional int64 app_size_bytes = 2;
4955 // App data size in bytes. -1 if unavailable.
4956 optional int64 app_data_size_bytes = 3;
4957 // App cache size in bytes. -1 if unavailable.
4958 optional int64 app_cache_size_bytes = 4;
4959 // Time that the cache file was produced.
4960 // Uses System.currentTimeMillis(), which is wall clock time.
4961 optional int64 cache_time_millis = 5;
4962}
4963
4964
4965/**
4966 * Size of a particular category. Eg: photos, videos.
4967 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4968 */
4969message CategorySize {
4970 enum Category {
4971 UNKNOWN = 0;
4972 APP_SIZE = 1;
4973 APP_DATA_SIZE = 2;
4974 APP_CACHE_SIZE = 3;
4975 PHOTOS = 4;
4976 VIDEOS = 5;
4977 AUDIO = 6;
4978 DOWNLOADS = 7;
4979 SYSTEM = 8;
4980 OTHER = 9;
4981 }
4982 optional Category category = 1;
4983 // Category size in bytes.
4984 optional int64 size_bytes = 2;
4985 // Time that the cache file was produced.
4986 // Uses System.currentTimeMillis(), which is wall clock time.
4987 optional int64 cache_time_millis = 3;
4988}
Tej Singhd6d6d772018-09-05 17:41:25 -07004989
4990/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004991 * Pulls per uid I/O stats. The stats are cumulative since boot.
4992 *
4993 * Read/write bytes are I/O events from a storage device
4994 * Read/write chars are data requested by read/write syscalls, and can be
4995 * satisfied by caching.
4996 *
4997 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4998 */
4999message DiskIo {
5000 optional int32 uid = 1 [(is_uid) = true];
5001 optional int64 fg_chars_read = 2;
5002 optional int64 fg_chars_write = 3;
5003 optional int64 fg_bytes_read = 4;
5004 optional int64 fg_bytes_write = 5;
5005 optional int64 bg_chars_read = 6;
5006 optional int64 bg_chars_write = 7;
5007 optional int64 bg_bytes_read = 8;
5008 optional int64 bg_bytes_write = 9;
5009 optional int64 fg_fsync = 10;
5010 optional int64 bg_fsync= 11;
5011}
5012
5013
5014/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005015 * Pulls the number of fingerprints for each user.
5016 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005017 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005018 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005019message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005020 // The associated user. Eg: 0 for owners, 10+ for others.
5021 // Defined in android/os/UserHandle.java
5022 optional int32 user = 1;
5023 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005024 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005025}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005026
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005027/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005028 * Pulls the number of faces for each user.
5029 *
5030 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5031 */
5032message NumFacesEnrolled {
5033 // The associated user. Eg: 0 for owners, 10+ for others.
5034 // Defined in android/os/UserHandle.java
5035 optional int32 user = 1;
5036 // Number of faces registered to that user.
5037 optional int32 num_faces_enrolled = 2;
5038}
5039/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005040 * A mapping of role holder -> role
5041 */
5042message RoleHolder {
5043 // uid of the role holder
5044 optional int32 uid = 1 [(is_uid) = true];
5045
5046 // package name of the role holder
5047 optional string package_name = 2;
5048
5049 // the role held
5050 optional string role = 3;
5051}
5052
Yangsteraf9aee72018-10-12 09:26:16 -07005053message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005054 // These are all in byte resolution.
5055 optional int64 min = 1 [deprecated = true];
5056 optional int64 average = 2 [deprecated = true];
5057 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005058
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005059 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5060 // int64 fields.
5061 optional int32 mean_kb = 4;
5062 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005063}
5064
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005065// A reduced subset of process states; reducing the number of possible states allows more
5066// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5067enum ProcessStateAggregated {
5068 PROCESS_STATE_UNKNOWN = 0;
5069 // Persistent system process.
5070 PROCESS_STATE_PERSISTENT = 1;
5071 // Top activity; actually any visible activity.
5072 PROCESS_STATE_TOP = 2;
5073 // Process binding to top or a foreground service.
5074 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5075 // Processing running a foreground service.
5076 PROCESS_STATE_FGS = 4;
5077 // Important foreground process (ime, wallpaper, etc).
5078 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5079 // Important background process.
5080 PROCESS_STATE_BACKGROUND = 6;
5081 // Process running a receiver.
5082 PROCESS_STATE_RECEIVER = 7;
5083 // All kinds of cached processes.
5084 PROCESS_STATE_CACHED = 8;
5085}
5086
5087// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005088message ProcessStatsStateProto {
5089 optional android.service.procstats.ScreenState screen_state = 1;
5090
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005091 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005092
5093 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5094 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005095 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5096
5097 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005098
5099 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005100 optional int64 duration_millis = 4 [deprecated = true];
5101 // Same as above, but with minute resolution so it fits into an int32.
5102 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005103
5104 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005105 optional int64 realtime_duration_millis = 9 [deprecated = true];
5106 // Same as above, but with minute resolution so it fits into an int32.
5107 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005108
5109 // # of samples taken
5110 optional int32 sample_size = 5;
5111
5112 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005113 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005114
5115 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005116 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005117
5118 // RSS is memory resident for this process
5119 optional AggStats rss = 8;
5120}
5121
5122// Next Tag: 7
5123message ProcessStatsProto {
5124 // Name of process.
5125 optional string process = 1;
5126
5127 // Uid of the process.
5128 optional int32 uid = 2;
5129
5130 // Information about how often kills occurred
5131 message Kill {
5132 // Count of excessive CPU kills
5133 optional int32 cpu = 1;
5134
5135 // Count of kills when cached
5136 optional int32 cached = 2;
5137
5138 // PSS stats during cached kill
5139 optional AggStats cached_pss = 3;
5140 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005141 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005142
5143 // Time and memory spent in various states.
5144 repeated ProcessStatsStateProto states = 5;
5145
5146 // Total time process has been running... screen_state, memory_state, and process_state
5147 // will not be set.
5148 optional ProcessStatsStateProto total_running_state = 6;
5149}
5150
5151message PackageServiceOperationStatsProto {
5152 // Operate enum: Started, Foreground, Bound, Executing
5153 optional android.service.procstats.ServiceOperationState operation = 1;
5154
5155 // Number of times the service was in this operation.
5156 optional int32 count = 2;
5157
5158 // Information about a state the service can be in.
5159 message StateStats {
5160 // Screen state enum.
5161 optional android.service.procstats.ScreenState screen_state = 1;
5162 // Memory state enum.
5163 optional android.service.procstats.MemoryState memory_state = 2;
5164
5165 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005166 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005167 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005168 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005169 }
5170 repeated StateStats state_stats = 3;
5171}
5172
5173message PackageServiceStatsProto {
5174 // Name of service component.
5175 optional string service_name = 1;
5176
5177 // The operation stats.
5178 // The package_name, package_uid, package_version, service_name will not be set to save space.
5179 repeated PackageServiceOperationStatsProto operation_stats = 2;
5180}
5181
5182message PackageAssociationSourceProcessStatsProto {
5183 // Uid of the process.
5184 optional int32 process_uid = 1;
5185 // Process name.
5186 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005187 // Package name.
5188 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005189 // Total count of the times this association appeared.
5190 optional int32 total_count = 3;
5191
5192 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005193 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005194
5195 // Total count of the times this association became actively impacting its target process.
5196 optional int32 active_count = 5;
5197
5198 // Information on one source in this association.
5199 message StateStats {
5200 // Process state enum.
5201 optional android.service.procstats.ProcessState process_state = 1;
5202 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005203 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005204 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005205 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005206 }
5207 repeated StateStats active_state_stats = 6;
5208}
5209
5210message PackageAssociationProcessStatsProto {
5211 // Name of the target component.
5212 optional string component_name = 1;
5213 // Information on one source in this association.
5214 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5215}
5216
5217
5218message ProcessStatsPackageProto {
5219 // Name of package.
5220 optional string package = 1;
5221
5222 // Uid of the package.
5223 optional int32 uid = 2;
5224
5225 // Version of the package.
5226 optional int64 version = 3;
5227
5228 // Stats for each process running with the package loaded in to it.
5229 repeated ProcessStatsProto process_stats = 4;
5230
5231 // Stats for each of the package's services.
5232 repeated PackageServiceStatsProto service_stats = 5;
5233
5234 // Stats for each association with the package.
5235 repeated PackageAssociationProcessStatsProto association_stats = 6;
5236}
5237
5238message ProcessStatsSectionProto {
5239 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005240 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005241
5242 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005243 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005244
5245 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005246 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005247
5248 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005249 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005250
5251 // System runtime library. e.g. "libdvm.so", "libart.so".
5252 optional string runtime = 5;
5253
5254 // whether kernel reports swapped pss.
5255 optional bool has_swapped_pss = 6;
5256
5257 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5258 enum Status {
5259 STATUS_UNKNOWN = 0;
5260 STATUS_COMPLETE = 1;
5261 STATUS_PARTIAL = 2;
5262 STATUS_SHUTDOWN = 3;
5263 STATUS_SYSPROPS = 4;
5264 }
5265 repeated Status status = 7;
5266
Chenjie Yub2ecc792019-01-17 10:27:26 -08005267 // Number of pages available of various types and sizes, representation fragmentation.
5268 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5269
Yangsteraf9aee72018-10-12 09:26:16 -07005270 // Stats for each process.
5271 repeated ProcessStatsProto process_stats = 8;
5272
5273 // Stats for each package.
5274 repeated ProcessStatsPackageProto package_stats = 9;
5275}
5276
Chenjie Yub2ecc792019-01-17 10:27:26 -08005277message ProcessStatsAvailablePagesProto {
5278 // Node these pages are in (as per /proc/pagetypeinfo)
5279 optional int32 node = 1;
5280
5281 // Zone these pages are in (as per /proc/pagetypeinfo)
5282 optional string zone = 2;
5283
5284 // Label for the type of these pages (as per /proc/pagetypeinfo)
5285 optional string label = 3;
5286
5287 // Distribution of number of pages available by order size. First entry in array is
5288 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5289 repeated int32 pages_per_order = 4;
5290}
5291
Chenjie Yu12e5e672018-09-14 15:54:59 -07005292/**
5293 * Pulled from ProcessStatsService.java
5294 */
5295message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005296 optional ProcessStatsSectionProto proc_stats_section = 1;
5297}
5298
Chenjie Yuf910b7802019-01-11 16:08:20 -08005299/**
5300 * Pulled from ProcessStatsService.java
5301 */
5302message ProcStatsPkgProc {
5303 optional ProcessStatsSectionProto proc_stats_section = 1;
5304}
5305
Chris Wrencdea3b72019-11-22 16:58:17 -05005306// Next Tag: 2
5307message PackageRemoteViewInfoProto {
5308 optional string package_name = 1;
5309 // add per-package additional info here (like channels)
5310}
5311
5312// Next Tag: 2
5313message NotificationRemoteViewsProto {
5314 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5315}
5316
5317/**
5318 * Pulled from NotificationManagerService.java
5319 */
5320message NotificationRemoteViews {
5321 optional NotificationRemoteViewsProto notification_remote_views = 1;
5322}
5323
Yangsteraf9aee72018-10-12 09:26:16 -07005324message PowerProfileProto {
5325 optional double cpu_suspend = 1;
5326
5327 optional double cpu_idle = 2;
5328
5329 optional double cpu_active = 3;
5330
5331 message CpuCluster {
5332 optional int32 id = 1;
5333 optional double cluster_power = 2;
5334 optional int32 cores = 3;
5335 repeated int64 speed = 4;
5336 repeated double core_power = 5;
5337 }
5338
5339 repeated CpuCluster cpu_cluster = 40;
5340
5341 optional double wifi_scan = 4;
5342
5343 optional double wifi_on = 5;
5344
5345 optional double wifi_active = 6;
5346
5347 optional double wifi_controller_idle = 7;
5348
5349 optional double wifi_controller_rx = 8;
5350
5351 optional double wifi_controller_tx = 9;
5352
5353 repeated double wifi_controller_tx_levels = 10;
5354
5355 optional double wifi_controller_operating_voltage = 11;
5356
5357 optional double bluetooth_controller_idle = 12;
5358
5359 optional double bluetooth_controller_rx = 13;
5360
5361 optional double bluetooth_controller_tx = 14;
5362
5363 optional double bluetooth_controller_operating_voltage = 15;
5364
5365 optional double modem_controller_sleep = 16;
5366
5367 optional double modem_controller_idle = 17;
5368
5369 optional double modem_controller_rx = 18;
5370
5371 repeated double modem_controller_tx = 19;
5372
5373 optional double modem_controller_operating_voltage = 20;
5374
5375 optional double gps_on = 21;
5376
5377 repeated double gps_signal_quality_based = 22;
5378
5379 optional double gps_operating_voltage = 23;
5380
5381 optional double bluetooth_on = 24;
5382
5383 optional double bluetooth_active = 25;
5384
5385 optional double bluetooth_at_cmd = 26;
5386
5387 optional double ambient_display = 27;
5388
5389 optional double screen_on = 28;
5390
5391 optional double radio_on = 29;
5392
5393 optional double radio_scanning = 30;
5394
5395 optional double radio_active = 31;
5396
5397 optional double screen_full = 32;
5398
5399 optional double audio = 33;
5400
5401 optional double video = 34;
5402
5403 optional double flashlight = 35;
5404
5405 optional double memory = 36;
5406
5407 optional double camera = 37;
5408
5409 optional double wifi_batched_scan = 38;
5410
5411 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005412}
Chenjie Yuab530202018-09-26 12:39:20 -07005413
5414/**
5415 * power_profile.xml and other constants for power model calculations.
5416 * Pulled from PowerProfile.java
5417 */
5418message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005419 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005420}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005421
5422/**
arangelovd5db50e2018-10-12 20:24:39 +01005423 * Logs when a user restriction was added or removed.
5424 *
5425 * Logged from:
5426 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5427 */
5428message UserRestrictionChanged {
5429 // The raw string of the user restriction as defined in UserManager.
5430 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5431 optional string restriction = 1;
5432 // Whether the restriction is enabled or disabled.
5433 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005434}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005435
5436/**
5437 * Pulls process user time and system time. Puller takes a snapshot of all pids
5438 * in the system and returns cpu stats for those that are working at the time.
5439 * Dead pids will be dropped. Kernel processes are excluded.
5440 * Min cool-down is 5 sec.
5441 */
5442message ProcessCpuTime {
5443 optional int32 uid = 1 [(is_uid) = true];
5444
5445 optional string process_name = 2;
5446 // Process cpu time in user space, cumulative from boot/process start
5447 optional int64 user_time_millis = 3;
5448 // Process cpu time in system space, cumulative from boot/process start
5449 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005450}
Misha Wagner5a51e002018-10-03 15:04:09 +01005451
5452/**
5453 * Pulls the CPU usage for each thread.
5454 *
5455 * Read from /proc/$PID/task/$TID/time_in_state files.
5456 *
5457 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5458 * time_in_state files not being present on some phones, have not been addressed. These should be
5459 * considered before a public release.
5460 */
5461message CpuTimePerThreadFreq {
5462 // UID that owns the process.
5463 optional int32 uid = 1 [(is_uid) = true];
5464 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005465 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005466 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005467 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005468 // Name of the process taken from `/proc/$PID/cmdline`.
5469 optional string process_name = 4;
5470 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5471 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005472
5473 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5474 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5475 // frequencies are given here as the alternative is sending eight separate atoms. This method
5476 // significantly reduces the amount of data created
5477 optional int32 frequency1_khz = 6;
5478 optional int32 time1_millis = 7;
5479 optional int32 frequency2_khz = 8;
5480 optional int32 time2_millis = 9;
5481 optional int32 frequency3_khz = 10;
5482 optional int32 time3_millis = 11;
5483 optional int32 frequency4_khz = 12;
5484 optional int32 time4_millis = 13;
5485 optional int32 frequency5_khz = 14;
5486 optional int32 time5_millis = 15;
5487 optional int32 frequency6_khz = 16;
5488 optional int32 time6_millis = 17;
5489 optional int32 frequency7_khz = 18;
5490 optional int32 time7_millis = 19;
5491 optional int32 frequency8_khz = 20;
5492 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005493}
Bookatz75ee60422018-11-09 12:27:37 -08005494
5495/**
Bookatz366a4432018-11-20 09:42:33 -08005496 * Pulls information about the device's build.
5497 */
5498message BuildInformation {
5499 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5500 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5501 optional string fingerprint = 1;
5502
5503 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5504 optional string brand = 2;
5505
5506 // Build.PRODUCT. The name of the overall product.
5507 optional string product = 3;
5508
5509 // Build.DEVICE. The name of the industrial design.
5510 optional string device = 4;
5511
5512 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5513 optional string version_release = 5;
5514
5515 // Build.ID. E.g. a label like "M4-rc20".
5516 optional string id = 6;
5517
5518 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5519 // represent this build.
5520 optional string version_incremental = 7;
5521
5522 // Build.TYPE. The type of build, like "user" or "eng".
5523 optional string type = 8;
5524
5525 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5526 optional string tags = 9;
5527}
5528
5529/**
Adam He420947c2019-01-23 15:59:09 -08005530 * Logs information about mismatched caller for content capture.
5531 *
5532 * Logged from:
5533 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5534 */
5535message ContentCaptureCallerMismatchReported {
5536 optional string intended_package = 1;
5537 optional string calling_package = 2;
5538}
5539
5540/**
5541 * Logs information about content capture service events.
5542 *
5543 * Logged from:
5544 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5545 */
5546message ContentCaptureServiceEvents {
5547 // The type of event.
5548 enum Event {
5549 UNKNOWN = 0;
5550 ON_CONNECTED = 1;
5551 ON_DISCONNECTED = 2;
5552 SET_WHITELIST = 3;
5553 SET_DISABLED = 4;
5554 ON_USER_DATA_REMOVED = 5;
5555 }
5556 optional Event event = 1;
5557 // component/package of content capture service.
5558 optional string service_info = 2;
5559 // component/package of target.
5560 // it's a concatenated list of component/package for SET_WHITELIST event
5561 // separated by " ".
5562 optional string target_info = 3;
5563}
5564
5565/**
5566 * Logs information about content capture session events.
5567 *
5568 * Logged from:
5569 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5570 */
5571message ContentCaptureSessionEvents {
5572 // The type of event.
5573 enum Event {
5574 UNKNOWN = 0;
5575 ON_SESSION_STARTED = 1;
5576 ON_SESSION_FINISHED = 2;
5577 SESSION_NOT_CREATED = 3;
5578 }
5579 optional int32 session_id = 1;
5580 optional Event event = 2;
5581 // (n/a on session finished)
5582 optional int32 state_flags = 3;
5583 // component/package of content capture service.
5584 optional string service_info = 4;
5585 // component/package of app.
5586 // (n/a on session finished)
5587 optional string app_info = 5;
5588 optional bool is_child_session = 6;
5589}
5590
5591/**
5592 * Logs information about session being flushed.
5593 *
5594 * Logged from:
5595 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5596 */
5597message ContentCaptureFlushed {
5598 optional int32 session_id = 1;
5599 // component/package of content capture service.
5600 optional string service_info = 2;
5601 // component/package of app.
5602 optional string app_info = 3;
5603 // session start/finish events
5604 optional int32 child_session_started = 4;
5605 optional int32 child_session_finished = 5;
5606 // count of view events.
5607 optional int32 view_appeared_count = 6;
5608 optional int32 view_disappeared_count = 7;
5609 optional int32 view_text_changed_count = 8;
5610
5611 // Flush stats.
5612 optional int32 max_events = 9;
5613 optional int32 idle_flush_freq = 10;
5614 optional int32 text_flush_freq = 11;
5615 optional int32 flush_reason = 12;
5616}
5617
5618/**
Bookatz75ee60422018-11-09 12:27:37 -08005619 * Pulls on-device BatteryStats power use calculations for the overall device.
5620 */
5621message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005622 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5623 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5624 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5625 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005626}
5627
5628/**
5629 * Pulls on-device BatteryStats power use calculations broken down by uid.
5630 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5631 * that is attributed to non-uid items. They must all be included to get the total power use.
5632 */
5633message DeviceCalculatedPowerBlameUid {
5634 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5635 optional int32 uid = 1 [(is_uid) = true];
5636
Bookatz3dbc13a2018-12-21 12:16:51 -08005637 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5638 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5639 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005640}
5641
5642/**
5643 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5644 * drain type.
5645 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5646 * is attributed uids. They must all be included to get the total power use.
5647 */
5648message DeviceCalculatedPowerBlameOther {
5649 // The type of item whose power use is being reported.
5650 enum DrainType {
5651 AMBIENT_DISPLAY = 0;
5652 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5653 BLUETOOTH = 2;
5654 CAMERA = 3;
5655 // Cell-standby
5656 CELL = 4;
5657 FLASHLIGHT = 5;
5658 IDLE = 6;
5659 MEMORY = 7;
5660 // Amount that total computed drain exceeded the drain estimated using the
5661 // battery level changes and capacity.
5662 OVERCOUNTED = 8;
5663 PHONE = 9;
5664 SCREEN = 10;
5665 // Amount that total computed drain was below the drain estimated using the
5666 // battery level changes and capacity.
5667 UNACCOUNTED = 11;
5668 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5669 WIFI = 13;
5670 }
5671 optional DrainType drain_type = 1;
5672
Bookatz3dbc13a2018-12-21 12:16:51 -08005673 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5674 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5675 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005676}
arangelov4e994062018-11-13 16:12:38 +00005677
5678/**
5679 * Logs device policy features.
5680 *
5681 * Logged from:
5682 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5683 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5684 */
5685message DevicePolicyEvent {
5686 // The event id - unique for each event.
5687 optional android.stats.devicepolicy.EventId event_id = 1;
5688 // The admin package name.
5689 optional string admin_package_name = 2;
5690 // A generic integer parameter.
5691 optional int32 integer_value = 3;
5692 // A generic boolean parameter.
5693 optional bool boolean_value = 4;
5694 // A parameter specifying a time period in milliseconds.
5695 optional uint64 time_period_millis = 5;
5696 // A parameter specifying a list of package names, bundle extras or string parameters.
5697 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5698}
shawnlinea5b66b2018-11-13 15:05:29 +08005699
5700/**
5701 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5702 *
5703 * Logged from:
5704 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5705 */
5706message DocsUILaunchReported {
5707 optional android.stats.docsui.LaunchAction launch_action = 1;
5708 optional bool has_initial_uri = 2;
5709 optional android.stats.docsui.MimeType mime_type = 3;
5710 optional android.stats.docsui.Root initial_root = 4;
5711}
5712
5713/**
5714 * Logs root/app visited event in file managers/picker. Call this when the user
5715 * taps on root/app in hamburger menu.
5716 *
5717 * Logged from:
5718 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5719 */
5720message DocsUIRootVisitedReported {
5721 optional android.stats.docsui.ContextScope scope = 1;
5722 optional android.stats.docsui.Root root = 2;
5723}
5724
5725/**
5726 * Logs file operation stats. Call this when a file operation has completed.
5727 *
5728 * Logged from:
5729 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5730 */
5731message DocsUIFileOperationReported {
5732 optional android.stats.docsui.Provider provider = 1;
5733 optional android.stats.docsui.FileOperation file_op = 2;
5734}
5735
5736/**
5737 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5738 * mode.
5739 *
5740 * Logged from:
5741 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5742 */
5743message DocsUIFileOperationCopyMoveModeReported {
5744 optional android.stats.docsui.FileOperation file_op = 1;
5745 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5746}
5747
5748
5749/**
5750 * Logs file sub operation stats. Call this when a file operation has failed.
5751 *
5752 * Logged from:
5753 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5754 */
5755message DocsUIFileOperationFailureReported {
5756 optional android.stats.docsui.Authority authority = 1;
5757 optional android.stats.docsui.SubFileOperation sub_op = 2;
5758}
5759
5760/**
5761* Logs the cancellation of a file operation. Call this when a job is canceled
5762*
5763* Logged from:
5764* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5765*/
5766message DocsUIFileOperationCanceledReported {
5767 optional android.stats.docsui.FileOperation file_op = 1;
5768}
5769
5770/**
5771 * Logs startup time in milliseconds.
5772 *
5773 * Logged from:
5774 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5775 */
5776message DocsUIStartupMsReported {
5777 optional int32 startup_millis = 1;
5778}
5779
5780/**
5781 * Logs the action that was started by user.
5782 *
5783 * Logged from:
5784 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5785 */
5786message DocsUIUserActionReported {
5787 optional android.stats.docsui.UserAction action = 1;
5788}
5789
5790/**
5791 * Logs the invalid type when invalid scoped access is requested.
5792 *
5793 * Logged from:
5794 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5795 */
5796message DocsUIInvalidScopedAccessRequestReported {
5797 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005798}
Ben Murdochbab399f62018-12-06 11:01:38 +00005799
5800/**
shawnlina75e82d2019-01-07 10:31:12 +08005801 * Logs the package name that launches docsui picker mode.
5802 *
5803 * Logged from:
5804 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5805 */
5806message DocsUIPickerLaunchedFromReported {
5807 optional string package_name = 1;
5808}
5809
5810/**
5811 * Logs the search type.
5812 *
5813 * Logged from:
5814 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5815 */
5816message DocsUISearchTypeReported {
5817 optional android.stats.docsui.SearchType search_type = 1;
5818}
5819
5820/**
5821 * Logs the search mode.
5822 *
5823 * Logged from:
5824 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5825 */
5826message DocsUISearchModeReported {
5827 optional android.stats.docsui.SearchMode search_mode = 1;
5828}
5829
5830/**
5831 * Logs the pick result information.
5832 *
5833 * Logged from:
5834 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5835 */
5836message DocsUIPickResultReported {
5837 optional int32 total_action_count = 1;
5838 optional int64 duration_millis = 2;
5839 optional int32 file_count= 3;
5840 optional bool is_searching = 4;
5841 optional android.stats.docsui.Root picked_from = 5;
5842 optional android.stats.docsui.MimeType mime_type = 6;
5843 optional int32 repeatedly_pick_times = 7;
5844}
5845
5846/**
Ben Murdochbab399f62018-12-06 11:01:38 +00005847 * Logs when an app's memory is compacted.
5848 *
5849 * Logged from:
5850 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5851 */
5852message AppCompacted {
5853 // The pid of the process being compacted.
5854 optional int32 pid = 1;
5855
5856 // The name of the process being compacted.
5857 optional string process_name = 2;
5858
5859 // The type of compaction.
5860 enum Action {
5861 UNKNOWN = 0;
5862 SOME = 1;
5863 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005864 PERSISTENT = 3;
5865 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00005866 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005867 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00005868
5869 // Total RSS in kilobytes consumed by the process prior to compaction.
5870 optional int64 before_rss_total_kilobytes = 4;
5871
5872 // File RSS in kilobytes consumed by the process prior to compaction.
5873 optional int64 before_rss_file_kilobytes = 5;
5874
5875 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5876 optional int64 before_rss_anon_kilobytes = 6;
5877
5878 // Swap in kilobytes consumed by the process prior to compaction.
5879 optional int64 before_swap_kilobytes = 7;
5880
5881 // Total RSS in kilobytes consumed by the process after compaction.
5882 optional int64 after_rss_total_kilobytes = 8;
5883
5884 // File RSS in kilobytes consumed by the process after compaction.
5885 optional int64 after_rss_file_kilobytes = 9;
5886
5887 // Anonymous RSS in kilobytes consumed by the process after compaction.
5888 optional int64 after_rss_anon_kilobytes = 10;
5889
5890 // Swap in kilobytes consumed by the process after compaction.
5891 optional int64 after_swap_kilobytes = 11;
5892
5893 // The time taken to perform compaction in milliseconds.
5894 optional int64 time_to_compact_millis = 12;
5895
5896 // The last compaction action performed for this app.
5897 optional Action last_action = 13;
5898
Ben Murdoch01720b82018-12-19 18:03:44 +00005899 // The last time that compaction was attempted on this process in milliseconds
5900 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5901 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00005902
Ben Murdoch885c21b2019-03-15 18:02:04 +00005903 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005904 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00005905
5906 // The process state at the time of compaction.
5907 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005908
5909 // Free ZRAM in kilobytes before compaction.
5910 optional int64 before_zram_free_kilobytes = 17;
5911
5912 // Free ZRAM in kilobytes after compaction.
5913 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00005914}
lifr157fc552018-12-12 16:38:04 +08005915
5916/**
lifrb6b90b62019-03-29 00:40:17 +08005917 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5918 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5919 *
lifr1f74b052019-04-16 22:16:30 +08005920 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5921 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5922 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5923 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005924 */
5925message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08005926 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005927
lifr1f74b052019-04-16 22:16:30 +08005928 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005929
5930 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005931 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005932
lifr1f74b052019-04-16 22:16:30 +08005933 // Only valid for event_type = EVENT_GETADDRINFO.
5934 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005935
lifr1f74b052019-04-16 22:16:30 +08005936 // Flags passed to android_res_nsend() defined in multinetwork.h
5937 // Only valid for event_type = EVENT_RESNSEND.
5938 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005939
lifrad9becc2019-05-20 11:04:41 +08005940 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005941
5942 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08005943 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005944
5945 // Additional pass-through fields opaque to statsd.
5946 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08005947 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08005948
5949 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5950 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005951}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005952
5953/**
5954 * Logs when a data stall event occurs.
5955 *
5956 * Log from:
5957 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5958 */
5959message DataStallEvent {
5960 // Data stall evaluation type.
5961 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5962 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5963 optional int32 evaluation_type = 1;
5964 // See definition in data_stall_event.proto.
5965 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5966 // See definition in data_stall_event.proto.
5967 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5968 // See definition in data_stall_event.proto.
5969 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5970 // See definition in data_stall_event.proto.
5971 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5972 // See definition in data_stall_event.proto.
5973 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5974}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005975
5976/*
5977 * Logs when RescueParty resets some set of experiment flags.
5978 *
5979 * Logged from:
5980 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5981 */
5982message RescuePartyResetReported {
5983 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5984 optional int32 rescue_level = 1;
5985}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005986
5987/**
5988 * Logs when signed config is received from an APK, and if that config was applied successfully.
5989 * Logged from:
5990 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5991 */
5992message SignedConfigReported {
5993 enum Type {
5994 UNKNOWN_TYPE = 0;
5995 GLOBAL_SETTINGS = 1;
5996 }
5997 optional Type type = 1;
5998
5999 // The final status of the signed config received.
6000 enum Status {
6001 UNKNOWN_STATUS = 0;
6002 APPLIED = 1;
6003 BASE64_FAILURE_CONFIG = 2;
6004 BASE64_FAILURE_SIGNATURE = 3;
6005 SECURITY_EXCEPTION = 4;
6006 INVALID_CONFIG = 5;
6007 OLD_CONFIG = 6;
6008 SIGNATURE_CHECK_FAILED = 7;
6009 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006010 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006011 }
6012 optional Status status = 2;
6013
6014 // The version of the signed config processed.
6015 optional int32 version = 3;
6016
6017 // The package name that the config was extracted from.
6018 optional string from_package = 4;
6019
6020 enum Key {
6021 NO_KEY = 0;
6022 DEBUG = 1;
6023 PRODUCTION = 2;
6024 }
6025 // Which key was used to verify the config.
6026 optional Key verified_with = 5;
6027}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006028
6029/*
6030 * Logs GNSS Network-Initiated (NI) location events.
6031 *
6032 * Logged from:
6033 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6034 */
6035message GnssNiEventReported {
6036 // The type of GnssNiEvent.
6037 enum EventType {
6038 UNKNOWN = 0;
6039 NI_REQUEST = 1;
6040 NI_RESPONSE = 2;
6041 }
6042 optional EventType event_type = 1;
6043
6044 // An ID generated by HAL to associate NI notifications and UI responses.
6045 optional int32 notification_id = 2;
6046
6047 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006048 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006049
6050 // NI requires notification.
6051 optional bool need_notify = 4;
6052
6053 // NI requires verification.
6054 optional bool need_verify = 5;
6055
6056 // NI requires privacy override, no notification/minimal trace.
6057 optional bool privacy_override = 6;
6058
6059 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6060 // seconds.
6061 optional int32 timeout = 7;
6062
6063 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006064 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006065
6066 // String representing the requester of the network inititated location request.
6067 optional string requestor_id = 9;
6068
6069 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6070 // network initiated location request.
6071 optional string text = 10;
6072
6073 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006074 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006075
6076 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006077 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006078
6079 // True if SUPL ES is enabled.
6080 optional bool is_supl_es_enabled = 13;
6081
6082 // True if GNSS location is enabled.
6083 optional bool is_location_enabled = 14;
6084
6085 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006086 optional android.server.location.GnssUserResponseType user_response = 15;
6087}
6088
6089/**
6090 * Logs GNSS non-framework (NFW) location notification.
6091 *
6092 * Logged from:
6093 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6094 */
6095message GnssNfwNotificationReported {
6096 // Package name of the Android proxy application representing the non-framework entity that
6097 // requested location. Set to empty string if unknown.
6098 optional string proxy_app_package_name = 1;
6099
6100 // Protocol stack that initiated the non-framework location request.
6101 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6102
6103 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6104 // set to empty string. This field is opaque to the framework and used for logging purposes.
6105 optional string other_protocol_stack_name = 3;
6106
6107 // Source initiating/receiving the location information.
6108 optional android.server.location.NfwRequestor requestor = 4;
6109
6110 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6111 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6112 // and used for logging purposes.
6113 optional string requestor_id = 5;
6114
6115 // Indicates whether location information was provided for this request.
6116 optional android.server.location.NfwResponseType response_type = 6;
6117
6118 // True if the device is in user initiated emergency session.
6119 optional bool in_emergency_mode = 7;
6120
6121 // True if cached location is provided.
6122 optional bool is_cached_location = 8;
6123
6124 // True if proxy app permission mismatch between framework and GNSS HAL.
6125 optional bool is_permission_mismatched = 9;
6126}
6127
6128/**
6129 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6130 *
6131 * Logged from:
6132 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6133 */
6134message GnssConfigurationReported {
6135 // SUPL host name.
6136 optional string supl_host = 1;
6137
6138 // SUPL port number.
6139 optional int32 supl_port = 2;
6140
6141 // C2K host name.
6142 optional string c2k_host = 3;
6143
6144 // C2K port number.
6145 optional int32 c2k_port = 4;
6146
6147 // The SUPL version requested by Carrier.
6148 optional int32 supl_ver = 5;
6149
6150 // The SUPL mode.
6151 optional android.server.location.SuplMode supl_mode = 6;
6152
6153 // True if NI emergency SUPL restrictions is enabled.
6154 optional bool supl_es = 7;
6155
6156 // LTE Positioning Profile settings
6157 optional android.server.location.LppProfile lpp_profile = 8;
6158
6159 // Positioning protocol on A-Glonass system.
6160 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6161
6162 // True if emergency PDN is used. Otherwise, regular PDN is used.
6163 optional bool use_emergency_pdn_for_emergency_supl= 10;
6164
6165 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6166 optional android.server.location.GpsLock gps_lock = 11;
6167
6168 // Number of seconds to extend the emergency session duration post emergency call.
6169 optional int32 es_extension_sec = 12;
6170
6171 // The full list of package names of proxy Android applications representing the non-framework
6172 // location access entities (on/off the device) for which the framework user has granted
6173 // non-framework location access permission. The package names are concatenated in one string
6174 // with spaces as separators.
6175 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006176}
Jack Yu95b64f32018-12-13 18:26:11 +08006177
6178/**
6179 * Logs when a NFC device's error occurred.
6180 * Logged from:
6181 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6182 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6183 */
6184message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006185 enum Type {
6186 UNKNOWN = 0;
6187 CMD_TIMEOUT = 1;
6188 ERROR_NOTIFICATION = 2;
6189 AID_OVERFLOW = 3;
6190 }
6191 optional Type type = 1;
6192 // If it's nci cmd timeout, log the timeout command.
6193 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006194
Alex Salod7c3eef2019-01-25 14:43:27 -08006195 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006196}
6197
6198/**
6199 * Logs when a NFC device's state changed event
6200 * Logged from:
6201 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6202 */
6203message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006204 enum State {
6205 UNKNOWN = 0;
6206 OFF = 1;
6207 ON = 2;
6208 ON_LOCKED = 3; // Secure Nfc enabled.
6209 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6210 }
6211 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006212}
6213
6214/**
6215 * Logs when a NFC Beam Transaction occurred.
6216 * Logged from:
6217 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6218 */
6219message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006220 enum Operation {
6221 UNKNOWN = 0;
6222 SEND = 1;
6223 RECEIVE = 2;
6224 }
6225 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006226}
6227
6228/**
6229 * Logs when a NFC Card Emulation Transaction occurred.
6230 * Logged from:
6231 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6232 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6233 */
6234message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006235 enum Category {
6236 UNKNOWN = 0;
6237 HCE_PAYMENT = 1;
6238 HCE_OTHER = 2;
6239 OFFHOST = 3;
6240 }
6241 // Transaction belongs to HCE payment or HCE other category, or offhost.
6242 optional Category category = 1;
6243 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6244 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006245}
6246
6247/**
6248 * Logs when a NFC Tag event occurred.
6249 * Logged from:
6250 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6251 */
6252message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006253 enum Type {
6254 UNKNOWN = 0;
6255 URL = 1;
6256 BT_PAIRING = 2;
6257 PROVISION = 3;
6258 WIFI_CONNECT = 4;
6259 APP_LAUNCH = 5;
6260 OTHERS = 6;
6261 }
6262 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006263}
6264
6265/**
6266 * Logs when Hce transaction triggered
6267 * Logged from:
6268 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6269 */
6270message NfcHceTransactionOccurred {
6271 // The latency period(in microseconds) it took for the first HCE data
6272 // exchange.
6273 optional uint32 latency_micros = 1;
6274}
6275
6276/**
6277 * Logs when SecureElement state event changed
6278 * Logged from:
6279 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6280 */
6281message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006282 enum State {
6283 UNKNOWN = 0;
6284 INITIALIZED = 1;
6285 DISCONNECTED = 2;
6286 CONNECTED = 3;
6287 HALCRASH = 4;
6288 }
6289 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006290
Alex Salod7c3eef2019-01-25 14:43:27 -08006291 optional string state_change_reason = 2;
6292 // SIMx or eSEx.
6293 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006294}
6295
6296/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006297 * Information about a permission grant request
6298 */
6299message PermissionGrantRequestResultReported {
6300 // unique value identifying an API call. A API call might result in multiple of these atoms
6301 optional int64 request_id = 1;
6302
6303 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006304 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006305
6306 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006307 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006308
6309 // The permission to be granted
6310 optional string permission_name = 4;
6311
6312 // If the permission was explicitly requested via the API or added by the system
6313 optional bool is_implicit = 5;
6314
6315 enum Result {
6316 UNDEFINED = 0;
6317 // permission request was ignored
6318 IGNORED = 1;
6319 // permission request was ignored because it was user fixed
6320 IGNORED_USER_FIXED = 2;
6321 // permission request was ignored because it was policy fixed
6322 IGNORED_POLICY_FIXED = 3;
6323 // permission was granted by user action
6324 USER_GRANTED = 4;
6325 // permission was automatically granted
6326 AUTO_GRANTED = 5;
6327 // permission was denied by user action
6328 USER_DENIED = 6;
6329 // permission was denied with prejudice by the user
6330 USER_DENIED_WITH_PREJUDICE = 7;
6331 // permission was automatically denied
6332 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006333 // permission request was ignored because permission is restricted
6334 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006335 // one time permission was granted by user action
6336 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006337 // user ignored request by leaving the request screen without choosing any option
6338 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006339 // user granted the permission after being linked to settings
6340 USER_GRANTED_IN_SETTINGS = 12;
6341 // user denied the permission after being linked to settings
6342 USER_DENIED_IN_SETTINGS = 13;
6343 // user denied the permission with prejudice after being linked to settings
6344 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6345 // permission was automatically revoked after one-time permission expired
6346 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006347 }
6348 // The result of the permission grant
6349 optional Result result = 6;
6350}
6351
6352/**
Jack Yu95b64f32018-12-13 18:26:11 +08006353 * Logs when Omapi API used
6354 * Logged from:
6355 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6356 */
6357message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006358 enum Operation {
6359 UNKNOWN = 0;
6360 OPEN_CHANNEL = 1;
6361 }
6362 optional Operation operation = 1;
6363 // SIMx or eSEx.
6364 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006365
Alex Salod7c3eef2019-01-25 14:43:27 -08006366 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006367}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006368
6369/**
Alex Saloa060aee2019-01-21 14:36:41 -08006370 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6371 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006372 * Logged from:
6373 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6374 */
6375message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006376 optional int64 dispatch_latency_millis = 1;
6377}
6378
6379/**
6380 * Logs AttentionManagerService attention check result.
6381 *
6382 * Logged from:
6383 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6384 */
6385message AttentionManagerServiceResultReported {
6386 // See core/java/android/service/attention/AttentionService.java
6387 enum AttentionCheckResult {
6388 UNKNOWN = 20;
6389 ATTENTION_SUCCESS_ABSENT = 0;
6390 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006391 ATTENTION_FAILURE_UNKNOWN = 2;
6392 ATTENTION_FAILURE_CANCELLED = 3;
6393 ATTENTION_FAILURE_PREEMPTED = 4;
6394 ATTENTION_FAILURE_TIMED_OUT = 5;
6395 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006396 }
6397 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006398}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006399
6400/**
6401 * Logs when an adb connection changes state.
6402 *
6403 * Logged from:
6404 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6405 */
6406message AdbConnectionChanged {
6407 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6408 // previously selected for this system.
6409 optional int64 last_connection_time_millis = 1;
6410
6411 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6412 // to reconnect via adb without user interaction.
6413 optional int64 auth_window_millis = 2;
6414
6415 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6416 optional android.debug.AdbConnectionStateEnum state = 3;
6417
6418 // True if the 'always allow' option was selected for this system.
6419 optional bool always_allow = 4;
6420}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006421
6422/*
6423 * Logs the reported speech DSP status.
6424 *
6425 * Logged from:
6426 * Vendor audio implementation.
6427 */
6428message SpeechDspStatReported {
6429 // The total Speech DSP uptime in milliseconds.
6430 optional int32 total_uptime_millis = 1;
6431 // The total Speech DSP downtime in milliseconds.
6432 optional int32 total_downtime_millis = 2;
6433 optional int32 total_crash_count = 3;
6434 optional int32 total_recover_count = 4;
6435}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006436
6437/**
6438 * Logs USB connector contaminant status.
6439 *
6440 * Logged from: USB Service.
6441 */
6442message UsbContaminantReported {
6443 optional string id = 1;
6444 optional android.service.usb.ContaminantPresenceStatus status = 2;
6445}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006446
6447/**
6448 * This atom is for debugging purpose.
6449 */
6450message DebugElapsedClock {
6451 // Monotically increasing value for each pull.
6452 optional int64 pull_count = 1;
6453 // Time from System.elapsedRealtime.
6454 optional int64 elapsed_clock_millis = 2;
6455 // Time from System.elapsedRealtime.
6456 optional int64 same_elapsed_clock_millis = 3;
6457 // Diff between current elapsed time and elapsed time from previous pull.
6458 optional int64 elapsed_clock_diff_millis = 4;
6459
6460 enum Type {
6461 TYPE_UNKNOWN = 0;
6462 ALWAYS_PRESENT = 1;
6463 PRESENT_ON_ODD_PULLS = 2;
6464 }
6465 // Type of behavior for the pulled data.
6466 optional Type type = 5;
6467}
6468
6469/**
6470 * This atom is for debugging purpose.
6471 */
6472message DebugFailingElapsedClock {
6473 // Monotically increasing value for each pull.
6474 optional int64 pull_count = 1;
6475 // Time from System.elapsedRealtime.
6476 optional int64 elapsed_clock_millis = 2;
6477 // Time from System.elapsedRealtime.
6478 optional int64 same_elapsed_clock_millis = 3;
6479 // Diff between current elapsed time and elapsed time from previous pull.
6480 optional int64 elapsed_clock_diff_millis = 4;
6481}
Steven Wuacef6bb2019-01-23 14:21:17 -05006482
6483/** Logs System UI bubbles event changed.
6484 *
6485 * Logged from:
6486 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6487 */
6488message BubbleUIChanged {
6489
6490 // The app package that is posting the bubble.
6491 optional string package_name = 1;
6492
6493 // The notification channel that is posting the bubble.
6494 optional string notification_channel = 2;
6495
6496 // The notification id associated with the posted bubble.
6497 optional int32 notification_id = 3;
6498
6499 // The position of the bubble within the bubble stack.
6500 optional int32 position = 4;
6501
6502 // The total number of bubbles within the bubble stack.
6503 optional int32 total_number = 5;
6504
6505 // User interactions with the bubble.
6506 enum Action {
6507 UNKNOWN = 0;
6508 POSTED = 1;
6509 UPDATED = 2;
6510 EXPANDED = 3;
6511 COLLAPSED = 4;
6512 DISMISSED = 5;
6513 STACK_DISMISSED = 6;
6514 STACK_MOVED = 7;
6515 HEADER_GO_TO_APP = 8;
6516 HEADER_GO_TO_SETTINGS = 9;
6517 PERMISSION_OPT_IN = 10;
6518 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006519 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006520 SWIPE_LEFT = 13;
6521 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006522 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006523 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006524 }
6525 optional Action action = 6;
6526
6527 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6528 optional float normalized_x_position = 7;
6529 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006530
6531 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6532 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006533
6534 // Whether the bubble is an on-going one.
6535 optional bool is_ongoing = 10;
6536
6537 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006538 // This is deprecated and the value should be ignored.
6539 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006540}
Kweku Adams8845d012018-12-11 20:06:45 -08006541
6542/**
Steven Wu552f63f2019-02-05 13:41:36 -05006543 * Logs System UI bubbles developer errors.
6544 *
6545 * Logged from:
6546 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6547 */
6548message BubbleDeveloperErrorReported {
6549
6550 // The app package that is posting the bubble.
6551 optional string package_name = 1;
6552
6553 // Bubble developer error type enums.
6554 enum Error {
6555 UNKNOWN = 0;
6556 ACTIVITY_INFO_MISSING = 1;
6557 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6558 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6559 }
6560 optional Error error = 2 [default = UNKNOWN];
6561}
6562
6563/**
Kweku Adams8845d012018-12-11 20:06:45 -08006564 * Logs that a constraint for a scheduled job has changed.
6565 *
6566 * Logged from:
6567 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6568 */
6569message ScheduledJobConstraintChanged {
6570 repeated AttributionNode attribution_node = 1;
6571
6572 // Name of the job.
6573 optional string job_name = 2;
6574
6575 optional com.android.server.job.ConstraintEnum constraint = 3;
6576
6577 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006578 UNKNOWN = 0;
6579 UNSATISFIED = 1;
6580 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006581 }
6582 optional State state = 4;
6583}
Alex Salod7c3eef2019-01-25 14:43:27 -08006584
6585/**
6586 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6587 * returns true.
6588 *
6589 * Logged from:
6590 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6591 */
6592message ScreenTimeoutExtensionReported {
6593 // Describes how many times in a row did the power manager reset the screen off timeout.
6594 optional uint32 consecutive_timeout_extended_count = 1;
6595}
Hui Yu885aca12019-01-10 17:11:34 -08006596
6597/*
6598* Logs number of milliseconds it takes to start a process.
6599* The definition of app process start time is from the app launch time to
6600* the time that Zygote finished forking the app process and loaded the
6601* application package's java classes.
6602
6603* This metric is different from AppStartOccurred which is for foreground
6604* activity only.
6605
6606* ProcessStartTime can report all processes (both foreground and background)
6607* start time.
6608*
6609* Logged from:
6610* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6611*/
6612message ProcessStartTime {
6613 // The uid of the ProcessRecord.
6614 optional int32 uid = 1 [(is_uid) = true];
6615
6616 // The process pid.
6617 optional int32 pid = 2;
6618
6619 // The process name.
6620 // Usually package name, "system" for system server.
6621 // Provided by ActivityManagerService.
6622 optional string process_name = 3;
6623
6624 enum StartType {
6625 UNKNOWN = 0;
6626 WARM = 1;
6627 HOT = 2;
6628 COLD = 3;
6629 }
6630
6631 // The start type.
6632 optional StartType type = 4;
6633
6634 // The elapsed realtime at the start of the process.
6635 optional int64 process_start_time_millis = 5;
6636
6637 // Number of milliseconds it takes to reach bind application.
6638 optional int32 bind_application_delay_millis = 6;
6639
6640 // Number of milliseconds it takes to finish start of the process.
6641 optional int32 process_start_delay_millis = 7;
6642
6643 // hostingType field in ProcessRecord, the component type such as "activity",
6644 // "service", "content provider", "broadcast" or other strings.
6645 optional string hosting_type = 8;
6646
6647 // hostingNameStr field in ProcessRecord. The component class name that runs
6648 // in this process.
6649 optional string hosting_name = 9;
6650}
6651
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006652/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006653 * Track Media Codec usage
6654 * Logged from:
6655 * frameworks/av/media/libstagefright/MediaCodec.cpp
6656 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6657 */
6658message MediametricsCodecReported {
6659 optional int64 timestamp_nanos = 1;
6660 optional string package_name = 2;
6661 optional int64 package_version_code = 3;
6662 optional int64 media_apex_version = 4;
6663
6664 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6665}
6666
6667/**
6668 * Track Media Extractor (pulling video/audio streams out of containers) usage
6669 * Logged from:
6670 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6671 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6672 */
6673message MediametricsExtractorReported {
6674 optional int64 timestamp_nanos = 1;
6675 optional string package_name = 2;
6676 optional int64 package_version_code = 3;
6677 optional int64 media_apex_version = 4;
6678
6679 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6680}
6681
6682/**
6683 * Track how we arbitrate between microphone/input requests.
6684 * Logged from
6685 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6686 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6687 */
6688message MediametricsAudiopolicyReported {
6689 optional int64 timestamp_nanos = 1;
6690 optional string package_name = 2;
6691 optional int64 package_version_code = 3;
6692 optional int64 media_apex_version = 4;
6693
6694 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6695}
6696
6697/**
6698 * Track how we arbitrate between microphone requests.
6699 * Logged from
6700 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6701 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6702 */
6703message MediametricsAudiorecordReported {
6704 optional int64 timestamp_nanos = 1;
6705 optional string package_name = 2;
6706 optional int64 package_version_code = 3;
6707 optional int64 media_apex_version = 4;
6708
6709 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6710}
6711
6712/**
6713 * Track how we arbitrate between microphone/input requests.
6714 * Logged from
6715 * frameworks/av/media/libnblog/ReportPerformance.cpp
6716 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6717 */
6718message MediametricsAudiothreadReported {
6719 optional int64 timestamp_nanos = 1;
6720 optional string package_name = 2;
6721 optional int64 package_version_code = 3;
6722 optional int64 media_apex_version = 4;
6723
6724 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6725}
6726
6727/**
6728 * Track how we arbitrate between microphone/input requests.
6729 * Logged from
6730 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6731 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6732 */
6733message MediametricsAudiotrackReported {
6734 optional int64 timestamp_nanos = 1;
6735 optional string package_name = 2;
6736 optional int64 package_version_code = 3;
6737 optional int64 media_apex_version = 4;
6738
6739 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6740}
6741
6742/**
6743 * Track information about DRM framework performance
6744 * Logged from
6745 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6746 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6747 */
6748message MediametricsMediadrmReported {
6749 optional int64 timestamp_nanos = 1;
6750 optional string package_name = 2;
6751 optional int64 package_version_code = 3;
6752 optional int64 media_apex_version = 4;
6753
6754 // vendor+description tell about which DRM plugin is in use on this device
6755 optional string vendor = 5;
6756 optional string description = 6;
6757 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6758 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6759}
6760
6761/**
6762 * Track information about the widevine DRM plugin performance
6763 * Logged from
6764 * vendor/widevine/libwvdrmengine/cdm/metrics
6765 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6766 */
6767message MediametricsDrmWidevineReported {
6768 optional int64 timestamp_nanos = 1;
6769 optional string package_name = 2;
6770 optional int64 package_version_code = 3;
6771 optional int64 media_apex_version = 4;
6772
6773 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6774}
6775
6776/**
6777 * Track information about recordings (e.g. camcorder)
6778 * Logged from
6779 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6780 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6781 */
6782message MediametricsRecorderReported {
6783 optional int64 timestamp_nanos = 1;
6784 optional string package_name = 2;
6785 optional int64 package_version_code = 3;
6786 optional int64 media_apex_version = 4;
6787
6788 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6789}
6790
6791/**
6792 * Track Media Player usage
6793 * Logged from:
6794 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6795 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6796 */
6797message MediametricsNuPlayerReported {
6798 optional int64 timestamp_nanos = 1;
6799 optional string package_name = 2;
6800 optional int64 package_version_code = 3;
6801 optional int64 media_apex_version = 4;
6802
6803 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6804}
6805
6806/**
Robert Shiha4beed32019-08-19 14:15:23 -07006807 * Track Legacy DRM usage
6808 * Logged from
6809 * frameworks/av/drm/drmserver/DrmManager.cpp
6810 */
6811message MediametricsDrmManagerReported {
6812 optional int64 timestamp_nanos = 1;
6813 optional string package_name = 2;
6814 optional int64 package_version_code = 3;
6815 optional int64 media_apex_version = 4;
6816
6817 enum Method {
6818 METHOD_NOT_FOUND = -1;
6819 GET_CONSTRAINTS = 0;
6820 GET_METADATA = 1;
6821 CAN_HANDLE = 2;
6822 PROCESS_DRM_INFO = 3;
6823 ACQUIRE_DRM_INFO = 4;
6824 SAVE_RIGHTS = 5;
6825 GET_ORIGINAL_MIME_TYPE = 6;
6826 GET_DRM_OBJECT_TYPE = 7;
6827 CHECK_RIGHTS_STATUS = 8;
6828 REMOVE_RIGHTS = 9;
6829 REMOVE_ALL_RIGHTS = 10;
6830 OPEN_CONVERT_SESSION = 11;
6831 OPEN_DECRYPT_SESSION = 12;
6832 }
6833
6834 // plugin_id+description inform which Legacy DRM plugins are still in use on device
6835 optional string plugin_id = 5;
6836 optional string description = 6;
6837 optional Method method = 7;
6838 optional string mime_types = 8;
6839}
6840
6841/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006842 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00006843 * Pulled from: StatsCompanionService
6844*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006845message DangerousPermissionState {
6846 // Name of the permission
6847 optional string permission_name = 1;
6848
6849 // Uid of the package
6850 optional int32 uid = 2 [(is_uid) = true];
6851
6852 // Package requesting the permission
6853 optional string package_name = 3;
6854
6855 // If the permission is granted to the uid
6856 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006857
6858 // Permission flags as per android.content.pm.PermissionFlags
6859 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006860}
6861
Michael Groover4a0ca942019-01-24 17:41:25 -08006862/**
6863 * Logs when a package is denied access to a device identifier based on the new access requirements.
6864 *
6865 * Logged from:
6866 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6867 */
6868message DeviceIdentifierAccessDenied {
6869 // The name of the package denied access to the requested device identifier.
6870 optional string package_name = 1;
6871
6872 // The name of the device identifier method the package attempted to invoke.
6873 optional string method_name = 2;
6874
6875 // True if the package is preinstalled.
6876 optional bool is_preinstalled = 3;
6877
6878 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08006879 // Starting from Android 11, this boolean is not set and will always be false.
6880 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08006881}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006882
6883/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006884 * Pulls the ongoing mainline install train version code.
6885 * Pulled from StatsCompanionService
6886 */
6887message TrainInfo {
6888 optional int64 train_version_code = 1;
6889
6890 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006891
6892 optional string train_name = 3;
6893
6894 enum Status {
6895 UNKNOWN = 0;
6896 INSTALL_REQUESTED = 1;
6897 INSTALL_STARTED = 2;
6898 INSTALL_STAGED_NOT_READY = 3;
6899 INSTALL_STAGED_READY = 4;
6900 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006901 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6902 // and INSTALL_FAILURE_COMMIT.
6903 INSTALL_FAILURE = 6 [deprecated = true];
6904 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006905 INSTALL_CANCELLED = 7;
6906 INSTALLER_ROLLBACK_REQUESTED = 8;
6907 INSTALLER_ROLLBACK_INITIATED = 9;
6908 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6909 INSTALLER_ROLLBACK_STAGED = 11;
6910 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6911 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6912 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6913 INSTALLER_ROLLBACK_SUCCESS = 15;
6914 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006915 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6916 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6917 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6918 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6919 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6920 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006921 INSTALL_FAILURE_DOWNLOAD = 23;
6922 INSTALL_FAILURE_STATE_MISMATCH = 24;
6923 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08006924 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006925 }
6926 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006927}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006928
6929/**
6930 * Logs the gesture stage changed event.
6931 *
6932 * Logged from:
6933 * frameworks/base/packages/SystemUI/
6934 */
6935message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006936 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006937}
6938
6939/**
6940 * Logs the feedback type.
6941 *
6942 * Logged from:
6943 * frameworks/base/packages/SystemUI/
6944 */
6945message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006946 // Whether or not the gesture was used.
6947 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006948}
6949
6950/**
6951 * Logs the progress.
6952 *
6953 * Logged from:
6954 * frameworks/base/packages/SystemUI/
6955 */
6956message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006957 // [0,100] progress for the assist gesture.
6958 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006959}
Neil Fullerdb14b482019-02-05 19:44:44 +00006960
6961/*
6962 * Information about the time zone data on a device.
6963 */
6964message TimeZoneDataInfo {
6965 // A version identifier for the data set on device. e.g. "2018i"
6966 optional string tzdb_version = 1;
6967}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006968
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006969/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006970 * Logs the GPU stats global health information.
6971 *
6972 * Logged from:
6973 * frameworks/native/services/gpuservice/gpustats/
6974 */
6975message GpuStatsGlobalInfo {
6976 // Package name of the gpu driver.
6977 optional string driver_package_name = 1;
6978
6979 // Version name of the gpu driver.
6980 optional string driver_version_name = 2;
6981
6982 // Version code of the gpu driver.
6983 optional int64 driver_version_code = 3;
6984
6985 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6986 optional int64 driver_build_time = 4;
6987
6988 // Total count of the gl driver gets loaded.
6989 optional int64 gl_loading_count = 5;
6990
6991 // Total count of the gl driver fails to be loaded.
6992 optional int64 gl_loading_failure_count = 6;
6993
6994 // Total count of the Vulkan driver gets loaded.
6995 optional int64 vk_loading_count = 7;
6996
6997 // Total count of the Vulkan driver fails to be loaded.
6998 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006999
7000 // Api version of the system Vulkan driver.
7001 optional int32 vulkan_version = 9;
7002
7003 // Api version of the system CPU Vulkan driver.
7004 optional int32 cpu_vulkan_version = 10;
7005
7006 // Api version of the system GLES driver.
7007 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007008
7009 // Total count of the angle driver gets loaded.
7010 optional int64 angle_loading_count = 12;
7011
7012 // Total count of the angle driver fails to be loaded.
7013 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007014}
7015
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007016/**
7017 * GPU driver loading time info.
7018 */
7019message GpuDriverLoadingTime {
7020 // List of all the driver loading times for this app. The list size is
7021 // capped at 50.
7022 repeated int64 driver_loading_time = 1;
7023}
7024
7025/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007026 * Logs the GPU stats per app health information.
7027 *
7028 * Logged from:
7029 * frameworks/native/services/gpuservice/gpustats/
7030 */
7031message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007032 // Package name of the application that loads the gpu driver. Total number
7033 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007034 optional string app_package_name = 1;
7035
7036 // Version code of the gpu driver this app loads.
7037 optional int64 driver_version_code = 2;
7038
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007039 // gl driver loading time info.
7040 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7041 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007042
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007043 // Vulkan driver loading time info.
7044 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7045 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007046
7047 // Angle driver loading time info.
7048 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7049 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007050
7051 // CPU Vulkan implementation is in use.
7052 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007053
7054 // App is not doing pre-rotation correctly.
7055 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007056
7057 // App creates GLESv1 context.
7058 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007059}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007060
7061/*
7062 * Logs the size of the system ion heap.
7063 *
7064 * Pulled from StatsCompanionService.
7065 */
7066message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007067 // Deprecated due to limited support of ion stats in debugfs.
7068 // Use `IonHeapSize` instead.
7069 option deprecated = true;
7070
Rafal Slawikd4e87572019-03-12 13:08:38 +00007071 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007072 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007073 optional int64 size_in_bytes = 1;
7074}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007075
Rafal Slawik77987ed2019-06-17 12:28:23 +01007076/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007077 * Logs the total size of the ion heap.
7078 *
7079 * Pulled from StatsCompanionService.
7080 */
7081message IonHeapSize {
7082 // Total size of all ion heaps in kilobytes.
7083 // Read from: /sys/kernel/ion/total_heaps_kb.
7084 optional int32 total_size_kb = 1;
7085}
7086
7087/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007088 * Logs the per-process size of the system ion heap.
7089 *
7090 * Pulled from StatsCompanionService.
7091 */
7092message ProcessSystemIonHeapSize {
7093 // The uid if available. -1 means not available.
7094 optional int32 uid = 1 [(is_uid) = true];
7095
7096 // The process name (from /proc/PID/cmdline).
7097 optional string process_name = 2;
7098
7099 // Sum of sizes of all allocations.
7100 optional int32 total_size_in_kilobytes = 3;
7101
7102 // Number of allocations.
7103 optional int32 allocation_count = 4;
7104
7105 // Size of the largest allocation.
7106 optional int32 max_size_in_kilobytes = 5;
7107}
7108
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007109/**
7110 * Push network stack events.
7111 *
7112 * Log from:
7113 * frameworks/base/packages/NetworkStack/
7114 */
7115message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007116 // The id that indicates the event reported from NetworkStack.
7117 optional int32 event_id = 1;
7118 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007119 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7120}
Carmen Agimofa769c152019-03-04 14:39:14 +00007121
7122/**
7123 * Logs the apps that are installed on the external storage.
7124 * Pulled from:
7125 * StatsCompanionService
7126 */
7127message AppsOnExternalStorageInfo {
7128 // The type of the external storage.
7129 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7130 // The name of the package that is installed on the external storage.
7131 optional string package_name = 2;
7132}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007133
7134/**
7135 * Logs the settings related to Face.
7136 * Logged from:
7137 * frameworks/base/services/core/java/com/android/server/stats
7138 */
7139message FaceSettings {
7140 // Whether or not face unlock is allowed on Keyguard.
7141 optional bool unlock_keyguard_enabled = 1;
7142 // Whether or not face unlock dismisses the Keyguard.
7143 optional bool unlock_dismisses_keyguard = 2;
7144 // Whether or not face unlock requires attention.
7145 optional bool unlock_attention_required = 3;
7146 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7147 optional bool unlock_app_enabled = 4;
7148 // Whether or not face unlock always requires user confirmation.
7149 optional bool unlock_always_require_confirmation = 5;
7150 // Whether or not a diverse set of poses are required during enrollment.
7151 optional bool unlock_diversity_required = 6;
7152}
Maggie White442b6312019-04-05 16:26:44 -07007153
7154/**
7155 * Logs cooling devices maintained by the kernel.
7156 *
7157 * Pulled from StatsCompanionService.java
7158 */
7159message CoolingDevice {
7160 // The type of cooling device being reported. Eg. CPU, GPU...
7161 optional android.os.CoolingTypeEnum device_location = 1;
7162 // The name of the cooling device source. Eg. CPU0
7163 optional string device_name = 2;
7164 // Current throttle state of the cooling device. The value can any unsigned
7165 // integer between 0 and max_state defined in its driver. 0 means device is
7166 // not in throttling, higher value means deeper throttling.
7167 optional int32 state = 3;
7168}
Ben Blount763a5d52019-04-10 11:48:58 -07007169
7170/**
7171 * Intelligence has several counter-type events that don't warrant a
7172 * full separate atom. These are primarily API call counters but also include
7173 * counters for feature usage and specific failure modes.
7174 *
7175 * Logged from the Intelligence mainline module.
7176 */
7177message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007178 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007179 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007180 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007181 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007182 // How many times the event occured (to report a batch of high frequency events).
7183 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007184 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007185 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007186}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007187
7188/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007189 * Logs when Car Power state changed.
7190 *
7191 * Logged from:
7192 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7193 */
7194message CarPowerStateChanged {
7195 // States come from CpmsState in CarPowerManagementService.java.
7196 enum State {
7197 WAIT_FOR_VHAL = 0;
7198 ON = 1;
7199 SHUTDOWN_PREPARE = 2;
7200 WAIT_FOR_FINISH = 3;
7201 SUSPEND = 4;
7202 SIMULATE_SLEEP = 5;
7203 }
7204 optional State state = 1;
7205}
7206
7207/**
7208 * Logs whether GarageMode is entered.
7209 *
7210 * Logged from:
7211 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7212 */
7213message GarageModeInfo {
7214 // Whether GarageMode is entered.
7215 optional bool is_garage_mode = 1;
7216}
Martijn Coenencd95d462019-04-25 17:09:45 +02007217
7218/**
7219 * Historical app ops data per package.
7220 */
7221message AppOps {
7222 // Uid of the package requesting the op
7223 optional int32 uid = 1 [(is_uid) = true];
7224
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007225 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007226 optional string package_name = 2;
7227
7228 // operation id; maps to the OP_* constants in AppOpsManager.java
7229 optional int32 op_id = 3;
7230
7231 // The number of times the op was granted while the app was in the
7232 // foreground (only for trusted requests)
7233 optional int64 trusted_foreground_granted_count = 4;
7234
7235 // The number of times the op was granted while the app was in the
7236 // background (only for trusted requests)
7237 optional int64 trusted_background_granted_count = 5;
7238
7239 // The number of times the op was rejected while the app was in the
7240 // foreground (only for trusted requests)
7241 optional int64 trusted_foreground_rejected_count = 6;
7242
7243 // The number of times the op was rejected while the app was in the
7244 // background (only for trusted requests)
7245 optional int64 trusted_background_rejected_count = 7;
7246
7247 // For long-running operations, total duration of the operation
7248 // while the app was in the foreground (only for trusted requests)
7249 optional int64 trusted_foreground_duration_millis = 8;
7250
7251 // For long-running operations, total duration of the operation
7252 // while the app was in the background (only for trusted requests)
7253 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007254
7255 // Whether AppOps is guarded by Runtime permission
7256 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007257}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007258
7259/**
7260 * Location Manager API Usage information(e.g. API under usage,
7261 * API call's parameters).
7262 * Logged from:
7263 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7264 */
7265message LocationManagerApiUsageReported {
7266
7267 // Indicating if usage starts or usage ends.
7268 optional android.stats.location.UsageState state = 1;
7269
7270 // LocationManagerService's API in use.
7271 // We can identify which API from LocationManager is
7272 // invoking current LMS API by the combination of
7273 // API parameter(e.g. is_listener_null, is_intent_null,
7274 // is_location_request_null)
7275 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7276
7277 // Name of the package calling the API.
7278 optional string calling_package_name = 3;
7279
7280 // Type of the location provider.
7281 optional android.stats.location.ProviderType provider = 4;
7282
7283 // Quality of the location request
7284 optional android.stats.location.LocationRequestQuality quality = 5;
7285
7286 // The desired interval for active location updates, in milliseconds.
7287 // Bucketized to reduce cardinality.
7288 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7289
7290 // Minimum distance between location updates, in meters.
7291 // Bucketized to reduce cardinality.
7292 optional android.stats.location.SmallestDisplacementBucket
7293 bucketized_smallest_displacement = 7;
7294
7295 // The number of location updates.
7296 optional int64 num_updates = 8;
7297
7298 // The request expiration time, in millisecond since boot.
7299 // Bucketized to reduce cardinality.
7300 optional android.stats.location.ExpirationBucket
7301 bucketized_expire_in = 9;
7302
7303 // Type of Callback passed in for this API.
7304 optional android.stats.location.CallbackType callback_type = 10;
7305
7306 // The radius of the central point of the alert
7307 // region, in meters. Only for API REQUEST_GEOFENCE.
7308 // Bucketized to reduce cardinality.
7309 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7310
7311 // Activity Importance of API caller.
7312 // Categorized to 3 types that are interesting from location's perspective.
7313 optional android.stats.location.ActivityImportance activiy_importance = 12;
7314}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007315
7316/**
7317 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7318 */
7319message ReviewPermissionsFragmentResultReported {
7320 // unique value identifying a permission group change. A permission group change might result
7321 // in multiple of these atoms
7322 optional int64 change_id = 1;
7323
7324 // UID of package the permission belongs to
7325 optional int32 uid = 2 [(is_uid) = true];
7326
7327 // Name of package the permission belongs to
7328 optional string package_name = 3;
7329
7330 // The permission to be granted
7331 optional string permission_name = 4;
7332
7333 // The result of the permission grant
7334 optional bool permission_granted = 5;
7335}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007336
7337/**
7338* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7339* Logged from: RuntimePermissionUpdgradeController
7340*/
7341message RuntimePermissionsUpgradeResult {
7342 // Permission granted as result of upgrade
7343 optional string permission_name = 1;
7344
7345 // UID of package granted permission
7346 optional int32 uid = 2 [(is_uid) = true];
7347
7348 // Name of package granted permission
7349 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007350}
7351
7352/**
7353* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7354*/
7355message GrantPermissionsActivityButtonActions {
7356 // Permission granted as result of upgrade
7357 optional string permission_group_name = 1;
7358
7359 // UID of package granted permission
7360 optional int32 uid = 2 [(is_uid) = true];
7361
7362 // Name of package requesting permission
7363 optional string package_name = 3;
7364
7365 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7366 // LABEL_ constants in GrantPermissionActivity.java
7367 optional int32 buttons_presented = 4;
7368
7369 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7370 optional int32 button_clicked = 5;
7371}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007372
7373/**
7374 * Information about LocationAccessCheck notification presented to user
7375 */
7376message LocationAccessCheckNotificationAction {
7377
7378 // id which identifies single session of user interacting with permission controller
7379 optional int64 session_id = 1;
7380
7381 // Uid of package for which location access check is presented
7382 optional int32 package_uid = 2;
7383
7384 // Name of package for which location access check is presented
7385 optional string package_name = 3;
7386
7387 enum Result {
7388 UNDEFINED = 0;
7389 // notification was presented to the user
7390 NOTIFICATION_PRESENTED = 1;
7391 // notification was declined by the user
7392 NOTIFICATION_DECLINED = 2;
7393 // notification was clicked by the user
7394 NOTIFICATION_CLICKED = 3;
7395 }
7396
7397 // View / interaction recorded
7398 optional Result result = 4;
7399}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007400
7401/**
7402 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7403 */
7404message AppPermissionFragmentActionReported {
7405 // id which identifies single session of user interacting with permission controller
7406 optional int64 session_id = 1;
7407
7408 // unique value identifying a permission group change. A permission group change might result
7409 // in multiple of these atoms
7410 optional int64 change_id = 2;
7411
7412 // UID of package the permission belongs to
7413 optional int32 uid = 3 [(is_uid) = true];
7414
7415 // Name of package the permission belongs to
7416 optional string package_name = 4;
7417
7418 // The permission to be granted
7419 optional string permission_name = 5;
7420
7421 // The result of the permission grant
7422 optional bool permission_granted = 6;
7423}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007424
7425/**
7426* Information about a AppPermissionFragment viewed by user
7427*/
7428message AppPermissionFragmentViewed {
7429 // id which identifies single session of user interacting with permission controller
7430 optional int64 session_id = 1;
7431
7432 // UID of package for which permissions are viewed
7433 optional int32 uid = 2 [(is_uid) = true];
7434
7435 // Name of package for which permissions are viewed
7436 optional string package_name = 3;
7437
7438 // Permission group viewed
7439 optional string permission_group_name = 4;
7440}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007441
7442/**
7443* Information about a AppPermissionsFragment viewed by user
7444*/
7445message AppPermissionsFragmentViewed {
7446 // id which identifies single session of user interacting with permission controller
7447 optional int64 session_id = 1;
7448
7449 // id which identifies single view as every view might have several logging records
7450 // with different package information attached
7451 optional int64 view_id = 2;
7452
7453 // Permission group viewed
7454 optional string permission_group_name = 3;
7455
7456 // UID of package for which permissions are viewed
7457 optional int32 uid = 4 [(is_uid) = true];
7458
7459 // Name of package for which permissions are viewed
7460 optional string package_name = 5;
7461
7462 // Category in which permission is included
7463 enum Category {
7464 UNDEFINED = 0;
7465 ALLOWED = 1;
7466 ALLOWED_FOREGROUND = 2;
7467 DENIED = 3;
7468 }
7469 optional Category category = 6;
7470}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007471
7472/**
7473* Information about a PermissionAppsFragment viewed by user.
7474* Logged from ui/handheld/PermissionAppsFragment.java
7475*/
7476message PermissionAppsFragmentViewed {
7477 // id which identifies single session of user interacting with permission controller
7478 optional int64 session_id = 1;
7479
7480 // id which identifies single view as every view might have several logging records
7481 // with different package information attached
7482 optional int64 view_id = 2;
7483
7484 // Permission group viewed
7485 optional string permission_group_name = 3;
7486
7487 // UID of package for which permissions are viewed
7488 optional int32 uid = 4 [(is_uid) = true];
7489
7490 // Name of package for which permissions are viewed
7491 optional string package_name = 5;
7492
7493 // Category in which app is included
7494 enum Category {
7495 UNDEFINED = 0;
7496 ALLOWED = 1;
7497 ALLOWED_FOREGROUND = 2;
7498 DENIED = 3;
7499 }
7500 optional Category category = 6;
7501}
Tony Make2b1b672019-07-29 16:59:47 +01007502
7503/**
7504 * Logs when there is a smart selection related event.
7505 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7506 * Logged from: TextClassifierEventLogger.java
7507 */
7508message TextSelectionEvent {
7509 // A session ID.
7510 optional string session_id = 1;
7511
7512 // Event type of this event.
7513 optional android.stats.textclassifier.EventType event_type = 2;
7514
Tony Mak9c84bd22019-12-09 07:27:25 +00007515 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007516 optional string model_name = 3;
7517
7518 // Type of widget that was involved in triggering this event.
7519 optional android.stats.textclassifier.WidgetType widget_type = 4;
7520
7521 // Index of this event in a session.
7522 optional int32 event_index = 5;
7523
7524 // Entity type that is involved.
7525 optional string entity_type = 6;
7526
7527 // Relative word index of the start of the selection.
7528 optional int32 relative_word_start_index = 7;
7529
7530 // Relative word (exclusive) index of the end of the selection.
7531 optional int32 relative_word_end_index = 8;
7532
7533 // Relative word index of the start of the smart selection.
7534 optional int32 relative_suggested_word_start_index = 9;
7535
7536 // Relative word (exclusive) index of the end of the smart selection.
7537 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007538
7539 // Name of source package.
7540 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007541}
7542
7543/**
7544 * Logs when there is a smart linkify related event.
7545 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7546 * Logged from: TextClassifierEventLogger.java
7547 */
7548message TextLinkifyEvent {
7549 // A session ID.
7550 optional string session_id = 1;
7551
7552 // Event type of this event.
7553 optional android.stats.textclassifier.EventType event_type = 2;
7554
Tony Mak9c84bd22019-12-09 07:27:25 +00007555 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007556 optional string model_name = 3;
7557
7558 // Type of widget that was involved in triggering this event.
7559 optional android.stats.textclassifier.WidgetType widget_type = 4;
7560
7561 // Index of this event in a session.
7562 optional int32 event_index = 5;
7563
7564 // Entity type that is involved.
7565 optional string entity_type = 6;
7566
7567 // Number of links detected.
7568 optional int32 num_links = 7;
7569
7570 // The total length of all links.
7571 optional int32 linked_text_length = 8;
7572
7573 // Length of input text.
7574 optional int32 text_length = 9;
7575
7576 // Time spent on generating links in ms.
7577 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007578
7579 // Name of source package.
7580 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007581}
7582
7583/**
7584 * Logs when there is a conversation actions related event.
7585 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7586 * Logged from: TextClassifierEventLogger.java
7587 */
7588message ConversationActionsEvent {
7589 // A session ID.
7590 optional string session_id = 1;
7591
7592 // Event type of this event.
7593 optional android.stats.textclassifier.EventType event_type = 2;
7594
Tony Mak9c84bd22019-12-09 07:27:25 +00007595 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007596 optional string model_name = 3;
7597
7598 // Type of widget that was involved in triggering this event.
7599 optional android.stats.textclassifier.WidgetType widget_type = 4;
7600
7601 // The first entity type that is involved.
7602 optional string first_entity_type = 5;
7603
7604 // The second entity type that is involved.
7605 optional string second_entity_type = 6;
7606
7607 // The third entity type that is involved.
7608 optional string third_entity_type = 7;
7609
7610 // The score of the first entity type.
7611 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01007612
7613 // Name of source package.
7614 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00007615
7616 // Name of the annotator model that is involved in this event.
7617 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01007618}
7619
7620/**
7621 * Logs when there is a language detection related event.
7622 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7623 * Logged from: TextClassifierEventLogger.java
7624 */
7625message LanguageDetectionEvent {
7626 // A session ID.
7627 optional string session_id = 1;
7628
7629 // Event type of this event.
7630 optional android.stats.textclassifier.EventType event_type = 2;
7631
Tony Mak9c84bd22019-12-09 07:27:25 +00007632 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007633 optional string model_name = 3;
7634
7635 // Type of widget that was involved in triggering this event.
7636 optional android.stats.textclassifier.WidgetType widget_type = 4;
7637
7638 // Detected language.
7639 optional string language_tag = 5;
7640
7641 // Score of the detected language.
7642 optional float score = 6;
7643
7644 // Position of this action.
7645 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007646
7647 // Name of source package.
7648 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007649}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007650
7651/**
7652 * Information about an OTA update attempt by update_engine.
7653 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7654 */
7655message UpdateEngineUpdateAttemptReported {
7656 // The number of attempts for the update engine to apply a given payload.
7657 optional int32 attempt_number = 1;
7658
7659 optional android.stats.otaupdate.PayloadType payload_type = 2;
7660
7661 // The total time in minutes for the update engine to apply a given payload.
7662 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7663 // it's increased when the system is sleeping.
7664 optional int32 duration_boottime_in_minutes = 3;
7665
7666 // The total time in minutes for the update engine to apply a given payload.
7667 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7668 // and it's not increased when the system is sleeping.
7669 optional int32 duration_monotonic_in_minutes = 4;
7670
7671 // The size of the payload in MiBs.
7672 optional int32 payload_size_mib = 5;
7673
7674 // The attempt result reported by the update engine for an OTA update.
7675 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7676
7677 // The error code reported by the update engine after an OTA update attempt
7678 // on A/B devices.
7679 optional android.stats.otaupdate.ErrorCode error_code = 7;
7680
7681 // The build fingerprint of the source system. The value is read from a
7682 // system property when the device takes the update. e.g.
7683 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7684 optional string source_fingerprint = 8;
7685}
7686
7687/**
7688 * Information about all the attempts the device make before finishing the
7689 * successful update.
7690 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7691 */
7692message UpdateEngineSuccessfulUpdateReported {
7693 // The number of attempts for the update engine to apply the payload for a
7694 // successful update.
7695 optional int32 attempt_count = 1;
7696
7697 optional android.stats.otaupdate.PayloadType payload_type = 2;
7698
7699 optional int32 payload_size_mib = 3;
7700
7701 // The total number of bytes downloaded by update_engine since the last
7702 // successful update.
7703 optional int32 total_bytes_downloaded_mib = 4;
7704
7705 // The ratio in percentage of the over-downloaded bytes compared to the
7706 // total bytes needed to successfully install the update. e.g. 200 if we
7707 // download 200MiB in total for a 100MiB package.
7708 optional int32 download_overhead_percentage = 5;
7709
7710 // The total time in minutes for the update engine to apply the payload for a
7711 // successful update.
7712 optional int32 total_duration_minutes = 6;
7713
7714 // The number of reboot of the device during a successful update.
7715 optional int32 reboot_count = 7;
7716}
Alec Mourie088e762019-07-02 13:10:55 -07007717
7718/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08007719 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
7720 * key to indicate whether it was successful or not.
7721 *
7722 * Logged from:
7723 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
7724 */
7725message RebootEscrowRecoveryReported {
7726 optional bool successful = 1;
7727}
7728
7729/**
Alec Mourie088e762019-07-02 13:10:55 -07007730 * Global display pipeline metrics reported by SurfaceFlinger.
7731 * Pulled from:
7732 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7733 */
7734message SurfaceflingerStatsGlobalInfo {
7735 // Total number of frames presented during the tracing period
7736 optional int64 total_frames = 1;
7737 // Total number of frames missed
7738 optional int64 missed_frames = 2;
7739 // Total number of frames that fell back to client composition
7740 optional int64 client_composition_frames = 3;
7741 // Total time the display was turned on
7742 optional int64 display_on_millis = 4;
7743 // Total time that was spent performing animations.
7744 // This is derived from the present-to-present layer histogram
7745 optional int64 animation_millis = 5;
7746}
7747
7748/**
7749 * Per-layer display pipeline metrics reported by SurfaceFlinger.
7750 * The number of layers uploaded will be restricted due to size limitations.
7751 * Pulled from:
7752 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7753 */
7754message SurfaceflingerStatsLayerInfo {
7755 // The layer for this set of metrics
7756 // For now we can infer that the package name is included in the layer
7757 // name.
7758 optional string layer_name = 1;
7759 // Total number of frames presented
7760 optional int64 total_frames = 2;
7761 // Total number of dropped frames while latching a buffer for this layer.
7762 optional int64 dropped_frames = 3;
7763 // Set of timings measured between successive presentation timestamps.
7764 optional FrameTimingHistogram present_to_present = 4
7765 [(android.os.statsd.log_mode) = MODE_BYTES];
7766 // Set of timings measured from when an app queued a buffer for
7767 // presentation, until the buffer was actually presented to the
7768 // display.
7769 optional FrameTimingHistogram post_to_present = 5
7770 [(android.os.statsd.log_mode) = MODE_BYTES];
7771 // Set of timings measured from when a buffer is ready to be presented,
7772 // until the buffer was actually presented to the display.
7773 optional FrameTimingHistogram acquire_to_present = 6
7774 [(android.os.statsd.log_mode) = MODE_BYTES];
7775 // Set of timings measured from when a buffer was latched by
7776 // SurfaceFlinger, until the buffer was presented to the display
7777 optional FrameTimingHistogram latch_to_present = 7
7778 [(android.os.statsd.log_mode) = MODE_BYTES];
7779 // Set of timings measured from the desired presentation to the actual
7780 // presentation time
7781 optional FrameTimingHistogram desired_to_present = 8
7782 [(android.os.statsd.log_mode) = MODE_BYTES];
7783 // Set of timings measured from when an app queued a buffer for
7784 // presentation, until the buffer was ready to be presented.
7785 optional FrameTimingHistogram post_to_acquire = 9
7786 [(android.os.statsd.log_mode) = MODE_BYTES];
7787}
7788
7789/**
7790 * Histogram of frame counts bucketed by time in milliseconds.
7791 * Because of size limitations, we hard-cap the number of buckets, with
7792 * buckets for corresponding to larger milliseconds being less precise.
7793 */
7794message FrameTimingHistogram {
7795 // Timings in milliseconds that describes a set of histogram buckets
7796 repeated int32 time_millis_buckets = 1;
7797 // Number of frames that match to each time_millis, i.e. the bucket
7798 // contents
7799 // It's required that len(time_millis) == len(frame_count)
7800 repeated int64 frame_counts = 2;
7801}
Emilian Peev6729f372019-08-29 09:14:09 -07007802
Emilian Peev6729f372019-08-29 09:14:09 -07007803/**
7804 * Information about camera facing and API level usage.
7805 * Logged from:
7806 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
7807 */
7808message CameraActionEvent {
7809 // Camera session duration
7810 optional int64 duration = 1;
7811
7812 // Camera API level used
7813 optional int32 api_level = 2;
7814
7815 // Name of client package
7816 optional string package_name = 3;
7817
7818 // Camera facing
7819 enum Facing {
7820 UNKNOWN = 0;
7821 BACK = 1;
7822 FRONT = 2;
7823 EXTERNAL = 3;
7824 }
7825 optional Facing facing = 4;
7826}
atrost01a20932019-08-28 15:40:37 +01007827
7828/**
7829 * Logs when a compatibility change is affecting an app.
7830 *
7831 * Logged from:
7832 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
7833 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
7834 */
7835message AppCompatibilityChangeReported {
7836 // The UID of the app being affected by the compatibilty change.
7837 optional int32 uid = 1 [(is_uid) = true];
7838
7839 // The ID of the change affecting the app.
7840 optional int64 change_id = 2;
7841
7842 enum State {
7843 UNKNOWN_STATE = 0;
7844 ENABLED = 1;
7845 DISABLED = 2;
7846 LOGGED = 3;
7847 }
7848
7849 // The state of the change - if logged from gating whether it was enabled or disabled, or just
7850 // logged otherwise.
7851 optional State state = 3;
7852
7853 enum Source {
7854 UNKNOWN_SOURCE = 0;
7855 APP_PROCESS = 1;
7856 SYSTEM_SERVER = 2;
7857 }
7858
7859 // Where it was logged from.
7860 optional Source source = 4;
7861
7862}
Hector Dearman40579f62019-11-01 13:19:30 +00007863
7864/**
7865 * Logged from
7866 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
7867 */
7868message PerfettoUploaded {
7869 enum Event {
7870 PERFETTO_UNDEFINED = 0;
7871 PERFETTO_TRACE_BEGIN = 1;
7872 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
7873 PERFETTO_ON_CONNECT = 3;
7874 PERFETTO_ON_TRACING_DISABLED = 4;
7875 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
7876 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
7877 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
7878 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
7879 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
7880 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
7881 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
7882 PERFETTO_TRIGGER_BEGIN = 12;
7883 PERFETTO_TRIGGER_SUCCESS = 13;
7884 PERFETTO_TRIGGER_FAILURE = 14;
7885 PERFETTO_HIT_GUARDRAILS = 15;
7886 PERFETTO_ON_TIMEOUT = 16;
7887 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
7888 }
7889
7890 // Which stage of the pipeline we are reporting from.
7891 optional Event event = 1;
7892
7893 // UUID matching the one set inside the SystemInfo trace packet.
7894 optional int64 trace_uuid_lsb = 2;
7895 optional int64 trace_uuid_msb = 3;
7896}
Mark Tabrya824a642019-11-05 12:26:12 -08007897
7898/**
7899 * Pulls client metrics on data transferred via Vehicle Maps Service.
7900 * Metrics are keyed by uid + layer.
7901 *
7902 * Pulled from:
7903 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
7904 */
7905message VmsClientStats {
7906 // UID of the VMS client app
7907 optional int32 uid = 1 [(is_uid) = true];
7908
7909 // VMS layer definition
7910 optional int32 layer_type = 2;
7911 optional int32 layer_channel = 3;
7912 optional int32 layer_version = 4;
7913
7914 // Bytes and packets sent by the client for the layer
7915 optional int64 tx_bytes = 5;
7916 optional int64 tx_packets = 6;
7917
7918 // Bytes and packets received by the client for the layer
7919 optional int64 rx_bytes = 7;
7920 optional int64 rx_packets = 8;
7921
7922 // Bytes and packets dropped due to client error
7923 optional int64 dropped_bytes = 9;
7924 optional int64 dropped_packets = 10;
7925}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007926
7927/**
7928 * State of a dangerous permission requested by a package - sampled
7929 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
7930*/
7931message DangerousPermissionStateSampled {
7932 // Name of the permission
7933 optional string permission_name = 1;
7934
7935 // Uid of the package
7936 optional int32 uid = 2 [(is_uid) = true];
7937
7938 // If the permission is granted to the uid
7939 optional bool is_granted = 3;
7940
7941 // Permission flags as per android.content.pm.PermissionFlags
7942 optional int32 permission_flags = 4;
7943}
7944
Stan Iliev637ba5e2019-08-16 13:43:08 -04007945/**
7946 * HWUI renders pipeline type: GL (0) or Vulkan (1).
7947 */
7948enum PipelineType {
7949 GL = 0;
7950 VULKAN = 1;
7951}
7952
7953/**
7954 * HWUI stats for a given app.
7955 */
7956message GraphicsStats {
7957 // The package name of the app
7958 optional string package_name = 1;
7959
7960 // The version code of the app
7961 optional int64 version_code = 2;
7962
7963 // The start & end timestamps in UTC as
7964 // milliseconds since January 1, 1970
7965 // Compatible with java.util.Date#setTime()
7966 optional int64 stats_start = 3;
7967
7968 optional int64 stats_end = 4;
7969
7970 // HWUI renders pipeline type: GL or Vulkan.
7971 optional PipelineType pipeline = 5;
7972
7973 // Distinct frame count.
7974 optional int32 total_frames = 6;
7975
7976 // Number of "missed vsync" events.
7977 optional int32 missed_vsync_count = 7;
7978
7979 // Number of frames in triple-buffering scenario (high input latency)
7980 optional int32 high_input_latency_count = 8;
7981
7982 // Number of "slow UI thread" events.
7983 optional int32 slow_ui_thread_count = 9;
7984
7985 // Number of "slow bitmap upload" events.
7986 optional int32 slow_bitmap_upload_count = 10;
7987
7988 // Number of "slow draw" events.
7989 optional int32 slow_draw_count = 11;
7990
7991 // Number of frames that missed their deadline (aka, visibly janked)
7992 optional int32 missed_deadline_count = 12;
7993
7994 // The frame time histogram for the package
7995 optional FrameTimingHistogram cpu_histogram = 13
7996 [(android.os.statsd.log_mode) = MODE_BYTES];
7997
7998 // The gpu frame time histogram for the package
7999 optional FrameTimingHistogram gpu_histogram = 14
8000 [(android.os.statsd.log_mode) = MODE_BYTES];
8001
8002 // UI mainline module version.
8003 optional int64 version_ui_module = 15;
8004
8005 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8006 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8007 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8008 // more apps are running / rendering.
8009 optional bool is_today = 16;
8010}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008011
8012/**
8013 * Message related to dangerous (runtime) app ops access
8014 */
8015message RuntimeAppOpsAccess {
8016 // Uid of the package accessing app op
8017 optional int32 uid = 1 [(is_uid) = true];
8018
8019 // Name of the package accessing app op
8020 optional string package_name = 2;
8021
8022 // operation id; maps to the OP_* constants in AppOpsManager.java
8023 optional int32 op_id = 3;
8024
8025 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
8026 // Features must be provided through manifest using <feature> tag available in R and above.
8027 optional string feature_id = 4;
8028
8029 // message related to app op access, limited to 600 chars by API
8030 optional string message = 5;
8031
8032 enum SamplingStrategy {
8033 DEFAULT = 0;
8034 UNIFORM = 1;
8035 RARELY_USED = 2;
8036 }
8037
8038 // sampling strategy used to collect this message
8039 optional SamplingStrategy sampling_strategy = 6;
8040}
8041
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008042/*
8043 * Logs userspace reboot outcome and duration.
8044 *
8045 * Logged from:
8046 * frameworks/base/core/java/com/android/server/BootReceiver.java
8047 */
8048message UserspaceRebootReported {
8049 // Possible outcomes of userspace reboot.
8050 enum Outcome {
8051 // Default value in case platform failed to determine the outcome.
8052 OUTCOME_UNKNOWN = 0;
8053 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8054 SUCCESS = 1;
8055 // Userspace reboot shutdown sequence was aborted.
8056 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8057 // Remounting userdata into checkpointing mode failed.
8058 FAILED_USERDATA_REMOUNT = 3;
8059 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8060 // reboot.
8061 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8062 }
8063 // Outcome of userspace reboot. Always set.
8064 optional Outcome outcome = 1;
8065 // Duration of userspace reboot in case it has a successful outcome.
8066 // Duration is measured as time between userspace reboot was initiated and until boot completed
8067 // (e.g. sys.boot_completed=1).
8068 optional int64 duration_millis = 2;
8069 // State of primary user's (user0) credential encryption storage.
8070 enum UserEncryptionState {
8071 // Default value.
8072 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8073 // Credential encrypted storage is unlocked.
8074 UNLOCKED = 1;
8075 // Credential encrypted storage is locked.
8076 LOCKED = 2;
8077 }
8078 // State of primary user's encryption storage at the moment boot completed. Always set.
8079 optional UserEncryptionState user_encryption_state = 3;
8080}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008081
8082/*
8083 * Logs integrity check information during each install.
8084 *
8085 * Logged from:
8086 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8087 */
8088message IntegrityCheckResultReported {
8089 optional string package_name = 1;
8090 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008091 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008092 optional string installer_package_name = 4;
8093 enum Response {
8094 UNKNOWN = 0;
8095 ALLOWED = 1;
8096 REJECTED = 2;
8097 FORCE_ALLOWED = 3;
8098 }
8099 optional Response response = 5;
8100 // An estimate on the cause of the response. This will only be populated for
8101 // REJECTED and FORCE_ALLOWED
8102 optional bool caused_by_app_cert_rule = 6;
8103 optional bool caused_by_installer_rule = 7;
8104}
8105
8106/**
8107 * Logs the information about the rules and the provider whenever rules are
8108 * pushed into AppIntegrityManager.
8109 *
8110 * Logged from:
8111 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8112 */
8113message IntegrityRulesPushed {
8114 optional bool success = 1;
8115 // Package name of the app that pushed the rules.
8116 optional string rule_provider = 2;
8117 // Version string of arbitrary format provided by the rule provider to
8118 // identify the rules.
8119 optional string rule_version = 3;
8120}
Jordan Liubedfa702019-12-20 15:08:45 -08008121
8122/**
8123 * Logs when a cell broadcast message is received on the device.
8124 *
8125 * Logged from CellBroadcastService module:
8126 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8127 */
8128message CellBroadcastMessageReported {
8129 // The type of Cell Broadcast message
8130 enum CbType {
8131 UNKNOWN_TYPE = 0;
8132 GSM = 1;
8133 CDMA = 2;
8134 CDMA_SPC = 3;
8135 }
8136
8137 // GSM, CDMA, CDMA-SCP
8138 optional CbType type = 1;
8139}
8140
8141/**
8142 * Logs when an error occurs while handling a cell broadcast message;
8143 *
8144 * Logged from CellBroadcastService module:
8145 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8146 */
8147message CellBroadcastMessageError {
8148 // The type of error raised when trying to handle a cell broadcast message
8149 enum ErrorType {
8150 UNKNOWN_TYPE = 0;
8151 CDMA_DECODING_ERROR = 1;
8152 CDMA_SCP_EMPTY = 2;
8153 CDMA_SCP_HANDLING_ERROR = 3;
8154 GSM_INVALID_HEADER_LENGTH = 4;
8155 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8156 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8157 GSM_INVALID_PDU = 7;
8158 GSM_INVALID_GEO_FENCING_DATA = 8;
8159 GSM_UMTS_INVALID_WAC = 9;
8160 FAILED_TO_INSERT_TO_DB = 10;
8161 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8162 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8163 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8164 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8165 }
8166
8167 // What kind of error occurred
8168 optional ErrorType type = 1;
8169
8170 // Exception message (or log message) associated with the error (max 1000 chars)
8171 optional string exception_message = 2;
8172}