blob: 1c7eb41ae10340cbb0cd945c2142665b149aa3a8 [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;
David Chenc8a43242017-10-17 16:23:28 -0700300 }
yroa1fe77c2018-02-26 14:22:54 -0800301
Bookatz76aafcf2018-09-17 16:17:10 -0700302 // DO NOT USE field numbers above 100,000 in AOSP.
303 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
304 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700305}
306
Yao Chend54f9dd2017-10-17 17:37:48 +0000307/**
Yangster-mac20877162017-12-22 17:19:39 -0800308 * This proto represents a node of an attribution chain.
309 * Note: All attribution chains are represented as a repeated field of type
310 * AttributionNode. It is understood that in such arrays, the order is that
311 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000312 */
Yangster-mac20877162017-12-22 17:19:39 -0800313message AttributionNode {
314 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800315 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800316
Yangster-mac20877162017-12-22 17:19:39 -0800317 // The (optional) string tag for an element in the attribution chain. If the
318 // element has no tag, it is encoded as an empty string.
319 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700320}
321
Yangster-mac48b3d622018-08-18 12:38:11 -0700322message KeyValuePair {
323 optional int32 key = 1;
324 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700325 int32 value_int = 2;
326 int64 value_long = 3;
327 string value_str = 4;
328 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700329 }
330}
331
332message KeyValuePairsAtom {
333 optional int32 uid = 1;
334 repeated KeyValuePair pairs = 2;
335}
336
Yao Chend54f9dd2017-10-17 17:37:48 +0000337/*
338 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800339 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000340 *
341 * RULES:
342 * - The field ids for each atom must start at 1, and count upwards by 1.
343 * Skipping field ids is not allowed.
344 * - These form an API, so renaming, renumbering or removing fields is
345 * not allowed between android releases. (This is not currently enforced,
346 * but there will be a tool to enforce this restriction).
347 * - The types must be built-in protocol buffer types, namely, no sub-messages
348 * are allowed (yet). The bytes type is also not allowed.
349 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800350 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000351 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800352 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000353 * - A field that is a uid should be a string field, tagged with the [xxx]
354 * annotation. The generated code on android will be represented by UIDs,
355 * and those UIDs will be translated in xxx to those strings.
356 *
357 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700358 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000359 * - If there is a UID, it goes first. Think in an object-oriented fashion.
360 * *****************************************************************************
361 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700362
Yao Chend54f9dd2017-10-17 17:37:48 +0000363/**
Yangster-mace16189a2018-08-26 12:20:16 -0700364 * Logs when the Thermal service HAL notifies the throttling start/stop events.
365 *
366 * Logged from:
367 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
368 */
369message ThermalThrottlingStateChanged {
370 optional android.os.TemperatureTypeEnum sensor_type = 1;
371
372 enum State {
373 UNKNOWN = 0;
374 START = 1;
375 STOP = 2;
376 }
377
378 optional State state = 2;
379
380 optional float temperature = 3;
381}
382
383/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000384 * Logs when the screen state changes.
385 *
386 * Logged from:
387 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
388 */
389message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800390 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700391 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700392}
Yao Chend54f9dd2017-10-17 17:37:48 +0000393
394/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700395 * Logs that the process state of the uid, as determined by ActivityManager
396 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000397 *
398 * Logged from:
399 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
400 */
Bookatzc1a050a2017-10-10 15:49:28 -0700401message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700402 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000403
Bookatzdb026a22018-01-10 19:01:56 -0800404 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700405 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000406}
407
408/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700409 * Logs process state change of a process, as per the activity manager.
410 *
411 * Logged from:
412 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
413 */
414message ProcessStateChanged {
415 optional int32 uid = 1;
416 optional string process_name = 2;
417 optional string package_name = 3;
418 // TODO: remove this when validation is done
419 optional int64 version = 5;
420 // The state, from frameworks/base/core/proto/android/app/enums.proto.
421 optional android.app.ProcessStateEnum state = 4;
422}
423
424/**
425 * Logs when ActivityManagerService sleep state is changed.
426 *
427 * Logged from:
428 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
429 */
430message ActivityManagerSleepStateChanged {
431 // TODO: import frameworks proto
432 enum State {
433 UNKNOWN = 0;
434 ASLEEP = 1;
435 AWAKE = 2;
436 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700437 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700438}
439
440/**
441 * Logs when system memory state changes.
442 *
443 * Logged from:
444 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
445 */
446message MemoryFactorStateChanged {
447 // TODO: import frameworks proto
448 enum State {
449 MEMORY_UNKNOWN = 0;
450 NORMAL = 1; // normal.
451 MODERATE = 2; // moderate memory pressure.
452 LOW = 3; // low memory.
453 CRITICAL = 4; // critical memory.
454
455 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700456 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700457}
458
459/**
460 * Logs when app is using too much cpu, according to ActivityManagerService.
461 *
462 * Logged from:
463 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
464 */
465message ExcessiveCpuUsageReported {
466 optional int32 uid = 1;
467 optional string process_name = 2;
468 optional string package_name = 3;
469 // package version. TODO: remove this when validation is done
470 optional int64 version = 4;
471}
472
473/**
474 * Logs when a cached process is killed, along with its pss.
475 *
476 * Logged from:
477 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
478 */
479message CachedKillReported {
480 optional int32 uid = 1;
481 optional string process_name = 2;
482 optional string package_name = 3;
483 // TODO: remove this when validation is done
484 optional int64 version = 5;
485 optional int64 pss = 4;
486}
487
488/**
489 * Logs when memory stats of a process is reported.
490 *
491 * Logged from:
492 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
493 */
494message ProcessMemoryStatReported {
495 optional int32 uid = 1;
496 optional string process_name = 2;
497 optional string package_name = 3;
498 //TODO: remove this when validation is done
499 optional int64 version = 9;
500 optional int64 pss = 4;
501 optional int64 uss = 5;
502 optional int64 rss = 6;
503 enum Type {
504 ADD_PSS_INTERNAL_SINGLE = 0;
505 ADD_PSS_INTERNAL_ALL_MEM = 1;
506 ADD_PSS_INTERNAL_ALL_POLL = 2;
507 ADD_PSS_EXTERNAL = 3;
508 ADD_PSS_EXTERNAL_SLOW = 4;
509 }
510 optional Type type = 7;
511 optional int64 duration = 8;
512}
513
514/**
Bookatzc1a050a2017-10-10 15:49:28 -0700515 * Logs that a process started, finished, crashed, or ANRed.
516 *
517 * Logged from:
518 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
519 */
520message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700521 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700522
David Chen0b5c90c2018-01-25 16:51:49 -0800523 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800524 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700525
Bookatzddccf0a2017-11-28 16:48:14 -0800526 // What lifecycle state the process changed to.
527 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800528 enum State {
529 FINISHED = 0;
530 STARTED = 1;
531 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800532 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800533 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700534}
535
Bookatzc1a050a2017-10-10 15:49:28 -0700536/**
537 * Logs when the ble scan state changes.
538 *
539 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700540 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700541 */
542message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800543 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700544
545 enum State {
546 OFF = 0;
547 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700548 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
549 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700550 }
551 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700552
Bookatze5ec0b42018-03-26 13:34:56 -0700553 // Does the scan have a filter.
554 optional bool is_filtered = 3;
555 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
556 optional bool is_first_match = 4;
557 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
558 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700559}
560
561/**
562 * Logs reporting of a ble scan finding results.
563 *
564 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700565 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700566 */
Bookatzae6738e2018-09-13 11:38:56 -0700567// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700568message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800569 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700570
571 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800572 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700573}
574
575/**
576 * Logs when a sensor state changes.
577 *
578 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700579 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700580 */
581message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800582 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700583
Bookatzc1a050a2017-10-10 15:49:28 -0700584 // The id (int) of the sensor.
585 optional int32 sensor_id = 2;
586
587 enum State {
588 OFF = 0;
589 ON = 1;
590 }
591 optional State state = 3;
592}
593
Bookatzc1a050a2017-10-10 15:49:28 -0700594/**
595 * Logs when GPS state changes.
596 *
597 * Logged from:
598 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
599 */
600message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800601 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700602
603 enum State {
604 OFF = 0;
605 ON = 1;
606 }
607 optional State state = 2;
608}
609
Bookatz48d362e2018-11-06 15:49:08 -0800610/**
611 * Logs when GPS signal quality.
612 *
613 * Logged from:
614 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
615 */
616message GpsSignalQualityChanged {
617 optional android.server.location.GpsSignalQualityEnum level = 1;
618}
619
Bookatzc1a050a2017-10-10 15:49:28 -0700620
621/**
622 * Logs when a sync manager sync state changes.
623 *
624 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700625 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700626 */
627message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800628 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700629
David Chen0b5c90c2018-01-25 16:51:49 -0800630 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800631 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700632
633 enum State {
634 OFF = 0;
635 ON = 1;
636 }
637 optional State state = 3;
638}
639
Yangster-mac96353002018-09-05 11:18:55 -0700640/*
641 * Deferred job stats.
642 *
643 * Logged from:
644 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
645*/
646message DeferredJobStatsReported {
647 repeated AttributionNode attribution_node = 1;
648
649 // Number of jobs deferred.
650 optional int32 num_jobs_deferred = 2;
651
652 // Time since the last job runs.
653 optional int64 time_since_last_job_millis = 3;
654}
655
Bookatzc1a050a2017-10-10 15:49:28 -0700656/**
657 * Logs when a job scheduler job state changes.
658 *
659 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700660 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700661 */
662message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800663 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700664
665 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800666 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700667
668 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800669 FINISHED = 0;
670 STARTED = 1;
671 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700672 }
673 optional State state = 3;
674
Tej Singh33a412b2018-03-16 18:43:59 -0700675 // The reason a job has stopped.
676 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700677 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700678 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700679}
680
681/**
682 * Logs when the audio state changes.
683 *
684 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700685 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700686 */
687message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800688 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700689
690 enum State {
691 OFF = 0;
692 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700693 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
694 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700695 }
696 optional State state = 2;
697}
698
699/**
700 * Logs when the video codec state changes.
701 *
702 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700703 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700704 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800705message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800706 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700707
708 enum State {
709 OFF = 0;
710 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700711 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
712 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700713 }
714 optional State state = 2;
715}
716
717/**
718 * Logs when the flashlight state changes.
719 *
720 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700721 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700722 */
723message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800724 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700725
726 enum State {
727 OFF = 0;
728 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700729 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
730 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700731 }
732 optional State state = 2;
733}
734
735/**
736 * Logs when the camera state changes.
737 *
738 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700739 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700740 */
741message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800742 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700743
744 enum State {
745 OFF = 0;
746 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700747 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
748 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700749 }
750 optional State state = 2;
751}
752
753/**
754 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000755 *
756 * Logged from:
757 * TODO
758 */
Bookatzd6746242017-10-24 18:39:35 -0700759message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800760 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000761
Bookatz1a1b0462018-01-12 11:47:03 -0800762 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
763 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700764 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700765
766 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
767 optional string tag = 3;
768
769 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800770 RELEASE = 0;
771 ACQUIRE = 1;
772 CHANGE_RELEASE = 2;
773 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700774 }
775 optional State state = 4;
776}
777
778/**
Bookatzc1a050a2017-10-10 15:49:28 -0700779 * Logs when a partial wakelock is considered 'long' (over 1 min).
780 *
781 * Logged from:
782 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
783 */
784message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800785 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700786
Yao Chend54f9dd2017-10-17 17:37:48 +0000787 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
788 optional string tag = 2;
789
Bookatzc1a050a2017-10-10 15:49:28 -0700790 // TODO: I have no idea what this is.
791 optional string history_tag = 3;
792
793 enum State {
794 OFF = 0;
795 ON = 1;
796 }
797 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000798}
799
Bookatzc1a050a2017-10-10 15:49:28 -0700800/**
Bookatza66083f2018-09-20 17:24:00 -0700801 * Logs when the device is interactive, according to the PowerManager Notifier.
802 *
803 * Logged from:
804 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
805 */
806message InteractiveStateChanged {
807 enum State {
808 OFF = 0;
809 ON = 1;
810 }
811 optional State state = 1;
812}
813
814/**
Bookatzc1a050a2017-10-10 15:49:28 -0700815 * Logs Battery Saver state change.
816 *
817 * Logged from:
818 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
819 */
820message BatterySaverModeStateChanged {
821 enum State {
822 OFF = 0;
823 ON = 1;
824 }
825 optional State state = 1;
826}
827
828/**
829 * Logs Doze mode state change.
830 *
831 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800832 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700833 */
834message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800835 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800836}
837
838
839/**
840 * Logs state change of Doze mode including maintenance windows.
841 *
842 * Logged from:
843 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
844 */
845message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800846 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700847}
848
849/**
850 * Logs screen brightness level.
851 *
852 * Logged from:
853 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
854 */
855message ScreenBrightnessChanged {
856 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
857 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700858}
859
860/**
861 * Logs battery level (percent full, from 0 to 100).
862 *
863 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700864 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700865 */
866message BatteryLevelChanged {
867 // Battery level. Should be in [0, 100].
868 optional int32 battery_level = 1;
869}
870
871/**
872 * Logs change in charging status of the device.
873 *
874 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700875 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700876 */
877message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800878 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
879 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700880}
881
882/**
883 * Logs whether the device is plugged in, and what power source it is using.
884 *
885 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700886 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700887 */
888message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800889 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
890 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700891}
892
Bookatz8c6571b2017-10-24 15:04:41 -0700893/**
894 * Logs when an app's wakeup alarm fires.
895 *
896 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700897 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700898 */
899message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800900 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800901
902 // Name of the wakeup alarm.
903 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700904
905 // Name of source package (for historical reasons, since BatteryStats tracked it).
906 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800907}
908
909/**
910 * Logs when an an app causes the mobile radio to change state.
911 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
912 *
913 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700914 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800915 */
916message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800917 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800918
Bookatz1a1b0462018-01-12 11:47:03 -0800919 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
920 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800921}
922
923/**
924 * Logs when an an app causes the wifi radio to change state.
925 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
926 *
927 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700928 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800929 */
930message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800931 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800932
Bookatz1a1b0462018-01-12 11:47:03 -0800933 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
934 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700935}
936
937/**
938 * Logs kernel wakeup reasons and aborts.
939 *
940 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700941 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700942 */
943message KernelWakeupReported {
944 // Name of the kernel wakeup reason (or abort).
945 optional string wakeup_reason_name = 1;
946
947 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800948 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700949}
950
951/**
Bookatzda1798c2018-12-13 14:16:00 -0800952 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800953 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800954 *
955 * Logged from:
956 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
957 */
958message WifiEnabledStateChanged {
959 enum State {
960 OFF = 0;
961 ON = 1;
962 }
963 optional State state = 1;
964}
965
966/**
967 * 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 -0800968 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
969 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800970 *
971 * Logged from:
972 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
973 */
974message WifiRunningStateChanged {
975 repeated AttributionNode attribution_node = 1;
976
977 enum State {
978 OFF = 0;
979 ON = 1;
980 }
981 optional State state = 2;
982}
983
984/**
Bookatze5885242017-10-24 20:10:31 -0700985 * Logs wifi locks held by an app.
986 *
987 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700988 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700989 */
990message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800991 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700992
993 enum State {
994 OFF = 0;
995 ON = 1;
996 }
997 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -0800998
999 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1000 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001001}
1002
1003/**
1004 * Logs wifi signal strength changes.
1005 *
1006 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001007 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001008 */
1009message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001010 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1011 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001012}
1013
1014/**
1015 * Logs wifi scans performed by an app.
1016 *
1017 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001018 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001019 */
1020message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001021 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001022
1023 enum State {
1024 OFF = 0;
1025 ON = 1;
1026 }
1027 optional State state = 2;
1028}
1029
1030/**
Tej Singh4503e102018-01-04 14:35:01 -08001031 * Logs wifi multicast locks held by an app
1032 *
1033 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001034 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001035 */
1036message WifiMulticastLockStateChanged {
1037 repeated AttributionNode attribution_node = 1;
1038
1039 enum State {
1040 OFF = 0;
1041 ON = 1;
1042 }
1043 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001044
1045 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001046}
1047
1048/**
Tej Singh1ea42892018-01-19 09:27:00 -08001049 * Logs shutdown reason and duration on next boot.
1050 *
1051 * Logged from:
1052 * frameworks/base/core/java/com/android/server/BootReceiver.java
1053 */
1054message ShutdownSequenceReported {
1055 // True if shutdown is for a reboot. Default: false if we do not know.
1056 optional bool reboot = 1;
1057
1058 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1059 optional string reason = 2;
1060
1061 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1062 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001063 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001064
1065 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001066 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001067}
1068
Tej Singh6483ea42018-01-25 17:45:49 -08001069
1070/**
1071 * Logs boot reason and duration.
1072 *
1073 * Logged from:
1074 * system/core/bootstat/bootstat.cpp
1075 */
1076message BootSequenceReported {
1077 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1078 // Default: "<EMPTY>" if not available.
1079 optional string bootloader_reason = 1;
1080
1081 // Reason for system boot. Eg. bootloader, reboot,userrequested
1082 // Default: "<EMPTY>" if not available.
1083 optional string system_reason = 2;
1084
1085 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001086 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001087
1088 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001089 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001090
1091 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001092 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001093
1094 // Time since last boot in ms. Default: 0 if not available.
1095 optional int64 time_since_last_boot = 6;
1096}
1097
Tej Singhc477d9c2018-02-05 18:31:39 -08001098
1099/**
1100 * Logs call state and disconnect cause (if applicable).
1101 *
1102 * Logged from:
1103 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1104 */
1105message CallStateChanged {
1106 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1107 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1108 optional android.telecom.CallStateEnum call_state = 1;
1109
1110 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1111 // This value is only applicable when the call_state is DISCONNECTED, and
1112 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1113 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1114 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1115
1116 // True if the call is self-managed, which are apps that use the
1117 // telecom infrastructure to make their own calls.
1118 optional bool self_managed = 3;
1119
1120 // True if call is external. External calls are calls on connected Wear
1121 // devices but show up in Telecom so the user can pull them onto the device.
1122 optional bool external_call = 4;
1123}
1124
Tej Singh1ea42892018-01-19 09:27:00 -08001125/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001126 * Logs keyguard state. The keyguard is the lock screen.
1127 *
1128 * Logged from:
1129 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1130 */
1131message KeyguardStateChanged {
1132 enum State {
1133 UNKNOWN = 0;
1134 // The keyguard is hidden when the phone is unlocked.
1135 HIDDEN = 1;
1136 // The keyguard is shown when the phone is locked (screen turns off).
1137 SHOWN= 2;
1138 // The keyguard is occluded when something is overlaying the keyguard.
1139 // Eg. Opening the camera while on the lock screen.
1140 OCCLUDED = 3;
1141 }
1142 optional State state = 1;
1143}
1144
1145/**
1146 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1147 * prompts the user to enter a password (pattern, pin, etc).
1148 *
1149 * Logged from:
1150 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1151 */
1152
1153message KeyguardBouncerStateChanged {
1154 enum State {
1155 UNKNOWN = 0;
1156 // Bouncer is hidden, either as a result of successfully entering the
1157 // password, screen timing out, or user going back to lock screen.
1158 HIDDEN = 1;
1159 // This is when the user is being prompted to enter the password.
1160 SHOWN = 2;
1161 }
1162 optional State state = 1;
1163}
1164
1165/**
1166 * Logs the result of entering a password into the keyguard bouncer.
1167 *
1168 * Logged from:
1169 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1170 */
1171message KeyguardBouncerPasswordEntered {
1172 enum BouncerResult {
1173 UNKNOWN = 0;
1174 // The password entered was incorrect.
1175 FAILURE = 1;
1176 // The password entered was correct.
1177 SUCCESS = 2;
1178 }
1179 optional BouncerResult result = 1;
1180}
1181
Tej Singha883b372018-02-15 11:30:01 -08001182/*
1183 * Logs changes to the configuration of the device. The configuration is defined
1184 * in frameworks/base/core/java/android/content/res/Configuration.java
1185 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1186 * Please go there to interpret the possible values each field can be.
1187 *
1188 * Logged from:
1189 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1190 */
1191message ResourceConfigurationChanged {
1192 // Bit mask of color capabilities of the screen.
1193 // Contains information about the color gamut and hdr mode of the screen.
1194 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001195 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001196
1197 // The target screen density being rendered to.
1198 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001199 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001200
1201 // Current user preference for the scaling factor for fonts,
1202 // relative to the base density scaling.
1203 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001204 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001205
1206 // Flag indicating whether the hard keyboard is hidden.
1207 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001208 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001209
1210 // The type of keyboard attached to the device.
1211 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1212 optional int32 keyboard = 5;
1213
1214 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1215 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001216 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001217
1218 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1219 // 0 if undefined.
1220 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1221 optional int32 mcc = 7;
1222
1223 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1224 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1225 // MNC_ZERO symbol defined in Configuration.java.
1226 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1227 optional int32 mnc = 8;
1228
1229 // The kind of navigation available on the device.
1230 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1231 optional int32 navigation = 9;
1232
1233 // Flag indicating whether the navigation is available.
1234 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001235 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001236
1237 // Overall orientation of the screen.
1238 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1239 optional int32 orientation = 11;
1240
1241 // The current height of the available screen space, in dp units.
1242 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001243 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001244
1245 // Bit mask of overall layout of the screen.
1246 // Contains information about screen size, whether the screen is wider/taller
1247 // than normal, whether the screen layout is right-tl-left or left-to-right,
1248 // and whether the screen has a rounded shape.
1249 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001250 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001251
1252 // Current width of the available screen space, in dp units.
1253 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001254 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001255
1256 // The smallest screen size an application will see in normal operation.
1257 // This is the smallest value of both screenWidthDp and screenHeightDp
1258 // in portrait and landscape.
1259 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001260 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001261
1262 // The type of touch screen attached to the device.
1263 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1264 optional int32 touchscreen = 16;
1265
1266 // Bit mask of the ui mode.
1267 // Contains information about the overall ui mode of the device.
1268 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1269 // Also contains information about whether the device is in night mode.
1270 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001271 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001272}
1273
Tej Singheee317b2018-03-07 19:28:05 -08001274
1275/**
1276 * Logs changes in the connection state of the mobile radio.
1277 *
1278 * Logged from:
1279 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1280 */
1281message MobileConnectionStateChanged {
1282 // States are from the state machine DataConnection.java.
1283 enum State {
1284 UNKNOWN = 0;
1285 // The connection is inactive, or disconnected.
1286 INACTIVE = 1;
1287 // The connection is being activated, or connecting.
1288 ACTIVATING = 2;
1289 // The connection is active, or connected.
1290 ACTIVE = 3;
1291 // The connection is disconnecting.
1292 DISCONNECTING = 4;
1293 // The connection is disconnecting after creating a connection.
1294 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1295 }
1296 optional State state = 1;
1297 // For multi-sim phones, this distinguishes between the sim cards.
1298 optional int32 sim_slot_index = 2;
1299 // Used to identify the connection. Starts at 0 and increments by 1 for
1300 // every new network created. Resets whenever the device reboots.
1301 optional int32 data_connection_id = 3;
1302 // A bitmask for the capabilities of this connection.
1303 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1304 // Default value (if we have no information): 0
1305 optional int64 capabilities = 4;
1306 // If this connection has internet.
1307 // This just checks if the DEFAULT bit of capabilities is set.
1308 optional bool has_internet = 5;
1309}
1310
1311/**
1312 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1313 *
1314 * Logged from:
1315 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1316 */
1317message MobileRadioTechnologyChanged {
1318 optional android.telephony.NetworkTypeEnum state = 1;
1319 // For multi-sim phones, this distinguishes between the sim cards.
1320 optional int32 sim_slot_index = 2;
1321}
1322
Andrew Chantb56388b2018-03-22 21:07:33 -07001323/**
1324 * Logs the VID and PID of any connected USB devices.
1325 *
1326 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1327 *
1328 * Logged by Vendor.
1329 */
1330message UsbDeviceAttached {
1331 optional int32 vid = 1;
1332 optional int32 pid = 2;
1333 optional bool has_audio = 3;
1334 optional bool has_hid = 4;
1335 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001336 enum State {
1337 STATE_DISCONNECTED = 0;
1338 STATE_CONNECTED = 1;
1339 }
1340 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001341 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001342}
1343
Tej Singheee317b2018-03-07 19:28:05 -08001344
Tej Singhdd7bd352018-02-09 19:33:15 -08001345/**
Tej Singh5d991e12018-03-09 19:48:11 -08001346 * Logs when Bluetooth is enabled and disabled.
1347 *
1348 * Logged from:
1349 * services/core/java/com/android/server/BluetoothManagerService.java
1350 */
1351message BluetoothEnabledStateChanged {
1352 repeated AttributionNode attribution_node = 1;
1353 // Whether or not bluetooth is enabled on the device.
1354 enum State {
1355 UNKNOWN = 0;
1356 ENABLED = 1;
1357 DISABLED = 2;
1358 }
1359 optional State state = 2;
1360 // The reason for being enabled/disabled.
1361 // Eg. Airplane mode, crash, application request.
1362 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1363 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001364 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001365}
1366
1367/**
Jack Hed9837c82019-01-09 01:19:13 -08001368 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001369 *
1370 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001371 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1372 *
1373 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001374 */
1375message BluetoothConnectionStateChanged {
1376 // The state of the connection.
1377 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1378 optional android.bluetooth.ConnectionStateEnum state = 1;
1379 // An identifier that can be used to match connect and disconnect events.
1380 // Currently is last two bytes of a hash of a device level ID and
1381 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001382 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1383 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001384 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1385 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001386 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001387 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001388 // An identifier that can be used to match events for this device.
1389 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1390 // Salt: Randomly generated 256 bit value
1391 // Hash algorithm: HMAC-SHA256
1392 // Size: 32 byte
1393 // Default: null or empty if the device identifier is not known
1394 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1395}
1396
1397/**
1398 * Logs when a Bluetooth device connects and disconnects over ACL
1399 *
1400 * Logged from:
1401 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1402 *
1403 * Next Tag: 3
1404 */
1405message BluetoothAclConnectionStateChanged {
1406 // An identifier that can be used to match events for this device.
1407 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1408 // Salt: Randomly generated 256 bit value
1409 // Hash algorithm: HMAC-SHA256
1410 // Size: 32 byte
1411 // Default: null or empty if the device identifier is not known
1412 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1413 // The state of the connection.
1414 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1415 optional android.bluetooth.ConnectionStateEnum state = 2;
1416}
1417
1418/**
1419 * Logs when a Bluetooth device connects and disconnects over SCO
1420 *
1421 * Logged from:
1422 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1423 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1424 *
1425 * Next Tag: 4
1426 */
1427message BluetoothScoConnectionStateChanged {
1428 // An identifier that can be used to match events for this device.
1429 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1430 // Salt: Randomly generated 256 bit value
1431 // Hash algorithm: HMAC-SHA256
1432 // Size: 32 byte
1433 // Default: null or empty if the device identifier is not known
1434 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1435 // The state of the connection.
1436 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1437 optional android.bluetooth.ConnectionStateEnum state = 2;
1438 // Codec used for this SCO connection
1439 // Default: UNKNOWN
1440 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001441}
1442
Jack Hec27040a2019-01-09 20:54:41 -08001443/**
1444 * Logged when active device of a profile changes
1445 *
1446 * Logged from:
1447 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1448 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1449 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1450 */
1451message BluetoothActiveDeviceChanged {
1452 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1453 // From android.bluetooth.BluetoothProfile
1454 optional int32 bt_profile = 1;
1455 // An identifier that can be used to match events for this new active device.
1456 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1457 // Salt: Randomly generated 256 bit value
1458 // Hash algorithm: HMAC-SHA256
1459 // Size: 32 byte
1460 // Default: null or empty if there is no active device for this profile
1461 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1462}
1463
Jack Heab86dbd22018-12-18 15:43:27 -08001464// Logs when there is an event affecting Bluetooth device's link layer connection.
1465// - This event is triggered when there is a related HCI command or event
1466// - Users of this metrics can deduce Bluetooth device's connection state from these events
1467// - HCI commands are logged before the command is sent, after receiving command status, and after
1468// receiving command complete
1469// - HCI events are logged when they arrive
1470//
1471// Low level log from system/bt
1472//
1473// Bluetooth classic commands:
1474// - CMD_CREATE_CONNECTION
1475// - CMD_DISCONNECT
1476// - CMD_CREATE_CONNECTION_CANCEL
1477// - CMD_ACCEPT_CONNECTION_REQUEST
1478// - CMD_REJECT_CONNECTION_REQUEST
1479// - CMD_SETUP_ESCO_CONNECTION
1480// - CMD_ACCEPT_ESCO_CONNECTION
1481// - CMD_REJECT_ESCO_CONNECTION
1482// - CMD_ENH_SETUP_ESCO_CONNECTION
1483// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1484//
1485// Bluetooth low energy commands:
1486// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1487// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1488// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1489// - CMD_BLE_CLEAR_WHITE_LIST
1490// - CMD_BLE_ADD_WHITE_LIST
1491// - CMD_BLE_REMOVE_WHITE_LIST
1492//
1493// Bluetooth classic events:
1494// - EVT_CONNECTION_COMP
1495// - EVT_CONNECTION_REQUEST
1496// - EVT_DISCONNECTION_COMP
1497// - EVT_ESCO_CONNECTION_COMP
1498// - EVT_ESCO_CONNECTION_CHANGED
1499//
1500// Bluetooth low energy meta events:
1501// - BLE_EVT_CONN_COMPLETE_EVT
1502// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1503//
1504// Next tag: 10
1505message BluetoothLinkLayerConnectionEvent {
1506 // An identifier that can be used to match events for this device.
1507 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1508 // Salt: Randomly generated 256 bit value
1509 // Hash algorithm: HMAC-SHA256
1510 // Size: 32 byte
1511 // Default: null or empty if the device identifier is not known
1512 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1513 // Connection handle of this connection if available
1514 // Range: 0x0000 - 0x0EFF (12 bits)
1515 // Default: 0xFFFF if the handle is unknown
1516 optional int32 connection_handle = 2;
1517 // Direction of the link
1518 // Default: DIRECTION_UNKNOWN
1519 optional android.bluetooth.DirectionEnum direction = 3;
1520 // Type of this link
1521 // Default: LINK_TYPE_UNKNOWN
1522 optional android.bluetooth.LinkTypeEnum type = 4;
1523
1524 // Reason metadata for this link layer connection event, rules for interpretation:
1525 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1526 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1527 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1528 // set and valid, ignore hci_ble_event
1529
1530 // HCI command associated with this event
1531 // Default: CMD_UNKNOWN
1532 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1533 // HCI event associated with this event
1534 // Default: EVT_UNKNOWN
1535 optional android.bluetooth.hci.EventEnum hci_event = 6;
1536 // HCI BLE meta event associated with this event
1537 // Default: BLE_EVT_UNKNOWN
1538 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1539 // HCI command status code if this is triggerred by hci_cmd
1540 // Default: STATUS_UNKNOWN
1541 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1542 // HCI reason code associated with this event
1543 // Default: STATUS_UNKNOWN
1544 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1545}
1546
Howard Roe103fe22019-01-17 16:52:16 -08001547/**
1548 * Logs when a module is rolled back by Watchdog.
1549 *
1550 * Logged from: Rollback Manager
1551 */
1552message WatchdogRollbackOccurred {
1553 enum RollbackType {
1554 UNKNOWN = 0;
1555 ROLLBACK_INITIATE = 1;
1556 ROLLBACK_SUCCESS = 2;
1557 ROLLBACK_FAILURE = 3;
1558 }
1559 optional RollbackType rollback_type = 1;
1560
1561 optional string package_name = 2;
1562
1563 optional int32 package_version_code = 3;
1564}
1565
Jack Hec27040a2019-01-09 20:54:41 -08001566/**
1567 * Logs when there is a change in Bluetooth A2DP playback state
1568 *
1569 * Logged from:
1570 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1571 */
1572message BluetoothA2dpPlaybackStateChanged {
1573 // An identifier that can be used to match events for this device.
1574 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1575 // Salt: Randomly generated 256 bit value
1576 // Hash algorithm: HMAC-SHA256
1577 // Size: 32 byte
1578 // Default: null or empty if the device identifier is not known
1579 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1580 // Current playback state
1581 // Default: PLAYBACK_STATE_UNKNOWN
1582 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1583 // Current audio coding mode
1584 // Default: AUDIO_CODING_MODE_UNKNOWN
1585 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1586}
1587
1588/**
1589 * Logs when there is a change in A2DP codec config for a particular remote device
1590 *
1591 * Logged from:
1592 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1593 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1594 */
1595message BluetoothA2dpCodecConfigChanged {
1596 // An identifier that can be used to match events for this device.
1597 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1598 // Salt: Randomly generated 256 bit value
1599 // Hash algorithm: HMAC-SHA256
1600 // Size: 32 byte
1601 // Default: null or empty if the device identifier is not known
1602 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1603 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1604 // Default SOURCE_CODEC_TYPE_INVALID
1605 optional int32 codec_type = 2;
1606 // Codec priroity, the higher the more preferred, -1 for disabled
1607 // Default: CODEC_PRIORITY_DEFAULT
1608 optional int32 codec_priority = 3;
1609 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1610 // Default: SAMPLE_RATE_NONE
1611 optional int32 sample_rate = 4;
1612 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1613 // Default: BITS_PER_SAMPLE_NONE
1614 optional int32 bits_per_sample = 5;
1615 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1616 // Default: CHANNEL_MODE_NONE
1617 optional int32 channel_mode = 6;
1618 // Codec specific values
1619 // Default 0
1620 optional int64 codec_specific_1 = 7;
1621 optional int64 codec_specific_2 = 8;
1622 optional int64 codec_specific_3 = 9;
1623 optional int64 codec_specific_4 = 10;
1624}
1625
1626/**
1627 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1628 * Each codec's capability is logged separately due to statsd restriction
1629 *
1630 * Logged from:
1631 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1632 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1633 */
1634message BluetoothA2dpCodecCapabilityChanged {
1635 // An identifier that can be used to match events for this device.
1636 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1637 // Salt: Randomly generated 256 bit value
1638 // Hash algorithm: HMAC-SHA256
1639 // Size: 32 byte
1640 // Default: null or empty if the device identifier is not known
1641 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1642 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1643 // Default SOURCE_CODEC_TYPE_INVALID
1644 optional int32 codec_type = 2;
1645 // Codec priroity, the higher the more preferred, -1 for disabled
1646 // Default: CODEC_PRIORITY_DEFAULT
1647 optional int32 codec_priority = 3;
1648 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1649 // in BluetoothCodecConfig
1650 // Default: empty and SAMPLE_RATE_NONE for individual item
1651 optional int32 sample_rate = 4;
1652 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1653 // in BluetoothCodecConfig
1654 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1655 optional int32 bits_per_sample = 5;
1656 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1657 // BluetoothCodecConfig
1658 // Default: empty and CHANNEL_MODE_NONE for individual item
1659 optional int32 channel_mode = 6;
1660 // Codec specific values
1661 // Default 0
1662 optional int64 codec_specific_1 = 7;
1663 optional int64 codec_specific_2 = 8;
1664 optional int64 codec_specific_3 = 9;
1665 optional int64 codec_specific_4 = 10;
1666}
1667
1668/**
1669 * Logs when A2DP failed to read from PCM source.
1670 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1671 *
1672 * Logged from:
1673 * system/bt
1674 */
1675message BluetoothA2dpAudioUnderrunReported {
1676 // An identifier that can be used to match events for this device.
1677 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1678 // Salt: Randomly generated 256 bit value
1679 // Hash algorithm: HMAC-SHA256
1680 // Size: 32 byte
1681 // Default: null or empty if the device identifier is not known
1682 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1683 // Encoding interval in nanoseconds
1684 // Default: 0
1685 optional int64 encoding_interval_nanos = 2;
1686 // Number of bytes of PCM data that could not be read from the source
1687 // Default: 0
1688 optional int32 num_missing_pcm_bytes = 3;
1689}
1690
1691/**
1692 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1693 * buffer queue is full and we have to drop data
1694 *
1695 * Logged from:
1696 * system/bt
1697 */
1698message BluetoothA2dpAudioOverrunReported {
1699 // An identifier that can be used to match events for this device.
1700 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1701 // Salt: Randomly generated 256 bit value
1702 // Hash algorithm: HMAC-SHA256
1703 // Size: 32 byte
1704 // Default: null or empty if the device identifier is not known
1705 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1706 // Encoding interval in nanoseconds
1707 // Default: 0
1708 optional int64 encoding_interval_nanos = 2;
1709 // Number of buffers dropped in this event
1710 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1711 // Default: 0
1712 optional int32 num_dropped_buffers = 3;
1713 // Number of encoded buffers dropped in this event
1714 // Default 0
1715 optional int32 num_dropped_encoded_frames = 4;
1716 // Number of encoded bytes dropped in this event
1717 // Default: 0
1718 optional int32 num_dropped_encoded_bytes = 5;
1719}
1720
1721/**
1722 * Logs when we receive reports regarding a device's RSSI value
1723 *
1724 * Logged from:
1725 * system/bt
1726 */
1727message BluetoothDeviceRssiReported {
1728 // An identifier that can be used to match events for this device.
1729 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1730 // Salt: Randomly generated 256 bit value
1731 // Hash algorithm: HMAC-SHA256
1732 // Size: 32 byte
1733 // Default: null or empty if the device identifier is not known
1734 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1735 // Connection handle of this connection if available
1736 // Range: 0x0000 - 0x0EFF (12 bits)
1737 // Default: 0xFFFF if the handle is unknown
1738 optional int32 connection_handle = 2;
1739 // HCI command status code if this is triggerred by hci_cmd
1740 // Default: STATUS_UNKNOWN
1741 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1742 // BR/EDR
1743 // Range: -128 ≤ N ≤ 127 (signed integer)
1744 // Units: dB
1745 // LE:
1746 // Range: -127 to 20, 127 (signed integer)
1747 // Units: dBm
1748 // Invalid when an out of range value is reported
1749 optional int32 rssi = 4;
1750}
1751
1752/**
1753 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1754 *
1755 * Logged from:
1756 * system/bt
1757 */
1758message BluetoothDeviceFailedContactCounterReported {
1759 // An identifier that can be used to match events for this device.
1760 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1761 // Salt: Randomly generated 256 bit value
1762 // Hash algorithm: HMAC-SHA256
1763 // Size: 32 byte
1764 // Default: null or empty if the device identifier is not known
1765 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1766 // Connection handle of this connection if available
1767 // Range: 0x0000 - 0x0EFF (12 bits)
1768 // Default: 0xFFFF if the handle is unknown
1769 optional int32 connection_handle = 2;
1770 // HCI command status code if this is triggerred by hci_cmd
1771 // Default: STATUS_UNKNOWN
1772 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1773 // Number of consecutive failed contacts for a connection corresponding to the Handle
1774 // Range: uint16_t, 0-0xFFFF
1775 // Default: 0xFFFFF
1776 optional int32 failed_contact_counter = 4;
1777}
1778
1779/**
1780 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1781 *
1782 * Logged from:
1783 * system/bt
1784 */
1785message BluetoothDeviceTxPowerLevelReported {
1786 // An identifier that can be used to match events for this device.
1787 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1788 // Salt: Randomly generated 256 bit value
1789 // Hash algorithm: HMAC-SHA256
1790 // Size: 32 byte
1791 // Default: null or empty if the device identifier is not known
1792 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1793 // Connection handle of this connection if available
1794 // Range: 0x0000 - 0x0EFF (12 bits)
1795 // Default: 0xFFFF if the handle is unknown
1796 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001797 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001798 // Default: STATUS_UNKNOWN
1799 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1800 // Range: -30 ≤ N ≤ 20
1801 // Units: dBm
1802 // Invalid when an out of range value is reported
1803 optional int32 transmit_power_level = 4;
1804}
Jack Heab86dbd22018-12-18 15:43:27 -08001805
Tej Singh5d991e12018-03-09 19:48:11 -08001806/**
Jack He1021a612019-01-20 21:22:46 -08001807 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1808 * receiving an HCI command from the host
1809 *
1810 * Logged from: system/bt
1811 */
1812message BluetoothHciTimeoutReported {
1813 // HCI command associated with this event
1814 // Default: CMD_UNKNOWN
1815 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1816}
1817
1818/**
1819 * Logs when we receive Bluetooth Link Quality Report event from the controller
1820 * See Android Bluetooth HCI specification for more details
1821 *
1822 * Note: all count and bytes field are counted since last event
1823 *
1824 * Logged from: system/bt
1825 */
1826message BluetoothQualityReportReported {
1827 // Quality report ID
1828 // Original type: uint8_t
1829 // Default: BQR_ID_UNKNOWN
1830 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1831 // Packet type of the connection
1832 // Original type: uint8_t
1833 // Default: BQR_PACKET_TYPE_UNKNOWN
1834 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1835 // Connection handle of the connection
1836 // Original type: uint16_t
1837 optional int32 connection_handle = 3;
1838 // Performing Role for the connection
1839 // Original type: uint8_t
1840 optional int32 connection_role = 4;
1841 // Current Transmit Power Level for the connection. This value is the same as the controller's
1842 // response to the HCI_Read_Transmit_Power_Level HCI command
1843 // Original type: uint8_t
1844 optional int32 tx_power_level = 5;
1845 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1846 // absolute receiver signal strength value
1847 // Original type: int8_t
1848 optional int32 rssi = 6;
1849 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1850 // channels used by the link currently
1851 // Original type: uint8_t
1852 optional int32 snr = 7;
1853 // Indicates the number of unused channels in AFH_channel_map
1854 // Original type: uint8_t
1855 optional int32 unused_afh_channel_count = 8;
1856 // Indicates the number of the channels which are interfered and quality is bad but are still
1857 // selected for AFH
1858 // Original type: uint8_t
1859 optional int32 afh_select_unideal_channel_count = 9;
1860 // Current Link Supervision Timeout Setting
1861 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1862 // Original type: uint16_t
1863 optional int32 lsto = 10;
1864 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1865 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1866 // 0x01 (Piconet Clock)
1867 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1868 // Original type: uint32_t
1869 optional int64 connection_piconet_clock = 11;
1870 // The count of retransmission
1871 // Original type: uint32_t
1872 optional int64 retransmission_count = 12;
1873 // The count of no RX
1874 // Original type: uint32_t
1875 optional int64 no_rx_count = 13;
1876 // The count of NAK (Negative Acknowledge)
1877 // Original type: uint32_t
1878 optional int64 nak_count = 14;
1879 // Controller timestamp of last TX ACK
1880 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1881 // Original type: uint32_t
1882 optional int64 last_tx_ack_timestamp = 15;
1883 // The count of Flow-off (STOP)
1884 // Original type: uint32_t
1885 optional int64 flow_off_count = 16;
1886 // Controller timestamp of last Flow-on (GO)
1887 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1888 // Original type: uint32_t
1889 optional int64 last_flow_on_timestamp = 17;
1890 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1891 // Original type: uint32_t
1892 optional int64 buffer_overflow_bytes = 18;
1893 // Buffer underflow count (in byte) since last event
1894 // Original type: uint32_t
1895 optional int64 buffer_underflow_bytes = 19;
1896}
1897
1898/**
1899 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1900 *
1901 * Notes:
1902 * - Each event can be partially filled as we might learn different pieces of device
1903 * information at different time
1904 * - Multiple device info events can be combined to give more complete picture
1905 * - When multiple device info events tries to describe the same information, the
1906 * later one wins
1907 *
1908 * Logged from:
1909 * packages/apps/Bluetooth
1910 */
1911message BluetoothManufacturerInfoReported {
1912 // An identifier that can be used to match events for this device.
1913 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1914 // Salt: Randomly generated 256 bit value
1915 // Hash algorithm: HMAC-SHA256
1916 // Size: 32 byte
1917 // Default: null or empty if the device identifier is not known
1918 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1919 // Where is this device info obtained from
1920 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1921 // Name of the data source
1922 // For EXTERNAL: package name of the data source
1923 // For INTERNAL: null for general case, component name otherwise
1924 optional string source_name = 3;
1925 // Name of the manufacturer of this device
1926 optional string manufacturer = 4;
1927 // Model of this device
1928 optional string model = 5;
1929 // Hardware version of this device
1930 optional string hardware_version = 6;
1931 // Software version of this device
1932 optional string software_version = 7;
1933}
1934
1935/**
1936 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1937 * device, as documented by the Bluetooth Core HCI specification
1938 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1939 * Vol 2, Part E, Page 1118
1940 *
1941 * Logged from:
1942 * system/bt
1943 */
1944message BluetoothRemoteVersionInfoReported {
1945 // Connection handle of the connection
1946 // Original type: uint16_t
1947 optional int32 connection_handle = 1;
1948 // HCI command status code
1949 // Default: STATUS_UNKNOWN
1950 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1951 // 1 byte Version of current LMP in the remote controller
1952 optional int32 lmp_version = 3;
1953 // 2 bytes LMP manufacturer code of the remote controller
1954 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1955 optional int32 lmp_manufacturer_code = 4;
1956 // 4 bytes subversion of the LMP in the remote controller
1957 optional int32 lmp_subversion = 5;
1958}
1959
1960/**
1961 * Logs when certain Bluetooth SDP attributes are discovered
1962 * Constant definitions are from:
1963 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1964 *
1965 * Current logged attributes:
1966 * - BluetoothProfileDescriptorList
1967 * - Supported Features Bitmask
1968 *
1969 * Logged from:
1970 * system/bt
1971 */
1972message BluetoothSdpAttributeReported {
1973 // An identifier that can be used to match events for this device.
1974 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1975 // Salt: Randomly generated 256 bit value
1976 // Hash algorithm: HMAC-SHA256
1977 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1978 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1979 // Original type: uint16_t
1980 optional int32 protocol_uuid = 2;
1981 // Short form UUIDs used to identify Bluetooth SDP attribute types
1982 // Original type: uint16_t
1983 optional int32 attribute_id = 3;
1984 // Attribute value for the particular attribute
1985 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1986}
1987
1988/**
1989 * Logs when bond state of a Bluetooth device changes
1990 *
1991 * Logged from:
1992 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
1993 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
1994 */
1995message BluetoothBondStateChanged {
1996 // An identifier that can be used to match events for this device.
1997 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1998 // Salt: Randomly generated 256 bit value
1999 // Hash algorithm: HMAC-SHA256
2000 // Size: 32 byte
2001 // Default: null or empty if the device identifier is not known
2002 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2003 // Preferred transport type to remote dual mode device
2004 // Default: TRANSPORT_AUTO means no preference
2005 optional android.bluetooth.TransportTypeEnum transport = 2;
2006 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2007 // Default: UNKNOWN
2008 optional android.bluetooth.DeviceTypeEnum type = 3;
2009 // Current bond state (NONE, BONDING, BONDED)
2010 // Default: BOND_STATE_UNKNOWN
2011 optional android.bluetooth.BondStateEnum bond_state = 4;
2012 // Bonding sub state
2013 // Default: BOND_SUB_STATE_UNKNOWN
2014 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2015 // Unbond Reason
2016 // Default: UNBOND_REASON_UNKNOWN
2017 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2018}
2019
2020/**
2021 * Logs there is an event related Bluetooth classic pairing
2022 *
2023 * Logged from:
2024 * system/bt
2025 */
2026message BluetoothClassicPairingEventReported {
2027 // An identifier that can be used to match events for this device.
2028 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2029 // Salt: Randomly generated 256 bit value
2030 // Hash algorithm: HMAC-SHA256
2031 // Size: 32 byte
2032 // Default: null or empty if the device identifier is not known
2033 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2034 // Connection handle of this connection if available
2035 // Range: 0x0000 - 0x0EFF (12 bits)
2036 // Default: 0xFFFF if the handle is unknown
2037 optional int32 connection_handle = 2;
2038 // HCI command associated with this event
2039 // Default: CMD_UNKNOWN
2040 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2041 // HCI event associated with this event
2042 // Default: EVT_UNKNOWN
2043 optional android.bluetooth.hci.EventEnum hci_event = 4;
2044 // HCI command status code if this is triggerred by hci_cmd
2045 // Default: STATUS_UNKNOWN
2046 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2047 // HCI reason code associated with this event
2048 // Default: STATUS_UNKNOWN
2049 optional android.bluetooth.hci.StatusEnum reason_code = 6;
2050}
2051
2052/**
2053 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2054 *
2055 * Logged from:
2056 * system/bt
2057 */
2058message BluetoothSmpPairingEventReported {
2059 // An identifier that can be used to match events for this device.
2060 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2061 // Salt: Randomly generated 256 bit value
2062 // Hash algorithm: HMAC-SHA256
2063 // Size: 32 byte
2064 // Default: null or empty if the device identifier is not known
2065 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2066 // SMP command sent or received over L2CAP
2067 // Default: CMD_UNKNOWN
2068 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2069 // Whether this command is sent or received
2070 // Default: DIRECTION_UNKNOWN
2071 optional android.bluetooth.DirectionEnum direction = 3;
2072 // SMP failure reason code
2073 // Default: PAIRING_FAIL_REASON_DEFAULT
2074 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2075}
2076
2077/**
Jack He815cdba2019-01-30 17:24:55 -08002078 * Logs when a Bluetooth socket’s connection state changed
2079 *
2080 * Logged from:
2081 * system/bt
2082 */
2083message BluetoothSocketConnectionStateChanged {
2084 // An identifier that can be used to match events for this device.
2085 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2086 // Salt: Randomly generated 256 bit value
2087 // Hash algorithm: HMAC-SHA256
2088 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002089 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002090 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002091 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002092 // Default 0 when unknown or don't care
2093 optional int32 port = 2;
2094 // Socket type as mentioned in
2095 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2096 // Default: SOCKET_TYPE_UNKNOWN
2097 optional android.bluetooth.SocketTypeEnum type = 3;
2098 // Socket connection state
2099 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2100 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2101 // Number of bytes sent to remote device during this connection
2102 optional int64 tx_bytes = 5;
2103 // Number of bytes received from remote device during this connection
2104 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002105 // Socket owner's UID
2106 optional int32 uid = 7 [(is_uid) = true];
2107 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2108 // |port| must be spawned by |server_port|
2109 // Default 0 when unknown or don't care
2110 optional int32 server_port = 8;
2111 // Whether this is a server listener socket
2112 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002113}
2114
2115/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002116 * Logs when something is plugged into or removed from the USB-C connector.
2117 *
2118 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002119 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002120 */
2121message UsbConnectorStateChanged {
2122 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002123 STATE_DISCONNECTED = 0;
2124 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002125 }
2126 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002127 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002128 // Last active session in ms.
2129 // 0 when the port is in connected state.
2130 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002131}
2132
2133/**
2134 * Logs the reported speaker impedance.
2135 *
2136 * Logged from:
2137 * Vendor audio implementation.
2138 */
2139message SpeakerImpedanceReported {
2140 optional int32 speaker_location = 1;
2141 optional int32 impedance = 2;
2142}
2143
2144/**
2145 * Logs the report of a failed hardware.
2146 *
2147 * Logged from:
2148 * Vendor HALs.
2149 *
2150 */
2151message HardwareFailed {
2152 enum HardwareType {
2153 HARDWARE_FAILED_UNKNOWN = 0;
2154 HARDWARE_FAILED_MICROPHONE = 1;
2155 HARDWARE_FAILED_CODEC = 2;
2156 HARDWARE_FAILED_SPEAKER = 3;
2157 HARDWARE_FAILED_FINGERPRINT = 4;
2158 }
2159 optional HardwareType hardware_type = 1;
2160
Maggie White6dcd8572019-01-31 14:11:50 -08002161 /**
2162 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002163 * the same hardware_type. The specific locations are vendor defined integers,
2164 * referring to board-specific numbering schemes.
2165 */
2166 optional int32 hardware_location = 2;
2167
Maggie White6dcd8572019-01-31 14:11:50 -08002168 /**
2169 * failure_code is specific to the HardwareType of the failed hardware.
2170 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002171 */
Maggie White6dcd8572019-01-31 14:11:50 -08002172 enum HardwareErrorCode {
2173 UNKNOWN = 0;
2174 COMPLETE = 1;
2175 SPEAKER_HIGH_Z = 2;
2176 SPEAKER_SHORT = 3;
2177 FINGERPRINT_SENSOR_BROKEN = 4;
2178 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Andrew Chant28d627e2018-02-22 15:17:05 -08002179 }
2180 optional int32 failure_code = 3;
2181}
2182
2183/**
2184 * Log an event when the device has been physically dropped.
2185 * Reported from the /vendor partition.
2186 */
2187message PhysicalDropDetected {
2188 // Confidence that the event was actually a drop, 0 -> 100
2189 optional int32 confidence_pctg = 1;
2190 // Peak acceleration of the drop, in 1/1000s of a g.
2191 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002192 // Duration of freefall in ms
2193 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002194}
2195
2196/**
2197 * Log bucketed battery charge cycles.
2198 *
2199 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002200 * a given charge point. For example, if 10 cycle buckets are
2201 * initialized, bucket 1 is the lowest 1/10th of the battery,
2202 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002203 *
2204 * Logged from:
2205 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2206 */
2207message ChargeCyclesReported {
2208 optional int32 cycle_bucket_1 = 1;
2209 optional int32 cycle_bucket_2 = 2;
2210 optional int32 cycle_bucket_3 = 3;
2211 optional int32 cycle_bucket_4 = 4;
2212 optional int32 cycle_bucket_5 = 5;
2213 optional int32 cycle_bucket_6 = 6;
2214 optional int32 cycle_bucket_7 = 7;
2215 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002216 optional int32 cycle_bucket_9 = 9;
2217 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002218}
2219
2220/**
Howard Roa46b6582018-09-18 16:45:02 -07002221 * Log battery health snapshot.
2222 *
2223 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2224 * are snapshotted periodically over 24hrs.
2225 */
2226message BatteryHealthSnapshot {
2227 enum BatterySnapshotType {
2228 UNKNOWN = 0;
2229 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2230 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2231 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2232 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2233 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2234 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2235 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2236 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2237 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2238 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2239 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2240 }
2241 optional BatterySnapshotType type = 1;
2242 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002243 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002244 // Voltage Battery Voltage, in microVolts.
2245 optional int32 voltage_micro_volt = 3;
2246 // Current Battery current, in microAmps.
2247 optional int32 current_micro_amps = 4;
2248 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2249 optional int32 open_circuit_micro_volt = 5;
2250 // Resistance Battery Resistance, in microOhms.
2251 optional int32 resistance_micro_ohm = 6;
2252 // Level Battery Level, as % of full.
2253 optional int32 level_percent = 7;
2254}
2255
2256/**
2257 * Log slow I/O operations on the primary storage.
2258 */
2259message SlowIo {
2260 // Classifications of IO Operations.
2261 enum IoOperation {
2262 UNKNOWN = 0;
2263 READ = 1;
2264 WRITE = 2;
2265 UNMAP = 3;
2266 SYNC = 4;
2267 }
2268 optional IoOperation operation = 1;
2269
2270 // The number of slow IO operations of this type over 24 hours.
2271 optional int32 count = 2;
2272}
2273
2274/**
2275 * Log battery caused shutdown with the last recorded voltage.
2276 */
2277message BatteryCausedShutdown {
2278 // The last recorded battery voltage prior to shutdown.
2279 optional int32 last_recorded_micro_volt = 1;
2280}
2281
2282/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002283 * Logs the duration of a davey (jank of >=700ms) when it occurs
2284 *
2285 * Logged from:
2286 * frameworks/base/libs/hwui/JankTracker.cpp
2287 */
2288message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002289 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002290 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002291
Tej Singhbb8554a2018-01-26 11:59:14 -08002292 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002293 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002294}
2295
2296/**
Bookatze5885242017-10-24 20:10:31 -07002297 * Logs phone signal strength changes.
2298 *
2299 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002300 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002301 */
2302message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002303 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2304 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002305}
2306
Yangster4ccebea2018-10-09 17:09:02 -07002307
2308/**
2309 * Logs when the phone state, sim state or signal strength changes
2310 *
2311 * Logged from:
2312 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2313 */
2314message PhoneServiceStateChanged {
2315 optional android.telephony.ServiceStateEnum state = 1;
2316 optional android.telephony.SimStateEnum sim_state = 2;
2317 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2318}
2319
2320/**
2321 * Logs when the phone becomes on or off.
2322 *
2323 * Logged from:
2324 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2325 */
2326message PhoneStateChanged {
2327 enum State {
2328 OFF = 0;
2329 ON = 1;
2330 }
2331 optional State state = 1;
2332}
2333
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002334message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002335 optional android.stats.launcher.LauncherAction action = 1;
2336 optional android.stats.launcher.LauncherState src_state = 2;
2337 optional android.stats.launcher.LauncherState dst_state = 3;
2338 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002339 optional bool is_swipe_up_enabled = 5;
2340}
2341
David Chenc28b2bb2017-10-24 12:52:52 -07002342/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002343 * Logs when Settings UI has changed.
2344 *
2345 * Logged from:
2346 * packages/apps/Settings
2347 */
2348message SettingsUIChanged {
2349 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002350 * Where this SettingsUIChange event comes from. For example, if
2351 * it's a PAGE_VISIBLE event, where the page is opened from.
2352 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002353 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002354
2355 /**
2356 * What the UI action is.
2357 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002358 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002359
2360 /**
2361 * Where the action is happening
2362 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002363 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002364
2365 /**
2366 * What preference changed in this event.
2367 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002368 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002369
2370 /**
2371 * The new value of the changed preference.
2372 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002373 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002374}
2375
2376/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002377 * Logs basic timing information about touch events.
2378 * Reported at most every 5 minutes while device is being interacted with.
2379 *
2380 * Logged from:
2381 * frameworks/native/services/inputflinger
2382 */
2383message TouchEventReported {
2384 /**
2385 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2386 * and the standard deviation of latency between the kernel and framework
2387 * for touchscreen events. The units are microseconds.
2388 *
2389 * The number is measured as the difference between the time at which
2390 * the input event was received in the evdev driver,
2391 * and the time at which the input event was received in EventHub.
2392 */
2393 // Minimum value
2394 optional float latency_min_micros = 1;
2395 // Maximum value
2396 optional float latency_max_micros = 2;
2397 // Average value
2398 optional float latency_mean_micros = 3;
2399 // Standard deviation
2400 optional float latency_stdev_micros = 4;
2401}
2402
2403/**
David Chenc28b2bb2017-10-24 12:52:52 -07002404 * Logs that a setting was updated.
2405 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002406 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002407 * The tag and is_default allow resetting of settings to default values based on the specified
2408 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2409 */
2410message SettingChanged {
2411 // The name of the setting.
2412 optional string setting = 1;
2413
2414 // The change being imposed on this setting. May represent a number, eg "3".
2415 optional string value = 2;
2416
2417 // The new value of this setting. For most settings, this is same as value. For some settings,
2418 // value is +X or -X where X represents an element in a set. For example, if the previous value
2419 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2420 // The +/- feature is currently only used for location_providers_allowed.
2421 optional string new_value = 3;
2422
2423 // The previous value of this setting.
2424 optional string prev_value = 4;
2425
2426 // The tag used with the is_default for resetting sets of settings. This is generally null.
2427 optional string tag = 5;
2428
Bookatz90867622018-01-31 15:05:57 -08002429 // True if this setting with tag should be resettable.
2430 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002431
David Chenbd789912018-03-16 17:19:55 -07002432 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002433 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002434
2435 enum ChangeReason {
2436 UPDATED = 1; // Updated can be an insertion or an update.
2437 DELETED = 2;
2438 }
2439 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002440}
Chenjie Yub3dda412017-10-24 13:41:59 -07002441
Chenjie Yu05013b32017-11-21 10:21:41 -08002442/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002443 * Logs activity going to foreground or background
2444 *
2445 * Logged from:
2446 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2447 */
2448message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002449 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002450 optional string pkg_name = 2;
2451 optional string class_name = 3;
2452
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002453 enum State {
2454 BACKGROUND = 0;
2455 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002456 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002457 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002458}
David Chenc8a43242017-10-17 16:23:28 -07002459
2460/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002461 * Logs when a volume entered low Storage state.
2462 * Logged from:
2463 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2464 */
2465message LowStorageStateChanged {
2466 // Volume that ran out of storage.
2467 optional string volume_description = 1;
2468
2469 enum State {
2470 UNKNOWN = 0;
2471 OFF = 1;
2472 ON = 2;
2473 }
2474 optional State state = 2;
2475}
2476
2477/**
2478 * Logs when an app is downgraded.
2479 * Logged from:
2480 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2481 */
2482message AppDowngraded {
2483 optional string package_name = 1;
2484 // Size of the package (all data) before being downgraded.
2485 optional int64 size_in_bytes_before = 2;
2486 // Size of the package (all data) after being downgraded.
2487 optional int64 size_in_bytes_after = 3;
2488
2489 optional bool aggressive = 4;
2490}
2491
2492/**
2493 * Logs when an app is optimized after being downgraded.
2494 * Logged from:
2495 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2496 */
2497message AppOptimizedAfterDowngraded {
2498 optional string package_name = 1;
2499}
2500
2501/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002502 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002503 * Logged from:
2504 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2505 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002506message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002507 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002508
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002509 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002510
2511 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002512 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002513 optional string process_name = 3;
2514
2515 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002516 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002517
2518 optional string package_name = 5;
2519
2520 enum InstantApp {
2521 UNAVAILABLE = 0;
2522 FALSE = 1;
2523 TRUE = 2;
2524 }
2525 optional InstantApp is_instant_app = 6;
2526
2527 enum ForegroundState {
2528 UNKNOWN = 0;
2529 BACKGROUND = 1;
2530 FOREGROUND = 2;
2531 }
2532 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002533
2534 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002535}
David Chen9e3808c2017-11-20 17:25:34 -08002536
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002537/**
2538 * Logs when a WTF (What a Terrible Failure) happened.
2539 * Logged from:
2540 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2541 */
2542message WTFOccurred {
2543 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002544
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002545 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002546
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002547 // The name of the process.
2548 // system_server if it is not by an app
2549 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002550
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002551 // The pid if available. -1 means not available.
2552 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002553
2554 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002555}
2556
2557/**
2558 * Logs when system server reports low memory.
2559 * Logged from:
2560 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2561 */
2562message LowMemReported {
2563}
2564
2565/**
2566 * Logs when an app ANR (App Not Responding) occurs.
2567 * Logged from:
2568 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2569 */
2570message ANROccurred {
2571 optional int32 uid = 1 [(is_uid) = true];
2572
2573 optional string process_name = 2;
2574
2575 optional string short_component_name = 3;
2576
2577 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002578
2579 enum InstantApp {
2580 UNAVAILABLE = 0;
2581 FALSE = 1;
2582 TRUE = 2;
2583 }
2584 optional InstantApp is_instant_app = 5;
2585
2586 enum ForegroundState {
2587 UNKNOWN = 0;
2588 BACKGROUND = 1;
2589 FOREGROUND = 2;
2590 }
2591 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002592
2593 optional android.server.ErrorSource error_source = 7;
2594
2595 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002596}
2597
Bookatza7020bd2018-08-28 16:29:35 -07002598/**
2599 * Logs when the vibrator state changes.
2600 * Logged from:
2601 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2602 */
2603message VibratorStateChanged {
2604 repeated AttributionNode attribution_node = 1;
2605
2606 enum State {
2607 OFF = 0;
2608 ON = 1;
2609 }
2610 optional State state = 2;
2611
2612 // Duration (in milliseconds) requested to keep the vibrator on.
2613 // Only applicable for State == ON.
2614 optional int64 duration_millis = 3;
2615}
2616
David Chen0a368b22017-12-06 16:28:16 -08002617/*
2618 * Allows other apps to push events into statsd.
2619 * Logged from:
2620 * frameworks/base/core/java/android/util/StatsLog.java
2621 */
David Chen0b5c90c2018-01-25 16:51:49 -08002622message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002623 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002624 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002625
2626 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2627 optional int32 label = 2;
2628
2629 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2630 // predicates for the metrics).
2631 enum State {
2632 UNKNOWN = 0;
2633 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2634 STOP = 2;
2635 START = 3;
2636 }
2637 optional State state = 3;
2638}
2639
David Chen9e3808c2017-11-20 17:25:34 -08002640/**
Bookatz7948c872018-09-04 12:58:33 -07002641 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2642 * For example, this could be due to the user manually changing the time.
2643 *
2644 * Logged from:
2645 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2646 */
2647message WallClockTimeShifted {
2648 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2649 optional int64 wall_clock_timestamp_millis = 1;
2650}
2651
2652/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002653 * Logs when statsd detects an anomaly.
2654 *
2655 * Logged from:
2656 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2657 */
2658message AnomalyDetected {
2659 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002660 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002661
Yangster-mac94e197c2018-01-02 16:03:03 -08002662 // Id of the config whose anomaly detection alert fired.
2663 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002664
Yangster-mac94e197c2018-01-02 16:03:03 -08002665 // Id of the alert (i.e. name of the anomaly that was detected).
2666 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002667}
2668
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002669message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002670 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002671 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002672
2673 // The app package name.
2674 optional string pkg_name = 2;
2675
2676 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002677 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002678 WARM = 1;
2679 HOT = 2;
2680 COLD = 3;
2681 }
2682 // The transition type.
2683 optional TransitionType type = 3;
2684
2685 // The activity name.
2686 optional string activity_name = 4;
2687
2688 // The name of the calling app. Empty if not set.
2689 optional string calling_pkg_name = 5;
2690
2691 // Whether the app is an instant app.
2692 optional bool is_instant_app = 6;
2693
2694 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002695 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002696
Bookatz80d11a02018-01-16 10:46:35 -08002697 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002698
David Chen0b5c90c2018-01-25 16:51:49 -08002699 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002700 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002701 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002702 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002703 optional int32 bind_application_delay_millis = 11;
2704 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002705
2706 // Empty if not set.
2707 optional string launch_token = 13;
2708
Calin Juravle759fbda2018-02-20 19:52:30 +00002709 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002710 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002711
2712 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002713 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002714}
2715
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002716message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002717 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002718 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002719
2720 // The app package name.
2721 optional string pkg_name = 2;
2722
2723 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002724 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002725 WARM = 1;
2726 HOT = 2;
2727 COLD = 3;
2728 }
2729 // The transition type.
2730 optional TransitionType type = 3;
2731
2732 // The activity name.
2733 optional string activity_name = 4;
2734}
2735
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002736message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002737 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002738 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002739
2740 // The app package name.
2741 optional string pkg_name = 2;
2742
2743 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002744 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002745 WITH_BUNDLE = 1;
2746 WITHOUT_BUNDLE = 2;
2747 }
2748 // The transition type.
2749 optional TransitionType type = 3;
2750
2751 // The activity name.
2752 optional string activity_name = 4;
2753
2754 optional bool transition_process_running = 5;
2755
2756 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002757 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002758}
2759
Bookatz8fcd09a2017-12-18 13:01:10 -08002760/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002761 * Logs a picture-in-picture action
2762 * Logged from:
2763 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2764 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2765 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2766 */
2767message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002768 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002769 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002770
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002771 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002772
Chenjie Yu52cacc62017-12-08 18:11:45 -08002773 enum State {
2774 ENTERED = 1;
2775 EXPANDED_TO_FULL_SCREEN = 2;
2776 MINIMIZED = 3;
2777 DISMISSED = 4;
2778 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002779 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002780}
2781
2782/**
Chenjie Yue8904192017-12-08 19:12:57 -08002783 * Logs overlay action
2784 * Logged from:
2785 * services/core/java/com/android/server/wm/Session.java
2786 */
2787message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002788 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002789
2790 optional string package_name = 2;
2791
2792 optional bool using_alert_window = 3;
2793
2794 enum State {
2795 ENTERED = 1;
2796 EXITED = 2;
2797 }
2798 optional State state = 4;
2799}
2800
Chenjie Yuccfe6452018-01-30 11:33:21 -08002801/*
2802 * Logs foreground service starts and stops.
2803 * Note that this is not when a service starts or stops, but when it is
2804 * considered foreground.
2805 * Logged from
2806 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2807 */
2808message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002809 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002810 // package_name + "/" + class_name
2811 optional string short_name = 2;
2812
2813 enum State {
2814 ENTER = 1;
2815 EXIT = 2;
2816 }
2817 optional State state = 3;
2818}
2819
Chenjie Yue8904192017-12-08 19:12:57 -08002820/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002821 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2822 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2823 * attributed back to the parent (host) uid. One example is Chrome.
2824 *
2825 * Logged from:
2826 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2827 */
2828message IsolatedUidChanged {
2829 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002830 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002831 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002832 optional int32 parent_uid = 1;
2833
2834 optional int32 isolated_uid = 2;
2835
2836 // We expect an isolated uid to be removed before if it's used for another parent uid.
2837 enum Event {
2838 REMOVED = 0;
2839 CREATED = 1;
2840 }
2841 optional Event event = 3;
2842}
2843
2844/*
2845 * Logs the reception of an incoming network packet causing the main system to wake up for
2846 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2847 * and processed by WakeupController.cpp.
2848 */
2849message PacketWakeupOccurred {
2850 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2851 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002852 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002853 // The interface name on which the packet was received.
2854 optional string iface = 2;
2855 // The ethertype value of the packet.
2856 optional int32 ethertype = 3;
2857 // String representation of the destination MAC address of the packet.
2858 optional string destination_hardware_address = 4;
2859 // String representation of the source address of the packet if this was an IP packet.
2860 optional string source_ip = 5;
2861 // String representation of the destination address of the packet if this was an IP packet.
2862 optional string destination_ip = 6;
2863 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2864 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2865 // families.
2866 optional int32 ip_next_header = 7;
2867 // The source port if this was a TCP or UDP packet.
2868 optional int32 source_port = 8;
2869 // The destination port if this was a TCP or UDP packet.
2870 optional int32 destination_port = 9;
2871}
2872
2873/*
2874 * Logs the memory stats for an app on startup.
2875 * Logged from:
2876 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2877 */
2878message AppStartMemoryStateCaptured {
2879 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002880 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002881
2882 // The process name.
2883 optional string process_name = 2;
2884
2885 // The activity name.
2886 optional string activity_name = 3;
2887
2888 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002889 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002890
2891 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002892 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002893
2894 // RSS
2895 optional int64 rss_in_bytes = 6;
2896
2897 // CACHE
2898 optional int64 cache_in_bytes = 7;
2899
2900 // SWAP
2901 optional int64 swap_in_bytes = 8;
2902}
2903
2904/*
2905 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2906 * for LMK event.
2907 * Logged from:
2908 * system/core/lmkd/lmkd.c
2909 */
2910message LmkStateChanged {
2911 enum State {
2912 UNKNOWN = 0;
2913 START = 1;
2914 STOP = 2;
2915 }
2916 optional State state = 1;
2917}
2918
2919/*
2920 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2921 * Logged from:
2922 * system/core/lmkd/lmkd.c
2923 */
2924message LmkKillOccurred {
2925 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002926 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002927
2928 // The process name.
2929 optional string process_name = 2;
2930
2931 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002932 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002933
2934 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002935 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002936
2937 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002938 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002939
2940 // RSS
2941 optional int64 rss_in_bytes = 6;
2942
2943 // CACHE
2944 optional int64 cache_in_bytes = 7;
2945
2946 // SWAP
2947 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002948
2949 // The elapsed real time of start of the process.
2950 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002951}
2952
Rajeev Kumar51b54602018-03-01 12:18:26 -08002953/*
2954 * Logs when the ActivityManagerService detects that an app died.
2955 *
2956 * Logged from:
2957 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2958 */
2959message AppDied {
2960 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002961 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002962}
2963
Howard Ro21a039c2018-08-06 14:55:47 -07002964/**
2965 * An atom for generic metrics logging. Available from Android Q.
2966 */
2967message GenericAtom {
2968 // The uid of the application that sent this custom atom.
2969 optional int32 uid = 1 [(is_uid) = true];
2970
2971 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002972 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002973}
2974
Tej Singhd6d6d772018-09-05 17:41:25 -07002975/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002976 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002977 *
2978 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002979 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002980 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002981message BiometricAcquired {
2982 // Biometric modality that was acquired.
2983 optional android.hardware.biometrics.ModalityEnum modality = 1;
2984 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
2985 optional int32 user = 2;
2986 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
2987 optional bool is_crypto = 3;
2988 // Action that the device is performing. Acquired messages are only expected for enroll and
2989 // authenticate. Other actions may indicate an error.
2990 optional android.hardware.biometrics.ActionEnum action = 4;
2991 // The client that this acquisition was received for.
2992 optional android.hardware.biometrics.ClientEnum client = 5;
2993 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
2994 optional int32 acquire_info = 6;
2995 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
2996 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07002997}
2998
2999/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003000 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003001 *
3002 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003003 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003004 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003005message BiometricAuthenticated {
3006 // Biometric modality that was used.
3007 optional android.hardware.biometrics.ModalityEnum modality = 1;
3008 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3009 optional int32 user = 2;
3010 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3011 // storage.
3012 optional bool is_crypto = 3;
3013 // The client that this acquisition was received for.
3014 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003015 // If authentication requires user confirmation. See BiometricPrompt's
3016 // setRequireConfirmation(bool) method.
3017 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003018
Kevin Chyn1741a072019-01-17 11:54:40 -08003019 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003020 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003021 REJECTED = 1;
3022 PENDING_CONFIRMATION = 2;
3023 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003024 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003025
3026 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003027 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003028 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3029 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3030 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3031 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003032 optional int64 latency_millis = 7;
Kevin Chyn1741a072019-01-17 11:54:40 -08003033}
3034
3035/**
3036 * Logs when a biometric error occurs.
3037 *
3038 * Logged from:
3039 * frameworks/base/services/core/java/com/android/server/biometrics
3040 */
3041message BiometricErrorOccurred {
3042 // Biometric modality that was used.
3043 optional android.hardware.biometrics.ModalityEnum modality = 1;
3044 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3045 optional int32 user = 2;
3046 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3047 optional bool is_crypto = 3;
3048 // Action that the device is performing.
3049 optional android.hardware.biometrics.ActionEnum action = 4;
3050 // The client that this acquisition was received for.
3051 optional android.hardware.biometrics.ClientEnum client = 5;
3052 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3053 // are unique to modality.
3054 optional int32 error_info = 6;
3055 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3056 // by the vendor and not specified by the HIDL interface.
3057 optional int32 error_info_vendor = 7;
3058}
3059
3060/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003061 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003062 * Logged from:
3063 * frameworks/base/services/core/java/com/android/server/biometrics
3064 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003065message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003066 // Biometric modality.
3067 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003068 // Type of issue detected.
3069 optional android.hardware.biometrics.IssueEnum issue = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07003070}
Howard Ro688ae182018-09-25 00:09:36 -07003071
3072message Notification {
3073
3074 // Type of notification event.
3075 enum Type {
3076 TYPE_UNKNOWN = 0;
3077 // Notification became visible to the user.
3078 TYPE_OPEN = 1;
3079 // Notification became hidden.
3080 TYPE_CLOSE = 2;
3081 // Notification switched to detail mode.
3082 TYPE_DETAIL = 3;
3083 // Notification was clicked.
3084 TYPE_ACTION = 4;
3085 // Notification was dismissed.
3086 TYPE_DISMISS = 5;
3087 // Notification switched to summary mode. The enum value of 14 is to
3088 // match that of metrics_constants.
3089 TYPE_COLLAPSE = 14;
3090 }
3091 optional Type type = 1;
3092
3093 // Package name associated with the notification.
3094 optional string package_name = 2;
3095
3096 // Tag associated with notification.
3097 optional string tag = 3;
3098
3099 // Application-supplied ID associated with the notification.
3100 optional int32 id = 4;
3101
3102 // Index of notification in the notification panel.
3103 optional int32 shade_index = 5;
3104
3105 // The number of notifications in the notification panel.
3106 optional int32 shade_count = 6;
3107
3108 // Importance for the notification.
3109 optional int32 importance = 7;
3110
3111 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07003112 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07003113
3114 // Importance for the notification channel.
3115 optional int32 channel_importance = 9;
3116
Howard Ro183c2bd2018-10-18 13:52:10 -07003117 // Application-supplied ID associated with the notifications group.
3118 optional string group_id = 10;
3119
Howard Ro688ae182018-09-25 00:09:36 -07003120 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07003121 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07003122
Howard Ro183c2bd2018-10-18 13:52:10 -07003123 // Reason for dismissal of a notification. This field is only meaningful for
3124 // TYPE_DISMISS events.
3125 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07003126
Howard Ro183c2bd2018-10-18 13:52:10 -07003127 // The first post time of notification, stable across updates.
3128 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07003129
Howard Ro183c2bd2018-10-18 13:52:10 -07003130 // The most recent interruption time, or the creation time if no updates.
3131 // Differs from update_millis because updates are filtered based on whether
3132 // they actually interrupted the user.
3133 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07003134
Howard Ro183c2bd2018-10-18 13:52:10 -07003135 // The most recent update time, or the creation time if no updates.
3136 optional int64 update_millis = 15;
3137
3138 // The most recent visibility event.
3139 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07003140}
3141
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003142/*
Tej Singh0d176952019-01-16 19:10:54 -08003143 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003144 */
Tej Singh0d176952019-01-16 19:10:54 -08003145message FlagFlipUpdateOccurred {
3146 // If the event is from a flag config package, specify the package name.
3147 optional string flag_flip_package_name = 1;
3148
3149 // The order id of the package
3150 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003151}
3152
3153/*
3154 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003155 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003156 */
3157message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003158 // Name of the train.
3159 optional string train_name = 1;
3160 // Version code for a "train" of packages that need to be installed atomically
3161 optional int64 train_version_code = 2;
3162 // After installation of this package, device requires a restart.
3163 optional bool requires_staging = 3;
3164 // Rollback should be enabled for this install.
3165 optional bool rollback_enabled = 4;
3166 // Requires low latency monitoring if possible.
3167 optional bool requires_low_latency_monitor = 5;
3168
Yangster-macb89807e2018-11-15 21:10:57 -08003169 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003170 UNKNOWN = 0;
3171 INSTALL_REQUESTED = 1;
3172 INSTALL_STARTED = 2;
3173 INSTALL_STAGED_NOT_READY = 3;
3174 INSTALL_STAGED_READY = 4;
3175 INSTALL_SUCCESS = 5;
3176 INSTALL_FAILURE = 6;
3177 INSTALL_CANCELLED = 7;
3178 INSTALLER_ROLLBACK_REQUESTED = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003179 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003180 optional State state = 6;
Yangster-macb89807e2018-11-15 21:10:57 -08003181}
3182
Maggie Whitefc1aa592018-11-28 21:55:23 -08003183/** Represents USB port overheat event. */
3184message UsbPortOverheatEvent {
3185 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3186 optional int32 plug_temperature_deci_c = 1;
3187
3188 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3189 optional int32 max_temperature_deci_c = 2;
3190
3191 /* Time between USB plug event and overheat threshold trip, in seconds. */
3192 optional int32 time_to_overheat_secs = 3;
3193
3194 /* Time between overheat threshold trip and hysteresis, in seconds. */
3195 optional int32 time_to_hysteresis_secs = 4;
3196
3197 /* Time between hysteresis and active mitigation ending, in seconds. */
3198 optional int32 time_to_inactive_secs = 5;
3199};
3200
Maggie White8735b852019-01-18 11:40:49 -08003201/**
3202 * Logs total effective full charge and discharge cycles on a battery.
3203 * Here are some examples of one effective cycle:
3204 * 1) the battery charges from 0% to 100% and drains back to 0%,
3205 * 2) charging from 50% to 100% and draining back to 50% twice.
3206 * Pulled from:
3207 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3208 */
3209message BatteryCycleCount {
3210 /* Number of total charge and discharge cycles on the system battery. */
3211 optional int32 cycle_count = 1;
3212}
3213
Yangster-macb89807e2018-11-15 21:10:57 -08003214/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003215 * Logs when a connection becomes available and lost.
3216 * Logged in StatsCompanionService.java
3217 */
3218message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003219 // Id of the network.
3220 optional int32 net_id = 1;
3221
3222 enum State {
3223 UNKNOWN = 0;
3224 CONNECTED = 1;
3225 DISCONNECTED = 2;
3226 }
3227 // Connected state of a network.
3228 optional State state = 2;
3229}
3230
3231/**
3232 * Logs when a service starts and stops.
3233 * Logged from:
3234 * services/core/java/com/android/server/am/ActiveServices.java
3235 */
3236message ServiceStateChanged {
3237
3238 optional int32 uid = 1 [(is_uid) = true];
3239
3240 optional string package_name = 2;
3241
3242 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003243
3244 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003245 START = 1;
3246 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003247 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003248
3249 optional State state = 4;
3250}
3251
3252/**
3253 * Logs when a service is launched.
3254 * Logged from:
3255 * services/core/java/com/android/server/am/ActiveServices.java
3256 */
3257message ServiceLaunchReported {
3258
3259 optional int32 uid = 1 [(is_uid) = true];
3260
3261 optional string package_name = 2;
3262
3263 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003264}
Howard Ro688ae182018-09-25 00:09:36 -07003265
Chenjie Yubbcbc602018-02-05 16:51:52 -08003266//////////////////////////////////////////////////////////////////////
3267// Pulled atoms below this line //
3268//////////////////////////////////////////////////////////////////////
3269
3270/**
David Chenc8a43242017-10-17 16:23:28 -07003271 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3272 *
3273 * Pulled from:
3274 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3275 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003276message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003277 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003278
3279 optional int64 rx_bytes = 2;
3280
3281 optional int64 rx_packets = 3;
3282
3283 optional int64 tx_bytes = 4;
3284
3285 optional int64 tx_packets = 5;
3286}
3287
3288/**
3289 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3290 *
3291 * Pulled from:
3292 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3293 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003294message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003295 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003296
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003297 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3298 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003299
3300 optional int64 rx_bytes = 3;
3301
3302 optional int64 rx_packets = 4;
3303
3304 optional int64 tx_bytes = 5;
3305
3306 optional int64 tx_packets = 6;
3307}
3308
3309/**
3310 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3311 *
3312 * Pulled from:
3313 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3314 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003315message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003316 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003317
3318 optional int64 rx_bytes = 2;
3319
3320 optional int64 rx_packets = 3;
3321
3322 optional int64 tx_bytes = 4;
3323
3324 optional int64 tx_packets = 5;
3325}
3326
3327/**
3328 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3329 *
3330 * Pulled from:
3331 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3332 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003333message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003334 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003335
Yao Chenc40a19d2018-03-15 16:48:25 -07003336 // 1 denotes foreground and 0 denotes background. This is called Set in
3337 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003338 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003339
3340 optional int64 rx_bytes = 3;
3341
3342 optional int64 rx_packets = 4;
3343
3344 optional int64 tx_bytes = 5;
3345
3346 optional int64 tx_packets = 6;
3347}
3348
3349/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003350 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3351 *
3352 * Pulled from:
3353 * StatsCompanionService
3354 */
3355message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003356 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003357
3358 optional int64 rx_bytes = 2;
3359
3360 optional int64 tx_bytes = 3;
3361}
3362
3363/**
David Chenc8a43242017-10-17 16:23:28 -07003364 * Pulls the kernel wakelock durations. This atom is adapted from
3365 * android/internal/os/KernelWakelockStats.java
3366 *
3367 * Pulled from:
3368 * StatsCompanionService using KernelWakelockReader.
3369 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003370message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003371 optional string name = 1;
3372
3373 optional int32 count = 2;
3374
3375 optional int32 version = 3;
3376
Yangster-maca8a30442018-10-13 23:46:34 -07003377 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003378}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003379
Chenjie Yu05013b32017-11-21 10:21:41 -08003380/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003381 * Pulls low power state information. If power.stats HAL is not available, this
3382 * includes platform and subsystem sleep state information,
3383 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3384 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003385 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003386 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003387 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3388 * as defined in:
3389 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003390 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003391message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003392 // Subsystem name
3393 optional string subsystem_name = 1;
3394 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3395 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003396 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3397 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003398 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003399 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003400 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003401 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003402 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003403}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003404
Chenjie Yu05013b32017-11-21 10:21:41 -08003405/**
Bookatz92da2832018-11-01 18:10:03 -07003406 * Pulls on-device power measurement information.
3407 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3408 * Pulled from:
3409 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3410 */
3411message OnDevicePowerMeasurement {
3412 // Name of the subsystem (to which the rail belongs).
3413 optional string subsystem_name = 1;
3414
3415 // Rail name. The rail lies within the subsystem.
3416 optional string rail_name = 2;
3417
3418 // Time (in ms since boot) at which the rail energy value was measured.
3419 // This may differ slightly from the time that statsd logs this information.
3420 optional uint64 measurement_timestamp_millis = 3;
3421
3422 // Accumulated energy used via the rail since device boot in uWs.
3423 optional uint64 energy_microwatt_secs = 4;
3424}
3425
3426/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003427 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003428 * Pulls the time the cpu spend on the frequency index. Frequency index
3429 * starts from highest to lowest. The value should be monotonically
3430 * increasing since boot. However, if there is a cpu
3431 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003432 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003433message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003434 optional uint32 cluster = 1;
3435 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003436 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003437}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003438
Chenjie Yu05013b32017-11-21 10:21:41 -08003439/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003440 * Pulls Cpu Time Per Uid.
3441 * Note that isolated process uid time should be attributed to host uids.
3442 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003443message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003444 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003445 optional uint64 user_time_micros = 2;
3446 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003447}
3448
3449/**
3450 * Pulls Cpu Time Per Uid per frequency.
3451 * Note that isolated process uid time should be attributed to host uids.
3452 * For each uid, we order the time by descending frequencies.
3453 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003454message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003455 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003456 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003457 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003458}
Hugo Benichi884970e2017-11-14 22:42:46 +09003459
Chenjie Yu05013b32017-11-21 10:21:41 -08003460/**
3461 * Pulls Wifi Controller Activity Energy Info
3462 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003463message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003464 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003465 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003466 // stack reported state
3467 // TODO: replace this with proto enum
3468 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003469 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003470 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003471 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003472 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003473 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003474 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003475 // product of current(mA), voltage(V) and time(ms)
3476 optional uint64 controller_energy_used = 6;
3477}
3478
3479/**
3480 * Pulls Modem Activity Energy Info
3481 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003482message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003483 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003484 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003485 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003486 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003487 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003488 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003489 /**
3490 * Tx power index
3491 * index 0 = tx_power < 0dBm
3492 * index 1 = 0dBm < tx_power < 5dBm
3493 * index 2 = 5dBm < tx_power < 15dBm
3494 * index 3 = 15dBm < tx_power < 20dBm
3495 * index 4 = tx_power > 20dBm
3496 */
3497 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003498 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003499 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003500 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003501 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003502 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003503 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003504 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003505 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003506 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003507 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003508 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003509 // product of current(mA), voltage(V) and time(ms)
3510 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003511}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003512
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003513/**
3514 * Pulls Bluetooth Activity Energy Info
3515 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3516 */
3517message BluetoothActivityInfo {
3518 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003519 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003520 // bluetooth stack state
3521 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003522 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003523 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003524 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003525 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003526 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003527 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003528 // product of current(mA), voltage(V) and time(ms)
3529 optional uint64 energy_used = 6;
3530}
3531
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003532/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003533 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003534 *
3535 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003536 */
3537message ProcessMemoryState {
3538 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003539 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003540
3541 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003542 // Usually package name, "system" for system server.
3543 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003544 optional string process_name = 2;
3545
Rafal Slawikda51b932018-12-13 16:31:33 +00003546 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003547 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003548
3549 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003550 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003551
3552 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003553 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003554
Rajeev Kumar90235992018-01-29 11:06:48 -08003555 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003556 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3557 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003558 optional int64 rss_in_bytes = 6;
3559
3560 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003561 // Value is read from memory.stat, field total_cache if per-app memory
3562 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003563 optional int64 cache_in_bytes = 7;
3564
3565 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003566 // Value is read from memory.stat, field total_swap if per-app memory
3567 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003568 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003569
Rafal Slawikd03ae422018-11-20 11:27:45 +00003570 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003571 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003572
3573 // Elapsed real time when the process started.
3574 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3575 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003576}
3577
3578/*
Rafal Slawik08621582018-10-15 14:53:07 +01003579 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003580 *
3581 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003582 */
3583message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003584 // The uid if available. -1 means not available.
3585 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003586
Rafal Slawikbf67d072018-10-23 11:07:54 +01003587 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003588 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003589 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003590
Rafal Slawikbf67d072018-10-23 11:07:54 +01003591 // # of page-faults
3592 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003593
Rafal Slawikbf67d072018-10-23 11:07:54 +01003594 // # of major page-faults
3595 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003596
Rafal Slawikbf67d072018-10-23 11:07:54 +01003597 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003598 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003599 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003600
Rafal Slawikd03ae422018-11-20 11:27:45 +00003601 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003602 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003603
3604 // Elapsed real time when the process started.
3605 // Value is read from /proc/PID/stat, field 22.
3606 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003607}
3608
3609/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003610 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003611 *
3612 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3613 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003614 *
3615 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003616 */
3617message ProcessMemoryHighWaterMark {
3618 // The uid if available. -1 means not available.
3619 optional int32 uid = 1 [(is_uid) = true];
3620
Rafal Slawikda51b932018-12-13 16:31:33 +00003621 // The process name.
3622 // Usually package name or process cmdline.
3623 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003624 optional string process_name = 2;
3625
3626 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3627 // /proc/PID/status.
3628 optional int64 rss_high_water_mark_in_bytes = 3;
3629}
3630
3631/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003632 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003633 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003634message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003635 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003636}
3637
3638/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003639 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003640 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003641message SystemUptime {
3642 // Milliseconds since the system was booted.
3643 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3644 // for external input).
3645 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003646 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003647}
3648
3649/*
3650 * Reads from /proc/uid_concurrent_active_time which has the format:
3651 * active: X (X is # cores)
3652 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3653 * [uid1]: [time-0] [time-1] [time-2] ... ...
3654 * ...
3655 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3656 * The file contains a monotonically increasing count of time for a single boot.
3657 */
3658message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003659 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003660 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003661}
3662
3663/**
3664 * Reads from /proc/uid_concurrent_policy_time which has the format:
3665 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3666 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3667 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3668 * ...
3669 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3670 * The file contains a monotonically increasing count of time for a single boot.
3671 */
3672message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003673 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003674 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003675 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003676}
3677
3678/*
3679 * Pulls free disk space, for data, system partition and temporary directory.
3680 */
3681message DiskSpace {
3682 // available bytes in data partition
3683 optional uint64 data_available_bytes = 1;
3684 // available bytes in system partition
3685 optional uint64 system_available_bytes = 2;
3686 // available bytes in download cache or temp directories
3687 optional uint64 temp_available_bytes = 3;
3688}
Tej Singhbf972d92018-01-10 20:51:13 -08003689
3690/**
3691 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003692 *
3693 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003694 */
3695message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003696 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003697}
3698
3699/**
3700 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003701 * Pulled from:
3702 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003703 */
3704message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003705 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003706}
3707
3708/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003709 * Pulls battery voltage.
3710 * Pulled from:
3711 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3712 */
3713message BatteryVoltage {
3714 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003715 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003716}
3717
3718/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003719 * Pulls battery level (percent full, from 0 to 100).
3720 *
3721 * Pulled from:
3722 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3723 */
3724message BatteryLevel {
3725 // Battery level. Should be in [0, 100].
3726 optional int32 battery_level = 1;
3727}
3728
3729/**
Tej Singhd89137e2018-03-26 14:51:40 -07003730 * Pulls the temperature of various parts of the device.
3731 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003732 *
3733 * Pulled from:
3734 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3735 */
3736message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003737 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003738 optional android.os.TemperatureTypeEnum sensor_location = 1;
3739
3740 // The name of the temperature source. Eg. CPU0
3741 optional string sensor_name = 2;
3742
Tej Singhd89137e2018-03-26 14:51:40 -07003743 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003744 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003745 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003746}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003747
3748/**
3749 * Pulls the statistics of calls to Binder.
3750 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003751 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3752 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003753 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003754 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003755 */
3756message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003757 // UID of the process responsible for the binder transaction. It will be set if the process
3758 // executing the binder transaction attribute the transaction to another uid using
3759 // Binder.setThreadWorkSource().
3760 //
3761 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003762 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003763 // UID of the process executing the binder transaction.
3764 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003765 // Fully qualified class name of the API call.
3766 //
3767 // This is a system server class name.
3768 //
3769 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3770 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3771 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3772 // commonly used APIs.
3773 optional string service_class_name = 2;
3774 // Method name of the API call. It can also be a transaction code if we cannot
3775 // resolve it to a name. See Binder#getTransactionName.
3776 //
3777 // This is a system server method name.
3778 optional string service_method_name = 3;
3779 // Total number of API calls.
3780 optional int64 call_count = 4;
3781 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3782 optional bool screen_interactive = 13;
3783 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3784 // call_count will be equal to recorded_call_count.
3785 //
3786 // If recorded_call_count is different than call_count, it means data collection has been
3787 // sampled. All the fields below will be sampled in this case.
3788 optional int64 recorded_call_count = 12;
3789 // Number of exceptions thrown by the API.
3790 optional int64 recorded_exception_count = 5;
3791 // Total latency of all API calls.
3792 // Average can be computed using total_latency_micros / recorded_call_count.
3793 optional int64 recorded_total_latency_micros = 6;
3794 // Maximum latency of one API call.
3795 optional int64 recorded_max_latency_micros = 7;
3796 // Total CPU usage of all API calls.
3797 // Average can be computed using total_cpu_micros / recorded_call_count.
3798 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3799 optional int64 recorded_total_cpu_micros = 8;
3800 // Maximum CPU usage of one API call.
3801 optional int64 recorded_max_cpu_micros = 9;
3802 // Maximum parcel reply size of one API call.
3803 optional int64 recorded_max_reply_size_bytes = 10;
3804 // Maximum parcel request size of one API call.
3805 optional int64 recorded_max_request_size_bytes = 11;
3806}
3807
3808/**
3809 * Pulls the statistics of exceptions during calls to Binder.
3810 *
3811 * Binder stats are cumulative from boot unless somebody reset the data using
3812 * > adb shell dumpsys binder_calls_stats --reset
3813 */
3814message BinderCallsExceptions {
3815 // Exception class name, e.g. java.lang.IllegalArgumentException.
3816 //
3817 // This is an exception class name thrown by the system server.
3818 optional string exception_class_name = 1;
3819 // Total number of exceptions.
3820 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003821}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003822
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003823/**
3824 * Pulls the statistics of message dispatching on HandlerThreads.
3825 *
3826 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3827 * config on the device.
3828 *
3829 * Next tag: 11
3830 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003831message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003832 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003833 optional int32 uid = 1 [(is_uid) = true];
3834
3835 // Fully qualified class name of the handler target class.
3836 //
3837 // This field does not contain PII. This is a system server class name.
3838 optional string handler_class_name = 2;
3839
3840 // The name of the thread that runs the Looper.
3841 //
3842 // This field does not contain PII. This is a system server thread name.
3843 optional string looper_thread_name = 3;
3844
3845 // The name of the dispatched message.
3846 //
3847 // This field does not contain PII. This is a system server constant or class
3848 // name.
3849 optional string message_name = 4;
3850
3851 // Total number of successfully dispatched messages.
3852 optional int64 message_count = 5;
3853
3854 // Total number of messages that failed dispatching.
3855 optional int64 exception_count = 6;
3856
3857 // Total number of processed messages we have data recorded for. If we
3858 // collected data for all the messages, message_count will be equal to
3859 // recorded_message_count.
3860 //
3861 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003862 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003863 optional int64 recorded_message_count = 7;
3864
3865 // Total latency of all processed messages.
3866 // Average can be computed using recorded_total_latency_micros /
3867 // recorded_message_count.
3868 optional int64 recorded_total_latency_micros = 8;
3869
3870 // Total CPU usage of all processed message.
3871 // Average can be computed using recorded_total_cpu_micros /
3872 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003873 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003874 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003875
3876 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3877 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003878
3879 // Max recorded CPU usage of all processed messages.
3880 optional int64 recorded_max_cpu_micros = 11;
3881
3882 // Max recorded latency of all processed messages.
3883 optional int64 recorded_max_latency_micros = 12;
3884
3885 // Total number of messages we tracked the dispatching delay for. If we
3886 // collected data for all the messages, message_count will be equal to
3887 // recorded_delay_message_count.
3888 //
3889 // If recorded_delay_message_count is different than message_count, it means data
3890 // collection has been sampled or/and not all messages specified the target dispatch time.
3891 // The fields below will be sampled in this case.
3892 optional int64 recorded_delay_message_count = 13;
3893
3894 // Total dispatching delay of all processed messages.
3895 // Calculated as a difference between the target dispatching time (Message.when)
3896 // and the actual dispatching time.
3897 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3898 optional int64 recorded_total_delay_millis = 14;
3899
3900 // Max dispatching delay of all processed messages.
3901 // Calculated as a difference between the target dispatching time (Message.when)
3902 // and the actual dispatching time.
3903 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003904}
Tej Singh86dc9db2018-09-06 00:39:57 +00003905
3906/**
3907 * Pulls disk information, such as write speed and latency.
3908 */
3909message DiskStats {
3910 // Time taken to open, write 512B to, and close a file.
3911 // -1 if error performing the check.
3912 optional int64 data_write_latency_millis = 1;
3913
3914 optional bool file_based_encryption = 2;
3915
3916 // Recent disk write speed in kB/s.
3917 // -1 if error querying storageed.
3918 // 0 if data is unavailable.
3919 optional int32 recent_disk_write_speed = 3;
3920}
3921
3922
3923/**
3924 * Free and total bytes of the Data, Cache, and System partition.
3925 */
3926message DirectoryUsage {
3927 enum Directory {
3928 UNKNOWN = 0;
3929 DATA = 1;
3930 CACHE = 2;
3931 SYSTEM = 3;
3932 }
3933 optional Directory directory = 1;
3934 optional int64 free_bytes = 2;
3935 optional int64 total_bytes = 3;
3936}
3937
3938
3939/**
3940 * Size of an application: apk size, data size, and cache size.
3941 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3942 * Information is only reported for apps with the primary user (user 0).
3943 * Sizes are aggregated by package name.
3944 */
3945message AppSize {
3946 // Including uids will involve modifying diskstats logic.
3947 optional string package_name = 1;
3948 // App size in bytes. -1 if unavailable.
3949 optional int64 app_size_bytes = 2;
3950 // App data size in bytes. -1 if unavailable.
3951 optional int64 app_data_size_bytes = 3;
3952 // App cache size in bytes. -1 if unavailable.
3953 optional int64 app_cache_size_bytes = 4;
3954 // Time that the cache file was produced.
3955 // Uses System.currentTimeMillis(), which is wall clock time.
3956 optional int64 cache_time_millis = 5;
3957}
3958
3959
3960/**
3961 * Size of a particular category. Eg: photos, videos.
3962 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3963 */
3964message CategorySize {
3965 enum Category {
3966 UNKNOWN = 0;
3967 APP_SIZE = 1;
3968 APP_DATA_SIZE = 2;
3969 APP_CACHE_SIZE = 3;
3970 PHOTOS = 4;
3971 VIDEOS = 5;
3972 AUDIO = 6;
3973 DOWNLOADS = 7;
3974 SYSTEM = 8;
3975 OTHER = 9;
3976 }
3977 optional Category category = 1;
3978 // Category size in bytes.
3979 optional int64 size_bytes = 2;
3980 // Time that the cache file was produced.
3981 // Uses System.currentTimeMillis(), which is wall clock time.
3982 optional int64 cache_time_millis = 3;
3983}
Tej Singhd6d6d772018-09-05 17:41:25 -07003984
3985/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003986 * Pulls per uid I/O stats. The stats are cumulative since boot.
3987 *
3988 * Read/write bytes are I/O events from a storage device
3989 * Read/write chars are data requested by read/write syscalls, and can be
3990 * satisfied by caching.
3991 *
3992 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3993 */
3994message DiskIo {
3995 optional int32 uid = 1 [(is_uid) = true];
3996 optional int64 fg_chars_read = 2;
3997 optional int64 fg_chars_write = 3;
3998 optional int64 fg_bytes_read = 4;
3999 optional int64 fg_bytes_write = 5;
4000 optional int64 bg_chars_read = 6;
4001 optional int64 bg_chars_write = 7;
4002 optional int64 bg_bytes_read = 8;
4003 optional int64 bg_bytes_write = 9;
4004 optional int64 fg_fsync = 10;
4005 optional int64 bg_fsync= 11;
4006}
4007
4008
4009/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004010 * Pulls the number of fingerprints for each user.
4011 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004012 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004013 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004014message NumBiometricsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004015 // The associated user. Eg: 0 for owners, 10+ for others.
4016 // Defined in android/os/UserHandle.java
4017 optional int32 user = 1;
4018 // Number of fingerprints registered to that user.
Kevin Chyn1741a072019-01-17 11:54:40 -08004019 optional int32 num_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004020}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004021
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004022/**
4023 * A mapping of role holder -> role
4024 */
4025message RoleHolder {
4026 // uid of the role holder
4027 optional int32 uid = 1 [(is_uid) = true];
4028
4029 // package name of the role holder
4030 optional string package_name = 2;
4031
4032 // the role held
4033 optional string role = 3;
4034}
4035
Yangsteraf9aee72018-10-12 09:26:16 -07004036message AggStats {
4037 optional int64 min = 1;
4038
4039 optional int64 average = 2;
4040
4041 optional int64 max = 3;
4042}
4043
4044message ProcessStatsStateProto {
4045 optional android.service.procstats.ScreenState screen_state = 1;
4046
4047 optional android.service.procstats.MemoryState memory_state = 2;
4048
4049 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4050 // and not frameworks/base/core/java/android/app/ActivityManager.java
4051 optional android.service.procstats.ProcessState process_state = 3;
4052
4053 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004054 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004055
4056 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004057 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004058
4059 // # of samples taken
4060 optional int32 sample_size = 5;
4061
4062 // PSS is memory reserved for this process
4063 optional AggStats pss = 6;
4064
4065 // USS is memory shared between processes, divided evenly for accounting
4066 optional AggStats uss = 7;
4067
4068 // RSS is memory resident for this process
4069 optional AggStats rss = 8;
4070}
4071
4072// Next Tag: 7
4073message ProcessStatsProto {
4074 // Name of process.
4075 optional string process = 1;
4076
4077 // Uid of the process.
4078 optional int32 uid = 2;
4079
4080 // Information about how often kills occurred
4081 message Kill {
4082 // Count of excessive CPU kills
4083 optional int32 cpu = 1;
4084
4085 // Count of kills when cached
4086 optional int32 cached = 2;
4087
4088 // PSS stats during cached kill
4089 optional AggStats cached_pss = 3;
4090 }
4091 optional Kill kill = 3;
4092
4093 // Time and memory spent in various states.
4094 repeated ProcessStatsStateProto states = 5;
4095
4096 // Total time process has been running... screen_state, memory_state, and process_state
4097 // will not be set.
4098 optional ProcessStatsStateProto total_running_state = 6;
4099}
4100
4101message PackageServiceOperationStatsProto {
4102 // Operate enum: Started, Foreground, Bound, Executing
4103 optional android.service.procstats.ServiceOperationState operation = 1;
4104
4105 // Number of times the service was in this operation.
4106 optional int32 count = 2;
4107
4108 // Information about a state the service can be in.
4109 message StateStats {
4110 // Screen state enum.
4111 optional android.service.procstats.ScreenState screen_state = 1;
4112 // Memory state enum.
4113 optional android.service.procstats.MemoryState memory_state = 2;
4114
4115 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004116 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004117 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004118 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004119 }
4120 repeated StateStats state_stats = 3;
4121}
4122
4123message PackageServiceStatsProto {
4124 // Name of service component.
4125 optional string service_name = 1;
4126
4127 // The operation stats.
4128 // The package_name, package_uid, package_version, service_name will not be set to save space.
4129 repeated PackageServiceOperationStatsProto operation_stats = 2;
4130}
4131
4132message PackageAssociationSourceProcessStatsProto {
4133 // Uid of the process.
4134 optional int32 process_uid = 1;
4135 // Process name.
4136 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004137 // Package name.
4138 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004139 // Total count of the times this association appeared.
4140 optional int32 total_count = 3;
4141
4142 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004143 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004144
4145 // Total count of the times this association became actively impacting its target process.
4146 optional int32 active_count = 5;
4147
4148 // Information on one source in this association.
4149 message StateStats {
4150 // Process state enum.
4151 optional android.service.procstats.ProcessState process_state = 1;
4152 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004153 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004154 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004155 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004156 }
4157 repeated StateStats active_state_stats = 6;
4158}
4159
4160message PackageAssociationProcessStatsProto {
4161 // Name of the target component.
4162 optional string component_name = 1;
4163 // Information on one source in this association.
4164 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4165}
4166
4167
4168message ProcessStatsPackageProto {
4169 // Name of package.
4170 optional string package = 1;
4171
4172 // Uid of the package.
4173 optional int32 uid = 2;
4174
4175 // Version of the package.
4176 optional int64 version = 3;
4177
4178 // Stats for each process running with the package loaded in to it.
4179 repeated ProcessStatsProto process_stats = 4;
4180
4181 // Stats for each of the package's services.
4182 repeated PackageServiceStatsProto service_stats = 5;
4183
4184 // Stats for each association with the package.
4185 repeated PackageAssociationProcessStatsProto association_stats = 6;
4186}
4187
4188message ProcessStatsSectionProto {
4189 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004190 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004191
4192 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004193 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004194
4195 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004196 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004197
4198 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004199 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004200
4201 // System runtime library. e.g. "libdvm.so", "libart.so".
4202 optional string runtime = 5;
4203
4204 // whether kernel reports swapped pss.
4205 optional bool has_swapped_pss = 6;
4206
4207 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4208 enum Status {
4209 STATUS_UNKNOWN = 0;
4210 STATUS_COMPLETE = 1;
4211 STATUS_PARTIAL = 2;
4212 STATUS_SHUTDOWN = 3;
4213 STATUS_SYSPROPS = 4;
4214 }
4215 repeated Status status = 7;
4216
Chenjie Yub2ecc792019-01-17 10:27:26 -08004217 // Number of pages available of various types and sizes, representation fragmentation.
4218 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4219
Yangsteraf9aee72018-10-12 09:26:16 -07004220 // Stats for each process.
4221 repeated ProcessStatsProto process_stats = 8;
4222
4223 // Stats for each package.
4224 repeated ProcessStatsPackageProto package_stats = 9;
4225}
4226
Chenjie Yub2ecc792019-01-17 10:27:26 -08004227message ProcessStatsAvailablePagesProto {
4228 // Node these pages are in (as per /proc/pagetypeinfo)
4229 optional int32 node = 1;
4230
4231 // Zone these pages are in (as per /proc/pagetypeinfo)
4232 optional string zone = 2;
4233
4234 // Label for the type of these pages (as per /proc/pagetypeinfo)
4235 optional string label = 3;
4236
4237 // Distribution of number of pages available by order size. First entry in array is
4238 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4239 repeated int32 pages_per_order = 4;
4240}
4241
Chenjie Yu12e5e672018-09-14 15:54:59 -07004242/**
4243 * Pulled from ProcessStatsService.java
4244 */
4245message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004246 optional ProcessStatsSectionProto proc_stats_section = 1;
4247}
4248
Chenjie Yuf910b7802019-01-11 16:08:20 -08004249/**
4250 * Pulled from ProcessStatsService.java
4251 */
4252message ProcStatsPkgProc {
4253 optional ProcessStatsSectionProto proc_stats_section = 1;
4254}
4255
Yangsteraf9aee72018-10-12 09:26:16 -07004256message PowerProfileProto {
4257 optional double cpu_suspend = 1;
4258
4259 optional double cpu_idle = 2;
4260
4261 optional double cpu_active = 3;
4262
4263 message CpuCluster {
4264 optional int32 id = 1;
4265 optional double cluster_power = 2;
4266 optional int32 cores = 3;
4267 repeated int64 speed = 4;
4268 repeated double core_power = 5;
4269 }
4270
4271 repeated CpuCluster cpu_cluster = 40;
4272
4273 optional double wifi_scan = 4;
4274
4275 optional double wifi_on = 5;
4276
4277 optional double wifi_active = 6;
4278
4279 optional double wifi_controller_idle = 7;
4280
4281 optional double wifi_controller_rx = 8;
4282
4283 optional double wifi_controller_tx = 9;
4284
4285 repeated double wifi_controller_tx_levels = 10;
4286
4287 optional double wifi_controller_operating_voltage = 11;
4288
4289 optional double bluetooth_controller_idle = 12;
4290
4291 optional double bluetooth_controller_rx = 13;
4292
4293 optional double bluetooth_controller_tx = 14;
4294
4295 optional double bluetooth_controller_operating_voltage = 15;
4296
4297 optional double modem_controller_sleep = 16;
4298
4299 optional double modem_controller_idle = 17;
4300
4301 optional double modem_controller_rx = 18;
4302
4303 repeated double modem_controller_tx = 19;
4304
4305 optional double modem_controller_operating_voltage = 20;
4306
4307 optional double gps_on = 21;
4308
4309 repeated double gps_signal_quality_based = 22;
4310
4311 optional double gps_operating_voltage = 23;
4312
4313 optional double bluetooth_on = 24;
4314
4315 optional double bluetooth_active = 25;
4316
4317 optional double bluetooth_at_cmd = 26;
4318
4319 optional double ambient_display = 27;
4320
4321 optional double screen_on = 28;
4322
4323 optional double radio_on = 29;
4324
4325 optional double radio_scanning = 30;
4326
4327 optional double radio_active = 31;
4328
4329 optional double screen_full = 32;
4330
4331 optional double audio = 33;
4332
4333 optional double video = 34;
4334
4335 optional double flashlight = 35;
4336
4337 optional double memory = 36;
4338
4339 optional double camera = 37;
4340
4341 optional double wifi_batched_scan = 38;
4342
4343 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004344}
Chenjie Yuab530202018-09-26 12:39:20 -07004345
4346/**
4347 * power_profile.xml and other constants for power model calculations.
4348 * Pulled from PowerProfile.java
4349 */
4350message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004351 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004352}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004353
4354/**
arangelovd5db50e2018-10-12 20:24:39 +01004355 * Logs when a user restriction was added or removed.
4356 *
4357 * Logged from:
4358 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4359 */
4360message UserRestrictionChanged {
4361 // The raw string of the user restriction as defined in UserManager.
4362 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4363 optional string restriction = 1;
4364 // Whether the restriction is enabled or disabled.
4365 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004366}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004367
4368/**
4369 * Pulls process user time and system time. Puller takes a snapshot of all pids
4370 * in the system and returns cpu stats for those that are working at the time.
4371 * Dead pids will be dropped. Kernel processes are excluded.
4372 * Min cool-down is 5 sec.
4373 */
4374message ProcessCpuTime {
4375 optional int32 uid = 1 [(is_uid) = true];
4376
4377 optional string process_name = 2;
4378 // Process cpu time in user space, cumulative from boot/process start
4379 optional int64 user_time_millis = 3;
4380 // Process cpu time in system space, cumulative from boot/process start
4381 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004382}
Misha Wagner5a51e002018-10-03 15:04:09 +01004383
4384/**
4385 * Pulls the CPU usage for each thread.
4386 *
4387 * Read from /proc/$PID/task/$TID/time_in_state files.
4388 *
4389 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4390 * time_in_state files not being present on some phones, have not been addressed. These should be
4391 * considered before a public release.
4392 */
4393message CpuTimePerThreadFreq {
4394 // UID that owns the process.
4395 optional int32 uid = 1 [(is_uid) = true];
4396 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004397 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004398 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004399 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004400 // Name of the process taken from `/proc/$PID/cmdline`.
4401 optional string process_name = 4;
4402 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4403 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004404
4405 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4406 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4407 // frequencies are given here as the alternative is sending eight separate atoms. This method
4408 // significantly reduces the amount of data created
4409 optional int32 frequency1_khz = 6;
4410 optional int32 time1_millis = 7;
4411 optional int32 frequency2_khz = 8;
4412 optional int32 time2_millis = 9;
4413 optional int32 frequency3_khz = 10;
4414 optional int32 time3_millis = 11;
4415 optional int32 frequency4_khz = 12;
4416 optional int32 time4_millis = 13;
4417 optional int32 frequency5_khz = 14;
4418 optional int32 time5_millis = 15;
4419 optional int32 frequency6_khz = 16;
4420 optional int32 time6_millis = 17;
4421 optional int32 frequency7_khz = 18;
4422 optional int32 time7_millis = 19;
4423 optional int32 frequency8_khz = 20;
4424 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004425}
Bookatz75ee6042018-11-09 12:27:37 -08004426
4427/**
Bookatz366a4432018-11-20 09:42:33 -08004428 * Pulls information about the device's build.
4429 */
4430message BuildInformation {
4431 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4432 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4433 optional string fingerprint = 1;
4434
4435 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4436 optional string brand = 2;
4437
4438 // Build.PRODUCT. The name of the overall product.
4439 optional string product = 3;
4440
4441 // Build.DEVICE. The name of the industrial design.
4442 optional string device = 4;
4443
4444 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4445 optional string version_release = 5;
4446
4447 // Build.ID. E.g. a label like "M4-rc20".
4448 optional string id = 6;
4449
4450 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4451 // represent this build.
4452 optional string version_incremental = 7;
4453
4454 // Build.TYPE. The type of build, like "user" or "eng".
4455 optional string type = 8;
4456
4457 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4458 optional string tags = 9;
4459}
4460
4461/**
Bookatz75ee6042018-11-09 12:27:37 -08004462 * Pulls on-device BatteryStats power use calculations for the overall device.
4463 */
4464message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004465 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4466 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4467 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4468 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004469}
4470
4471/**
4472 * Pulls on-device BatteryStats power use calculations broken down by uid.
4473 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4474 * that is attributed to non-uid items. They must all be included to get the total power use.
4475 */
4476message DeviceCalculatedPowerBlameUid {
4477 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4478 optional int32 uid = 1 [(is_uid) = true];
4479
Bookatz3dbc13a2018-12-21 12:16:51 -08004480 // Power used by this uid 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 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004483}
4484
4485/**
4486 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4487 * drain type.
4488 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4489 * is attributed uids. They must all be included to get the total power use.
4490 */
4491message DeviceCalculatedPowerBlameOther {
4492 // The type of item whose power use is being reported.
4493 enum DrainType {
4494 AMBIENT_DISPLAY = 0;
4495 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4496 BLUETOOTH = 2;
4497 CAMERA = 3;
4498 // Cell-standby
4499 CELL = 4;
4500 FLASHLIGHT = 5;
4501 IDLE = 6;
4502 MEMORY = 7;
4503 // Amount that total computed drain exceeded the drain estimated using the
4504 // battery level changes and capacity.
4505 OVERCOUNTED = 8;
4506 PHONE = 9;
4507 SCREEN = 10;
4508 // Amount that total computed drain was below the drain estimated using the
4509 // battery level changes and capacity.
4510 UNACCOUNTED = 11;
4511 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4512 WIFI = 13;
4513 }
4514 optional DrainType drain_type = 1;
4515
Bookatz3dbc13a2018-12-21 12:16:51 -08004516 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4517 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4518 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004519}
arangelov4e994062018-11-13 16:12:38 +00004520
4521/**
4522 * Logs device policy features.
4523 *
4524 * Logged from:
4525 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4526 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4527 */
4528message DevicePolicyEvent {
4529 // The event id - unique for each event.
4530 optional android.stats.devicepolicy.EventId event_id = 1;
4531 // The admin package name.
4532 optional string admin_package_name = 2;
4533 // A generic integer parameter.
4534 optional int32 integer_value = 3;
4535 // A generic boolean parameter.
4536 optional bool boolean_value = 4;
4537 // A parameter specifying a time period in milliseconds.
4538 optional uint64 time_period_millis = 5;
4539 // A parameter specifying a list of package names, bundle extras or string parameters.
4540 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4541}
shawnlinea5b66b2018-11-13 15:05:29 +08004542
4543/**
4544 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4545 *
4546 * Logged from:
4547 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4548 */
4549message DocsUILaunchReported {
4550 optional android.stats.docsui.LaunchAction launch_action = 1;
4551 optional bool has_initial_uri = 2;
4552 optional android.stats.docsui.MimeType mime_type = 3;
4553 optional android.stats.docsui.Root initial_root = 4;
4554}
4555
4556/**
4557 * Logs root/app visited event in file managers/picker. Call this when the user
4558 * taps on root/app in hamburger menu.
4559 *
4560 * Logged from:
4561 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4562 */
4563message DocsUIRootVisitedReported {
4564 optional android.stats.docsui.ContextScope scope = 1;
4565 optional android.stats.docsui.Root root = 2;
4566}
4567
4568/**
4569 * Logs file operation stats. Call this when a file operation has completed.
4570 *
4571 * Logged from:
4572 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4573 */
4574message DocsUIFileOperationReported {
4575 optional android.stats.docsui.Provider provider = 1;
4576 optional android.stats.docsui.FileOperation file_op = 2;
4577}
4578
4579/**
4580 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4581 * mode.
4582 *
4583 * Logged from:
4584 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4585 */
4586message DocsUIFileOperationCopyMoveModeReported {
4587 optional android.stats.docsui.FileOperation file_op = 1;
4588 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4589}
4590
4591
4592/**
4593 * Logs file sub operation stats. Call this when a file operation has failed.
4594 *
4595 * Logged from:
4596 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4597 */
4598message DocsUIFileOperationFailureReported {
4599 optional android.stats.docsui.Authority authority = 1;
4600 optional android.stats.docsui.SubFileOperation sub_op = 2;
4601}
4602
4603/**
4604* Logs the cancellation of a file operation. Call this when a job is canceled
4605*
4606* Logged from:
4607* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4608*/
4609message DocsUIFileOperationCanceledReported {
4610 optional android.stats.docsui.FileOperation file_op = 1;
4611}
4612
4613/**
4614 * Logs startup time in milliseconds.
4615 *
4616 * Logged from:
4617 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4618 */
4619message DocsUIStartupMsReported {
4620 optional int32 startup_millis = 1;
4621}
4622
4623/**
4624 * Logs the action that was started by user.
4625 *
4626 * Logged from:
4627 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4628 */
4629message DocsUIUserActionReported {
4630 optional android.stats.docsui.UserAction action = 1;
4631}
4632
4633/**
4634 * Logs the invalid type when invalid scoped access is requested.
4635 *
4636 * Logged from:
4637 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4638 */
4639message DocsUIInvalidScopedAccessRequestReported {
4640 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004641}
Ben Murdochbab399f2018-12-06 11:01:38 +00004642
4643/**
shawnlina75e82d2019-01-07 10:31:12 +08004644 * Logs the package name that launches docsui picker mode.
4645 *
4646 * Logged from:
4647 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4648 */
4649message DocsUIPickerLaunchedFromReported {
4650 optional string package_name = 1;
4651}
4652
4653/**
4654 * Logs the search type.
4655 *
4656 * Logged from:
4657 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4658 */
4659message DocsUISearchTypeReported {
4660 optional android.stats.docsui.SearchType search_type = 1;
4661}
4662
4663/**
4664 * Logs the search mode.
4665 *
4666 * Logged from:
4667 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4668 */
4669message DocsUISearchModeReported {
4670 optional android.stats.docsui.SearchMode search_mode = 1;
4671}
4672
4673/**
4674 * Logs the pick result information.
4675 *
4676 * Logged from:
4677 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4678 */
4679message DocsUIPickResultReported {
4680 optional int32 total_action_count = 1;
4681 optional int64 duration_millis = 2;
4682 optional int32 file_count= 3;
4683 optional bool is_searching = 4;
4684 optional android.stats.docsui.Root picked_from = 5;
4685 optional android.stats.docsui.MimeType mime_type = 6;
4686 optional int32 repeatedly_pick_times = 7;
4687}
4688
4689/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004690 * Logs when an app's memory is compacted.
4691 *
4692 * Logged from:
4693 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4694 */
4695message AppCompacted {
4696 // The pid of the process being compacted.
4697 optional int32 pid = 1;
4698
4699 // The name of the process being compacted.
4700 optional string process_name = 2;
4701
4702 // The type of compaction.
4703 enum Action {
4704 UNKNOWN = 0;
4705 SOME = 1;
4706 FULL = 2;
4707 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004708 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004709
4710 // Total RSS in kilobytes consumed by the process prior to compaction.
4711 optional int64 before_rss_total_kilobytes = 4;
4712
4713 // File RSS in kilobytes consumed by the process prior to compaction.
4714 optional int64 before_rss_file_kilobytes = 5;
4715
4716 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4717 optional int64 before_rss_anon_kilobytes = 6;
4718
4719 // Swap in kilobytes consumed by the process prior to compaction.
4720 optional int64 before_swap_kilobytes = 7;
4721
4722 // Total RSS in kilobytes consumed by the process after compaction.
4723 optional int64 after_rss_total_kilobytes = 8;
4724
4725 // File RSS in kilobytes consumed by the process after compaction.
4726 optional int64 after_rss_file_kilobytes = 9;
4727
4728 // Anonymous RSS in kilobytes consumed by the process after compaction.
4729 optional int64 after_rss_anon_kilobytes = 10;
4730
4731 // Swap in kilobytes consumed by the process after compaction.
4732 optional int64 after_swap_kilobytes = 11;
4733
4734 // The time taken to perform compaction in milliseconds.
4735 optional int64 time_to_compact_millis = 12;
4736
4737 // The last compaction action performed for this app.
4738 optional Action last_action = 13;
4739
Ben Murdoch01720b82018-12-19 18:03:44 +00004740 // The last time that compaction was attempted on this process in milliseconds
4741 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4742 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004743
Ben Murdoch01720b82018-12-19 18:03:44 +00004744 // The oom_score_adj at the time of compaction.
4745 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004746
4747 // The process state at the time of compaction.
4748 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00004749
4750 // Free ZRAM in kilobytes before compaction.
4751 optional int64 before_zram_free_kilobytes = 17;
4752
4753 // Free ZRAM in kilobytes after compaction.
4754 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00004755}
lifr157fc552018-12-12 16:38:04 +08004756
4757/**
4758 * Logs the latency period(in microseconds) and the return code of
4759 * the DNS(Domain Name System) lookups.
4760 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4761 * to get info(address or hostname) from DNS server(or DNS cache).
4762 * Logged from:
4763 * /system/netd/server/DnsProxyListener.cpp
4764 */
4765message NetworkDnsEventReported {
4766 // The types of the DNS lookups, as defined in
4767 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4768 enum EventType {
4769 EVENT_UNKNOWN = 0;
4770 EVENT_GETADDRINFO = 1;
4771 EVENT_GETHOSTBYNAME = 2;
4772 EVENT_GETHOSTBYADDR = 3;
4773 EVENT_RES_NSEND = 4;
4774 }
4775 optional EventType event_type = 1;
4776
4777 // The return value of the DNS resolver for each DNS lookups.
4778 //bionic/libc/include/netdb.h
4779 //system/netd/resolv/include/netd_resolv/resolv.h
4780 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004781 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004782 EAI_ADDRFAMILY = 1;
4783 EAI_AGAIN = 2;
4784 EAI_BADFLAGS = 3;
4785 EAI_FAIL = 4;
4786 EAI_FAMILY = 5;
4787 EAI_MEMORY = 6;
4788 EAI_NODATA = 7;
4789 EAI_NONAME = 8;
4790 EAI_SERVICE = 9;
4791 EAI_SOCKTYPE = 10;
4792 EAI_SYSTEM = 11;
4793 EAI_BADHINTS = 12;
4794 EAI_PROTOCOL = 13;
4795 EAI_OVERFLOW = 14;
4796 RESOLV_TIMEOUT = 255;
4797 EAI_MAX = 256;
4798 }
4799 optional ReturnCode return_code = 2;
4800
4801 // The latency period(in microseconds) it took for this DNS lookup to complete.
4802 optional int32 latency_micros = 3;
4803}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004804
4805/**
4806 * Logs when a data stall event occurs.
4807 *
4808 * Log from:
4809 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4810 */
4811message DataStallEvent {
4812 // Data stall evaluation type.
4813 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4814 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4815 optional int32 evaluation_type = 1;
4816 // See definition in data_stall_event.proto.
4817 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4818 // See definition in data_stall_event.proto.
4819 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4820 // See definition in data_stall_event.proto.
4821 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4822 // See definition in data_stall_event.proto.
4823 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4824 // See definition in data_stall_event.proto.
4825 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4826}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004827
4828/*
4829 * Logs when RescueParty resets some set of experiment flags.
4830 *
4831 * Logged from:
4832 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4833 */
4834message RescuePartyResetReported {
4835 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4836 optional int32 rescue_level = 1;
4837}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004838
4839/**
4840 * Logs when signed config is received from an APK, and if that config was applied successfully.
4841 * Logged from:
4842 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4843 */
4844message SignedConfigReported {
4845 enum Type {
4846 UNKNOWN_TYPE = 0;
4847 GLOBAL_SETTINGS = 1;
4848 }
4849 optional Type type = 1;
4850
4851 // The final status of the signed config received.
4852 enum Status {
4853 UNKNOWN_STATUS = 0;
4854 APPLIED = 1;
4855 BASE64_FAILURE_CONFIG = 2;
4856 BASE64_FAILURE_SIGNATURE = 3;
4857 SECURITY_EXCEPTION = 4;
4858 INVALID_CONFIG = 5;
4859 OLD_CONFIG = 6;
4860 SIGNATURE_CHECK_FAILED = 7;
4861 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004862 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004863 }
4864 optional Status status = 2;
4865
4866 // The version of the signed config processed.
4867 optional int32 version = 3;
4868
4869 // The package name that the config was extracted from.
4870 optional string from_package = 4;
4871
4872 enum Key {
4873 NO_KEY = 0;
4874 DEBUG = 1;
4875 PRODUCTION = 2;
4876 }
4877 // Which key was used to verify the config.
4878 optional Key verified_with = 5;
4879}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004880
4881/*
4882 * Logs GNSS Network-Initiated (NI) location events.
4883 *
4884 * Logged from:
4885 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4886 */
4887message GnssNiEventReported {
4888 // The type of GnssNiEvent.
4889 enum EventType {
4890 UNKNOWN = 0;
4891 NI_REQUEST = 1;
4892 NI_RESPONSE = 2;
4893 }
4894 optional EventType event_type = 1;
4895
4896 // An ID generated by HAL to associate NI notifications and UI responses.
4897 optional int32 notification_id = 2;
4898
4899 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004900 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004901
4902 // NI requires notification.
4903 optional bool need_notify = 4;
4904
4905 // NI requires verification.
4906 optional bool need_verify = 5;
4907
4908 // NI requires privacy override, no notification/minimal trace.
4909 optional bool privacy_override = 6;
4910
4911 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4912 // seconds.
4913 optional int32 timeout = 7;
4914
4915 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004916 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004917
4918 // String representing the requester of the network inititated location request.
4919 optional string requestor_id = 9;
4920
4921 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4922 // network initiated location request.
4923 optional string text = 10;
4924
4925 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004926 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004927
4928 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004929 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004930
4931 // True if SUPL ES is enabled.
4932 optional bool is_supl_es_enabled = 13;
4933
4934 // True if GNSS location is enabled.
4935 optional bool is_location_enabled = 14;
4936
4937 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004938 optional android.server.location.GnssUserResponseType user_response = 15;
4939}
4940
4941/**
4942 * Logs GNSS non-framework (NFW) location notification.
4943 *
4944 * Logged from:
4945 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4946 */
4947message GnssNfwNotificationReported {
4948 // Package name of the Android proxy application representing the non-framework entity that
4949 // requested location. Set to empty string if unknown.
4950 optional string proxy_app_package_name = 1;
4951
4952 // Protocol stack that initiated the non-framework location request.
4953 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4954
4955 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
4956 // set to empty string. This field is opaque to the framework and used for logging purposes.
4957 optional string other_protocol_stack_name = 3;
4958
4959 // Source initiating/receiving the location information.
4960 optional android.server.location.NfwRequestor requestor = 4;
4961
4962 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
4963 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
4964 // and used for logging purposes.
4965 optional string requestor_id = 5;
4966
4967 // Indicates whether location information was provided for this request.
4968 optional android.server.location.NfwResponseType response_type = 6;
4969
4970 // True if the device is in user initiated emergency session.
4971 optional bool in_emergency_mode = 7;
4972
4973 // True if cached location is provided.
4974 optional bool is_cached_location = 8;
4975
4976 // True if proxy app permission mismatch between framework and GNSS HAL.
4977 optional bool is_permission_mismatched = 9;
4978}
4979
4980/**
4981 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
4982 *
4983 * Logged from:
4984 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
4985 */
4986message GnssConfigurationReported {
4987 // SUPL host name.
4988 optional string supl_host = 1;
4989
4990 // SUPL port number.
4991 optional int32 supl_port = 2;
4992
4993 // C2K host name.
4994 optional string c2k_host = 3;
4995
4996 // C2K port number.
4997 optional int32 c2k_port = 4;
4998
4999 // The SUPL version requested by Carrier.
5000 optional int32 supl_ver = 5;
5001
5002 // The SUPL mode.
5003 optional android.server.location.SuplMode supl_mode = 6;
5004
5005 // True if NI emergency SUPL restrictions is enabled.
5006 optional bool supl_es = 7;
5007
5008 // LTE Positioning Profile settings
5009 optional android.server.location.LppProfile lpp_profile = 8;
5010
5011 // Positioning protocol on A-Glonass system.
5012 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5013
5014 // True if emergency PDN is used. Otherwise, regular PDN is used.
5015 optional bool use_emergency_pdn_for_emergency_supl= 10;
5016
5017 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5018 optional android.server.location.GpsLock gps_lock = 11;
5019
5020 // Number of seconds to extend the emergency session duration post emergency call.
5021 optional int32 es_extension_sec = 12;
5022
5023 // The full list of package names of proxy Android applications representing the non-framework
5024 // location access entities (on/off the device) for which the framework user has granted
5025 // non-framework location access permission. The package names are concatenated in one string
5026 // with spaces as separators.
5027 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005028}
Jack Yu95b64f32018-12-13 18:26:11 +08005029
5030/**
5031 * Logs when a NFC device's error occurred.
5032 * Logged from:
5033 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5034 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5035 */
5036message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005037 enum Type {
5038 UNKNOWN = 0;
5039 CMD_TIMEOUT = 1;
5040 ERROR_NOTIFICATION = 2;
5041 AID_OVERFLOW = 3;
5042 }
5043 optional Type type = 1;
5044 // If it's nci cmd timeout, log the timeout command.
5045 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005046
Alex Salod7c3eef2019-01-25 14:43:27 -08005047 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005048}
5049
5050/**
5051 * Logs when a NFC device's state changed event
5052 * Logged from:
5053 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5054 */
5055message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005056 enum State {
5057 UNKNOWN = 0;
5058 OFF = 1;
5059 ON = 2;
5060 ON_LOCKED = 3; // Secure Nfc enabled.
5061 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5062 }
5063 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005064}
5065
5066/**
5067 * Logs when a NFC Beam Transaction occurred.
5068 * Logged from:
5069 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5070 */
5071message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005072 enum Operation {
5073 UNKNOWN = 0;
5074 SEND = 1;
5075 RECEIVE = 2;
5076 }
5077 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005078}
5079
5080/**
5081 * Logs when a NFC Card Emulation Transaction occurred.
5082 * Logged from:
5083 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5084 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5085 */
5086message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005087 enum Category {
5088 UNKNOWN = 0;
5089 HCE_PAYMENT = 1;
5090 HCE_OTHER = 2;
5091 OFFHOST = 3;
5092 }
5093 // Transaction belongs to HCE payment or HCE other category, or offhost.
5094 optional Category category = 1;
5095 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5096 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005097}
5098
5099/**
5100 * Logs when a NFC Tag event occurred.
5101 * Logged from:
5102 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5103 */
5104message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005105 enum Type {
5106 UNKNOWN = 0;
5107 URL = 1;
5108 BT_PAIRING = 2;
5109 PROVISION = 3;
5110 WIFI_CONNECT = 4;
5111 APP_LAUNCH = 5;
5112 OTHERS = 6;
5113 }
5114 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005115}
5116
5117/**
5118 * Logs when Hce transaction triggered
5119 * Logged from:
5120 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5121 */
5122message NfcHceTransactionOccurred {
5123 // The latency period(in microseconds) it took for the first HCE data
5124 // exchange.
5125 optional uint32 latency_micros = 1;
5126}
5127
5128/**
5129 * Logs when SecureElement state event changed
5130 * Logged from:
5131 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5132 */
5133message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005134 enum State {
5135 UNKNOWN = 0;
5136 INITIALIZED = 1;
5137 DISCONNECTED = 2;
5138 CONNECTED = 3;
5139 HALCRASH = 4;
5140 }
5141 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005142
Alex Salod7c3eef2019-01-25 14:43:27 -08005143 optional string state_change_reason = 2;
5144 // SIMx or eSEx.
5145 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005146}
5147
5148/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005149 * Information about a permission grant request
5150 */
5151message PermissionGrantRequestResultReported {
5152 // unique value identifying an API call. A API call might result in multiple of these atoms
5153 optional int64 request_id = 1;
5154
5155 // UID of package requesting the permission grant
5156 optional int32 requesting_uid = 2 [(is_uid) = true];
5157
5158 // Name of package requesting the permission grant
5159 optional string requesting_package_name = 3;
5160
5161 // The permission to be granted
5162 optional string permission_name = 4;
5163
5164 // If the permission was explicitly requested via the API or added by the system
5165 optional bool is_implicit = 5;
5166
5167 enum Result {
5168 UNDEFINED = 0;
5169 // permission request was ignored
5170 IGNORED = 1;
5171 // permission request was ignored because it was user fixed
5172 IGNORED_USER_FIXED = 2;
5173 // permission request was ignored because it was policy fixed
5174 IGNORED_POLICY_FIXED = 3;
5175 // permission was granted by user action
5176 USER_GRANTED = 4;
5177 // permission was automatically granted
5178 AUTO_GRANTED = 5;
5179 // permission was denied by user action
5180 USER_DENIED = 6;
5181 // permission was denied with prejudice by the user
5182 USER_DENIED_WITH_PREJUDICE = 7;
5183 // permission was automatically denied
5184 AUTO_DENIED = 8;
5185 }
5186 // The result of the permission grant
5187 optional Result result = 6;
5188}
5189
5190/**
Jack Yu95b64f32018-12-13 18:26:11 +08005191 * Logs when Omapi API used
5192 * Logged from:
5193 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5194 */
5195message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005196 enum Operation {
5197 UNKNOWN = 0;
5198 OPEN_CHANNEL = 1;
5199 }
5200 optional Operation operation = 1;
5201 // SIMx or eSEx.
5202 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005203
Alex Salod7c3eef2019-01-25 14:43:27 -08005204 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005205}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005206
5207/**
Alex Saloa060aee2019-01-21 14:36:41 -08005208 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5209 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005210 * Logged from:
5211 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5212 */
5213message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005214 optional int64 dispatch_latency_millis = 1;
5215}
5216
5217/**
5218 * Logs AttentionManagerService attention check result.
5219 *
5220 * Logged from:
5221 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5222 */
5223message AttentionManagerServiceResultReported {
5224 // See core/java/android/service/attention/AttentionService.java
5225 enum AttentionCheckResult {
5226 UNKNOWN = 20;
5227 ATTENTION_SUCCESS_ABSENT = 0;
5228 ATTENTION_SUCCESS_PRESENT = 1;
5229 ATTENTION_FAILURE_PREEMPTED = 2;
5230 ATTENTION_FAILURE_TIMED_OUT = 3;
5231 ATTENTION_FAILURE_UNKNOWN = 4;
5232 }
5233 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005234}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005235
5236/**
5237 * Logs when an adb connection changes state.
5238 *
5239 * Logged from:
5240 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5241 */
5242message AdbConnectionChanged {
5243 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5244 // previously selected for this system.
5245 optional int64 last_connection_time_millis = 1;
5246
5247 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5248 // to reconnect via adb without user interaction.
5249 optional int64 auth_window_millis = 2;
5250
5251 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5252 optional android.debug.AdbConnectionStateEnum state = 3;
5253
5254 // True if the 'always allow' option was selected for this system.
5255 optional bool always_allow = 4;
5256}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005257
5258/*
5259 * Logs the reported speech DSP status.
5260 *
5261 * Logged from:
5262 * Vendor audio implementation.
5263 */
5264message SpeechDspStatReported {
5265 // The total Speech DSP uptime in milliseconds.
5266 optional int32 total_uptime_millis = 1;
5267 // The total Speech DSP downtime in milliseconds.
5268 optional int32 total_downtime_millis = 2;
5269 optional int32 total_crash_count = 3;
5270 optional int32 total_recover_count = 4;
5271}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005272
5273/**
5274 * Logs USB connector contaminant status.
5275 *
5276 * Logged from: USB Service.
5277 */
5278message UsbContaminantReported {
5279 optional string id = 1;
5280 optional android.service.usb.ContaminantPresenceStatus status = 2;
5281}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005282
5283/**
5284 * This atom is for debugging purpose.
5285 */
5286message DebugElapsedClock {
5287 // Monotically increasing value for each pull.
5288 optional int64 pull_count = 1;
5289 // Time from System.elapsedRealtime.
5290 optional int64 elapsed_clock_millis = 2;
5291 // Time from System.elapsedRealtime.
5292 optional int64 same_elapsed_clock_millis = 3;
5293 // Diff between current elapsed time and elapsed time from previous pull.
5294 optional int64 elapsed_clock_diff_millis = 4;
5295
5296 enum Type {
5297 TYPE_UNKNOWN = 0;
5298 ALWAYS_PRESENT = 1;
5299 PRESENT_ON_ODD_PULLS = 2;
5300 }
5301 // Type of behavior for the pulled data.
5302 optional Type type = 5;
5303}
5304
5305/**
5306 * This atom is for debugging purpose.
5307 */
5308message DebugFailingElapsedClock {
5309 // Monotically increasing value for each pull.
5310 optional int64 pull_count = 1;
5311 // Time from System.elapsedRealtime.
5312 optional int64 elapsed_clock_millis = 2;
5313 // Time from System.elapsedRealtime.
5314 optional int64 same_elapsed_clock_millis = 3;
5315 // Diff between current elapsed time and elapsed time from previous pull.
5316 optional int64 elapsed_clock_diff_millis = 4;
5317}
Steven Wuacef6bb2019-01-23 14:21:17 -05005318
5319/** Logs System UI bubbles event changed.
5320 *
5321 * Logged from:
5322 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5323 */
5324message BubbleUIChanged {
5325
5326 // The app package that is posting the bubble.
5327 optional string package_name = 1;
5328
5329 // The notification channel that is posting the bubble.
5330 optional string notification_channel = 2;
5331
5332 // The notification id associated with the posted bubble.
5333 optional int32 notification_id = 3;
5334
5335 // The position of the bubble within the bubble stack.
5336 optional int32 position = 4;
5337
5338 // The total number of bubbles within the bubble stack.
5339 optional int32 total_number = 5;
5340
5341 // User interactions with the bubble.
5342 enum Action {
5343 UNKNOWN = 0;
5344 POSTED = 1;
5345 UPDATED = 2;
5346 EXPANDED = 3;
5347 COLLAPSED = 4;
5348 DISMISSED = 5;
5349 STACK_DISMISSED = 6;
5350 STACK_MOVED = 7;
5351 HEADER_GO_TO_APP = 8;
5352 HEADER_GO_TO_SETTINGS = 9;
5353 PERMISSION_OPT_IN = 10;
5354 PERMISSION_OPT_OUT = 11;
5355 PERMISSION_IGNORED = 12;
5356 SWIPE_LEFT = 13;
5357 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005358 STACK_EXPANDED = 15;
Steven Wuacef6bb2019-01-23 14:21:17 -05005359 }
5360 optional Action action = 6;
5361
5362 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5363 optional float normalized_x_position = 7;
5364 optional float normalized_y_position = 8;
5365}
Kweku Adams8845d012018-12-11 20:06:45 -08005366
5367/**
Steven Wu552f63f2019-02-05 13:41:36 -05005368 * Logs System UI bubbles developer errors.
5369 *
5370 * Logged from:
5371 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5372 */
5373message BubbleDeveloperErrorReported {
5374
5375 // The app package that is posting the bubble.
5376 optional string package_name = 1;
5377
5378 // Bubble developer error type enums.
5379 enum Error {
5380 UNKNOWN = 0;
5381 ACTIVITY_INFO_MISSING = 1;
5382 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5383 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5384 }
5385 optional Error error = 2 [default = UNKNOWN];
5386}
5387
5388/**
Kweku Adams8845d012018-12-11 20:06:45 -08005389 * Logs that a constraint for a scheduled job has changed.
5390 *
5391 * Logged from:
5392 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5393 */
5394message ScheduledJobConstraintChanged {
5395 repeated AttributionNode attribution_node = 1;
5396
5397 // Name of the job.
5398 optional string job_name = 2;
5399
5400 optional com.android.server.job.ConstraintEnum constraint = 3;
5401
5402 enum State {
5403 UNSATISFIED = 0;
5404 SATISFIED = 1;
5405 }
5406 optional State state = 4;
5407}
Alex Salod7c3eef2019-01-25 14:43:27 -08005408
5409/**
5410 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5411 * returns true.
5412 *
5413 * Logged from:
5414 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5415 */
5416message ScreenTimeoutExtensionReported {
5417 // Describes how many times in a row did the power manager reset the screen off timeout.
5418 optional uint32 consecutive_timeout_extended_count = 1;
5419}
Hui Yu885aca12019-01-10 17:11:34 -08005420
5421/*
5422* Logs number of milliseconds it takes to start a process.
5423* The definition of app process start time is from the app launch time to
5424* the time that Zygote finished forking the app process and loaded the
5425* application package's java classes.
5426
5427* This metric is different from AppStartOccurred which is for foreground
5428* activity only.
5429
5430* ProcessStartTime can report all processes (both foreground and background)
5431* start time.
5432*
5433* Logged from:
5434* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5435*/
5436message ProcessStartTime {
5437 // The uid of the ProcessRecord.
5438 optional int32 uid = 1 [(is_uid) = true];
5439
5440 // The process pid.
5441 optional int32 pid = 2;
5442
5443 // The process name.
5444 // Usually package name, "system" for system server.
5445 // Provided by ActivityManagerService.
5446 optional string process_name = 3;
5447
5448 enum StartType {
5449 UNKNOWN = 0;
5450 WARM = 1;
5451 HOT = 2;
5452 COLD = 3;
5453 }
5454
5455 // The start type.
5456 optional StartType type = 4;
5457
5458 // The elapsed realtime at the start of the process.
5459 optional int64 process_start_time_millis = 5;
5460
5461 // Number of milliseconds it takes to reach bind application.
5462 optional int32 bind_application_delay_millis = 6;
5463
5464 // Number of milliseconds it takes to finish start of the process.
5465 optional int32 process_start_delay_millis = 7;
5466
5467 // hostingType field in ProcessRecord, the component type such as "activity",
5468 // "service", "content provider", "broadcast" or other strings.
5469 optional string hosting_type = 8;
5470
5471 // hostingNameStr field in ProcessRecord. The component class name that runs
5472 // in this process.
5473 optional string hosting_name = 9;
5474}
5475
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005476/**
5477 * State of a dangerous permission requested by a package
5478 */
5479message DangerousPermissionState {
5480 // Name of the permission
5481 optional string permission_name = 1;
5482
5483 // Uid of the package
5484 optional int32 uid = 2 [(is_uid) = true];
5485
5486 // Package requesting the permission
5487 optional string package_name = 3;
5488
5489 // If the permission is granted to the uid
5490 optional bool is_granted = 4;
5491}
5492
Michael Groover4a0ca942019-01-24 17:41:25 -08005493/**
5494 * Logs when a package is denied access to a device identifier based on the new access requirements.
5495 *
5496 * Logged from:
5497 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
5498 */
5499message DeviceIdentifierAccessDenied {
5500 // The name of the package denied access to the requested device identifier.
5501 optional string package_name = 1;
5502
5503 // The name of the device identifier method the package attempted to invoke.
5504 optional string method_name = 2;
5505
5506 // True if the package is preinstalled.
5507 optional bool is_preinstalled = 3;
5508
5509 // True if the package is privileged.
5510 optional bool is_priv_app = 4;
5511}