blob: fc20304e410aadba247fa8c4f1288e66c2744cdb [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;
Yao Chend54f9dd2017-10-17 17:37:48 +0000242 }
David Chenc8a43242017-10-17 16:23:28 -0700243
David Chen6e3e6cb2018-01-03 16:14:06 -0800244 // Pulled events will start at field 10000.
Olivier Gaillard18d452202019-01-22 15:03:41 +0000245 // Next: 10048
David Chenc8a43242017-10-17 16:23:28 -0700246 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800247 WifiBytesTransfer wifi_bytes_transfer = 10000;
248 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
249 MobileBytesTransfer mobile_bytes_transfer = 10002;
250 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800251 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800252 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800253 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800254 CpuTimePerFreq cpu_time_per_freq = 10008;
255 CpuTimePerUid cpu_time_per_uid = 10009;
256 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800257 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800258 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800259 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800260 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800261 SystemElapsedRealtime system_elapsed_realtime = 10014;
262 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800263 CpuActiveTime cpu_active_time = 10016;
264 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000265 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800266 RemainingBatteryCapacity remaining_battery_capacity = 10019;
267 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800268 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100269 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100270 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100271 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000272 DiskStats disk_stats = 10025;
273 DirectoryUsage directory_usage = 10026;
274 AppSize app_size = 10027;
275 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700276 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700277 BatteryVoltage battery_voltage = 10030;
Kevin Chyn1741a072019-01-17 11:54:40 -0800278 NumBiometricsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700279 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700280 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800281 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700282 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100283 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100284 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700285 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800286 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
287 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
288 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000289 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800290 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800291 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800292 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000293 DebugElapsedClock debug_elapsed_clock = 10046;
294 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
Kevin Chyn1741a072019-01-17 11:54:40 -0800295 NumBiometricsEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800296 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800297 DangerousPermissionState dangerous_permission_state = 10050;
David Chenc8a43242017-10-17 16:23:28 -0700298 }
yroa1fe77c2018-02-26 14:22:54 -0800299
Bookatz76aafcf2018-09-17 16:17:10 -0700300 // DO NOT USE field numbers above 100,000 in AOSP.
301 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
302 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700303}
304
Yao Chend54f9dd2017-10-17 17:37:48 +0000305/**
Yangster-mac20877162017-12-22 17:19:39 -0800306 * This proto represents a node of an attribution chain.
307 * Note: All attribution chains are represented as a repeated field of type
308 * AttributionNode. It is understood that in such arrays, the order is that
309 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000310 */
Yangster-mac20877162017-12-22 17:19:39 -0800311message AttributionNode {
312 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800313 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800314
Yangster-mac20877162017-12-22 17:19:39 -0800315 // The (optional) string tag for an element in the attribution chain. If the
316 // element has no tag, it is encoded as an empty string.
317 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700318}
319
Yangster-mac48b3d622018-08-18 12:38:11 -0700320message KeyValuePair {
321 optional int32 key = 1;
322 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700323 int32 value_int = 2;
324 int64 value_long = 3;
325 string value_str = 4;
326 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700327 }
328}
329
330message KeyValuePairsAtom {
331 optional int32 uid = 1;
332 repeated KeyValuePair pairs = 2;
333}
334
Yao Chend54f9dd2017-10-17 17:37:48 +0000335/*
336 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800337 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000338 *
339 * RULES:
340 * - The field ids for each atom must start at 1, and count upwards by 1.
341 * Skipping field ids is not allowed.
342 * - These form an API, so renaming, renumbering or removing fields is
343 * not allowed between android releases. (This is not currently enforced,
344 * but there will be a tool to enforce this restriction).
345 * - The types must be built-in protocol buffer types, namely, no sub-messages
346 * are allowed (yet). The bytes type is also not allowed.
347 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800348 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000349 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800350 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000351 * - A field that is a uid should be a string field, tagged with the [xxx]
352 * annotation. The generated code on android will be represented by UIDs,
353 * and those UIDs will be translated in xxx to those strings.
354 *
355 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700356 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000357 * - If there is a UID, it goes first. Think in an object-oriented fashion.
358 * *****************************************************************************
359 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700360
Yao Chend54f9dd2017-10-17 17:37:48 +0000361/**
Yangster-mace16189a2018-08-26 12:20:16 -0700362 * Logs when the Thermal service HAL notifies the throttling start/stop events.
363 *
364 * Logged from:
365 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
366 */
367message ThermalThrottlingStateChanged {
368 optional android.os.TemperatureTypeEnum sensor_type = 1;
369
370 enum State {
371 UNKNOWN = 0;
372 START = 1;
373 STOP = 2;
374 }
375
376 optional State state = 2;
377
378 optional float temperature = 3;
379}
380
381/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000382 * Logs when the screen state changes.
383 *
384 * Logged from:
385 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
386 */
387message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800388 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700389 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700390}
Yao Chend54f9dd2017-10-17 17:37:48 +0000391
392/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700393 * Logs that the process state of the uid, as determined by ActivityManager
394 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000395 *
396 * Logged from:
397 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
398 */
Bookatzc1a050a2017-10-10 15:49:28 -0700399message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700400 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000401
Bookatzdb026a22018-01-10 19:01:56 -0800402 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700403 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000404}
405
406/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700407 * Logs process state change of a process, as per the activity manager.
408 *
409 * Logged from:
410 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
411 */
412message ProcessStateChanged {
413 optional int32 uid = 1;
414 optional string process_name = 2;
415 optional string package_name = 3;
416 // TODO: remove this when validation is done
417 optional int64 version = 5;
418 // The state, from frameworks/base/core/proto/android/app/enums.proto.
419 optional android.app.ProcessStateEnum state = 4;
420}
421
422/**
423 * Logs when ActivityManagerService sleep state is changed.
424 *
425 * Logged from:
426 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
427 */
428message ActivityManagerSleepStateChanged {
429 // TODO: import frameworks proto
430 enum State {
431 UNKNOWN = 0;
432 ASLEEP = 1;
433 AWAKE = 2;
434 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700435 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700436}
437
438/**
439 * Logs when system memory state changes.
440 *
441 * Logged from:
442 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
443 */
444message MemoryFactorStateChanged {
445 // TODO: import frameworks proto
446 enum State {
447 MEMORY_UNKNOWN = 0;
448 NORMAL = 1; // normal.
449 MODERATE = 2; // moderate memory pressure.
450 LOW = 3; // low memory.
451 CRITICAL = 4; // critical memory.
452
453 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700454 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700455}
456
457/**
458 * Logs when app is using too much cpu, according to ActivityManagerService.
459 *
460 * Logged from:
461 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
462 */
463message ExcessiveCpuUsageReported {
464 optional int32 uid = 1;
465 optional string process_name = 2;
466 optional string package_name = 3;
467 // package version. TODO: remove this when validation is done
468 optional int64 version = 4;
469}
470
471/**
472 * Logs when a cached process is killed, along with its pss.
473 *
474 * Logged from:
475 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
476 */
477message CachedKillReported {
478 optional int32 uid = 1;
479 optional string process_name = 2;
480 optional string package_name = 3;
481 // TODO: remove this when validation is done
482 optional int64 version = 5;
483 optional int64 pss = 4;
484}
485
486/**
487 * Logs when memory stats of a process is reported.
488 *
489 * Logged from:
490 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
491 */
492message ProcessMemoryStatReported {
493 optional int32 uid = 1;
494 optional string process_name = 2;
495 optional string package_name = 3;
496 //TODO: remove this when validation is done
497 optional int64 version = 9;
498 optional int64 pss = 4;
499 optional int64 uss = 5;
500 optional int64 rss = 6;
501 enum Type {
502 ADD_PSS_INTERNAL_SINGLE = 0;
503 ADD_PSS_INTERNAL_ALL_MEM = 1;
504 ADD_PSS_INTERNAL_ALL_POLL = 2;
505 ADD_PSS_EXTERNAL = 3;
506 ADD_PSS_EXTERNAL_SLOW = 4;
507 }
508 optional Type type = 7;
509 optional int64 duration = 8;
510}
511
512/**
Bookatzc1a050a2017-10-10 15:49:28 -0700513 * Logs that a process started, finished, crashed, or ANRed.
514 *
515 * Logged from:
516 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
517 */
518message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700519 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700520
David Chen0b5c90c2018-01-25 16:51:49 -0800521 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800522 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700523
Bookatzddccf0a2017-11-28 16:48:14 -0800524 // What lifecycle state the process changed to.
525 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800526 enum State {
527 FINISHED = 0;
528 STARTED = 1;
529 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800530 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800531 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700532}
533
Bookatzc1a050a2017-10-10 15:49:28 -0700534/**
535 * Logs when the ble scan state changes.
536 *
537 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700538 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700539 */
540message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800541 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700542
543 enum State {
544 OFF = 0;
545 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700546 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
547 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700548 }
549 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700550
Bookatze5ec0b42018-03-26 13:34:56 -0700551 // Does the scan have a filter.
552 optional bool is_filtered = 3;
553 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
554 optional bool is_first_match = 4;
555 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
556 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700557}
558
559/**
560 * Logs reporting of a ble scan finding results.
561 *
562 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700563 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700564 */
Bookatzae6738e2018-09-13 11:38:56 -0700565// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700566message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800567 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700568
569 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800570 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700571}
572
573/**
574 * Logs when a sensor state changes.
575 *
576 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700577 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700578 */
579message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800580 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700581
Bookatzc1a050a2017-10-10 15:49:28 -0700582 // The id (int) of the sensor.
583 optional int32 sensor_id = 2;
584
585 enum State {
586 OFF = 0;
587 ON = 1;
588 }
589 optional State state = 3;
590}
591
Bookatzc1a050a2017-10-10 15:49:28 -0700592/**
593 * Logs when GPS state changes.
594 *
595 * Logged from:
596 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
597 */
598message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800599 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700600
601 enum State {
602 OFF = 0;
603 ON = 1;
604 }
605 optional State state = 2;
606}
607
Bookatz48d362e2018-11-06 15:49:08 -0800608/**
609 * Logs when GPS signal quality.
610 *
611 * Logged from:
612 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
613 */
614message GpsSignalQualityChanged {
615 optional android.server.location.GpsSignalQualityEnum level = 1;
616}
617
Bookatzc1a050a2017-10-10 15:49:28 -0700618
619/**
620 * Logs when a sync manager sync state changes.
621 *
622 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700623 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700624 */
625message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800626 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700627
David Chen0b5c90c2018-01-25 16:51:49 -0800628 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800629 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700630
631 enum State {
632 OFF = 0;
633 ON = 1;
634 }
635 optional State state = 3;
636}
637
Yangster-mac96353002018-09-05 11:18:55 -0700638/*
639 * Deferred job stats.
640 *
641 * Logged from:
642 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
643*/
644message DeferredJobStatsReported {
645 repeated AttributionNode attribution_node = 1;
646
647 // Number of jobs deferred.
648 optional int32 num_jobs_deferred = 2;
649
650 // Time since the last job runs.
651 optional int64 time_since_last_job_millis = 3;
652}
653
Bookatzc1a050a2017-10-10 15:49:28 -0700654/**
655 * Logs when a job scheduler job state changes.
656 *
657 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700658 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700659 */
660message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800661 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700662
663 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800664 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700665
666 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800667 FINISHED = 0;
668 STARTED = 1;
669 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700670 }
671 optional State state = 3;
672
Tej Singh33a412b2018-03-16 18:43:59 -0700673 // The reason a job has stopped.
674 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700675 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700676 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700677}
678
679/**
680 * Logs when the audio state changes.
681 *
682 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700683 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700684 */
685message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800686 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700687
688 enum State {
689 OFF = 0;
690 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700691 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
692 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700693 }
694 optional State state = 2;
695}
696
697/**
698 * Logs when the video codec state changes.
699 *
700 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700701 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700702 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800703message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800704 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700705
706 enum State {
707 OFF = 0;
708 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700709 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
710 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700711 }
712 optional State state = 2;
713}
714
715/**
716 * Logs when the flashlight state changes.
717 *
718 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700719 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700720 */
721message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800722 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700723
724 enum State {
725 OFF = 0;
726 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700727 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
728 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700729 }
730 optional State state = 2;
731}
732
733/**
734 * Logs when the camera state changes.
735 *
736 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700737 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700738 */
739message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800740 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700741
742 enum State {
743 OFF = 0;
744 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700745 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
746 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700747 }
748 optional State state = 2;
749}
750
751/**
752 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000753 *
754 * Logged from:
755 * TODO
756 */
Bookatzd6746242017-10-24 18:39:35 -0700757message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800758 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000759
Bookatz1a1b0462018-01-12 11:47:03 -0800760 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
761 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700762 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700763
764 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
765 optional string tag = 3;
766
767 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800768 RELEASE = 0;
769 ACQUIRE = 1;
770 CHANGE_RELEASE = 2;
771 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700772 }
773 optional State state = 4;
774}
775
776/**
Bookatzc1a050a2017-10-10 15:49:28 -0700777 * Logs when a partial wakelock is considered 'long' (over 1 min).
778 *
779 * Logged from:
780 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
781 */
782message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800783 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700784
Yao Chend54f9dd2017-10-17 17:37:48 +0000785 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
786 optional string tag = 2;
787
Bookatzc1a050a2017-10-10 15:49:28 -0700788 // TODO: I have no idea what this is.
789 optional string history_tag = 3;
790
791 enum State {
792 OFF = 0;
793 ON = 1;
794 }
795 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000796}
797
Bookatzc1a050a2017-10-10 15:49:28 -0700798/**
Bookatza66083f2018-09-20 17:24:00 -0700799 * Logs when the device is interactive, according to the PowerManager Notifier.
800 *
801 * Logged from:
802 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
803 */
804message InteractiveStateChanged {
805 enum State {
806 OFF = 0;
807 ON = 1;
808 }
809 optional State state = 1;
810}
811
812/**
Bookatzc1a050a2017-10-10 15:49:28 -0700813 * Logs Battery Saver state change.
814 *
815 * Logged from:
816 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
817 */
818message BatterySaverModeStateChanged {
819 enum State {
820 OFF = 0;
821 ON = 1;
822 }
823 optional State state = 1;
824}
825
826/**
827 * Logs Doze mode state change.
828 *
829 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800830 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700831 */
832message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800833 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800834}
835
836
837/**
838 * Logs state change of Doze mode including maintenance windows.
839 *
840 * Logged from:
841 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
842 */
843message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800844 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700845}
846
847/**
848 * Logs screen brightness level.
849 *
850 * Logged from:
851 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
852 */
853message ScreenBrightnessChanged {
854 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
855 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700856}
857
858/**
859 * Logs battery level (percent full, from 0 to 100).
860 *
861 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700862 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700863 */
864message BatteryLevelChanged {
865 // Battery level. Should be in [0, 100].
866 optional int32 battery_level = 1;
867}
868
869/**
870 * Logs change in charging status of the device.
871 *
872 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700873 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700874 */
875message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800876 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
877 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700878}
879
880/**
881 * Logs whether the device is plugged in, and what power source it is using.
882 *
883 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700884 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700885 */
886message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800887 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
888 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700889}
890
Bookatz8c6571b2017-10-24 15:04:41 -0700891/**
892 * Logs when an app's wakeup alarm fires.
893 *
894 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700895 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700896 */
897message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800898 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800899
900 // Name of the wakeup alarm.
901 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700902
903 // Name of source package (for historical reasons, since BatteryStats tracked it).
904 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800905}
906
907/**
908 * Logs when an an app causes the mobile radio to change state.
909 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
910 *
911 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700912 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800913 */
914message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800915 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800916
Bookatz1a1b0462018-01-12 11:47:03 -0800917 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
918 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800919}
920
921/**
922 * Logs when an an app causes the wifi radio to change state.
923 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
924 *
925 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700926 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800927 */
928message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800929 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800930
Bookatz1a1b0462018-01-12 11:47:03 -0800931 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
932 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700933}
934
935/**
936 * Logs kernel wakeup reasons and aborts.
937 *
938 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700939 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700940 */
941message KernelWakeupReported {
942 // Name of the kernel wakeup reason (or abort).
943 optional string wakeup_reason_name = 1;
944
945 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800946 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700947}
948
949/**
Bookatzda1798c2018-12-13 14:16:00 -0800950 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800951 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800952 *
953 * Logged from:
954 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
955 */
956message WifiEnabledStateChanged {
957 enum State {
958 OFF = 0;
959 ON = 1;
960 }
961 optional State state = 1;
962}
963
964/**
965 * 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 -0800966 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
967 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800968 *
969 * Logged from:
970 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
971 */
972message WifiRunningStateChanged {
973 repeated AttributionNode attribution_node = 1;
974
975 enum State {
976 OFF = 0;
977 ON = 1;
978 }
979 optional State state = 2;
980}
981
982/**
Bookatze5885242017-10-24 20:10:31 -0700983 * Logs wifi locks held by an app.
984 *
985 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700986 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700987 */
988message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800989 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700990
991 enum State {
992 OFF = 0;
993 ON = 1;
994 }
995 optional State state = 2;
996}
997
998/**
999 * Logs wifi signal strength changes.
1000 *
1001 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001002 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001003 */
1004message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001005 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1006 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001007}
1008
1009/**
1010 * Logs wifi scans performed by an app.
1011 *
1012 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001013 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001014 */
1015message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001016 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001017
1018 enum State {
1019 OFF = 0;
1020 ON = 1;
1021 }
1022 optional State state = 2;
1023}
1024
1025/**
Tej Singh4503e102018-01-04 14:35:01 -08001026 * Logs wifi multicast locks held by an app
1027 *
1028 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001029 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001030 */
1031message WifiMulticastLockStateChanged {
1032 repeated AttributionNode attribution_node = 1;
1033
1034 enum State {
1035 OFF = 0;
1036 ON = 1;
1037 }
1038 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001039
1040 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001041}
1042
1043/**
Tej Singh1ea42892018-01-19 09:27:00 -08001044 * Logs shutdown reason and duration on next boot.
1045 *
1046 * Logged from:
1047 * frameworks/base/core/java/com/android/server/BootReceiver.java
1048 */
1049message ShutdownSequenceReported {
1050 // True if shutdown is for a reboot. Default: false if we do not know.
1051 optional bool reboot = 1;
1052
1053 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1054 optional string reason = 2;
1055
1056 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1057 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001058 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001059
1060 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001061 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001062}
1063
Tej Singh6483ea42018-01-25 17:45:49 -08001064
1065/**
1066 * Logs boot reason and duration.
1067 *
1068 * Logged from:
1069 * system/core/bootstat/bootstat.cpp
1070 */
1071message BootSequenceReported {
1072 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1073 // Default: "<EMPTY>" if not available.
1074 optional string bootloader_reason = 1;
1075
1076 // Reason for system boot. Eg. bootloader, reboot,userrequested
1077 // Default: "<EMPTY>" if not available.
1078 optional string system_reason = 2;
1079
1080 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001081 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001082
1083 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001084 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001085
1086 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001087 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001088
1089 // Time since last boot in ms. Default: 0 if not available.
1090 optional int64 time_since_last_boot = 6;
1091}
1092
Tej Singhc477d9c2018-02-05 18:31:39 -08001093
1094/**
1095 * Logs call state and disconnect cause (if applicable).
1096 *
1097 * Logged from:
1098 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1099 */
1100message CallStateChanged {
1101 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1102 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1103 optional android.telecom.CallStateEnum call_state = 1;
1104
1105 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1106 // This value is only applicable when the call_state is DISCONNECTED, and
1107 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1108 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1109 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1110
1111 // True if the call is self-managed, which are apps that use the
1112 // telecom infrastructure to make their own calls.
1113 optional bool self_managed = 3;
1114
1115 // True if call is external. External calls are calls on connected Wear
1116 // devices but show up in Telecom so the user can pull them onto the device.
1117 optional bool external_call = 4;
1118}
1119
Tej Singh1ea42892018-01-19 09:27:00 -08001120/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001121 * Logs keyguard state. The keyguard is the lock screen.
1122 *
1123 * Logged from:
1124 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1125 */
1126message KeyguardStateChanged {
1127 enum State {
1128 UNKNOWN = 0;
1129 // The keyguard is hidden when the phone is unlocked.
1130 HIDDEN = 1;
1131 // The keyguard is shown when the phone is locked (screen turns off).
1132 SHOWN= 2;
1133 // The keyguard is occluded when something is overlaying the keyguard.
1134 // Eg. Opening the camera while on the lock screen.
1135 OCCLUDED = 3;
1136 }
1137 optional State state = 1;
1138}
1139
1140/**
1141 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1142 * prompts the user to enter a password (pattern, pin, etc).
1143 *
1144 * Logged from:
1145 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1146 */
1147
1148message KeyguardBouncerStateChanged {
1149 enum State {
1150 UNKNOWN = 0;
1151 // Bouncer is hidden, either as a result of successfully entering the
1152 // password, screen timing out, or user going back to lock screen.
1153 HIDDEN = 1;
1154 // This is when the user is being prompted to enter the password.
1155 SHOWN = 2;
1156 }
1157 optional State state = 1;
1158}
1159
1160/**
1161 * Logs the result of entering a password into the keyguard bouncer.
1162 *
1163 * Logged from:
1164 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1165 */
1166message KeyguardBouncerPasswordEntered {
1167 enum BouncerResult {
1168 UNKNOWN = 0;
1169 // The password entered was incorrect.
1170 FAILURE = 1;
1171 // The password entered was correct.
1172 SUCCESS = 2;
1173 }
1174 optional BouncerResult result = 1;
1175}
1176
Tej Singha883b372018-02-15 11:30:01 -08001177/*
1178 * Logs changes to the configuration of the device. The configuration is defined
1179 * in frameworks/base/core/java/android/content/res/Configuration.java
1180 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1181 * Please go there to interpret the possible values each field can be.
1182 *
1183 * Logged from:
1184 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1185 */
1186message ResourceConfigurationChanged {
1187 // Bit mask of color capabilities of the screen.
1188 // Contains information about the color gamut and hdr mode of the screen.
1189 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001190 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001191
1192 // The target screen density being rendered to.
1193 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001194 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001195
1196 // Current user preference for the scaling factor for fonts,
1197 // relative to the base density scaling.
1198 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001199 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001200
1201 // Flag indicating whether the hard keyboard is hidden.
1202 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001203 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001204
1205 // The type of keyboard attached to the device.
1206 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1207 optional int32 keyboard = 5;
1208
1209 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1210 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001211 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001212
1213 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1214 // 0 if undefined.
1215 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1216 optional int32 mcc = 7;
1217
1218 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1219 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1220 // MNC_ZERO symbol defined in Configuration.java.
1221 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1222 optional int32 mnc = 8;
1223
1224 // The kind of navigation available on the device.
1225 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1226 optional int32 navigation = 9;
1227
1228 // Flag indicating whether the navigation is available.
1229 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001230 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001231
1232 // Overall orientation of the screen.
1233 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1234 optional int32 orientation = 11;
1235
1236 // The current height of the available screen space, in dp units.
1237 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001238 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001239
1240 // Bit mask of overall layout of the screen.
1241 // Contains information about screen size, whether the screen is wider/taller
1242 // than normal, whether the screen layout is right-tl-left or left-to-right,
1243 // and whether the screen has a rounded shape.
1244 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001245 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001246
1247 // Current width of the available screen space, in dp units.
1248 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001249 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001250
1251 // The smallest screen size an application will see in normal operation.
1252 // This is the smallest value of both screenWidthDp and screenHeightDp
1253 // in portrait and landscape.
1254 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001255 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001256
1257 // The type of touch screen attached to the device.
1258 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1259 optional int32 touchscreen = 16;
1260
1261 // Bit mask of the ui mode.
1262 // Contains information about the overall ui mode of the device.
1263 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1264 // Also contains information about whether the device is in night mode.
1265 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001266 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001267}
1268
Tej Singheee317b2018-03-07 19:28:05 -08001269
1270/**
1271 * Logs changes in the connection state of the mobile radio.
1272 *
1273 * Logged from:
1274 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1275 */
1276message MobileConnectionStateChanged {
1277 // States are from the state machine DataConnection.java.
1278 enum State {
1279 UNKNOWN = 0;
1280 // The connection is inactive, or disconnected.
1281 INACTIVE = 1;
1282 // The connection is being activated, or connecting.
1283 ACTIVATING = 2;
1284 // The connection is active, or connected.
1285 ACTIVE = 3;
1286 // The connection is disconnecting.
1287 DISCONNECTING = 4;
1288 // The connection is disconnecting after creating a connection.
1289 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1290 }
1291 optional State state = 1;
1292 // For multi-sim phones, this distinguishes between the sim cards.
1293 optional int32 sim_slot_index = 2;
1294 // Used to identify the connection. Starts at 0 and increments by 1 for
1295 // every new network created. Resets whenever the device reboots.
1296 optional int32 data_connection_id = 3;
1297 // A bitmask for the capabilities of this connection.
1298 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1299 // Default value (if we have no information): 0
1300 optional int64 capabilities = 4;
1301 // If this connection has internet.
1302 // This just checks if the DEFAULT bit of capabilities is set.
1303 optional bool has_internet = 5;
1304}
1305
1306/**
1307 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1308 *
1309 * Logged from:
1310 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1311 */
1312message MobileRadioTechnologyChanged {
1313 optional android.telephony.NetworkTypeEnum state = 1;
1314 // For multi-sim phones, this distinguishes between the sim cards.
1315 optional int32 sim_slot_index = 2;
1316}
1317
Andrew Chantb56388b2018-03-22 21:07:33 -07001318/**
1319 * Logs the VID and PID of any connected USB devices.
1320 *
1321 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1322 *
1323 * Logged by Vendor.
1324 */
1325message UsbDeviceAttached {
1326 optional int32 vid = 1;
1327 optional int32 pid = 2;
1328 optional bool has_audio = 3;
1329 optional bool has_hid = 4;
1330 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001331 enum State {
1332 STATE_DISCONNECTED = 0;
1333 STATE_CONNECTED = 1;
1334 }
1335 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001336 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001337}
1338
Tej Singheee317b2018-03-07 19:28:05 -08001339
Tej Singhdd7bd352018-02-09 19:33:15 -08001340/**
Tej Singh5d991e12018-03-09 19:48:11 -08001341 * Logs when Bluetooth is enabled and disabled.
1342 *
1343 * Logged from:
1344 * services/core/java/com/android/server/BluetoothManagerService.java
1345 */
1346message BluetoothEnabledStateChanged {
1347 repeated AttributionNode attribution_node = 1;
1348 // Whether or not bluetooth is enabled on the device.
1349 enum State {
1350 UNKNOWN = 0;
1351 ENABLED = 1;
1352 DISABLED = 2;
1353 }
1354 optional State state = 2;
1355 // The reason for being enabled/disabled.
1356 // Eg. Airplane mode, crash, application request.
1357 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1358 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001359 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001360}
1361
1362/**
Jack Hed9837c82019-01-09 01:19:13 -08001363 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001364 *
1365 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001366 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1367 *
1368 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001369 */
1370message BluetoothConnectionStateChanged {
1371 // The state of the connection.
1372 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1373 optional android.bluetooth.ConnectionStateEnum state = 1;
1374 // An identifier that can be used to match connect and disconnect events.
1375 // Currently is last two bytes of a hash of a device level ID and
1376 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001377 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1378 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001379 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1380 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001381 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001382 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001383 // An identifier that can be used to match events for this device.
1384 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1385 // Salt: Randomly generated 256 bit value
1386 // Hash algorithm: HMAC-SHA256
1387 // Size: 32 byte
1388 // Default: null or empty if the device identifier is not known
1389 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1390}
1391
1392/**
1393 * Logs when a Bluetooth device connects and disconnects over ACL
1394 *
1395 * Logged from:
1396 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1397 *
1398 * Next Tag: 3
1399 */
1400message BluetoothAclConnectionStateChanged {
1401 // An identifier that can be used to match events for this device.
1402 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1403 // Salt: Randomly generated 256 bit value
1404 // Hash algorithm: HMAC-SHA256
1405 // Size: 32 byte
1406 // Default: null or empty if the device identifier is not known
1407 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1408 // The state of the connection.
1409 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1410 optional android.bluetooth.ConnectionStateEnum state = 2;
1411}
1412
1413/**
1414 * Logs when a Bluetooth device connects and disconnects over SCO
1415 *
1416 * Logged from:
1417 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1418 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1419 *
1420 * Next Tag: 4
1421 */
1422message BluetoothScoConnectionStateChanged {
1423 // An identifier that can be used to match events for this device.
1424 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1425 // Salt: Randomly generated 256 bit value
1426 // Hash algorithm: HMAC-SHA256
1427 // Size: 32 byte
1428 // Default: null or empty if the device identifier is not known
1429 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1430 // The state of the connection.
1431 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1432 optional android.bluetooth.ConnectionStateEnum state = 2;
1433 // Codec used for this SCO connection
1434 // Default: UNKNOWN
1435 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001436}
1437
Jack Hec27040a2019-01-09 20:54:41 -08001438/**
1439 * Logged when active device of a profile changes
1440 *
1441 * Logged from:
1442 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1443 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1444 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1445 */
1446message BluetoothActiveDeviceChanged {
1447 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1448 // From android.bluetooth.BluetoothProfile
1449 optional int32 bt_profile = 1;
1450 // An identifier that can be used to match events for this new active device.
1451 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1452 // Salt: Randomly generated 256 bit value
1453 // Hash algorithm: HMAC-SHA256
1454 // Size: 32 byte
1455 // Default: null or empty if there is no active device for this profile
1456 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1457}
1458
Jack Heab86dbd22018-12-18 15:43:27 -08001459// Logs when there is an event affecting Bluetooth device's link layer connection.
1460// - This event is triggered when there is a related HCI command or event
1461// - Users of this metrics can deduce Bluetooth device's connection state from these events
1462// - HCI commands are logged before the command is sent, after receiving command status, and after
1463// receiving command complete
1464// - HCI events are logged when they arrive
1465//
1466// Low level log from system/bt
1467//
1468// Bluetooth classic commands:
1469// - CMD_CREATE_CONNECTION
1470// - CMD_DISCONNECT
1471// - CMD_CREATE_CONNECTION_CANCEL
1472// - CMD_ACCEPT_CONNECTION_REQUEST
1473// - CMD_REJECT_CONNECTION_REQUEST
1474// - CMD_SETUP_ESCO_CONNECTION
1475// - CMD_ACCEPT_ESCO_CONNECTION
1476// - CMD_REJECT_ESCO_CONNECTION
1477// - CMD_ENH_SETUP_ESCO_CONNECTION
1478// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1479//
1480// Bluetooth low energy commands:
1481// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1482// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1483// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1484// - CMD_BLE_CLEAR_WHITE_LIST
1485// - CMD_BLE_ADD_WHITE_LIST
1486// - CMD_BLE_REMOVE_WHITE_LIST
1487//
1488// Bluetooth classic events:
1489// - EVT_CONNECTION_COMP
1490// - EVT_CONNECTION_REQUEST
1491// - EVT_DISCONNECTION_COMP
1492// - EVT_ESCO_CONNECTION_COMP
1493// - EVT_ESCO_CONNECTION_CHANGED
1494//
1495// Bluetooth low energy meta events:
1496// - BLE_EVT_CONN_COMPLETE_EVT
1497// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1498//
1499// Next tag: 10
1500message BluetoothLinkLayerConnectionEvent {
1501 // An identifier that can be used to match events for this device.
1502 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1503 // Salt: Randomly generated 256 bit value
1504 // Hash algorithm: HMAC-SHA256
1505 // Size: 32 byte
1506 // Default: null or empty if the device identifier is not known
1507 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1508 // Connection handle of this connection if available
1509 // Range: 0x0000 - 0x0EFF (12 bits)
1510 // Default: 0xFFFF if the handle is unknown
1511 optional int32 connection_handle = 2;
1512 // Direction of the link
1513 // Default: DIRECTION_UNKNOWN
1514 optional android.bluetooth.DirectionEnum direction = 3;
1515 // Type of this link
1516 // Default: LINK_TYPE_UNKNOWN
1517 optional android.bluetooth.LinkTypeEnum type = 4;
1518
1519 // Reason metadata for this link layer connection event, rules for interpretation:
1520 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1521 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1522 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1523 // set and valid, ignore hci_ble_event
1524
1525 // HCI command associated with this event
1526 // Default: CMD_UNKNOWN
1527 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1528 // HCI event associated with this event
1529 // Default: EVT_UNKNOWN
1530 optional android.bluetooth.hci.EventEnum hci_event = 6;
1531 // HCI BLE meta event associated with this event
1532 // Default: BLE_EVT_UNKNOWN
1533 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1534 // HCI command status code if this is triggerred by hci_cmd
1535 // Default: STATUS_UNKNOWN
1536 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1537 // HCI reason code associated with this event
1538 // Default: STATUS_UNKNOWN
1539 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1540}
1541
Howard Roe103fe22019-01-17 16:52:16 -08001542/**
1543 * Logs when a module is rolled back by Watchdog.
1544 *
1545 * Logged from: Rollback Manager
1546 */
1547message WatchdogRollbackOccurred {
1548 enum RollbackType {
1549 UNKNOWN = 0;
1550 ROLLBACK_INITIATE = 1;
1551 ROLLBACK_SUCCESS = 2;
1552 ROLLBACK_FAILURE = 3;
1553 }
1554 optional RollbackType rollback_type = 1;
1555
1556 optional string package_name = 2;
1557
1558 optional int32 package_version_code = 3;
1559}
1560
Jack Hec27040a2019-01-09 20:54:41 -08001561/**
1562 * Logs when there is a change in Bluetooth A2DP playback state
1563 *
1564 * Logged from:
1565 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1566 */
1567message BluetoothA2dpPlaybackStateChanged {
1568 // An identifier that can be used to match events for this device.
1569 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1570 // Salt: Randomly generated 256 bit value
1571 // Hash algorithm: HMAC-SHA256
1572 // Size: 32 byte
1573 // Default: null or empty if the device identifier is not known
1574 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1575 // Current playback state
1576 // Default: PLAYBACK_STATE_UNKNOWN
1577 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1578 // Current audio coding mode
1579 // Default: AUDIO_CODING_MODE_UNKNOWN
1580 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1581}
1582
1583/**
1584 * Logs when there is a change in A2DP codec config for a particular remote device
1585 *
1586 * Logged from:
1587 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1588 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1589 */
1590message BluetoothA2dpCodecConfigChanged {
1591 // An identifier that can be used to match events for this device.
1592 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1593 // Salt: Randomly generated 256 bit value
1594 // Hash algorithm: HMAC-SHA256
1595 // Size: 32 byte
1596 // Default: null or empty if the device identifier is not known
1597 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1598 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1599 // Default SOURCE_CODEC_TYPE_INVALID
1600 optional int32 codec_type = 2;
1601 // Codec priroity, the higher the more preferred, -1 for disabled
1602 // Default: CODEC_PRIORITY_DEFAULT
1603 optional int32 codec_priority = 3;
1604 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1605 // Default: SAMPLE_RATE_NONE
1606 optional int32 sample_rate = 4;
1607 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1608 // Default: BITS_PER_SAMPLE_NONE
1609 optional int32 bits_per_sample = 5;
1610 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1611 // Default: CHANNEL_MODE_NONE
1612 optional int32 channel_mode = 6;
1613 // Codec specific values
1614 // Default 0
1615 optional int64 codec_specific_1 = 7;
1616 optional int64 codec_specific_2 = 8;
1617 optional int64 codec_specific_3 = 9;
1618 optional int64 codec_specific_4 = 10;
1619}
1620
1621/**
1622 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1623 * Each codec's capability is logged separately due to statsd restriction
1624 *
1625 * Logged from:
1626 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1627 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1628 */
1629message BluetoothA2dpCodecCapabilityChanged {
1630 // An identifier that can be used to match events for this device.
1631 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1632 // Salt: Randomly generated 256 bit value
1633 // Hash algorithm: HMAC-SHA256
1634 // Size: 32 byte
1635 // Default: null or empty if the device identifier is not known
1636 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1637 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1638 // Default SOURCE_CODEC_TYPE_INVALID
1639 optional int32 codec_type = 2;
1640 // Codec priroity, the higher the more preferred, -1 for disabled
1641 // Default: CODEC_PRIORITY_DEFAULT
1642 optional int32 codec_priority = 3;
1643 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1644 // in BluetoothCodecConfig
1645 // Default: empty and SAMPLE_RATE_NONE for individual item
1646 optional int32 sample_rate = 4;
1647 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1648 // in BluetoothCodecConfig
1649 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1650 optional int32 bits_per_sample = 5;
1651 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1652 // BluetoothCodecConfig
1653 // Default: empty and CHANNEL_MODE_NONE for individual item
1654 optional int32 channel_mode = 6;
1655 // Codec specific values
1656 // Default 0
1657 optional int64 codec_specific_1 = 7;
1658 optional int64 codec_specific_2 = 8;
1659 optional int64 codec_specific_3 = 9;
1660 optional int64 codec_specific_4 = 10;
1661}
1662
1663/**
1664 * Logs when A2DP failed to read from PCM source.
1665 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1666 *
1667 * Logged from:
1668 * system/bt
1669 */
1670message BluetoothA2dpAudioUnderrunReported {
1671 // An identifier that can be used to match events for this device.
1672 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1673 // Salt: Randomly generated 256 bit value
1674 // Hash algorithm: HMAC-SHA256
1675 // Size: 32 byte
1676 // Default: null or empty if the device identifier is not known
1677 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1678 // Encoding interval in nanoseconds
1679 // Default: 0
1680 optional int64 encoding_interval_nanos = 2;
1681 // Number of bytes of PCM data that could not be read from the source
1682 // Default: 0
1683 optional int32 num_missing_pcm_bytes = 3;
1684}
1685
1686/**
1687 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1688 * buffer queue is full and we have to drop data
1689 *
1690 * Logged from:
1691 * system/bt
1692 */
1693message BluetoothA2dpAudioOverrunReported {
1694 // An identifier that can be used to match events for this device.
1695 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1696 // Salt: Randomly generated 256 bit value
1697 // Hash algorithm: HMAC-SHA256
1698 // Size: 32 byte
1699 // Default: null or empty if the device identifier is not known
1700 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1701 // Encoding interval in nanoseconds
1702 // Default: 0
1703 optional int64 encoding_interval_nanos = 2;
1704 // Number of buffers dropped in this event
1705 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1706 // Default: 0
1707 optional int32 num_dropped_buffers = 3;
1708 // Number of encoded buffers dropped in this event
1709 // Default 0
1710 optional int32 num_dropped_encoded_frames = 4;
1711 // Number of encoded bytes dropped in this event
1712 // Default: 0
1713 optional int32 num_dropped_encoded_bytes = 5;
1714}
1715
1716/**
1717 * Logs when we receive reports regarding a device's RSSI value
1718 *
1719 * Logged from:
1720 * system/bt
1721 */
1722message BluetoothDeviceRssiReported {
1723 // An identifier that can be used to match events for this device.
1724 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1725 // Salt: Randomly generated 256 bit value
1726 // Hash algorithm: HMAC-SHA256
1727 // Size: 32 byte
1728 // Default: null or empty if the device identifier is not known
1729 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1730 // Connection handle of this connection if available
1731 // Range: 0x0000 - 0x0EFF (12 bits)
1732 // Default: 0xFFFF if the handle is unknown
1733 optional int32 connection_handle = 2;
1734 // HCI command status code if this is triggerred by hci_cmd
1735 // Default: STATUS_UNKNOWN
1736 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1737 // BR/EDR
1738 // Range: -128 ≤ N ≤ 127 (signed integer)
1739 // Units: dB
1740 // LE:
1741 // Range: -127 to 20, 127 (signed integer)
1742 // Units: dBm
1743 // Invalid when an out of range value is reported
1744 optional int32 rssi = 4;
1745}
1746
1747/**
1748 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1749 *
1750 * Logged from:
1751 * system/bt
1752 */
1753message BluetoothDeviceFailedContactCounterReported {
1754 // An identifier that can be used to match events for this device.
1755 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1756 // Salt: Randomly generated 256 bit value
1757 // Hash algorithm: HMAC-SHA256
1758 // Size: 32 byte
1759 // Default: null or empty if the device identifier is not known
1760 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1761 // Connection handle of this connection if available
1762 // Range: 0x0000 - 0x0EFF (12 bits)
1763 // Default: 0xFFFF if the handle is unknown
1764 optional int32 connection_handle = 2;
1765 // HCI command status code if this is triggerred by hci_cmd
1766 // Default: STATUS_UNKNOWN
1767 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1768 // Number of consecutive failed contacts for a connection corresponding to the Handle
1769 // Range: uint16_t, 0-0xFFFF
1770 // Default: 0xFFFFF
1771 optional int32 failed_contact_counter = 4;
1772}
1773
1774/**
1775 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1776 *
1777 * Logged from:
1778 * system/bt
1779 */
1780message BluetoothDeviceTxPowerLevelReported {
1781 // An identifier that can be used to match events for this device.
1782 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1783 // Salt: Randomly generated 256 bit value
1784 // Hash algorithm: HMAC-SHA256
1785 // Size: 32 byte
1786 // Default: null or empty if the device identifier is not known
1787 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1788 // Connection handle of this connection if available
1789 // Range: 0x0000 - 0x0EFF (12 bits)
1790 // Default: 0xFFFF if the handle is unknown
1791 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001792 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001793 // Default: STATUS_UNKNOWN
1794 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1795 // Range: -30 ≤ N ≤ 20
1796 // Units: dBm
1797 // Invalid when an out of range value is reported
1798 optional int32 transmit_power_level = 4;
1799}
Jack Heab86dbd22018-12-18 15:43:27 -08001800
Tej Singh5d991e12018-03-09 19:48:11 -08001801/**
Jack He1021a612019-01-20 21:22:46 -08001802 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1803 * receiving an HCI command from the host
1804 *
1805 * Logged from: system/bt
1806 */
1807message BluetoothHciTimeoutReported {
1808 // HCI command associated with this event
1809 // Default: CMD_UNKNOWN
1810 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1811}
1812
1813/**
1814 * Logs when we receive Bluetooth Link Quality Report event from the controller
1815 * See Android Bluetooth HCI specification for more details
1816 *
1817 * Note: all count and bytes field are counted since last event
1818 *
1819 * Logged from: system/bt
1820 */
1821message BluetoothQualityReportReported {
1822 // Quality report ID
1823 // Original type: uint8_t
1824 // Default: BQR_ID_UNKNOWN
1825 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1826 // Packet type of the connection
1827 // Original type: uint8_t
1828 // Default: BQR_PACKET_TYPE_UNKNOWN
1829 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1830 // Connection handle of the connection
1831 // Original type: uint16_t
1832 optional int32 connection_handle = 3;
1833 // Performing Role for the connection
1834 // Original type: uint8_t
1835 optional int32 connection_role = 4;
1836 // Current Transmit Power Level for the connection. This value is the same as the controller's
1837 // response to the HCI_Read_Transmit_Power_Level HCI command
1838 // Original type: uint8_t
1839 optional int32 tx_power_level = 5;
1840 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1841 // absolute receiver signal strength value
1842 // Original type: int8_t
1843 optional int32 rssi = 6;
1844 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1845 // channels used by the link currently
1846 // Original type: uint8_t
1847 optional int32 snr = 7;
1848 // Indicates the number of unused channels in AFH_channel_map
1849 // Original type: uint8_t
1850 optional int32 unused_afh_channel_count = 8;
1851 // Indicates the number of the channels which are interfered and quality is bad but are still
1852 // selected for AFH
1853 // Original type: uint8_t
1854 optional int32 afh_select_unideal_channel_count = 9;
1855 // Current Link Supervision Timeout Setting
1856 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1857 // Original type: uint16_t
1858 optional int32 lsto = 10;
1859 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1860 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1861 // 0x01 (Piconet Clock)
1862 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1863 // Original type: uint32_t
1864 optional int64 connection_piconet_clock = 11;
1865 // The count of retransmission
1866 // Original type: uint32_t
1867 optional int64 retransmission_count = 12;
1868 // The count of no RX
1869 // Original type: uint32_t
1870 optional int64 no_rx_count = 13;
1871 // The count of NAK (Negative Acknowledge)
1872 // Original type: uint32_t
1873 optional int64 nak_count = 14;
1874 // Controller timestamp of last TX ACK
1875 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1876 // Original type: uint32_t
1877 optional int64 last_tx_ack_timestamp = 15;
1878 // The count of Flow-off (STOP)
1879 // Original type: uint32_t
1880 optional int64 flow_off_count = 16;
1881 // Controller timestamp of last Flow-on (GO)
1882 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1883 // Original type: uint32_t
1884 optional int64 last_flow_on_timestamp = 17;
1885 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1886 // Original type: uint32_t
1887 optional int64 buffer_overflow_bytes = 18;
1888 // Buffer underflow count (in byte) since last event
1889 // Original type: uint32_t
1890 optional int64 buffer_underflow_bytes = 19;
1891}
1892
1893/**
1894 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1895 *
1896 * Notes:
1897 * - Each event can be partially filled as we might learn different pieces of device
1898 * information at different time
1899 * - Multiple device info events can be combined to give more complete picture
1900 * - When multiple device info events tries to describe the same information, the
1901 * later one wins
1902 *
1903 * Logged from:
1904 * packages/apps/Bluetooth
1905 */
1906message BluetoothManufacturerInfoReported {
1907 // An identifier that can be used to match events for this device.
1908 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1909 // Salt: Randomly generated 256 bit value
1910 // Hash algorithm: HMAC-SHA256
1911 // Size: 32 byte
1912 // Default: null or empty if the device identifier is not known
1913 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1914 // Where is this device info obtained from
1915 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1916 // Name of the data source
1917 // For EXTERNAL: package name of the data source
1918 // For INTERNAL: null for general case, component name otherwise
1919 optional string source_name = 3;
1920 // Name of the manufacturer of this device
1921 optional string manufacturer = 4;
1922 // Model of this device
1923 optional string model = 5;
1924 // Hardware version of this device
1925 optional string hardware_version = 6;
1926 // Software version of this device
1927 optional string software_version = 7;
1928}
1929
1930/**
1931 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1932 * device, as documented by the Bluetooth Core HCI specification
1933 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1934 * Vol 2, Part E, Page 1118
1935 *
1936 * Logged from:
1937 * system/bt
1938 */
1939message BluetoothRemoteVersionInfoReported {
1940 // Connection handle of the connection
1941 // Original type: uint16_t
1942 optional int32 connection_handle = 1;
1943 // HCI command status code
1944 // Default: STATUS_UNKNOWN
1945 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1946 // 1 byte Version of current LMP in the remote controller
1947 optional int32 lmp_version = 3;
1948 // 2 bytes LMP manufacturer code of the remote controller
1949 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1950 optional int32 lmp_manufacturer_code = 4;
1951 // 4 bytes subversion of the LMP in the remote controller
1952 optional int32 lmp_subversion = 5;
1953}
1954
1955/**
1956 * Logs when certain Bluetooth SDP attributes are discovered
1957 * Constant definitions are from:
1958 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1959 *
1960 * Current logged attributes:
1961 * - BluetoothProfileDescriptorList
1962 * - Supported Features Bitmask
1963 *
1964 * Logged from:
1965 * system/bt
1966 */
1967message BluetoothSdpAttributeReported {
1968 // An identifier that can be used to match events for this device.
1969 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1970 // Salt: Randomly generated 256 bit value
1971 // Hash algorithm: HMAC-SHA256
1972 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1973 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1974 // Original type: uint16_t
1975 optional int32 protocol_uuid = 2;
1976 // Short form UUIDs used to identify Bluetooth SDP attribute types
1977 // Original type: uint16_t
1978 optional int32 attribute_id = 3;
1979 // Attribute value for the particular attribute
1980 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1981}
1982
1983/**
1984 * Logs when bond state of a Bluetooth device changes
1985 *
1986 * Logged from:
1987 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
1988 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
1989 */
1990message BluetoothBondStateChanged {
1991 // An identifier that can be used to match events for this device.
1992 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1993 // Salt: Randomly generated 256 bit value
1994 // Hash algorithm: HMAC-SHA256
1995 // Size: 32 byte
1996 // Default: null or empty if the device identifier is not known
1997 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1998 // Preferred transport type to remote dual mode device
1999 // Default: TRANSPORT_AUTO means no preference
2000 optional android.bluetooth.TransportTypeEnum transport = 2;
2001 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2002 // Default: UNKNOWN
2003 optional android.bluetooth.DeviceTypeEnum type = 3;
2004 // Current bond state (NONE, BONDING, BONDED)
2005 // Default: BOND_STATE_UNKNOWN
2006 optional android.bluetooth.BondStateEnum bond_state = 4;
2007 // Bonding sub state
2008 // Default: BOND_SUB_STATE_UNKNOWN
2009 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2010 // Unbond Reason
2011 // Default: UNBOND_REASON_UNKNOWN
2012 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2013}
2014
2015/**
2016 * Logs there is an event related Bluetooth classic pairing
2017 *
2018 * Logged from:
2019 * system/bt
2020 */
2021message BluetoothClassicPairingEventReported {
2022 // An identifier that can be used to match events for this device.
2023 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2024 // Salt: Randomly generated 256 bit value
2025 // Hash algorithm: HMAC-SHA256
2026 // Size: 32 byte
2027 // Default: null or empty if the device identifier is not known
2028 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2029 // Connection handle of this connection if available
2030 // Range: 0x0000 - 0x0EFF (12 bits)
2031 // Default: 0xFFFF if the handle is unknown
2032 optional int32 connection_handle = 2;
2033 // HCI command associated with this event
2034 // Default: CMD_UNKNOWN
2035 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2036 // HCI event associated with this event
2037 // Default: EVT_UNKNOWN
2038 optional android.bluetooth.hci.EventEnum hci_event = 4;
2039 // HCI command status code if this is triggerred by hci_cmd
2040 // Default: STATUS_UNKNOWN
2041 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2042 // HCI reason code associated with this event
2043 // Default: STATUS_UNKNOWN
2044 optional android.bluetooth.hci.StatusEnum reason_code = 6;
2045}
2046
2047/**
2048 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2049 *
2050 * Logged from:
2051 * system/bt
2052 */
2053message BluetoothSmpPairingEventReported {
2054 // An identifier that can be used to match events for this device.
2055 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2056 // Salt: Randomly generated 256 bit value
2057 // Hash algorithm: HMAC-SHA256
2058 // Size: 32 byte
2059 // Default: null or empty if the device identifier is not known
2060 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2061 // SMP command sent or received over L2CAP
2062 // Default: CMD_UNKNOWN
2063 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2064 // Whether this command is sent or received
2065 // Default: DIRECTION_UNKNOWN
2066 optional android.bluetooth.DirectionEnum direction = 3;
2067 // SMP failure reason code
2068 // Default: PAIRING_FAIL_REASON_DEFAULT
2069 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2070}
2071
2072/**
Jack He815cdba2019-01-30 17:24:55 -08002073 * Logs when a Bluetooth socket’s connection state changed
2074 *
2075 * Logged from:
2076 * system/bt
2077 */
2078message BluetoothSocketConnectionStateChanged {
2079 // An identifier that can be used to match events for this device.
2080 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2081 // Salt: Randomly generated 256 bit value
2082 // Hash algorithm: HMAC-SHA256
2083 // Size: 32 byte
2084 // Default: null or empty if the device identifier is not known
2085 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2086 // Port of this socket
2087 // Default 0 when unknown or don't care
2088 optional int32 port = 2;
2089 // Socket type as mentioned in
2090 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2091 // Default: SOCKET_TYPE_UNKNOWN
2092 optional android.bluetooth.SocketTypeEnum type = 3;
2093 // Socket connection state
2094 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2095 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2096 // Number of bytes sent to remote device during this connection
2097 optional int64 tx_bytes = 5;
2098 // Number of bytes received from remote device during this connection
2099 optional int64 rx_bytes = 6;
2100}
2101
2102/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002103 * Logs when something is plugged into or removed from the USB-C connector.
2104 *
2105 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002106 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002107 */
2108message UsbConnectorStateChanged {
2109 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002110 STATE_DISCONNECTED = 0;
2111 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002112 }
2113 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002114 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002115 // Last active session in ms.
2116 // 0 when the port is in connected state.
2117 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002118}
2119
2120/**
2121 * Logs the reported speaker impedance.
2122 *
2123 * Logged from:
2124 * Vendor audio implementation.
2125 */
2126message SpeakerImpedanceReported {
2127 optional int32 speaker_location = 1;
2128 optional int32 impedance = 2;
2129}
2130
2131/**
2132 * Logs the report of a failed hardware.
2133 *
2134 * Logged from:
2135 * Vendor HALs.
2136 *
2137 */
2138message HardwareFailed {
2139 enum HardwareType {
2140 HARDWARE_FAILED_UNKNOWN = 0;
2141 HARDWARE_FAILED_MICROPHONE = 1;
2142 HARDWARE_FAILED_CODEC = 2;
2143 HARDWARE_FAILED_SPEAKER = 3;
2144 HARDWARE_FAILED_FINGERPRINT = 4;
2145 }
2146 optional HardwareType hardware_type = 1;
2147
Maggie White6dcd8572019-01-31 14:11:50 -08002148 /**
2149 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002150 * the same hardware_type. The specific locations are vendor defined integers,
2151 * referring to board-specific numbering schemes.
2152 */
2153 optional int32 hardware_location = 2;
2154
Maggie White6dcd8572019-01-31 14:11:50 -08002155 /**
2156 * failure_code is specific to the HardwareType of the failed hardware.
2157 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002158 */
Maggie White6dcd8572019-01-31 14:11:50 -08002159 enum HardwareErrorCode {
2160 UNKNOWN = 0;
2161 COMPLETE = 1;
2162 SPEAKER_HIGH_Z = 2;
2163 SPEAKER_SHORT = 3;
2164 FINGERPRINT_SENSOR_BROKEN = 4;
2165 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Andrew Chant28d627e2018-02-22 15:17:05 -08002166 }
2167 optional int32 failure_code = 3;
2168}
2169
2170/**
2171 * Log an event when the device has been physically dropped.
2172 * Reported from the /vendor partition.
2173 */
2174message PhysicalDropDetected {
2175 // Confidence that the event was actually a drop, 0 -> 100
2176 optional int32 confidence_pctg = 1;
2177 // Peak acceleration of the drop, in 1/1000s of a g.
2178 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002179 // Duration of freefall in ms
2180 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002181}
2182
2183/**
2184 * Log bucketed battery charge cycles.
2185 *
2186 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002187 * a given charge point. For example, if 10 cycle buckets are
2188 * initialized, bucket 1 is the lowest 1/10th of the battery,
2189 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002190 *
2191 * Logged from:
2192 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2193 */
2194message ChargeCyclesReported {
2195 optional int32 cycle_bucket_1 = 1;
2196 optional int32 cycle_bucket_2 = 2;
2197 optional int32 cycle_bucket_3 = 3;
2198 optional int32 cycle_bucket_4 = 4;
2199 optional int32 cycle_bucket_5 = 5;
2200 optional int32 cycle_bucket_6 = 6;
2201 optional int32 cycle_bucket_7 = 7;
2202 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002203 optional int32 cycle_bucket_9 = 9;
2204 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002205}
2206
2207/**
Howard Roa46b6582018-09-18 16:45:02 -07002208 * Log battery health snapshot.
2209 *
2210 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2211 * are snapshotted periodically over 24hrs.
2212 */
2213message BatteryHealthSnapshot {
2214 enum BatterySnapshotType {
2215 UNKNOWN = 0;
2216 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2217 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2218 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2219 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2220 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2221 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2222 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2223 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2224 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2225 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2226 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2227 }
2228 optional BatterySnapshotType type = 1;
2229 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002230 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002231 // Voltage Battery Voltage, in microVolts.
2232 optional int32 voltage_micro_volt = 3;
2233 // Current Battery current, in microAmps.
2234 optional int32 current_micro_amps = 4;
2235 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2236 optional int32 open_circuit_micro_volt = 5;
2237 // Resistance Battery Resistance, in microOhms.
2238 optional int32 resistance_micro_ohm = 6;
2239 // Level Battery Level, as % of full.
2240 optional int32 level_percent = 7;
2241}
2242
2243/**
2244 * Log slow I/O operations on the primary storage.
2245 */
2246message SlowIo {
2247 // Classifications of IO Operations.
2248 enum IoOperation {
2249 UNKNOWN = 0;
2250 READ = 1;
2251 WRITE = 2;
2252 UNMAP = 3;
2253 SYNC = 4;
2254 }
2255 optional IoOperation operation = 1;
2256
2257 // The number of slow IO operations of this type over 24 hours.
2258 optional int32 count = 2;
2259}
2260
2261/**
2262 * Log battery caused shutdown with the last recorded voltage.
2263 */
2264message BatteryCausedShutdown {
2265 // The last recorded battery voltage prior to shutdown.
2266 optional int32 last_recorded_micro_volt = 1;
2267}
2268
2269/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002270 * Logs the duration of a davey (jank of >=700ms) when it occurs
2271 *
2272 * Logged from:
2273 * frameworks/base/libs/hwui/JankTracker.cpp
2274 */
2275message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002276 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002277 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002278
Tej Singhbb8554a2018-01-26 11:59:14 -08002279 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002280 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002281}
2282
2283/**
Bookatze5885242017-10-24 20:10:31 -07002284 * Logs phone signal strength changes.
2285 *
2286 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002287 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002288 */
2289message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002290 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2291 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002292}
2293
Yangster4ccebea2018-10-09 17:09:02 -07002294
2295/**
2296 * Logs when the phone state, sim state or signal strength changes
2297 *
2298 * Logged from:
2299 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2300 */
2301message PhoneServiceStateChanged {
2302 optional android.telephony.ServiceStateEnum state = 1;
2303 optional android.telephony.SimStateEnum sim_state = 2;
2304 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2305}
2306
2307/**
2308 * Logs when the phone becomes on or off.
2309 *
2310 * Logged from:
2311 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2312 */
2313message PhoneStateChanged {
2314 enum State {
2315 OFF = 0;
2316 ON = 1;
2317 }
2318 optional State state = 1;
2319}
2320
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002321message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002322 optional android.stats.launcher.LauncherAction action = 1;
2323 optional android.stats.launcher.LauncherState src_state = 2;
2324 optional android.stats.launcher.LauncherState dst_state = 3;
2325 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002326 optional bool is_swipe_up_enabled = 5;
2327}
2328
David Chenc28b2bb2017-10-24 12:52:52 -07002329/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002330 * Logs when Settings UI has changed.
2331 *
2332 * Logged from:
2333 * packages/apps/Settings
2334 */
2335message SettingsUIChanged {
2336 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002337 * Where this SettingsUIChange event comes from. For example, if
2338 * it's a PAGE_VISIBLE event, where the page is opened from.
2339 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002340 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002341
2342 /**
2343 * What the UI action is.
2344 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002345 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002346
2347 /**
2348 * Where the action is happening
2349 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002350 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002351
2352 /**
2353 * What preference changed in this event.
2354 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002355 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002356
2357 /**
2358 * The new value of the changed preference.
2359 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002360 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002361}
2362
2363/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002364 * Logs basic timing information about touch events.
2365 * Reported at most every 5 minutes while device is being interacted with.
2366 *
2367 * Logged from:
2368 * frameworks/native/services/inputflinger
2369 */
2370message TouchEventReported {
2371 /**
2372 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2373 * and the standard deviation of latency between the kernel and framework
2374 * for touchscreen events. The units are microseconds.
2375 *
2376 * The number is measured as the difference between the time at which
2377 * the input event was received in the evdev driver,
2378 * and the time at which the input event was received in EventHub.
2379 */
2380 // Minimum value
2381 optional float latency_min_micros = 1;
2382 // Maximum value
2383 optional float latency_max_micros = 2;
2384 // Average value
2385 optional float latency_mean_micros = 3;
2386 // Standard deviation
2387 optional float latency_stdev_micros = 4;
2388}
2389
2390/**
David Chenc28b2bb2017-10-24 12:52:52 -07002391 * Logs that a setting was updated.
2392 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002393 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002394 * The tag and is_default allow resetting of settings to default values based on the specified
2395 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2396 */
2397message SettingChanged {
2398 // The name of the setting.
2399 optional string setting = 1;
2400
2401 // The change being imposed on this setting. May represent a number, eg "3".
2402 optional string value = 2;
2403
2404 // The new value of this setting. For most settings, this is same as value. For some settings,
2405 // value is +X or -X where X represents an element in a set. For example, if the previous value
2406 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2407 // The +/- feature is currently only used for location_providers_allowed.
2408 optional string new_value = 3;
2409
2410 // The previous value of this setting.
2411 optional string prev_value = 4;
2412
2413 // The tag used with the is_default for resetting sets of settings. This is generally null.
2414 optional string tag = 5;
2415
Bookatz90867622018-01-31 15:05:57 -08002416 // True if this setting with tag should be resettable.
2417 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002418
David Chenbd789912018-03-16 17:19:55 -07002419 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002420 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002421
2422 enum ChangeReason {
2423 UPDATED = 1; // Updated can be an insertion or an update.
2424 DELETED = 2;
2425 }
2426 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002427}
Chenjie Yub3dda412017-10-24 13:41:59 -07002428
Chenjie Yu05013b32017-11-21 10:21:41 -08002429/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002430 * Logs activity going to foreground or background
2431 *
2432 * Logged from:
2433 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2434 */
2435message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002436 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002437 optional string pkg_name = 2;
2438 optional string class_name = 3;
2439
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002440 enum State {
2441 BACKGROUND = 0;
2442 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002443 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002444 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002445}
David Chenc8a43242017-10-17 16:23:28 -07002446
2447/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002448 * Logs when a volume entered low Storage state.
2449 * Logged from:
2450 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2451 */
2452message LowStorageStateChanged {
2453 // Volume that ran out of storage.
2454 optional string volume_description = 1;
2455
2456 enum State {
2457 UNKNOWN = 0;
2458 OFF = 1;
2459 ON = 2;
2460 }
2461 optional State state = 2;
2462}
2463
2464/**
2465 * Logs when an app is downgraded.
2466 * Logged from:
2467 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2468 */
2469message AppDowngraded {
2470 optional string package_name = 1;
2471 // Size of the package (all data) before being downgraded.
2472 optional int64 size_in_bytes_before = 2;
2473 // Size of the package (all data) after being downgraded.
2474 optional int64 size_in_bytes_after = 3;
2475
2476 optional bool aggressive = 4;
2477}
2478
2479/**
2480 * Logs when an app is optimized after being downgraded.
2481 * Logged from:
2482 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2483 */
2484message AppOptimizedAfterDowngraded {
2485 optional string package_name = 1;
2486}
2487
2488/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002489 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002490 * Logged from:
2491 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2492 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002493message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002494 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002495
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002496 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002497
2498 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002499 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002500 optional string process_name = 3;
2501
2502 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002503 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002504
2505 optional string package_name = 5;
2506
2507 enum InstantApp {
2508 UNAVAILABLE = 0;
2509 FALSE = 1;
2510 TRUE = 2;
2511 }
2512 optional InstantApp is_instant_app = 6;
2513
2514 enum ForegroundState {
2515 UNKNOWN = 0;
2516 BACKGROUND = 1;
2517 FOREGROUND = 2;
2518 }
2519 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002520
2521 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002522}
David Chen9e3808c2017-11-20 17:25:34 -08002523
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002524/**
2525 * Logs when a WTF (What a Terrible Failure) happened.
2526 * Logged from:
2527 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2528 */
2529message WTFOccurred {
2530 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002531
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002532 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002533
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002534 // The name of the process.
2535 // system_server if it is not by an app
2536 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002537
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002538 // The pid if available. -1 means not available.
2539 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002540
2541 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002542}
2543
2544/**
2545 * Logs when system server reports low memory.
2546 * Logged from:
2547 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2548 */
2549message LowMemReported {
2550}
2551
2552/**
2553 * Logs when an app ANR (App Not Responding) occurs.
2554 * Logged from:
2555 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2556 */
2557message ANROccurred {
2558 optional int32 uid = 1 [(is_uid) = true];
2559
2560 optional string process_name = 2;
2561
2562 optional string short_component_name = 3;
2563
2564 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002565
2566 enum InstantApp {
2567 UNAVAILABLE = 0;
2568 FALSE = 1;
2569 TRUE = 2;
2570 }
2571 optional InstantApp is_instant_app = 5;
2572
2573 enum ForegroundState {
2574 UNKNOWN = 0;
2575 BACKGROUND = 1;
2576 FOREGROUND = 2;
2577 }
2578 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002579
2580 optional android.server.ErrorSource error_source = 7;
2581
2582 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002583}
2584
Bookatza7020bd2018-08-28 16:29:35 -07002585/**
2586 * Logs when the vibrator state changes.
2587 * Logged from:
2588 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2589 */
2590message VibratorStateChanged {
2591 repeated AttributionNode attribution_node = 1;
2592
2593 enum State {
2594 OFF = 0;
2595 ON = 1;
2596 }
2597 optional State state = 2;
2598
2599 // Duration (in milliseconds) requested to keep the vibrator on.
2600 // Only applicable for State == ON.
2601 optional int64 duration_millis = 3;
2602}
2603
David Chen0a368b22017-12-06 16:28:16 -08002604/*
2605 * Allows other apps to push events into statsd.
2606 * Logged from:
2607 * frameworks/base/core/java/android/util/StatsLog.java
2608 */
David Chen0b5c90c2018-01-25 16:51:49 -08002609message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002610 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002611 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002612
2613 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2614 optional int32 label = 2;
2615
2616 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2617 // predicates for the metrics).
2618 enum State {
2619 UNKNOWN = 0;
2620 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2621 STOP = 2;
2622 START = 3;
2623 }
2624 optional State state = 3;
2625}
2626
David Chen9e3808c2017-11-20 17:25:34 -08002627/**
Bookatz7948c872018-09-04 12:58:33 -07002628 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2629 * For example, this could be due to the user manually changing the time.
2630 *
2631 * Logged from:
2632 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2633 */
2634message WallClockTimeShifted {
2635 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2636 optional int64 wall_clock_timestamp_millis = 1;
2637}
2638
2639/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002640 * Logs when statsd detects an anomaly.
2641 *
2642 * Logged from:
2643 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2644 */
2645message AnomalyDetected {
2646 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002647 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002648
Yangster-mac94e197c2018-01-02 16:03:03 -08002649 // Id of the config whose anomaly detection alert fired.
2650 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002651
Yangster-mac94e197c2018-01-02 16:03:03 -08002652 // Id of the alert (i.e. name of the anomaly that was detected).
2653 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002654}
2655
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002656message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002657 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002658 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002659
2660 // The app package name.
2661 optional string pkg_name = 2;
2662
2663 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002664 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002665 WARM = 1;
2666 HOT = 2;
2667 COLD = 3;
2668 }
2669 // The transition type.
2670 optional TransitionType type = 3;
2671
2672 // The activity name.
2673 optional string activity_name = 4;
2674
2675 // The name of the calling app. Empty if not set.
2676 optional string calling_pkg_name = 5;
2677
2678 // Whether the app is an instant app.
2679 optional bool is_instant_app = 6;
2680
2681 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002682 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002683
Bookatz80d11a02018-01-16 10:46:35 -08002684 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002685
David Chen0b5c90c2018-01-25 16:51:49 -08002686 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002687 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002688 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002689 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002690 optional int32 bind_application_delay_millis = 11;
2691 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002692
2693 // Empty if not set.
2694 optional string launch_token = 13;
2695
Calin Juravle759fbda2018-02-20 19:52:30 +00002696 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002697 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002698
2699 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002700 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002701}
2702
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002703message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002704 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002705 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002706
2707 // The app package name.
2708 optional string pkg_name = 2;
2709
2710 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002711 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002712 WARM = 1;
2713 HOT = 2;
2714 COLD = 3;
2715 }
2716 // The transition type.
2717 optional TransitionType type = 3;
2718
2719 // The activity name.
2720 optional string activity_name = 4;
2721}
2722
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002723message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002724 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002725 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002726
2727 // The app package name.
2728 optional string pkg_name = 2;
2729
2730 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002731 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002732 WITH_BUNDLE = 1;
2733 WITHOUT_BUNDLE = 2;
2734 }
2735 // The transition type.
2736 optional TransitionType type = 3;
2737
2738 // The activity name.
2739 optional string activity_name = 4;
2740
2741 optional bool transition_process_running = 5;
2742
2743 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002744 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002745}
2746
Bookatz8fcd09a2017-12-18 13:01:10 -08002747/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002748 * Logs a picture-in-picture action
2749 * Logged from:
2750 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2751 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2752 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2753 */
2754message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002755 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002756 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002757
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002758 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002759
Chenjie Yu52cacc62017-12-08 18:11:45 -08002760 enum State {
2761 ENTERED = 1;
2762 EXPANDED_TO_FULL_SCREEN = 2;
2763 MINIMIZED = 3;
2764 DISMISSED = 4;
2765 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002766 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002767}
2768
2769/**
Chenjie Yue8904192017-12-08 19:12:57 -08002770 * Logs overlay action
2771 * Logged from:
2772 * services/core/java/com/android/server/wm/Session.java
2773 */
2774message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002775 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002776
2777 optional string package_name = 2;
2778
2779 optional bool using_alert_window = 3;
2780
2781 enum State {
2782 ENTERED = 1;
2783 EXITED = 2;
2784 }
2785 optional State state = 4;
2786}
2787
Chenjie Yuccfe6452018-01-30 11:33:21 -08002788/*
2789 * Logs foreground service starts and stops.
2790 * Note that this is not when a service starts or stops, but when it is
2791 * considered foreground.
2792 * Logged from
2793 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2794 */
2795message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002796 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002797 // package_name + "/" + class_name
2798 optional string short_name = 2;
2799
2800 enum State {
2801 ENTER = 1;
2802 EXIT = 2;
2803 }
2804 optional State state = 3;
2805}
2806
Chenjie Yue8904192017-12-08 19:12:57 -08002807/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002808 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2809 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2810 * attributed back to the parent (host) uid. One example is Chrome.
2811 *
2812 * Logged from:
2813 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2814 */
2815message IsolatedUidChanged {
2816 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002817 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002818 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002819 optional int32 parent_uid = 1;
2820
2821 optional int32 isolated_uid = 2;
2822
2823 // We expect an isolated uid to be removed before if it's used for another parent uid.
2824 enum Event {
2825 REMOVED = 0;
2826 CREATED = 1;
2827 }
2828 optional Event event = 3;
2829}
2830
2831/*
2832 * Logs the reception of an incoming network packet causing the main system to wake up for
2833 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2834 * and processed by WakeupController.cpp.
2835 */
2836message PacketWakeupOccurred {
2837 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2838 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002839 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002840 // The interface name on which the packet was received.
2841 optional string iface = 2;
2842 // The ethertype value of the packet.
2843 optional int32 ethertype = 3;
2844 // String representation of the destination MAC address of the packet.
2845 optional string destination_hardware_address = 4;
2846 // String representation of the source address of the packet if this was an IP packet.
2847 optional string source_ip = 5;
2848 // String representation of the destination address of the packet if this was an IP packet.
2849 optional string destination_ip = 6;
2850 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2851 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2852 // families.
2853 optional int32 ip_next_header = 7;
2854 // The source port if this was a TCP or UDP packet.
2855 optional int32 source_port = 8;
2856 // The destination port if this was a TCP or UDP packet.
2857 optional int32 destination_port = 9;
2858}
2859
2860/*
2861 * Logs the memory stats for an app on startup.
2862 * Logged from:
2863 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2864 */
2865message AppStartMemoryStateCaptured {
2866 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002867 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002868
2869 // The process name.
2870 optional string process_name = 2;
2871
2872 // The activity name.
2873 optional string activity_name = 3;
2874
2875 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002876 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002877
2878 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002879 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002880
2881 // RSS
2882 optional int64 rss_in_bytes = 6;
2883
2884 // CACHE
2885 optional int64 cache_in_bytes = 7;
2886
2887 // SWAP
2888 optional int64 swap_in_bytes = 8;
2889}
2890
2891/*
2892 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2893 * for LMK event.
2894 * Logged from:
2895 * system/core/lmkd/lmkd.c
2896 */
2897message LmkStateChanged {
2898 enum State {
2899 UNKNOWN = 0;
2900 START = 1;
2901 STOP = 2;
2902 }
2903 optional State state = 1;
2904}
2905
2906/*
2907 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2908 * Logged from:
2909 * system/core/lmkd/lmkd.c
2910 */
2911message LmkKillOccurred {
2912 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002913 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002914
2915 // The process name.
2916 optional string process_name = 2;
2917
2918 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002919 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002920
2921 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002922 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002923
2924 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002925 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002926
2927 // RSS
2928 optional int64 rss_in_bytes = 6;
2929
2930 // CACHE
2931 optional int64 cache_in_bytes = 7;
2932
2933 // SWAP
2934 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002935
2936 // The elapsed real time of start of the process.
2937 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002938}
2939
Rajeev Kumar51b54602018-03-01 12:18:26 -08002940/*
2941 * Logs when the ActivityManagerService detects that an app died.
2942 *
2943 * Logged from:
2944 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2945 */
2946message AppDied {
2947 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002948 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002949}
2950
Howard Ro21a039c2018-08-06 14:55:47 -07002951/**
2952 * An atom for generic metrics logging. Available from Android Q.
2953 */
2954message GenericAtom {
2955 // The uid of the application that sent this custom atom.
2956 optional int32 uid = 1 [(is_uid) = true];
2957
2958 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002959 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002960}
2961
Tej Singhd6d6d772018-09-05 17:41:25 -07002962/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002963 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002964 *
2965 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002966 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002967 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002968message BiometricAcquired {
2969 // Biometric modality that was acquired.
2970 optional android.hardware.biometrics.ModalityEnum modality = 1;
2971 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
2972 optional int32 user = 2;
2973 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
2974 optional bool is_crypto = 3;
2975 // Action that the device is performing. Acquired messages are only expected for enroll and
2976 // authenticate. Other actions may indicate an error.
2977 optional android.hardware.biometrics.ActionEnum action = 4;
2978 // The client that this acquisition was received for.
2979 optional android.hardware.biometrics.ClientEnum client = 5;
2980 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
2981 optional int32 acquire_info = 6;
2982 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
2983 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07002984}
2985
2986/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002987 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002988 *
2989 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002990 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002991 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002992message BiometricAuthenticated {
2993 // Biometric modality that was used.
2994 optional android.hardware.biometrics.ModalityEnum modality = 1;
2995 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
2996 optional int32 user = 2;
2997 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
2998 // storage.
2999 optional bool is_crypto = 3;
3000 // The client that this acquisition was received for.
3001 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003002 // If authentication requires user confirmation. See BiometricPrompt's
3003 // setRequireConfirmation(bool) method.
3004 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003005
Kevin Chyn1741a072019-01-17 11:54:40 -08003006 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003007 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003008 REJECTED = 1;
3009 PENDING_CONFIRMATION = 2;
3010 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003011 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003012
3013 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003014 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003015 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3016 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3017 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3018 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003019 optional int64 latency_millis = 7;
Kevin Chyn1741a072019-01-17 11:54:40 -08003020}
3021
3022/**
3023 * Logs when a biometric error occurs.
3024 *
3025 * Logged from:
3026 * frameworks/base/services/core/java/com/android/server/biometrics
3027 */
3028message BiometricErrorOccurred {
3029 // Biometric modality that was used.
3030 optional android.hardware.biometrics.ModalityEnum modality = 1;
3031 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3032 optional int32 user = 2;
3033 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3034 optional bool is_crypto = 3;
3035 // Action that the device is performing.
3036 optional android.hardware.biometrics.ActionEnum action = 4;
3037 // The client that this acquisition was received for.
3038 optional android.hardware.biometrics.ClientEnum client = 5;
3039 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3040 // are unique to modality.
3041 optional int32 error_info = 6;
3042 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3043 // by the vendor and not specified by the HIDL interface.
3044 optional int32 error_info_vendor = 7;
3045}
3046
3047/**
3048 * Logs when a biometric HAL has crashed.
3049 * Logged from:
3050 * frameworks/base/services/core/java/com/android/server/biometrics
3051 */
3052message BiometricHalDeathReported {
3053 // Biometric modality.
3054 optional android.hardware.biometrics.ModalityEnum modality = 1;
Tej Singhd6d6d772018-09-05 17:41:25 -07003055}
Howard Ro688ae182018-09-25 00:09:36 -07003056
3057message Notification {
3058
3059 // Type of notification event.
3060 enum Type {
3061 TYPE_UNKNOWN = 0;
3062 // Notification became visible to the user.
3063 TYPE_OPEN = 1;
3064 // Notification became hidden.
3065 TYPE_CLOSE = 2;
3066 // Notification switched to detail mode.
3067 TYPE_DETAIL = 3;
3068 // Notification was clicked.
3069 TYPE_ACTION = 4;
3070 // Notification was dismissed.
3071 TYPE_DISMISS = 5;
3072 // Notification switched to summary mode. The enum value of 14 is to
3073 // match that of metrics_constants.
3074 TYPE_COLLAPSE = 14;
3075 }
3076 optional Type type = 1;
3077
3078 // Package name associated with the notification.
3079 optional string package_name = 2;
3080
3081 // Tag associated with notification.
3082 optional string tag = 3;
3083
3084 // Application-supplied ID associated with the notification.
3085 optional int32 id = 4;
3086
3087 // Index of notification in the notification panel.
3088 optional int32 shade_index = 5;
3089
3090 // The number of notifications in the notification panel.
3091 optional int32 shade_count = 6;
3092
3093 // Importance for the notification.
3094 optional int32 importance = 7;
3095
3096 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07003097 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07003098
3099 // Importance for the notification channel.
3100 optional int32 channel_importance = 9;
3101
Howard Ro183c2bd2018-10-18 13:52:10 -07003102 // Application-supplied ID associated with the notifications group.
3103 optional string group_id = 10;
3104
Howard Ro688ae182018-09-25 00:09:36 -07003105 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07003106 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07003107
Howard Ro183c2bd2018-10-18 13:52:10 -07003108 // Reason for dismissal of a notification. This field is only meaningful for
3109 // TYPE_DISMISS events.
3110 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07003111
Howard Ro183c2bd2018-10-18 13:52:10 -07003112 // The first post time of notification, stable across updates.
3113 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07003114
Howard Ro183c2bd2018-10-18 13:52:10 -07003115 // The most recent interruption time, or the creation time if no updates.
3116 // Differs from update_millis because updates are filtered based on whether
3117 // they actually interrupted the user.
3118 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07003119
Howard Ro183c2bd2018-10-18 13:52:10 -07003120 // The most recent update time, or the creation time if no updates.
3121 optional int64 update_millis = 15;
3122
3123 // The most recent visibility event.
3124 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07003125}
3126
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003127/*
Tej Singh0d176952019-01-16 19:10:54 -08003128 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003129 */
Tej Singh0d176952019-01-16 19:10:54 -08003130message FlagFlipUpdateOccurred {
3131 // If the event is from a flag config package, specify the package name.
3132 optional string flag_flip_package_name = 1;
3133
3134 // The order id of the package
3135 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003136}
3137
3138/*
3139 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003140 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003141 */
3142message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003143 // Name of the train.
3144 optional string train_name = 1;
3145 // Version code for a "train" of packages that need to be installed atomically
3146 optional int64 train_version_code = 2;
3147 // After installation of this package, device requires a restart.
3148 optional bool requires_staging = 3;
3149 // Rollback should be enabled for this install.
3150 optional bool rollback_enabled = 4;
3151 // Requires low latency monitoring if possible.
3152 optional bool requires_low_latency_monitor = 5;
3153
Yangster-macb89807e2018-11-15 21:10:57 -08003154 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003155 UNKNOWN = 0;
3156 INSTALL_REQUESTED = 1;
3157 INSTALL_STARTED = 2;
3158 INSTALL_STAGED_NOT_READY = 3;
3159 INSTALL_STAGED_READY = 4;
3160 INSTALL_SUCCESS = 5;
3161 INSTALL_FAILURE = 6;
3162 INSTALL_CANCELLED = 7;
3163 INSTALLER_ROLLBACK_REQUESTED = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003164 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003165 optional State state = 6;
Yangster-macb89807e2018-11-15 21:10:57 -08003166}
3167
Maggie Whitefc1aa592018-11-28 21:55:23 -08003168/** Represents USB port overheat event. */
3169message UsbPortOverheatEvent {
3170 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3171 optional int32 plug_temperature_deci_c = 1;
3172
3173 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3174 optional int32 max_temperature_deci_c = 2;
3175
3176 /* Time between USB plug event and overheat threshold trip, in seconds. */
3177 optional int32 time_to_overheat_secs = 3;
3178
3179 /* Time between overheat threshold trip and hysteresis, in seconds. */
3180 optional int32 time_to_hysteresis_secs = 4;
3181
3182 /* Time between hysteresis and active mitigation ending, in seconds. */
3183 optional int32 time_to_inactive_secs = 5;
3184};
3185
Maggie White8735b852019-01-18 11:40:49 -08003186/**
3187 * Logs total effective full charge and discharge cycles on a battery.
3188 * Here are some examples of one effective cycle:
3189 * 1) the battery charges from 0% to 100% and drains back to 0%,
3190 * 2) charging from 50% to 100% and draining back to 50% twice.
3191 * Pulled from:
3192 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3193 */
3194message BatteryCycleCount {
3195 /* Number of total charge and discharge cycles on the system battery. */
3196 optional int32 cycle_count = 1;
3197}
3198
Yangster-macb89807e2018-11-15 21:10:57 -08003199/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003200 * Logs when a connection becomes available and lost.
3201 * Logged in StatsCompanionService.java
3202 */
3203message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003204 // Id of the network.
3205 optional int32 net_id = 1;
3206
3207 enum State {
3208 UNKNOWN = 0;
3209 CONNECTED = 1;
3210 DISCONNECTED = 2;
3211 }
3212 // Connected state of a network.
3213 optional State state = 2;
3214}
3215
3216/**
3217 * Logs when a service starts and stops.
3218 * Logged from:
3219 * services/core/java/com/android/server/am/ActiveServices.java
3220 */
3221message ServiceStateChanged {
3222
3223 optional int32 uid = 1 [(is_uid) = true];
3224
3225 optional string package_name = 2;
3226
3227 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003228
3229 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003230 START = 1;
3231 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003232 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003233
3234 optional State state = 4;
3235}
3236
3237/**
3238 * Logs when a service is launched.
3239 * Logged from:
3240 * services/core/java/com/android/server/am/ActiveServices.java
3241 */
3242message ServiceLaunchReported {
3243
3244 optional int32 uid = 1 [(is_uid) = true];
3245
3246 optional string package_name = 2;
3247
3248 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003249}
Howard Ro688ae182018-09-25 00:09:36 -07003250
Chenjie Yubbcbc602018-02-05 16:51:52 -08003251//////////////////////////////////////////////////////////////////////
3252// Pulled atoms below this line //
3253//////////////////////////////////////////////////////////////////////
3254
3255/**
David Chenc8a43242017-10-17 16:23:28 -07003256 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3257 *
3258 * Pulled from:
3259 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3260 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003261message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003262 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003263
3264 optional int64 rx_bytes = 2;
3265
3266 optional int64 rx_packets = 3;
3267
3268 optional int64 tx_bytes = 4;
3269
3270 optional int64 tx_packets = 5;
3271}
3272
3273/**
3274 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3275 *
3276 * Pulled from:
3277 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3278 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003279message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003280 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003281
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003282 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3283 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003284
3285 optional int64 rx_bytes = 3;
3286
3287 optional int64 rx_packets = 4;
3288
3289 optional int64 tx_bytes = 5;
3290
3291 optional int64 tx_packets = 6;
3292}
3293
3294/**
3295 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3296 *
3297 * Pulled from:
3298 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3299 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003300message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003301 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003302
3303 optional int64 rx_bytes = 2;
3304
3305 optional int64 rx_packets = 3;
3306
3307 optional int64 tx_bytes = 4;
3308
3309 optional int64 tx_packets = 5;
3310}
3311
3312/**
3313 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3314 *
3315 * Pulled from:
3316 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3317 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003318message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003319 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003320
Yao Chenc40a19d2018-03-15 16:48:25 -07003321 // 1 denotes foreground and 0 denotes background. This is called Set in
3322 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003323 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003324
3325 optional int64 rx_bytes = 3;
3326
3327 optional int64 rx_packets = 4;
3328
3329 optional int64 tx_bytes = 5;
3330
3331 optional int64 tx_packets = 6;
3332}
3333
3334/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003335 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3336 *
3337 * Pulled from:
3338 * StatsCompanionService
3339 */
3340message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003341 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003342
3343 optional int64 rx_bytes = 2;
3344
3345 optional int64 tx_bytes = 3;
3346}
3347
3348/**
David Chenc8a43242017-10-17 16:23:28 -07003349 * Pulls the kernel wakelock durations. This atom is adapted from
3350 * android/internal/os/KernelWakelockStats.java
3351 *
3352 * Pulled from:
3353 * StatsCompanionService using KernelWakelockReader.
3354 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003355message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003356 optional string name = 1;
3357
3358 optional int32 count = 2;
3359
3360 optional int32 version = 3;
3361
Yangster-maca8a30442018-10-13 23:46:34 -07003362 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003363}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003364
Chenjie Yu05013b32017-11-21 10:21:41 -08003365/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003366 * Pulls low power state information. If power.stats HAL is not available, this
3367 * includes platform and subsystem sleep state information,
3368 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3369 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003370 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003371 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003372 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3373 * as defined in:
3374 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003375 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003376message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003377 // Subsystem name
3378 optional string subsystem_name = 1;
3379 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3380 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003381 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3382 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003383 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003384 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003385 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003386 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003387 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003388}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003389
Chenjie Yu05013b32017-11-21 10:21:41 -08003390/**
Bookatz92da2832018-11-01 18:10:03 -07003391 * Pulls on-device power measurement information.
3392 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3393 * Pulled from:
3394 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3395 */
3396message OnDevicePowerMeasurement {
3397 // Name of the subsystem (to which the rail belongs).
3398 optional string subsystem_name = 1;
3399
3400 // Rail name. The rail lies within the subsystem.
3401 optional string rail_name = 2;
3402
3403 // Time (in ms since boot) at which the rail energy value was measured.
3404 // This may differ slightly from the time that statsd logs this information.
3405 optional uint64 measurement_timestamp_millis = 3;
3406
3407 // Accumulated energy used via the rail since device boot in uWs.
3408 optional uint64 energy_microwatt_secs = 4;
3409}
3410
3411/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003412 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003413 * Pulls the time the cpu spend on the frequency index. Frequency index
3414 * starts from highest to lowest. The value should be monotonically
3415 * increasing since boot. However, if there is a cpu
3416 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003417 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003418message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003419 optional uint32 cluster = 1;
3420 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003421 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003422}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003423
Chenjie Yu05013b32017-11-21 10:21:41 -08003424/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003425 * Pulls Cpu Time Per Uid.
3426 * Note that isolated process uid time should be attributed to host uids.
3427 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003428message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003429 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003430 optional uint64 user_time_micros = 2;
3431 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003432}
3433
3434/**
3435 * Pulls Cpu Time Per Uid per frequency.
3436 * Note that isolated process uid time should be attributed to host uids.
3437 * For each uid, we order the time by descending frequencies.
3438 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003439message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003440 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003441 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003442 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003443}
Hugo Benichi884970e2017-11-14 22:42:46 +09003444
Chenjie Yu05013b32017-11-21 10:21:41 -08003445/**
3446 * Pulls Wifi Controller Activity Energy Info
3447 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003448message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003449 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003450 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003451 // stack reported state
3452 // TODO: replace this with proto enum
3453 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003454 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003455 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003456 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003457 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003458 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003459 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003460 // product of current(mA), voltage(V) and time(ms)
3461 optional uint64 controller_energy_used = 6;
3462}
3463
3464/**
3465 * Pulls Modem Activity Energy Info
3466 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003467message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003468 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003469 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003470 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003471 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003472 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003473 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003474 /**
3475 * Tx power index
3476 * index 0 = tx_power < 0dBm
3477 * index 1 = 0dBm < tx_power < 5dBm
3478 * index 2 = 5dBm < tx_power < 15dBm
3479 * index 3 = 15dBm < tx_power < 20dBm
3480 * index 4 = tx_power > 20dBm
3481 */
3482 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003483 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003484 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003485 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003486 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003487 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003488 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003489 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003490 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003491 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003492 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003493 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003494 // product of current(mA), voltage(V) and time(ms)
3495 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003496}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003497
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003498/**
3499 * Pulls Bluetooth Activity Energy Info
3500 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3501 */
3502message BluetoothActivityInfo {
3503 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003504 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003505 // bluetooth stack state
3506 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003507 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003508 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003509 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003510 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003511 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003512 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003513 // product of current(mA), voltage(V) and time(ms)
3514 optional uint64 energy_used = 6;
3515}
3516
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003517/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003518 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003519 *
3520 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003521 */
3522message ProcessMemoryState {
3523 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003524 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003525
3526 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003527 // Usually package name, "system" for system server.
3528 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003529 optional string process_name = 2;
3530
Rafal Slawikda51b932018-12-13 16:31:33 +00003531 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003532 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003533
3534 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003535 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003536
3537 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003538 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003539
Rajeev Kumar90235992018-01-29 11:06:48 -08003540 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003541 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3542 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003543 optional int64 rss_in_bytes = 6;
3544
3545 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003546 // Value is read from memory.stat, field total_cache if per-app memory
3547 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003548 optional int64 cache_in_bytes = 7;
3549
3550 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003551 // Value is read from memory.stat, field total_swap if per-app memory
3552 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003553 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003554
Rafal Slawikd03ae422018-11-20 11:27:45 +00003555 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003556 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003557
3558 // Elapsed real time when the process started.
3559 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3560 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003561}
3562
3563/*
Rafal Slawik08621582018-10-15 14:53:07 +01003564 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003565 *
3566 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003567 */
3568message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003569 // The uid if available. -1 means not available.
3570 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003571
Rafal Slawikbf67d072018-10-23 11:07:54 +01003572 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003573 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003574 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003575
Rafal Slawikbf67d072018-10-23 11:07:54 +01003576 // # of page-faults
3577 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003578
Rafal Slawikbf67d072018-10-23 11:07:54 +01003579 // # of major page-faults
3580 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003581
Rafal Slawikbf67d072018-10-23 11:07:54 +01003582 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003583 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003584 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003585
Rafal Slawikd03ae422018-11-20 11:27:45 +00003586 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003587 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003588
3589 // Elapsed real time when the process started.
3590 // Value is read from /proc/PID/stat, field 22.
3591 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003592}
3593
3594/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003595 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003596 *
3597 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3598 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003599 *
3600 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003601 */
3602message ProcessMemoryHighWaterMark {
3603 // The uid if available. -1 means not available.
3604 optional int32 uid = 1 [(is_uid) = true];
3605
Rafal Slawikda51b932018-12-13 16:31:33 +00003606 // The process name.
3607 // Usually package name or process cmdline.
3608 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003609 optional string process_name = 2;
3610
3611 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3612 // /proc/PID/status.
3613 optional int64 rss_high_water_mark_in_bytes = 3;
3614}
3615
3616/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003617 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003618 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003619message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003620 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003621}
3622
3623/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003624 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003625 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003626message SystemUptime {
3627 // Milliseconds since the system was booted.
3628 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3629 // for external input).
3630 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003631 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003632}
3633
3634/*
3635 * Reads from /proc/uid_concurrent_active_time which has the format:
3636 * active: X (X is # cores)
3637 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3638 * [uid1]: [time-0] [time-1] [time-2] ... ...
3639 * ...
3640 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3641 * The file contains a monotonically increasing count of time for a single boot.
3642 */
3643message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003644 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003645 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003646}
3647
3648/**
3649 * Reads from /proc/uid_concurrent_policy_time which has the format:
3650 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3651 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3652 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3653 * ...
3654 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3655 * The file contains a monotonically increasing count of time for a single boot.
3656 */
3657message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003658 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003659 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003660 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003661}
3662
3663/*
3664 * Pulls free disk space, for data, system partition and temporary directory.
3665 */
3666message DiskSpace {
3667 // available bytes in data partition
3668 optional uint64 data_available_bytes = 1;
3669 // available bytes in system partition
3670 optional uint64 system_available_bytes = 2;
3671 // available bytes in download cache or temp directories
3672 optional uint64 temp_available_bytes = 3;
3673}
Tej Singhbf972d92018-01-10 20:51:13 -08003674
3675/**
3676 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003677 *
3678 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003679 */
3680message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003681 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003682}
3683
3684/**
3685 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003686 * Pulled from:
3687 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003688 */
3689message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003690 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003691}
3692
3693/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003694 * Pulls battery voltage.
3695 * Pulled from:
3696 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3697 */
3698message BatteryVoltage {
3699 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003700 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003701}
3702
3703/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003704 * Pulls battery level (percent full, from 0 to 100).
3705 *
3706 * Pulled from:
3707 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3708 */
3709message BatteryLevel {
3710 // Battery level. Should be in [0, 100].
3711 optional int32 battery_level = 1;
3712}
3713
3714/**
Tej Singhd89137e2018-03-26 14:51:40 -07003715 * Pulls the temperature of various parts of the device.
3716 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003717 *
3718 * Pulled from:
3719 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3720 */
3721message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003722 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003723 optional android.os.TemperatureTypeEnum sensor_location = 1;
3724
3725 // The name of the temperature source. Eg. CPU0
3726 optional string sensor_name = 2;
3727
Tej Singhd89137e2018-03-26 14:51:40 -07003728 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003729 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003730 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003731}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003732
3733/**
3734 * Pulls the statistics of calls to Binder.
3735 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003736 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3737 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003738 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003739 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003740 */
3741message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003742 // UID of the process responsible for the binder transaction. It will be set if the process
3743 // executing the binder transaction attribute the transaction to another uid using
3744 // Binder.setThreadWorkSource().
3745 //
3746 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003747 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003748 // UID of the process executing the binder transaction.
3749 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003750 // Fully qualified class name of the API call.
3751 //
3752 // This is a system server class name.
3753 //
3754 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3755 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3756 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3757 // commonly used APIs.
3758 optional string service_class_name = 2;
3759 // Method name of the API call. It can also be a transaction code if we cannot
3760 // resolve it to a name. See Binder#getTransactionName.
3761 //
3762 // This is a system server method name.
3763 optional string service_method_name = 3;
3764 // Total number of API calls.
3765 optional int64 call_count = 4;
3766 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3767 optional bool screen_interactive = 13;
3768 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3769 // call_count will be equal to recorded_call_count.
3770 //
3771 // If recorded_call_count is different than call_count, it means data collection has been
3772 // sampled. All the fields below will be sampled in this case.
3773 optional int64 recorded_call_count = 12;
3774 // Number of exceptions thrown by the API.
3775 optional int64 recorded_exception_count = 5;
3776 // Total latency of all API calls.
3777 // Average can be computed using total_latency_micros / recorded_call_count.
3778 optional int64 recorded_total_latency_micros = 6;
3779 // Maximum latency of one API call.
3780 optional int64 recorded_max_latency_micros = 7;
3781 // Total CPU usage of all API calls.
3782 // Average can be computed using total_cpu_micros / recorded_call_count.
3783 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3784 optional int64 recorded_total_cpu_micros = 8;
3785 // Maximum CPU usage of one API call.
3786 optional int64 recorded_max_cpu_micros = 9;
3787 // Maximum parcel reply size of one API call.
3788 optional int64 recorded_max_reply_size_bytes = 10;
3789 // Maximum parcel request size of one API call.
3790 optional int64 recorded_max_request_size_bytes = 11;
3791}
3792
3793/**
3794 * Pulls the statistics of exceptions during calls to Binder.
3795 *
3796 * Binder stats are cumulative from boot unless somebody reset the data using
3797 * > adb shell dumpsys binder_calls_stats --reset
3798 */
3799message BinderCallsExceptions {
3800 // Exception class name, e.g. java.lang.IllegalArgumentException.
3801 //
3802 // This is an exception class name thrown by the system server.
3803 optional string exception_class_name = 1;
3804 // Total number of exceptions.
3805 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003806}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003807
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003808/**
3809 * Pulls the statistics of message dispatching on HandlerThreads.
3810 *
3811 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3812 * config on the device.
3813 *
3814 * Next tag: 11
3815 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003816message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003817 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003818 optional int32 uid = 1 [(is_uid) = true];
3819
3820 // Fully qualified class name of the handler target class.
3821 //
3822 // This field does not contain PII. This is a system server class name.
3823 optional string handler_class_name = 2;
3824
3825 // The name of the thread that runs the Looper.
3826 //
3827 // This field does not contain PII. This is a system server thread name.
3828 optional string looper_thread_name = 3;
3829
3830 // The name of the dispatched message.
3831 //
3832 // This field does not contain PII. This is a system server constant or class
3833 // name.
3834 optional string message_name = 4;
3835
3836 // Total number of successfully dispatched messages.
3837 optional int64 message_count = 5;
3838
3839 // Total number of messages that failed dispatching.
3840 optional int64 exception_count = 6;
3841
3842 // Total number of processed messages we have data recorded for. If we
3843 // collected data for all the messages, message_count will be equal to
3844 // recorded_message_count.
3845 //
3846 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003847 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003848 optional int64 recorded_message_count = 7;
3849
3850 // Total latency of all processed messages.
3851 // Average can be computed using recorded_total_latency_micros /
3852 // recorded_message_count.
3853 optional int64 recorded_total_latency_micros = 8;
3854
3855 // Total CPU usage of all processed message.
3856 // Average can be computed using recorded_total_cpu_micros /
3857 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003858 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003859 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003860
3861 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3862 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003863
3864 // Max recorded CPU usage of all processed messages.
3865 optional int64 recorded_max_cpu_micros = 11;
3866
3867 // Max recorded latency of all processed messages.
3868 optional int64 recorded_max_latency_micros = 12;
3869
3870 // Total number of messages we tracked the dispatching delay for. If we
3871 // collected data for all the messages, message_count will be equal to
3872 // recorded_delay_message_count.
3873 //
3874 // If recorded_delay_message_count is different than message_count, it means data
3875 // collection has been sampled or/and not all messages specified the target dispatch time.
3876 // The fields below will be sampled in this case.
3877 optional int64 recorded_delay_message_count = 13;
3878
3879 // Total dispatching delay of all processed messages.
3880 // Calculated as a difference between the target dispatching time (Message.when)
3881 // and the actual dispatching time.
3882 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3883 optional int64 recorded_total_delay_millis = 14;
3884
3885 // Max dispatching delay of all processed messages.
3886 // Calculated as a difference between the target dispatching time (Message.when)
3887 // and the actual dispatching time.
3888 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003889}
Tej Singh86dc9db2018-09-06 00:39:57 +00003890
3891/**
3892 * Pulls disk information, such as write speed and latency.
3893 */
3894message DiskStats {
3895 // Time taken to open, write 512B to, and close a file.
3896 // -1 if error performing the check.
3897 optional int64 data_write_latency_millis = 1;
3898
3899 optional bool file_based_encryption = 2;
3900
3901 // Recent disk write speed in kB/s.
3902 // -1 if error querying storageed.
3903 // 0 if data is unavailable.
3904 optional int32 recent_disk_write_speed = 3;
3905}
3906
3907
3908/**
3909 * Free and total bytes of the Data, Cache, and System partition.
3910 */
3911message DirectoryUsage {
3912 enum Directory {
3913 UNKNOWN = 0;
3914 DATA = 1;
3915 CACHE = 2;
3916 SYSTEM = 3;
3917 }
3918 optional Directory directory = 1;
3919 optional int64 free_bytes = 2;
3920 optional int64 total_bytes = 3;
3921}
3922
3923
3924/**
3925 * Size of an application: apk size, data size, and cache size.
3926 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3927 * Information is only reported for apps with the primary user (user 0).
3928 * Sizes are aggregated by package name.
3929 */
3930message AppSize {
3931 // Including uids will involve modifying diskstats logic.
3932 optional string package_name = 1;
3933 // App size in bytes. -1 if unavailable.
3934 optional int64 app_size_bytes = 2;
3935 // App data size in bytes. -1 if unavailable.
3936 optional int64 app_data_size_bytes = 3;
3937 // App cache size in bytes. -1 if unavailable.
3938 optional int64 app_cache_size_bytes = 4;
3939 // Time that the cache file was produced.
3940 // Uses System.currentTimeMillis(), which is wall clock time.
3941 optional int64 cache_time_millis = 5;
3942}
3943
3944
3945/**
3946 * Size of a particular category. Eg: photos, videos.
3947 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3948 */
3949message CategorySize {
3950 enum Category {
3951 UNKNOWN = 0;
3952 APP_SIZE = 1;
3953 APP_DATA_SIZE = 2;
3954 APP_CACHE_SIZE = 3;
3955 PHOTOS = 4;
3956 VIDEOS = 5;
3957 AUDIO = 6;
3958 DOWNLOADS = 7;
3959 SYSTEM = 8;
3960 OTHER = 9;
3961 }
3962 optional Category category = 1;
3963 // Category size in bytes.
3964 optional int64 size_bytes = 2;
3965 // Time that the cache file was produced.
3966 // Uses System.currentTimeMillis(), which is wall clock time.
3967 optional int64 cache_time_millis = 3;
3968}
Tej Singhd6d6d772018-09-05 17:41:25 -07003969
3970/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003971 * Pulls per uid I/O stats. The stats are cumulative since boot.
3972 *
3973 * Read/write bytes are I/O events from a storage device
3974 * Read/write chars are data requested by read/write syscalls, and can be
3975 * satisfied by caching.
3976 *
3977 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3978 */
3979message DiskIo {
3980 optional int32 uid = 1 [(is_uid) = true];
3981 optional int64 fg_chars_read = 2;
3982 optional int64 fg_chars_write = 3;
3983 optional int64 fg_bytes_read = 4;
3984 optional int64 fg_bytes_write = 5;
3985 optional int64 bg_chars_read = 6;
3986 optional int64 bg_chars_write = 7;
3987 optional int64 bg_bytes_read = 8;
3988 optional int64 bg_bytes_write = 9;
3989 optional int64 fg_fsync = 10;
3990 optional int64 bg_fsync= 11;
3991}
3992
3993
3994/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003995 * Pulls the number of fingerprints for each user.
3996 *
Kevin Chyn1741a072019-01-17 11:54:40 -08003997 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07003998 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003999message NumBiometricsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004000 // The associated user. Eg: 0 for owners, 10+ for others.
4001 // Defined in android/os/UserHandle.java
4002 optional int32 user = 1;
4003 // Number of fingerprints registered to that user.
Kevin Chyn1741a072019-01-17 11:54:40 -08004004 optional int32 num_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004005}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004006
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004007/**
4008 * A mapping of role holder -> role
4009 */
4010message RoleHolder {
4011 // uid of the role holder
4012 optional int32 uid = 1 [(is_uid) = true];
4013
4014 // package name of the role holder
4015 optional string package_name = 2;
4016
4017 // the role held
4018 optional string role = 3;
4019}
4020
Yangsteraf9aee72018-10-12 09:26:16 -07004021message AggStats {
4022 optional int64 min = 1;
4023
4024 optional int64 average = 2;
4025
4026 optional int64 max = 3;
4027}
4028
4029message ProcessStatsStateProto {
4030 optional android.service.procstats.ScreenState screen_state = 1;
4031
4032 optional android.service.procstats.MemoryState memory_state = 2;
4033
4034 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4035 // and not frameworks/base/core/java/android/app/ActivityManager.java
4036 optional android.service.procstats.ProcessState process_state = 3;
4037
4038 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004039 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004040
4041 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004042 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004043
4044 // # of samples taken
4045 optional int32 sample_size = 5;
4046
4047 // PSS is memory reserved for this process
4048 optional AggStats pss = 6;
4049
4050 // USS is memory shared between processes, divided evenly for accounting
4051 optional AggStats uss = 7;
4052
4053 // RSS is memory resident for this process
4054 optional AggStats rss = 8;
4055}
4056
4057// Next Tag: 7
4058message ProcessStatsProto {
4059 // Name of process.
4060 optional string process = 1;
4061
4062 // Uid of the process.
4063 optional int32 uid = 2;
4064
4065 // Information about how often kills occurred
4066 message Kill {
4067 // Count of excessive CPU kills
4068 optional int32 cpu = 1;
4069
4070 // Count of kills when cached
4071 optional int32 cached = 2;
4072
4073 // PSS stats during cached kill
4074 optional AggStats cached_pss = 3;
4075 }
4076 optional Kill kill = 3;
4077
4078 // Time and memory spent in various states.
4079 repeated ProcessStatsStateProto states = 5;
4080
4081 // Total time process has been running... screen_state, memory_state, and process_state
4082 // will not be set.
4083 optional ProcessStatsStateProto total_running_state = 6;
4084}
4085
4086message PackageServiceOperationStatsProto {
4087 // Operate enum: Started, Foreground, Bound, Executing
4088 optional android.service.procstats.ServiceOperationState operation = 1;
4089
4090 // Number of times the service was in this operation.
4091 optional int32 count = 2;
4092
4093 // Information about a state the service can be in.
4094 message StateStats {
4095 // Screen state enum.
4096 optional android.service.procstats.ScreenState screen_state = 1;
4097 // Memory state enum.
4098 optional android.service.procstats.MemoryState memory_state = 2;
4099
4100 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004101 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004102 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004103 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004104 }
4105 repeated StateStats state_stats = 3;
4106}
4107
4108message PackageServiceStatsProto {
4109 // Name of service component.
4110 optional string service_name = 1;
4111
4112 // The operation stats.
4113 // The package_name, package_uid, package_version, service_name will not be set to save space.
4114 repeated PackageServiceOperationStatsProto operation_stats = 2;
4115}
4116
4117message PackageAssociationSourceProcessStatsProto {
4118 // Uid of the process.
4119 optional int32 process_uid = 1;
4120 // Process name.
4121 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004122 // Package name.
4123 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004124 // Total count of the times this association appeared.
4125 optional int32 total_count = 3;
4126
4127 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004128 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004129
4130 // Total count of the times this association became actively impacting its target process.
4131 optional int32 active_count = 5;
4132
4133 // Information on one source in this association.
4134 message StateStats {
4135 // Process state enum.
4136 optional android.service.procstats.ProcessState process_state = 1;
4137 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004138 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004139 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004140 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004141 }
4142 repeated StateStats active_state_stats = 6;
4143}
4144
4145message PackageAssociationProcessStatsProto {
4146 // Name of the target component.
4147 optional string component_name = 1;
4148 // Information on one source in this association.
4149 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4150}
4151
4152
4153message ProcessStatsPackageProto {
4154 // Name of package.
4155 optional string package = 1;
4156
4157 // Uid of the package.
4158 optional int32 uid = 2;
4159
4160 // Version of the package.
4161 optional int64 version = 3;
4162
4163 // Stats for each process running with the package loaded in to it.
4164 repeated ProcessStatsProto process_stats = 4;
4165
4166 // Stats for each of the package's services.
4167 repeated PackageServiceStatsProto service_stats = 5;
4168
4169 // Stats for each association with the package.
4170 repeated PackageAssociationProcessStatsProto association_stats = 6;
4171}
4172
4173message ProcessStatsSectionProto {
4174 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004175 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004176
4177 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004178 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004179
4180 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004181 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004182
4183 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004184 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004185
4186 // System runtime library. e.g. "libdvm.so", "libart.so".
4187 optional string runtime = 5;
4188
4189 // whether kernel reports swapped pss.
4190 optional bool has_swapped_pss = 6;
4191
4192 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4193 enum Status {
4194 STATUS_UNKNOWN = 0;
4195 STATUS_COMPLETE = 1;
4196 STATUS_PARTIAL = 2;
4197 STATUS_SHUTDOWN = 3;
4198 STATUS_SYSPROPS = 4;
4199 }
4200 repeated Status status = 7;
4201
Chenjie Yub2ecc792019-01-17 10:27:26 -08004202 // Number of pages available of various types and sizes, representation fragmentation.
4203 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4204
Yangsteraf9aee72018-10-12 09:26:16 -07004205 // Stats for each process.
4206 repeated ProcessStatsProto process_stats = 8;
4207
4208 // Stats for each package.
4209 repeated ProcessStatsPackageProto package_stats = 9;
4210}
4211
Chenjie Yub2ecc792019-01-17 10:27:26 -08004212message ProcessStatsAvailablePagesProto {
4213 // Node these pages are in (as per /proc/pagetypeinfo)
4214 optional int32 node = 1;
4215
4216 // Zone these pages are in (as per /proc/pagetypeinfo)
4217 optional string zone = 2;
4218
4219 // Label for the type of these pages (as per /proc/pagetypeinfo)
4220 optional string label = 3;
4221
4222 // Distribution of number of pages available by order size. First entry in array is
4223 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4224 repeated int32 pages_per_order = 4;
4225}
4226
Chenjie Yu12e5e672018-09-14 15:54:59 -07004227/**
4228 * Pulled from ProcessStatsService.java
4229 */
4230message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004231 optional ProcessStatsSectionProto proc_stats_section = 1;
4232}
4233
Chenjie Yuf910b7802019-01-11 16:08:20 -08004234/**
4235 * Pulled from ProcessStatsService.java
4236 */
4237message ProcStatsPkgProc {
4238 optional ProcessStatsSectionProto proc_stats_section = 1;
4239}
4240
Yangsteraf9aee72018-10-12 09:26:16 -07004241message PowerProfileProto {
4242 optional double cpu_suspend = 1;
4243
4244 optional double cpu_idle = 2;
4245
4246 optional double cpu_active = 3;
4247
4248 message CpuCluster {
4249 optional int32 id = 1;
4250 optional double cluster_power = 2;
4251 optional int32 cores = 3;
4252 repeated int64 speed = 4;
4253 repeated double core_power = 5;
4254 }
4255
4256 repeated CpuCluster cpu_cluster = 40;
4257
4258 optional double wifi_scan = 4;
4259
4260 optional double wifi_on = 5;
4261
4262 optional double wifi_active = 6;
4263
4264 optional double wifi_controller_idle = 7;
4265
4266 optional double wifi_controller_rx = 8;
4267
4268 optional double wifi_controller_tx = 9;
4269
4270 repeated double wifi_controller_tx_levels = 10;
4271
4272 optional double wifi_controller_operating_voltage = 11;
4273
4274 optional double bluetooth_controller_idle = 12;
4275
4276 optional double bluetooth_controller_rx = 13;
4277
4278 optional double bluetooth_controller_tx = 14;
4279
4280 optional double bluetooth_controller_operating_voltage = 15;
4281
4282 optional double modem_controller_sleep = 16;
4283
4284 optional double modem_controller_idle = 17;
4285
4286 optional double modem_controller_rx = 18;
4287
4288 repeated double modem_controller_tx = 19;
4289
4290 optional double modem_controller_operating_voltage = 20;
4291
4292 optional double gps_on = 21;
4293
4294 repeated double gps_signal_quality_based = 22;
4295
4296 optional double gps_operating_voltage = 23;
4297
4298 optional double bluetooth_on = 24;
4299
4300 optional double bluetooth_active = 25;
4301
4302 optional double bluetooth_at_cmd = 26;
4303
4304 optional double ambient_display = 27;
4305
4306 optional double screen_on = 28;
4307
4308 optional double radio_on = 29;
4309
4310 optional double radio_scanning = 30;
4311
4312 optional double radio_active = 31;
4313
4314 optional double screen_full = 32;
4315
4316 optional double audio = 33;
4317
4318 optional double video = 34;
4319
4320 optional double flashlight = 35;
4321
4322 optional double memory = 36;
4323
4324 optional double camera = 37;
4325
4326 optional double wifi_batched_scan = 38;
4327
4328 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004329}
Chenjie Yuab530202018-09-26 12:39:20 -07004330
4331/**
4332 * power_profile.xml and other constants for power model calculations.
4333 * Pulled from PowerProfile.java
4334 */
4335message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004336 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004337}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004338
4339/**
arangelovd5db50e2018-10-12 20:24:39 +01004340 * Logs when a user restriction was added or removed.
4341 *
4342 * Logged from:
4343 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4344 */
4345message UserRestrictionChanged {
4346 // The raw string of the user restriction as defined in UserManager.
4347 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4348 optional string restriction = 1;
4349 // Whether the restriction is enabled or disabled.
4350 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004351}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004352
4353/**
4354 * Pulls process user time and system time. Puller takes a snapshot of all pids
4355 * in the system and returns cpu stats for those that are working at the time.
4356 * Dead pids will be dropped. Kernel processes are excluded.
4357 * Min cool-down is 5 sec.
4358 */
4359message ProcessCpuTime {
4360 optional int32 uid = 1 [(is_uid) = true];
4361
4362 optional string process_name = 2;
4363 // Process cpu time in user space, cumulative from boot/process start
4364 optional int64 user_time_millis = 3;
4365 // Process cpu time in system space, cumulative from boot/process start
4366 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004367}
Misha Wagner5a51e002018-10-03 15:04:09 +01004368
4369/**
4370 * Pulls the CPU usage for each thread.
4371 *
4372 * Read from /proc/$PID/task/$TID/time_in_state files.
4373 *
4374 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4375 * time_in_state files not being present on some phones, have not been addressed. These should be
4376 * considered before a public release.
4377 */
4378message CpuTimePerThreadFreq {
4379 // UID that owns the process.
4380 optional int32 uid = 1 [(is_uid) = true];
4381 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004382 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004383 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004384 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004385 // Name of the process taken from `/proc/$PID/cmdline`.
4386 optional string process_name = 4;
4387 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4388 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004389
4390 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4391 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4392 // frequencies are given here as the alternative is sending eight separate atoms. This method
4393 // significantly reduces the amount of data created
4394 optional int32 frequency1_khz = 6;
4395 optional int32 time1_millis = 7;
4396 optional int32 frequency2_khz = 8;
4397 optional int32 time2_millis = 9;
4398 optional int32 frequency3_khz = 10;
4399 optional int32 time3_millis = 11;
4400 optional int32 frequency4_khz = 12;
4401 optional int32 time4_millis = 13;
4402 optional int32 frequency5_khz = 14;
4403 optional int32 time5_millis = 15;
4404 optional int32 frequency6_khz = 16;
4405 optional int32 time6_millis = 17;
4406 optional int32 frequency7_khz = 18;
4407 optional int32 time7_millis = 19;
4408 optional int32 frequency8_khz = 20;
4409 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004410}
Bookatz75ee6042018-11-09 12:27:37 -08004411
4412/**
Bookatz366a4432018-11-20 09:42:33 -08004413 * Pulls information about the device's build.
4414 */
4415message BuildInformation {
4416 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4417 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4418 optional string fingerprint = 1;
4419
4420 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4421 optional string brand = 2;
4422
4423 // Build.PRODUCT. The name of the overall product.
4424 optional string product = 3;
4425
4426 // Build.DEVICE. The name of the industrial design.
4427 optional string device = 4;
4428
4429 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4430 optional string version_release = 5;
4431
4432 // Build.ID. E.g. a label like "M4-rc20".
4433 optional string id = 6;
4434
4435 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4436 // represent this build.
4437 optional string version_incremental = 7;
4438
4439 // Build.TYPE. The type of build, like "user" or "eng".
4440 optional string type = 8;
4441
4442 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4443 optional string tags = 9;
4444}
4445
4446/**
Bookatz75ee6042018-11-09 12:27:37 -08004447 * Pulls on-device BatteryStats power use calculations for the overall device.
4448 */
4449message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004450 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4451 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4452 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4453 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004454}
4455
4456/**
4457 * Pulls on-device BatteryStats power use calculations broken down by uid.
4458 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4459 * that is attributed to non-uid items. They must all be included to get the total power use.
4460 */
4461message DeviceCalculatedPowerBlameUid {
4462 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4463 optional int32 uid = 1 [(is_uid) = true];
4464
Bookatz3dbc13a2018-12-21 12:16:51 -08004465 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4466 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4467 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004468}
4469
4470/**
4471 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4472 * drain type.
4473 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4474 * is attributed uids. They must all be included to get the total power use.
4475 */
4476message DeviceCalculatedPowerBlameOther {
4477 // The type of item whose power use is being reported.
4478 enum DrainType {
4479 AMBIENT_DISPLAY = 0;
4480 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4481 BLUETOOTH = 2;
4482 CAMERA = 3;
4483 // Cell-standby
4484 CELL = 4;
4485 FLASHLIGHT = 5;
4486 IDLE = 6;
4487 MEMORY = 7;
4488 // Amount that total computed drain exceeded the drain estimated using the
4489 // battery level changes and capacity.
4490 OVERCOUNTED = 8;
4491 PHONE = 9;
4492 SCREEN = 10;
4493 // Amount that total computed drain was below the drain estimated using the
4494 // battery level changes and capacity.
4495 UNACCOUNTED = 11;
4496 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4497 WIFI = 13;
4498 }
4499 optional DrainType drain_type = 1;
4500
Bookatz3dbc13a2018-12-21 12:16:51 -08004501 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4502 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4503 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004504}
arangelov4e994062018-11-13 16:12:38 +00004505
4506/**
4507 * Logs device policy features.
4508 *
4509 * Logged from:
4510 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4511 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4512 */
4513message DevicePolicyEvent {
4514 // The event id - unique for each event.
4515 optional android.stats.devicepolicy.EventId event_id = 1;
4516 // The admin package name.
4517 optional string admin_package_name = 2;
4518 // A generic integer parameter.
4519 optional int32 integer_value = 3;
4520 // A generic boolean parameter.
4521 optional bool boolean_value = 4;
4522 // A parameter specifying a time period in milliseconds.
4523 optional uint64 time_period_millis = 5;
4524 // A parameter specifying a list of package names, bundle extras or string parameters.
4525 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4526}
shawnlinea5b66b2018-11-13 15:05:29 +08004527
4528/**
4529 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4530 *
4531 * Logged from:
4532 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4533 */
4534message DocsUILaunchReported {
4535 optional android.stats.docsui.LaunchAction launch_action = 1;
4536 optional bool has_initial_uri = 2;
4537 optional android.stats.docsui.MimeType mime_type = 3;
4538 optional android.stats.docsui.Root initial_root = 4;
4539}
4540
4541/**
4542 * Logs root/app visited event in file managers/picker. Call this when the user
4543 * taps on root/app in hamburger menu.
4544 *
4545 * Logged from:
4546 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4547 */
4548message DocsUIRootVisitedReported {
4549 optional android.stats.docsui.ContextScope scope = 1;
4550 optional android.stats.docsui.Root root = 2;
4551}
4552
4553/**
4554 * Logs file operation stats. Call this when a file operation has completed.
4555 *
4556 * Logged from:
4557 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4558 */
4559message DocsUIFileOperationReported {
4560 optional android.stats.docsui.Provider provider = 1;
4561 optional android.stats.docsui.FileOperation file_op = 2;
4562}
4563
4564/**
4565 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4566 * mode.
4567 *
4568 * Logged from:
4569 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4570 */
4571message DocsUIFileOperationCopyMoveModeReported {
4572 optional android.stats.docsui.FileOperation file_op = 1;
4573 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4574}
4575
4576
4577/**
4578 * Logs file sub operation stats. Call this when a file operation has failed.
4579 *
4580 * Logged from:
4581 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4582 */
4583message DocsUIFileOperationFailureReported {
4584 optional android.stats.docsui.Authority authority = 1;
4585 optional android.stats.docsui.SubFileOperation sub_op = 2;
4586}
4587
4588/**
4589* Logs the cancellation of a file operation. Call this when a job is canceled
4590*
4591* Logged from:
4592* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4593*/
4594message DocsUIFileOperationCanceledReported {
4595 optional android.stats.docsui.FileOperation file_op = 1;
4596}
4597
4598/**
4599 * Logs startup time in milliseconds.
4600 *
4601 * Logged from:
4602 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4603 */
4604message DocsUIStartupMsReported {
4605 optional int32 startup_millis = 1;
4606}
4607
4608/**
4609 * Logs the action that was started by user.
4610 *
4611 * Logged from:
4612 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4613 */
4614message DocsUIUserActionReported {
4615 optional android.stats.docsui.UserAction action = 1;
4616}
4617
4618/**
4619 * Logs the invalid type when invalid scoped access is requested.
4620 *
4621 * Logged from:
4622 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4623 */
4624message DocsUIInvalidScopedAccessRequestReported {
4625 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004626}
Ben Murdochbab399f2018-12-06 11:01:38 +00004627
4628/**
shawnlina75e82d2019-01-07 10:31:12 +08004629 * Logs the package name that launches docsui picker mode.
4630 *
4631 * Logged from:
4632 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4633 */
4634message DocsUIPickerLaunchedFromReported {
4635 optional string package_name = 1;
4636}
4637
4638/**
4639 * Logs the search type.
4640 *
4641 * Logged from:
4642 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4643 */
4644message DocsUISearchTypeReported {
4645 optional android.stats.docsui.SearchType search_type = 1;
4646}
4647
4648/**
4649 * Logs the search mode.
4650 *
4651 * Logged from:
4652 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4653 */
4654message DocsUISearchModeReported {
4655 optional android.stats.docsui.SearchMode search_mode = 1;
4656}
4657
4658/**
4659 * Logs the pick result information.
4660 *
4661 * Logged from:
4662 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4663 */
4664message DocsUIPickResultReported {
4665 optional int32 total_action_count = 1;
4666 optional int64 duration_millis = 2;
4667 optional int32 file_count= 3;
4668 optional bool is_searching = 4;
4669 optional android.stats.docsui.Root picked_from = 5;
4670 optional android.stats.docsui.MimeType mime_type = 6;
4671 optional int32 repeatedly_pick_times = 7;
4672}
4673
4674/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004675 * Logs when an app's memory is compacted.
4676 *
4677 * Logged from:
4678 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4679 */
4680message AppCompacted {
4681 // The pid of the process being compacted.
4682 optional int32 pid = 1;
4683
4684 // The name of the process being compacted.
4685 optional string process_name = 2;
4686
4687 // The type of compaction.
4688 enum Action {
4689 UNKNOWN = 0;
4690 SOME = 1;
4691 FULL = 2;
4692 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004693 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004694
4695 // Total RSS in kilobytes consumed by the process prior to compaction.
4696 optional int64 before_rss_total_kilobytes = 4;
4697
4698 // File RSS in kilobytes consumed by the process prior to compaction.
4699 optional int64 before_rss_file_kilobytes = 5;
4700
4701 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4702 optional int64 before_rss_anon_kilobytes = 6;
4703
4704 // Swap in kilobytes consumed by the process prior to compaction.
4705 optional int64 before_swap_kilobytes = 7;
4706
4707 // Total RSS in kilobytes consumed by the process after compaction.
4708 optional int64 after_rss_total_kilobytes = 8;
4709
4710 // File RSS in kilobytes consumed by the process after compaction.
4711 optional int64 after_rss_file_kilobytes = 9;
4712
4713 // Anonymous RSS in kilobytes consumed by the process after compaction.
4714 optional int64 after_rss_anon_kilobytes = 10;
4715
4716 // Swap in kilobytes consumed by the process after compaction.
4717 optional int64 after_swap_kilobytes = 11;
4718
4719 // The time taken to perform compaction in milliseconds.
4720 optional int64 time_to_compact_millis = 12;
4721
4722 // The last compaction action performed for this app.
4723 optional Action last_action = 13;
4724
Ben Murdoch01720b82018-12-19 18:03:44 +00004725 // The last time that compaction was attempted on this process in milliseconds
4726 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4727 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004728
Ben Murdoch01720b82018-12-19 18:03:44 +00004729 // The oom_score_adj at the time of compaction.
4730 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004731
4732 // The process state at the time of compaction.
4733 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
4734}
lifr157fc552018-12-12 16:38:04 +08004735
4736/**
4737 * Logs the latency period(in microseconds) and the return code of
4738 * the DNS(Domain Name System) lookups.
4739 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4740 * to get info(address or hostname) from DNS server(or DNS cache).
4741 * Logged from:
4742 * /system/netd/server/DnsProxyListener.cpp
4743 */
4744message NetworkDnsEventReported {
4745 // The types of the DNS lookups, as defined in
4746 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4747 enum EventType {
4748 EVENT_UNKNOWN = 0;
4749 EVENT_GETADDRINFO = 1;
4750 EVENT_GETHOSTBYNAME = 2;
4751 EVENT_GETHOSTBYADDR = 3;
4752 EVENT_RES_NSEND = 4;
4753 }
4754 optional EventType event_type = 1;
4755
4756 // The return value of the DNS resolver for each DNS lookups.
4757 //bionic/libc/include/netdb.h
4758 //system/netd/resolv/include/netd_resolv/resolv.h
4759 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004760 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004761 EAI_ADDRFAMILY = 1;
4762 EAI_AGAIN = 2;
4763 EAI_BADFLAGS = 3;
4764 EAI_FAIL = 4;
4765 EAI_FAMILY = 5;
4766 EAI_MEMORY = 6;
4767 EAI_NODATA = 7;
4768 EAI_NONAME = 8;
4769 EAI_SERVICE = 9;
4770 EAI_SOCKTYPE = 10;
4771 EAI_SYSTEM = 11;
4772 EAI_BADHINTS = 12;
4773 EAI_PROTOCOL = 13;
4774 EAI_OVERFLOW = 14;
4775 RESOLV_TIMEOUT = 255;
4776 EAI_MAX = 256;
4777 }
4778 optional ReturnCode return_code = 2;
4779
4780 // The latency period(in microseconds) it took for this DNS lookup to complete.
4781 optional int32 latency_micros = 3;
4782}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004783
4784/**
4785 * Logs when a data stall event occurs.
4786 *
4787 * Log from:
4788 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4789 */
4790message DataStallEvent {
4791 // Data stall evaluation type.
4792 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4793 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4794 optional int32 evaluation_type = 1;
4795 // See definition in data_stall_event.proto.
4796 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4797 // See definition in data_stall_event.proto.
4798 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4799 // See definition in data_stall_event.proto.
4800 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4801 // See definition in data_stall_event.proto.
4802 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4803 // See definition in data_stall_event.proto.
4804 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4805}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004806
4807/*
4808 * Logs when RescueParty resets some set of experiment flags.
4809 *
4810 * Logged from:
4811 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4812 */
4813message RescuePartyResetReported {
4814 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4815 optional int32 rescue_level = 1;
4816}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004817
4818/**
4819 * Logs when signed config is received from an APK, and if that config was applied successfully.
4820 * Logged from:
4821 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4822 */
4823message SignedConfigReported {
4824 enum Type {
4825 UNKNOWN_TYPE = 0;
4826 GLOBAL_SETTINGS = 1;
4827 }
4828 optional Type type = 1;
4829
4830 // The final status of the signed config received.
4831 enum Status {
4832 UNKNOWN_STATUS = 0;
4833 APPLIED = 1;
4834 BASE64_FAILURE_CONFIG = 2;
4835 BASE64_FAILURE_SIGNATURE = 3;
4836 SECURITY_EXCEPTION = 4;
4837 INVALID_CONFIG = 5;
4838 OLD_CONFIG = 6;
4839 SIGNATURE_CHECK_FAILED = 7;
4840 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004841 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004842 }
4843 optional Status status = 2;
4844
4845 // The version of the signed config processed.
4846 optional int32 version = 3;
4847
4848 // The package name that the config was extracted from.
4849 optional string from_package = 4;
4850
4851 enum Key {
4852 NO_KEY = 0;
4853 DEBUG = 1;
4854 PRODUCTION = 2;
4855 }
4856 // Which key was used to verify the config.
4857 optional Key verified_with = 5;
4858}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004859
4860/*
4861 * Logs GNSS Network-Initiated (NI) location events.
4862 *
4863 * Logged from:
4864 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4865 */
4866message GnssNiEventReported {
4867 // The type of GnssNiEvent.
4868 enum EventType {
4869 UNKNOWN = 0;
4870 NI_REQUEST = 1;
4871 NI_RESPONSE = 2;
4872 }
4873 optional EventType event_type = 1;
4874
4875 // An ID generated by HAL to associate NI notifications and UI responses.
4876 optional int32 notification_id = 2;
4877
4878 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004879 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004880
4881 // NI requires notification.
4882 optional bool need_notify = 4;
4883
4884 // NI requires verification.
4885 optional bool need_verify = 5;
4886
4887 // NI requires privacy override, no notification/minimal trace.
4888 optional bool privacy_override = 6;
4889
4890 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4891 // seconds.
4892 optional int32 timeout = 7;
4893
4894 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004895 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004896
4897 // String representing the requester of the network inititated location request.
4898 optional string requestor_id = 9;
4899
4900 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4901 // network initiated location request.
4902 optional string text = 10;
4903
4904 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004905 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004906
4907 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004908 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004909
4910 // True if SUPL ES is enabled.
4911 optional bool is_supl_es_enabled = 13;
4912
4913 // True if GNSS location is enabled.
4914 optional bool is_location_enabled = 14;
4915
4916 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004917 optional android.server.location.GnssUserResponseType user_response = 15;
4918}
4919
4920/**
4921 * Logs GNSS non-framework (NFW) location notification.
4922 *
4923 * Logged from:
4924 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4925 */
4926message GnssNfwNotificationReported {
4927 // Package name of the Android proxy application representing the non-framework entity that
4928 // requested location. Set to empty string if unknown.
4929 optional string proxy_app_package_name = 1;
4930
4931 // Protocol stack that initiated the non-framework location request.
4932 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4933
4934 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
4935 // set to empty string. This field is opaque to the framework and used for logging purposes.
4936 optional string other_protocol_stack_name = 3;
4937
4938 // Source initiating/receiving the location information.
4939 optional android.server.location.NfwRequestor requestor = 4;
4940
4941 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
4942 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
4943 // and used for logging purposes.
4944 optional string requestor_id = 5;
4945
4946 // Indicates whether location information was provided for this request.
4947 optional android.server.location.NfwResponseType response_type = 6;
4948
4949 // True if the device is in user initiated emergency session.
4950 optional bool in_emergency_mode = 7;
4951
4952 // True if cached location is provided.
4953 optional bool is_cached_location = 8;
4954
4955 // True if proxy app permission mismatch between framework and GNSS HAL.
4956 optional bool is_permission_mismatched = 9;
4957}
4958
4959/**
4960 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
4961 *
4962 * Logged from:
4963 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
4964 */
4965message GnssConfigurationReported {
4966 // SUPL host name.
4967 optional string supl_host = 1;
4968
4969 // SUPL port number.
4970 optional int32 supl_port = 2;
4971
4972 // C2K host name.
4973 optional string c2k_host = 3;
4974
4975 // C2K port number.
4976 optional int32 c2k_port = 4;
4977
4978 // The SUPL version requested by Carrier.
4979 optional int32 supl_ver = 5;
4980
4981 // The SUPL mode.
4982 optional android.server.location.SuplMode supl_mode = 6;
4983
4984 // True if NI emergency SUPL restrictions is enabled.
4985 optional bool supl_es = 7;
4986
4987 // LTE Positioning Profile settings
4988 optional android.server.location.LppProfile lpp_profile = 8;
4989
4990 // Positioning protocol on A-Glonass system.
4991 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
4992
4993 // True if emergency PDN is used. Otherwise, regular PDN is used.
4994 optional bool use_emergency_pdn_for_emergency_supl= 10;
4995
4996 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
4997 optional android.server.location.GpsLock gps_lock = 11;
4998
4999 // Number of seconds to extend the emergency session duration post emergency call.
5000 optional int32 es_extension_sec = 12;
5001
5002 // The full list of package names of proxy Android applications representing the non-framework
5003 // location access entities (on/off the device) for which the framework user has granted
5004 // non-framework location access permission. The package names are concatenated in one string
5005 // with spaces as separators.
5006 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005007}
Jack Yu95b64f32018-12-13 18:26:11 +08005008
5009/**
5010 * Logs when a NFC device's error occurred.
5011 * Logged from:
5012 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5013 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5014 */
5015message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005016 enum Type {
5017 UNKNOWN = 0;
5018 CMD_TIMEOUT = 1;
5019 ERROR_NOTIFICATION = 2;
5020 AID_OVERFLOW = 3;
5021 }
5022 optional Type type = 1;
5023 // If it's nci cmd timeout, log the timeout command.
5024 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005025
Alex Salod7c3eef2019-01-25 14:43:27 -08005026 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005027}
5028
5029/**
5030 * Logs when a NFC device's state changed event
5031 * Logged from:
5032 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5033 */
5034message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005035 enum State {
5036 UNKNOWN = 0;
5037 OFF = 1;
5038 ON = 2;
5039 ON_LOCKED = 3; // Secure Nfc enabled.
5040 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5041 }
5042 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005043}
5044
5045/**
5046 * Logs when a NFC Beam Transaction occurred.
5047 * Logged from:
5048 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5049 */
5050message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005051 enum Operation {
5052 UNKNOWN = 0;
5053 SEND = 1;
5054 RECEIVE = 2;
5055 }
5056 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005057}
5058
5059/**
5060 * Logs when a NFC Card Emulation Transaction occurred.
5061 * Logged from:
5062 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5063 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5064 */
5065message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005066 enum Category {
5067 UNKNOWN = 0;
5068 HCE_PAYMENT = 1;
5069 HCE_OTHER = 2;
5070 OFFHOST = 3;
5071 }
5072 // Transaction belongs to HCE payment or HCE other category, or offhost.
5073 optional Category category = 1;
5074 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5075 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005076}
5077
5078/**
5079 * Logs when a NFC Tag event occurred.
5080 * Logged from:
5081 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5082 */
5083message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005084 enum Type {
5085 UNKNOWN = 0;
5086 URL = 1;
5087 BT_PAIRING = 2;
5088 PROVISION = 3;
5089 WIFI_CONNECT = 4;
5090 APP_LAUNCH = 5;
5091 OTHERS = 6;
5092 }
5093 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005094}
5095
5096/**
5097 * Logs when Hce transaction triggered
5098 * Logged from:
5099 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5100 */
5101message NfcHceTransactionOccurred {
5102 // The latency period(in microseconds) it took for the first HCE data
5103 // exchange.
5104 optional uint32 latency_micros = 1;
5105}
5106
5107/**
5108 * Logs when SecureElement state event changed
5109 * Logged from:
5110 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5111 */
5112message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005113 enum State {
5114 UNKNOWN = 0;
5115 INITIALIZED = 1;
5116 DISCONNECTED = 2;
5117 CONNECTED = 3;
5118 HALCRASH = 4;
5119 }
5120 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005121
Alex Salod7c3eef2019-01-25 14:43:27 -08005122 optional string state_change_reason = 2;
5123 // SIMx or eSEx.
5124 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005125}
5126
5127/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005128 * Information about a permission grant request
5129 */
5130message PermissionGrantRequestResultReported {
5131 // unique value identifying an API call. A API call might result in multiple of these atoms
5132 optional int64 request_id = 1;
5133
5134 // UID of package requesting the permission grant
5135 optional int32 requesting_uid = 2 [(is_uid) = true];
5136
5137 // Name of package requesting the permission grant
5138 optional string requesting_package_name = 3;
5139
5140 // The permission to be granted
5141 optional string permission_name = 4;
5142
5143 // If the permission was explicitly requested via the API or added by the system
5144 optional bool is_implicit = 5;
5145
5146 enum Result {
5147 UNDEFINED = 0;
5148 // permission request was ignored
5149 IGNORED = 1;
5150 // permission request was ignored because it was user fixed
5151 IGNORED_USER_FIXED = 2;
5152 // permission request was ignored because it was policy fixed
5153 IGNORED_POLICY_FIXED = 3;
5154 // permission was granted by user action
5155 USER_GRANTED = 4;
5156 // permission was automatically granted
5157 AUTO_GRANTED = 5;
5158 // permission was denied by user action
5159 USER_DENIED = 6;
5160 // permission was denied with prejudice by the user
5161 USER_DENIED_WITH_PREJUDICE = 7;
5162 // permission was automatically denied
5163 AUTO_DENIED = 8;
5164 }
5165 // The result of the permission grant
5166 optional Result result = 6;
5167}
5168
5169/**
Jack Yu95b64f32018-12-13 18:26:11 +08005170 * Logs when Omapi API used
5171 * Logged from:
5172 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5173 */
5174message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005175 enum Operation {
5176 UNKNOWN = 0;
5177 OPEN_CHANNEL = 1;
5178 }
5179 optional Operation operation = 1;
5180 // SIMx or eSEx.
5181 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005182
Alex Salod7c3eef2019-01-25 14:43:27 -08005183 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005184}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005185
5186/**
Alex Saloa060aee2019-01-21 14:36:41 -08005187 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5188 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005189 * Logged from:
5190 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5191 */
5192message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005193 optional int64 dispatch_latency_millis = 1;
5194}
5195
5196/**
5197 * Logs AttentionManagerService attention check result.
5198 *
5199 * Logged from:
5200 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5201 */
5202message AttentionManagerServiceResultReported {
5203 // See core/java/android/service/attention/AttentionService.java
5204 enum AttentionCheckResult {
5205 UNKNOWN = 20;
5206 ATTENTION_SUCCESS_ABSENT = 0;
5207 ATTENTION_SUCCESS_PRESENT = 1;
5208 ATTENTION_FAILURE_PREEMPTED = 2;
5209 ATTENTION_FAILURE_TIMED_OUT = 3;
5210 ATTENTION_FAILURE_UNKNOWN = 4;
5211 }
5212 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005213}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005214
5215/**
5216 * Logs when an adb connection changes state.
5217 *
5218 * Logged from:
5219 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5220 */
5221message AdbConnectionChanged {
5222 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5223 // previously selected for this system.
5224 optional int64 last_connection_time_millis = 1;
5225
5226 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5227 // to reconnect via adb without user interaction.
5228 optional int64 auth_window_millis = 2;
5229
5230 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5231 optional android.debug.AdbConnectionStateEnum state = 3;
5232
5233 // True if the 'always allow' option was selected for this system.
5234 optional bool always_allow = 4;
5235}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005236
5237/*
5238 * Logs the reported speech DSP status.
5239 *
5240 * Logged from:
5241 * Vendor audio implementation.
5242 */
5243message SpeechDspStatReported {
5244 // The total Speech DSP uptime in milliseconds.
5245 optional int32 total_uptime_millis = 1;
5246 // The total Speech DSP downtime in milliseconds.
5247 optional int32 total_downtime_millis = 2;
5248 optional int32 total_crash_count = 3;
5249 optional int32 total_recover_count = 4;
5250}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005251
5252/**
5253 * Logs USB connector contaminant status.
5254 *
5255 * Logged from: USB Service.
5256 */
5257message UsbContaminantReported {
5258 optional string id = 1;
5259 optional android.service.usb.ContaminantPresenceStatus status = 2;
5260}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005261
5262/**
5263 * This atom is for debugging purpose.
5264 */
5265message DebugElapsedClock {
5266 // Monotically increasing value for each pull.
5267 optional int64 pull_count = 1;
5268 // Time from System.elapsedRealtime.
5269 optional int64 elapsed_clock_millis = 2;
5270 // Time from System.elapsedRealtime.
5271 optional int64 same_elapsed_clock_millis = 3;
5272 // Diff between current elapsed time and elapsed time from previous pull.
5273 optional int64 elapsed_clock_diff_millis = 4;
5274
5275 enum Type {
5276 TYPE_UNKNOWN = 0;
5277 ALWAYS_PRESENT = 1;
5278 PRESENT_ON_ODD_PULLS = 2;
5279 }
5280 // Type of behavior for the pulled data.
5281 optional Type type = 5;
5282}
5283
5284/**
5285 * This atom is for debugging purpose.
5286 */
5287message DebugFailingElapsedClock {
5288 // Monotically increasing value for each pull.
5289 optional int64 pull_count = 1;
5290 // Time from System.elapsedRealtime.
5291 optional int64 elapsed_clock_millis = 2;
5292 // Time from System.elapsedRealtime.
5293 optional int64 same_elapsed_clock_millis = 3;
5294 // Diff between current elapsed time and elapsed time from previous pull.
5295 optional int64 elapsed_clock_diff_millis = 4;
5296}
Steven Wuacef6bb2019-01-23 14:21:17 -05005297
5298/** Logs System UI bubbles event changed.
5299 *
5300 * Logged from:
5301 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5302 */
5303message BubbleUIChanged {
5304
5305 // The app package that is posting the bubble.
5306 optional string package_name = 1;
5307
5308 // The notification channel that is posting the bubble.
5309 optional string notification_channel = 2;
5310
5311 // The notification id associated with the posted bubble.
5312 optional int32 notification_id = 3;
5313
5314 // The position of the bubble within the bubble stack.
5315 optional int32 position = 4;
5316
5317 // The total number of bubbles within the bubble stack.
5318 optional int32 total_number = 5;
5319
5320 // User interactions with the bubble.
5321 enum Action {
5322 UNKNOWN = 0;
5323 POSTED = 1;
5324 UPDATED = 2;
5325 EXPANDED = 3;
5326 COLLAPSED = 4;
5327 DISMISSED = 5;
5328 STACK_DISMISSED = 6;
5329 STACK_MOVED = 7;
5330 HEADER_GO_TO_APP = 8;
5331 HEADER_GO_TO_SETTINGS = 9;
5332 PERMISSION_OPT_IN = 10;
5333 PERMISSION_OPT_OUT = 11;
5334 PERMISSION_IGNORED = 12;
5335 SWIPE_LEFT = 13;
5336 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005337 STACK_EXPANDED = 15;
Steven Wuacef6bb2019-01-23 14:21:17 -05005338 }
5339 optional Action action = 6;
5340
5341 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5342 optional float normalized_x_position = 7;
5343 optional float normalized_y_position = 8;
5344}
Kweku Adams8845d012018-12-11 20:06:45 -08005345
5346/**
5347 * Logs that a constraint for a scheduled job has changed.
5348 *
5349 * Logged from:
5350 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5351 */
5352message ScheduledJobConstraintChanged {
5353 repeated AttributionNode attribution_node = 1;
5354
5355 // Name of the job.
5356 optional string job_name = 2;
5357
5358 optional com.android.server.job.ConstraintEnum constraint = 3;
5359
5360 enum State {
5361 UNSATISFIED = 0;
5362 SATISFIED = 1;
5363 }
5364 optional State state = 4;
5365}
Alex Salod7c3eef2019-01-25 14:43:27 -08005366
5367/**
5368 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5369 * returns true.
5370 *
5371 * Logged from:
5372 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5373 */
5374message ScreenTimeoutExtensionReported {
5375 // Describes how many times in a row did the power manager reset the screen off timeout.
5376 optional uint32 consecutive_timeout_extended_count = 1;
5377}
Hui Yu885aca12019-01-10 17:11:34 -08005378
5379/*
5380* Logs number of milliseconds it takes to start a process.
5381* The definition of app process start time is from the app launch time to
5382* the time that Zygote finished forking the app process and loaded the
5383* application package's java classes.
5384
5385* This metric is different from AppStartOccurred which is for foreground
5386* activity only.
5387
5388* ProcessStartTime can report all processes (both foreground and background)
5389* start time.
5390*
5391* Logged from:
5392* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5393*/
5394message ProcessStartTime {
5395 // The uid of the ProcessRecord.
5396 optional int32 uid = 1 [(is_uid) = true];
5397
5398 // The process pid.
5399 optional int32 pid = 2;
5400
5401 // The process name.
5402 // Usually package name, "system" for system server.
5403 // Provided by ActivityManagerService.
5404 optional string process_name = 3;
5405
5406 enum StartType {
5407 UNKNOWN = 0;
5408 WARM = 1;
5409 HOT = 2;
5410 COLD = 3;
5411 }
5412
5413 // The start type.
5414 optional StartType type = 4;
5415
5416 // The elapsed realtime at the start of the process.
5417 optional int64 process_start_time_millis = 5;
5418
5419 // Number of milliseconds it takes to reach bind application.
5420 optional int32 bind_application_delay_millis = 6;
5421
5422 // Number of milliseconds it takes to finish start of the process.
5423 optional int32 process_start_delay_millis = 7;
5424
5425 // hostingType field in ProcessRecord, the component type such as "activity",
5426 // "service", "content provider", "broadcast" or other strings.
5427 optional string hosting_type = 8;
5428
5429 // hostingNameStr field in ProcessRecord. The component class name that runs
5430 // in this process.
5431 optional string hosting_name = 9;
5432}
5433
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005434/**
5435 * State of a dangerous permission requested by a package
5436 */
5437message DangerousPermissionState {
5438 // Name of the permission
5439 optional string permission_name = 1;
5440
5441 // Uid of the package
5442 optional int32 uid = 2 [(is_uid) = true];
5443
5444 // Package requesting the permission
5445 optional string package_name = 3;
5446
5447 // If the permission is granted to the uid
5448 optional bool is_granted = 4;
5449}
5450
Michael Groover4a0ca942019-01-24 17:41:25 -08005451/**
5452 * Logs when a package is denied access to a device identifier based on the new access requirements.
5453 *
5454 * Logged from:
5455 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
5456 */
5457message DeviceIdentifierAccessDenied {
5458 // The name of the package denied access to the requested device identifier.
5459 optional string package_name = 1;
5460
5461 // The name of the device identifier method the package attempted to invoke.
5462 optional string method_name = 2;
5463
5464 // True if the package is preinstalled.
5465 optional bool is_preinstalled = 3;
5466
5467 // True if the package is privileged.
5468 optional bool is_priv_app = 4;
5469}