blob: 1d764e325955d1ab3183ed1c47cd71afe1a5b158 [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";
Fan Zhangf837b8e2018-10-23 12:38:30 -070025import "frameworks/base/core/proto/android/app/settings_enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070026import "frameworks/base/core/proto/android/app/job/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";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080034import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080035import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080036import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080037import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080038import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080039import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070040import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080041import "frameworks/base/core/proto/android/service/usb.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070042import "frameworks/base/core/proto/android/stats/enums.proto";
shawnlinea5b66b2018-11-13 15:05:29 +080043import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080044import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
45import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070046import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080047import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080048import "frameworks/base/core/proto/android/telephony/enums.proto";
49import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080050import "frameworks/base/core/proto/android/wifi/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080051
Yao Chend54f9dd2017-10-17 17:37:48 +000052/**
Stefan Lafonae2df012017-11-14 09:17:21 -080053 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000054 * raw stats log events from the Android system, also known as "atoms."
55 *
56 * This field contains a single oneof with all of the available messages.
57 * The stats-log-api-gen tool runs as part of the Android build and
58 * generates the android.util.StatsLog class, which contains the constants
59 * and methods that Android uses to log.
60 *
Stefan Lafonae2df012017-11-14 09:17:21 -080061 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000062 * Instead, statsd on Android constructs these messages synthetically,
63 * in the format defined here and in stats_log.proto.
64 */
Stefan Lafonae2df012017-11-14 09:17:21 -080065message Atom {
66 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070067 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070068 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
69 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070070 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070071 BleScanResultReceived ble_scan_result_received = 4;
72 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080073 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070074 SyncStateChanged sync_state_changed = 7;
75 ScheduledJobStateChanged scheduled_job_state_changed = 8;
76 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070077 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080078 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
79 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
80 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070081 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
82 MemoryFactorStateChanged memory_factor_state_changed = 15;
83 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
84 CachedKillReported cached_kill_reported = 17;
85 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070086 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080087 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
88 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
89 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070090 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080091 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070092 CameraStateChanged camera_state_changed = 25;
93 FlashlightStateChanged flashlight_state_changed = 26;
94 UidProcessStateChanged uid_process_state_changed = 27;
95 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
96 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070097 BatteryLevelChanged battery_level_changed = 30;
98 ChargingStateChanged charging_state_changed = 31;
99 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700100 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800101 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700102 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
103 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700104 WifiLockStateChanged wifi_lock_state_changed = 37;
105 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
106 WifiScanStateChanged wifi_scan_state_changed = 39;
107 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700108 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700109 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700110 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900111 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700112 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800113 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000114 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800115 AppStartOccurred app_start_occurred = 48;
116 AppStartCanceled app_start_canceled = 49;
117 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800118 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800119 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800120 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800121 LmkStateChanged lmk_state_changed = 54;
122 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800123 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800124 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000125 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800126 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800127 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800128 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800129 KeyguardStateChanged keyguard_state_changed = 62;
130 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
131 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800132 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800133 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800134 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
135 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800136 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700137 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800138 SpeakerImpedanceReported speaker_impedance_reported = 71;
139 HardwareFailed hardware_failed = 72;
140 PhysicalDropDetected physical_drop_detected = 73;
141 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800142 MobileConnectionStateChanged mobile_connection_state_changed = 75;
143 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700144 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800145 AppCrashOccurred app_crash_occurred = 78;
146 ANROccurred anr_occurred = 79;
147 WTFOccurred wtf_occurred = 80;
148 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700149 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700150 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700151 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700152 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700153 ThermalThrottlingStateChanged thermal_throttling = 86;
Kevin Chyn1741a072019-01-17 11:54:40 -0800154 BiometricAcquired biometric_acquired = 87;
155 BiometricAuthenticated biometric_authenticated = 88;
156 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700157 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700158 BatteryHealthSnapshot battery_health_snapshot = 91;
159 SlowIo slow_io = 92;
160 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700161 PhoneServiceStateChanged phone_service_state_changed = 94;
162 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100163 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700164 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700165 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700166 // TODO: service state change is very noisy shortly after boot, as well
167 // as at other transitions - coming out of doze, device plugged in, etc.
168 // Consider removing this if it becomes a problem
169 ServiceStateChanged service_state_changed = 99;
170 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800171 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800172 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000173 DevicePolicyEvent device_policy_event = 103;
shawnlinea5b66b2018-11-13 15:05:29 +0800174 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104;
175 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported = 105;
176 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106;
177 DocsUIFileOperationReported docs_ui_provider_file_op = 107;
178 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request = 108;
179 DocsUILaunchReported docs_ui_launch_reported = 109;
180 DocsUIRootVisitedReported docs_ui_root_visited = 110;
181 DocsUIStartupMsReported docs_ui_startup_ms = 111;
182 DocsUIUserActionReported docs_ui_user_action_reported = 112;
Bookatzda1798c2018-12-13 14:16:00 -0800183 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
184 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000185 AppCompacted app_compacted = 115;
lifr030d23a2019-01-11 16:54:51 +0800186 NetworkDnsEventReported network_dns_event_reported = 116;
shawnlina75e82d2019-01-07 10:31:12 +0800187 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported = 117;
188 DocsUIPickResultReported docs_ui_pick_result_reported = 118;
189 DocsUISearchModeReported docs_ui_search_mode_reported = 119;
190 DocsUISearchTypeReported docs_ui_search_type_reported = 120;
Chiachang Wangf6bedc22019-01-14 11:54:32 +0800191 DataStallEvent data_stall_event = 121;
Christian Brunschenf86039e2018-12-21 12:26:14 +0000192 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000193 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800194 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800195 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800196 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
197 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000198 AppDowngraded app_downgraded = 128;
199 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
200 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800201 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
202 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800203 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800204 NfcErrorOccurred nfc_error_occurred = 134;
205 NfcStateChanged nfc_state_changed = 135;
206 NfcBeamOccurred nfc_beam_occurred = 136;
207 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
208 NfcTagOccurred nfc_tag_occurred = 138;
209 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
210 SeStateChanged se_state_changed = 140;
211 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800212 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800213 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800214 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800215 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800216 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800217 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800218 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500219 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800220 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800221 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
222 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
223 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
224 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
225 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
226 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
227 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
228 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
229 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800230 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
231 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
232 BluetoothManufacturerInfoReported bluetooth_device_info_reported = 162;
233 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
234 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
235 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
236 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
237 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800238 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800239 ProcessStartTime process_start_time = 169;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -0800240 PermissionGrantRequestResultReported permission_grant_request_result_reported = 170;
Jack He815cdba2019-01-30 17:24:55 -0800241 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800242 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500243 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
Yao Chend54f9dd2017-10-17 17:37:48 +0000244 }
David Chenc8a43242017-10-17 16:23:28 -0700245
David Chen6e3e6cb2018-01-03 16:14:06 -0800246 // Pulled events will start at field 10000.
Olivier Gaillard18d452202019-01-22 15:03:41 +0000247 // Next: 10048
David Chenc8a43242017-10-17 16:23:28 -0700248 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800249 WifiBytesTransfer wifi_bytes_transfer = 10000;
250 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
251 MobileBytesTransfer mobile_bytes_transfer = 10002;
252 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800253 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800254 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800255 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800256 CpuTimePerFreq cpu_time_per_freq = 10008;
257 CpuTimePerUid cpu_time_per_uid = 10009;
258 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800259 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800260 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800261 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800262 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800263 SystemElapsedRealtime system_elapsed_realtime = 10014;
264 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800265 CpuActiveTime cpu_active_time = 10016;
266 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000267 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800268 RemainingBatteryCapacity remaining_battery_capacity = 10019;
269 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800270 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100271 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100272 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100273 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000274 DiskStats disk_stats = 10025;
275 DirectoryUsage directory_usage = 10026;
276 AppSize app_size = 10027;
277 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700278 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700279 BatteryVoltage battery_voltage = 10030;
Kevin Chyn1741a072019-01-17 11:54:40 -0800280 NumBiometricsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700281 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700282 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800283 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700284 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100285 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100286 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700287 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800288 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
289 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
290 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000291 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800292 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800293 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800294 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000295 DebugElapsedClock debug_elapsed_clock = 10046;
296 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
Kevin Chyn1741a072019-01-17 11:54:40 -0800297 NumBiometricsEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800298 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800299 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800300 TrainInfo train_info = 10051;
David Chenc8a43242017-10-17 16:23:28 -0700301 }
yroa1fe77c2018-02-26 14:22:54 -0800302
Bookatz76aafcf2018-09-17 16:17:10 -0700303 // DO NOT USE field numbers above 100,000 in AOSP.
304 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
305 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700306}
307
Yao Chend54f9dd2017-10-17 17:37:48 +0000308/**
Yangster-mac20877162017-12-22 17:19:39 -0800309 * This proto represents a node of an attribution chain.
310 * Note: All attribution chains are represented as a repeated field of type
311 * AttributionNode. It is understood that in such arrays, the order is that
312 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000313 */
Yangster-mac20877162017-12-22 17:19:39 -0800314message AttributionNode {
315 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800316 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800317
Yangster-mac20877162017-12-22 17:19:39 -0800318 // The (optional) string tag for an element in the attribution chain. If the
319 // element has no tag, it is encoded as an empty string.
320 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700321}
322
Yangster-mac48b3d622018-08-18 12:38:11 -0700323message KeyValuePair {
324 optional int32 key = 1;
325 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700326 int32 value_int = 2;
327 int64 value_long = 3;
328 string value_str = 4;
329 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700330 }
331}
332
333message KeyValuePairsAtom {
334 optional int32 uid = 1;
335 repeated KeyValuePair pairs = 2;
336}
337
Yao Chend54f9dd2017-10-17 17:37:48 +0000338/*
339 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800340 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000341 *
342 * RULES:
343 * - The field ids for each atom must start at 1, and count upwards by 1.
344 * Skipping field ids is not allowed.
345 * - These form an API, so renaming, renumbering or removing fields is
346 * not allowed between android releases. (This is not currently enforced,
347 * but there will be a tool to enforce this restriction).
348 * - The types must be built-in protocol buffer types, namely, no sub-messages
349 * are allowed (yet). The bytes type is also not allowed.
350 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800351 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000352 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800353 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000354 * - A field that is a uid should be a string field, tagged with the [xxx]
355 * annotation. The generated code on android will be represented by UIDs,
356 * and those UIDs will be translated in xxx to those strings.
357 *
358 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700359 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000360 * - If there is a UID, it goes first. Think in an object-oriented fashion.
361 * *****************************************************************************
362 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700363
Yao Chend54f9dd2017-10-17 17:37:48 +0000364/**
Yangster-mace16189a2018-08-26 12:20:16 -0700365 * Logs when the Thermal service HAL notifies the throttling start/stop events.
366 *
367 * Logged from:
368 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
369 */
370message ThermalThrottlingStateChanged {
371 optional android.os.TemperatureTypeEnum sensor_type = 1;
372
373 enum State {
374 UNKNOWN = 0;
375 START = 1;
376 STOP = 2;
377 }
378
379 optional State state = 2;
380
381 optional float temperature = 3;
382}
383
384/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000385 * Logs when the screen state changes.
386 *
387 * Logged from:
388 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
389 */
390message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800391 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700392 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700393}
Yao Chend54f9dd2017-10-17 17:37:48 +0000394
395/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700396 * Logs that the process state of the uid, as determined by ActivityManager
397 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000398 *
399 * Logged from:
400 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
401 */
Bookatzc1a050a2017-10-10 15:49:28 -0700402message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700403 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000404
Bookatzdb026a22018-01-10 19:01:56 -0800405 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700406 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000407}
408
409/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700410 * Logs process state change of a process, as per the activity manager.
411 *
412 * Logged from:
413 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
414 */
415message ProcessStateChanged {
416 optional int32 uid = 1;
417 optional string process_name = 2;
418 optional string package_name = 3;
419 // TODO: remove this when validation is done
420 optional int64 version = 5;
421 // The state, from frameworks/base/core/proto/android/app/enums.proto.
422 optional android.app.ProcessStateEnum state = 4;
423}
424
425/**
426 * Logs when ActivityManagerService sleep state is changed.
427 *
428 * Logged from:
429 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
430 */
431message ActivityManagerSleepStateChanged {
432 // TODO: import frameworks proto
433 enum State {
434 UNKNOWN = 0;
435 ASLEEP = 1;
436 AWAKE = 2;
437 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700438 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700439}
440
441/**
442 * Logs when system memory state changes.
443 *
444 * Logged from:
445 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
446 */
447message MemoryFactorStateChanged {
448 // TODO: import frameworks proto
449 enum State {
450 MEMORY_UNKNOWN = 0;
451 NORMAL = 1; // normal.
452 MODERATE = 2; // moderate memory pressure.
453 LOW = 3; // low memory.
454 CRITICAL = 4; // critical memory.
455
456 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700457 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700458}
459
460/**
461 * Logs when app is using too much cpu, according to ActivityManagerService.
462 *
463 * Logged from:
464 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
465 */
466message ExcessiveCpuUsageReported {
467 optional int32 uid = 1;
468 optional string process_name = 2;
469 optional string package_name = 3;
470 // package version. TODO: remove this when validation is done
471 optional int64 version = 4;
472}
473
474/**
475 * Logs when a cached process is killed, along with its pss.
476 *
477 * Logged from:
478 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
479 */
480message CachedKillReported {
481 optional int32 uid = 1;
482 optional string process_name = 2;
483 optional string package_name = 3;
484 // TODO: remove this when validation is done
485 optional int64 version = 5;
486 optional int64 pss = 4;
487}
488
489/**
490 * Logs when memory stats of a process is reported.
491 *
492 * Logged from:
493 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
494 */
495message ProcessMemoryStatReported {
496 optional int32 uid = 1;
497 optional string process_name = 2;
498 optional string package_name = 3;
499 //TODO: remove this when validation is done
500 optional int64 version = 9;
501 optional int64 pss = 4;
502 optional int64 uss = 5;
503 optional int64 rss = 6;
504 enum Type {
505 ADD_PSS_INTERNAL_SINGLE = 0;
506 ADD_PSS_INTERNAL_ALL_MEM = 1;
507 ADD_PSS_INTERNAL_ALL_POLL = 2;
508 ADD_PSS_EXTERNAL = 3;
509 ADD_PSS_EXTERNAL_SLOW = 4;
510 }
511 optional Type type = 7;
512 optional int64 duration = 8;
513}
514
515/**
Bookatzc1a050a2017-10-10 15:49:28 -0700516 * Logs that a process started, finished, crashed, or ANRed.
517 *
518 * Logged from:
519 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
520 */
521message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700522 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700523
David Chen0b5c90c2018-01-25 16:51:49 -0800524 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800525 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700526
Bookatzddccf0a2017-11-28 16:48:14 -0800527 // What lifecycle state the process changed to.
528 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800529 enum State {
530 FINISHED = 0;
531 STARTED = 1;
532 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800533 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800534 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700535}
536
Bookatzc1a050a2017-10-10 15:49:28 -0700537/**
538 * Logs when the ble scan state changes.
539 *
540 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700541 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700542 */
543message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800544 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700545
546 enum State {
547 OFF = 0;
548 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700549 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
550 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700551 }
552 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700553
Bookatze5ec0b42018-03-26 13:34:56 -0700554 // Does the scan have a filter.
555 optional bool is_filtered = 3;
556 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
557 optional bool is_first_match = 4;
558 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
559 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700560}
561
562/**
563 * Logs reporting of a ble scan finding results.
564 *
565 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700566 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700567 */
Bookatzae6738e2018-09-13 11:38:56 -0700568// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700569message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800570 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700571
572 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800573 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700574}
575
576/**
577 * Logs when a sensor state changes.
578 *
579 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700580 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700581 */
582message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800583 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700584
Bookatzc1a050a2017-10-10 15:49:28 -0700585 // The id (int) of the sensor.
586 optional int32 sensor_id = 2;
587
588 enum State {
589 OFF = 0;
590 ON = 1;
591 }
592 optional State state = 3;
593}
594
Bookatzc1a050a2017-10-10 15:49:28 -0700595/**
596 * Logs when GPS state changes.
597 *
598 * Logged from:
599 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
600 */
601message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800602 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700603
604 enum State {
605 OFF = 0;
606 ON = 1;
607 }
608 optional State state = 2;
609}
610
Bookatz48d362e2018-11-06 15:49:08 -0800611/**
612 * Logs when GPS signal quality.
613 *
614 * Logged from:
615 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
616 */
617message GpsSignalQualityChanged {
618 optional android.server.location.GpsSignalQualityEnum level = 1;
619}
620
Bookatzc1a050a2017-10-10 15:49:28 -0700621
622/**
623 * Logs when a sync manager sync state changes.
624 *
625 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700626 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700627 */
628message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800629 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700630
David Chen0b5c90c2018-01-25 16:51:49 -0800631 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800632 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700633
634 enum State {
635 OFF = 0;
636 ON = 1;
637 }
638 optional State state = 3;
639}
640
Yangster-mac96353002018-09-05 11:18:55 -0700641/*
642 * Deferred job stats.
643 *
644 * Logged from:
645 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
646*/
647message DeferredJobStatsReported {
648 repeated AttributionNode attribution_node = 1;
649
650 // Number of jobs deferred.
651 optional int32 num_jobs_deferred = 2;
652
653 // Time since the last job runs.
654 optional int64 time_since_last_job_millis = 3;
655}
656
Bookatzc1a050a2017-10-10 15:49:28 -0700657/**
658 * Logs when a job scheduler job state changes.
659 *
660 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700661 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700662 */
663message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800664 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700665
666 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800667 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700668
669 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800670 FINISHED = 0;
671 STARTED = 1;
672 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700673 }
674 optional State state = 3;
675
Tej Singh33a412b2018-03-16 18:43:59 -0700676 // The reason a job has stopped.
677 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700678 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700679 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700680}
681
682/**
683 * Logs when the audio state changes.
684 *
685 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700686 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700687 */
688message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800689 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700690
691 enum State {
692 OFF = 0;
693 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700694 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
695 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700696 }
697 optional State state = 2;
698}
699
700/**
701 * Logs when the video codec state changes.
702 *
703 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700704 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700705 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800706message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800707 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700708
709 enum State {
710 OFF = 0;
711 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700712 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
713 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700714 }
715 optional State state = 2;
716}
717
718/**
719 * Logs when the flashlight state changes.
720 *
721 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700722 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700723 */
724message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800725 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700726
727 enum State {
728 OFF = 0;
729 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700730 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
731 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700732 }
733 optional State state = 2;
734}
735
736/**
737 * Logs when the camera state changes.
738 *
739 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700740 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700741 */
742message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800743 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700744
745 enum State {
746 OFF = 0;
747 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700748 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
749 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700750 }
751 optional State state = 2;
752}
753
754/**
755 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000756 *
757 * Logged from:
758 * TODO
759 */
Bookatzd6746242017-10-24 18:39:35 -0700760message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800761 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000762
Bookatz1a1b0462018-01-12 11:47:03 -0800763 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
764 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700765 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700766
767 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
768 optional string tag = 3;
769
770 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800771 RELEASE = 0;
772 ACQUIRE = 1;
773 CHANGE_RELEASE = 2;
774 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700775 }
776 optional State state = 4;
777}
778
779/**
Bookatzc1a050a2017-10-10 15:49:28 -0700780 * Logs when a partial wakelock is considered 'long' (over 1 min).
781 *
782 * Logged from:
783 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
784 */
785message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800786 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700787
Yao Chend54f9dd2017-10-17 17:37:48 +0000788 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
789 optional string tag = 2;
790
Bookatzc1a050a2017-10-10 15:49:28 -0700791 // TODO: I have no idea what this is.
792 optional string history_tag = 3;
793
794 enum State {
795 OFF = 0;
796 ON = 1;
797 }
798 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000799}
800
Bookatzc1a050a2017-10-10 15:49:28 -0700801/**
Bookatza66083f2018-09-20 17:24:00 -0700802 * Logs when the device is interactive, according to the PowerManager Notifier.
803 *
804 * Logged from:
805 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
806 */
807message InteractiveStateChanged {
808 enum State {
809 OFF = 0;
810 ON = 1;
811 }
812 optional State state = 1;
813}
814
815/**
Bookatzc1a050a2017-10-10 15:49:28 -0700816 * Logs Battery Saver state change.
817 *
818 * Logged from:
819 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
820 */
821message BatterySaverModeStateChanged {
822 enum State {
823 OFF = 0;
824 ON = 1;
825 }
826 optional State state = 1;
827}
828
829/**
830 * Logs Doze mode state change.
831 *
832 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800833 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700834 */
835message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800836 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800837}
838
839
840/**
841 * Logs state change of Doze mode including maintenance windows.
842 *
843 * Logged from:
844 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
845 */
846message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800847 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700848}
849
850/**
851 * Logs screen brightness level.
852 *
853 * Logged from:
854 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
855 */
856message ScreenBrightnessChanged {
857 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
858 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700859}
860
861/**
862 * Logs battery level (percent full, from 0 to 100).
863 *
864 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700865 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700866 */
867message BatteryLevelChanged {
868 // Battery level. Should be in [0, 100].
869 optional int32 battery_level = 1;
870}
871
872/**
873 * Logs change in charging status of the device.
874 *
875 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700876 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700877 */
878message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800879 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
880 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700881}
882
883/**
884 * Logs whether the device is plugged in, and what power source it is using.
885 *
886 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700887 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700888 */
889message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800890 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
891 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700892}
893
Bookatz8c6571b2017-10-24 15:04:41 -0700894/**
895 * Logs when an app's wakeup alarm fires.
896 *
897 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700898 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700899 */
900message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800901 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800902
903 // Name of the wakeup alarm.
904 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700905
906 // Name of source package (for historical reasons, since BatteryStats tracked it).
907 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800908}
909
910/**
911 * Logs when an an app causes the mobile radio to change state.
912 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
913 *
914 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700915 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800916 */
917message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800918 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800919
Bookatz1a1b0462018-01-12 11:47:03 -0800920 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
921 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800922}
923
924/**
925 * Logs when an an app causes the wifi radio to change state.
926 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
927 *
928 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700929 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800930 */
931message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800932 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800933
Bookatz1a1b0462018-01-12 11:47:03 -0800934 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
935 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700936}
937
938/**
939 * Logs kernel wakeup reasons and aborts.
940 *
941 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700942 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700943 */
944message KernelWakeupReported {
945 // Name of the kernel wakeup reason (or abort).
946 optional string wakeup_reason_name = 1;
947
948 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800949 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700950}
951
952/**
Bookatzda1798c2018-12-13 14:16:00 -0800953 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800954 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800955 *
956 * Logged from:
957 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
958 */
959message WifiEnabledStateChanged {
960 enum State {
961 OFF = 0;
962 ON = 1;
963 }
964 optional State state = 1;
965}
966
967/**
968 * 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 -0800969 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
970 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800971 *
972 * Logged from:
973 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
974 */
975message WifiRunningStateChanged {
976 repeated AttributionNode attribution_node = 1;
977
978 enum State {
979 OFF = 0;
980 ON = 1;
981 }
982 optional State state = 2;
983}
984
985/**
Bookatze5885242017-10-24 20:10:31 -0700986 * Logs wifi locks held by an app.
987 *
988 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700989 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700990 */
991message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800992 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700993
994 enum State {
995 OFF = 0;
996 ON = 1;
997 }
998 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -0800999
1000 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1001 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001002}
1003
1004/**
1005 * Logs wifi signal strength changes.
1006 *
1007 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001008 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001009 */
1010message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001011 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1012 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001013}
1014
1015/**
1016 * Logs wifi scans performed by an app.
1017 *
1018 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001019 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001020 */
1021message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001022 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001023
1024 enum State {
1025 OFF = 0;
1026 ON = 1;
1027 }
1028 optional State state = 2;
1029}
1030
1031/**
Tej Singh4503e102018-01-04 14:35:01 -08001032 * Logs wifi multicast locks held by an app
1033 *
1034 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001035 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001036 */
1037message WifiMulticastLockStateChanged {
1038 repeated AttributionNode attribution_node = 1;
1039
1040 enum State {
1041 OFF = 0;
1042 ON = 1;
1043 }
1044 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001045
1046 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001047}
1048
1049/**
Tej Singh1ea42892018-01-19 09:27:00 -08001050 * Logs shutdown reason and duration on next boot.
1051 *
1052 * Logged from:
1053 * frameworks/base/core/java/com/android/server/BootReceiver.java
1054 */
1055message ShutdownSequenceReported {
1056 // True if shutdown is for a reboot. Default: false if we do not know.
1057 optional bool reboot = 1;
1058
1059 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1060 optional string reason = 2;
1061
1062 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1063 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001064 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001065
1066 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001067 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001068}
1069
Tej Singh6483ea42018-01-25 17:45:49 -08001070
1071/**
1072 * Logs boot reason and duration.
1073 *
1074 * Logged from:
1075 * system/core/bootstat/bootstat.cpp
1076 */
1077message BootSequenceReported {
1078 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1079 // Default: "<EMPTY>" if not available.
1080 optional string bootloader_reason = 1;
1081
1082 // Reason for system boot. Eg. bootloader, reboot,userrequested
1083 // Default: "<EMPTY>" if not available.
1084 optional string system_reason = 2;
1085
1086 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001087 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001088
1089 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001090 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001091
1092 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001093 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001094
1095 // Time since last boot in ms. Default: 0 if not available.
1096 optional int64 time_since_last_boot = 6;
1097}
1098
Tej Singhc477d9c2018-02-05 18:31:39 -08001099
1100/**
1101 * Logs call state and disconnect cause (if applicable).
1102 *
1103 * Logged from:
1104 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1105 */
1106message CallStateChanged {
1107 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1108 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1109 optional android.telecom.CallStateEnum call_state = 1;
1110
1111 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1112 // This value is only applicable when the call_state is DISCONNECTED, and
1113 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1114 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1115 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1116
1117 // True if the call is self-managed, which are apps that use the
1118 // telecom infrastructure to make their own calls.
1119 optional bool self_managed = 3;
1120
1121 // True if call is external. External calls are calls on connected Wear
1122 // devices but show up in Telecom so the user can pull them onto the device.
1123 optional bool external_call = 4;
1124}
1125
Tej Singh1ea42892018-01-19 09:27:00 -08001126/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001127 * Logs keyguard state. The keyguard is the lock screen.
1128 *
1129 * Logged from:
1130 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1131 */
1132message KeyguardStateChanged {
1133 enum State {
1134 UNKNOWN = 0;
1135 // The keyguard is hidden when the phone is unlocked.
1136 HIDDEN = 1;
1137 // The keyguard is shown when the phone is locked (screen turns off).
1138 SHOWN= 2;
1139 // The keyguard is occluded when something is overlaying the keyguard.
1140 // Eg. Opening the camera while on the lock screen.
1141 OCCLUDED = 3;
1142 }
1143 optional State state = 1;
1144}
1145
1146/**
1147 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1148 * prompts the user to enter a password (pattern, pin, etc).
1149 *
1150 * Logged from:
1151 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1152 */
1153
1154message KeyguardBouncerStateChanged {
1155 enum State {
1156 UNKNOWN = 0;
1157 // Bouncer is hidden, either as a result of successfully entering the
1158 // password, screen timing out, or user going back to lock screen.
1159 HIDDEN = 1;
1160 // This is when the user is being prompted to enter the password.
1161 SHOWN = 2;
1162 }
1163 optional State state = 1;
1164}
1165
1166/**
1167 * Logs the result of entering a password into the keyguard bouncer.
1168 *
1169 * Logged from:
1170 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1171 */
1172message KeyguardBouncerPasswordEntered {
1173 enum BouncerResult {
1174 UNKNOWN = 0;
1175 // The password entered was incorrect.
1176 FAILURE = 1;
1177 // The password entered was correct.
1178 SUCCESS = 2;
1179 }
1180 optional BouncerResult result = 1;
1181}
1182
Tej Singha883b372018-02-15 11:30:01 -08001183/*
1184 * Logs changes to the configuration of the device. The configuration is defined
1185 * in frameworks/base/core/java/android/content/res/Configuration.java
1186 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1187 * Please go there to interpret the possible values each field can be.
1188 *
1189 * Logged from:
1190 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1191 */
1192message ResourceConfigurationChanged {
1193 // Bit mask of color capabilities of the screen.
1194 // Contains information about the color gamut and hdr mode of the screen.
1195 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001196 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001197
1198 // The target screen density being rendered to.
1199 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001200 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001201
1202 // Current user preference for the scaling factor for fonts,
1203 // relative to the base density scaling.
1204 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001205 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001206
1207 // Flag indicating whether the hard keyboard is hidden.
1208 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001209 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001210
1211 // The type of keyboard attached to the device.
1212 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1213 optional int32 keyboard = 5;
1214
1215 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1216 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001217 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001218
1219 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1220 // 0 if undefined.
1221 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1222 optional int32 mcc = 7;
1223
1224 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1225 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1226 // MNC_ZERO symbol defined in Configuration.java.
1227 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1228 optional int32 mnc = 8;
1229
1230 // The kind of navigation available on the device.
1231 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1232 optional int32 navigation = 9;
1233
1234 // Flag indicating whether the navigation is available.
1235 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001236 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001237
1238 // Overall orientation of the screen.
1239 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1240 optional int32 orientation = 11;
1241
1242 // The current height of the available screen space, in dp units.
1243 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001244 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001245
1246 // Bit mask of overall layout of the screen.
1247 // Contains information about screen size, whether the screen is wider/taller
1248 // than normal, whether the screen layout is right-tl-left or left-to-right,
1249 // and whether the screen has a rounded shape.
1250 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001251 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001252
1253 // Current width of the available screen space, in dp units.
1254 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001255 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001256
1257 // The smallest screen size an application will see in normal operation.
1258 // This is the smallest value of both screenWidthDp and screenHeightDp
1259 // in portrait and landscape.
1260 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001261 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001262
1263 // The type of touch screen attached to the device.
1264 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1265 optional int32 touchscreen = 16;
1266
1267 // Bit mask of the ui mode.
1268 // Contains information about the overall ui mode of the device.
1269 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1270 // Also contains information about whether the device is in night mode.
1271 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001272 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001273}
1274
Tej Singheee317b2018-03-07 19:28:05 -08001275
1276/**
1277 * Logs changes in the connection state of the mobile radio.
1278 *
1279 * Logged from:
1280 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1281 */
1282message MobileConnectionStateChanged {
1283 // States are from the state machine DataConnection.java.
1284 enum State {
1285 UNKNOWN = 0;
1286 // The connection is inactive, or disconnected.
1287 INACTIVE = 1;
1288 // The connection is being activated, or connecting.
1289 ACTIVATING = 2;
1290 // The connection is active, or connected.
1291 ACTIVE = 3;
1292 // The connection is disconnecting.
1293 DISCONNECTING = 4;
1294 // The connection is disconnecting after creating a connection.
1295 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1296 }
1297 optional State state = 1;
1298 // For multi-sim phones, this distinguishes between the sim cards.
1299 optional int32 sim_slot_index = 2;
1300 // Used to identify the connection. Starts at 0 and increments by 1 for
1301 // every new network created. Resets whenever the device reboots.
1302 optional int32 data_connection_id = 3;
1303 // A bitmask for the capabilities of this connection.
1304 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1305 // Default value (if we have no information): 0
1306 optional int64 capabilities = 4;
1307 // If this connection has internet.
1308 // This just checks if the DEFAULT bit of capabilities is set.
1309 optional bool has_internet = 5;
1310}
1311
1312/**
1313 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1314 *
1315 * Logged from:
1316 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1317 */
1318message MobileRadioTechnologyChanged {
1319 optional android.telephony.NetworkTypeEnum state = 1;
1320 // For multi-sim phones, this distinguishes between the sim cards.
1321 optional int32 sim_slot_index = 2;
1322}
1323
Andrew Chantb56388b2018-03-22 21:07:33 -07001324/**
1325 * Logs the VID and PID of any connected USB devices.
1326 *
1327 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1328 *
1329 * Logged by Vendor.
1330 */
1331message UsbDeviceAttached {
1332 optional int32 vid = 1;
1333 optional int32 pid = 2;
1334 optional bool has_audio = 3;
1335 optional bool has_hid = 4;
1336 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001337 enum State {
1338 STATE_DISCONNECTED = 0;
1339 STATE_CONNECTED = 1;
1340 }
1341 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001342 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001343}
1344
Tej Singheee317b2018-03-07 19:28:05 -08001345
Tej Singhdd7bd352018-02-09 19:33:15 -08001346/**
Tej Singh5d991e12018-03-09 19:48:11 -08001347 * Logs when Bluetooth is enabled and disabled.
1348 *
1349 * Logged from:
1350 * services/core/java/com/android/server/BluetoothManagerService.java
1351 */
1352message BluetoothEnabledStateChanged {
1353 repeated AttributionNode attribution_node = 1;
1354 // Whether or not bluetooth is enabled on the device.
1355 enum State {
1356 UNKNOWN = 0;
1357 ENABLED = 1;
1358 DISABLED = 2;
1359 }
1360 optional State state = 2;
1361 // The reason for being enabled/disabled.
1362 // Eg. Airplane mode, crash, application request.
1363 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1364 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001365 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001366}
1367
1368/**
Jack Hed9837c82019-01-09 01:19:13 -08001369 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001370 *
1371 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001372 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1373 *
1374 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001375 */
1376message BluetoothConnectionStateChanged {
1377 // The state of the connection.
1378 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1379 optional android.bluetooth.ConnectionStateEnum state = 1;
1380 // An identifier that can be used to match connect and disconnect events.
1381 // Currently is last two bytes of a hash of a device level ID and
1382 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001383 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1384 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001385 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1386 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001387 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001388 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001389 // An identifier that can be used to match events for this device.
1390 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1391 // Salt: Randomly generated 256 bit value
1392 // Hash algorithm: HMAC-SHA256
1393 // Size: 32 byte
1394 // Default: null or empty if the device identifier is not known
1395 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1396}
1397
1398/**
1399 * Logs when a Bluetooth device connects and disconnects over ACL
1400 *
1401 * Logged from:
1402 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1403 *
1404 * Next Tag: 3
1405 */
1406message BluetoothAclConnectionStateChanged {
1407 // An identifier that can be used to match events for this device.
1408 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1409 // Salt: Randomly generated 256 bit value
1410 // Hash algorithm: HMAC-SHA256
1411 // Size: 32 byte
1412 // Default: null or empty if the device identifier is not known
1413 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1414 // The state of the connection.
1415 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1416 optional android.bluetooth.ConnectionStateEnum state = 2;
1417}
1418
1419/**
1420 * Logs when a Bluetooth device connects and disconnects over SCO
1421 *
1422 * Logged from:
1423 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1424 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1425 *
1426 * Next Tag: 4
1427 */
1428message BluetoothScoConnectionStateChanged {
1429 // An identifier that can be used to match events for this device.
1430 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1431 // Salt: Randomly generated 256 bit value
1432 // Hash algorithm: HMAC-SHA256
1433 // Size: 32 byte
1434 // Default: null or empty if the device identifier is not known
1435 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1436 // The state of the connection.
1437 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1438 optional android.bluetooth.ConnectionStateEnum state = 2;
1439 // Codec used for this SCO connection
1440 // Default: UNKNOWN
1441 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001442}
1443
Jack Hec27040a2019-01-09 20:54:41 -08001444/**
1445 * Logged when active device of a profile changes
1446 *
1447 * Logged from:
1448 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1449 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1450 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1451 */
1452message BluetoothActiveDeviceChanged {
1453 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1454 // From android.bluetooth.BluetoothProfile
1455 optional int32 bt_profile = 1;
1456 // An identifier that can be used to match events for this new active device.
1457 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1458 // Salt: Randomly generated 256 bit value
1459 // Hash algorithm: HMAC-SHA256
1460 // Size: 32 byte
1461 // Default: null or empty if there is no active device for this profile
1462 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1463}
1464
Jack Heab86dbd22018-12-18 15:43:27 -08001465// Logs when there is an event affecting Bluetooth device's link layer connection.
1466// - This event is triggered when there is a related HCI command or event
1467// - Users of this metrics can deduce Bluetooth device's connection state from these events
1468// - HCI commands are logged before the command is sent, after receiving command status, and after
1469// receiving command complete
1470// - HCI events are logged when they arrive
1471//
1472// Low level log from system/bt
1473//
1474// Bluetooth classic commands:
1475// - CMD_CREATE_CONNECTION
1476// - CMD_DISCONNECT
1477// - CMD_CREATE_CONNECTION_CANCEL
1478// - CMD_ACCEPT_CONNECTION_REQUEST
1479// - CMD_REJECT_CONNECTION_REQUEST
1480// - CMD_SETUP_ESCO_CONNECTION
1481// - CMD_ACCEPT_ESCO_CONNECTION
1482// - CMD_REJECT_ESCO_CONNECTION
1483// - CMD_ENH_SETUP_ESCO_CONNECTION
1484// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1485//
1486// Bluetooth low energy commands:
1487// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1488// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1489// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1490// - CMD_BLE_CLEAR_WHITE_LIST
1491// - CMD_BLE_ADD_WHITE_LIST
1492// - CMD_BLE_REMOVE_WHITE_LIST
1493//
1494// Bluetooth classic events:
1495// - EVT_CONNECTION_COMP
1496// - EVT_CONNECTION_REQUEST
1497// - EVT_DISCONNECTION_COMP
1498// - EVT_ESCO_CONNECTION_COMP
1499// - EVT_ESCO_CONNECTION_CHANGED
1500//
1501// Bluetooth low energy meta events:
1502// - BLE_EVT_CONN_COMPLETE_EVT
1503// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1504//
1505// Next tag: 10
1506message BluetoothLinkLayerConnectionEvent {
1507 // An identifier that can be used to match events for this device.
1508 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1509 // Salt: Randomly generated 256 bit value
1510 // Hash algorithm: HMAC-SHA256
1511 // Size: 32 byte
1512 // Default: null or empty if the device identifier is not known
1513 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1514 // Connection handle of this connection if available
1515 // Range: 0x0000 - 0x0EFF (12 bits)
1516 // Default: 0xFFFF if the handle is unknown
1517 optional int32 connection_handle = 2;
1518 // Direction of the link
1519 // Default: DIRECTION_UNKNOWN
1520 optional android.bluetooth.DirectionEnum direction = 3;
1521 // Type of this link
1522 // Default: LINK_TYPE_UNKNOWN
1523 optional android.bluetooth.LinkTypeEnum type = 4;
1524
1525 // Reason metadata for this link layer connection event, rules for interpretation:
1526 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1527 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1528 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1529 // set and valid, ignore hci_ble_event
1530
1531 // HCI command associated with this event
1532 // Default: CMD_UNKNOWN
1533 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1534 // HCI event associated with this event
1535 // Default: EVT_UNKNOWN
1536 optional android.bluetooth.hci.EventEnum hci_event = 6;
1537 // HCI BLE meta event associated with this event
1538 // Default: BLE_EVT_UNKNOWN
1539 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1540 // HCI command status code if this is triggerred by hci_cmd
1541 // Default: STATUS_UNKNOWN
1542 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1543 // HCI reason code associated with this event
1544 // Default: STATUS_UNKNOWN
1545 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1546}
1547
Howard Roe103fe22019-01-17 16:52:16 -08001548/**
1549 * Logs when a module is rolled back by Watchdog.
1550 *
1551 * Logged from: Rollback Manager
1552 */
1553message WatchdogRollbackOccurred {
1554 enum RollbackType {
1555 UNKNOWN = 0;
1556 ROLLBACK_INITIATE = 1;
1557 ROLLBACK_SUCCESS = 2;
1558 ROLLBACK_FAILURE = 3;
1559 }
1560 optional RollbackType rollback_type = 1;
1561
1562 optional string package_name = 2;
1563
1564 optional int32 package_version_code = 3;
1565}
1566
Jack Hec27040a2019-01-09 20:54:41 -08001567/**
1568 * Logs when there is a change in Bluetooth A2DP playback state
1569 *
1570 * Logged from:
1571 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1572 */
1573message BluetoothA2dpPlaybackStateChanged {
1574 // An identifier that can be used to match events for this device.
1575 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1576 // Salt: Randomly generated 256 bit value
1577 // Hash algorithm: HMAC-SHA256
1578 // Size: 32 byte
1579 // Default: null or empty if the device identifier is not known
1580 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1581 // Current playback state
1582 // Default: PLAYBACK_STATE_UNKNOWN
1583 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1584 // Current audio coding mode
1585 // Default: AUDIO_CODING_MODE_UNKNOWN
1586 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1587}
1588
1589/**
1590 * Logs when there is a change in A2DP codec config for a particular remote device
1591 *
1592 * Logged from:
1593 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1594 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1595 */
1596message BluetoothA2dpCodecConfigChanged {
1597 // An identifier that can be used to match events for this device.
1598 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1599 // Salt: Randomly generated 256 bit value
1600 // Hash algorithm: HMAC-SHA256
1601 // Size: 32 byte
1602 // Default: null or empty if the device identifier is not known
1603 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1604 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1605 // Default SOURCE_CODEC_TYPE_INVALID
1606 optional int32 codec_type = 2;
1607 // Codec priroity, the higher the more preferred, -1 for disabled
1608 // Default: CODEC_PRIORITY_DEFAULT
1609 optional int32 codec_priority = 3;
1610 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1611 // Default: SAMPLE_RATE_NONE
1612 optional int32 sample_rate = 4;
1613 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1614 // Default: BITS_PER_SAMPLE_NONE
1615 optional int32 bits_per_sample = 5;
1616 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1617 // Default: CHANNEL_MODE_NONE
1618 optional int32 channel_mode = 6;
1619 // Codec specific values
1620 // Default 0
1621 optional int64 codec_specific_1 = 7;
1622 optional int64 codec_specific_2 = 8;
1623 optional int64 codec_specific_3 = 9;
1624 optional int64 codec_specific_4 = 10;
1625}
1626
1627/**
1628 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1629 * Each codec's capability is logged separately due to statsd restriction
1630 *
1631 * Logged from:
1632 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1633 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1634 */
1635message BluetoothA2dpCodecCapabilityChanged {
1636 // An identifier that can be used to match events for this device.
1637 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1638 // Salt: Randomly generated 256 bit value
1639 // Hash algorithm: HMAC-SHA256
1640 // Size: 32 byte
1641 // Default: null or empty if the device identifier is not known
1642 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1643 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1644 // Default SOURCE_CODEC_TYPE_INVALID
1645 optional int32 codec_type = 2;
1646 // Codec priroity, the higher the more preferred, -1 for disabled
1647 // Default: CODEC_PRIORITY_DEFAULT
1648 optional int32 codec_priority = 3;
1649 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1650 // in BluetoothCodecConfig
1651 // Default: empty and SAMPLE_RATE_NONE for individual item
1652 optional int32 sample_rate = 4;
1653 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1654 // in BluetoothCodecConfig
1655 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1656 optional int32 bits_per_sample = 5;
1657 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1658 // BluetoothCodecConfig
1659 // Default: empty and CHANNEL_MODE_NONE for individual item
1660 optional int32 channel_mode = 6;
1661 // Codec specific values
1662 // Default 0
1663 optional int64 codec_specific_1 = 7;
1664 optional int64 codec_specific_2 = 8;
1665 optional int64 codec_specific_3 = 9;
1666 optional int64 codec_specific_4 = 10;
1667}
1668
1669/**
1670 * Logs when A2DP failed to read from PCM source.
1671 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1672 *
1673 * Logged from:
1674 * system/bt
1675 */
1676message BluetoothA2dpAudioUnderrunReported {
1677 // An identifier that can be used to match events for this device.
1678 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1679 // Salt: Randomly generated 256 bit value
1680 // Hash algorithm: HMAC-SHA256
1681 // Size: 32 byte
1682 // Default: null or empty if the device identifier is not known
1683 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1684 // Encoding interval in nanoseconds
1685 // Default: 0
1686 optional int64 encoding_interval_nanos = 2;
1687 // Number of bytes of PCM data that could not be read from the source
1688 // Default: 0
1689 optional int32 num_missing_pcm_bytes = 3;
1690}
1691
1692/**
1693 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1694 * buffer queue is full and we have to drop data
1695 *
1696 * Logged from:
1697 * system/bt
1698 */
1699message BluetoothA2dpAudioOverrunReported {
1700 // An identifier that can be used to match events for this device.
1701 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1702 // Salt: Randomly generated 256 bit value
1703 // Hash algorithm: HMAC-SHA256
1704 // Size: 32 byte
1705 // Default: null or empty if the device identifier is not known
1706 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1707 // Encoding interval in nanoseconds
1708 // Default: 0
1709 optional int64 encoding_interval_nanos = 2;
1710 // Number of buffers dropped in this event
1711 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1712 // Default: 0
1713 optional int32 num_dropped_buffers = 3;
1714 // Number of encoded buffers dropped in this event
1715 // Default 0
1716 optional int32 num_dropped_encoded_frames = 4;
1717 // Number of encoded bytes dropped in this event
1718 // Default: 0
1719 optional int32 num_dropped_encoded_bytes = 5;
1720}
1721
1722/**
1723 * Logs when we receive reports regarding a device's RSSI value
1724 *
1725 * Logged from:
1726 * system/bt
1727 */
1728message BluetoothDeviceRssiReported {
1729 // An identifier that can be used to match events for this device.
1730 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1731 // Salt: Randomly generated 256 bit value
1732 // Hash algorithm: HMAC-SHA256
1733 // Size: 32 byte
1734 // Default: null or empty if the device identifier is not known
1735 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1736 // Connection handle of this connection if available
1737 // Range: 0x0000 - 0x0EFF (12 bits)
1738 // Default: 0xFFFF if the handle is unknown
1739 optional int32 connection_handle = 2;
1740 // HCI command status code if this is triggerred by hci_cmd
1741 // Default: STATUS_UNKNOWN
1742 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1743 // BR/EDR
1744 // Range: -128 ≤ N ≤ 127 (signed integer)
1745 // Units: dB
1746 // LE:
1747 // Range: -127 to 20, 127 (signed integer)
1748 // Units: dBm
1749 // Invalid when an out of range value is reported
1750 optional int32 rssi = 4;
1751}
1752
1753/**
1754 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1755 *
1756 * Logged from:
1757 * system/bt
1758 */
1759message BluetoothDeviceFailedContactCounterReported {
1760 // An identifier that can be used to match events for this device.
1761 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1762 // Salt: Randomly generated 256 bit value
1763 // Hash algorithm: HMAC-SHA256
1764 // Size: 32 byte
1765 // Default: null or empty if the device identifier is not known
1766 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1767 // Connection handle of this connection if available
1768 // Range: 0x0000 - 0x0EFF (12 bits)
1769 // Default: 0xFFFF if the handle is unknown
1770 optional int32 connection_handle = 2;
1771 // HCI command status code if this is triggerred by hci_cmd
1772 // Default: STATUS_UNKNOWN
1773 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1774 // Number of consecutive failed contacts for a connection corresponding to the Handle
1775 // Range: uint16_t, 0-0xFFFF
1776 // Default: 0xFFFFF
1777 optional int32 failed_contact_counter = 4;
1778}
1779
1780/**
1781 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1782 *
1783 * Logged from:
1784 * system/bt
1785 */
1786message BluetoothDeviceTxPowerLevelReported {
1787 // An identifier that can be used to match events for this device.
1788 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1789 // Salt: Randomly generated 256 bit value
1790 // Hash algorithm: HMAC-SHA256
1791 // Size: 32 byte
1792 // Default: null or empty if the device identifier is not known
1793 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1794 // Connection handle of this connection if available
1795 // Range: 0x0000 - 0x0EFF (12 bits)
1796 // Default: 0xFFFF if the handle is unknown
1797 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001798 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001799 // Default: STATUS_UNKNOWN
1800 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1801 // Range: -30 ≤ N ≤ 20
1802 // Units: dBm
1803 // Invalid when an out of range value is reported
1804 optional int32 transmit_power_level = 4;
1805}
Jack Heab86dbd22018-12-18 15:43:27 -08001806
Tej Singh5d991e12018-03-09 19:48:11 -08001807/**
Jack He1021a612019-01-20 21:22:46 -08001808 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1809 * receiving an HCI command from the host
1810 *
1811 * Logged from: system/bt
1812 */
1813message BluetoothHciTimeoutReported {
1814 // HCI command associated with this event
1815 // Default: CMD_UNKNOWN
1816 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1817}
1818
1819/**
1820 * Logs when we receive Bluetooth Link Quality Report event from the controller
1821 * See Android Bluetooth HCI specification for more details
1822 *
1823 * Note: all count and bytes field are counted since last event
1824 *
1825 * Logged from: system/bt
1826 */
1827message BluetoothQualityReportReported {
1828 // Quality report ID
1829 // Original type: uint8_t
1830 // Default: BQR_ID_UNKNOWN
1831 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1832 // Packet type of the connection
1833 // Original type: uint8_t
1834 // Default: BQR_PACKET_TYPE_UNKNOWN
1835 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1836 // Connection handle of the connection
1837 // Original type: uint16_t
1838 optional int32 connection_handle = 3;
1839 // Performing Role for the connection
1840 // Original type: uint8_t
1841 optional int32 connection_role = 4;
1842 // Current Transmit Power Level for the connection. This value is the same as the controller's
1843 // response to the HCI_Read_Transmit_Power_Level HCI command
1844 // Original type: uint8_t
1845 optional int32 tx_power_level = 5;
1846 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1847 // absolute receiver signal strength value
1848 // Original type: int8_t
1849 optional int32 rssi = 6;
1850 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1851 // channels used by the link currently
1852 // Original type: uint8_t
1853 optional int32 snr = 7;
1854 // Indicates the number of unused channels in AFH_channel_map
1855 // Original type: uint8_t
1856 optional int32 unused_afh_channel_count = 8;
1857 // Indicates the number of the channels which are interfered and quality is bad but are still
1858 // selected for AFH
1859 // Original type: uint8_t
1860 optional int32 afh_select_unideal_channel_count = 9;
1861 // Current Link Supervision Timeout Setting
1862 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1863 // Original type: uint16_t
1864 optional int32 lsto = 10;
1865 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1866 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1867 // 0x01 (Piconet Clock)
1868 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1869 // Original type: uint32_t
1870 optional int64 connection_piconet_clock = 11;
1871 // The count of retransmission
1872 // Original type: uint32_t
1873 optional int64 retransmission_count = 12;
1874 // The count of no RX
1875 // Original type: uint32_t
1876 optional int64 no_rx_count = 13;
1877 // The count of NAK (Negative Acknowledge)
1878 // Original type: uint32_t
1879 optional int64 nak_count = 14;
1880 // Controller timestamp of last TX ACK
1881 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1882 // Original type: uint32_t
1883 optional int64 last_tx_ack_timestamp = 15;
1884 // The count of Flow-off (STOP)
1885 // Original type: uint32_t
1886 optional int64 flow_off_count = 16;
1887 // Controller timestamp of last Flow-on (GO)
1888 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1889 // Original type: uint32_t
1890 optional int64 last_flow_on_timestamp = 17;
1891 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1892 // Original type: uint32_t
1893 optional int64 buffer_overflow_bytes = 18;
1894 // Buffer underflow count (in byte) since last event
1895 // Original type: uint32_t
1896 optional int64 buffer_underflow_bytes = 19;
1897}
1898
1899/**
1900 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1901 *
1902 * Notes:
1903 * - Each event can be partially filled as we might learn different pieces of device
1904 * information at different time
1905 * - Multiple device info events can be combined to give more complete picture
1906 * - When multiple device info events tries to describe the same information, the
1907 * later one wins
1908 *
1909 * Logged from:
1910 * packages/apps/Bluetooth
1911 */
1912message BluetoothManufacturerInfoReported {
1913 // An identifier that can be used to match events for this device.
1914 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1915 // Salt: Randomly generated 256 bit value
1916 // Hash algorithm: HMAC-SHA256
1917 // Size: 32 byte
1918 // Default: null or empty if the device identifier is not known
1919 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1920 // Where is this device info obtained from
1921 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1922 // Name of the data source
1923 // For EXTERNAL: package name of the data source
1924 // For INTERNAL: null for general case, component name otherwise
1925 optional string source_name = 3;
1926 // Name of the manufacturer of this device
1927 optional string manufacturer = 4;
1928 // Model of this device
1929 optional string model = 5;
1930 // Hardware version of this device
1931 optional string hardware_version = 6;
1932 // Software version of this device
1933 optional string software_version = 7;
1934}
1935
1936/**
1937 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1938 * device, as documented by the Bluetooth Core HCI specification
1939 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1940 * Vol 2, Part E, Page 1118
1941 *
1942 * Logged from:
1943 * system/bt
1944 */
1945message BluetoothRemoteVersionInfoReported {
1946 // Connection handle of the connection
1947 // Original type: uint16_t
1948 optional int32 connection_handle = 1;
1949 // HCI command status code
1950 // Default: STATUS_UNKNOWN
1951 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1952 // 1 byte Version of current LMP in the remote controller
1953 optional int32 lmp_version = 3;
1954 // 2 bytes LMP manufacturer code of the remote controller
1955 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1956 optional int32 lmp_manufacturer_code = 4;
1957 // 4 bytes subversion of the LMP in the remote controller
1958 optional int32 lmp_subversion = 5;
1959}
1960
1961/**
1962 * Logs when certain Bluetooth SDP attributes are discovered
1963 * Constant definitions are from:
1964 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1965 *
1966 * Current logged attributes:
1967 * - BluetoothProfileDescriptorList
1968 * - Supported Features Bitmask
1969 *
1970 * Logged from:
1971 * system/bt
1972 */
1973message BluetoothSdpAttributeReported {
1974 // An identifier that can be used to match events for this device.
1975 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1976 // Salt: Randomly generated 256 bit value
1977 // Hash algorithm: HMAC-SHA256
1978 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1979 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1980 // Original type: uint16_t
1981 optional int32 protocol_uuid = 2;
1982 // Short form UUIDs used to identify Bluetooth SDP attribute types
1983 // Original type: uint16_t
1984 optional int32 attribute_id = 3;
1985 // Attribute value for the particular attribute
1986 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1987}
1988
1989/**
1990 * Logs when bond state of a Bluetooth device changes
1991 *
1992 * Logged from:
1993 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
1994 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
1995 */
1996message BluetoothBondStateChanged {
1997 // An identifier that can be used to match events for this device.
1998 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1999 // Salt: Randomly generated 256 bit value
2000 // Hash algorithm: HMAC-SHA256
2001 // Size: 32 byte
2002 // Default: null or empty if the device identifier is not known
2003 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2004 // Preferred transport type to remote dual mode device
2005 // Default: TRANSPORT_AUTO means no preference
2006 optional android.bluetooth.TransportTypeEnum transport = 2;
2007 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2008 // Default: UNKNOWN
2009 optional android.bluetooth.DeviceTypeEnum type = 3;
2010 // Current bond state (NONE, BONDING, BONDED)
2011 // Default: BOND_STATE_UNKNOWN
2012 optional android.bluetooth.BondStateEnum bond_state = 4;
2013 // Bonding sub state
2014 // Default: BOND_SUB_STATE_UNKNOWN
2015 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2016 // Unbond Reason
2017 // Default: UNBOND_REASON_UNKNOWN
2018 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2019}
2020
2021/**
2022 * Logs there is an event related Bluetooth classic pairing
2023 *
2024 * Logged from:
2025 * system/bt
2026 */
2027message BluetoothClassicPairingEventReported {
2028 // An identifier that can be used to match events for this device.
2029 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2030 // Salt: Randomly generated 256 bit value
2031 // Hash algorithm: HMAC-SHA256
2032 // Size: 32 byte
2033 // Default: null or empty if the device identifier is not known
2034 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2035 // Connection handle of this connection if available
2036 // Range: 0x0000 - 0x0EFF (12 bits)
2037 // Default: 0xFFFF if the handle is unknown
2038 optional int32 connection_handle = 2;
2039 // HCI command associated with this event
2040 // Default: CMD_UNKNOWN
2041 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2042 // HCI event associated with this event
2043 // Default: EVT_UNKNOWN
2044 optional android.bluetooth.hci.EventEnum hci_event = 4;
2045 // HCI command status code if this is triggerred by hci_cmd
2046 // Default: STATUS_UNKNOWN
2047 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2048 // HCI reason code associated with this event
2049 // Default: STATUS_UNKNOWN
2050 optional android.bluetooth.hci.StatusEnum reason_code = 6;
2051}
2052
2053/**
2054 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2055 *
2056 * Logged from:
2057 * system/bt
2058 */
2059message BluetoothSmpPairingEventReported {
2060 // An identifier that can be used to match events for this device.
2061 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2062 // Salt: Randomly generated 256 bit value
2063 // Hash algorithm: HMAC-SHA256
2064 // Size: 32 byte
2065 // Default: null or empty if the device identifier is not known
2066 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2067 // SMP command sent or received over L2CAP
2068 // Default: CMD_UNKNOWN
2069 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2070 // Whether this command is sent or received
2071 // Default: DIRECTION_UNKNOWN
2072 optional android.bluetooth.DirectionEnum direction = 3;
2073 // SMP failure reason code
2074 // Default: PAIRING_FAIL_REASON_DEFAULT
2075 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2076}
2077
2078/**
Jack He815cdba2019-01-30 17:24:55 -08002079 * Logs when a Bluetooth socket’s connection state changed
2080 *
2081 * Logged from:
2082 * system/bt
2083 */
2084message BluetoothSocketConnectionStateChanged {
2085 // An identifier that can be used to match events for this device.
2086 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2087 // Salt: Randomly generated 256 bit value
2088 // Hash algorithm: HMAC-SHA256
2089 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002090 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002091 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002092 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002093 // Default 0 when unknown or don't care
2094 optional int32 port = 2;
2095 // Socket type as mentioned in
2096 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2097 // Default: SOCKET_TYPE_UNKNOWN
2098 optional android.bluetooth.SocketTypeEnum type = 3;
2099 // Socket connection state
2100 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2101 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2102 // Number of bytes sent to remote device during this connection
2103 optional int64 tx_bytes = 5;
2104 // Number of bytes received from remote device during this connection
2105 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002106 // Socket owner's UID
2107 optional int32 uid = 7 [(is_uid) = true];
2108 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2109 // |port| must be spawned by |server_port|
2110 // Default 0 when unknown or don't care
2111 optional int32 server_port = 8;
2112 // Whether this is a server listener socket
2113 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002114}
2115
2116/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002117 * Logs when something is plugged into or removed from the USB-C connector.
2118 *
2119 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002120 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002121 */
2122message UsbConnectorStateChanged {
2123 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002124 STATE_DISCONNECTED = 0;
2125 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002126 }
2127 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002128 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002129 // Last active session in ms.
2130 // 0 when the port is in connected state.
2131 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002132}
2133
2134/**
2135 * Logs the reported speaker impedance.
2136 *
2137 * Logged from:
2138 * Vendor audio implementation.
2139 */
2140message SpeakerImpedanceReported {
2141 optional int32 speaker_location = 1;
2142 optional int32 impedance = 2;
2143}
2144
2145/**
2146 * Logs the report of a failed hardware.
2147 *
2148 * Logged from:
2149 * Vendor HALs.
2150 *
2151 */
2152message HardwareFailed {
2153 enum HardwareType {
2154 HARDWARE_FAILED_UNKNOWN = 0;
2155 HARDWARE_FAILED_MICROPHONE = 1;
2156 HARDWARE_FAILED_CODEC = 2;
2157 HARDWARE_FAILED_SPEAKER = 3;
2158 HARDWARE_FAILED_FINGERPRINT = 4;
2159 }
2160 optional HardwareType hardware_type = 1;
2161
Maggie White6dcd8572019-01-31 14:11:50 -08002162 /**
2163 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002164 * the same hardware_type. The specific locations are vendor defined integers,
2165 * referring to board-specific numbering schemes.
2166 */
2167 optional int32 hardware_location = 2;
2168
Maggie White6dcd8572019-01-31 14:11:50 -08002169 /**
2170 * failure_code is specific to the HardwareType of the failed hardware.
2171 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002172 */
Maggie White6dcd8572019-01-31 14:11:50 -08002173 enum HardwareErrorCode {
2174 UNKNOWN = 0;
2175 COMPLETE = 1;
2176 SPEAKER_HIGH_Z = 2;
2177 SPEAKER_SHORT = 3;
2178 FINGERPRINT_SENSOR_BROKEN = 4;
2179 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002180 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002181 }
2182 optional int32 failure_code = 3;
2183}
2184
2185/**
2186 * Log an event when the device has been physically dropped.
2187 * Reported from the /vendor partition.
2188 */
2189message PhysicalDropDetected {
2190 // Confidence that the event was actually a drop, 0 -> 100
2191 optional int32 confidence_pctg = 1;
2192 // Peak acceleration of the drop, in 1/1000s of a g.
2193 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002194 // Duration of freefall in ms
2195 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002196}
2197
2198/**
2199 * Log bucketed battery charge cycles.
2200 *
2201 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002202 * a given charge point. For example, if 10 cycle buckets are
2203 * initialized, bucket 1 is the lowest 1/10th of the battery,
2204 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002205 *
2206 * Logged from:
2207 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2208 */
2209message ChargeCyclesReported {
2210 optional int32 cycle_bucket_1 = 1;
2211 optional int32 cycle_bucket_2 = 2;
2212 optional int32 cycle_bucket_3 = 3;
2213 optional int32 cycle_bucket_4 = 4;
2214 optional int32 cycle_bucket_5 = 5;
2215 optional int32 cycle_bucket_6 = 6;
2216 optional int32 cycle_bucket_7 = 7;
2217 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002218 optional int32 cycle_bucket_9 = 9;
2219 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002220}
2221
2222/**
Howard Roa46b6582018-09-18 16:45:02 -07002223 * Log battery health snapshot.
2224 *
2225 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2226 * are snapshotted periodically over 24hrs.
2227 */
2228message BatteryHealthSnapshot {
2229 enum BatterySnapshotType {
2230 UNKNOWN = 0;
2231 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2232 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2233 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2234 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2235 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2236 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2237 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2238 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2239 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2240 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2241 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2242 }
2243 optional BatterySnapshotType type = 1;
2244 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002245 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002246 // Voltage Battery Voltage, in microVolts.
2247 optional int32 voltage_micro_volt = 3;
2248 // Current Battery current, in microAmps.
2249 optional int32 current_micro_amps = 4;
2250 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2251 optional int32 open_circuit_micro_volt = 5;
2252 // Resistance Battery Resistance, in microOhms.
2253 optional int32 resistance_micro_ohm = 6;
2254 // Level Battery Level, as % of full.
2255 optional int32 level_percent = 7;
2256}
2257
2258/**
2259 * Log slow I/O operations on the primary storage.
2260 */
2261message SlowIo {
2262 // Classifications of IO Operations.
2263 enum IoOperation {
2264 UNKNOWN = 0;
2265 READ = 1;
2266 WRITE = 2;
2267 UNMAP = 3;
2268 SYNC = 4;
2269 }
2270 optional IoOperation operation = 1;
2271
2272 // The number of slow IO operations of this type over 24 hours.
2273 optional int32 count = 2;
2274}
2275
2276/**
2277 * Log battery caused shutdown with the last recorded voltage.
2278 */
2279message BatteryCausedShutdown {
2280 // The last recorded battery voltage prior to shutdown.
2281 optional int32 last_recorded_micro_volt = 1;
2282}
2283
2284/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002285 * Logs the duration of a davey (jank of >=700ms) when it occurs
2286 *
2287 * Logged from:
2288 * frameworks/base/libs/hwui/JankTracker.cpp
2289 */
2290message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002291 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002292 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002293
Tej Singhbb8554a2018-01-26 11:59:14 -08002294 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002295 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002296}
2297
2298/**
Bookatze5885242017-10-24 20:10:31 -07002299 * Logs phone signal strength changes.
2300 *
2301 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002302 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002303 */
2304message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002305 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2306 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002307}
2308
Yangster4ccebea2018-10-09 17:09:02 -07002309
2310/**
2311 * Logs when the phone state, sim state or signal strength changes
2312 *
2313 * Logged from:
2314 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2315 */
2316message PhoneServiceStateChanged {
2317 optional android.telephony.ServiceStateEnum state = 1;
2318 optional android.telephony.SimStateEnum sim_state = 2;
2319 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2320}
2321
2322/**
2323 * Logs when the phone becomes on or off.
2324 *
2325 * Logged from:
2326 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2327 */
2328message PhoneStateChanged {
2329 enum State {
2330 OFF = 0;
2331 ON = 1;
2332 }
2333 optional State state = 1;
2334}
2335
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002336message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002337 optional android.stats.launcher.LauncherAction action = 1;
2338 optional android.stats.launcher.LauncherState src_state = 2;
2339 optional android.stats.launcher.LauncherState dst_state = 3;
2340 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002341 optional bool is_swipe_up_enabled = 5;
2342}
2343
David Chenc28b2bb2017-10-24 12:52:52 -07002344/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002345 * Logs when Settings UI has changed.
2346 *
2347 * Logged from:
2348 * packages/apps/Settings
2349 */
2350message SettingsUIChanged {
2351 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002352 * Where this SettingsUIChange event comes from. For example, if
2353 * it's a PAGE_VISIBLE event, where the page is opened from.
2354 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002355 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002356
2357 /**
2358 * What the UI action is.
2359 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002360 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002361
2362 /**
2363 * Where the action is happening
2364 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002365 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002366
2367 /**
2368 * What preference changed in this event.
2369 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002370 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002371
2372 /**
2373 * The new value of the changed preference.
2374 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002375 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002376}
2377
2378/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002379 * Logs basic timing information about touch events.
2380 * Reported at most every 5 minutes while device is being interacted with.
2381 *
2382 * Logged from:
2383 * frameworks/native/services/inputflinger
2384 */
2385message TouchEventReported {
2386 /**
2387 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2388 * and the standard deviation of latency between the kernel and framework
2389 * for touchscreen events. The units are microseconds.
2390 *
2391 * The number is measured as the difference between the time at which
2392 * the input event was received in the evdev driver,
2393 * and the time at which the input event was received in EventHub.
2394 */
2395 // Minimum value
2396 optional float latency_min_micros = 1;
2397 // Maximum value
2398 optional float latency_max_micros = 2;
2399 // Average value
2400 optional float latency_mean_micros = 3;
2401 // Standard deviation
2402 optional float latency_stdev_micros = 4;
2403}
2404
2405/**
David Chenc28b2bb2017-10-24 12:52:52 -07002406 * Logs that a setting was updated.
2407 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002408 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002409 * The tag and is_default allow resetting of settings to default values based on the specified
2410 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2411 */
2412message SettingChanged {
2413 // The name of the setting.
2414 optional string setting = 1;
2415
2416 // The change being imposed on this setting. May represent a number, eg "3".
2417 optional string value = 2;
2418
2419 // The new value of this setting. For most settings, this is same as value. For some settings,
2420 // value is +X or -X where X represents an element in a set. For example, if the previous value
2421 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2422 // The +/- feature is currently only used for location_providers_allowed.
2423 optional string new_value = 3;
2424
2425 // The previous value of this setting.
2426 optional string prev_value = 4;
2427
2428 // The tag used with the is_default for resetting sets of settings. This is generally null.
2429 optional string tag = 5;
2430
Bookatz90867622018-01-31 15:05:57 -08002431 // True if this setting with tag should be resettable.
2432 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002433
David Chenbd789912018-03-16 17:19:55 -07002434 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002435 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002436
2437 enum ChangeReason {
2438 UPDATED = 1; // Updated can be an insertion or an update.
2439 DELETED = 2;
2440 }
2441 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002442}
Chenjie Yub3dda412017-10-24 13:41:59 -07002443
Chenjie Yu05013b32017-11-21 10:21:41 -08002444/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002445 * Logs activity going to foreground or background
2446 *
2447 * Logged from:
2448 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2449 */
2450message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002451 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002452 optional string pkg_name = 2;
2453 optional string class_name = 3;
2454
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002455 enum State {
2456 BACKGROUND = 0;
2457 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002458 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002459 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002460}
David Chenc8a43242017-10-17 16:23:28 -07002461
2462/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002463 * Logs when a volume entered low Storage state.
2464 * Logged from:
2465 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2466 */
2467message LowStorageStateChanged {
2468 // Volume that ran out of storage.
2469 optional string volume_description = 1;
2470
2471 enum State {
2472 UNKNOWN = 0;
2473 OFF = 1;
2474 ON = 2;
2475 }
2476 optional State state = 2;
2477}
2478
2479/**
2480 * Logs when an app is downgraded.
2481 * Logged from:
2482 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2483 */
2484message AppDowngraded {
2485 optional string package_name = 1;
2486 // Size of the package (all data) before being downgraded.
2487 optional int64 size_in_bytes_before = 2;
2488 // Size of the package (all data) after being downgraded.
2489 optional int64 size_in_bytes_after = 3;
2490
2491 optional bool aggressive = 4;
2492}
2493
2494/**
2495 * Logs when an app is optimized after being downgraded.
2496 * Logged from:
2497 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2498 */
2499message AppOptimizedAfterDowngraded {
2500 optional string package_name = 1;
2501}
2502
2503/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002504 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002505 * Logged from:
2506 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2507 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002508message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002509 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002510
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002511 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002512
2513 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002514 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002515 optional string process_name = 3;
2516
2517 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002518 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002519
2520 optional string package_name = 5;
2521
2522 enum InstantApp {
2523 UNAVAILABLE = 0;
2524 FALSE = 1;
2525 TRUE = 2;
2526 }
2527 optional InstantApp is_instant_app = 6;
2528
2529 enum ForegroundState {
2530 UNKNOWN = 0;
2531 BACKGROUND = 1;
2532 FOREGROUND = 2;
2533 }
2534 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002535
2536 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002537}
David Chen9e3808c2017-11-20 17:25:34 -08002538
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002539/**
2540 * Logs when a WTF (What a Terrible Failure) happened.
2541 * Logged from:
2542 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2543 */
2544message WTFOccurred {
2545 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002546
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002547 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002548
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002549 // The name of the process.
2550 // system_server if it is not by an app
2551 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002552
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002553 // The pid if available. -1 means not available.
2554 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002555
2556 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002557}
2558
2559/**
2560 * Logs when system server reports low memory.
2561 * Logged from:
2562 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2563 */
2564message LowMemReported {
2565}
2566
2567/**
2568 * Logs when an app ANR (App Not Responding) occurs.
2569 * Logged from:
2570 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2571 */
2572message ANROccurred {
2573 optional int32 uid = 1 [(is_uid) = true];
2574
2575 optional string process_name = 2;
2576
2577 optional string short_component_name = 3;
2578
2579 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002580
2581 enum InstantApp {
2582 UNAVAILABLE = 0;
2583 FALSE = 1;
2584 TRUE = 2;
2585 }
2586 optional InstantApp is_instant_app = 5;
2587
2588 enum ForegroundState {
2589 UNKNOWN = 0;
2590 BACKGROUND = 1;
2591 FOREGROUND = 2;
2592 }
2593 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002594
2595 optional android.server.ErrorSource error_source = 7;
2596
2597 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002598}
2599
Bookatza7020bd2018-08-28 16:29:35 -07002600/**
2601 * Logs when the vibrator state changes.
2602 * Logged from:
2603 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2604 */
2605message VibratorStateChanged {
2606 repeated AttributionNode attribution_node = 1;
2607
2608 enum State {
2609 OFF = 0;
2610 ON = 1;
2611 }
2612 optional State state = 2;
2613
2614 // Duration (in milliseconds) requested to keep the vibrator on.
2615 // Only applicable for State == ON.
2616 optional int64 duration_millis = 3;
2617}
2618
David Chen0a368b22017-12-06 16:28:16 -08002619/*
2620 * Allows other apps to push events into statsd.
2621 * Logged from:
2622 * frameworks/base/core/java/android/util/StatsLog.java
2623 */
David Chen0b5c90c2018-01-25 16:51:49 -08002624message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002625 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002626 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002627
2628 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2629 optional int32 label = 2;
2630
2631 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2632 // predicates for the metrics).
2633 enum State {
2634 UNKNOWN = 0;
2635 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2636 STOP = 2;
2637 START = 3;
2638 }
2639 optional State state = 3;
2640}
2641
David Chen9e3808c2017-11-20 17:25:34 -08002642/**
Bookatz7948c872018-09-04 12:58:33 -07002643 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2644 * For example, this could be due to the user manually changing the time.
2645 *
2646 * Logged from:
2647 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2648 */
2649message WallClockTimeShifted {
2650 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2651 optional int64 wall_clock_timestamp_millis = 1;
2652}
2653
2654/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002655 * Logs when statsd detects an anomaly.
2656 *
2657 * Logged from:
2658 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2659 */
2660message AnomalyDetected {
2661 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002662 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002663
Yangster-mac94e197c2018-01-02 16:03:03 -08002664 // Id of the config whose anomaly detection alert fired.
2665 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002666
Yangster-mac94e197c2018-01-02 16:03:03 -08002667 // Id of the alert (i.e. name of the anomaly that was detected).
2668 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002669}
2670
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002671message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002672 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002673 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002674
2675 // The app package name.
2676 optional string pkg_name = 2;
2677
2678 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002679 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002680 WARM = 1;
2681 HOT = 2;
2682 COLD = 3;
2683 }
2684 // The transition type.
2685 optional TransitionType type = 3;
2686
2687 // The activity name.
2688 optional string activity_name = 4;
2689
2690 // The name of the calling app. Empty if not set.
2691 optional string calling_pkg_name = 5;
2692
2693 // Whether the app is an instant app.
2694 optional bool is_instant_app = 6;
2695
2696 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002697 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002698
Bookatz80d11a02018-01-16 10:46:35 -08002699 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002700
David Chen0b5c90c2018-01-25 16:51:49 -08002701 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002702 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002703 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002704 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002705 optional int32 bind_application_delay_millis = 11;
2706 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002707
2708 // Empty if not set.
2709 optional string launch_token = 13;
2710
Calin Juravle759fbda2018-02-20 19:52:30 +00002711 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002712 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002713
2714 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002715 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002716}
2717
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002718message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002719 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002720 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002721
2722 // The app package name.
2723 optional string pkg_name = 2;
2724
2725 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002726 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002727 WARM = 1;
2728 HOT = 2;
2729 COLD = 3;
2730 }
2731 // The transition type.
2732 optional TransitionType type = 3;
2733
2734 // The activity name.
2735 optional string activity_name = 4;
2736}
2737
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002738message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002739 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002740 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002741
2742 // The app package name.
2743 optional string pkg_name = 2;
2744
2745 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002746 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002747 WITH_BUNDLE = 1;
2748 WITHOUT_BUNDLE = 2;
2749 }
2750 // The transition type.
2751 optional TransitionType type = 3;
2752
2753 // The activity name.
2754 optional string activity_name = 4;
2755
2756 optional bool transition_process_running = 5;
2757
2758 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002759 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002760}
2761
Bookatz8fcd09a2017-12-18 13:01:10 -08002762/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002763 * Logs a picture-in-picture action
2764 * Logged from:
2765 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2766 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2767 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2768 */
2769message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002770 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002771 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002772
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002773 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002774
Chenjie Yu52cacc62017-12-08 18:11:45 -08002775 enum State {
2776 ENTERED = 1;
2777 EXPANDED_TO_FULL_SCREEN = 2;
2778 MINIMIZED = 3;
2779 DISMISSED = 4;
2780 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002781 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002782}
2783
2784/**
Chenjie Yue8904192017-12-08 19:12:57 -08002785 * Logs overlay action
2786 * Logged from:
2787 * services/core/java/com/android/server/wm/Session.java
2788 */
2789message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002790 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002791
2792 optional string package_name = 2;
2793
2794 optional bool using_alert_window = 3;
2795
2796 enum State {
2797 ENTERED = 1;
2798 EXITED = 2;
2799 }
2800 optional State state = 4;
2801}
2802
Chenjie Yuccfe6452018-01-30 11:33:21 -08002803/*
2804 * Logs foreground service starts and stops.
2805 * Note that this is not when a service starts or stops, but when it is
2806 * considered foreground.
2807 * Logged from
2808 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2809 */
2810message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002811 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002812 // package_name + "/" + class_name
2813 optional string short_name = 2;
2814
2815 enum State {
2816 ENTER = 1;
2817 EXIT = 2;
2818 }
2819 optional State state = 3;
2820}
2821
Chenjie Yue8904192017-12-08 19:12:57 -08002822/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002823 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2824 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2825 * attributed back to the parent (host) uid. One example is Chrome.
2826 *
2827 * Logged from:
2828 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2829 */
2830message IsolatedUidChanged {
2831 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002832 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002833 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002834 optional int32 parent_uid = 1;
2835
2836 optional int32 isolated_uid = 2;
2837
2838 // We expect an isolated uid to be removed before if it's used for another parent uid.
2839 enum Event {
2840 REMOVED = 0;
2841 CREATED = 1;
2842 }
2843 optional Event event = 3;
2844}
2845
2846/*
2847 * Logs the reception of an incoming network packet causing the main system to wake up for
2848 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2849 * and processed by WakeupController.cpp.
2850 */
2851message PacketWakeupOccurred {
2852 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2853 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002854 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002855 // The interface name on which the packet was received.
2856 optional string iface = 2;
2857 // The ethertype value of the packet.
2858 optional int32 ethertype = 3;
2859 // String representation of the destination MAC address of the packet.
2860 optional string destination_hardware_address = 4;
2861 // String representation of the source address of the packet if this was an IP packet.
2862 optional string source_ip = 5;
2863 // String representation of the destination address of the packet if this was an IP packet.
2864 optional string destination_ip = 6;
2865 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2866 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2867 // families.
2868 optional int32 ip_next_header = 7;
2869 // The source port if this was a TCP or UDP packet.
2870 optional int32 source_port = 8;
2871 // The destination port if this was a TCP or UDP packet.
2872 optional int32 destination_port = 9;
2873}
2874
2875/*
2876 * Logs the memory stats for an app on startup.
2877 * Logged from:
2878 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2879 */
2880message AppStartMemoryStateCaptured {
2881 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002882 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002883
2884 // The process name.
2885 optional string process_name = 2;
2886
2887 // The activity name.
2888 optional string activity_name = 3;
2889
2890 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002891 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002892
2893 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002894 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002895
2896 // RSS
2897 optional int64 rss_in_bytes = 6;
2898
2899 // CACHE
2900 optional int64 cache_in_bytes = 7;
2901
2902 // SWAP
2903 optional int64 swap_in_bytes = 8;
2904}
2905
2906/*
2907 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2908 * for LMK event.
2909 * Logged from:
2910 * system/core/lmkd/lmkd.c
2911 */
2912message LmkStateChanged {
2913 enum State {
2914 UNKNOWN = 0;
2915 START = 1;
2916 STOP = 2;
2917 }
2918 optional State state = 1;
2919}
2920
2921/*
2922 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2923 * Logged from:
2924 * system/core/lmkd/lmkd.c
2925 */
2926message LmkKillOccurred {
2927 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002928 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002929
2930 // The process name.
2931 optional string process_name = 2;
2932
2933 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002934 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002935
2936 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002937 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002938
2939 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002940 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002941
2942 // RSS
2943 optional int64 rss_in_bytes = 6;
2944
2945 // CACHE
2946 optional int64 cache_in_bytes = 7;
2947
2948 // SWAP
2949 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002950
2951 // The elapsed real time of start of the process.
2952 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002953}
2954
Rajeev Kumar51b54602018-03-01 12:18:26 -08002955/*
2956 * Logs when the ActivityManagerService detects that an app died.
2957 *
2958 * Logged from:
2959 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2960 */
2961message AppDied {
2962 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002963 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002964}
2965
Howard Ro21a039c2018-08-06 14:55:47 -07002966/**
2967 * An atom for generic metrics logging. Available from Android Q.
2968 */
2969message GenericAtom {
2970 // The uid of the application that sent this custom atom.
2971 optional int32 uid = 1 [(is_uid) = true];
2972
2973 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002974 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002975}
2976
Tej Singhd6d6d772018-09-05 17:41:25 -07002977/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002978 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002979 *
2980 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002981 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002982 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002983message BiometricAcquired {
2984 // Biometric modality that was acquired.
2985 optional android.hardware.biometrics.ModalityEnum modality = 1;
2986 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
2987 optional int32 user = 2;
2988 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
2989 optional bool is_crypto = 3;
2990 // Action that the device is performing. Acquired messages are only expected for enroll and
2991 // authenticate. Other actions may indicate an error.
2992 optional android.hardware.biometrics.ActionEnum action = 4;
2993 // The client that this acquisition was received for.
2994 optional android.hardware.biometrics.ClientEnum client = 5;
2995 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
2996 optional int32 acquire_info = 6;
2997 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
2998 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07002999}
3000
3001/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003002 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003003 *
3004 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003005 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003006 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003007message BiometricAuthenticated {
3008 // Biometric modality that was used.
3009 optional android.hardware.biometrics.ModalityEnum modality = 1;
3010 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3011 optional int32 user = 2;
3012 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3013 // storage.
3014 optional bool is_crypto = 3;
3015 // The client that this acquisition was received for.
3016 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003017 // If authentication requires user confirmation. See BiometricPrompt's
3018 // setRequireConfirmation(bool) method.
3019 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003020
Kevin Chyn1741a072019-01-17 11:54:40 -08003021 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003022 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003023 REJECTED = 1;
3024 PENDING_CONFIRMATION = 2;
3025 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003026 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003027
3028 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003029 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003030 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3031 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3032 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3033 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003034 optional int64 latency_millis = 7;
Kevin Chyn1741a072019-01-17 11:54:40 -08003035}
3036
3037/**
3038 * Logs when a biometric error occurs.
3039 *
3040 * Logged from:
3041 * frameworks/base/services/core/java/com/android/server/biometrics
3042 */
3043message BiometricErrorOccurred {
3044 // Biometric modality that was used.
3045 optional android.hardware.biometrics.ModalityEnum modality = 1;
3046 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3047 optional int32 user = 2;
3048 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3049 optional bool is_crypto = 3;
3050 // Action that the device is performing.
3051 optional android.hardware.biometrics.ActionEnum action = 4;
3052 // The client that this acquisition was received for.
3053 optional android.hardware.biometrics.ClientEnum client = 5;
3054 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3055 // are unique to modality.
3056 optional int32 error_info = 6;
3057 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3058 // by the vendor and not specified by the HIDL interface.
3059 optional int32 error_info_vendor = 7;
3060}
3061
3062/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003063 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003064 * Logged from:
3065 * frameworks/base/services/core/java/com/android/server/biometrics
3066 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003067message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003068 // Biometric modality.
3069 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003070 // Type of issue detected.
3071 optional android.hardware.biometrics.IssueEnum issue = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07003072}
Howard Ro688ae182018-09-25 00:09:36 -07003073
3074message Notification {
3075
3076 // Type of notification event.
3077 enum Type {
3078 TYPE_UNKNOWN = 0;
3079 // Notification became visible to the user.
3080 TYPE_OPEN = 1;
3081 // Notification became hidden.
3082 TYPE_CLOSE = 2;
3083 // Notification switched to detail mode.
3084 TYPE_DETAIL = 3;
3085 // Notification was clicked.
3086 TYPE_ACTION = 4;
3087 // Notification was dismissed.
3088 TYPE_DISMISS = 5;
3089 // Notification switched to summary mode. The enum value of 14 is to
3090 // match that of metrics_constants.
3091 TYPE_COLLAPSE = 14;
3092 }
3093 optional Type type = 1;
3094
3095 // Package name associated with the notification.
3096 optional string package_name = 2;
3097
3098 // Tag associated with notification.
3099 optional string tag = 3;
3100
3101 // Application-supplied ID associated with the notification.
3102 optional int32 id = 4;
3103
3104 // Index of notification in the notification panel.
3105 optional int32 shade_index = 5;
3106
3107 // The number of notifications in the notification panel.
3108 optional int32 shade_count = 6;
3109
3110 // Importance for the notification.
3111 optional int32 importance = 7;
3112
3113 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07003114 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07003115
3116 // Importance for the notification channel.
3117 optional int32 channel_importance = 9;
3118
Howard Ro183c2bd2018-10-18 13:52:10 -07003119 // Application-supplied ID associated with the notifications group.
3120 optional string group_id = 10;
3121
Howard Ro688ae182018-09-25 00:09:36 -07003122 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07003123 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07003124
Howard Ro183c2bd2018-10-18 13:52:10 -07003125 // Reason for dismissal of a notification. This field is only meaningful for
3126 // TYPE_DISMISS events.
3127 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07003128
Howard Ro183c2bd2018-10-18 13:52:10 -07003129 // The first post time of notification, stable across updates.
3130 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07003131
Howard Ro183c2bd2018-10-18 13:52:10 -07003132 // The most recent interruption time, or the creation time if no updates.
3133 // Differs from update_millis because updates are filtered based on whether
3134 // they actually interrupted the user.
3135 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07003136
Howard Ro183c2bd2018-10-18 13:52:10 -07003137 // The most recent update time, or the creation time if no updates.
3138 optional int64 update_millis = 15;
3139
3140 // The most recent visibility event.
3141 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07003142}
3143
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003144/*
Tej Singh0d176952019-01-16 19:10:54 -08003145 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003146 */
Tej Singh0d176952019-01-16 19:10:54 -08003147message FlagFlipUpdateOccurred {
3148 // If the event is from a flag config package, specify the package name.
3149 optional string flag_flip_package_name = 1;
3150
3151 // The order id of the package
3152 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003153}
3154
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003155/**
3156 * Potential experiment ids that goes with a train install.
3157 */
3158message TrainExperimentIds {
3159 repeated int64 experiment_id = 1;
3160}
3161
Yangster-macb89807e2018-11-15 21:10:57 -08003162/*
3163 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003164 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003165 */
3166message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003167 // Name of the train.
3168 optional string train_name = 1;
3169 // Version code for a "train" of packages that need to be installed atomically
3170 optional int64 train_version_code = 2;
3171 // After installation of this package, device requires a restart.
3172 optional bool requires_staging = 3;
3173 // Rollback should be enabled for this install.
3174 optional bool rollback_enabled = 4;
3175 // Requires low latency monitoring if possible.
3176 optional bool requires_low_latency_monitor = 5;
3177
Yangster-macb89807e2018-11-15 21:10:57 -08003178 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003179 UNKNOWN = 0;
3180 INSTALL_REQUESTED = 1;
3181 INSTALL_STARTED = 2;
3182 INSTALL_STAGED_NOT_READY = 3;
3183 INSTALL_STAGED_READY = 4;
3184 INSTALL_SUCCESS = 5;
3185 INSTALL_FAILURE = 6;
3186 INSTALL_CANCELLED = 7;
3187 INSTALLER_ROLLBACK_REQUESTED = 8;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003188 INSTALLER_ROLLBACK_SUCCESS = 9;
3189 INSTALLER_ROLLBACK_FAILURE = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08003190 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003191 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003192 // Possible experiment ids for monitoring this push.
3193 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3194 // user id
3195 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003196}
3197
Maggie Whitefc1aa592018-11-28 21:55:23 -08003198/** Represents USB port overheat event. */
3199message UsbPortOverheatEvent {
3200 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3201 optional int32 plug_temperature_deci_c = 1;
3202
3203 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3204 optional int32 max_temperature_deci_c = 2;
3205
3206 /* Time between USB plug event and overheat threshold trip, in seconds. */
3207 optional int32 time_to_overheat_secs = 3;
3208
3209 /* Time between overheat threshold trip and hysteresis, in seconds. */
3210 optional int32 time_to_hysteresis_secs = 4;
3211
3212 /* Time between hysteresis and active mitigation ending, in seconds. */
3213 optional int32 time_to_inactive_secs = 5;
3214};
3215
Maggie White8735b852019-01-18 11:40:49 -08003216/**
3217 * Logs total effective full charge and discharge cycles on a battery.
3218 * Here are some examples of one effective cycle:
3219 * 1) the battery charges from 0% to 100% and drains back to 0%,
3220 * 2) charging from 50% to 100% and draining back to 50% twice.
3221 * Pulled from:
3222 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3223 */
3224message BatteryCycleCount {
3225 /* Number of total charge and discharge cycles on the system battery. */
3226 optional int32 cycle_count = 1;
3227}
3228
Yangster-macb89807e2018-11-15 21:10:57 -08003229/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003230 * Logs when a connection becomes available and lost.
3231 * Logged in StatsCompanionService.java
3232 */
3233message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003234 // Id of the network.
3235 optional int32 net_id = 1;
3236
3237 enum State {
3238 UNKNOWN = 0;
3239 CONNECTED = 1;
3240 DISCONNECTED = 2;
3241 }
3242 // Connected state of a network.
3243 optional State state = 2;
3244}
3245
3246/**
3247 * Logs when a service starts and stops.
3248 * Logged from:
3249 * services/core/java/com/android/server/am/ActiveServices.java
3250 */
3251message ServiceStateChanged {
3252
3253 optional int32 uid = 1 [(is_uid) = true];
3254
3255 optional string package_name = 2;
3256
3257 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003258
3259 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003260 START = 1;
3261 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003262 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003263
3264 optional State state = 4;
3265}
3266
3267/**
3268 * Logs when a service is launched.
3269 * Logged from:
3270 * services/core/java/com/android/server/am/ActiveServices.java
3271 */
3272message ServiceLaunchReported {
3273
3274 optional int32 uid = 1 [(is_uid) = true];
3275
3276 optional string package_name = 2;
3277
3278 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003279}
Howard Ro688ae182018-09-25 00:09:36 -07003280
Chenjie Yubbcbc602018-02-05 16:51:52 -08003281//////////////////////////////////////////////////////////////////////
3282// Pulled atoms below this line //
3283//////////////////////////////////////////////////////////////////////
3284
3285/**
David Chenc8a43242017-10-17 16:23:28 -07003286 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3287 *
3288 * Pulled from:
3289 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3290 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003291message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003292 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003293
3294 optional int64 rx_bytes = 2;
3295
3296 optional int64 rx_packets = 3;
3297
3298 optional int64 tx_bytes = 4;
3299
3300 optional int64 tx_packets = 5;
3301}
3302
3303/**
3304 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3305 *
3306 * Pulled from:
3307 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3308 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003309message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003310 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003311
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003312 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3313 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003314
3315 optional int64 rx_bytes = 3;
3316
3317 optional int64 rx_packets = 4;
3318
3319 optional int64 tx_bytes = 5;
3320
3321 optional int64 tx_packets = 6;
3322}
3323
3324/**
3325 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3326 *
3327 * Pulled from:
3328 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3329 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003330message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003331 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003332
3333 optional int64 rx_bytes = 2;
3334
3335 optional int64 rx_packets = 3;
3336
3337 optional int64 tx_bytes = 4;
3338
3339 optional int64 tx_packets = 5;
3340}
3341
3342/**
3343 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3344 *
3345 * Pulled from:
3346 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3347 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003348message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003349 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003350
Yao Chenc40a19d2018-03-15 16:48:25 -07003351 // 1 denotes foreground and 0 denotes background. This is called Set in
3352 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003353 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003354
3355 optional int64 rx_bytes = 3;
3356
3357 optional int64 rx_packets = 4;
3358
3359 optional int64 tx_bytes = 5;
3360
3361 optional int64 tx_packets = 6;
3362}
3363
3364/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003365 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3366 *
3367 * Pulled from:
3368 * StatsCompanionService
3369 */
3370message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003371 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003372
3373 optional int64 rx_bytes = 2;
3374
3375 optional int64 tx_bytes = 3;
3376}
3377
3378/**
David Chenc8a43242017-10-17 16:23:28 -07003379 * Pulls the kernel wakelock durations. This atom is adapted from
3380 * android/internal/os/KernelWakelockStats.java
3381 *
3382 * Pulled from:
3383 * StatsCompanionService using KernelWakelockReader.
3384 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003385message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003386 optional string name = 1;
3387
3388 optional int32 count = 2;
3389
3390 optional int32 version = 3;
3391
Yangster-maca8a30442018-10-13 23:46:34 -07003392 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003393}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003394
Chenjie Yu05013b32017-11-21 10:21:41 -08003395/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003396 * Pulls low power state information. If power.stats HAL is not available, this
3397 * includes platform and subsystem sleep state information,
3398 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3399 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003400 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003401 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003402 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3403 * as defined in:
3404 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003405 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003406message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003407 // Subsystem name
3408 optional string subsystem_name = 1;
3409 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3410 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003411 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3412 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003413 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003414 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003415 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003416 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003417 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003418}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003419
Chenjie Yu05013b32017-11-21 10:21:41 -08003420/**
Bookatz92da2832018-11-01 18:10:03 -07003421 * Pulls on-device power measurement information.
3422 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3423 * Pulled from:
3424 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3425 */
3426message OnDevicePowerMeasurement {
3427 // Name of the subsystem (to which the rail belongs).
3428 optional string subsystem_name = 1;
3429
3430 // Rail name. The rail lies within the subsystem.
3431 optional string rail_name = 2;
3432
3433 // Time (in ms since boot) at which the rail energy value was measured.
3434 // This may differ slightly from the time that statsd logs this information.
3435 optional uint64 measurement_timestamp_millis = 3;
3436
3437 // Accumulated energy used via the rail since device boot in uWs.
3438 optional uint64 energy_microwatt_secs = 4;
3439}
3440
3441/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003442 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003443 * Pulls the time the cpu spend on the frequency index. Frequency index
3444 * starts from highest to lowest. The value should be monotonically
3445 * increasing since boot. However, if there is a cpu
3446 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003447 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003448message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003449 optional uint32 cluster = 1;
3450 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003451 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003452}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003453
Chenjie Yu05013b32017-11-21 10:21:41 -08003454/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003455 * Pulls Cpu Time Per Uid.
3456 * Note that isolated process uid time should be attributed to host uids.
3457 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003458message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003459 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003460 optional uint64 user_time_micros = 2;
3461 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003462}
3463
3464/**
3465 * Pulls Cpu Time Per Uid per frequency.
3466 * Note that isolated process uid time should be attributed to host uids.
3467 * For each uid, we order the time by descending frequencies.
3468 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003469message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003470 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003471 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003472 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003473}
Hugo Benichi884970e2017-11-14 22:42:46 +09003474
Chenjie Yu05013b32017-11-21 10:21:41 -08003475/**
3476 * Pulls Wifi Controller Activity Energy Info
3477 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003478message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003479 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003480 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003481 // stack reported state
3482 // TODO: replace this with proto enum
3483 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003484 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003485 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003486 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003487 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003488 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003489 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003490 // product of current(mA), voltage(V) and time(ms)
3491 optional uint64 controller_energy_used = 6;
3492}
3493
3494/**
3495 * Pulls Modem Activity Energy Info
3496 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003497message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003498 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003499 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003500 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003501 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003502 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003503 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003504 /**
3505 * Tx power index
3506 * index 0 = tx_power < 0dBm
3507 * index 1 = 0dBm < tx_power < 5dBm
3508 * index 2 = 5dBm < tx_power < 15dBm
3509 * index 3 = 15dBm < tx_power < 20dBm
3510 * index 4 = tx_power > 20dBm
3511 */
3512 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003513 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003514 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003515 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003516 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003517 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003518 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003519 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003520 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003521 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003522 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003523 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003524 // product of current(mA), voltage(V) and time(ms)
3525 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003526}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003527
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003528/**
3529 * Pulls Bluetooth Activity Energy Info
3530 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3531 */
3532message BluetoothActivityInfo {
3533 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003534 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003535 // bluetooth stack state
3536 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003537 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003538 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003539 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003540 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003541 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003542 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003543 // product of current(mA), voltage(V) and time(ms)
3544 optional uint64 energy_used = 6;
3545}
3546
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003547/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003548 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003549 *
3550 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003551 */
3552message ProcessMemoryState {
3553 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003554 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003555
3556 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003557 // Usually package name, "system" for system server.
3558 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003559 optional string process_name = 2;
3560
Rafal Slawikda51b932018-12-13 16:31:33 +00003561 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003562 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003563
3564 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003565 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003566
3567 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003568 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003569
Rajeev Kumar90235992018-01-29 11:06:48 -08003570 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003571 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3572 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003573 optional int64 rss_in_bytes = 6;
3574
3575 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003576 // Value is read from memory.stat, field total_cache if per-app memory
3577 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003578 optional int64 cache_in_bytes = 7;
3579
3580 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003581 // Value is read from memory.stat, field total_swap if per-app memory
3582 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003583 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003584
Rafal Slawikd03ae422018-11-20 11:27:45 +00003585 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003586 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003587
3588 // Elapsed real time when the process started.
3589 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3590 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003591}
3592
3593/*
Rafal Slawik08621582018-10-15 14:53:07 +01003594 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003595 *
3596 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003597 */
3598message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003599 // The uid if available. -1 means not available.
3600 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003601
Rafal Slawikbf67d072018-10-23 11:07:54 +01003602 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003603 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003604 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003605
Rafal Slawikbf67d072018-10-23 11:07:54 +01003606 // # of page-faults
3607 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003608
Rafal Slawikbf67d072018-10-23 11:07:54 +01003609 // # of major page-faults
3610 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003611
Rafal Slawikbf67d072018-10-23 11:07:54 +01003612 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003613 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003614 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003615
Rafal Slawikd03ae422018-11-20 11:27:45 +00003616 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003617 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003618
3619 // Elapsed real time when the process started.
3620 // Value is read from /proc/PID/stat, field 22.
3621 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003622}
3623
3624/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003625 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003626 *
3627 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3628 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003629 *
3630 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003631 */
3632message ProcessMemoryHighWaterMark {
3633 // The uid if available. -1 means not available.
3634 optional int32 uid = 1 [(is_uid) = true];
3635
Rafal Slawikda51b932018-12-13 16:31:33 +00003636 // The process name.
3637 // Usually package name or process cmdline.
3638 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003639 optional string process_name = 2;
3640
3641 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3642 // /proc/PID/status.
3643 optional int64 rss_high_water_mark_in_bytes = 3;
3644}
3645
3646/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003647 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003648 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003649message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003650 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003651}
3652
3653/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003654 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003655 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003656message SystemUptime {
3657 // Milliseconds since the system was booted.
3658 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3659 // for external input).
3660 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003661 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003662}
3663
3664/*
3665 * Reads from /proc/uid_concurrent_active_time which has the format:
3666 * active: X (X is # cores)
3667 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3668 * [uid1]: [time-0] [time-1] [time-2] ... ...
3669 * ...
3670 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3671 * The file contains a monotonically increasing count of time for a single boot.
3672 */
3673message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003674 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003675 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003676}
3677
3678/**
3679 * Reads from /proc/uid_concurrent_policy_time which has the format:
3680 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3681 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3682 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3683 * ...
3684 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3685 * The file contains a monotonically increasing count of time for a single boot.
3686 */
3687message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003688 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003689 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003690 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003691}
3692
3693/*
3694 * Pulls free disk space, for data, system partition and temporary directory.
3695 */
3696message DiskSpace {
3697 // available bytes in data partition
3698 optional uint64 data_available_bytes = 1;
3699 // available bytes in system partition
3700 optional uint64 system_available_bytes = 2;
3701 // available bytes in download cache or temp directories
3702 optional uint64 temp_available_bytes = 3;
3703}
Tej Singhbf972d92018-01-10 20:51:13 -08003704
3705/**
3706 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003707 *
3708 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003709 */
3710message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003711 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003712}
3713
3714/**
3715 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003716 * Pulled from:
3717 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003718 */
3719message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003720 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003721}
3722
3723/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003724 * Pulls battery voltage.
3725 * Pulled from:
3726 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3727 */
3728message BatteryVoltage {
3729 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003730 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003731}
3732
3733/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003734 * Pulls battery level (percent full, from 0 to 100).
3735 *
3736 * Pulled from:
3737 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3738 */
3739message BatteryLevel {
3740 // Battery level. Should be in [0, 100].
3741 optional int32 battery_level = 1;
3742}
3743
3744/**
Tej Singhd89137e2018-03-26 14:51:40 -07003745 * Pulls the temperature of various parts of the device.
3746 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003747 *
3748 * Pulled from:
3749 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3750 */
3751message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003752 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003753 optional android.os.TemperatureTypeEnum sensor_location = 1;
3754
3755 // The name of the temperature source. Eg. CPU0
3756 optional string sensor_name = 2;
3757
Tej Singhd89137e2018-03-26 14:51:40 -07003758 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003759 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003760 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003761}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003762
3763/**
3764 * Pulls the statistics of calls to Binder.
3765 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003766 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3767 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003768 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003769 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003770 */
3771message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003772 // UID of the process responsible for the binder transaction. It will be set if the process
3773 // executing the binder transaction attribute the transaction to another uid using
3774 // Binder.setThreadWorkSource().
3775 //
3776 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003777 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003778 // UID of the process executing the binder transaction.
3779 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003780 // Fully qualified class name of the API call.
3781 //
3782 // This is a system server class name.
3783 //
3784 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3785 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3786 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3787 // commonly used APIs.
3788 optional string service_class_name = 2;
3789 // Method name of the API call. It can also be a transaction code if we cannot
3790 // resolve it to a name. See Binder#getTransactionName.
3791 //
3792 // This is a system server method name.
3793 optional string service_method_name = 3;
3794 // Total number of API calls.
3795 optional int64 call_count = 4;
3796 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3797 optional bool screen_interactive = 13;
3798 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3799 // call_count will be equal to recorded_call_count.
3800 //
3801 // If recorded_call_count is different than call_count, it means data collection has been
3802 // sampled. All the fields below will be sampled in this case.
3803 optional int64 recorded_call_count = 12;
3804 // Number of exceptions thrown by the API.
3805 optional int64 recorded_exception_count = 5;
3806 // Total latency of all API calls.
3807 // Average can be computed using total_latency_micros / recorded_call_count.
3808 optional int64 recorded_total_latency_micros = 6;
3809 // Maximum latency of one API call.
3810 optional int64 recorded_max_latency_micros = 7;
3811 // Total CPU usage of all API calls.
3812 // Average can be computed using total_cpu_micros / recorded_call_count.
3813 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3814 optional int64 recorded_total_cpu_micros = 8;
3815 // Maximum CPU usage of one API call.
3816 optional int64 recorded_max_cpu_micros = 9;
3817 // Maximum parcel reply size of one API call.
3818 optional int64 recorded_max_reply_size_bytes = 10;
3819 // Maximum parcel request size of one API call.
3820 optional int64 recorded_max_request_size_bytes = 11;
3821}
3822
3823/**
3824 * Pulls the statistics of exceptions during calls to Binder.
3825 *
3826 * Binder stats are cumulative from boot unless somebody reset the data using
3827 * > adb shell dumpsys binder_calls_stats --reset
3828 */
3829message BinderCallsExceptions {
3830 // Exception class name, e.g. java.lang.IllegalArgumentException.
3831 //
3832 // This is an exception class name thrown by the system server.
3833 optional string exception_class_name = 1;
3834 // Total number of exceptions.
3835 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003836}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003837
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003838/**
3839 * Pulls the statistics of message dispatching on HandlerThreads.
3840 *
3841 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3842 * config on the device.
3843 *
3844 * Next tag: 11
3845 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003846message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003847 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003848 optional int32 uid = 1 [(is_uid) = true];
3849
3850 // Fully qualified class name of the handler target class.
3851 //
3852 // This field does not contain PII. This is a system server class name.
3853 optional string handler_class_name = 2;
3854
3855 // The name of the thread that runs the Looper.
3856 //
3857 // This field does not contain PII. This is a system server thread name.
3858 optional string looper_thread_name = 3;
3859
3860 // The name of the dispatched message.
3861 //
3862 // This field does not contain PII. This is a system server constant or class
3863 // name.
3864 optional string message_name = 4;
3865
3866 // Total number of successfully dispatched messages.
3867 optional int64 message_count = 5;
3868
3869 // Total number of messages that failed dispatching.
3870 optional int64 exception_count = 6;
3871
3872 // Total number of processed messages we have data recorded for. If we
3873 // collected data for all the messages, message_count will be equal to
3874 // recorded_message_count.
3875 //
3876 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003877 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003878 optional int64 recorded_message_count = 7;
3879
3880 // Total latency of all processed messages.
3881 // Average can be computed using recorded_total_latency_micros /
3882 // recorded_message_count.
3883 optional int64 recorded_total_latency_micros = 8;
3884
3885 // Total CPU usage of all processed message.
3886 // Average can be computed using recorded_total_cpu_micros /
3887 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003888 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003889 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003890
3891 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3892 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003893
3894 // Max recorded CPU usage of all processed messages.
3895 optional int64 recorded_max_cpu_micros = 11;
3896
3897 // Max recorded latency of all processed messages.
3898 optional int64 recorded_max_latency_micros = 12;
3899
3900 // Total number of messages we tracked the dispatching delay for. If we
3901 // collected data for all the messages, message_count will be equal to
3902 // recorded_delay_message_count.
3903 //
3904 // If recorded_delay_message_count is different than message_count, it means data
3905 // collection has been sampled or/and not all messages specified the target dispatch time.
3906 // The fields below will be sampled in this case.
3907 optional int64 recorded_delay_message_count = 13;
3908
3909 // Total dispatching delay of all processed messages.
3910 // Calculated as a difference between the target dispatching time (Message.when)
3911 // and the actual dispatching time.
3912 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3913 optional int64 recorded_total_delay_millis = 14;
3914
3915 // Max dispatching delay of all processed messages.
3916 // Calculated as a difference between the target dispatching time (Message.when)
3917 // and the actual dispatching time.
3918 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003919}
Tej Singh86dc9db2018-09-06 00:39:57 +00003920
3921/**
3922 * Pulls disk information, such as write speed and latency.
3923 */
3924message DiskStats {
3925 // Time taken to open, write 512B to, and close a file.
3926 // -1 if error performing the check.
3927 optional int64 data_write_latency_millis = 1;
3928
3929 optional bool file_based_encryption = 2;
3930
3931 // Recent disk write speed in kB/s.
3932 // -1 if error querying storageed.
3933 // 0 if data is unavailable.
3934 optional int32 recent_disk_write_speed = 3;
3935}
3936
3937
3938/**
3939 * Free and total bytes of the Data, Cache, and System partition.
3940 */
3941message DirectoryUsage {
3942 enum Directory {
3943 UNKNOWN = 0;
3944 DATA = 1;
3945 CACHE = 2;
3946 SYSTEM = 3;
3947 }
3948 optional Directory directory = 1;
3949 optional int64 free_bytes = 2;
3950 optional int64 total_bytes = 3;
3951}
3952
3953
3954/**
3955 * Size of an application: apk size, data size, and cache size.
3956 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3957 * Information is only reported for apps with the primary user (user 0).
3958 * Sizes are aggregated by package name.
3959 */
3960message AppSize {
3961 // Including uids will involve modifying diskstats logic.
3962 optional string package_name = 1;
3963 // App size in bytes. -1 if unavailable.
3964 optional int64 app_size_bytes = 2;
3965 // App data size in bytes. -1 if unavailable.
3966 optional int64 app_data_size_bytes = 3;
3967 // App cache size in bytes. -1 if unavailable.
3968 optional int64 app_cache_size_bytes = 4;
3969 // Time that the cache file was produced.
3970 // Uses System.currentTimeMillis(), which is wall clock time.
3971 optional int64 cache_time_millis = 5;
3972}
3973
3974
3975/**
3976 * Size of a particular category. Eg: photos, videos.
3977 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3978 */
3979message CategorySize {
3980 enum Category {
3981 UNKNOWN = 0;
3982 APP_SIZE = 1;
3983 APP_DATA_SIZE = 2;
3984 APP_CACHE_SIZE = 3;
3985 PHOTOS = 4;
3986 VIDEOS = 5;
3987 AUDIO = 6;
3988 DOWNLOADS = 7;
3989 SYSTEM = 8;
3990 OTHER = 9;
3991 }
3992 optional Category category = 1;
3993 // Category size in bytes.
3994 optional int64 size_bytes = 2;
3995 // Time that the cache file was produced.
3996 // Uses System.currentTimeMillis(), which is wall clock time.
3997 optional int64 cache_time_millis = 3;
3998}
Tej Singhd6d6d772018-09-05 17:41:25 -07003999
4000/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004001 * Pulls per uid I/O stats. The stats are cumulative since boot.
4002 *
4003 * Read/write bytes are I/O events from a storage device
4004 * Read/write chars are data requested by read/write syscalls, and can be
4005 * satisfied by caching.
4006 *
4007 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4008 */
4009message DiskIo {
4010 optional int32 uid = 1 [(is_uid) = true];
4011 optional int64 fg_chars_read = 2;
4012 optional int64 fg_chars_write = 3;
4013 optional int64 fg_bytes_read = 4;
4014 optional int64 fg_bytes_write = 5;
4015 optional int64 bg_chars_read = 6;
4016 optional int64 bg_chars_write = 7;
4017 optional int64 bg_bytes_read = 8;
4018 optional int64 bg_bytes_write = 9;
4019 optional int64 fg_fsync = 10;
4020 optional int64 bg_fsync= 11;
4021}
4022
4023
4024/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004025 * Pulls the number of fingerprints for each user.
4026 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004027 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004028 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004029message NumBiometricsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004030 // The associated user. Eg: 0 for owners, 10+ for others.
4031 // Defined in android/os/UserHandle.java
4032 optional int32 user = 1;
4033 // Number of fingerprints registered to that user.
Kevin Chyn1741a072019-01-17 11:54:40 -08004034 optional int32 num_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004035}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004036
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004037/**
4038 * A mapping of role holder -> role
4039 */
4040message RoleHolder {
4041 // uid of the role holder
4042 optional int32 uid = 1 [(is_uid) = true];
4043
4044 // package name of the role holder
4045 optional string package_name = 2;
4046
4047 // the role held
4048 optional string role = 3;
4049}
4050
Yangsteraf9aee72018-10-12 09:26:16 -07004051message AggStats {
4052 optional int64 min = 1;
4053
4054 optional int64 average = 2;
4055
4056 optional int64 max = 3;
4057}
4058
4059message ProcessStatsStateProto {
4060 optional android.service.procstats.ScreenState screen_state = 1;
4061
4062 optional android.service.procstats.MemoryState memory_state = 2;
4063
4064 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4065 // and not frameworks/base/core/java/android/app/ActivityManager.java
4066 optional android.service.procstats.ProcessState process_state = 3;
4067
4068 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004069 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004070
4071 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004072 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004073
4074 // # of samples taken
4075 optional int32 sample_size = 5;
4076
4077 // PSS is memory reserved for this process
4078 optional AggStats pss = 6;
4079
4080 // USS is memory shared between processes, divided evenly for accounting
4081 optional AggStats uss = 7;
4082
4083 // RSS is memory resident for this process
4084 optional AggStats rss = 8;
4085}
4086
4087// Next Tag: 7
4088message ProcessStatsProto {
4089 // Name of process.
4090 optional string process = 1;
4091
4092 // Uid of the process.
4093 optional int32 uid = 2;
4094
4095 // Information about how often kills occurred
4096 message Kill {
4097 // Count of excessive CPU kills
4098 optional int32 cpu = 1;
4099
4100 // Count of kills when cached
4101 optional int32 cached = 2;
4102
4103 // PSS stats during cached kill
4104 optional AggStats cached_pss = 3;
4105 }
4106 optional Kill kill = 3;
4107
4108 // Time and memory spent in various states.
4109 repeated ProcessStatsStateProto states = 5;
4110
4111 // Total time process has been running... screen_state, memory_state, and process_state
4112 // will not be set.
4113 optional ProcessStatsStateProto total_running_state = 6;
4114}
4115
4116message PackageServiceOperationStatsProto {
4117 // Operate enum: Started, Foreground, Bound, Executing
4118 optional android.service.procstats.ServiceOperationState operation = 1;
4119
4120 // Number of times the service was in this operation.
4121 optional int32 count = 2;
4122
4123 // Information about a state the service can be in.
4124 message StateStats {
4125 // Screen state enum.
4126 optional android.service.procstats.ScreenState screen_state = 1;
4127 // Memory state enum.
4128 optional android.service.procstats.MemoryState memory_state = 2;
4129
4130 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004131 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004132 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004133 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004134 }
4135 repeated StateStats state_stats = 3;
4136}
4137
4138message PackageServiceStatsProto {
4139 // Name of service component.
4140 optional string service_name = 1;
4141
4142 // The operation stats.
4143 // The package_name, package_uid, package_version, service_name will not be set to save space.
4144 repeated PackageServiceOperationStatsProto operation_stats = 2;
4145}
4146
4147message PackageAssociationSourceProcessStatsProto {
4148 // Uid of the process.
4149 optional int32 process_uid = 1;
4150 // Process name.
4151 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004152 // Package name.
4153 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004154 // Total count of the times this association appeared.
4155 optional int32 total_count = 3;
4156
4157 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004158 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004159
4160 // Total count of the times this association became actively impacting its target process.
4161 optional int32 active_count = 5;
4162
4163 // Information on one source in this association.
4164 message StateStats {
4165 // Process state enum.
4166 optional android.service.procstats.ProcessState process_state = 1;
4167 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004168 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004169 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004170 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004171 }
4172 repeated StateStats active_state_stats = 6;
4173}
4174
4175message PackageAssociationProcessStatsProto {
4176 // Name of the target component.
4177 optional string component_name = 1;
4178 // Information on one source in this association.
4179 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4180}
4181
4182
4183message ProcessStatsPackageProto {
4184 // Name of package.
4185 optional string package = 1;
4186
4187 // Uid of the package.
4188 optional int32 uid = 2;
4189
4190 // Version of the package.
4191 optional int64 version = 3;
4192
4193 // Stats for each process running with the package loaded in to it.
4194 repeated ProcessStatsProto process_stats = 4;
4195
4196 // Stats for each of the package's services.
4197 repeated PackageServiceStatsProto service_stats = 5;
4198
4199 // Stats for each association with the package.
4200 repeated PackageAssociationProcessStatsProto association_stats = 6;
4201}
4202
4203message ProcessStatsSectionProto {
4204 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004205 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004206
4207 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004208 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004209
4210 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004211 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004212
4213 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004214 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004215
4216 // System runtime library. e.g. "libdvm.so", "libart.so".
4217 optional string runtime = 5;
4218
4219 // whether kernel reports swapped pss.
4220 optional bool has_swapped_pss = 6;
4221
4222 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4223 enum Status {
4224 STATUS_UNKNOWN = 0;
4225 STATUS_COMPLETE = 1;
4226 STATUS_PARTIAL = 2;
4227 STATUS_SHUTDOWN = 3;
4228 STATUS_SYSPROPS = 4;
4229 }
4230 repeated Status status = 7;
4231
Chenjie Yub2ecc792019-01-17 10:27:26 -08004232 // Number of pages available of various types and sizes, representation fragmentation.
4233 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4234
Yangsteraf9aee72018-10-12 09:26:16 -07004235 // Stats for each process.
4236 repeated ProcessStatsProto process_stats = 8;
4237
4238 // Stats for each package.
4239 repeated ProcessStatsPackageProto package_stats = 9;
4240}
4241
Chenjie Yub2ecc792019-01-17 10:27:26 -08004242message ProcessStatsAvailablePagesProto {
4243 // Node these pages are in (as per /proc/pagetypeinfo)
4244 optional int32 node = 1;
4245
4246 // Zone these pages are in (as per /proc/pagetypeinfo)
4247 optional string zone = 2;
4248
4249 // Label for the type of these pages (as per /proc/pagetypeinfo)
4250 optional string label = 3;
4251
4252 // Distribution of number of pages available by order size. First entry in array is
4253 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4254 repeated int32 pages_per_order = 4;
4255}
4256
Chenjie Yu12e5e672018-09-14 15:54:59 -07004257/**
4258 * Pulled from ProcessStatsService.java
4259 */
4260message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004261 optional ProcessStatsSectionProto proc_stats_section = 1;
4262}
4263
Chenjie Yuf910b7802019-01-11 16:08:20 -08004264/**
4265 * Pulled from ProcessStatsService.java
4266 */
4267message ProcStatsPkgProc {
4268 optional ProcessStatsSectionProto proc_stats_section = 1;
4269}
4270
Yangsteraf9aee72018-10-12 09:26:16 -07004271message PowerProfileProto {
4272 optional double cpu_suspend = 1;
4273
4274 optional double cpu_idle = 2;
4275
4276 optional double cpu_active = 3;
4277
4278 message CpuCluster {
4279 optional int32 id = 1;
4280 optional double cluster_power = 2;
4281 optional int32 cores = 3;
4282 repeated int64 speed = 4;
4283 repeated double core_power = 5;
4284 }
4285
4286 repeated CpuCluster cpu_cluster = 40;
4287
4288 optional double wifi_scan = 4;
4289
4290 optional double wifi_on = 5;
4291
4292 optional double wifi_active = 6;
4293
4294 optional double wifi_controller_idle = 7;
4295
4296 optional double wifi_controller_rx = 8;
4297
4298 optional double wifi_controller_tx = 9;
4299
4300 repeated double wifi_controller_tx_levels = 10;
4301
4302 optional double wifi_controller_operating_voltage = 11;
4303
4304 optional double bluetooth_controller_idle = 12;
4305
4306 optional double bluetooth_controller_rx = 13;
4307
4308 optional double bluetooth_controller_tx = 14;
4309
4310 optional double bluetooth_controller_operating_voltage = 15;
4311
4312 optional double modem_controller_sleep = 16;
4313
4314 optional double modem_controller_idle = 17;
4315
4316 optional double modem_controller_rx = 18;
4317
4318 repeated double modem_controller_tx = 19;
4319
4320 optional double modem_controller_operating_voltage = 20;
4321
4322 optional double gps_on = 21;
4323
4324 repeated double gps_signal_quality_based = 22;
4325
4326 optional double gps_operating_voltage = 23;
4327
4328 optional double bluetooth_on = 24;
4329
4330 optional double bluetooth_active = 25;
4331
4332 optional double bluetooth_at_cmd = 26;
4333
4334 optional double ambient_display = 27;
4335
4336 optional double screen_on = 28;
4337
4338 optional double radio_on = 29;
4339
4340 optional double radio_scanning = 30;
4341
4342 optional double radio_active = 31;
4343
4344 optional double screen_full = 32;
4345
4346 optional double audio = 33;
4347
4348 optional double video = 34;
4349
4350 optional double flashlight = 35;
4351
4352 optional double memory = 36;
4353
4354 optional double camera = 37;
4355
4356 optional double wifi_batched_scan = 38;
4357
4358 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004359}
Chenjie Yuab530202018-09-26 12:39:20 -07004360
4361/**
4362 * power_profile.xml and other constants for power model calculations.
4363 * Pulled from PowerProfile.java
4364 */
4365message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004366 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004367}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004368
4369/**
arangelovd5db50e2018-10-12 20:24:39 +01004370 * Logs when a user restriction was added or removed.
4371 *
4372 * Logged from:
4373 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4374 */
4375message UserRestrictionChanged {
4376 // The raw string of the user restriction as defined in UserManager.
4377 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4378 optional string restriction = 1;
4379 // Whether the restriction is enabled or disabled.
4380 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004381}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004382
4383/**
4384 * Pulls process user time and system time. Puller takes a snapshot of all pids
4385 * in the system and returns cpu stats for those that are working at the time.
4386 * Dead pids will be dropped. Kernel processes are excluded.
4387 * Min cool-down is 5 sec.
4388 */
4389message ProcessCpuTime {
4390 optional int32 uid = 1 [(is_uid) = true];
4391
4392 optional string process_name = 2;
4393 // Process cpu time in user space, cumulative from boot/process start
4394 optional int64 user_time_millis = 3;
4395 // Process cpu time in system space, cumulative from boot/process start
4396 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004397}
Misha Wagner5a51e002018-10-03 15:04:09 +01004398
4399/**
4400 * Pulls the CPU usage for each thread.
4401 *
4402 * Read from /proc/$PID/task/$TID/time_in_state files.
4403 *
4404 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4405 * time_in_state files not being present on some phones, have not been addressed. These should be
4406 * considered before a public release.
4407 */
4408message CpuTimePerThreadFreq {
4409 // UID that owns the process.
4410 optional int32 uid = 1 [(is_uid) = true];
4411 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004412 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004413 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004414 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004415 // Name of the process taken from `/proc/$PID/cmdline`.
4416 optional string process_name = 4;
4417 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4418 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004419
4420 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4421 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4422 // frequencies are given here as the alternative is sending eight separate atoms. This method
4423 // significantly reduces the amount of data created
4424 optional int32 frequency1_khz = 6;
4425 optional int32 time1_millis = 7;
4426 optional int32 frequency2_khz = 8;
4427 optional int32 time2_millis = 9;
4428 optional int32 frequency3_khz = 10;
4429 optional int32 time3_millis = 11;
4430 optional int32 frequency4_khz = 12;
4431 optional int32 time4_millis = 13;
4432 optional int32 frequency5_khz = 14;
4433 optional int32 time5_millis = 15;
4434 optional int32 frequency6_khz = 16;
4435 optional int32 time6_millis = 17;
4436 optional int32 frequency7_khz = 18;
4437 optional int32 time7_millis = 19;
4438 optional int32 frequency8_khz = 20;
4439 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004440}
Bookatz75ee6042018-11-09 12:27:37 -08004441
4442/**
Bookatz366a4432018-11-20 09:42:33 -08004443 * Pulls information about the device's build.
4444 */
4445message BuildInformation {
4446 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4447 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4448 optional string fingerprint = 1;
4449
4450 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4451 optional string brand = 2;
4452
4453 // Build.PRODUCT. The name of the overall product.
4454 optional string product = 3;
4455
4456 // Build.DEVICE. The name of the industrial design.
4457 optional string device = 4;
4458
4459 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4460 optional string version_release = 5;
4461
4462 // Build.ID. E.g. a label like "M4-rc20".
4463 optional string id = 6;
4464
4465 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4466 // represent this build.
4467 optional string version_incremental = 7;
4468
4469 // Build.TYPE. The type of build, like "user" or "eng".
4470 optional string type = 8;
4471
4472 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4473 optional string tags = 9;
4474}
4475
4476/**
Bookatz75ee6042018-11-09 12:27:37 -08004477 * Pulls on-device BatteryStats power use calculations for the overall device.
4478 */
4479message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004480 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4481 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4482 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4483 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004484}
4485
4486/**
4487 * Pulls on-device BatteryStats power use calculations broken down by uid.
4488 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4489 * that is attributed to non-uid items. They must all be included to get the total power use.
4490 */
4491message DeviceCalculatedPowerBlameUid {
4492 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4493 optional int32 uid = 1 [(is_uid) = true];
4494
Bookatz3dbc13a2018-12-21 12:16:51 -08004495 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4496 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4497 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004498}
4499
4500/**
4501 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4502 * drain type.
4503 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4504 * is attributed uids. They must all be included to get the total power use.
4505 */
4506message DeviceCalculatedPowerBlameOther {
4507 // The type of item whose power use is being reported.
4508 enum DrainType {
4509 AMBIENT_DISPLAY = 0;
4510 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4511 BLUETOOTH = 2;
4512 CAMERA = 3;
4513 // Cell-standby
4514 CELL = 4;
4515 FLASHLIGHT = 5;
4516 IDLE = 6;
4517 MEMORY = 7;
4518 // Amount that total computed drain exceeded the drain estimated using the
4519 // battery level changes and capacity.
4520 OVERCOUNTED = 8;
4521 PHONE = 9;
4522 SCREEN = 10;
4523 // Amount that total computed drain was below the drain estimated using the
4524 // battery level changes and capacity.
4525 UNACCOUNTED = 11;
4526 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4527 WIFI = 13;
4528 }
4529 optional DrainType drain_type = 1;
4530
Bookatz3dbc13a2018-12-21 12:16:51 -08004531 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4532 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4533 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004534}
arangelov4e994062018-11-13 16:12:38 +00004535
4536/**
4537 * Logs device policy features.
4538 *
4539 * Logged from:
4540 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4541 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4542 */
4543message DevicePolicyEvent {
4544 // The event id - unique for each event.
4545 optional android.stats.devicepolicy.EventId event_id = 1;
4546 // The admin package name.
4547 optional string admin_package_name = 2;
4548 // A generic integer parameter.
4549 optional int32 integer_value = 3;
4550 // A generic boolean parameter.
4551 optional bool boolean_value = 4;
4552 // A parameter specifying a time period in milliseconds.
4553 optional uint64 time_period_millis = 5;
4554 // A parameter specifying a list of package names, bundle extras or string parameters.
4555 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4556}
shawnlinea5b66b2018-11-13 15:05:29 +08004557
4558/**
4559 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4560 *
4561 * Logged from:
4562 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4563 */
4564message DocsUILaunchReported {
4565 optional android.stats.docsui.LaunchAction launch_action = 1;
4566 optional bool has_initial_uri = 2;
4567 optional android.stats.docsui.MimeType mime_type = 3;
4568 optional android.stats.docsui.Root initial_root = 4;
4569}
4570
4571/**
4572 * Logs root/app visited event in file managers/picker. Call this when the user
4573 * taps on root/app in hamburger menu.
4574 *
4575 * Logged from:
4576 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4577 */
4578message DocsUIRootVisitedReported {
4579 optional android.stats.docsui.ContextScope scope = 1;
4580 optional android.stats.docsui.Root root = 2;
4581}
4582
4583/**
4584 * Logs file operation stats. Call this when a file operation has completed.
4585 *
4586 * Logged from:
4587 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4588 */
4589message DocsUIFileOperationReported {
4590 optional android.stats.docsui.Provider provider = 1;
4591 optional android.stats.docsui.FileOperation file_op = 2;
4592}
4593
4594/**
4595 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4596 * mode.
4597 *
4598 * Logged from:
4599 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4600 */
4601message DocsUIFileOperationCopyMoveModeReported {
4602 optional android.stats.docsui.FileOperation file_op = 1;
4603 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4604}
4605
4606
4607/**
4608 * Logs file sub operation stats. Call this when a file operation has failed.
4609 *
4610 * Logged from:
4611 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4612 */
4613message DocsUIFileOperationFailureReported {
4614 optional android.stats.docsui.Authority authority = 1;
4615 optional android.stats.docsui.SubFileOperation sub_op = 2;
4616}
4617
4618/**
4619* Logs the cancellation of a file operation. Call this when a job is canceled
4620*
4621* Logged from:
4622* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4623*/
4624message DocsUIFileOperationCanceledReported {
4625 optional android.stats.docsui.FileOperation file_op = 1;
4626}
4627
4628/**
4629 * Logs startup time in milliseconds.
4630 *
4631 * Logged from:
4632 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4633 */
4634message DocsUIStartupMsReported {
4635 optional int32 startup_millis = 1;
4636}
4637
4638/**
4639 * Logs the action that was started by user.
4640 *
4641 * Logged from:
4642 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4643 */
4644message DocsUIUserActionReported {
4645 optional android.stats.docsui.UserAction action = 1;
4646}
4647
4648/**
4649 * Logs the invalid type when invalid scoped access is requested.
4650 *
4651 * Logged from:
4652 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4653 */
4654message DocsUIInvalidScopedAccessRequestReported {
4655 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004656}
Ben Murdochbab399f2018-12-06 11:01:38 +00004657
4658/**
shawnlina75e82d2019-01-07 10:31:12 +08004659 * Logs the package name that launches docsui picker mode.
4660 *
4661 * Logged from:
4662 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4663 */
4664message DocsUIPickerLaunchedFromReported {
4665 optional string package_name = 1;
4666}
4667
4668/**
4669 * Logs the search type.
4670 *
4671 * Logged from:
4672 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4673 */
4674message DocsUISearchTypeReported {
4675 optional android.stats.docsui.SearchType search_type = 1;
4676}
4677
4678/**
4679 * Logs the search mode.
4680 *
4681 * Logged from:
4682 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4683 */
4684message DocsUISearchModeReported {
4685 optional android.stats.docsui.SearchMode search_mode = 1;
4686}
4687
4688/**
4689 * Logs the pick result information.
4690 *
4691 * Logged from:
4692 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4693 */
4694message DocsUIPickResultReported {
4695 optional int32 total_action_count = 1;
4696 optional int64 duration_millis = 2;
4697 optional int32 file_count= 3;
4698 optional bool is_searching = 4;
4699 optional android.stats.docsui.Root picked_from = 5;
4700 optional android.stats.docsui.MimeType mime_type = 6;
4701 optional int32 repeatedly_pick_times = 7;
4702}
4703
4704/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004705 * Logs when an app's memory is compacted.
4706 *
4707 * Logged from:
4708 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4709 */
4710message AppCompacted {
4711 // The pid of the process being compacted.
4712 optional int32 pid = 1;
4713
4714 // The name of the process being compacted.
4715 optional string process_name = 2;
4716
4717 // The type of compaction.
4718 enum Action {
4719 UNKNOWN = 0;
4720 SOME = 1;
4721 FULL = 2;
4722 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004723 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004724
4725 // Total RSS in kilobytes consumed by the process prior to compaction.
4726 optional int64 before_rss_total_kilobytes = 4;
4727
4728 // File RSS in kilobytes consumed by the process prior to compaction.
4729 optional int64 before_rss_file_kilobytes = 5;
4730
4731 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4732 optional int64 before_rss_anon_kilobytes = 6;
4733
4734 // Swap in kilobytes consumed by the process prior to compaction.
4735 optional int64 before_swap_kilobytes = 7;
4736
4737 // Total RSS in kilobytes consumed by the process after compaction.
4738 optional int64 after_rss_total_kilobytes = 8;
4739
4740 // File RSS in kilobytes consumed by the process after compaction.
4741 optional int64 after_rss_file_kilobytes = 9;
4742
4743 // Anonymous RSS in kilobytes consumed by the process after compaction.
4744 optional int64 after_rss_anon_kilobytes = 10;
4745
4746 // Swap in kilobytes consumed by the process after compaction.
4747 optional int64 after_swap_kilobytes = 11;
4748
4749 // The time taken to perform compaction in milliseconds.
4750 optional int64 time_to_compact_millis = 12;
4751
4752 // The last compaction action performed for this app.
4753 optional Action last_action = 13;
4754
Ben Murdoch01720b82018-12-19 18:03:44 +00004755 // The last time that compaction was attempted on this process in milliseconds
4756 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4757 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004758
Ben Murdoch01720b82018-12-19 18:03:44 +00004759 // The oom_score_adj at the time of compaction.
4760 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004761
4762 // The process state at the time of compaction.
4763 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
4764}
lifr157fc552018-12-12 16:38:04 +08004765
4766/**
4767 * Logs the latency period(in microseconds) and the return code of
4768 * the DNS(Domain Name System) lookups.
4769 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4770 * to get info(address or hostname) from DNS server(or DNS cache).
4771 * Logged from:
4772 * /system/netd/server/DnsProxyListener.cpp
4773 */
4774message NetworkDnsEventReported {
4775 // The types of the DNS lookups, as defined in
4776 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4777 enum EventType {
4778 EVENT_UNKNOWN = 0;
4779 EVENT_GETADDRINFO = 1;
4780 EVENT_GETHOSTBYNAME = 2;
4781 EVENT_GETHOSTBYADDR = 3;
4782 EVENT_RES_NSEND = 4;
4783 }
4784 optional EventType event_type = 1;
4785
4786 // The return value of the DNS resolver for each DNS lookups.
4787 //bionic/libc/include/netdb.h
4788 //system/netd/resolv/include/netd_resolv/resolv.h
4789 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004790 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004791 EAI_ADDRFAMILY = 1;
4792 EAI_AGAIN = 2;
4793 EAI_BADFLAGS = 3;
4794 EAI_FAIL = 4;
4795 EAI_FAMILY = 5;
4796 EAI_MEMORY = 6;
4797 EAI_NODATA = 7;
4798 EAI_NONAME = 8;
4799 EAI_SERVICE = 9;
4800 EAI_SOCKTYPE = 10;
4801 EAI_SYSTEM = 11;
4802 EAI_BADHINTS = 12;
4803 EAI_PROTOCOL = 13;
4804 EAI_OVERFLOW = 14;
4805 RESOLV_TIMEOUT = 255;
4806 EAI_MAX = 256;
4807 }
4808 optional ReturnCode return_code = 2;
4809
4810 // The latency period(in microseconds) it took for this DNS lookup to complete.
4811 optional int32 latency_micros = 3;
4812}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004813
4814/**
4815 * Logs when a data stall event occurs.
4816 *
4817 * Log from:
4818 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4819 */
4820message DataStallEvent {
4821 // Data stall evaluation type.
4822 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4823 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4824 optional int32 evaluation_type = 1;
4825 // See definition in data_stall_event.proto.
4826 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4827 // See definition in data_stall_event.proto.
4828 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4829 // See definition in data_stall_event.proto.
4830 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4831 // See definition in data_stall_event.proto.
4832 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4833 // See definition in data_stall_event.proto.
4834 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4835}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004836
4837/*
4838 * Logs when RescueParty resets some set of experiment flags.
4839 *
4840 * Logged from:
4841 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4842 */
4843message RescuePartyResetReported {
4844 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4845 optional int32 rescue_level = 1;
4846}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004847
4848/**
4849 * Logs when signed config is received from an APK, and if that config was applied successfully.
4850 * Logged from:
4851 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4852 */
4853message SignedConfigReported {
4854 enum Type {
4855 UNKNOWN_TYPE = 0;
4856 GLOBAL_SETTINGS = 1;
4857 }
4858 optional Type type = 1;
4859
4860 // The final status of the signed config received.
4861 enum Status {
4862 UNKNOWN_STATUS = 0;
4863 APPLIED = 1;
4864 BASE64_FAILURE_CONFIG = 2;
4865 BASE64_FAILURE_SIGNATURE = 3;
4866 SECURITY_EXCEPTION = 4;
4867 INVALID_CONFIG = 5;
4868 OLD_CONFIG = 6;
4869 SIGNATURE_CHECK_FAILED = 7;
4870 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004871 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004872 }
4873 optional Status status = 2;
4874
4875 // The version of the signed config processed.
4876 optional int32 version = 3;
4877
4878 // The package name that the config was extracted from.
4879 optional string from_package = 4;
4880
4881 enum Key {
4882 NO_KEY = 0;
4883 DEBUG = 1;
4884 PRODUCTION = 2;
4885 }
4886 // Which key was used to verify the config.
4887 optional Key verified_with = 5;
4888}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004889
4890/*
4891 * Logs GNSS Network-Initiated (NI) location events.
4892 *
4893 * Logged from:
4894 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4895 */
4896message GnssNiEventReported {
4897 // The type of GnssNiEvent.
4898 enum EventType {
4899 UNKNOWN = 0;
4900 NI_REQUEST = 1;
4901 NI_RESPONSE = 2;
4902 }
4903 optional EventType event_type = 1;
4904
4905 // An ID generated by HAL to associate NI notifications and UI responses.
4906 optional int32 notification_id = 2;
4907
4908 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004909 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004910
4911 // NI requires notification.
4912 optional bool need_notify = 4;
4913
4914 // NI requires verification.
4915 optional bool need_verify = 5;
4916
4917 // NI requires privacy override, no notification/minimal trace.
4918 optional bool privacy_override = 6;
4919
4920 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4921 // seconds.
4922 optional int32 timeout = 7;
4923
4924 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004925 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004926
4927 // String representing the requester of the network inititated location request.
4928 optional string requestor_id = 9;
4929
4930 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4931 // network initiated location request.
4932 optional string text = 10;
4933
4934 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004935 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004936
4937 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004938 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004939
4940 // True if SUPL ES is enabled.
4941 optional bool is_supl_es_enabled = 13;
4942
4943 // True if GNSS location is enabled.
4944 optional bool is_location_enabled = 14;
4945
4946 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004947 optional android.server.location.GnssUserResponseType user_response = 15;
4948}
4949
4950/**
4951 * Logs GNSS non-framework (NFW) location notification.
4952 *
4953 * Logged from:
4954 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4955 */
4956message GnssNfwNotificationReported {
4957 // Package name of the Android proxy application representing the non-framework entity that
4958 // requested location. Set to empty string if unknown.
4959 optional string proxy_app_package_name = 1;
4960
4961 // Protocol stack that initiated the non-framework location request.
4962 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4963
4964 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
4965 // set to empty string. This field is opaque to the framework and used for logging purposes.
4966 optional string other_protocol_stack_name = 3;
4967
4968 // Source initiating/receiving the location information.
4969 optional android.server.location.NfwRequestor requestor = 4;
4970
4971 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
4972 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
4973 // and used for logging purposes.
4974 optional string requestor_id = 5;
4975
4976 // Indicates whether location information was provided for this request.
4977 optional android.server.location.NfwResponseType response_type = 6;
4978
4979 // True if the device is in user initiated emergency session.
4980 optional bool in_emergency_mode = 7;
4981
4982 // True if cached location is provided.
4983 optional bool is_cached_location = 8;
4984
4985 // True if proxy app permission mismatch between framework and GNSS HAL.
4986 optional bool is_permission_mismatched = 9;
4987}
4988
4989/**
4990 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
4991 *
4992 * Logged from:
4993 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
4994 */
4995message GnssConfigurationReported {
4996 // SUPL host name.
4997 optional string supl_host = 1;
4998
4999 // SUPL port number.
5000 optional int32 supl_port = 2;
5001
5002 // C2K host name.
5003 optional string c2k_host = 3;
5004
5005 // C2K port number.
5006 optional int32 c2k_port = 4;
5007
5008 // The SUPL version requested by Carrier.
5009 optional int32 supl_ver = 5;
5010
5011 // The SUPL mode.
5012 optional android.server.location.SuplMode supl_mode = 6;
5013
5014 // True if NI emergency SUPL restrictions is enabled.
5015 optional bool supl_es = 7;
5016
5017 // LTE Positioning Profile settings
5018 optional android.server.location.LppProfile lpp_profile = 8;
5019
5020 // Positioning protocol on A-Glonass system.
5021 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5022
5023 // True if emergency PDN is used. Otherwise, regular PDN is used.
5024 optional bool use_emergency_pdn_for_emergency_supl= 10;
5025
5026 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5027 optional android.server.location.GpsLock gps_lock = 11;
5028
5029 // Number of seconds to extend the emergency session duration post emergency call.
5030 optional int32 es_extension_sec = 12;
5031
5032 // The full list of package names of proxy Android applications representing the non-framework
5033 // location access entities (on/off the device) for which the framework user has granted
5034 // non-framework location access permission. The package names are concatenated in one string
5035 // with spaces as separators.
5036 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005037}
Jack Yu95b64f32018-12-13 18:26:11 +08005038
5039/**
5040 * Logs when a NFC device's error occurred.
5041 * Logged from:
5042 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5043 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5044 */
5045message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005046 enum Type {
5047 UNKNOWN = 0;
5048 CMD_TIMEOUT = 1;
5049 ERROR_NOTIFICATION = 2;
5050 AID_OVERFLOW = 3;
5051 }
5052 optional Type type = 1;
5053 // If it's nci cmd timeout, log the timeout command.
5054 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005055
Alex Salod7c3eef2019-01-25 14:43:27 -08005056 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005057}
5058
5059/**
5060 * Logs when a NFC device's state changed event
5061 * Logged from:
5062 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5063 */
5064message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005065 enum State {
5066 UNKNOWN = 0;
5067 OFF = 1;
5068 ON = 2;
5069 ON_LOCKED = 3; // Secure Nfc enabled.
5070 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5071 }
5072 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005073}
5074
5075/**
5076 * Logs when a NFC Beam Transaction occurred.
5077 * Logged from:
5078 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5079 */
5080message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005081 enum Operation {
5082 UNKNOWN = 0;
5083 SEND = 1;
5084 RECEIVE = 2;
5085 }
5086 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005087}
5088
5089/**
5090 * Logs when a NFC Card Emulation Transaction occurred.
5091 * Logged from:
5092 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5093 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5094 */
5095message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005096 enum Category {
5097 UNKNOWN = 0;
5098 HCE_PAYMENT = 1;
5099 HCE_OTHER = 2;
5100 OFFHOST = 3;
5101 }
5102 // Transaction belongs to HCE payment or HCE other category, or offhost.
5103 optional Category category = 1;
5104 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5105 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005106}
5107
5108/**
5109 * Logs when a NFC Tag event occurred.
5110 * Logged from:
5111 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5112 */
5113message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005114 enum Type {
5115 UNKNOWN = 0;
5116 URL = 1;
5117 BT_PAIRING = 2;
5118 PROVISION = 3;
5119 WIFI_CONNECT = 4;
5120 APP_LAUNCH = 5;
5121 OTHERS = 6;
5122 }
5123 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005124}
5125
5126/**
5127 * Logs when Hce transaction triggered
5128 * Logged from:
5129 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5130 */
5131message NfcHceTransactionOccurred {
5132 // The latency period(in microseconds) it took for the first HCE data
5133 // exchange.
5134 optional uint32 latency_micros = 1;
5135}
5136
5137/**
5138 * Logs when SecureElement state event changed
5139 * Logged from:
5140 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5141 */
5142message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005143 enum State {
5144 UNKNOWN = 0;
5145 INITIALIZED = 1;
5146 DISCONNECTED = 2;
5147 CONNECTED = 3;
5148 HALCRASH = 4;
5149 }
5150 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005151
Alex Salod7c3eef2019-01-25 14:43:27 -08005152 optional string state_change_reason = 2;
5153 // SIMx or eSEx.
5154 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005155}
5156
5157/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005158 * Information about a permission grant request
5159 */
5160message PermissionGrantRequestResultReported {
5161 // unique value identifying an API call. A API call might result in multiple of these atoms
5162 optional int64 request_id = 1;
5163
5164 // UID of package requesting the permission grant
5165 optional int32 requesting_uid = 2 [(is_uid) = true];
5166
5167 // Name of package requesting the permission grant
5168 optional string requesting_package_name = 3;
5169
5170 // The permission to be granted
5171 optional string permission_name = 4;
5172
5173 // If the permission was explicitly requested via the API or added by the system
5174 optional bool is_implicit = 5;
5175
5176 enum Result {
5177 UNDEFINED = 0;
5178 // permission request was ignored
5179 IGNORED = 1;
5180 // permission request was ignored because it was user fixed
5181 IGNORED_USER_FIXED = 2;
5182 // permission request was ignored because it was policy fixed
5183 IGNORED_POLICY_FIXED = 3;
5184 // permission was granted by user action
5185 USER_GRANTED = 4;
5186 // permission was automatically granted
5187 AUTO_GRANTED = 5;
5188 // permission was denied by user action
5189 USER_DENIED = 6;
5190 // permission was denied with prejudice by the user
5191 USER_DENIED_WITH_PREJUDICE = 7;
5192 // permission was automatically denied
5193 AUTO_DENIED = 8;
5194 }
5195 // The result of the permission grant
5196 optional Result result = 6;
5197}
5198
5199/**
Jack Yu95b64f32018-12-13 18:26:11 +08005200 * Logs when Omapi API used
5201 * Logged from:
5202 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5203 */
5204message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005205 enum Operation {
5206 UNKNOWN = 0;
5207 OPEN_CHANNEL = 1;
5208 }
5209 optional Operation operation = 1;
5210 // SIMx or eSEx.
5211 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005212
Alex Salod7c3eef2019-01-25 14:43:27 -08005213 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005214}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005215
5216/**
Alex Saloa060aee2019-01-21 14:36:41 -08005217 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5218 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005219 * Logged from:
5220 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5221 */
5222message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005223 optional int64 dispatch_latency_millis = 1;
5224}
5225
5226/**
5227 * Logs AttentionManagerService attention check result.
5228 *
5229 * Logged from:
5230 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5231 */
5232message AttentionManagerServiceResultReported {
5233 // See core/java/android/service/attention/AttentionService.java
5234 enum AttentionCheckResult {
5235 UNKNOWN = 20;
5236 ATTENTION_SUCCESS_ABSENT = 0;
5237 ATTENTION_SUCCESS_PRESENT = 1;
5238 ATTENTION_FAILURE_PREEMPTED = 2;
5239 ATTENTION_FAILURE_TIMED_OUT = 3;
5240 ATTENTION_FAILURE_UNKNOWN = 4;
5241 }
5242 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005243}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005244
5245/**
5246 * Logs when an adb connection changes state.
5247 *
5248 * Logged from:
5249 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5250 */
5251message AdbConnectionChanged {
5252 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5253 // previously selected for this system.
5254 optional int64 last_connection_time_millis = 1;
5255
5256 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5257 // to reconnect via adb without user interaction.
5258 optional int64 auth_window_millis = 2;
5259
5260 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5261 optional android.debug.AdbConnectionStateEnum state = 3;
5262
5263 // True if the 'always allow' option was selected for this system.
5264 optional bool always_allow = 4;
5265}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005266
5267/*
5268 * Logs the reported speech DSP status.
5269 *
5270 * Logged from:
5271 * Vendor audio implementation.
5272 */
5273message SpeechDspStatReported {
5274 // The total Speech DSP uptime in milliseconds.
5275 optional int32 total_uptime_millis = 1;
5276 // The total Speech DSP downtime in milliseconds.
5277 optional int32 total_downtime_millis = 2;
5278 optional int32 total_crash_count = 3;
5279 optional int32 total_recover_count = 4;
5280}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005281
5282/**
5283 * Logs USB connector contaminant status.
5284 *
5285 * Logged from: USB Service.
5286 */
5287message UsbContaminantReported {
5288 optional string id = 1;
5289 optional android.service.usb.ContaminantPresenceStatus status = 2;
5290}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005291
5292/**
5293 * This atom is for debugging purpose.
5294 */
5295message DebugElapsedClock {
5296 // Monotically increasing value for each pull.
5297 optional int64 pull_count = 1;
5298 // Time from System.elapsedRealtime.
5299 optional int64 elapsed_clock_millis = 2;
5300 // Time from System.elapsedRealtime.
5301 optional int64 same_elapsed_clock_millis = 3;
5302 // Diff between current elapsed time and elapsed time from previous pull.
5303 optional int64 elapsed_clock_diff_millis = 4;
5304
5305 enum Type {
5306 TYPE_UNKNOWN = 0;
5307 ALWAYS_PRESENT = 1;
5308 PRESENT_ON_ODD_PULLS = 2;
5309 }
5310 // Type of behavior for the pulled data.
5311 optional Type type = 5;
5312}
5313
5314/**
5315 * This atom is for debugging purpose.
5316 */
5317message DebugFailingElapsedClock {
5318 // Monotically increasing value for each pull.
5319 optional int64 pull_count = 1;
5320 // Time from System.elapsedRealtime.
5321 optional int64 elapsed_clock_millis = 2;
5322 // Time from System.elapsedRealtime.
5323 optional int64 same_elapsed_clock_millis = 3;
5324 // Diff between current elapsed time and elapsed time from previous pull.
5325 optional int64 elapsed_clock_diff_millis = 4;
5326}
Steven Wuacef6bb2019-01-23 14:21:17 -05005327
5328/** Logs System UI bubbles event changed.
5329 *
5330 * Logged from:
5331 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5332 */
5333message BubbleUIChanged {
5334
5335 // The app package that is posting the bubble.
5336 optional string package_name = 1;
5337
5338 // The notification channel that is posting the bubble.
5339 optional string notification_channel = 2;
5340
5341 // The notification id associated with the posted bubble.
5342 optional int32 notification_id = 3;
5343
5344 // The position of the bubble within the bubble stack.
5345 optional int32 position = 4;
5346
5347 // The total number of bubbles within the bubble stack.
5348 optional int32 total_number = 5;
5349
5350 // User interactions with the bubble.
5351 enum Action {
5352 UNKNOWN = 0;
5353 POSTED = 1;
5354 UPDATED = 2;
5355 EXPANDED = 3;
5356 COLLAPSED = 4;
5357 DISMISSED = 5;
5358 STACK_DISMISSED = 6;
5359 STACK_MOVED = 7;
5360 HEADER_GO_TO_APP = 8;
5361 HEADER_GO_TO_SETTINGS = 9;
5362 PERMISSION_OPT_IN = 10;
5363 PERMISSION_OPT_OUT = 11;
5364 PERMISSION_IGNORED = 12;
5365 SWIPE_LEFT = 13;
5366 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005367 STACK_EXPANDED = 15;
Steven Wuacef6bb2019-01-23 14:21:17 -05005368 }
5369 optional Action action = 6;
5370
5371 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5372 optional float normalized_x_position = 7;
5373 optional float normalized_y_position = 8;
5374}
Kweku Adams8845d012018-12-11 20:06:45 -08005375
5376/**
Steven Wu552f63f2019-02-05 13:41:36 -05005377 * Logs System UI bubbles developer errors.
5378 *
5379 * Logged from:
5380 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5381 */
5382message BubbleDeveloperErrorReported {
5383
5384 // The app package that is posting the bubble.
5385 optional string package_name = 1;
5386
5387 // Bubble developer error type enums.
5388 enum Error {
5389 UNKNOWN = 0;
5390 ACTIVITY_INFO_MISSING = 1;
5391 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5392 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5393 }
5394 optional Error error = 2 [default = UNKNOWN];
5395}
5396
5397/**
Kweku Adams8845d012018-12-11 20:06:45 -08005398 * Logs that a constraint for a scheduled job has changed.
5399 *
5400 * Logged from:
5401 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5402 */
5403message ScheduledJobConstraintChanged {
5404 repeated AttributionNode attribution_node = 1;
5405
5406 // Name of the job.
5407 optional string job_name = 2;
5408
5409 optional com.android.server.job.ConstraintEnum constraint = 3;
5410
5411 enum State {
5412 UNSATISFIED = 0;
5413 SATISFIED = 1;
5414 }
5415 optional State state = 4;
5416}
Alex Salod7c3eef2019-01-25 14:43:27 -08005417
5418/**
5419 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5420 * returns true.
5421 *
5422 * Logged from:
5423 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5424 */
5425message ScreenTimeoutExtensionReported {
5426 // Describes how many times in a row did the power manager reset the screen off timeout.
5427 optional uint32 consecutive_timeout_extended_count = 1;
5428}
Hui Yu885aca12019-01-10 17:11:34 -08005429
5430/*
5431* Logs number of milliseconds it takes to start a process.
5432* The definition of app process start time is from the app launch time to
5433* the time that Zygote finished forking the app process and loaded the
5434* application package's java classes.
5435
5436* This metric is different from AppStartOccurred which is for foreground
5437* activity only.
5438
5439* ProcessStartTime can report all processes (both foreground and background)
5440* start time.
5441*
5442* Logged from:
5443* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5444*/
5445message ProcessStartTime {
5446 // The uid of the ProcessRecord.
5447 optional int32 uid = 1 [(is_uid) = true];
5448
5449 // The process pid.
5450 optional int32 pid = 2;
5451
5452 // The process name.
5453 // Usually package name, "system" for system server.
5454 // Provided by ActivityManagerService.
5455 optional string process_name = 3;
5456
5457 enum StartType {
5458 UNKNOWN = 0;
5459 WARM = 1;
5460 HOT = 2;
5461 COLD = 3;
5462 }
5463
5464 // The start type.
5465 optional StartType type = 4;
5466
5467 // The elapsed realtime at the start of the process.
5468 optional int64 process_start_time_millis = 5;
5469
5470 // Number of milliseconds it takes to reach bind application.
5471 optional int32 bind_application_delay_millis = 6;
5472
5473 // Number of milliseconds it takes to finish start of the process.
5474 optional int32 process_start_delay_millis = 7;
5475
5476 // hostingType field in ProcessRecord, the component type such as "activity",
5477 // "service", "content provider", "broadcast" or other strings.
5478 optional string hosting_type = 8;
5479
5480 // hostingNameStr field in ProcessRecord. The component class name that runs
5481 // in this process.
5482 optional string hosting_name = 9;
5483}
5484
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005485/**
5486 * State of a dangerous permission requested by a package
5487 */
5488message DangerousPermissionState {
5489 // Name of the permission
5490 optional string permission_name = 1;
5491
5492 // Uid of the package
5493 optional int32 uid = 2 [(is_uid) = true];
5494
5495 // Package requesting the permission
5496 optional string package_name = 3;
5497
5498 // If the permission is granted to the uid
5499 optional bool is_granted = 4;
5500}
5501
Michael Groover4a0ca942019-01-24 17:41:25 -08005502/**
5503 * Logs when a package is denied access to a device identifier based on the new access requirements.
5504 *
5505 * Logged from:
5506 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
5507 */
5508message DeviceIdentifierAccessDenied {
5509 // The name of the package denied access to the requested device identifier.
5510 optional string package_name = 1;
5511
5512 // The name of the device identifier method the package attempted to invoke.
5513 optional string method_name = 2;
5514
5515 // True if the package is preinstalled.
5516 optional bool is_preinstalled = 3;
5517
5518 // True if the package is privileged.
5519 optional bool is_priv_app = 4;
5520}
Chenjie Yue13f44a2019-02-07 17:51:38 -08005521
5522/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08005523 * Pulls the ongoing mainline install train version code.
5524 * Pulled from StatsCompanionService
5525 */
5526message TrainInfo {
5527 optional int64 train_version_code = 1;
5528
5529 optional TrainExperimentIds train_experiment_id = 2;
5530}