blob: cec19b8841d76508ca4d326f40ffccdde64e2140 [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";
Yao Chen8c433862018-10-24 14:09:20 -070044import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080045import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080046import "frameworks/base/core/proto/android/telephony/enums.proto";
47import "frameworks/base/core/proto/android/view/enums.proto";
arangelov4e994062018-11-13 16:12:38 +000048import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
49import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080050
Yao Chend54f9dd2017-10-17 17:37:48 +000051/**
Stefan Lafonae2df012017-11-14 09:17:21 -080052 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000053 * raw stats log events from the Android system, also known as "atoms."
54 *
55 * This field contains a single oneof with all of the available messages.
56 * The stats-log-api-gen tool runs as part of the Android build and
57 * generates the android.util.StatsLog class, which contains the constants
58 * and methods that Android uses to log.
59 *
Stefan Lafonae2df012017-11-14 09:17:21 -080060 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000061 * Instead, statsd on Android constructs these messages synthetically,
62 * in the format defined here and in stats_log.proto.
63 */
Stefan Lafonae2df012017-11-14 09:17:21 -080064message Atom {
65 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070066 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070067 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
68 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070069 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070070 BleScanResultReceived ble_scan_result_received = 4;
71 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080072 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070073 SyncStateChanged sync_state_changed = 7;
74 ScheduledJobStateChanged scheduled_job_state_changed = 8;
75 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070076 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080077 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
78 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
79 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070080 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
81 MemoryFactorStateChanged memory_factor_state_changed = 15;
82 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
83 CachedKillReported cached_kill_reported = 17;
84 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070085 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080086 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
87 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
88 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070089 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080090 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070091 CameraStateChanged camera_state_changed = 25;
92 FlashlightStateChanged flashlight_state_changed = 26;
93 UidProcessStateChanged uid_process_state_changed = 27;
94 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
95 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070096 BatteryLevelChanged battery_level_changed = 30;
97 ChargingStateChanged charging_state_changed = 31;
98 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -070099 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800100 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700101 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
102 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700103 WifiLockStateChanged wifi_lock_state_changed = 37;
104 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
105 WifiScanStateChanged wifi_scan_state_changed = 39;
106 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700107 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700108 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700109 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900110 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700111 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800112 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000113 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800114 AppStartOccurred app_start_occurred = 48;
115 AppStartCanceled app_start_canceled = 49;
116 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800117 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800118 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800119 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800120 LmkStateChanged lmk_state_changed = 54;
121 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800122 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800123 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000124 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800125 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800126 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800127 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800128 KeyguardStateChanged keyguard_state_changed = 62;
129 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
130 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800131 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800132 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800133 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
134 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800135 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700136 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800137 SpeakerImpedanceReported speaker_impedance_reported = 71;
138 HardwareFailed hardware_failed = 72;
139 PhysicalDropDetected physical_drop_detected = 73;
140 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800141 MobileConnectionStateChanged mobile_connection_state_changed = 75;
142 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700143 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800144 AppCrashOccurred app_crash_occurred = 78;
145 ANROccurred anr_occurred = 79;
146 WTFOccurred wtf_occurred = 80;
147 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700148 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700149 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700150 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700151 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700152 ThermalThrottlingStateChanged thermal_throttling = 86;
Kevin Chyn1741a072019-01-17 11:54:40 -0800153 BiometricAcquired biometric_acquired = 87;
154 BiometricAuthenticated biometric_authenticated = 88;
155 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700156 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700157 BatteryHealthSnapshot battery_health_snapshot = 91;
158 SlowIo slow_io = 92;
159 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700160 PhoneServiceStateChanged phone_service_state_changed = 94;
161 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100162 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700163 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700164 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700165 // TODO: service state change is very noisy shortly after boot, as well
166 // as at other transitions - coming out of doze, device plugged in, etc.
167 // Consider removing this if it becomes a problem
168 ServiceStateChanged service_state_changed = 99;
169 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800170 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800171 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000172 DevicePolicyEvent device_policy_event = 103;
shawnlinea5b66b2018-11-13 15:05:29 +0800173 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104;
174 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported = 105;
175 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106;
176 DocsUIFileOperationReported docs_ui_provider_file_op = 107;
177 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request = 108;
178 DocsUILaunchReported docs_ui_launch_reported = 109;
179 DocsUIRootVisitedReported docs_ui_root_visited = 110;
180 DocsUIStartupMsReported docs_ui_startup_ms = 111;
181 DocsUIUserActionReported docs_ui_user_action_reported = 112;
Bookatzda1798c2018-12-13 14:16:00 -0800182 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
183 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000184 AppCompacted app_compacted = 115;
lifr030d23a2019-01-11 16:54:51 +0800185 NetworkDnsEventReported network_dns_event_reported = 116;
shawnlina75e82d2019-01-07 10:31:12 +0800186 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported = 117;
187 DocsUIPickResultReported docs_ui_pick_result_reported = 118;
188 DocsUISearchModeReported docs_ui_search_mode_reported = 119;
189 DocsUISearchTypeReported docs_ui_search_type_reported = 120;
Chiachang Wangf6bedc22019-01-14 11:54:32 +0800190 DataStallEvent data_stall_event = 121;
Christian Brunschenf86039e2018-12-21 12:26:14 +0000191 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000192 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800193 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800194 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800195 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
196 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000197 AppDowngraded app_downgraded = 128;
198 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
199 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800200 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
201 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800202 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800203 NfcErrorOccurred nfc_error_occurred = 134;
204 NfcStateChanged nfc_state_changed = 135;
205 NfcBeamOccurred nfc_beam_occurred = 136;
206 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
207 NfcTagOccurred nfc_tag_occurred = 138;
208 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
209 SeStateChanged se_state_changed = 140;
210 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800211 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800212 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800213 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800214 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800215 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800216 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyn1741a072019-01-17 11:54:40 -0800217 BiometricHalDeathReported biometric_hal_death_reported = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500218 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800219 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800220 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
221 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
222 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
223 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
224 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
225 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
226 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
227 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
228 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800229 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
230 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
231 BluetoothManufacturerInfoReported bluetooth_device_info_reported = 162;
232 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
233 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
234 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
235 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
236 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800237 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800238 ProcessStartTime process_start_time = 169;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -0800239 PermissionGrantRequestResultReported permission_grant_request_result_reported = 170;
Jack He815cdba2019-01-30 17:24:55 -0800240 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800241 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500242 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
Yao Chend54f9dd2017-10-17 17:37:48 +0000243 }
David Chenc8a43242017-10-17 16:23:28 -0700244
David Chen6e3e6cb2018-01-03 16:14:06 -0800245 // Pulled events will start at field 10000.
Olivier Gaillard18d452202019-01-22 15:03:41 +0000246 // Next: 10048
David Chenc8a43242017-10-17 16:23:28 -0700247 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800248 WifiBytesTransfer wifi_bytes_transfer = 10000;
249 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
250 MobileBytesTransfer mobile_bytes_transfer = 10002;
251 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800252 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800253 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800254 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800255 CpuTimePerFreq cpu_time_per_freq = 10008;
256 CpuTimePerUid cpu_time_per_uid = 10009;
257 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800258 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800259 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800260 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800261 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800262 SystemElapsedRealtime system_elapsed_realtime = 10014;
263 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800264 CpuActiveTime cpu_active_time = 10016;
265 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000266 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800267 RemainingBatteryCapacity remaining_battery_capacity = 10019;
268 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800269 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100270 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100271 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100272 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000273 DiskStats disk_stats = 10025;
274 DirectoryUsage directory_usage = 10026;
275 AppSize app_size = 10027;
276 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700277 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700278 BatteryVoltage battery_voltage = 10030;
Kevin Chyn1741a072019-01-17 11:54:40 -0800279 NumBiometricsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700280 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700281 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800282 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700283 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100284 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100285 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700286 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800287 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
288 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
289 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000290 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800291 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800292 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800293 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000294 DebugElapsedClock debug_elapsed_clock = 10046;
295 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
Kevin Chyn1741a072019-01-17 11:54:40 -0800296 NumBiometricsEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800297 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800298 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800299 TrainInfo train_info = 10051;
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;
998}
999
1000/**
1001 * Logs wifi signal strength changes.
1002 *
1003 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001004 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001005 */
1006message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001007 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1008 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001009}
1010
1011/**
1012 * Logs wifi scans performed by an app.
1013 *
1014 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001015 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001016 */
1017message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001018 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001019
1020 enum State {
1021 OFF = 0;
1022 ON = 1;
1023 }
1024 optional State state = 2;
1025}
1026
1027/**
Tej Singh4503e102018-01-04 14:35:01 -08001028 * Logs wifi multicast locks held by an app
1029 *
1030 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001031 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001032 */
1033message WifiMulticastLockStateChanged {
1034 repeated AttributionNode attribution_node = 1;
1035
1036 enum State {
1037 OFF = 0;
1038 ON = 1;
1039 }
1040 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001041
1042 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001043}
1044
1045/**
Tej Singh1ea42892018-01-19 09:27:00 -08001046 * Logs shutdown reason and duration on next boot.
1047 *
1048 * Logged from:
1049 * frameworks/base/core/java/com/android/server/BootReceiver.java
1050 */
1051message ShutdownSequenceReported {
1052 // True if shutdown is for a reboot. Default: false if we do not know.
1053 optional bool reboot = 1;
1054
1055 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1056 optional string reason = 2;
1057
1058 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1059 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001060 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001061
1062 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001063 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001064}
1065
Tej Singh6483ea42018-01-25 17:45:49 -08001066
1067/**
1068 * Logs boot reason and duration.
1069 *
1070 * Logged from:
1071 * system/core/bootstat/bootstat.cpp
1072 */
1073message BootSequenceReported {
1074 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1075 // Default: "<EMPTY>" if not available.
1076 optional string bootloader_reason = 1;
1077
1078 // Reason for system boot. Eg. bootloader, reboot,userrequested
1079 // Default: "<EMPTY>" if not available.
1080 optional string system_reason = 2;
1081
1082 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001083 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001084
1085 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001086 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001087
1088 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001089 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001090
1091 // Time since last boot in ms. Default: 0 if not available.
1092 optional int64 time_since_last_boot = 6;
1093}
1094
Tej Singhc477d9c2018-02-05 18:31:39 -08001095
1096/**
1097 * Logs call state and disconnect cause (if applicable).
1098 *
1099 * Logged from:
1100 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1101 */
1102message CallStateChanged {
1103 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1104 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1105 optional android.telecom.CallStateEnum call_state = 1;
1106
1107 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1108 // This value is only applicable when the call_state is DISCONNECTED, and
1109 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1110 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1111 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1112
1113 // True if the call is self-managed, which are apps that use the
1114 // telecom infrastructure to make their own calls.
1115 optional bool self_managed = 3;
1116
1117 // True if call is external. External calls are calls on connected Wear
1118 // devices but show up in Telecom so the user can pull them onto the device.
1119 optional bool external_call = 4;
1120}
1121
Tej Singh1ea42892018-01-19 09:27:00 -08001122/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001123 * Logs keyguard state. The keyguard is the lock screen.
1124 *
1125 * Logged from:
1126 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1127 */
1128message KeyguardStateChanged {
1129 enum State {
1130 UNKNOWN = 0;
1131 // The keyguard is hidden when the phone is unlocked.
1132 HIDDEN = 1;
1133 // The keyguard is shown when the phone is locked (screen turns off).
1134 SHOWN= 2;
1135 // The keyguard is occluded when something is overlaying the keyguard.
1136 // Eg. Opening the camera while on the lock screen.
1137 OCCLUDED = 3;
1138 }
1139 optional State state = 1;
1140}
1141
1142/**
1143 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1144 * prompts the user to enter a password (pattern, pin, etc).
1145 *
1146 * Logged from:
1147 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1148 */
1149
1150message KeyguardBouncerStateChanged {
1151 enum State {
1152 UNKNOWN = 0;
1153 // Bouncer is hidden, either as a result of successfully entering the
1154 // password, screen timing out, or user going back to lock screen.
1155 HIDDEN = 1;
1156 // This is when the user is being prompted to enter the password.
1157 SHOWN = 2;
1158 }
1159 optional State state = 1;
1160}
1161
1162/**
1163 * Logs the result of entering a password into the keyguard bouncer.
1164 *
1165 * Logged from:
1166 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1167 */
1168message KeyguardBouncerPasswordEntered {
1169 enum BouncerResult {
1170 UNKNOWN = 0;
1171 // The password entered was incorrect.
1172 FAILURE = 1;
1173 // The password entered was correct.
1174 SUCCESS = 2;
1175 }
1176 optional BouncerResult result = 1;
1177}
1178
Tej Singha883b372018-02-15 11:30:01 -08001179/*
1180 * Logs changes to the configuration of the device. The configuration is defined
1181 * in frameworks/base/core/java/android/content/res/Configuration.java
1182 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1183 * Please go there to interpret the possible values each field can be.
1184 *
1185 * Logged from:
1186 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1187 */
1188message ResourceConfigurationChanged {
1189 // Bit mask of color capabilities of the screen.
1190 // Contains information about the color gamut and hdr mode of the screen.
1191 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001192 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001193
1194 // The target screen density being rendered to.
1195 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001196 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001197
1198 // Current user preference for the scaling factor for fonts,
1199 // relative to the base density scaling.
1200 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001201 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001202
1203 // Flag indicating whether the hard keyboard is hidden.
1204 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001205 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001206
1207 // The type of keyboard attached to the device.
1208 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1209 optional int32 keyboard = 5;
1210
1211 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1212 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001213 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001214
1215 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1216 // 0 if undefined.
1217 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1218 optional int32 mcc = 7;
1219
1220 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1221 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1222 // MNC_ZERO symbol defined in Configuration.java.
1223 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1224 optional int32 mnc = 8;
1225
1226 // The kind of navigation available on the device.
1227 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1228 optional int32 navigation = 9;
1229
1230 // Flag indicating whether the navigation is available.
1231 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001232 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001233
1234 // Overall orientation of the screen.
1235 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1236 optional int32 orientation = 11;
1237
1238 // The current height of the available screen space, in dp units.
1239 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001240 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001241
1242 // Bit mask of overall layout of the screen.
1243 // Contains information about screen size, whether the screen is wider/taller
1244 // than normal, whether the screen layout is right-tl-left or left-to-right,
1245 // and whether the screen has a rounded shape.
1246 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001247 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001248
1249 // Current width of the available screen space, in dp units.
1250 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001251 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001252
1253 // The smallest screen size an application will see in normal operation.
1254 // This is the smallest value of both screenWidthDp and screenHeightDp
1255 // in portrait and landscape.
1256 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001257 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001258
1259 // The type of touch screen attached to the device.
1260 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1261 optional int32 touchscreen = 16;
1262
1263 // Bit mask of the ui mode.
1264 // Contains information about the overall ui mode of the device.
1265 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1266 // Also contains information about whether the device is in night mode.
1267 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001268 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001269}
1270
Tej Singheee317b2018-03-07 19:28:05 -08001271
1272/**
1273 * Logs changes in the connection state of the mobile radio.
1274 *
1275 * Logged from:
1276 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1277 */
1278message MobileConnectionStateChanged {
1279 // States are from the state machine DataConnection.java.
1280 enum State {
1281 UNKNOWN = 0;
1282 // The connection is inactive, or disconnected.
1283 INACTIVE = 1;
1284 // The connection is being activated, or connecting.
1285 ACTIVATING = 2;
1286 // The connection is active, or connected.
1287 ACTIVE = 3;
1288 // The connection is disconnecting.
1289 DISCONNECTING = 4;
1290 // The connection is disconnecting after creating a connection.
1291 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1292 }
1293 optional State state = 1;
1294 // For multi-sim phones, this distinguishes between the sim cards.
1295 optional int32 sim_slot_index = 2;
1296 // Used to identify the connection. Starts at 0 and increments by 1 for
1297 // every new network created. Resets whenever the device reboots.
1298 optional int32 data_connection_id = 3;
1299 // A bitmask for the capabilities of this connection.
1300 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1301 // Default value (if we have no information): 0
1302 optional int64 capabilities = 4;
1303 // If this connection has internet.
1304 // This just checks if the DEFAULT bit of capabilities is set.
1305 optional bool has_internet = 5;
1306}
1307
1308/**
1309 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1310 *
1311 * Logged from:
1312 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1313 */
1314message MobileRadioTechnologyChanged {
1315 optional android.telephony.NetworkTypeEnum state = 1;
1316 // For multi-sim phones, this distinguishes between the sim cards.
1317 optional int32 sim_slot_index = 2;
1318}
1319
Andrew Chantb56388b2018-03-22 21:07:33 -07001320/**
1321 * Logs the VID and PID of any connected USB devices.
1322 *
1323 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1324 *
1325 * Logged by Vendor.
1326 */
1327message UsbDeviceAttached {
1328 optional int32 vid = 1;
1329 optional int32 pid = 2;
1330 optional bool has_audio = 3;
1331 optional bool has_hid = 4;
1332 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001333 enum State {
1334 STATE_DISCONNECTED = 0;
1335 STATE_CONNECTED = 1;
1336 }
1337 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001338 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001339}
1340
Tej Singheee317b2018-03-07 19:28:05 -08001341
Tej Singhdd7bd352018-02-09 19:33:15 -08001342/**
Tej Singh5d991e12018-03-09 19:48:11 -08001343 * Logs when Bluetooth is enabled and disabled.
1344 *
1345 * Logged from:
1346 * services/core/java/com/android/server/BluetoothManagerService.java
1347 */
1348message BluetoothEnabledStateChanged {
1349 repeated AttributionNode attribution_node = 1;
1350 // Whether or not bluetooth is enabled on the device.
1351 enum State {
1352 UNKNOWN = 0;
1353 ENABLED = 1;
1354 DISABLED = 2;
1355 }
1356 optional State state = 2;
1357 // The reason for being enabled/disabled.
1358 // Eg. Airplane mode, crash, application request.
1359 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1360 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001361 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001362}
1363
1364/**
Jack Hed9837c82019-01-09 01:19:13 -08001365 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001366 *
1367 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001368 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1369 *
1370 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001371 */
1372message BluetoothConnectionStateChanged {
1373 // The state of the connection.
1374 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1375 optional android.bluetooth.ConnectionStateEnum state = 1;
1376 // An identifier that can be used to match connect and disconnect events.
1377 // Currently is last two bytes of a hash of a device level ID and
1378 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001379 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1380 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001381 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1382 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001383 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001384 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001385 // An identifier that can be used to match events for this device.
1386 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1387 // Salt: Randomly generated 256 bit value
1388 // Hash algorithm: HMAC-SHA256
1389 // Size: 32 byte
1390 // Default: null or empty if the device identifier is not known
1391 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1392}
1393
1394/**
1395 * Logs when a Bluetooth device connects and disconnects over ACL
1396 *
1397 * Logged from:
1398 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1399 *
1400 * Next Tag: 3
1401 */
1402message BluetoothAclConnectionStateChanged {
1403 // An identifier that can be used to match events for this device.
1404 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1405 // Salt: Randomly generated 256 bit value
1406 // Hash algorithm: HMAC-SHA256
1407 // Size: 32 byte
1408 // Default: null or empty if the device identifier is not known
1409 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1410 // The state of the connection.
1411 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1412 optional android.bluetooth.ConnectionStateEnum state = 2;
1413}
1414
1415/**
1416 * Logs when a Bluetooth device connects and disconnects over SCO
1417 *
1418 * Logged from:
1419 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1420 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1421 *
1422 * Next Tag: 4
1423 */
1424message BluetoothScoConnectionStateChanged {
1425 // An identifier that can be used to match events for this device.
1426 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1427 // Salt: Randomly generated 256 bit value
1428 // Hash algorithm: HMAC-SHA256
1429 // Size: 32 byte
1430 // Default: null or empty if the device identifier is not known
1431 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1432 // The state of the connection.
1433 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1434 optional android.bluetooth.ConnectionStateEnum state = 2;
1435 // Codec used for this SCO connection
1436 // Default: UNKNOWN
1437 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001438}
1439
Jack Hec27040a2019-01-09 20:54:41 -08001440/**
1441 * Logged when active device of a profile changes
1442 *
1443 * Logged from:
1444 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1445 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1446 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1447 */
1448message BluetoothActiveDeviceChanged {
1449 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1450 // From android.bluetooth.BluetoothProfile
1451 optional int32 bt_profile = 1;
1452 // An identifier that can be used to match events for this new active device.
1453 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1454 // Salt: Randomly generated 256 bit value
1455 // Hash algorithm: HMAC-SHA256
1456 // Size: 32 byte
1457 // Default: null or empty if there is no active device for this profile
1458 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1459}
1460
Jack Heab86dbd22018-12-18 15:43:27 -08001461// Logs when there is an event affecting Bluetooth device's link layer connection.
1462// - This event is triggered when there is a related HCI command or event
1463// - Users of this metrics can deduce Bluetooth device's connection state from these events
1464// - HCI commands are logged before the command is sent, after receiving command status, and after
1465// receiving command complete
1466// - HCI events are logged when they arrive
1467//
1468// Low level log from system/bt
1469//
1470// Bluetooth classic commands:
1471// - CMD_CREATE_CONNECTION
1472// - CMD_DISCONNECT
1473// - CMD_CREATE_CONNECTION_CANCEL
1474// - CMD_ACCEPT_CONNECTION_REQUEST
1475// - CMD_REJECT_CONNECTION_REQUEST
1476// - CMD_SETUP_ESCO_CONNECTION
1477// - CMD_ACCEPT_ESCO_CONNECTION
1478// - CMD_REJECT_ESCO_CONNECTION
1479// - CMD_ENH_SETUP_ESCO_CONNECTION
1480// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1481//
1482// Bluetooth low energy commands:
1483// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1484// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1485// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1486// - CMD_BLE_CLEAR_WHITE_LIST
1487// - CMD_BLE_ADD_WHITE_LIST
1488// - CMD_BLE_REMOVE_WHITE_LIST
1489//
1490// Bluetooth classic events:
1491// - EVT_CONNECTION_COMP
1492// - EVT_CONNECTION_REQUEST
1493// - EVT_DISCONNECTION_COMP
1494// - EVT_ESCO_CONNECTION_COMP
1495// - EVT_ESCO_CONNECTION_CHANGED
1496//
1497// Bluetooth low energy meta events:
1498// - BLE_EVT_CONN_COMPLETE_EVT
1499// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1500//
1501// Next tag: 10
1502message BluetoothLinkLayerConnectionEvent {
1503 // An identifier that can be used to match events for this device.
1504 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1505 // Salt: Randomly generated 256 bit value
1506 // Hash algorithm: HMAC-SHA256
1507 // Size: 32 byte
1508 // Default: null or empty if the device identifier is not known
1509 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1510 // Connection handle of this connection if available
1511 // Range: 0x0000 - 0x0EFF (12 bits)
1512 // Default: 0xFFFF if the handle is unknown
1513 optional int32 connection_handle = 2;
1514 // Direction of the link
1515 // Default: DIRECTION_UNKNOWN
1516 optional android.bluetooth.DirectionEnum direction = 3;
1517 // Type of this link
1518 // Default: LINK_TYPE_UNKNOWN
1519 optional android.bluetooth.LinkTypeEnum type = 4;
1520
1521 // Reason metadata for this link layer connection event, rules for interpretation:
1522 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1523 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1524 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1525 // set and valid, ignore hci_ble_event
1526
1527 // HCI command associated with this event
1528 // Default: CMD_UNKNOWN
1529 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1530 // HCI event associated with this event
1531 // Default: EVT_UNKNOWN
1532 optional android.bluetooth.hci.EventEnum hci_event = 6;
1533 // HCI BLE meta event associated with this event
1534 // Default: BLE_EVT_UNKNOWN
1535 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1536 // HCI command status code if this is triggerred by hci_cmd
1537 // Default: STATUS_UNKNOWN
1538 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1539 // HCI reason code associated with this event
1540 // Default: STATUS_UNKNOWN
1541 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1542}
1543
Howard Roe103fe22019-01-17 16:52:16 -08001544/**
1545 * Logs when a module is rolled back by Watchdog.
1546 *
1547 * Logged from: Rollback Manager
1548 */
1549message WatchdogRollbackOccurred {
1550 enum RollbackType {
1551 UNKNOWN = 0;
1552 ROLLBACK_INITIATE = 1;
1553 ROLLBACK_SUCCESS = 2;
1554 ROLLBACK_FAILURE = 3;
1555 }
1556 optional RollbackType rollback_type = 1;
1557
1558 optional string package_name = 2;
1559
1560 optional int32 package_version_code = 3;
1561}
1562
Jack Hec27040a2019-01-09 20:54:41 -08001563/**
1564 * Logs when there is a change in Bluetooth A2DP playback state
1565 *
1566 * Logged from:
1567 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1568 */
1569message BluetoothA2dpPlaybackStateChanged {
1570 // An identifier that can be used to match events for this device.
1571 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1572 // Salt: Randomly generated 256 bit value
1573 // Hash algorithm: HMAC-SHA256
1574 // Size: 32 byte
1575 // Default: null or empty if the device identifier is not known
1576 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1577 // Current playback state
1578 // Default: PLAYBACK_STATE_UNKNOWN
1579 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1580 // Current audio coding mode
1581 // Default: AUDIO_CODING_MODE_UNKNOWN
1582 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1583}
1584
1585/**
1586 * Logs when there is a change in A2DP codec config for a particular remote device
1587 *
1588 * Logged from:
1589 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1590 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1591 */
1592message BluetoothA2dpCodecConfigChanged {
1593 // An identifier that can be used to match events for this device.
1594 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1595 // Salt: Randomly generated 256 bit value
1596 // Hash algorithm: HMAC-SHA256
1597 // Size: 32 byte
1598 // Default: null or empty if the device identifier is not known
1599 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1600 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1601 // Default SOURCE_CODEC_TYPE_INVALID
1602 optional int32 codec_type = 2;
1603 // Codec priroity, the higher the more preferred, -1 for disabled
1604 // Default: CODEC_PRIORITY_DEFAULT
1605 optional int32 codec_priority = 3;
1606 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1607 // Default: SAMPLE_RATE_NONE
1608 optional int32 sample_rate = 4;
1609 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1610 // Default: BITS_PER_SAMPLE_NONE
1611 optional int32 bits_per_sample = 5;
1612 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1613 // Default: CHANNEL_MODE_NONE
1614 optional int32 channel_mode = 6;
1615 // Codec specific values
1616 // Default 0
1617 optional int64 codec_specific_1 = 7;
1618 optional int64 codec_specific_2 = 8;
1619 optional int64 codec_specific_3 = 9;
1620 optional int64 codec_specific_4 = 10;
1621}
1622
1623/**
1624 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1625 * Each codec's capability is logged separately due to statsd restriction
1626 *
1627 * Logged from:
1628 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1629 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1630 */
1631message BluetoothA2dpCodecCapabilityChanged {
1632 // An identifier that can be used to match events for this device.
1633 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1634 // Salt: Randomly generated 256 bit value
1635 // Hash algorithm: HMAC-SHA256
1636 // Size: 32 byte
1637 // Default: null or empty if the device identifier is not known
1638 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1639 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1640 // Default SOURCE_CODEC_TYPE_INVALID
1641 optional int32 codec_type = 2;
1642 // Codec priroity, the higher the more preferred, -1 for disabled
1643 // Default: CODEC_PRIORITY_DEFAULT
1644 optional int32 codec_priority = 3;
1645 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1646 // in BluetoothCodecConfig
1647 // Default: empty and SAMPLE_RATE_NONE for individual item
1648 optional int32 sample_rate = 4;
1649 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1650 // in BluetoothCodecConfig
1651 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1652 optional int32 bits_per_sample = 5;
1653 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1654 // BluetoothCodecConfig
1655 // Default: empty and CHANNEL_MODE_NONE for individual item
1656 optional int32 channel_mode = 6;
1657 // Codec specific values
1658 // Default 0
1659 optional int64 codec_specific_1 = 7;
1660 optional int64 codec_specific_2 = 8;
1661 optional int64 codec_specific_3 = 9;
1662 optional int64 codec_specific_4 = 10;
1663}
1664
1665/**
1666 * Logs when A2DP failed to read from PCM source.
1667 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1668 *
1669 * Logged from:
1670 * system/bt
1671 */
1672message BluetoothA2dpAudioUnderrunReported {
1673 // An identifier that can be used to match events for this device.
1674 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1675 // Salt: Randomly generated 256 bit value
1676 // Hash algorithm: HMAC-SHA256
1677 // Size: 32 byte
1678 // Default: null or empty if the device identifier is not known
1679 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1680 // Encoding interval in nanoseconds
1681 // Default: 0
1682 optional int64 encoding_interval_nanos = 2;
1683 // Number of bytes of PCM data that could not be read from the source
1684 // Default: 0
1685 optional int32 num_missing_pcm_bytes = 3;
1686}
1687
1688/**
1689 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1690 * buffer queue is full and we have to drop data
1691 *
1692 * Logged from:
1693 * system/bt
1694 */
1695message BluetoothA2dpAudioOverrunReported {
1696 // An identifier that can be used to match events for this device.
1697 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1698 // Salt: Randomly generated 256 bit value
1699 // Hash algorithm: HMAC-SHA256
1700 // Size: 32 byte
1701 // Default: null or empty if the device identifier is not known
1702 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1703 // Encoding interval in nanoseconds
1704 // Default: 0
1705 optional int64 encoding_interval_nanos = 2;
1706 // Number of buffers dropped in this event
1707 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1708 // Default: 0
1709 optional int32 num_dropped_buffers = 3;
1710 // Number of encoded buffers dropped in this event
1711 // Default 0
1712 optional int32 num_dropped_encoded_frames = 4;
1713 // Number of encoded bytes dropped in this event
1714 // Default: 0
1715 optional int32 num_dropped_encoded_bytes = 5;
1716}
1717
1718/**
1719 * Logs when we receive reports regarding a device's RSSI value
1720 *
1721 * Logged from:
1722 * system/bt
1723 */
1724message BluetoothDeviceRssiReported {
1725 // An identifier that can be used to match events for this device.
1726 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1727 // Salt: Randomly generated 256 bit value
1728 // Hash algorithm: HMAC-SHA256
1729 // Size: 32 byte
1730 // Default: null or empty if the device identifier is not known
1731 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1732 // Connection handle of this connection if available
1733 // Range: 0x0000 - 0x0EFF (12 bits)
1734 // Default: 0xFFFF if the handle is unknown
1735 optional int32 connection_handle = 2;
1736 // HCI command status code if this is triggerred by hci_cmd
1737 // Default: STATUS_UNKNOWN
1738 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1739 // BR/EDR
1740 // Range: -128 ≤ N ≤ 127 (signed integer)
1741 // Units: dB
1742 // LE:
1743 // Range: -127 to 20, 127 (signed integer)
1744 // Units: dBm
1745 // Invalid when an out of range value is reported
1746 optional int32 rssi = 4;
1747}
1748
1749/**
1750 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1751 *
1752 * Logged from:
1753 * system/bt
1754 */
1755message BluetoothDeviceFailedContactCounterReported {
1756 // An identifier that can be used to match events for this device.
1757 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1758 // Salt: Randomly generated 256 bit value
1759 // Hash algorithm: HMAC-SHA256
1760 // Size: 32 byte
1761 // Default: null or empty if the device identifier is not known
1762 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1763 // Connection handle of this connection if available
1764 // Range: 0x0000 - 0x0EFF (12 bits)
1765 // Default: 0xFFFF if the handle is unknown
1766 optional int32 connection_handle = 2;
1767 // HCI command status code if this is triggerred by hci_cmd
1768 // Default: STATUS_UNKNOWN
1769 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1770 // Number of consecutive failed contacts for a connection corresponding to the Handle
1771 // Range: uint16_t, 0-0xFFFF
1772 // Default: 0xFFFFF
1773 optional int32 failed_contact_counter = 4;
1774}
1775
1776/**
1777 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1778 *
1779 * Logged from:
1780 * system/bt
1781 */
1782message BluetoothDeviceTxPowerLevelReported {
1783 // An identifier that can be used to match events for this device.
1784 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1785 // Salt: Randomly generated 256 bit value
1786 // Hash algorithm: HMAC-SHA256
1787 // Size: 32 byte
1788 // Default: null or empty if the device identifier is not known
1789 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1790 // Connection handle of this connection if available
1791 // Range: 0x0000 - 0x0EFF (12 bits)
1792 // Default: 0xFFFF if the handle is unknown
1793 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001794 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001795 // Default: STATUS_UNKNOWN
1796 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1797 // Range: -30 ≤ N ≤ 20
1798 // Units: dBm
1799 // Invalid when an out of range value is reported
1800 optional int32 transmit_power_level = 4;
1801}
Jack Heab86dbd22018-12-18 15:43:27 -08001802
Tej Singh5d991e12018-03-09 19:48:11 -08001803/**
Jack He1021a612019-01-20 21:22:46 -08001804 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1805 * receiving an HCI command from the host
1806 *
1807 * Logged from: system/bt
1808 */
1809message BluetoothHciTimeoutReported {
1810 // HCI command associated with this event
1811 // Default: CMD_UNKNOWN
1812 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1813}
1814
1815/**
1816 * Logs when we receive Bluetooth Link Quality Report event from the controller
1817 * See Android Bluetooth HCI specification for more details
1818 *
1819 * Note: all count and bytes field are counted since last event
1820 *
1821 * Logged from: system/bt
1822 */
1823message BluetoothQualityReportReported {
1824 // Quality report ID
1825 // Original type: uint8_t
1826 // Default: BQR_ID_UNKNOWN
1827 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1828 // Packet type of the connection
1829 // Original type: uint8_t
1830 // Default: BQR_PACKET_TYPE_UNKNOWN
1831 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1832 // Connection handle of the connection
1833 // Original type: uint16_t
1834 optional int32 connection_handle = 3;
1835 // Performing Role for the connection
1836 // Original type: uint8_t
1837 optional int32 connection_role = 4;
1838 // Current Transmit Power Level for the connection. This value is the same as the controller's
1839 // response to the HCI_Read_Transmit_Power_Level HCI command
1840 // Original type: uint8_t
1841 optional int32 tx_power_level = 5;
1842 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1843 // absolute receiver signal strength value
1844 // Original type: int8_t
1845 optional int32 rssi = 6;
1846 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1847 // channels used by the link currently
1848 // Original type: uint8_t
1849 optional int32 snr = 7;
1850 // Indicates the number of unused channels in AFH_channel_map
1851 // Original type: uint8_t
1852 optional int32 unused_afh_channel_count = 8;
1853 // Indicates the number of the channels which are interfered and quality is bad but are still
1854 // selected for AFH
1855 // Original type: uint8_t
1856 optional int32 afh_select_unideal_channel_count = 9;
1857 // Current Link Supervision Timeout Setting
1858 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1859 // Original type: uint16_t
1860 optional int32 lsto = 10;
1861 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1862 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1863 // 0x01 (Piconet Clock)
1864 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1865 // Original type: uint32_t
1866 optional int64 connection_piconet_clock = 11;
1867 // The count of retransmission
1868 // Original type: uint32_t
1869 optional int64 retransmission_count = 12;
1870 // The count of no RX
1871 // Original type: uint32_t
1872 optional int64 no_rx_count = 13;
1873 // The count of NAK (Negative Acknowledge)
1874 // Original type: uint32_t
1875 optional int64 nak_count = 14;
1876 // Controller timestamp of last TX ACK
1877 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1878 // Original type: uint32_t
1879 optional int64 last_tx_ack_timestamp = 15;
1880 // The count of Flow-off (STOP)
1881 // Original type: uint32_t
1882 optional int64 flow_off_count = 16;
1883 // Controller timestamp of last Flow-on (GO)
1884 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1885 // Original type: uint32_t
1886 optional int64 last_flow_on_timestamp = 17;
1887 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1888 // Original type: uint32_t
1889 optional int64 buffer_overflow_bytes = 18;
1890 // Buffer underflow count (in byte) since last event
1891 // Original type: uint32_t
1892 optional int64 buffer_underflow_bytes = 19;
1893}
1894
1895/**
1896 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1897 *
1898 * Notes:
1899 * - Each event can be partially filled as we might learn different pieces of device
1900 * information at different time
1901 * - Multiple device info events can be combined to give more complete picture
1902 * - When multiple device info events tries to describe the same information, the
1903 * later one wins
1904 *
1905 * Logged from:
1906 * packages/apps/Bluetooth
1907 */
1908message BluetoothManufacturerInfoReported {
1909 // An identifier that can be used to match events for this device.
1910 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1911 // Salt: Randomly generated 256 bit value
1912 // Hash algorithm: HMAC-SHA256
1913 // Size: 32 byte
1914 // Default: null or empty if the device identifier is not known
1915 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1916 // Where is this device info obtained from
1917 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1918 // Name of the data source
1919 // For EXTERNAL: package name of the data source
1920 // For INTERNAL: null for general case, component name otherwise
1921 optional string source_name = 3;
1922 // Name of the manufacturer of this device
1923 optional string manufacturer = 4;
1924 // Model of this device
1925 optional string model = 5;
1926 // Hardware version of this device
1927 optional string hardware_version = 6;
1928 // Software version of this device
1929 optional string software_version = 7;
1930}
1931
1932/**
1933 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1934 * device, as documented by the Bluetooth Core HCI specification
1935 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1936 * Vol 2, Part E, Page 1118
1937 *
1938 * Logged from:
1939 * system/bt
1940 */
1941message BluetoothRemoteVersionInfoReported {
1942 // Connection handle of the connection
1943 // Original type: uint16_t
1944 optional int32 connection_handle = 1;
1945 // HCI command status code
1946 // Default: STATUS_UNKNOWN
1947 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1948 // 1 byte Version of current LMP in the remote controller
1949 optional int32 lmp_version = 3;
1950 // 2 bytes LMP manufacturer code of the remote controller
1951 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1952 optional int32 lmp_manufacturer_code = 4;
1953 // 4 bytes subversion of the LMP in the remote controller
1954 optional int32 lmp_subversion = 5;
1955}
1956
1957/**
1958 * Logs when certain Bluetooth SDP attributes are discovered
1959 * Constant definitions are from:
1960 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1961 *
1962 * Current logged attributes:
1963 * - BluetoothProfileDescriptorList
1964 * - Supported Features Bitmask
1965 *
1966 * Logged from:
1967 * system/bt
1968 */
1969message BluetoothSdpAttributeReported {
1970 // An identifier that can be used to match events for this device.
1971 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1972 // Salt: Randomly generated 256 bit value
1973 // Hash algorithm: HMAC-SHA256
1974 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1975 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1976 // Original type: uint16_t
1977 optional int32 protocol_uuid = 2;
1978 // Short form UUIDs used to identify Bluetooth SDP attribute types
1979 // Original type: uint16_t
1980 optional int32 attribute_id = 3;
1981 // Attribute value for the particular attribute
1982 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1983}
1984
1985/**
1986 * Logs when bond state of a Bluetooth device changes
1987 *
1988 * Logged from:
1989 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
1990 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
1991 */
1992message BluetoothBondStateChanged {
1993 // An identifier that can be used to match events for this device.
1994 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1995 // Salt: Randomly generated 256 bit value
1996 // Hash algorithm: HMAC-SHA256
1997 // Size: 32 byte
1998 // Default: null or empty if the device identifier is not known
1999 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2000 // Preferred transport type to remote dual mode device
2001 // Default: TRANSPORT_AUTO means no preference
2002 optional android.bluetooth.TransportTypeEnum transport = 2;
2003 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2004 // Default: UNKNOWN
2005 optional android.bluetooth.DeviceTypeEnum type = 3;
2006 // Current bond state (NONE, BONDING, BONDED)
2007 // Default: BOND_STATE_UNKNOWN
2008 optional android.bluetooth.BondStateEnum bond_state = 4;
2009 // Bonding sub state
2010 // Default: BOND_SUB_STATE_UNKNOWN
2011 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2012 // Unbond Reason
2013 // Default: UNBOND_REASON_UNKNOWN
2014 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2015}
2016
2017/**
2018 * Logs there is an event related Bluetooth classic pairing
2019 *
2020 * Logged from:
2021 * system/bt
2022 */
2023message BluetoothClassicPairingEventReported {
2024 // An identifier that can be used to match events for this device.
2025 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2026 // Salt: Randomly generated 256 bit value
2027 // Hash algorithm: HMAC-SHA256
2028 // Size: 32 byte
2029 // Default: null or empty if the device identifier is not known
2030 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2031 // Connection handle of this connection if available
2032 // Range: 0x0000 - 0x0EFF (12 bits)
2033 // Default: 0xFFFF if the handle is unknown
2034 optional int32 connection_handle = 2;
2035 // HCI command associated with this event
2036 // Default: CMD_UNKNOWN
2037 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2038 // HCI event associated with this event
2039 // Default: EVT_UNKNOWN
2040 optional android.bluetooth.hci.EventEnum hci_event = 4;
2041 // HCI command status code if this is triggerred by hci_cmd
2042 // Default: STATUS_UNKNOWN
2043 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2044 // HCI reason code associated with this event
2045 // Default: STATUS_UNKNOWN
2046 optional android.bluetooth.hci.StatusEnum reason_code = 6;
2047}
2048
2049/**
2050 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2051 *
2052 * Logged from:
2053 * system/bt
2054 */
2055message BluetoothSmpPairingEventReported {
2056 // An identifier that can be used to match events for this device.
2057 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2058 // Salt: Randomly generated 256 bit value
2059 // Hash algorithm: HMAC-SHA256
2060 // Size: 32 byte
2061 // Default: null or empty if the device identifier is not known
2062 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2063 // SMP command sent or received over L2CAP
2064 // Default: CMD_UNKNOWN
2065 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2066 // Whether this command is sent or received
2067 // Default: DIRECTION_UNKNOWN
2068 optional android.bluetooth.DirectionEnum direction = 3;
2069 // SMP failure reason code
2070 // Default: PAIRING_FAIL_REASON_DEFAULT
2071 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2072}
2073
2074/**
Jack He815cdba2019-01-30 17:24:55 -08002075 * Logs when a Bluetooth socket’s connection state changed
2076 *
2077 * Logged from:
2078 * system/bt
2079 */
2080message BluetoothSocketConnectionStateChanged {
2081 // An identifier that can be used to match events for this device.
2082 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2083 // Salt: Randomly generated 256 bit value
2084 // Hash algorithm: HMAC-SHA256
2085 // Size: 32 byte
2086 // Default: null or empty if the device identifier is not known
2087 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2088 // Port of this socket
2089 // Default 0 when unknown or don't care
2090 optional int32 port = 2;
2091 // Socket type as mentioned in
2092 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2093 // Default: SOCKET_TYPE_UNKNOWN
2094 optional android.bluetooth.SocketTypeEnum type = 3;
2095 // Socket connection state
2096 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2097 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2098 // Number of bytes sent to remote device during this connection
2099 optional int64 tx_bytes = 5;
2100 // Number of bytes received from remote device during this connection
2101 optional int64 rx_bytes = 6;
2102}
2103
2104/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002105 * Logs when something is plugged into or removed from the USB-C connector.
2106 *
2107 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002108 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002109 */
2110message UsbConnectorStateChanged {
2111 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002112 STATE_DISCONNECTED = 0;
2113 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002114 }
2115 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002116 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002117 // Last active session in ms.
2118 // 0 when the port is in connected state.
2119 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002120}
2121
2122/**
2123 * Logs the reported speaker impedance.
2124 *
2125 * Logged from:
2126 * Vendor audio implementation.
2127 */
2128message SpeakerImpedanceReported {
2129 optional int32 speaker_location = 1;
2130 optional int32 impedance = 2;
2131}
2132
2133/**
2134 * Logs the report of a failed hardware.
2135 *
2136 * Logged from:
2137 * Vendor HALs.
2138 *
2139 */
2140message HardwareFailed {
2141 enum HardwareType {
2142 HARDWARE_FAILED_UNKNOWN = 0;
2143 HARDWARE_FAILED_MICROPHONE = 1;
2144 HARDWARE_FAILED_CODEC = 2;
2145 HARDWARE_FAILED_SPEAKER = 3;
2146 HARDWARE_FAILED_FINGERPRINT = 4;
2147 }
2148 optional HardwareType hardware_type = 1;
2149
Maggie White6dcd8572019-01-31 14:11:50 -08002150 /**
2151 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002152 * the same hardware_type. The specific locations are vendor defined integers,
2153 * referring to board-specific numbering schemes.
2154 */
2155 optional int32 hardware_location = 2;
2156
Maggie White6dcd8572019-01-31 14:11:50 -08002157 /**
2158 * failure_code is specific to the HardwareType of the failed hardware.
2159 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002160 */
Maggie White6dcd8572019-01-31 14:11:50 -08002161 enum HardwareErrorCode {
2162 UNKNOWN = 0;
2163 COMPLETE = 1;
2164 SPEAKER_HIGH_Z = 2;
2165 SPEAKER_SHORT = 3;
2166 FINGERPRINT_SENSOR_BROKEN = 4;
2167 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Andrew Chant28d627e2018-02-22 15:17:05 -08002168 }
2169 optional int32 failure_code = 3;
2170}
2171
2172/**
2173 * Log an event when the device has been physically dropped.
2174 * Reported from the /vendor partition.
2175 */
2176message PhysicalDropDetected {
2177 // Confidence that the event was actually a drop, 0 -> 100
2178 optional int32 confidence_pctg = 1;
2179 // Peak acceleration of the drop, in 1/1000s of a g.
2180 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002181 // Duration of freefall in ms
2182 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002183}
2184
2185/**
2186 * Log bucketed battery charge cycles.
2187 *
2188 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002189 * a given charge point. For example, if 10 cycle buckets are
2190 * initialized, bucket 1 is the lowest 1/10th of the battery,
2191 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002192 *
2193 * Logged from:
2194 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2195 */
2196message ChargeCyclesReported {
2197 optional int32 cycle_bucket_1 = 1;
2198 optional int32 cycle_bucket_2 = 2;
2199 optional int32 cycle_bucket_3 = 3;
2200 optional int32 cycle_bucket_4 = 4;
2201 optional int32 cycle_bucket_5 = 5;
2202 optional int32 cycle_bucket_6 = 6;
2203 optional int32 cycle_bucket_7 = 7;
2204 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002205 optional int32 cycle_bucket_9 = 9;
2206 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002207}
2208
2209/**
Howard Roa46b6582018-09-18 16:45:02 -07002210 * Log battery health snapshot.
2211 *
2212 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2213 * are snapshotted periodically over 24hrs.
2214 */
2215message BatteryHealthSnapshot {
2216 enum BatterySnapshotType {
2217 UNKNOWN = 0;
2218 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2219 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2220 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2221 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2222 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2223 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2224 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2225 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2226 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2227 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2228 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2229 }
2230 optional BatterySnapshotType type = 1;
2231 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002232 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002233 // Voltage Battery Voltage, in microVolts.
2234 optional int32 voltage_micro_volt = 3;
2235 // Current Battery current, in microAmps.
2236 optional int32 current_micro_amps = 4;
2237 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2238 optional int32 open_circuit_micro_volt = 5;
2239 // Resistance Battery Resistance, in microOhms.
2240 optional int32 resistance_micro_ohm = 6;
2241 // Level Battery Level, as % of full.
2242 optional int32 level_percent = 7;
2243}
2244
2245/**
2246 * Log slow I/O operations on the primary storage.
2247 */
2248message SlowIo {
2249 // Classifications of IO Operations.
2250 enum IoOperation {
2251 UNKNOWN = 0;
2252 READ = 1;
2253 WRITE = 2;
2254 UNMAP = 3;
2255 SYNC = 4;
2256 }
2257 optional IoOperation operation = 1;
2258
2259 // The number of slow IO operations of this type over 24 hours.
2260 optional int32 count = 2;
2261}
2262
2263/**
2264 * Log battery caused shutdown with the last recorded voltage.
2265 */
2266message BatteryCausedShutdown {
2267 // The last recorded battery voltage prior to shutdown.
2268 optional int32 last_recorded_micro_volt = 1;
2269}
2270
2271/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002272 * Logs the duration of a davey (jank of >=700ms) when it occurs
2273 *
2274 * Logged from:
2275 * frameworks/base/libs/hwui/JankTracker.cpp
2276 */
2277message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002278 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002279 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002280
Tej Singhbb8554a2018-01-26 11:59:14 -08002281 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002282 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002283}
2284
2285/**
Bookatze5885242017-10-24 20:10:31 -07002286 * Logs phone signal strength changes.
2287 *
2288 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002289 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002290 */
2291message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002292 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2293 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002294}
2295
Yangster4ccebea2018-10-09 17:09:02 -07002296
2297/**
2298 * Logs when the phone state, sim state or signal strength changes
2299 *
2300 * Logged from:
2301 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2302 */
2303message PhoneServiceStateChanged {
2304 optional android.telephony.ServiceStateEnum state = 1;
2305 optional android.telephony.SimStateEnum sim_state = 2;
2306 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2307}
2308
2309/**
2310 * Logs when the phone becomes on or off.
2311 *
2312 * Logged from:
2313 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2314 */
2315message PhoneStateChanged {
2316 enum State {
2317 OFF = 0;
2318 ON = 1;
2319 }
2320 optional State state = 1;
2321}
2322
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002323message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002324 optional android.stats.launcher.LauncherAction action = 1;
2325 optional android.stats.launcher.LauncherState src_state = 2;
2326 optional android.stats.launcher.LauncherState dst_state = 3;
2327 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002328 optional bool is_swipe_up_enabled = 5;
2329}
2330
David Chenc28b2bb2017-10-24 12:52:52 -07002331/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002332 * Logs when Settings UI has changed.
2333 *
2334 * Logged from:
2335 * packages/apps/Settings
2336 */
2337message SettingsUIChanged {
2338 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002339 * Where this SettingsUIChange event comes from. For example, if
2340 * it's a PAGE_VISIBLE event, where the page is opened from.
2341 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002342 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002343
2344 /**
2345 * What the UI action is.
2346 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002347 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002348
2349 /**
2350 * Where the action is happening
2351 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002352 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002353
2354 /**
2355 * What preference changed in this event.
2356 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002357 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002358
2359 /**
2360 * The new value of the changed preference.
2361 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002362 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002363}
2364
2365/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002366 * Logs basic timing information about touch events.
2367 * Reported at most every 5 minutes while device is being interacted with.
2368 *
2369 * Logged from:
2370 * frameworks/native/services/inputflinger
2371 */
2372message TouchEventReported {
2373 /**
2374 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2375 * and the standard deviation of latency between the kernel and framework
2376 * for touchscreen events. The units are microseconds.
2377 *
2378 * The number is measured as the difference between the time at which
2379 * the input event was received in the evdev driver,
2380 * and the time at which the input event was received in EventHub.
2381 */
2382 // Minimum value
2383 optional float latency_min_micros = 1;
2384 // Maximum value
2385 optional float latency_max_micros = 2;
2386 // Average value
2387 optional float latency_mean_micros = 3;
2388 // Standard deviation
2389 optional float latency_stdev_micros = 4;
2390}
2391
2392/**
David Chenc28b2bb2017-10-24 12:52:52 -07002393 * Logs that a setting was updated.
2394 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002395 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002396 * The tag and is_default allow resetting of settings to default values based on the specified
2397 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2398 */
2399message SettingChanged {
2400 // The name of the setting.
2401 optional string setting = 1;
2402
2403 // The change being imposed on this setting. May represent a number, eg "3".
2404 optional string value = 2;
2405
2406 // The new value of this setting. For most settings, this is same as value. For some settings,
2407 // value is +X or -X where X represents an element in a set. For example, if the previous value
2408 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2409 // The +/- feature is currently only used for location_providers_allowed.
2410 optional string new_value = 3;
2411
2412 // The previous value of this setting.
2413 optional string prev_value = 4;
2414
2415 // The tag used with the is_default for resetting sets of settings. This is generally null.
2416 optional string tag = 5;
2417
Bookatz90867622018-01-31 15:05:57 -08002418 // True if this setting with tag should be resettable.
2419 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002420
David Chenbd789912018-03-16 17:19:55 -07002421 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002422 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002423
2424 enum ChangeReason {
2425 UPDATED = 1; // Updated can be an insertion or an update.
2426 DELETED = 2;
2427 }
2428 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002429}
Chenjie Yub3dda412017-10-24 13:41:59 -07002430
Chenjie Yu05013b32017-11-21 10:21:41 -08002431/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002432 * Logs activity going to foreground or background
2433 *
2434 * Logged from:
2435 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2436 */
2437message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002438 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002439 optional string pkg_name = 2;
2440 optional string class_name = 3;
2441
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002442 enum State {
2443 BACKGROUND = 0;
2444 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002445 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002446 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002447}
David Chenc8a43242017-10-17 16:23:28 -07002448
2449/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002450 * Logs when a volume entered low Storage state.
2451 * Logged from:
2452 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2453 */
2454message LowStorageStateChanged {
2455 // Volume that ran out of storage.
2456 optional string volume_description = 1;
2457
2458 enum State {
2459 UNKNOWN = 0;
2460 OFF = 1;
2461 ON = 2;
2462 }
2463 optional State state = 2;
2464}
2465
2466/**
2467 * Logs when an app is downgraded.
2468 * Logged from:
2469 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2470 */
2471message AppDowngraded {
2472 optional string package_name = 1;
2473 // Size of the package (all data) before being downgraded.
2474 optional int64 size_in_bytes_before = 2;
2475 // Size of the package (all data) after being downgraded.
2476 optional int64 size_in_bytes_after = 3;
2477
2478 optional bool aggressive = 4;
2479}
2480
2481/**
2482 * Logs when an app is optimized after being downgraded.
2483 * Logged from:
2484 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2485 */
2486message AppOptimizedAfterDowngraded {
2487 optional string package_name = 1;
2488}
2489
2490/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002491 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002492 * Logged from:
2493 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2494 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002495message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002496 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002497
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002498 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002499
2500 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002501 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002502 optional string process_name = 3;
2503
2504 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002505 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002506
2507 optional string package_name = 5;
2508
2509 enum InstantApp {
2510 UNAVAILABLE = 0;
2511 FALSE = 1;
2512 TRUE = 2;
2513 }
2514 optional InstantApp is_instant_app = 6;
2515
2516 enum ForegroundState {
2517 UNKNOWN = 0;
2518 BACKGROUND = 1;
2519 FOREGROUND = 2;
2520 }
2521 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002522
2523 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002524}
David Chen9e3808c2017-11-20 17:25:34 -08002525
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002526/**
2527 * Logs when a WTF (What a Terrible Failure) happened.
2528 * Logged from:
2529 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2530 */
2531message WTFOccurred {
2532 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002533
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002534 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002535
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002536 // The name of the process.
2537 // system_server if it is not by an app
2538 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002539
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002540 // The pid if available. -1 means not available.
2541 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002542
2543 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002544}
2545
2546/**
2547 * Logs when system server reports low memory.
2548 * Logged from:
2549 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2550 */
2551message LowMemReported {
2552}
2553
2554/**
2555 * Logs when an app ANR (App Not Responding) occurs.
2556 * Logged from:
2557 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2558 */
2559message ANROccurred {
2560 optional int32 uid = 1 [(is_uid) = true];
2561
2562 optional string process_name = 2;
2563
2564 optional string short_component_name = 3;
2565
2566 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002567
2568 enum InstantApp {
2569 UNAVAILABLE = 0;
2570 FALSE = 1;
2571 TRUE = 2;
2572 }
2573 optional InstantApp is_instant_app = 5;
2574
2575 enum ForegroundState {
2576 UNKNOWN = 0;
2577 BACKGROUND = 1;
2578 FOREGROUND = 2;
2579 }
2580 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002581
2582 optional android.server.ErrorSource error_source = 7;
2583
2584 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002585}
2586
Bookatza7020bd2018-08-28 16:29:35 -07002587/**
2588 * Logs when the vibrator state changes.
2589 * Logged from:
2590 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2591 */
2592message VibratorStateChanged {
2593 repeated AttributionNode attribution_node = 1;
2594
2595 enum State {
2596 OFF = 0;
2597 ON = 1;
2598 }
2599 optional State state = 2;
2600
2601 // Duration (in milliseconds) requested to keep the vibrator on.
2602 // Only applicable for State == ON.
2603 optional int64 duration_millis = 3;
2604}
2605
David Chen0a368b22017-12-06 16:28:16 -08002606/*
2607 * Allows other apps to push events into statsd.
2608 * Logged from:
2609 * frameworks/base/core/java/android/util/StatsLog.java
2610 */
David Chen0b5c90c2018-01-25 16:51:49 -08002611message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002612 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002613 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002614
2615 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2616 optional int32 label = 2;
2617
2618 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2619 // predicates for the metrics).
2620 enum State {
2621 UNKNOWN = 0;
2622 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2623 STOP = 2;
2624 START = 3;
2625 }
2626 optional State state = 3;
2627}
2628
David Chen9e3808c2017-11-20 17:25:34 -08002629/**
Bookatz7948c872018-09-04 12:58:33 -07002630 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2631 * For example, this could be due to the user manually changing the time.
2632 *
2633 * Logged from:
2634 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2635 */
2636message WallClockTimeShifted {
2637 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2638 optional int64 wall_clock_timestamp_millis = 1;
2639}
2640
2641/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002642 * Logs when statsd detects an anomaly.
2643 *
2644 * Logged from:
2645 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2646 */
2647message AnomalyDetected {
2648 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002649 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002650
Yangster-mac94e197c2018-01-02 16:03:03 -08002651 // Id of the config whose anomaly detection alert fired.
2652 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002653
Yangster-mac94e197c2018-01-02 16:03:03 -08002654 // Id of the alert (i.e. name of the anomaly that was detected).
2655 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002656}
2657
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002658message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002659 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002660 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002661
2662 // The app package name.
2663 optional string pkg_name = 2;
2664
2665 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002666 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002667 WARM = 1;
2668 HOT = 2;
2669 COLD = 3;
2670 }
2671 // The transition type.
2672 optional TransitionType type = 3;
2673
2674 // The activity name.
2675 optional string activity_name = 4;
2676
2677 // The name of the calling app. Empty if not set.
2678 optional string calling_pkg_name = 5;
2679
2680 // Whether the app is an instant app.
2681 optional bool is_instant_app = 6;
2682
2683 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002684 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002685
Bookatz80d11a02018-01-16 10:46:35 -08002686 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002687
David Chen0b5c90c2018-01-25 16:51:49 -08002688 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002689 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002690 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002691 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002692 optional int32 bind_application_delay_millis = 11;
2693 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002694
2695 // Empty if not set.
2696 optional string launch_token = 13;
2697
Calin Juravle759fbda2018-02-20 19:52:30 +00002698 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002699 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002700
2701 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002702 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002703}
2704
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002705message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002706 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002707 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002708
2709 // The app package name.
2710 optional string pkg_name = 2;
2711
2712 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002713 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002714 WARM = 1;
2715 HOT = 2;
2716 COLD = 3;
2717 }
2718 // The transition type.
2719 optional TransitionType type = 3;
2720
2721 // The activity name.
2722 optional string activity_name = 4;
2723}
2724
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002725message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002726 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002727 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002728
2729 // The app package name.
2730 optional string pkg_name = 2;
2731
2732 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002733 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002734 WITH_BUNDLE = 1;
2735 WITHOUT_BUNDLE = 2;
2736 }
2737 // The transition type.
2738 optional TransitionType type = 3;
2739
2740 // The activity name.
2741 optional string activity_name = 4;
2742
2743 optional bool transition_process_running = 5;
2744
2745 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002746 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002747}
2748
Bookatz8fcd09a2017-12-18 13:01:10 -08002749/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002750 * Logs a picture-in-picture action
2751 * Logged from:
2752 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2753 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2754 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2755 */
2756message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002757 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002758 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002759
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002760 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002761
Chenjie Yu52cacc62017-12-08 18:11:45 -08002762 enum State {
2763 ENTERED = 1;
2764 EXPANDED_TO_FULL_SCREEN = 2;
2765 MINIMIZED = 3;
2766 DISMISSED = 4;
2767 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002768 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002769}
2770
2771/**
Chenjie Yue8904192017-12-08 19:12:57 -08002772 * Logs overlay action
2773 * Logged from:
2774 * services/core/java/com/android/server/wm/Session.java
2775 */
2776message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002777 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002778
2779 optional string package_name = 2;
2780
2781 optional bool using_alert_window = 3;
2782
2783 enum State {
2784 ENTERED = 1;
2785 EXITED = 2;
2786 }
2787 optional State state = 4;
2788}
2789
Chenjie Yuccfe6452018-01-30 11:33:21 -08002790/*
2791 * Logs foreground service starts and stops.
2792 * Note that this is not when a service starts or stops, but when it is
2793 * considered foreground.
2794 * Logged from
2795 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2796 */
2797message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002798 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002799 // package_name + "/" + class_name
2800 optional string short_name = 2;
2801
2802 enum State {
2803 ENTER = 1;
2804 EXIT = 2;
2805 }
2806 optional State state = 3;
2807}
2808
Chenjie Yue8904192017-12-08 19:12:57 -08002809/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002810 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2811 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2812 * attributed back to the parent (host) uid. One example is Chrome.
2813 *
2814 * Logged from:
2815 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2816 */
2817message IsolatedUidChanged {
2818 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002819 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002820 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002821 optional int32 parent_uid = 1;
2822
2823 optional int32 isolated_uid = 2;
2824
2825 // We expect an isolated uid to be removed before if it's used for another parent uid.
2826 enum Event {
2827 REMOVED = 0;
2828 CREATED = 1;
2829 }
2830 optional Event event = 3;
2831}
2832
2833/*
2834 * Logs the reception of an incoming network packet causing the main system to wake up for
2835 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2836 * and processed by WakeupController.cpp.
2837 */
2838message PacketWakeupOccurred {
2839 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2840 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002841 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002842 // The interface name on which the packet was received.
2843 optional string iface = 2;
2844 // The ethertype value of the packet.
2845 optional int32 ethertype = 3;
2846 // String representation of the destination MAC address of the packet.
2847 optional string destination_hardware_address = 4;
2848 // String representation of the source address of the packet if this was an IP packet.
2849 optional string source_ip = 5;
2850 // String representation of the destination address of the packet if this was an IP packet.
2851 optional string destination_ip = 6;
2852 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2853 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2854 // families.
2855 optional int32 ip_next_header = 7;
2856 // The source port if this was a TCP or UDP packet.
2857 optional int32 source_port = 8;
2858 // The destination port if this was a TCP or UDP packet.
2859 optional int32 destination_port = 9;
2860}
2861
2862/*
2863 * Logs the memory stats for an app on startup.
2864 * Logged from:
2865 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2866 */
2867message AppStartMemoryStateCaptured {
2868 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002869 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002870
2871 // The process name.
2872 optional string process_name = 2;
2873
2874 // The activity name.
2875 optional string activity_name = 3;
2876
2877 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002878 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002879
2880 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002881 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002882
2883 // RSS
2884 optional int64 rss_in_bytes = 6;
2885
2886 // CACHE
2887 optional int64 cache_in_bytes = 7;
2888
2889 // SWAP
2890 optional int64 swap_in_bytes = 8;
2891}
2892
2893/*
2894 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2895 * for LMK event.
2896 * Logged from:
2897 * system/core/lmkd/lmkd.c
2898 */
2899message LmkStateChanged {
2900 enum State {
2901 UNKNOWN = 0;
2902 START = 1;
2903 STOP = 2;
2904 }
2905 optional State state = 1;
2906}
2907
2908/*
2909 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2910 * Logged from:
2911 * system/core/lmkd/lmkd.c
2912 */
2913message LmkKillOccurred {
2914 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002915 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002916
2917 // The process name.
2918 optional string process_name = 2;
2919
2920 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002921 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002922
2923 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002924 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002925
2926 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002927 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002928
2929 // RSS
2930 optional int64 rss_in_bytes = 6;
2931
2932 // CACHE
2933 optional int64 cache_in_bytes = 7;
2934
2935 // SWAP
2936 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002937
2938 // The elapsed real time of start of the process.
2939 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002940}
2941
Rajeev Kumar51b54602018-03-01 12:18:26 -08002942/*
2943 * Logs when the ActivityManagerService detects that an app died.
2944 *
2945 * Logged from:
2946 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2947 */
2948message AppDied {
2949 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002950 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002951}
2952
Howard Ro21a039c2018-08-06 14:55:47 -07002953/**
2954 * An atom for generic metrics logging. Available from Android Q.
2955 */
2956message GenericAtom {
2957 // The uid of the application that sent this custom atom.
2958 optional int32 uid = 1 [(is_uid) = true];
2959
2960 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002961 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002962}
2963
Tej Singhd6d6d772018-09-05 17:41:25 -07002964/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002965 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002966 *
2967 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002968 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002969 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002970message BiometricAcquired {
2971 // Biometric modality that was acquired.
2972 optional android.hardware.biometrics.ModalityEnum modality = 1;
2973 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
2974 optional int32 user = 2;
2975 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
2976 optional bool is_crypto = 3;
2977 // Action that the device is performing. Acquired messages are only expected for enroll and
2978 // authenticate. Other actions may indicate an error.
2979 optional android.hardware.biometrics.ActionEnum action = 4;
2980 // The client that this acquisition was received for.
2981 optional android.hardware.biometrics.ClientEnum client = 5;
2982 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
2983 optional int32 acquire_info = 6;
2984 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
2985 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07002986}
2987
2988/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002989 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002990 *
2991 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002992 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002993 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002994message BiometricAuthenticated {
2995 // Biometric modality that was used.
2996 optional android.hardware.biometrics.ModalityEnum modality = 1;
2997 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
2998 optional int32 user = 2;
2999 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3000 // storage.
3001 optional bool is_crypto = 3;
3002 // The client that this acquisition was received for.
3003 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003004 // If authentication requires user confirmation. See BiometricPrompt's
3005 // setRequireConfirmation(bool) method.
3006 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003007
Kevin Chyn1741a072019-01-17 11:54:40 -08003008 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003009 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003010 REJECTED = 1;
3011 PENDING_CONFIRMATION = 2;
3012 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003013 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003014
3015 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003016 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003017 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3018 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3019 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3020 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003021 optional int64 latency_millis = 7;
Kevin Chyn1741a072019-01-17 11:54:40 -08003022}
3023
3024/**
3025 * Logs when a biometric error occurs.
3026 *
3027 * Logged from:
3028 * frameworks/base/services/core/java/com/android/server/biometrics
3029 */
3030message BiometricErrorOccurred {
3031 // Biometric modality that was used.
3032 optional android.hardware.biometrics.ModalityEnum modality = 1;
3033 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3034 optional int32 user = 2;
3035 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3036 optional bool is_crypto = 3;
3037 // Action that the device is performing.
3038 optional android.hardware.biometrics.ActionEnum action = 4;
3039 // The client that this acquisition was received for.
3040 optional android.hardware.biometrics.ClientEnum client = 5;
3041 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3042 // are unique to modality.
3043 optional int32 error_info = 6;
3044 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3045 // by the vendor and not specified by the HIDL interface.
3046 optional int32 error_info_vendor = 7;
3047}
3048
3049/**
3050 * Logs when a biometric HAL has crashed.
3051 * Logged from:
3052 * frameworks/base/services/core/java/com/android/server/biometrics
3053 */
3054message BiometricHalDeathReported {
3055 // Biometric modality.
3056 optional android.hardware.biometrics.ModalityEnum modality = 1;
Tej Singhd6d6d772018-09-05 17:41:25 -07003057}
Howard Ro688ae182018-09-25 00:09:36 -07003058
3059message Notification {
3060
3061 // Type of notification event.
3062 enum Type {
3063 TYPE_UNKNOWN = 0;
3064 // Notification became visible to the user.
3065 TYPE_OPEN = 1;
3066 // Notification became hidden.
3067 TYPE_CLOSE = 2;
3068 // Notification switched to detail mode.
3069 TYPE_DETAIL = 3;
3070 // Notification was clicked.
3071 TYPE_ACTION = 4;
3072 // Notification was dismissed.
3073 TYPE_DISMISS = 5;
3074 // Notification switched to summary mode. The enum value of 14 is to
3075 // match that of metrics_constants.
3076 TYPE_COLLAPSE = 14;
3077 }
3078 optional Type type = 1;
3079
3080 // Package name associated with the notification.
3081 optional string package_name = 2;
3082
3083 // Tag associated with notification.
3084 optional string tag = 3;
3085
3086 // Application-supplied ID associated with the notification.
3087 optional int32 id = 4;
3088
3089 // Index of notification in the notification panel.
3090 optional int32 shade_index = 5;
3091
3092 // The number of notifications in the notification panel.
3093 optional int32 shade_count = 6;
3094
3095 // Importance for the notification.
3096 optional int32 importance = 7;
3097
3098 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07003099 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07003100
3101 // Importance for the notification channel.
3102 optional int32 channel_importance = 9;
3103
Howard Ro183c2bd2018-10-18 13:52:10 -07003104 // Application-supplied ID associated with the notifications group.
3105 optional string group_id = 10;
3106
Howard Ro688ae182018-09-25 00:09:36 -07003107 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07003108 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07003109
Howard Ro183c2bd2018-10-18 13:52:10 -07003110 // Reason for dismissal of a notification. This field is only meaningful for
3111 // TYPE_DISMISS events.
3112 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07003113
Howard Ro183c2bd2018-10-18 13:52:10 -07003114 // The first post time of notification, stable across updates.
3115 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07003116
Howard Ro183c2bd2018-10-18 13:52:10 -07003117 // The most recent interruption time, or the creation time if no updates.
3118 // Differs from update_millis because updates are filtered based on whether
3119 // they actually interrupted the user.
3120 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07003121
Howard Ro183c2bd2018-10-18 13:52:10 -07003122 // The most recent update time, or the creation time if no updates.
3123 optional int64 update_millis = 15;
3124
3125 // The most recent visibility event.
3126 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07003127}
3128
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003129/*
Tej Singh0d176952019-01-16 19:10:54 -08003130 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003131 */
Tej Singh0d176952019-01-16 19:10:54 -08003132message FlagFlipUpdateOccurred {
3133 // If the event is from a flag config package, specify the package name.
3134 optional string flag_flip_package_name = 1;
3135
3136 // The order id of the package
3137 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003138}
3139
3140/*
3141 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003142 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003143 */
3144message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003145 // Name of the train.
3146 optional string train_name = 1;
3147 // Version code for a "train" of packages that need to be installed atomically
3148 optional int64 train_version_code = 2;
3149 // After installation of this package, device requires a restart.
3150 optional bool requires_staging = 3;
3151 // Rollback should be enabled for this install.
3152 optional bool rollback_enabled = 4;
3153 // Requires low latency monitoring if possible.
3154 optional bool requires_low_latency_monitor = 5;
3155
Yangster-macb89807e2018-11-15 21:10:57 -08003156 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003157 UNKNOWN = 0;
3158 INSTALL_REQUESTED = 1;
3159 INSTALL_STARTED = 2;
3160 INSTALL_STAGED_NOT_READY = 3;
3161 INSTALL_STAGED_READY = 4;
3162 INSTALL_SUCCESS = 5;
3163 INSTALL_FAILURE = 6;
3164 INSTALL_CANCELLED = 7;
3165 INSTALLER_ROLLBACK_REQUESTED = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003166 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003167 optional State state = 6;
Yangster-macb89807e2018-11-15 21:10:57 -08003168}
3169
Maggie Whitefc1aa592018-11-28 21:55:23 -08003170/** Represents USB port overheat event. */
3171message UsbPortOverheatEvent {
3172 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3173 optional int32 plug_temperature_deci_c = 1;
3174
3175 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3176 optional int32 max_temperature_deci_c = 2;
3177
3178 /* Time between USB plug event and overheat threshold trip, in seconds. */
3179 optional int32 time_to_overheat_secs = 3;
3180
3181 /* Time between overheat threshold trip and hysteresis, in seconds. */
3182 optional int32 time_to_hysteresis_secs = 4;
3183
3184 /* Time between hysteresis and active mitigation ending, in seconds. */
3185 optional int32 time_to_inactive_secs = 5;
3186};
3187
Maggie White8735b852019-01-18 11:40:49 -08003188/**
3189 * Logs total effective full charge and discharge cycles on a battery.
3190 * Here are some examples of one effective cycle:
3191 * 1) the battery charges from 0% to 100% and drains back to 0%,
3192 * 2) charging from 50% to 100% and draining back to 50% twice.
3193 * Pulled from:
3194 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3195 */
3196message BatteryCycleCount {
3197 /* Number of total charge and discharge cycles on the system battery. */
3198 optional int32 cycle_count = 1;
3199}
3200
Yangster-macb89807e2018-11-15 21:10:57 -08003201/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003202 * Logs when a connection becomes available and lost.
3203 * Logged in StatsCompanionService.java
3204 */
3205message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003206 // Id of the network.
3207 optional int32 net_id = 1;
3208
3209 enum State {
3210 UNKNOWN = 0;
3211 CONNECTED = 1;
3212 DISCONNECTED = 2;
3213 }
3214 // Connected state of a network.
3215 optional State state = 2;
3216}
3217
3218/**
3219 * Logs when a service starts and stops.
3220 * Logged from:
3221 * services/core/java/com/android/server/am/ActiveServices.java
3222 */
3223message ServiceStateChanged {
3224
3225 optional int32 uid = 1 [(is_uid) = true];
3226
3227 optional string package_name = 2;
3228
3229 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003230
3231 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003232 START = 1;
3233 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003234 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003235
3236 optional State state = 4;
3237}
3238
3239/**
3240 * Logs when a service is launched.
3241 * Logged from:
3242 * services/core/java/com/android/server/am/ActiveServices.java
3243 */
3244message ServiceLaunchReported {
3245
3246 optional int32 uid = 1 [(is_uid) = true];
3247
3248 optional string package_name = 2;
3249
3250 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003251}
Howard Ro688ae182018-09-25 00:09:36 -07003252
Chenjie Yubbcbc602018-02-05 16:51:52 -08003253//////////////////////////////////////////////////////////////////////
3254// Pulled atoms below this line //
3255//////////////////////////////////////////////////////////////////////
3256
3257/**
David Chenc8a43242017-10-17 16:23:28 -07003258 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3259 *
3260 * Pulled from:
3261 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3262 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003263message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003264 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003265
3266 optional int64 rx_bytes = 2;
3267
3268 optional int64 rx_packets = 3;
3269
3270 optional int64 tx_bytes = 4;
3271
3272 optional int64 tx_packets = 5;
3273}
3274
3275/**
3276 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3277 *
3278 * Pulled from:
3279 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3280 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003281message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003282 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003283
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003284 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3285 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003286
3287 optional int64 rx_bytes = 3;
3288
3289 optional int64 rx_packets = 4;
3290
3291 optional int64 tx_bytes = 5;
3292
3293 optional int64 tx_packets = 6;
3294}
3295
3296/**
3297 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3298 *
3299 * Pulled from:
3300 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3301 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003302message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003303 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003304
3305 optional int64 rx_bytes = 2;
3306
3307 optional int64 rx_packets = 3;
3308
3309 optional int64 tx_bytes = 4;
3310
3311 optional int64 tx_packets = 5;
3312}
3313
3314/**
3315 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3316 *
3317 * Pulled from:
3318 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3319 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003320message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003321 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003322
Yao Chenc40a19d2018-03-15 16:48:25 -07003323 // 1 denotes foreground and 0 denotes background. This is called Set in
3324 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003325 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003326
3327 optional int64 rx_bytes = 3;
3328
3329 optional int64 rx_packets = 4;
3330
3331 optional int64 tx_bytes = 5;
3332
3333 optional int64 tx_packets = 6;
3334}
3335
3336/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003337 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3338 *
3339 * Pulled from:
3340 * StatsCompanionService
3341 */
3342message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003343 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003344
3345 optional int64 rx_bytes = 2;
3346
3347 optional int64 tx_bytes = 3;
3348}
3349
3350/**
David Chenc8a43242017-10-17 16:23:28 -07003351 * Pulls the kernel wakelock durations. This atom is adapted from
3352 * android/internal/os/KernelWakelockStats.java
3353 *
3354 * Pulled from:
3355 * StatsCompanionService using KernelWakelockReader.
3356 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003357message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003358 optional string name = 1;
3359
3360 optional int32 count = 2;
3361
3362 optional int32 version = 3;
3363
Yangster-maca8a30442018-10-13 23:46:34 -07003364 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003365}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003366
Chenjie Yu05013b32017-11-21 10:21:41 -08003367/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003368 * Pulls low power state information. If power.stats HAL is not available, this
3369 * includes platform and subsystem sleep state information,
3370 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3371 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003372 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003373 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003374 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3375 * as defined in:
3376 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003377 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003378message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003379 // Subsystem name
3380 optional string subsystem_name = 1;
3381 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3382 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003383 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3384 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003385 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003386 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003387 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003388 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003389 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003390}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003391
Chenjie Yu05013b32017-11-21 10:21:41 -08003392/**
Bookatz92da2832018-11-01 18:10:03 -07003393 * Pulls on-device power measurement information.
3394 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3395 * Pulled from:
3396 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3397 */
3398message OnDevicePowerMeasurement {
3399 // Name of the subsystem (to which the rail belongs).
3400 optional string subsystem_name = 1;
3401
3402 // Rail name. The rail lies within the subsystem.
3403 optional string rail_name = 2;
3404
3405 // Time (in ms since boot) at which the rail energy value was measured.
3406 // This may differ slightly from the time that statsd logs this information.
3407 optional uint64 measurement_timestamp_millis = 3;
3408
3409 // Accumulated energy used via the rail since device boot in uWs.
3410 optional uint64 energy_microwatt_secs = 4;
3411}
3412
3413/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003414 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003415 * Pulls the time the cpu spend on the frequency index. Frequency index
3416 * starts from highest to lowest. The value should be monotonically
3417 * increasing since boot. However, if there is a cpu
3418 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003419 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003420message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003421 optional uint32 cluster = 1;
3422 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003423 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003424}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003425
Chenjie Yu05013b32017-11-21 10:21:41 -08003426/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003427 * Pulls Cpu Time Per Uid.
3428 * Note that isolated process uid time should be attributed to host uids.
3429 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003430message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003431 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003432 optional uint64 user_time_micros = 2;
3433 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003434}
3435
3436/**
3437 * Pulls Cpu Time Per Uid per frequency.
3438 * Note that isolated process uid time should be attributed to host uids.
3439 * For each uid, we order the time by descending frequencies.
3440 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003441message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003442 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003443 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003444 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003445}
Hugo Benichi884970e2017-11-14 22:42:46 +09003446
Chenjie Yu05013b32017-11-21 10:21:41 -08003447/**
3448 * Pulls Wifi Controller Activity Energy Info
3449 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003450message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003451 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003452 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003453 // stack reported state
3454 // TODO: replace this with proto enum
3455 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003456 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003457 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003458 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003459 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003460 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003461 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003462 // product of current(mA), voltage(V) and time(ms)
3463 optional uint64 controller_energy_used = 6;
3464}
3465
3466/**
3467 * Pulls Modem Activity Energy Info
3468 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003469message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003470 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003471 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003472 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003473 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003474 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003475 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003476 /**
3477 * Tx power index
3478 * index 0 = tx_power < 0dBm
3479 * index 1 = 0dBm < tx_power < 5dBm
3480 * index 2 = 5dBm < tx_power < 15dBm
3481 * index 3 = 15dBm < tx_power < 20dBm
3482 * index 4 = tx_power > 20dBm
3483 */
3484 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003485 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003486 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003487 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003488 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003489 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003490 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003491 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003492 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003493 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003494 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003495 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003496 // product of current(mA), voltage(V) and time(ms)
3497 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003498}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003499
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003500/**
3501 * Pulls Bluetooth Activity Energy Info
3502 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3503 */
3504message BluetoothActivityInfo {
3505 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003506 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003507 // bluetooth stack state
3508 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003509 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003510 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003511 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003512 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003513 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003514 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003515 // product of current(mA), voltage(V) and time(ms)
3516 optional uint64 energy_used = 6;
3517}
3518
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003519/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003520 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003521 *
3522 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003523 */
3524message ProcessMemoryState {
3525 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003526 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003527
3528 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003529 // Usually package name, "system" for system server.
3530 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003531 optional string process_name = 2;
3532
Rafal Slawikda51b932018-12-13 16:31:33 +00003533 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003534 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003535
3536 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003537 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003538
3539 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003540 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003541
Rajeev Kumar90235992018-01-29 11:06:48 -08003542 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003543 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3544 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003545 optional int64 rss_in_bytes = 6;
3546
3547 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003548 // Value is read from memory.stat, field total_cache if per-app memory
3549 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003550 optional int64 cache_in_bytes = 7;
3551
3552 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003553 // Value is read from memory.stat, field total_swap if per-app memory
3554 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003555 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003556
Rafal Slawikd03ae422018-11-20 11:27:45 +00003557 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003558 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003559
3560 // Elapsed real time when the process started.
3561 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3562 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003563}
3564
3565/*
Rafal Slawik08621582018-10-15 14:53:07 +01003566 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003567 *
3568 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003569 */
3570message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003571 // The uid if available. -1 means not available.
3572 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003573
Rafal Slawikbf67d072018-10-23 11:07:54 +01003574 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003575 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003576 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003577
Rafal Slawikbf67d072018-10-23 11:07:54 +01003578 // # of page-faults
3579 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003580
Rafal Slawikbf67d072018-10-23 11:07:54 +01003581 // # of major page-faults
3582 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003583
Rafal Slawikbf67d072018-10-23 11:07:54 +01003584 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003585 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003586 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003587
Rafal Slawikd03ae422018-11-20 11:27:45 +00003588 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003589 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003590
3591 // Elapsed real time when the process started.
3592 // Value is read from /proc/PID/stat, field 22.
3593 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003594}
3595
3596/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003597 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003598 *
3599 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3600 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003601 *
3602 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003603 */
3604message ProcessMemoryHighWaterMark {
3605 // The uid if available. -1 means not available.
3606 optional int32 uid = 1 [(is_uid) = true];
3607
Rafal Slawikda51b932018-12-13 16:31:33 +00003608 // The process name.
3609 // Usually package name or process cmdline.
3610 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003611 optional string process_name = 2;
3612
3613 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3614 // /proc/PID/status.
3615 optional int64 rss_high_water_mark_in_bytes = 3;
3616}
3617
3618/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003619 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003620 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003621message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003622 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003623}
3624
3625/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003626 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003627 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003628message SystemUptime {
3629 // Milliseconds since the system was booted.
3630 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3631 // for external input).
3632 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003633 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003634}
3635
3636/*
3637 * Reads from /proc/uid_concurrent_active_time which has the format:
3638 * active: X (X is # cores)
3639 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3640 * [uid1]: [time-0] [time-1] [time-2] ... ...
3641 * ...
3642 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3643 * The file contains a monotonically increasing count of time for a single boot.
3644 */
3645message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003646 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003647 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003648}
3649
3650/**
3651 * Reads from /proc/uid_concurrent_policy_time which has the format:
3652 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3653 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3654 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3655 * ...
3656 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3657 * The file contains a monotonically increasing count of time for a single boot.
3658 */
3659message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003660 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003661 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003662 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003663}
3664
3665/*
3666 * Pulls free disk space, for data, system partition and temporary directory.
3667 */
3668message DiskSpace {
3669 // available bytes in data partition
3670 optional uint64 data_available_bytes = 1;
3671 // available bytes in system partition
3672 optional uint64 system_available_bytes = 2;
3673 // available bytes in download cache or temp directories
3674 optional uint64 temp_available_bytes = 3;
3675}
Tej Singhbf972d92018-01-10 20:51:13 -08003676
3677/**
3678 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003679 *
3680 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003681 */
3682message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003683 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003684}
3685
3686/**
3687 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003688 * Pulled from:
3689 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003690 */
3691message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003692 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003693}
3694
3695/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003696 * Pulls battery voltage.
3697 * Pulled from:
3698 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3699 */
3700message BatteryVoltage {
3701 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003702 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003703}
3704
3705/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003706 * Pulls battery level (percent full, from 0 to 100).
3707 *
3708 * Pulled from:
3709 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3710 */
3711message BatteryLevel {
3712 // Battery level. Should be in [0, 100].
3713 optional int32 battery_level = 1;
3714}
3715
3716/**
Tej Singhd89137e2018-03-26 14:51:40 -07003717 * Pulls the temperature of various parts of the device.
3718 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003719 *
3720 * Pulled from:
3721 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3722 */
3723message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003724 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003725 optional android.os.TemperatureTypeEnum sensor_location = 1;
3726
3727 // The name of the temperature source. Eg. CPU0
3728 optional string sensor_name = 2;
3729
Tej Singhd89137e2018-03-26 14:51:40 -07003730 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003731 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003732 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003733}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003734
3735/**
3736 * Pulls the statistics of calls to Binder.
3737 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003738 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3739 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003740 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003741 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003742 */
3743message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003744 // UID of the process responsible for the binder transaction. It will be set if the process
3745 // executing the binder transaction attribute the transaction to another uid using
3746 // Binder.setThreadWorkSource().
3747 //
3748 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003749 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003750 // UID of the process executing the binder transaction.
3751 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003752 // Fully qualified class name of the API call.
3753 //
3754 // This is a system server class name.
3755 //
3756 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3757 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3758 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3759 // commonly used APIs.
3760 optional string service_class_name = 2;
3761 // Method name of the API call. It can also be a transaction code if we cannot
3762 // resolve it to a name. See Binder#getTransactionName.
3763 //
3764 // This is a system server method name.
3765 optional string service_method_name = 3;
3766 // Total number of API calls.
3767 optional int64 call_count = 4;
3768 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3769 optional bool screen_interactive = 13;
3770 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3771 // call_count will be equal to recorded_call_count.
3772 //
3773 // If recorded_call_count is different than call_count, it means data collection has been
3774 // sampled. All the fields below will be sampled in this case.
3775 optional int64 recorded_call_count = 12;
3776 // Number of exceptions thrown by the API.
3777 optional int64 recorded_exception_count = 5;
3778 // Total latency of all API calls.
3779 // Average can be computed using total_latency_micros / recorded_call_count.
3780 optional int64 recorded_total_latency_micros = 6;
3781 // Maximum latency of one API call.
3782 optional int64 recorded_max_latency_micros = 7;
3783 // Total CPU usage of all API calls.
3784 // Average can be computed using total_cpu_micros / recorded_call_count.
3785 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3786 optional int64 recorded_total_cpu_micros = 8;
3787 // Maximum CPU usage of one API call.
3788 optional int64 recorded_max_cpu_micros = 9;
3789 // Maximum parcel reply size of one API call.
3790 optional int64 recorded_max_reply_size_bytes = 10;
3791 // Maximum parcel request size of one API call.
3792 optional int64 recorded_max_request_size_bytes = 11;
3793}
3794
3795/**
3796 * Pulls the statistics of exceptions during calls to Binder.
3797 *
3798 * Binder stats are cumulative from boot unless somebody reset the data using
3799 * > adb shell dumpsys binder_calls_stats --reset
3800 */
3801message BinderCallsExceptions {
3802 // Exception class name, e.g. java.lang.IllegalArgumentException.
3803 //
3804 // This is an exception class name thrown by the system server.
3805 optional string exception_class_name = 1;
3806 // Total number of exceptions.
3807 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003808}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003809
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003810/**
3811 * Pulls the statistics of message dispatching on HandlerThreads.
3812 *
3813 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3814 * config on the device.
3815 *
3816 * Next tag: 11
3817 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003818message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003819 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003820 optional int32 uid = 1 [(is_uid) = true];
3821
3822 // Fully qualified class name of the handler target class.
3823 //
3824 // This field does not contain PII. This is a system server class name.
3825 optional string handler_class_name = 2;
3826
3827 // The name of the thread that runs the Looper.
3828 //
3829 // This field does not contain PII. This is a system server thread name.
3830 optional string looper_thread_name = 3;
3831
3832 // The name of the dispatched message.
3833 //
3834 // This field does not contain PII. This is a system server constant or class
3835 // name.
3836 optional string message_name = 4;
3837
3838 // Total number of successfully dispatched messages.
3839 optional int64 message_count = 5;
3840
3841 // Total number of messages that failed dispatching.
3842 optional int64 exception_count = 6;
3843
3844 // Total number of processed messages we have data recorded for. If we
3845 // collected data for all the messages, message_count will be equal to
3846 // recorded_message_count.
3847 //
3848 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003849 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003850 optional int64 recorded_message_count = 7;
3851
3852 // Total latency of all processed messages.
3853 // Average can be computed using recorded_total_latency_micros /
3854 // recorded_message_count.
3855 optional int64 recorded_total_latency_micros = 8;
3856
3857 // Total CPU usage of all processed message.
3858 // Average can be computed using recorded_total_cpu_micros /
3859 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003860 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003861 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003862
3863 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3864 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003865
3866 // Max recorded CPU usage of all processed messages.
3867 optional int64 recorded_max_cpu_micros = 11;
3868
3869 // Max recorded latency of all processed messages.
3870 optional int64 recorded_max_latency_micros = 12;
3871
3872 // Total number of messages we tracked the dispatching delay for. If we
3873 // collected data for all the messages, message_count will be equal to
3874 // recorded_delay_message_count.
3875 //
3876 // If recorded_delay_message_count is different than message_count, it means data
3877 // collection has been sampled or/and not all messages specified the target dispatch time.
3878 // The fields below will be sampled in this case.
3879 optional int64 recorded_delay_message_count = 13;
3880
3881 // Total dispatching delay of all processed messages.
3882 // Calculated as a difference between the target dispatching time (Message.when)
3883 // and the actual dispatching time.
3884 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3885 optional int64 recorded_total_delay_millis = 14;
3886
3887 // Max dispatching delay of all processed messages.
3888 // Calculated as a difference between the target dispatching time (Message.when)
3889 // and the actual dispatching time.
3890 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003891}
Tej Singh86dc9db2018-09-06 00:39:57 +00003892
3893/**
3894 * Pulls disk information, such as write speed and latency.
3895 */
3896message DiskStats {
3897 // Time taken to open, write 512B to, and close a file.
3898 // -1 if error performing the check.
3899 optional int64 data_write_latency_millis = 1;
3900
3901 optional bool file_based_encryption = 2;
3902
3903 // Recent disk write speed in kB/s.
3904 // -1 if error querying storageed.
3905 // 0 if data is unavailable.
3906 optional int32 recent_disk_write_speed = 3;
3907}
3908
3909
3910/**
3911 * Free and total bytes of the Data, Cache, and System partition.
3912 */
3913message DirectoryUsage {
3914 enum Directory {
3915 UNKNOWN = 0;
3916 DATA = 1;
3917 CACHE = 2;
3918 SYSTEM = 3;
3919 }
3920 optional Directory directory = 1;
3921 optional int64 free_bytes = 2;
3922 optional int64 total_bytes = 3;
3923}
3924
3925
3926/**
3927 * Size of an application: apk size, data size, and cache size.
3928 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3929 * Information is only reported for apps with the primary user (user 0).
3930 * Sizes are aggregated by package name.
3931 */
3932message AppSize {
3933 // Including uids will involve modifying diskstats logic.
3934 optional string package_name = 1;
3935 // App size in bytes. -1 if unavailable.
3936 optional int64 app_size_bytes = 2;
3937 // App data size in bytes. -1 if unavailable.
3938 optional int64 app_data_size_bytes = 3;
3939 // App cache size in bytes. -1 if unavailable.
3940 optional int64 app_cache_size_bytes = 4;
3941 // Time that the cache file was produced.
3942 // Uses System.currentTimeMillis(), which is wall clock time.
3943 optional int64 cache_time_millis = 5;
3944}
3945
3946
3947/**
3948 * Size of a particular category. Eg: photos, videos.
3949 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3950 */
3951message CategorySize {
3952 enum Category {
3953 UNKNOWN = 0;
3954 APP_SIZE = 1;
3955 APP_DATA_SIZE = 2;
3956 APP_CACHE_SIZE = 3;
3957 PHOTOS = 4;
3958 VIDEOS = 5;
3959 AUDIO = 6;
3960 DOWNLOADS = 7;
3961 SYSTEM = 8;
3962 OTHER = 9;
3963 }
3964 optional Category category = 1;
3965 // Category size in bytes.
3966 optional int64 size_bytes = 2;
3967 // Time that the cache file was produced.
3968 // Uses System.currentTimeMillis(), which is wall clock time.
3969 optional int64 cache_time_millis = 3;
3970}
Tej Singhd6d6d772018-09-05 17:41:25 -07003971
3972/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003973 * Pulls per uid I/O stats. The stats are cumulative since boot.
3974 *
3975 * Read/write bytes are I/O events from a storage device
3976 * Read/write chars are data requested by read/write syscalls, and can be
3977 * satisfied by caching.
3978 *
3979 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3980 */
3981message DiskIo {
3982 optional int32 uid = 1 [(is_uid) = true];
3983 optional int64 fg_chars_read = 2;
3984 optional int64 fg_chars_write = 3;
3985 optional int64 fg_bytes_read = 4;
3986 optional int64 fg_bytes_write = 5;
3987 optional int64 bg_chars_read = 6;
3988 optional int64 bg_chars_write = 7;
3989 optional int64 bg_bytes_read = 8;
3990 optional int64 bg_bytes_write = 9;
3991 optional int64 fg_fsync = 10;
3992 optional int64 bg_fsync= 11;
3993}
3994
3995
3996/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003997 * Pulls the number of fingerprints for each user.
3998 *
Kevin Chyn1741a072019-01-17 11:54:40 -08003999 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004000 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004001message NumBiometricsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004002 // The associated user. Eg: 0 for owners, 10+ for others.
4003 // Defined in android/os/UserHandle.java
4004 optional int32 user = 1;
4005 // Number of fingerprints registered to that user.
Kevin Chyn1741a072019-01-17 11:54:40 -08004006 optional int32 num_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004007}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004008
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004009/**
4010 * A mapping of role holder -> role
4011 */
4012message RoleHolder {
4013 // uid of the role holder
4014 optional int32 uid = 1 [(is_uid) = true];
4015
4016 // package name of the role holder
4017 optional string package_name = 2;
4018
4019 // the role held
4020 optional string role = 3;
4021}
4022
Yangsteraf9aee72018-10-12 09:26:16 -07004023message AggStats {
4024 optional int64 min = 1;
4025
4026 optional int64 average = 2;
4027
4028 optional int64 max = 3;
4029}
4030
4031message ProcessStatsStateProto {
4032 optional android.service.procstats.ScreenState screen_state = 1;
4033
4034 optional android.service.procstats.MemoryState memory_state = 2;
4035
4036 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4037 // and not frameworks/base/core/java/android/app/ActivityManager.java
4038 optional android.service.procstats.ProcessState process_state = 3;
4039
4040 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004041 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004042
4043 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004044 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004045
4046 // # of samples taken
4047 optional int32 sample_size = 5;
4048
4049 // PSS is memory reserved for this process
4050 optional AggStats pss = 6;
4051
4052 // USS is memory shared between processes, divided evenly for accounting
4053 optional AggStats uss = 7;
4054
4055 // RSS is memory resident for this process
4056 optional AggStats rss = 8;
4057}
4058
4059// Next Tag: 7
4060message ProcessStatsProto {
4061 // Name of process.
4062 optional string process = 1;
4063
4064 // Uid of the process.
4065 optional int32 uid = 2;
4066
4067 // Information about how often kills occurred
4068 message Kill {
4069 // Count of excessive CPU kills
4070 optional int32 cpu = 1;
4071
4072 // Count of kills when cached
4073 optional int32 cached = 2;
4074
4075 // PSS stats during cached kill
4076 optional AggStats cached_pss = 3;
4077 }
4078 optional Kill kill = 3;
4079
4080 // Time and memory spent in various states.
4081 repeated ProcessStatsStateProto states = 5;
4082
4083 // Total time process has been running... screen_state, memory_state, and process_state
4084 // will not be set.
4085 optional ProcessStatsStateProto total_running_state = 6;
4086}
4087
4088message PackageServiceOperationStatsProto {
4089 // Operate enum: Started, Foreground, Bound, Executing
4090 optional android.service.procstats.ServiceOperationState operation = 1;
4091
4092 // Number of times the service was in this operation.
4093 optional int32 count = 2;
4094
4095 // Information about a state the service can be in.
4096 message StateStats {
4097 // Screen state enum.
4098 optional android.service.procstats.ScreenState screen_state = 1;
4099 // Memory state enum.
4100 optional android.service.procstats.MemoryState memory_state = 2;
4101
4102 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004103 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004104 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004105 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004106 }
4107 repeated StateStats state_stats = 3;
4108}
4109
4110message PackageServiceStatsProto {
4111 // Name of service component.
4112 optional string service_name = 1;
4113
4114 // The operation stats.
4115 // The package_name, package_uid, package_version, service_name will not be set to save space.
4116 repeated PackageServiceOperationStatsProto operation_stats = 2;
4117}
4118
4119message PackageAssociationSourceProcessStatsProto {
4120 // Uid of the process.
4121 optional int32 process_uid = 1;
4122 // Process name.
4123 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004124 // Package name.
4125 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004126 // Total count of the times this association appeared.
4127 optional int32 total_count = 3;
4128
4129 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004130 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004131
4132 // Total count of the times this association became actively impacting its target process.
4133 optional int32 active_count = 5;
4134
4135 // Information on one source in this association.
4136 message StateStats {
4137 // Process state enum.
4138 optional android.service.procstats.ProcessState process_state = 1;
4139 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004140 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004141 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004142 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004143 }
4144 repeated StateStats active_state_stats = 6;
4145}
4146
4147message PackageAssociationProcessStatsProto {
4148 // Name of the target component.
4149 optional string component_name = 1;
4150 // Information on one source in this association.
4151 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4152}
4153
4154
4155message ProcessStatsPackageProto {
4156 // Name of package.
4157 optional string package = 1;
4158
4159 // Uid of the package.
4160 optional int32 uid = 2;
4161
4162 // Version of the package.
4163 optional int64 version = 3;
4164
4165 // Stats for each process running with the package loaded in to it.
4166 repeated ProcessStatsProto process_stats = 4;
4167
4168 // Stats for each of the package's services.
4169 repeated PackageServiceStatsProto service_stats = 5;
4170
4171 // Stats for each association with the package.
4172 repeated PackageAssociationProcessStatsProto association_stats = 6;
4173}
4174
4175message ProcessStatsSectionProto {
4176 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004177 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004178
4179 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004180 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004181
4182 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004183 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004184
4185 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004186 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004187
4188 // System runtime library. e.g. "libdvm.so", "libart.so".
4189 optional string runtime = 5;
4190
4191 // whether kernel reports swapped pss.
4192 optional bool has_swapped_pss = 6;
4193
4194 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4195 enum Status {
4196 STATUS_UNKNOWN = 0;
4197 STATUS_COMPLETE = 1;
4198 STATUS_PARTIAL = 2;
4199 STATUS_SHUTDOWN = 3;
4200 STATUS_SYSPROPS = 4;
4201 }
4202 repeated Status status = 7;
4203
Chenjie Yub2ecc792019-01-17 10:27:26 -08004204 // Number of pages available of various types and sizes, representation fragmentation.
4205 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4206
Yangsteraf9aee72018-10-12 09:26:16 -07004207 // Stats for each process.
4208 repeated ProcessStatsProto process_stats = 8;
4209
4210 // Stats for each package.
4211 repeated ProcessStatsPackageProto package_stats = 9;
4212}
4213
Chenjie Yub2ecc792019-01-17 10:27:26 -08004214message ProcessStatsAvailablePagesProto {
4215 // Node these pages are in (as per /proc/pagetypeinfo)
4216 optional int32 node = 1;
4217
4218 // Zone these pages are in (as per /proc/pagetypeinfo)
4219 optional string zone = 2;
4220
4221 // Label for the type of these pages (as per /proc/pagetypeinfo)
4222 optional string label = 3;
4223
4224 // Distribution of number of pages available by order size. First entry in array is
4225 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4226 repeated int32 pages_per_order = 4;
4227}
4228
Chenjie Yu12e5e672018-09-14 15:54:59 -07004229/**
4230 * Pulled from ProcessStatsService.java
4231 */
4232message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004233 optional ProcessStatsSectionProto proc_stats_section = 1;
4234}
4235
Chenjie Yuf910b7802019-01-11 16:08:20 -08004236/**
4237 * Pulled from ProcessStatsService.java
4238 */
4239message ProcStatsPkgProc {
4240 optional ProcessStatsSectionProto proc_stats_section = 1;
4241}
4242
Yangsteraf9aee72018-10-12 09:26:16 -07004243message PowerProfileProto {
4244 optional double cpu_suspend = 1;
4245
4246 optional double cpu_idle = 2;
4247
4248 optional double cpu_active = 3;
4249
4250 message CpuCluster {
4251 optional int32 id = 1;
4252 optional double cluster_power = 2;
4253 optional int32 cores = 3;
4254 repeated int64 speed = 4;
4255 repeated double core_power = 5;
4256 }
4257
4258 repeated CpuCluster cpu_cluster = 40;
4259
4260 optional double wifi_scan = 4;
4261
4262 optional double wifi_on = 5;
4263
4264 optional double wifi_active = 6;
4265
4266 optional double wifi_controller_idle = 7;
4267
4268 optional double wifi_controller_rx = 8;
4269
4270 optional double wifi_controller_tx = 9;
4271
4272 repeated double wifi_controller_tx_levels = 10;
4273
4274 optional double wifi_controller_operating_voltage = 11;
4275
4276 optional double bluetooth_controller_idle = 12;
4277
4278 optional double bluetooth_controller_rx = 13;
4279
4280 optional double bluetooth_controller_tx = 14;
4281
4282 optional double bluetooth_controller_operating_voltage = 15;
4283
4284 optional double modem_controller_sleep = 16;
4285
4286 optional double modem_controller_idle = 17;
4287
4288 optional double modem_controller_rx = 18;
4289
4290 repeated double modem_controller_tx = 19;
4291
4292 optional double modem_controller_operating_voltage = 20;
4293
4294 optional double gps_on = 21;
4295
4296 repeated double gps_signal_quality_based = 22;
4297
4298 optional double gps_operating_voltage = 23;
4299
4300 optional double bluetooth_on = 24;
4301
4302 optional double bluetooth_active = 25;
4303
4304 optional double bluetooth_at_cmd = 26;
4305
4306 optional double ambient_display = 27;
4307
4308 optional double screen_on = 28;
4309
4310 optional double radio_on = 29;
4311
4312 optional double radio_scanning = 30;
4313
4314 optional double radio_active = 31;
4315
4316 optional double screen_full = 32;
4317
4318 optional double audio = 33;
4319
4320 optional double video = 34;
4321
4322 optional double flashlight = 35;
4323
4324 optional double memory = 36;
4325
4326 optional double camera = 37;
4327
4328 optional double wifi_batched_scan = 38;
4329
4330 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004331}
Chenjie Yuab530202018-09-26 12:39:20 -07004332
4333/**
4334 * power_profile.xml and other constants for power model calculations.
4335 * Pulled from PowerProfile.java
4336 */
4337message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004338 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004339}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004340
4341/**
arangelovd5db50e2018-10-12 20:24:39 +01004342 * Logs when a user restriction was added or removed.
4343 *
4344 * Logged from:
4345 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4346 */
4347message UserRestrictionChanged {
4348 // The raw string of the user restriction as defined in UserManager.
4349 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4350 optional string restriction = 1;
4351 // Whether the restriction is enabled or disabled.
4352 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004353}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004354
4355/**
4356 * Pulls process user time and system time. Puller takes a snapshot of all pids
4357 * in the system and returns cpu stats for those that are working at the time.
4358 * Dead pids will be dropped. Kernel processes are excluded.
4359 * Min cool-down is 5 sec.
4360 */
4361message ProcessCpuTime {
4362 optional int32 uid = 1 [(is_uid) = true];
4363
4364 optional string process_name = 2;
4365 // Process cpu time in user space, cumulative from boot/process start
4366 optional int64 user_time_millis = 3;
4367 // Process cpu time in system space, cumulative from boot/process start
4368 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004369}
Misha Wagner5a51e002018-10-03 15:04:09 +01004370
4371/**
4372 * Pulls the CPU usage for each thread.
4373 *
4374 * Read from /proc/$PID/task/$TID/time_in_state files.
4375 *
4376 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4377 * time_in_state files not being present on some phones, have not been addressed. These should be
4378 * considered before a public release.
4379 */
4380message CpuTimePerThreadFreq {
4381 // UID that owns the process.
4382 optional int32 uid = 1 [(is_uid) = true];
4383 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004384 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004385 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004386 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004387 // Name of the process taken from `/proc/$PID/cmdline`.
4388 optional string process_name = 4;
4389 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4390 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004391
4392 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4393 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4394 // frequencies are given here as the alternative is sending eight separate atoms. This method
4395 // significantly reduces the amount of data created
4396 optional int32 frequency1_khz = 6;
4397 optional int32 time1_millis = 7;
4398 optional int32 frequency2_khz = 8;
4399 optional int32 time2_millis = 9;
4400 optional int32 frequency3_khz = 10;
4401 optional int32 time3_millis = 11;
4402 optional int32 frequency4_khz = 12;
4403 optional int32 time4_millis = 13;
4404 optional int32 frequency5_khz = 14;
4405 optional int32 time5_millis = 15;
4406 optional int32 frequency6_khz = 16;
4407 optional int32 time6_millis = 17;
4408 optional int32 frequency7_khz = 18;
4409 optional int32 time7_millis = 19;
4410 optional int32 frequency8_khz = 20;
4411 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004412}
Bookatz75ee6042018-11-09 12:27:37 -08004413
4414/**
Bookatz366a4432018-11-20 09:42:33 -08004415 * Pulls information about the device's build.
4416 */
4417message BuildInformation {
4418 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4419 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4420 optional string fingerprint = 1;
4421
4422 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4423 optional string brand = 2;
4424
4425 // Build.PRODUCT. The name of the overall product.
4426 optional string product = 3;
4427
4428 // Build.DEVICE. The name of the industrial design.
4429 optional string device = 4;
4430
4431 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4432 optional string version_release = 5;
4433
4434 // Build.ID. E.g. a label like "M4-rc20".
4435 optional string id = 6;
4436
4437 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4438 // represent this build.
4439 optional string version_incremental = 7;
4440
4441 // Build.TYPE. The type of build, like "user" or "eng".
4442 optional string type = 8;
4443
4444 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4445 optional string tags = 9;
4446}
4447
4448/**
Bookatz75ee6042018-11-09 12:27:37 -08004449 * Pulls on-device BatteryStats power use calculations for the overall device.
4450 */
4451message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004452 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4453 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4454 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4455 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004456}
4457
4458/**
4459 * Pulls on-device BatteryStats power use calculations broken down by uid.
4460 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4461 * that is attributed to non-uid items. They must all be included to get the total power use.
4462 */
4463message DeviceCalculatedPowerBlameUid {
4464 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4465 optional int32 uid = 1 [(is_uid) = true];
4466
Bookatz3dbc13a2018-12-21 12:16:51 -08004467 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4468 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4469 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004470}
4471
4472/**
4473 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4474 * drain type.
4475 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4476 * is attributed uids. They must all be included to get the total power use.
4477 */
4478message DeviceCalculatedPowerBlameOther {
4479 // The type of item whose power use is being reported.
4480 enum DrainType {
4481 AMBIENT_DISPLAY = 0;
4482 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4483 BLUETOOTH = 2;
4484 CAMERA = 3;
4485 // Cell-standby
4486 CELL = 4;
4487 FLASHLIGHT = 5;
4488 IDLE = 6;
4489 MEMORY = 7;
4490 // Amount that total computed drain exceeded the drain estimated using the
4491 // battery level changes and capacity.
4492 OVERCOUNTED = 8;
4493 PHONE = 9;
4494 SCREEN = 10;
4495 // Amount that total computed drain was below the drain estimated using the
4496 // battery level changes and capacity.
4497 UNACCOUNTED = 11;
4498 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4499 WIFI = 13;
4500 }
4501 optional DrainType drain_type = 1;
4502
Bookatz3dbc13a2018-12-21 12:16:51 -08004503 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4504 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4505 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004506}
arangelov4e994062018-11-13 16:12:38 +00004507
4508/**
4509 * Logs device policy features.
4510 *
4511 * Logged from:
4512 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4513 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4514 */
4515message DevicePolicyEvent {
4516 // The event id - unique for each event.
4517 optional android.stats.devicepolicy.EventId event_id = 1;
4518 // The admin package name.
4519 optional string admin_package_name = 2;
4520 // A generic integer parameter.
4521 optional int32 integer_value = 3;
4522 // A generic boolean parameter.
4523 optional bool boolean_value = 4;
4524 // A parameter specifying a time period in milliseconds.
4525 optional uint64 time_period_millis = 5;
4526 // A parameter specifying a list of package names, bundle extras or string parameters.
4527 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4528}
shawnlinea5b66b2018-11-13 15:05:29 +08004529
4530/**
4531 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4532 *
4533 * Logged from:
4534 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4535 */
4536message DocsUILaunchReported {
4537 optional android.stats.docsui.LaunchAction launch_action = 1;
4538 optional bool has_initial_uri = 2;
4539 optional android.stats.docsui.MimeType mime_type = 3;
4540 optional android.stats.docsui.Root initial_root = 4;
4541}
4542
4543/**
4544 * Logs root/app visited event in file managers/picker. Call this when the user
4545 * taps on root/app in hamburger menu.
4546 *
4547 * Logged from:
4548 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4549 */
4550message DocsUIRootVisitedReported {
4551 optional android.stats.docsui.ContextScope scope = 1;
4552 optional android.stats.docsui.Root root = 2;
4553}
4554
4555/**
4556 * Logs file operation stats. Call this when a file operation has completed.
4557 *
4558 * Logged from:
4559 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4560 */
4561message DocsUIFileOperationReported {
4562 optional android.stats.docsui.Provider provider = 1;
4563 optional android.stats.docsui.FileOperation file_op = 2;
4564}
4565
4566/**
4567 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4568 * mode.
4569 *
4570 * Logged from:
4571 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4572 */
4573message DocsUIFileOperationCopyMoveModeReported {
4574 optional android.stats.docsui.FileOperation file_op = 1;
4575 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4576}
4577
4578
4579/**
4580 * Logs file sub operation stats. Call this when a file operation has failed.
4581 *
4582 * Logged from:
4583 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4584 */
4585message DocsUIFileOperationFailureReported {
4586 optional android.stats.docsui.Authority authority = 1;
4587 optional android.stats.docsui.SubFileOperation sub_op = 2;
4588}
4589
4590/**
4591* Logs the cancellation of a file operation. Call this when a job is canceled
4592*
4593* Logged from:
4594* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4595*/
4596message DocsUIFileOperationCanceledReported {
4597 optional android.stats.docsui.FileOperation file_op = 1;
4598}
4599
4600/**
4601 * Logs startup time in milliseconds.
4602 *
4603 * Logged from:
4604 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4605 */
4606message DocsUIStartupMsReported {
4607 optional int32 startup_millis = 1;
4608}
4609
4610/**
4611 * Logs the action that was started by user.
4612 *
4613 * Logged from:
4614 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4615 */
4616message DocsUIUserActionReported {
4617 optional android.stats.docsui.UserAction action = 1;
4618}
4619
4620/**
4621 * Logs the invalid type when invalid scoped access is requested.
4622 *
4623 * Logged from:
4624 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4625 */
4626message DocsUIInvalidScopedAccessRequestReported {
4627 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004628}
Ben Murdochbab399f2018-12-06 11:01:38 +00004629
4630/**
shawnlina75e82d2019-01-07 10:31:12 +08004631 * Logs the package name that launches docsui picker mode.
4632 *
4633 * Logged from:
4634 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4635 */
4636message DocsUIPickerLaunchedFromReported {
4637 optional string package_name = 1;
4638}
4639
4640/**
4641 * Logs the search type.
4642 *
4643 * Logged from:
4644 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4645 */
4646message DocsUISearchTypeReported {
4647 optional android.stats.docsui.SearchType search_type = 1;
4648}
4649
4650/**
4651 * Logs the search mode.
4652 *
4653 * Logged from:
4654 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4655 */
4656message DocsUISearchModeReported {
4657 optional android.stats.docsui.SearchMode search_mode = 1;
4658}
4659
4660/**
4661 * Logs the pick result information.
4662 *
4663 * Logged from:
4664 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4665 */
4666message DocsUIPickResultReported {
4667 optional int32 total_action_count = 1;
4668 optional int64 duration_millis = 2;
4669 optional int32 file_count= 3;
4670 optional bool is_searching = 4;
4671 optional android.stats.docsui.Root picked_from = 5;
4672 optional android.stats.docsui.MimeType mime_type = 6;
4673 optional int32 repeatedly_pick_times = 7;
4674}
4675
4676/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004677 * Logs when an app's memory is compacted.
4678 *
4679 * Logged from:
4680 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4681 */
4682message AppCompacted {
4683 // The pid of the process being compacted.
4684 optional int32 pid = 1;
4685
4686 // The name of the process being compacted.
4687 optional string process_name = 2;
4688
4689 // The type of compaction.
4690 enum Action {
4691 UNKNOWN = 0;
4692 SOME = 1;
4693 FULL = 2;
4694 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004695 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004696
4697 // Total RSS in kilobytes consumed by the process prior to compaction.
4698 optional int64 before_rss_total_kilobytes = 4;
4699
4700 // File RSS in kilobytes consumed by the process prior to compaction.
4701 optional int64 before_rss_file_kilobytes = 5;
4702
4703 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4704 optional int64 before_rss_anon_kilobytes = 6;
4705
4706 // Swap in kilobytes consumed by the process prior to compaction.
4707 optional int64 before_swap_kilobytes = 7;
4708
4709 // Total RSS in kilobytes consumed by the process after compaction.
4710 optional int64 after_rss_total_kilobytes = 8;
4711
4712 // File RSS in kilobytes consumed by the process after compaction.
4713 optional int64 after_rss_file_kilobytes = 9;
4714
4715 // Anonymous RSS in kilobytes consumed by the process after compaction.
4716 optional int64 after_rss_anon_kilobytes = 10;
4717
4718 // Swap in kilobytes consumed by the process after compaction.
4719 optional int64 after_swap_kilobytes = 11;
4720
4721 // The time taken to perform compaction in milliseconds.
4722 optional int64 time_to_compact_millis = 12;
4723
4724 // The last compaction action performed for this app.
4725 optional Action last_action = 13;
4726
Ben Murdoch01720b82018-12-19 18:03:44 +00004727 // The last time that compaction was attempted on this process in milliseconds
4728 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4729 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004730
Ben Murdoch01720b82018-12-19 18:03:44 +00004731 // The oom_score_adj at the time of compaction.
4732 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004733
4734 // The process state at the time of compaction.
4735 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
4736}
lifr157fc552018-12-12 16:38:04 +08004737
4738/**
4739 * Logs the latency period(in microseconds) and the return code of
4740 * the DNS(Domain Name System) lookups.
4741 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4742 * to get info(address or hostname) from DNS server(or DNS cache).
4743 * Logged from:
4744 * /system/netd/server/DnsProxyListener.cpp
4745 */
4746message NetworkDnsEventReported {
4747 // The types of the DNS lookups, as defined in
4748 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4749 enum EventType {
4750 EVENT_UNKNOWN = 0;
4751 EVENT_GETADDRINFO = 1;
4752 EVENT_GETHOSTBYNAME = 2;
4753 EVENT_GETHOSTBYADDR = 3;
4754 EVENT_RES_NSEND = 4;
4755 }
4756 optional EventType event_type = 1;
4757
4758 // The return value of the DNS resolver for each DNS lookups.
4759 //bionic/libc/include/netdb.h
4760 //system/netd/resolv/include/netd_resolv/resolv.h
4761 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004762 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004763 EAI_ADDRFAMILY = 1;
4764 EAI_AGAIN = 2;
4765 EAI_BADFLAGS = 3;
4766 EAI_FAIL = 4;
4767 EAI_FAMILY = 5;
4768 EAI_MEMORY = 6;
4769 EAI_NODATA = 7;
4770 EAI_NONAME = 8;
4771 EAI_SERVICE = 9;
4772 EAI_SOCKTYPE = 10;
4773 EAI_SYSTEM = 11;
4774 EAI_BADHINTS = 12;
4775 EAI_PROTOCOL = 13;
4776 EAI_OVERFLOW = 14;
4777 RESOLV_TIMEOUT = 255;
4778 EAI_MAX = 256;
4779 }
4780 optional ReturnCode return_code = 2;
4781
4782 // The latency period(in microseconds) it took for this DNS lookup to complete.
4783 optional int32 latency_micros = 3;
4784}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004785
4786/**
4787 * Logs when a data stall event occurs.
4788 *
4789 * Log from:
4790 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4791 */
4792message DataStallEvent {
4793 // Data stall evaluation type.
4794 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4795 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4796 optional int32 evaluation_type = 1;
4797 // See definition in data_stall_event.proto.
4798 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4799 // See definition in data_stall_event.proto.
4800 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4801 // See definition in data_stall_event.proto.
4802 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4803 // See definition in data_stall_event.proto.
4804 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4805 // See definition in data_stall_event.proto.
4806 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4807}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004808
4809/*
4810 * Logs when RescueParty resets some set of experiment flags.
4811 *
4812 * Logged from:
4813 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4814 */
4815message RescuePartyResetReported {
4816 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4817 optional int32 rescue_level = 1;
4818}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004819
4820/**
4821 * Logs when signed config is received from an APK, and if that config was applied successfully.
4822 * Logged from:
4823 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4824 */
4825message SignedConfigReported {
4826 enum Type {
4827 UNKNOWN_TYPE = 0;
4828 GLOBAL_SETTINGS = 1;
4829 }
4830 optional Type type = 1;
4831
4832 // The final status of the signed config received.
4833 enum Status {
4834 UNKNOWN_STATUS = 0;
4835 APPLIED = 1;
4836 BASE64_FAILURE_CONFIG = 2;
4837 BASE64_FAILURE_SIGNATURE = 3;
4838 SECURITY_EXCEPTION = 4;
4839 INVALID_CONFIG = 5;
4840 OLD_CONFIG = 6;
4841 SIGNATURE_CHECK_FAILED = 7;
4842 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004843 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004844 }
4845 optional Status status = 2;
4846
4847 // The version of the signed config processed.
4848 optional int32 version = 3;
4849
4850 // The package name that the config was extracted from.
4851 optional string from_package = 4;
4852
4853 enum Key {
4854 NO_KEY = 0;
4855 DEBUG = 1;
4856 PRODUCTION = 2;
4857 }
4858 // Which key was used to verify the config.
4859 optional Key verified_with = 5;
4860}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004861
4862/*
4863 * Logs GNSS Network-Initiated (NI) location events.
4864 *
4865 * Logged from:
4866 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4867 */
4868message GnssNiEventReported {
4869 // The type of GnssNiEvent.
4870 enum EventType {
4871 UNKNOWN = 0;
4872 NI_REQUEST = 1;
4873 NI_RESPONSE = 2;
4874 }
4875 optional EventType event_type = 1;
4876
4877 // An ID generated by HAL to associate NI notifications and UI responses.
4878 optional int32 notification_id = 2;
4879
4880 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004881 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004882
4883 // NI requires notification.
4884 optional bool need_notify = 4;
4885
4886 // NI requires verification.
4887 optional bool need_verify = 5;
4888
4889 // NI requires privacy override, no notification/minimal trace.
4890 optional bool privacy_override = 6;
4891
4892 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4893 // seconds.
4894 optional int32 timeout = 7;
4895
4896 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004897 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004898
4899 // String representing the requester of the network inititated location request.
4900 optional string requestor_id = 9;
4901
4902 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4903 // network initiated location request.
4904 optional string text = 10;
4905
4906 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004907 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004908
4909 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004910 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004911
4912 // True if SUPL ES is enabled.
4913 optional bool is_supl_es_enabled = 13;
4914
4915 // True if GNSS location is enabled.
4916 optional bool is_location_enabled = 14;
4917
4918 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004919 optional android.server.location.GnssUserResponseType user_response = 15;
4920}
4921
4922/**
4923 * Logs GNSS non-framework (NFW) location notification.
4924 *
4925 * Logged from:
4926 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4927 */
4928message GnssNfwNotificationReported {
4929 // Package name of the Android proxy application representing the non-framework entity that
4930 // requested location. Set to empty string if unknown.
4931 optional string proxy_app_package_name = 1;
4932
4933 // Protocol stack that initiated the non-framework location request.
4934 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4935
4936 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
4937 // set to empty string. This field is opaque to the framework and used for logging purposes.
4938 optional string other_protocol_stack_name = 3;
4939
4940 // Source initiating/receiving the location information.
4941 optional android.server.location.NfwRequestor requestor = 4;
4942
4943 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
4944 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
4945 // and used for logging purposes.
4946 optional string requestor_id = 5;
4947
4948 // Indicates whether location information was provided for this request.
4949 optional android.server.location.NfwResponseType response_type = 6;
4950
4951 // True if the device is in user initiated emergency session.
4952 optional bool in_emergency_mode = 7;
4953
4954 // True if cached location is provided.
4955 optional bool is_cached_location = 8;
4956
4957 // True if proxy app permission mismatch between framework and GNSS HAL.
4958 optional bool is_permission_mismatched = 9;
4959}
4960
4961/**
4962 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
4963 *
4964 * Logged from:
4965 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
4966 */
4967message GnssConfigurationReported {
4968 // SUPL host name.
4969 optional string supl_host = 1;
4970
4971 // SUPL port number.
4972 optional int32 supl_port = 2;
4973
4974 // C2K host name.
4975 optional string c2k_host = 3;
4976
4977 // C2K port number.
4978 optional int32 c2k_port = 4;
4979
4980 // The SUPL version requested by Carrier.
4981 optional int32 supl_ver = 5;
4982
4983 // The SUPL mode.
4984 optional android.server.location.SuplMode supl_mode = 6;
4985
4986 // True if NI emergency SUPL restrictions is enabled.
4987 optional bool supl_es = 7;
4988
4989 // LTE Positioning Profile settings
4990 optional android.server.location.LppProfile lpp_profile = 8;
4991
4992 // Positioning protocol on A-Glonass system.
4993 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
4994
4995 // True if emergency PDN is used. Otherwise, regular PDN is used.
4996 optional bool use_emergency_pdn_for_emergency_supl= 10;
4997
4998 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
4999 optional android.server.location.GpsLock gps_lock = 11;
5000
5001 // Number of seconds to extend the emergency session duration post emergency call.
5002 optional int32 es_extension_sec = 12;
5003
5004 // The full list of package names of proxy Android applications representing the non-framework
5005 // location access entities (on/off the device) for which the framework user has granted
5006 // non-framework location access permission. The package names are concatenated in one string
5007 // with spaces as separators.
5008 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005009}
Jack Yu95b64f32018-12-13 18:26:11 +08005010
5011/**
5012 * Logs when a NFC device's error occurred.
5013 * Logged from:
5014 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5015 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5016 */
5017message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005018 enum Type {
5019 UNKNOWN = 0;
5020 CMD_TIMEOUT = 1;
5021 ERROR_NOTIFICATION = 2;
5022 AID_OVERFLOW = 3;
5023 }
5024 optional Type type = 1;
5025 // If it's nci cmd timeout, log the timeout command.
5026 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005027
Alex Salod7c3eef2019-01-25 14:43:27 -08005028 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005029}
5030
5031/**
5032 * Logs when a NFC device's state changed event
5033 * Logged from:
5034 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5035 */
5036message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005037 enum State {
5038 UNKNOWN = 0;
5039 OFF = 1;
5040 ON = 2;
5041 ON_LOCKED = 3; // Secure Nfc enabled.
5042 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5043 }
5044 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005045}
5046
5047/**
5048 * Logs when a NFC Beam Transaction occurred.
5049 * Logged from:
5050 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5051 */
5052message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005053 enum Operation {
5054 UNKNOWN = 0;
5055 SEND = 1;
5056 RECEIVE = 2;
5057 }
5058 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005059}
5060
5061/**
5062 * Logs when a NFC Card Emulation Transaction occurred.
5063 * Logged from:
5064 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5065 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5066 */
5067message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005068 enum Category {
5069 UNKNOWN = 0;
5070 HCE_PAYMENT = 1;
5071 HCE_OTHER = 2;
5072 OFFHOST = 3;
5073 }
5074 // Transaction belongs to HCE payment or HCE other category, or offhost.
5075 optional Category category = 1;
5076 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5077 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005078}
5079
5080/**
5081 * Logs when a NFC Tag event occurred.
5082 * Logged from:
5083 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5084 */
5085message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005086 enum Type {
5087 UNKNOWN = 0;
5088 URL = 1;
5089 BT_PAIRING = 2;
5090 PROVISION = 3;
5091 WIFI_CONNECT = 4;
5092 APP_LAUNCH = 5;
5093 OTHERS = 6;
5094 }
5095 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005096}
5097
5098/**
5099 * Logs when Hce transaction triggered
5100 * Logged from:
5101 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5102 */
5103message NfcHceTransactionOccurred {
5104 // The latency period(in microseconds) it took for the first HCE data
5105 // exchange.
5106 optional uint32 latency_micros = 1;
5107}
5108
5109/**
5110 * Logs when SecureElement state event changed
5111 * Logged from:
5112 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5113 */
5114message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005115 enum State {
5116 UNKNOWN = 0;
5117 INITIALIZED = 1;
5118 DISCONNECTED = 2;
5119 CONNECTED = 3;
5120 HALCRASH = 4;
5121 }
5122 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005123
Alex Salod7c3eef2019-01-25 14:43:27 -08005124 optional string state_change_reason = 2;
5125 // SIMx or eSEx.
5126 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005127}
5128
5129/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005130 * Information about a permission grant request
5131 */
5132message PermissionGrantRequestResultReported {
5133 // unique value identifying an API call. A API call might result in multiple of these atoms
5134 optional int64 request_id = 1;
5135
5136 // UID of package requesting the permission grant
5137 optional int32 requesting_uid = 2 [(is_uid) = true];
5138
5139 // Name of package requesting the permission grant
5140 optional string requesting_package_name = 3;
5141
5142 // The permission to be granted
5143 optional string permission_name = 4;
5144
5145 // If the permission was explicitly requested via the API or added by the system
5146 optional bool is_implicit = 5;
5147
5148 enum Result {
5149 UNDEFINED = 0;
5150 // permission request was ignored
5151 IGNORED = 1;
5152 // permission request was ignored because it was user fixed
5153 IGNORED_USER_FIXED = 2;
5154 // permission request was ignored because it was policy fixed
5155 IGNORED_POLICY_FIXED = 3;
5156 // permission was granted by user action
5157 USER_GRANTED = 4;
5158 // permission was automatically granted
5159 AUTO_GRANTED = 5;
5160 // permission was denied by user action
5161 USER_DENIED = 6;
5162 // permission was denied with prejudice by the user
5163 USER_DENIED_WITH_PREJUDICE = 7;
5164 // permission was automatically denied
5165 AUTO_DENIED = 8;
5166 }
5167 // The result of the permission grant
5168 optional Result result = 6;
5169}
5170
5171/**
Jack Yu95b64f32018-12-13 18:26:11 +08005172 * Logs when Omapi API used
5173 * Logged from:
5174 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5175 */
5176message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005177 enum Operation {
5178 UNKNOWN = 0;
5179 OPEN_CHANNEL = 1;
5180 }
5181 optional Operation operation = 1;
5182 // SIMx or eSEx.
5183 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005184
Alex Salod7c3eef2019-01-25 14:43:27 -08005185 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005186}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005187
5188/**
Alex Saloa060aee2019-01-21 14:36:41 -08005189 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5190 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005191 * Logged from:
5192 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5193 */
5194message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005195 optional int64 dispatch_latency_millis = 1;
5196}
5197
5198/**
5199 * Logs AttentionManagerService attention check result.
5200 *
5201 * Logged from:
5202 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5203 */
5204message AttentionManagerServiceResultReported {
5205 // See core/java/android/service/attention/AttentionService.java
5206 enum AttentionCheckResult {
5207 UNKNOWN = 20;
5208 ATTENTION_SUCCESS_ABSENT = 0;
5209 ATTENTION_SUCCESS_PRESENT = 1;
5210 ATTENTION_FAILURE_PREEMPTED = 2;
5211 ATTENTION_FAILURE_TIMED_OUT = 3;
5212 ATTENTION_FAILURE_UNKNOWN = 4;
5213 }
5214 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005215}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005216
5217/**
5218 * Logs when an adb connection changes state.
5219 *
5220 * Logged from:
5221 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5222 */
5223message AdbConnectionChanged {
5224 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5225 // previously selected for this system.
5226 optional int64 last_connection_time_millis = 1;
5227
5228 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5229 // to reconnect via adb without user interaction.
5230 optional int64 auth_window_millis = 2;
5231
5232 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5233 optional android.debug.AdbConnectionStateEnum state = 3;
5234
5235 // True if the 'always allow' option was selected for this system.
5236 optional bool always_allow = 4;
5237}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005238
5239/*
5240 * Logs the reported speech DSP status.
5241 *
5242 * Logged from:
5243 * Vendor audio implementation.
5244 */
5245message SpeechDspStatReported {
5246 // The total Speech DSP uptime in milliseconds.
5247 optional int32 total_uptime_millis = 1;
5248 // The total Speech DSP downtime in milliseconds.
5249 optional int32 total_downtime_millis = 2;
5250 optional int32 total_crash_count = 3;
5251 optional int32 total_recover_count = 4;
5252}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005253
5254/**
5255 * Logs USB connector contaminant status.
5256 *
5257 * Logged from: USB Service.
5258 */
5259message UsbContaminantReported {
5260 optional string id = 1;
5261 optional android.service.usb.ContaminantPresenceStatus status = 2;
5262}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005263
5264/**
5265 * This atom is for debugging purpose.
5266 */
5267message DebugElapsedClock {
5268 // Monotically increasing value for each pull.
5269 optional int64 pull_count = 1;
5270 // Time from System.elapsedRealtime.
5271 optional int64 elapsed_clock_millis = 2;
5272 // Time from System.elapsedRealtime.
5273 optional int64 same_elapsed_clock_millis = 3;
5274 // Diff between current elapsed time and elapsed time from previous pull.
5275 optional int64 elapsed_clock_diff_millis = 4;
5276
5277 enum Type {
5278 TYPE_UNKNOWN = 0;
5279 ALWAYS_PRESENT = 1;
5280 PRESENT_ON_ODD_PULLS = 2;
5281 }
5282 // Type of behavior for the pulled data.
5283 optional Type type = 5;
5284}
5285
5286/**
5287 * This atom is for debugging purpose.
5288 */
5289message DebugFailingElapsedClock {
5290 // Monotically increasing value for each pull.
5291 optional int64 pull_count = 1;
5292 // Time from System.elapsedRealtime.
5293 optional int64 elapsed_clock_millis = 2;
5294 // Time from System.elapsedRealtime.
5295 optional int64 same_elapsed_clock_millis = 3;
5296 // Diff between current elapsed time and elapsed time from previous pull.
5297 optional int64 elapsed_clock_diff_millis = 4;
5298}
Steven Wuacef6bb2019-01-23 14:21:17 -05005299
5300/** Logs System UI bubbles event changed.
5301 *
5302 * Logged from:
5303 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5304 */
5305message BubbleUIChanged {
5306
5307 // The app package that is posting the bubble.
5308 optional string package_name = 1;
5309
5310 // The notification channel that is posting the bubble.
5311 optional string notification_channel = 2;
5312
5313 // The notification id associated with the posted bubble.
5314 optional int32 notification_id = 3;
5315
5316 // The position of the bubble within the bubble stack.
5317 optional int32 position = 4;
5318
5319 // The total number of bubbles within the bubble stack.
5320 optional int32 total_number = 5;
5321
5322 // User interactions with the bubble.
5323 enum Action {
5324 UNKNOWN = 0;
5325 POSTED = 1;
5326 UPDATED = 2;
5327 EXPANDED = 3;
5328 COLLAPSED = 4;
5329 DISMISSED = 5;
5330 STACK_DISMISSED = 6;
5331 STACK_MOVED = 7;
5332 HEADER_GO_TO_APP = 8;
5333 HEADER_GO_TO_SETTINGS = 9;
5334 PERMISSION_OPT_IN = 10;
5335 PERMISSION_OPT_OUT = 11;
5336 PERMISSION_IGNORED = 12;
5337 SWIPE_LEFT = 13;
5338 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005339 STACK_EXPANDED = 15;
Steven Wuacef6bb2019-01-23 14:21:17 -05005340 }
5341 optional Action action = 6;
5342
5343 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5344 optional float normalized_x_position = 7;
5345 optional float normalized_y_position = 8;
5346}
Kweku Adams8845d012018-12-11 20:06:45 -08005347
5348/**
Steven Wu552f63f2019-02-05 13:41:36 -05005349 * Logs System UI bubbles developer errors.
5350 *
5351 * Logged from:
5352 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5353 */
5354message BubbleDeveloperErrorReported {
5355
5356 // The app package that is posting the bubble.
5357 optional string package_name = 1;
5358
5359 // Bubble developer error type enums.
5360 enum Error {
5361 UNKNOWN = 0;
5362 ACTIVITY_INFO_MISSING = 1;
5363 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5364 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5365 }
5366 optional Error error = 2 [default = UNKNOWN];
5367}
5368
5369/**
Kweku Adams8845d012018-12-11 20:06:45 -08005370 * Logs that a constraint for a scheduled job has changed.
5371 *
5372 * Logged from:
5373 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5374 */
5375message ScheduledJobConstraintChanged {
5376 repeated AttributionNode attribution_node = 1;
5377
5378 // Name of the job.
5379 optional string job_name = 2;
5380
5381 optional com.android.server.job.ConstraintEnum constraint = 3;
5382
5383 enum State {
5384 UNSATISFIED = 0;
5385 SATISFIED = 1;
5386 }
5387 optional State state = 4;
5388}
Alex Salod7c3eef2019-01-25 14:43:27 -08005389
5390/**
5391 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5392 * returns true.
5393 *
5394 * Logged from:
5395 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5396 */
5397message ScreenTimeoutExtensionReported {
5398 // Describes how many times in a row did the power manager reset the screen off timeout.
5399 optional uint32 consecutive_timeout_extended_count = 1;
5400}
Hui Yu885aca12019-01-10 17:11:34 -08005401
5402/*
5403* Logs number of milliseconds it takes to start a process.
5404* The definition of app process start time is from the app launch time to
5405* the time that Zygote finished forking the app process and loaded the
5406* application package's java classes.
5407
5408* This metric is different from AppStartOccurred which is for foreground
5409* activity only.
5410
5411* ProcessStartTime can report all processes (both foreground and background)
5412* start time.
5413*
5414* Logged from:
5415* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5416*/
5417message ProcessStartTime {
5418 // The uid of the ProcessRecord.
5419 optional int32 uid = 1 [(is_uid) = true];
5420
5421 // The process pid.
5422 optional int32 pid = 2;
5423
5424 // The process name.
5425 // Usually package name, "system" for system server.
5426 // Provided by ActivityManagerService.
5427 optional string process_name = 3;
5428
5429 enum StartType {
5430 UNKNOWN = 0;
5431 WARM = 1;
5432 HOT = 2;
5433 COLD = 3;
5434 }
5435
5436 // The start type.
5437 optional StartType type = 4;
5438
5439 // The elapsed realtime at the start of the process.
5440 optional int64 process_start_time_millis = 5;
5441
5442 // Number of milliseconds it takes to reach bind application.
5443 optional int32 bind_application_delay_millis = 6;
5444
5445 // Number of milliseconds it takes to finish start of the process.
5446 optional int32 process_start_delay_millis = 7;
5447
5448 // hostingType field in ProcessRecord, the component type such as "activity",
5449 // "service", "content provider", "broadcast" or other strings.
5450 optional string hosting_type = 8;
5451
5452 // hostingNameStr field in ProcessRecord. The component class name that runs
5453 // in this process.
5454 optional string hosting_name = 9;
5455}
5456
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005457/**
5458 * State of a dangerous permission requested by a package
5459 */
5460message DangerousPermissionState {
5461 // Name of the permission
5462 optional string permission_name = 1;
5463
5464 // Uid of the package
5465 optional int32 uid = 2 [(is_uid) = true];
5466
5467 // Package requesting the permission
5468 optional string package_name = 3;
5469
5470 // If the permission is granted to the uid
5471 optional bool is_granted = 4;
5472}
5473
Michael Groover4a0ca942019-01-24 17:41:25 -08005474/**
5475 * Logs when a package is denied access to a device identifier based on the new access requirements.
5476 *
5477 * Logged from:
5478 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
5479 */
5480message DeviceIdentifierAccessDenied {
5481 // The name of the package denied access to the requested device identifier.
5482 optional string package_name = 1;
5483
5484 // The name of the device identifier method the package attempted to invoke.
5485 optional string method_name = 2;
5486
5487 // True if the package is preinstalled.
5488 optional bool is_preinstalled = 3;
5489
5490 // True if the package is privileged.
5491 optional bool is_priv_app = 4;
5492}
Chenjie Yue13f44a2019-02-07 17:51:38 -08005493
5494/**
5495 * Potential experiment ids that goes with a train install.
5496 */
5497message TrainExperimentIds {
5498 repeated int64 experiment_id = 1;
5499}
5500
5501/**
5502 * Pulls the ongoing mainline install train version code.
5503 * Pulled from StatsCompanionService
5504 */
5505message TrainInfo {
5506 optional int64 train_version_code = 1;
5507
5508 optional TrainExperimentIds train_experiment_id = 2;
5509}